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)
| 88 | // error", with the error set to a contextual help message about the |
| 89 | // current statement. |
| 90 | func 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 |
nothing calls this directly
no test coverage detected