Fixed empty identifier error reporting
This commit is contained in:
parent
b2f4b8d850
commit
eacef33cf8
|
|
@ -758,11 +758,12 @@ static LexerResult lexer_next(LexerInfo *lexer_info) {
|
|||
// Identifiers and Booleans
|
||||
if (is_identifier_start(lexer_info))
|
||||
return parse_identifiers_and_booleans(lexer_info, c, start, start_line);
|
||||
if (c == ':')
|
||||
if (c == ':') {
|
||||
if (far_peek(lexer_info, 1) == ':')
|
||||
return lexer_error(lexer_info, SLS_STR("Invalid identifier literal: empty identifier after '::'."), start, start_line);
|
||||
else
|
||||
return lexer_error(lexer_info, SLS_STR("Unexpected single colon ':'."), start, start_line);
|
||||
}
|
||||
|
||||
// Random Characters
|
||||
SlsStr error_msg = sls_format(SLS_STR("Unexpected character: unexpected '%c' during parsing."), c);
|
||||
|
|
|
|||
Loading…
Reference in New Issue