tm-grammars 1.22.18 → 1.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (234) hide show
  1. package/NOTICE +287 -1
  2. package/README.md +241 -239
  3. package/grammars/abap.json +36 -36
  4. package/grammars/actionscript-3.json +29 -29
  5. package/grammars/ada.json +78 -78
  6. package/grammars/angular-expression.json +62 -62
  7. package/grammars/angular-html.json +0 -1
  8. package/grammars/angular-inline-style.json +3 -3
  9. package/grammars/angular-inline-template.json +2 -2
  10. package/grammars/angular-template-blocks.json +3 -3
  11. package/grammars/angular-template.json +1 -1
  12. package/grammars/angular-ts.json +251 -251
  13. package/grammars/apache.json +31 -31
  14. package/grammars/apex.json +108 -108
  15. package/grammars/apl.json +18 -18
  16. package/grammars/applescript.json +11 -11
  17. package/grammars/ara.json +13 -13
  18. package/grammars/asciidoc.json +234 -234
  19. package/grammars/asm.json +90 -90
  20. package/grammars/astro.json +25 -25
  21. package/grammars/awk.json +8 -8
  22. package/grammars/ballerina.json +150 -150
  23. package/grammars/bat.json +28 -28
  24. package/grammars/beancount.json +33 -33
  25. package/grammars/berry.json +11 -11
  26. package/grammars/bibtex.json +12 -12
  27. package/grammars/bicep.json +12 -12
  28. package/grammars/blade.json +183 -183
  29. package/grammars/bsl.json +58 -58
  30. package/grammars/c.json +162 -162
  31. package/grammars/cadence.json +20 -20
  32. package/grammars/cairo.json +10 -10
  33. package/grammars/clarity.json +20 -20
  34. package/grammars/clojure.json +25 -25
  35. package/grammars/cmake.json +3 -3
  36. package/grammars/cobol.json +91 -91
  37. package/grammars/codeql.json +154 -154
  38. package/grammars/coffee.json +45 -45
  39. package/grammars/common-lisp.json +50 -50
  40. package/grammars/coq.json +10 -10
  41. package/grammars/cpp-macro.json +410 -410
  42. package/grammars/cpp.json +641 -641
  43. package/grammars/crystal.json +68 -68
  44. package/grammars/csharp.json +196 -196
  45. package/grammars/css.json +83 -83
  46. package/grammars/csv.json +1 -1
  47. package/grammars/cue.json +55 -55
  48. package/grammars/cypher.json +11 -11
  49. package/grammars/d.json +127 -32
  50. package/grammars/dart.json +18 -18
  51. package/grammars/dax.json +9 -9
  52. package/grammars/desktop.json +9 -9
  53. package/grammars/diff.json +3 -3
  54. package/grammars/dotenv.json +3 -3
  55. package/grammars/dream-maker.json +20 -20
  56. package/grammars/edge.json +8 -8
  57. package/grammars/elixir.json +44 -44
  58. package/grammars/elm.json +23 -23
  59. package/grammars/emacs-lisp.json +76 -76
  60. package/grammars/erb.json +2 -2
  61. package/grammars/erlang.json +29 -29
  62. package/grammars/es-tag-css.json +3 -3
  63. package/grammars/es-tag-glsl.json +3 -3
  64. package/grammars/es-tag-html.json +3 -3
  65. package/grammars/es-tag-sql.json +2 -2
  66. package/grammars/es-tag-xml.json +2 -2
  67. package/grammars/fennel.json +8 -8
  68. package/grammars/fish.json +10 -10
  69. package/grammars/fluent.json +10 -10
  70. package/grammars/fortran-fixed-form.json +1 -1
  71. package/grammars/fortran-free-form.json +106 -106
  72. package/grammars/fsharp.json +70 -70
  73. package/grammars/gdresource.json +15 -15
  74. package/grammars/gdscript.json +31 -27
  75. package/grammars/gdshader.json +18 -18
  76. package/grammars/genie.json +6 -6
  77. package/grammars/gherkin.json +1 -1
  78. package/grammars/git-commit.json +1 -1
  79. package/grammars/git-rebase.json +1 -1
  80. package/grammars/gleam.json +11 -11
  81. package/grammars/glimmer-js.json +35 -35
  82. package/grammars/glimmer-ts.json +35 -35
  83. package/grammars/glsl.json +4 -4
  84. package/grammars/gnuplot.json +41 -41
  85. package/grammars/go.json +155 -155
  86. package/grammars/graphql.json +20 -20
  87. package/grammars/groovy.json +44 -44
  88. package/grammars/hack.json +74 -74
  89. package/grammars/haml.json +24 -24
  90. package/grammars/handlebars.json +25 -25
  91. package/grammars/haskell.json +99 -99
  92. package/grammars/haxe.json +51 -51
  93. package/grammars/hcl.json +43 -43
  94. package/grammars/hjson.json +29 -29
  95. package/grammars/hlsl.json +15 -15
  96. package/grammars/html-derivative.json +0 -1
  97. package/grammars/html.json +28 -29
  98. package/grammars/http.json +17 -17
  99. package/grammars/hxml.json +3 -3
  100. package/grammars/hy.json +10 -10
  101. package/grammars/imba.json +168 -173
  102. package/grammars/ini.json +2 -2
  103. package/grammars/java.json +54 -54
  104. package/grammars/javascript.json +262 -262
  105. package/grammars/jinja-html.json +3 -3
  106. package/grammars/jinja.json +15 -15
  107. package/grammars/jison.json +18 -18
  108. package/grammars/json.json +6 -6
  109. package/grammars/json5.json +12 -12
  110. package/grammars/jsonc.json +6 -6
  111. package/grammars/jsonl.json +6 -6
  112. package/grammars/jsonnet.json +15 -15
  113. package/grammars/jssm.json +4 -4
  114. package/grammars/jsx.json +262 -262
  115. package/grammars/julia.json +45 -45
  116. package/grammars/kotlin.json +15 -15
  117. package/grammars/kusto.json +13 -13
  118. package/grammars/latex.json +260 -260
  119. package/grammars/lean.json +12 -12
  120. package/grammars/less.json +91 -91
  121. package/grammars/liquid.json +96 -62
  122. package/grammars/llvm.json +122 -0
  123. package/grammars/log.json +22 -22
  124. package/grammars/logo.json +2 -2
  125. package/grammars/lua.json +34 -34
  126. package/grammars/luau.json +20 -20
  127. package/grammars/make.json +22 -22
  128. package/grammars/markdown-vue.json +1 -1
  129. package/grammars/markdown.json +83 -83
  130. package/grammars/marko.json +19 -19
  131. package/grammars/matlab.json +29 -29
  132. package/grammars/mdc.json +17 -17
  133. package/grammars/mdx.json +278 -278
  134. package/grammars/mermaid.json +97 -97
  135. package/grammars/mipsasm.json +2 -2
  136. package/grammars/mojo.json +122 -122
  137. package/grammars/move.json +35 -35
  138. package/grammars/narrat.json +10 -10
  139. package/grammars/nextflow.json +11 -11
  140. package/grammars/nginx.json +45 -45
  141. package/grammars/nim.json +44 -44
  142. package/grammars/nix.json +71 -71
  143. package/grammars/nushell.json +36 -36
  144. package/grammars/objective-c.json +129 -129
  145. package/grammars/objective-cpp.json +245 -245
  146. package/grammars/ocaml.json +229 -229
  147. package/grammars/pascal.json +4 -4
  148. package/grammars/perl.json +64 -64
  149. package/grammars/php.json +199 -199
  150. package/grammars/plsql.json +10 -10
  151. package/grammars/po.json +4 -4
  152. package/grammars/polar.json +13 -13
  153. package/grammars/postcss.json +31 -31
  154. package/grammars/powerquery.json +10 -10
  155. package/grammars/powershell.json +54 -54
  156. package/grammars/prisma.json +13 -13
  157. package/grammars/prolog.json +3 -3
  158. package/grammars/proto.json +11 -11
  159. package/grammars/pug.json +30 -30
  160. package/grammars/puppet.json +35 -35
  161. package/grammars/purescript.json +843 -467
  162. package/grammars/python.json +126 -126
  163. package/grammars/qml.json +18 -18
  164. package/grammars/qss.json +7 -7
  165. package/grammars/r.json +17 -17
  166. package/grammars/racket.json +58 -58
  167. package/grammars/raku.json +15 -15
  168. package/grammars/razor.json +30 -30
  169. package/grammars/reg.json +3 -3
  170. package/grammars/regexp.json +15 -15
  171. package/grammars/rel.json +4 -4
  172. package/grammars/riscv.json +15 -15
  173. package/grammars/rst.json +26 -26
  174. package/grammars/ruby.json +103 -106
  175. package/grammars/rust.json +13 -13
  176. package/grammars/sas.json +9 -9
  177. package/grammars/sass.json +35 -35
  178. package/grammars/scala.json +75 -75
  179. package/grammars/scheme.json +16 -16
  180. package/grammars/scss.json +68 -68
  181. package/grammars/sdbl.json +18 -18
  182. package/grammars/shaderlab.json +8 -8
  183. package/grammars/shellscript.json +111 -111
  184. package/grammars/shellsession.json +1 -1
  185. package/grammars/smalltalk.json +5 -5
  186. package/grammars/solidity.json +20 -20
  187. package/grammars/soy.json +30 -30
  188. package/grammars/sparql.json +1 -1
  189. package/grammars/splunk.json +6 -6
  190. package/grammars/sql.json +8 -8
  191. package/grammars/ssh-config.json +2 -2
  192. package/grammars/stata.json +90 -90
  193. package/grammars/stylus.json +48 -48
  194. package/grammars/svelte.json +35 -25
  195. package/grammars/swift.json +114 -114
  196. package/grammars/system-verilog.json +25 -25
  197. package/grammars/systemd.json +16 -16
  198. package/grammars/talonscript.json +12 -12
  199. package/grammars/tasl.json +10 -10
  200. package/grammars/tcl.json +11 -11
  201. package/grammars/templ.json +34 -34
  202. package/grammars/terraform.json +42 -42
  203. package/grammars/tex.json +14 -14
  204. package/grammars/toml.json +15 -15
  205. package/grammars/tsx.json +262 -262
  206. package/grammars/turtle.json +2 -2
  207. package/grammars/twig.json +37 -37
  208. package/grammars/typescript.json +251 -251
  209. package/grammars/typespec.json +54 -273
  210. package/grammars/typst.json +34 -34
  211. package/grammars/v.json +32 -32
  212. package/grammars/vala.json +6 -6
  213. package/grammars/vb.json +7 -7
  214. package/grammars/verilog.json +4 -4
  215. package/grammars/vhdl.json +10 -10
  216. package/grammars/viml.json +22 -22
  217. package/grammars/vue-html.json +10 -10
  218. package/grammars/vue-sfc-style-variable-injection.json +1 -1
  219. package/grammars/vue.json +65 -65
  220. package/grammars/vyper.json +126 -126
  221. package/grammars/wasm.json +26 -26
  222. package/grammars/wenyan.json +7 -7
  223. package/grammars/wgsl.json +9 -9
  224. package/grammars/wikitext.json +66 -66
  225. package/grammars/wit.json +1409 -0
  226. package/grammars/wolfram.json +446 -446
  227. package/grammars/xml.json +11 -11
  228. package/grammars/xsl.json +1 -1
  229. package/grammars/yaml.json +24 -24
  230. package/grammars/zenscript.json +8 -8
  231. package/grammars/zig.json +11 -11
  232. package/index.d.ts +7 -0
  233. package/index.js +1226 -506
  234. package/package.json +1 -1
