diff options
author | Kristóf Marussy <kristof@marussy.com> | 2021-11-05 18:47:40 +0100 |
---|---|---|
committer | Kristóf Marussy <kristof@marussy.com> | 2021-11-05 18:47:40 +0100 |
commit | c5a6471251fd8728089d22dc1b0f0615af92c396 (patch) | |
tree | 5e715ab696cfd3c6716228927cefb25cfad3121e | |
parent | feat(lang): add example validation checks (diff) | |
download | refinery-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.grammar | 4 | ||||
-rw-r--r-- | language/src/main/java/tools/refinery/language/Problem.xtext | 6 |
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 | ||
156 | TypeScope: | 156 | TypeScope: |
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 | ||
185 | Identifier: | 185 | Identifier: |
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 | ||
189 | Integer returns ecore::EInt hidden(): | 189 | Integer returns ecore::EInt hidden(): |
190 | "-"? INT; | 190 | "-"? INT; |