Commit 469a48ad authored by Camil Staps's avatar Camil Staps 🚀

v0.1.9: fix list incorrectly identified as charlist literal

parent 2b4c1c15
......@@ -316,19 +316,19 @@ var highlightRules = {
[/((?:^|\s)= )/, ['punctuation'], 'jump:rhs'],
[/(otherwise)/, ['keyword']],
[/('(?:[^'\\]|\\(?:x[0-9a-fA-F]+|\d+|.))')/,
['literal literal-char']],
['literal literal-char']],
[/([+~-]?\d+\.\d+(?:E[+-]?\d+)?)\b/,
['literal literal-real']],
['literal literal-real']],
[/([+~-]?0[0-7]+)\b/,
['literal literal-int literal-int-oct']],
['literal literal-int literal-int-oct']],
[/([+~-]?\d+)\b/,['literal literal-int literal-int-dec']],
[/([+~-]?0x[\da-fA-F]+)\b/,
['literal literal-int literal-int-hex']],
['literal literal-int literal-int-hex']],
[/\b(True|False)\b/,
['literal literal-bool']],
['literal literal-bool']],
[/(")/, ['literal literal-string'], 'string'],
[/(\[)(\s*)(')(?=.*'\])/,
['punctuation', 'whitespace', 'literal literal-char'], 'charlist'],
['punctuation', 'whitespace', 'literal literal-char'], 'charlist'],
[/([A-Z][\w`]*)/,['constructor']],
[/\b(_)\b/, ['argument argument-wildcard']],
[/([\w`]+)/, ['funcname funcname-onlyused']],
......@@ -337,30 +337,30 @@ var highlightRules = {
rhs: [
[/(\n)(\|)/, ['whitespace', 'punctuation'], 'jump:guard'],
[/(code\s+(?:inline\s*)?)({)/,
['keyword', 'punctuation'], 'abc'],
['keyword', 'punctuation'], 'abc'],
[/\b(if|let|in|with|case|otherwise)\b/,
['keyword']],
['keyword']],
[/\b(of)\b/, ['keyword'], 'funcargs'],
[/('[\w`]+'\.)/, ['qualifiedname']],
[/('(?:[^'\\]|\\(?:x[0-9a-fA-F]+|\d+|.))')/,
['literal literal-char']],
['literal literal-char']],
[/\b([+~-]?\d+\.\d+(?:E[+-]?\d+)?)\b/,
['literal literal-real']],
['literal literal-real']],
[/\b([+~-]?0[0-7]+)\b/,
['literal literal-int literal-int-oct']],
['literal literal-int literal-int-oct']],
[/\b([+~-]?\d+)\b/,
['literal literal-int literal-int-dec']],
['literal literal-int literal-int-dec']],
[/\b([+~-]?0x[\da-fA-F]+)\b/,
['literal literal-int literal-int-hex']],
['literal literal-int literal-int-hex']],
[/\b(True|False)\b/,
['literal literal-bool']],
['literal literal-bool']],
[/(")/, ['literal literal-string'], 'string'],
[/(\[)(\s*)(')(?=.*'\])/,
['punctuation', 'whitespace', 'literal literal-char'], 'charlist'],
['punctuation', 'whitespace', 'literal literal-char'], 'charlist'],
[/(\(.+\)\s+infix.*)/,
['__type__']],
['__type__']],
[/([\w`]+\s*::.*)/,
['__type__']],
['__type__']],
[/([A-Z][\w`]*)/,['constructor']],
[/\b(_)\b/, ['argument argument-wildcard']],
[/([\w`]+)/, ['funcname funcname-onlyused']],
......@@ -377,6 +377,7 @@ var highlightRules = {
],
charlist: [
[/(')(\s*)(\])/, ['literal literal-char', 'whitespace', 'punctuation'], 'pop'],
[/(')/, ['literal literal-char'], 'pop'],
[/(\\.)/, ['literal literal-char']],
[/([^\\']+)/, ['literal literal-char']]
],
......@@ -385,9 +386,9 @@ var highlightRules = {
],
className: [
[/(\()(.*)(\))(\s*)(infix[lr]?)(\s*)(\d*)(\s*)/,
['punctuation', 'classname', 'punctuation', 'whitespace',
'keyword', 'whitespace', 'keyword', 'whitespace'],
'jump:classHeading'],
['punctuation', 'classname', 'punctuation', 'whitespace',
'keyword', 'whitespace', 'keyword', 'whitespace'],
'jump:classHeading'],
[/(\S+)/, ['classname'], 'jump:classHeading']
],
classHeading: [
......
{
"name": "clean-highlighter",
"version": "0.1.8",
"version": "0.1.9",
"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