diff options
author | 2021-06-27 17:59:54 +0200 | |
---|---|---|
committer | 2021-06-27 18:09:46 +0200 | |
commit | 5785f36b17d2b290d88c05fee54e39060a07b6d4 (patch) | |
tree | 31f4f319b493d6f29e13ef63fe46eb18935178b5 /language-web/src/main/webapp/xtext-resources | |
parent | Fix running outside of Eclipse (diff) | |
download | refinery-5785f36b17d2b290d88c05fee54e39060a07b6d4.tar.gz refinery-5785f36b17d2b290d88c05fee54e39060a07b6d4.tar.zst refinery-5785f36b17d2b290d88c05fee54e39060a07b6d4.zip |
Customize client-side CodeMirror mode
Diffstat (limited to 'language-web/src/main/webapp/xtext-resources')
-rw-r--r-- | language-web/src/main/webapp/xtext-resources/generated/mode-problem.js | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/language-web/src/main/webapp/xtext-resources/generated/mode-problem.js b/language-web/src/main/webapp/xtext-resources/generated/mode-problem.js index 89373b1c..1640d13d 100644 --- a/language-web/src/main/webapp/xtext-resources/generated/mode-problem.js +++ b/language-web/src/main/webapp/xtext-resources/generated/mode-problem.js | |||
@@ -2,12 +2,16 @@ define(["codemirror", "codemirror/addon/mode/simple"], function(CodeMirror, Simp | |||
2 | var keywords = "abstract|class|contains|enum|error|extends|false|opposite|pred|problem|refers|scope|true|unknown"; | 2 | var keywords = "abstract|class|contains|enum|error|extends|false|opposite|pred|problem|refers|scope|true|unknown"; |
3 | CodeMirror.defineSimpleMode("xtext/problem", { | 3 | CodeMirror.defineSimpleMode("xtext/problem", { |
4 | start: [ | 4 | start: [ |
5 | {token: "comment", regex: "\\/\\/.*$"}, | ||
6 | {token: "comment", regex: "\\/\\*", next : "comment"}, | 5 | {token: "comment", regex: "\\/\\*", next : "comment"}, |
7 | {token: "string", regex: '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'}, | 6 | {token: "string", regex: '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'}, |
8 | {token: "constant.numeric", regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"}, | 7 | {token: "quoted-name", regex: "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"}, |
9 | {token: "lparen", regex: "[\\[({]"}, | 8 | {token: "number", regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"}, |
10 | {token: "rparen", regex: "[\\])}]"}, | 9 | {token: "number", regex: "[*]"}, |
10 | {token: "comment", regex: "%.*$"}, | ||
11 | {token: "comment", regex: "\\/\\/.*$"}, | ||
12 | {token: "lparen", indent: true, regex: "[[({]"}, | ||
13 | {token: "rparen", dedent: true, dedentIfLineStart: true, regex: "[\\])}]"}, | ||
14 | {indent: true, push: "predicateBody", regex: ":-"}, | ||
11 | {token: "keyword", regex: "\\b(?:" + keywords + ")\\b"} | 15 | {token: "keyword", regex: "\\b(?:" + keywords + ")\\b"} |
12 | ], | 16 | ], |
13 | comment: [ | 17 | comment: [ |
@@ -16,7 +20,21 @@ define(["codemirror", "codemirror/addon/mode/simple"], function(CodeMirror, Simp | |||
16 | ], | 20 | ], |
17 | meta: { | 21 | meta: { |
18 | dontIndentStates: ["comment"], | 22 | dontIndentStates: ["comment"], |
19 | lineComment: "//" | 23 | lineComment: "%", |
20 | } | 24 | electricChars: "])]" |
25 | }, | ||
26 | predicateBody: [ | ||
27 | {token: "comment", regex: "\\/\\*", next : "comment"}, | ||
28 | {token: "string", regex: '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'}, | ||
29 | {token: "quoted-name", regex: "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"}, | ||
30 | {token: "number", regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"}, | ||
31 | {token: "number", regex: "[*]"}, | ||
32 | {token: "comment", regex: "%.*$"}, | ||
33 | {token: "comment", regex: "\\/\\/.*$"}, | ||
34 | {token: "lparen", indent: true, regex: "[[({]"}, | ||
35 | {token: "rparen", dedent: true, dedentIfLineStart: true, regex: "[\\])}]"}, | ||
36 | {dedent: true, dedentIfLineStart: false, pop: true, regex: "\\.\\s*$"}, | ||
37 | {token: "keyword", regex: "\\b(?:" + keywords + ")\\b"} | ||
38 | ] | ||
21 | }); | 39 | }); |
22 | }); | 40 | }); |