diff options
author | Minteck <contact@minteck.org> | 2022-10-18 08:59:09 +0200 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2022-10-18 08:59:09 +0200 |
commit | 2c4ae43e688a9873e86211ea0e7aeb9ba770dd77 (patch) | |
tree | 17848d95522dab25d3cdeb9c4a6450e2a234861f /alarm/node_modules/graphql/language/experimentalOnlineParser/onlineParser.d.ts | |
parent | 108525534c28013cfe1897c30e4565f9893f3766 (diff) | |
download | pluralconnect-2c4ae43e688a9873e86211ea0e7aeb9ba770dd77.tar.gz pluralconnect-2c4ae43e688a9873e86211ea0e7aeb9ba770dd77.tar.bz2 pluralconnect-2c4ae43e688a9873e86211ea0e7aeb9ba770dd77.zip |
Update
Diffstat (limited to 'alarm/node_modules/graphql/language/experimentalOnlineParser/onlineParser.d.ts')
-rw-r--r-- | alarm/node_modules/graphql/language/experimentalOnlineParser/onlineParser.d.ts | 125 |
1 files changed, 125 insertions, 0 deletions
diff --git a/alarm/node_modules/graphql/language/experimentalOnlineParser/onlineParser.d.ts b/alarm/node_modules/graphql/language/experimentalOnlineParser/onlineParser.d.ts new file mode 100644 index 0000000..9570b9e --- /dev/null +++ b/alarm/node_modules/graphql/language/experimentalOnlineParser/onlineParser.d.ts @@ -0,0 +1,125 @@ +import { Lexer } from '../lexer'; + +import { + GraphQLGrammarTokenConstraint, + GraphQLGrammarOfTypeConstraint, + GraphQLGrammarListOfTypeConstraint, + GraphQLGrammarPeekConstraint, + GraphQLGrammarConstraintsSet, +} from './grammar'; + +interface BaseOnlineParserRule { + kind: string; + name?: string; + depth: number; + step: number; + expanded: boolean; + state: string; + optional?: boolean; + eatNextOnFail?: boolean; +} +interface TokenOnlineParserRule + extends BaseOnlineParserRule, + GraphQLGrammarTokenConstraint {} +interface OfTypeOnlineParserRule + extends BaseOnlineParserRule, + GraphQLGrammarOfTypeConstraint {} +interface ListOfTypeOnlineParserRule + extends BaseOnlineParserRule, + GraphQLGrammarListOfTypeConstraint {} +interface PeekOnlineParserRule + extends BaseOnlineParserRule, + GraphQLGrammarPeekConstraint { + index: number; + matched: boolean; +} +interface ConstraintsSetOnlineParserRule extends BaseOnlineParserRule { + constraintsSet: boolean; + constraints: GraphQLGrammarConstraintsSet; +} + +type OnlineParserRule = + | TokenOnlineParserRule + | OfTypeOnlineParserRule + | ListOfTypeOnlineParserRule + | PeekOnlineParserRule + | ConstraintsSetOnlineParserRule; + +export interface OnlineParserState { + rules: Array<OnlineParserRule>; + kind: () => string; + step: () => number; + levels: Array<number>; + indentLevel: number | undefined; + name: string | null; + type: string | null; +} + +interface Token { + kind: string; + value?: string; + tokenName?: string | undefined; + ruleName?: string | undefined; +} + +type OnlineParserConfig = { + tabSize: number; +}; + +type OnlineParserConfigOption = { + tabSize?: number; +}; + +export class OnlineParser { + state: OnlineParserState; + _lexer: Lexer; + _config: OnlineParserConfig; + constructor( + source: string, + state?: OnlineParserState, + config?: OnlineParserConfigOption, + ); + static startState(): OnlineParserState; + static copyState(state: OnlineParserState): OnlineParserState; + sol(): boolean; + parseToken(): Token; + indentation(): number; + private readonly _parseTokenConstraint; + private readonly _parseListOfTypeConstraint; + private readonly _parseOfTypeConstraint; + private readonly _parsePeekConstraint; + private readonly _parseConstraintsSetRule; + private readonly _matchToken; + private readonly _butNot; + private readonly _transformLexerToken; + private readonly _getNextRule; + private readonly _popMatchedRule; + private readonly _rollbackRule; + private readonly _pushRule; + private readonly _getRuleKind; + private readonly _advanceToken; + private readonly _lookAhead; +} + +export const TokenKind: { + NAME: string; + INT: string; + FLOAT: string; + STRING: string; + BLOCK_STRING: string; + COMMENT: string; + PUNCTUATION: string; + EOF: string; + INVALID: string; +}; + +export const RuleKind: { + TOKEN_CONSTRAINT: string; + OF_TYPE_CONSTRAINT: string; + LIST_OF_TYPE_CONSTRAINT: string; + PEEK_CONSTRAINT: string; + CONSTRAINTS_SET: string; + CONSTRAINTS_SET_ROOT: string; + RULE_NAME: string; + INVALID: string; +}; |