mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 09:58:32 +02:00
codemirror updated to 5.47.0
This commit is contained in:
parent
e845b80e10
commit
54e37dea20
15
libraries/codemirror/addon/edit/matchbrackets.js
vendored
15
libraries/codemirror/addon/edit/matchbrackets.js
vendored
@ -14,20 +14,25 @@
|
|||||||
|
|
||||||
var Pos = CodeMirror.Pos;
|
var Pos = CodeMirror.Pos;
|
||||||
|
|
||||||
var matching = {"(": ")>", ")": "(<", "[": "]>", "]": "[<", "{": "}>", "}": "{<"};
|
var matching = {"(": ")>", ")": "(<", "[": "]>", "]": "[<", "{": "}>", "}": "{<", "<": ">>", ">": "<<"};
|
||||||
|
|
||||||
|
function bracketRegex(config) {
|
||||||
|
return config && config.bracketRegex || /[(){}[\]]/
|
||||||
|
}
|
||||||
|
|
||||||
function findMatchingBracket(cm, where, config) {
|
function findMatchingBracket(cm, where, config) {
|
||||||
var line = cm.getLineHandle(where.line), pos = where.ch - 1;
|
var line = cm.getLineHandle(where.line), pos = where.ch - 1;
|
||||||
var afterCursor = config && config.afterCursor
|
var afterCursor = config && config.afterCursor
|
||||||
if (afterCursor == null)
|
if (afterCursor == null)
|
||||||
afterCursor = /(^| )cm-fat-cursor($| )/.test(cm.getWrapperElement().className)
|
afterCursor = /(^| )cm-fat-cursor($| )/.test(cm.getWrapperElement().className)
|
||||||
|
var re = bracketRegex(config)
|
||||||
|
|
||||||
// A cursor is defined as between two characters, but in in vim command mode
|
// A cursor is defined as between two characters, but in in vim command mode
|
||||||
// (i.e. not insert mode), the cursor is visually represented as a
|
// (i.e. not insert mode), the cursor is visually represented as a
|
||||||
// highlighted box on top of the 2nd character. Otherwise, we allow matches
|
// highlighted box on top of the 2nd character. Otherwise, we allow matches
|
||||||
// from before or after the cursor.
|
// from before or after the cursor.
|
||||||
var match = (!afterCursor && pos >= 0 && matching[line.text.charAt(pos)]) ||
|
var match = (!afterCursor && pos >= 0 && re.test(line.text.charAt(pos)) && matching[line.text.charAt(pos)]) ||
|
||||||
matching[line.text.charAt(++pos)];
|
re.test(line.text.charAt(pos + 1)) && matching[line.text.charAt(++pos)];
|
||||||
if (!match) return null;
|
if (!match) return null;
|
||||||
var dir = match.charAt(1) == ">" ? 1 : -1;
|
var dir = match.charAt(1) == ">" ? 1 : -1;
|
||||||
if (config && config.strict && (dir > 0) != (pos == where.ch)) return null;
|
if (config && config.strict && (dir > 0) != (pos == where.ch)) return null;
|
||||||
@ -51,7 +56,7 @@
|
|||||||
var maxScanLines = (config && config.maxScanLines) || 1000;
|
var maxScanLines = (config && config.maxScanLines) || 1000;
|
||||||
|
|
||||||
var stack = [];
|
var stack = [];
|
||||||
var re = config && config.bracketRegex ? config.bracketRegex : /[(){}[\]]/;
|
var re = bracketRegex(config)
|
||||||
var lineEnd = dir > 0 ? Math.min(where.line + maxScanLines, cm.lastLine() + 1)
|
var lineEnd = dir > 0 ? Math.min(where.line + maxScanLines, cm.lastLine() + 1)
|
||||||
: Math.max(cm.firstLine() - 1, where.line - maxScanLines);
|
: Math.max(cm.firstLine() - 1, where.line - maxScanLines);
|
||||||
for (var lineNo = where.line; lineNo != lineEnd; lineNo += dir) {
|
for (var lineNo = where.line; lineNo != lineEnd; lineNo += dir) {
|
||||||
@ -64,7 +69,7 @@
|
|||||||
var ch = line.charAt(pos);
|
var ch = line.charAt(pos);
|
||||||
if (re.test(ch) && (style === undefined || cm.getTokenTypeAt(Pos(lineNo, pos + 1)) == style)) {
|
if (re.test(ch) && (style === undefined || cm.getTokenTypeAt(Pos(lineNo, pos + 1)) == style)) {
|
||||||
var match = matching[ch];
|
var match = matching[ch];
|
||||||
if ((match.charAt(1) == ">") == (dir > 0)) stack.push(ch);
|
if (match && (match.charAt(1) == ">") == (dir > 0)) stack.push(ch);
|
||||||
else if (!stack.length) return {pos: Pos(lineNo, pos), ch: ch};
|
else if (!stack.length) return {pos: Pos(lineNo, pos), ch: ch};
|
||||||
else stack.pop();
|
else stack.pop();
|
||||||
}
|
}
|
||||||
|
2
libraries/codemirror/addon/lint/lint.js
vendored
2
libraries/codemirror/addon/lint/lint.js
vendored
@ -1,5 +1,5 @@
|
|||||||
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
||||||
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
// Distributed under an MIT license: https://codemirror.net/LICENSE
|
||||||
|
|
||||||
(function(mod) {
|
(function(mod) {
|
||||||
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
||||||
|
File diff suppressed because it is too large
Load Diff
2
libraries/codemirror/mode/asn.1/index.html
vendored
2
libraries/codemirror/mode/asn.1/index.html
vendored
@ -8,7 +8,7 @@
|
|||||||
<script src="../../lib/codemirror.js"></script>
|
<script src="../../lib/codemirror.js"></script>
|
||||||
<script src="../../addon/edit/matchbrackets.js"></script>
|
<script src="../../addon/edit/matchbrackets.js"></script>
|
||||||
<script src="asn.1.js"></script>
|
<script src="asn.1.js"></script>
|
||||||
<style type="text/css">
|
<style>
|
||||||
.CodeMirror {
|
.CodeMirror {
|
||||||
border-top: 1px solid black;
|
border-top: 1px solid black;
|
||||||
border-bottom: 1px solid black;
|
border-bottom: 1px solid black;
|
||||||
|
@ -146,7 +146,7 @@ exten => 8500,n,Goto(s,6)
|
|||||||
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
||||||
mode: "text/x-asterisk",
|
mode: "text/x-asterisk",
|
||||||
matchBrackets: true,
|
matchBrackets: true,
|
||||||
lineNumber: true
|
lineNumbers: true
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
122
libraries/codemirror/mode/clike/clike.js
vendored
122
libraries/codemirror/mode/clike/clike.js
vendored
@ -65,7 +65,10 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
|
|||||||
numberStart = parserConfig.numberStart || /[\d\.]/,
|
numberStart = parserConfig.numberStart || /[\d\.]/,
|
||||||
number = parserConfig.number || /^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)?/i,
|
number = parserConfig.number || /^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)?/i,
|
||||||
isOperatorChar = parserConfig.isOperatorChar || /[+\-*&%=<>!?|\/]/,
|
isOperatorChar = parserConfig.isOperatorChar || /[+\-*&%=<>!?|\/]/,
|
||||||
isIdentifierChar = parserConfig.isIdentifierChar || /[\w\$_\xa1-\uffff]/;
|
isIdentifierChar = parserConfig.isIdentifierChar || /[\w\$_\xa1-\uffff]/,
|
||||||
|
// An optional function that takes a {string} token and returns true if it
|
||||||
|
// should be treated as a builtin.
|
||||||
|
isReservedIdentifier = parserConfig.isReservedIdentifier || false;
|
||||||
|
|
||||||
var curPunc, isDefKeyword;
|
var curPunc, isDefKeyword;
|
||||||
|
|
||||||
@ -113,7 +116,8 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
|
|||||||
return "keyword";
|
return "keyword";
|
||||||
}
|
}
|
||||||
if (contains(types, cur)) return "type";
|
if (contains(types, cur)) return "type";
|
||||||
if (contains(builtin, cur)) {
|
if (contains(builtin, cur)
|
||||||
|
|| (isReservedIdentifier && isReservedIdentifier(cur))) {
|
||||||
if (contains(blockKeywords, cur)) curPunc = "newstatement";
|
if (contains(blockKeywords, cur)) curPunc = "newstatement";
|
||||||
return "builtin";
|
return "builtin";
|
||||||
}
|
}
|
||||||
@ -263,8 +267,33 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
var cKeywords = "auto if break case register continue return default do sizeof " +
|
var cKeywords = "auto if break case register continue return default do sizeof " +
|
||||||
"static else struct switch extern typedef union for goto while enum const volatile";
|
"static else struct switch extern typedef union for goto while enum const " +
|
||||||
var cTypes = "int long char short double float unsigned signed void size_t ptrdiff_t";
|
"volatile inline restrict asm fortran";
|
||||||
|
|
||||||
|
// Do not use this. Use the cTypes function below. This is global just to avoid
|
||||||
|
// excessive calls when cTypes is being called multiple times during a parse.
|
||||||
|
var basicCTypes = words("int long char short double float unsigned signed " +
|
||||||
|
"void bool");
|
||||||
|
|
||||||
|
// Do not use this. Use the objCTypes function below. This is global just to avoid
|
||||||
|
// excessive calls when objCTypes is being called multiple times during a parse.
|
||||||
|
var basicObjCTypes = words("SEL instancetype id Class Protocol BOOL");
|
||||||
|
|
||||||
|
// Returns true if identifier is a "C" type.
|
||||||
|
// C type is defined as those that are reserved by the compiler (basicTypes),
|
||||||
|
// and those that end in _t (Reserved by POSIX for types)
|
||||||
|
// http://www.gnu.org/software/libc/manual/html_node/Reserved-Names.html
|
||||||
|
function cTypes(identifier) {
|
||||||
|
return contains(basicCTypes, identifier) || /.+_t$/.test(identifier);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Returns true if identifier is a "Objective C" type.
|
||||||
|
function objCTypes(identifier) {
|
||||||
|
return cTypes(identifier) || contains(basicObjCTypes, identifier);
|
||||||
|
}
|
||||||
|
|
||||||
|
var cBlockKeywords = "case do else for if switch while struct enum union";
|
||||||
|
var cDefKeywords = "struct enum union";
|
||||||
|
|
||||||
function cppHook(stream, state) {
|
function cppHook(stream, state) {
|
||||||
if (!state.startOfLine) return false
|
if (!state.startOfLine) return false
|
||||||
@ -286,6 +315,14 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// For C and C++ (and ObjC): identifiers starting with __
|
||||||
|
// or _ followed by a capital letter are reserved for the compiler.
|
||||||
|
function cIsReservedIdentifier(token) {
|
||||||
|
if (!token || token.length < 2) return false;
|
||||||
|
if (token[0] != '_') return false;
|
||||||
|
return (token[1] == '_') || (token[1] !== token[1].toLowerCase());
|
||||||
|
}
|
||||||
|
|
||||||
function cpp14Literal(stream) {
|
function cpp14Literal(stream) {
|
||||||
stream.eatWhile(/[\w\.']/);
|
stream.eatWhile(/[\w\.']/);
|
||||||
return "number";
|
return "number";
|
||||||
@ -368,31 +405,36 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
|
|||||||
def(["text/x-csrc", "text/x-c", "text/x-chdr"], {
|
def(["text/x-csrc", "text/x-c", "text/x-chdr"], {
|
||||||
name: "clike",
|
name: "clike",
|
||||||
keywords: words(cKeywords),
|
keywords: words(cKeywords),
|
||||||
types: words(cTypes + " bool _Complex _Bool float_t double_t intptr_t intmax_t " +
|
types: cTypes,
|
||||||
"int8_t int16_t int32_t int64_t uintptr_t uintmax_t uint8_t uint16_t " +
|
blockKeywords: words(cBlockKeywords),
|
||||||
"uint32_t uint64_t"),
|
defKeywords: words(cDefKeywords),
|
||||||
blockKeywords: words("case do else for if switch while struct"),
|
|
||||||
defKeywords: words("struct"),
|
|
||||||
typeFirstDefinitions: true,
|
typeFirstDefinitions: true,
|
||||||
atoms: words("NULL true false"),
|
atoms: words("NULL true false"),
|
||||||
hooks: {"#": cppHook, "*": pointerHook},
|
isReservedIdentifier: cIsReservedIdentifier,
|
||||||
|
hooks: {
|
||||||
|
"#": cppHook,
|
||||||
|
"*": pointerHook,
|
||||||
|
},
|
||||||
modeProps: {fold: ["brace", "include"]}
|
modeProps: {fold: ["brace", "include"]}
|
||||||
});
|
});
|
||||||
|
|
||||||
def(["text/x-c++src", "text/x-c++hdr"], {
|
def(["text/x-c++src", "text/x-c++hdr"], {
|
||||||
name: "clike",
|
name: "clike",
|
||||||
keywords: words(cKeywords + " asm dynamic_cast namespace reinterpret_cast try explicit new " +
|
// Keywords from https://en.cppreference.com/w/cpp/keyword includes C++20.
|
||||||
"static_cast typeid catch operator template typename class friend private " +
|
keywords: words(cKeywords + "alignas alignof and and_eq audit axiom bitand bitor catch " +
|
||||||
"this using const_cast inline public throw virtual delete mutable protected " +
|
"class compl concept constexpr const_cast decltype delete dynamic_cast " +
|
||||||
"alignas alignof constexpr decltype nullptr noexcept thread_local final " +
|
"explicit export final friend import module mutable namespace new noexcept " +
|
||||||
"static_assert override"),
|
"not not_eq operator or or_eq override private protected public " +
|
||||||
types: words(cTypes + " bool wchar_t"),
|
"reinterpret_cast requires static_assert static_cast template this " +
|
||||||
blockKeywords: words("catch class do else finally for if struct switch try while"),
|
"thread_local throw try typeid typename using virtual xor xor_eq"),
|
||||||
defKeywords: words("class namespace struct enum union"),
|
types: cTypes,
|
||||||
|
blockKeywords: words(cBlockKeywords + " class try catch"),
|
||||||
|
defKeywords: words(cDefKeywords + " class namespace"),
|
||||||
typeFirstDefinitions: true,
|
typeFirstDefinitions: true,
|
||||||
atoms: words("true false NULL"),
|
atoms: words("true false NULL nullptr"),
|
||||||
dontIndentStatements: /^template$/,
|
dontIndentStatements: /^template$/,
|
||||||
isIdentifierChar: /[\w\$_~\xa1-\uffff]/,
|
isIdentifierChar: /[\w\$_~\xa1-\uffff]/,
|
||||||
|
isReservedIdentifier: cIsReservedIdentifier,
|
||||||
hooks: {
|
hooks: {
|
||||||
"#": cppHook,
|
"#": cppHook,
|
||||||
"*": pointerHook,
|
"*": pointerHook,
|
||||||
@ -513,7 +555,6 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
|
|||||||
def("text/x-scala", {
|
def("text/x-scala", {
|
||||||
name: "clike",
|
name: "clike",
|
||||||
keywords: words(
|
keywords: words(
|
||||||
|
|
||||||
/* scala */
|
/* scala */
|
||||||
"abstract case catch class def do else extends final finally for forSome if " +
|
"abstract case catch class def do else extends final finally for forSome if " +
|
||||||
"implicit import lazy match new null object override package private protected return " +
|
"implicit import lazy match new null object override package private protected return " +
|
||||||
@ -628,6 +669,9 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
|
|||||||
stream.eatWhile(/[\w\$_]/);
|
stream.eatWhile(/[\w\$_]/);
|
||||||
return "meta";
|
return "meta";
|
||||||
},
|
},
|
||||||
|
'*': function(_stream, state) {
|
||||||
|
return state.prevToken == '.' ? 'variable' : 'operator';
|
||||||
|
},
|
||||||
'"': function(stream, state) {
|
'"': function(stream, state) {
|
||||||
state.tokenize = tokenKotlinString(stream.match('""'));
|
state.tokenize = tokenKotlinString(stream.match('""'));
|
||||||
return state.tokenize(stream, state);
|
return state.tokenize(stream, state);
|
||||||
@ -708,11 +752,11 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
|
|||||||
|
|
||||||
def("text/x-nesc", {
|
def("text/x-nesc", {
|
||||||
name: "clike",
|
name: "clike",
|
||||||
keywords: words(cKeywords + "as atomic async call command component components configuration event generic " +
|
keywords: words(cKeywords + " as atomic async call command component components configuration event generic " +
|
||||||
"implementation includes interface module new norace nx_struct nx_union post provides " +
|
"implementation includes interface module new norace nx_struct nx_union post provides " +
|
||||||
"signal task uses abstract extends"),
|
"signal task uses abstract extends"),
|
||||||
types: words(cTypes),
|
types: cTypes,
|
||||||
blockKeywords: words("case do else for if switch while struct"),
|
blockKeywords: words(cBlockKeywords),
|
||||||
atoms: words("null true false"),
|
atoms: words("null true false"),
|
||||||
hooks: {"#": cppHook},
|
hooks: {"#": cppHook},
|
||||||
modeProps: {fold: ["brace", "include"]}
|
modeProps: {fold: ["brace", "include"]}
|
||||||
@ -720,28 +764,34 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
|
|||||||
|
|
||||||
def("text/x-objectivec", {
|
def("text/x-objectivec", {
|
||||||
name: "clike",
|
name: "clike",
|
||||||
keywords: words(cKeywords + "inline restrict _Bool _Complex _Imaginary BOOL Class bycopy byref id IMP in " +
|
keywords: words(cKeywords + " bycopy byref in inout oneway out self super atomic nonatomic retain copy " +
|
||||||
"inout nil oneway out Protocol SEL self super atomic nonatomic retain copy readwrite readonly"),
|
"readwrite readonly strong weak assign typeof nullable nonnull null_resettable _cmd " +
|
||||||
types: words(cTypes),
|
"@interface @implementation @end @protocol @encode @property @synthesize @dynamic @class " +
|
||||||
atoms: words("YES NO NULL NILL ON OFF true false"),
|
"@public @package @private @protected @required @optional @try @catch @finally @import " +
|
||||||
|
"@selector @encode @defs @synchronized @autoreleasepool @compatibility_alias @available"),
|
||||||
|
types: objCTypes,
|
||||||
|
builtin: words("FOUNDATION_EXPORT FOUNDATION_EXTERN NS_INLINE NS_FORMAT_FUNCTION NS_RETURNS_RETAINED " +
|
||||||
|
"NS_ERROR_ENUM NS_RETURNS_NOT_RETAINED NS_RETURNS_INNER_POINTER NS_DESIGNATED_INITIALIZER " +
|
||||||
|
"NS_ENUM NS_OPTIONS NS_REQUIRES_NIL_TERMINATION NS_ASSUME_NONNULL_BEGIN " +
|
||||||
|
"NS_ASSUME_NONNULL_END NS_SWIFT_NAME NS_REFINED_FOR_SWIFT"),
|
||||||
|
blockKeywords: words(cBlockKeywords + " @synthesize @try @catch @finally @autoreleasepool @synchronized"),
|
||||||
|
defKeywords: words(cDefKeywords + " @interface @implementation @protocol @class"),
|
||||||
|
dontIndentStatements: /^@.*$/,
|
||||||
|
typeFirstDefinitions: true,
|
||||||
|
atoms: words("YES NO NULL Nil nil true false nullptr"),
|
||||||
|
isReservedIdentifier: cIsReservedIdentifier,
|
||||||
hooks: {
|
hooks: {
|
||||||
"@": function(stream) {
|
|
||||||
stream.eatWhile(/[\w\$]/);
|
|
||||||
return "keyword";
|
|
||||||
},
|
|
||||||
"#": cppHook,
|
"#": cppHook,
|
||||||
indent: function(_state, ctx, textAfter) {
|
"*": pointerHook,
|
||||||
if (ctx.type == "statement" && /^@\w/.test(textAfter)) return ctx.indented
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
modeProps: {fold: "brace"}
|
modeProps: {fold: ["brace", "include"]}
|
||||||
});
|
});
|
||||||
|
|
||||||
def("text/x-squirrel", {
|
def("text/x-squirrel", {
|
||||||
name: "clike",
|
name: "clike",
|
||||||
keywords: words("base break clone continue const default delete enum extends function in class" +
|
keywords: words("base break clone continue const default delete enum extends function in class" +
|
||||||
" foreach local resume return this throw typeof yield constructor instanceof static"),
|
" foreach local resume return this throw typeof yield constructor instanceof static"),
|
||||||
types: words(cTypes),
|
types: cTypes,
|
||||||
blockKeywords: words("case catch class else for foreach if switch try while"),
|
blockKeywords: words("case catch class else for foreach if switch try while"),
|
||||||
defKeywords: words("function local class"),
|
defKeywords: words("function local class"),
|
||||||
typeFirstDefinitions: true,
|
typeFirstDefinitions: true,
|
||||||
|
34
libraries/codemirror/mode/clike/index.html
vendored
34
libraries/codemirror/mode/clike/index.html
vendored
@ -147,16 +147,36 @@ This is a longer comment
|
|||||||
That spans two lines
|
That spans two lines
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import <Test/Test.h>
|
#import "MyClass.h"
|
||||||
|
#import <AFramework/AFrameork.h>
|
||||||
|
@import BFrameworkModule;
|
||||||
|
|
||||||
|
NS_ENUM(SomeValues) {
|
||||||
|
aValue = 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
// A Class Extension with some properties
|
||||||
|
@interface MyClass ()<AProtocol>
|
||||||
|
@property(atomic, readwrite, assign) NSInteger anInt;
|
||||||
|
@property(nonatomic, strong, nullable) NSString *aString;
|
||||||
|
@end
|
||||||
|
|
||||||
@implementation YourAppDelegate
|
@implementation YourAppDelegate
|
||||||
|
|
||||||
// This is a one-line comment
|
- (instancetype)initWithString:(NSString *)aStringVar {
|
||||||
|
if ((self = [super init])) {
|
||||||
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{
|
aString = aStringVar;
|
||||||
char myString[] = "This is a C character array";
|
}
|
||||||
int test = 5;
|
return self;
|
||||||
return YES;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (BOOL)doSomething:(float)progress {
|
||||||
|
NSString *myString = @"This is a ObjC string %f ";
|
||||||
|
myString = [[NSString stringWithFormat:myString, progress] stringByAppendingString:self.aString];
|
||||||
|
return myString.length > 100 ? NO : YES;
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
</textarea></div>
|
</textarea></div>
|
||||||
|
|
||||||
<h2>Java example</h2>
|
<h2>Java example</h2>
|
||||||
|
70
libraries/codemirror/mode/clike/test.js
vendored
70
libraries/codemirror/mode/clike/test.js
vendored
@ -23,6 +23,8 @@
|
|||||||
MT("def",
|
MT("def",
|
||||||
"[type void] [def foo]() {}",
|
"[type void] [def foo]() {}",
|
||||||
"[keyword struct] [def bar]{}",
|
"[keyword struct] [def bar]{}",
|
||||||
|
"[keyword enum] [def zot]{}",
|
||||||
|
"[keyword union] [def ugh]{}",
|
||||||
"[type int] [type *][def baz]() {}");
|
"[type int] [type *][def baz]() {}");
|
||||||
|
|
||||||
MT("def_new_line",
|
MT("def_new_line",
|
||||||
@ -43,6 +45,26 @@
|
|||||||
"[type unsigned] [type int] [variable bar] [operator =] [number 8];",
|
"[type unsigned] [type int] [variable bar] [operator =] [number 8];",
|
||||||
"[meta #include <baz> ][comment // comment]")
|
"[meta #include <baz> ][comment // comment]")
|
||||||
|
|
||||||
|
MT("c_underscores",
|
||||||
|
"[builtin __FOO];",
|
||||||
|
"[builtin _Complex];",
|
||||||
|
"[builtin __aName];",
|
||||||
|
"[variable _aName];");
|
||||||
|
|
||||||
|
MT("c_types",
|
||||||
|
"[type int];",
|
||||||
|
"[type long];",
|
||||||
|
"[type char];",
|
||||||
|
"[type short];",
|
||||||
|
"[type double];",
|
||||||
|
"[type float];",
|
||||||
|
"[type unsigned];",
|
||||||
|
"[type signed];",
|
||||||
|
"[type void];",
|
||||||
|
"[type bool];",
|
||||||
|
"[type foo_t];",
|
||||||
|
"[variable foo_T];",
|
||||||
|
"[variable _t];");
|
||||||
|
|
||||||
var mode_cpp = CodeMirror.getMode({indentUnit: 2}, "text/x-c++src");
|
var mode_cpp = CodeMirror.getMode({indentUnit: 2}, "text/x-c++src");
|
||||||
function MTCPP(name) { test.mode(name, mode_cpp, Array.prototype.slice.call(arguments, 1)); }
|
function MTCPP(name) { test.mode(name, mode_cpp, Array.prototype.slice.call(arguments, 1)); }
|
||||||
@ -57,6 +79,54 @@
|
|||||||
"[def Foo::Foo]() {}",
|
"[def Foo::Foo]() {}",
|
||||||
"[def Foo::~Foo]() {}");
|
"[def Foo::~Foo]() {}");
|
||||||
|
|
||||||
|
MTCPP("cpp_underscores",
|
||||||
|
"[builtin __FOO];",
|
||||||
|
"[builtin _Complex];",
|
||||||
|
"[builtin __aName];",
|
||||||
|
"[variable _aName];");
|
||||||
|
|
||||||
|
var mode_objc = CodeMirror.getMode({indentUnit: 2}, "text/x-objectivec");
|
||||||
|
function MTOBJC(name) { test.mode(name, mode_objc, Array.prototype.slice.call(arguments, 1)); }
|
||||||
|
|
||||||
|
MTOBJC("objc_underscores",
|
||||||
|
"[builtin __FOO];",
|
||||||
|
"[builtin _Complex];",
|
||||||
|
"[builtin __aName];",
|
||||||
|
"[variable _aName];");
|
||||||
|
|
||||||
|
MTOBJC("objc_interface",
|
||||||
|
"[keyword @interface] [def foo] {",
|
||||||
|
" [type int] [variable bar];",
|
||||||
|
"}",
|
||||||
|
"[keyword @property] ([keyword atomic], [keyword nullable]) [variable NSString][operator *] [variable a];",
|
||||||
|
"[keyword @property] ([keyword nonatomic], [keyword assign]) [type int] [variable b];",
|
||||||
|
"[operator -]([type instancetype])[variable initWithFoo]:([type int])[variable a] " +
|
||||||
|
"[builtin NS_DESIGNATED_INITIALIZER];",
|
||||||
|
"[keyword @end]");
|
||||||
|
|
||||||
|
MTOBJC("objc_implementation",
|
||||||
|
"[keyword @implementation] [def foo] {",
|
||||||
|
" [type int] [variable bar];",
|
||||||
|
"}",
|
||||||
|
"[keyword @property] ([keyword readwrite]) [type SEL] [variable a];",
|
||||||
|
"[operator -]([type instancetype])[variable initWithFoo]:([type int])[variable a] {",
|
||||||
|
" [keyword if](([keyword self] [operator =] [[[keyword super] [variable init] ]])) {}",
|
||||||
|
" [keyword return] [keyword self];",
|
||||||
|
"}",
|
||||||
|
"[keyword @end]");
|
||||||
|
|
||||||
|
MTOBJC("objc_types",
|
||||||
|
"[type int];",
|
||||||
|
"[type foo_t];",
|
||||||
|
"[variable foo_T];",
|
||||||
|
"[type id];",
|
||||||
|
"[type SEL];",
|
||||||
|
"[type instancetype];",
|
||||||
|
"[type Class];",
|
||||||
|
"[type Protocol];",
|
||||||
|
"[type BOOL];"
|
||||||
|
);
|
||||||
|
|
||||||
var mode_scala = CodeMirror.getMode({indentUnit: 2}, "text/x-scala");
|
var mode_scala = CodeMirror.getMode({indentUnit: 2}, "text/x-scala");
|
||||||
function MTSCALA(name) { test.mode("scala_" + name, mode_scala, Array.prototype.slice.call(arguments, 1)); }
|
function MTSCALA(name) { test.mode("scala_" + name, mode_scala, Array.prototype.slice.call(arguments, 1)); }
|
||||||
MTSCALA("nested_comments",
|
MTSCALA("nested_comments",
|
||||||
|
2
libraries/codemirror/mode/clojure/clojure.js
vendored
2
libraries/codemirror/mode/clojure/clojure.js
vendored
@ -166,7 +166,7 @@ CodeMirror.defineMode("clojure", function (options) {
|
|||||||
var qualifiedSymbol = /^(?:(?:[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*(?:\.[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*)*\/)?(?:\/|[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*)*(?=[\\\[\]\s"(),;@^`{}~]|$))/;
|
var qualifiedSymbol = /^(?:(?:[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*(?:\.[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*)*\/)?(?:\/|[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*)*(?=[\\\[\]\s"(),;@^`{}~]|$))/;
|
||||||
|
|
||||||
function base(stream, state) {
|
function base(stream, state) {
|
||||||
if (stream.eatSpace()) return ["space", null];
|
if (stream.eatSpace() || stream.eat(",")) return ["space", null];
|
||||||
if (stream.match(numberLiteral)) return [null, "number"];
|
if (stream.match(numberLiteral)) return [null, "number"];
|
||||||
if (stream.match(characterLiteral)) return [null, "string-2"];
|
if (stream.match(characterLiteral)) return [null, "string-2"];
|
||||||
if (stream.eat(/^"/)) return (state.tokenize = inString)(stream, state);
|
if (stream.eat(/^"/)) return (state.tokenize = inString)(stream, state);
|
||||||
|
15
libraries/codemirror/mode/css/css.js
vendored
15
libraries/codemirror/mode/css/css.js
vendored
@ -63,7 +63,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
|
|||||||
if (/[\d.]/.test(stream.peek())) {
|
if (/[\d.]/.test(stream.peek())) {
|
||||||
stream.eatWhile(/[\w.%]/);
|
stream.eatWhile(/[\w.%]/);
|
||||||
return ret("number", "unit");
|
return ret("number", "unit");
|
||||||
} else if (stream.match(/^-[\w\\\-]+/)) {
|
} else if (stream.match(/^-[\w\\\-]*/)) {
|
||||||
stream.eatWhile(/[\w\\\-]/);
|
stream.eatWhile(/[\w\\\-]/);
|
||||||
if (stream.match(/^\s*:/, false))
|
if (stream.match(/^\s*:/, false))
|
||||||
return ret("variable-2", "variable-definition");
|
return ret("variable-2", "variable-definition");
|
||||||
@ -77,12 +77,11 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
|
|||||||
return ret("qualifier", "qualifier");
|
return ret("qualifier", "qualifier");
|
||||||
} else if (/[:;{}\[\]\(\)]/.test(ch)) {
|
} else if (/[:;{}\[\]\(\)]/.test(ch)) {
|
||||||
return ret(null, ch);
|
return ret(null, ch);
|
||||||
} else if (((ch == "u" || ch == "U") && stream.match(/rl(-prefix)?\(/i)) ||
|
} else if (stream.match(/[\w-.]+(?=\()/)) {
|
||||||
((ch == "d" || ch == "D") && stream.match("omain(", true, true)) ||
|
if (/^(url(-prefix)?|domain|regexp)$/.test(stream.current().toLowerCase())) {
|
||||||
((ch == "r" || ch == "R") && stream.match("egexp(", true, true))) {
|
state.tokenize = tokenParenthesized;
|
||||||
stream.backUp(1);
|
}
|
||||||
state.tokenize = tokenParenthesized;
|
return ret("variable callee", "variable");
|
||||||
return ret("property", "word");
|
|
||||||
} else if (/[\w\\\-]/.test(ch)) {
|
} else if (/[\w\\\-]/.test(ch)) {
|
||||||
stream.eatWhile(/[\w\\\-]/);
|
stream.eatWhile(/[\w\\\-]/);
|
||||||
return ret("property", "word");
|
return ret("property", "word");
|
||||||
@ -501,7 +500,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
|
|||||||
"margin-bottom", "margin-left", "margin-right", "margin-top",
|
"margin-bottom", "margin-left", "margin-right", "margin-top",
|
||||||
"marks", "marquee-direction", "marquee-loop",
|
"marks", "marquee-direction", "marquee-loop",
|
||||||
"marquee-play-count", "marquee-speed", "marquee-style", "max-height",
|
"marquee-play-count", "marquee-speed", "marquee-style", "max-height",
|
||||||
"max-width", "min-height", "min-width", "move-to", "nav-down", "nav-index",
|
"max-width", "min-height", "min-width", "mix-blend-mode", "move-to", "nav-down", "nav-index",
|
||||||
"nav-left", "nav-right", "nav-up", "object-fit", "object-position",
|
"nav-left", "nav-right", "nav-up", "object-fit", "object-position",
|
||||||
"opacity", "order", "orphans", "outline",
|
"opacity", "order", "orphans", "outline",
|
||||||
"outline-color", "outline-offset", "outline-style", "outline-width",
|
"outline-color", "outline-offset", "outline-style", "outline-width",
|
||||||
|
8
libraries/codemirror/mode/css/less_test.js
vendored
8
libraries/codemirror/mode/css/less_test.js
vendored
@ -10,8 +10,8 @@
|
|||||||
MT("variable",
|
MT("variable",
|
||||||
"[variable-2 @base]: [atom #f04615];",
|
"[variable-2 @base]: [atom #f04615];",
|
||||||
"[qualifier .class] {",
|
"[qualifier .class] {",
|
||||||
" [property width]: [variable percentage]([number 0.5]); [comment // returns `50%`]",
|
" [property width]: [variable&callee percentage]([number 0.5]); [comment // returns `50%`]",
|
||||||
" [property color]: [variable saturate]([variable-2 @base], [number 5%]);",
|
" [property color]: [variable&callee saturate]([variable-2 @base], [number 5%]);",
|
||||||
"}");
|
"}");
|
||||||
|
|
||||||
MT("amp",
|
MT("amp",
|
||||||
@ -26,10 +26,10 @@
|
|||||||
|
|
||||||
MT("mixin",
|
MT("mixin",
|
||||||
"[qualifier .mixin] ([variable dark]; [variable-2 @color]) {",
|
"[qualifier .mixin] ([variable dark]; [variable-2 @color]) {",
|
||||||
" [property color]: [atom darken]([variable-2 @color], [number 10%]);",
|
" [property color]: [variable&callee darken]([variable-2 @color], [number 10%]);",
|
||||||
"}",
|
"}",
|
||||||
"[qualifier .mixin] ([variable light]; [variable-2 @color]) {",
|
"[qualifier .mixin] ([variable light]; [variable-2 @color]) {",
|
||||||
" [property color]: [atom lighten]([variable-2 @color], [number 10%]);",
|
" [property color]: [variable&callee lighten]([variable-2 @color], [number 10%]);",
|
||||||
"}",
|
"}",
|
||||||
"[qualifier .mixin] ([variable-2 @_]; [variable-2 @color]) {",
|
"[qualifier .mixin] ([variable-2 @_]; [variable-2 @color]) {",
|
||||||
" [property display]: [atom block];",
|
" [property display]: [atom block];",
|
||||||
|
10
libraries/codemirror/mode/css/scss_test.js
vendored
10
libraries/codemirror/mode/css/scss_test.js
vendored
@ -6,19 +6,19 @@
|
|||||||
function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), "scss"); }
|
function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), "scss"); }
|
||||||
|
|
||||||
MT('url_with_quotation',
|
MT('url_with_quotation',
|
||||||
"[tag foo] { [property background]:[atom url]([string test.jpg]) }");
|
"[tag foo] { [property background]:[variable&callee url]([string test.jpg]) }");
|
||||||
|
|
||||||
MT('url_with_double_quotes',
|
MT('url_with_double_quotes',
|
||||||
"[tag foo] { [property background]:[atom url]([string \"test.jpg\"]) }");
|
"[tag foo] { [property background]:[variable&callee url]([string \"test.jpg\"]) }");
|
||||||
|
|
||||||
MT('url_with_single_quotes',
|
MT('url_with_single_quotes',
|
||||||
"[tag foo] { [property background]:[atom url]([string \'test.jpg\']) }");
|
"[tag foo] { [property background]:[variable&callee url]([string \'test.jpg\']) }");
|
||||||
|
|
||||||
MT('string',
|
MT('string',
|
||||||
"[def @import] [string \"compass/css3\"]");
|
"[def @import] [string \"compass/css3\"]");
|
||||||
|
|
||||||
MT('important_keyword',
|
MT('important_keyword',
|
||||||
"[tag foo] { [property background]:[atom url]([string \'test.jpg\']) [keyword !important] }");
|
"[tag foo] { [property background]:[variable&callee url]([string \'test.jpg\']) [keyword !important] }");
|
||||||
|
|
||||||
MT('variable',
|
MT('variable',
|
||||||
"[variable-2 $blue]:[atom #333]");
|
"[variable-2 $blue]:[atom #333]");
|
||||||
@ -95,7 +95,7 @@
|
|||||||
|
|
||||||
MT('indent_parentheses',
|
MT('indent_parentheses',
|
||||||
"[tag foo] {",
|
"[tag foo] {",
|
||||||
" [property color]: [atom darken]([variable-2 $blue],",
|
" [property color]: [variable&callee darken]([variable-2 $blue],",
|
||||||
" [number 9%]);",
|
" [number 9%]);",
|
||||||
"}");
|
"}");
|
||||||
|
|
||||||
|
50
libraries/codemirror/mode/css/test.js
vendored
50
libraries/codemirror/mode/css/test.js
vendored
@ -89,11 +89,11 @@
|
|||||||
"[tag foo] { [property margin]: [number 0]; [property padding]: [number 0]; }");
|
"[tag foo] { [property margin]: [number 0]; [property padding]: [number 0]; }");
|
||||||
|
|
||||||
MT("tagTwoPropertiesURL",
|
MT("tagTwoPropertiesURL",
|
||||||
"[tag foo] { [property background]: [atom url]([string //example.com/foo.png]); [property padding]: [number 0]; }");
|
"[tag foo] { [property background]: [variable&callee url]([string //example.com/foo.png]); [property padding]: [number 0]; }");
|
||||||
|
|
||||||
MT("indent_tagSelector",
|
MT("indent_tagSelector",
|
||||||
"[tag strong], [tag em] {",
|
"[tag strong], [tag em] {",
|
||||||
" [property background]: [atom rgba](",
|
" [property background]: [variable&callee rgba](",
|
||||||
" [number 255], [number 255], [number 0], [number .2]",
|
" [number 255], [number 255], [number 0], [number .2]",
|
||||||
" );",
|
" );",
|
||||||
"}");
|
"}");
|
||||||
@ -114,7 +114,7 @@
|
|||||||
|
|
||||||
MT("indent_parentheses",
|
MT("indent_parentheses",
|
||||||
"[tag foo]:[variable-3 before] {",
|
"[tag foo]:[variable-3 before] {",
|
||||||
" [property background]: [atom url](",
|
" [property background]: [variable&callee url](",
|
||||||
"[string blahblah]",
|
"[string blahblah]",
|
||||||
"[string etc]",
|
"[string etc]",
|
||||||
"[string ]) [keyword !important];",
|
"[string ]) [keyword !important];",
|
||||||
@ -124,20 +124,20 @@
|
|||||||
"[def @font-face] {",
|
"[def @font-face] {",
|
||||||
" [property font-family]: [string 'myfont'];",
|
" [property font-family]: [string 'myfont'];",
|
||||||
" [error nonsense]: [string 'abc'];",
|
" [error nonsense]: [string 'abc'];",
|
||||||
" [property src]: [atom url]([string http://blah]),",
|
" [property src]: [variable&callee url]([string http://blah]),",
|
||||||
" [atom url]([string http://foo]);",
|
" [variable&callee url]([string http://foo]);",
|
||||||
"}");
|
"}");
|
||||||
|
|
||||||
MT("empty_url",
|
MT("empty_url",
|
||||||
"[def @import] [atom url]() [attribute screen];");
|
"[def @import] [variable&callee url]() [attribute screen];");
|
||||||
|
|
||||||
MT("parens",
|
MT("parens",
|
||||||
"[qualifier .foo] {",
|
"[qualifier .foo] {",
|
||||||
" [property background-image]: [variable fade]([atom #000], [number 20%]);",
|
" [property background-image]: [variable&callee fade]([atom #000], [number 20%]);",
|
||||||
" [property border-image]: [atom linear-gradient](",
|
" [property border-image]: [variable&callee linear-gradient](",
|
||||||
" [atom to] [atom bottom],",
|
" [atom to] [atom bottom],",
|
||||||
" [variable fade]([atom #000], [number 20%]) [number 0%],",
|
" [variable&callee fade]([atom #000], [number 20%]) [number 0%],",
|
||||||
" [variable fade]([atom #000], [number 20%]) [number 100%]",
|
" [variable&callee fade]([atom #000], [number 20%]) [number 100%]",
|
||||||
" );",
|
" );",
|
||||||
"}");
|
"}");
|
||||||
|
|
||||||
@ -146,7 +146,15 @@
|
|||||||
" [variable-2 --main-color]: [atom #06c];",
|
" [variable-2 --main-color]: [atom #06c];",
|
||||||
"}",
|
"}",
|
||||||
"[tag h1][builtin #foo] {",
|
"[tag h1][builtin #foo] {",
|
||||||
" [property color]: [atom var]([variable-2 --main-color]);",
|
" [property color]: [variable&callee var]([variable-2 --main-color]);",
|
||||||
|
"}");
|
||||||
|
|
||||||
|
MT("blank_css_variable",
|
||||||
|
":[variable-3 root] {",
|
||||||
|
" [variable-2 --]: [atom #06c];",
|
||||||
|
"}",
|
||||||
|
"[tag h1][builtin #foo] {",
|
||||||
|
" [property color]: [variable&callee var]([variable-2 --]);",
|
||||||
"}");
|
"}");
|
||||||
|
|
||||||
MT("supports",
|
MT("supports",
|
||||||
@ -155,10 +163,10 @@
|
|||||||
"}");
|
"}");
|
||||||
|
|
||||||
MT("document",
|
MT("document",
|
||||||
"[def @document] [tag url]([string http://blah]),",
|
"[def @document] [variable&callee url]([string http://blah]),",
|
||||||
" [tag url-prefix]([string https://]),",
|
" [variable&callee url-prefix]([string https://]),",
|
||||||
" [tag domain]([string blah.com]),",
|
" [variable&callee domain]([string blah.com]),",
|
||||||
" [tag regexp]([string \".*blah.+\"]) {",
|
" [variable&callee regexp]([string \".*blah.+\"]) {",
|
||||||
" [builtin #id] {",
|
" [builtin #id] {",
|
||||||
" [property background-color]: [keyword white];",
|
" [property background-color]: [keyword white];",
|
||||||
" }",
|
" }",
|
||||||
@ -168,16 +176,16 @@
|
|||||||
"}");
|
"}");
|
||||||
|
|
||||||
MT("document_url",
|
MT("document_url",
|
||||||
"[def @document] [tag url]([string http://blah]) { [qualifier .class] { } }");
|
"[def @document] [variable&callee url]([string http://blah]) { [qualifier .class] { } }");
|
||||||
|
|
||||||
MT("document_urlPrefix",
|
MT("document_urlPrefix",
|
||||||
"[def @document] [tag url-prefix]([string https://]) { [builtin #id] { } }");
|
"[def @document] [variable&callee url-prefix]([string https://]) { [builtin #id] { } }");
|
||||||
|
|
||||||
MT("document_domain",
|
MT("document_domain",
|
||||||
"[def @document] [tag domain]([string blah.com]) { [tag foo] { } }");
|
"[def @document] [variable&callee domain]([string blah.com]) { [tag foo] { } }");
|
||||||
|
|
||||||
MT("document_regexp",
|
MT("document_regexp",
|
||||||
"[def @document] [tag regexp]([string \".*blah.+\"]) { [builtin #id] { } }");
|
"[def @document] [variable&callee regexp]([string \".*blah.+\"]) { [builtin #id] { } }");
|
||||||
|
|
||||||
MT("counter-style",
|
MT("counter-style",
|
||||||
"[def @counter-style] [variable binary] {",
|
"[def @counter-style] [variable binary] {",
|
||||||
@ -199,11 +207,11 @@
|
|||||||
"[tag ol][qualifier .roman] { [property list-style]: [variable simple-roman]; }");
|
"[tag ol][qualifier .roman] { [property list-style]: [variable simple-roman]; }");
|
||||||
|
|
||||||
MT("counter-style-symbols",
|
MT("counter-style-symbols",
|
||||||
"[tag ol] { [property list-style]: [atom symbols]([atom cyclic] [string \"*\"] [string \"\\2020\"] [string \"\\2021\"] [string \"\\A7\"]); }");
|
"[tag ol] { [property list-style]: [variable&callee symbols]([atom cyclic] [string \"*\"] [string \"\\2020\"] [string \"\\2021\"] [string \"\\A7\"]); }");
|
||||||
|
|
||||||
MT("comment-does-not-disrupt",
|
MT("comment-does-not-disrupt",
|
||||||
"[def @font-face] [comment /* foo */] {",
|
"[def @font-face] [comment /* foo */] {",
|
||||||
" [property src]: [atom url]([string x]);",
|
" [property src]: [variable&callee url]([string x]);",
|
||||||
" [property font-family]: [variable One];",
|
" [property font-family]: [variable One];",
|
||||||
"}")
|
"}")
|
||||||
})();
|
})();
|
||||||
|
7
libraries/codemirror/mode/d/d.js
vendored
7
libraries/codemirror/mode/d/d.js
vendored
@ -182,7 +182,12 @@ CodeMirror.defineMode("d", function(config, parserConfig) {
|
|||||||
else return ctx.indented + (closing ? 0 : indentUnit);
|
else return ctx.indented + (closing ? 0 : indentUnit);
|
||||||
},
|
},
|
||||||
|
|
||||||
electricChars: "{}"
|
electricChars: "{}",
|
||||||
|
blockCommentStart: "/*",
|
||||||
|
blockCommentEnd: "*/",
|
||||||
|
blockCommentContinue: " * ",
|
||||||
|
lineComment: "//",
|
||||||
|
fold: "brace"
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
2
libraries/codemirror/mode/django/index.html
vendored
2
libraries/codemirror/mode/django/index.html
vendored
@ -11,7 +11,7 @@
|
|||||||
<script src="../xml/xml.js"></script>
|
<script src="../xml/xml.js"></script>
|
||||||
<script src="../htmlmixed/htmlmixed.js"></script>
|
<script src="../htmlmixed/htmlmixed.js"></script>
|
||||||
<script src="django.js"></script>
|
<script src="django.js"></script>
|
||||||
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
||||||
<div id=nav>
|
<div id=nav>
|
||||||
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
<script src="../../lib/codemirror.js"></script>
|
<script src="../../lib/codemirror.js"></script>
|
||||||
<script src="../../addon/mode/simple.js"></script>
|
<script src="../../addon/mode/simple.js"></script>
|
||||||
<script src="dockerfile.js"></script>
|
<script src="dockerfile.js"></script>
|
||||||
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
||||||
<div id=nav>
|
<div id=nav>
|
||||||
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
||||||
|
|
||||||
|
2
libraries/codemirror/mode/dtd/index.html
vendored
2
libraries/codemirror/mode/dtd/index.html
vendored
@ -7,7 +7,7 @@
|
|||||||
<link rel="stylesheet" href="../../lib/codemirror.css">
|
<link rel="stylesheet" href="../../lib/codemirror.css">
|
||||||
<script src="../../lib/codemirror.js"></script>
|
<script src="../../lib/codemirror.js"></script>
|
||||||
<script src="dtd.js"></script>
|
<script src="dtd.js"></script>
|
||||||
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
||||||
<div id=nav>
|
<div id=nav>
|
||||||
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
||||||
|
|
||||||
|
2
libraries/codemirror/mode/dylan/index.html
vendored
2
libraries/codemirror/mode/dylan/index.html
vendored
@ -10,7 +10,7 @@
|
|||||||
<script src="../../addon/comment/continuecomment.js"></script>
|
<script src="../../addon/comment/continuecomment.js"></script>
|
||||||
<script src="../../addon/comment/comment.js"></script>
|
<script src="../../addon/comment/comment.js"></script>
|
||||||
<script src="dylan.js"></script>
|
<script src="dylan.js"></script>
|
||||||
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
||||||
<div id=nav>
|
<div id=nav>
|
||||||
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
||||||
|
|
||||||
|
2
libraries/codemirror/mode/ebnf/index.html
vendored
2
libraries/codemirror/mode/ebnf/index.html
vendored
@ -9,7 +9,7 @@
|
|||||||
<script src="../../lib/codemirror.js"></script>
|
<script src="../../lib/codemirror.js"></script>
|
||||||
<script src="../javascript/javascript.js"></script>
|
<script src="../javascript/javascript.js"></script>
|
||||||
<script src="ebnf.js"></script>
|
<script src="ebnf.js"></script>
|
||||||
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id=nav>
|
<div id=nav>
|
||||||
|
2
libraries/codemirror/mode/elm/index.html
vendored
2
libraries/codemirror/mode/elm/index.html
vendored
@ -7,7 +7,7 @@
|
|||||||
<link rel="stylesheet" href="../../lib/codemirror.css">
|
<link rel="stylesheet" href="../../lib/codemirror.css">
|
||||||
<script src="../../lib/codemirror.js"></script>
|
<script src="../../lib/codemirror.js"></script>
|
||||||
<script src="elm.js"></script>
|
<script src="elm.js"></script>
|
||||||
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
||||||
<div id=nav>
|
<div id=nav>
|
||||||
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
||||||
|
|
||||||
|
2
libraries/codemirror/mode/erlang/index.html
vendored
2
libraries/codemirror/mode/erlang/index.html
vendored
@ -9,7 +9,7 @@
|
|||||||
<script src="../../lib/codemirror.js"></script>
|
<script src="../../lib/codemirror.js"></script>
|
||||||
<script src="../../addon/edit/matchbrackets.js"></script>
|
<script src="../../addon/edit/matchbrackets.js"></script>
|
||||||
<script src="erlang.js"></script>
|
<script src="erlang.js"></script>
|
||||||
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
||||||
<div id=nav>
|
<div id=nav>
|
||||||
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
||||||
|
|
||||||
|
2
libraries/codemirror/mode/fortran/index.html
vendored
2
libraries/codemirror/mode/fortran/index.html
vendored
@ -7,7 +7,7 @@
|
|||||||
<link rel="stylesheet" href="../../lib/codemirror.css">
|
<link rel="stylesheet" href="../../lib/codemirror.css">
|
||||||
<script src="../../lib/codemirror.js"></script>
|
<script src="../../lib/codemirror.js"></script>
|
||||||
<script src="fortran.js"></script>
|
<script src="fortran.js"></script>
|
||||||
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
||||||
<div id=nav>
|
<div id=nav>
|
||||||
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
||||||
|
|
||||||
|
2
libraries/codemirror/mode/gfm/index.html
vendored
2
libraries/codemirror/mode/gfm/index.html
vendored
@ -15,7 +15,7 @@
|
|||||||
<script src="../htmlmixed/htmlmixed.js"></script>
|
<script src="../htmlmixed/htmlmixed.js"></script>
|
||||||
<script src="../clike/clike.js"></script>
|
<script src="../clike/clike.js"></script>
|
||||||
<script src="../meta.js"></script>
|
<script src="../meta.js"></script>
|
||||||
<style type="text/css">
|
<style>
|
||||||
.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
|
.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
|
||||||
.cm-s-default .cm-emoji {color: #009688;}
|
.cm-s-default .cm-emoji {color: #009688;}
|
||||||
</style>
|
</style>
|
||||||
|
2
libraries/codemirror/mode/haskell/index.html
vendored
2
libraries/codemirror/mode/haskell/index.html
vendored
@ -9,7 +9,7 @@
|
|||||||
<script src="../../lib/codemirror.js"></script>
|
<script src="../../lib/codemirror.js"></script>
|
||||||
<script src="../../addon/edit/matchbrackets.js"></script>
|
<script src="../../addon/edit/matchbrackets.js"></script>
|
||||||
<script src="haskell.js"></script>
|
<script src="haskell.js"></script>
|
||||||
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
||||||
<div id=nav>
|
<div id=nav>
|
||||||
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
||||||
|
|
||||||
|
2
libraries/codemirror/mode/haxe/index.html
vendored
2
libraries/codemirror/mode/haxe/index.html
vendored
@ -7,7 +7,7 @@
|
|||||||
<link rel="stylesheet" href="../../lib/codemirror.css">
|
<link rel="stylesheet" href="../../lib/codemirror.css">
|
||||||
<script src="../../lib/codemirror.js"></script>
|
<script src="../../lib/codemirror.js"></script>
|
||||||
<script src="haxe.js"></script>
|
<script src="haxe.js"></script>
|
||||||
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
||||||
<div id=nav>
|
<div id=nav>
|
||||||
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
<script src="../htmlmixed/htmlmixed.js"></script>
|
<script src="../htmlmixed/htmlmixed.js"></script>
|
||||||
<script src="../../addon/mode/multiplex.js"></script>
|
<script src="../../addon/mode/multiplex.js"></script>
|
||||||
<script src="htmlembedded.js"></script>
|
<script src="htmlembedded.js"></script>
|
||||||
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
||||||
<div id=nav>
|
<div id=nav>
|
||||||
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@
|
|||||||
return maybeBackup(stream, endTag, state.localMode.token(stream, state.localState));
|
return maybeBackup(stream, endTag, state.localMode.token(stream, state.localState));
|
||||||
};
|
};
|
||||||
state.localMode = mode;
|
state.localMode = mode;
|
||||||
state.localState = CodeMirror.startState(mode, htmlMode.indent(state.htmlState, ""));
|
state.localState = CodeMirror.startState(mode, htmlMode.indent(state.htmlState, "", ""));
|
||||||
} else if (state.inTag) {
|
} else if (state.inTag) {
|
||||||
state.inTag += stream.current()
|
state.inTag += stream.current()
|
||||||
if (stream.eol()) state.inTag += " "
|
if (stream.eol()) state.inTag += " "
|
||||||
@ -135,7 +135,7 @@
|
|||||||
|
|
||||||
indent: function (state, textAfter, line) {
|
indent: function (state, textAfter, line) {
|
||||||
if (!state.localMode || /^\s*<\//.test(textAfter))
|
if (!state.localMode || /^\s*<\//.test(textAfter))
|
||||||
return htmlMode.indent(state.htmlState, textAfter);
|
return htmlMode.indent(state.htmlState, textAfter, line);
|
||||||
else if (state.localMode.indent)
|
else if (state.localMode.indent)
|
||||||
return state.localMode.indent(state.localState, textAfter, line);
|
return state.localMode.indent(state.localState, textAfter, line);
|
||||||
else
|
else
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
<!-- this is a comment -->
|
<!-- this is a comment -->
|
||||||
<head>
|
<head>
|
||||||
<title>Mixed HTML Example</title>
|
<title>Mixed HTML Example</title>
|
||||||
<style type="text/css">
|
<style>
|
||||||
h1 {font-family: comic sans; color: #f0f;}
|
h1 {font-family: comic sans; color: #f0f;}
|
||||||
div {background: yellow !important;}
|
div {background: yellow !important;}
|
||||||
body {
|
body {
|
||||||
|
2
libraries/codemirror/mode/http/index.html
vendored
2
libraries/codemirror/mode/http/index.html
vendored
@ -7,7 +7,7 @@
|
|||||||
<link rel="stylesheet" href="../../lib/codemirror.css">
|
<link rel="stylesheet" href="../../lib/codemirror.css">
|
||||||
<script src="../../lib/codemirror.js"></script>
|
<script src="../../lib/codemirror.js"></script>
|
||||||
<script src="http.js"></script>
|
<script src="http.js"></script>
|
||||||
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
||||||
<div id=nav>
|
<div id=nav>
|
||||||
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
||||||
|
|
||||||
|
2
libraries/codemirror/mode/idl/index.html
vendored
2
libraries/codemirror/mode/idl/index.html
vendored
@ -8,7 +8,7 @@
|
|||||||
<script src="../../lib/codemirror.js"></script>
|
<script src="../../lib/codemirror.js"></script>
|
||||||
<script src="../../addon/edit/matchbrackets.js"></script>
|
<script src="../../addon/edit/matchbrackets.js"></script>
|
||||||
<script src="idl.js"></script>
|
<script src="idl.js"></script>
|
||||||
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
||||||
<div id=nav>
|
<div id=nav>
|
||||||
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
<script src="../../addon/comment/continuecomment.js"></script>
|
<script src="../../addon/comment/continuecomment.js"></script>
|
||||||
<script src="../../addon/comment/comment.js"></script>
|
<script src="../../addon/comment/comment.js"></script>
|
||||||
<script src="javascript.js"></script>
|
<script src="javascript.js"></script>
|
||||||
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
||||||
<div id=nav>
|
<div id=nav>
|
||||||
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
||||||
|
|
||||||
|
@ -365,7 +365,10 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
|
|||||||
}
|
}
|
||||||
if (type == "function") return cont(functiondef);
|
if (type == "function") return cont(functiondef);
|
||||||
if (type == "for") return cont(pushlex("form"), forspec, statement, poplex);
|
if (type == "for") return cont(pushlex("form"), forspec, statement, poplex);
|
||||||
if (type == "class" || (isTS && value == "interface")) { cx.marked = "keyword"; return cont(pushlex("form"), className, poplex); }
|
if (type == "class" || (isTS && value == "interface")) {
|
||||||
|
cx.marked = "keyword"
|
||||||
|
return cont(pushlex("form", type == "class" ? type : value), className, poplex)
|
||||||
|
}
|
||||||
if (type == "variable") {
|
if (type == "variable") {
|
||||||
if (isTS && value == "declare") {
|
if (isTS && value == "declare") {
|
||||||
cx.marked = "keyword"
|
cx.marked = "keyword"
|
||||||
@ -373,11 +376,11 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
|
|||||||
} else if (isTS && (value == "module" || value == "enum" || value == "type") && cx.stream.match(/^\s*\w/, false)) {
|
} else if (isTS && (value == "module" || value == "enum" || value == "type") && cx.stream.match(/^\s*\w/, false)) {
|
||||||
cx.marked = "keyword"
|
cx.marked = "keyword"
|
||||||
if (value == "enum") return cont(enumdef);
|
if (value == "enum") return cont(enumdef);
|
||||||
else if (value == "type") return cont(typeexpr, expect("operator"), typeexpr, expect(";"));
|
else if (value == "type") return cont(typename, expect("operator"), typeexpr, expect(";"));
|
||||||
else return cont(pushlex("form"), pattern, expect("{"), pushlex("}"), block, poplex, poplex)
|
else return cont(pushlex("form"), pattern, expect("{"), pushlex("}"), block, poplex, poplex)
|
||||||
} else if (isTS && value == "namespace") {
|
} else if (isTS && value == "namespace") {
|
||||||
cx.marked = "keyword"
|
cx.marked = "keyword"
|
||||||
return cont(pushlex("form"), expression, block, poplex)
|
return cont(pushlex("form"), expression, statement, poplex)
|
||||||
} else if (isTS && value == "abstract") {
|
} else if (isTS && value == "abstract") {
|
||||||
cx.marked = "keyword"
|
cx.marked = "keyword"
|
||||||
return cont(statement)
|
return cont(statement)
|
||||||
@ -552,6 +555,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
|
|||||||
}, proceed);
|
}, proceed);
|
||||||
}
|
}
|
||||||
if (type == end || value == end) return cont();
|
if (type == end || value == end) return cont();
|
||||||
|
if (sep && sep.indexOf(";") > -1) return pass(what)
|
||||||
return cont(expect(end));
|
return cont(expect(end));
|
||||||
}
|
}
|
||||||
return function(type, value) {
|
return function(type, value) {
|
||||||
@ -570,7 +574,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
|
|||||||
}
|
}
|
||||||
function maybetype(type, value) {
|
function maybetype(type, value) {
|
||||||
if (isTS) {
|
if (isTS) {
|
||||||
if (type == ":") return cont(typeexpr);
|
if (type == ":" || value == "in") return cont(typeexpr);
|
||||||
if (value == "?") return cont(maybetype);
|
if (value == "?") return cont(maybetype);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -587,18 +591,19 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
function typeexpr(type, value) {
|
function typeexpr(type, value) {
|
||||||
if (value == "keyof" || value == "typeof") {
|
if (value == "keyof" || value == "typeof" || value == "infer") {
|
||||||
cx.marked = "keyword"
|
cx.marked = "keyword"
|
||||||
return cont(value == "keyof" ? typeexpr : expressionNoComma)
|
return cont(value == "typeof" ? expressionNoComma : typeexpr)
|
||||||
}
|
}
|
||||||
if (type == "variable" || value == "void") {
|
if (type == "variable" || value == "void") {
|
||||||
cx.marked = "type"
|
cx.marked = "type"
|
||||||
return cont(afterType)
|
return cont(afterType)
|
||||||
}
|
}
|
||||||
|
if (value == "|" || value == "&") return cont(typeexpr)
|
||||||
if (type == "string" || type == "number" || type == "atom") return cont(afterType);
|
if (type == "string" || type == "number" || type == "atom") return cont(afterType);
|
||||||
if (type == "[") return cont(pushlex("]"), commasep(typeexpr, "]", ","), poplex, afterType)
|
if (type == "[") return cont(pushlex("]"), commasep(typeexpr, "]", ","), poplex, afterType)
|
||||||
if (type == "{") return cont(pushlex("}"), commasep(typeprop, "}", ",;"), poplex, afterType)
|
if (type == "{") return cont(pushlex("}"), commasep(typeprop, "}", ",;"), poplex, afterType)
|
||||||
if (type == "(") return cont(commasep(typearg, ")"), maybeReturnType)
|
if (type == "(") return cont(commasep(typearg, ")"), maybeReturnType, afterType)
|
||||||
if (type == "<") return cont(commasep(typeexpr, ">"), typeexpr)
|
if (type == "<") return cont(commasep(typeexpr, ">"), typeexpr)
|
||||||
}
|
}
|
||||||
function maybeReturnType(type) {
|
function maybeReturnType(type) {
|
||||||
@ -608,24 +613,28 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
|
|||||||
if (type == "variable" || cx.style == "keyword") {
|
if (type == "variable" || cx.style == "keyword") {
|
||||||
cx.marked = "property"
|
cx.marked = "property"
|
||||||
return cont(typeprop)
|
return cont(typeprop)
|
||||||
} else if (value == "?") {
|
} else if (value == "?" || type == "number" || type == "string") {
|
||||||
return cont(typeprop)
|
return cont(typeprop)
|
||||||
} else if (type == ":") {
|
} else if (type == ":") {
|
||||||
return cont(typeexpr)
|
return cont(typeexpr)
|
||||||
} else if (type == "[") {
|
} else if (type == "[") {
|
||||||
return cont(expression, maybetype, expect("]"), typeprop)
|
return cont(expect("variable"), maybetype, expect("]"), typeprop)
|
||||||
|
} else if (type == "(") {
|
||||||
|
return pass(functiondecl, typeprop)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function typearg(type, value) {
|
function typearg(type, value) {
|
||||||
if (type == "variable" && cx.stream.match(/^\s*[?:]/, false) || value == "?") return cont(typearg)
|
if (type == "variable" && cx.stream.match(/^\s*[?:]/, false) || value == "?") return cont(typearg)
|
||||||
if (type == ":") return cont(typeexpr)
|
if (type == ":") return cont(typeexpr)
|
||||||
|
if (type == "spread") return cont(typearg)
|
||||||
return pass(typeexpr)
|
return pass(typeexpr)
|
||||||
}
|
}
|
||||||
function afterType(type, value) {
|
function afterType(type, value) {
|
||||||
if (value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, afterType)
|
if (value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, afterType)
|
||||||
if (value == "|" || type == "." || value == "&") return cont(typeexpr)
|
if (value == "|" || type == "." || value == "&") return cont(typeexpr)
|
||||||
if (type == "[") return cont(expect("]"), afterType)
|
if (type == "[") return cont(typeexpr, expect("]"), afterType)
|
||||||
if (value == "extends" || value == "implements") { cx.marked = "keyword"; return cont(typeexpr) }
|
if (value == "extends" || value == "implements") { cx.marked = "keyword"; return cont(typeexpr) }
|
||||||
|
if (value == "?") return cont(typeexpr, expect(":"), typeexpr)
|
||||||
}
|
}
|
||||||
function maybeTypeArgs(_, value) {
|
function maybeTypeArgs(_, value) {
|
||||||
if (value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, afterType)
|
if (value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, afterType)
|
||||||
@ -655,6 +664,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
|
|||||||
if (type == "variable") cx.marked = "property";
|
if (type == "variable") cx.marked = "property";
|
||||||
if (type == "spread") return cont(pattern);
|
if (type == "spread") return cont(pattern);
|
||||||
if (type == "}") return pass();
|
if (type == "}") return pass();
|
||||||
|
if (type == "[") return cont(expression, expect(']'), expect(':'), proppattern);
|
||||||
return cont(expect(":"), pattern, maybeAssign);
|
return cont(expect(":"), pattern, maybeAssign);
|
||||||
}
|
}
|
||||||
function eltpattern() {
|
function eltpattern() {
|
||||||
@ -671,25 +681,18 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
|
|||||||
}
|
}
|
||||||
function forspec(type, value) {
|
function forspec(type, value) {
|
||||||
if (value == "await") return cont(forspec);
|
if (value == "await") return cont(forspec);
|
||||||
if (type == "(") return cont(pushlex(")"), forspec1, expect(")"), poplex);
|
if (type == "(") return cont(pushlex(")"), forspec1, poplex);
|
||||||
}
|
}
|
||||||
function forspec1(type) {
|
function forspec1(type) {
|
||||||
if (type == "var") return cont(vardef, expect(";"), forspec2);
|
if (type == "var") return cont(vardef, forspec2);
|
||||||
if (type == ";") return cont(forspec2);
|
if (type == "variable") return cont(forspec2);
|
||||||
if (type == "variable") return cont(formaybeinof);
|
return pass(forspec2)
|
||||||
return pass(expression, expect(";"), forspec2);
|
|
||||||
}
|
|
||||||
function formaybeinof(_type, value) {
|
|
||||||
if (value == "in" || value == "of") { cx.marked = "keyword"; return cont(expression); }
|
|
||||||
return cont(maybeoperatorComma, forspec2);
|
|
||||||
}
|
}
|
||||||
function forspec2(type, value) {
|
function forspec2(type, value) {
|
||||||
if (type == ";") return cont(forspec3);
|
if (type == ")") return cont()
|
||||||
if (value == "in" || value == "of") { cx.marked = "keyword"; return cont(expression); }
|
if (type == ";") return cont(forspec2)
|
||||||
return pass(expression, expect(";"), forspec3);
|
if (value == "in" || value == "of") { cx.marked = "keyword"; return cont(expression, forspec2) }
|
||||||
}
|
return pass(expression, forspec2)
|
||||||
function forspec3(type) {
|
|
||||||
if (type != ")") cont(expression);
|
|
||||||
}
|
}
|
||||||
function functiondef(type, value) {
|
function functiondef(type, value) {
|
||||||
if (value == "*") {cx.marked = "keyword"; return cont(functiondef);}
|
if (value == "*") {cx.marked = "keyword"; return cont(functiondef);}
|
||||||
@ -697,10 +700,25 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
|
|||||||
if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, mayberettype, statement, popcontext);
|
if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, mayberettype, statement, popcontext);
|
||||||
if (isTS && value == "<") return cont(pushlex(">"), commasep(typeparam, ">"), poplex, functiondef)
|
if (isTS && value == "<") return cont(pushlex(">"), commasep(typeparam, ">"), poplex, functiondef)
|
||||||
}
|
}
|
||||||
|
function functiondecl(type, value) {
|
||||||
|
if (value == "*") {cx.marked = "keyword"; return cont(functiondecl);}
|
||||||
|
if (type == "variable") {register(value); return cont(functiondecl);}
|
||||||
|
if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, mayberettype, popcontext);
|
||||||
|
if (isTS && value == "<") return cont(pushlex(">"), commasep(typeparam, ">"), poplex, functiondecl)
|
||||||
|
}
|
||||||
|
function typename(type, value) {
|
||||||
|
if (type == "keyword" || type == "variable") {
|
||||||
|
cx.marked = "type"
|
||||||
|
return cont(typename)
|
||||||
|
} else if (value == "<") {
|
||||||
|
return cont(pushlex(">"), commasep(typeparam, ">"), poplex)
|
||||||
|
}
|
||||||
|
}
|
||||||
function funarg(type, value) {
|
function funarg(type, value) {
|
||||||
if (value == "@") cont(expression, funarg)
|
if (value == "@") cont(expression, funarg)
|
||||||
if (type == "spread") return cont(funarg);
|
if (type == "spread") return cont(funarg);
|
||||||
if (isTS && isModifier(value)) { cx.marked = "keyword"; return cont(funarg); }
|
if (isTS && isModifier(value)) { cx.marked = "keyword"; return cont(funarg); }
|
||||||
|
if (isTS && type == "this") return cont(maybetype, maybeAssign)
|
||||||
return pass(pattern, maybetype, maybeAssign);
|
return pass(pattern, maybetype, maybeAssign);
|
||||||
}
|
}
|
||||||
function classExpression(type, value) {
|
function classExpression(type, value) {
|
||||||
@ -731,13 +749,15 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
|
|||||||
cx.marked = "property";
|
cx.marked = "property";
|
||||||
return cont(isTS ? classfield : functiondef, classBody);
|
return cont(isTS ? classfield : functiondef, classBody);
|
||||||
}
|
}
|
||||||
|
if (type == "number" || type == "string") return cont(isTS ? classfield : functiondef, classBody);
|
||||||
if (type == "[")
|
if (type == "[")
|
||||||
return cont(expression, maybetype, expect("]"), isTS ? classfield : functiondef, classBody)
|
return cont(expression, maybetype, expect("]"), isTS ? classfield : functiondef, classBody)
|
||||||
if (value == "*") {
|
if (value == "*") {
|
||||||
cx.marked = "keyword";
|
cx.marked = "keyword";
|
||||||
return cont(classBody);
|
return cont(classBody);
|
||||||
}
|
}
|
||||||
if (type == ";") return cont(classBody);
|
if (isTS && type == "(") return pass(functiondecl, classBody)
|
||||||
|
if (type == ";" || type == ",") return cont(classBody);
|
||||||
if (type == "}") return cont();
|
if (type == "}") return cont();
|
||||||
if (value == "@") return cont(expression, classBody)
|
if (value == "@") return cont(expression, classBody)
|
||||||
}
|
}
|
||||||
@ -745,7 +765,8 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
|
|||||||
if (value == "?") return cont(classfield)
|
if (value == "?") return cont(classfield)
|
||||||
if (type == ":") return cont(typeexpr, maybeAssign)
|
if (type == ":") return cont(typeexpr, maybeAssign)
|
||||||
if (value == "=") return cont(expressionNoComma)
|
if (value == "=") return cont(expressionNoComma)
|
||||||
return pass(functiondef)
|
var context = cx.state.lexical.prev, isInterface = context && context.info == "interface"
|
||||||
|
return pass(isInterface ? functiondecl : functiondef)
|
||||||
}
|
}
|
||||||
function afterExport(type, value) {
|
function afterExport(type, value) {
|
||||||
if (value == "*") { cx.marked = "keyword"; return cont(maybeFrom, expect(";")); }
|
if (value == "*") { cx.marked = "keyword"; return cont(maybeFrom, expect(";")); }
|
||||||
@ -888,8 +909,6 @@ CodeMirror.registerHelper("wordChars", "javascript", /[\w$]/);
|
|||||||
CodeMirror.defineMIME("text/javascript", "javascript");
|
CodeMirror.defineMIME("text/javascript", "javascript");
|
||||||
CodeMirror.defineMIME("text/ecmascript", "javascript");
|
CodeMirror.defineMIME("text/ecmascript", "javascript");
|
||||||
CodeMirror.defineMIME("application/javascript", "javascript");
|
CodeMirror.defineMIME("application/javascript", "javascript");
|
||||||
CodeMirror.defineMIME("application/javascript;env=frontend", "javascript");
|
|
||||||
CodeMirror.defineMIME("application/javascript;env=backend", "javascript");
|
|
||||||
CodeMirror.defineMIME("application/x-javascript", "javascript");
|
CodeMirror.defineMIME("application/x-javascript", "javascript");
|
||||||
CodeMirror.defineMIME("application/ecmascript", "javascript");
|
CodeMirror.defineMIME("application/ecmascript", "javascript");
|
||||||
CodeMirror.defineMIME("application/json", {name: "javascript", json: true});
|
CodeMirror.defineMIME("application/json", {name: "javascript", json: true});
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
<script src="../../addon/comment/continuecomment.js"></script>
|
<script src="../../addon/comment/continuecomment.js"></script>
|
||||||
<script src="../../addon/comment/comment.js"></script>
|
<script src="../../addon/comment/comment.js"></script>
|
||||||
<script src="javascript.js"></script>
|
<script src="javascript.js"></script>
|
||||||
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
||||||
<div id="nav">
|
<div id="nav">
|
||||||
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"/></a>
|
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"/></a>
|
||||||
|
|
||||||
|
12
libraries/codemirror/mode/javascript/test.js
vendored
12
libraries/codemirror/mode/javascript/test.js
vendored
@ -226,6 +226,12 @@
|
|||||||
" [keyword return] [variable-2 x];",
|
" [keyword return] [variable-2 x];",
|
||||||
"}");
|
"}");
|
||||||
|
|
||||||
|
MT(
|
||||||
|
"param_destructuring",
|
||||||
|
"[keyword function] [def foo]([def x] [operator =] [string-2 `foo${][number 10][string-2 }bar`]) {",
|
||||||
|
" [keyword return] [variable-2 x];",
|
||||||
|
"}");
|
||||||
|
|
||||||
MT("new_target",
|
MT("new_target",
|
||||||
"[keyword function] [def F]([def target]) {",
|
"[keyword function] [def F]([def target]) {",
|
||||||
" [keyword if] ([variable-2 target] [operator &&] [keyword new].[keyword target].[property name]) {",
|
" [keyword if] ([variable-2 target] [operator &&] [keyword new].[keyword target].[property name]) {",
|
||||||
@ -442,6 +448,12 @@
|
|||||||
TS("abstract class",
|
TS("abstract class",
|
||||||
"[keyword export] [keyword abstract] [keyword class] [def Foo] {}")
|
"[keyword export] [keyword abstract] [keyword class] [def Foo] {}")
|
||||||
|
|
||||||
|
TS("interface without semicolons",
|
||||||
|
"[keyword interface] [def Foo] {",
|
||||||
|
" [property greet]([def x]: [type int]): [type blah]",
|
||||||
|
" [property bar]: [type void]",
|
||||||
|
"}")
|
||||||
|
|
||||||
var jsonld_mode = CodeMirror.getMode(
|
var jsonld_mode = CodeMirror.getMode(
|
||||||
{indentUnit: 2},
|
{indentUnit: 2},
|
||||||
{name: "javascript", jsonld: true}
|
{name: "javascript", jsonld: true}
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
<script src="../../lib/codemirror.js"></script>
|
<script src="../../lib/codemirror.js"></script>
|
||||||
<script src="../../addon/edit/matchbrackets.js"></script>
|
<script src="../../addon/edit/matchbrackets.js"></script>
|
||||||
<script src="javascript.js"></script>
|
<script src="javascript.js"></script>
|
||||||
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
||||||
<div id=nav>
|
<div id=nav>
|
||||||
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
||||||
|
|
||||||
|
2
libraries/codemirror/mode/jinja2/index.html
vendored
2
libraries/codemirror/mode/jinja2/index.html
vendored
@ -7,7 +7,7 @@
|
|||||||
<link rel="stylesheet" href="../../lib/codemirror.css">
|
<link rel="stylesheet" href="../../lib/codemirror.css">
|
||||||
<script src="../../lib/codemirror.js"></script>
|
<script src="../../lib/codemirror.js"></script>
|
||||||
<script src="jinja2.js"></script>
|
<script src="jinja2.js"></script>
|
||||||
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
||||||
<div id=nav>
|
<div id=nav>
|
||||||
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
||||||
|
|
||||||
|
2
libraries/codemirror/mode/jinja2/jinja2.js
vendored
2
libraries/codemirror/mode/jinja2/jinja2.js
vendored
@ -141,4 +141,6 @@
|
|||||||
blockCommentEnd: "#}"
|
blockCommentEnd: "#}"
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
CodeMirror.defineMIME("text/jinja2", "jinja2");
|
||||||
});
|
});
|
||||||
|
2
libraries/codemirror/mode/jsx/index.html
vendored
2
libraries/codemirror/mode/jsx/index.html
vendored
@ -9,7 +9,7 @@
|
|||||||
<script src="../javascript/javascript.js"></script>
|
<script src="../javascript/javascript.js"></script>
|
||||||
<script src="../xml/xml.js"></script>
|
<script src="../xml/xml.js"></script>
|
||||||
<script src="jsx.js"></script>
|
<script src="jsx.js"></script>
|
||||||
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
||||||
<div id=nav>
|
<div id=nav>
|
||||||
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
||||||
|
|
||||||
|
4
libraries/codemirror/mode/jsx/jsx.js
vendored
4
libraries/codemirror/mode/jsx/jsx.js
vendored
@ -32,7 +32,7 @@
|
|||||||
function flatXMLIndent(state) {
|
function flatXMLIndent(state) {
|
||||||
var tagName = state.tagName
|
var tagName = state.tagName
|
||||||
state.tagName = null
|
state.tagName = null
|
||||||
var result = xmlMode.indent(state, "")
|
var result = xmlMode.indent(state, "", "")
|
||||||
state.tagName = tagName
|
state.tagName = tagName
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
@ -105,7 +105,7 @@
|
|||||||
function jsToken(stream, state, cx) {
|
function jsToken(stream, state, cx) {
|
||||||
if (stream.peek() == "<" && jsMode.expressionAllowed(stream, cx.state)) {
|
if (stream.peek() == "<" && jsMode.expressionAllowed(stream, cx.state)) {
|
||||||
jsMode.skipExpression(cx.state)
|
jsMode.skipExpression(cx.state)
|
||||||
state.context = new Context(CodeMirror.startState(xmlMode, jsMode.indent(cx.state, "")),
|
state.context = new Context(CodeMirror.startState(xmlMode, jsMode.indent(cx.state, "", "")),
|
||||||
xmlMode, 0, state.context)
|
xmlMode, 0, state.context)
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
2
libraries/codemirror/mode/julia/index.html
vendored
2
libraries/codemirror/mode/julia/index.html
vendored
@ -8,7 +8,7 @@
|
|||||||
<script src="../../lib/codemirror.js"></script>
|
<script src="../../lib/codemirror.js"></script>
|
||||||
<script src="../../addon/edit/matchbrackets.js"></script>
|
<script src="../../addon/edit/matchbrackets.js"></script>
|
||||||
<script src="julia.js"></script>
|
<script src="julia.js"></script>
|
||||||
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
||||||
<div id=nav>
|
<div id=nav>
|
||||||
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
||||||
|
|
||||||
|
92
libraries/codemirror/mode/julia/julia.js
vendored
92
libraries/codemirror/mode/julia/julia.js
vendored
@ -23,58 +23,50 @@ CodeMirror.defineMode("julia", function(config, parserConf) {
|
|||||||
var uChar = "([^\\u0027\\u005C\\uD800-\\uDFFF]|[\\uD800-\\uDFFF][\\uDC00-\\uDFFF])";
|
var uChar = "([^\\u0027\\u005C\\uD800-\\uDFFF]|[\\uD800-\\uDFFF][\\uDC00-\\uDFFF])";
|
||||||
|
|
||||||
var operators = parserConf.operators || wordRegexp([
|
var operators = parserConf.operators || wordRegexp([
|
||||||
"[<>]:", "[<>=]=", "<<=?", ">>>?=?", "=>", "->", "\\/\\/",
|
"[<>]:", "[<>=]=", "<<=?", ">>>?=?", "=>", "->", "\\/\\/",
|
||||||
"[\\\\%*+\\-<>!=\\/^|&\\u00F7\\u22BB]=?", "\\?", "\\$", "~", ":",
|
"[\\\\%*+\\-<>!=\\/^|&\\u00F7\\u22BB]=?", "\\?", "\\$", "~", ":",
|
||||||
"\\u00D7", "\\u2208", "\\u2209", "\\u220B", "\\u220C", "\\u2218",
|
"\\u00D7", "\\u2208", "\\u2209", "\\u220B", "\\u220C", "\\u2218",
|
||||||
"\\u221A", "\\u221B", "\\u2229", "\\u222A", "\\u2260", "\\u2264",
|
"\\u221A", "\\u221B", "\\u2229", "\\u222A", "\\u2260", "\\u2264",
|
||||||
"\\u2265", "\\u2286", "\\u2288", "\\u228A", "\\u22C5",
|
"\\u2265", "\\u2286", "\\u2288", "\\u228A", "\\u22C5",
|
||||||
"\\b(in|isa)\\b(?!\.?\\()"], "");
|
"\\b(in|isa)\\b(?!\.?\\()"], "");
|
||||||
var delimiters = parserConf.delimiters || /^[;,()[\]{}]/;
|
var delimiters = parserConf.delimiters || /^[;,()[\]{}]/;
|
||||||
var identifiers = parserConf.identifiers ||
|
var identifiers = parserConf.identifiers ||
|
||||||
/^[_A-Za-z\u00A1-\u2217\u2219-\uFFFF][\w\u00A1-\u2217\u2219-\uFFFF]*!*/;
|
/^[_A-Za-z\u00A1-\u2217\u2219-\uFFFF][\w\u00A1-\u2217\u2219-\uFFFF]*!*/;
|
||||||
|
|
||||||
var chars = wordRegexp([octChar, hexChar, sChar, uChar], "'");
|
var chars = wordRegexp([octChar, hexChar, sChar, uChar], "'");
|
||||||
|
|
||||||
var commonOpeners = ["begin", "function", "type", "struct", "immutable",
|
var openersList = ["begin", "function", "type", "struct", "immutable", "let",
|
||||||
"let", "macro", "for", "while", "quote", "if", "else", "elseif", "try",
|
"macro", "for", "while", "quote", "if", "else", "elseif", "try",
|
||||||
"finally", "catch", "do"];
|
"finally", "catch", "do"];
|
||||||
|
|
||||||
var commonClosers = ["end", "else", "elseif", "catch", "finally"];
|
var closersList = ["end", "else", "elseif", "catch", "finally"];
|
||||||
|
|
||||||
var commonKeywords = ["if", "else", "elseif", "while", "for", "begin",
|
var keywordsList = ["if", "else", "elseif", "while", "for", "begin", "let",
|
||||||
"let", "end", "do", "try", "catch", "finally", "return", "break",
|
"end", "do", "try", "catch", "finally", "return", "break", "continue",
|
||||||
"continue", "global", "local", "const", "export", "import", "importall",
|
"global", "local", "const", "export", "import", "importall", "using",
|
||||||
"using", "function", "where", "macro", "module", "baremodule", "struct",
|
"function", "where", "macro", "module", "baremodule", "struct", "type",
|
||||||
"type", "mutable", "immutable", "quote", "typealias", "abstract",
|
"mutable", "immutable", "quote", "typealias", "abstract", "primitive",
|
||||||
"primitive", "bitstype"];
|
"bitstype"];
|
||||||
|
|
||||||
var commonBuiltins = ["true", "false", "nothing", "NaN", "Inf"];
|
var builtinsList = ["true", "false", "nothing", "NaN", "Inf"];
|
||||||
|
|
||||||
CodeMirror.registerHelper("hintWords", "julia", commonKeywords.concat(commonBuiltins));
|
CodeMirror.registerHelper("hintWords", "julia", keywordsList.concat(builtinsList));
|
||||||
|
|
||||||
var openers = wordRegexp(commonOpeners);
|
var openers = wordRegexp(openersList);
|
||||||
var closers = wordRegexp(commonClosers);
|
var closers = wordRegexp(closersList);
|
||||||
var keywords = wordRegexp(commonKeywords);
|
var keywords = wordRegexp(keywordsList);
|
||||||
var builtins = wordRegexp(commonBuiltins);
|
var builtins = wordRegexp(builtinsList);
|
||||||
|
|
||||||
var macro = /^@[_A-Za-z][\w]*/;
|
var macro = /^@[_A-Za-z][\w]*/;
|
||||||
var symbol = /^:[_A-Za-z\u00A1-\uFFFF][\w\u00A1-\uFFFF]*!*/;
|
var symbol = /^:[_A-Za-z\u00A1-\uFFFF][\w\u00A1-\uFFFF]*!*/;
|
||||||
var stringPrefixes = /^(`|([_A-Za-z\u00A1-\uFFFF]*"("")?))/;
|
var stringPrefixes = /^(`|([_A-Za-z\u00A1-\uFFFF]*"("")?))/;
|
||||||
|
|
||||||
function inArray(state) {
|
function inArray(state) {
|
||||||
return inGenerator(state, '[')
|
return (state.nestedArrays > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
function inGenerator(state, bracket, depth) {
|
function inGenerator(state) {
|
||||||
if (typeof(bracket) === "undefined") { bracket = '('; }
|
return (state.nestedGenerators > 0);
|
||||||
if (typeof(depth) === "undefined") { depth = 0; }
|
|
||||||
var scope = currentScope(state, depth);
|
|
||||||
if ((depth == 0 && scope === "if" && inGenerator(state, bracket, depth + 1)) ||
|
|
||||||
(scope === "for" && inGenerator(state, bracket, depth + 1)) ||
|
|
||||||
(scope === bracket)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function currentScope(state, n) {
|
function currentScope(state, n) {
|
||||||
@ -126,16 +118,19 @@ CodeMirror.defineMode("julia", function(config, parserConf) {
|
|||||||
|
|
||||||
if (ch === '[') {
|
if (ch === '[') {
|
||||||
state.scopes.push('[');
|
state.scopes.push('[');
|
||||||
|
state.nestedArrays++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ch === '(') {
|
if (ch === '(') {
|
||||||
state.scopes.push('(');
|
state.scopes.push('(');
|
||||||
|
state.nestedGenerators++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (inArray(state) && ch === ']') {
|
if (inArray(state) && ch === ']') {
|
||||||
if (currentScope(state) === "if") { state.scopes.pop(); }
|
if (currentScope(state) === "if") { state.scopes.pop(); }
|
||||||
while (currentScope(state) === "for") { state.scopes.pop(); }
|
while (currentScope(state) === "for") { state.scopes.pop(); }
|
||||||
state.scopes.pop();
|
state.scopes.pop();
|
||||||
|
state.nestedArrays--;
|
||||||
state.leavingExpr = true;
|
state.leavingExpr = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -143,6 +138,7 @@ CodeMirror.defineMode("julia", function(config, parserConf) {
|
|||||||
if (currentScope(state) === "if") { state.scopes.pop(); }
|
if (currentScope(state) === "if") { state.scopes.pop(); }
|
||||||
while (currentScope(state) === "for") { state.scopes.pop(); }
|
while (currentScope(state) === "for") { state.scopes.pop(); }
|
||||||
state.scopes.pop();
|
state.scopes.pop();
|
||||||
|
state.nestedGenerators--;
|
||||||
state.leavingExpr = true;
|
state.leavingExpr = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -156,14 +152,12 @@ CodeMirror.defineMode("julia", function(config, parserConf) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var match;
|
var match;
|
||||||
if (match = stream.match(openers)) {
|
if (match = stream.match(openers, false)) {
|
||||||
state.scopes.push(match[0]);
|
state.scopes.push(match[0]);
|
||||||
return "keyword";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stream.match(closers)) {
|
if (stream.match(closers, false)) {
|
||||||
state.scopes.pop();
|
state.scopes.pop();
|
||||||
return "keyword";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle type annotations
|
// Handle type annotations
|
||||||
@ -307,13 +301,13 @@ CodeMirror.defineMode("julia", function(config, parserConf) {
|
|||||||
function tokenAnnotation(stream, state) {
|
function tokenAnnotation(stream, state) {
|
||||||
stream.match(/.*?(?=,|;|{|}|\(|\)|=|$|\s)/);
|
stream.match(/.*?(?=,|;|{|}|\(|\)|=|$|\s)/);
|
||||||
if (stream.match(/^{/)) {
|
if (stream.match(/^{/)) {
|
||||||
state.nestedLevels++;
|
state.nestedParameters++;
|
||||||
} else if (stream.match(/^}/)) {
|
} else if (stream.match(/^}/) && state.nestedParameters > 0) {
|
||||||
state.nestedLevels--;
|
state.nestedParameters--;
|
||||||
}
|
}
|
||||||
if (state.nestedLevels > 0) {
|
if (state.nestedParameters > 0) {
|
||||||
stream.match(/.*?(?={|})/) || stream.next();
|
stream.match(/.*?(?={|})/) || stream.next();
|
||||||
} else if (state.nestedLevels == 0) {
|
} else if (state.nestedParameters == 0) {
|
||||||
state.tokenize = tokenBase;
|
state.tokenize = tokenBase;
|
||||||
}
|
}
|
||||||
return "builtin";
|
return "builtin";
|
||||||
@ -321,14 +315,14 @@ CodeMirror.defineMode("julia", function(config, parserConf) {
|
|||||||
|
|
||||||
function tokenComment(stream, state) {
|
function tokenComment(stream, state) {
|
||||||
if (stream.match(/^#=/)) {
|
if (stream.match(/^#=/)) {
|
||||||
state.nestedLevels++;
|
state.nestedComments++;
|
||||||
}
|
}
|
||||||
if (!stream.match(/.*?(?=(#=|=#))/)) {
|
if (!stream.match(/.*?(?=(#=|=#))/)) {
|
||||||
stream.skipToEnd();
|
stream.skipToEnd();
|
||||||
}
|
}
|
||||||
if (stream.match(/^=#/)) {
|
if (stream.match(/^=#/)) {
|
||||||
state.nestedLevels--;
|
state.nestedComments--;
|
||||||
if (state.nestedLevels == 0)
|
if (state.nestedComments == 0)
|
||||||
state.tokenize = tokenBase;
|
state.tokenize = tokenBase;
|
||||||
}
|
}
|
||||||
return "comment";
|
return "comment";
|
||||||
@ -391,7 +385,10 @@ CodeMirror.defineMode("julia", function(config, parserConf) {
|
|||||||
lastToken: null,
|
lastToken: null,
|
||||||
leavingExpr: false,
|
leavingExpr: false,
|
||||||
isDefinition: false,
|
isDefinition: false,
|
||||||
nestedLevels: 0,
|
nestedArrays: 0,
|
||||||
|
nestedComments: 0,
|
||||||
|
nestedGenerators: 0,
|
||||||
|
nestedParameters: 0,
|
||||||
charsAdvanced: 0,
|
charsAdvanced: 0,
|
||||||
firstParenPos: -1
|
firstParenPos: -1
|
||||||
};
|
};
|
||||||
@ -422,6 +419,7 @@ CodeMirror.defineMode("julia", function(config, parserConf) {
|
|||||||
blockCommentStart: "#=",
|
blockCommentStart: "#=",
|
||||||
blockCommentEnd: "=#",
|
blockCommentEnd: "=#",
|
||||||
lineComment: "#",
|
lineComment: "#",
|
||||||
|
closeBrackets: "()[]{}\"\"",
|
||||||
fold: "indent"
|
fold: "indent"
|
||||||
};
|
};
|
||||||
return external;
|
return external;
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
<script src="../../addon/edit/continuelist.js"></script>
|
<script src="../../addon/edit/continuelist.js"></script>
|
||||||
<script src="../xml/xml.js"></script>
|
<script src="../xml/xml.js"></script>
|
||||||
<script src="markdown.js"></script>
|
<script src="markdown.js"></script>
|
||||||
<style type="text/css">
|
<style>
|
||||||
.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
|
.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
|
||||||
.cm-s-default .cm-trailing-space-a:before,
|
.cm-s-default .cm-trailing-space-a:before,
|
||||||
.cm-s-default .cm-trailing-space-b:before {position: absolute; content: "\00B7"; color: #777;}
|
.cm-s-default .cm-trailing-space-b:before {position: absolute; content: "\00B7"; color: #777;}
|
||||||
|
@ -91,7 +91,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
|
|||||||
, textRE = /^[^#!\[\]*_\\<>` "'(~:]+/
|
, textRE = /^[^#!\[\]*_\\<>` "'(~:]+/
|
||||||
, fencedCodeRE = /^(~~~+|```+)[ \t]*([\w+#-]*)[^\n`]*$/
|
, fencedCodeRE = /^(~~~+|```+)[ \t]*([\w+#-]*)[^\n`]*$/
|
||||||
, linkDefRE = /^\s*\[[^\]]+?\]:.*$/ // naive link-definition
|
, linkDefRE = /^\s*\[[^\]]+?\]:.*$/ // naive link-definition
|
||||||
, punctuation = /[!\"#$%&\'()*+,\-\.\/:;<=>?@\[\\\]^_`{|}~—]/
|
, punctuation = /[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/
|
||||||
, expandedTab = " " // CommonMark specifies tab as 4 spaces
|
, expandedTab = " " // CommonMark specifies tab as 4 spaces
|
||||||
|
|
||||||
function switchInline(stream, state, f) {
|
function switchInline(stream, state, f) {
|
||||||
|
4
libraries/codemirror/mode/meta.js
vendored
4
libraries/codemirror/mode/meta.js
vendored
@ -51,7 +51,7 @@
|
|||||||
{name: "Factor", mime: "text/x-factor", mode: "factor", ext: ["factor"]},
|
{name: "Factor", mime: "text/x-factor", mode: "factor", ext: ["factor"]},
|
||||||
{name: "FCL", mime: "text/x-fcl", mode: "fcl"},
|
{name: "FCL", mime: "text/x-fcl", mode: "fcl"},
|
||||||
{name: "Forth", mime: "text/x-forth", mode: "forth", ext: ["forth", "fth", "4th"]},
|
{name: "Forth", mime: "text/x-forth", mode: "forth", ext: ["forth", "fth", "4th"]},
|
||||||
{name: "Fortran", mime: "text/x-fortran", mode: "fortran", ext: ["f", "for", "f77", "f90"]},
|
{name: "Fortran", mime: "text/x-fortran", mode: "fortran", ext: ["f", "for", "f77", "f90", "f95"]},
|
||||||
{name: "F#", mime: "text/x-fsharp", mode: "mllike", ext: ["fs"], alias: ["fsharp"]},
|
{name: "F#", mime: "text/x-fsharp", mode: "mllike", ext: ["fs"], alias: ["fsharp"]},
|
||||||
{name: "Gas", mime: "text/x-gas", mode: "gas", ext: ["s"]},
|
{name: "Gas", mime: "text/x-gas", mode: "gas", ext: ["s"]},
|
||||||
{name: "Gherkin", mime: "text/x-feature", mode: "gherkin", ext: ["feature"]},
|
{name: "Gherkin", mime: "text/x-feature", mode: "gherkin", ext: ["feature"]},
|
||||||
@ -75,7 +75,7 @@
|
|||||||
{name: "JSON", mimes: ["application/json", "application/x-json"], mode: "javascript", ext: ["json", "map"], alias: ["json5"]},
|
{name: "JSON", mimes: ["application/json", "application/x-json"], mode: "javascript", ext: ["json", "map"], alias: ["json5"]},
|
||||||
{name: "JSON-LD", mime: "application/ld+json", mode: "javascript", ext: ["jsonld"], alias: ["jsonld"]},
|
{name: "JSON-LD", mime: "application/ld+json", mode: "javascript", ext: ["jsonld"], alias: ["jsonld"]},
|
||||||
{name: "JSX", mime: "text/jsx", mode: "jsx", ext: ["jsx"]},
|
{name: "JSX", mime: "text/jsx", mode: "jsx", ext: ["jsx"]},
|
||||||
{name: "Jinja2", mime: "null", mode: "jinja2", ext: ["j2", "jinja", "jinja2"]},
|
{name: "Jinja2", mime: "text/jinja2", mode: "jinja2", ext: ["j2", "jinja", "jinja2"]},
|
||||||
{name: "Julia", mime: "text/x-julia", mode: "julia", ext: ["jl"]},
|
{name: "Julia", mime: "text/x-julia", mode: "julia", ext: ["jl"]},
|
||||||
{name: "Kotlin", mime: "text/x-kotlin", mode: "clike", ext: ["kt"]},
|
{name: "Kotlin", mime: "text/x-kotlin", mode: "clike", ext: ["kt"]},
|
||||||
{name: "LESS", mime: "text/x-less", mode: "css", ext: ["less"]},
|
{name: "LESS", mime: "text/x-less", mode: "css", ext: ["less"]},
|
||||||
|
6
libraries/codemirror/mode/mscgen/mscgen.js
vendored
6
libraries/codemirror/mode/mscgen/mscgen.js
vendored
@ -33,9 +33,9 @@
|
|||||||
},
|
},
|
||||||
xu: {
|
xu: {
|
||||||
"keywords" : ["msc", "xu"],
|
"keywords" : ["msc", "xu"],
|
||||||
"options" : ["hscale", "width", "arcgradient", "wordwraparcs", "watermark"],
|
"options" : ["hscale", "width", "arcgradient", "wordwraparcs", "wordwrapentities", "watermark"],
|
||||||
"constants" : ["true", "false", "on", "off", "auto"],
|
"constants" : ["true", "false", "on", "off", "auto"],
|
||||||
"attributes" : ["label", "idurl", "id", "url", "linecolor", "linecolour", "textcolor", "textcolour", "textbgcolor", "textbgcolour", "arclinecolor", "arclinecolour", "arctextcolor", "arctextcolour", "arctextbgcolor", "arctextbgcolour", "arcskip"],
|
"attributes" : ["label", "idurl", "id", "url", "linecolor", "linecolour", "textcolor", "textcolour", "textbgcolor", "textbgcolour", "arclinecolor", "arclinecolour", "arctextcolor", "arctextcolour", "arctextbgcolor", "arctextbgcolour", "arcskip", "title", "deactivate", "activate", "activation"],
|
||||||
"brackets" : ["\\{", "\\}"], // [ and ] are brackets too, but these get handled in with lists
|
"brackets" : ["\\{", "\\}"], // [ and ] are brackets too, but these get handled in with lists
|
||||||
"arcsWords" : ["note", "abox", "rbox", "box", "alt", "else", "opt", "break", "par", "seq", "strict", "neg", "critical", "ignore", "consider", "assert", "loop", "ref", "exc"],
|
"arcsWords" : ["note", "abox", "rbox", "box", "alt", "else", "opt", "break", "par", "seq", "strict", "neg", "critical", "ignore", "consider", "assert", "loop", "ref", "exc"],
|
||||||
"arcsOthers" : ["\\|\\|\\|", "\\.\\.\\.", "---", "--", "<->", "==", "<<=>>", "<=>", "\\.\\.", "<<>>", "::", "<:>", "->", "=>>", "=>", ">>", ":>", "<-", "<<=", "<=", "<<", "<:", "x-", "-x"],
|
"arcsOthers" : ["\\|\\|\\|", "\\.\\.\\.", "---", "--", "<->", "==", "<<=>>", "<=>", "\\.\\.", "<<>>", "::", "<:>", "->", "=>>", "=>", ">>", ":>", "<-", "<<=", "<=", "<<", "<:", "x-", "-x"],
|
||||||
@ -44,7 +44,7 @@
|
|||||||
},
|
},
|
||||||
msgenny: {
|
msgenny: {
|
||||||
"keywords" : null,
|
"keywords" : null,
|
||||||
"options" : ["hscale", "width", "arcgradient", "wordwraparcs", "watermark"],
|
"options" : ["hscale", "width", "arcgradient", "wordwraparcs", "wordwrapentities", "watermark"],
|
||||||
"constants" : ["true", "false", "on", "off", "auto"],
|
"constants" : ["true", "false", "on", "off", "auto"],
|
||||||
"attributes" : null,
|
"attributes" : null,
|
||||||
"brackets" : ["\\{", "\\}"],
|
"brackets" : ["\\{", "\\}"],
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
|
|
||||||
MT("xù/ msgenny keywords classify as 'base'",
|
MT("xù/ msgenny keywords classify as 'base'",
|
||||||
"[base watermark]",
|
"[base watermark]",
|
||||||
|
"[base wordwrapentities]",
|
||||||
"[base alt loop opt ref else break par seq assert]"
|
"[base alt loop opt ref else break par seq assert]"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
MT("xù/ msgenny keywords classify as 'keyword'",
|
MT("xù/ msgenny keywords classify as 'keyword'",
|
||||||
"[keyword watermark]",
|
"[keyword watermark]",
|
||||||
|
"[keyword wordwrapentities]",
|
||||||
"[keyword alt]","[keyword loop]","[keyword opt]","[keyword ref]","[keyword else]","[keyword break]","[keyword par]","[keyword seq]","[keyword assert]"
|
"[keyword alt]","[keyword loop]","[keyword opt]","[keyword ref]","[keyword else]","[keyword break]","[keyword par]","[keyword seq]","[keyword assert]"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
7
libraries/codemirror/mode/mscgen/xu_test.js
vendored
7
libraries/codemirror/mode/mscgen/xu_test.js
vendored
@ -60,7 +60,8 @@
|
|||||||
"[attribute id]","[attribute url]","[attribute idurl]",
|
"[attribute id]","[attribute url]","[attribute idurl]",
|
||||||
"[attribute linecolor]","[attribute linecolour]","[attribute textcolor]","[attribute textcolour]","[attribute textbgcolor]","[attribute textbgcolour]",
|
"[attribute linecolor]","[attribute linecolour]","[attribute textcolor]","[attribute textcolour]","[attribute textbgcolor]","[attribute textbgcolour]",
|
||||||
"[attribute arclinecolor]","[attribute arclinecolour]","[attribute arctextcolor]","[attribute arctextcolour]","[attribute arctextbgcolor]","[attribute arctextbgcolour]",
|
"[attribute arclinecolor]","[attribute arclinecolour]","[attribute arctextcolor]","[attribute arctextcolour]","[attribute arctextbgcolor]","[attribute arctextbgcolour]",
|
||||||
"[attribute arcskip][bracket ]]]"
|
"[attribute arcskip]","[attribute title]",
|
||||||
|
"[attribute activate]","[attribute deactivate]","[attribute activation][bracket ]]]"
|
||||||
);
|
);
|
||||||
|
|
||||||
MT("outside an attribute list, attributes classify as base",
|
MT("outside an attribute list, attributes classify as base",
|
||||||
@ -68,7 +69,7 @@
|
|||||||
"[base id]","[base url]","[base idurl]",
|
"[base id]","[base url]","[base idurl]",
|
||||||
"[base linecolor]","[base linecolour]","[base textcolor]","[base textcolour]","[base textbgcolor]","[base textbgcolour]",
|
"[base linecolor]","[base linecolour]","[base textcolor]","[base textcolour]","[base textbgcolor]","[base textbgcolour]",
|
||||||
"[base arclinecolor]","[base arclinecolour]","[base arctextcolor]","[base arctextcolour]","[base arctextbgcolor]","[base arctextbgcolour]",
|
"[base arclinecolor]","[base arclinecolour]","[base arctextcolor]","[base arctextcolour]","[base arctextbgcolor]","[base arctextbgcolour]",
|
||||||
"[base arcskip]"
|
"[base arcskip]", "[base title]"
|
||||||
);
|
);
|
||||||
|
|
||||||
MT("a typical program",
|
MT("a typical program",
|
||||||
@ -79,7 +80,7 @@
|
|||||||
"[base b][bracket [[][attribute label][operator =][string \"Entity B\"][bracket ]]][base ,]",
|
"[base b][bracket [[][attribute label][operator =][string \"Entity B\"][bracket ]]][base ,]",
|
||||||
"[base c][bracket [[][attribute label][operator =][string \"Entity C\"][bracket ]]][base ;]",
|
"[base c][bracket [[][attribute label][operator =][string \"Entity C\"][bracket ]]][base ;]",
|
||||||
"[base a ][keyword =>>][base b][bracket [[][attribute label][operator =][string \"Hello entity B\"][bracket ]]][base ;]",
|
"[base a ][keyword =>>][base b][bracket [[][attribute label][operator =][string \"Hello entity B\"][bracket ]]][base ;]",
|
||||||
"[base a ][keyword <<][base b][bracket [[][attribute label][operator =][string \"Here's an answer dude!\"][bracket ]]][base ;]",
|
"[base a ][keyword <<][base b][bracket [[][attribute label][operator =][string \"Here's an answer dude!\"][base , ][attribute title][operator =][string \"This is a title for this message\"][bracket ]]][base ;]",
|
||||||
"[base c ][keyword :>][base *][bracket [[][attribute label][operator =][string \"What about me?\"][base , ][attribute textcolor][operator =][base red][bracket ]]][base ;]",
|
"[base c ][keyword :>][base *][bracket [[][attribute label][operator =][string \"What about me?\"][base , ][attribute textcolor][operator =][base red][bracket ]]][base ;]",
|
||||||
"[bracket }]"
|
"[bracket }]"
|
||||||
);
|
);
|
||||||
|
2
libraries/codemirror/mode/mumps/index.html
vendored
2
libraries/codemirror/mode/mumps/index.html
vendored
@ -7,7 +7,7 @@
|
|||||||
<link rel="stylesheet" href="../../lib/codemirror.css">
|
<link rel="stylesheet" href="../../lib/codemirror.css">
|
||||||
<script src="../../lib/codemirror.js"></script>
|
<script src="../../lib/codemirror.js"></script>
|
||||||
<script src="mumps.js"></script>
|
<script src="mumps.js"></script>
|
||||||
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
||||||
<div id=nav>
|
<div id=nav>
|
||||||
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<link rel="stylesheet" href="../../lib/codemirror.css">
|
<link rel="stylesheet" href="../../lib/codemirror.css">
|
||||||
<script src="../../lib/codemirror.js"></script>
|
<script src="../../lib/codemirror.js"></script>
|
||||||
<script src="ntriples.js"></script>
|
<script src="ntriples.js"></script>
|
||||||
<style type="text/css">
|
<style>
|
||||||
.CodeMirror {
|
.CodeMirror {
|
||||||
border: 1px solid #eee;
|
border: 1px solid #eee;
|
||||||
height: auto;
|
height: auto;
|
||||||
|
2
libraries/codemirror/mode/octave/index.html
vendored
2
libraries/codemirror/mode/octave/index.html
vendored
@ -8,7 +8,7 @@
|
|||||||
<script src="../../lib/codemirror.js"></script>
|
<script src="../../lib/codemirror.js"></script>
|
||||||
<script src="../../addon/edit/matchbrackets.js"></script>
|
<script src="../../addon/edit/matchbrackets.js"></script>
|
||||||
<script src="octave.js"></script>
|
<script src="octave.js"></script>
|
||||||
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
||||||
<div id=nav>
|
<div id=nav>
|
||||||
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
||||||
|
|
||||||
|
4
libraries/codemirror/mode/oz/index.html
vendored
4
libraries/codemirror/mode/oz/index.html
vendored
@ -7,7 +7,7 @@
|
|||||||
<link rel="stylesheet" href="../../lib/codemirror.css">
|
<link rel="stylesheet" href="../../lib/codemirror.css">
|
||||||
<script src="../../lib/codemirror.js"></script>
|
<script src="../../lib/codemirror.js"></script>
|
||||||
<script src="oz.js"></script>
|
<script src="oz.js"></script>
|
||||||
<script type="text/javascript" src="../../addon/runmode/runmode.js"></script>
|
<script src="../../addon/runmode/runmode.js"></script>
|
||||||
<style>
|
<style>
|
||||||
.CodeMirror {border: 1px solid #aaa;}
|
.CodeMirror {border: 1px solid #aaa;}
|
||||||
</style>
|
</style>
|
||||||
@ -49,7 +49,7 @@ end
|
|||||||
</textarea>
|
</textarea>
|
||||||
<p>MIME type defined: <code>text/x-oz</code>.</p>
|
<p>MIME type defined: <code>text/x-oz</code>.</p>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script>
|
||||||
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
||||||
lineNumbers: true,
|
lineNumbers: true,
|
||||||
mode: "text/x-oz",
|
mode: "text/x-oz",
|
||||||
|
2
libraries/codemirror/mode/pascal/index.html
vendored
2
libraries/codemirror/mode/pascal/index.html
vendored
@ -7,7 +7,7 @@
|
|||||||
<link rel="stylesheet" href="../../lib/codemirror.css">
|
<link rel="stylesheet" href="../../lib/codemirror.css">
|
||||||
<script src="../../lib/codemirror.js"></script>
|
<script src="../../lib/codemirror.js"></script>
|
||||||
<script src="pascal.js"></script>
|
<script src="pascal.js"></script>
|
||||||
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
||||||
<div id=nav>
|
<div id=nav>
|
||||||
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
||||||
|
|
||||||
|
2
libraries/codemirror/mode/pegjs/index.html
vendored
2
libraries/codemirror/mode/pegjs/index.html
vendored
@ -9,7 +9,7 @@
|
|||||||
<script src="../../lib/codemirror.js"></script>
|
<script src="../../lib/codemirror.js"></script>
|
||||||
<script src="../javascript/javascript.js"></script>
|
<script src="../javascript/javascript.js"></script>
|
||||||
<script src="pegjs.js"></script>
|
<script src="pegjs.js"></script>
|
||||||
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id=nav>
|
<div id=nav>
|
||||||
|
2
libraries/codemirror/mode/perl/index.html
vendored
2
libraries/codemirror/mode/perl/index.html
vendored
@ -7,7 +7,7 @@
|
|||||||
<link rel="stylesheet" href="../../lib/codemirror.css">
|
<link rel="stylesheet" href="../../lib/codemirror.css">
|
||||||
<script src="../../lib/codemirror.js"></script>
|
<script src="../../lib/codemirror.js"></script>
|
||||||
<script src="perl.js"></script>
|
<script src="perl.js"></script>
|
||||||
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
||||||
<div id=nav>
|
<div id=nav>
|
||||||
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
||||||
|
|
||||||
|
2
libraries/codemirror/mode/php/index.html
vendored
2
libraries/codemirror/mode/php/index.html
vendored
@ -13,7 +13,7 @@
|
|||||||
<script src="../css/css.js"></script>
|
<script src="../css/css.js"></script>
|
||||||
<script src="../clike/clike.js"></script>
|
<script src="../clike/clike.js"></script>
|
||||||
<script src="php.js"></script>
|
<script src="php.js"></script>
|
||||||
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
||||||
<div id=nav>
|
<div id=nav>
|
||||||
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
||||||
|
|
||||||
|
8
libraries/codemirror/mode/php/php.js
vendored
8
libraries/codemirror/mode/php/php.js
vendored
@ -160,7 +160,7 @@
|
|||||||
if (!isPHP) {
|
if (!isPHP) {
|
||||||
if (stream.match(/^<\?\w*/)) {
|
if (stream.match(/^<\?\w*/)) {
|
||||||
state.curMode = phpMode;
|
state.curMode = phpMode;
|
||||||
if (!state.php) state.php = CodeMirror.startState(phpMode, htmlMode.indent(state.html, ""))
|
if (!state.php) state.php = CodeMirror.startState(phpMode, htmlMode.indent(state.html, "", ""))
|
||||||
state.curState = state.php;
|
state.curState = state.php;
|
||||||
return "meta";
|
return "meta";
|
||||||
}
|
}
|
||||||
@ -213,11 +213,11 @@
|
|||||||
|
|
||||||
token: dispatch,
|
token: dispatch,
|
||||||
|
|
||||||
indent: function(state, textAfter) {
|
indent: function(state, textAfter, line) {
|
||||||
if ((state.curMode != phpMode && /^\s*<\//.test(textAfter)) ||
|
if ((state.curMode != phpMode && /^\s*<\//.test(textAfter)) ||
|
||||||
(state.curMode == phpMode && /^\?>/.test(textAfter)))
|
(state.curMode == phpMode && /^\?>/.test(textAfter)))
|
||||||
return htmlMode.indent(state.html, textAfter);
|
return htmlMode.indent(state.html, textAfter, line);
|
||||||
return state.curMode.indent(state.curState, textAfter);
|
return state.curMode.indent(state.curState, textAfter, line);
|
||||||
},
|
},
|
||||||
|
|
||||||
blockCommentStart: "/*",
|
blockCommentStart: "/*",
|
||||||
|
2
libraries/codemirror/mode/pug/index.html
vendored
2
libraries/codemirror/mode/pug/index.html
vendored
@ -11,7 +11,7 @@
|
|||||||
<script src="../xml/xml.js"></script>
|
<script src="../xml/xml.js"></script>
|
||||||
<script src="../htmlmixed/htmlmixed.js"></script>
|
<script src="../htmlmixed/htmlmixed.js"></script>
|
||||||
<script src="pug.js"></script>
|
<script src="pug.js"></script>
|
||||||
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
||||||
<div id=nav>
|
<div id=nav>
|
||||||
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
||||||
|
|
||||||
|
2
libraries/codemirror/mode/python/index.html
vendored
2
libraries/codemirror/mode/python/index.html
vendored
@ -8,7 +8,7 @@
|
|||||||
<script src="../../lib/codemirror.js"></script>
|
<script src="../../lib/codemirror.js"></script>
|
||||||
<script src="../../addon/edit/matchbrackets.js"></script>
|
<script src="../../addon/edit/matchbrackets.js"></script>
|
||||||
<script src="python.js"></script>
|
<script src="python.js"></script>
|
||||||
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
||||||
<div id=nav>
|
<div id=nav>
|
||||||
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
||||||
|
|
||||||
|
50
libraries/codemirror/mode/python/python.js
vendored
50
libraries/codemirror/mode/python/python.js
vendored
@ -44,7 +44,7 @@
|
|||||||
var delimiters = parserConf.delimiters || parserConf.singleDelimiters || /^[\(\)\[\]\{\}@,:`=;\.\\]/;
|
var delimiters = parserConf.delimiters || parserConf.singleDelimiters || /^[\(\)\[\]\{\}@,:`=;\.\\]/;
|
||||||
// (Backwards-compatiblity with old, cumbersome config system)
|
// (Backwards-compatiblity with old, cumbersome config system)
|
||||||
var operators = [parserConf.singleOperators, parserConf.doubleOperators, parserConf.doubleDelimiters, parserConf.tripleDelimiters,
|
var operators = [parserConf.singleOperators, parserConf.doubleOperators, parserConf.doubleDelimiters, parserConf.tripleDelimiters,
|
||||||
parserConf.operators || /^([-+*/%\/&|^]=?|[<>=]+|\/\/=?|\*\*=?|!=|[~!@])/]
|
parserConf.operators || /^([-+*/%\/&|^]=?|[<>=]+|\/\/=?|\*\*=?|!=|[~!@]|\.\.\.)/]
|
||||||
for (var i = 0; i < operators.length; i++) if (!operators[i]) operators.splice(i--, 1)
|
for (var i = 0; i < operators.length; i++) if (!operators[i]) operators.splice(i--, 1)
|
||||||
|
|
||||||
var hangingIndent = parserConf.hangingIndent || conf.indentUnit;
|
var hangingIndent = parserConf.hangingIndent || conf.indentUnit;
|
||||||
@ -144,7 +144,7 @@
|
|||||||
if (stream.match(stringPrefixes)) {
|
if (stream.match(stringPrefixes)) {
|
||||||
var isFmtString = stream.current().toLowerCase().indexOf('f') !== -1;
|
var isFmtString = stream.current().toLowerCase().indexOf('f') !== -1;
|
||||||
if (!isFmtString) {
|
if (!isFmtString) {
|
||||||
state.tokenize = tokenStringFactory(stream.current());
|
state.tokenize = tokenStringFactory(stream.current(), state.tokenize);
|
||||||
return state.tokenize(stream, state);
|
return state.tokenize(stream, state);
|
||||||
} else {
|
} else {
|
||||||
state.tokenize = formatStringFactory(stream.current(), state.tokenize);
|
state.tokenize = formatStringFactory(stream.current(), state.tokenize);
|
||||||
@ -187,23 +187,18 @@
|
|||||||
var singleline = delimiter.length == 1;
|
var singleline = delimiter.length == 1;
|
||||||
var OUTCLASS = "string";
|
var OUTCLASS = "string";
|
||||||
|
|
||||||
function tokenFString(stream, state) {
|
function tokenNestedExpr(depth) {
|
||||||
// inside f-str Expression
|
return function(stream, state) {
|
||||||
if (stream.match(delimiter)) {
|
var inner = tokenBaseInner(stream, state)
|
||||||
// expression ends pre-maturally, but very common in editing
|
if (inner == "punctuation") {
|
||||||
// Could show error to remind users to close brace here
|
if (stream.current() == "{") {
|
||||||
state.tokenize = tokenString
|
state.tokenize = tokenNestedExpr(depth + 1)
|
||||||
return OUTCLASS;
|
} else if (stream.current() == "}") {
|
||||||
} else if (stream.match('{')) {
|
if (depth > 1) state.tokenize = tokenNestedExpr(depth - 1)
|
||||||
// starting brace, if not eaten below
|
else state.tokenize = tokenString
|
||||||
return "punctuation";
|
}
|
||||||
} else if (stream.match('}')) {
|
}
|
||||||
// return to regular inside string state
|
return inner
|
||||||
state.tokenize = tokenString
|
|
||||||
return "punctuation";
|
|
||||||
} else {
|
|
||||||
// use tokenBaseInner to parse the expression
|
|
||||||
return tokenBaseInner(stream, state);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -222,14 +217,9 @@
|
|||||||
return OUTCLASS;
|
return OUTCLASS;
|
||||||
} else if (stream.match('{', false)) {
|
} else if (stream.match('{', false)) {
|
||||||
// switch to nested mode
|
// switch to nested mode
|
||||||
state.tokenize = tokenFString
|
state.tokenize = tokenNestedExpr(0)
|
||||||
if (stream.current()) {
|
if (stream.current()) return OUTCLASS;
|
||||||
return OUTCLASS;
|
else return state.tokenize(stream, state)
|
||||||
} else {
|
|
||||||
// need to return something, so eat the starting {
|
|
||||||
stream.next();
|
|
||||||
return "punctuation";
|
|
||||||
}
|
|
||||||
} else if (stream.match('}}')) {
|
} else if (stream.match('}}')) {
|
||||||
return OUTCLASS;
|
return OUTCLASS;
|
||||||
} else if (stream.match('}')) {
|
} else if (stream.match('}')) {
|
||||||
@ -251,7 +241,7 @@
|
|||||||
return tokenString;
|
return tokenString;
|
||||||
}
|
}
|
||||||
|
|
||||||
function tokenStringFactory(delimiter) {
|
function tokenStringFactory(delimiter, tokenOuter) {
|
||||||
while ("rubf".indexOf(delimiter.charAt(0).toLowerCase()) >= 0)
|
while ("rubf".indexOf(delimiter.charAt(0).toLowerCase()) >= 0)
|
||||||
delimiter = delimiter.substr(1);
|
delimiter = delimiter.substr(1);
|
||||||
|
|
||||||
@ -266,7 +256,7 @@
|
|||||||
if (singleline && stream.eol())
|
if (singleline && stream.eol())
|
||||||
return OUTCLASS;
|
return OUTCLASS;
|
||||||
} else if (stream.match(delimiter)) {
|
} else if (stream.match(delimiter)) {
|
||||||
state.tokenize = tokenBase;
|
state.tokenize = tokenOuter;
|
||||||
return OUTCLASS;
|
return OUTCLASS;
|
||||||
} else {
|
} else {
|
||||||
stream.eat(/['"]/);
|
stream.eat(/['"]/);
|
||||||
@ -276,7 +266,7 @@
|
|||||||
if (parserConf.singleLineStringErrors)
|
if (parserConf.singleLineStringErrors)
|
||||||
return ERRORCLASS;
|
return ERRORCLASS;
|
||||||
else
|
else
|
||||||
state.tokenize = tokenBase;
|
state.tokenize = tokenOuter;
|
||||||
}
|
}
|
||||||
return OUTCLASS;
|
return OUTCLASS;
|
||||||
}
|
}
|
||||||
|
6
libraries/codemirror/mode/python/test.js
vendored
6
libraries/codemirror/mode/python/test.js
vendored
@ -35,4 +35,10 @@
|
|||||||
MT("fInvalidFString", "[error f'this is wrong}]");
|
MT("fInvalidFString", "[error f'this is wrong}]");
|
||||||
MT("fNestedFString", "[string f'expression ]{[number 100] [operator +] [string f'inner]{[number 5]}[string ']}[string string']");
|
MT("fNestedFString", "[string f'expression ]{[number 100] [operator +] [string f'inner]{[number 5]}[string ']}[string string']");
|
||||||
MT("uValidStringPrefix", "[string u'this is an unicode string']");
|
MT("uValidStringPrefix", "[string u'this is an unicode string']");
|
||||||
|
|
||||||
|
MT("nestedString", "[string f']{[variable b][[ [string \"c\"] ]]}[string f'] [comment # oops]")
|
||||||
|
|
||||||
|
MT("bracesInFString", "[string f']{[variable x] [operator +] {}}[string !']")
|
||||||
|
|
||||||
|
MT("nestedFString", "[string f']{[variable b][[ [string f\"c\"] ]]}[string f'] [comment # oops]")
|
||||||
})();
|
})();
|
||||||
|
2
libraries/codemirror/mode/q/index.html
vendored
2
libraries/codemirror/mode/q/index.html
vendored
@ -8,7 +8,7 @@
|
|||||||
<script src="../../lib/codemirror.js"></script>
|
<script src="../../lib/codemirror.js"></script>
|
||||||
<script src="../../addon/edit/matchbrackets.js"></script>
|
<script src="../../addon/edit/matchbrackets.js"></script>
|
||||||
<script src="q.js"></script>
|
<script src="q.js"></script>
|
||||||
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
||||||
<div id=nav>
|
<div id=nav>
|
||||||
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
||||||
|
|
||||||
|
2
libraries/codemirror/mode/r/r.js
vendored
2
libraries/codemirror/mode/r/r.js
vendored
@ -19,7 +19,7 @@ CodeMirror.defineMode("r", function(config) {
|
|||||||
for (var i = 0; i < words.length; ++i) res[words[i]] = true;
|
for (var i = 0; i < words.length; ++i) res[words[i]] = true;
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
var commonAtoms = ["NULL", "NA", "Inf", "NaN", "NA_integer_", "NA_real_", "NA_complex_", "NA_character_"];
|
var commonAtoms = ["NULL", "NA", "Inf", "NaN", "NA_integer_", "NA_real_", "NA_complex_", "NA_character_", "TRUE", "FALSE"];
|
||||||
var commonBuiltins = ["list", "quote", "bquote", "eval", "return", "call", "parse", "deparse"];
|
var commonBuiltins = ["list", "quote", "bquote", "eval", "return", "call", "parse", "deparse"];
|
||||||
var commonKeywords = ["if", "else", "repeat", "while", "function", "for", "in", "next", "break"];
|
var commonKeywords = ["if", "else", "repeat", "while", "function", "for", "in", "next", "break"];
|
||||||
var commonBlockKeywords = ["if", "else", "repeat", "while", "function", "for"];
|
var commonBlockKeywords = ["if", "else", "repeat", "while", "function", "for"];
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
<script src="../../../lib/codemirror.js"></script>
|
<script src="../../../lib/codemirror.js"></script>
|
||||||
<script src="changes.js"></script>
|
<script src="changes.js"></script>
|
||||||
<link rel="stylesheet" href="../../../doc/docs.css">
|
<link rel="stylesheet" href="../../../doc/docs.css">
|
||||||
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
||||||
|
|
||||||
<div id=nav>
|
<div id=nav>
|
||||||
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../../doc/logo.png"></a>
|
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../../doc/logo.png"></a>
|
||||||
|
2
libraries/codemirror/mode/rpm/index.html
vendored
2
libraries/codemirror/mode/rpm/index.html
vendored
@ -8,7 +8,7 @@
|
|||||||
<script src="../../lib/codemirror.js"></script>
|
<script src="../../lib/codemirror.js"></script>
|
||||||
<script src="rpm.js"></script>
|
<script src="rpm.js"></script>
|
||||||
<link rel="stylesheet" href="../../doc/docs.css">
|
<link rel="stylesheet" href="../../doc/docs.css">
|
||||||
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
||||||
|
|
||||||
<div id=nav>
|
<div id=nav>
|
||||||
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
||||||
|
2
libraries/codemirror/mode/rst/index.html
vendored
2
libraries/codemirror/mode/rst/index.html
vendored
@ -8,7 +8,7 @@
|
|||||||
<script src="../../lib/codemirror.js"></script>
|
<script src="../../lib/codemirror.js"></script>
|
||||||
<script src="../../addon/mode/overlay.js"></script>
|
<script src="../../addon/mode/overlay.js"></script>
|
||||||
<script src="rst.js"></script>
|
<script src="rst.js"></script>
|
||||||
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
||||||
<div id=nav>
|
<div id=nav>
|
||||||
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
||||||
|
|
||||||
|
18
libraries/codemirror/mode/ruby/ruby.js
vendored
18
libraries/codemirror/mode/ruby/ruby.js
vendored
@ -28,7 +28,8 @@ CodeMirror.defineMode("ruby", function(config) {
|
|||||||
var indentWords = wordObj(["def", "class", "case", "for", "while", "until", "module", "then",
|
var indentWords = wordObj(["def", "class", "case", "for", "while", "until", "module", "then",
|
||||||
"catch", "loop", "proc", "begin"]);
|
"catch", "loop", "proc", "begin"]);
|
||||||
var dedentWords = wordObj(["end", "until"]);
|
var dedentWords = wordObj(["end", "until"]);
|
||||||
var matching = {"[": "]", "{": "}", "(": ")"};
|
var opening = {"[": "]", "{": "}", "(": ")"};
|
||||||
|
var closing = {"]": "[", "}": "{", ")": "("};
|
||||||
var curPunc;
|
var curPunc;
|
||||||
|
|
||||||
function chain(newtok, stream, state) {
|
function chain(newtok, stream, state) {
|
||||||
@ -58,13 +59,13 @@ CodeMirror.defineMode("ruby", function(config) {
|
|||||||
else if (stream.eat(/[wxq]/)) { style = "string"; embed = false; }
|
else if (stream.eat(/[wxq]/)) { style = "string"; embed = false; }
|
||||||
var delim = stream.eat(/[^\w\s=]/);
|
var delim = stream.eat(/[^\w\s=]/);
|
||||||
if (!delim) return "operator";
|
if (!delim) return "operator";
|
||||||
if (matching.propertyIsEnumerable(delim)) delim = matching[delim];
|
if (opening.propertyIsEnumerable(delim)) delim = opening[delim];
|
||||||
return chain(readQuoted(delim, style, embed, true), stream, state);
|
return chain(readQuoted(delim, style, embed, true), stream, state);
|
||||||
} else if (ch == "#") {
|
} else if (ch == "#") {
|
||||||
stream.skipToEnd();
|
stream.skipToEnd();
|
||||||
return "comment";
|
return "comment";
|
||||||
} else if (ch == "<" && (m = stream.match(/^<-?[\`\"\']?([a-zA-Z_?]\w*)[\`\"\']?(?:;|$)/))) {
|
} else if (ch == "<" && (m = stream.match(/^<([-~])[\`\"\']?([a-zA-Z_?]\w*)[\`\"\']?(?:;|$)/))) {
|
||||||
return chain(readHereDoc(m[1]), stream, state);
|
return chain(readHereDoc(m[2], m[1]), stream, state);
|
||||||
} else if (ch == "0") {
|
} else if (ch == "0") {
|
||||||
if (stream.eat("x")) stream.eatWhile(/[\da-fA-F]/);
|
if (stream.eat("x")) stream.eatWhile(/[\da-fA-F]/);
|
||||||
else if (stream.eat("b")) stream.eatWhile(/[01]/);
|
else if (stream.eat("b")) stream.eatWhile(/[01]/);
|
||||||
@ -216,8 +217,9 @@ CodeMirror.defineMode("ruby", function(config) {
|
|||||||
return style;
|
return style;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
function readHereDoc(phrase) {
|
function readHereDoc(phrase, mayIndent) {
|
||||||
return function(stream, state) {
|
return function(stream, state) {
|
||||||
|
if (mayIndent) stream.eatSpace()
|
||||||
if (stream.match(phrase)) state.tokenize.pop();
|
if (stream.match(phrase)) state.tokenize.pop();
|
||||||
else stream.skipToEnd();
|
else stream.skipToEnd();
|
||||||
return "string";
|
return "string";
|
||||||
@ -276,12 +278,12 @@ CodeMirror.defineMode("ruby", function(config) {
|
|||||||
},
|
},
|
||||||
|
|
||||||
indent: function(state, textAfter) {
|
indent: function(state, textAfter) {
|
||||||
if (state.tokenize[state.tokenize.length-1] != tokenBase) return 0;
|
if (state.tokenize[state.tokenize.length-1] != tokenBase) return CodeMirror.Pass;
|
||||||
var firstChar = textAfter && textAfter.charAt(0);
|
var firstChar = textAfter && textAfter.charAt(0);
|
||||||
var ct = state.context;
|
var ct = state.context;
|
||||||
var closing = ct.type == matching[firstChar] ||
|
var closed = ct.type == closing[firstChar] ||
|
||||||
ct.type == "keyword" && /^(?:end|until|else|elsif|when|rescue)\b/.test(textAfter);
|
ct.type == "keyword" && /^(?:end|until|else|elsif|when|rescue)\b/.test(textAfter);
|
||||||
return ct.indented + (closing ? 0 : config.indentUnit) +
|
return ct.indented + (closed ? 0 : config.indentUnit) +
|
||||||
(state.continuedLine ? config.indentUnit : 0);
|
(state.continuedLine ? config.indentUnit : 0);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
7
libraries/codemirror/mode/ruby/test.js
vendored
7
libraries/codemirror/mode/ruby/test.js
vendored
@ -13,4 +13,11 @@
|
|||||||
|
|
||||||
MT("complex_regexp",
|
MT("complex_regexp",
|
||||||
"[keyword if] [variable cr] [operator =~] [string-2 /(?: \\( #{][tag RE_NOT][string-2 }\\( | #{][tag RE_NOT_PAR_OR][string-2 }* #{][tag RE_OPA_OR][string-2 } )/][variable x]")
|
"[keyword if] [variable cr] [operator =~] [string-2 /(?: \\( #{][tag RE_NOT][string-2 }\\( | #{][tag RE_NOT_PAR_OR][string-2 }* #{][tag RE_OPA_OR][string-2 } )/][variable x]")
|
||||||
|
|
||||||
|
MT("indented_heredoc",
|
||||||
|
"[keyword def] [def x]",
|
||||||
|
" [variable y] [operator =] [string <<-FOO]",
|
||||||
|
"[string bar]",
|
||||||
|
"[string FOO]",
|
||||||
|
"[keyword end]")
|
||||||
})();
|
})();
|
||||||
|
2
libraries/codemirror/mode/rust/index.html
vendored
2
libraries/codemirror/mode/rust/index.html
vendored
@ -8,7 +8,7 @@
|
|||||||
<script src="../../lib/codemirror.js"></script>
|
<script src="../../lib/codemirror.js"></script>
|
||||||
<script src="../../addon/mode/simple.js"></script>
|
<script src="../../addon/mode/simple.js"></script>
|
||||||
<script src="rust.js"></script>
|
<script src="rust.js"></script>
|
||||||
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
||||||
<div id=nav>
|
<div id=nav>
|
||||||
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
||||||
|
|
||||||
|
2
libraries/codemirror/mode/sas/index.html
vendored
2
libraries/codemirror/mode/sas/index.html
vendored
@ -8,7 +8,7 @@
|
|||||||
<script src="../../lib/codemirror.js"></script>
|
<script src="../../lib/codemirror.js"></script>
|
||||||
<script src="../xml/xml.js"></script>
|
<script src="../xml/xml.js"></script>
|
||||||
<script src="sas.js"></script>
|
<script src="sas.js"></script>
|
||||||
<style type="text/css">
|
<style>
|
||||||
.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
|
.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
|
||||||
.cm-s-default .cm-trailing-space-a:before,
|
.cm-s-default .cm-trailing-space-a:before,
|
||||||
.cm-s-default .cm-trailing-space-b:before {position: absolute; content: "\00B7"; color: #777;}
|
.cm-s-default .cm-trailing-space-b:before {position: absolute; content: "\00B7"; color: #777;}
|
||||||
|
24
libraries/codemirror/mode/scheme/scheme.js
vendored
24
libraries/codemirror/mode/scheme/scheme.js
vendored
@ -73,7 +73,8 @@ CodeMirror.defineMode("scheme", function () {
|
|||||||
indentStack: null,
|
indentStack: null,
|
||||||
indentation: 0,
|
indentation: 0,
|
||||||
mode: false,
|
mode: false,
|
||||||
sExprComment: false
|
sExprComment: false,
|
||||||
|
sExprQuote: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -121,7 +122,7 @@ CodeMirror.defineMode("scheme", function () {
|
|||||||
state.sExprComment = 0;
|
state.sExprComment = 0;
|
||||||
}else{
|
}else{
|
||||||
// if not we just comment the entire of the next token
|
// if not we just comment the entire of the next token
|
||||||
stream.eatWhile(/[^/s]/); // eat non spaces
|
stream.eatWhile(/[^\s\(\)\[\]]/); // eat symbol atom
|
||||||
returnType = COMMENT;
|
returnType = COMMENT;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -133,7 +134,15 @@ CodeMirror.defineMode("scheme", function () {
|
|||||||
returnType = STRING;
|
returnType = STRING;
|
||||||
|
|
||||||
} else if (ch == "'") {
|
} else if (ch == "'") {
|
||||||
returnType = ATOM;
|
if (stream.peek() == "(" || stream.peek() == "["){
|
||||||
|
if (typeof state.sExprQuote != "number") {
|
||||||
|
state.sExprQuote = 0;
|
||||||
|
} // else already in a quoted expression
|
||||||
|
returnType = ATOM;
|
||||||
|
} else {
|
||||||
|
stream.eatWhile(/[\w_\-!$%&*+\.\/:<=>?@\^~]/);
|
||||||
|
returnType = ATOM;
|
||||||
|
}
|
||||||
} else if (ch == '#') {
|
} else if (ch == '#') {
|
||||||
if (stream.eat("|")) { // Multi-line comment
|
if (stream.eat("|")) { // Multi-line comment
|
||||||
state.mode = "comment"; // toggle to comment mode
|
state.mode = "comment"; // toggle to comment mode
|
||||||
@ -209,6 +218,7 @@ CodeMirror.defineMode("scheme", function () {
|
|||||||
stream.backUp(stream.current().length - 1); // undo all the eating
|
stream.backUp(stream.current().length - 1); // undo all the eating
|
||||||
|
|
||||||
if(typeof state.sExprComment == "number") state.sExprComment++;
|
if(typeof state.sExprComment == "number") state.sExprComment++;
|
||||||
|
if(typeof state.sExprQuote == "number") state.sExprQuote++;
|
||||||
|
|
||||||
returnType = BRACKET;
|
returnType = BRACKET;
|
||||||
} else if (ch == ")" || ch == "]") {
|
} else if (ch == ")" || ch == "]") {
|
||||||
@ -222,6 +232,12 @@ CodeMirror.defineMode("scheme", function () {
|
|||||||
state.sExprComment = false; // turn off s-expr commenting mode
|
state.sExprComment = false; // turn off s-expr commenting mode
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(typeof state.sExprQuote == "number"){
|
||||||
|
if(--state.sExprQuote == 0){
|
||||||
|
returnType = ATOM; // final closing bracket
|
||||||
|
state.sExprQuote = false; // turn off s-expr quote mode
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
stream.eatWhile(/[\w_\-!$%&*+\.\/:<=>?@\^~]/);
|
stream.eatWhile(/[\w_\-!$%&*+\.\/:<=>?@\^~]/);
|
||||||
@ -231,7 +247,7 @@ CodeMirror.defineMode("scheme", function () {
|
|||||||
} else returnType = "variable";
|
} else returnType = "variable";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return (typeof state.sExprComment == "number") ? COMMENT : returnType;
|
return (typeof state.sExprComment == "number") ? COMMENT : ((typeof state.sExprQuote == "number") ? ATOM : returnType);
|
||||||
},
|
},
|
||||||
|
|
||||||
indent: function (state) {
|
indent: function (state) {
|
||||||
|
2
libraries/codemirror/mode/smarty/index.html
vendored
2
libraries/codemirror/mode/smarty/index.html
vendored
@ -8,7 +8,7 @@
|
|||||||
<script src="../../lib/codemirror.js"></script>
|
<script src="../../lib/codemirror.js"></script>
|
||||||
<script src="../xml/xml.js"></script>
|
<script src="../xml/xml.js"></script>
|
||||||
<script src="smarty.js"></script>
|
<script src="smarty.js"></script>
|
||||||
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
||||||
<div id=nav>
|
<div id=nav>
|
||||||
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
||||||
|
|
||||||
|
4
libraries/codemirror/mode/smarty/smarty.js
vendored
4
libraries/codemirror/mode/smarty/smarty.js
vendored
@ -210,9 +210,9 @@
|
|||||||
state.last = last;
|
state.last = last;
|
||||||
return style;
|
return style;
|
||||||
},
|
},
|
||||||
indent: function(state, text) {
|
indent: function(state, text, line) {
|
||||||
if (state.tokenize == tokenTop && baseMode.indent)
|
if (state.tokenize == tokenTop && baseMode.indent)
|
||||||
return baseMode.indent(state.base, text);
|
return baseMode.indent(state.base, text, line);
|
||||||
else
|
else
|
||||||
return CodeMirror.Pass;
|
return CodeMirror.Pass;
|
||||||
},
|
},
|
||||||
|
2
libraries/codemirror/mode/solr/index.html
vendored
2
libraries/codemirror/mode/solr/index.html
vendored
@ -7,7 +7,7 @@
|
|||||||
<link rel="stylesheet" href="../../lib/codemirror.css">
|
<link rel="stylesheet" href="../../lib/codemirror.css">
|
||||||
<script src="../../lib/codemirror.js"></script>
|
<script src="../../lib/codemirror.js"></script>
|
||||||
<script src="solr.js"></script>
|
<script src="solr.js"></script>
|
||||||
<style type="text/css">
|
<style>
|
||||||
.CodeMirror {
|
.CodeMirror {
|
||||||
border-top: 1px solid black;
|
border-top: 1px solid black;
|
||||||
border-bottom: 1px solid black;
|
border-bottom: 1px solid black;
|
||||||
|
2
libraries/codemirror/mode/soy/index.html
vendored
2
libraries/codemirror/mode/soy/index.html
vendored
@ -12,7 +12,7 @@
|
|||||||
<script src="../javascript/javascript.js"></script>
|
<script src="../javascript/javascript.js"></script>
|
||||||
<script src="../css/css.js"></script>
|
<script src="../css/css.js"></script>
|
||||||
<script src="soy.js"></script>
|
<script src="soy.js"></script>
|
||||||
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
||||||
<div id=nav>
|
<div id=nav>
|
||||||
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
||||||
|
|
||||||
|
196
libraries/codemirror/mode/soy/soy.js
vendored
196
libraries/codemirror/mode/soy/soy.js
vendored
@ -11,9 +11,43 @@
|
|||||||
})(function(CodeMirror) {
|
})(function(CodeMirror) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var indentingTags = ["template", "literal", "msg", "fallbackmsg", "let", "if", "elseif",
|
var paramData = { noEndTag: true, soyState: "param-def" };
|
||||||
"else", "switch", "case", "default", "foreach", "ifempty", "for",
|
var tags = {
|
||||||
"call", "param", "deltemplate", "delcall", "log"];
|
"alias": { noEndTag: true },
|
||||||
|
"delpackage": { noEndTag: true },
|
||||||
|
"namespace": { noEndTag: true, soyState: "namespace-def" },
|
||||||
|
"@param": paramData,
|
||||||
|
"@param?": paramData,
|
||||||
|
"@inject": paramData,
|
||||||
|
"@inject?": paramData,
|
||||||
|
"@state": paramData,
|
||||||
|
"@state?": paramData,
|
||||||
|
"template": { soyState: "templ-def", variableScope: true},
|
||||||
|
"literal": { },
|
||||||
|
"msg": {},
|
||||||
|
"fallbackmsg": { noEndTag: true, reduceIndent: true},
|
||||||
|
"let": { soyState: "var-def" },
|
||||||
|
"if": {},
|
||||||
|
"elseif": { noEndTag: true, reduceIndent: true},
|
||||||
|
"else": { noEndTag: true, reduceIndent: true},
|
||||||
|
"switch": {},
|
||||||
|
"case": { noEndTag: true, reduceIndent: true},
|
||||||
|
"default": { noEndTag: true, reduceIndent: true},
|
||||||
|
"foreach": { variableScope: true, soyState: "var-def" },
|
||||||
|
"ifempty": { noEndTag: true, reduceIndent: true},
|
||||||
|
"for": { variableScope: true, soyState: "var-def" },
|
||||||
|
"call": { soyState: "templ-ref" },
|
||||||
|
"param": { soyState: "param-ref"},
|
||||||
|
"print": { noEndTag: true },
|
||||||
|
"deltemplate": { soyState: "templ-def", variableScope: true},
|
||||||
|
"delcall": { soyState: "templ-ref" },
|
||||||
|
"log": {},
|
||||||
|
"element": { variableScope: true },
|
||||||
|
};
|
||||||
|
|
||||||
|
var indentingTags = Object.keys(tags).filter(function(tag) {
|
||||||
|
return !tags[tag].noEndTag || tags[tag].reduceIndent;
|
||||||
|
});
|
||||||
|
|
||||||
CodeMirror.defineMode("soy", function(config) {
|
CodeMirror.defineMode("soy", function(config) {
|
||||||
var textMode = CodeMirror.getMode(config, "text/plain");
|
var textMode = CodeMirror.getMode(config, "text/plain");
|
||||||
@ -68,30 +102,38 @@
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function popcontext(state) {
|
||||||
|
if (!state.context) return;
|
||||||
|
if (state.context.scope) {
|
||||||
|
state.variables = state.context.scope;
|
||||||
|
}
|
||||||
|
state.context = state.context.previousContext;
|
||||||
|
}
|
||||||
|
|
||||||
// Reference a variable `name` in `list`.
|
// Reference a variable `name` in `list`.
|
||||||
// Let `loose` be truthy to ignore missing identifiers.
|
// Let `loose` be truthy to ignore missing identifiers.
|
||||||
function ref(list, name, loose) {
|
function ref(list, name, loose) {
|
||||||
return contains(list, name) ? "variable-2" : (loose ? "variable" : "variable-2 error");
|
return contains(list, name) ? "variable-2" : (loose ? "variable" : "variable-2 error");
|
||||||
}
|
}
|
||||||
|
|
||||||
function popscope(state) {
|
// Data for an open soy tag.
|
||||||
if (state.scopes) {
|
function Context(previousContext, tag, scope) {
|
||||||
state.variables = state.scopes.element;
|
this.previousContext = previousContext;
|
||||||
state.scopes = state.scopes.next;
|
this.tag = tag;
|
||||||
}
|
this.kind = null;
|
||||||
|
this.scope = scope;
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
startState: function() {
|
startState: function() {
|
||||||
return {
|
return {
|
||||||
kind: [],
|
|
||||||
kindTag: [],
|
|
||||||
soyState: [],
|
soyState: [],
|
||||||
templates: null,
|
templates: null,
|
||||||
variables: prepend(null, 'ij'),
|
variables: prepend(null, 'ij'),
|
||||||
scopes: null,
|
scopes: null,
|
||||||
indent: 0,
|
indent: 0,
|
||||||
quoteKind: null,
|
quoteKind: null,
|
||||||
|
context: null,
|
||||||
localStates: [{
|
localStates: [{
|
||||||
mode: modes.html,
|
mode: modes.html,
|
||||||
state: CodeMirror.startState(modes.html)
|
state: CodeMirror.startState(modes.html)
|
||||||
@ -102,12 +144,10 @@
|
|||||||
copyState: function(state) {
|
copyState: function(state) {
|
||||||
return {
|
return {
|
||||||
tag: state.tag, // Last seen Soy tag.
|
tag: state.tag, // Last seen Soy tag.
|
||||||
kind: state.kind.concat([]), // Values of kind="" attributes.
|
|
||||||
kindTag: state.kindTag.concat([]), // Opened tags with kind="" attributes.
|
|
||||||
soyState: state.soyState.concat([]),
|
soyState: state.soyState.concat([]),
|
||||||
templates: state.templates,
|
templates: state.templates,
|
||||||
variables: state.variables,
|
variables: state.variables,
|
||||||
scopes: state.scopes,
|
context: state.context,
|
||||||
indent: state.indent, // Indentation of the following line.
|
indent: state.indent, // Indentation of the following line.
|
||||||
quoteKind: state.quoteKind,
|
quoteKind: state.quoteKind,
|
||||||
localStates: state.localStates.map(function(localState) {
|
localStates: state.localStates.map(function(localState) {
|
||||||
@ -129,7 +169,7 @@
|
|||||||
} else {
|
} else {
|
||||||
stream.skipToEnd();
|
stream.skipToEnd();
|
||||||
}
|
}
|
||||||
if (!state.scopes) {
|
if (!state.context || !state.context.scope) {
|
||||||
var paramRe = /@param\??\s+(\S+)/g;
|
var paramRe = /@param\??\s+(\S+)/g;
|
||||||
var current = stream.current();
|
var current = stream.current();
|
||||||
for (var match; (match = paramRe.exec(current)); ) {
|
for (var match; (match = paramRe.exec(current)); ) {
|
||||||
@ -162,7 +202,6 @@
|
|||||||
case "templ-def":
|
case "templ-def":
|
||||||
if (match = stream.match(/^\.?([\w]+(?!\.[\w]+)*)/)) {
|
if (match = stream.match(/^\.?([\w]+(?!\.[\w]+)*)/)) {
|
||||||
state.templates = prepend(state.templates, match[1]);
|
state.templates = prepend(state.templates, match[1]);
|
||||||
state.scopes = prepend(state.scopes, state.variables);
|
|
||||||
state.soyState.pop();
|
state.soyState.pop();
|
||||||
return "def";
|
return "def";
|
||||||
}
|
}
|
||||||
@ -170,11 +209,11 @@
|
|||||||
return null;
|
return null;
|
||||||
|
|
||||||
case "templ-ref":
|
case "templ-ref":
|
||||||
if (match = stream.match(/^\.?([\w]+)/)) {
|
if (match = stream.match(/(\.?[a-zA-Z_][a-zA-Z_0-9]+)+/)) {
|
||||||
state.soyState.pop();
|
state.soyState.pop();
|
||||||
// If the first character is '.', try to match against a local template name.
|
// If the first character is '.', it can only be a local template.
|
||||||
if (match[0][0] == '.') {
|
if (match[0][0] == '.') {
|
||||||
return ref(state.templates, match[1], true);
|
return "variable-2"
|
||||||
}
|
}
|
||||||
// Otherwise
|
// Otherwise
|
||||||
return "variable";
|
return "variable";
|
||||||
@ -182,6 +221,14 @@
|
|||||||
stream.next();
|
stream.next();
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
case "namespace-def":
|
||||||
|
if (match = stream.match(/^\.?([\w\.]+)/)) {
|
||||||
|
state.soyState.pop();
|
||||||
|
return "variable";
|
||||||
|
}
|
||||||
|
stream.next();
|
||||||
|
return null;
|
||||||
|
|
||||||
case "param-def":
|
case "param-def":
|
||||||
if (match = stream.match(/^\w+/)) {
|
if (match = stream.match(/^\w+/)) {
|
||||||
state.variables = prepend(state.variables, match[0]);
|
state.variables = prepend(state.variables, match[0]);
|
||||||
@ -192,13 +239,21 @@
|
|||||||
stream.next();
|
stream.next();
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
case "param-ref":
|
||||||
|
if (match = stream.match(/^\w+/)) {
|
||||||
|
state.soyState.pop();
|
||||||
|
return "property";
|
||||||
|
}
|
||||||
|
stream.next();
|
||||||
|
return null;
|
||||||
|
|
||||||
case "param-type":
|
case "param-type":
|
||||||
if (stream.peek() == "}") {
|
if (stream.peek() == "}") {
|
||||||
state.soyState.pop();
|
state.soyState.pop();
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (stream.eatWhile(/^[\w]+/)) {
|
if (stream.eatWhile(/^([\w]+|[?])/)) {
|
||||||
return "variable-3";
|
return "type";
|
||||||
}
|
}
|
||||||
stream.next();
|
stream.next();
|
||||||
return null;
|
return null;
|
||||||
@ -213,29 +268,31 @@
|
|||||||
return null;
|
return null;
|
||||||
|
|
||||||
case "tag":
|
case "tag":
|
||||||
|
var endTag = state.tag[0] == "/";
|
||||||
|
var tagName = endTag ? state.tag.substring(1) : state.tag;
|
||||||
|
var tag = tags[tagName];
|
||||||
if (stream.match(/^\/?}/)) {
|
if (stream.match(/^\/?}/)) {
|
||||||
|
var selfClosed = stream.current() == "/}";
|
||||||
|
if (selfClosed && !endTag) {
|
||||||
|
popcontext(state);
|
||||||
|
}
|
||||||
if (state.tag == "/template" || state.tag == "/deltemplate") {
|
if (state.tag == "/template" || state.tag == "/deltemplate") {
|
||||||
popscope(state);
|
|
||||||
state.variables = prepend(null, 'ij');
|
state.variables = prepend(null, 'ij');
|
||||||
state.indent = 0;
|
state.indent = 0;
|
||||||
} else {
|
} else {
|
||||||
if (state.tag == "/for" || state.tag == "/foreach") {
|
|
||||||
popscope(state);
|
|
||||||
}
|
|
||||||
state.indent -= config.indentUnit *
|
state.indent -= config.indentUnit *
|
||||||
(stream.current() == "/}" || indentingTags.indexOf(state.tag) == -1 ? 2 : 1);
|
(selfClosed || indentingTags.indexOf(state.tag) == -1 ? 2 : 1);
|
||||||
}
|
}
|
||||||
state.soyState.pop();
|
state.soyState.pop();
|
||||||
return "keyword";
|
return "keyword";
|
||||||
} else if (stream.match(/^([\w?]+)(?==)/)) {
|
} else if (stream.match(/^([\w?]+)(?==)/)) {
|
||||||
if (stream.current() == "kind" && (match = stream.match(/^="([^"]+)/, false))) {
|
if (stream.current() == "kind" && (match = stream.match(/^="([^"]+)/, false))) {
|
||||||
var kind = match[1];
|
var kind = match[1];
|
||||||
state.kind.push(kind);
|
state.context.kind = kind;
|
||||||
state.kindTag.push(state.tag);
|
|
||||||
var mode = modes[kind] || modes.html;
|
var mode = modes[kind] || modes.html;
|
||||||
var localState = last(state.localStates);
|
var localState = last(state.localStates);
|
||||||
if (localState.mode.indent) {
|
if (localState.mode.indent) {
|
||||||
state.indent += localState.mode.indent(localState.state, "");
|
state.indent += localState.mode.indent(localState.state, "", "");
|
||||||
}
|
}
|
||||||
state.localStates.push({
|
state.localStates.push({
|
||||||
mode: mode,
|
mode: mode,
|
||||||
@ -243,11 +300,22 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
return "attribute";
|
return "attribute";
|
||||||
|
} else if (match = stream.match(/([\w]+)(?=\()/)) {
|
||||||
|
return "variable callee";
|
||||||
} else if (match = stream.match(/^["']/)) {
|
} else if (match = stream.match(/^["']/)) {
|
||||||
state.soyState.push("string");
|
state.soyState.push("string");
|
||||||
state.quoteKind = match;
|
state.quoteKind = match;
|
||||||
return "string";
|
return "string";
|
||||||
}
|
}
|
||||||
|
if (stream.match(/(null|true|false)(?!\w)/) ||
|
||||||
|
stream.match(/0x([0-9a-fA-F]{2,})/) ||
|
||||||
|
stream.match(/-?([0-9]*[.])?[0-9]+(e[0-9]*)?/)) {
|
||||||
|
return "atom";
|
||||||
|
}
|
||||||
|
if (stream.match(/(\||[+\-*\/%]|[=!]=|\?:|[<>]=?)/)) {
|
||||||
|
// Tokenize filter, binary, null propagator, and equality operators.
|
||||||
|
return "operator";
|
||||||
|
}
|
||||||
if (match = stream.match(/^\$([\w]+)/)) {
|
if (match = stream.match(/^\$([\w]+)/)) {
|
||||||
return ref(state.variables, match[1]);
|
return ref(state.variables, match[1]);
|
||||||
}
|
}
|
||||||
@ -269,41 +337,49 @@
|
|||||||
if (stream.match(/^\{literal}/)) {
|
if (stream.match(/^\{literal}/)) {
|
||||||
state.indent += config.indentUnit;
|
state.indent += config.indentUnit;
|
||||||
state.soyState.push("literal");
|
state.soyState.push("literal");
|
||||||
|
state.context = new Context(state.context, "literal", state.variables);
|
||||||
return "keyword";
|
return "keyword";
|
||||||
|
|
||||||
// A tag-keyword must be followed by whitespace, comment or a closing tag.
|
// A tag-keyword must be followed by whitespace, comment or a closing tag.
|
||||||
} else if (match = stream.match(/^\{([/@\\]?\w+\??)(?=$|[\s}]|\/[/*])/)) {
|
} else if (match = stream.match(/^\{([/@\\]?\w+\??)(?=$|[\s}]|\/[/*])/)) {
|
||||||
if (match[1] != "/switch")
|
var prevTag = state.tag;
|
||||||
state.indent += (/^(\/|(else|elseif|ifempty|case|fallbackmsg|default)$)/.test(match[1]) && state.tag != "switch" ? 1 : 2) * config.indentUnit;
|
|
||||||
state.tag = match[1];
|
state.tag = match[1];
|
||||||
if (state.tag == "/" + last(state.kindTag)) {
|
var endTag = state.tag[0] == "/";
|
||||||
// We found the tag that opened the current kind="".
|
var indentingTag = !!tags[state.tag];
|
||||||
state.kind.pop();
|
var tagName = endTag ? state.tag.substring(1) : state.tag;
|
||||||
state.kindTag.pop();
|
var tag = tags[tagName];
|
||||||
state.localStates.pop();
|
if (state.tag != "/switch")
|
||||||
var localState = last(state.localStates);
|
state.indent += ((endTag || tag && tag.reduceIndent) && prevTag != "switch" ? 1 : 2) * config.indentUnit;
|
||||||
if (localState.mode.indent) {
|
|
||||||
state.indent -= localState.mode.indent(localState.state, "");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
state.soyState.push("tag");
|
state.soyState.push("tag");
|
||||||
if (state.tag == "template" || state.tag == "deltemplate") {
|
var tagError = false;
|
||||||
state.soyState.push("templ-def");
|
if (tag) {
|
||||||
} else if (state.tag == "call" || state.tag == "delcall") {
|
if (!endTag) {
|
||||||
state.soyState.push("templ-ref");
|
if (tag.soyState) state.soyState.push(tag.soyState);
|
||||||
} else if (state.tag == "let") {
|
|
||||||
state.soyState.push("var-def");
|
|
||||||
} else if (state.tag == "for" || state.tag == "foreach") {
|
|
||||||
state.scopes = prepend(state.scopes, state.variables);
|
|
||||||
state.soyState.push("var-def");
|
|
||||||
} else if (state.tag == "namespace") {
|
|
||||||
if (!state.scopes) {
|
|
||||||
state.variables = prepend(null, 'ij');
|
|
||||||
}
|
}
|
||||||
} else if (state.tag.match(/^@(?:param\??|inject)/)) {
|
// If a new tag, open a new context.
|
||||||
state.soyState.push("param-def");
|
if (!tag.noEndTag && (indentingTag || !endTag)) {
|
||||||
|
state.context = new Context(state.context, state.tag, tag.variableScope ? state.variables : null);
|
||||||
|
// Otherwise close the current context.
|
||||||
|
} else if (endTag) {
|
||||||
|
if (!state.context || state.context.tag != tagName) {
|
||||||
|
tagError = true;
|
||||||
|
} else if (state.context) {
|
||||||
|
if (state.context.kind) {
|
||||||
|
state.localStates.pop();
|
||||||
|
var localState = last(state.localStates);
|
||||||
|
if (localState.mode.indent) {
|
||||||
|
state.indent -= localState.mode.indent(localState.state, "", "");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
popcontext(state);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (endTag) {
|
||||||
|
// Assume all tags with a closing tag are defined in the config.
|
||||||
|
tagError = true;
|
||||||
}
|
}
|
||||||
return "keyword";
|
return (tagError ? "error " : "") + "keyword";
|
||||||
|
|
||||||
// Not a tag-keyword; it's an implicit print tag.
|
// Not a tag-keyword; it's an implicit print tag.
|
||||||
} else if (stream.eat('{')) {
|
} else if (stream.eat('{')) {
|
||||||
@ -316,7 +392,7 @@
|
|||||||
return tokenUntil(stream, state, /\{|\s+\/\/|\/\*/);
|
return tokenUntil(stream, state, /\{|\s+\/\/|\/\*/);
|
||||||
},
|
},
|
||||||
|
|
||||||
indent: function(state, textAfter) {
|
indent: function(state, textAfter, line) {
|
||||||
var indent = state.indent, top = last(state.soyState);
|
var indent = state.indent, top = last(state.soyState);
|
||||||
if (top == "comment") return CodeMirror.Pass;
|
if (top == "comment") return CodeMirror.Pass;
|
||||||
|
|
||||||
@ -330,7 +406,7 @@
|
|||||||
}
|
}
|
||||||
var localState = last(state.localStates);
|
var localState = last(state.localStates);
|
||||||
if (indent && localState.mode.indent) {
|
if (indent && localState.mode.indent) {
|
||||||
indent += localState.mode.indent(localState.state, textAfter);
|
indent += localState.mode.indent(localState.state, textAfter, line);
|
||||||
}
|
}
|
||||||
return indent;
|
return indent;
|
||||||
},
|
},
|
||||||
@ -350,8 +426,10 @@
|
|||||||
};
|
};
|
||||||
}, "htmlmixed");
|
}, "htmlmixed");
|
||||||
|
|
||||||
CodeMirror.registerHelper("hintWords", "soy", indentingTags.concat(
|
CodeMirror.registerHelper("wordChars", "soy", /[\w$]/);
|
||||||
["delpackage", "namespace", "alias", "print", "css", "debugger"]));
|
|
||||||
|
CodeMirror.registerHelper("hintWords", "soy", Object.keys(tags).concat(
|
||||||
|
["css", "debugger"]));
|
||||||
|
|
||||||
CodeMirror.defineMIME("text/x-soy", "soy");
|
CodeMirror.defineMIME("text/x-soy", "soy");
|
||||||
});
|
});
|
||||||
|
117
libraries/codemirror/mode/soy/test.js
vendored
117
libraries/codemirror/mode/soy/test.js
vendored
@ -8,7 +8,7 @@
|
|||||||
// Test of small keywords and words containing them.
|
// Test of small keywords and words containing them.
|
||||||
MT('keywords-test',
|
MT('keywords-test',
|
||||||
'[keyword {] [keyword as] worrying [keyword and] notorious [keyword as]',
|
'[keyword {] [keyword as] worrying [keyword and] notorious [keyword as]',
|
||||||
' the Fandor-alias assassin, [keyword or]',
|
' the Fandor[operator -]alias assassin, [keyword or]',
|
||||||
' Corcand cannot fit [keyword in] [keyword }]');
|
' Corcand cannot fit [keyword in] [keyword }]');
|
||||||
|
|
||||||
MT('let-test',
|
MT('let-test',
|
||||||
@ -20,18 +20,63 @@
|
|||||||
'[keyword {/template}]',
|
'[keyword {/template}]',
|
||||||
'');
|
'');
|
||||||
|
|
||||||
|
MT('function-test',
|
||||||
|
'[keyword {] [callee&variable css]([string "MyClass"])[keyword }]',
|
||||||
|
'[tag&bracket <][tag input] [attribute value]=[string "]' +
|
||||||
|
'[keyword {] [callee&variable index]([variable-2&error $list])[keyword }]' +
|
||||||
|
'[string "][tag&bracket />]');
|
||||||
|
|
||||||
|
MT('namespace-test',
|
||||||
|
'[keyword {namespace] [variable namespace][keyword }]')
|
||||||
|
|
||||||
|
MT('namespace-with-attribute-test',
|
||||||
|
'[keyword {namespace] [variable my.namespace.templates] ' +
|
||||||
|
'[attribute requirecss]=[string "my.namespace"][keyword }]');
|
||||||
|
|
||||||
|
MT('operators-test',
|
||||||
|
'[keyword {] [atom 1] [operator ==] [atom 1] [keyword }]',
|
||||||
|
'[keyword {] [atom 1] [operator !=] [atom 2] [keyword }]',
|
||||||
|
'[keyword {] [atom 2] [operator +] [atom 2] [keyword }]',
|
||||||
|
'[keyword {] [atom 2] [operator -] [atom 2] [keyword }]',
|
||||||
|
'[keyword {] [atom 2] [operator *] [atom 2] [keyword }]',
|
||||||
|
'[keyword {] [atom 2] [operator /] [atom 2] [keyword }]',
|
||||||
|
'[keyword {] [atom 2] [operator %] [atom 2] [keyword }]',
|
||||||
|
'[keyword {] [atom 2] [operator <=] [atom 2] [keyword }]',
|
||||||
|
'[keyword {] [atom 2] [operator >=] [atom 2] [keyword }]',
|
||||||
|
'[keyword {] [atom 3] [operator >] [atom 2] [keyword }]',
|
||||||
|
'[keyword {] [atom 2] [operator >] [atom 3] [keyword }]',
|
||||||
|
'[keyword {] [atom null] [operator ?:] [string ""] [keyword }]',
|
||||||
|
'[keyword {] [variable-2&error $variable] [operator |] safeHtml [keyword }]')
|
||||||
|
|
||||||
|
MT('primitive-test',
|
||||||
|
'[keyword {] [atom true] [keyword }]',
|
||||||
|
'[keyword {] [atom false] [keyword }]',
|
||||||
|
'[keyword {] truethy [keyword }]',
|
||||||
|
'[keyword {] falsey [keyword }]',
|
||||||
|
'[keyword {] [atom 42] [keyword }]',
|
||||||
|
'[keyword {] [atom .42] [keyword }]',
|
||||||
|
'[keyword {] [atom 0.42] [keyword }]',
|
||||||
|
'[keyword {] [atom -0.42] [keyword }]',
|
||||||
|
'[keyword {] [atom -.2] [keyword }]',
|
||||||
|
'[keyword {] [atom 6.03e23] [keyword }]',
|
||||||
|
'[keyword {] [atom -0.03e0] [keyword }]',
|
||||||
|
'[keyword {] [atom 0x1F] [keyword }]',
|
||||||
|
'[keyword {] [atom 0x1F00BBEA] [keyword }]');
|
||||||
|
|
||||||
MT('param-type-test',
|
MT('param-type-test',
|
||||||
'[keyword {@param] [def a]: ' +
|
'[keyword {@param] [def a]: ' +
|
||||||
'[variable-3 list]<[[[variable-3 a]: [variable-3 int], ' +
|
'[type list]<[[[type a]: [type int], ' +
|
||||||
'[variable-3 b]: [variable-3 map]<[variable-3 string], ' +
|
'[type b]: [type map]<[type string], ' +
|
||||||
'[variable-3 bool]>]]>][keyword }]');
|
'[type bool]>]]>][keyword }]',
|
||||||
|
'[keyword {@param] [def unknown]: [type ?][keyword }]',
|
||||||
|
'[keyword {@param] [def list]: [type list]<[type ?]>[keyword }]');
|
||||||
|
|
||||||
MT('undefined-var',
|
MT('undefined-var',
|
||||||
'[keyword {][variable-2&error $var]');
|
'[keyword {][variable-2&error $var]');
|
||||||
|
|
||||||
MT('param-scope-test',
|
MT('param-scope-test',
|
||||||
'[keyword {template] [def .a][keyword }]',
|
'[keyword {template] [def .a][keyword }]',
|
||||||
' [keyword {@param] [def x]: [variable-3 string][keyword }]',
|
' [keyword {@param] [def x]: [type string][keyword }]',
|
||||||
' [keyword {][variable-2 $x][keyword }]',
|
' [keyword {][variable-2 $x][keyword }]',
|
||||||
'[keyword {/template}]',
|
'[keyword {/template}]',
|
||||||
'',
|
'',
|
||||||
@ -48,7 +93,7 @@
|
|||||||
|
|
||||||
MT('defined-if-variable-test',
|
MT('defined-if-variable-test',
|
||||||
'[keyword {template] [def .foo][keyword }]',
|
'[keyword {template] [def .foo][keyword }]',
|
||||||
' [keyword {@param?] [def showThing]: [variable-3 bool][keyword }]',
|
' [keyword {@param?] [def showThing]: [type bool][keyword }]',
|
||||||
' [keyword {if] [variable-2 $showThing][keyword }]',
|
' [keyword {if] [variable-2 $showThing][keyword }]',
|
||||||
' Yo!',
|
' Yo!',
|
||||||
' [keyword {/if}]',
|
' [keyword {/if}]',
|
||||||
@ -56,17 +101,15 @@
|
|||||||
'');
|
'');
|
||||||
|
|
||||||
MT('template-calls-test',
|
MT('template-calls-test',
|
||||||
'[keyword {template] [def .foo][keyword }]',
|
|
||||||
' Yo!',
|
|
||||||
'[keyword {/template}]',
|
|
||||||
'[keyword {call] [variable-2 .foo][keyword /}]',
|
'[keyword {call] [variable-2 .foo][keyword /}]',
|
||||||
'[keyword {call] [variable foo][keyword /}]',
|
'[keyword {call] [variable foo][keyword /}]',
|
||||||
'[keyword {call] [variable .bar][keyword /}]',
|
'[keyword {call] [variable foo][keyword }] [keyword {/call}]',
|
||||||
'[keyword {call] [variable bar][keyword /}]',
|
'[keyword {call] [variable first1.second.third_3][keyword /}]',
|
||||||
|
'[keyword {call] [variable first1.second.third_3] [keyword }] [keyword {/call}]',
|
||||||
'');
|
'');
|
||||||
|
|
||||||
MT('foreach-scope-test',
|
MT('foreach-scope-test',
|
||||||
'[keyword {@param] [def bar]: [variable-3 string][keyword }]',
|
'[keyword {@param] [def bar]: [type string][keyword }]',
|
||||||
'[keyword {foreach] [def $foo] [keyword in] [variable-2&error $foos][keyword }]',
|
'[keyword {foreach] [def $foo] [keyword in] [variable-2&error $foos][keyword }]',
|
||||||
' [keyword {][variable-2 $foo][keyword }]',
|
' [keyword {][variable-2 $foo][keyword }]',
|
||||||
'[keyword {/foreach}]',
|
'[keyword {/foreach}]',
|
||||||
@ -84,8 +127,8 @@
|
|||||||
MT('nested-kind-test',
|
MT('nested-kind-test',
|
||||||
'[keyword {template] [def .foo] [attribute kind]=[string "html"][keyword }]',
|
'[keyword {template] [def .foo] [attribute kind]=[string "html"][keyword }]',
|
||||||
' [tag&bracket <][tag div][tag&bracket >]',
|
' [tag&bracket <][tag div][tag&bracket >]',
|
||||||
' [keyword {call] [variable .bar][keyword }]',
|
' [keyword {call] [variable-2 .bar][keyword }]',
|
||||||
' [keyword {param] [attribute kind]=[string "js"][keyword }]',
|
' [keyword {param] [property propertyName] [attribute kind]=[string "js"][keyword }]',
|
||||||
' [keyword var] [def bar] [operator =] [number 5];',
|
' [keyword var] [def bar] [operator =] [number 5];',
|
||||||
' [keyword {/param}]',
|
' [keyword {/param}]',
|
||||||
' [keyword {/call}]',
|
' [keyword {/call}]',
|
||||||
@ -94,14 +137,14 @@
|
|||||||
'');
|
'');
|
||||||
|
|
||||||
MT('tag-starting-with-function-call-is-not-a-keyword',
|
MT('tag-starting-with-function-call-is-not-a-keyword',
|
||||||
'[keyword {]index([variable-2&error $foo])[keyword }]',
|
'[keyword {][callee&variable index]([variable-2&error $foo])[keyword }]',
|
||||||
'[keyword {css] [string "some-class"][keyword }]',
|
'[keyword {css] [string "some-class"][keyword }]',
|
||||||
'[keyword {]css([string "some-class"])[keyword }]',
|
'[keyword {][callee&variable css]([string "some-class"])[keyword }]',
|
||||||
'');
|
'');
|
||||||
|
|
||||||
MT('allow-missing-colon-in-@param',
|
MT('allow-missing-colon-in-@param',
|
||||||
'[keyword {template] [def .foo][keyword }]',
|
'[keyword {template] [def .foo][keyword }]',
|
||||||
' [keyword {@param] [def showThing] [variable-3 bool][keyword }]',
|
' [keyword {@param] [def showThing] [type bool][keyword }]',
|
||||||
' [keyword {if] [variable-2 $showThing][keyword }]',
|
' [keyword {if] [variable-2 $showThing][keyword }]',
|
||||||
' Yo!',
|
' Yo!',
|
||||||
' [keyword {/if}]',
|
' [keyword {/if}]',
|
||||||
@ -118,4 +161,44 @@
|
|||||||
MT('highlight-command-at-eol',
|
MT('highlight-command-at-eol',
|
||||||
'[keyword {msg]',
|
'[keyword {msg]',
|
||||||
' [keyword }]');
|
' [keyword }]');
|
||||||
|
|
||||||
|
MT('switch-indent-test',
|
||||||
|
'[keyword {let] [def $marbles]: [atom 5] [keyword /}]',
|
||||||
|
'[keyword {switch] [variable-2 $marbles][keyword }]',
|
||||||
|
' [keyword {case] [atom 0][keyword }]',
|
||||||
|
' No marbles',
|
||||||
|
' [keyword {default}]',
|
||||||
|
' At least 1 marble',
|
||||||
|
'[keyword {/switch}]',
|
||||||
|
'');
|
||||||
|
|
||||||
|
MT('if-elseif-else-indent',
|
||||||
|
'[keyword {if] [atom true][keyword }]',
|
||||||
|
' [keyword {let] [def $a]: [atom 5] [keyword /}]',
|
||||||
|
'[keyword {elseif] [atom false][keyword }]',
|
||||||
|
' [keyword {let] [def $bar]: [atom 5] [keyword /}]',
|
||||||
|
'[keyword {else}]',
|
||||||
|
' [keyword {let] [def $bar]: [atom 5] [keyword /}]',
|
||||||
|
'[keyword {/if}]');
|
||||||
|
|
||||||
|
MT('msg-fallbackmsg-indent',
|
||||||
|
'[keyword {msg] [attribute desc]=[string "A message"][keyword }]',
|
||||||
|
' A message',
|
||||||
|
'[keyword {fallbackmsg] [attribute desc]=[string "A message"][keyword }]',
|
||||||
|
' Old message',
|
||||||
|
'[keyword {/msg}]');
|
||||||
|
|
||||||
|
MT('special-chars',
|
||||||
|
'[keyword {sp}]',
|
||||||
|
'[keyword {nil}]',
|
||||||
|
'[keyword {\\r}]',
|
||||||
|
'[keyword {\\n}]',
|
||||||
|
'[keyword {\\t}]',
|
||||||
|
'[keyword {lb}]',
|
||||||
|
'[keyword {rb}]');
|
||||||
|
|
||||||
|
MT('wrong-closing-tag',
|
||||||
|
'[keyword {if] [atom true][keyword }]',
|
||||||
|
' Optional',
|
||||||
|
'[keyword&error {/badend][keyword }]');
|
||||||
})();
|
})();
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
<script src="../../lib/codemirror.js"></script>
|
<script src="../../lib/codemirror.js"></script>
|
||||||
<script src="../../addon/edit/matchbrackets.js"></script>
|
<script src="../../addon/edit/matchbrackets.js"></script>
|
||||||
<script src="spreadsheet.js"></script>
|
<script src="spreadsheet.js"></script>
|
||||||
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
||||||
<div id=nav>
|
<div id=nav>
|
||||||
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
||||||
|
|
||||||
|
36
libraries/codemirror/mode/sql/sql.js
vendored
36
libraries/codemirror/mode/sql/sql.js
vendored
File diff suppressed because one or more lines are too long
68
libraries/codemirror/mode/swift/index.html
vendored
68
libraries/codemirror/mode/swift/index.html
vendored
@ -28,50 +28,32 @@
|
|||||||
<article>
|
<article>
|
||||||
<h2>Swift mode</h2>
|
<h2>Swift mode</h2>
|
||||||
<form><textarea id="code" name="code">
|
<form><textarea id="code" name="code">
|
||||||
//
|
protocol HeaderViewProtocol {
|
||||||
// TipCalculatorModel.swift
|
func setTitle(_ string: String)
|
||||||
// TipCalculator
|
|
||||||
//
|
|
||||||
// Created by Main Account on 12/18/14.
|
|
||||||
// Copyright (c) 2014 Razeware LLC. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
import Foundation
|
|
||||||
|
|
||||||
class TipCalculatorModel {
|
|
||||||
|
|
||||||
var total: Double
|
|
||||||
var taxPct: Double
|
|
||||||
var subtotal: Double {
|
|
||||||
get {
|
|
||||||
return total / (taxPct + 1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
init(total: Double, taxPct: Double) {
|
|
||||||
self.total = total
|
|
||||||
self.taxPct = taxPct
|
|
||||||
}
|
|
||||||
|
|
||||||
func calcTipWithTipPct(tipPct: Double) -> Double {
|
|
||||||
return subtotal * tipPct
|
|
||||||
}
|
|
||||||
|
|
||||||
func returnPossibleTips() -> [Int: Double] {
|
|
||||||
|
|
||||||
let possibleTipsInferred = [0.15, 0.18, 0.20]
|
|
||||||
let possibleTipsExplicit:[Double] = [0.15, 0.18, 0.20]
|
|
||||||
|
|
||||||
var retval = [Int: Double]()
|
|
||||||
for possibleTip in possibleTipsInferred {
|
|
||||||
let intPct = Int(possibleTip*100)
|
|
||||||
retval[intPct] = calcTipWithTipPct(possibleTip)
|
|
||||||
}
|
|
||||||
return retval
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct AnyHeaderView {
|
||||||
|
let view: UIView
|
||||||
|
let headerView: HeaderViewProtocol
|
||||||
|
init<T: UIView>(view: T) where T: HeaderViewProtocol {
|
||||||
|
self.view = view
|
||||||
|
self.headerView = view
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let header = AnyHeaderView(view: myView)
|
||||||
|
header.headerView.setTitle("hi")
|
||||||
|
|
||||||
|
struct HeaderView {
|
||||||
|
let view: UIView
|
||||||
|
let setTitle: (String) -> ()
|
||||||
|
}
|
||||||
|
|
||||||
|
var label = UILabel()
|
||||||
|
let header = HeaderView(view: label) { str in
|
||||||
|
label.text = str
|
||||||
|
}
|
||||||
|
header.setTitle("hello")
|
||||||
</textarea></form>
|
</textarea></form>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
42
libraries/codemirror/mode/swift/swift.js
vendored
42
libraries/codemirror/mode/swift/swift.js
vendored
@ -73,9 +73,9 @@
|
|||||||
stream.match("..")
|
stream.match("..")
|
||||||
return "punctuation"
|
return "punctuation"
|
||||||
}
|
}
|
||||||
if (ch == '"' || ch == "'") {
|
var stringMatch
|
||||||
stream.next()
|
if (stringMatch = stream.match(/("""|"|')/)) {
|
||||||
var tokenize = tokenString(ch)
|
var tokenize = tokenString.bind(null, stringMatch[0])
|
||||||
state.tokenize.push(tokenize)
|
state.tokenize.push(tokenize)
|
||||||
return tokenize(stream, state)
|
return tokenize(stream, state)
|
||||||
}
|
}
|
||||||
@ -116,25 +116,29 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function tokenString(quote) {
|
function tokenString(openQuote, stream, state) {
|
||||||
return function(stream, state) {
|
var singleLine = openQuote.length == 1
|
||||||
var ch, escaped = false
|
var ch, escaped = false
|
||||||
while (ch = stream.next()) {
|
while (ch = stream.peek()) {
|
||||||
if (escaped) {
|
if (escaped) {
|
||||||
if (ch == "(") {
|
stream.next()
|
||||||
state.tokenize.push(tokenUntilClosingParen())
|
if (ch == "(") {
|
||||||
return "string"
|
state.tokenize.push(tokenUntilClosingParen())
|
||||||
}
|
return "string"
|
||||||
escaped = false
|
|
||||||
} else if (ch == quote) {
|
|
||||||
break
|
|
||||||
} else {
|
|
||||||
escaped = ch == "\\"
|
|
||||||
}
|
}
|
||||||
|
escaped = false
|
||||||
|
} else if (stream.match(openQuote)) {
|
||||||
|
state.tokenize.pop()
|
||||||
|
return "string"
|
||||||
|
} else {
|
||||||
|
stream.next()
|
||||||
|
escaped = ch == "\\"
|
||||||
}
|
}
|
||||||
state.tokenize.pop()
|
|
||||||
return "string"
|
|
||||||
}
|
}
|
||||||
|
if (singleLine) {
|
||||||
|
state.tokenize.pop()
|
||||||
|
}
|
||||||
|
return "string"
|
||||||
}
|
}
|
||||||
|
|
||||||
function tokenComment(stream, state) {
|
function tokenComment(stream, state) {
|
||||||
|
8
libraries/codemirror/mode/swift/test.js
vendored
8
libraries/codemirror/mode/swift/test.js
vendored
@ -35,7 +35,13 @@
|
|||||||
// Strings and string interpolation.
|
// Strings and string interpolation.
|
||||||
MT("strings",
|
MT("strings",
|
||||||
"[keyword var] [def a][punctuation :] [variable-2 String] [operator =] [string \"test\"]",
|
"[keyword var] [def a][punctuation :] [variable-2 String] [operator =] [string \"test\"]",
|
||||||
"[keyword var] [def b][punctuation :] [variable-2 String] [operator =] [string \"\\(][variable a][string )\"]");
|
"[keyword var] [def b][punctuation :] [variable-2 String] [operator =] [string \"\\(][variable a][string )\"]",
|
||||||
|
"[keyword var] [def c] [operator =] [string \"\"\"]",
|
||||||
|
"[string multi]",
|
||||||
|
"[string line]",
|
||||||
|
"[string \"test\"]",
|
||||||
|
"[string \"\"\"]",
|
||||||
|
"[variable print][punctuation (][string \"\"][punctuation )]");
|
||||||
|
|
||||||
// Comments.
|
// Comments.
|
||||||
MT("comments",
|
MT("comments",
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
<script src="../../lib/codemirror.js"></script>
|
<script src="../../lib/codemirror.js"></script>
|
||||||
<script src="../../addon/edit/matchbrackets.js"></script>
|
<script src="../../addon/edit/matchbrackets.js"></script>
|
||||||
<script src="tiddlywiki.js"></script>
|
<script src="tiddlywiki.js"></script>
|
||||||
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
||||||
<div id=nav>
|
<div id=nav>
|
||||||
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
||||||
|
|
||||||
|
4
libraries/codemirror/mode/tiki/index.html
vendored
4
libraries/codemirror/mode/tiki/index.html
vendored
@ -8,7 +8,7 @@
|
|||||||
<link rel="stylesheet" href="tiki.css">
|
<link rel="stylesheet" href="tiki.css">
|
||||||
<script src="../../lib/codemirror.js"></script>
|
<script src="../../lib/codemirror.js"></script>
|
||||||
<script src="tiki.js"></script>
|
<script src="tiki.js"></script>
|
||||||
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
||||||
<div id=nav>
|
<div id=nav>
|
||||||
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
||||||
|
|
||||||
@ -85,7 +85,7 @@ Plugin (inline):
|
|||||||
{plugin attr="my attr"}
|
{plugin attr="my attr"}
|
||||||
</textarea></div>
|
</textarea></div>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script>
|
||||||
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
||||||
mode: 'tiki',
|
mode: 'tiki',
|
||||||
lineNumbers: true
|
lineNumbers: true
|
||||||
|
2
libraries/codemirror/mode/toml/index.html
vendored
2
libraries/codemirror/mode/toml/index.html
vendored
@ -7,7 +7,7 @@
|
|||||||
<link rel="stylesheet" href="../../lib/codemirror.css">
|
<link rel="stylesheet" href="../../lib/codemirror.css">
|
||||||
<script src="../../lib/codemirror.js"></script>
|
<script src="../../lib/codemirror.js"></script>
|
||||||
<script src="toml.js"></script>
|
<script src="toml.js"></script>
|
||||||
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
||||||
<div id=nav>
|
<div id=nav>
|
||||||
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
||||||
|
|
||||||
|
2
libraries/codemirror/mode/tornado/index.html
vendored
2
libraries/codemirror/mode/tornado/index.html
vendored
@ -10,7 +10,7 @@
|
|||||||
<script src="../xml/xml.js"></script>
|
<script src="../xml/xml.js"></script>
|
||||||
<script src="../htmlmixed/htmlmixed.js"></script>
|
<script src="../htmlmixed/htmlmixed.js"></script>
|
||||||
<script src="tornado.js"></script>
|
<script src="tornado.js"></script>
|
||||||
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
||||||
<div id=nav>
|
<div id=nav>
|
||||||
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
<script src="../../lib/codemirror.js"></script>
|
<script src="../../lib/codemirror.js"></script>
|
||||||
<script src="../../addon/edit/matchbrackets.js"></script>
|
<script src="../../addon/edit/matchbrackets.js"></script>
|
||||||
<script src="ttcn-cfg.js"></script>
|
<script src="ttcn-cfg.js"></script>
|
||||||
<style type="text/css">
|
<style>
|
||||||
.CodeMirror {
|
.CodeMirror {
|
||||||
border-top: 1px solid black;
|
border-top: 1px solid black;
|
||||||
border-bottom: 1px solid black;
|
border-bottom: 1px solid black;
|
||||||
|
2
libraries/codemirror/mode/ttcn/index.html
vendored
2
libraries/codemirror/mode/ttcn/index.html
vendored
@ -8,7 +8,7 @@
|
|||||||
<script src="../../lib/codemirror.js"></script>
|
<script src="../../lib/codemirror.js"></script>
|
||||||
<script src="../../addon/edit/matchbrackets.js"></script>
|
<script src="../../addon/edit/matchbrackets.js"></script>
|
||||||
<script src="ttcn.js"></script>
|
<script src="ttcn.js"></script>
|
||||||
<style type="text/css">
|
<style>
|
||||||
.CodeMirror {
|
.CodeMirror {
|
||||||
border-top: 1px solid black;
|
border-top: 1px solid black;
|
||||||
border-bottom: 1px solid black;
|
border-bottom: 1px solid black;
|
||||||
|
2
libraries/codemirror/mode/twig/index.html
vendored
2
libraries/codemirror/mode/twig/index.html
vendored
@ -7,7 +7,7 @@
|
|||||||
<link rel="stylesheet" href="../../lib/codemirror.css">
|
<link rel="stylesheet" href="../../lib/codemirror.css">
|
||||||
<script src="../../lib/codemirror.js"></script>
|
<script src="../../lib/codemirror.js"></script>
|
||||||
<script src="twig.js"></script>
|
<script src="twig.js"></script>
|
||||||
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
||||||
<div id=nav>
|
<div id=nav>
|
||||||
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
||||||
|
|
||||||
|
4
libraries/codemirror/mode/vb/index.html
vendored
4
libraries/codemirror/mode/vb/index.html
vendored
@ -5,10 +5,10 @@
|
|||||||
<link rel=stylesheet href="../../doc/docs.css">
|
<link rel=stylesheet href="../../doc/docs.css">
|
||||||
|
|
||||||
<link rel="stylesheet" href="../../lib/codemirror.css">
|
<link rel="stylesheet" href="../../lib/codemirror.css">
|
||||||
<link href="http://fonts.googleapis.com/css?family=Inconsolata" rel="stylesheet" type="text/css">
|
<link href="http://fonts.googleapis.com/css?family=Inconsolata" rel="stylesheet">
|
||||||
<script src="../../lib/codemirror.js"></script>
|
<script src="../../lib/codemirror.js"></script>
|
||||||
<script src="vb.js"></script>
|
<script src="vb.js"></script>
|
||||||
<script type="text/javascript" src="../../addon/runmode/runmode.js"></script>
|
<script src="../../addon/runmode/runmode.js"></script>
|
||||||
<style>
|
<style>
|
||||||
.CodeMirror {border: 1px solid #aaa; height:210px; height: auto;}
|
.CodeMirror {border: 1px solid #aaa; height:210px; height: auto;}
|
||||||
.CodeMirror-scroll { overflow-x: auto; overflow-y: hidden;}
|
.CodeMirror-scroll { overflow-x: auto; overflow-y: hidden;}
|
||||||
|
14
libraries/codemirror/mode/vb/vb.js
vendored
14
libraries/codemirror/mode/vb/vb.js
vendored
@ -25,16 +25,16 @@ CodeMirror.defineMode("vb", function(conf, parserConf) {
|
|||||||
var tripleDelimiters = new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))");
|
var tripleDelimiters = new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))");
|
||||||
var identifiers = new RegExp("^[_A-Za-z][_A-Za-z0-9]*");
|
var identifiers = new RegExp("^[_A-Za-z][_A-Za-z0-9]*");
|
||||||
|
|
||||||
var openingKeywords = ['class','module', 'sub','enum','select','while','if','function', 'get','set','property', 'try'];
|
var openingKeywords = ['class','module', 'sub','enum','select','while','if','function', 'get','set','property', 'try', 'structure', 'synclock', 'using', 'with'];
|
||||||
var middleKeywords = ['else','elseif','case', 'catch'];
|
var middleKeywords = ['else','elseif','case', 'catch', 'finally'];
|
||||||
var endKeywords = ['next','loop'];
|
var endKeywords = ['next','loop'];
|
||||||
|
|
||||||
var operatorKeywords = ['and', 'or', 'not', 'xor', 'in'];
|
var operatorKeywords = ['and', "andalso", 'or', 'orelse', 'xor', 'in', 'not', 'is', 'isnot', 'like'];
|
||||||
var wordOperators = wordRegexp(operatorKeywords);
|
var wordOperators = wordRegexp(operatorKeywords);
|
||||||
var commonKeywords = ['as', 'dim', 'break', 'continue','optional', 'then', 'until',
|
|
||||||
'goto', 'byval','byref','new','handles','property', 'return',
|
var commonKeywords = ["#const", "#else", "#elseif", "#end", "#if", "#region", "addhandler", "addressof", "alias", "as", "byref", "byval", "cbool", "cbyte", "cchar", "cdate", "cdbl", "cdec", "cint", "clng", "cobj", "compare", "const", "continue", "csbyte", "cshort", "csng", "cstr", "cuint", "culng", "cushort", "declare", "default", "delegate", "dim", "directcast", "each", "erase", "error", "event", "exit", "explicit", "false", "for", "friend", "gettype", "goto", "handles", "implements", "imports", "infer", "inherits", "interface", "isfalse", "istrue", "lib", "me", "mod", "mustinherit", "mustoverride", "my", "mybase", "myclass", "namespace", "narrowing", "new", "nothing", "notinheritable", "notoverridable", "of", "off", "on", "operator", "option", "optional", "out", "overloads", "overridable", "overrides", "paramarray", "partial", "private", "protected", "public", "raiseevent", "readonly", "redim", "removehandler", "resume", "return", "shadows", "shared", "static", "step", "stop", "strict", "then", "throw", "to", "true", "trycast", "typeof", "until", "until", "when", "widening", "withevents", "writeonly"];
|
||||||
'const','private', 'protected', 'friend', 'public', 'shared', 'static', 'true','false'];
|
|
||||||
var commontypes = ['integer','string','double','decimal','boolean','short','char', 'float','single'];
|
var commontypes = ['object', 'boolean', 'char', 'string', 'byte', 'sbyte', 'short', 'ushort', 'int16', 'uint16', 'integer', 'uinteger', 'int32', 'uint32', 'long', 'ulong', 'int64', 'uint64', 'decimal', 'single', 'double', 'float', 'date', 'datetime', 'intptr', 'uintptr'];
|
||||||
|
|
||||||
var keywords = wordRegexp(commonKeywords);
|
var keywords = wordRegexp(commonKeywords);
|
||||||
var types = wordRegexp(commontypes);
|
var types = wordRegexp(commontypes);
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<link rel="stylesheet" href="../../lib/codemirror.css">
|
<link rel="stylesheet" href="../../lib/codemirror.css">
|
||||||
<script src="../../lib/codemirror.js"></script>
|
<script src="../../lib/codemirror.js"></script>
|
||||||
<script src="vbscript.js"></script>
|
<script src="vbscript.js"></script>
|
||||||
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
||||||
<div id=nav>
|
<div id=nav>
|
||||||
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
||||||
|
|
||||||
|
2
libraries/codemirror/mode/verilog/index.html
vendored
2
libraries/codemirror/mode/verilog/index.html
vendored
@ -8,7 +8,7 @@
|
|||||||
<script src="../../lib/codemirror.js"></script>
|
<script src="../../lib/codemirror.js"></script>
|
||||||
<script src="../../addon/edit/matchbrackets.js"></script>
|
<script src="../../addon/edit/matchbrackets.js"></script>
|
||||||
<script src="verilog.js"></script>
|
<script src="verilog.js"></script>
|
||||||
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
||||||
<div id=nav>
|
<div id=nav>
|
||||||
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
||||||
|
|
||||||
|
2
libraries/codemirror/mode/vhdl/index.html
vendored
2
libraries/codemirror/mode/vhdl/index.html
vendored
@ -8,7 +8,7 @@
|
|||||||
<script src="../../lib/codemirror.js"></script>
|
<script src="../../lib/codemirror.js"></script>
|
||||||
<script src="../../addon/edit/matchbrackets.js"></script>
|
<script src="../../addon/edit/matchbrackets.js"></script>
|
||||||
<script src="vhdl.js"></script>
|
<script src="vhdl.js"></script>
|
||||||
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
||||||
<div id=nav>
|
<div id=nav>
|
||||||
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
||||||
|
|
||||||
|
2
libraries/codemirror/mode/webidl/index.html
vendored
2
libraries/codemirror/mode/webidl/index.html
vendored
@ -7,7 +7,7 @@
|
|||||||
<script src="../../lib/codemirror.js"></script>
|
<script src="../../lib/codemirror.js"></script>
|
||||||
<script src="../../addon/edit/matchbrackets.js"></script>
|
<script src="../../addon/edit/matchbrackets.js"></script>
|
||||||
<script src="webidl.js"></script>
|
<script src="webidl.js"></script>
|
||||||
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
||||||
|
|
||||||
<div id="nav">
|
<div id="nav">
|
||||||
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id="logo" src="../../doc/logo.png"></a>
|
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id="logo" src="../../doc/logo.png"></a>
|
||||||
|
2
libraries/codemirror/mode/xml/index.html
vendored
2
libraries/codemirror/mode/xml/index.html
vendored
@ -7,7 +7,7 @@
|
|||||||
<link rel="stylesheet" href="../../lib/codemirror.css">
|
<link rel="stylesheet" href="../../lib/codemirror.css">
|
||||||
<script src="../../lib/codemirror.js"></script>
|
<script src="../../lib/codemirror.js"></script>
|
||||||
<script src="xml.js"></script>
|
<script src="xml.js"></script>
|
||||||
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
||||||
<div id=nav>
|
<div id=nav>
|
||||||
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
||||||
|
|
||||||
|
2
libraries/codemirror/mode/xquery/index.html
vendored
2
libraries/codemirror/mode/xquery/index.html
vendored
@ -9,7 +9,7 @@
|
|||||||
<script src="../../lib/codemirror.js"></script>
|
<script src="../../lib/codemirror.js"></script>
|
||||||
<script src="../../addon/edit/matchbrackets.js"></script>
|
<script src="../../addon/edit/matchbrackets.js"></script>
|
||||||
<script src="xquery.js"></script>
|
<script src="xquery.js"></script>
|
||||||
<style type="text/css">
|
<style>
|
||||||
.CodeMirror {
|
.CodeMirror {
|
||||||
border-top: 1px solid black; border-bottom: 1px solid black;
|
border-top: 1px solid black; border-bottom: 1px solid black;
|
||||||
height:400px;
|
height:400px;
|
||||||
|
2
libraries/codemirror/mode/z80/index.html
vendored
2
libraries/codemirror/mode/z80/index.html
vendored
@ -7,7 +7,7 @@
|
|||||||
<link rel="stylesheet" href="../../lib/codemirror.css">
|
<link rel="stylesheet" href="../../lib/codemirror.css">
|
||||||
<script src="../../lib/codemirror.js"></script>
|
<script src="../../lib/codemirror.js"></script>
|
||||||
<script src="z80.js"></script>
|
<script src="z80.js"></script>
|
||||||
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
||||||
<div id=nav>
|
<div id=nav>
|
||||||
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
<a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user