diff options
author | 2021-06-27 23:21:42 +0200 | |
---|---|---|
committer | 2021-06-27 23:30:25 +0200 | |
commit | 7febe0b4781c5bb0fab34895ad642040ae143a8b (patch) | |
tree | 5bc49f9195b18a938382f2527ee4ab273527a07a /language-mwe2/src/main/java/org/eclipse/viatra/solver/language/mwe2 | |
parent | Electric semicolons (diff) | |
download | refinery-7febe0b4781c5bb0fab34895ad642040ae143a8b.tar.gz refinery-7febe0b4781c5bb0fab34895ad642040ae143a8b.tar.zst refinery-7febe0b4781c5bb0fab34895ad642040ae143a8b.zip |
Add data constant support
Diffstat (limited to 'language-mwe2/src/main/java/org/eclipse/viatra/solver/language/mwe2')
-rw-r--r-- | language-mwe2/src/main/java/org/eclipse/viatra/solver/language/mwe2/ProblemWebIntegrationFragment.java | 4 |
1 files changed, 3 insertions, 1 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 c8a2c58c..18e13245 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 | |||
@@ -9,6 +9,8 @@ import com.google.common.collect.Multimap; | |||
9 | public class ProblemWebIntegrationFragment extends WebIntegrationFragment { | 9 | public class ProblemWebIntegrationFragment extends WebIntegrationFragment { |
10 | public ProblemWebIntegrationFragment() { | 10 | public ProblemWebIntegrationFragment() { |
11 | setFramework(Framework.CODEMIRROR.name()); | 11 | setFramework(Framework.CODEMIRROR.name()); |
12 | // The exponential operators e and E are not keywords | ||
13 | setKeywordsFilter("[^eE]|\\w\\w+"); | ||
12 | // We use our custom token style for single-quoted names | 14 | // We use our custom token style for single-quoted names |
13 | addSuppressPattern("string_singleQuote"); | 15 | addSuppressPattern("string_singleQuote"); |
14 | // 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 |
@@ -47,7 +49,7 @@ public class ProblemWebIntegrationFragment extends WebIntegrationFragment { | |||
47 | patterns.put("meta", "lineComment: \"%\""); | 49 | patterns.put("meta", "lineComment: \"%\""); |
48 | // Override indentation behavior | 50 | // Override indentation behavior |
49 | patterns.put("start", "{token: \"lparen\", indent: true, regex: \"[[({]\"}"); | 51 | patterns.put("start", "{token: \"lparen\", indent: true, regex: \"[[({]\"}"); |
50 | patterns.put("start", "{token: \"rparen\", dedent: true, dedentIfLineStart: true, regex: \"[\\\\])}]\"}"); | 52 | patterns.put("start", "{token: \"rparen\", dedent: true, regex: \"[\\\\])}]\"}"); |
51 | patterns.putAll("predicateBody", patterns.get("start")); | 53 | patterns.putAll("predicateBody", patterns.get("start")); |
52 | patterns.put("start", "{indent: true, push: \"predicateBody\", regex: \":-\"}"); | 54 | patterns.put("start", "{indent: true, push: \"predicateBody\", regex: \":-\"}"); |
53 | patterns.put("predicateBody", "{dedent: true, dedentIfLineStart: false, pop: true, regex: \"\\\\.\\\\s*$\"}"); | 55 | patterns.put("predicateBody", "{dedent: true, dedentIfLineStart: false, pop: true, regex: \"\\\\.\\\\s*$\"}"); |