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