feat(transpiler): Transform template strings to triple quoted Dart strings
This commit is contained in:
parent
4f416694a5
commit
93f6d26f68
|
@ -5,5 +5,10 @@ export function main() {
|
|||
it('string interpolation', function() {
|
||||
expect(`${123}-'${456}"`).toEqual('123-\'456"');
|
||||
});
|
||||
|
||||
it('multiline string', function () {
|
||||
expect(`1'
|
||||
2"`).toEqual('1\'\n2"');
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -75,12 +75,11 @@ export class DartParseTreeWriter extends JavaScriptParseTreeWriter {
|
|||
|
||||
visitTemplateLiteralExpression(tree) {
|
||||
if (tree.operand) {
|
||||
this.visitAny(tree.operand);
|
||||
this.writeSpace_();
|
||||
throw new Error('tagged template strings are not supported');
|
||||
}
|
||||
this.writeRaw_('"');
|
||||
this.writeRaw_("'''");
|
||||
this.visitList(tree.elements);
|
||||
this.writeRaw_('"');
|
||||
this.writeRaw_("'''");
|
||||
}
|
||||
|
||||
visitTemplateLiteralPortion(tree) {
|
||||
|
|
Loading…
Reference in New Issue