Skip to content

Commit 4c9905e

Browse files
committed
Additional quasi-quotation scope
1 parent d5f6b81 commit 4c9905e

File tree

3 files changed

+16
-14
lines changed

3 files changed

+16
-14
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
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.
77
- Fix highlighting of symbolic data constructors within fixity declarations (e.g. `infixl 9 :$`).
8+
- Add `meta.embedded.block.{quasi-quoter}` scope to quasi-quotations.
89

910
## 3.3.0 - 25.06.2020
1011

syntaxes/haskell.YAML-tmLanguage

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1735,21 +1735,20 @@ repository:
17351735
(?x)
17361736
(\[)
17371737
(?:(\$\$)|(\$))?
1738-
(?!'\|') # Don't parse ['|'...] as a quasi quotation
1739-
((?:[^\s\p{S}\p{P}]|[\.'_])*)
1738+
(?!'\|') # Don't parse ['|'...] as a quasi quotation
1739+
((?:[\p{Lu}\p{Lt}][\p{Ll}_\p{Lu}\p{Lt}\p{Nd}']*\.)*) # Optional qualifier
1740+
((?:[^\s\p{S}\p{P}]|['_])*) # Quasi-quoter
17401741
(\|\|?)
17411742
beginCaptures:
17421743
'1': {name: keyword.operator.quasi-quotation.begin.haskell}
17431744
'2': {name: keyword.operator.prefix.double-dollar.haskell}
17441745
'3': {name: keyword.operator.prefix.dollar.haskell}
1745-
'4':
1746-
patterns:
1747-
- include: '#qualifier'
1748-
name: entity.name.quasi-quoter.haskell
1749-
'5': {name: keyword.operator.quasi-quotation.begin.haskell}
1750-
end: '\5\]'
1746+
'4': {name: entity.name.namespace.haskell}
1747+
'5': {name: entity.name.quasi-quoter.haskell}
1748+
'6': {name: keyword.operator.quasi-quotation.begin.haskell}
1749+
end: '\6\]'
17511750
endCaptures:
17521751
'0': {name: keyword.operator.quasi-quotation.end.haskell}
1753-
name: meta.quasi-quotation.haskell
1752+
name: "meta.quasi-quotation.haskell meta.embedded.block.$5"
17541753
scopeName: source.haskell
17551754
uuid: 5C034675-1F6D-497E-8073-369D37E2FD7D

test/tests/QuasiQuotes.hs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,18 @@
4848

4949
<HTML>
5050
-- ^^^^^^ meta.quasi-quotation.haskell
51+
-- ^^^^^^ meta.embedded.block.html
5152
|]
5253
-- ^^ keyword.operator.quasi-quotation.end.haskell
5354
-- ^^ meta.quasi-quotation.haskell
5455

55-
[Mod.xml'| <xml /> |]
56-
-- ^ ^ keyword.operator.quasi-quotation.begin.haskell
56+
[Mod.xml| <xml /> |]
57+
-- ^ ^ keyword.operator.quasi-quotation.begin.haskell
5758
-- ^^^^ entity.name.namespace.haskell
58-
-- ^^^^ entity.name.quasi-quoter.haskell
59-
-- ^^ keyword.operator.quasi-quotation.end.haskell
60-
-- ^^^^^^^^^^^^^^^^^^^^^ meta.quasi-quotation.haskell
59+
-- ^^^ entity.name.quasi-quoter.haskell
60+
-- ^^ keyword.operator.quasi-quotation.end.haskell
61+
-- ^^^^^^^^^^^^^^^^^^^^ meta.quasi-quotation.haskell
62+
-- ^^^^^^^ meta.embedded.block.xml
6163

6264
[a'|'xyz|]
6365
-- ^^ entity.name.quasi-quoter.haskell

0 commit comments

Comments
 (0)