MCPcopy Create free account
hub / github.com/dolthub/doltgresql / helpWith

Function helpWith

postgres/parser/parser/help.go:90–102  ·  view source on GitHub ↗

helpWith is to be used in parser actions to mark the parser "in error", with the error set to a contextual help message about the current statement.

(sqllex sqlLexer, helpText string)

Source from the content-addressed store, hash-verified

88// error", with the error set to a contextual help message about the
89// current statement.
90func helpWith(sqllex sqlLexer, helpText string) int {
91 scan := sqllex.(*lexer)
92 if helpText == "" {
93 scan.lastError = pgerror.WithCandidateCode(errors.New("help upon syntax error"), pgcode.Syntax)
94 scan.populateHelpMsg("help:\n" + AllHelp)
95 return 1
96 }
97 msg := HelpMessage{Command: helpText, HelpMessageBody: HelpMessages[helpText]}
98 scan.SetHelp(msg)
99 // We return non-zero to indicate to the caller of Parse() that the
100 // parse was unsuccessful.
101 return 1
102}
103
104// helpWithFunction is to be used in parser actions to mark the parser
105// "in error", with the error set to a contextual help message about

Callers

nothing calls this directly

Calls 3

WithCandidateCodeFunction · 0.92
populateHelpMsgMethod · 0.80
SetHelpMethod · 0.80

Tested by

no test coverage detected