MCPcopy Create free account
hub / github.com/aurelia/binding / nextToken

Method nextToken

src/parser.js:348–374  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

346 }
347
348 nextToken() {
349 /*
350 * Each index in CharScanners (0-65535) contains a scan function for the charCode with that number.
351 * The array is "zero-filled" with a throwing function and has functions for all ASCII chars (except ~@#`\)
352 * and IdentifierParts from the Latin1 script (1314 in total).
353 * Additional characters can be added via addIdentifierStart / addIdentifierPart.
354 */
355 while (this.idx < this.len) {
356 if (this.ch <= /*whitespace*/0x20) {
357 this.next();
358 continue;
359 }
360 this.start = this.idx;
361 if (this.ch === /*$*/0x24 || (this.ch >= /*a*/0x61 && this.ch <= /*z*/0x7A)) {
362 this.tkn = this.scanIdentifier();
363 return;
364 }
365 /*
366 * Note: the lookup below could also handle the characters which are handled above. It's just a performance tweak (direct
367 * comparisons are faster than array indexers)
368 */
369 if ((this.tkn = CharScanners[this.ch](this)) !== null) { // a null token means the character must be skipped
370 return;
371 }
372 }
373 this.tkn = T$EOF;
374 }
375
376 /** Advance to the next char */
377 next() {

Callers 9

parseBindingBehaviorMethod · 0.95
parseVariadicArgsMethod · 0.95
parseExpressionMethod · 0.95
parseBinaryMethod · 0.95
parseLeftHandSideMethod · 0.95
parseTemplateMethod · 0.95
optMethod · 0.95
expectMethod · 0.95
aurelia-binding.jsFile · 0.80

Calls 2

nextMethod · 0.95
scanIdentifierMethod · 0.95

Tested by

no test coverage detected