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.
This commit is contained in:
kpdecker
2014-11-28 22:58:21 -06:00
parent 8a6796e5c0
commit 928ba56b95
7 changed files with 269 additions and 214 deletions
+8 -7
View File
@@ -42,13 +42,14 @@ describe('ast', function() {
it('stores location info', function(){
var sexprNode = new handlebarsEnv.AST.SubExpression([{ original: 'foo'}], null);
var mustacheNode = new handlebarsEnv.AST.MustacheStatement(sexprNode, false, {});
var block = new handlebarsEnv.AST.BlockStatement(mustacheNode,
{body: [], strip: {}}, {body: [], strip: {}},
{
strip: {},
path: {original: 'foo'}
},
LOCATION_INFO);
var block = new handlebarsEnv.AST.BlockStatement(
mustacheNode,
{body: []},
{body: []},
{},
{},
{},
LOCATION_INFO);
testLocationInfoStorage(block);
});
});