@@ -23,7 +23,7 @@
23
23
  "include": "#char_literal"
24
24
  },
25
25
  {
26
- "match": "(?<!@|#)-\\}",
26
+ "match": "(?<![@#])-}",
27
27
  "name": "invalid"
28
28
  },
29
29
  {
@@ -95,7 +95,7 @@
95
95
  "name": "punctuation.bracket.haskell"
96
96
  }
97
97
  },
98
- "match": "(\\[)\\s*(\\])",
98
+ "match": "(\\[)\\s*(])",
99
99
  "name": "constant.language.empty-list.haskell"
100
100
  },
101
101
  {
@@ -136,7 +136,7 @@
136
136
  "name": "keyword.other.class.haskell"
137
137
  }
138
138
  },
139
- "end": "(?=(?<!')\\bwhere\\b(?!'))|(?=\\}|;)|^(?!\\1\\s+\\S|\\s*(?:$|\\{-[^@]|--+(?![\\p{S}\\p{P}&&[^(),;\\[\\]{}`_\"']]).*$))",
139
+ "end": "(?x) # Detect end of class declaration:\n # 'where' keyword\n (?=(?<!')\\bwhere\\b(?!')) \n # Decreasing indentation\n |(?=\\}|;) # Explicit indentation\n |^(?! # Implicit indentation: end match on newline *unless* the new line is either:\n \\1\\s+\\S # - more indented, or\n | \\s* # - starts with whitespace, followed by:\n (?: $ # - the end of the line (i.e. empty line), or\n |\\{-[^@] # - the start of a block comment, or\n |--+ # - the start of a single-line comment.\n (?![\\p{S}\\p{P}&&[^(),;\\[\\]{}`_\"']]).*$) # non-symbol\n # The double dash may not be followed by other operator characters\n # (then it would be an operator, not a comment)\n )",
140
140
  "name": "meta.declaration.class.haskell",
141
141
  "patterns": [
142
142
  {
@@ -151,7 +151,7 @@
151
151
  ]
152
152
  },
153
153
  {
154
- "begin": "^(\\s*)(data|newtype)(?:\\s+(instance))?\\s+((?:(?!(?:(?<![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']])(?:=|--+)(?![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']]))|(?:\\b(?<!')(?:where|deriving)\\b(?!'))|{-).)*)(?=\\b(?<!'')where\\b(?!''))",
154
+ "begin": "^(\\s*)(data|newtype)(?:\\s+(instance))?\\s+((?:(?!(?<![[\\p{S}\\p{P}]&&[^(),;\\[\\]`{}_\"']])(?:=|--+)(?![[\\p{S}\\p{P}]&&[^(),;\\[\\]`{}_\"']])|\\b(?<!')(?:where|deriving)\\b(?!')|\\{-).)*)(?=\\b(?<!'')where\\b(?!''))",
155
155
  "beginCaptures": {
156
156
  "2": {
157
157
  "name": "keyword.other.$2.haskell"
@@ -167,7 +167,7 @@
167
167
  ]
168
168
  }
169
169
  },
170
- "end": "(?=(?<!')\\bderiving\\b(?!'))|(?=\\}|;)|^(?!\\1\\s+\\S|\\s*(?:$|\\{-[^@]|--+(?![\\p{S}\\p{P}&&[^(),;\\[\\]{}`_\"']]).*$))",
170
+ "end": "(?x) # Detect end of data declaration:\n # Deriving clause\n (?=(?<!')\\bderiving\\b(?!')) \n # Decreasing indentation\n |(?=\\}|;) # Explicit indentation\n |^(?! # Implicit indentation: end match on newline *unless* the new line is either:\n \\1\\s+\\S # - more indented, or\n | \\s* # - starts with whitespace, followed by:\n (?: $ # - the end of the line (i.e. empty line), or\n |\\{-[^@] # - the start of a block comment, or\n |--+ # - the start of a single-line comment.\n (?![\\p{S}\\p{P}&&[^(),;\\[\\]{}`_\"']]).*$) # non-symbol\n # The double dash may not be followed by other operator characters\n # (then it would be an operator, not a comment)\n )\n",
171
171
  "name": "meta.declaration.$2.generalized.haskell",
172
172
  "patterns": [
173
173
  {
@@ -183,7 +183,7 @@
183
183
  "name": "punctuation.brace.haskell"
184
184
  }
185
185
  },
