Verified Commit 75a176b7 authored by Camil Staps's avatar Camil Staps 🙂

Cleanup

parent 6e2fb85a
...@@ -168,32 +168,32 @@ var highlightRules = { ...@@ -168,32 +168,32 @@ var highlightRules = {
], ],
start: [ start: [
[/(generic)(\s)/, [/(generic)(\s)/,
['keyword', 'whitespace'], 'generic'], ['keyword', 'whitespace'], 'generic'],
[/(import)(\s)/, ['keyword', 'whitespace'], 'import'], [/(import)(\s)/, ['keyword', 'whitespace'], 'import'],
[/(from)(\s)/, ['keyword', 'whitespace'], 'importFrom'], [/(from)(\s)/, ['keyword', 'whitespace'], 'importFrom'],
[/(where\b)/, ['keyword']], [/(where\b)/, ['keyword']],
[/((?:(?:definition|implementation|system)\s+)?module\b)/, [/((?:(?:definition|implementation|system)\s+)?module\b)/,
['keyword'], 'moduleName'], ['keyword'], 'moduleName'],
[/(instance)(\s)/, ['keyword', 'whitespace'], 'instance'], [/(instance)(\s)/, ['keyword', 'whitespace'], 'instance'],
[/(derive)(\s+)(class)/, ['keyword', 'whitespace', 'keyword'], 'deriveClass'], [/(derive)(\s+)(class)/, ['keyword', 'whitespace', 'keyword'], 'deriveClass'],
[/(derive)(\s)/, ['keyword', 'whitespace'], 'derive'], [/(derive)(\s)/, ['keyword', 'whitespace'], 'derive'],
[/(class)(\s)/, ['keyword', 'whitespace'], 'className'], [/(class)(\s)/, ['keyword', 'whitespace'], 'className'],
[/(::)/, ['punctuation'], 'typeDefName'], [/(::)/, ['punctuation'], 'typeDefName'],
[/(\S+)(\s+)(::)/, [/(\S+)(\s+)(::)/,
['funcname', 'whitespace', 'punctuation'], 'type'], ['funcname', 'whitespace', 'punctuation'], 'type'],
[/(\()(\S+)(\))(\s*)(infix[rl]?)(\s*)(\d*)(\s*)(::)/, [/(\()(\S+)(\))(\s*)(infix[rl]?)(\s*)(\d*)(\s*)(::)/,
['punctuation', 'funcname', 'punctuation', 'whitespace', ['punctuation', 'funcname', 'punctuation', 'whitespace',
'keyword', 'whitespace', 'keyword', 'whitespace', 'keyword', 'whitespace', 'keyword', 'whitespace',
'punctuation'] 'punctuation']
, 'type'], , 'type'],
[/(\()(\S+)(\))(\s+)(infix[rl]?)(\s*)(\d*)/, [/(\()(\S+)(\))(\s+)(infix[rl]?)(\s*)(\d*)/,
['punctuation', 'funcname', 'punctuation', 'whitespace', ['punctuation', 'funcname', 'punctuation', 'whitespace',
'keyword', 'whitespace', 'keyword']], 'keyword', 'whitespace', 'keyword']],
[/(\()(\S+)(\))/,['punctuation', 'funcname', 'punctuation'], 'funcargs'], [/(\()(\S+)(\))/,['punctuation', 'funcname', 'punctuation'], 'funcargs'],
[/(infix[rl]?)(\s+)(\d*)/, [/(infix[rl]?)(\s+)(\d*)/,
['keyword', 'whitespace', 'keyword']], ['keyword', 'whitespace', 'keyword']],
[/(foreign export(?: (?:c|std)call)?)/, [/(foreign export(?: (?:c|std)call)?)/,
['keyword']], ['keyword']],
[/([\(\)])/, ['punctuation']], [/([\(\)])/, ['punctuation']],
[/(::)/, ['punctuation'], 'type'], [/(::)/, ['punctuation'], 'type'],
[/([{};])/, ['punctuation']], [/([{};])/, ['punctuation']],
...@@ -223,9 +223,9 @@ var highlightRules = { ...@@ -223,9 +223,9 @@ var highlightRules = {
], ],
startConstructor: [ // alternative entry point in case this is a constructor startConstructor: [ // alternative entry point in case this is a constructor
[/(\()(.*)(\))(\s*)(infix[lr]?)(\s*)(\d*)(\s*)(::)/, [/(\()(.*)(\))(\s*)(infix[lr]?)(\s*)(\d*)(\s*)(::)/,
['punctuation', 'constructor', 'punctuation', ['punctuation', 'constructor', 'punctuation',
'whitespace', 'keyword', 'whitespace', 'keyword', 'whitespace', 'keyword', 'whitespace', 'keyword',
'whitespace', 'punctuation'], 'type'], 'whitespace', 'punctuation'], 'type'],
[/(.*)(::)/, ['constructor', 'punctuation'], 'type'] [/(.*)(::)/, ['constructor', 'punctuation'], 'type']
], ],
startRecordField: [ // alternative entry point in case this is a record field startRecordField: [ // alternative entry point in case this is a record field
...@@ -316,9 +316,9 @@ var highlightRules = { ...@@ -316,9 +316,9 @@ var highlightRules = {
], ],
macro: [ macro: [
[/(\(.+\)\s+infix.*)/, [/(\(.+\)\s+infix.*)/,
['__type__']], ['__type__']],
[/([\w`]+\s*::.*)/, [/([\w`]+\s*::.*)/,
['__type__']], ['__type__']],
[/\b(where|with)\b/, ['keyword'], 'jump:macro'], [/\b(where|with)\b/, ['keyword'], 'jump:macro'],
[/(special)(\s)/,['keyword', 'whitespace'], 'special'], [/(special)(\s)/,['keyword', 'whitespace'], 'special'],
[/(\()(\S+)(\))/, ['punctuation', 'funcname', 'punctuation'], 'funcargs'], [/(\()(\S+)(\))/, ['punctuation', 'funcname', 'punctuation'], 'funcargs'],
...@@ -454,16 +454,16 @@ var highlightRules = { ...@@ -454,16 +454,16 @@ var highlightRules = {
[/(\n)/, ['whitespace'], 'pop'], [/(\n)/, ['whitespace'], 'pop'],
[/(\|.*\n)/, ['comment'], 'pop'], [/(\|.*\n)/, ['comment'], 'pop'],
[/('(?:[^'\\]|\\(?:x[0-9a-fA-F]+|\d+|.))')/, [/('(?:[^'\\]|\\(?:x[0-9a-fA-F]+|\d+|.))')/,
['literal literal-char']], ['literal literal-char']],
[/([+~-]?\d+\.\d+(?:E[+-]?\d+)?)\b/, [/([+~-]?\d+\.\d+(?:E[+-]?\d+)?)\b/,
['literal literal-real']], ['literal literal-real']],
[/([+~-]?\d+E[+-]?\d+)\b/, [/([+~-]?\d+E[+-]?\d+)\b/,
['literal literal-real']], ['literal literal-real']],
[/([+~-]?\d+)\b/,['literal literal-int literal-int-dec']], [/([+~-]?\d+)\b/,['literal literal-int literal-int-dec']],
[/([+~-]?0x[\da-fA-F]+)\b/, [/([+~-]?0x[\da-fA-F]+)\b/,
['literal literal-int literal-int-hex']], ['literal literal-int literal-int-hex']],
[/\b(TRUE|FALSE)\b/, [/\b(TRUE|FALSE)\b/,
['literal literal-bool']], ['literal literal-bool']],
[/(")/, ['literal literal-string'], 'string'], [/(")/, ['literal literal-string'], 'string'],
[/(\S+)/, ['abc-argument']] [/(\S+)/, ['abc-argument']]
], ],
...@@ -504,7 +504,7 @@ var highlightRules = { ...@@ -504,7 +504,7 @@ var highlightRules = {
], ],
typeDefRecord: [ typeDefRecord: [
[/([a-z_][\w`]*)(\s*)(::)/, [/([a-z_][\w`]*)(\s*)(::)/,
['field', 'whitespace', 'punctuation'], 'typeDefFieldType'], ['field', 'whitespace', 'punctuation'], 'typeDefFieldType'],
[/(\})/, ['punctuation']] [/(\})/, ['punctuation']]
], ],
typeDefFieldType: [ typeDefFieldType: [
...@@ -526,13 +526,13 @@ var highlightRules = { ...@@ -526,13 +526,13 @@ var highlightRules = {
[/(E)(\.)/, ['existential', 'punctuation'], 'quantifiedVariables'], [/(E)(\.)/, ['existential', 'punctuation'], 'quantifiedVariables'],
[/([A-Z_][\w`]*)/, ['constructor'], 'typeDefConsArgs'], [/([A-Z_][\w`]*)/, ['constructor'], 'typeDefConsArgs'],
[/(\()([~@#\$%\^\?!\+\-\*<>\\\/\|&=:]*)(\))/, [/(\()([~@#\$%\^\?!\+\-\*<>\\\/\|&=:]*)(\))/,
['punctuation', 'constructor', 'punctuation'], ['punctuation', 'constructor', 'punctuation'],
'typeDefConsArgs'], 'typeDefConsArgs'],
[/(\.\.)/, ['punctuation']] [/(\.\.)/, ['punctuation']]
], ],
typeDefConsArgs: [ typeDefConsArgs: [
[/(infix[lr]?)(\s*)(\d*)(\s+)/, [/(infix[lr]?)(\s*)(\d*)(\s+)/,
['keyword', 'whitespace', 'keyword', 'whitespace']], ['keyword', 'whitespace', 'keyword', 'whitespace']],
[/([a-z][\w`]*)/, ['typevar']], [/([a-z][\w`]*)/, ['typevar']],
[/(A)(\.)/, ['existential', 'punctuation'], 'quantifiedVariables'], [/(A)(\.)/, ['existential', 'punctuation'], 'quantifiedVariables'],
[/([A-Z][\w`]*)/, ['type']], [/([A-Z][\w`]*)/, ['type']],
......
...@@ -55,9 +55,6 @@ function parseTestCase(name, contents) { ...@@ -55,9 +55,6 @@ function parseTestCase(name, contents) {
return testcase; return testcase;
} }
function resultsAreEqual(expected, actual) {
}
function parseResult(result) { function parseResult(result) {
var parsedResult = ''; var parsedResult = '';
result = JSDOM.fragment(result); result = JSDOM.fragment(result);
......
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