aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Kristóf Marussy <kristof@marussy.com>2021-11-05 18:47:40 +0100
committerLibravatar Kristóf Marussy <kristof@marussy.com>2021-11-05 18:47:40 +0100
commitc5a6471251fd8728089d22dc1b0f0615af92c396 (patch)
tree5e715ab696cfd3c6716228927cefb25cfad3121e
parentfeat(lang): add example validation checks (diff)
downloadrefinery-c5a6471251fd8728089d22dc1b0f0615af92c396.tar.gz
refinery-c5a6471251fd8728089d22dc1b0f0615af92c396.tar.zst
refinery-c5a6471251fd8728089d22dc1b0f0615af92c396.zip
fix(lang): make default and scope non-contextual
Contextual keywords make Xtext parsing more complicated and degrade content assist.
-rw-r--r--language-web/src/main/js/language/problem.grammar4
-rw-r--r--language/src/main/java/tools/refinery/language/Problem.xtext6
2 files changed, 5 insertions, 5 deletions
diff --git a/language-web/src/main/js/language/problem.grammar b/language-web/src/main/js/language/problem.grammar
index c242a4ba..86cc7722 100644
--- a/language-web/src/main/js/language/problem.grammar
+++ b/language-web/src/main/js/language/problem.grammar
@@ -24,7 +24,7 @@ statement {
24 RuleBody { ":" sep<OrOp, Conjunction> "~>" sep<OrOp, Action> "." } 24 RuleBody { ":" sep<OrOp, Conjunction> "~>" sep<OrOp, Action> "." }
25 } | 25 } |
26 Assertion { 26 Assertion {
27 ckw<"default">? (NotOp | UnknownOp)? RelationName 27 kw<"default">? (NotOp | UnknownOp)? RelationName
28 ParameterList<AssertionArgument> (":" LogicValue)? "." 28 ParameterList<AssertionArgument> (":" LogicValue)? "."
29 } | 29 } |
30 NodeValueAssertion { 30 NodeValueAssertion {
@@ -34,7 +34,7 @@ statement {
34 ckw<"unique"> sep<",", UniqueNodeName> "." 34 ckw<"unique"> sep<",", UniqueNodeName> "."
35 } | 35 } |
36 ScopeDeclaration { 36 ScopeDeclaration {
37 ckw<"scope"> sep<",", ScopeElement> "." 37 kw<"scope"> sep<",", ScopeElement> "."
38 } 38 }
39} 39}
40 40
diff --git a/language/src/main/java/tools/refinery/language/Problem.xtext b/language/src/main/java/tools/refinery/language/Problem.xtext
index 6f6a8588..0fa47d63 100644
--- a/language/src/main/java/tools/refinery/language/Problem.xtext
+++ b/language/src/main/java/tools/refinery/language/Problem.xtext
@@ -154,7 +154,7 @@ ScopeDeclaration:
154 "scope" typeScopes+=TypeScope ("," typeScopes+=TypeScope)* "."; 154 "scope" typeScopes+=TypeScope ("," typeScopes+=TypeScope)* ".";
155 155
156TypeScope: 156TypeScope:
157 targetType=[ClassDeclaration] 157 targetType=[ClassDeclaration|QualifiedName]
158 (increment?="+=" | "=") 158 (increment?="+=" | "=")
159 multiplicity=DefiniteMultiplicity; 159 multiplicity=DefiniteMultiplicity;
160 160
@@ -183,8 +183,8 @@ QualifiedName hidden():
183 Identifier ("::" Identifier)*; 183 Identifier ("::" Identifier)*;
184 184
185Identifier: 185Identifier:
186 ID | "true" | "false" | "unknown" | "error" | "class" | "abstract" | "extends" | "enum" | "pred" | "scope" | 186 ID | "true" | "false" | "unknown" | "error" | "class" | "abstract" | "extends" | "enum" | "pred" |
187 "unique" | "default" | "problem" | "new" | "delete"; 187 "unique" | "problem" | "new" | "delete";
188 188
189Integer returns ecore::EInt hidden(): 189Integer returns ecore::EInt hidden():
190 "-"? INT; 190 "-"? INT;