MCPcopy
hub / github.com/postcss/postcss / parse

Method parse

lib/parser.js:448–484  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

446 }
447
448 parse() {
449 let token
450 while (!this.tokenizer.endOfFile()) {
451 token = this.tokenizer.nextToken()
452
453 switch (token[0]) {
454 case 'space':
455 this.spaces += token[1]
456 break
457
458 case ';':
459 this.freeSemicolon(token)
460 break
461
462 case '}':
463 this.end(token)
464 break
465
466 case 'comment':
467 this.comment(token)
468 break
469
470 case 'at-word':
471 this.atrule(token)
472 break
473
474 case '{':
475 this.emptyRule(token)
476 break
477
478 default:
479 this.other(token)
480 break
481 }
482 }
483 this.endFile()
484 }
485
486 precheckMissedSemicolon(/* tokens */) {
487 // Hook for Safe Parser

Callers 11

parseFunction · 0.95
loadMapMethod · 0.80
map.test.tsFile · 0.80
postcss.test.tsFile · 0.80
visitor.test.tsFile · 0.80
result.test.tsFile · 0.80
parseErrorFunction · 0.80
fromJSON.test.tsFile · 0.80
parentCanNarrowTypeFunction · 0.80
fuzz_parse.jsFile · 0.80

Calls 7

freeSemicolonMethod · 0.95
endMethod · 0.95
commentMethod · 0.95
atruleMethod · 0.95
emptyRuleMethod · 0.95
otherMethod · 0.95
endFileMethod · 0.95

Tested by 1

parseErrorFunction · 0.64