diff options
author | 2024-01-31 02:00:09 +0100 | |
---|---|---|
committer | 2024-01-31 18:45:13 +0100 | |
commit | c63126d2f1ce5f571c316b37e00fb43d2da7c7d3 (patch) | |
tree | 16e9dd04624565f7c9ccedd17749a9f264e89cb0 /subprojects/frontend/src/language/problemLanguageSupport.ts | |
parent | fix(build): avoid cyclic dependency (diff) | |
download | refinery-c63126d2f1ce5f571c316b37e00fb43d2da7c7d3.tar.gz refinery-c63126d2f1ce5f571c316b37e00fb43d2da7c7d3.tar.zst refinery-c63126d2f1ce5f571c316b37e00fb43d2da7c7d3.zip |
refactor(language): module and node declarations
* New default file extension: .refinery (.problem is also supported).
* Add module keyword for self-contained modules.
* Rename indiv declarations to atom declaration.
* Add node and multi declarations for explicitly declared nodes and
multi-objects, respectively.
Diffstat (limited to 'subprojects/frontend/src/language/problemLanguageSupport.ts')
-rw-r--r-- | subprojects/frontend/src/language/problemLanguageSupport.ts | 11 |
1 files changed, 7 insertions, 4 deletions
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 | }), |