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:
+8
-7
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user