Verified Commit 5559140b authored by Camil Staps's avatar Camil Staps 🙂

Fix #4: parentheses around infix constructors

parent f49212c8
......@@ -189,9 +189,10 @@ function highlightClean(func, callback, start) {
[/([^:\[\](),\s]+)/, ['argument']]
],
startConstructor: [ // alternative entry point in case this is a constructor
[/(.*)(infix[lr]?)(\s*)(\d*)(\s*)(::)/,
['constructor', 'keyword', 'whitespace', 'keyword',
'whitespace', 'punctuation'], 'type'],
[/(\()(.*)(\))(infix[lr]?)(\s*)(\d*)(\s*)(::)/,
['punctuation', 'constructor', 'punctuation', 'keyword',
'whitespace', 'keyword', 'whitespace', 'punctuation'],
'type'],
[/(.*)(::)/, ['constructor', 'punctuation'], 'type']
],
startRecordField: [ // alternative entry point in case this is a record field
......@@ -444,7 +445,9 @@ function highlightClean(func, callback, start) {
typeDefADT: [
[/(E)(\.)/, ['existential', 'punctuation'], 'quantifiedVariables'],
[/([A-Z_][\w`]*)/, ['constructor'], 'typeDefConsArgs'],
[/(\([~@#\$%\^\?!\+\-\*<>\\\/\|&=:]*\))/, ['constructor'], 'typeDefConsArgs'],
[/(\()([~@#\$%\^\?!\+\-\*<>\\\/\|&=:]*)(\))/,
['punctuation', 'constructor', 'punctuation'],
'typeDefConsArgs'],
[/(\.\.)/, ['punctuation']]
],
typeDefConsArgs: [
......
-----
:: Expression
= Var BoundVar
| App App
| (@) infixl 9 Expression [Expression]
-----
punctuation ::
whitespace
type Expression
whitespace \n
punctuation =
whitespace
constructor Var
whitespace
type BoundVar
whitespace \n
punctuation |
whitespace
constructor App
whitespace
type App
whitespace \n
punctuation |
whitespace
punctuation (
constructor @
punctuation )
whitespace
keyword infixl
whitespace
keyword 9
whitespace
type Expression
whitespace
punctuation [
type Expression
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