Verified Commit 0d3b56e3 authored by Camil Staps's avatar Camil Staps 🚀

Add support for character lists

parent 644ab3ff
......@@ -345,6 +345,7 @@ function highlightClean(func, callback, start) {
[/\b(True|False)\b/,
['literal literal-bool']],
[/(")/, ['literal literal-string'], 'string'],
[/(\[)(\s*)(')/, ['punctuation', 'whitespace', 'literal literal-char'], 'charlist'],
[/([A-Z][\w`]*)/,['constructor']],
[/\b(_)\b/, ['argument argument-wildcard']],
[/([\w`]+)/, ['funcname funcname-onlyused']],
......@@ -371,6 +372,7 @@ function highlightClean(func, callback, start) {
[/\b(True|False)\b/,
['literal literal-bool']],
[/(")/, ['literal literal-string'], 'string'],
[/(\[)(\s*)(')/, ['punctuation', 'whitespace', 'literal literal-char'], 'charlist'],
[/(\(.+\)\s+infix.*)/,
['__type__']],
[/([\w`]+\s*::.*)/,
......@@ -389,6 +391,11 @@ function highlightClean(func, callback, start) {
[/(\\.)/, ['literal literal-string']],
[/([^\\"]+)/, ['literal literal-string']]
],
charlist: [
[/(')(\s*)(\])/, ['literal literal-char', 'whitespace', 'punctuation'], 'pop'],
[/(\\.)/, ['literal literal-char']],
[/([^']+)/, ['literal literal-char']]
],
instance: [
[/(\S+)/, ['classname'], 'jump:type'],
],
......
-----
Start = map (appSnd3 toString o (appThd3 $ map (appSnd toString)))
<$> flip match input <$> compile rgx
where
rgx = ['^([a-zA-Z\\d][\\w\\.%+-]*)@([a-zA-Z\\d-]+\\.)+[a-zA-Z]{2,}']
input = ['query@cloogle.org']
-----
funcname Start
whitespace
punctuation =
whitespace
funcname funcname-onlyused map
whitespace
punctuation (
funcname funcname-onlyused appSnd3
whitespace
funcname funcname-onlyused toString
whitespace
funcname funcname-onlyused o
whitespace
punctuation (
funcname funcname-onlyused appThd3
whitespace
punctuation $
whitespace
funcname funcname-onlyused map
whitespace
punctuation (
funcname funcname-onlyused appSnd
whitespace
funcname funcname-onlyused toString
punctuation )))
whitespace \n
punctuation <$>
whitespace
funcname funcname-onlyused flip
whitespace
funcname funcname-onlyused match
whitespace
funcname funcname-onlyused input
whitespace
punctuation <$>
whitespace
funcname funcname-onlyused compile
whitespace
funcname funcname-onlyused rgx
whitespace \n
keyword where
whitespace \n
funcname rgx
whitespace
punctuation =
whitespace
punctuation [
whitespace
literal literal-char '^([a-zA-Z\\d][\\w\\.%+-]*)@([a-zA-Z\\d-]+\\.)+[a-zA-Z]{2,}'
whitespace
punctuation ]
whitespace \n
funcname input
whitespace
punctuation =
whitespace
punctuation [
whitespace
literal literal-char 'query@cloogle.org'
whitespace
punctuation ]
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