diff options
| author | Lindsey Kuper <lindsey@rockstargirl.org> | 2012-05-31 11:33:18 -0700 |
|---|---|---|
| committer | Lindsey Kuper <lindsey@rockstargirl.org> | 2012-05-31 12:20:26 -0700 |
| commit | f394933641b5894a4c408aaae59ea3f632b3ee64 (patch) | |
| tree | e15e3b84575dba2bce5722b0506a489460baf786 /src/libsyntax | |
| parent | abef5f54c99ab8a6a1ea73c9b946557c13caf719 (diff) | |
| download | rust-f394933641b5894a4c408aaae59ea3f632b3ee64.tar.gz rust-f394933641b5894a4c408aaae59ea3f632b3ee64.zip | |
Allow optional comma before `with` in FRU. Closes #2463.
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 3cb40befa0e..a2c43ec3a2a 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -724,6 +724,12 @@ class parser { let mut fields = [self.parse_field(token::COLON)]; let mut base = none; while self.token != token::RBRACE { + // optional comma before "with" + if self.token == token::COMMA + && self.token_is_keyword("with", + self.look_ahead(1u)) { + self.bump(); + } if self.eat_keyword("with") { base = some(self.parse_expr()); break; } |
