diff options
author | Kristóf Marussy <kristof@marussy.com> | 2024-02-18 23:52:32 +0100 |
---|---|---|
committer | Kristóf Marussy <kristof@marussy.com> | 2024-02-18 23:52:32 +0100 |
commit | fc3c4dabc1a9b3575c9525c362417334da90b6d6 (patch) | |
tree | 97f978dd8bf29badbacc47a3b81a6530b74dc3e0 /subprojects/frontend/src/language | |
parent | fix(language): type hash colors (diff) | |
download | refinery-fc3c4dabc1a9b3575c9525c362417334da90b6d6.tar.gz refinery-fc3c4dabc1a9b3575c9525c362417334da90b6d6.tar.zst refinery-fc3c4dabc1a9b3575c9525c362417334da90b6d6.zip |
fix(frontend): module name highlighting
Diffstat (limited to 'subprojects/frontend/src/language')
-rw-r--r-- | subprojects/frontend/src/language/problem.grammar | 6 | ||||
-rw-r--r-- | subprojects/frontend/src/language/problemLanguageSupport.ts | 1 |
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 | ||
24 | statement { | 24 | statement { |
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 | ||
174 | NodeName { QualifiedName } | 174 | NodeName { QualifiedName } |
175 | 175 | ||
176 | ModuleName { QualifiedName } | ||
177 | |||
176 | QualifiedName[implicitCompletion=true] { "::"? identifier (QualifiedNameSeparator "::" identifier)* } | 178 | QualifiedName[implicitCompletion=true] { "::"? identifier (QualifiedNameSeparator "::" identifier)* } |
177 | 179 | ||
178 | kw<term> { @specialize[@name={term},implicitCompletion=true]<identifier, term> } | 180 | kw<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, |