Skip to content

Commit 31df8ef

Browse files
NullVoxPopuliclaude
andcommitted
fix: reorder ElementContent so BlockParams wins over AttrNameOnly
The grammar's ElementContent had AttrNameOnly before BlockParams in the ordered choice, so <Foo as |bar|> was matching 'as' as a bare attribute name rather than kicking off block params. Put BlockParams first in the alternation. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
1 parent f7273e2 commit 31df8ef

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

Binary file not shown.

packages/@glimmer/syntax/pkg/wasm-bytes.mjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

packages/@glimmer/syntax/src/glimmer.pest

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,9 +292,10 @@ CloseTag = {
292292
}
293293

294294
// ElementContent covers attributes, modifiers, splattributes, block params, and comments
295+
// Check BlockParams first so `as |x|` isn't consumed as attribute name `as`.
295296
ElementContent = _{
296-
WS+ ~ (Splattributes | MustacheComment | AttrModifier | AttrWithValue | AttrNameOnly)
297-
| WS+ ~ BlockParams
297+
BlockParams
298+
| WS+ ~ (Splattributes | MustacheComment | AttrModifier | AttrWithValue | AttrNameOnly)
298299
}
299300

300301
// TagName unifies all valid angle-bracket tag name forms:

0 commit comments

Comments
 (0)