MCPcopy Create free account
hub / github.com/cockroachdb/cockroachdb-parser / parseOneWithInt

Method parseOneWithInt

pkg/sql/parser/parse.go:75–86  ·  view source on GitHub ↗
(
	sql string, nakedIntType *types.T, comments commentsMode,
)

Source from the content-addressed store, hash-verified

73}
74
75func (p *Parser) parseOneWithInt(
76 sql string, nakedIntType *types.T, comments commentsMode,
77) (statements.Statement[tree.Statement], error) {
78 stmts, err := p.parseWithDepth(1, sql, nakedIntType, comments)
79 if err != nil {
80 return statements.Statement[tree.Statement]{}, err
81 }
82 if len(stmts) != 1 {
83 return statements.Statement[tree.Statement]{}, errors.AssertionFailedf("expected 1 statement, but found %d", len(stmts))
84 }
85 return stmts[0], nil
86}
87
88func (p *Parser) scanOneStmt() (sql string, tokens []sqlSymType, done bool) {
89 tokens = p.tokBuf[:0]

Callers 2

ParseOneRetainCommentsFunction · 0.95
ParseOneWithIntFunction · 0.95

Calls 1

parseWithDepthMethod · 0.95

Tested by

no test coverage detected