From f394933641b5894a4c408aaae59ea3f632b3ee64 Mon Sep 17 00:00:00 2001 From: Lindsey Kuper Date: Thu, 31 May 2012 11:33:18 -0700 Subject: Allow optional comma before `with` in FRU. Closes #2463. --- src/libsyntax/parse/parser.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/libsyntax/parse') 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; } -- cgit 1.4.1-3-g733a5