about summary refs log tree commit diff
path: root/src/comp
diff options
context:
space:
mode:
authorGraydon Hoare <graydon@mozilla.com>2011-03-07 15:38:20 -0800
committerGraydon Hoare <graydon@mozilla.com>2011-03-07 15:38:20 -0800
commitdf3038e68bf1189cd9cb0fc81e57da2c23594b63 (patch)
treec6c457d5afdd38bf176c305be437e17e4ef566df /src/comp
parent3869b3bfe489fc8db37b4436a9a38e732cc3d219 (diff)
downloadrust-df3038e68bf1189cd9cb0fc81e57da2c23594b63.tar.gz
rust-df3038e68bf1189cd9cb0fc81e57da2c23594b63.zip
Parse opacity (and drop on the floor), so std.rc parses now.
Diffstat (limited to 'src/comp')
-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 d45260f3ad1..52ae66c8502 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 f60ff36b65f..71e592ff106 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()) {