summaryrefslogtreecommitdiff
path: root/src/parse/expr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/parse/expr.cpp')
-rw-r--r--src/parse/expr.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/parse/expr.cpp b/src/parse/expr.cpp
index 46be8e63..c632ed55 100644
--- a/src/parse/expr.cpp
+++ b/src/parse/expr.cpp
@@ -1219,8 +1219,20 @@ TokenTree Parse_TT(TokenStream& lex, bool unwrapped)
case TOK_BRACE_OPEN:
closer = TOK_BRACE_CLOSE;
break;
+ // HACK! mrustc parses #[ and #![ as composite tokens
+ // TODO: Split these into their component tokens.
+ case TOK_ATTR_OPEN:
+ case TOK_CATTR_OPEN:
+ if( unwrapped )
+ throw ParseError::Unexpected(lex, tok);
+ closer = TOK_SQUARE_CLOSE;
+ break;
+
case TOK_EOF:
case TOK_NULL:
+ case TOK_PAREN_CLOSE:
+ case TOK_SQUARE_CLOSE:
+ case TOK_BRACE_CLOSE:
throw ParseError::Unexpected(lex, tok);
default:
return TokenTree( mv$(tok) );