Add support for dynamic partial names
Uses the subexpression syntax to allow for dynamic partial lookups. Ex:
```
{{> (helper) }}
```
Fixes #933
This commit is contained in:
+7
-1
@@ -77,7 +77,13 @@ mustache
|
||||
;
|
||||
|
||||
partial
|
||||
: OPEN_PARTIAL sexpr CLOSE -> new yy.PartialStatement($2, yy.stripFlags($1, $3), yy.locInfo(@$))
|
||||
: OPEN_PARTIAL partial_expr CLOSE -> new yy.PartialStatement($2, yy.stripFlags($1, $3), yy.locInfo(@$))
|
||||
;
|
||||
|
||||
partial_expr
|
||||
: helperName param* hash? -> new yy.PartialExpression($1, $2, $3, yy.locInfo(@$))
|
||||
| dataName -> new yy.PartialExpression($1, null, null, yy.locInfo(@$))
|
||||
| OPEN_SEXPR sexpr CLOSE_SEXPR param* hash? -> new yy.PartialExpression($2, $4, $5, yy.locInfo(@$))
|
||||
;
|
||||
|
||||
sexpr
|
||||
|
||||
Reference in New Issue
Block a user