MCPcopy Create free account
hub / github.com/Snapchat/Valdi / tryParse

Method tryParse

compiler/companion/src/utils/TextParser.ts:75–86  ·  view source on GitHub ↗
(term: string)

Source from the content-addressed store, hash-verified

73 }
74
75 tryParse(term: string): boolean {
76 this.consumeWhitespaces();
77
78 for (let i = 0; i < term.length; i++) {
79 if (term.charCodeAt(i) !== this.text.charCodeAt(this.position + i)) {
80 return false;
81 }
82 }
83
84 this.position += term.length;
85 return true;
86 }
87
88 private isIdentifier(position: number): boolean {
89 const code = this.text.charCodeAt(position);

Callers 6

parseMethod · 0.95
parseQuotedStringMethod · 0.95
peekMethod · 0.95
makeImportedSymbolFunction · 0.45
parseImportedSymbolsListFunction · 0.45
parseImportFunction · 0.45

Calls 1

consumeWhitespacesMethod · 0.95

Tested by

no test coverage detected