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

Method parseWithDepth

pkg/sql/plpgsql/parser/parse.go:82–96  ·  view source on GitHub ↗
(
	depth int, plpgsql string, nakedIntType *types.T,
)

Source from the content-addressed store, hash-verified

80}
81
82func (p *Parser) parseWithDepth(
83 depth int, plpgsql string, nakedIntType *types.T,
84) (statements.PLpgStatement, error) {
85 p.scanner.Init(plpgsql)
86 defer p.scanner.Cleanup()
87 sql, tokens, done := p.scanFnBlock()
88 stmt, err := p.parse(depth+1, sql, tokens, nakedIntType)
89 if err != nil {
90 return statements.PLpgStatement{}, err
91 }
92 if !done {
93 return statements.PLpgStatement{}, errors.AssertionFailedf("invalid plpgsql function: %s", plpgsql)
94 }
95 return stmt, nil
96}
97
98// parse parses a statement from the given scanned tokens.
99func (p *Parser) parse(

Callers 2

ParseMethod · 0.95
ParseFunction · 0.95

Calls 4

scanFnBlockMethod · 0.95
parseMethod · 0.95
CleanupMethod · 0.80
InitMethod · 0.45

Tested by

no test coverage detected