Skip to content

Conversation

@zharinov
Copy link
Member

Summary

  • Named nodes with internal captures now bubble fields up alongside the outer capture
  • Previously, capturing a named node would incorrectly nest internal fields
  • Added inner_creates_scope() to distinguish scope-creating expressions (sequences, alternations) from others

Example

Q = (function
  name: (identifier) @name :: string
  body: (block) @body
) @func :: FunctionInfo

Before: { func: { name: string, body: Node } } (nested)
After: { func: FunctionInfo, name: string, body: Node } (flat)

Test plan

  • Added named_node_captured_with_internal_captures test

@zharinov zharinov enabled auto-merge (squash) December 30, 2025 03:19
@zharinov zharinov force-pushed the fix/capture-scope-bubbling branch from eaed89c to c0c1919 Compare December 30, 2025 03:24
@zharinov zharinov force-pushed the fix/capture-scope-bubbling branch from c0c1919 to 65b9b8c Compare December 30, 2025 03:25
@zharinov zharinov merged commit 7a88a8d into master Dec 30, 2025
4 checks passed
@zharinov zharinov deleted the fix/capture-scope-bubbling branch December 30, 2025 03:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants