Fix assign parsing
= is a keyword not an identifier
This commit is contained in:
parent
bc4fbe4276
commit
61c36c4def
@ -147,7 +147,7 @@ impl Parser {
|
|||||||
try!(self.expect(Keyword(Kw::Let)));
|
try!(self.expect(Keyword(Kw::Let)));
|
||||||
let name = try!(self.expect_identifier());
|
let name = try!(self.expect_identifier());
|
||||||
match self.lookahead() {
|
match self.lookahead() {
|
||||||
Some(Identifier(ref s)) if s == "=" => { self.next(); },
|
Some(Keyword(Kw::Assign)) => { self.next(); },
|
||||||
_ => return parse_error!("Expected `=`"),
|
_ => return parse_error!("Expected `=`"),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user