diff options
author | kpdecker <kpdecker@gmail.com> | 2015-09-01 00:48:20 -0500 |
---|---|---|
committer | kpdecker <kpdecker@gmail.com> | 2015-09-01 00:48:20 -0500 |
commit | e7a64f018ca541a7e0ac8ab2108ed86820bb47b1 (patch) | |
tree | 9680f623156fad643bae1a38ae9de425d8fbd583 /docs/compiler-api.md | |
parent | 0f5061e44524a431659f0665c4cd7557af9525a0 (diff) | |
parent | 6c45f49b24d63acda37072df464bd670af97a072 (diff) | |
download | handlebars.js-e7a64f018ca541a7e0ac8ab2108ed86820bb47b1.zip handlebars.js-e7a64f018ca541a7e0ac8ab2108ed86820bb47b1.tar.gz handlebars.js-e7a64f018ca541a7e0ac8ab2108ed86820bb47b1.tar.bz2 |
Merge branch 'decorators'
Diffstat (limited to 'docs/compiler-api.md')
-rw-r--r-- | docs/compiler-api.md | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/docs/compiler-api.md b/docs/compiler-api.md index 81438d2..2938219 100644 --- a/docs/compiler-api.md +++ b/docs/compiler-api.md @@ -120,6 +120,33 @@ interface CommentStatement <: Statement { } ``` + +```java +interface Decorator <: Statement { + type: "Decorator"; + + path: PathExpression | Literal; + params: [ Expression ]; + hash: Hash; + + strip: StripFlags | null; +} + +interface DecoratorBlock <: Statement { + type: "DecoratorBlock"; + path: PathExpression | Literal; + params: [ Expression ]; + hash: Hash; + + program: Program | null; + + openStrip: StripFlags | null; + closeStrip: StripFlags | null; +} +``` + +Decorator paths only utilize the `path.original` value and as a consequence do not support depthed evaluation. + ### Expressions ```java @@ -249,7 +276,7 @@ The `Handlebars.JavaScriptCompiler` object has a number of methods that may be c - `parent` is the existing code in the path resolution - `name` is the current path component - - `type` is the type of name being evaluated. May be one of `context`, `data`, `helper`, or `partial`. + - `type` is the type of name being evaluated. May be one of `context`, `data`, `helper`, `decorator`, or `partial`. Note that this does not impact dynamic partials, which implementors need to be aware of. Overriding `VM.resolvePartial` may be required to support dynamic cases. |