186
- "end": "(\\})",
186
+ "end": "(})",
187
187
  "endCaptures": {
188
188
  "1": {
189
189
  "name": "punctuation.brace.haskell"
@@ -218,7 +218,7 @@
218
218
  "include": "#role_annotation"
219
219
  },
220
220
  {
221
- "begin": "^(\\s*)(pattern)\\s+(.*?)\\s+(::|∷)(?![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']])",
221
+ "begin": "^(\\s*)(pattern)\\s+(.*?)\\s+(::|∷)(?![[\\p{S}\\p{P}]&&[^(),;\\[\\]`{}_\"']])",
222
222
  "beginCaptures": {
223
223
  "2": {
224
224
  "name": "keyword.other.pattern.haskell"
@@ -237,7 +237,7 @@
237
237
  "name": "keyword.operator.double-colon.haskell"
238
238
  }
239
239
  },
240
- "end": "(?=\\}|;)|^(?!\\1\\s+\\S|\\s*(?:$|\\{-[^@]|--+(?![\\p{S}\\p{P}&&[^(),;\\[\\]{}`_\"']]).*$))",
240
+ "end": "(?x) # Detect end of pattern type definition by decreasing indentation:\n (?=\\}|;) # Explicit indentation\n |^(?! # Implicit indentation: end match on newline *unless* the new line is either:\n \\1\\s+\\S # - more indented, or\n | \\s* # - starts with whitespace, followed by:\n (?: $ # - the end of the line (i.e. empty line), or\n |\\{-[^@] # - the start of a block comment, or\n |--+ # - the start of a single-line comment.\n (?![\\p{S}\\p{P}&&[^(),;\\[\\]{}`_\"']]).*$) # non-symbol\n # The double dash may not be followed by other operator characters\n # (then it would be an operator, not a comment)\n )\n",
241
241
  "name": "meta.declaration.pattern.type.haskell",
242
242
  "patterns": [
243
243
  {
@@ -252,7 +252,7 @@
252
252
  "name": "keyword.other.pattern.haskell"
253
253
  }
254
254
  },
255
- "end": "(?=\\}|;)|^(?!\\1\\s+\\S|\\s*(?:$|\\{-[^@]|--+(?![\\p{S}\\p{P}&&[^(),;\\[\\]{}`_\"']]).*$))",
255
+ "end": "(?x) # Detect end of pattern type definition by decreasing indentation:\n (?=\\}|;) # Explicit indentation\n |^(?! # Implicit indentation: end match on newline *unless* the new line is either:\n \\1\\s+\\S # - more indented, or\n | \\s* # - starts with whitespace, followed by:\n (?: $ # - the end of the line (i.e. empty line), or\n |\\{-[^@] # - the start of a block comment, or\n |--+ # - the start of a single-line comment.\n (?![\\p{S}\\p{P}&&[^(),;\\[\\]{}`_\"']]).*$) # non-symbol\n # The double dash may not be followed by other operator characters\n # (then it would be an operator, not a comment)\n )\n",
256
256
  "name": "meta.declaration.pattern.haskell",
257
257
  "patterns": [
258
258
  {
@@ -261,7 +261,7 @@
261
261
  ]
262
262
  },
263
263
  {
264
- "begin": "^(\\s*)(data|newtype)(?:\\s+(family|instance))?\\s+(((?!(?:(?<![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']])(?:=|--+)(?![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']]))|(?:\\b(?<!')(?:where|deriving)\\b(?!'))|{-).)*)",
264
+ "begin": "^(\\s*)(data|newtype)(?:\\s+(family|instance))?\\s+(((?!(?<![[\\p{S}\\p{P}]&&[^(),;\\[\\]`{}_\"']])(?:=|--+)(?![[\\p{S}\\p{P}]&&[^(),;\\[\\]`{}_\"']])|\\b(?<!')(?:where|deriving)\\b(?!')|\\{-).)*)",
265
265
  "beginCaptures": {
266
266
  "2": {
267
267
  "name": "keyword.other.$2.haskell"
@@ -277,7 +277,7 @@
277
277
  ]
278
278
  }
279
279
  },
280
- "end": "(?=\\}|;)|^(?!\\1\\s+\\S|\\s*(?:$|\\{-[^@]|--+(?![\\p{S}\\p{P}&&[^(),;\\[\\]{}`_\"']]).*$))",
280
+ "end": "(?x) # Detect end of data declaration: \n # Decreasing indentation\n (?=\\}|;) # Explicit indentation\n |^(?! # Implicit indentation: end match on newline *unless* the new line is either:\n \\1\\s+\\S # - more indented, or\n | \\s* # - starts with whitespace, followed by:\n (?: $ # - the end of the line (i.e. empty line), or\n |\\{-[^@] # - the start of a block comment, or\n |--+ # - the start of a single-line comment.\n (?![\\p{S}\\p{P}&&[^(),;\\[\\]{}`_\"']]).*$) # non-symbol\n # The double dash may not be followed by other operator characters\n # (then it would be an operator, not a comment)\n )",
281
281
  "name": "meta.declaration.$2.algebraic.haskell",
282
282
  "patterns": [
283
283
  {
@@ -304,7 +304,7 @@
304
304
  ]
305
305
  },
306
306
  {
307
- "begin": "^(\\s*)(type)\\s+(family)\\b(?!')(((?!(?:(?<![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']])(?:=|--+)(?![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']]))|\\b(?<!')where\\b(?!')|{-).)*)",
307
+ "begin": "^(\\s*)(type)\\s+(family)\\b(?!')(((?!(?<![[\\p{S}\\p{P}]&&[^(),;\\[\\]`{}_\"']])(?:=|--+)(?![[\\p{S}\\p{P}]&&[^(),;\\[\\]`{}_\"']])|\\b(?<!')where\\b(?!')|\\{-).)*)",
308
308
  "beginCaptures": {
309
309
  "2": {
310
310
  "name": "keyword.other.type.haskell"
@@ -326,7 +326,7 @@
326
326
  ]
327
327
  }
328
328
  },
329
- "end": "(?=\\}|;)|^(?!\\1\\s+\\S|\\s*(?:$|\\{-[^@]|--+(?![\\p{S}\\p{P}&&[^(),;\\[\\]{}`_\"']]).*$))",
329
+ "end": "(?x) # Detect end of type family by decreasing indentation:\n (?=\\}|;) # Explicit indentation\n |^(?! # Implicit indentation: end match on newline *unless* the new line is either:\n \\1\\s+\\S # - more indented, or\n | \\s* # - starts with whitespace, followed by:\n (?: $ # - the end of the line (i.e. empty line), or\n |\\{-[^@] # - the start of a block comment, or\n |--+ # - the start of a single-line comment.\n (?![\\p{S}\\p{P}&&[^(),;\\[\\]{}`_\"']]).*$) # non-symbol\n # The double dash may not be followed by other operator characters\n # (then it would be an operator, not a comment)\n )\n",
330
330
  "name": "meta.declaration.type.family.haskell",
331
331
  "patterns": [
332
332
  {
@@ -341,7 +341,7 @@
341
341
  ]
342
342
  },
343
343
  {
344
- "begin": "^(\\s*)(type)(?:\\s+(instance))?\\s+(((?!(?:(?<![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']])(?:=|--+|::|∷)(?![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']]))|{-).)*)",
344
+ "begin": "^(\\s*)(type)(?:\\s+(instance))?\\s+(((?!(?<![[\\p{S}\\p{P}]&&[^(),;\\[\\]`{}_\"']])(?:=|--+|::|∷)(?![[\\p{S}\\p{P}]&&[^(),;\\[\\]`{}_\"']])|\\{-).)*)",
345
345
  "beginCaptures": {
346
346
  "2": {
347
347
  "name": "keyword.other.type.haskell"
@@ -357,7 +357,7 @@
357
357
  ]
358
358
  }
359
359
  },
360
- "end": "(?=\\}|;)|^(?!\\1\\s+\\S|\\s*(?:$|\\{-[^@]|--+(?![\\p{S}\\p{P}&&[^(),;\\[\\]{}`_\"']]).*$))",
360
+ "end": "(?x) # Detect end of type definition by decreasing indentation:\n (?=\\}|;) # Explicit indentation\n |^(?! # Implicit indentation: end match on newline *unless* the new line is either:\n \\1\\s+\\S # - more indented, or\n | \\s* # - starts with whitespace, followed by:\n (?: $ # - the end of the line (i.e. empty line), or\n |\\{-[^@] # - the start of a block comment, or\n |--+ # - the start of a single-line comment.\n (?![\\p{S}\\p{P}&&[^(),;\\[\\]{}`_\"']]).*$) # non-symbol\n # The double dash may not be followed by other operator characters\n # (then it would be an operator, not a comment)\n )\n",
361
361
  "name": "meta.declaration.type.haskell",
362
362
  "patterns": [
363
363
  {
@@ -372,7 +372,7 @@
372
372
  "name": "keyword.other.instance.haskell"
373
373
  }
374
374
  },
375
- "end": "(?=\\b(?<!')(where)\\b(?!'))|(?=\\}|;)|^(?!\\1\\s+\\S|\\s*(?:$|\\{-[^@]|--+(?![\\p{S}\\p{P}&&[^(),;\\[\\]{}`_\"']]).*$))",
375
+ "end": "(?=\\b(?<!')(where)\\b(?!'))|(?=[};])|^(?!\\1\\s+\\S|\\s*(?:$|\\{-[^@]|--+(?![[\\p{S}\\p{P}]&&[^(),;\\[\\]{}`_\"']]).*$))",
376
376
  "name": "meta.declaration.instance.haskell",
377
377
  "patterns": [
378
378
  {
@@ -393,7 +393,7 @@
393
393
  "name": "keyword.other.import.haskell"
394
394
  }
395
395
  },
396
- "end": "(?=\\b(?<!')(where)\\b(?!'))|(?=\\}|;)|^(?!\\1\\s+\\S|\\s*(?:$|\\{-[^@]|--+(?![\\p{S}\\p{P}&&[^(),;\\[\\]{}`_\"']]).*$))",
396
+ "end": "(?=\\b(?<!')(where)\\b(?!'))|(?=[};])|^(?!\\1\\s+\\S|\\s*(?:$|\\{-[^@]|--+(?![[\\p{S}\\p{P}]&&[^(),;\\[\\]{}`_\"']]).*$))",
397
397
  "name": "meta.import.haskell",
398
398
  "patterns": [
399
399
  {
@@ -536,7 +536,7 @@
536
536
  "name": "punctuation.bracket.haskell"
537
537
  }
538
538
  },
539
- "end": "(\\])",
539
+ "end": "(])",
540
540
  "endCaptures": {
541
541
  "1": {
542
542
  "name": "punctuation.bracket.haskell"
@@ -562,7 +562,7 @@
562
562
  "include": "#comment_like"
563
563
  },
564
564
  {
565
- "begin": "(?<![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']])(?:(=)|(\\|))(?![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']])",
565
+ "begin": "(?<![[\\p{S}\\p{P}]&&[^(),;\\[\\]`{}_\"']])(?:(=)|(\\|))(?![[\\p{S}\\p{P}]&&[^(),;\\[\\]`{}_\"']])",
566
566
  "beginCaptures": {
567
567
  "1": {
568
568
  "name": "keyword.operator.eq.haskell"
@@ -571,7 +571,7 @@
571
571
  "name": "keyword.operator.pipe.haskell"
572
572
  }
573
573
  },
574
- "end": "(?:\\G|^)\\s*(?:(?:(?<!')\\b((?:[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'\\.])+)|('?(?<paren>\\((?:[^\\(\\)]*|\\g<paren>)*\\)))|('?(?<brac>\\((?:[^\\[\\]]*|\\g<brac>)*\\])))\\s*(?:(?<![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']])(:[\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']]*)|(`)([\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)(`)))|(?:(?<!')\\b([\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*))|(\\()\\s*(:[\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']]*)\\s*(\\))",
574
+ "end": "(?:\\G|^)\\s*(?:(?<!')\\b([\\p{Ll}_\\p{Lu}\\p{Lt}\\d'.]+)|('?(?<paren>\\((?:[^()]*|\\g<paren>)*\\)))|('?(?<brac>\\((?:[^\\[\\]]*|\\g<brac>)*])))\\s*(?:(?<![[\\p{S}\\p{P}]&&[^(),;\\[\\]`{}_\"']])(:[[\\p{S}\\p{P}]&&[^(),;\\[\\]`{}_\"']]*)|(`)([\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\d']*)(`))|(?<!')\\b([\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\d']*)|(\\()\\s*(:[[\\p{S}\\p{P}]&&[^(),;\\[\\]`{}_\"']]*)\\s*(\\))",
575
575
  "endCaptures": {
576
576
  "1": {
577
577
  "patterns": [
@@ -647,7 +647,7 @@
647
647
  "name": "punctuation.definition.comment.haskell"
648
648
  }
649
649
  },
650
- "end": "-\\}",
650
+ "end": "-}",
651
651
  "name": "comment.block.haskell",
652
652
  "patterns": [
653
653
  {
@@ -676,7 +676,7 @@
676
676
  "name": "punctuation.definition.string.end.haskell"
677
677
  }
678
678
  },
679
- "match": "(?<![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(')(?:[\\ -\\[\\]-~]|(\\\\(?:NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|[abfnrtv\\\\\\\"'\\\\&]))|(\\\\o[0-7]+)|(\\\\x[0-9A-Fa-f]+)|(\\\\\\^[A-Z@\\[\\]\\\\\\^_]))(')",
679
+ "match": "(?<![\\p{Ll}_\\p{Lu}\\p{Lt}\\d'])(')(?:[ -\\[\\]-~]|(\\\\(?:NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|[abfnrtv\\\\\"'\\&]))|(\\\\o[0-7]+)|(\\\\x\\h+)|(\\\\\\^[A-Z@\\[\\]\\\\\\^_]))(')",
680
680
  "name": "string.quoted.single.haskell"
681
681
  },
682
682
  "comma": {
@@ -699,7 +699,7 @@
699
699
  "comments": {
700
700
  "patterns": [
701
701
  {
702
- "begin": "^(\\s*)(--\\s[\\|\\$])",
702
+ "begin": "^(\\s*)(--\\s[|$])",
703
703
  "beginCaptures": {
704
704
  "2": {
705
705
  "name": "punctuation.whitespace.comment.leading.haskell"
@@ -709,7 +709,7 @@
709
709
  "name": "comment.block.documentation.haskell"
710
710
  },
711
711
  {
712
- "begin": "(^[ \\t]+)?(--\\s[\\^\\*])",
712
+ "begin": "(^[ \\t]+)?(--\\s[\\^*])",
713
713
  "beginCaptures": {
714
714
  "1": {
715
715
  "name": "punctuation.whitespace.comment.leading.haskell"
@@ -720,13 +720,13 @@
720
720
  },
721
721
  {
722
722
  "applyEndPatternLast": 1,
723
- "begin": "\\{-\\s?[\\|\\$\\*\\^]",
723
+ "begin": "\\{-\\s?[|$*\\^]",
724
724
  "captures": {
725
725
  "0": {
726
726
  "name": "punctuation.definition.comment.haskell"
727
727
  }
728
728
  },
729
- "end": "-\\}",
729
+ "end": "-}",
730
730
  "name": "comment.block.documentation.haskell",
731
731
  "patterns": [
732
732
  {
@@ -735,7 +735,7 @@
735
735
  ]
736
736
  },
737
737
  {
738
- "begin": "(^[ \\t]+)?(?=--+(?![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']]))",
738
+ "begin": "(^[ \\t]+)?(?=--+(?![[\\p{S}\\p{P}]&&[^(),;\\[\\]`{}_\"']]))",
739
739
  "beginCaptures": {
740
740
  "1": {
741
741
  "name": "punctuation.whitespace.comment.leading.haskell"
@@ -776,7 +776,7 @@
776
776
  "name": "keyword.operator.big-arrow.haskell"
777
777
  }
778
778
  },
779
- "match": "(.*)(?<![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']])(=>|⇒)(?![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']])"
779
+ "match": "(.*)(?<![[\\p{S}\\p{P}]&&[^(),;\\[\\]`{}_\"']])(=>|⇒)(?![[\\p{S}\\p{P}]&&[^(),;\\[\\]`{}_\"']])"
780
780
  },
781
781
  "cpp": {
782
782
  "captures": {
@@ -788,7 +788,7 @@
788
788
  "name": "meta.preprocessor.c"
789
789
  },
790
790
  "data_constructor": {
791
- "match": "\\b(?<!')[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?![\\.'\\w])",
791
+ "match": "\\b(?<!')[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\d']*(?![.'\\w])",
792
792
  "name": "constant.other.haskell"
793
793
  },
794
794
  "deriving": {
@@ -803,7 +803,7 @@
803
803
  "name": "keyword.other.deriving.strategy.$3.haskell"
804
804
  }
805
805
  },
806
- "end": "(?=\\}|;)|^(?!\\1\\s+\\S|\\s*(?:$|\\{-[^@]|--+(?![\\p{S}\\p{P}&&[^(),;\\[\\]{}`_\"']]).*$))",
806
+ "end": "(?x) # Detect end of deriving statement\n # Decreasing indentation\n (?=\\}|;) # Explicit indentation\n |^(?! # Implicit indentation: end match on newline *unless* the new line is either:\n \\1\\s+\\S # - more indented, or\n | \\s* # - starts with whitespace, followed by:\n (?: $ # - the end of the line (i.e. empty line), or\n |\\{-[^@] # - the start of a block comment, or\n |--+ # - the start of a single-line comment.\n (?![\\p{S}\\p{P}&&[^(),;\\[\\]{}`_\"']]).*$) # non-symbol\n # The double dash may not be followed by other operator characters\n # (then it would be an operator, not a comment)\n )",
807
807
  "name": "meta.deriving.haskell",
808
808
  "patterns": [
809
809
  {
@@ -878,7 +878,7 @@
878
878
  ]
879
879
  }
880
880
  },
881
- "match": "(deriving)(?:\\s+(stock|newtype|anyclass))?\\s+([\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)(\\s+(via)\\s+(.*)$)?",
881
+ "match": "(deriving)(?:\\s+(stock|newtype|anyclass))?\\s+([\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\d']*)(\\s+(via)\\s+(.*)$)?",
882
882
  "name": "meta.deriving.haskell"
883
883
  },
884
884
  {
@@ -893,7 +893,7 @@
893
893
  "name": "keyword.operator.double-colon.haskell"
894
894
  }
895
895
  },
896
- "match": "\\s*(::|∷)(?![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']])\\s*"
896
+ "match": "\\s*(::|∷)(?![[\\p{S}\\p{P}]&&[^(),;\\[\\]`{}_\"']])\\s*"
897
897
  },
898
898
  "export_constructs": {
899
899
  "patterns": [
@@ -907,7 +907,7 @@
907
907
  "name": "keyword.other.pattern.haskell"
908
908
  }
909
909
  },
910
- "end": "([\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)|(\\()\\s*(:[\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']]+)\\s*(\\))",
910
+ "end": "([\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\d']*)|(\\()\\s*(:[[\\p{S}\\p{P}]&&[^(),;\\[\\]`{}_\"']]+)\\s*(\\))",
911
911
  "endCaptures": {
912
912
  "1": {
913
913
  "name": "constant.other.haskell"
@@ -935,7 +935,7 @@
935
935
  "name": "keyword.other.type.haskell"
936
936
  }
937
937
  },
938
- "end": "([\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)|(\\()\\s*([\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']]+)\\s*(\\))",
938
+ "end": "([\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\d']*)|(\\()\\s*([[\\p{S}\\p{P}]&&[^(),;\\[\\]`{}_\"']]+)\\s*(\\))",
939
939
  "endCaptures": {
940
940
  "1": {
941
941
  "name": "storage.type.haskell"
@@ -957,11 +957,11 @@
957
957
  ]
958
958
  },
959
959
  {
960
- "match": "(?<!')\\b[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*",
960
+ "match": "(?<!')\\b[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\d']*",
961
961
  "name": "entity.name.function.haskell"
962
962
  },
963
963
  {
964
- "match": "(?<!')\\b[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*",
964
+ "match": "(?<!')\\b[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\d']*",
965
965
  "name": "storage.type.haskell"
966
966
  },
967
967
  {
@@ -985,7 +985,7 @@
985
985
  "name": "keyword.other.$3.haskell"
986
986
  }
987
987
  },
988
- "end": "(?=\\}|;)|^(?!\\1\\s+\\S|\\s*(?:$|\\{-[^@]|--+(?![\\p{S}\\p{P}&&[^(),;\\[\\]{}`_\"']]).*$))",
988
+ "end": "(?x) # Detect end of FFI block by decreasing indentation:\n (?=\\}|;) # Explicit indentation\n |^(?! # Implicit indentation: end match on newline *unless* the new line is either:\n \\1\\s+\\S # - more indented, or\n | \\s* # - starts with whitespace, followed by:\n (?: $ # - the end of the line (i.e. empty line), or\n |\\{-[^@] # - the start of a block comment, or\n |--+ # - the start of a single-line comment.\n (?![\\p{S}\\p{P}&&[^(),;\\[\\]{}`_\"']]).*$) # non-symbol\n # The double dash may not be followed by other operator characters\n # (then it would be an operator, not a comment)\n )\n",
989
989
  "name": "meta.$3.foreign.haskell",
990
990
  "patterns": [
991
991
  {
@@ -1000,8 +1000,8 @@
1000
1000
  "match": "\\b(?<!')(ccall|cplusplus|dotnet|jvm|stdcall|prim|capi)\\s+"
1001
1001
  },
1002
1002
  {
1003
- "begin": "(?=\")|(?=\\b(?<!')([\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)\\b(?!'))",
1004
- "end": "(?=(::|∷)(?![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']]))",
1003
+ "begin": "(?=\")|(?=\\b(?<!')([\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\d']*)\\b(?!'))",
1004
+ "end": "(?=(::|∷)(?![[\\p{S}\\p{P}]&&[^(),;\\[\\]`{}_\"']]))",
1005
1005
  "patterns": [
1006
1006
  {
1007
1007
  "include": "#comment_like"
@@ -1026,7 +1026,7 @@
1026
1026
  "name": "entity.name.function.infix.haskell"
1027
1027
  }
1028
1028
  },
1029
- "match": "\\b(?<!')(safe|unsafe|interruptible)\\b(?!')\\s*(\"(?:\\\\\"|[^\"])*\")?\\s*(?:(?:\\b(?<!'')([\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)\\b(?!'))|(?:\\(\\s*(?!--+\\))([\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']]+)\\s*\\)))"
1029
+ "match": "\\b(?<!')(safe|unsafe|interruptible)\\b(?!')\\s*(\"(?:\\\\\"|[^\"])*\")?\\s*(?:\\b(?<!'')([\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\d']*)\\b(?!')|\\(\\s*(?!--+\\))([[\\p{S}\\p{P}]&&[^(),;\\[\\]`{}_\"']]+)\\s*\\))"
1030
1030
  },
1031
1031
  {
1032
1032
  "captures": {
@@ -1072,7 +1072,7 @@
1072
1072
  "name": "punctuation.paren.haskell"
1073
1073
  }
1074
1074
  },
1075
- "match": "(?:\\b(?<!'')([\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)\\b(?!'))|(?:(\\()\\s*(?!--+\\))([\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']]+)\\s*(\\)))"
1075
+ "match": "\\b(?<!'')([\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\d']*)\\b(?!')|(\\()\\s*(?!--+\\))([[\\p{S}\\p{P}]&&[^(),;\\[\\]`{}_\"']]+)\\s*(\\))"
1076
1076
  }
1077
1077
  ]
1078
1078
  },
@@ -1093,7 +1093,7 @@
1093
1093
  "name": "constant.numeric.floating.hexadecimal.haskell"
1094
1094
  }
1095
1095
  },
1096
- "match": "\\b(?<!')(?:([0-9][_0-9]*\\.[0-9][_0-9]*(?:[eE][-+]?[0-9][_0-9]*)?|[0-9][_0-9]*[eE][-+]?[0-9][_0-9]*)|(0[xX]_*[0-9a-fA-F][_0-9a-fA-F]*\\.[0-9a-fA-F][_0-9a-fA-F]*(?:[pP][-+]?[0-9][_0-9]*)?|0[xX]_*[0-9a-fA-F][_0-9a-fA-F]*[pP][-+]?[0-9][_0-9]*))\\b(?!')"
1096
+ "match": "\\b(?<!')(?:([0-9][_0-9]*\\.[0-9][_0-9]*(?:[eE][\\-+]?[0-9][_0-9]*)?|[0-9][_0-9]*[eE][\\-+]?[0-9][_0-9]*)|(0(?:[xX]_*\\h[_\\h]*\\.\\h[_\\h]*(?:[pP][\\-+]?[0-9][_0-9]*)?|[xX]_*\\h[_\\h]*[pP][\\-+]?[0-9][_0-9]*)))\\b(?!')"
1097
1097
  },
1098
1098
  "forall": {
1099
1099
  "begin": "\\b(?<!')(forall|∀)\\b(?!')",
@@ -1124,7 +1124,7 @@
1124
1124
  ]
1125
1125
  },
1126
1126
  "fun_decl": {
1127
- "begin": "^(\\s*)(?<fn>(?:[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*\\#*|\\(\\s*(?!--+\\))[\\p{S}\\p{P}&&[^(),:;\\[\\]`{}_\"']][\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']]*\\s*\\))(?:\\s*,\\s*\\g<fn>)?)\\s*(?<![\\p{S}\\p{P}&&[^\\),;\\]`}_\"']])(::|∷)(?![\\p{S}\\p{P}&&[^\\(,;\\[`{_\"']])",
1127
+ "begin": "^(\\s*)(?<fn>(?:[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\d']*#*|\\(\\s*(?!--+\\))[[\\p{S}\\p{P}]&&[^(),:;\\[\\]`{}_\"']][[\\p{S}\\p{P}]&&[^(),;\\[\\]`{}_\"']]*\\s*\\))(?:\\s*,\\s*\\g<fn>)?)\\s*(?<![[\\p{S}\\p{P}]&&[^),;\\]`}_\"']])(::|∷)(?![[\\p{S}\\p{P}]&&[^(,;\\[`{_\"']])",
1128
1128
  "beginCaptures": {
1129
1129
  "2": {
1130
1130
  "name": "entity.name.function.haskell",
@@ -1141,7 +1141,7 @@
1141
1141
  "name": "keyword.operator.double-colon.haskell"
1142
1142
  }
1143
1143
  },
1144
- "end": "(?=(?<![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']])((<-|←)|(=)|(-<|↢)|(-<<|⤛))([(),;\\[\\]`{}_\"']|[^\\p{S}\\p{P}]))|(?=\\}|;)|^(?!\\1\\s+\\S|\\s*(?:$|\\{-[^@]|--+(?![\\p{S}\\p{P}&&[^(),;\\[\\]{}`_\"']]).*$))",
1144
+ "end": "(?=(?<![[\\p{S}\\p{P}]&&[^(),;\\[\\]`{}_\"']])((<-|←)|(=)|(-<|↢)|(-<<|⤛))([(),;\\[\\]`{}_\"'[^\\p{S}\\p{P}]]))|(?=[};])|^(?!\\1\\s+\\S|\\s*(?:$|\\{-[^@]|--+(?![[\\p{S}\\p{P}]&&[^(),;\\[\\]{}`_\"']]).*$))",
1145
1145
  "name": "meta.function.type-declaration.haskell",
1146
1146
  "patterns": [
1147
1147
  {
@@ -1152,7 +1152,7 @@
1152
1152
  "gadt_constructor": {
1153
1153
  "patterns": [
1154
1154
  {
1155
- "begin": "^(\\s*)(?:(\\b(?<!')[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)|(\\()\\s*(:[\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']]*)\\s*(\\)))",
1155
+ "begin": "^(\\s*)(?:(\\b(?<!')[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\d']*)|(\\()\\s*(:[[\\p{S}\\p{P}]&&[^(),;\\[\\]`{}_\"']]*)\\s*(\\)))",
1156
1156
  "beginCaptures": {
1157
1157
  "2": {
1158
1158
  "name": "constant.other.haskell"
@@ -1167,7 +1167,7 @@
1167
1167
  "name": "punctuation.paren.haskell"
1168
1168
  }
1169
1169
  },
1170
- "end": "(?=\\b(?<!'')deriving\\b(?!'))|(?=\\}|;)|^(?!\\1\\s+\\S|\\s*(?:$|\\{-[^@]|--+(?![\\p{S}\\p{P}&&[^(),;\\[\\]{}`_\"']]).*$))",
1170
+ "end": "(?x)\n # GADT constructor ends\n (?=\\b(?<!'')deriving\\b(?!')) \n # Decreasing indentation\n |(?=\\}|;) # Explicit indentation\n |^(?! # Implicit indentation: end match on newline *unless* the new line is either:\n \\1\\s+\\S # - more indented, or\n | \\s* # - starts with whitespace, followed by:\n (?: $ # - the end of the line (i.e. empty line), or\n |\\{-[^@] # - the start of a block comment, or\n |--+ # - the start of a single-line comment.\n (?![\\p{S}\\p{P}&&[^(),;\\[\\]{}`_\"']]).*$) # non-symbol\n # The double dash may not be followed by other operator characters\n # (then it would be an operator, not a comment)\n )\n",
1171
1171
  "patterns": [
1172
1172
  {
1173
1173
  "include": "#comment_like"
@@ -1187,7 +1187,7 @@
1187
1187
  ]
1188
1188
  },
1189
1189
  {
1190
- "begin": "(\\b(?<!')[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}]*)|(\\()\\s*(:[\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']]*)\\s*(\\))",
1190
+ "begin": "(\\b(?<!')[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\d]*)|(\\()\\s*(:[[\\p{S}\\p{P}]&&[^(),;\\[\\]`{}_\"']]*)\\s*(\\))",
1191
1191
  "beginCaptures": {
1192
1192
  "1": {
1193
1193
  "name": "constant.other.haskell"
@@ -1237,7 +1237,7 @@
1237
1237
  "name": "keyword.operator.infix.haskell"
1238
1238
  }
1239
1239
  },
1240
- "match": "((?:(?<!'')('')?[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'']*\\.)*)(\\#+|[\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']]+(?<!\\#))"
1240
+ "match": "((?:(?<!'')('')?[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\d']*\\.)*)(#+|[[\\p{S}\\p{P}]&&[^(),;\\[\\]`{}_\"']]+(?<!#))"
1241
1241
  },
1242
1242
  {
1243
1243
  "captures": {
@@ -1258,7 +1258,7 @@
1258
1258
  "name": "punctuation.backtick.haskell"
1259
1259
  }
1260
1260
  },
1261
- "match": "(`)((?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'']*\\.)*)([\\p{Ll}\\p{Lu}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'']*)(`)",
1261
+ "match": "(`)((?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\d']*\\.)*)([\\p{Ll}\\p{Lu}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\d']*)(`)",
1262
1262
  "name": "keyword.operator.function.infix.haskell"
1263
1263
  }
1264
1264
  ]
@@ -1270,7 +1270,7 @@
1270
1270
  "name": "punctuation.bracket.haskell"
1271
1271
  }
1272
1272
  },
1273
- "end": "\\]",
1273
+ "end": "]",
1274
1274
  "endCaptures": {
1275
1275
  "0": {
1276
1276
  "name": "punctuation.bracket.haskell"
@@ -1306,7 +1306,7 @@
1306
1306
  "name": "constant.numeric.integral.binary.haskell"
1307
1307
  }
1308
1308
  },
1309
- "match": "\\b(?<!')(?:([0-9][_0-9]*)|(0[xX]_*[0-9a-fA-F][_0-9a-fA-F]*)|(0[oO]_*[0-7][_0-7]*)|(0[bB]_*[01][_01]*))\\b(?!')"
1309
+ "match": "\\b(?<!')(?:([0-9][_0-9]*)|(0[xX]_*\\h[_\\h]*)|(0[oO]_*[0-7][_0-7]*)|(0[bB]_*[01][_01]*))\\b(?!')"
1310
1310
  },
1311
1311
  "keyword": {
1312
1312
  "captures": {
@@ -1332,7 +1332,7 @@
1332
1332
  "name": "punctuation.brace.haskell"
1333
1333
  }
1334
1334
  },
1335
- "end": "(\\})",
1335
+ "end": "(})",
1336
1336
  "endCaptures": {
1337
1337
  "1": {
1338
1338
  "name": "punctuation.brace.haskell"
@@ -1350,7 +1350,7 @@
1350
1350
  },
1351
1351
  "liquid_haskell": {
1352
1352
  "begin": "\\{-@",
1353
- "end": "@-\\}",
1353
+ "end": "@-}",
1354
1354
  "name": "block.liquidhaskell.haskell",
1355
1355
  "patterns": [
1356
1356
  {
@@ -1422,7 +1422,7 @@
1422
1422
  ]
1423
1423
  },
1424
1424
  "module_name": {
1425
- "match": "(?<conid>[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(\\.\\g<conid>)?)",
1425
+ "match": "(?<conid>[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\d']*(\\.\\g<conid>)?)",
1426
1426
  "name": "entity.name.namespace.haskell"
1427
1427
  },
1428
1428
  "numeric_literals": {
@@ -1450,24 +1450,24 @@
1450
1450
  ]
1451
1451
  }
1452
1452
  },
1453
- "match": "(?<![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}\\p{S}\\p{P}&&[^(,;\\[`{]])(\\#)(?:(\"(?:\\\\\"|[^\"])*\")|[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'\\.]+)",
1453
+ "match": "(?<![[\\p{Ll}_\\p{Lu}\\p{Lt}\\d\\p{S}\\p{P}]&&[^(,;\\[`{]])(#)(?:(\"(?:\\\\\"|[^\"])*\")|[\\p{Ll}_\\p{Lu}\\p{Lt}\\d'.]+)",
1454
1454
  "name": "entity.name.label.haskell"
1455
1455
  }
1456
1456
  ]
