checkStrictEmpty returns an error if strict mode is enabled and no statements were parsed. This consolidates the repeated strict empty-statement check pattern.
()
| 827 | // checkStrictEmpty returns an error if strict mode is enabled and no statements were parsed. |
| 828 | // This consolidates the repeated strict empty-statement check pattern. |
| 829 | func (p *Parser) checkStrictEmpty() error { |
| 830 | if p.strict { |
| 831 | return goerrors.InvalidSyntaxError( |
| 832 | "empty statement not allowed in strict mode", |
| 833 | p.currentLocation(), |
| 834 | "provide at least one SQL statement", |
| 835 | ) |
| 836 | } |
| 837 | return nil |
| 838 | } |
| 839 | |
| 840 | // checkStrictEmptySemicolon returns an error if strict mode is enabled and a bare semicolon is encountered. |
| 841 | func (p *Parser) checkStrictEmptySemicolon() error { |
no test coverage detected