aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGraydon Hoare <[email protected]>2011-03-07 15:38:20 -0800
committerGraydon Hoare <[email protected]>2011-03-07 15:38:20 -0800
commitdf3038e68bf1189cd9cb0fc81e57da2c23594b63 (patch)
treec6c457d5afdd38bf176c305be437e17e4ef566df /src
parentModernize test/run-pass/generic-recursive-tag.rs. Un-XFAIL it in rustboot. (diff)
downloadrust-df3038e68bf1189cd9cb0fc81e57da2c23594b63.tar.xz
rust-df3038e68bf1189cd9cb0fc81e57da2c23594b63.zip
Parse opacity (and drop on the floor), so std.rc parses now.
Diffstat (limited to 'src')
-rw-r--r--src/comp/front/ast.rs5
-rw-r--r--src/comp/front/parser.rs16
2 files changed, 21 insertions, 0 deletions
diff --git a/src/comp/front/ast.rs b/src/comp/front/ast.rs
index d45260f3..52ae66c8 100644
--- a/src/comp/front/ast.rs
+++ b/src/comp/front/ast.rs
@@ -83,6 +83,11 @@ tag mutability {
imm;
}
+tag opacity {
+ op_abstract;
+ op_transparent;
+}
+
tag layer {
layer_value;
layer_state;
diff --git a/src/comp/front/parser.rs b/src/comp/front/parser.rs
index f60ff36b..71e592ff 100644
--- a/src/comp/front/parser.rs
+++ b/src/comp/front/parser.rs
@@ -1830,6 +1830,8 @@ impure fn parse_item_native_fn(parser p, ast.effect eff) -> @ast.native_item {
impure fn parse_native_item(parser p) -> @ast.native_item {
let ast.effect eff = parse_effect(p);
+ let ast.opacity opa = parse_opacity(p);
+ let ast.layer lyr = parse_layer(p);
alt (p.peek()) {
case (token.TYPE) {
ret parse_item_native_type(p);
@@ -1978,6 +1980,19 @@ impure fn parse_item_tag(parser p) -> @ast.item {
ret @spanned(lo, hi, item);
}
+impure fn parse_opacity(parser p) -> ast.opacity {
+ alt (p.peek()) {
+ case (token.ABS) {
+ p.bump();
+ ret ast.op_abstract;
+ }
+ case (_) {
+ ret ast.op_transparent;
+ }
+ }
+ fail;
+}
+
impure fn parse_layer(parser p) -> ast.layer {
alt (p.peek()) {
case (token.STATE) {
@@ -2033,6 +2048,7 @@ fn peeking_at_item(parser p) -> bool {
impure fn parse_item(parser p) -> @ast.item {
let ast.effect eff = parse_effect(p);
+ let ast.opacity opa = parse_opacity(p);
let ast.layer lyr = parse_layer(p);
alt (p.peek()) {