diff options
author | John Hodge <tpg@ucc.asn.au> | 2019-03-04 11:18:04 +0800 |
---|---|---|
committer | John Hodge <tpg@ucc.asn.au> | 2019-03-04 11:18:04 +0800 |
commit | 3f6ad4a766e6daef9ed82b989e8cd2044a3d3679 (patch) | |
tree | bef1ad9fb08e4c02e484e1adda16ea9541ecc897 | |
parent | a473a4eddc80b54e3458739ef2c4b18c24d50f92 (diff) | |
download | mrust-3f6ad4a766e6daef9ed82b989e8cd2044a3d3679.tar.gz |
Parse - TOK_RWORD_MACRO and stub handler
-rw-r--r-- | src/parse/eTokenType.enum.h | 1 | ||||
-rw-r--r-- | src/parse/lex.cpp | 1 | ||||
-rw-r--r-- | src/parse/root.cpp | 8 | ||||
-rw-r--r-- | src/parse/token.cpp | 1 |
4 files changed, 11 insertions, 0 deletions
diff --git a/src/parse/eTokenType.enum.h b/src/parse/eTokenType.enum.h index 93590264..d5a0eb86 100644 --- a/src/parse/eTokenType.enum.h +++ b/src/parse/eTokenType.enum.h @@ -140,6 +140,7 @@ _(TOK_RWORD_SUPER) _(TOK_RWORD_PROC) _(TOK_RWORD_MOVE) +_(TOK_RWORD_MACRO) _(TOK_RWORD_ABSTRACT) _(TOK_RWORD_FINAL) diff --git a/src/parse/lex.cpp b/src/parse/lex.cpp index 0b145379..477ff9af 100644 --- a/src/parse/lex.cpp +++ b/src/parse/lex.cpp @@ -155,6 +155,7 @@ static const struct { TOKENT("in", TOK_RWORD_IN), TOKENT("let", TOK_RWORD_LET), TOKENT("loop", TOK_RWORD_LOOP), + TOKENT("macro", TOK_RWORD_MACRO), TOKENT("match", TOK_RWORD_MATCH), TOKENT("mod", TOK_RWORD_MOD), TOKENT("move", TOK_RWORD_MOVE), diff --git a/src/parse/root.cpp b/src/parse/root.cpp index d79df434..a85812ea 100644 --- a/src/parse/root.cpp +++ b/src/parse/root.cpp @@ -1921,6 +1921,14 @@ namespace { item_data = ::AST::Item( Parse_TraitDef(lex, meta_items) ); break; + case TOK_RWORD_MACRO: + if( TARGETVER_1_19 ) + { + throw ParseError::Unexpected(lex, tok); + } + TODO(lex.point_span(), "macro items"); + break; + case TOK_RWORD_MOD: { GET_CHECK_TOK(tok, lex, TOK_IDENT); auto name = mv$(tok.str()); diff --git a/src/parse/token.cpp b/src/parse/token.cpp index f9c168e8..d8a68d88 100644 --- a/src/parse/token.cpp +++ b/src/parse/token.cpp @@ -477,6 +477,7 @@ struct EscapedString { case TOK_RWORD_BE: return "be"; case TOK_RWORD_UNSIZED: return "unsized"; + case TOK_RWORD_MACRO: return "macro"; } throw ParseError::BugCheck("Reached end of Token::to_str"); } |