Fix assign parsing

= is a keyword not an identifier
This commit is contained in:
greg 2016-01-03 22:28:55 -08:00
parent bc4fbe4276
commit 61c36c4def

View File

@ -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 `=`"),
} }