Parse and output ES6 template strings. Yikes!

This commit is contained in:
Fábio Santos
2015-09-05 22:32:57 +01:00
parent af22b9c657
commit e1cb1a0e3c
4 changed files with 79 additions and 1 deletions

View File

@@ -501,6 +501,22 @@ var AST_Destructuring = DEFNODE("Destructuring", "names is_array", {
}
});
var AST_TemplateString = DEFNODE("TemplateString", "segments", {
$documentation: "A template string literal",
$propdoc: {
segments: "[string|AST_Expression]* One or more segments. They can be the parts that are evaluated, or the raw string parts."
},
_walk: function(visitor) {
return visitor._visit(this, function(){
this.segments.forEach(function(seg, i){
if (i % 2 !== 0) {
seg._walk(visitor);
}
});
});
}
});
/* -----[ JUMPS ]----- */
var AST_Jump = DEFNODE("Jump", null, {