Skip to content

Commit 150c9c5

Browse files
committed
Fix for empty quasi-quotations
1 parent 57f8e8c commit 150c9c5

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
- Add `meta.embedded.block.{quasi-quoter}` scope to quasi-quotations.
99
- Ensure highlighting of unicode forall syntax matches that of alphabetic forall syntax
1010
([#175](https://github.com/JustusAdam/language-haskell/issues/175)).
11+
- Fix highlighting of empty quasi-quotations such as `[i||]`.
1112

1213
## 3.3.0 - 25.06.2020
1314

syntaxes/haskell.YAML-tmLanguage

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1721,7 +1721,7 @@ repository:
17211721
(?x)
17221722
(\[)
17231723
(e|d|p)?
1724-
(\|\|?)
1724+
(\|(?:\|(?!\]))?)
17251725
beginCaptures:
17261726
'1': {name: keyword.operator.quasi-quotation.begin.haskell}
17271727
'2': {name: entity.name.quasi-quoter.haskell}
@@ -1736,7 +1736,7 @@ repository:
17361736
(?x)
17371737
(\[)
17381738
(t)
1739-
(\|\|?)
1739+
(\|(?:\|(?!\]))?)
17401740
beginCaptures:
17411741
'1': {name: keyword.operator.quasi-quotation.begin.haskell}
17421742
'2': {name: entity.name.quasi-quoter.haskell}
@@ -1754,7 +1754,7 @@ repository:
17541754
(?!'\|') # Don't parse ['|'...] as a quasi quotation
17551755
((?:[\p{Lu}\p{Lt}][\p{Ll}_\p{Lu}\p{Lt}\p{Nd}']*\.)*) # Optional qualifier
17561756
((?:[^\s\p{S}\p{P}]|['_])*) # Quasi-quoter
1757-
(\|\|?)
1757+
(\|(?:\|(?!\]))?)
17581758
beginCaptures:
17591759
'1': {name: keyword.operator.quasi-quotation.begin.haskell}
17601760
'2': {name: keyword.operator.prefix.double-dollar.haskell}

test/tickets/T0023.hs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
-- SYNTAX TEST "source.haskell" "Empty quasi-quote"
2+
3+
instance Show NixIndexException where
4+
show (NixEnvFail errCode _ _) = [i||]
5+
-- ^ ^ keyword.operator.quasi-quotation.begin.haskell
6+
-- ^ entity.name.quasi-quoter.haskell
7+
-- ^^ keyword.operator.quasi-quotation.end.haskell
8+
show ParseNixEnvResError = "Failed to parse the output of nix-env"
9+
-- <------------------------------------------------------------------ - meta.quasi-quotation.haskell
10+
11+
type S = String
12+
13+
-- <--------------- -meta.quasi-quotation.haskell

0 commit comments

Comments
 (0)