diff options
| author | Lindsey Kuper <[email protected]> | 2011-05-13 17:26:14 -0700 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2011-05-13 17:37:01 -0700 |
| commit | 5679f5c55e15e4a42542c36b1abc86b469903d19 (patch) | |
| tree | 05e621c2d05f678d2a15cbb70de7f09163619ef3 /src/comp/front/parser.rs | |
| parent | More anon obj work; whitespace police in middle::fold (diff) | |
| download | rust-5679f5c55e15e4a42542c36b1abc86b469903d19.tar.xz rust-5679f5c55e15e4a42542c36b1abc86b469903d19.zip | |
'with' no longer a token; whitespace police.
Plus renaming the anonymous objects test to a more descriptive name,
and XFAILing it because it doesn't work yet.
Diffstat (limited to 'src/comp/front/parser.rs')
| -rw-r--r-- | src/comp/front/parser.rs | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/comp/front/parser.rs b/src/comp/front/parser.rs index 8eb6c398..767e7e93 100644 --- a/src/comp/front/parser.rs +++ b/src/comp/front/parser.rs @@ -801,15 +801,11 @@ fn parse_bottom_expr(parser p) -> @ast::expr { expect(p, token::LBRACE); while (p.peek() != token::RBRACE) { - alt (p.peek()) { - case (token::WITH) { - p.bump(); - with_obj = some[ast::ident](parse_ident(p)); - } - case (_) { - _vec::push[@ast::method](meths, - parse_method(p)); - } + if (eat_word(p, "with")) { + with_obj = some[ast::ident](parse_ident(p)); + } else { + _vec::push[@ast::method](meths, + parse_method(p)); } } |