Add support for qualified imports

parent 1861ae1e
......@@ -12,7 +12,7 @@
font-weight: bold;
}
.funcname.funcname-onlyused, .modulename.modulename-onlyused, .argument {
.funcname.funcname-onlyused, .argument {
color: #6e94ad;
font-weight: normal;
}
......@@ -43,6 +43,11 @@
color: #444;
}
.qualified {
color: #444;
font-weight: normal;
}
.field {
color: #41b1b5;
}
......
......@@ -144,6 +144,7 @@ function highlightClean(func, callback, start) {
_prepend: [
[/(\s*)(\/\/.*)/, ['whitespace', 'comment']],
[/(\s*)(\/\*)/, ['whitespace', 'comment'], 'comment'],
[/(')([\w`]+)('\.)/, ['punctuation', 'qualified', 'punctuation']],
],
_append: [
[/(\n[^\n\S]*)/, function(matches, states) {
......@@ -344,7 +345,8 @@ function highlightClean(func, callback, start) {
[/\b(True|False)\b/,
['literal literal-bool']],
[/(")/, ['literal literal-string'], 'string'],
[/(\[)(\s*)(')/, ['punctuation', 'whitespace', 'literal literal-char'], 'charlist'],
[/(\[)(\s*)(')(?=.*'\])/,
['punctuation', 'whitespace', 'literal literal-char'], 'charlist'],
[/([A-Z][\w`]*)/,['constructor']],
[/\b(_)\b/, ['argument argument-wildcard']],
[/([\w`]+)/, ['funcname funcname-onlyused']],
......@@ -371,7 +373,8 @@ function highlightClean(func, callback, start) {
[/\b(True|False)\b/,
['literal literal-bool']],
[/(")/, ['literal literal-string'], 'string'],
[/(\[)(\s*)(')/, ['punctuation', 'whitespace', 'literal literal-char'], 'charlist'],
[/(\[)(\s*)(')(?=.*'\])/,
['punctuation', 'whitespace', 'literal literal-char'], 'charlist'],
[/(\(.+\)\s+infix.*)/,
['__type__']],
[/([\w`]+\s*::.*)/,
......@@ -558,7 +561,7 @@ function highlightClean(func, callback, start) {
],
importAs: [
[/(,)/, ['punctuation'], 'pop'],
[/([^,\s]+)/, ['modulename modulename-onlyused']]
[/([^,\s]+)/, ['modulename qualified']]
],
importFrom: [
[/([^,\s]+)(\s+)(import)/, ['modulename', 'whitespace', 'keyword'], 'importSelections']
......
-----
instance 'T'.toTypeContext ['syntax'.TypeContext]
where
toTypeContext context
= ['T'.Instance gds.glob_object.ds_ident.id_name (map 'T'.toType tc_types)
\\ {tc_class=(TCClass gds),tc_types} <- context] ++
['T'.Derivation gtc_generic.glob_object.ds_ident.id_name ('T'.toType t)
\\ {tc_class=(TCGeneric {gtc_generic}),tc_types=[t]} <- context]
-----
keyword instance
whitespace
punctuation '
qualified T
punctuation '.
classname toTypeContext
whitespace
punctuation ['
qualified syntax
punctuation '.
type TypeContext
punctuation ]
whitespace \n
keyword where
whitespace \n
funcname toTypeContext
whitespace
argument context
whitespace \n
punctuation =
whitespace
punctuation ['
qualified T
punctuation '.
constructor Instance
whitespace
funcname funcname-onlyused gds
punctuation .
funcname funcname-onlyused glob_object
punctuation .
funcname funcname-onlyused ds_ident
punctuation .
funcname funcname-onlyused id_name
whitespace
punctuation (
funcname funcname-onlyused map
whitespace
punctuation '
qualified T
punctuation '.
funcname funcname-onlyused toType
whitespace
funcname funcname-onlyused tc_types
punctuation )
whitespace \n
punctuation \\
whitespace
punctuation {
funcname funcname-onlyused tc_class
punctuation =(
constructor TCClass
whitespace
funcname funcname-onlyused gds
punctuation ),
funcname funcname-onlyused tc_types
punctuation }
whitespace
punctuation <-
whitespace
argumentinrhs context
punctuation ]
whitespace
punctuation ++
whitespace \n
punctuation ['
qualified T
punctuation '.
constructor Derivation
whitespace
funcname funcname-onlyused gtc_generic
punctuation .
funcname funcname-onlyused glob_object
punctuation .
funcname funcname-onlyused ds_ident
punctuation .
funcname funcname-onlyused id_name
whitespace
punctuation ('
qualified T
punctuation '.
funcname funcname-onlyused toType
whitespace
funcname funcname-onlyused t
punctuation )
whitespace \n
punctuation \\
whitespace
punctuation {
funcname funcname-onlyused tc_class
punctuation =(
constructor TCGeneric
whitespace
punctuation {
funcname funcname-onlyused gtc_generic
punctuation }),
funcname funcname-onlyused tc_types
punctuation =[
funcname funcname-onlyused t
punctuation ]}
whitespace
punctuation <-
whitespace
argumentinrhs context
punctuation ]
-----
pdType :: !'syntax'.ParsedDefinition -> Maybe 'T'.Type
-----
funcname pdType
whitespace
punctuation ::
whitespace
punctuation !'
qualified syntax
punctuation '.
type ParsedDefinition
whitespace
punctuation ->
whitespace
type Maybe
whitespace
punctuation '
qualified T
punctuation '.
type Type
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment