File tree 1 file changed +15
-2
lines changed
1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change 225
225
var ch = code . charCodeAt ( i ) ;
226
226
if ( needSpaceBetween ( lastCh , ch ) )
227
227
resultCode += " " ;
228
- if ( ch >= LEX_OPERATOR_START && ch < LEX_OPERATOR_START + TOKENS . length ) {
229
- resultCode += TOKENS [ ch - LEX_OPERATOR_START ] ;
228
+ if ( ch >= LEX_OPERATOR_START ) {
229
+ if ( ch == LEX_RAW_STRING8 ) { // decode raw strings
230
+ var len = code . charCodeAt ( i + 1 ) ;
231
+ resultCode += JSON . stringify ( code . substring ( i + 2 , i + 2 + len ) ) ;
232
+ i += 1 + len ;
233
+ } else if ( ch == LEX_RAW_STRING16 ) {
234
+ var len = code . charCodeAt ( i + 1 ) | ( code . charCodeAt ( i + 2 ) << 8 ) ;
235
+ resultCode += JSON . stringify ( code . substring ( i + 3 , i + 3 + len ) ) ;
236
+ i += 2 + len ;
237
+ } else if ( ch < LEX_OPERATOR_START + TOKENS . length ) // decoded other tokens
238
+ resultCode += TOKENS [ ch - LEX_OPERATOR_START ] ;
239
+ else {
240
+ console . warn ( "Unexpected pretokenised string code:" , ch ) ;
241
+ resultCode += code [ i ] ;
242
+ }
230
243
} else resultCode += code [ i ] ;
231
244
lastCh = ch ;
232
245
}
You can’t perform that action at this time.
0 commit comments