Verified Commit 3fbd4b60 authored by Camil Staps's avatar Camil Staps 🙂

v0.1.31: add support for ?Just and ?None series of maybe constructors

parent 1f3f7da2
Pipeline #43824 passed with stage
in 56 seconds
......@@ -221,6 +221,7 @@ var highlightRules = {
[/(\|)/, ['punctuation'], 'jump:guard'],
[/(#)/, ['punctuation']],
[/([A-Z][^:\[\](),{}=\s]+)/, ['constructor']],
[/(\?[#^|]?(?:None|Just)?)/, ['constructor']],
[/([^:\[\](),{}=|\s]+)/, ['argument']]
],
startConstructor: [ // alternative entry point in case this is a constructor
......@@ -271,6 +272,7 @@ var highlightRules = {
typeOfPattern: [
[/([a-z]\w*)/, ['argument']],
[/([A-Z]\w*)/, ['constructor']],
[/(\?[#^|]?(?:None|Just)?)/, ['constructor']],
[/([{([])/, ['punctuation'], 'typeOfPattern'],
[/([})\]])/, ['punctuation'], 'pop'],
[/([=:]+)/, ['punctuation']],
......@@ -350,6 +352,7 @@ var highlightRules = {
[/(\[)(\s*)(')(?=.*'\])/,
['punctuation', 'whitespace', 'literal literal-char'], 'charlist'],
[/([A-Z][\w`]*)/,['constructor']],
[/(\?[#^|]?(?:None|Just)?)/, ['constructor']],
[/\b(_)\b/, ['argument argument-wildcard']],
[/([\w`]+)/, ['funcname funcname-onlyused']],
[/(\S)/, ['punctuation']]
......@@ -384,6 +387,7 @@ var highlightRules = {
[/([\w`]+(?:\s*[^\S\n])?::.*)/,
['__type__']],
[/([A-Z][\w`]*)/,['constructor']],
[/(\?[#^|]?(?:None|Just)?)/, ['constructor']],
[/\b(_)\b/, ['argument argument-wildcard']],
[/([\w`]+)/, ['funcname funcname-onlyused']],
[/(\S)/, ['punctuation']]
......@@ -539,6 +543,7 @@ var highlightRules = {
typeDefADT: [
[/(E)(\.)/, ['existential', 'punctuation'], 'quantifiedVariables'],
[/([A-Z_][\w`]*)/, ['constructor'], 'typeDefConsArgs'],
[/(\?[#^|]?(?:None|Just)?)/, ['constructor'], 'typeDefConsArgs'],
[/(\()([~@#\$%\^\?!\+\-\*<>\\\/\|&=:]*)(\))/,
['punctuation', 'constructor', 'punctuation'],
'typeDefConsArgs'],
......
{
"name": "clean-highlighter",
"version": "0.1.30",
"version": "0.1.31",
"description": "Clean language highlighter",
"keywords": ["clean","highlighter"],
"main": "clean.js",
......
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