diff options
author | 2021-11-06 16:39:42 +0100 | |
---|---|---|
committer | 2021-11-06 16:39:42 +0100 | |
commit | 6b7075eccf7ddaccc797ffbdd855dd4b0bbad0d4 (patch) | |
tree | 013f3cc4e43ce06ff508592d4c1d7b08ef4beb0d /language/src | |
parent | fix(lang): mark transient references (diff) | |
download | refinery-6b7075eccf7ddaccc797ffbdd855dd4b0bbad0d4.tar.gz refinery-6b7075eccf7ddaccc797ffbdd855dd4b0bbad0d4.tar.zst refinery-6b7075eccf7ddaccc797ffbdd855dd4b0bbad0d4.zip |
chore(lang): shorten keyword individual -> indiv
Diffstat (limited to 'language/src')
5 files changed, 8 insertions, 8 deletions
diff --git a/language/src/main/java/tools/refinery/language/Problem.xtext b/language/src/main/java/tools/refinery/language/Problem.xtext index b7562759..e2723b55 100644 --- a/language/src/main/java/tools/refinery/language/Problem.xtext +++ b/language/src/main/java/tools/refinery/language/Problem.xtext | |||
@@ -174,7 +174,7 @@ ExactMultiplicity: | |||
174 | exactValue=INT; | 174 | exactValue=INT; |
175 | 175 | ||
176 | IndividualDeclaration: | 176 | IndividualDeclaration: |
177 | "individual" nodes+=EnumLiteral ("," nodes+=EnumLiteral)* "."; | 177 | "indiv" nodes+=EnumLiteral ("," nodes+=EnumLiteral)* "."; |
178 | 178 | ||
179 | UpperBound returns ecore::EInt: | 179 | UpperBound returns ecore::EInt: |
180 | INT | "*"; | 180 | INT | "*"; |
@@ -184,7 +184,7 @@ QualifiedName hidden(): | |||
184 | 184 | ||
185 | Identifier: | 185 | Identifier: |
186 | ID | "true" | "false" | "unknown" | "error" | "class" | "abstract" | "extends" | "enum" | "pred" | | 186 | ID | "true" | "false" | "unknown" | "error" | "class" | "abstract" | "extends" | "enum" | "pred" | |
187 | "individual" | "problem" | "new" | "delete" | "direct" | "rule"; | 187 | "indiv" | "problem" | "new" | "delete" | "direct" | "rule"; |
188 | 188 | ||
189 | Integer returns ecore::EInt hidden(): | 189 | Integer returns ecore::EInt hidden(): |
190 | "-"? INT; | 190 | "-"? INT; |
diff --git a/language/src/main/java/tools/refinery/language/validation/ProblemValidator.java b/language/src/main/java/tools/refinery/language/validation/ProblemValidator.java index 3c10d39e..975fdca2 100644 --- a/language/src/main/java/tools/refinery/language/validation/ProblemValidator.java +++ b/language/src/main/java/tools/refinery/language/validation/ProblemValidator.java | |||
@@ -53,7 +53,7 @@ public class ProblemValidator extends AbstractProblemValidator { | |||
53 | var variableOrNode = argument.getVariableOrNode(); | 53 | var variableOrNode = argument.getVariableOrNode(); |
54 | if (variableOrNode instanceof Node node && !ProblemUtil.isIndividualNode(node)) { | 54 | if (variableOrNode instanceof Node node && !ProblemUtil.isIndividualNode(node)) { |
55 | var name = node.getName(); | 55 | var name = node.getName(); |
56 | var message = "Only individual nodes can be referenced in predicates. Mark '%s' as individual with the declaration 'individual %s.'" | 56 | var message = "Only individual nodes can be referenced in predicates. Mark '%s' as individual with the declaration 'indiv %s.'" |
57 | .formatted(name, name); | 57 | .formatted(name, name); |
58 | error(message, argument, ProblemPackage.Literals.VARIABLE_OR_NODE_ARGUMENT__VARIABLE_OR_NODE, | 58 | error(message, argument, ProblemPackage.Literals.VARIABLE_OR_NODE_ARGUMENT__VARIABLE_OR_NODE, |
59 | INSIGNIFICANT_INDEX, NON_INDIVIDUAL_NODE_ISSUE); | 59 | INSIGNIFICANT_INDEX, NON_INDIVIDUAL_NODE_ISSUE); |
diff --git a/language/src/test/java/tools/refinery/language/tests/ProblemParsingTest.xtend b/language/src/test/java/tools/refinery/language/tests/ProblemParsingTest.xtend index 9e357529..53d31a6c 100644 --- a/language/src/test/java/tools/refinery/language/tests/ProblemParsingTest.xtend +++ b/language/src/test/java/tools/refinery/language/tests/ProblemParsingTest.xtend | |||
@@ -46,7 +46,7 @@ class ProblemParsingTest { | |||
46 | error invalidTaxStatus(Person p) <-> | 46 | error invalidTaxStatus(Person p) <-> |
47 | taxStatus(p, child), children(p, _q). | 47 | taxStatus(p, child), children(p, _q). |
48 | 48 | ||
49 | individual family. | 49 | indiv family. |
50 | Family(family). | 50 | Family(family). |
51 | members(family, anne): true. | 51 | members(family, anne): true. |
52 | members(family, bob). | 52 | members(family, bob). |
diff --git a/language/src/test/java/tools/refinery/language/tests/scoping/NodeScopingTest.xtend b/language/src/test/java/tools/refinery/language/tests/scoping/NodeScopingTest.xtend index 5f669847..3a046341 100644 --- a/language/src/test/java/tools/refinery/language/tests/scoping/NodeScopingTest.xtend +++ b/language/src/test/java/tools/refinery/language/tests/scoping/NodeScopingTest.xtend | |||
@@ -81,7 +81,7 @@ class NodeScopingTest { | |||
81 | def void individualNodeInAssertionTest(String qualifiedNamePrefix, boolean namedProblem) { | 81 | def void individualNodeInAssertionTest(String qualifiedNamePrefix, boolean namedProblem) { |
82 | val it = parseHelper.parse(''' | 82 | val it = parseHelper.parse(''' |
83 | «IF namedProblem»problem test.«ENDIF» | 83 | «IF namedProblem»problem test.«ENDIF» |
84 | individual a, b. | 84 | indiv a, b. |
85 | pred predicate(node x, node y) <-> node(x). | 85 | pred predicate(node x, node y) <-> node(x). |
86 | predicate(«qualifiedNamePrefix»a, «qualifiedNamePrefix»a). | 86 | predicate(«qualifiedNamePrefix»a, «qualifiedNamePrefix»a). |
87 | ?predicate(«qualifiedNamePrefix»a, «qualifiedNamePrefix»b). | 87 | ?predicate(«qualifiedNamePrefix»a, «qualifiedNamePrefix»b). |
@@ -99,7 +99,7 @@ class NodeScopingTest { | |||
99 | def void individualNodeInNodeValueAssertionTest(String qualifiedNamePrefix, boolean namedProblem) { | 99 | def void individualNodeInNodeValueAssertionTest(String qualifiedNamePrefix, boolean namedProblem) { |
100 | val it = parseHelper.parse(''' | 100 | val it = parseHelper.parse(''' |
101 | «IF namedProblem»problem test.«ENDIF» | 101 | «IF namedProblem»problem test.«ENDIF» |
102 | individual a. | 102 | indiv a. |
103 | «qualifiedNamePrefix»a: 16. | 103 | «qualifiedNamePrefix»a: 16. |
104 | ''') | 104 | ''') |
105 | assertThat(errors, empty) | 105 | assertThat(errors, empty) |
@@ -112,7 +112,7 @@ class NodeScopingTest { | |||
112 | def void individualNodeInPredicateTest(String qualifiedNamePrefix, boolean namedProblem) { | 112 | def void individualNodeInPredicateTest(String qualifiedNamePrefix, boolean namedProblem) { |
113 | val it = parseHelper.parse(''' | 113 | val it = parseHelper.parse(''' |
114 | «IF namedProblem»problem test.«ENDIF» | 114 | «IF namedProblem»problem test.«ENDIF» |
115 | individual b. | 115 | indiv b. |
116 | pred predicate(node a) <-> node(«qualifiedNamePrefix»b). | 116 | pred predicate(node a) <-> node(«qualifiedNamePrefix»b). |
117 | ''') | 117 | ''') |
118 | assertThat(errors, empty) | 118 | assertThat(errors, empty) |
diff --git a/language/src/test/java/tools/refinery/language/tests/serializer/ProblemSerializerTest.java b/language/src/test/java/tools/refinery/language/tests/serializer/ProblemSerializerTest.java index 34c1d14b..303da50f 100644 --- a/language/src/test/java/tools/refinery/language/tests/serializer/ProblemSerializerTest.java +++ b/language/src/test/java/tools/refinery/language/tests/serializer/ProblemSerializerTest.java | |||
@@ -74,7 +74,7 @@ public class ProblemSerializerTest { | |||
74 | problem.getStatements().add(individualDeclaration); | 74 | problem.getStatements().add(individualDeclaration); |
75 | createAssertion(pred, node); | 75 | createAssertion(pred, node); |
76 | 76 | ||
77 | assertSerializedResult("pred foo ( node p ) . individual a . foo ( a ) : true ."); | 77 | assertSerializedResult("pred foo ( node p ) . indiv a . foo ( a ) : true ."); |
78 | } | 78 | } |
79 | 79 | ||
80 | private PredicateDefinition createPred() { | 80 | private PredicateDefinition createPred() { |