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:
kpdecker
2015-01-18 13:23:45 -06:00
parent b0b522b4f8
commit cb51b82b8e
9 changed files with 92 additions and 9 deletions
+7 -1
View File
@@ -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