MCPcopy
hub / github.com/autoNumeric/autoNumeric / _match

Method _match

src/maths/Parser.js:152–159  ·  view source on GitHub ↗
(expected)

Source from the content-addressed store, hash-verified

150 }
151
152 _match(expected) {
153 const index = this.lexer.getIndex() - 1;
154 if (this.text[index] === expected) {
155 this.token = this.lexer.getNextToken(this.decimalCharacter);
156 } else {
157 throw new Error(`Unexpected token '${this.token.symbol}' at position '${index}' in the match function`);
158 }
159 }
160}

Callers 1

_factorMethod · 0.95

Calls 2

getIndexMethod · 0.80
getNextTokenMethod · 0.80

Tested by

no test coverage detected