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

Method ParseReturnExpr

pkg/sql/plpgsql/parser/lexer.go:382–389  ·  view source on GitHub ↗

ParseReturnExpr handles reading and parsing the expression for a RETURN or RETURN NEXT statement, which can be nonexistent.

()

Source from the content-addressed store, hash-verified

380// ParseReturnExpr handles reading and parsing the expression for a RETURN or
381// RETURN NEXT statement, which can be nonexistent.
382func (l *lexer) ParseReturnExpr() (plpgsqltree.Expr, error) {
383 startPos, endPos, _, err := l.readSQLConstruct(true /* isExpr */, true /* allowEmpty */, ';')
384 if err != nil || startPos == endPos {
385 return nil, err
386 }
387 exprStr := l.getStr(startPos, endPos)
388 return l.ParseExpr(exprStr)
389}
390
391// ParseReturnQuery handles reading and parsing the query for a RETURN QUERY
392// statement, which can be nonexistent.

Callers 1

ParseMethod · 0.80

Calls 3

readSQLConstructMethod · 0.95
getStrMethod · 0.95
ParseExprMethod · 0.95

Tested by

no test coverage detected