Skip to content

Commit 6b31543

Browse files
committed
style: convert to code blocks
1 parent 6305b00 commit 6b31543

File tree

1 file changed

+41
-11
lines changed

1 file changed

+41
-11
lines changed

src/language/parser.ts

Lines changed: 41 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,9 @@ export class Parser {
203203
// Implements the parsing rules in the Document section.
204204

205205
/**
206+
* ```
206207
* Document : Definition+
208+
* ```
207209
*/
208210
parseDocument(): DocumentNode {
209211
return this.node<DocumentNode>(this._lexer.token, {
@@ -217,6 +219,7 @@ export class Parser {
217219
}
218220

219221
/**
222+
* ```
220223
* Definition :
221224
* - ExecutableDefinition
222225
* - TypeSystemDefinition
@@ -225,6 +228,7 @@ export class Parser {
225228
* ExecutableDefinition :
226229
* - OperationDefinition
227230
* - FragmentDefinition
231+
* ```
228232
*/
229233
parseDefinition(): DefinitionNode {
230234
if (this.peek(TokenKind.NAME)) {
@@ -259,9 +263,11 @@ export class Parser {
259263
// Implements the parsing rules in the Operations section.
260264

261265
/**
266+
* ```
262267
* OperationDefinition :
263268
* - SelectionSet
264269
* - OperationType Name? VariableDefinitions? Directives? SelectionSet
270+
* ```
265271
*/
266272
parseOperationDefinition(): OperationDefinitionNode {
267273
const start = this._lexer.token;
@@ -291,7 +297,9 @@ export class Parser {
291297
}
292298

293299
/**
300+
* ```
294301
* OperationType : one of query mutation subscription
302+
* ```
295303
*/
296304
parseOperationType(): OperationTypeNode {
297305
const operationToken = this.expectToken(TokenKind.NAME);
@@ -308,7 +316,9 @@ export class Parser {
308316
}
309317

310318
/**
319+
* ```
311320
* VariableDefinitions : ( VariableDefinition+ )
321+
* ```
312322
*/
313323
parseVariableDefinitions(): Array<VariableDefinitionNode> {
314324
return this.optionalMany(
@@ -319,7 +329,9 @@ export class Parser {
319329
}
320330

321331
/**
332+
* ```
322333
* VariableDefinition : Variable : Type DefaultValue? Directives[Const]?
334+
* ```
323335
*/
324336
parseVariableDefinition(): VariableDefinitionNode {
325337
return this.node<VariableDefinitionNode>(this._lexer.token, {
@@ -346,7 +358,9 @@ export class Parser {
346358
}
347359

348360
/**
349-
* SelectionSet : `{ Selection+ }`
361+
* ```
362+
* SelectionSet : { Selection+ }
363+
* ```
350364
*/
351365
parseSelectionSet(): SelectionSetNode {
352366
return this.node<SelectionSetNode>(this._lexer.token, {
@@ -616,9 +630,11 @@ export class Parser {
616630
}
617631

618632
/**
633+
* ```
619634
* ObjectValue[Const] :
620-
* - `{ }`
621-
* - `{ ObjectField[?Const]+ }`
635+
* - { }
636+
* - { ObjectField[?Const]+ }
637+
* ```
622638
*/
623639
parseObject(isConst: true): ConstObjectValueNode;
624640
parseObject(isConst: boolean): ObjectValueNode;
@@ -666,7 +682,9 @@ export class Parser {
666682
}
667683

668684
/**
669-
* Directive[Const] : `@ Name Arguments[?Const]?`
685+
* ```
686+
* Directive[Const] : @ Name Arguments[?Const]?
687+
* ```
670688
*/
671689
parseDirective(isConst: true): ConstDirectiveNode;
672690
parseDirective(isConst: boolean): DirectiveNode;
@@ -782,7 +800,9 @@ export class Parser {
782800
}
783801

784802
/**
785-
* SchemaDefinition : `Description? schema Directives[Const]? { OperationTypeDefinition+ }`
803+
* ```
804+
* SchemaDefinition : Description? schema Directives[Const]? { OperationTypeDefinition+ }
805+
* ```
786806
*/
787807
parseSchemaDefinition(): SchemaDefinitionNode {
788808
const start = this._lexer.token;
@@ -869,7 +889,9 @@ export class Parser {
869889
}
870890

871891
/**
872-
* FieldsDefinition : `{ FieldDefinition+ }`
892+
* ```
893+
* FieldsDefinition : { FieldDefinition+ }
894+
* ```
873895
*/
874896
parseFieldsDefinition(): Array<FieldDefinitionNode> {
875897
return this.optionalMany(
@@ -1011,7 +1033,9 @@ export class Parser {
10111033
}
10121034

10131035
/**
1014-
* EnumValuesDefinition : `{ EnumValueDefinition+ }`
1036+
* ```
1037+
* EnumValuesDefinition : { EnumValueDefinition+ }
1038+
* ```
10151039
*/
10161040
parseEnumValuesDefinition(): Array<EnumValueDefinitionNode> {
10171041
return this.optionalMany(
@@ -1060,7 +1084,9 @@ export class Parser {
10601084
}
10611085

10621086
/**
1063-
* InputFieldsDefinition : `{ InputValueDefinition+ }`
1087+
* ```
1088+
* InputFieldsDefinition : { InputValueDefinition+ }
1089+
* ```
10641090
*/
10651091
parseInputFieldsDefinition(): Array<InputValueDefinitionNode> {
10661092
return this.optionalMany(
@@ -1109,9 +1135,11 @@ export class Parser {
11091135
}
11101136

11111137
/**
1138+
* ```
11121139
* SchemaExtension :
1113-
* - `extend schema Directives[Const]? { OperationTypeDefinition+ }`
1114-
* - `extend schema Directives[Const]`
1140+
* - extend schema Directives[Const]? { OperationTypeDefinition+ }
1141+
* - extend schema Directives[Const]
1142+
* ```
11151143
*/
11161144
parseSchemaExtension(): SchemaExtensionNode {
11171145
const start = this._lexer.token;
@@ -1283,8 +1311,10 @@ export class Parser {
12831311
}
12841312

12851313
/**
1314+
* ```
12861315
* DirectiveDefinition :
1287-
* - `Description? directive @ Name ArgumentsDefinition? `repeatable`? on DirectiveLocations`
1316+
* - Description? directive @ Name ArgumentsDefinition? `repeatable`? on DirectiveLocations
1317+
* ```
12881318
*/
12891319
parseDirectiveDefinition(): DirectiveDefinitionNode {
12901320
const start = this._lexer.token;

0 commit comments

Comments
 (0)