summary refs log tree commit diff
path: root/src/comp/syntax/parse/lexer.rs
diff options
context:
space:
mode:
authorPaul Stansifer <paul.stansifer@gmail.com>2011-06-29 18:07:04 -0700
committerPaul Stansifer <paul.stansifer@gmail.com>2011-07-11 18:52:10 -0700
commit80cf4ecd3bfe602004145e57cf7fdfb067b76ce1 (patch)
tree7fe2ceabdf59e39be101924ee18d6afdefcd00b5 /src/comp/syntax/parse/lexer.rs
parentfd24fd5e318c5bfbe0cba49f0b49edd3c112f451 (diff)
downloadrust-80cf4ecd3bfe602004145e57cf7fdfb067b76ce1.tar.gz
rust-80cf4ecd3bfe602004145e57cf7fdfb067b76ce1.zip
Add nodes for embedding types and blocks in expressions for macros.
Diffstat (limited to 'src/comp/syntax/parse/lexer.rs')
-rw-r--r--src/comp/syntax/parse/lexer.rs26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/comp/syntax/parse/lexer.rs b/src/comp/syntax/parse/lexer.rs
index 64b04693d60..21b1b7ee634 100644
--- a/src/comp/syntax/parse/lexer.rs
+++ b/src/comp/syntax/parse/lexer.rs
@@ -361,12 +361,8 @@ fn next_token(&reader rdr) -> token::token {
         } else { ret token::BINOP(op); }
     }
     alt (c) {
-        case (
-             // One-byte tokens.
-             '?') {
-            rdr.bump();
-            ret token::QUES;
-        }
+        // One-byte tokens.
+        case ('?') { rdr.bump(); ret token::QUES; }
         case (';') { rdr.bump(); ret token::SEMI; }
         case (',') { rdr.bump(); ret token::COMMA; }
         case ('.') { rdr.bump(); ret token::DOT; }
@@ -377,7 +373,18 @@ fn next_token(&reader rdr) -> token::token {
         case ('[') { rdr.bump(); ret token::LBRACKET; }
         case (']') { rdr.bump(); ret token::RBRACKET; }
         case ('@') { rdr.bump(); ret token::AT; }
-        case ('#') { rdr.bump(); ret token::POUND; }
+        case ('#') { 
+            rdr.bump(); 
+            if (rdr.curr() == '<') {
+                rdr.bump();
+                ret token::POUND_LT;
+            }
+            if (rdr.curr() == '{') {
+                rdr.bump();
+                ret token::POUND_LBRACE;
+            }
+            ret token::POUND;
+        }
         case ('~') { rdr.bump(); ret token::TILDE; }
         case (':') {
             rdr.bump();
@@ -386,9 +393,8 @@ fn next_token(&reader rdr) -> token::token {
                 ret token::MOD_SEP;
             } else { ret token::COLON; }
         }
-        case (
-             // Multi-byte tokens.
-             '=') {
+        // Multi-byte tokens.
+        case ('=') {
             rdr.bump();
             if (rdr.curr() == '=') {
                 rdr.bump();