aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Kristóf Marussy <kristof@marussy.com>2024-02-18 23:52:32 +0100
committerLibravatar Kristóf Marussy <kristof@marussy.com>2024-02-18 23:52:32 +0100
commitfc3c4dabc1a9b3575c9525c362417334da90b6d6 (patch)
tree97f978dd8bf29badbacc47a3b81a6530b74dc3e0
parentfix(language): type hash colors (diff)
downloadrefinery-fc3c4dabc1a9b3575c9525c362417334da90b6d6.tar.gz
refinery-fc3c4dabc1a9b3575c9525c362417334da90b6d6.tar.zst
refinery-fc3c4dabc1a9b3575c9525c362417334da90b6d6.zip
fix(frontend): module name highlighting
-rw-r--r--subprojects/frontend/src/language/problem.grammar6
-rw-r--r--subprojects/frontend/src/language/problemLanguageSupport.ts1
2 files changed, 5 insertions, 2 deletions
diff --git a/subprojects/frontend/src/language/problem.grammar b/subprojects/frontend/src/language/problem.grammar
index e39ce102..b69ee73f 100644
--- a/subprojects/frontend/src/language/problem.grammar
+++ b/subprojects/frontend/src/language/problem.grammar
@@ -23,7 +23,7 @@
23 23
24statement { 24statement {
25 ImportStatement { 25 ImportStatement {
26 kw<"import"> QualifiedName (kw<"as"> identifier)? "." 26 kw<"import"> ModuleName (kw<"as"> ModuleName)? "."
27 } | 27 } |
28 Assertion { 28 Assertion {
29 kw<"default">? (NotOp | UnknownOp)? RelationName 29 kw<"default">? (NotOp | UnknownOp)? RelationName
@@ -31,7 +31,7 @@ statement {
31 (":" Expr)? "." 31 (":" Expr)? "."
32 } | 32 } |
33 ProblemDeclaration { 33 ProblemDeclaration {
34 (ckw<"module"> | kw<"problem">) QualifiedName "." 34 (ckw<"module"> | kw<"problem">) ModuleName "."
35 } | 35 } |
36 ClassDefinition { 36 ClassDefinition {
37 kw<"abstract">? kw<"class"> RelationName 37 kw<"abstract">? kw<"class"> RelationName
@@ -173,6 +173,8 @@ VariableName[@dynamicPrecedence=10] { QualifiedName ~name }
173 173
174NodeName { QualifiedName } 174NodeName { QualifiedName }
175 175
176ModuleName { QualifiedName }
177
176QualifiedName[implicitCompletion=true] { "::"? identifier (QualifiedNameSeparator "::" identifier)* } 178QualifiedName[implicitCompletion=true] { "::"? identifier (QualifiedNameSeparator "::" identifier)* }
177 179
178kw<term> { @specialize[@name={term},implicitCompletion=true]<identifier, term> } 180kw<term> { @specialize[@name={term},implicitCompletion=true]<identifier, term> }
diff --git a/subprojects/frontend/src/language/problemLanguageSupport.ts b/subprojects/frontend/src/language/problemLanguageSupport.ts
index aebccfa4..14826363 100644
--- a/subprojects/frontend/src/language/problemLanguageSupport.ts
+++ b/subprojects/frontend/src/language/problemLanguageSupport.ts
@@ -47,6 +47,7 @@ const parserWithMetadata = parser.configure({
47 // 'RuleName/QualifiedName': t.typeName, 47 // 'RuleName/QualifiedName': t.typeName,
48 'AtomNodeName/QualifiedName': t.atom, 48 'AtomNodeName/QualifiedName': t.atom,
49 'VariableName/QualifiedName': t.variableName, 49 'VariableName/QualifiedName': t.variableName,
50 'ModuleName/QualifiedName': t.typeName,
50 '{ }': t.brace, 51 '{ }': t.brace,
51 '( )': t.paren, 52 '( )': t.paren,
52 '[ ]': t.squareBracket, 53 '[ ]': t.squareBracket,