diff options
author | kpdecker <kpdecker@gmail.com> | 2014-11-28 22:58:21 -0600 |
---|---|---|
committer | kpdecker <kpdecker@gmail.com> | 2014-11-28 23:13:06 -0600 |
commit | 928ba56b9577fd6cd874f0a83178f1265a6d0526 (patch) | |
tree | 1c522b0869f663e076e38cf741eac7370c798f90 /lib/handlebars/compiler/ast.js | |
parent | 8a6796e5c09686b47945a35826d77680d589d07c (diff) | |
download | handlebars.js-928ba56b9577fd6cd874f0a83178f1265a6d0526.zip handlebars.js-928ba56b9577fd6cd874f0a83178f1265a6d0526.tar.gz handlebars.js-928ba56b9577fd6cd874f0a83178f1265a6d0526.tar.bz2 |
Rework strip flags to make clearer at in AST level
Rather than keeping state in the AST, which requires some gymnastics, we create a separate visitor flow which does the top down iteration necessary to calculate all of the state needed for proper whitespace control evaluation.
Diffstat (limited to 'lib/handlebars/compiler/ast.js')
-rw-r--r-- | lib/handlebars/compiler/ast.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/handlebars/compiler/ast.js b/lib/handlebars/compiler/ast.js index 9f25443..72a56aa 100644 --- a/lib/handlebars/compiler/ast.js +++ b/lib/handlebars/compiler/ast.js @@ -20,14 +20,17 @@ var AST = { this.strip = strip; }, - BlockStatement: function(sexpr, program, inverse, strip, locInfo) { + BlockStatement: function(sexpr, program, inverse, openStrip, inverseStrip, closeStrip, locInfo) { this.loc = locInfo; this.type = 'BlockStatement'; this.sexpr = sexpr; this.program = program; this.inverse = inverse; - this.strip = strip; + + this.openStrip = openStrip; + this.inverseStrip = inverseStrip; + this.closeStrip = closeStrip; }, PartialStatement: function(sexpr, strip, locInfo) { @@ -37,7 +40,6 @@ var AST = { this.indent = ''; this.strip = strip; - this.strip.inlineStandalone = true; }, ContentStatement: function(string, locInfo) { @@ -52,7 +54,6 @@ var AST = { this.value = comment; this.strip = strip; - strip.inlineStandalone = true; }, SubExpression: function(path, params, hash, locInfo) { |