From bc48ea4e3c8c901defd6eadb7ad44c0dca6fb4e1 Mon Sep 17 00:00:00 2001 From: Taus Date: Fri, 1 May 2026 13:53:59 +0000 Subject: [PATCH] Yeast: Skip unnamed tokens in AST dump output Unnamed tokens (keywords, operators, punctuation) in the unnamed children bucket are no longer shown in dump output. They still appear if they are inside a named field. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- shared/yeast/src/dump.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/shared/yeast/src/dump.rs b/shared/yeast/src/dump.rs index 35212dcff03..ba82071de3f 100644 --- a/shared/yeast/src/dump.rs +++ b/shared/yeast/src/dump.rs @@ -100,10 +100,14 @@ fn dump_node(ast: &Ast, id: usize, source: &str, options: &DumpOptions, indent: } } - // Unnamed children + // Unnamed children — skip unnamed tokens (keywords, punctuation) if let Some(children) = node.fields.get(&CHILD_FIELD) { for &child_id in children { - dump_node(ast, child_id, source, options, indent + 1, out); + if let Some(child) = ast.get_node(child_id) { + if child.is_named() { + dump_node(ast, child_id, source, options, indent + 1, out); + } + } } } }