diff options
Diffstat (limited to 'language-mwe2/src/main/java/org/eclipse/viatra/solver')
-rw-r--r-- | language-mwe2/src/main/java/org/eclipse/viatra/solver/language/mwe2/ProblemWebIntegrationFragment.java | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/language-mwe2/src/main/java/org/eclipse/viatra/solver/language/mwe2/ProblemWebIntegrationFragment.java b/language-mwe2/src/main/java/org/eclipse/viatra/solver/language/mwe2/ProblemWebIntegrationFragment.java index 78311e0d..8a2c6538 100644 --- a/language-mwe2/src/main/java/org/eclipse/viatra/solver/language/mwe2/ProblemWebIntegrationFragment.java +++ b/language-mwe2/src/main/java/org/eclipse/viatra/solver/language/mwe2/ProblemWebIntegrationFragment.java | |||
@@ -13,8 +13,6 @@ public class ProblemWebIntegrationFragment extends WebIntegrationFragment { | |||
13 | 13 | ||
14 | public ProblemWebIntegrationFragment() { | 14 | public ProblemWebIntegrationFragment() { |
15 | setFramework(Framework.CODEMIRROR.name()); | 15 | setFramework(Framework.CODEMIRROR.name()); |
16 | // We use our custom token style for single-quoted names | ||
17 | addSuppressPattern("string_singleQuote"); | ||
18 | // Use the CodeMirror default .cm-number instead of .cm-constant.cm-numeric | 16 | // Use the CodeMirror default .cm-number instead of .cm-constant.cm-numeric |
19 | addSuppressPattern("number_decimal"); | 17 | addSuppressPattern("number_decimal"); |
20 | // We use our own custom single-line comments | 18 | // We use our own custom single-line comments |
@@ -39,12 +37,9 @@ public class ProblemWebIntegrationFragment extends WebIntegrationFragment { | |||
39 | @Override | 37 | @Override |
40 | protected Multimap<String, String> createCodeMirrorPatterns(String langId, Set<String> keywords) { | 38 | protected Multimap<String, String> createCodeMirrorPatterns(String langId, Set<String> keywords) { |
41 | Multimap<String, String> patterns = super.createCodeMirrorPatterns(langId, keywords); | 39 | Multimap<String, String> patterns = super.createCodeMirrorPatterns(langId, keywords); |
42 | // We use our custom token style for single-quoted names | ||
43 | patterns.put(START_STATE, "{token: \"quoted-name\", regex: \"['](?:(?:\\\\\\\\.)|(?:[^'\\\\\\\\]))*?[']\"}"); | ||
44 | // Use the CodeMirror default .cm-number instead of .cm-constant.cm-numeric | 40 | // Use the CodeMirror default .cm-number instead of .cm-constant.cm-numeric |
45 | patterns.put(START_STATE, | 41 | patterns.put(START_STATE, |
46 | "{token: \"number\", regex: \"[+-]?\\\\d+(?:(?:\\\\.\\\\d*)?(?:[eE][+-]?\\\\d+)?)?\\\\b\"}"); | 42 | "{token: \"number\", regex: \"[+-]?\\\\d+(?:(?:\\\\.\\\\d*)?(?:[eE][+-]?\\\\d+)?)?\\\\b\"}"); |
47 | patterns.put(START_STATE, "{token: \"number\", regex: \"[*]\"}"); | ||
48 | // We use our own custom single-line comments | 43 | // We use our own custom single-line comments |
49 | patterns.put(START_STATE, "{token: \"comment\", regex: \"%.*$\"}"); | 44 | patterns.put(START_STATE, "{token: \"comment\", regex: \"%.*$\"}"); |
50 | patterns.put(START_STATE, "{token: \"comment\", regex: \"\\\\/\\\\/.*$\"}"); | 45 | patterns.put(START_STATE, "{token: \"comment\", regex: \"\\\\/\\\\/.*$\"}"); |
@@ -53,7 +48,7 @@ public class ProblemWebIntegrationFragment extends WebIntegrationFragment { | |||
53 | patterns.put(START_STATE, "{token: \"lparen\", indent: true, regex: \"[[({]\"}"); | 48 | patterns.put(START_STATE, "{token: \"lparen\", indent: true, regex: \"[[({]\"}"); |
54 | patterns.put(START_STATE, "{token: \"rparen\", dedent: true, regex: \"[\\\\])}]\"}"); | 49 | patterns.put(START_STATE, "{token: \"rparen\", dedent: true, regex: \"[\\\\])}]\"}"); |
55 | patterns.putAll(PREDICATE_BODY_STATE, patterns.get(START_STATE)); | 50 | patterns.putAll(PREDICATE_BODY_STATE, patterns.get(START_STATE)); |
56 | patterns.put(START_STATE, "{indent: true, push: \"" + PREDICATE_BODY_STATE + "\", regex: \"<=>\"}"); | 51 | patterns.put(START_STATE, "{indent: true, push: \"" + PREDICATE_BODY_STATE + "\", regex: \"<->\"}"); |
57 | patterns.put(PREDICATE_BODY_STATE, | 52 | patterns.put(PREDICATE_BODY_STATE, |
58 | "{dedent: true, dedentIfLineStart: false, pop: true, regex: \"\\\\.\\\\s*$\"}"); | 53 | "{dedent: true, dedentIfLineStart: false, pop: true, regex: \"\\\\.\\\\s*$\"}"); |
59 | patterns.put(PREDICATE_BODY_STATE, "{indent: true, dedent: true, regex: \"[;]\"}"); | 54 | patterns.put(PREDICATE_BODY_STATE, "{indent: true, dedent: true, regex: \"[;]\"}"); |