@@ -70,11 +70,7 @@ import type {
70
70
import { Location , OperationTypeNode } from './ast.js' ;
71
71
import { DirectiveLocation } from './directiveLocation.js' ;
72
72
import { Kind } from './kinds.js' ;
73
- import {
74
- isPunctuatorTokenKind ,
75
- Lexer ,
76
- SchemaCoordinateLexer ,
77
- } from './lexer.js' ;
73
+ import { isPunctuatorTokenKind , Lexer } from './lexer.js' ;
78
74
import { isSource , Source } from './source.js' ;
79
75
import { TokenKind } from './tokenKind.js' ;
80
76
@@ -118,24 +114,6 @@ export interface ParseOptions {
118
114
* ```
119
115
*/
120
116
experimentalFragmentArguments ?: boolean | undefined ;
121
-
122
- /**
123
- * You may override the Lexer class used to lex the source; this is used by
124
- * schema coordinates to introduce a lexer that forbids ignored tokens.
125
- */
126
- Lexer ?: typeof Lexer | undefined ;
127
- }
128
-
129
- /**
130
- * Configuration options to control schema coordinate parser behavior
131
- */
132
- export interface ParseSchemaCoordinateOptions {
133
- /**
134
- * By default, the parser creates AST nodes that know the location
135
- * in the source that they correspond to. This configuration flag
136
- * disables that behavior for performance or testing.
137
- */
138
- noLocation ?: boolean | undefined ;
139
117
}
140
118
141
119
/**
@@ -221,13 +199,9 @@ export function parseType(
221
199
*/
222
200
export function parseSchemaCoordinate (
223
201
source : string | Source ,
224
- options ?: ParseSchemaCoordinateOptions ,
202
+ options ?: ParseOptions ,
225
203
) : SchemaCoordinateNode {
226
- // Ignored tokens are excluded syntax for a Schema Coordinate.
227
- const parser = new Parser ( source , {
228
- ...options ,
229
- Lexer : SchemaCoordinateLexer ,
230
- } ) ;
204
+ const parser = new Parser ( source , options ) ;
231
205
parser . expectToken ( TokenKind . SOF ) ;
232
206
const coordinate = parser . parseSchemaCoordinate ( ) ;
233
207
parser . expectToken ( TokenKind . EOF ) ;
@@ -253,8 +227,7 @@ export class Parser {
253
227
constructor ( source : string | Source , options : ParseOptions = { } ) {
254
228
const sourceObj = isSource ( source ) ? source : new Source ( source ) ;
255
229
256
- const LexerClass = options . Lexer ?? Lexer ;
257
- this . _lexer = new LexerClass ( sourceObj ) ;
230
+ this . _lexer = new Lexer ( sourceObj ) ;
258
231
this . _options = options ;
259
232
this . _tokenCounter = 0 ;
260
233
}
0 commit comments