Fix parsing concat
This commit is contained in:
parent
68da93541d
commit
fb12568e33
@ -94,4 +94,4 @@ for k, v in (ipairs(table)) do
|
||||
print(k, v)
|
||||
end
|
||||
|
||||
print(_ENV.b)
|
||||
print("hello " .. "there")
|
||||
12
src/ast.rs
12
src/ast.rs
@ -480,6 +480,11 @@ impl Parse for IndexedAccess {
|
||||
fn parse(mut stream: TokenStream) -> Result<Self, TokenStreamError> {
|
||||
let mut expressions = Vec::new();
|
||||
while let Some(Token::Symbol('[') | Token::Symbol('.')) = stream.peek() {
|
||||
if let (Some(Token::Symbol('.')), Some(Token::Symbol('.'))) =
|
||||
(stream.peek(), stream.peek2())
|
||||
{
|
||||
break;
|
||||
}
|
||||
match stream.next().unwrap() {
|
||||
Token::Symbol('[') => {
|
||||
let expression = stream.parse()?;
|
||||
@ -668,6 +673,10 @@ impl Parse for BinaryOperator {
|
||||
stream.next();
|
||||
Ok(BinaryOperator::NotEqual)
|
||||
}
|
||||
(Token::Symbol('.'), Some(Token::Symbol('.'))) => {
|
||||
stream.next();
|
||||
Ok(BinaryOperator::Concat)
|
||||
}
|
||||
|
||||
(Token::Symbol('>'), Some(Token::Symbol('>'))) => {
|
||||
stream.next();
|
||||
@ -790,6 +799,9 @@ impl Parse for PrimaryExpression {
|
||||
);
|
||||
}
|
||||
Token::Symbol('[') | Token::Symbol('.') => {
|
||||
if stream.peek2() == Some(Token::Symbol('.')) {
|
||||
break;
|
||||
}
|
||||
let meta = Metadata::produce(&mut stream, pre.clone());
|
||||
let IndexedAccess(accesses) = stream.parse()?;
|
||||
for access in accesses {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user