@handlebars/parser
Advanced tools
Comparing version 1.1.0 to 2.0.0
@@ -0,1 +1,9 @@ | ||
## v2.0.0 (2020-12-09) | ||
#### :boom: Breaking Change | ||
* [#3](https://github.com/handlebars-lang/handlebars-parser/pull/3) Make sub-expressions callable ([@pzuraq](https://github.com/pzuraq)) | ||
#### Committers: 1 | ||
- Chris Garrett ([@pzuraq](https://github.com/pzuraq)) | ||
## v1.1.0 (2020-09-18) | ||
@@ -2,0 +10,0 @@ |
{ | ||
"name": "@handlebars/parser", | ||
"version": "1.1.0", | ||
"version": "2.0.0", | ||
"description": "The parser for the Handlebars language", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/handlebars-lang/handlebars-parser#readme", |
@@ -285,2 +285,37 @@ import { parse, print } from '../dist/esm'; | ||
it('parses mustaches with sub-expressions as the callable', function() { | ||
equals( | ||
astFor('{{(my-helper foo)}}'), | ||
'{{ PATH:my-helper [PATH:foo] [] }}\n' | ||
); | ||
}); | ||
it('parses mustaches with sub-expressions as the callable (with args)', function() { | ||
equals( | ||
astFor('{{(my-helper foo) bar}}'), | ||
'{{ PATH:my-helper [PATH:foo] [PATH:bar] }}\n' | ||
); | ||
}); | ||
it('parses sub-expressions with a sub-expression as the callable', function() { | ||
equals( | ||
astFor('{{((my-helper foo))}}'), | ||
'{{ PATH:my-helper [PATH:foo] [] [] }}\n' | ||
); | ||
}); | ||
it('parses sub-expressions with a sub-expression as the callable (with args)', function() { | ||
equals( | ||
astFor('{{((my-helper foo) bar)}}'), | ||
'{{ PATH:my-helper [PATH:foo] [PATH:bar] [] }}\n' | ||
); | ||
}); | ||
it('parses arguments with a sub-expression as the callable (with args)', function() { | ||
equals( | ||
astFor('{{my-helper ((foo) bar) baz=((foo bar))}}'), | ||
'{{ PATH:my-helper [PATH:foo [] [PATH:bar]] HASH{baz=PATH:foo [PATH:bar] []} }}\n' | ||
); | ||
}); | ||
it('parses inverse block with block params', function() { | ||
@@ -287,0 +322,0 @@ equals( |
@@ -26,3 +26,3 @@ export interface Node { | ||
type: 'MustacheStatement'; | ||
path: PathExpression | Literal; | ||
path: SubExpression | PathExpression | Literal; | ||
params: Expression[]; | ||
@@ -85,3 +85,3 @@ hash: Hash; | ||
type: 'SubExpression'; | ||
path: PathExpression; | ||
path: SubExpression | PathExpression; | ||
params: Expression[]; | ||
@@ -88,0 +88,0 @@ hash: Hash; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
586700
5076