mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-27 04:54:21 +01:00
fix: empty variables are allowed
This commit is contained in:
@@ -574,14 +574,8 @@ impl<'a> Lexer<'a> {
|
||||
|
||||
match tok {
|
||||
b'?' => {
|
||||
let start_digit = self.offset;
|
||||
self.eat_while(|b| b.is_some() && b.unwrap().is_ascii_digit());
|
||||
|
||||
// empty variable name
|
||||
if start_digit == self.offset {
|
||||
return Err(Error::BadVariableName((start, self.offset - start).into()));
|
||||
}
|
||||
|
||||
Ok(Token {
|
||||
value: &self.input[start + 1..self.offset], // do not include '? in the value
|
||||
token_type: Some(TokenType::TK_VARIABLE),
|
||||
|
||||
Reference in New Issue
Block a user