diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2011-03-18 11:49:06 -0700 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2011-03-18 11:49:47 -0700 |
| commit | 2ef9c01ffcd160937ddccc91a6f5e9fa24f22fd4 (patch) | |
| tree | 2c558d866e94eb0ee42d9d4c608f75dc4e45a4c8 /src/comp/front | |
| parent | 4c2245d8421ff43832b005375025cd14f56c1ca9 (diff) | |
| download | rust-2ef9c01ffcd160937ddccc91a6f5e9fa24f22fd4.tar.gz rust-2ef9c01ffcd160937ddccc91a6f5e9fa24f22fd4.zip | |
rustc: Implement "mutable?". Add a test case and XFAIL it in rustboot for now.
Diffstat (limited to 'src/comp/front')
| -rw-r--r-- | src/comp/front/ast.rs | 1 | ||||
| -rw-r--r-- | src/comp/front/parser.rs | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/src/comp/front/ast.rs b/src/comp/front/ast.rs index e519d03bf2c..ec93db55c92 100644 --- a/src/comp/front/ast.rs +++ b/src/comp/front/ast.rs @@ -91,6 +91,7 @@ tag pat_ { tag mutability { mut; imm; + maybe_mut; } tag opacity { diff --git a/src/comp/front/parser.rs b/src/comp/front/parser.rs index 71f0f2d891d..028b8a3132d 100644 --- a/src/comp/front/parser.rs +++ b/src/comp/front/parser.rs @@ -615,6 +615,10 @@ impure fn parse_path(parser p, greed g) -> ast.path { impure fn parse_mutability(parser p) -> ast.mutability { if (p.peek() == token.MUTABLE) { p.bump(); + if (p.peek() == token.QUES) { + p.bump(); + ret ast.maybe_mut; + } ret ast.mut; } ret ast.imm; |
