MCPcopy Index your code
hub / github.com/yuin/gopher-lua / yylex1

Function yylex1

parse/parser.go:481–514  ·  view source on GitHub ↗
(lex yyLexer, lval *yySymType)

Source from the content-addressed store, hash-verified

479}
480
481func yylex1(lex yyLexer, lval *yySymType) (char, token int) {
482 token = 0
483 char = lex.Lex(lval)
484 if char <= 0 {
485 token = int(yyTok1[0])
486 goto out
487 }
488 if char < len(yyTok1) {
489 token = int(yyTok1[char])
490 goto out
491 }
492 if char >= yyPrivate {
493 if char < yyPrivate+len(yyTok2) {
494 token = int(yyTok2[char-yyPrivate])
495 goto out
496 }
497 }
498 for i := 0; i < len(yyTok3); i += 2 {
499 token = int(yyTok3[i+0])
500 if token == char {
501 token = int(yyTok3[i+1])
502 goto out
503 }
504 }
505
506out:
507 if token == 0 {
508 token = int(yyTok2[1]) /* unknown char */
509 }
510 if yyDebug >= 3 {
511 __yyfmt__.Printf("lex %s(%d)\n", yyTokname(token), uint(char))
512 }
513 return char, token
514}
515
516func yyParse(yylex yyLexer) int {
517 return yyNewParser().Parse(yylex)

Callers 1

ParseMethod · 0.85

Calls 2

yyToknameFunction · 0.85
LexMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…