MCPcopy Create free account
hub / github.com/Permify/permify / peekError

Method peekError

pkg/dsl/parser/parser.go:874–878  ·  view source on GitHub ↗

peekError adds an error message to the parser's error list indicating that the next token in the input did not match the expected type(s). It takes one or more token types as arguments that indicate the expected types.

(t ...token.Type)

Source from the content-addressed store, hash-verified

872// did not match the expected type(s).
873// It takes one or more token types as arguments that indicate the expected types.
874func (p *Parser) peekError(t ...token.Type) {
875 expected := strings.Join(tokenTypesToStrings(t), ", ")
876 msg := fmt.Sprintf("%v:%v:expected next token to be %s, got %s instead", p.l.GetLinePosition(), p.l.GetColumnPosition(), expected, p.peekToken.Type)
877 p.errors = append(p.errors, msg)
878}
879
880// currentError adds an error message to the parser's error list indicating that the current token in the input
881// did not match the expected type(s).

Callers 3

parseRuleStatementMethod · 0.95
expectAndNextMethod · 0.95
expectMethod · 0.95

Calls 3

tokenTypesToStringsFunction · 0.85
GetLinePositionMethod · 0.80
GetColumnPositionMethod · 0.80

Tested by

no test coverage detected