summaryrefslogtreecommitdiffstats
path: root/lib/handlebars/compiler/ast.js
diff options
context:
space:
mode:
authorLes Hill <leshill@gmail.com>2012-12-13 10:33:20 -0800
committerLes Hill <leshill@gmail.com>2012-12-13 11:15:38 -0800
commit4bb794d814d068361a101a87735e2b9bbcee5115 (patch)
tree954c5fab968696bc3364671ecca47e6ac6c8a4f9 /lib/handlebars/compiler/ast.js
parentfd0560b95124bd6d335c0bd6af907281a22d72ea (diff)
downloadhandlebars.js-4bb794d814d068361a101a87735e2b9bbcee5115.zip
handlebars.js-4bb794d814d068361a101a87735e2b9bbcee5115.tar.gz
handlebars.js-4bb794d814d068361a101a87735e2b9bbcee5115.tar.bz2
Partials can be paths
Allows partials with slashes, a common partial syntax. For example: {{> shared/dude}}
Diffstat (limited to 'lib/handlebars/compiler/ast.js')
-rw-r--r--lib/handlebars/compiler/ast.js16
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/handlebars/compiler/ast.js b/lib/handlebars/compiler/ast.js
index 25abe0a..459b863 100644
--- a/lib/handlebars/compiler/ast.js
+++ b/lib/handlebars/compiler/ast.js
@@ -33,13 +33,10 @@ var Handlebars = require('./base');
// pass or at runtime.
};
- Handlebars.AST.PartialNode = function(id, context) {
- this.type = "partial";
-
- // TODO: disallow complex IDs
-
- this.id = id;
- this.context = context;
+ Handlebars.AST.PartialNode = function(partialName, context) {
+ this.type = "partial";
+ this.partialName = partialName;
+ this.context = context;
};
var verifyMatch = function(open, close) {
@@ -93,6 +90,11 @@ var Handlebars = require('./base');
this.isSimple = parts.length === 1 && !this.isScoped && depth === 0;
};
+ Handlebars.AST.PartialNameNode = function(name) {
+ this.type = "PARTIAL_NAME";
+ this.name = name;
+ };
+
Handlebars.AST.DataNode = function(id) {
this.type = "DATA";
this.id = id;