MCPcopy Create free account
hub / github.com/auxten/postgresql-parser / StringWithFlags

Method StringWithFlags

pkg/sql/parser/parse.go:70–79  ·  view source on GitHub ↗

StringWithFlags returns the AST formatted as a string (with the given flags).

(flags tree.FmtFlags)

Source from the content-addressed store, hash-verified

68
69// StringWithFlags returns the AST formatted as a string (with the given flags).
70func (stmts Statements) StringWithFlags(flags tree.FmtFlags) string {
71 ctx := tree.NewFmtCtx(flags)
72 for i, s := range stmts {
73 if i > 0 {
74 ctx.WriteString("; ")
75 }
76 ctx.FormatNode(s.AST)
77 }
78 return ctx.CloseAndGetString()
79}
80
81// Parser wraps a scanner, parser and other utilities present in the parser
82// package.

Callers 3

StringMethod · 0.95
TestParse2Function · 0.80
TestParseTreeFunction · 0.80

Calls 3

FormatNodeMethod · 0.95
CloseAndGetStringMethod · 0.95
NewFmtCtxFunction · 0.92

Tested by 2

TestParse2Function · 0.64
TestParseTreeFunction · 0.64