InvalidNumberError creates an E1003 error for a malformed numeric literal, such as a number with multiple decimal points (1.2.3) or an invalid exponent format. Parameters: - value: The raw string that could not be parsed as a number - location: Line/column where the literal starts - sql: Full SQL s
(value string, location models.Location, sql string)
| 76 | // - location: Line/column where the literal starts |
| 77 | // - sql: Full SQL source used to generate visual context |
| 78 | func InvalidNumberError(value string, location models.Location, sql string) *Error { |
| 79 | return NewError( |
| 80 | ErrCodeInvalidNumber, |
| 81 | fmt.Sprintf("invalid numeric literal: '%s'", value), |
| 82 | location, |
| 83 | ).WithContext(sql, len(value)).WithHint("Check the numeric format (e.g., 123, 123.45, 1.23e10)") |
| 84 | } |
| 85 | |
| 86 | // UnexpectedTokenError creates an E2001 error for a token that does not fit the |
| 87 | // expected grammar at the current parse position. An intelligent "Did you mean?" |