summaryrefslogtreecommitdiffstats
path: root/lib/handlebars/compiler/base.js
diff options
context:
space:
mode:
authorkpdecker <kpdecker@gmail.com>2014-11-28 22:58:21 -0600
committerkpdecker <kpdecker@gmail.com>2014-11-28 23:13:06 -0600
commit928ba56b9577fd6cd874f0a83178f1265a6d0526 (patch)
tree1c522b0869f663e076e38cf741eac7370c798f90 /lib/handlebars/compiler/base.js
parent8a6796e5c09686b47945a35826d77680d589d07c (diff)
downloadhandlebars.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/base.js')
-rw-r--r--lib/handlebars/compiler/base.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/handlebars/compiler/base.js b/lib/handlebars/compiler/base.js
index 786c37e..ff237ec 100644
--- a/lib/handlebars/compiler/base.js
+++ b/lib/handlebars/compiler/base.js
@@ -1,5 +1,6 @@
import parser from "./parser";
import AST from "./ast";
+import WhitespaceControl from "./whitespace-control";
module Helpers from "./helpers";
import { extend } from "../utils";
@@ -19,5 +20,6 @@ export function parse(input, options) {
return new yy.SourceLocation(options && options.srcName, locInfo);
};
- return parser.parse(input);
+ var strip = new WhitespaceControl();
+ return strip.accept(parser.parse(input));
}