You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/lang-reference.md
+11-1Lines changed: 11 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -783,9 +783,19 @@ Anchors require parent node context to be meaningful:
783
783
Q = . (a) ; definition level (no parent node)
784
784
Q = {. (a)} ; sequence boundary without parent
785
785
Q = {(a) .} ; sequence boundary without parent
786
+
Q = [(a) . (b)] ; directly in alternation
786
787
```
787
788
788
-
The rule: **boundary anchors need a parent named node** to provide first/last child or adjacent sibling semantics. Interior anchors (between items in a sequence) are always valid because both sides are explicitly defined.
789
+
To anchor within alternation branches, wrap in a sequence:
0 commit comments