summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorkpdecker <kpdecker@gmail.com>2015-01-18 14:21:04 -0600
committerkpdecker <kpdecker@gmail.com>2015-01-18 14:21:04 -0600
commit999da739a66199483ffc4d82426550aee5ac798f (patch)
tree8464b928df21ff913b5ab17cb872420acd1718e7 /docs
parentd567d9c34566a6adab1eaea40ade2729fbce8144 (diff)
downloadhandlebars.js-999da739a66199483ffc4d82426550aee5ac798f.zip
handlebars.js-999da739a66199483ffc4d82426550aee5ac798f.tar.gz
handlebars.js-999da739a66199483ffc4d82426550aee5ac798f.tar.bz2
Update for proposed SubExpression dependency break
Avoids parsing against SubExpressions and instead inlines the content that a subexpression otherwise would have. This can still be based via duck typing so should not add much overhead to the compiler.
Diffstat (limited to 'docs')
-rw-r--r--docs/compiler-api.md36
1 files changed, 17 insertions, 19 deletions
diff --git a/docs/compiler-api.md b/docs/compiler-api.md
index 7a5db38..39bcacd 100644
--- a/docs/compiler-api.md
+++ b/docs/compiler-api.md
@@ -55,15 +55,21 @@ interface Statement <: Node { }
interface MustacheStatement <: Statement {
type: "MustacheStatement";
- sexpr: SubExpression;
- escaped: boolean;
+ path: PathExpression;
+ params: [ Expression ];
+ hash: Hash;
+
+ escaped: boolean;
strip: StripFlags | null;
}
interface BlockStatement <: Statement {
type: "BlockStatement";
- sexpr: SubExpression;
+ path: PathExpression;
+ params: [ Expression ];
+ hash: Hash;
+
program: Program | null;
inverse: Program | null;
@@ -74,12 +80,19 @@ interface BlockStatement <: Statement {
interface PartialStatement <: Statement {
type: "PartialStatement";
- sexpr: SubExpression;
+ name: PathExpression | SubExpression;
+ params: [ Expression ];
+ hash: Hash;
indent: string;
strip: StripFlags | null;
}
+```
+`name` will be a `SubExpression` when tied to a dynamic partial, i.e. `{{> (foo) }}`, otherwise this is a path or literal whose `original` value is used to lookup the desired partial.
+
+
+```java
interface ContentStatement <: Statement {
type: "ContentStatement";
value: string;
@@ -108,24 +121,9 @@ interface SubExpression <: Expression {
path: PathExpression;
params: [ Expression ];
hash: Hash;
-
- isHelper: true | null;
}
```
-`isHelper` is not required and is used to disambiguate between cases such as `{{foo}}` and `(foo)`, which have slightly different call behaviors.
-
-```java
-interface PartialExpression <: Expression {
- type: "PartialExpression";
- name: PathExpression | Literal | SubExpression;
- params: [ Expression ];
- hash: Hash;
-}
-```
-
-`name` will be a `SubExpression` when tied to a dynamic partial, i.e. `{{> (foo) }}`, otherwise this is a path or literal whose `original` value is used to lookup the desired partial.
-
##### Paths
```java