New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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.11.0 to 5.12.0

.npmignore

4

addon/dialog/dialog.js

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

if (inp) {
inp.focus();
if (options.value) {

@@ -83,4 +85,2 @@ inp.value = options.value;

if (options.closeOnBlur !== false) CodeMirror.on(inp, "blur", close);
inp.focus();
} else if (button = dialog.getElementsByTagName("button")[0]) {

@@ -87,0 +87,0 @@ CodeMirror.on(button, "click", function() {

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

if (dv.diffOutOfDate) return;
var start = chunk.editTo > to.lastLine() ? Pos(chunk.editFrom - 1) : Pos(chunk.editFrom, 0)
to.replaceRange(from.getRange(Pos(chunk.origFrom, 0), Pos(chunk.origTo, 0)),
Pos(chunk.editFrom, 0), Pos(chunk.editTo, 0));
start, Pos(chunk.editTo, 0));
}

@@ -434,0 +435,0 @@

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

var BACK_CLASS = "CodeMirror-activeline-background";
var GUTT_CLASS = "CodeMirror-activeline-gutter";

@@ -40,2 +41,3 @@ CodeMirror.defineOption("styleActiveLine", false, function(cm, val, old) {

cm.removeLineClass(cm.state.activeLines[i], "background", BACK_CLASS);
cm.removeLineClass(cm.state.activeLines[i], "gutter", GUTT_CLASS);
}

@@ -65,2 +67,3 @@ }

cm.addLineClass(active[i], "background", BACK_CLASS);
cm.addLineClass(active[i], "gutter", GUTT_CLASS);
}

@@ -67,0 +70,0 @@ cm.state.activeLines = active;

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

map["Shift-" + ctrl + "K"] = "deleteLine";
map["Shift-Ctrl-K"] = "deleteLine";

@@ -111,0 +111,0 @@ function insertLine(cm, above) {

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

function Context(indented, column, type, align, prev) {
this.indented = indented;
this.column = column;
this.type = type;
this.align = align;
this.prev = prev;
}
function isStatement(type) {
return type == "statement" || type == "switchstatement" || type == "namespace";
}
function pushContext(state, col, type) {
var indent = state.indented;
if (state.context && isStatement(state.context.type) && !isStatement(type))
indent = state.context.indented;
return state.context = new Context(indent, col, type, null, state.context);
}
function popContext(state) {
var t = state.context.type;
if (t == ")" || t == "]" || t == "}")
state.indented = state.context.indented;
return state.context = state.context.prev;
}
function typeBefore(stream, state) {
if (state.prevToken == "variable" || state.prevToken == "variable-3") return true;
if (/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(stream.string.slice(0, stream.start))) return true;
}
function isTopScope(context) {
for (;;) {
if (!context || context.type == "top") return true;
if (context.type == "}" && context.prev.type != "namespace") return false;
context = context.prev;
}
}
CodeMirror.defineMode("clike", function(config, parserConfig) {

@@ -115,38 +151,2 @@ var indentUnit = config.indentUnit,

function Context(indented, column, type, align, prev) {
this.indented = indented;
this.column = column;
this.type = type;
this.align = align;
this.prev = prev;
}
function isStatement(type) {
return type == "statement" || type == "switchstatement" || type == "namespace";
}
function pushContext(state, col, type) {
var indent = state.indented;
if (state.context && isStatement(state.context.type) && !isStatement(type))
indent = state.context.indented;
return state.context = new Context(indent, col, type, null, state.context);
}
function popContext(state) {
var t = state.context.type;
if (t == ")" || t == "]" || t == "}")
state.indented = state.context.indented;
return state.context = state.context.prev;
}
function typeBefore(stream, state) {
if (state.prevToken == "variable" || state.prevToken == "variable-3") return true;
if (/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(stream.string.slice(0, stream.start))) return true;
}
function isTopScope(context) {
for (;;) {
if (!context || context.type == "top") return true;
if (context.type == "}" && context.prev.type != "namespace") return false;
context = context.prev;
}
}
// Interface

@@ -502,3 +502,3 @@

"AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either " +
"Enumeration Equiv Error Exception Fractional Function IndexedSeq Integral Iterable " +
"Enumeration Equiv Error Exception Fractional Function IndexedSeq Int Integral Iterable " +
"Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering " +

@@ -533,2 +533,11 @@ "Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder " +

return "atom";
},
"=": function(stream, state) {
var cx = state.context
if (cx.type == "}" && cx.align && stream.eat(">")) {
state.context = new Context(cx.indented, cx.column, cx.type, null, cx.prev)
return "operator"
} else {
return false
}
}

@@ -535,0 +544,0 @@ },

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

function getAttrValue(stream, attr) {
var pos = stream.pos, match;
while (pos >= 0 && stream.string.charAt(pos) !== "<") pos--;
if (pos < 0) return pos;
if (match = stream.string.slice(pos, stream.pos).match(getAttrRegexp(attr)))
return match[2];
return "";
function getAttrValue(text, attr) {
var match = text.match(getAttrRegexp(attr))
return match ? match[2] : ""
}

@@ -70,6 +66,6 @@

function findMatchingMode(tagInfo, stream) {
function findMatchingMode(tagInfo, tagText) {
for (var i = 0; i < tagInfo.length; i++) {
var spec = tagInfo[i];
if (!spec[0] || spec[1].test(getAttrValue(stream, spec[0]))) return spec[2];
if (!spec[0] || spec[1].test(getAttrValue(tagText, spec[0]))) return spec[2];
}

@@ -94,11 +90,13 @@ }

function html(stream, state) {
var tagName = state.htmlState.tagName && state.htmlState.tagName.toLowerCase();
var tagInfo = tagName && tags.hasOwnProperty(tagName) && tags[tagName];
var style = htmlMode.token(stream, state.htmlState), modeSpec;
if (tagInfo && /\btag\b/.test(style) && stream.current() === ">" &&
(modeSpec = findMatchingMode(tagInfo, stream))) {
var mode = CodeMirror.getMode(config, modeSpec);
var endTagA = getTagRegexp(tagName, true), endTag = getTagRegexp(tagName, false);
var style = htmlMode.token(stream, state.htmlState), tag = /\btag\b/.test(style), tagName
if (tag && !/[<>\s\/]/.test(stream.current()) &&
(tagName = state.htmlState.tagName && state.htmlState.tagName.toLowerCase()) &&
tags.hasOwnProperty(tagName)) {
state.inTag = tagName + " "
} else if (state.inTag && tag && />$/.test(stream.current())) {
var inTag = /^([\S]+) (.*)/.exec(state.inTag)
state.inTag = null
var modeSpec = stream.current() == ">" && findMatchingMode(tags[inTag[1]], inTag[2])
var mode = CodeMirror.getMode(config, modeSpec)
var endTagA = getTagRegexp(inTag[1], true), endTag = getTagRegexp(inTag[1], false);
state.token = function (stream, state) {

@@ -114,2 +112,5 @@ if (stream.match(endTagA, false)) {

state.localState = CodeMirror.startState(mode, htmlMode.indent(state.htmlState, ""));
} else if (state.inTag) {
state.inTag += stream.current()
if (stream.eol()) state.inTag += " "
}

@@ -122,3 +123,3 @@ return style;

var state = htmlMode.startState();
return {token: html, localMode: null, localState: null, htmlState: state};
return {token: html, inTag: null, localMode: null, localState: null, htmlState: state};
},

@@ -131,3 +132,4 @@

}
return {token: state.token, localMode: state.localMode, localState: local,
return {token: state.token, inTag: state.inTag,
localMode: state.localMode, localState: local,
htmlState: CodeMirror.copyState(htmlMode, state.htmlState)};

@@ -134,0 +136,0 @@ },

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

function wordRegexp(words) {
return new RegExp("^((" + words.join(")|(") + "))\\b");
function wordRegexp(words, end) {
if (typeof end === 'undefined') { end = "\\b"; }
return new RegExp("^((" + words.join(")|(") + "))" + end);
}
var octChar = "\\\\[0-7]{1,3}";
var hexChar = "\\\\x[A-Fa-f0-9]{1,2}";
var specialChar = "\\\\[abfnrtv0%?'\"\\\\]";
var singleChar = "([^\\u0027\\u005C\\uD800-\\uDFFF]|[\\uD800-\\uDFFF][\\uDC00-\\uDFFF])";
var operators = parserConf.operators || /^\.?[|&^\\%*+\-<>!=\/]=?|\?|~|:|\$|\.[<>]|<<=?|>>>?=?|\.[<>=]=|->?|\/\/|\bin\b(?!\()|[\u2208\u2209](?!\()/;
var delimiters = parserConf.delimiters || /^[;,()[\]{}]/;
var identifiers = parserConf.identifiers || /^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*!*/;
var identifiers = parserConf.identifiers || /^[_A-Za-z\u00A1-\uFFFF][\w\u00A1-\uFFFF]*!*/;
var charsList = [octChar, hexChar, specialChar, singleChar];
var blockOpeners = ["begin", "function", "type", "immutable", "let", "macro", "for", "while", "quote", "if", "else", "elseif", "try", "finally", "catch", "do"];

@@ -31,3 +37,4 @@ var blockClosers = ["end", "else", "elseif", "catch", "finally"];

//var stringPrefixes = new RegExp("^[br]?('|\")")
var stringPrefixes = /^(`|'|"{3}|([brv]?"))/;
var stringPrefixes = /^(`|"{3}|([brv]?"))/;
var chars = wordRegexp(charsList, "'");
var keywords = wordRegexp(keywordList);

@@ -37,5 +44,5 @@ var builtins = wordRegexp(builtinList);

var closers = wordRegexp(blockClosers);
var macro = /^@[_A-Za-z][_A-Za-z0-9]*/;
var symbol = /^:[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*!*/;
var typeAnnotation = /^::[^.,;"{()=$\s]+({[^}]*}+)*/;
var macro = /^@[_A-Za-z][\w]*/;
var symbol = /^:[_A-Za-z\u00A1-\uFFFF][\w\u00A1-\uFFFF]*!*/;
var typeAnnotation = /^::[^,;"{()=$\s]+({[^}]*}+)*/;

@@ -59,16 +66,7 @@ function inArray(state) {

function tokenBase(stream, state) {
//Handle multiline comments
if (stream.match(/^#=\s*/)) {
state.scopes.push('#=');
// Handle multiline comments
if (stream.match(/^#=/, false)) {
state.tokenize = tokenComment;
return state.tokenize(stream, state);
}
if (currentScope(state) == '#=' && stream.match(/^=#/)) {
state.scopes.pop();
return 'comment';
}
if (state.scopes.indexOf('#=') >= 0) {
if (!stream.match(/.*?(?=(#=|=#))/)) {
stream.skipToEnd();
}
return 'comment';
}

@@ -107,2 +105,6 @@ // Handle scope changes

if (ch === '(') {
state.scopes.push('(');
}
var scope = currentScope(state);

@@ -145,29 +147,16 @@

var imMatcher = RegExp(/^im\b/);
var floatLiteral = false;
var numberLiteral = false;
// Floats
if (stream.match(/^\d*\.(?!\.)\d+([ef][\+\-]?\d+)?/i)) { floatLiteral = true; }
if (stream.match(/^\d+\.(?!\.)\d*/)) { floatLiteral = true; }
if (stream.match(/^\.\d+/)) { floatLiteral = true; }
if (stream.match(/^0x\.[0-9a-f]+p[\+\-]?\d+/i)) { floatLiteral = true; }
if (floatLiteral) {
// Float literals may be "imaginary"
stream.match(imMatcher);
state.leavingExpr = true;
return 'number';
}
if (stream.match(/^\d*\.(?!\.)\d*([Eef][\+\-]?\d+)?/i)) { numberLiteral = true; }
if (stream.match(/^\d+\.(?!\.)\d*/)) { numberLiteral = true; }
if (stream.match(/^\.\d+/)) { numberLiteral = true; }
if (stream.match(/^0x\.[0-9a-f]+p[\+\-]?\d+/i)) { numberLiteral = true; }
// Integers
var intLiteral = false;
// Hex
if (stream.match(/^0x[0-9a-f]+/i)) { intLiteral = true; }
// Binary
if (stream.match(/^0b[01]+/i)) { intLiteral = true; }
// Octal
if (stream.match(/^0o[0-7]+/i)) { intLiteral = true; }
// Decimal
if (stream.match(/^[1-9]\d*(e[\+\-]?\d+)?/)) {
intLiteral = true;
}
if (stream.match(/^0x[0-9a-f]+/i)) { numberLiteral = true; } // Hex
if (stream.match(/^0b[01]+/i)) { numberLiteral = true; } // Binary
if (stream.match(/^0o[0-7]+/i)) { numberLiteral = true; } // Octal
if (stream.match(/^[1-9]\d*(e[\+\-]?\d+)?/)) { numberLiteral = true; } // Decimal
// Zero by itself with no other piece of number.
if (stream.match(/^0(?![\dx])/i)) { intLiteral = true; }
if (intLiteral) {
if (stream.match(/^0(?![\dx])/i)) { numberLiteral = true; }
if (numberLiteral) {
// Integer literals may be "long"

@@ -203,2 +192,8 @@ stream.match(imMatcher);

// Handle Chars
if (stream.match(/^'/)) {
state.tokenize = tokenChar;
return state.tokenize(stream, state);
}
// Handle Strings

@@ -279,3 +274,3 @@ if (stream.match(stringPrefixes)) {

stream.backUp(state.charsAdvanced);
while (state.scopes.length > state.firstParenPos + 1)
while (state.scopes.length > state.firstParenPos)
state.scopes.pop();

@@ -290,2 +285,44 @@ state.firstParenPos = -1;

function tokenComment(stream, state) {
if (stream.match(/^#=/)) {
state.weakScopes++;
}
if (!stream.match(/.*?(?=(#=|=#))/)) {
stream.skipToEnd();
}
if (stream.match(/^=#/)) {
state.weakScopes--;
if (state.weakScopes == 0)
state.tokenize = tokenBase;
}
return 'comment';
}
function tokenChar(stream, state) {
var isChar = false, match;
if (stream.match(chars)) {
isChar = true;
} else if (match = stream.match(/\\u([a-f0-9]{1,4})(?=')/i)) {
var value = parseInt(match[1], 16);
if (value <= 55295 || value >= 57344) { // (U+0,U+D7FF), (U+E000,U+FFFF)
isChar = true;
stream.next();
}
} else if (match = stream.match(/\\U([A-Fa-f0-9]{5,8})(?=')/)) {
var value = parseInt(match[1], 16);
if (value <= 1114111) { // U+10FFFF
isChar = true;
stream.next();
}
}
if (isChar) {
state.leavingExpr = true;
state.tokenize = tokenBase;
return 'string';
}
if (!stream.match(/^[^']+(?=')/)) { stream.skipToEnd(); }
if (stream.match(/^'/)) { state.tokenize = tokenBase; }
return ERRORCLASS;
}
function tokenStringFactory(delimiter) {

@@ -295,3 +332,2 @@ while ('bruv'.indexOf(delimiter.charAt(0).toLowerCase()) >= 0) {

}
var singleline = delimiter == "'";
var OUTCLASS = 'string';

@@ -301,22 +337,13 @@

while (!stream.eol()) {
stream.eatWhile(/[^'"\\]/);
stream.eatWhile(/[^"\\]/);
if (stream.eat('\\')) {
stream.next();
if (singleline && stream.eol()) {
return OUTCLASS;
}
} else if (stream.match(delimiter)) {
state.tokenize = tokenBase;
state.leavingExpr = true;
return OUTCLASS;
} else {
stream.eat(/['"]/);
stream.eat(/["]/);
}
}
if (singleline) {
if (parserConf.singleLineStringErrors) {
return ERRORCLASS;
} else {
state.tokenize = tokenBase;
}
}
return OUTCLASS;

@@ -333,2 +360,3 @@ }

scopes: [],
weakScopes: 0,
lastToken: null,

@@ -360,3 +388,3 @@ leavingExpr: false,

var delta = 0;
if (textAfter == "end" || textAfter == "]" || textAfter == "}" || textAfter == "else" || textAfter == "elseif" || textAfter == "catch" || textAfter == "finally") {
if (textAfter == "]" || textAfter == ")" || textAfter == "end" || textAfter == "else" || textAfter == "elseif" || textAfter == "catch" || textAfter == "finally") {
delta = -1;

@@ -367,5 +395,5 @@ }

electricInput: /(end|else(if)?|catch|finally)$/,
lineComment: "#",
fold: "indent",
electricChars: "edlsifyh]}"
fold: "indent"
};

@@ -372,0 +400,0 @@ return external;

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

var htmlFound = CodeMirror.modes.hasOwnProperty("xml");
var htmlMode = CodeMirror.getMode(cmCfg, htmlFound ? {name: "xml", htmlMode: true} : "text/plain");
var htmlMode = CodeMirror.getMode(cmCfg, "text/html");
var htmlModeMissing = htmlMode.name == "null"

@@ -59,4 +59,2 @@ function getMode(name) {

var codeDepth = 0;
var tokenTypes = {

@@ -126,3 +124,3 @@ header: "header",

state.indentedCode = false;
if (!htmlFound && state.f == htmlBlock) {
if (htmlModeMissing && state.f == htmlBlock) {
state.f = inlineNormal;

@@ -221,3 +219,3 @@ state.block = blockNormal;

if (modeCfg.highlightFormatting) state.formatting = "code-block";
state.code = true;
state.code = -1
return getType(state);

@@ -231,8 +229,11 @@ }

var style = htmlMode.token(stream, state.htmlState);
if ((htmlFound && state.htmlState.tagStart === null &&
(!state.htmlState.context && state.htmlState.tokenize.isInText)) ||
(state.md_inside && stream.current().indexOf(">") > -1)) {
state.f = inlineNormal;
state.block = blockNormal;
state.htmlState = null;
if (!htmlModeMissing) {
var inner = CodeMirror.innerMode(htmlMode, state.htmlState)
if ((inner.mode.name == "xml" && inner.state.tagStart === null &&
(!inner.state.context && inner.state.tokenize.isInText)) ||
(state.md_inside && stream.current().indexOf(">") > -1)) {
state.f = inlineNormal;
state.block = blockNormal;
state.htmlState = null;
}
}

@@ -261,5 +262,5 @@ return style;

if (modeCfg.highlightFormatting) state.formatting = "code-block";
state.code = true;
state.code = 1
var returnType = getType(state);
state.code = false;
state.code = 0
return returnType;

@@ -387,11 +388,2 @@ }

if (ch === '\\') {
stream.next();
if (modeCfg.highlightFormatting) {
var type = getType(state);
var formattingEscape = tokenTypes.formatting + "-escape";
return type ? type + " " + formattingEscape : formattingEscape;
}
}
// Matches link titles present on next line

@@ -415,17 +407,14 @@ if (state.linkTitle) {

if (modeCfg.highlightFormatting) state.formatting = "code";
var t = getType(state);
var before = stream.pos;
stream.eatWhile('`');
var difference = 1 + stream.pos - before;
if (!state.code) {
codeDepth = difference;
state.code = true;
return getType(state);
var count = stream.current().length
if (state.code == 0) {
state.code = count
return getType(state)
} else if (count == state.code) { // Must be exact
var t = getType(state)
state.code = 0
return t
} else {
if (difference === codeDepth) { // Must be exact
state.code = false;
return t;
}
state.formatting = previousFormatting;
return getType(state);
state.formatting = previousFormatting
return getType(state)
}

@@ -436,2 +425,11 @@ } else if (state.code) {

if (ch === '\\') {
stream.next();
if (modeCfg.highlightFormatting) {
var type = getType(state);
var formattingEscape = tokenTypes.formatting + "-escape";
return type ? type + " " + formattingEscape : formattingEscape;
}
}
if (ch === '!' && stream.match(/\[[^\]]*\] ?(?:\(|\[)/, false)) {

@@ -704,2 +702,3 @@ stream.match(/\[[^\]]*\]/);

linkTitle: false,
code: 0,
em: false,

@@ -706,0 +705,0 @@ strong: false,

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

{name: "Factor", mime: "text/x-factor", mode: "factor", ext: ["factor"]},
{name: "FCL", mime: "text/x-fcl", mode: "fcl"},
{name: "Forth", mime: "text/x-forth", mode: "forth", ext: ["forth", "fth", "4th"]},

@@ -58,3 +59,3 @@ {name: "Fortran", mime: "text/x-fortran", mode: "fortran", ext: ["f", "for", "f77", "f90"]},

{name: "Go", mime: "text/x-go", mode: "go", ext: ["go"]},
{name: "Groovy", mime: "text/x-groovy", mode: "groovy", ext: ["groovy"]},
{name: "Groovy", mime: "text/x-groovy", mode: "groovy", ext: ["groovy", "gradle"]},
{name: "HAML", mime: "text/x-haml", mode: "haml", ext: ["haml"]},

@@ -61,0 +62,0 @@ {name: "Haskell", mime: "text/x-haskell", mode: "haskell", ext: ["hs"]},

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

if (parserConf.version && parseInt(parserConf.version, 10) == 3){
if (parserConf.version && parseInt(parserConf.version, 10) == 3) {
// since http://legacy.python.org/dev/peps/pep-0465/ @ is also an operator

@@ -69,8 +69,8 @@ var singleOperators = parserConf.singleOperators || /^[\+\-\*\/%&|\^~<>!@]/;

var myKeywords = commonKeywords, myBuiltins = commonBuiltins;
if(parserConf.extra_keywords != undefined){
if (parserConf.extra_keywords != undefined)
myKeywords = myKeywords.concat(parserConf.extra_keywords);
}
if(parserConf.extra_builtins != undefined){
if (parserConf.extra_builtins != undefined)
myBuiltins = myBuiltins.concat(parserConf.extra_builtins);
}
if (parserConf.version && parseInt(parserConf.version, 10) == 3) {

@@ -90,2 +90,3 @@ myKeywords = myKeywords.concat(py3.keywords);

function tokenBase(stream, state) {
if (stream.sol()) state.indent = stream.indentation()
// Handle scope changes

@@ -97,3 +98,3 @@ if (stream.sol() && top(state).type == "py") {

if (lineOffset > scopeOffset)
pushScope(stream, state, "py");
pushPyScope(state);
else if (lineOffset < scopeOffset && dedent(stream, state))

@@ -231,14 +232,16 @@ state.errorToken = true;

function pushScope(stream, state, type) {
var offset = 0, align = null;
if (type == "py") {
while (top(state).type != "py")
state.scopes.pop();
}
offset = top(state).offset + (type == "py" ? conf.indentUnit : hangingIndent);
if (type != "py" && !stream.match(/^(\s|#.*)*$/, false))
align = stream.column() + 1;
state.scopes.push({offset: offset, type: type, align: align});
function pushPyScope(state) {
while (top(state).type != "py") state.scopes.pop()
state.scopes.push({offset: top(state).offset + conf.indentUnit,
type: "py",
align: null})
}
function pushBracketScope(stream, state, type) {
var align = stream.match(/^([\s\[\{\(]|#.*)*$/, false) ? null : stream.column() + 1
state.scopes.push({offset: state.indent + hangingIndent,
type: type,
align: align})
}
function dedent(stream, state) {

@@ -258,8 +261,7 @@ var indented = stream.indentation();

// Handle decorators
if (current == "@"){
if(parserConf.version && parseInt(parserConf.version, 10) == 3){
return stream.match(identifiers, false) ? "meta" : "operator";
} else {
return stream.match(identifiers, false) ? "meta" : ERRORCLASS;
}
if (current == "@") {
if (parserConf.version && parseInt(parserConf.version, 10) == 3)
return stream.match(identifiers, false) ? "meta" : "operator";
else
return stream.match(identifiers, false) ? "meta" : ERRORCLASS;
}

@@ -277,11 +279,11 @@

if (current == ":" && !state.lambda && top(state).type == "py")
pushScope(stream, state, "py");
pushPyScope(state);
var delimiter_index = current.length == 1 ? "[({".indexOf(current) : -1;
if (delimiter_index != -1)
pushScope(stream, state, "])}".slice(delimiter_index, delimiter_index+1));
pushBracketScope(stream, state, "])}".slice(delimiter_index, delimiter_index+1));
delimiter_index = "])}".indexOf(current);
if (delimiter_index != -1) {
if (top(state).type == current) state.scopes.pop();
if (top(state).type == current) state.indent = state.scopes.pop().offset - hangingIndent
else return ERRORCLASS;

@@ -302,2 +304,3 @@ }

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

@@ -327,12 +330,10 @@ lambda: false,

var scope = top(state);
var closing = textAfter && textAfter.charAt(0) == scope.type;
var scope = top(state), closing = scope.type == textAfter.charAt(0)
if (scope.align != null)
return scope.align - (closing ? 1 : 0);
else if (closing && state.scopes.length > 1)
return state.scopes[state.scopes.length - 2].offset;
return scope.align - (closing ? 1 : 0)
else
return scope.offset;
return scope.offset - (closing ? hangingIndent : 0)
},
electricInput: /^\s*[\}\]\)]$/,
closeBrackets: {triples: "'\""},

@@ -339,0 +340,0 @@ lineComment: "#",

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

while (state.context && state.context.type == "pattern") popContext(state);
if (state.context && curPunc == state.context.type) popContext(state);
if (state.context && curPunc == state.context.type) {
popContext(state);
if (curPunc == "}" && state.context && state.context.type == "pattern")
popContext(state);
}
}

@@ -141,0 +145,0 @@ else if (curPunc == "." && state.context && state.context.type == "pattern") popContext(state);

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

if (stream.match(/\\[a-z]+/)) return "string-2";
else return null;
else {
stream.next();
return "atom";
}
case ".":

@@ -76,0 +79,0 @@ case ",":

@@ -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 limit";
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 ";

@@ -361,2 +361,16 @@ // turn a space-separated list into an array

});
CodeMirror.defineMIME("text/x-pgsql", {
name: "sql",
client: set("source"),
// http://www.postgresql.org/docs/9.5/static/sql-keywords-appendix.html
keywords: set(sqlKeywords + "a abort abs absent absolute access according action ada add admin after aggregate all allocate also always analyse analyze any are array array_agg array_max_cardinality asensitive assertion assignment asymmetric at atomic attribute attributes authorization avg backward base64 before begin begin_frame begin_partition bernoulli binary bit_length blob blocked bom both breadth c cache call called cardinality cascade cascaded case cast catalog catalog_name ceil ceiling chain characteristics characters character_length character_set_catalog character_set_name character_set_schema char_length check checkpoint class class_origin clob close cluster coalesce cobol collate collation collation_catalog collation_name collation_schema collect column columns column_name command_function command_function_code comment comments commit committed concurrently condition condition_number configuration conflict connect connection connection_name constraint constraints constraint_catalog constraint_name constraint_schema constructor contains content continue control conversion convert copy corr corresponding cost covar_pop covar_samp cross csv cube cume_dist current current_catalog current_date current_default_transform_group current_path current_role current_row current_schema current_time current_timestamp current_transform_group_for_type current_user cursor cursor_name cycle data database datalink datetime_interval_code datetime_interval_precision day db deallocate dec declare default defaults deferrable deferred defined definer degree delimiter delimiters dense_rank depth deref derived describe descriptor deterministic diagnostics dictionary disable discard disconnect dispatch dlnewcopy dlpreviouscopy dlurlcomplete dlurlcompleteonly dlurlcompletewrite dlurlpath dlurlpathonly dlurlpathwrite dlurlscheme dlurlserver dlvalue do document domain dynamic dynamic_function dynamic_function_code each element else empty enable encoding encrypted end end-exec end_frame end_partition enforced enum equals escape event every except exception exclude excluding exclusive exec execute exists exp explain expression extension external extract false family fetch file filter final first first_value flag float floor following for force foreign fortran forward found frame_row free freeze fs full function functions fusion g general generated get global go goto grant granted greatest grouping groups handler header hex hierarchy hold hour id identity if ignore ilike immediate immediately immutable implementation implicit import including increment indent index indexes indicator inherit inherits initially inline inner inout input insensitive instance instantiable instead integrity intersect intersection invoker isnull isolation k key key_member key_type label lag language large last last_value lateral lead leading leakproof least left length level library like_regex link listen ln load local localtime localtimestamp location locator lock locked logged lower m map mapping match matched materialized max maxvalue max_cardinality member merge message_length message_octet_length message_text method min minute minvalue mod mode modifies module month more move multiset mumps name names namespace national natural nchar nclob nesting new next nfc nfd nfkc nfkd nil no none normalize normalized nothing notify notnull nowait nth_value ntile null nullable nullif nulls number object occurrences_regex octets octet_length of off offset oids old only open operator option options ordering ordinality others out outer output over overlaps overlay overriding owned owner p pad parameter parameter_mode parameter_name parameter_ordinal_position parameter_specific_catalog parameter_specific_name parameter_specific_schema parser partial partition pascal passing passthrough password percent percentile_cont percentile_disc percent_rank period permission placing plans pli policy portion position position_regex power precedes preceding prepare prepared preserve primary prior privileges procedural procedure program public quote range rank read reads reassign recheck recovery recursive ref references referencing refresh regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy regr_syy reindex relative release rename repeatable replace replica requiring reset respect restart restore restrict result return returned_cardinality returned_length returned_octet_length returned_sqlstate returning returns revoke right role rollback rollup routine routine_catalog routine_name routine_schema row rows row_count row_number rule savepoint scale schema schema_name scope scope_catalog scope_name scope_schema scroll search second section security selective self sensitive sequence sequences serializable server server_name session session_user setof sets share show similar simple size skip snapshot some source space specific specifictype specific_name sql sqlcode sqlerror sqlexception sqlstate sqlwarning sqrt stable standalone start state statement static statistics stddev_pop stddev_samp stdin stdout storage strict strip structure style subclass_origin submultiset substring substring_regex succeeds sum symmetric sysid system system_time system_user t tables tablesample tablespace table_name temp template temporary then ties timezone_hour timezone_minute to token top_level_count trailing transaction transactions_committed transactions_rolled_back transaction_active transform transforms translate translate_regex translation treat trigger trigger_catalog trigger_name trigger_schema trim trim_array true truncate trusted type types uescape unbounded uncommitted under unencrypted unique unknown unlink unlisten unlogged unnamed unnest until untyped upper uri usage user user_defined_type_catalog user_defined_type_code user_defined_type_name user_defined_type_schema using vacuum valid validate validator value value_of varbinary variadic var_pop var_samp verbose version versioning view views volatile when whenever whitespace width_bucket window within work wrapper write xmlagg xmlattributes xmlbinary xmlcast xmlcomment xmlconcat xmldeclaration xmldocument xmlelement xmlexists xmlforest xmliterate xmlnamespaces xmlparse xmlpi xmlquery xmlroot xmlschema xmlserialize xmltable xmltext xmlvalidate year yes loop repeat"),
// http://www.postgresql.org/docs/9.5/static/datatype.html
builtin: set("bigint int8 bigserial serial8 bit varying varbit boolean bool box bytea character char varchar cidr circle date double precision float8 inet integer int int4 interval json jsonb line lseg macaddr money numeric decimal path pg_lsn point polygon real float4 smallint int2 smallserial serial2 serial serial4 text time without zone with timetz timestamp timestamptz tsquery tsvector txid_snapshot uuid xml"),
atoms: set("false true null unknown"),
operatorChars: /^[*+\-%<>!=&|^]/,
dateSQL: set("date time timestamp"),
support: set("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber nCharCast charsetCast commentHash commentSpaceRequired")
});
}());

@@ -363,0 +377,0 @@

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

popContext(state);
if (state.context && state.context.tagName == tagName) {
if ((state.context && state.context.tagName == tagName) || config.matchClosing === false) {
setStyle = "tag";

@@ -243,0 +243,0 @@ return closeState;

{
"name": "codemirror",
"version":"5.11.0",
"version":"5.12.0",
"main": "lib/codemirror.js",

@@ -8,3 +8,6 @@ "description": "In-browser code editing made bearable",

"directories": {"lib": "./lib"},
"scripts": {"test": "node ./test/run.js"},
"scripts": {
"test": "node ./test/run.js",
"lint": "bin/lint"
},
"devDependencies": {"node-static": "0.6.0",

@@ -11,0 +14,0 @@ "phantomjs": "1.9.2-5",

Sorry, the diff of this file is not supported yet

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 not supported yet

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

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