File tree Expand file tree Collapse file tree 3 files changed +28
-6
lines changed Expand file tree Collapse file tree 3 files changed +28
-6
lines changed Original file line number Diff line number Diff line change @@ -4273,6 +4273,7 @@ export class Parser extends DiagnosticEmitter {
4273
4273
// at '{': ... '}'
4274
4274
var depth = 1 ;
4275
4275
var again = true ;
4276
+ let readingTemplateString = false ;
4276
4277
do {
4277
4278
switch ( tn . next ( ) ) {
4278
4279
case Token . ENDOFFILE : {
@@ -4290,6 +4291,13 @@ export class Parser extends DiagnosticEmitter {
4290
4291
case Token . CLOSEBRACE : {
4291
4292
-- depth ;
4292
4293
if ( ! depth ) again = false ;
4294
+ if ( readingTemplateString ) {
4295
+ tn . readString ( CharCode . BACKTICK ) ;
4296
+ readingTemplateString = tn . readingTemplateString ;
4297
+ if ( readingTemplateString ) {
4298
+ ++ depth ;
4299
+ }
4300
+ }
4293
4301
break ;
4294
4302
}
4295
4303
case Token . IDENTIFIER : {
@@ -4301,13 +4309,10 @@ export class Parser extends DiagnosticEmitter {
4301
4309
break ;
4302
4310
}
4303
4311
case Token . TEMPLATELITERAL : {
4304
- if ( tn . readingTemplateString ) {
4305
- tn . readString ( CharCode . BACKTICK ) ;
4306
- } else {
4307
- tn . readString ( ) ;
4308
- }
4312
+ tn . readString ( ) ;
4313
+ readingTemplateString = tn . readingTemplateString ;
4309
4314
// in readString, tn.pos consume '${'
4310
- if ( tn . readingTemplateString ) {
4315
+ if ( readingTemplateString ) {
4311
4316
++ depth ;
4312
4317
}
4313
4318
break ;
Original file line number Diff line number Diff line change
1
+ {
2
+ for ( ) {
3
+ `Some string`
4
+ }
5
+
6
+ while ( ) {
7
+ `Some${ 11 } string`
8
+ }
9
+
10
+ if ( ) {
11
+ `Some${ "11" } string`
12
+ }
13
+ }
Original file line number Diff line number Diff line change
1
+ { }
2
+ // ERROR 1109: "Expression expected." in skip-error-block.ts(2,8+1)
3
+ // ERROR 1109: "Expression expected." in skip-error-block.ts(6,10+1)
4
+ // ERROR 1109: "Expression expected." in skip-error-block.ts(10,7+1)
You can’t perform that action at this time.
0 commit comments