MCPcopy Create free account
hub / github.com/AfterShip/clickhouse-sql-parser / expectKeyword

Method expectKeyword

parser/parser_common.go:80–86  ·  view source on GitHub ↗
(keyword string)

Source from the content-addressed store, hash-verified

78}
79
80func (p *Parser) expectKeyword(keyword string) error {
81 if !p.matchKeyword(keyword) {
82 return fmt.Errorf("expected keyword: %s, but got %s", keyword, p.lastTokenKind())
83 }
84 _ = p.lexer.consumeToken()
85 return nil
86}
87
88func (p *Parser) tryConsumeKeywords(keywords ...string) bool {
89 savedState := p.lexer.saveState()

Callers 15

parseDropDatabaseMethod · 0.95
parseDropStmtMethod · 0.95
tryParseModifierMethod · 0.95
parseInfixMethod · 0.95
parseExtractFromMethod · 0.95
parseColumnCastExprMethod · 0.95
parseIntervalMethod · 0.95
parseColumnCaseExprMethod · 0.95
parseCreateViewMethod · 0.95
parseCreateLiveViewMethod · 0.95

Calls 3

matchKeywordMethod · 0.95
lastTokenKindMethod · 0.95
consumeTokenMethod · 0.80

Tested by

no test coverage detected