MCPcopy Create free account
hub / github.com/araddon/qlbridge / expect

Method expect

expr/parse.go:228–234  ·  view source on GitHub ↗

expect verifies the current token and guarantees it has the required type

(expected lex.TokenType, context string)

Source from the content-addressed store, hash-verified

226
227// expect verifies the current token and guarantees it has the required type
228func (t *tree) expect(expected lex.TokenType, context string) lex.Token {
229 token := t.Cur()
230 if token.T != expected {
231 t.unexpected(token, context)
232 }
233 return token
234}
235
236// expectOneOf consumes the next token and guarantees it has one of the required types.
237func (t *tree) expectOneOf(expected1, expected2 lex.TokenType, context string) lex.Token {

Callers 5

cInnerMethod · 0.95
FMethod · 0.95
vMethod · 0.95
FuncMethod · 0.95
ArrayNodeMethod · 0.95

Calls 2

unexpectedMethod · 0.95
CurMethod · 0.65

Tested by

no test coverage detected