v0.1.24: fix contexts of generics

parent a899f1ca
Pipeline #18085 passed with stage
in 24 seconds
......@@ -236,7 +236,11 @@ var highlightRules = {
],
genericVars: [
[/(::)/, ['punctuation'], 'jump:type'],
[/(\S)/, ['typevar']]
[/(\|)/, ['punctuation'], 'genericContext'],
[/(\S+)/, ['typevar']]
],
genericContext: [
[/(\S+)/, ['generic'], 'pop']
],
genericArgs: [
[/\b(of)\b/, ['keyword'], 'jump:funcargs'],
......@@ -280,7 +284,7 @@ var highlightRules = {
context: [
[/(,)/, ['punctuation']],
[/(\[)/, ['punctuation'], 'attrenv'],
[/(\S+)(\{\|)/, ['generic', 'punctuation'], 'genericContext'],
[/(\S+)(\{\|)/, ['generic', 'punctuation'], 'contextKind'],
// These are two hacks for class context in universally quantified types:
[/(\()/, ['punctuation'], 'pop'], // hack for sqlShare
[/(->)/, ['punctuation'], 'pop'], // hack for sqlExecute
......@@ -288,7 +292,7 @@ var highlightRules = {
[/([^\s{]+)(,)/, ['classname', 'punctuation']],
[/([^\s{]+)/, ['classname'], 'contextType']
],
genericContext: [
contextKind: [
[/([*>-]+\|\},)/, ['punctuation'], 'pop'],
[/([*>-]+\|\})/, ['punctuation'], 'jump:contextType']
],
......
{
"name": "clean-highlighter",
"version": "0.1.23",
"version": "0.1.24",
"description": "Clean language highlighter",
"keywords": ["clean","highlighter"],
"main": "clean.js",
......
-----
generic bimap a b | bimap b a :: .a -> .b
-----
keyword generic
whitespace
funcname funcname-generic bimap
whitespace
typevar a
whitespace
typevar b
whitespace
punctuation |
whitespace
generic bimap
whitespace
typevar b
whitespace
typevar a
whitespace
punctuation ::
whitespace
punctuation .
typevar a
whitespace
punctuation ->
whitespace
punctuation .
typevar b
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