Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

codemirror

Package Overview
Dependencies
Maintainers
1
Versions
151
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

codemirror - npm Package Compare versions

Comparing version 5.8.0 to 5.9.0

README.md

4

addon/fold/comment-fold.js

@@ -31,3 +31,5 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others

if (pass == 1 && found < start.ch) return;
if (/comment/.test(cm.getTokenTypeAt(CodeMirror.Pos(line, found + 1)))) {
if (/comment/.test(cm.getTokenTypeAt(CodeMirror.Pos(line, found + 1))) &&
(lineText.slice(found - endToken.length, found) == endToken ||
!/comment/.test(cm.getTokenTypeAt(CodeMirror.Pos(line, found))))) {
startCh = found + startToken.length;

@@ -34,0 +36,0 @@ break;

@@ -298,2 +298,9 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others

if (completion.options.completeOnSingleClick)
CodeMirror.on(hints, "mousemove", function(e) {
var elt = getHintElement(hints, e.target || e.srcElement);
if (elt && elt.hintId != null)
widget.changeActive(elt.hintId);
});
CodeMirror.signal(data, "select", completions[0], hints.firstChild);

@@ -434,3 +441,3 @@ return true;

closeOnUnfocus: true,
completeOnSingleClick: false,
completeOnSingleClick: true,
container: null,

@@ -437,0 +444,0 @@ customKeys: null,

@@ -179,1 +179,2 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others

require.cache[require.resolve("../../lib/codemirror")] = require.cache[require.resolve("./runmode.node")];
require.cache[require.resolve("../../addon/runmode/runmode")] = require.cache[require.resolve("./runmode.node")];

@@ -54,3 +54,3 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others

var hScale = (cm.getWrapperElement().clientHeight - cm.display.barHeight - this.buttonHeight * 2) /
cm.heightAtLine(cm.lastLine() + 1, "local");
cm.getScrollerElement().scrollHeight
if (hScale != this.hScale) {

@@ -57,0 +57,0 @@ this.hScale = hScale;

@@ -32,3 +32,3 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others

if (match && match.index == stream.pos) {
stream.pos += match[0].length;
stream.pos += match[0].length || 1;
return "searching";

@@ -35,0 +35,0 @@ } else if (match) {

@@ -138,2 +138,3 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others

destroy: function () {
closeArgHints(this)
if (this.worker) {

@@ -140,0 +141,0 @@ this.worker.terminate();

@@ -30,3 +30,4 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others

isPunctuationChar = parserConfig.isPunctuationChar || /[\[\]{}\(\),;\:\.]/,
isNumberChar = parserConfig.isNumberChar || /\d/,
numberStart = parserConfig.numberStart || /[\d\.]/,
number = parserConfig.number || /^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)?/i,
isOperatorChar = parserConfig.isOperatorChar || /[+\-*&%=<>!?|\/]/,

@@ -51,5 +52,6 @@ endStatement = parserConfig.endStatement || /^[;:,]$/;

}
if (isNumberChar.test(ch)) {
stream.eatWhile(/[\w\.]/);
return "number";
if (numberStart.test(ch)) {
stream.backUp(1)
if (stream.match(number)) return "number"
stream.next()
}

@@ -225,2 +227,6 @@ if (ch == "/") {

var switchBlock = ctx.prev && ctx.prev.type == "switchstatement";
if (parserConfig.allmanIndentation && /[{(]/.test(firstChar)) {
while (ctx.type != "top" && ctx.type != "}") ctx = ctx.prev
return ctx.indented
}
if (isStatement(ctx.type))

@@ -258,4 +264,3 @@ return ctx.indented + (firstChar == "{" ? 0 : statementIndentUnit);

var cKeywords = "auto if break case register continue return default do sizeof " +
"static else struct switch extern typedef float union for " +
"goto while enum const volatile";
"static else struct switch extern typedef union for goto while enum const volatile";
var cTypes = "int long char short double float unsigned signed void size_t ptrdiff_t";

@@ -537,2 +542,19 @@

function tokenKotlinString(tripleString){
return function (stream, state) {
var escaped = false, next, end = false;
while (!stream.eol()) {
if (!tripleString && !escaped && stream.match('"') ) {end = true; break;}
if (tripleString && stream.match('"""')) {end = true; break;}
next = stream.next();
if(!escaped && next == "$" && stream.match('{'))
stream.skipTo("}");
escaped = !escaped && next == "\\" && !tripleString;
}
if (end || !tripleString)
state.tokenize = null;
return "string";
}
}
def("text/x-kotlin", {

@@ -544,3 +566,3 @@ name: "clike",

"var fun for is in This throw return " +
"break continue object if else while do try when !in !is as?" +
"break continue object if else while do try when !in !is as? " +

@@ -551,3 +573,3 @@ /*soft keywords*/

"sealed field property receiver param sparam lateinit data inline noinline tailrec " +
"external annotation crossinline"
"external annotation crossinline const operator infix"
),

@@ -561,2 +583,4 @@ types: words(

),
intendSwitch: false,
indentStatements: false,
multiLineStrings: true,

@@ -566,2 +590,8 @@ blockKeywords: words("catch class do else finally for if where try while enum"),

atoms: words("true false null this"),
hooks: {
'"': function(stream, state) {
state.tokenize = tokenKotlinString(stream.match('""'));
return state.tokenize(stream, state);
}
},
modeProps: {closeBrackets: {triples: '"'}}

@@ -715,3 +745,4 @@ });

isOperatorChar: /[+\-*&%=<>!?|^~:\/]/,
isNumberChar: /[\d#$]/,
numberStart: /[\d#$]/,
number: /^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i,
multiLineStrings: true,

@@ -718,0 +749,0 @@ typeFirstDefinitions: true,

@@ -231,3 +231,3 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others

if (type == "hash" && !/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(stream.current())) {
if (type == "hash" && !/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(stream.current())) {
override += " error";

@@ -234,0 +234,0 @@ } else if (type == "word") {

@@ -18,3 +18,3 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others

"try catch finally do else for if switch while import library export " +
"part of show hide is").split(" ");
"part of show hide is as").split(" ");
var blockKeywords = "try catch finally do else for if switch while".split(" ");

@@ -50,3 +50,3 @@ var atoms = "true false null".split(" ");

"@": function(stream) {
stream.eatWhile(/[\w\$_]/);
stream.eatWhile(/[\w\$_\.]/);
return "meta";

@@ -100,3 +100,3 @@ },

}
escaped = !escaped && next == "\\";
escaped = !raw && !escaped && next == "\\";
}

@@ -103,0 +103,0 @@ return "string";

@@ -17,10 +17,10 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others

CodeMirror.defineMode("django:inner", function() {
var keywords = ["block", "endblock", "for", "endfor", "true", "false",
"loop", "none", "self", "super", "if", "endif", "as",
"else", "import", "with", "endwith", "without", "context", "ifequal", "endifequal",
"ifnotequal", "endifnotequal", "extends", "include", "load", "comment",
"endcomment", "empty", "url", "static", "trans", "blocktrans", "now", "regroup",
"lorem", "ifchanged", "endifchanged", "firstof", "debug", "cycle", "csrf_token",
"autoescape", "endautoescape", "spaceless", "ssi", "templatetag",
"verbatim", "endverbatim", "widthratio"],
var keywords = ["block", "endblock", "for", "endfor", "true", "false", "filter", "endfilter",
"loop", "none", "self", "super", "if", "elif", "endif", "as", "else", "import",
"with", "endwith", "without", "context", "ifequal", "endifequal", "ifnotequal",
"endifnotequal", "extends", "include", "load", "comment", "endcomment",
"empty", "url", "static", "trans", "blocktrans", "endblocktrans", "now",
"regroup", "lorem", "ifchanged", "endifchanged", "firstof", "debug", "cycle",
"csrf_token", "autoescape", "endautoescape", "spaceless", "endspaceless",
"ssi", "templatetag", "verbatim", "endverbatim", "widthratio"],
filters = ["add", "addslashes", "capfirst", "center", "cut", "date",

@@ -27,0 +27,0 @@ "default", "default_if_none", "dictsort",

@@ -88,4 +88,6 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others

} else if (ch == "{") {
state.tokenize = rubyInQuote("}");
return state.tokenize(stream, state);
if (!stream.match(/^\{%.*/)) {
state.tokenize = rubyInQuote("}");
return state.tokenize(stream, state);
}
}

@@ -92,0 +94,0 @@ }

@@ -24,4 +24,4 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others

// Double and single quotes
{ regex: /"(?:[^\\]|\\.)*?"/, token: "string" },
{ regex: /'(?:[^\\]|\\.)*?'/, token: "string" },
{ regex: /"(?:[^\\"]|\\.)*"?/, token: "string" },
{ regex: /'(?:[^\\']|\\.)*'?/, token: "string" },

@@ -28,0 +28,0 @@ // Handlebars keywords

@@ -35,3 +35,3 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others

"var": kw("var"), "const": kw("var"), "let": kw("var"),
"async": kw("async"), "function": kw("function"), "catch": kw("catch"),
"function": kw("function"), "catch": kw("catch"),
"for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"),

@@ -41,3 +41,3 @@ "in": operator, "typeof": operator, "instanceof": operator,

"this": kw("this"), "class": kw("class"), "super": kw("atom"),
"await": C, "yield": C, "export": kw("export"), "import": kw("import"), "extends": C
"yield": C, "export": kw("export"), "import": kw("import"), "extends": C
};

@@ -126,4 +126,3 @@

return ret("comment", "comment");
} else if (state.lastType == "operator" || state.lastType == "keyword c" ||
state.lastType == "sof" || /^[\[{}\(,;:]$/.test(state.lastType)) {
} else if (/^(?:operator|sof|keyword c|case|new|[\[{}\(,;:])$/.test(state.lastType)) {
readRegexp(stream);

@@ -379,3 +378,2 @@ stream.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/);

if (atomicTypes.hasOwnProperty(type)) return cont(maybeop);
if (type == "async") return cont(expression);
if (type == "function") return cont(functiondef, maybeop);

@@ -459,5 +457,3 @@ if (type == "keyword c") return cont(noComma ? maybeexpressionNoComma : maybeexpression);

function objprop(type, value) {
if (type == "async") {
return cont(objprop);
} else if (type == "variable" || cx.style == "keyword") {
if (type == "variable" || cx.style == "keyword") {
cx.marked = "property";

@@ -473,2 +469,4 @@ if (value == "get" || value == "set") return cont(getterSetter);

return cont(expression, expect("]"), afterprop);
} else if (type == "spread") {
return cont(expression);
}

@@ -475,0 +473,0 @@ }

@@ -286,3 +286,3 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others

}
return (state.scopes.length + delta) * 4;
return (state.scopes.length + delta) * _conf.indentUnit;
},

@@ -289,0 +289,0 @@

@@ -715,3 +715,3 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others

prevLine: s.prevLine,
thisLine: s.this,
thisLine: s.thisLine,

@@ -718,0 +718,0 @@ block: s.block,

@@ -20,29 +20,61 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others

{regex: /(?:[+-]?)(?:0x[\d,a-f]+)|(?:0o[0-7]+)|(?:0b[0,1]+)|(?:\d+.?\d*)/, token: "number"},
// Strings
{ regex: /"(?:[^\\"]|\\.)*"?/, token: "string" },
{ regex: /'(?:[^\\']|\\.)*'?/, token: "string" },
{ regex: /`(?:[^\\`]|\\.)*`?/, token: "string" },
// Compile Time Commands
{regex: /(?:\!(include|addincludedir|addplugindir|appendfile|cd|delfile|echo|error|execute|packhdr|finalize|getdllversion|system|tempfile|warning|verbose|define|undef|insertmacro|makensis|searchparse|searchreplace))\b/, token: "keyword"},
// Conditional Compilation
{regex: /(?:\!(if(?:n?def)?|ifmacron?def|macro))\b/, token: "keyword", indent: true},
{regex: /(?:\!(else|endif|macroend))\b/, token: "keyword", dedent: true},
// Runtime Commands
{regex: /(?:Abort|AddBrandingImage|AddSize|AllowRootDirInstall|AllowSkipFiles|AutoCloseWindow|BGFont|BGGradient|BrandingText|BringToFront|Call|CallInstDLL|Caption|ChangeUI|CheckBitmap|ClearErrors|CompletedText|ComponentText|CopyFiles|CRCCheck|CreateDirectory|CreateFont|CreateShortCut|Delete|DeleteINISec|DeleteINIStr|DeleteRegKey|DeleteRegValue|DetailPrint|DetailsButtonText|DirText|DirVar|DirVerify|EnableWindow|EnumRegKey|EnumRegValue|Exch|Exec|ExecShell|ExecWait|ExpandEnvStrings|File|FileBufSize|FileClose|FileErrorText|FileOpen|FileRead|FileReadByte|FileReadUTF16LE|FileReadWord|FileWriteUTF16LE|FileSeek|FileWrite|FileWriteByte|FileWriteWord|FindClose|FindFirst|FindNext|FindWindow|FlushINI|GetCurInstType|GetCurrentAddress|GetDlgItem|GetDLLVersion|GetDLLVersionLocal|GetErrorLevel|GetFileTime|GetFileTimeLocal|GetFullPathName|GetFunctionAddress|GetInstDirError|GetLabelAddress|GetTempFileName|Goto|HideWindow|Icon|IfAbort|IfErrors|IfFileExists|IfRebootFlag|IfSilent|InitPluginsDir|InstallButtonText|InstallColors|InstallDir|InstallDirRegKey|InstProgressFlags|InstType|InstTypeGetText|InstTypeSetText|IntCmp|IntCmpU|IntFmt|IntOp|IsWindow|LangString|LicenseBkColor|LicenseData|LicenseForceSelection|LicenseLangString|LicenseText|LoadLanguageFile|LockWindow|LogSet|LogText|ManifestDPIAware|ManifestSupportedOS|MessageBox|MiscButtonText|Name|Nop|OutFile|Page|PageCallbacks|Pop|Push|Quit|ReadEnvStr|ReadINIStr|ReadRegDWORD|ReadRegStr|Reboot|RegDLL|Rename|RequestExecutionLevel|ReserveFile|Return|RMDir|SearchPath|SectionGetFlags|SectionGetInstTypes|SectionGetSize|SectionGetText|SectionIn|SectionSetFlags|SectionSetInstTypes|SectionSetSize|SectionSetText|SendMessage|SetAutoClose|SetBrandingImage|SetCompress|SetCompressor|SetCompressorDictSize|SetCtlColors|SetCurInstType|SetDatablockOptimize|SetDateSave|SetDetailsPrint|SetDetailsView|SetErrorLevel|SetErrors|SetFileAttributes|SetFont|SetOutPath|SetOverwrite|SetPluginUnload|SetRebootFlag|SetRegView|SetShellVarContext|SetSilent|ShowInstDetails|ShowUninstDetails|ShowWindow|SilentInstall|SilentUnInstall|Sleep|SpaceTexts|StrCmp|StrCmpS|StrCpy|StrLen|SubCaption|Unicode|UninstallButtonText|UninstallCaption|UninstallIcon|UninstallSubCaption|UninstallText|UninstPage|UnRegDLL|Var|VIAddVersionKey|VIFileVersion|VIProductVersion|WindowIcon|WriteINIStr|WriteRegBin|WriteRegDWORD|WriteRegExpandStr|WriteRegStr|WriteUninstaller|XPStyle)\b/, token: "keyword"},
{regex: /\b(?:Abort|AddBrandingImage|AddSize|AllowRootDirInstall|AllowSkipFiles|AutoCloseWindow|BGFont|BGGradient|BrandingText|BringToFront|Call|CallInstDLL|Caption|ChangeUI|CheckBitmap|ClearErrors|CompletedText|ComponentText|CopyFiles|CRCCheck|CreateDirectory|CreateFont|CreateShortCut|Delete|DeleteINISec|DeleteINIStr|DeleteRegKey|DeleteRegValue|DetailPrint|DetailsButtonText|DirText|DirVar|DirVerify|EnableWindow|EnumRegKey|EnumRegValue|Exch|Exec|ExecShell|ExecWait|ExpandEnvStrings|File|FileBufSize|FileClose|FileErrorText|FileOpen|FileRead|FileReadByte|FileReadUTF16LE|FileReadWord|FileWriteUTF16LE|FileSeek|FileWrite|FileWriteByte|FileWriteWord|FindClose|FindFirst|FindNext|FindWindow|FlushINI|GetCurInstType|GetCurrentAddress|GetDlgItem|GetDLLVersion|GetDLLVersionLocal|GetErrorLevel|GetFileTime|GetFileTimeLocal|GetFullPathName|GetFunctionAddress|GetInstDirError|GetLabelAddress|GetTempFileName|Goto|HideWindow|Icon|IfAbort|IfErrors|IfFileExists|IfRebootFlag|IfSilent|InitPluginsDir|InstallButtonText|InstallColors|InstallDir|InstallDirRegKey|InstProgressFlags|InstType|InstTypeGetText|InstTypeSetText|IntCmp|IntCmpU|IntFmt|IntOp|IsWindow|LangString|LicenseBkColor|LicenseData|LicenseForceSelection|LicenseLangString|LicenseText|LoadLanguageFile|LockWindow|LogSet|LogText|ManifestDPIAware|ManifestSupportedOS|MessageBox|MiscButtonText|Name|Nop|OutFile|Page|PageCallbacks|Pop|Push|Quit|ReadEnvStr|ReadINIStr|ReadRegDWORD|ReadRegStr|Reboot|RegDLL|Rename|RequestExecutionLevel|ReserveFile|Return|RMDir|SearchPath|SectionGetFlags|SectionGetInstTypes|SectionGetSize|SectionGetText|SectionIn|SectionSetFlags|SectionSetInstTypes|SectionSetSize|SectionSetText|SendMessage|SetAutoClose|SetBrandingImage|SetCompress|SetCompressor|SetCompressorDictSize|SetCtlColors|SetCurInstType|SetDatablockOptimize|SetDateSave|SetDetailsPrint|SetDetailsView|SetErrorLevel|SetErrors|SetFileAttributes|SetFont|SetOutPath|SetOverwrite|SetPluginUnload|SetRebootFlag|SetRegView|SetShellVarContext|SetSilent|ShowInstDetails|ShowUninstDetails|ShowWindow|SilentInstall|SilentUnInstall|Sleep|SpaceTexts|StrCmp|StrCmpS|StrCpy|StrLen|SubCaption|Unicode|UninstallButtonText|UninstallCaption|UninstallIcon|UninstallSubCaption|UninstallText|UninstPage|UnRegDLL|Var|VIAddVersionKey|VIFileVersion|VIProductVersion|WindowIcon|WriteINIStr|WriteRegBin|WriteRegDWORD|WriteRegExpandStr|WriteRegStr|WriteUninstaller|XPStyle)\b/, token: "keyword"},
{regex: /\b(?:Function|PageEx|Section(?:Group)?)\b/, token: "keyword", indent: true},
{regex: /\b(?:(Function|PageEx|Section(?:Group)?)End)\b/, token: "keyword", dedent: true},
// Options
// Command Options
{regex: /\b(?:ARCHIVE|FILE_ATTRIBUTE_ARCHIVE|FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_NORMAL|FILE_ATTRIBUTE_OFFLINE|FILE_ATTRIBUTE_READONLY|FILE_ATTRIBUTE_SYSTEM|FILE_ATTRIBUTE_TEMPORARY|HIDDEN|HKCC|HKCR|HKCU|HKDD|HKEY_CLASSES_ROOT|HKEY_CURRENT_CONFIG|HKEY_CURRENT_USER|HKEY_DYN_DATA|HKEY_LOCAL_MACHINE|HKEY_PERFORMANCE_DATA|HKEY_USERS|HKLM|HKPD|HKU|IDABORT|IDCANCEL|IDD_DIR|IDD_INST|IDD_INSTFILES|IDD_LICENSE|IDD_SELCOM|IDD_UNINST|IDD_VERIFY|IDIGNORE|IDNO|IDOK|IDRETRY|IDYES|MB_ABORTRETRYIGNORE|MB_DEFBUTTON1|MB_DEFBUTTON2|MB_DEFBUTTON3|MB_DEFBUTTON4|MB_ICONEXCLAMATION|MB_ICONINFORMATION|MB_ICONQUESTION|MB_ICONSTOP|MB_OK|MB_OKCANCEL|MB_RETRYCANCEL|MB_RIGHT|MB_RTLREADING|MB_SETFOREGROUND|MB_TOPMOST|MB_USERICON|MB_YESNO|MB_YESNOCANCEL|NORMAL|OFFLINE|READONLY|SHCTX|SHELL_CONTEXT|SW_HIDE|SW_SHOWDEFAULT|SW_SHOWMAXIMIZED|SW_SHOWMINIMIZED|SW_SHOWNORMAL|SYSTEM|TEMPORARY)\b/, token: "atom"},
{regex: /\b(?:admin|all|auto|both|bottom|bzip2|components|current|custom|directory|force|hide|highest|ifdiff|ifnewer|instfiles|lastused|leave|left|license|listonly|lzma|nevershow|none|normal|notset|right|show|silent|silentlog|textonly|top|try|un\.components|un\.custom|un\.directory|un\.instfiles|un\.license|uninstConfirm|user|Win10|Win7|Win8|WinVista|zlib)\b/, token: "builtin"},
// LogicLib
{regex: /\$\{(?:End(If|Unless|While)|Loop(?:Until)|Next)\}/, token: "variable-2", dedent: true},
{regex: /\$\{(?:Do(Until|While)|Else(?:If(?:Not)?)?|For(?:Each)?|(?:(?:And|Else|Or)?If(?:Cmd|Not|Then)?|Unless)|While)\}/, token: "variable-2", indent: true},
// LogicLib.nsh
{regex: /\$\{(?:And(?:If(?:Not)?|Unless)|Break|Case(?:Else)?|Continue|Default|Do(?:Until|While)?|Else(?:If(?:Not)?|Unless)?|End(?:If|Select|Switch)|Exit(?:Do|For|While)|For(?:Each)?|If(?:Cmd|Not(?:Then)?|Then)?|Loop(?:Until|While)?|Or(?:If(?:Not)?|Unless)|Select|Switch|Unless|While)\}/, token: "variable-2", indent: true},
// FileFunc.nsh
{regex: /\$\{(?:BannerTrimPath|DirState|DriveSpace|Get(BaseName|Drives|ExeName|ExePath|FileAttributes|FileExt|FileName|FileVersion|Options|OptionsS|Parameters|Parent|Root|Size|Time)|Locate|RefreshShellIcons)\}/, token: "variable-2", dedent: true},
// Memento.nsh
{regex: /\$\{(?:Memento(?:Section(?:Done|End|Restore|Save)?|UnselectedSection))\}/, token: "variable-2", dedent: true},
// TextFunc.nsh
{regex: /\$\{(?:Config(?:Read|ReadS|Write|WriteS)|File(?:Join|ReadFromEnd|Recode)|Line(?:Find|Read|Sum)|Text(?:Compare|CompareS)|TrimNewLines)\}/, token: "variable-2", dedent: true},
// WinVer.nsh
{regex: /\$\{(?:(?:At(?:Least|Most)|Is)(?:ServicePack|Win(?:7|8|10|95|98|200(?:0|3|8(?:R2)?)|ME|NT4|Vista|XP))|Is(?:NT|Server))\}/, token: "variable", dedent: true},
// WordFunc.nsh
{regex: /\$\{(?:StrFilterS?|Version(?:Compare|Convert)|Word(?:AddS?|Find(?:(?:2|3)X)?S?|InsertS?|ReplaceS?))\}/, token: "variable-2", dedent: true},
// x64.nsh
{regex: /\$\{(?:RunningX64)\}/, token: "variable", dedent: true},
{regex: /\$\{(?:Disable|Enable)X64FSRedirection\}/, token: "variable-2", dedent: true},
// Line Comment
{regex: /(#|;).*/, token: "comment"},
// Block Comment
{regex: /\/\*/, token: "comment", next: "comment"},
// Operator
{regex: /[-+\/*=<>!]+/, token: "operator"},
// Variable
{regex: /\$[\w]+/, token: "variable"},
// Constant
{regex: /\${[\w]+}/,token: "variable-2"},
// Language String

@@ -49,0 +81,0 @@ {regex: /\$\([\w]+\)/,token: "variable-3"}

@@ -51,14 +51,14 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others

var singleDelimiters = parserConf.singleDelimiters || new RegExp("^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]");
var doubleOperators = parserConf.doubleOperators || new RegExp("^((==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))");
var doubleDelimiters = parserConf.doubleDelimiters || new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))");
var tripleDelimiters = parserConf.tripleDelimiters || new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))");
var singleDelimiters = parserConf.singleDelimiters || /^[\(\)\[\]\{\}@,:`=;\.]/;
var doubleOperators = parserConf.doubleOperators || /^([!<>]==|<>|<<|>>|\/\/|\*\*)/;
var doubleDelimiters = parserConf.doubleDelimiters || /^(\+=|\-=|\*=|%=|\/=|&=|\|=|\^=)/;
var tripleDelimiters = parserConf.tripleDelimiters || /^(\/\/=|>>=|<<=|\*\*=)/;
if (parserConf.version && parseInt(parserConf.version, 10) == 3){
// since http://legacy.python.org/dev/peps/pep-0465/ @ is also an operator
var singleOperators = parserConf.singleOperators || new RegExp("^[\\+\\-\\*/%&|\\^~<>!@]");
var identifiers = parserConf.identifiers|| new RegExp("^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*");
var singleOperators = parserConf.singleOperators || /^[\+\-\*\/%&|\^~<>!@]/;
var identifiers = parserConf.identifiers|| /^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*/;
} else {
var singleOperators = parserConf.singleOperators || new RegExp("^[\\+\\-\\*/%&|\\^~<>!]");
var identifiers = parserConf.identifiers|| new RegExp("^[_A-Za-z][_A-Za-z0-9]*");
var singleOperators = parserConf.singleOperators || /^[\+\-\*\/%&|\^~<>!]/;
var identifiers = parserConf.identifiers|| /^[_A-Za-z][_A-Za-z0-9]*/;
}

@@ -164,3 +164,3 @@

if (stream.match(tripleDelimiters) || stream.match(doubleDelimiters))
return null;
return "punctuation";

@@ -171,4 +171,7 @@ if (stream.match(doubleOperators) || stream.match(singleOperators))

if (stream.match(singleDelimiters))
return null;
return "punctuation";
if (state.lastToken == "." && stream.match(identifiers))
return "property";
if (stream.match(keywords) || stream.match(wordOperators))

@@ -252,13 +255,2 @@ return "keyword";

// Handle '.' connected identifiers
if (current == ".") {
style = stream.match(identifiers, false) ? null : ERRORCLASS;
if (style == null && state.lastStyle == "meta") {
// Apply 'meta' style to '.' connected identifiers when
// appropriate.
style = "meta";
}
return style;
}
// Handle decorators

@@ -274,3 +266,3 @@ if (current == "@"){

if ((style == "variable" || style == "builtin")
&& state.lastStyle == "meta")
&& state.lastToken == "meta")
style = "meta";

@@ -308,3 +300,2 @@

scopes: [{offset: basecolumn || 0, type: "py", align: null}],
lastStyle: null,
lastToken: null,

@@ -321,8 +312,6 @@ lambda: false,

state.lastStyle = style;
if (style && style != "comment")
state.lastToken = (style == "keyword" || style == "punctuation") ? stream.current() : style;
if (style == "punctuation") style = null;
var current = stream.current();
if (current && style)
state.lastToken = current;
if (stream.eol() && state.lambda)

@@ -329,0 +318,0 @@ state.lambda = false;

@@ -15,7 +15,8 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others

CodeMirror.defineSimpleMode("rust",{
start:[
start: [
// string and byte string
{regex: /b?"(?:[^\\]|\\.)*?"/, token: "string"},
{regex: /b?"/, token: "string", next: "string"},
// raw string and raw byte string
{regex: /(b?r)(#*)(".*?)("\2)/, token: ["string", "string", "string", "string"]},
{regex: /b?r"/, token: "string", next: "string_raw"},
{regex: /b?r#+"/, token: "string", next: "string_raw_hash"},
// character

@@ -43,2 +44,14 @@ {regex: /'(?:[^'\\]|\\(?:[nrt0'"]|x[\da-fA-F]{2}|u\{[\da-fA-F]{6}\}))'/, token: "string-2"},

],
string: [
{regex: /"/, token: "string", next: "start"},
{regex: /(?:[^\\"]|\\(?:.|$))*/, token: "string"}
],
string_raw: [
{regex: /"/, token: "string", next: "start"},
{regex: /[^"]*/, token: "string"}
],
string_raw_hash: [
{regex: /"#+/, token: "string", next: "start"},
{regex: /(?:[^"]|"(?!#))*/, token: "string"}
],
comment: [

@@ -45,0 +58,0 @@ {regex: /.*?\*\//, token: "comment", next: "start"},

@@ -260,3 +260,3 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others

// these keywords are used by all SQL dialects (however, a mode can still overwrite it)
var sqlKeywords = "alter and as asc between by count create delete desc distinct drop from group having in insert into is join like not on or order select set table union update values where ";
var sqlKeywords = "alter and as asc between by count create delete desc distinct drop from group having in insert into is join like not on or order select set table union update values where limit";

@@ -263,0 +263,0 @@ // turn a space-separated list into an array

{
"name": "codemirror",
"version":"5.8.0",
"version":"5.9.0",
"main": "lib/codemirror.js",

@@ -5,0 +5,0 @@ "description": "In-browser code editing made bearable",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc