@@ -73,7 +73,7 @@ export const indentation = new ExternalTokenizer((input, stack) => {
73
73
} )
74
74
75
75
// Flags used in Context objects
76
- const cx_Bracketed = 1 , cx_DoubleQuote = 2 , cx_Long = 4 , cx_Raw = 8 , cx_Format = 16
76
+ const cx_Bracketed = 1 , cx_String = 2 , cx_DoubleQuote = 4 , cx_Long = 8 , cx_Raw = 16 , cx_Format = 32
77
77
78
78
function Context ( parent , indent , flags ) {
79
79
this . parent = parent
@@ -108,13 +108,13 @@ const stringFlags = new Map([
108
108
[ stringStartFRD , cx_Format | cx_Raw | cx_DoubleQuote ] ,
109
109
[ stringStartFRL , cx_Format | cx_Raw | cx_Long ] ,
110
110
[ stringStartFRLD , cx_Format | cx_Raw | cx_Long | cx_DoubleQuote ]
111
- ] )
111
+ ] . map ( ( [ term , flags ] ) => [ term , flags | cx_String ] ) )
112
112
113
113
export const trackIndent = new ContextTracker ( {
114
114
start : topIndent ,
115
- reduce ( context , term ) {
115
+ reduce ( context , term , _ , input ) {
116
116
if ( ( context . flags & cx_Bracketed ) && bracketed . has ( term ) ||
117
- ( term == StringTerm || term == FormatString ) && context . flags && context . flags != cx_Bracketed )
117
+ ( term == StringTerm || term == FormatString ) && ( context . flags & cx_String ) )
118
118
return context . parent
119
119
return context
120
120
} ,
0 commit comments