MCPcopy
hub / github.com/grafana/tempo / yylex1

Function yylex1

pkg/traceql/expr.y.go:768–801  ·  view source on GitHub ↗
(lex yyLexer, lval *yySymType)

Source from the content-addressed store, hash-verified

766}
767
768func yylex1(lex yyLexer, lval *yySymType) (char, token int) {
769 token = 0
770 char = lex.Lex(lval)
771 if char <= 0 {
772 token = int(yyTok1[0])
773 goto out
774 }
775 if char < len(yyTok1) {
776 token = int(yyTok1[char])
777 goto out
778 }
779 if char >= yyPrivate {
780 if char < yyPrivate+len(yyTok2) {
781 token = int(yyTok2[char-yyPrivate])
782 goto out
783 }
784 }
785 for i := 0; i < len(yyTok3); i += 2 {
786 token = int(yyTok3[i+0])
787 if token == char {
788 token = int(yyTok3[i+1])
789 goto out
790 }
791 }
792
793out:
794 if token == 0 {
795 token = int(yyTok2[1]) /* unknown char */
796 }
797 if yyDebug >= 3 {
798 __yyfmt__.Printf("lex %s(%d)\n", yyTokname(token), uint(char))
799 }
800 return char, token
801}
802
803func yyParse(yylex yyLexer) int {
804 return yyNewParser().Parse(yylex)

Callers 1

ParseMethod · 0.85

Calls 2

yyToknameFunction · 0.85
LexMethod · 0.65

Tested by

no test coverage detected