ErrorUnexpectedChar creates an error for an unexpected character. This is used when the tokenizer encounters a character that cannot start any valid token in the current context. Parameters: - ch: The unexpected character (byte) - location: Position where the character was found Returns an Error
(ch byte, location models.Location)
| 79 | // |
| 80 | // Example: "unexpected character: @ at line 2, column 5" |
| 81 | func ErrorUnexpectedChar(ch byte, location models.Location) *Error { |
| 82 | return NewError(fmt.Sprintf("unexpected character: %c", ch), location) |
| 83 | } |
| 84 | |
| 85 | // ErrorUnterminatedString creates an error for an unterminated string literal. |
| 86 | // |