aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/expand/rust-macro-expand.cc
diff options
context:
space:
mode:
authorSimplyTheOther <simplytheother@gmail.com>2020-12-13 15:47:32 +0800
committerSimplyTheOther <simplytheother@gmail.com>2020-12-13 15:47:32 +0800
commit6ee2c06c47a905b11ee5b674710df187126203bc (patch)
tree255f82f294ec703fe6b53e6413e4c1f449f5911e /gcc/rust/expand/rust-macro-expand.cc
parente21c9fe1657303605efeacd4890430e7d40c4c3c (diff)
downloadgcc-6ee2c06c47a905b11ee5b674710df187126203bc.zip
gcc-6ee2c06c47a905b11ee5b674710df187126203bc.tar.gz
gcc-6ee2c06c47a905b11ee5b674710df187126203bc.tar.bz2
Attempt to fix array parsing errors
Diffstat (limited to 'gcc/rust/expand/rust-macro-expand.cc')
-rw-r--r--gcc/rust/expand/rust-macro-expand.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/rust/expand/rust-macro-expand.cc b/gcc/rust/expand/rust-macro-expand.cc
index 82941c7..4f28836 100644
--- a/gcc/rust/expand/rust-macro-expand.cc
+++ b/gcc/rust/expand/rust-macro-expand.cc
@@ -3291,6 +3291,25 @@ MacroExpander::expand_invoc (std::unique_ptr<AST::MacroInvocation> &invoc)
- derive or legacy derive - "token-based" vs "AST-based"
- else is unreachable
- derive container macro - unreachable*/
+
+#if 0
+ // macro_rules macro test code
+ auto rule_def = find_rules_def(invoc->get_path());
+ if (rule_def != nullptr) {
+ ASTFrag expanded = expand_decl_macro(invoc, rule_def);
+ /* could make this a data structure containing vectors of exprs, patterns and types (for regular),
+ * and then stmts and items (for semi). Except what about having an expr, then a type? Hmm. Might
+ * have to do the "unified base type" thing OR just have a simulated union, and then have AST frag
+ * be a vector of these simulated unions. */
+
+ // how would errors be signalled? null fragment? something else?
+ // what about error vs just not having stuff in rules definition yet?
+
+ /* replace macro invocation with ast frag. actually, don't have any context here. maybe attach ast
+ * frag to macro invocation, and then have a method above get it? Or just return the ast frag from
+ * this method. */
+ }
+#endif
}
/* Determines whether any cfg predicate is false and hence item with attributes