Skip to content

Commit

Permalink
style: convert to code blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
saihaj committed Jun 14, 2021
1 parent 6305b00 commit 6b31543
Showing 1 changed file with 41 additions and 11 deletions.
52 changes: 41 additions & 11 deletions src/language/parser.ts
Expand Up @@ -203,7 +203,9 @@ export class Parser {
// Implements the parsing rules in the Document section.

/**
* ```
* Document : Definition+
* ```
*/
parseDocument(): DocumentNode {
return this.node<DocumentNode>(this._lexer.token, {
Expand All @@ -217,6 +219,7 @@ export class Parser {
}

/**
* ```
* Definition :
* - ExecutableDefinition
* - TypeSystemDefinition
Expand All @@ -225,6 +228,7 @@ export class Parser {
* ExecutableDefinition :
* - OperationDefinition
* - FragmentDefinition
* ```
*/
parseDefinition(): DefinitionNode {
if (this.peek(TokenKind.NAME)) {
Expand Down Expand Up @@ -259,9 +263,11 @@ export class Parser {
// Implements the parsing rules in the Operations section.

/**
* ```
* OperationDefinition :
* - SelectionSet
* - OperationType Name? VariableDefinitions? Directives? SelectionSet
* ```
*/
parseOperationDefinition(): OperationDefinitionNode {
const start = this._lexer.token;
Expand Down Expand Up @@ -291,7 +297,9 @@ export class Parser {
}

/**
* ```
* OperationType : one of query mutation subscription
* ```
*/
parseOperationType(): OperationTypeNode {
const operationToken = this.expectToken(TokenKind.NAME);
Expand All @@ -308,7 +316,9 @@ export class Parser {
}

/**
* ```
* VariableDefinitions : ( VariableDefinition+ )
* ```
*/
parseVariableDefinitions(): Array<VariableDefinitionNode> {
return this.optionalMany(
Expand All @@ -319,7 +329,9 @@ export class Parser {
}

/**
* ```
* VariableDefinition : Variable : Type DefaultValue? Directives[Const]?
* ```
*/
parseVariableDefinition(): VariableDefinitionNode {
return this.node<VariableDefinitionNode>(this._lexer.token, {
Expand All @@ -346,7 +358,9 @@ export class Parser {
}

/**
* SelectionSet : `{ Selection+ }`
* ```
* SelectionSet : { Selection+ }
* ```
*/
parseSelectionSet(): SelectionSetNode {
return this.node<SelectionSetNode>(this._lexer.token, {
Expand Down Expand Up @@ -616,9 +630,11 @@ export class Parser {
}

/**
* ```
* ObjectValue[Const] :
* - `{ }`
* - `{ ObjectField[?Const]+ }`
* - { }
* - { ObjectField[?Const]+ }
* ```
*/
parseObject(isConst: true): ConstObjectValueNode;
parseObject(isConst: boolean): ObjectValueNode;
Expand Down Expand Up @@ -666,7 +682,9 @@ export class Parser {
}

/**
* Directive[Const] : `@ Name Arguments[?Const]?`
* ```
* Directive[Const] : @ Name Arguments[?Const]?
* ```
*/
parseDirective(isConst: true): ConstDirectiveNode;
parseDirective(isConst: boolean): DirectiveNode;
Expand Down Expand Up @@ -782,7 +800,9 @@ export class Parser {
}

/**
* SchemaDefinition : `Description? schema Directives[Const]? { OperationTypeDefinition+ }`
* ```
* SchemaDefinition : Description? schema Directives[Const]? { OperationTypeDefinition+ }
* ```
*/
parseSchemaDefinition(): SchemaDefinitionNode {
const start = this._lexer.token;
Expand Down Expand Up @@ -869,7 +889,9 @@ export class Parser {
}

/**
* FieldsDefinition : `{ FieldDefinition+ }`
* ```
* FieldsDefinition : { FieldDefinition+ }
* ```
*/
parseFieldsDefinition(): Array<FieldDefinitionNode> {
return this.optionalMany(
Expand Down Expand Up @@ -1011,7 +1033,9 @@ export class Parser {
}

/**
* EnumValuesDefinition : `{ EnumValueDefinition+ }`
* ```
* EnumValuesDefinition : { EnumValueDefinition+ }
* ```
*/
parseEnumValuesDefinition(): Array<EnumValueDefinitionNode> {
return this.optionalMany(
Expand Down Expand Up @@ -1060,7 +1084,9 @@ export class Parser {
}

/**
* InputFieldsDefinition : `{ InputValueDefinition+ }`
* ```
* InputFieldsDefinition : { InputValueDefinition+ }
* ```
*/
parseInputFieldsDefinition(): Array<InputValueDefinitionNode> {
return this.optionalMany(
Expand Down Expand Up @@ -1109,9 +1135,11 @@ export class Parser {
}

/**
* ```
* SchemaExtension :
* - `extend schema Directives[Const]? { OperationTypeDefinition+ }`
* - `extend schema Directives[Const]`
* - extend schema Directives[Const]? { OperationTypeDefinition+ }
* - extend schema Directives[Const]
* ```
*/
parseSchemaExtension(): SchemaExtensionNode {
const start = this._lexer.token;
Expand Down Expand Up @@ -1283,8 +1311,10 @@ export class Parser {
}

/**
* ```
* DirectiveDefinition :
* - `Description? directive @ Name ArgumentsDefinition? `repeatable`? on DirectiveLocations`
* - Description? directive @ Name ArgumentsDefinition? `repeatable`? on DirectiveLocations
* ```
*/
parseDirectiveDefinition(): DirectiveDefinitionNode {
const start = this._lexer.token;
Expand Down

0 comments on commit 6b31543

Please sign in to comment.