diff options
Diffstat (limited to 'subprojects/frontend/src/language')
-rw-r--r-- | subprojects/frontend/src/language/problem.grammar | 13 | ||||
-rw-r--r-- | subprojects/frontend/src/language/problemLanguageSupport.ts | 11 |
2 files changed, 15 insertions, 9 deletions
diff --git a/subprojects/frontend/src/language/problem.grammar b/subprojects/frontend/src/language/problem.grammar index ce3baa02..b08a9c36 100644 --- a/subprojects/frontend/src/language/problem.grammar +++ b/subprojects/frontend/src/language/problem.grammar | |||
@@ -28,7 +28,7 @@ statement { | |||
28 | (":" Expr)? "." | 28 | (":" Expr)? "." |
29 | } | | 29 | } | |
30 | ProblemDeclaration { | 30 | ProblemDeclaration { |
31 | kw<"problem"> QualifiedName "." | 31 | (ckw<"module"> | kw<"problem">) QualifiedName "." |
32 | } | | 32 | } | |
33 | ClassDefinition { | 33 | ClassDefinition { |
34 | kw<"abstract">? kw<"class"> RelationName | 34 | kw<"abstract">? kw<"class"> RelationName |
@@ -37,7 +37,7 @@ statement { | |||
37 | } | | 37 | } | |
38 | EnumDefinition { | 38 | EnumDefinition { |
39 | kw<"enum"> RelationName | 39 | kw<"enum"> RelationName |
40 | (EnumBody { "{" sep<",", IndividualNodeName> "}" } | ".") | 40 | (EnumBody { "{" sep<",", AtomNodeName> "}" } | ".") |
41 | } | | 41 | } | |
42 | PredicateDefinition { | 42 | PredicateDefinition { |
43 | ( | 43 | ( |
@@ -56,8 +56,11 @@ statement { | |||
56 | // RuleName ParameterList<Parameter>? | 56 | // RuleName ParameterList<Parameter>? |
57 | // RuleBody { ":" sep<OrOp, Conjunction> "==>" sep<OrOp, Consequent> "." } | 57 | // RuleBody { ":" sep<OrOp, Conjunction> "==>" sep<OrOp, Consequent> "." } |
58 | //} | | 58 | //} | |
59 | IndividualDeclaration { | 59 | AtomDeclaration { |
60 | kw<"indiv"> sep<",", IndividualNodeName> "." | 60 | ckw<"atom"> sep<",", AtomNodeName> "." |
61 | } | | ||
62 | NodeDeclaration { | ||
63 | (ckw<"node"> | ckw<"multi">) sep<",", NodeName> "." | ||
61 | } | | 64 | } | |
62 | ScopeDeclaration { | 65 | ScopeDeclaration { |
63 | kw<"scope"> sep<",", ScopeElement> "." | 66 | kw<"scope"> sep<",", ScopeElement> "." |
@@ -161,7 +164,7 @@ RelationName { QualifiedName ~name } | |||
161 | 164 | ||
162 | //RuleName { QualifiedName } | 165 | //RuleName { QualifiedName } |
163 | 166 | ||
164 | IndividualNodeName { QualifiedName } | 167 | AtomNodeName { QualifiedName } |
165 | 168 | ||
166 | VariableName[@dynamicPrecedence=10] { QualifiedName ~name } | 169 | VariableName[@dynamicPrecedence=10] { QualifiedName ~name } |
167 | 170 | ||
diff --git a/subprojects/frontend/src/language/problemLanguageSupport.ts b/subprojects/frontend/src/language/problemLanguageSupport.ts index 2121e05f..3847fdd8 100644 --- a/subprojects/frontend/src/language/problemLanguageSupport.ts +++ b/subprojects/frontend/src/language/problemLanguageSupport.ts | |||
@@ -27,7 +27,8 @@ const parserWithMetadata = parser.configure({ | |||
27 | styleTags({ | 27 | styleTags({ |
28 | LineComment: t.lineComment, | 28 | LineComment: t.lineComment, |
29 | BlockComment: t.blockComment, | 29 | BlockComment: t.blockComment, |
30 | 'problem class enum pred fn indiv scope': t.definitionKeyword, | 30 | 'module problem class enum pred fn scope': t.definitionKeyword, |
31 | 'node atom multi': t.definitionKeyword, | ||
31 | 'abstract extends refers contains container opposite': t.modifier, | 32 | 'abstract extends refers contains container opposite': t.modifier, |
32 | 'default error contained containment': t.modifier, | 33 | 'default error contained containment': t.modifier, |
33 | 'true false unknown error': t.keyword, | 34 | 'true false unknown error': t.keyword, |
@@ -44,7 +45,7 @@ const parserWithMetadata = parser.configure({ | |||
44 | String: t.string, | 45 | String: t.string, |
45 | 'RelationName/QualifiedName': t.typeName, | 46 | 'RelationName/QualifiedName': t.typeName, |
46 | // 'RuleName/QualifiedName': t.typeName, | 47 | // 'RuleName/QualifiedName': t.typeName, |
47 | 'IndividualNodeName/QualifiedName': t.atom, | 48 | 'AtomNodeName/QualifiedName': t.atom, |
48 | 'VariableName/QualifiedName': t.variableName, | 49 | 'VariableName/QualifiedName': t.variableName, |
49 | '{ }': t.brace, | 50 | '{ }': t.brace, |
50 | '( )': t.paren, | 51 | '( )': t.paren, |
@@ -54,7 +55,8 @@ const parserWithMetadata = parser.configure({ | |||
54 | }), | 55 | }), |
55 | indentNodeProp.add({ | 56 | indentNodeProp.add({ |
56 | ProblemDeclaration: indentDeclaration, | 57 | ProblemDeclaration: indentDeclaration, |
57 | UniqueDeclaration: indentDeclaration, | 58 | AtomDeclaration: indentDeclaration, |
59 | NodeDeclaration: indentDeclaration, | ||
58 | ScopeDeclaration: indentDeclaration, | 60 | ScopeDeclaration: indentDeclaration, |
59 | PredicateBody: indentPredicateOrRule, | 61 | PredicateBody: indentPredicateOrRule, |
60 | FunctionBody: indentPredicateOrRule, | 62 | FunctionBody: indentPredicateOrRule, |
@@ -70,7 +72,8 @@ const parserWithMetadata = parser.configure({ | |||
70 | // RuleBody: foldInside, | 72 | // RuleBody: foldInside, |
71 | Conjunction: foldConjunction, | 73 | Conjunction: foldConjunction, |
72 | // Consequent: foldWholeNode, | 74 | // Consequent: foldWholeNode, |
73 | UniqueDeclaration: foldDeclaration, | 75 | AtomDeclaration: foldDeclaration, |
76 | NodeDeclaration: foldDeclaration, | ||
74 | ScopeDeclaration: foldDeclaration, | 77 | ScopeDeclaration: foldDeclaration, |
75 | BlockComment: foldBlockComment, | 78 | BlockComment: foldBlockComment, |
76 | }), | 79 | }), |