Parse re-assignment
This commit is contained in:
parent
b3fec86fbd
commit
af27da619d
@ -1,7 +1,7 @@
|
|||||||
function max (a, b)
|
function max (a, b)
|
||||||
local m = a
|
local m = a
|
||||||
if a then
|
if a then
|
||||||
local m = b
|
m = b
|
||||||
end
|
end
|
||||||
return m
|
return m
|
||||||
end
|
end
|
||||||
@ -229,6 +229,12 @@ impl Parse for Statement {
|
|||||||
name,
|
name,
|
||||||
expr,
|
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 {
|
} else {
|
||||||
Err(stream.expecting_err("statement"))
|
Err(stream.expecting_err("statement"))
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user