Skip to content

Commit

Permalink
refactor(language): make opposite and subsets contextual keywords
Browse files Browse the repository at this point in the history
  • Loading branch information
kris7t committed Nov 4, 2024
1 parent d3b7f7b commit 87062fe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions subprojects/frontend/src/language/problem.grammar
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ statement {
PredicateDefinition {
((kw<"error"> | kw<"partial"> | ckw<"shadow">)* kw<"pred"> | kw<"error">)
RelationName ParameterList<Parameter>?
(kw<"subsets"> sep1<",", RelationName>)*
(ckw<"subsets"> sep1<",", RelationName>)*
PredicateBody { ("<->" sep<OrOp, Conjunction>)? "." }
} |
// FunctionDefinition {
Expand Down Expand Up @@ -91,8 +91,10 @@ FeatureDeclaration {
("[" Multiplicity? "]")?
RelationName
(
kw<"opposite"> RelationName |
kw<"subsets"> sep1<",", RelationName>
!feature RelationOptions[@dynamicPrecedence=1] {
ckw<"opposite"> RelationName |
ckw<"subsets"> sep1<",", RelationName>
}
)*
";"?
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ NonContainmentQualifiedName hidden():
(NonContainmentIdentifier | "::" Identifier) (QUALIFIED_NAME_SEPARATOR Identifier)*;

Identifier:
NonContainmentIdentifier | "contains" | "container";
NonContainmentIdentifier | "contains" | "container" | "opposite" | "subsets";

NonContainmentIdentifier:
ID | QUOTED_ID | "atom" | "multi" | "problem" | "module" |
Expand Down

0 comments on commit 87062fe

Please sign in to comment.