summaryrefslogtreecommitdiff
path: root/src/parse/expr.cpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2017-01-08 09:48:19 +0800
committerJohn Hodge <tpg@mutabah.net>2017-01-08 09:48:19 +0800
commit3f047e495793a1eed8244b96bc0dddff275cd19c (patch)
treea53112cc7ecfd414b1832a8a1a28c4643c100b46 /src/parse/expr.cpp
parentaf7089cec53828533462af5349e861f7d524d22e (diff)
downloadmrust-3f047e495793a1eed8244b96bc0dddff275cd19c.tar.gz
All - i128/u182 support, typecheck and parse fixes
Diffstat (limited to 'src/parse/expr.cpp')
-rw-r--r--src/parse/expr.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/parse/expr.cpp b/src/parse/expr.cpp
index eb82bae7..d4edb208 100644
--- a/src/parse/expr.cpp
+++ b/src/parse/expr.cpp
@@ -110,6 +110,15 @@ ExprNodeP Parse_ExprBlockLine_WithItems(TokenStream& lex, ::std::shared_ptr<AST:
GET_CHECK_TOK(tok, lex, TOK_SQUARE_CLOSE);
}
+ // `union Ident` - contextual keyword
+ if( tok.type() == TOK_IDENT && tok.str() == "union" && lex.lookahead(0) == TOK_IDENT ) {
+ PUTBACK(tok, lex);
+ if( !local_mod ) {
+ local_mod = lex.parse_state().get_current_mod().add_anon();
+ }
+ Parse_Mod_Item(lex, *local_mod, mv$(item_attrs));
+ return ExprNodeP();
+ }
switch(tok.type())
{
// Items: