Verified Commit 08e3fbaa authored by Camil Staps's avatar Camil Staps 🙂

v0.1.13: Add special cases to highlight the parentheses in (->) as punctuation

parent 0852232e
...@@ -239,6 +239,7 @@ var highlightRules = { ...@@ -239,6 +239,7 @@ var highlightRules = {
genericArgs: [ genericArgs: [
[/(of)/, ['keyword'], 'jump:funcargs'], [/(of)/, ['keyword'], 'jump:funcargs'],
[/([A-Z]\w*)/, ['type']], [/([A-Z]\w*)/, ['type']],
[/(\()(->)(\))/, ['punctuation', 'type', 'punctuation']],
[/([[\]{}!#()>, -]+)/, ['type']], [/([[\]{}!#()>, -]+)/, ['type']],
[/([a-z]\w*)/, ['typevar']], [/([a-z]\w*)/, ['typevar']],
[/(\|})/, ['punctuation'], 'jump:funcargs'], [/(\|})/, ['punctuation'], 'jump:funcargs'],
...@@ -250,6 +251,7 @@ var highlightRules = { ...@@ -250,6 +251,7 @@ var highlightRules = {
[/(A)(\.)/, ['existential', 'punctuation'], 'quantifiedVariables'], [/(A)(\.)/, ['existential', 'punctuation'], 'quantifiedVariables'],
[/([A-Z_][\w`]*)/, ['type']], [/([A-Z_][\w`]*)/, ['type']],
[/(\(\))/, ['type']], [/(\(\))/, ['type']],
[/(\()(->)(\))/, ['punctuation', 'type', 'punctuation']],
[/(\|)/, ['punctuation'], 'context'], [/(\|)/, ['punctuation'], 'context'],
[/([^\s\w])/, ['punctuation']] [/([^\s\w])/, ['punctuation']]
], ],
...@@ -463,6 +465,7 @@ var highlightRules = { ...@@ -463,6 +465,7 @@ var highlightRules = {
[/([A-Z_][\w`]*)/, ['type']], [/([A-Z_][\w`]*)/, ['type']],
[/(\[! \])/, ['type']], // Special cases for head-strict and tail-strict lists; [/(\[! \])/, ['type']], // Special cases for head-strict and tail-strict lists;
[/(\[ !\])/, ['type']], // we don't want to parse whitespace there [/(\[ !\])/, ['type']], // we don't want to parse whitespace there
[/(\()(->)(\))/, ['punctuation', 'type', 'punctuation']],
[/([~@#\$%\^\?!\+\-\*<>\\\/\|&=:\[\]{}(,)]+)/, ['type']], [/([~@#\$%\^\?!\+\-\*<>\\\/\|&=:\[\]{}(,)]+)/, ['type']],
[/([a-z_`][\w`]*)/, ['typevar'], 'jump:typeDefVars'] [/([a-z_`][\w`]*)/, ['typevar'], 'jump:typeDefVars']
], ],
......
{ {
"name": "clean-highlighter", "name": "clean-highlighter",
"version": "0.1.12", "version": "0.1.13",
"description": "Clean language highlighter", "description": "Clean language highlighter",
"keywords": ["clean","highlighter"], "keywords": ["clean","highlighter"],
"main": "clean.js", "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