File tree Expand file tree Collapse file tree 3 files changed +13
-29
lines changed Expand file tree Collapse file tree 3 files changed +13
-29
lines changed Original file line number Diff line number Diff line change @@ -376,10 +376,7 @@ export abstract class Node {
376
376
value : string ,
377
377
range : Range
378
378
) : StringLiteralExpression {
379
- var expr = new StringLiteralExpression ( ) ;
380
- expr . range = range ;
381
- expr . value = value ;
382
- return expr ;
379
+ return new TemplateLiteralExpression ( value , range ) ;
383
380
}
384
381
385
382
static createSuperExpression (
@@ -1443,12 +1440,16 @@ export class StringLiteralExpression extends LiteralExpression {
1443
1440
}
1444
1441
}
1445
1442
1446
- /** Represents a string template literal expression. */
1443
+ /** Represents a string literal expression. */
1447
1444
export class TemplateLiteralExpression extends LiteralExpression {
1448
- literalKind = LiteralKind . TEMPLATE ;
1449
-
1450
- /** String value without quotes. */
1451
- value : string ;
1445
+ constructor (
1446
+ /** String value without quotes. */
1447
+ public expresssionParts : Expression [ ] ,
1448
+ /** Source range. */
1449
+ range : Range
1450
+ ) {
1451
+ super ( LiteralKind . TEMPLATE , range ) ;
1452
+ }
1452
1453
}
1453
1454
1454
1455
/** Represents a `super` expression. */
Original file line number Diff line number Diff line change @@ -8780,9 +8780,9 @@ export class Compiler extends DiagnosticEmitter {
8780
8780
return module . unreachable ( ) ;
8781
8781
}
8782
8782
8783
- compileTemplateLiteral ( arg0 : TemplateLiteralExpression , constraints : Constraints ) : ExpressionRef {
8784
- const innerExpressions : ExpressionRef [ ] = [ ] ;
8785
-
8783
+ compileTemplateLiteral ( expr : TemplateLiteralExpression , constraints : Constraints ) : ExpressionRef {
8784
+ const innerExpressions : ExpressionRef [ ] = expr . expressionParts ;
8785
+
8786
8786
return 0 ;
8787
8787
}
8788
8788
Original file line number Diff line number Diff line change @@ -560,12 +560,8 @@ export class Tokenizer extends DiagnosticEmitter {
560
560
return Token . STRINGLITERAL ;
561
561
}
562
562
case CharCode . BACKTICK : { // TODO
563
- < < < << << HEAD
564
- return Token . TEMPLATELITERAL ; // expects a call to readString
565
- === === =
566
563
this . pos = pos ;
567
564
return Token . STRINGLITERAL ; // expects a call to readString
568
- > >>> >>> upstream / master
569
565
}
570
566
case CharCode . PERCENT : {
571
567
++ pos ;
@@ -1086,11 +1082,6 @@ export class Tokenizer extends DiagnosticEmitter {
1086
1082
1087
1083
readString ( quote : i32 = - 1 ) : string {
1088
1084
var text = this . source . text ;
1089
- < < < << << HEAD
1090
- quote = quote = = - 1 ? text . charCodeAt ( this . pos ++ ) : quote ;
1091
- var start = this . pos ;
1092
- === = ===
1093
- > >>> > >> upstream / master
1094
1085
var end = this . end ;
1095
1086
var pos = this . pos ;
1096
1087
var quote = text . charCodeAt ( pos ++ ) ;
@@ -1105,15 +1096,7 @@ export class Tokenizer extends DiagnosticEmitter {
1105
1096
) ;
1106
1097
break ;
1107
1098
}
1108
- << < < < << HEAD
1109
- let c = text . charCodeAt ( this . pos ) ;
1110
- if ( quote == CharCode . BACKTICK && c == CharCode . DOLLAR ) {
1111
- result += text . substring ( start , this . pos ) ;
1112
- break ;
1113
- }
1114
- === = ===
1115
1099
let c = text . charCodeAt ( pos ) ;
1116
- >>> > >>> upstream / master
1117
1100
if ( c == quote ) {
1118
1101
result += text . substring ( start , pos ++ ) ;
1119
1102
break ;
You can’t perform that action at this time.
0 commit comments