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

Method tryParseWithTimeout

parser/parser_view.go:335–354  ·  view source on GitHub ↗
(pos Pos)

Source from the content-addressed store, hash-verified

333}
334
335func (p *Parser) tryParseWithTimeout(pos Pos) (*WithTimeoutClause, error) {
336 if !p.tryConsumeKeywords(KeywordWith) {
337 return nil, nil // nolint
338 }
339 if err := p.expectKeyword(KeywordTimeout); err != nil {
340 return nil, err
341 }
342
343 withTimeout := &WithTimeoutClause{WithTimeoutPos: pos}
344
345 if p.matchTokenKind(TokenKindInt) {
346 decimalNumber, err := p.parseDecimal(p.Pos())
347 if err != nil {
348 return nil, err
349 }
350 withTimeout.Number = decimalNumber
351 }
352
353 return withTimeout, nil
354}

Callers 1

parseCreateLiveViewMethod · 0.95

Calls 5

tryConsumeKeywordsMethod · 0.95
expectKeywordMethod · 0.95
matchTokenKindMethod · 0.95
parseDecimalMethod · 0.95
PosMethod · 0.95

Tested by

no test coverage detected