MCPcopy Index your code
hub / github.com/expr-lang/expr / next

Method next

parser/parser.go:164–187  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

162}
163
164func (p *Parser) next() {
165 if p.hasStash {
166 p.current = p.stashed
167 p.hasStash = false
168 return
169 }
170
171 token, err := p.lexer.Next()
172 var e *file.Error
173 switch {
174 case err == nil:
175 p.current = token
176 case errors.Is(err, io.EOF):
177 p.error("unexpected end of expression")
178 case errors.As(err, &e):
179 p.err = e
180 default:
181 p.err = &file.Error{
182 Location: p.current.Location,
183 Message: "unknown lexing error",
184 Prev: err,
185 }
186 }
187}
188
189func (p *Parser) expect(kind Kind, values ...string) {
190 if p.current.Is(kind, values...) {

Callers 13

ParseMethod · 0.95
expectMethod · 0.95
parseExpressionMethod · 0.95
parseConditionalIfMethod · 0.95
parseConditionalMethod · 0.95
parsePrimaryMethod · 0.95
parseSecondaryMethod · 0.95
parseCallMethod · 0.95
parsePredicateMethod · 0.95
parseMapExpressionMethod · 0.95

Calls 3

errorMethod · 0.95
NextMethod · 0.80
IsMethod · 0.80

Tested by

no test coverage detected