Skip to content

Commit 3aa5ab4

Browse files
committed
rename cleanup types more
1 parent db5f817 commit 3aa5ab4

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

src/languages/r.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export default function(hljs) {
5252
'standardGeneric substitute sum switch tan tanh tanpi tracemem' +
5353
'trigamma trunc unclass untracemem UseMethod xtfrm',
5454
},
55-
extensions: [
55+
compilerExtensions: [
5656
// allow beforeMatch to act as a "qualifier" for the match
5757
// the full match begin must be [beforeMatch][begin]
5858
(mode, parent) => {

src/lib/mode_compiler.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ import { compileKeywords } from "./compile_keywords.js";
1111
* Given the raw result of a language definition (Language), compiles this so
1212
* that it is ready for highlighting code.
1313
* @param {Language} language
14-
* @param {{plugins: HLJSPlugin[]] }} opts
14+
* @param {{plugins: HLJSPlugin[] }} opts
1515
* @returns {CompiledLanguage}
1616
*/
17-
export function compileLanguage(language, {plugins}) {
17+
export function compileLanguage(language, { plugins }) {
1818
/**
1919
* Builds a regex with the case sensativility of the current language
2020
*
@@ -289,7 +289,7 @@ export function compileLanguage(language, {plugins}) {
289289
].forEach(ext => ext(mode, parent));
290290

291291
plugins.forEach(plugin => plugin["beforeCompile:early"] && plugin["beforeCompile:early"](mode, parent));
292-
language.extensions.forEach(ext => ext(mode, parent));
292+
language.compilerExtensions.forEach(ext => ext(mode, parent));
293293
plugins.forEach(plugin => plugin["beforeCompile:late"] && plugin["beforeCompile:late"](mode, parent));
294294

295295
// __beforeBegin is considered private API, internal use only
@@ -352,7 +352,7 @@ export function compileLanguage(language, {plugins}) {
352352
return cmode;
353353
}
354354

355-
if (!language.extensions) language.extensions = [];
355+
if (!language.compilerExtensions) language.compilerExtensions = [];
356356

357357
// self is not valid at the top-level
358358
if (language.contains && language.contains.includes('self')) {

types/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ interface LanguageDetail {
163163
compiled?: boolean,
164164
exports?: any,
165165
classNameAliases?: Record<string, string>
166+
compilerExtensions?: CompilerExt[]
166167
}
167168

168169
type Language = LanguageDetail & Partial<Mode>

0 commit comments

Comments
 (0)