Bug: function bodies are not nested under the node #15
Clément DELALANDE opened 2 days ago

Summary\n parses the body as a sibling top-level statement, not as a child of . Verified on :\n\n\n(func ...)\n (statement [3, 23] - [3, 39]\n (return [3, 23] - [3, 39] ...))\n\n\nThe node is a sibling of , outside its span. The rule stops at :\n\njs\nfunction: ($) => seq(\n "func", field("name", $.word),\n field("parameters", $.function_parameters),\n optional(seq($.arrow, $.type)),\n ":",\n),\n\n\n## Impact\n- Scoping is wrong (variables declared inside a function are not scoped to it).\n- Any transpiler/LSP that walks children will see an empty body.\n- for locals will not associate definitions with their scope.\n\n## Expected\n should own a containing statements (assignments, expressions, control flow, nested returns). Body delimiters need to be defined — Gate appears to use indentation blocks (GDScript style), so a newline+indent terminator is likely needed.\n\n## Files\n- — rule

1/1
Type
Bug
Priority
Major
Assignees
Not assigned
Issue Votes (0)
Watchers (1)
Reference
gate/tree-sitter-gate#15
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover