Skip to content

Commit 414e16a

Browse files
committed
Add some template arguments comments to debug output
1 parent ad92fa2 commit 414e16a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

source/parse.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,8 @@ auto prefix_expression_node::visit(auto& v, int depth) -> void
404404
}
405405

406406

407+
struct template_args_tag { };
408+
407409
struct unqualified_id_node
408410
{
409411
token const* identifier = {}; // required
@@ -449,13 +451,16 @@ struct unqualified_id_node
449451
v.start(*identifier, depth+1);
450452

451453
if (!template_args.empty()) {
454+
// Inform the visitor that this is a template args list
455+
v.start(template_args_tag{}, depth);
452456
assert(open_angle != source_position{});
453457
assert(close_angle != source_position{});
454458
assert(template_args.front().comma == source_position{});
455459
for (auto& a : template_args) {
456460
try_visit< expression>(a.arg, v, depth+1);
457461
try_visit<id_expression>(a.arg, v, depth+1);
458462
}
463+
v.end(template_args_tag{}, depth);
459464
}
460465

461466
v.end(*this, depth);
@@ -3257,6 +3262,11 @@ class parse_tree_printer : printing_visitor
32573262
o << pre(indent) << "function returns\n";
32583263
}
32593264

3265+
auto start(template_args_tag const&, int indent) -> void
3266+
{
3267+
o << pre(indent) << "template arguments\n";
3268+
}
3269+
32603270
auto start(declaration_node const& n, int indent) -> void
32613271
{
32623272
o << pre(indent) << "declaration\n";

0 commit comments

Comments
 (0)