MCPcopy
hub / github.com/google/go-jsonnet / unexpectedTokenError

Method unexpectedTokenError

internal/parser/parser.go:62–67  ·  view source on GitHub ↗
(tk tokenKind, t *token)

Source from the content-addressed store, hash-verified

60}
61
62func (p *parser) unexpectedTokenError(tk tokenKind, t *token) errors.StaticError {
63 if tk == t.kind {
64 panic("Unexpectedly expected token kind")
65 }
66 return errors.MakeStaticError(fmt.Sprintf("Expected token %v but got %v", tk, t), t.loc)
67}
68
69func (p *parser) popExpect(tk tokenKind) (*token, errors.StaticError) {
70 t := p.pop()

Callers 2

popExpectMethod · 0.95
parseMethod · 0.95

Calls 1

MakeStaticErrorFunction · 0.92

Tested by

no test coverage detected