diff options
author | John Hodge <tpg@mutabah.net> | 2017-01-08 09:48:19 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2017-01-08 09:48:19 +0800 |
commit | 3f047e495793a1eed8244b96bc0dddff275cd19c (patch) | |
tree | a53112cc7ecfd414b1832a8a1a28c4643c100b46 /src/parse | |
parent | af7089cec53828533462af5349e861f7d524d22e (diff) | |
download | mrust-3f047e495793a1eed8244b96bc0dddff275cd19c.tar.gz |
All - i128/u182 support, typecheck and parse fixes
Diffstat (limited to 'src/parse')
-rw-r--r-- | src/parse/expr.cpp | 9 |
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: |