File tree Expand file tree Collapse file tree 4 files changed +12
-9
lines changed Expand file tree Collapse file tree 4 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -249,7 +249,7 @@ const HLJS = function(hljs) {
249249 if ( mode [ "on:end" ] ) {
250250 const resp = new Response ( mode ) ;
251251 mode [ "on:end" ] ( match , resp ) ;
252- if ( resp . ignore ) matched = false ;
252+ if ( resp . isMatchIgnored ) matched = false ;
253253 }
254254
255255 if ( matched ) {
@@ -301,7 +301,7 @@ const HLJS = function(hljs) {
301301 for ( const cb of beforeCallbacks ) {
302302 if ( ! cb ) continue ;
303303 cb ( match , resp ) ;
304- if ( resp . ignore ) return doIgnore ( lexeme ) ;
304+ if ( resp . isMatchIgnored ) return doIgnore ( lexeme ) ;
305305 }
306306
307307 if ( newMode && newMode . endSameAsBegin ) {
Original file line number Diff line number Diff line change @@ -279,7 +279,7 @@ export function compileLanguage(language, { plugins }) {
279279 */
280280 function compileMode ( mode , parent ) {
281281 const cmode = /** @type CompiledMode */ ( mode ) ;
282- if ( mode . compiled ) return cmode ;
282+ if ( mode . isCompiled ) return cmode ;
283283
284284 [
285285 // do this early so compiler extensions generally don't have to worry about
@@ -301,7 +301,7 @@ export function compileLanguage(language, { plugins }) {
301301 EXT . compileRelevance
302302 ] . forEach ( ext => ext ( mode , parent ) ) ;
303303
304- mode . compiled = true ;
304+ mode . isCompiled = true ;
305305
306306 let keywordPattern = null ;
307307 if ( typeof mode . keywords === "object" ) {
Original file line number Diff line number Diff line change 1+ /** @implements CallbackResponse */
12export default class Response {
23 /**
34 * @param {CompiledMode } mode
@@ -7,9 +8,10 @@ export default class Response {
78 if ( mode . data === undefined ) mode . data = { } ;
89
910 this . data = mode . data ;
11+ this . isMatchIgnored = false ;
1012 }
1113
1214 ignoreMatch ( ) {
13- this . ignore = true ;
15+ this . isMatchIgnored = true ;
1416 }
1517}
Original file line number Diff line number Diff line change @@ -125,6 +125,7 @@ interface HLJSOptions {
125125interface CallbackResponse {
126126 data : Record < string , any >
127127 ignoreMatch : ( ) => void
128+ isMatchIgnored : boolean
128129}
129130
130131/************
@@ -170,7 +171,7 @@ interface LanguageDetail {
170171 contains : ( Mode ) [ ]
171172 case_insensitive ?: boolean
172173 keywords ?: Record < string , any > | string
173- compiled ?: boolean ,
174+ isCompiled ?: boolean ,
174175 exports ?: any ,
175176 classNameAliases ?: Record < string , string >
176177 compilerExtensions ?: CompilerExt [ ]
@@ -180,7 +181,7 @@ interface LanguageDetail {
180181type Language = LanguageDetail & Partial < Mode >
181182
182183interface CompiledLanguage extends LanguageDetail , CompiledMode {
183- compiled : true
184+ isCompiled : true
184185 contains : CompiledMode [ ]
185186 keywords : Record < string , any >
186187}
@@ -199,7 +200,7 @@ type CompiledMode = Omit<Mode, 'contains'> &
199200 endRe : RegExp
200201 illegalRe : RegExp
201202 matcher : any
202- compiled : true
203+ isCompiled : true
203204 starts ?: CompiledMode
204205 parent ?: CompiledMode
205206 }
@@ -230,7 +231,7 @@ interface ModeDetails {
230231 cachedVariants ?: Mode [ ]
231232 // parsed
232233 subLanguage ?: string | string [ ]
233- compiled ?: boolean
234+ isCompiled ?: boolean
234235 label ?: string
235236}
236237
You can’t perform that action at this time.
0 commit comments