From 0e5144716759fb7a20fd277d35a1e6fb92b59a5a Mon Sep 17 00:00:00 2001 From: John Hodge Date: Fri, 5 May 2017 15:30:07 +0800 Subject: Expand - Scoping of macros defined in functions --- src/expand/mod.cpp | 5 ++++- src/parse/expr.cpp | 10 ++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/expand/mod.cpp b/src/expand/mod.cpp index e2164a06..788b2109 100644 --- a/src/expand/mod.cpp +++ b/src/expand/mod.cpp @@ -690,11 +690,13 @@ struct CExpandExpr: void Expand_Expr(::AST::Crate& crate, LList modstack, ::std::unique_ptr& node) { + TRACE_FUNCTION_F("unique_ptr"); auto visitor = CExpandExpr(crate, modstack); visitor.visit(node); } void Expand_Expr(::AST::Crate& crate, LList modstack, ::std::shared_ptr& node) { + TRACE_FUNCTION_F("shared_ptr"); auto visitor = CExpandExpr(crate, modstack); node->visit(visitor); if( visitor.replacement ) { @@ -703,6 +705,7 @@ void Expand_Expr(::AST::Crate& crate, LList modstack, ::std: } void Expand_Expr(::AST::Crate& crate, LList modstack, AST::Expr& node) { + TRACE_FUNCTION_F("AST::Expr"); auto visitor = CExpandExpr(crate, modstack); node.visit_nodes(visitor); if( visitor.replacement ) { @@ -829,7 +832,7 @@ void Expand_Mod(::AST::Crate& crate, LList modstack, ::AST:: { auto& i = mod.items()[idx]; - DEBUG("- " << i.name << " (" << ::AST::Item::tag_to_str(i.data.tag()) << ") :: " << i.data.attrs); + DEBUG("- " << modpath << "::" << i.name << " (" << ::AST::Item::tag_to_str(i.data.tag()) << ") :: " << i.data.attrs); ::AST::Path path = modpath + i.name; auto attrs = mv$(i.data.attrs); diff --git a/src/parse/expr.cpp b/src/parse/expr.cpp index 15a3e179..93adc3d4 100644 --- a/src/parse/expr.cpp +++ b/src/parse/expr.cpp @@ -119,6 +119,16 @@ ExprNodeP Parse_ExprBlockLine_WithItems(TokenStream& lex, ::std::shared_ptr