diff options
author | John Hodge <tpg@mutabah.net> | 2016-09-26 14:47:25 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-09-26 14:47:25 +0800 |
commit | a55a69d69c8159c83fedbac97dcff682cd9cf8a7 (patch) | |
tree | bdefff27402c7aab2b4802b962634e5c0732eb9e /src/macro_rules/mod.cpp | |
parent | 1628e934e97a313325f6b6ea5fab8750b2e2dfa4 (diff) | |
download | mrust-a55a69d69c8159c83fedbac97dcff682cd9cf8a7.tar.gz |
Parse - Fix bugs with :stmt capture and use
Diffstat (limited to 'src/macro_rules/mod.cpp')
-rw-r--r-- | src/macro_rules/mod.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/macro_rules/mod.cpp b/src/macro_rules/mod.cpp index effa03cb..095763a8 100644 --- a/src/macro_rules/mod.cpp +++ b/src/macro_rules/mod.cpp @@ -68,14 +68,28 @@ bool is_token_expr(eTokenType tt) { return true;
switch( tt )
{
+ // Leading unary operators
case TOK_AMP: // Borrow
case TOK_STAR: // Deref
- case TOK_PAREN_OPEN: // Parenthesised
- case TOK_SQUARE_OPEN: // Array
- case TOK_MACRO:
case TOK_DASH: // Negate
case TOK_EXCLAM: // Invert
case TOK_RWORD_BOX: // Box
+ // Composite values
+ case TOK_MACRO:
+ case TOK_PAREN_OPEN: // Parenthesised
+ case TOK_SQUARE_OPEN: // Array
+
+ // Flow
+ case TOK_RWORD_RETURN:
+ case TOK_RWORD_BREAK:
+ case TOK_RWORD_CONTINUE:
+
+ // Blocks
+ case TOK_RWORD_IF:
+ case TOK_RWORD_FOR:
+ case TOK_RWORD_WHILE:
+ case TOK_RWORD_LOOP:
+ case TOK_RWORD_UNSAFE:
// Closures
case TOK_RWORD_MOVE:
@@ -88,6 +102,7 @@ bool is_token_expr(eTokenType tt) { case TOK_STRING:
case TOK_RWORD_TRUE:
case TOK_RWORD_FALSE:
+
case TOK_INTERPOLATED_EXPR:
return true;
default:
|