Skip to content

Commit

Permalink
fix(parser): handle trailing comma in object literals
Browse files Browse the repository at this point in the history
  • Loading branch information
gomesalexandre committed Feb 10, 2020
1 parent 4488352 commit f38e17a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lib/syntax/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,10 @@ impl Parser {
let name = match tk.data {
TokenData::Identifier(ref id) => id.clone(),
TokenData::StringLiteral(ref str) => str.clone(),
TokenData::Punctuator(Punctuator::CloseBlock) => {
self.pos += 1;
break;
}
_ => {
return Err(ParseError::Expected(
vec![
Expand Down

0 comments on commit f38e17a

Please sign in to comment.