about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMichael Sullivan <sully@msully.net>2011-05-26 18:16:24 -0700
committerMichael Sullivan <sully@msully.net>2011-05-27 12:01:20 -0700
commit55b40e6894e2adb743080e23c87a257c12801078 (patch)
tree7a8edc0e944b08c1c9fd137216a78a54bc9538d7 /src
parent147b088125e27115a6c7417c9a1b55cc1d099b11 (diff)
Lex '|>' as the RECV token.
Diffstat (limited to 'src')
-rw-r--r--src/comp/front/lexer.rs19
-rw-r--r--src/comp/front/token.rs1
2 files changed, 14 insertions, 6 deletions
diff --git a/src/comp/front/lexer.rs b/src/comp/front/lexer.rs
index 3e88c01a292..dd0bdb3a53a 100644
--- a/src/comp/front/lexer.rs
+++ b/src/comp/front/lexer.rs
@@ -674,12 +674,19 @@ fn next_token(&reader rdr) -> token::token {
         }
 
         case ('|') {
-            if (rdr.next() == '|') {
-                rdr.bump();
-                rdr.bump();
-                ret token::OROR;
-            } else {
-                ret binop(rdr, token::OR);
+            alt (rdr.next()) {
+                case ('|') {
+                    rdr.bump();
+                    rdr.bump();
+                    ret token::OROR;
+                }
+                case ('>') {
+                    rdr.bump();
+                    ret token::RECV;
+                }
+                case (_) {
+                    ret binop(rdr, token::OR);
+                }
             }
         }
 
diff --git a/src/comp/front/token.rs b/src/comp/front/token.rs
index 7c778ccaad3..1dcaac884b8 100644
--- a/src/comp/front/token.rs
+++ b/src/comp/front/token.rs
@@ -49,6 +49,7 @@ tag token {
     QUES;
     RARROW;
     SEND;
+    RECV;
     LARROW;
     LPAREN;
     RPAREN;