Skip to content

Commit

Permalink
docs: explain the parse extension precondition
Browse files Browse the repository at this point in the history
  • Loading branch information
vohoanglong0107 committed May 21, 2024
1 parent 865a097 commit 61744b6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ pub(crate) fn parse_object_type_definition(p: &mut GraphqlParser) -> ParsedSynta
Present(m.complete(p, GRAPHQL_OBJECT_TYPE_DEFINITION))
}

/// Must only be called if the next 2 token is `extend` and `type`, otherwise it will panic.
#[inline]
pub(crate) fn parse_object_type_extension(p: &mut GraphqlParser) -> ParsedSyntax {
let m = p.start();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ pub(crate) fn parse_scalar_type_definition(p: &mut GraphqlParser) -> ParsedSynta
Present(m.complete(p, GRAPHQL_SCALAR_TYPE_DEFINITION))
}

/// Must only be called if the next 2 token is `extend` and `scalar`, otherwise it will panic.
#[inline]
pub(crate) fn parse_scalar_type_extension(p: &mut GraphqlParser) -> ParsedSyntax {
let m = p.start();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ pub(crate) fn parse_schema_definition(p: &mut GraphqlParser) -> ParsedSyntax {
Present(m.complete(p, GRAPHQL_SCHEMA_DEFINITION))
}

/// Must only be called if the next 2 token is `extend` and `schema`, otherwise it will panic.
#[inline]
pub(crate) fn parse_schema_extension(p: &mut GraphqlParser) -> ParsedSyntax {
let m = p.start();
Expand Down

0 comments on commit 61744b6

Please sign in to comment.