Parse re-assignment
This commit is contained in:
parent
b3fec86fbd
commit
af27da619d
@ -1,7 +1,7 @@
|
||||
function max (a, b)
|
||||
local m = a
|
||||
if a then
|
||||
local m = b
|
||||
m = b
|
||||
end
|
||||
return m
|
||||
end
|
||||
@ -229,6 +229,12 @@ impl Parse for Statement {
|
||||
name,
|
||||
expr,
|
||||
))
|
||||
} else if let Some(Token::Word(_)) = peeked
|
||||
&& stream.peek2() == Some(Token::Symbol('='))
|
||||
{
|
||||
let name = stream.parse()?;
|
||||
stream.expect(Token::Symbol('='))?;
|
||||
Ok(Self::Assignment(None, name, stream.parse()?))
|
||||
} else {
|
||||
Err(stream.expecting_err("statement"))
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user