Skip to content

Commit

Permalink
Merge pull request #313 from thec0keman/module-namespaces
Browse files Browse the repository at this point in the history
Add support for module namespaces
  • Loading branch information
John Ratcliff authored Dec 18, 2018
2 parents c8bf454 + fa7dac2 commit c7bda31
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/pegjs/mustache/name-character.pegjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
start = newMustacheNameChar

// a character that can be in a mustache name
newMustacheNameChar = [-_/A-Za-z0-9] / arrayIndex / '.' / '@'
newMustacheNameChar = [-_/A-Za-z0-9] / arrayIndex / '.' / '@' / '::'

// Ember requires that array indexes have a . before them
arrayIndex = '.[' newMustacheNameChar* ']'
8 changes: 8 additions & 0 deletions tests/integration/glimmer-component-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,11 @@ test('named block support', function() {

compilesTo(emblem, '<x-modal><@header as |@title|>Header {{title}}</@header><@body>Body</@body><@footer>Footer</@footer></x-modal>');
});

test('module namespaces', function() {
var emblem = w(
'% my-addon::foo'
)

compilesTo(emblem, '<my-addon::foo></my-addon::foo>');
});
8 changes: 8 additions & 0 deletions tests/integration/mustaches-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -562,3 +562,11 @@ test('named block with block param', function() {

compilesTo(emblem, '{{#x-layout as |@widget|}}{{#@widget as |a b c|}}Hi.{{/@widget}}{{/x-layout}}');
});

test('module namespaces', function() {
var emblem = w(
'= my-addon::foo'
)

compilesTo(emblem, '{{my-addon::foo}}');
});

0 comments on commit c7bda31

Please sign in to comment.