1457
1457
  },
1458
1458
  "pragma": {
1459
1459
  "begin": "\\{-#",
1460
- "end": "#-\\}",
1460
+ "end": "#-}",
1461
1461
  "name": "meta.preprocessor.haskell",
1462
1462
  "patterns": [
1463
1463
  {
1464
- "begin": "(?xi) \\b(?<!')(LANGUAGE)\\b(?!')",
1464
+ "begin": "(?i)\\b(?<!')(LANGUAGE)\\b(?!')",
1465
1465
  "beginCaptures": {
1466
1466
  "1": {
1467
1467
  "name": "keyword.other.preprocessor.pragma.haskell"
1468
1468
  }
1469
1469
  },
1470
- "end": "(?=#-\\})",
1470
+ "end": "(?=#-})",
1471
1471
  "patterns": [
1472
1472
  {
1473
1473
  "match": "(?:No)?(?:AutoDeriveTypeable|DatatypeContexts|DoRec|IncoherentInstances|MonadFailDesugaring|MonoPatBinds|NullaryTypeClasses|OverlappingInstances|PatternSignatures|RecordPuns|RelaxedPolyRec)",
@@ -1479,7 +1479,7 @@
1479
1479
  "name": "keyword.other.preprocessor.extension.haskell"
1480
1480
  }
1481
1481
  },
1482
- "match": "((?:No)?(?:AllowAmbiguousTypes|AlternativeLayoutRule|AlternativeLayoutRuleTransitional|Arrows|BangPatterns|BinaryLiterals|CApiFFI|CPP|CUSKs|ConstrainedClassMethods|ConstraintKinds|DataKinds|DefaultSignatures|DeriveAnyClass|DeriveDataTypeable|DeriveFoldable|DeriveFunctor|DeriveGeneric|DeriveLift|DeriveTraversable|DerivingStrategies|DerivingVia|DisambiguateRecordFields|DoAndIfThenElse|BlockArguments|DuplicateRecordFields|EmptyCase|EmptyDataDecls|EmptyDataDeriving|ExistentialQuantification|ExplicitForAll|ExplicitNamespaces|ExtendedDefaultRules|FlexibleContexts|FlexibleInstances|ForeignFunctionInterface|FunctionalDependencies|GADTSyntax|GADTs|GHCForeignImportPrim|Generali(?:s|z)edNewtypeDeriving|ImplicitParams|ImplicitPrelude|ImportQualifiedPost|ImpredicativeTypes|TypeFamilyDependencies|InstanceSigs|ApplicativeDo|InterruptibleFFI|JavaScriptFFI|KindSignatures|LambdaCase|LiberalTypeSynonyms|MagicHash|MonadComprehensions|MonoLocalBinds|MonomorphismRestriction|MultiParamTypeClasses|MultiWayIf|NumericUnderscores|NPlusKPatterns|NamedFieldPuns|NamedWildCards|NegativeLiterals|HexFloatLiterals|NondecreasingIndentation|NumDecimals|OverloadedLabels|OverloadedLists|OverloadedStrings|PackageImports|ParallelArrays|ParallelListComp|PartialTypeSignatures|PatternGuards|PatternSynonyms|PolyKinds|PolymorphicComponents|QuantifiedConstraints|PostfixOperators|QuasiQuotes|Rank2Types|RankNTypes|RebindableSyntax|RecordWildCards|RecursiveDo|RelaxedLayout|RoleAnnotations|ScopedTypeVariables|StandaloneDeriving|StarIsType|StaticPointers|Strict|StrictData|TemplateHaskell|TemplateHaskellQuotes|StandaloneKindSignatures|TraditionalRecordSyntax|TransformListComp|TupleSections|TypeApplications|TypeInType|TypeFamilies|TypeOperators|TypeSynonymInstances|UnboxedTuples|UnboxedSums|UndecidableInstances|UndecidableSuperClasses|UnicodeSyntax|UnliftedFFITypes|UnliftedNewtypes|ViewPatterns))"
1482
+ "match": "((?:No)?(?:AllowAmbiguousTypes|AlternativeLayoutRule|AlternativeLayoutRuleTransitional|Arrows|BangPatterns|BinaryLiterals|CApiFFI|CPP|CUSKs|ConstrainedClassMethods|ConstraintKinds|DataKinds|DefaultSignatures|DeriveAnyClass|DeriveDataTypeable|DeriveFoldable|DeriveFunctor|DeriveGeneric|DeriveLift|DeriveTraversable|DerivingStrategies|DerivingVia|DisambiguateRecordFields|DoAndIfThenElse|BlockArguments|DuplicateRecordFields|EmptyCase|EmptyDataDecls|EmptyDataDeriving|ExistentialQuantification|ExplicitForAll|ExplicitNamespaces|ExtendedDefaultRules|FlexibleContexts|FlexibleInstances|ForeignFunctionInterface|FunctionalDependencies|GADTSyntax|GADTs|GHCForeignImportPrim|Generali[sz]edNewtypeDeriving|ImplicitParams|ImplicitPrelude|ImportQualifiedPost|ImpredicativeTypes|TypeFamilyDependencies|InstanceSigs|ApplicativeDo|InterruptibleFFI|JavaScriptFFI|KindSignatures|LambdaCase|LiberalTypeSynonyms|MagicHash|MonadComprehensions|MonoLocalBinds|MonomorphismRestriction|MultiParamTypeClasses|MultiWayIf|NumericUnderscores|NPlusKPatterns|NamedFieldPuns|NamedWildCards|NegativeLiterals|HexFloatLiterals|NondecreasingIndentation|NumDecimals|OverloadedLabels|OverloadedLists|OverloadedStrings|PackageImports|ParallelArrays|ParallelListComp|PartialTypeSignatures|PatternGuards|PatternSynonyms|PolyKinds|PolymorphicComponents|QuantifiedConstraints|PostfixOperators|QuasiQuotes|Rank2Types|RankNTypes|RebindableSyntax|RecordWildCards|RecursiveDo|RelaxedLayout|RoleAnnotations|ScopedTypeVariables|StandaloneDeriving|StarIsType|StaticPointers|Strict|StrictData|TemplateHaskell|TemplateHaskellQuotes|StandaloneKindSignatures|TraditionalRecordSyntax|TransformListComp|TupleSections|TypeApplications|TypeInType|TypeFamilies|TypeOperators|TypeSynonymInstances|UnboxedTuples|UnboxedSums|UndecidableInstances|UndecidableSuperClasses|UnicodeSyntax|UnliftedFFITypes|UnliftedNewtypes|ViewPatterns))"
1483
1483
  },
1484
1484
  {
1485
1485
  "include": "#comma"
@@ -1487,7 +1487,7 @@
1487
1487
  ]
1488
1488
  },
1489
1489
  {
1490
- "begin": "(?xi)\n \\b(?<!')(SPECIALI(?:S|Z)E)\n (?:\n \\s*( \\[ [^\\[\\]]* \\])?\\s*\n |\\s+\n )\n (instance)\\b(?!')",
1490
+ "begin": "(?i)\\b(?<!')(SPECIALI[SZ]E)(?:\\s*(\\[[^\\[\\]]*])?\\s*|\\s+)(instance)\\b(?!')",
1491
1491
  "beginCaptures": {
1492
1492
  "1": {
1493
1493
  "name": "keyword.other.preprocessor.pragma.haskell"
@@ -1503,7 +1503,7 @@
1503
1503
  "name": "keyword.other.instance.haskell"
1504
1504
  }
1505
1505
  },
1506
- "end": "(?=#-\\})",
1506
+ "end": "(?=#-})",
1507
1507
  "patterns": [
1508
1508
  {
1509
1509
  "include": "#type_signature"
@@ -1511,7 +1511,7 @@
1511
1511
  ]
1512
1512
  },
1513
1513
  {
1514
- "begin": "(?xi)\n \\b(?<!')(SPECIALI(?:S|Z)E)\\b(?!')\n (?:\\s+(INLINE)\\b(?!'))?\n (?:\\s*(\\[ [^\\[\\]]* \\])?)\n \\s*",
1514
+ "begin": "(?i)\\b(?<!')(SPECIALI[SZ]E)\\b(?!')(?:\\s+(INLINE)\\b(?!'))?\\s*(\\[[^\\[\\]]*])?\\s*",
1515
1515
  "beginCaptures": {
1516
1516
  "1": {
1517
1517
  "name": "keyword.other.preprocessor.pragma.haskell"
@@ -1527,7 +1527,7 @@
1527
1527
  ]
1528
1528
  }
1529
1529
  },
1530
- "end": "(?=#-\\})",
1530
+ "end": "(?=#-})",
1531
1531
  "patterns": [
1532
1532
  {
1533
1533
  "include": "$self"
@@ -1535,7 +1535,7 @@
1535
1535
  ]
1536
1536
  },
1537
1537
  {
1538
- "match": "(?xi) \\b(?<!')\n (LANGUAGE|OPTIONS_GHC|INCLUDE\n |MINIMAL|UNPACK|OVERLAPS|INCOHERENT\n |NOUNPACK|SOURCE|OVERLAPPING|OVERLAPPABLE|INLINE\n |NOINLINE|INLINE?ABLE|CONLIKE|LINE|COLUMN|RULES\n |COMPLETE)\\b(?!')",
1538
+ "match": "(?i)\\b(?<!')(LANGUAGE|OPTIONS_GHC|INCLUDE|MINIMAL|UNPACK|OVERLAPS|INCOHERENT|NOUNPACK|SOURCE|OVERLAPPING|OVERLAPPABLE|INLINE|NOINLINE|INLINE?ABLE|CONLIKE|LINE|COLUMN|RULES|COMPLETE)\\b(?!')",
1539
1539
  "name": "keyword.other.preprocessor.haskell"
1540
1540
  },
1541
1541
  {
@@ -1545,7 +1545,7 @@
1545
1545
  "name": "keyword.other.preprocessor.pragma.haskell"
1546
1546
  }
1547
1547
  },
1548
- "end": "(?=#-\\})",
1548
+ "end": "(?=#-})",
1549
1549
  "patterns": [
1550
1550
  {
1551
1551
  "include": "#string_literal"
@@ -1568,18 +1568,18 @@
1568
1568
  "name": "punctuation.paren.haskell"
1569
1569
  }
1570
1570
  },
1571
- "match": "(\\()\\s*(?!(?:--+|\\.\\.)\\))(\\#+|[\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']]+(?<!\\#))\\s*(\\))"
1571
+ "match": "(\\()\\s*(?!(?:--+|\\.\\.)\\))(#+|[[\\p{S}\\p{P}]&&[^(),;\\[\\]`{}_\"']]+(?<!#))\\s*(\\))"
1572
1572
  }
