@@ -1401,8 +1401,7 @@ export class Parser {
1401
1401
// Core parsing utility functions
1402
1402
1403
1403
/**
1404
- * Returns a location object, used to identify the place in
1405
- * the source that created a given parsed object.
1404
+ * Returns a location object, used to identify the place in the source that created a given parsed object.
1406
1405
*/
1407
1406
loc ( startToken : Token ) : Location | void {
1408
1407
if ( this . _options ?. noLocation !== true ) {
@@ -1422,8 +1421,8 @@ export class Parser {
1422
1421
}
1423
1422
1424
1423
/**
1425
- * If the next token is of the given kind, return that token after advancing
1426
- * the lexer. Otherwise, do not change the parser state and throw an error.
1424
+ * If the next token is of the given kind, return that token after advancing the lexer.
1425
+ * Otherwise, do not change the parser state and throw an error.
1427
1426
*/
1428
1427
expectToken ( kind : TokenKindEnum ) : Token {
1429
1428
const token = this . _lexer . token ;
@@ -1440,8 +1439,8 @@ export class Parser {
1440
1439
}
1441
1440
1442
1441
/**
1443
- * If the next token is of the given kind, return that token after advancing
1444
- * the lexer. Otherwise, do not change the parser state and return undefined.
1442
+ * If the next token is of the given kind, return that token after advancing the lexer.
1443
+ * Otherwise, do not change the parser state and return undefined.
1445
1444
*/
1446
1445
expectOptionalToken ( kind : TokenKindEnum ) : ?Token {
1447
1446
const token = this . _lexer . token ;
@@ -1470,8 +1469,8 @@ export class Parser {
1470
1469
}
1471
1470
1472
1471
/**
1473
- * If the next token is a given keyword, return "true" after advancing
1474
- * the lexer. Otherwise, do not change the parser state and return "false".
1472
+ * If the next token is a given keyword, return "true" after advancing the lexer.
1473
+ * Otherwise, do not change the parser state and return "false".
1475
1474
*/
1476
1475
expectOptionalKeyword ( value : string ) : boolean {
1477
1476
const token = this . _lexer . token ;
@@ -1483,8 +1482,7 @@ export class Parser {
1483
1482
}
1484
1483
1485
1484
/**
1486
- * Helper function for creating an error when an unexpected lexed token
1487
- * is encountered.
1485
+ * Helper function for creating an error when an unexpected lexed token is encountered.
1488
1486
*/
1489
1487
unexpected ( atToken ?: ?Token ) : GraphQLError {
1490
1488
const token = atToken ?? this . _lexer . token ;
@@ -1496,10 +1494,9 @@ export class Parser {
1496
1494
}
1497
1495
1498
1496
/**
1499
- * Returns a possibly empty list of parse nodes, determined by
1500
- * the parseFn. This list begins with a lex token of openKind
1501
- * and ends with a lex token of closeKind. Advances the parser
1502
- * to the next lex token after the closing token.
1497
+ * Returns a possibly empty list of parse nodes, determined by the parseFn.
1498
+ * This list begins with a lex token of openKind and ends with a lex token of closeKind.
1499
+ * Advances the parser to the next lex token after the closing token.
1503
1500
*/
1504
1501
any < T > (
1505
1502
openKind : TokenKindEnum ,
@@ -1516,10 +1513,9 @@ export class Parser {
1516
1513
1517
1514
/**
1518
1515
* Returns a list of parse nodes, determined by the parseFn.
1519
- * It can be empty only if open token is missing otherwise it will always
1520
- * return non-empty list that begins with a lex token of openKind and ends
1521
- * with a lex token of closeKind. Advances the parser to the next lex token
1522
- * after the closing token.
1516
+ * It can be empty only if open token is missing otherwise it will always return non-empty list
1517
+ * that begins with a lex token of openKind and ends with a lex token of closeKind.
1518
+ * Advances the parser to the next lex token after the closing token.
1523
1519
*/
1524
1520
optionalMany < T > (
1525
1521
openKind : TokenKindEnum ,
@@ -1537,10 +1533,9 @@ export class Parser {
1537
1533
}
1538
1534
1539
1535
/**
1540
- * Returns a non-empty list of parse nodes, determined by
1541
- * the parseFn. This list begins with a lex token of openKind
1542
- * and ends with a lex token of closeKind. Advances the parser
1543
- * to the next lex token after the closing token.
1536
+ * Returns a non-empty list of parse nodes, determined by the parseFn.
1537
+ * This list begins with a lex token of openKind and ends with a lex token of closeKind.
1538
+ * Advances the parser to the next lex token after the closing token.
1544
1539
*/
1545
1540
many < T > (
1546
1541
openKind : TokenKindEnum ,
@@ -1557,15 +1552,15 @@ export class Parser {
1557
1552
}
1558
1553
1559
1554
/**
1560
- * A helper function to describe a token as a string for debugging
1555
+ * A helper function to describe a token as a string for debugging.
1561
1556
*/
1562
1557
function getTokenDesc ( token : Token ) : string {
1563
1558
const value = token . value ;
1564
1559
return getTokenKindDesc ( token . kind ) + ( value != null ? ` "${ value } "` : '' ) ;
1565
1560
}
1566
1561
1567
1562
/**
1568
- * A helper function to describe a token kind as a string for debugging
1563
+ * A helper function to describe a token kind as a string for debugging.
1569
1564
*/
1570
1565
function getTokenKindDesc ( kind : TokenKindEnum ) : string {
1571
1566
return isPunctuatorTokenKind ( kind ) ? `"${ kind } "` : kind ;
0 commit comments