Skip to content

Commit d5f6b81

Browse files
committed
Fix for symbolic data-con in fixity declaration
1 parent 5c3be62 commit d5f6b81

File tree

13 files changed

+50
-42
lines changed

13 files changed

+50
-42
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
([#170](https://github.com/JustusAdam/language-haskell/issues/170)).
55
- Proper highlighting of lambda case, including fixing the highlighting of subsequent braces (which were wrongly highlighted as record syntax).
66
- Recognize indented `\begin{code}` boundary in literate haskell files.
7+
- Fix highlighting of symbolic data constructors within fixity declarations (e.g. `infixl 9 :$`).
78

89
## 3.3.0 - 25.06.2020
910

syntaxes/haskell.YAML-tmLanguage

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -378,11 +378,13 @@ patterns:
378378
- include: '#keyword'
379379
- match: '^\s*(infix[lr]?)\s+(.*)'
380380
captures:
381-
'1': {name: "keyword.other.$1.haskell"}
381+
'1': {name: "keyword.other.fixity.$1.haskell"}
382382
'2':
383383
patterns:
384384
- include: '#comment_like'
385385
- include: '#integer_literals'
386+
- match: ':[\p{S}\p{P}&&[^(),;\[\]`{}_"'']]*'
387+
name: constant.other.operator.infix.haskell
386388
- include: "#infix_op"
387389
name: meta.fixity-declaration.haskell
388390
- include: '#start_type_signature'
@@ -392,7 +394,7 @@ patterns:
392394
- include: '#fun_decl'
393395
- include: '#qualifier'
394396
- match: ':[\p{S}\p{P}&&[^(),;\[\]`{}_"'']]*'
395-
name: constant.other.operator.haskell
397+
name: constant.other.operator.infix.haskell
396398
- include: '#data_constructor'
397399
- include: '#prefix_op'
398400
- include: '#infix_op'
@@ -648,7 +650,7 @@ repository:
648650
- include: '#record_wildcard'
649651
- match: >-
650652
(\()\s*(:[\p{S}\p{P}&&[^(),;\[\]`{}_"']]*)\s*(\))
651-
name: constant.other.operator.haskell
653+
name: constant.other.operator.prefix.haskell
652654
- include: '#export_constructs'
653655
- include: '#comma'
654656
export_constructs:
@@ -666,7 +668,7 @@ repository:
666668
endCaptures:
667669
'1': {name: constant.other.haskell}
668670
'2': {name: punctuation.paren.haskell}
669-
'3': {name: constant.other.operator.haskell}
671+
'3': {name: constant.other.operator.prefix.haskell}
670672
'4': {name: punctuation.paren.haskell}
671673
patterns:
672674
- include: '#comment_like'
@@ -1074,13 +1076,13 @@ repository:
10741076
'4':
10751077
patterns:
10761078
- include: '#type_signature'
1077-
'6': {name: constant.other.operator.haskell}
1079+
'6': {name: constant.other.operator.infix.haskell}
10781080
'7': {name: punctuation.backtick.haskell}
1079-
'8': {name: constant.other.haskell}
1081+
'8': {name: constant.other.infix.haskell}
10801082
'9': {name: punctuation.backtick.haskell}
10811083
'10': {name: constant.other.haskell}
10821084
'11': {name: punctuation.paren.haskell}
1083-
'12': {name: constant.other.operator.haskell}
1085+
'12': {name: constant.other.operator.prefix.haskell}
10841086
'13': {name: punctuation.paren.haskell}
10851087
patterns:
10861088
- include: '#comment_like'
@@ -1102,7 +1104,7 @@ repository:
11021104
beginCaptures:
11031105
'2': {name: constant.other.haskell}
11041106
'3': {name: punctuation.paren.haskell}
1105-
'4': {name: constant.other.operator.haskell}
1107+
'4': {name: constant.other.operator.prefix.haskell}
11061108
'5': {name: punctuation.paren.haskell}
11071109
end: |
11081110
(?x)
@@ -1134,7 +1136,7 @@ repository:
11341136
beginCaptures:
11351137
'1': {name: constant.other.haskell}
11361138
'2': {name: punctuation.paren.haskell}
1137-
'3': {name: constant.other.operator.haskell}
1139+
'3': {name: constant.other.operator.prefix.haskell}
11381140
'4': {name: punctuation.paren.haskell}
11391141
end: '(?=;|\}|$)'
11401142
patterns:

test/tests/Exports.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,24 @@ module M
77
, S((:<..<), .. )
88
-- ^ storage.type.haskell
99
-- ^^ - variable.other.member.wildcard.haskell
10-
-- ^^^^^ constant.other.operator.haskell
10+
-- ^^^^^ constant.other.operator.prefix.haskell
1111
-- ^^ variable.other.member.wildcard.haskell
1212
, (:->)((:>))
1313
-- ^^^ storage.type.operator.haskell
14-
-- ^^ constant.other.operator.haskell
14+
-- ^^ constant.other.operator.prefix.haskell
1515
, (:<>)(C,a,D,E)
1616
-- ^^^ storage.type.operator.haskell
1717
, A((<>), (:>>))
1818
-- ^ storage.type.haskell
19-
-- ^^^ constant.other.operator.haskell
19+
-- ^^^ constant.other.operator.prefix.haskell
2020
, f
2121
-- ^ entity.name.function.haskell
2222
, pattern P
2323
-- ^^^^^^^ keyword.other.pattern.haskell
2424
-- ^ constant.other.haskell
2525
, pattern (:|)
2626
-- ^^^^^^^ keyword.other.pattern.haskell
27-
-- ^^ constant.other.operator.haskell
27+
-- ^^ constant.other.operator.prefix.haskell
2828
, pattern -- Q,)
2929
-- ^^^^^^^ keyword.other.pattern.haskell
3030
Q

test/tests/Fixity.hs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@
22

33

44
infixl 3 :+
5-
-- ^^^^^^ keyword.other.infixl.haskell
5+
-- ^^^^^^ keyword.other.fixity.infixl.haskell
66
-- ^ constant.numeric.integral.decimal.haskell
7-
-- ^^ keyword.operator.infix.haskell
7+
-- ^^ constant.other.operator.infix.haskell
88

99
infixr 7 ---:
10-
-- ^^^^^^ keyword.other.infixr.haskell
10+
-- ^^^^^^ keyword.other.fixity.infixr.haskell
1111
-- ^ constant.numeric.integral.decimal.haskell
1212
-- ^^^^ keyword.operator.infix.haskell
1313

1414
infix 1 `Cons`
15-
-- ^^^^^ keyword.other.infix.haskell
15+
-- ^^^^^ keyword.other.fixity.infix.haskell
1616
-- ^ constant.numeric.integral.decimal.haskell
1717
-- ^^^^ constant.other.haskell
1818
-- ^^^^^^ keyword.operator.function.infix.haskell
1919

2020
infix 2 <|> -- comment
21-
-- ^^^^^ keyword.other.infix.haskell
21+
-- ^^^^^ keyword.other.fixity.infix.haskell
2222
-- ^ constant.numeric.integral.decimal.haskell
2323
-- ^^^ keyword.operator.infix.haskell
2424
-- ^^^^^^^^^^ comment.line.double-dash.haskell

test/tests/GADTRecord.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
data (!!!) :: Type where
1919
(:<>) :: { fld1 :: A, (&) :: B } -> (!!!)
20-
-- ^^^ constant.other.operator.haskell
20+
-- ^^^ constant.other.operator.prefix.haskell
2121
-- ^^^^ ^ variable.other.member.definition.haskell
2222
-- ^ ^ punctuation.brace.haskell
2323
-- ^ ^ storage.type.haskell

test/tests/GADTs.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
-- ^ ^ ^ storage.type.haskell
2020

2121
(:&) :: G A B C
22-
-- ^^ constant.other.operator.haskell
22+
-- ^^ constant.other.operator.prefix.haskell
2323
-- ^^ keyword.operator.double-colon.haskell
2424
-- ^ ^ ^ ^ storage.type.haskell
2525

test/tests/Imports.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,24 @@ import M
77
, S((:<..<), .. )
88
-- ^ storage.type.haskell
99
-- ^^ - variable.other.member.wildcard.haskell
10-
-- ^^^^^ constant.other.operator.haskell
10+
-- ^^^^^ constant.other.operator.prefix.haskell
1111
-- ^^ variable.other.member.wildcard.haskell
1212
, (:->)((:>))
1313
-- ^^^ storage.type.operator.haskell
14-
-- ^^ constant.other.operator.haskell
14+
-- ^^ constant.other.operator.prefix.haskell
1515
, (:<>)(C,a,D,E)
1616
-- ^^^ storage.type.operator.haskell
1717
, A((<>), (:>>))
1818
-- ^ storage.type.haskell
19-
-- ^^^ constant.other.operator.haskell
19+
-- ^^^ constant.other.operator.prefix.haskell
2020
, f
2121
-- ^ entity.name.function.haskell
2222
, pattern P
2323
-- ^^^^^^^ keyword.other.pattern.haskell
2424
-- ^ constant.other.haskell
2525
, pattern (:| )
2626
-- ^^^^^^^ keyword.other.pattern.haskell
27-
-- ^^ constant.other.operator.haskell
27+
-- ^^ constant.other.operator.prefix.haskell
2828
, pattern -- Q,)
2929
-- ^^^^^^^ keyword.other.pattern.haskell
3030
Q

test/tests/InfixDataDecl.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
-- ^^^^ keyword.other.data.haskell
66
-- ^ keyword.operator.eq.haskell
77
-- ^ ^ punctuation.paren.haskell
8-
-- ^ constant.other.haskell
8+
-- ^ constant.other.infix.haskell
99
-- ^ ^ punctuation.backtick.haskell
1010
-- ^ keyword.operator.promotion.haskell
1111
-- ^ ^ ^ ^ ^ storage.type.haskell
@@ -17,7 +17,7 @@
1717
-- ^^^^ keyword.other.data.haskell
1818
-- ^ keyword.operator.eq.haskell
1919
-- ^ keyword.operator.promotion.haskell
20-
-- ^ constant.other.haskell
20+
-- ^ constant.other.infix.haskell
2121
-- ^ ^ punctuation.backtick.haskell
2222
-- ^ ^ ^ storage.type.haskell
2323
-- ^ ^ ^ ^ variable.other.generic-type.haskell
@@ -26,5 +26,6 @@
2626
-- ^^^^ keyword.other.data.haskell
2727
-- ^ keyword.operator.eq.haskell
2828
-- ^^^^ entity.name.namespace.haskell
29+
-- ^ constant.other.infix.haskell
2930
-- ^ ^ punctuation.backtick.haskell
3031
-- ^ ^^ storage.type.haskell

test/tests/SymbolicPatternSynonyms.hs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
-- ^^^^^^^ keyword.other.pattern.haskell
66
-- ^^^^^ ^^^^^^^ constant.other.operator.haskell
77
pattern (:<..<) s e = s :<..< e
8-
-- ^^^^^ ^^^^^ constant.other.operator.haskell
8+
-- ^^^^^ constant.other.operator.haskell
9+
-- ^^^^^ constant.other.operator.infix.haskell
910
pattern (:<=..<=) s e = s :<=..<= e
10-
-- ^^^^^^^ ^^^^^^^ constant.other.operator.haskell
11+
-- ^^^^^^^ constant.other.operator.haskell
12+
-- ^^^^^^^ constant.other.operator.infix.haskell

test/tickets/T0069.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module Main (
55
-- ^^^^^ meta.declaration.exports.haskell entity.name.function.haskell
66
-- ^^^^^ - invalid
77
, Bar((:->), (:->>)), Baz, func5
8-
-- ^^^ ^^^^ meta.declaration.exports.haskell constant.other.operator.haskell
8+
-- ^^^ ^^^^ meta.declaration.exports.haskell constant.other.operator.prefix.haskell
99
-- ^^^ meta.declaration.exports.haskell storage.type.haskell
1010
-- ^^^^^ meta.declaration.exports.haskell entity.name.function.haskell
1111
) where

0 commit comments

Comments
 (0)