1573
1573
  ]
1574
1574
  },
1575
1575
  "qualifier": {
1576
- "match": "\\b(?<!')[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*\\.",
1576
+ "match": "\\b(?<!')[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\d']*\\.",
1577
1577
  "name": "entity.name.namespace.haskell"
1578
1578
  },
1579
1579
  "quasi_quote": {
1580
1580
  "patterns": [
1581
1581
  {
1582
- "begin": "(\\[)(e|d|p)?(\\|\\|?)",
1582
+ "begin": "(\\[)([edp])?(\\|\\|?)",
1583
1583
  "beginCaptures": {
1584
1584
  "1": {
1585
1585
  "name": "keyword.operator.quasi-quotation.begin.haskell"
@@ -1631,7 +1631,7 @@
1631
1631
  ]
1632
1632
  },
1633
1633
  {
1634
- "begin": "(\\[)(?:(\\$\\$)|(\\$))?((?:[^\\s\\p{S}\\p{P}]|[\\.'_])*)(\\|\\|?)",
1634
+ "begin": "(\\[)(?:(\\$\\$)|(\\$))?([[^\\s\\p{S}\\p{P}].'_]*)(\\|\\|?)",
1635
1635
  "beginCaptures": {
1636
1636
  "1": {
1637
1637
  "name": "keyword.operator.quasi-quotation.begin.haskell"
@@ -1665,7 +1665,7 @@
1665
1665
  ]
1666
1666
  },
1667
1667
  "record": {
1668
- "begin": "({)(?!-)",
1668
+ "begin": "(\\{)(?!-)",
1669
1669
  "beginCaptures": {
1670
1670
  "1": {
1671
1671
  "name": "punctuation.brace.haskell"
@@ -1688,7 +1688,7 @@
1688
1688
  ]
1689
1689
  },
1690
1690
  "record_decl": {
1691
- "begin": "({)(?!-)",
1691
+ "begin": "(\\{)(?!-)",
1692
1692
  "beginCaptures": {
1693
1693
  "1": {
1694
1694
  "name": "punctuation.brace.haskell"
@@ -1711,7 +1711,7 @@
1711
1711
  ]
1712
1712
  },
1713
1713
  "record_decl_field": {
1714
- "begin": "(?:([\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)|(\\()\\s*([\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']]+)\\s*(\\)))",
1714
+ "begin": "(?:([\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\d']*)|(\\()\\s*([[\\p{S}\\p{P}]&&[^(),;\\[\\]`{}_\"']]+)\\s*(\\)))",
1715
1715
  "beginCaptures": {
1716
1716
  "1": {
1717
1717
  "name": "variable.other.member.definition.haskell"
@@ -1753,7 +1753,7 @@
1753
1753
  "record_field": {
1754
1754
  "patterns": [
1755
1755
  {
1756
- "begin": "(?:([\\p{Ll}\\p{Lu}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}\\.']*)|(\\()\\s*([\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']]+)\\s*(\\)))",
1756
+ "begin": "(?:([\\p{Ll}\\p{Lu}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\d.']*)|(\\()\\s*([[\\p{S}\\p{P}]&&[^(),;\\[\\]`{}_\"']]+)\\s*(\\)))",
1757
1757
  "beginCaptures": {
1758
1758
  "1": {
1759
1759
  "name": "variable.other.member.haskell",
@@ -1802,7 +1802,7 @@
1802
1802
  "name": "variable.other.member.wildcard.haskell"
1803
1803
  }
1804
1804
  },
1805
- "match": "(?<![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']])(\\.\\.)(?![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']])"
1805
+ "match": "(?<![[\\p{S}\\p{P}]&&[^(),;\\[\\]`{}_\"']])(\\.\\.)(?![[\\p{S}\\p{P}]&&[^(),;\\[\\]`{}_\"']])"
1806
1806
  },
1807
1807
  "reserved_symbol": {
1808
1808
  "patterns": [
@@ -1845,7 +1845,7 @@
1845
1845
  "name": "keyword.operator.arrow.left.tail.double.haskell"
1846
1846
  }
1847
1847
  },
1848
- "match": "(?<![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"'']])(?:(\\.\\.)|(:)|(=)|(\\\\)|(\\|)|(<-|←)|(->|→)|(-<|↢)|(-<<|⤛)|(>-|⤚)|(>>-|⤜)|(∀))(?![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"'']])"
1848
+ "match": "(?<![[\\p{S}\\p{P}]&&[^(),;\\[\\]`{}_\"']])(?:(\\.\\.)|(:)|(=)|(\\\\)|(\\|)|(<-|←)|(->|→)|(-<|↢)|(-<<|⤛)|(>-|⤚)|(>>-|⤜)|(∀))(?![[\\p{S}\\p{P}]&&[^(),;\\[\\]`{}_\"']])"
1849
1849
  },
1850
1850
  {
1851
1851
  "captures": {
@@ -1853,7 +1853,7 @@
1853
1853
  "name": "keyword.operator.postfix.hash.haskell"
1854
1854
  }
1855
1855
  },
1856
- "match": "(?<=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}\\p{S}\\p{P}&&[^\\#,;\\[`{]])(\\#+)(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}\\p{S}\\p{P}&&[^),;\\]`}]])"
1856
+ "match": "(?<=[[\\p{Ll}_\\p{Lu}\\p{Lt}\\d\\p{S}\\p{P}]&&[^#,;\\[`{]])(#+)(?![[\\p{Ll}_\\p{Lu}\\p{Lt}\\d\\p{S}\\p{P}]&&[^),;\\]`}]])"
1857
1857
  },
1858
1858
  {
1859
1859
  "captures": {
@@ -1861,7 +1861,7 @@
1861
1861
  "name": "keyword.operator.infix.tight.at.haskell"
1862
1862
  }
1863
1863
  },
1864
- "match": "(?<=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}\\)\\}\\]])(@)(?=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}\\(\\[\\{])"
1864
+ "match": "(?<=[\\p{Ll}_\\p{Lu}\\p{Lt}\\d)}\\]])(@)(?=[\\p{Ll}_\\p{Lu}\\p{Lt}\\d(\\[{])"
1865
1865
  },
1866
1866
  {
1867
1867
  "captures": {
@@ -1881,7 +1881,7 @@
1881
1881
  "name": "keyword.operator.prefix.double-dollar.haskell"
1882
1882
  }
1883
1883
  },
1884
- "match": "(?<![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}\\p{S}\\p{P}&&[^(,;\\[`{]])(?:(~)|(!)|(-)|(\\$)|(\\$\\$))(?=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}\\(\\{\\[])"
1884
+ "match": "(?<![[\\p{Ll}_\\p{Lu}\\p{Lt}\\d\\p{S}\\p{P}]&&[^(,;\\[`{]])(?:(~)|(!)|(-)|(\\$)|(\\$\\$))(?=[\\p{Ll}_\\p{Lu}\\p{Lt}\\d({\\[])"
1885
1885
  }
1886
1886
  ]
1887
1887
  },
@@ -1897,7 +1897,7 @@
1897
1897
  "name": "keyword.other.role.haskell"
1898
1898
  }
1899
1899
  },
1900
- "end": "(?=\\}|;)|^(?!\\1\\s+\\S|\\s*(?:$|\\{-[^@]|--+(?![\\p{S}\\p{P}&&[^(),;\\[\\]{}`_\"']]).*$))",
1900
+ "end": "(?x) # Detect end of block by decreasing indentation:\n (?=\\}|;) # Explicit indentation\n |^(?! # Implicit indentation: end match on newline *unless* the new line is either:\n \\1\\s+\\S # - more indented, or\n | \\s* # - starts with whitespace, followed by:\n (?: $ # - the end of the line (i.e. empty line), or\n |\\{-[^@] # - the start of a block comment, or\n |--+ # - the start of a single-line comment.\n (?![\\p{S}\\p{P}&&[^(),;\\[\\]{}`_\"']]).*$) # non-symbol\n # The double dash may not be followed by other operator characters\n # (then it would be an operator, not a comment)\n )",
1901
1901
  "name": "meta.role-annotation.haskell",
1902
1902
  "patterns": [
1903
1903
  {
@@ -1921,13 +1921,13 @@
1921
1921
  "start_type_signature": {
1922
1922
  "patterns": [
1923
1923
  {
1924
- "begin": "^(\\s*)(::|∷)(?![\\p{S}\\p{P}&&[^\\(,;\\[`{_\"']])\\s*",
1924
+ "begin": "^(\\s*)(::|∷)(?![[\\p{S}\\p{P}]&&[^(,;\\[`{_\"']])\\s*",
1925
1925
  "beginCaptures": {
1926
1926
  "2": {
1927
1927
  "name": "keyword.operator.double-colon.haskell"
1928
1928
  }
1929
1929
  },
1930
- "end": "(?=\\#?\\)|\\]|,|(?<!')\\b(in|then|else|of)\\b(?!')|(?<![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']])(?:(\\\\|λ)|(<-|←)|(=)|(-<|↢)|(-<<|⤛))([(),;\\[\\]`{}_\"']|[^\\p{S}\\p{P}])|(\\#|@)-\\}|(?=\\}|;)|^(?!\\1\\s*\\S|\\s*(?:$|\\{-[^@]|--+(?![\\p{S}\\p{P}&&[^(),;\\[\\]{}`_\"']]).*$)))",
1930
+ "end": "(?=#?\\)|[\\],]|(?<!')\\b(in|then|else|of)\\b(?!')|(?<![[\\p{S}\\p{P}]&&[^(),;\\[\\]`{}_\"']])(?:([\\\\λ])|(<-|←)|(=)|(-<|↢)|(-<<|⤛))([(),;\\[\\]`{}_\"'[^\\p{S}\\p{P}]])|([#@])-}|(?=[};])|^(?!\\1\\s*\\S|\\s*(?:$|\\{-[^@]|--+(?![[\\p{S}\\p{P}]&&[^(),;\\[\\]{}`_\"']]).*$)))",
1931
1931
  "name": "meta.type-declaration.haskell",
1932
1932
  "patterns": [
1933
1933
  {
@@ -1936,13 +1936,13 @@
1936
1936
  ]
1937
1937
  },
1938
1938
  {
1939
- "begin": "(?<![\\p{S}\\p{P}&&[^\\(,;\\[`{_\"']])(::|∷)(?![\\p{S}\\p{P}&&[^\\(,;\\[`{_\"']])",
1939
+ "begin": "(?<![[\\p{S}\\p{P}]&&[^(,;\\[`{_\"']])(::|∷)(?![[\\p{S}\\p{P}]&&[^(,;\\[`{_\"']])",
1940
1940
  "beginCaptures": {
1941
1941
  "1": {
1942
1942
  "name": "keyword.operator.double-colon.haskell"
1943
1943
  }
1944
1944
  },
1945
- "end": "(?=\\#?\\)|\\]|,|\\b(?<!')(in|then|else|of)\\b(?!')|(\\#|@)-\\}|(?<![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']])(?:(\\\\|λ)|(<-|←)|(=)|(-<|↢)|(-<<|⤛))([(),;\\[\\]`{}_\"']|[^\\p{S}\\p{P}])|(?=\\}|;)|$)",
1945
+ "end": "(?=#?\\)|[\\],]|\\b(?<!')(in|then|else|of)\\b(?!')|([#@])-}|(?<![[\\p{S}\\p{P}]&&[^(),;\\[\\]`{}_\"']])(?:([\\\\λ])|(<-|←)|(=)|(-<|↢)|(-<<|⤛))([(),;\\[\\]`{}_\"'[^\\p{S}\\p{P}]])|(?=[};])|$)",
1946
1946
  "patterns": [
1947
1947
  {
1948
1948
  "include": "#type_signature"
@@ -1967,11 +1967,11 @@
1967
1967
  "name": "string.quoted.double.haskell",
1968
1968
  "patterns": [
1969
1969
  {
1970
- "match": "\\\\(NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|[abfnrtv\\\\\\\"'\\&])",
1970
+ "match": "\\\\(NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|[abfnrtv\\\\\"'\\&])",
1971
1971
  "name": "constant.character.escape.haskell"
1972
1972
  },
1973
1973
  {
1974
- "match": "\\\\o[0-7]+|\\\\x[0-9A-Fa-f]+|\\\\[0-9]+",
1974
+ "match": "\\\\(?:o[0-7]+|x\\h+|[0-9]+)",
1975
1975
  "name": "constant.character.escape.octal.haskell"
1976
1976
  },
1977
1977
  {
@@ -2041,7 +2041,7 @@
2041
2041
  "name": "punctuation.bracket.haskell"
2042
2042
  }
2043
2043
  },
2044
- "end": "\\]",
2044
+ "end": "]",
2045
2045
  "endCaptures": {
2046
2046
  "0": {
2047
2047
  "name": "punctuation.bracket.haskell"
@@ -2055,13 +2055,13 @@
2055
2055
  ]
2056
2056
  },
2057
2057
  {
2058
- "begin": "(?<=[\\s,;\\[\\]{}\"])(@)(?=\\\")",
2058
+ "begin": "(?<=[\\s,;\\[\\]{}\"])(@)(?=\")",
2059
2059
  "beginCaptures": {
2060
2060
  "1": {
2061
2061
  "name": "keyword.operator.prefix.at.haskell"
2062
2062
  }
2063
2063
  },
2064
- "end": "(?<=\\\")",
2064
+ "end": "(?<=\")",
2065
2065
  "name": "meta.type-application.haskell",
2066
2066
  "patterns": [
2067
2067
  {
@@ -2070,13 +2070,13 @@
2070
2070
  ]
2071
2071
  },
2072
2072
  {
2073
- "begin": "(?<=[\\s,;\\[\\]{}\"])(@)(?=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])",
2073
+ "begin": "(?<=[\\s,;\\[\\]{}\"])(@)(?=[\\p{Ll}_\\p{Lu}\\p{Lt}\\d'])",
2074
2074
  "beginCaptures": {
2075
2075
  "1": {
2076
2076
  "name": "keyword.operator.prefix.at.haskell"
2077
2077
  }
2078
2078
  },
2079
- "end": "(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])",
2079
+ "end": "(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\d'])",
2080
2080
  "name": "meta.type-application.haskell",
2081
2081
  "patterns": [
2082
2082
  {
@@ -2100,7 +2100,7 @@
2100
2100
  "name": "storage.type.haskell"
2101
2101
  }
2102
2102
  },
2103
- "match": "(')?((?:\\b[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*\\.)*)(\\b[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)"
2103
+ "match": "(')?((?:\\b[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\d']*\\.)*)(\\b[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\d']*)"
2104
2104
  },
2105
2105
  {
2106
2106
  "captures": {
@@ -2120,7 +2120,7 @@
2120
2120
  "name": "punctuation.paren.haskell"
2121
2121
  }
2122
2122
  },
2123
- "match": "(')?(\\()\\s*((?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*\\.)*)([\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']]+)\\s*(\\))"
2123
+ "match": "(')?(\\()\\s*((?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\d']*\\.)*)([[\\p{S}\\p{P}]&&[^(),;\\[\\]`{}_\"']]+)\\s*(\\))"
2124
2124
  }
2125
2125
  ]
2126
2126
  },
@@ -2138,7 +2138,7 @@
2138
2138
  "name": "storage.type.operator.infix.haskell"
2139
2139
  }
2140
2140
  },
2141
- "match": "(?:(?<!')('))?((?:\\b[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*\\.)*)(?![#@]?-})(\\#+|[\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']]+(?<!\\#))"
2141
+ "match": "(?:(?<!')('))?((?:\\b[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\d']*\\.)*)(?![#@]?-})(#+|[[\\p{S}\\p{P}]&&[^(),;\\[\\]`{}_\"']]+(?<!#))"
2142
2142
  },
2143
2143
  {
2144
2144
  "captures": {
@@ -2158,7 +2158,7 @@
2158
2158
  "name": "punctuation.backtick.haskell"
2159
2159
  }
2160
2160
  },
2161
- "match": "(')?(\\`)((?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*\\.)*)([\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)(`)"
2161
+ "match": "(')?(`)((?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\d']*\\.)*)([\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\d']*)(`)"
2162
2162
  }
2163
2163
  ]
2164
2164
  },
@@ -2263,14 +2263,14 @@
2263
2263
  "name": "punctuation.bracket.haskell"
2264
2264
  }
2265
2265
  },
