Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions lib/pegjs/html/glimmer-tag-string.pegjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@import "../non-separator-colon.pegjs" as nonSeparatorColon

start = tagString

tagString 'valid tag string'
= c:$tagChar+

tagChar = [_a-zA-Z0-9-.] / nonSeparatorColon / '@'
4 changes: 2 additions & 2 deletions lib/pegjs/html/tag-component.pegjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
@import "./attribute.pegjs" as attribute
@import "./attribute-bracketed.pegjs" as bracketedAttribute
@import "./attribute-shorthand.pegjs" as shorthandAttributes
@import "./tag-string.pegjs" as tagString
@import "./glimmer-tag-string.pegjs" as glimmerTagString
@import "../mustache/ast/in-tag.pegjs" as inTagMustache
@import "../syntax/block-params.pegjs" as blockParamsRaw
@import "../whitespace.pegjs" as _
Expand All @@ -29,7 +29,7 @@ htmlStart

// @TODO / coercion
componentTag
= '%' _ s:tagString
= '%' _ s:glimmerTagString
{
return s;
}
Expand Down
13 changes: 12 additions & 1 deletion tests/integration/glimmer/blocks-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module('glimmer: blocks', function (hooks) {

assert.compilesTo(emblem,
'<MyComponent @value={{foo}} as |comp1 @comp2|>{{comp.name}}</MyComponent>');
});
});

test('recursive nesting part 2', function (assert) {
const emblem = w(
Expand All @@ -33,4 +33,15 @@ module('glimmer: blocks', function (hooks) {
assert.compilesTo(emblem, '<my-comp-1><my-comp-2><p>Hello</p></my-comp-2></my-comp-1>');
});


test("block params with nested comp", function (assert) {
const emblem = w(
"%MyComponent @value=foo as |comp1 @comp2|",
" %comp.name @value1=foo"
);

assert.compilesTo(emblem,
'<MyComponent @value={{foo}} as |comp1 @comp2|><comp.name @value1={{foo}}></comp.name></MyComponent>');
});

});