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