diff options
author | John Hodge <tpg@ucc.asn.au> | 2019-06-09 17:37:38 +0800 |
---|---|---|
committer | John Hodge <tpg@ucc.asn.au> | 2019-06-09 17:37:38 +0800 |
commit | 8992eaa470e27ed3da396aed41ce741bc509bb0f (patch) | |
tree | a07e8fc5e766a58aa6878d603efd0c4a079621b5 /src | |
parent | 770166eeec3f02b0c6fbac5150c3d5eec2bb211b (diff) | |
download | mrust-8992eaa470e27ed3da396aed41ce741bc509bb0f.tar.gz |
macro_rules - Handle open range operators
Diffstat (limited to 'src')
-rw-r--r-- | src/macro_rules/eval.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/macro_rules/eval.cpp b/src/macro_rules/eval.cpp index 2d1b6bb1..927a3585 100644 --- a/src/macro_rules/eval.cpp +++ b/src/macro_rules/eval.cpp @@ -1109,6 +1109,11 @@ namespace lex.consume(); break; + // Possibly a left-open (or full-open) range literal + case TOK_DOUBLE_DOT: + case TOK_DOUBLE_DOT_EQUAL: + case TOK_TRIPLE_DOT: + break; case TOK_RWORD_UNSAFE: lex.consume(); @@ -1264,11 +1269,28 @@ namespace case TOK_EXCLAM_EQUAL: case TOK_DOUBLE_AMP: case TOK_DOUBLE_PIPE: - case TOK_DOUBLE_DOT: case TOK_DOUBLE_DOT_EQUAL: case TOK_TRIPLE_DOT: lex.consume(); break; + case TOK_DOUBLE_DOT: + lex.consume(); + DEBUG("TOK_DOUBLE_DOT => " << lex.next()); + switch(lex.next()) + { + case TOK_EOF: + return true; + case TOK_COMMA: + case TOK_SEMICOLON: + case TOK_BRACE_CLOSE: + case TOK_PAREN_CLOSE: + case TOK_SQUARE_CLOSE: + cont = false; + break; + default: + break; + } + break; case TOK_EQUAL: case TOK_PLUS_EQUAL: case TOK_DASH_EQUAL: |