Skip to content

Commit

Permalink
(chore) camelCase lint
Browse files Browse the repository at this point in the history
  • Loading branch information
joshgoebel committed Dec 23, 2020
1 parent eaa1c42 commit 6c2ff21
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
18 changes: 9 additions & 9 deletions src/lib/mode_compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,8 @@ export function compileLanguage(language, { plugins }) {

mode.contains.forEach(term => mm.addRule(term.begin, { rule: term, type: "begin" }));

if (mode.terminator_end) {
mm.addRule(mode.terminator_end, { type: "end" });
if (mode.terminatorEnd) {
mm.addRule(mode.terminatorEnd, { type: "end" });
}
if (mode.illegal) {
mm.addRule(mode.illegal, { type: "illegal" });
Expand Down Expand Up @@ -329,9 +329,9 @@ export function compileLanguage(language, { plugins }) {
if (mode.endSameAsBegin) mode.end = mode.begin;
if (!mode.end && !mode.endsWithParent) mode.end = /\B|\b/;
if (mode.end) cmode.endRe = langRe(mode.end);
cmode.terminator_end = regex.source(mode.end) || '';
if (mode.endsWithParent && parent.terminator_end) {
cmode.terminator_end += (mode.end ? '|' : '') + parent.terminator_end;
cmode.terminatorEnd = regex.source(mode.end) || '';
if (mode.endsWithParent && parent.terminatorEnd) {
cmode.terminatorEnd += (mode.end ? '|' : '') + parent.terminatorEnd;
}
}
if (mode.illegal) cmode.illegalRe = langRe(/** @type {RegExp | string} */ (mode.illegal));
Expand Down Expand Up @@ -391,17 +391,17 @@ function dependencyOnParent(mode) {
* @returns {Mode | Mode[]}
* */
function expandOrCloneMode(mode) {
if (mode.variants && !mode.cached_variants) {
mode.cached_variants = mode.variants.map(function(variant) {
if (mode.variants && !mode.cachedVariants) {
mode.cachedVariants = mode.variants.map(function(variant) {
return inherit(mode, { variants: null }, variant);
});
}

// EXPAND
// if we have variants then essentially "replace" the mode with the variants
// this happens in compileMode, where this function is called from
if (mode.cached_variants) {
return mode.cached_variants;
if (mode.cachedVariants) {
return mode.cachedVariants;
}

// CLONE
Expand Down
4 changes: 2 additions & 2 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ type CompiledMode = Omit<Mode, 'contains'> &
contains: CompiledMode[]
keywords: KeywordDict
data: Record<string, any>
terminator_end: string
terminatorEnd: string
keywordPatternRe: RegExp
beginRe: RegExp
endRe: RegExp
Expand Down Expand Up @@ -221,7 +221,7 @@ interface ModeDetails {
relevance?: number
illegal?: string | RegExp | Array<string | RegExp>
variants?: Mode[]
cached_variants?: Mode[]
cachedVariants?: Mode[]
// parsed
subLanguage?: string | string[]
compiled?: boolean
Expand Down

0 comments on commit 6c2ff21

Please sign in to comment.