File tree Expand file tree Collapse file tree 4 files changed +14
-29
lines changed
Expand file tree Collapse file tree 4 files changed +14
-29
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ under the licensing terms detailed in LICENSE:
2525* Guido Zuidhof <me@guido.io>
2626* ncave <777696+ncave@users.noreply.github.com>
2727* Andrew Davis <pulpdrew@gmail.com>
28+ * Fred <codingsh@pm.me>
2829
2930Portions of this software are derived from third-party works licensed under
3031the following terms:
Original file line number Diff line number Diff line change @@ -376,10 +376,7 @@ export abstract class Node {
376376 value : string ,
377377 range : Range
378378 ) : StringLiteralExpression {
379- var expr = new StringLiteralExpression ( ) ;
380- expr . range = range ;
381- expr . value = value ;
382- return expr ;
379+ return new TemplateLiteralExpression ( value , range ) ;
383380 }
384381
385382 static createSuperExpression (
@@ -1443,12 +1440,16 @@ export class StringLiteralExpression extends LiteralExpression {
14431440 }
14441441}
14451442
1446- /** Represents a string template literal expression. */
1443+ /** Represents a string literal expression. */
14471444export 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+ }
14521453}
14531454
14541455/** Represents a `super` expression. */
Original file line number Diff line number Diff line change @@ -8780,9 +8780,9 @@ export class Compiler extends DiagnosticEmitter {
87808780 return module . unreachable ( ) ;
87818781 }
87828782
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+
87868786 return 0 ;
87878787 }
87888788
Original file line number Diff line number Diff line change @@ -560,12 +560,8 @@ export class Tokenizer extends DiagnosticEmitter {
560560 return Token . STRINGLITERAL ;
561561 }
562562 case CharCode . BACKTICK : { // TODO
563- < < < << << HEAD
564- return Token . TEMPLATELITERAL ; // expects a call to readString
565- === === =
566563 this . pos = pos ;
567564 return Token . STRINGLITERAL ; // expects a call to readString
568- > >>> >>> upstream / master
569565 }
570566 case CharCode . PERCENT : {
571567 ++ pos ;
@@ -1086,11 +1082,6 @@ export class Tokenizer extends DiagnosticEmitter {
10861082
10871083 readString ( quote : i32 = - 1 ) : string {
10881084 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
10941085 var end = this . end ;
10951086 var pos = this . pos ;
10961087 var quote = text . charCodeAt ( pos ++ ) ;
@@ -1105,15 +1096,7 @@ export class Tokenizer extends DiagnosticEmitter {
11051096 ) ;
11061097 break ;
11071098 }
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- === = ===
11151099 let c = text . charCodeAt ( pos ) ;
1116- >>> > >>> upstream / master
11171100 if ( c == quote ) {
11181101 result += text . substring ( start , pos ++ ) ;
11191102 break ;
You can’t perform that action at this time.
0 commit comments