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

Method popExpectOp

internal/parser/parser.go:77–84  ·  view source on GitHub ↗
(op string)

Source from the content-addressed store, hash-verified

75}
76
77func (p *parser) popExpectOp(op string) (*token, errors.StaticError) {
78 t := p.pop()
79 if t.kind != tokenOperator || t.data != op {
80 return nil, errors.MakeStaticError(
81 fmt.Sprintf("Expected operator %v but got %v", op, t), t.loc)
82 }
83 return t, nil
84}
85
86func (p *parser) peek() *token {
87 return &p.t[p.currT]

Callers 2

parseBindMethod · 0.95

Calls 2

popMethod · 0.95
MakeStaticErrorFunction · 0.92

Tested by

no test coverage detected