1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
define(["codemirror", "codemirror/addon/mode/simple"], function(CodeMirror, SimpleMode) {
var keywords = "abstract|class|contains|error|extends|false|opposite|pred|refers|scope|true|unknown";
CodeMirror.defineSimpleMode("xtext/problem", {
start: [
{token: "comment", regex: "\\/\\/.*$"},
{token: "comment", regex: "\\/\\*", next : "comment"},
{token: "string", regex: '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},
{token: "string", regex: "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},
{token: "constant.numeric", regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},
{token: "lparen", regex: "[\\[(]"},
{token: "rparen", regex: "[\\])]"},
{token: "keyword", regex: "\\b(?:" + keywords + ")\\b"}
],
comment: [
{token: "comment", regex: ".*?\\*\\/", next : "start"},
{token: "comment", regex: ".+"}
],
meta: {
dontIndentStates: ["comment"],
lineComment: "//"
}
});
});
|