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)
| 75 | // error", with the error set to a contextual help message about the |
| 76 | // current statement. |
| 77 | func helpWith(sqllex sqlLexer, helpText string) int { |
| 78 | scan := sqllex.(*lexer) |
| 79 | if helpText == "" { |
| 80 | scan.lastError = pgerror.WithCandidateCode(errors.New("help upon syntax error"), pgcode.Syntax) |
| 81 | scan.populateHelpMsg("help:\n" + AllHelp) |
| 82 | return 1 |
| 83 | } |
| 84 | msg := HelpMessage{Command: helpText, HelpMessageBody: HelpMessages[helpText]} |
| 85 | scan.SetHelp(msg) |
| 86 | // We return non-zero to indicate to the caller of Parse() that the |
| 87 | // parse was unsuccessful. |
| 88 | return 1 |
| 89 | } |
| 90 | |
| 91 | // helpWithFunction is to be used in parser actions to mark the parser |
| 92 | // "in error", with the error set to a contextual help message about |
nothing calls this directly
no test coverage detected
searching dependent graphs…