2266
- "match": "(')?(\\[)\\s*(\\])",
2266
+ "match": "(')?(\\[)\\s*(])",
2267
2267
  "name": "support.constant.empty-list.haskell"
2268
2268
  },
2269
2269
  {
2270
2270
  "include": "#integer_literals"
2271
2271
  },
2272
2272
  {
2273
- "match": "(::|∷)(?![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"']])",
2273
+ "match": "(::|∷)(?![[\\p{S}\\p{P}]&&[^(),;\\[\\]`{}_\"']])",
2274
2274
  "name": "keyword.operator.double-colon.haskell"
2275
2275
  },
2276
2276
  {
@@ -2362,7 +2362,7 @@
2362
2362
  "name": "punctuation.bracket.haskell"
2363
2363
  }
2364
2364
  },
2365
- "end": "(\\])",
2365
+ "end": "(])",
2366
2366
  "endCaptures": {
2367
2367
  "1": {
2368
2368
  "name": "punctuation.bracket.haskell"
@@ -2383,7 +2383,7 @@
2383
2383
  ]
2384
2384
  },
2385
2385
  "type_variable": {
2386
- "match": "\\b(?<!')(?!(?:forall|deriving)\\b(?!'))[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*",
2386
+ "match": "\\b(?<!')(?!(?:forall|deriving)\\b(?!'))[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\d']*",
2387
2387
  "name": "variable.other.generic-type.haskell"
2388
2388
  },
2389
2389
  "where": {
@@ -2398,7 +2398,7 @@
2398
2398
  "name": "punctuation.brace.haskell"
2399
2399
  }
2400
2400
  },
2401
- "end": "(\\})",
2401
+ "end": "(})",
2402
2402
  "endCaptures": {
2403
2403
  "1": {
2404
2404
  "name": "punctuation.brace.haskell"