@codingame/monaco-editor-wrapper 1.14.9 → 2.1.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 (98) hide show
  1. package/dist/COBOL.tmLanguage.js +2 -2
  2. package/dist/META.js +100 -0
  3. package/dist/atd.js +114 -0
  4. package/dist/atd2.js +110 -0
  5. package/dist/cobol-snippets.js +2 -2117
  6. package/dist/cobol2.js +46 -0
  7. package/dist/cpp.tmLanguage.js +50 -15
  8. package/dist/cpptools.js +44 -3
  9. package/dist/cram.js +257 -0
  10. package/dist/dart3.js +37 -1
  11. package/dist/directives.tmLanguage.js +20 -0
  12. package/dist/dune-project.js +65 -0
  13. package/dist/dune-project2.js +481 -0
  14. package/dist/dune-workspace.js +65 -0
  15. package/dist/dune-workspace2.js +298 -0
  16. package/dist/dune.js +65 -0
  17. package/dist/dune2.js +2962 -0
  18. package/dist/erlang.js +4 -4
  19. package/dist/features/extensionConfigurations.js +11 -1
  20. package/dist/fsharp.tmLanguage.js +24 -4
  21. package/dist/index.js +38 -1
  22. package/dist/interpolations.tmLanguage.js +20 -0
  23. package/dist/java2.js +6 -0
  24. package/dist/json.js +1 -1
  25. package/dist/jsonc.js +1 -1
  26. package/dist/lua2.js +1089 -125
  27. package/dist/main.js +825 -426
  28. package/dist/markdown-svelte-css.js +37 -0
  29. package/dist/markdown-svelte-js.js +37 -0
  30. package/dist/markdown-svelte.js +59 -0
  31. package/dist/markdown-vue.js +59 -0
  32. package/dist/menhir-action.js +51 -0
  33. package/dist/menhir.js +597 -0
  34. package/dist/merlin.js +23 -23
  35. package/dist/monaco.d.ts +1 -1
  36. package/dist/oasis.js +99 -0
  37. package/dist/ocaml-dune-project.js +38 -0
  38. package/dist/ocaml-dune.js +53 -0
  39. package/dist/ocaml-markdown-codeblock.js +1 -1
  40. package/dist/ocaml-ocaml.js +88 -0
  41. package/dist/ocaml-ocamllex.js +12 -0
  42. package/dist/ocaml.META.js +29 -0
  43. package/dist/ocaml.interface.js +114 -0
  44. package/dist/ocaml.interface2.js +292 -0
  45. package/dist/ocaml.js +40 -8
  46. package/dist/ocaml.menhir.js +81 -0
  47. package/dist/ocaml.oasis.js +18 -0
  48. package/dist/ocaml.ocamlbuild.js +45 -0
  49. package/dist/ocaml.ocamlformat.js +8 -0
  50. package/dist/ocaml.ocamllex.js +60 -0
  51. package/dist/ocaml.opam-install.js +49 -0
  52. package/dist/ocaml.opam.js +69 -0
  53. package/dist/ocaml2.js +600 -2676
  54. package/dist/ocaml3.js +89 -105
  55. package/dist/ocamlbuild.js +142 -192
  56. package/dist/ocamldoc.js +54 -0
  57. package/dist/ocamlformat.js +206 -0
  58. package/dist/ocamllex.js +133 -0
  59. package/dist/omnisharp.js +2 -2
  60. package/dist/opam-install.js +40 -0
  61. package/dist/opam.js +100 -109
  62. package/dist/postcss.src.yaml.js +393 -0
  63. package/dist/pug-svelte-dotblock.js +69 -0
  64. package/dist/pug-svelte-tags.js +215 -0
  65. package/dist/pug-svelte.js +307 -0
  66. package/dist/reason-markdown-codeblock.js +1 -1
  67. package/dist/reason.js +0 -4
  68. package/dist/scalameta.js +5 -3
  69. package/dist/sql.tmLanguage.js +21 -5
  70. package/dist/svelte.js +118 -0
  71. package/dist/svelte.svelte-vscode-svelte.js +46 -0
  72. package/dist/svelte.svelte-vscode.js +373 -0
  73. package/dist/svelte.tmLanguage.src.yaml.js +1099 -0
  74. package/dist/theme-defaults~light_vs.js +2 -1
  75. package/dist/tools/EditorOpenHandlerRegistry.d.ts +8 -0
  76. package/dist/typescript-language-features.js +16 -0
  77. package/dist/typescript.js +20 -1
  78. package/dist/typescriptreact.js +20 -1
  79. package/dist/vetur.js +407 -0
  80. package/dist/vscode-R.js +55 -0
  81. package/dist/vscode-python.js +6 -6
  82. package/dist/vue-generated.js +1301 -0
  83. package/dist/vue-html.js +99 -0
  84. package/dist/vue-html.tmLanguage.js +573 -0
  85. package/dist/vue-postcss.js +72 -0
  86. package/dist/vue-sugarss.js +60 -0
  87. package/dist/vue-sugarss2.js +396 -0
  88. package/dist/vue.js +106 -0
  89. package/package.json +52 -6
  90. package/stats.html +1 -1
  91. package/dist/ocaml-hover-info.js +0 -34
  92. package/dist/ocaml-hover-type.js +0 -24
  93. package/dist/ocaml-reason.js +0 -100
  94. package/dist/reason-hover-info.js +0 -34
  95. package/dist/reason-hover-signature.js +0 -21
  96. package/dist/reason-hover-type.js +0 -21
  97. package/dist/services/MultiEditorStandaloneCodeEditorService.d.ts +0 -9
  98. package/dist/services/TextModelService.d.ts +0 -25
package/dist/ocaml2.js CHANGED
@@ -1,2969 +1,893 @@
1
1
  var name = "OCaml";
2
2
  var scopeName = "source.ocaml";
3
3
  var fileTypes = [
4
- ".ml",
5
- ".mli"
4
+ "ml",
5
+ "eliom",
6
+ ".ocamlinit"
6
7
  ];
7
8
  var patterns = [
8
9
  {
9
- include: "#comment"
10
+ include: "#directives"
10
11
  },
11
12
  {
12
- include: "#pragma"
13
+ include: "#comments"
13
14
  },
14
15
  {
15
- include: "#decl"
16
+ include: "#strings"
17
+ },
18
+ {
19
+ include: "#characters"
20
+ },
21
+ {
22
+ include: "#attributes"
23
+ },
24
+ {
25
+ include: "#extensions"
26
+ },
27
+ {
28
+ include: "#modules"
29
+ },
30
+ {
31
+ include: "#bindings"
32
+ },
33
+ {
34
+ include: "#operators"
35
+ },
36
+ {
37
+ include: "#keywords"
38
+ },
39
+ {
40
+ include: "#literals"
41
+ },
42
+ {
43
+ include: "#types"
44
+ },
45
+ {
46
+ include: "#identifiers"
16
47
  }
17
48
  ];
18
49
  var repository = {
19
- attribute: {
20
- begin: "(\\[)[[:space:]]*((?<![#\\-:!?.@*/&%^+<=>|~$])@{1,3}(?![#\\-:!?.@*/&%^+<=>|~$]))",
21
- end: "\\]",
22
- beginCaptures: {
23
- "1": {
24
- name: "constant.language constant.numeric entity.other.attribute-name.id.css strong"
25
- },
26
- "2": {
27
- name: "variable.other.class.js message.error variable.interpolation string.regexp"
28
- }
29
- },
30
- endCaptures: {
31
- "0": {
32
- name: "constant.language constant.numeric entity.other.attribute-name.id.css strong"
33
- }
34
- },
35
- patterns: [
36
- {
37
- include: "#attributePayload"
38
- }
39
- ]
40
- },
41
- attributeIdentifier: {
42
- match: "((?<![#\\-:!?.@*/&%^+<=>|~$])%(?![#\\-:!?.@*/&%^+<=>|~$]))((?:(?!\\b(?:and|'|as|asr|assert|\\*|begin|class|:|,|@|constraint|do|done|downto|else|end|=|exception|external|false|for|\\.|fun|function|functor|>|-|if|in|include|inherit|initializer|land|lazy|\\{|\\(|\\[|<|let|lor|lsl|lsr|lxor|match|method|mod|module|mutable|new|nonrec|#|object|of|open|or|%|\\+|private|\\?|\"|rec|\\\\|\\}|\\)|\\]|;|sig|/|struct|then|~|to|true|try|type|val|\\||virtual|when|while|with)\\b(?:[^']|$))\\b(?=[[:lower:]_])[[:alpha:]_][[:word:]']*))",
43
- captures: {
44
- "1": {
45
- name: "variable.other.class.js message.error variable.interpolation string.regexp strong"
46
- },
47
- "2": {
48
- name: "punctuation.definition.tag"
49
- }
50
- }
51
- },
52
- attributePayload: {
50
+ directives: {
53
51
  patterns: [
54
52
  {
55
- begin: "(?:(?<=(?:[^#\\-:!?.@*/&%^+<=>|~$]%|^%))(?![#\\-:!?.@*/&%^+<=>|~$]))",
56
- end: "((?<![#\\-:!?.@*/&%^+<=>|~$])[:\\?](?![#\\-:!?.@*/&%^+<=>|~$]))|(?<=[[:space:]])|(?=\\])",
57
- endCaptures: {
53
+ comment: "line number directive",
54
+ begin: "^[[:space:]]*(#)[[:space:]]*([[:digit:]]+)",
55
+ end: "$",
56
+ beginCaptures: {
58
57
  "1": {
59
- name: "variable.other.class.js message.error variable.interpolation string.regexp"
60
- }
61
- },
62
- patterns: [
63
- {
64
- include: "#pathModuleExtended"
65
- },
66
- {
67
- include: "#pathRecord"
68
- }
69
- ]
70
- },
71
- {
72
- begin: "(?:(?<=(?:[^#\\-:!?.@*/&%^+<=>|~$]:|^:))(?![#\\-:!?.@*/&%^+<=>|~$]))",
73
- end: "(?=\\])",
74
- patterns: [
75
- {
76
- include: "#signature"
58
+ name: "keyword.other.ocaml"
77
59
  },
78
- {
79
- include: "#type"
60
+ "2": {
61
+ name: "constant.numeric.decimal.integer.ocaml"
80
62
  }
81
- ]
63
+ },
64
+ contentName: "comment.line.directive.ocaml"
82
65
  },
83
66
  {
84
- begin: "(?:(?<=(?:[^#\\-:!?.@*/&%^+<=>|~$]\\?|^\\?))(?![#\\-:!?.@*/&%^+<=>|~$]))",
85
- end: "(?=\\])",
67
+ comment: "toplevel directives",
86
68
  patterns: [
87
69
  {
88
- begin: "(?:(?<=(?:[^#\\-:!?.@*/&%^+<=>|~$]\\?|^\\?))(?![#\\-:!?.@*/&%^+<=>|~$]))",
89
- end: "(?=\\])|\\bwhen\\b",
90
- endCaptures: {
70
+ comment: "general, loading codes",
71
+ begin: "^[[:space:]]*(#)[[:space:]]*(help|quit|cd|directory|remove_directory|load_rec|load|use|mod_use)",
72
+ end: "$",
73
+ beginCaptures: {
91
74
  "1": {
75
+ name: "keyword.other.ocaml"
76
+ },
77
+ "2": {
78
+ name: "keyword.other.ocaml"
92
79
  }
93
80
  },
94
81
  patterns: [
95
82
  {
96
- include: "#pattern"
83
+ include: "#strings"
97
84
  }
98
85
  ]
99
86
  },
100
87
  {
101
- begin: "(?:(?<=(?:[^[:word:]]when|^when))(?![[:word:]]))",
102
- end: "(?=\\])",
88
+ comment: "environment queries",
89
+ begin: "^[[:space:]]*(#)[[:space:]]*(show_class_type|show_class|show_exception|show_module_type|show_module|show_type|show_val|show)",
90
+ end: "$",
91
+ beginCaptures: {
92
+ "1": {
93
+ name: "keyword.other.ocaml"
94
+ },
95
+ "2": {
96
+ name: "keyword.other.ocaml"
97
+ }
98
+ },
103
99
  patterns: [
104
100
  {
105
- include: "#term"
101
+ include: "#types"
102
+ },
103
+ {
104
+ include: "#identifiers"
106
105
  }
107
106
  ]
108
- }
109
- ]
110
- },
111
- {
112
- include: "#term"
113
- }
114
- ]
115
- },
116
- bindClassTerm: {
117
- patterns: [
118
- {
119
- begin: "(?:(?<=(?:[^[:word:]]and|^and|[^[:word:]]class|^class|[^[:word:]]type|^type))(?![[:word:]]))",
120
- end: "(?<![#\\-:!?.@*/&%^+<=>|~$])(:)|(=)(?![#\\-:!?.@*/&%^+<=>|~$])|(?=;;|\\}|\\)|\\]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)",
121
- endCaptures: {
122
- "1": {
123
- name: "variable.other.class.js message.error variable.interpolation string.regexp strong"
124
107
  },
125
- "2": {
126
- name: "support.type strong"
127
- }
128
- },
129
- patterns: [
130
108
  {
131
- begin: "(?:(?<=(?:[^[:word:]]and|^and|[^[:word:]]class|^class|[^[:word:]]type|^type))(?![[:word:]]))",
132
- end: "(?=(?:(?!\\b(?:and|'|as|asr|assert|\\*|begin|class|:|,|@|constraint|do|done|downto|else|end|=|exception|external|false|for|\\.|fun|function|functor|>|-|if|in|include|inherit|initializer|land|lazy|\\{|\\(|\\[|<|let|lor|lsl|lsr|lxor|match|method|mod|module|mutable|new|nonrec|#|object|of|open|or|%|\\+|private|\\?|\"|rec|\\\\|\\}|\\)|\\]|;|sig|/|struct|then|~|to|true|try|type|val|\\||virtual|when|while|with)\\b(?:[^']|$))\\b(?=[[:lower:]_])[[:alpha:]_][[:word:]']*)[[:space:]]*,|[^[:space:][:lower:]%])|(?:(?!\\b(?:and|'|as|asr|assert|\\*|begin|class|:|,|@|constraint|do|done|downto|else|end|=|exception|external|false|for|\\.|fun|function|functor|>|-|if|in|include|inherit|initializer|land|lazy|\\{|\\(|\\[|<|let|lor|lsl|lsr|lxor|match|method|mod|module|mutable|new|nonrec|#|object|of|open|or|%|\\+|private|\\?|\"|rec|\\\\|\\}|\\)|\\]|;|sig|/|struct|then|~|to|true|try|type|val|\\||virtual|when|while|with)\\b(?:[^']|$))\\b(?=[[:lower:]_])[[:alpha:]_][[:word:]']*)|(?=\\btype\\b)",
133
- endCaptures: {
134
- "0": {
135
- name: "entity.name.function strong emphasis"
109
+ comment: "pretty-printing, tracing",
110
+ begin: "^[[:space:]]*(#)[[:space:]]*(install_printer|print_depth|print_length|remove_printer|trace|untrace_all|untrace)",
111
+ end: "$",
112
+ beginCaptures: {
113
+ "1": {
114
+ name: "keyword.other.ocaml"
115
+ },
116
+ "2": {
117
+ name: "keyword.other.ocaml"
136
118
  }
137
119
  },
138
120
  patterns: [
139
121
  {
140
- include: "#attributeIdentifier"
122
+ include: "#literals"
123
+ },
124
+ {
125
+ include: "#identifiers"
141
126
  }
142
127
  ]
143
128
  },
144
129
  {
145
- begin: "\\[",
146
- end: "\\]",
147
- captures: {
148
- "0": {
149
- name: "punctuation.definition.tag"
130
+ comment: "compiler options",
131
+ begin: "^[[:space:]]*(#)[[:space:]]*(labels|ppx|principal|rectypes|warn_error|warnings)",
132
+ end: "$",
133
+ beginCaptures: {
134
+ "1": {
135
+ name: "keyword.other.ocaml"
136
+ },
137
+ "2": {
138
+ name: "keyword.other.ocaml"
150
139
  }
151
140
  },
152
141
  patterns: [
153
142
  {
154
- include: "#type"
143
+ include: "#strings"
144
+ },
145
+ {
146
+ include: "#literals"
155
147
  }
156
148
  ]
157
- },
158
- {
159
- include: "#bindTermArgs"
160
149
  }
161
150
  ]
162
151
  },
163
152
  {
164
- begin: "(?:(?<=(?:[^#\\-:!?.@*/&%^+<=>|~$]:|^:))(?![#\\-:!?.@*/&%^+<=>|~$]))",
165
- end: "(?<![#\\-:!?.@*/&%^+<=>|~$])=(?![#\\-:!?.@*/&%^+<=>|~$])|(?=\\}|\\)|\\]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|val)\\b)",
166
- endCaptures: {
167
- "0": {
168
- name: "support.type strong"
153
+ comment: "topfind directives",
154
+ begin: "^[[:space:]]*(#)[[:space:]]*(require|list|camlp4o|camlp4r|predicates|thread)",
155
+ end: "$",
156
+ beginCaptures: {
157
+ "1": {
158
+ name: "keyword.other.ocaml"
159
+ },
160
+ "2": {
161
+ name: "keyword.other.ocaml"
169
162
  }
170
163
  },
171
164
  patterns: [
172
165
  {
173
- include: "#literalClassType"
166
+ include: "#strings"
174
167
  }
175
168
  ]
176
169
  },
177
170
  {
178
- begin: "(?:(?<=(?:[^#\\-:!?.@*/&%^+<=>|~$]=|^=))(?![#\\-:!?.@*/&%^+<=>|~$]))",
179
- end: "\\band\\b|(?=;;|\\}|\\)|\\]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)",
180
- endCaptures: {
181
- "0": {
182
- name: "variable.other.class.js message.error variable.interpolation string.regexp markup.underline"
183
- }
184
- },
185
- patterns: [
186
- {
187
- include: "#term"
188
- }
189
- ]
190
- }
191
- ]
192
- },
193
- bindClassType: {
194
- patterns: [
195
- {
196
- begin: "(?:(?<=(?:[^[:word:]]and|^and|[^[:word:]]class|^class|[^[:word:]]type|^type))(?![[:word:]]))",
197
- end: "(?<![#\\-:!?.@*/&%^+<=>|~$])(:)|(=)(?![#\\-:!?.@*/&%^+<=>|~$])|(?=;;|\\}|\\)|\\]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)",
198
- endCaptures: {
171
+ comment: "cppo directives",
172
+ begin: "^[[:space:]]*(#)[[:space:]]*(define|undef|ifdef|ifndef|if|else|elif|endif|include|warning|error|ext|endext)",
173
+ end: "$",
174
+ beginCaptures: {
199
175
  "1": {
200
- name: "variable.other.class.js message.error variable.interpolation string.regexp strong"
176
+ name: "keyword.other.ocaml"
201
177
  },
202
178
  "2": {
203
- name: "support.type strong"
179
+ name: "keyword.other.ocaml"
204
180
  }
205
181
  },
206
182
  patterns: [
207
183
  {
208
- begin: "(?:(?<=(?:[^[:word:]]and|^and|[^[:word:]]class|^class|[^[:word:]]type|^type))(?![[:word:]]))",
209
- end: "(?=(?:(?!\\b(?:and|'|as|asr|assert|\\*|begin|class|:|,|@|constraint|do|done|downto|else|end|=|exception|external|false|for|\\.|fun|function|functor|>|-|if|in|include|inherit|initializer|land|lazy|\\{|\\(|\\[|<|let|lor|lsl|lsr|lxor|match|method|mod|module|mutable|new|nonrec|#|object|of|open|or|%|\\+|private|\\?|\"|rec|\\\\|\\}|\\)|\\]|;|sig|/|struct|then|~|to|true|try|type|val|\\||virtual|when|while|with)\\b(?:[^']|$))\\b(?=[[:lower:]_])[[:alpha:]_][[:word:]']*)[[:space:]]*,|[^[:space:][:lower:]%])|(?:(?!\\b(?:and|'|as|asr|assert|\\*|begin|class|:|,|@|constraint|do|done|downto|else|end|=|exception|external|false|for|\\.|fun|function|functor|>|-|if|in|include|inherit|initializer|land|lazy|\\{|\\(|\\[|<|let|lor|lsl|lsr|lxor|match|method|mod|module|mutable|new|nonrec|#|object|of|open|or|%|\\+|private|\\?|\"|rec|\\\\|\\}|\\)|\\]|;|sig|/|struct|then|~|to|true|try|type|val|\\||virtual|when|while|with)\\b(?:[^']|$))\\b(?=[[:lower:]_])[[:alpha:]_][[:word:]']*)|(?=\\btype\\b)",
210
- endCaptures: {
211
- "0": {
212
- name: "entity.name.function strong emphasis"
213
- }
214
- },
215
- patterns: [
216
- {
217
- include: "#attributeIdentifier"
218
- }
219
- ]
184
+ name: "keyword.other.ocaml",
185
+ match: "\\b(defined)\\b"
220
186
  },
221
187
  {
222
- begin: "\\[",
223
- end: "\\]",
224
- captures: {
225
- "0": {
226
- name: "punctuation.definition.tag"
227
- }
228
- },
229
- patterns: [
230
- {
231
- include: "#type"
232
- }
233
- ]
188
+ name: "keyword.other.ocaml",
189
+ match: "\\\\"
234
190
  },
235
191
  {
236
- include: "#bindTermArgs"
237
- }
238
- ]
239
- },
240
- {
241
- begin: "(?:(?<=(?:[^#\\-:!?.@*/&%^+<=>|~$]:|^:))(?![#\\-:!?.@*/&%^+<=>|~$]))",
242
- end: "(?<![#\\-:!?.@*/&%^+<=>|~$])=(?![#\\-:!?.@*/&%^+<=>|~$])|(?=\\}|\\)|\\]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|val)\\b)",
243
- endCaptures: {
244
- "0": {
245
- name: "support.type strong"
246
- }
247
- },
248
- patterns: [
192
+ include: "#comments"
193
+ },
249
194
  {
250
- include: "#literalClassType"
251
- }
252
- ]
253
- },
254
- {
255
- begin: "(?:(?<=(?:[^#\\-:!?.@*/&%^+<=>|~$]=|^=))(?![#\\-:!?.@*/&%^+<=>|~$]))",
256
- end: "\\band\\b|(?=;;|\\}|\\)|\\]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)",
257
- endCaptures: {
258
- "0": {
259
- name: "variable.other.class.js message.error variable.interpolation string.regexp markup.underline"
260
- }
261
- },
262
- patterns: [
195
+ include: "#strings"
196
+ },
197
+ {
198
+ include: "#characters"
199
+ },
200
+ {
201
+ include: "#keywords"
202
+ },
203
+ {
204
+ include: "#operators"
205
+ },
206
+ {
207
+ include: "#literals"
208
+ },
209
+ {
210
+ include: "#types"
211
+ },
263
212
  {
264
- include: "#literalClassType"
213
+ include: "#identifiers"
265
214
  }
266
215
  ]
267
216
  }
268
217
  ]
269
218
  },
270
- bindConstructor: {
219
+ comments: {
271
220
  patterns: [
272
221
  {
273
- begin: "(?:(?<=(?:[^[:word:]]exception|^exception))(?![[:word:]]))|(?:(?<=(?:[^#\\-:!?.@*/&%^+<=>|~$]\\+=|^\\+=|[^#\\-:!?.@*/&%^+<=>|~$]=|^=|[^#\\-:!?.@*/&%^+<=>|~$]\\||^\\|))(?![#\\-:!?.@*/&%^+<=>|~$]))",
274
- end: "(:)|(\\bof\\b)|((?<![#\\-:!?.@*/&%^+<=>|~$])\\|(?![#\\-:!?.@*/&%^+<=>|~$]))|(?=;;|\\}|\\)|\\]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)",
275
- endCaptures: {
276
- "1": {
277
- name: "variable.other.class.js message.error variable.interpolation string.regexp strong"
278
- },
279
- "2": {
280
- name: "punctuation.definition.tag"
281
- },
282
- "3": {
283
- name: "support.type strong"
284
- }
285
- },
222
+ comment: "empty comment",
223
+ name: "comment.block.ocaml",
224
+ match: "\\(\\*\\*\\)"
225
+ },
226
+ {
227
+ comment: "ocamldoc comment",
228
+ name: "comment.doc.ocaml",
229
+ begin: "\\(\\*\\*",
230
+ end: "\\*\\)",
286
231
  patterns: [
287
232
  {
288
- include: "#attributeIdentifier"
289
- },
290
- {
291
- match: "\\.\\.",
292
- name: "variable.other.class.js message.error variable.interpolation string.regexp"
233
+ include: "source.ocaml.ocamldoc#markup"
293
234
  },
294
235
  {
295
- match: "\\b(?:\\b(?=[[:upper:]])[[:alpha:]_][[:word:]']*)\\b(?![[:space:]]*(?:\\.|\\([^\\*]))",
296
- name: "constant.language constant.numeric entity.other.attribute-name.id.css strong"
236
+ include: "#strings-in-comments"
297
237
  },
298
238
  {
299
- include: "#type"
239
+ include: "#comments"
300
240
  }
301
241
  ]
302
242
  },
303
243
  {
304
- begin: "(?:(?<=(?:[^#\\-:!?.@*/&%^+<=>|~$]:|^:))(?![#\\-:!?.@*/&%^+<=>|~$]))|(?:(?<=(?:[^[:word:]]of|^of))(?![[:word:]]))",
305
- end: "(?<![#\\-:!?.@*/&%^+<=>|~$])\\|(?![#\\-:!?.@*/&%^+<=>|~$])|(?=;;|\\}|\\)|\\]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)",
306
- endCaptures: {
307
- "0": {
308
- name: "support.type strong"
244
+ comment: "Cinaps comment",
245
+ begin: "\\(\\*\\$",
246
+ end: "\\*\\)",
247
+ beginCaptures: [
248
+ {
249
+ name: "comment.cinaps.ocaml"
309
250
  }
310
- },
251
+ ],
252
+ endCaptures: [
253
+ {
254
+ name: "comment.cinaps.ocaml"
255
+ }
256
+ ],
257
+ patterns: [
258
+ {
259
+ include: "$self"
260
+ }
261
+ ]
262
+ },
263
+ {
264
+ comment: "block comment",
265
+ name: "comment.block.ocaml",
266
+ begin: "\\(\\*",
267
+ end: "\\*\\)",
311
268
  patterns: [
312
269
  {
313
- include: "#type"
270
+ include: "#strings-in-comments"
271
+ },
272
+ {
273
+ include: "#comments"
314
274
  }
315
275
  ]
316
276
  }
317
277
  ]
318
278
  },
319
- bindSignature: {
279
+ "strings-in-comments": {
320
280
  patterns: [
321
281
  {
322
- include: "#comment"
282
+ comment: "char literal",
283
+ match: "'(\\\\)?.'"
323
284
  },
324
285
  {
325
- begin: "(?:(?<=(?:[^[:word:]]type|^type))(?![[:word:]]))",
326
- end: "(?<![#\\-:!?.@*/&%^+<=>|~$])=(?![#\\-:!?.@*/&%^+<=>|~$])",
327
- endCaptures: {
328
- "0": {
329
- name: "support.type strong"
330
- }
331
- },
286
+ comment: "string literal",
287
+ begin: "\"",
288
+ end: "\"",
332
289
  patterns: [
333
290
  {
334
- include: "#comment"
291
+ match: "\\\\\\\\"
335
292
  },
336
293
  {
337
- include: "#pathModuleExtended"
294
+ match: "\\\\\""
338
295
  }
339
296
  ]
340
297
  },
341
298
  {
342
- begin: "(?:(?<=(?:[^#\\-:!?.@*/&%^+<=>|~$]=|^=))(?![#\\-:!?.@*/&%^+<=>|~$]))",
343
- end: "\\band\\b|(?=;;|\\}|\\)|\\]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)",
344
- endCaptures: {
345
- "0": {
346
- name: "variable.other.class.js message.error variable.interpolation string.regexp markup.underline"
347
- }
348
- },
349
- patterns: [
350
- {
351
- include: "#signature"
352
- }
353
- ]
299
+ comment: "quoted string literal",
300
+ begin: "\\{[[:lower:]_]*\\|",
301
+ end: "\\|[[:lower:]_]*\\}"
354
302
  }
355
303
  ]
356
304
  },
357
- bindStructure: {
305
+ strings: {
358
306
  patterns: [
359
307
  {
360
- include: "#comment"
361
- },
362
- {
363
- begin: "(?:(?<=(?:[^[:word:]]and|^and))(?![[:word:]]))|(?=[[:upper:]])",
364
- end: "(?<![#\\-:!?.@*/&%^+<=>|~$])(:(?!=))|(:?=)(?![#\\-:!?.@*/&%^+<=>|~$])|(?=\\}|\\)|\\]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|open|type|val)\\b)",
365
- endCaptures: {
308
+ comment: "quoted string literal",
309
+ name: "string.quoted.braced.ocaml",
310
+ begin: "\\{(%%?[[:alpha:]_][[:word:]']*(\\.[[:alpha:]_][[:word:]']*)*[[:space:]]*)?[[:lower:]_]*\\|",
311
+ end: "\\|[[:lower:]_]*\\}",
312
+ beginCaptures: {
366
313
  "1": {
367
- name: "variable.other.class.js message.error variable.interpolation string.regexp strong"
368
- },
369
- "2": {
370
- name: "support.type strong"
314
+ name: "keyword.other.extension.ocaml"
371
315
  }
372
- },
316
+ }
317
+ },
318
+ {
319
+ comment: "string literal",
320
+ name: "string.quoted.double.ocaml",
321
+ begin: "\"",
322
+ end: "\"",
373
323
  patterns: [
374
324
  {
375
- include: "#comment"
325
+ comment: "escaped newline",
326
+ name: "constant.character.escape.ocaml",
327
+ match: "\\\\$"
376
328
  },
377
329
  {
378
- match: "\\bmodule\\b",
379
- name: "markup.inserted constant.language support.constant.property-value entity.name.filename"
330
+ comment: "escaped backslash",
331
+ name: "constant.character.escape.ocaml",
332
+ match: "\\\\\\\\"
380
333
  },
381
334
  {
382
- match: "(?:\\b(?=[[:upper:]])[[:alpha:]_][[:word:]']*)",
383
- name: "entity.name.function strong emphasis"
335
+ comment: "escaped quote or whitespace",
336
+ name: "constant.character.escape.ocaml",
337
+ match: "\\\\[\"'ntbr ]"
384
338
  },
385
339
  {
386
- begin: "\\((?!\\))",
387
- end: "\\)",
388
- captures: {
389
- "0": {
390
- name: "punctuation.definition.tag"
391
- }
392
- },
393
- patterns: [
394
- {
395
- include: "#comment"
396
- },
397
- {
398
- begin: "(?<![#\\-:!?.@*/&%^+<=>|~$]):(?![#\\-:!?.@*/&%^+<=>|~$])",
399
- end: "(?=\\))",
400
- beginCaptures: {
401
- "0": {
402
- name: "variable.other.class.js message.error variable.interpolation string.regexp strong"
403
- }
404
- },
405
- patterns: [
406
- {
407
- include: "#signature"
408
- }
409
- ]
410
- },
411
- {
412
- include: "#variableModule"
413
- }
414
- ]
340
+ comment: "character from decimal ASCII code",
341
+ name: "constant.character.escape.ocaml",
342
+ match: "\\\\[[:digit:]]{3}"
415
343
  },
416
344
  {
417
- include: "#literalUnit"
418
- }
419
- ]
420
- },
421
- {
422
- begin: "(?:(?<=(?:[^#\\-:!?.@*/&%^+<=>|~$]:|^:))(?![#\\-:!?.@*/&%^+<=>|~$]))",
423
- end: "\\b(and)\\b|((?<![#\\-:!?.@*/&%^+<=>|~$])=(?![#\\-:!?.@*/&%^+<=>|~$]))|(?=;;|\\}|\\)|\\]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)",
424
- endCaptures: {
425
- "1": {
426
- name: "variable.other.class.js message.error variable.interpolation string.regexp markup.underline"
345
+ comment: "character from hexadecimal ASCII code",
346
+ name: "constant.character.escape.ocaml",
347
+ match: "\\\\x[[:xdigit:]]{2}"
427
348
  },
428
- "2": {
429
- name: "support.type strong"
430
- }
431
- },
432
- patterns: [
433
349
  {
434
- include: "#signature"
435
- }
436
- ]
437
- },
438
- {
439
- begin: "(?:(?<=(?:[^#\\-:!?.@*/&%^+<=>|~$]:=|^:=|[^#\\-:!?.@*/&%^+<=>|~$]=|^=))(?![#\\-:!?.@*/&%^+<=>|~$]))",
440
- end: "\\b(?:(and)|(with))\\b|(?=;;|\\}|\\)|\\]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)",
441
- endCaptures: {
442
- "1": {
443
- name: "variable.other.class.js message.error variable.interpolation string.regexp markup.underline"
350
+ comment: "character from octal ASCII code",
351
+ name: "constant.character.escape.ocaml",
352
+ match: "\\\\o[0-3][0-7]{2}"
353
+ },
354
+ {
355
+ comment: "unicode character escape sequence",
356
+ name: "constant.character.escape.ocaml",
357
+ match: "\\\\u\\{[[:xdigit:]]{1,6}\\}"
358
+ },
359
+ {
360
+ comment: "printf format string",
361
+ name: "constant.character.printf.ocaml",
362
+ match: "%[-0+ #]*([[:digit:]]+|\\*)?(.([[:digit:]]+|\\*))?[lLn]?[diunlLNxXosScCfFeEgGhHBbat!%@,]"
444
363
  },
445
- "2": {
446
- name: "variable.other.class.js message.error variable.interpolation string.regexp markup.underline"
447
- }
448
- },
449
- patterns: [
450
364
  {
451
- include: "#structure"
365
+ comment: "unknown escape sequence",
366
+ name: "invalid.illegal.unknown-escape.ocaml",
367
+ match: "\\\\."
452
368
  }
453
369
  ]
454
370
  }
455
371
  ]
456
372
  },
457
- bindTerm: {
373
+ characters: {
458
374
  patterns: [
459
375
  {
460
- begin: "(?:(?<=(?:[^#\\-:!?.@*/&%^+<=>|~$]!|^!))(?![#\\-:!?.@*/&%^+<=>|~$]))|(?:(?<=(?:[^[:word:]]and|^and|[^[:word:]]external|^external|[^[:word:]]let|^let|[^[:word:]]method|^method|[^[:word:]]val|^val))(?![[:word:]]))",
461
- end: "(\\bmodule\\b)|(\\bopen\\b)|(?<![#\\-:!?.@*/&%^+<=>|~$])(:)|((?<![#\\-:!?.@*/&%^+<=>|~$])=(?![#\\-:!?.@*/&%^+<=>|~$]))(?![#\\-:!?.@*/&%^+<=>|~$])|(?=;;|\\}|\\)|\\]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)",
462
- endCaptures: {
376
+ comment: "character literal from escaped backslash",
377
+ name: "string.quoted.single.ocaml",
378
+ match: "'(\\\\\\\\)'",
379
+ captures: {
463
380
  "1": {
464
- name: "markup.inserted constant.language support.constant.property-value entity.name.filename"
465
- },
466
- "2": {
467
- name: "variable.other.class.js message.error variable.interpolation string.regexp"
468
- },
469
- "3": {
470
- name: "variable.other.class.js message.error variable.interpolation string.regexp strong"
471
- },
472
- "4": {
473
- name: "support.type strong"
474
- }
475
- },
476
- patterns: [
477
- {
478
- begin: "(?:(?<=(?:[^#\\-:!?.@*/&%^+<=>|~$]!|^!))(?![#\\-:!?.@*/&%^+<=>|~$]))|(?:(?<=(?:[^[:word:]]and|^and|[^[:word:]]external|^external|[^[:word:]]let|^let|[^[:word:]]method|^method|[^[:word:]]val|^val))(?![[:word:]]))",
479
- end: "(?=\\b(?:module|open)\\b)|(?=(?:(?!\\b(?:and|'|as|asr|assert|\\*|begin|class|:|,|@|constraint|do|done|downto|else|end|=|exception|external|false|for|\\.|fun|function|functor|>|-|if|in|include|inherit|initializer|land|lazy|\\{|\\(|\\[|<|let|lor|lsl|lsr|lxor|match|method|mod|module|mutable|new|nonrec|#|object|of|open|or|%|\\+|private|\\?|\"|rec|\\\\|\\}|\\)|\\]|;|sig|/|struct|then|~|to|true|try|type|val|\\||virtual|when|while|with)\\b(?:[^']|$))\\b(?=[[:lower:]_])[[:alpha:]_][[:word:]']*)[[:space:]]*,|[^[:space:][:lower:]%])|(\\brec\\b)|((?:(?!\\b(?:and|'|as|asr|assert|\\*|begin|class|:|,|@|constraint|do|done|downto|else|end|=|exception|external|false|for|\\.|fun|function|functor|>|-|if|in|include|inherit|initializer|land|lazy|\\{|\\(|\\[|<|let|lor|lsl|lsr|lxor|match|method|mod|module|mutable|new|nonrec|#|object|of|open|or|%|\\+|private|\\?|\"|rec|\\\\|\\}|\\)|\\]|;|sig|/|struct|then|~|to|true|try|type|val|\\||virtual|when|while|with)\\b(?:[^']|$))\\b(?=[[:lower:]_])[[:alpha:]_][[:word:]']*))",
480
- endCaptures: {
481
- "1": {
482
- name: "variable.other.class.js message.error variable.interpolation string.regexp"
483
- },
484
- "2": {
485
- name: "entity.name.function strong emphasis"
486
- }
487
- },
488
- patterns: [
489
- {
490
- include: "#attributeIdentifier"
491
- },
492
- {
493
- include: "#comment"
494
- }
495
- ]
496
- },
497
- {
498
- begin: "(?:(?<=(?:[^[:word:]]rec|^rec))(?![[:word:]]))",
499
- end: "((?:(?!\\b(?:and|'|as|asr|assert|\\*|begin|class|:|,|@|constraint|do|done|downto|else|end|=|exception|external|false|for|\\.|fun|function|functor|>|-|if|in|include|inherit|initializer|land|lazy|\\{|\\(|\\[|<|let|lor|lsl|lsr|lxor|match|method|mod|module|mutable|new|nonrec|#|object|of|open|or|%|\\+|private|\\?|\"|rec|\\\\|\\}|\\)|\\]|;|sig|/|struct|then|~|to|true|try|type|val|\\||virtual|when|while|with)\\b(?:[^']|$))\\b(?=[[:lower:]_])[[:alpha:]_][[:word:]']*))|(?=[^[:space:][:alpha:]])",
500
- endCaptures: {
501
- "0": {
502
- name: "entity.name.function strong emphasis"
503
- }
504
- },
505
- patterns: [
506
- {
507
- include: "#bindTermArgs"
508
- }
509
- ]
510
- },
511
- {
512
- include: "#bindTermArgs"
381
+ name: "constant.character.escape.ocaml"
513
382
  }
514
- ]
515
- },
516
- {
517
- begin: "(?:(?<=(?:[^[:word:]]module|^module))(?![[:word:]]))",
518
- end: "(?=;;|\\}|\\)|\\]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)",
519
- patterns: [
520
- {
521
- include: "#declModule"
522
- }
523
- ]
524
- },
525
- {
526
- begin: "(?:(?<=(?:[^[:word:]]open|^open))(?![[:word:]]))",
527
- end: "(?=\\bin\\b)|(?=\\}|\\)|\\]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)",
528
- patterns: [
529
- {
530
- include: "#pathModuleSimple"
531
- }
532
- ]
533
- },
534
- {
535
- begin: "(?:(?<=(?:[^#\\-:!?.@*/&%^+<=>|~$]:|^:))(?![#\\-:!?.@*/&%^+<=>|~$]))",
536
- end: "(?<![#\\-:!?.@*/&%^+<=>|~$])=(?![#\\-:!?.@*/&%^+<=>|~$])|(?=;;|\\}|\\)|\\]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)",
537
- endCaptures: {
538
- "0": {
539
- name: "support.type strong"
540
- }
541
- },
542
- patterns: [
543
- {
544
- begin: "(?:(?<=(?:[^#\\-:!?.@*/&%^+<=>|~$]:|^:))(?![#\\-:!?.@*/&%^+<=>|~$]))",
545
- end: "\\btype\\b|(?=[^[:space:]])",
546
- endCaptures: {
547
- "0": {
548
- name: "keyword.control"
549
- }
550
- }
551
- },
552
- {
553
- begin: "(?:(?<=(?:[^[:word:]]type|^type))(?![[:word:]]))",
554
- end: "(?<![#\\-:!?.@*/&%^+<=>|~$])\\.(?![#\\-:!?.@*/&%^+<=>|~$])",
555
- endCaptures: {
556
- "0": {
557
- name: "variable.other.class.js message.error variable.interpolation string.regexp"
558
- }
559
- },
560
- patterns: [
561
- {
562
- include: "#pattern"
563
- }
564
- ]
565
- },
566
- {
567
- include: "#type"
568
- }
569
- ]
570
- },
571
- {
572
- begin: "(?:(?<=(?:[^#\\-:!?.@*/&%^+<=>|~$]=|^=))(?![#\\-:!?.@*/&%^+<=>|~$]))",
573
- end: "\\band\\b|(?=;;|\\}|\\)|\\]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)",
574
- endCaptures: {
575
- "0": {
576
- name: "variable.other.class.js message.error variable.interpolation string.regexp markup.underline"
577
- }
578
- },
579
- patterns: [
580
- {
581
- include: "#term"
582
- }
583
- ]
584
- }
585
- ]
586
- },
587
- bindTermArgs: {
588
- patterns: [
589
- {
590
- begin: "~|\\?",
591
- end: ":|(?=[^[:space:]])",
592
- applyEndPatternLast: true,
593
- beginCaptures: {
594
- "0": {
595
- name: "variable.other.class.js message.error variable.interpolation string.regexp"
596
- }
597
- },
598
- endCaptures: {
599
- "0": {
600
- name: "keyword"
601
- }
602
- },
603
- patterns: [
604
- {
605
- begin: "(?:(?<=(?:[^#\\-:!?.@*/&%^+<=>|~$]~|^~|[^#\\-:!?.@*/&%^+<=>|~$]\\?|^\\?))(?![#\\-:!?.@*/&%^+<=>|~$]))",
606
- end: "(?:(?!\\b(?:and|'|as|asr|assert|\\*|begin|class|:|,|@|constraint|do|done|downto|else|end|=|exception|external|false|for|\\.|fun|function|functor|>|-|if|in|include|inherit|initializer|land|lazy|\\{|\\(|\\[|<|let|lor|lsl|lsr|lxor|match|method|mod|module|mutable|new|nonrec|#|object|of|open|or|%|\\+|private|\\?|\"|rec|\\\\|\\}|\\)|\\]|;|sig|/|struct|then|~|to|true|try|type|val|\\||virtual|when|while|with)\\b(?:[^']|$))\\b(?=[[:lower:]_])[[:alpha:]_][[:word:]']*)|(?<=\\))",
607
- endCaptures: {
608
- "0": {
609
- name: "markup.inserted constant.language support.constant.property-value entity.name.filename"
610
- }
611
- },
612
- patterns: [
613
- {
614
- include: "#comment"
615
- },
616
- {
617
- begin: "\\((?!\\*)",
618
- end: "\\)",
619
- captures: {
620
- "0": {
621
- name: "punctuation.definition.tag"
622
- }
623
- },
624
- patterns: [
625
- {
626
- begin: "(?<=\\()",
627
- end: ":|=",
628
- endCaptures: {
629
- "0": {
630
- name: "keyword"
631
- }
632
- },
633
- patterns: [
634
- {
635
- match: "(?:(?!\\b(?:and|'|as|asr|assert|\\*|begin|class|:|,|@|constraint|do|done|downto|else|end|=|exception|external|false|for|\\.|fun|function|functor|>|-|if|in|include|inherit|initializer|land|lazy|\\{|\\(|\\[|<|let|lor|lsl|lsr|lxor|match|method|mod|module|mutable|new|nonrec|#|object|of|open|or|%|\\+|private|\\?|\"|rec|\\\\|\\}|\\)|\\]|;|sig|/|struct|then|~|to|true|try|type|val|\\||virtual|when|while|with)\\b(?:[^']|$))\\b(?=[[:lower:]_])[[:alpha:]_][[:word:]']*)",
636
- name: "markup.inserted constant.language support.constant.property-value entity.name.filename"
637
- }
638
- ]
639
- },
640
- {
641
- begin: "(?<=:)",
642
- end: "=|(?=\\))",
643
- endCaptures: {
644
- "0": {
645
- name: "keyword"
646
- }
647
- },
648
- patterns: [
649
- {
650
- include: "#type"
651
- }
652
- ]
653
- },
654
- {
655
- begin: "(?:(?<=(?:[^#\\-:!?.@*/&%^+<=>|~$]=|^=))(?![#\\-:!?.@*/&%^+<=>|~$]))",
656
- end: "(?=\\))",
657
- patterns: [
658
- {
659
- include: "#term"
660
- }
661
- ]
662
- }
663
- ]
664
- }
665
- ]
666
- }
667
- ]
668
- },
669
- {
670
- include: "#pattern"
671
- }
672
- ]
673
- },
674
- bindType: {
675
- patterns: [
676
- {
677
- begin: "(?:(?<=(?:[^[:word:]]and|^and|[^[:word:]]type|^type))(?![[:word:]]))",
678
- end: "(?<![#\\-:!?.@*/&%^+<=>|~$])\\+=|=(?![#\\-:!?.@*/&%^+<=>|~$])|(?=;;|\\}|\\)|\\]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)",
679
- endCaptures: {
680
- "0": {
681
- name: "support.type strong"
682
- }
683
- },
684
- patterns: [
685
- {
686
- include: "#attributeIdentifier"
687
- },
688
- {
689
- include: "#pathType"
690
- },
691
- {
692
- match: "(?:(?!\\b(?:and|'|as|asr|assert|\\*|begin|class|:|,|@|constraint|do|done|downto|else|end|=|exception|external|false|for|\\.|fun|function|functor|>|-|if|in|include|inherit|initializer|land|lazy|\\{|\\(|\\[|<|let|lor|lsl|lsr|lxor|match|method|mod|module|mutable|new|nonrec|#|object|of|open|or|%|\\+|private|\\?|\"|rec|\\\\|\\}|\\)|\\]|;|sig|/|struct|then|~|to|true|try|type|val|\\||virtual|when|while|with)\\b(?:[^']|$))\\b(?=[[:lower:]_])[[:alpha:]_][[:word:]']*)",
693
- name: "entity.name.function strong"
694
- },
695
- {
696
- include: "#type"
697
- }
698
- ]
699
- },
700
- {
701
- begin: "(?:(?<=(?:[^#\\-:!?.@*/&%^+<=>|~$]\\+=|^\\+=|[^#\\-:!?.@*/&%^+<=>|~$]=|^=))(?![#\\-:!?.@*/&%^+<=>|~$]))",
702
- end: "\\band\\b|(?=;;|\\}|\\)|\\]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)",
703
- endCaptures: {
704
- "0": {
705
- name: "variable.other.class.js message.error variable.interpolation string.regexp markup.underline"
706
- }
707
- },
708
- patterns: [
709
- {
710
- include: "#bindConstructor"
711
- }
712
- ]
713
- }
714
- ]
715
- },
716
- comment: {
717
- patterns: [
718
- {
719
- include: "#attribute"
720
- },
721
- {
722
- include: "#extension"
723
- },
724
- {
725
- include: "#commentBlock"
726
- },
727
- {
728
- include: "#commentDoc"
729
- }
730
- ]
731
- },
732
- commentBlock: {
733
- begin: "\\(\\*(?!\\*[^\\)])",
734
- end: "\\*\\)",
735
- name: "comment constant.regexp meta.separator.markdown",
736
- contentName: "emphasis",
737
- patterns: [
738
- {
739
- include: "#commentBlock"
740
- },
741
- {
742
- include: "#commentDoc"
743
- }
744
- ]
745
- },
746
- commentDoc: {
747
- begin: "\\(\\*\\*",
748
- end: "\\*\\)",
749
- name: "comment constant.regexp meta.separator.markdown",
750
- patterns: [
751
- {
752
- match: "\\*"
753
- },
754
- {
755
- include: "#comment"
756
- }
757
- ]
758
- },
759
- decl: {
760
- patterns: [
761
- {
762
- include: "#declClass"
763
- },
764
- {
765
- include: "#declException"
766
- },
767
- {
768
- include: "#declInclude"
769
- },
770
- {
771
- include: "#declModule"
772
- },
773
- {
774
- include: "#declOpen"
775
- },
776
- {
777
- include: "#declTerm"
778
- },
779
- {
780
- include: "#declType"
781
- }
782
- ]
783
- },
784
- declClass: {
785
- begin: "\\bclass\\b",
786
- end: ";;|(?=\\}|\\)|\\]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)",
787
- beginCaptures: {
788
- "0": {
789
- name: "entity.name.class constant.numeric markup.underline"
790
- }
791
- },
792
- endCaptures: {
793
- "0": {
794
- name: "punctuation.definition.tag"
795
- }
796
- },
797
- patterns: [
798
- {
799
- include: "#comment"
800
- },
801
- {
802
- include: "#pragma"
803
- },
804
- {
805
- begin: "(?:(?<=(?:[^[:word:]]class|^class))(?![[:word:]]))",
806
- end: "\\btype\\b|(?=\\}|\\)|\\]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|val)\\b)",
807
- beginCaptures: {
808
- "0": {
809
- name: "entity.name.class constant.numeric markup.underline"
810
- }
811
- },
812
- endCaptures: {
813
- "0": {
814
- name: "keyword"
815
- }
816
- },
817
- patterns: [
818
- {
819
- include: "#bindClassTerm"
820
- }
821
- ]
822
- },
823
- {
824
- begin: "(?:(?<=(?:[^[:word:]]type|^type))(?![[:word:]]))",
825
- end: "(?=;;|\\}|\\)|\\]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)",
826
- patterns: [
827
- {
828
- include: "#bindClassType"
829
- }
830
- ]
831
- }
832
- ]
833
- },
834
- declException: {
835
- begin: "\\bexception\\b",
836
- end: ";;|(?=\\}|\\)|\\]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)",
837
- beginCaptures: {
838
- "0": {
839
- name: "keyword markup.underline"
840
- }
841
- },
842
- endCaptures: {
843
- "0": {
844
- name: "punctuation.definition.tag"
845
- }
846
- },
847
- patterns: [
848
- {
849
- include: "#attributeIdentifier"
850
- },
851
- {
852
- include: "#comment"
853
- },
854
- {
855
- include: "#pragma"
856
- },
857
- {
858
- include: "#bindConstructor"
859
- }
860
- ]
861
- },
862
- declInclude: {
863
- begin: "\\binclude\\b",
864
- end: ";;|(?=\\}|\\)|\\]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)",
865
- beginCaptures: {
866
- "0": {
867
- name: "variable.other.class.js message.error variable.interpolation string.regexp"
868
- }
869
- },
870
- endCaptures: {
871
- "0": {
872
- name: "punctuation.definition.tag"
873
- }
874
- },
875
- patterns: [
876
- {
877
- include: "#attributeIdentifier"
878
- },
879
- {
880
- include: "#comment"
881
- },
882
- {
883
- include: "#pragma"
884
- },
885
- {
886
- include: "#signature"
887
- }
888
- ]
889
- },
890
- declModule: {
891
- begin: "(?:(?<=(?:[^[:word:]]module|^module))(?![[:word:]]))|\\bmodule\\b",
892
- end: ";;|(?=\\}|\\)|\\]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)",
893
- beginCaptures: {
894
- "0": {
895
- name: "markup.inserted constant.language support.constant.property-value entity.name.filename markup.underline"
896
- }
897
- },
898
- endCaptures: {
899
- "0": {
900
- name: "punctuation.definition.tag"
901
- }
902
- },
903
- patterns: [
904
- {
905
- include: "#comment"
906
- },
907
- {
908
- include: "#pragma"
909
- },
910
- {
911
- begin: "(?:(?<=(?:[^[:word:]]module|^module))(?![[:word:]]))",
912
- end: "(\\btype\\b)|(?=[[:upper:]])",
913
- endCaptures: {
914
- "0": {
915
- name: "keyword"
916
- }
917
- },
918
- patterns: [
919
- {
920
- include: "#attributeIdentifier"
921
- },
922
- {
923
- include: "#comment"
924
- },
925
- {
926
- match: "\\brec\\b",
927
- name: "variable.other.class.js message.error variable.interpolation string.regexp"
928
- }
929
- ]
930
- },
931
- {
932
- begin: "(?:(?<=(?:[^[:word:]]type|^type))(?![[:word:]]))",
933
- end: "(?=;;|\\}|\\)|\\]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)",
934
- patterns: [
935
- {
936
- include: "#bindSignature"
937
- }
938
- ]
939
- },
940
- {
941
- begin: "(?=[[:upper:]])",
942
- end: "(?=;;|\\}|\\)|\\]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)",
943
- patterns: [
944
- {
945
- include: "#bindStructure"
946
- }
947
- ]
948
- }
949
- ]
950
- },
951
- declOpen: {
952
- begin: "\\bopen\\b",
953
- end: ";;|(?=\\}|\\)|\\]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)",
954
- beginCaptures: {
955
- "0": {
956
- name: "variable.other.class.js message.error variable.interpolation string.regexp"
957
- }
958
- },
959
- endCaptures: {
960
- "0": {
961
- name: "punctuation.definition.tag"
962
- }
963
- },
964
- patterns: [
965
- {
966
- include: "#attributeIdentifier"
967
- },
968
- {
969
- include: "#comment"
970
- },
971
- {
972
- include: "#pragma"
973
- },
974
- {
975
- include: "#pathModuleExtended"
976
- }
977
- ]
978
- },
979
- declTerm: {
980
- begin: "\\b(?:(external|val)|(method)|(let))\\b(!?)",
981
- end: ";;|(?=\\}|\\)|\\]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)",
982
- beginCaptures: {
983
- "1": {
984
- name: "support.type markup.underline"
985
- },
986
- "2": {
987
- name: "storage.type markup.underline"
988
- },
989
- "3": {
990
- name: "keyword.control markup.underline"
991
- },
992
- "4": {
993
- name: "variable.other.class.js message.error variable.interpolation string.regexp"
994
- }
995
- },
996
- endCaptures: {
997
- "0": {
998
- name: "punctuation.definition.tag"
999
- }
1000
- },
1001
- patterns: [
1002
- {
1003
- include: "#comment"
1004
- },
1005
- {
1006
- include: "#pragma"
1007
- },
1008
- {
1009
- include: "#bindTerm"
1010
- }
1011
- ]
1012
- },
1013
- declType: {
1014
- begin: "(?:(?<=(?:[^[:word:]]type|^type))(?![[:word:]]))|\\btype\\b",
1015
- end: ";;|(?=\\}|\\)|\\]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)",
1016
- beginCaptures: {
1017
- "0": {
1018
- name: "keyword markup.underline"
1019
- }
1020
- },
1021
- endCaptures: {
1022
- "0": {
1023
- name: "punctuation.definition.tag"
1024
- }
1025
- },
1026
- patterns: [
1027
- {
1028
- include: "#comment"
1029
- },
1030
- {
1031
- include: "#pragma"
1032
- },
1033
- {
1034
- include: "#bindType"
1035
- }
1036
- ]
1037
- },
1038
- extension: {
1039
- begin: "(\\[)((?<![#\\-:!?.@*/&%^+<=>|~$])%{1,3}(?![#\\-:!?.@*/&%^+<=>|~$]))",
1040
- end: "\\]",
1041
- beginCaptures: {
1042
- "1": {
1043
- name: "constant.language constant.numeric entity.other.attribute-name.id.css strong"
1044
- },
1045
- "2": {
1046
- name: "variable.other.class.js message.error variable.interpolation string.regexp"
1047
- }
1048
- },
1049
- endCaptures: {
1050
- "0": {
1051
- name: "constant.language constant.numeric entity.other.attribute-name.id.css strong"
1052
- }
1053
- },
1054
- patterns: [
1055
- {
1056
- include: "#attributePayload"
1057
- }
1058
- ]
1059
- },
1060
- literal: {
1061
- patterns: [
1062
- {
1063
- include: "#termConstructor"
1064
- },
1065
- {
1066
- include: "#literalArray"
1067
- },
1068
- {
1069
- include: "#literalBoolean"
1070
- },
1071
- {
1072
- include: "#literalCharacter"
1073
- },
1074
- {
1075
- include: "#literalList"
1076
- },
1077
- {
1078
- include: "#literalNumber"
1079
- },
1080
- {
1081
- include: "#literalObjectTerm"
1082
- },
1083
- {
1084
- include: "#literalString"
1085
- },
1086
- {
1087
- include: "#literalRecord"
1088
- },
1089
- {
1090
- include: "#literalUnit"
1091
- }
1092
- ]
1093
- },
1094
- literalArray: {
1095
- begin: "\\[\\|",
1096
- end: "\\|\\]",
1097
- captures: {
1098
- "0": {
1099
- name: "constant.language constant.numeric entity.other.attribute-name.id.css strong"
1100
- }
1101
- },
1102
- patterns: [
1103
- {
1104
- include: "#term"
1105
- }
1106
- ]
1107
- },
1108
- literalBoolean: {
1109
- match: "\\bfalse|true\\b",
1110
- name: "constant.language constant.numeric entity.other.attribute-name.id.css strong"
1111
- },
1112
- literalCharacter: {
1113
- begin: "(?<![[:word:]])'",
1114
- end: "'",
1115
- name: "markup.punctuation.quote.beginning",
1116
- patterns: [
1117
- {
1118
- include: "#literalCharacterEscape"
1119
- }
1120
- ]
1121
- },
1122
- literalCharacterEscape: {
1123
- match: "\\\\(?:[\\\\\"'ntbr]|[[:digit:]][[:digit:]][[:digit:]]|x[[:xdigit:]][[:xdigit:]]|o[0-3][0-7][0-7])"
1124
- },
1125
- literalClassType: {
1126
- patterns: [
1127
- {
1128
- include: "#comment"
1129
- },
1130
- {
1131
- begin: "\\bobject\\b",
1132
- end: "\\bend\\b",
1133
- captures: {
1134
- "0": {
1135
- name: "punctuation.definition.tag emphasis"
1136
- }
1137
- },
1138
- patterns: [
1139
- {
1140
- begin: "\\binherit\\b",
1141
- end: ";;|(?=\\}|\\)|\\]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)",
1142
- beginCaptures: {
1143
- "0": {
1144
- name: "variable.other.class.js message.error variable.interpolation string.regexp"
1145
- }
1146
- },
1147
- endCaptures: {
1148
- "0": {
1149
- name: "punctuation.definition.tag"
1150
- }
1151
- },
1152
- patterns: [
1153
- {
1154
- begin: "\\bas\\b",
1155
- end: ";;|(?=\\}|\\)|\\]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)",
1156
- beginCaptures: {
1157
- "0": {
1158
- name: "variable.other.class.js message.error variable.interpolation string.regexp"
1159
- }
1160
- },
1161
- patterns: [
1162
- {
1163
- include: "#variablePattern"
1164
- }
1165
- ]
1166
- },
1167
- {
1168
- include: "#type"
1169
- }
1170
- ]
1171
- },
1172
- {
1173
- include: "#pattern"
1174
- },
1175
- {
1176
- include: "#declTerm"
1177
- }
1178
- ]
1179
- },
1180
- {
1181
- begin: "\\[",
1182
- end: "\\]"
1183
- }
1184
- ]
1185
- },
1186
- literalList: {
1187
- patterns: [
1188
- {
1189
- begin: "\\[",
1190
- end: "\\]",
1191
- captures: {
1192
- "0": {
1193
- name: "constant.language constant.numeric entity.other.attribute-name.id.css strong"
1194
- }
1195
- },
1196
- patterns: [
1197
- {
1198
- include: "#term"
1199
- }
1200
- ]
1201
- }
1202
- ]
1203
- },
1204
- literalNumber: {
1205
- match: "(?<![[:alpha:]])[[:digit:]][[:digit:]]*(\\.[[:digit:]][[:digit:]]*)?",
1206
- name: "constant.numeric"
1207
- },
1208
- literalObjectTerm: {
1209
- patterns: [
1210
- {
1211
- include: "#comment"
1212
- },
1213
- {
1214
- begin: "\\bobject\\b",
1215
- end: "\\bend\\b",
1216
- captures: {
1217
- "0": {
1218
- name: "punctuation.definition.tag emphasis"
1219
- }
1220
- },
1221
- patterns: [
1222
- {
1223
- begin: "\\binherit\\b",
1224
- end: ";;|(?=\\}|\\)|\\]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)",
1225
- beginCaptures: {
1226
- "0": {
1227
- name: "variable.other.class.js message.error variable.interpolation string.regexp"
1228
- }
1229
- },
1230
- endCaptures: {
1231
- "0": {
1232
- name: "punctuation.definition.tag"
1233
- }
1234
- },
1235
- patterns: [
1236
- {
1237
- begin: "\\bas\\b",
1238
- end: ";;|(?=\\}|\\)|\\]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)",
1239
- beginCaptures: {
1240
- "0": {
1241
- name: "variable.other.class.js message.error variable.interpolation string.regexp"
1242
- }
1243
- },
1244
- patterns: [
1245
- {
1246
- include: "#variablePattern"
1247
- }
1248
- ]
1249
- },
1250
- {
1251
- include: "#term"
1252
- }
1253
- ]
1254
- },
1255
- {
1256
- include: "#pattern"
1257
- },
1258
- {
1259
- include: "#declTerm"
1260
- }
1261
- ]
1262
- },
1263
- {
1264
- begin: "\\[",
1265
- end: "\\]"
1266
- }
1267
- ]
1268
- },
1269
- literalRecord: {
1270
- begin: "\\{",
1271
- end: "\\}",
1272
- captures: {
1273
- "0": {
1274
- name: "constant.language constant.numeric entity.other.attribute-name.id.css strong strong"
1275
- }
1276
- },
1277
- patterns: [
1278
- {
1279
- begin: "(?<=\\{|;)",
1280
- end: "(:)|(=)|(;)|(with)|(?=\\})",
1281
- endCaptures: {
1282
- "1": {
1283
- name: "variable.other.class.js message.error variable.interpolation string.regexp strong"
1284
- },
1285
- "2": {
1286
- name: "support.type strong"
1287
- },
1288
- "3": {
1289
- name: "variable.other.class.js message.error variable.interpolation string.regexp"
1290
- },
1291
- "4": {
1292
- name: "variable.other.class.js message.error variable.interpolation string.regexp"
1293
- }
1294
- },
1295
- patterns: [
1296
- {
1297
- include: "#comment"
1298
- },
1299
- {
1300
- include: "#pathModulePrefixSimple"
1301
- },
1302
- {
1303
- match: "(?:(?!\\b(?:and|'|as|asr|assert|\\*|begin|class|:|,|@|constraint|do|done|downto|else|end|=|exception|external|false|for|\\.|fun|function|functor|>|-|if|in|include|inherit|initializer|land|lazy|\\{|\\(|\\[|<|let|lor|lsl|lsr|lxor|match|method|mod|module|mutable|new|nonrec|#|object|of|open|or|%|\\+|private|\\?|\"|rec|\\\\|\\}|\\)|\\]|;|sig|/|struct|then|~|to|true|try|type|val|\\||virtual|when|while|with)\\b(?:[^']|$))\\b(?=[[:lower:]_])[[:alpha:]_][[:word:]']*)",
1304
- name: "markup.inserted constant.language support.constant.property-value entity.name.filename emphasis"
1305
- }
1306
- ]
1307
- },
1308
- {
1309
- begin: "(?:(?<=(?:[^[:word:]]with|^with))(?![[:word:]]))",
1310
- end: "(:)|(=)|(;)|(?=\\})",
1311
- endCaptures: {
1312
- "1": {
1313
- name: "variable.other.class.js message.error variable.interpolation string.regexp strong"
1314
- },
1315
- "2": {
1316
- name: "support.type strong"
1317
- },
1318
- "3": {
1319
- name: "variable.other.class.js message.error variable.interpolation string.regexp"
1320
- }
1321
- },
1322
- patterns: [
1323
- {
1324
- match: "(?:(?!\\b(?:and|'|as|asr|assert|\\*|begin|class|:|,|@|constraint|do|done|downto|else|end|=|exception|external|false|for|\\.|fun|function|functor|>|-|if|in|include|inherit|initializer|land|lazy|\\{|\\(|\\[|<|let|lor|lsl|lsr|lxor|match|method|mod|module|mutable|new|nonrec|#|object|of|open|or|%|\\+|private|\\?|\"|rec|\\\\|\\}|\\)|\\]|;|sig|/|struct|then|~|to|true|try|type|val|\\||virtual|when|while|with)\\b(?:[^']|$))\\b(?=[[:lower:]_])[[:alpha:]_][[:word:]']*)",
1325
- name: "markup.inserted constant.language support.constant.property-value entity.name.filename emphasis"
1326
- }
1327
- ]
1328
- },
1329
- {
1330
- begin: "(?:(?<=(?:[^#\\-:!?.@*/&%^+<=>|~$]:|^:))(?![#\\-:!?.@*/&%^+<=>|~$]))",
1331
- end: "(;)|(=)|(?=\\})",
1332
- endCaptures: {
1333
- "1": {
1334
- name: "variable.other.class.js message.error variable.interpolation string.regexp"
1335
- },
1336
- "2": {
1337
- name: "support.type strong"
1338
- }
1339
- },
1340
- patterns: [
1341
- {
1342
- include: "#type"
1343
- }
1344
- ]
1345
- },
1346
- {
1347
- begin: "(?:(?<=(?:[^#\\-:!?.@*/&%^+<=>|~$]=|^=))(?![#\\-:!?.@*/&%^+<=>|~$]))",
1348
- end: ";|(?=\\})",
1349
- endCaptures: {
1350
- "0": {
1351
- name: "variable.other.class.js message.error variable.interpolation string.regexp"
1352
- }
1353
- },
1354
- patterns: [
1355
- {
1356
- include: "#term"
1357
- }
1358
- ]
1359
- }
1360
- ]
1361
- },
1362
- literalString: {
1363
- patterns: [
1364
- {
1365
- begin: "\"",
1366
- end: "\"",
1367
- name: "string beginning.punctuation.definition.quote.markdown",
1368
- patterns: [
1369
- {
1370
- include: "#literalStringEscape"
1371
- }
1372
- ]
1373
- },
1374
- {
1375
- begin: "(\\{)([_[:lower:]]*?)(\\|)",
1376
- end: "(\\|)(\\2)(\\})",
1377
- name: "string beginning.punctuation.definition.quote.markdown",
1378
- patterns: [
1379
- {
1380
- include: "#literalStringEscape"
1381
- }
1382
- ]
1383
- }
1384
- ]
1385
- },
1386
- literalStringEscape: {
1387
- match: "\\\\(?:[\\\\\"ntbr]|[[:digit:]][[:digit:]][[:digit:]]|x[[:xdigit:]][[:xdigit:]]|o[0-3][0-7][0-7])"
1388
- },
1389
- literalUnit: {
1390
- match: "\\(\\)",
1391
- name: "constant.language constant.numeric entity.other.attribute-name.id.css strong"
1392
- },
1393
- pathModuleExtended: {
1394
- patterns: [
1395
- {
1396
- include: "#pathModulePrefixExtended"
1397
- },
1398
- {
1399
- match: "(?:\\b(?=[[:upper:]])[[:alpha:]_][[:word:]']*)",
1400
- name: "entity.name.class constant.numeric"
1401
- }
1402
- ]
1403
- },
1404
- pathModulePrefixExtended: {
1405
- begin: "(?:\\b(?=[[:upper:]])[[:alpha:]_][[:word:]']*)(?=[[:space:]]*\\.|$|\\()",
1406
- end: "(?![[:space:]\\.]|$|\\()",
1407
- beginCaptures: {
1408
- "0": {
1409
- name: "entity.name.class constant.numeric"
1410
- }
1411
- },
1412
- patterns: [
1413
- {
1414
- include: "#comment"
1415
- },
1416
- {
1417
- begin: "\\(",
1418
- end: "\\)",
1419
- captures: {
1420
- "0": {
1421
- name: "keyword.control"
1422
- }
1423
- },
1424
- patterns: [
1425
- {
1426
- match: "((?:\\b(?=[[:upper:]])[[:alpha:]_][[:word:]']*)(?=[[:space:]]*\\)))",
1427
- name: "string.other.link variable.language variable.parameter emphasis"
1428
- },
1429
- {
1430
- include: "#structure"
1431
- }
1432
- ]
1433
- },
1434
- {
1435
- begin: "(?<![#\\-:!?.@*/&%^+<=>|~$])\\.(?![#\\-:!?.@*/&%^+<=>|~$])",
1436
- end: "((?:\\b(?=[[:upper:]])[[:alpha:]_][[:word:]']*)(?=[[:space:]]*\\.|$))|((?:\\b(?=[[:upper:]])[[:alpha:]_][[:word:]']*)(?=[[:space:]]*(?:$|\\()))|((?:\\b(?=[[:upper:]])[[:alpha:]_][[:word:]']*)(?=[[:space:]]*\\)))|(?![[:space:]\\.[:upper:]]|$|\\()",
1437
- beginCaptures: {
1438
- "0": {
1439
- name: "keyword strong"
1440
- }
1441
- },
1442
- endCaptures: {
1443
- "1": {
1444
- name: "entity.name.class constant.numeric"
1445
- },
1446
- "2": {
1447
- name: "entity.name.function strong"
1448
- },
1449
- "3": {
1450
- name: "string.other.link variable.language variable.parameter emphasis"
1451
- }
1452
- }
1453
- }
1454
- ]
1455
- },
1456
- pathModulePrefixExtendedParens: {
1457
- begin: "\\(",
1458
- end: "\\)",
1459
- captures: {
1460
- "0": {
1461
- name: "keyword.control"
1462
- }
1463
- },
1464
- patterns: [
1465
- {
1466
- match: "((?:\\b(?=[[:upper:]])[[:alpha:]_][[:word:]']*)(?=[[:space:]]*\\)))",
1467
- name: "string.other.link variable.language variable.parameter emphasis"
1468
- },
1469
- {
1470
- include: "#structure"
1471
- }
1472
- ]
1473
- },
1474
- pathModulePrefixSimple: {
1475
- begin: "(?:\\b(?=[[:upper:]])[[:alpha:]_][[:word:]']*)(?=[[:space:]]*\\.)",
1476
- end: "(?![[:space:]\\.])",
1477
- beginCaptures: {
1478
- "0": {
1479
- name: "entity.name.class constant.numeric"
1480
- }
1481
- },
1482
- patterns: [
1483
- {
1484
- include: "#comment"
1485
- },
1486
- {
1487
- begin: "(?<![#\\-:!?.@*/&%^+<=>|~$])\\.(?![#\\-:!?.@*/&%^+<=>|~$])",
1488
- end: "((?:\\b(?=[[:upper:]])[[:alpha:]_][[:word:]']*)(?=[[:space:]]*\\.))|((?:\\b(?=[[:upper:]])[[:alpha:]_][[:word:]']*)(?=[[:space:]]*))|(?![[:space:]\\.[:upper:]])",
1489
- beginCaptures: {
1490
- "0": {
1491
- name: "keyword strong"
1492
- }
1493
- },
1494
- endCaptures: {
1495
- "1": {
1496
- name: "entity.name.class constant.numeric"
1497
- },
1498
- "2": {
1499
- name: "constant.language constant.numeric entity.other.attribute-name.id.css strong"
1500
- }
1501
- }
1502
- }
1503
- ]
1504
- },
1505
- pathModuleSimple: {
1506
- patterns: [
1507
- {
1508
- include: "#pathModulePrefixSimple"
1509
- },
1510
- {
1511
- match: "(?:\\b(?=[[:upper:]])[[:alpha:]_][[:word:]']*)",
1512
- name: "entity.name.class constant.numeric"
1513
- }
1514
- ]
1515
- },
1516
- pathRecord: {
1517
- patterns: [
1518
- {
1519
- begin: "(?:(?!\\b(?:and|'|as|asr|assert|\\*|begin|class|:|,|@|constraint|do|done|downto|else|end|=|exception|external|false|for|\\.|fun|function|functor|>|-|if|in|include|inherit|initializer|land|lazy|\\{|\\(|\\[|<|let|lor|lsl|lsr|lxor|match|method|mod|module|mutable|new|nonrec|#|object|of|open|or|%|\\+|private|\\?|\"|rec|\\\\|\\}|\\)|\\]|;|sig|/|struct|then|~|to|true|try|type|val|\\||virtual|when|while|with)\\b(?:[^']|$))\\b(?=[[:lower:]_])[[:alpha:]_][[:word:]']*)",
1520
- end: "(?=[^[:space:]\\.])(?!\\(\\*)",
1521
- patterns: [
1522
- {
1523
- include: "#comment"
1524
- },
1525
- {
1526
- begin: "(?:(?<=(?:[^#\\-:!?.@*/&%^+<=>|~$]\\.|^\\.))(?![#\\-:!?.@*/&%^+<=>|~$]))|(?<![#\\-:!?.@*/&%^+<=>|~$])\\.(?![#\\-:!?.@*/&%^+<=>|~$])",
1527
- end: "((?<![#\\-:!?.@*/&%^+<=>|~$])\\.(?![#\\-:!?.@*/&%^+<=>|~$]))|((?:(?!\\b(?:and|'|as|asr|assert|\\*|begin|class|:|,|@|constraint|do|done|downto|else|end|=|exception|external|false|for|\\.|fun|function|functor|>|-|if|in|include|inherit|initializer|land|lazy|\\{|\\(|\\[|<|let|lor|lsl|lsr|lxor|match|method|mod|mutable|nonrec|#|object|of|open|or|%|\\+|private|\\?|\"|rec|\\\\|\\}|\\)|\\]|;|sig|/|struct|then|~|to|true|try|type|val|\\||virtual|when|while|with)\\b(?:[^']|$))\\b(?=[[:lower:]_])[[:alpha:]_][[:word:]']*))|(?<=\\))|(?<=\\])",
1528
- beginCaptures: {
1529
- "0": {
1530
- name: "keyword strong"
1531
- }
1532
- },
1533
- endCaptures: {
1534
- "1": {
1535
- name: "keyword strong"
1536
- },
1537
- "2": {
1538
- name: "markup.inserted constant.language support.constant.property-value entity.name.filename"
1539
- }
1540
- },
1541
- patterns: [
1542
- {
1543
- include: "#comment"
1544
- },
1545
- {
1546
- include: "#pathModulePrefixSimple"
1547
- },
1548
- {
1549
- begin: "\\((?!\\*)",
1550
- end: "\\)",
1551
- captures: {
1552
- "0": {
1553
- name: "variable.other.class.js message.error variable.interpolation string.regexp"
1554
- }
1555
- },
1556
- patterns: [
1557
- {
1558
- include: "#term"
1559
- }
1560
- ]
1561
- },
1562
- {
1563
- begin: "\\[",
1564
- end: "\\]",
1565
- captures: {
1566
- "0": {
1567
- name: "variable.other.class.js message.error variable.interpolation string.regexp"
1568
- }
1569
- },
1570
- patterns: [
1571
- {
1572
- include: "#pattern"
1573
- }
1574
- ]
1575
- }
1576
- ]
1577
- }
1578
- ]
1579
- }
1580
- ]
1581
- },
1582
- pattern: {
1583
- patterns: [
1584
- {
1585
- include: "#comment"
1586
- },
1587
- {
1588
- include: "#patternArray"
1589
- },
1590
- {
1591
- include: "#patternLazy"
1592
- },
1593
- {
1594
- include: "#patternList"
1595
- },
1596
- {
1597
- include: "#patternMisc"
1598
- },
1599
- {
1600
- include: "#patternModule"
1601
- },
1602
- {
1603
- include: "#patternRecord"
1604
- },
1605
- {
1606
- include: "#literal"
1607
- },
1608
- {
1609
- include: "#patternParens"
1610
- },
1611
- {
1612
- include: "#patternType"
1613
- },
1614
- {
1615
- include: "#variablePattern"
1616
- },
1617
- {
1618
- include: "#termOperator"
1619
- }
1620
- ]
1621
- },
1622
- patternArray: {
1623
- begin: "\\[\\|",
1624
- end: "\\|\\]",
1625
- captures: {
1626
- "0": {
1627
- name: "constant.language constant.numeric entity.other.attribute-name.id.css strong"
1628
- }
1629
- },
1630
- patterns: [
1631
- {
1632
- include: "#pattern"
1633
- }
1634
- ]
1635
- },
1636
- patternLazy: {
1637
- match: "lazy",
1638
- name: "variable.other.class.js message.error variable.interpolation string.regexp"
1639
- },
1640
- patternList: {
1641
- begin: "\\[",
1642
- end: "\\]",
1643
- captures: {
1644
- "0": {
1645
- name: "constant.language constant.numeric entity.other.attribute-name.id.css strong"
1646
- }
1647
- },
1648
- patterns: [
1649
- {
1650
- include: "#pattern"
1651
- }
1652
- ]
1653
- },
1654
- patternMisc: {
1655
- match: "((?<![#\\-:!?.@*/&%^+<=>|~$]),(?![#\\-:!?.@*/&%^+<=>|~$]))|([#\\-:!?.@*/&%^+<=>|~$]+)|\\b(as)\\b",
1656
- captures: {
1657
- "1": {
1658
- name: "string.regexp strong"
1659
- },
1660
- "2": {
1661
- name: "variable.other.class.js message.error variable.interpolation string.regexp"
1662
- },
1663
- "3": {
1664
- name: "variable.other.class.js message.error variable.interpolation string.regexp"
1665
- }
1666
- }
1667
- },
1668
- patternModule: {
1669
- begin: "\\bmodule\\b",
1670
- end: "(?=\\))",
1671
- beginCaptures: {
1672
- "0": {
1673
- name: "markup.inserted constant.language support.constant.property-value entity.name.filename"
1674
- }
1675
- },
1676
- patterns: [
1677
- {
1678
- include: "#declModule"
1679
- }
1680
- ]
1681
- },
1682
- patternParens: {
1683
- begin: "\\((?!\\))",
1684
- end: "\\)",
1685
- captures: {
1686
- "0": {
1687
- name: "punctuation.definition.tag"
1688
- }
1689
- },
1690
- patterns: [
1691
- {
1692
- include: "#comment"
1693
- },
1694
- {
1695
- begin: "(?<![#\\-:!?.@*/&%^+<=>|~$]):(?![#\\-:!?.@*/&%^+<=>|~$])",
1696
- end: "(?=\\))",
1697
- beginCaptures: {
1698
- "0": {
1699
- name: "variable.other.class.js message.error variable.interpolation string.regexp strong"
1700
- }
1701
- },
1702
- patterns: [
1703
- {
1704
- include: "#type"
1705
- }
1706
- ]
1707
- },
1708
- {
1709
- include: "#pattern"
1710
- }
1711
- ]
1712
- },
1713
- patternRecord: {
1714
- begin: "\\{",
1715
- end: "\\}",
1716
- captures: {
1717
- "0": {
1718
- name: "constant.language constant.numeric entity.other.attribute-name.id.css strong strong"
1719
- }
1720
- },
1721
- patterns: [
1722
- {
1723
- begin: "(?<=\\{|;)",
1724
- end: "(:)|(=)|(;)|(with)|(?=\\})",
1725
- endCaptures: {
1726
- "1": {
1727
- name: "variable.other.class.js message.error variable.interpolation string.regexp strong"
1728
- },
1729
- "2": {
1730
- name: "support.type strong"
1731
- },
1732
- "3": {
1733
- name: "variable.other.class.js message.error variable.interpolation string.regexp"
1734
- },
1735
- "4": {
1736
- name: "variable.other.class.js message.error variable.interpolation string.regexp"
1737
- }
1738
- },
1739
- patterns: [
1740
- {
1741
- include: "#comment"
1742
- },
1743
- {
1744
- include: "#pathModulePrefixSimple"
1745
- },
1746
- {
1747
- match: "(?:(?!\\b(?:and|'|as|asr|assert|\\*|begin|class|:|,|@|constraint|do|done|downto|else|end|=|exception|external|false|for|\\.|fun|function|functor|>|-|if|in|include|inherit|initializer|land|lazy|\\{|\\(|\\[|<|let|lor|lsl|lsr|lxor|match|method|mod|module|mutable|new|nonrec|#|object|of|open|or|%|\\+|private|\\?|\"|rec|\\\\|\\}|\\)|\\]|;|sig|/|struct|then|~|to|true|try|type|val|\\||virtual|when|while|with)\\b(?:[^']|$))\\b(?=[[:lower:]_])[[:alpha:]_][[:word:]']*)",
1748
- name: "markup.inserted constant.language support.constant.property-value entity.name.filename emphasis"
1749
- }
1750
- ]
1751
- },
1752
- {
1753
- begin: "(?:(?<=(?:[^[:word:]]with|^with))(?![[:word:]]))",
1754
- end: "(:)|(=)|(;)|(?=\\})",
1755
- endCaptures: {
1756
- "1": {
1757
- name: "variable.other.class.js message.error variable.interpolation string.regexp strong"
1758
- },
1759
- "2": {
1760
- name: "support.type strong"
1761
- },
1762
- "3": {
1763
- name: "variable.other.class.js message.error variable.interpolation string.regexp"
1764
- }
1765
- },
1766
- patterns: [
1767
- {
1768
- match: "(?:(?!\\b(?:and|'|as|asr|assert|\\*|begin|class|:|,|@|constraint|do|done|downto|else|end|=|exception|external|false|for|\\.|fun|function|functor|>|-|if|in|include|inherit|initializer|land|lazy|\\{|\\(|\\[|<|let|lor|lsl|lsr|lxor|match|method|mod|module|mutable|new|nonrec|#|object|of|open|or|%|\\+|private|\\?|\"|rec|\\\\|\\}|\\)|\\]|;|sig|/|struct|then|~|to|true|try|type|val|\\||virtual|when|while|with)\\b(?:[^']|$))\\b(?=[[:lower:]_])[[:alpha:]_][[:word:]']*)",
1769
- name: "markup.inserted constant.language support.constant.property-value entity.name.filename emphasis"
1770
- }
1771
- ]
1772
- },
1773
- {
1774
- begin: "(?:(?<=(?:[^#\\-:!?.@*/&%^+<=>|~$]:|^:))(?![#\\-:!?.@*/&%^+<=>|~$]))",
1775
- end: "(;)|(=)|(?=\\})",
1776
- endCaptures: {
1777
- "1": {
1778
- name: "variable.other.class.js message.error variable.interpolation string.regexp"
1779
- },
1780
- "2": {
1781
- name: "support.type strong"
1782
- }
1783
- },
1784
- patterns: [
1785
- {
1786
- include: "#type"
1787
- }
1788
- ]
1789
- },
1790
- {
1791
- begin: "(?:(?<=(?:[^#\\-:!?.@*/&%^+<=>|~$]=|^=))(?![#\\-:!?.@*/&%^+<=>|~$]))",
1792
- end: ";|(?=\\})",
1793
- endCaptures: {
1794
- "0": {
1795
- name: "variable.other.class.js message.error variable.interpolation string.regexp"
1796
- }
1797
- },
1798
- patterns: [
1799
- {
1800
- include: "#pattern"
1801
- }
1802
- ]
1803
- }
1804
- ]
1805
- },
1806
- patternType: {
1807
- begin: "\\btype\\b",
1808
- end: "(?=\\))",
1809
- beginCaptures: {
1810
- "0": {
1811
- name: "keyword"
1812
- }
1813
- },
1814
- patterns: [
1815
- {
1816
- include: "#declType"
1817
- }
1818
- ]
1819
- },
1820
- pragma: {
1821
- begin: "(?<![#\\-:!?.@*/&%^+<=>|~$])#(?![#\\-:!?.@*/&%^+<=>|~$])",
1822
- end: "(?=;;|\\}|\\)|\\]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)",
1823
- beginCaptures: {
1824
- "0": {
1825
- name: "punctuation.definition.tag"
1826
- }
1827
- },
1828
- patterns: [
1829
- {
1830
- include: "#comment"
1831
- },
1832
- {
1833
- include: "#literalNumber"
1834
- },
1835
- {
1836
- include: "#literalString"
1837
- }
1838
- ]
1839
- },
1840
- signature: {
1841
- patterns: [
1842
- {
1843
- include: "#comment"
1844
- },
1845
- {
1846
- include: "#signatureLiteral"
1847
- },
1848
- {
1849
- include: "#signatureFunctor"
1850
- },
1851
- {
1852
- include: "#pathModuleExtended"
1853
- },
1854
- {
1855
- include: "#signatureParens"
1856
- },
1857
- {
1858
- include: "#signatureRecovered"
1859
- },
1860
- {
1861
- include: "#signatureConstraints"
1862
- }
1863
- ]
1864
- },
1865
- signatureConstraints: {
1866
- begin: "\\bwith\\b",
1867
- end: "(?=\\))|(?=;;|\\}|\\)|\\]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)",
1868
- beginCaptures: {
1869
- "0": {
1870
- name: "variable.other.class.js message.error variable.interpolation string.regexp markup.underline"
1871
- }
1872
- },
1873
- patterns: [
1874
- {
1875
- begin: "(?:(?<=(?:[^[:word:]]with|^with))(?![[:word:]]))",
1876
- end: "\\b(?:(module)|(type))\\b",
1877
- endCaptures: {
1878
- "1": {
1879
- name: "markup.inserted constant.language support.constant.property-value entity.name.filename"
1880
- },
1881
- "2": {
1882
- name: "keyword"
1883
- }
1884
- }
1885
- },
1886
- {
1887
- include: "#declModule"
1888
- },
1889
- {
1890
- include: "#declType"
1891
- }
1892
- ]
1893
- },
1894
- signatureFunctor: {
1895
- patterns: [
1896
- {
1897
- begin: "\\bfunctor\\b",
1898
- end: "(?=;;|\\}|\\)|\\]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)",
1899
- beginCaptures: {
1900
- "0": {
1901
- name: "keyword"
1902
- }
1903
- },
1904
- patterns: [
1905
- {
1906
- begin: "(?:(?<=(?:[^[:word:]]functor|^functor))(?![[:word:]]))",
1907
- end: "(\\(\\))|(\\((?!\\)))",
1908
- endCaptures: {
1909
- "1": {
1910
- name: "constant.language constant.numeric entity.other.attribute-name.id.css strong"
1911
- },
1912
- "2": {
1913
- name: "punctuation.definition.tag"
1914
- }
1915
- }
1916
- },
1917
- {
1918
- begin: "(?<=\\()",
1919
- end: "(:)|(\\))",
1920
- endCaptures: {
1921
- "1": {
1922
- name: "variable.other.class.js message.error variable.interpolation string.regexp strong"
1923
- },
1924
- "2": {
1925
- name: "punctuation.definition.tag"
1926
- }
1927
- },
1928
- patterns: [
1929
- {
1930
- include: "#variableModule"
1931
- }
1932
- ]
1933
- },
1934
- {
1935
- begin: "(?:(?<=(?:[^#\\-:!?.@*/&%^+<=>|~$]:|^:))(?![#\\-:!?.@*/&%^+<=>|~$]))",
1936
- end: "\\)",
1937
- endCaptures: {
1938
- "0": {
1939
- name: "punctuation.definition.tag"
1940
- }
1941
- },
1942
- patterns: [
1943
- {
1944
- include: "#signature"
1945
- }
1946
- ]
1947
- },
1948
- {
1949
- begin: "(?<=\\))",
1950
- end: "(\\()|((?<![#\\-:!?.@*/&%^+<=>|~$])->(?![#\\-:!?.@*/&%^+<=>|~$]))",
1951
- endCaptures: {
1952
- "1": {
1953
- name: "punctuation.definition.tag"
1954
- },
1955
- "2": {
1956
- name: "support.type strong"
1957
- }
1958
- }
1959
- },
1960
- {
1961
- begin: "(?:(?<=(?:[^#\\-:!?.@*/&%^+<=>|~$]->|^->))(?![#\\-:!?.@*/&%^+<=>|~$]))",
1962
- end: "(?=;;|\\}|\\)|\\]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)",
1963
- patterns: [
1964
- {
1965
- include: "#signature"
1966
- }
1967
- ]
1968
- }
1969
- ]
1970
- },
1971
- {
1972
- match: "(?<![#\\-:!?.@*/&%^+<=>|~$])->(?![#\\-:!?.@*/&%^+<=>|~$])",
1973
- name: "support.type strong"
1974
- }
1975
- ]
1976
- },
1977
- signatureLiteral: {
1978
- begin: "\\bsig\\b",
1979
- end: "\\bend\\b",
1980
- captures: {
1981
- "0": {
1982
- name: "punctuation.definition.tag emphasis"
1983
- }
1984
- },
1985
- patterns: [
1986
- {
1987
- include: "#comment"
1988
- },
1989
- {
1990
- include: "#pragma"
1991
- },
1992
- {
1993
- include: "#decl"
1994
- }
1995
- ]
1996
- },
1997
- signatureParens: {
1998
- begin: "\\((?!\\))",
1999
- end: "\\)",
2000
- captures: {
2001
- "0": {
2002
- name: "punctuation.definition.tag"
2003
- }
2004
- },
2005
- patterns: [
2006
- {
2007
- include: "#comment"
2008
- },
2009
- {
2010
- begin: "(?<![#\\-:!?.@*/&%^+<=>|~$]):(?![#\\-:!?.@*/&%^+<=>|~$])",
2011
- end: "(?=\\))",
2012
- beginCaptures: {
2013
- "0": {
2014
- name: "variable.other.class.js message.error variable.interpolation string.regexp strong"
2015
- }
2016
- },
2017
- patterns: [
2018
- {
2019
- include: "#signature"
2020
- }
2021
- ]
2022
- },
2023
- {
2024
- include: "#signature"
2025
- }
2026
- ]
2027
- },
2028
- signatureRecovered: {
2029
- patterns: [
2030
- {
2031
- begin: "\\(|(?:(?<=(?:[^#\\-:!?.@*/&%^+<=>|~$]:|^:|[^#\\-:!?.@*/&%^+<=>|~$]->|^->))(?![#\\-:!?.@*/&%^+<=>|~$]))|(?:(?<=(?:[^[:word:]]include|^include|[^[:word:]]open|^open))(?![[:word:]]))",
2032
- end: "\\bmodule\\b|(?!$|[[:space:]]|\\bmodule\\b)",
2033
- endCaptures: {
2034
- "0": {
2035
- name: "markup.inserted constant.language support.constant.property-value entity.name.filename"
2036
- }
2037
- }
2038
- },
2039
- {
2040
- begin: "(?:(?<=(?:[^[:word:]]module|^module))(?![[:word:]]))",
2041
- end: "(?=;;|\\}|\\)|\\]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)",
2042
- patterns: [
2043
- {
2044
- begin: "(?:(?<=(?:[^[:word:]]module|^module))(?![[:word:]]))",
2045
- end: "\\btype\\b",
2046
- endCaptures: {
2047
- "0": {
2048
- name: "keyword"
2049
- }
2050
- }
2051
- },
2052
- {
2053
- begin: "(?:(?<=(?:[^[:word:]]type|^type))(?![[:word:]]))",
2054
- end: "\\bof\\b",
2055
- endCaptures: {
2056
- "0": {
2057
- name: "punctuation.definition.tag"
2058
- }
2059
- }
2060
- },
2061
- {
2062
- begin: "(?:(?<=(?:[^[:word:]]of|^of))(?![[:word:]]))",
2063
- end: "(?=;;|\\}|\\)|\\]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)",
2064
- patterns: [
2065
- {
2066
- include: "#signature"
2067
- }
2068
- ]
2069
- }
2070
- ]
2071
- }
2072
- ]
2073
- },
2074
- structure: {
2075
- patterns: [
2076
- {
2077
- include: "#comment"
2078
- },
2079
- {
2080
- include: "#structureLiteral"
2081
- },
2082
- {
2083
- include: "#structureFunctor"
2084
- },
2085
- {
2086
- include: "#pathModuleExtended"
2087
- },
2088
- {
2089
- include: "#structureParens"
2090
- }
2091
- ]
2092
- },
2093
- structureFunctor: {
2094
- patterns: [
2095
- {
2096
- begin: "\\bfunctor\\b",
2097
- end: "(?=;;|\\}|\\)|\\]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)",
2098
- beginCaptures: {
2099
- "0": {
2100
- name: "keyword"
2101
- }
2102
- },
2103
- patterns: [
2104
- {
2105
- begin: "(?:(?<=(?:[^[:word:]]functor|^functor))(?![[:word:]]))",
2106
- end: "(\\(\\))|(\\((?!\\)))",
2107
- endCaptures: {
2108
- "1": {
2109
- name: "constant.language constant.numeric entity.other.attribute-name.id.css strong"
2110
- },
2111
- "2": {
2112
- name: "punctuation.definition.tag"
2113
- }
2114
- }
2115
- },
2116
- {
2117
- begin: "(?<=\\()",
2118
- end: "(:)|(\\))",
2119
- endCaptures: {
2120
- "1": {
2121
- name: "variable.other.class.js message.error variable.interpolation string.regexp strong"
2122
- },
2123
- "2": {
2124
- name: "punctuation.definition.tag"
2125
- }
2126
- },
2127
- patterns: [
2128
- {
2129
- include: "#variableModule"
2130
- }
2131
- ]
2132
- },
2133
- {
2134
- begin: "(?:(?<=(?:[^#\\-:!?.@*/&%^+<=>|~$]:|^:))(?![#\\-:!?.@*/&%^+<=>|~$]))",
2135
- end: "\\)",
2136
- endCaptures: {
2137
- "0": {
2138
- name: "punctuation.definition.tag"
2139
- }
2140
- },
2141
- patterns: [
2142
- {
2143
- include: "#signature"
2144
- }
2145
- ]
2146
- },
2147
- {
2148
- begin: "(?<=\\))",
2149
- end: "(\\()|((?<![#\\-:!?.@*/&%^+<=>|~$])->(?![#\\-:!?.@*/&%^+<=>|~$]))",
2150
- endCaptures: {
2151
- "1": {
2152
- name: "punctuation.definition.tag"
2153
- },
2154
- "2": {
2155
- name: "support.type strong"
2156
- }
2157
- }
2158
- },
2159
- {
2160
- begin: "(?:(?<=(?:[^#\\-:!?.@*/&%^+<=>|~$]->|^->))(?![#\\-:!?.@*/&%^+<=>|~$]))",
2161
- end: "(?=;;|\\}|\\)|\\]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)",
2162
- patterns: [
2163
- {
2164
- include: "#structure"
2165
- }
2166
- ]
2167
- }
2168
- ]
2169
- },
2170
- {
2171
- match: "(?<![#\\-:!?.@*/&%^+<=>|~$])->(?![#\\-:!?.@*/&%^+<=>|~$])",
2172
- name: "support.type strong"
2173
- }
2174
- ]
2175
- },
2176
- structureLiteral: {
2177
- begin: "\\bstruct\\b",
2178
- end: "\\bend\\b",
2179
- captures: {
2180
- "0": {
2181
- name: "punctuation.definition.tag emphasis"
2182
- }
2183
- },
2184
- patterns: [
2185
- {
2186
- include: "#comment"
2187
- },
2188
- {
2189
- include: "#pragma"
2190
- },
2191
- {
2192
- include: "#decl"
2193
- }
2194
- ]
2195
- },
2196
- structureParens: {
2197
- begin: "\\(",
2198
- end: "\\)",
2199
- captures: {
2200
- "0": {
2201
- name: "punctuation.definition.tag"
2202
- }
2203
- },
2204
- patterns: [
2205
- {
2206
- include: "#structureUnpack"
2207
- },
2208
- {
2209
- include: "#structure"
2210
- }
2211
- ]
2212
- },
2213
- structureUnpack: {
2214
- begin: "\\bval\\b",
2215
- end: "(?=\\))",
2216
- beginCaptures: {
2217
- "0": {
2218
- name: "variable.other.class.js message.error variable.interpolation string.regexp"
2219
- }
2220
- }
2221
- },
2222
- term: {
2223
- patterns: [
2224
- {
2225
- include: "#termLet"
2226
- },
2227
- {
2228
- include: "#termAtomic"
2229
- }
2230
- ]
2231
- },
2232
- termAtomic: {
2233
- patterns: [
2234
- {
2235
- include: "#comment"
2236
- },
2237
- {
2238
- include: "#termConditional"
2239
- },
2240
- {
2241
- include: "#termConstructor"
2242
- },
2243
- {
2244
- include: "#termDelim"
2245
- },
2246
- {
2247
- include: "#termFor"
2248
- },
2249
- {
2250
- include: "#termFunction"
2251
- },
2252
- {
2253
- include: "#literal"
2254
- },
2255
- {
2256
- include: "#termMatch"
2257
- },
2258
- {
2259
- include: "#termMatchRule"
2260
- },
2261
- {
2262
- include: "#termPun"
2263
- },
2264
- {
2265
- include: "#termOperator"
2266
- },
2267
- {
2268
- include: "#termTry"
2269
- },
2270
- {
2271
- include: "#termWhile"
2272
- },
2273
- {
2274
- include: "#pathRecord"
2275
- }
2276
- ]
2277
- },
2278
- termConditional: {
2279
- match: "\\b(?:if|then|else)\\b",
2280
- name: "keyword.control"
2281
- },
2282
- termConstructor: {
2283
- patterns: [
2284
- {
2285
- include: "#pathModulePrefixSimple"
2286
- },
2287
- {
2288
- match: "(?:\\b(?=[[:upper:]])[[:alpha:]_][[:word:]']*)",
2289
- name: "constant.language constant.numeric entity.other.attribute-name.id.css strong"
2290
- }
2291
- ]
2292
- },
2293
- termDelim: {
2294
- patterns: [
2295
- {
2296
- begin: "\\((?!\\))",
2297
- end: "\\)",
2298
- captures: {
2299
- "0": {
2300
- name: "punctuation.definition.tag"
2301
- }
2302
- },
2303
- patterns: [
2304
- {
2305
- include: "#term"
2306
- }
2307
- ]
383
+ }
2308
384
  },
2309
385
  {
2310
- begin: "\\bbegin\\b",
2311
- end: "\\bend\\b",
386
+ comment: "character literal from escaped quote or whitespace",
387
+ name: "string.quoted.single.ocaml",
388
+ match: "'(\\\\[\"'ntbr ])'",
2312
389
  captures: {
2313
- "0": {
2314
- name: "punctuation.definition.tag"
2315
- }
2316
- },
2317
- patterns: [
2318
- {
2319
- include: "#attributeIdentifier"
2320
- },
2321
- {
2322
- include: "#term"
2323
- }
2324
- ]
2325
- }
2326
- ]
2327
- },
2328
- termFor: {
2329
- patterns: [
2330
- {
2331
- begin: "\\bfor\\b",
2332
- end: "\\bdone\\b",
2333
- beginCaptures: {
2334
- "0": {
2335
- name: "keyword.control"
2336
- }
2337
- },
2338
- endCaptures: {
2339
- "0": {
2340
- name: "keyword.control"
2341
- }
2342
- },
2343
- patterns: [
2344
- {
2345
- begin: "(?:(?<=(?:[^[:word:]]for|^for))(?![[:word:]]))",
2346
- end: "(?<![#\\-:!?.@*/&%^+<=>|~$])=(?![#\\-:!?.@*/&%^+<=>|~$])",
2347
- endCaptures: {
2348
- "0": {
2349
- name: "support.type strong"
2350
- }
2351
- },
2352
- patterns: [
2353
- {
2354
- include: "#pattern"
2355
- }
2356
- ]
2357
- },
2358
- {
2359
- begin: "(?:(?<=(?:[^#\\-:!?.@*/&%^+<=>|~$]=|^=))(?![#\\-:!?.@*/&%^+<=>|~$]))",
2360
- end: "\\b(?:downto|to)\\b",
2361
- endCaptures: {
2362
- "0": {
2363
- name: "keyword.control"
2364
- }
2365
- },
2366
- patterns: [
2367
- {
2368
- include: "#term"
2369
- }
2370
- ]
2371
- },
2372
- {
2373
- begin: "(?:(?<=(?:[^[:word:]]to|^to))(?![[:word:]]))",
2374
- end: "\\bdo\\b",
2375
- endCaptures: {
2376
- "0": {
2377
- name: "keyword.control"
2378
- }
2379
- },
2380
- patterns: [
2381
- {
2382
- include: "#term"
2383
- }
2384
- ]
2385
- },
2386
- {
2387
- begin: "(?:(?<=(?:[^[:word:]]do|^do))(?![[:word:]]))",
2388
- end: "(?=\\bdone\\b)",
2389
- patterns: [
2390
- {
2391
- include: "#term"
2392
- }
2393
- ]
2394
- }
2395
- ]
2396
- }
2397
- ]
2398
- },
2399
- termFunction: {
2400
- match: "\\b(?:(fun)|(function))\\b",
2401
- captures: {
2402
- "1": {
2403
- name: "storage.type"
2404
- },
2405
- "2": {
2406
- name: "storage.type"
2407
- }
2408
- }
2409
- },
2410
- termLet: {
2411
- patterns: [
2412
- {
2413
- begin: "(?:(?:(?<=(?:[^#\\-:!?.@*/&%^+<=>|~$]=|^=|[^#\\-:!?.@*/&%^+<=>|~$]->|^->))(?![#\\-:!?.@*/&%^+<=>|~$]))|(?<=;|\\())(?=[[:space:]]|\\blet\\b)|(?:(?<=(?:[^[:word:]]begin|^begin|[^[:word:]]do|^do|[^[:word:]]else|^else|[^[:word:]]in|^in|[^[:word:]]struct|^struct|[^[:word:]]then|^then|[^[:word:]]try|^try))(?![[:word:]]))|(?:(?<=(?:[^#\\-:!?.@*/&%^+<=>|~$]@@|^@@))(?![#\\-:!?.@*/&%^+<=>|~$]))[[:space:]]+",
2414
- end: "\\b(?:(and)|(let))\\b|(?=[^[:space:]])(?!\\(\\*)",
2415
- endCaptures: {
2416
- "1": {
2417
- name: "variable.other.class.js message.error variable.interpolation string.regexp markup.underline"
2418
- },
2419
- "2": {
2420
- name: "storage.type markup.underline"
2421
- }
2422
- },
2423
- patterns: [
2424
- {
2425
- include: "#comment"
2426
- }
2427
- ]
2428
- },
2429
- {
2430
- begin: "(?:(?<=(?:[^[:word:]]and|^and|[^[:word:]]let|^let))(?![[:word:]]))|(let)",
2431
- end: "\\b(?:(and)|(in))\\b|(?=\\}|\\)|\\]|\\b(?:end|class|exception|external|include|inherit|initializer|let|method|module|open|type|val)\\b)",
2432
- beginCaptures: {
2433
390
  "1": {
2434
- name: "storage.type markup.underline"
391
+ name: "constant.character.escape.ocaml"
2435
392
  }
2436
- },
2437
- endCaptures: {
2438
- "1": {
2439
- name: "variable.other.class.js message.error variable.interpolation string.regexp markup.underline"
2440
- },
2441
- "2": {
2442
- name: "storage.type markup.underline"
2443
- }
2444
- },
2445
- patterns: [
2446
- {
2447
- include: "#bindTerm"
2448
- }
2449
- ]
2450
- }
2451
- ]
2452
- },
2453
- termMatch: {
2454
- begin: "\\bmatch\\b",
2455
- end: "\\bwith\\b",
2456
- captures: {
2457
- "0": {
2458
- name: "keyword.control"
2459
- }
2460
- },
2461
- patterns: [
2462
- {
2463
- include: "#term"
2464
- }
2465
- ]
2466
- },
2467
- termMatchRule: {
2468
- patterns: [
2469
- {
2470
- begin: "(?:(?<=(?:[^[:word:]]fun|^fun|[^[:word:]]function|^function|[^[:word:]]with|^with))(?![[:word:]]))",
2471
- end: "(?<![#\\-:!?.@*/&%^+<=>|~$])(\\|)|(->)(?![#\\-:!?.@*/&%^+<=>|~$])",
2472
- endCaptures: {
2473
- "1": {
2474
- name: "support.type strong"
2475
- },
2476
- "2": {
2477
- name: "support.type strong"
2478
- }
2479
- },
2480
- patterns: [
2481
- {
2482
- include: "#comment"
2483
- },
2484
- {
2485
- include: "#attributeIdentifier"
2486
- },
2487
- {
2488
- include: "#pattern"
2489
- }
2490
- ]
393
+ }
2491
394
  },
2492
395
  {
2493
- begin: "(?:(?<=(?:[^\\[#\\-:!?.@*/&%^+<=>|~$]\\||^\\|))(?![#\\-:!?.@*/&%^+<=>|~$]))|(?<![#\\-:!?.@*/&%^+<=>|~$])\\|(?![#\\-:!?.@*/&%^+<=>|~$])",
2494
- end: "(?<![#\\-:!?.@*/&%^+<=>|~$])(\\|)|(->)(?![#\\-:!?.@*/&%^+<=>|~$])",
2495
- beginCaptures: {
2496
- "0": {
2497
- name: "support.type strong"
2498
- }
2499
- },
2500
- endCaptures: {
2501
- "1": {
2502
- name: "support.type strong"
2503
- },
2504
- "2": {
2505
- name: "support.type strong"
2506
- }
2507
- },
2508
- patterns: [
2509
- {
2510
- include: "#pattern"
2511
- },
2512
- {
2513
- begin: "\\bwhen\\b",
2514
- end: "(?=(?<![#\\-:!?.@*/&%^+<=>|~$])->(?![#\\-:!?.@*/&%^+<=>|~$]))",
2515
- beginCaptures: {
2516
- "0": {
2517
- name: "variable.other.class.js message.error variable.interpolation string.regexp"
2518
- }
2519
- },
2520
- patterns: [
2521
- {
2522
- include: "#term"
2523
- }
2524
- ]
2525
- }
2526
- ]
2527
- }
2528
- ]
2529
- },
2530
- termOperator: {
2531
- patterns: [
2532
- {
2533
- begin: "(?<![#\\-:!?.@*/&%^+<=>|~$])#(?![#\\-:!?.@*/&%^+<=>|~$])",
2534
- end: "(?:(?!\\b(?:and|'|as|asr|assert|\\*|begin|class|:|,|@|constraint|do|done|downto|else|end|=|exception|external|false|for|\\.|fun|function|functor|>|-|if|in|include|inherit|initializer|land|lazy|\\{|\\(|\\[|<|let|lor|lsl|lsr|lxor|match|method|mod|module|mutable|new|nonrec|#|object|of|open|or|%|\\+|private|\\?|\"|rec|\\\\|\\}|\\)|\\]|;|sig|/|struct|then|~|to|true|try|type|val|\\||virtual|when|while|with)\\b(?:[^']|$))\\b(?=[[:lower:]_])[[:alpha:]_][[:word:]']*)",
2535
- beginCaptures: {
2536
- "0": {
2537
- name: "keyword"
396
+ comment: "character literal from decimal ASCII code",
397
+ name: "string.quoted.single.ocaml",
398
+ match: "'(\\\\[[:digit:]]{3})'",
399
+ captures: {
400
+ "1": {
401
+ name: "constant.character.escape.ocaml"
2538
402
  }
2539
- },
2540
- endCaptures: {
2541
- "0": {
2542
- name: "entity.name.function"
403
+ }
404
+ },
405
+ {
406
+ comment: "character literal from hexadecimal ASCII code",
407
+ name: "string.quoted.single.ocaml",
408
+ match: "'(\\\\x[[:xdigit:]]{2})'",
409
+ captures: {
410
+ "1": {
411
+ name: "constant.character.escape.ocaml"
2543
412
  }
2544
413
  }
2545
414
  },
2546
415
  {
2547
- match: "<-",
416
+ comment: "character literal from octal ASCII code",
417
+ name: "string.quoted.single.ocaml",
418
+ match: "'(\\\\o[0-3][0-7]{2})'",
2548
419
  captures: {
2549
- "0": {
2550
- name: "keyword.control strong"
420
+ "1": {
421
+ name: "constant.character.escape.ocaml"
2551
422
  }
2552
423
  }
2553
424
  },
2554
425
  {
2555
- match: "(,|[#\\-:!?.@*/&%^+<=>|~$]+)|(;)",
426
+ comment: "character literal from unknown escape sequence",
427
+ name: "string.quoted.single.ocaml",
428
+ match: "'(\\\\.)'",
2556
429
  captures: {
2557
430
  "1": {
2558
- name: "variable.other.class.js message.error variable.interpolation string.regexp"
2559
- },
2560
- "2": {
2561
- name: "variable.other.class.js message.error variable.interpolation string.regexp"
431
+ name: "invalid.illegal.unknown-escape.ocaml"
2562
432
  }
2563
433
  }
2564
434
  },
2565
435
  {
2566
- match: "\\b(?:and|assert|asr|land|lazy|lsr|lxor|mod|new|or)\\b",
2567
- name: "variable.other.class.js message.error variable.interpolation string.regexp"
436
+ comment: "character literal",
437
+ name: "string.quoted.single.ocaml",
438
+ match: "'.'"
2568
439
  }
2569
440
  ]
2570
441
  },
2571
- termPun: {
2572
- begin: "(?<![#\\-:!?.@*/&%^+<=>|~$])\\?|~(?![#\\-:!?.@*/&%^+<=>|~$])",
2573
- end: ":|(?=[^[:space:]:])",
2574
- applyEndPatternLast: true,
442
+ attributes: {
443
+ begin: "\\[(@|@@|@@@)[[:space:]]*([[:alpha:]_]+(\\.[[:word:]']+)*)",
444
+ end: "\\]",
2575
445
  beginCaptures: {
2576
- "0": {
2577
- name: "variable.other.class.js message.error variable.interpolation string.regexp"
2578
- }
2579
- },
2580
- endCaptures: {
2581
- "0": {
2582
- name: "keyword"
446
+ "1": {
447
+ name: "keyword.operator.attribute.ocaml"
448
+ },
449
+ "2": {
450
+ name: "keyword.other.attribute.ocaml",
451
+ patterns: [
452
+ {
453
+ name: "keyword.other.ocaml punctuation.other.period punctuation.separator.period",
454
+ match: "\\."
455
+ }
456
+ ]
2583
457
  }
2584
458
  },
2585
459
  patterns: [
2586
460
  {
2587
- begin: "(?:(?<=(?:[^#\\-:!?.@*/&%^+<=>|~$]\\?|^\\?|[^#\\-:!?.@*/&%^+<=>|~$]~|^~))(?![#\\-:!?.@*/&%^+<=>|~$]))",
2588
- end: "(?:(?!\\b(?:and|'|as|asr|assert|\\*|begin|class|:|,|@|constraint|do|done|downto|else|end|=|exception|external|false|for|\\.|fun|function|functor|>|-|if|in|include|inherit|initializer|land|lazy|\\{|\\(|\\[|<|let|lor|lsl|lsr|lxor|match|method|mod|module|mutable|new|nonrec|#|object|of|open|or|%|\\+|private|\\?|\"|rec|\\\\|\\}|\\)|\\]|;|sig|/|struct|then|~|to|true|try|type|val|\\||virtual|when|while|with)\\b(?:[^']|$))\\b(?=[[:lower:]_])[[:alpha:]_][[:word:]']*)",
2589
- endCaptures: {
2590
- "0": {
2591
- name: "markup.inserted constant.language support.constant.property-value entity.name.filename"
2592
- }
2593
- }
461
+ include: "$self"
2594
462
  }
2595
463
  ]
2596
464
  },
2597
- termTry: {
2598
- begin: "\\btry\\b",
2599
- end: "\\bwith\\b",
2600
- captures: {
2601
- "0": {
2602
- name: "keyword.control"
465
+ extensions: {
466
+ begin: "\\[(%|%%)[[:space:]]*([[:alpha:]_]+(\\.[[:word:]']+)*)",
467
+ end: "\\]",
468
+ beginCaptures: {
469
+ "1": {
470
+ name: "keyword.operator.extension.ocaml"
471
+ },
472
+ "2": {
473
+ name: "keyword.other.extension.ocaml",
474
+ patterns: [
475
+ {
476
+ name: "keyword.other.ocaml punctuation.other.period punctuation.separator.period",
477
+ match: "\\."
478
+ }
479
+ ]
2603
480
  }
2604
481
  },
2605
482
  patterns: [
2606
483
  {
2607
- include: "#term"
484
+ include: "$self"
2608
485
  }
2609
486
  ]
2610
487
  },
2611
- termWhile: {
488
+ modules: {
2612
489
  patterns: [
2613
490
  {
2614
- begin: "\\bwhile\\b",
2615
- end: "\\bdone\\b",
2616
- beginCaptures: {
2617
- "0": {
2618
- name: "keyword.control"
491
+ begin: "\\b(sig)\\b",
492
+ end: "\\b(end)\\b",
493
+ beginCaptures: [
494
+ {
495
+ name: "keyword.other.ocaml"
2619
496
  }
2620
- },
2621
- endCaptures: {
2622
- "0": {
2623
- name: "keyword.control"
497
+ ],
498
+ endCaptures: [
499
+ {
500
+ name: "keyword.other.ocaml"
2624
501
  }
2625
- },
502
+ ],
2626
503
  patterns: [
2627
504
  {
2628
- begin: "(?:(?<=(?:[^[:word:]]while|^while))(?![[:word:]]))",
2629
- end: "\\bdo\\b",
2630
- endCaptures: {
2631
- "0": {
2632
- name: "keyword.control"
2633
- }
2634
- },
2635
- patterns: [
2636
- {
2637
- include: "#term"
2638
- }
2639
- ]
2640
- },
505
+ include: "source.ocaml.interface"
506
+ }
507
+ ]
508
+ },
509
+ {
510
+ begin: "\\b(struct)\\b",
511
+ end: "\\b(end)\\b",
512
+ beginCaptures: [
2641
513
  {
2642
- begin: "(?:(?<=(?:[^[:word:]]do|^do))(?![[:word:]]))",
2643
- end: "(?=\\bdone\\b)",
2644
- patterns: [
2645
- {
2646
- include: "#term"
2647
- }
2648
- ]
514
+ name: "keyword.other.ocaml"
515
+ }
516
+ ],
517
+ endCaptures: [
518
+ {
519
+ name: "keyword.other.ocaml"
520
+ }
521
+ ],
522
+ patterns: [
523
+ {
524
+ include: "$self"
2649
525
  }
2650
526
  ]
2651
527
  }
2652
528
  ]
2653
529
  },
2654
- type: {
530
+ bindings: {
2655
531
  patterns: [
2656
532
  {
2657
- include: "#comment"
2658
- },
2659
- {
2660
- match: "\\bnonrec\\b",
2661
- name: "variable.other.class.js message.error variable.interpolation string.regexp"
2662
- },
2663
- {
2664
- include: "#pathModulePrefixExtended"
2665
- },
2666
- {
2667
- include: "#typeLabel"
2668
- },
2669
- {
2670
- include: "#typeObject"
2671
- },
2672
- {
2673
- include: "#typeOperator"
2674
- },
2675
- {
2676
- include: "#typeParens"
533
+ comment: "for loop",
534
+ match: "\\b(for)[[:space:]]+([[:lower:]_][[:word:]']*)",
535
+ captures: {
536
+ "1": {
537
+ name: "keyword.ocaml"
538
+ },
539
+ "2": {
540
+ name: "entity.name.function.binding.ocaml"
541
+ }
542
+ }
2677
543
  },
2678
544
  {
2679
- include: "#typePolymorphicVariant"
545
+ comment: "local open/exception/module",
546
+ match: "\\b(let)[[:space:]]+(open|exception|module)\\b(?!')",
547
+ captures: {
548
+ "1": {
549
+ name: "keyword.ocaml"
550
+ },
551
+ "2": {
552
+ name: "keyword.ocaml"
553
+ }
554
+ }
2680
555
  },
2681
556
  {
2682
- include: "#typeRecord"
557
+ comment: "let expression",
558
+ match: "\\b(let)[[:space:]]+(?!lazy\\b(?!'))(rec[[:space:]]+)?(?!rec\\b(?!'))([[:lower:]_][[:word:]']*)[[:space:]]+(?!,|::)",
559
+ captures: {
560
+ "1": {
561
+ name: "keyword.ocaml"
562
+ },
563
+ "2": {
564
+ name: "keyword.ocaml"
565
+ },
566
+ "3": {
567
+ name: "entity.name.function.binding.ocaml"
568
+ }
569
+ }
2683
570
  },
2684
571
  {
2685
- include: "#typeConstructor"
2686
- }
2687
- ]
2688
- },
2689
- typeConstructor: {
2690
- patterns: [
2691
- {
2692
- begin: "(_)|((?:(?!\\b(?:and|'|as|asr|assert|\\*|begin|class|:|,|@|constraint|do|done|downto|else|end|=|exception|external|false|for|\\.|fun|function|functor|>|-|if|in|include|inherit|initializer|land|lazy|\\{|\\(|\\[|<|let|lor|lsl|lsr|lxor|match|method|mod|module|mutable|new|nonrec|#|object|of|open|or|%|\\+|private|\\?|\"|rec|\\\\|\\}|\\)|\\]|;|sig|/|struct|then|~|to|true|try|type|val|\\||virtual|when|while|with)\\b(?:[^']|$))\\b(?=[[:lower:]_])[[:alpha:]_][[:word:]']*))|(')((?:(?!\\b(?:and|'|as|asr|assert|\\*|begin|class|:|,|@|constraint|do|done|downto|else|end|=|exception|external|false|for|\\.|fun|function|functor|>|-|if|in|include|inherit|initializer|land|lazy|\\{|\\(|\\[|<|let|lor|lsl|lsr|lxor|match|method|mod|module|mutable|new|nonrec|#|object|of|open|or|%|\\+|private|\\?|\"|rec|\\\\|\\}|\\)|\\]|;|sig|/|struct|then|~|to|true|try|type|val|\\||virtual|when|while|with)\\b(?:[^']|$))\\b(?=[[:lower:]_])[[:alpha:]_][[:word:]']*))|(?<=[^\\*]\\)|\\])",
2693
- end: "(?=\\((?!\\*)|\\*|:|,|=|\\.|>|-|\\{|\\[|\\+|\\}|\\)|\\]|;|\\|)|((?:(?!\\b(?:and|'|as|asr|assert|\\*|begin|class|:|,|@|constraint|do|done|downto|else|end|=|exception|external|false|for|\\.|fun|function|functor|>|-|if|in|include|inherit|initializer|land|lazy|\\{|\\(|\\[|<|let|lor|lsl|lsr|lxor|match|method|mod|module|mutable|new|nonrec|#|object|of|open|or|%|\\+|private|\\?|\"|rec|\\\\|\\}|\\)|\\]|;|sig|/|struct|then|~|to|true|try|type|val|\\||virtual|when|while|with)\\b(?:[^']|$))\\b(?=[[:lower:]_])[[:alpha:]_][[:word:]']*))[:space:]*(?!\\(\\*|[[:word:]])|(?=;;|\\}|\\)|\\]|\\b(?:end|and|class|exception|external|in|include|inherit|initializer|let|method|module|open|type|val)\\b)",
2694
- beginCaptures: {
572
+ comment: "using binding operators",
573
+ match: "\\b(let|and)([$&*+\\-/=>@^|<][!?$&*+\\-/=>@^|%:]*)[[:space:]]*(?!lazy\\b(?!'))([[:lower:]_][[:word:]']*)[[:space:]]+(?!,|::)",
574
+ captures: {
2695
575
  "1": {
2696
- name: "comment constant.regexp meta.separator.markdown"
576
+ name: "keyword.ocaml"
2697
577
  },
2698
- "3": {
2699
- name: "string.other.link variable.language variable.parameter emphasis strong emphasis"
578
+ "2": {
579
+ name: "keyword.ocaml"
2700
580
  },
2701
- "4": {
2702
- name: "keyword.control emphasis"
581
+ "3": {
582
+ name: "entity.name.function.binding.ocaml"
2703
583
  }
2704
- },
2705
- endCaptures: {
584
+ }
585
+ },
586
+ {
587
+ comment: "first class module packing",
588
+ match: "\\([[:space:]]*(val)[[:space:]]+([[:lower:]_][[:word:]']*)",
589
+ captures: {
2706
590
  "1": {
2707
- name: "entity.name.function strong"
2708
- }
2709
- },
2710
- patterns: [
2711
- {
2712
- include: "#comment"
591
+ name: "keyword.ocaml"
2713
592
  },
2714
- {
2715
- include: "#pathModulePrefixExtended"
593
+ "2": {
594
+ patterns: [
595
+ {
596
+ include: "$self"
597
+ }
598
+ ]
2716
599
  }
2717
- ]
2718
- }
2719
- ]
2720
- },
2721
- typeLabel: {
2722
- patterns: [
600
+ }
601
+ },
2723
602
  {
2724
- begin: "(\\??)((?:(?!\\b(?:and|'|as|asr|assert|\\*|begin|class|:|,|@|constraint|do|done|downto|else|end|=|exception|external|false|for|\\.|fun|function|functor|>|-|if|in|include|inherit|initializer|land|lazy|\\{|\\(|\\[|<|let|lor|lsl|lsr|lxor|match|method|mod|module|mutable|new|nonrec|#|object|of|open|or|%|\\+|private|\\?|\"|rec|\\\\|\\}|\\)|\\]|;|sig|/|struct|then|~|to|true|try|type|val|\\||virtual|when|while|with)\\b(?:[^']|$))\\b(?=[[:lower:]_])[[:alpha:]_][[:word:]']*))[[:space:]]*((?<![#\\-:!?.@*/&%^+<=>|~$]):(?![#\\-:!?.@*/&%^+<=>|~$]))",
2725
- end: "(?=(?<![#\\-:!?.@*/&%^+<=>|~$])->(?![#\\-:!?.@*/&%^+<=>|~$]))",
603
+ comment: "locally abstract types",
604
+ match: "(?:\\(|(:))[[:space:]]*(type)((?:[[:space:]]+[[:lower:]_][[:word:]']*)+)",
2726
605
  captures: {
2727
606
  "1": {
2728
- name: "keyword strong emphasis"
607
+ name: "keyword.other.ocaml punctuation.other.colon punctuation.colon"
2729
608
  },
2730
609
  "2": {
2731
- name: "markup.inserted constant.language support.constant.property-value entity.name.filename emphasis"
610
+ name: "keyword.ocaml"
2732
611
  },
2733
612
  "3": {
2734
- name: "keyword"
613
+ name: "entity.name.function.binding.ocaml"
2735
614
  }
2736
- },
2737
- patterns: [
2738
- {
2739
- include: "#type"
2740
- }
2741
- ]
2742
- }
2743
- ]
2744
- },
2745
- typeModule: {
2746
- begin: "\\bmodule\\b",
2747
- end: "(?=\\))",
2748
- beginCaptures: {
2749
- "0": {
2750
- name: "markup.inserted constant.language support.constant.property-value entity.name.filename"
2751
- }
2752
- },
2753
- patterns: [
2754
- {
2755
- include: "#pathModuleExtended"
615
+ }
2756
616
  },
2757
617
  {
2758
- include: "#signatureConstraints"
2759
- }
2760
- ]
2761
- },
2762
- typeObject: {
2763
- begin: "<",
2764
- end: ">",
2765
- captures: {
2766
- "0": {
2767
- name: "constant.language constant.numeric entity.other.attribute-name.id.css strong strong"
2768
- }
2769
- },
2770
- patterns: [
2771
- {
2772
- begin: "(?<=<|;)",
2773
- end: "(:)|(?=>)",
2774
- endCaptures: {
618
+ comment: "optional labeled argument with type",
619
+ begin: "(\\?)\\([[:space:]]*([[:lower:]_][[:word:]']*)",
620
+ beginCaptures: {
2775
621
  "1": {
2776
- name: "variable.other.class.js message.error variable.interpolation string.regexp strong"
2777
- },
2778
- "3": {
2779
- name: "variable.other.class.js message.error variable.interpolation string.regexp"
622
+ name: "variable.parameter.optional.ocaml"
2780
623
  },
2781
- "4": {
2782
- name: "variable.other.class.js message.error variable.interpolation string.regexp"
624
+ "2": {
625
+ name: "variable.parameter.optional.ocaml"
2783
626
  }
2784
627
  },
628
+ end: "\\)",
2785
629
  patterns: [
2786
630
  {
2787
- include: "#comment"
2788
- },
2789
- {
2790
- include: "#pathModulePrefixSimple"
2791
- },
2792
- {
2793
- match: "(?:(?!\\b(?:and|'|as|asr|assert|\\*|begin|class|:|,|@|constraint|do|done|downto|else|end|=|exception|external|false|for|\\.|fun|function|functor|>|-|if|in|include|inherit|initializer|land|lazy|\\{|\\(|\\[|<|let|lor|lsl|lsr|lxor|match|method|mod|module|mutable|new|nonrec|#|object|of|open|or|%|\\+|private|\\?|\"|rec|\\\\|\\}|\\)|\\]|;|sig|/|struct|then|~|to|true|try|type|val|\\||virtual|when|while|with)\\b(?:[^']|$))\\b(?=[[:lower:]_])[[:alpha:]_][[:word:]']*)",
2794
- name: "markup.inserted constant.language support.constant.property-value entity.name.filename emphasis"
631
+ include: "$self"
2795
632
  }
2796
633
  ]
2797
634
  },
2798
635
  {
2799
- begin: "(?:(?<=(?:[^#\\-:!?.@*/&%^+<=>|~$]:|^:))(?![#\\-:!?.@*/&%^+<=>|~$]))",
2800
- end: "(;)|(?=>)",
2801
- endCaptures: {
636
+ comment: "labeled argument with type",
637
+ begin: "(~)\\([[:space:]]*([[:lower:]_][[:word:]']*)",
638
+ beginCaptures: {
2802
639
  "1": {
2803
- name: "variable.other.class.js message.error variable.interpolation string.regexp"
640
+ name: "variable.parameter.labeled.ocaml"
2804
641
  },
2805
642
  "2": {
2806
- name: "support.type strong"
643
+ name: "variable.parameter.labeled.ocaml"
2807
644
  }
2808
645
  },
646
+ end: "\\)",
2809
647
  patterns: [
2810
648
  {
2811
- include: "#type"
649
+ include: "$self"
2812
650
  }
2813
651
  ]
2814
- }
2815
- ]
2816
- },
2817
- typeOperator: {
2818
- patterns: [
652
+ },
2819
653
  {
2820
- match: ",|;|[#\\-:!?.@*/&%^+<=>|~$]+",
2821
- name: "variable.other.class.js message.error variable.interpolation string.regexp strong"
654
+ include: "source.ocaml.interface#bindings"
2822
655
  }
2823
656
  ]
2824
657
  },
2825
- typeParens: {
2826
- begin: "\\(",
2827
- end: "\\)",
2828
- captures: {
2829
- "0": {
2830
- name: "punctuation.definition.tag"
2831
- }
2832
- },
658
+ operators: {
2833
659
  patterns: [
2834
660
  {
2835
- match: ",",
2836
- name: "variable.other.class.js message.error variable.interpolation string.regexp"
661
+ comment: "binding operator",
662
+ name: "keyword.ocaml",
663
+ match: "\\b(let|and)[$&*+\\-/=>@^|<][!?$&*+\\-/=>@^|%:]*"
664
+ },
665
+ {
666
+ comment: "infix symbol",
667
+ name: "keyword.operator.ocaml",
668
+ match: "[$&*+\\-/=>@^%<][~!?$&*+\\-/=>@^|%<:.]*"
669
+ },
670
+ {
671
+ comment: "infix symbol that begins with vertical bar",
672
+ name: "keyword.operator.ocaml",
673
+ match: "\\|[~!?$&*+\\-/=>@^|%<:.]+"
674
+ },
675
+ {
676
+ comment: "vertical bar",
677
+ name: "keyword.other.ocaml",
678
+ match: "(?<!\\[)(\\|)(?!\\])"
679
+ },
680
+ {
681
+ comment: "infix symbol",
682
+ name: "keyword.operator.ocaml",
683
+ match: "#[~!?$&*+\\-/=>@^|%<:.]+"
684
+ },
685
+ {
686
+ comment: "prefix symbol",
687
+ name: "keyword.operator.ocaml",
688
+ match: "![~!?$&*+\\-/=>@^|%<:.]*"
689
+ },
690
+ {
691
+ comment: "prefix symbol",
692
+ name: "keyword.operator.ocaml",
693
+ match: "[?~][~!?$&*+\\-/=>@^|%<:.]+"
694
+ },
695
+ {
696
+ comment: "named operator",
697
+ name: "keyword.operator.ocaml",
698
+ match: "\\b(or|mod|land|lor|lxor|lsl|lsr|asr)\\b"
699
+ },
700
+ {
701
+ comment: "method invocation",
702
+ name: "keyword.other.ocaml",
703
+ match: "#"
704
+ },
705
+ {
706
+ comment: "type annotation",
707
+ name: "keyword.other.ocaml punctuation.other.colon punctuation.colon",
708
+ match: ":"
709
+ },
710
+ {
711
+ comment: "field accessor",
712
+ name: "keyword.other.ocaml punctuation.other.period punctuation.separator.period",
713
+ match: "\\."
2837
714
  },
2838
715
  {
2839
- include: "#typeModule"
716
+ comment: "semicolon separator",
717
+ name: "keyword.other.ocaml punctuation.separator.terminator punctuation.separator.semicolon",
718
+ match: ";"
2840
719
  },
2841
720
  {
2842
- include: "#type"
721
+ comment: "comma separator",
722
+ name: "keyword.other.ocaml punctuation.comma punctuation.separator.comma",
723
+ match: ","
2843
724
  }
2844
725
  ]
2845
726
  },
2846
- typePolymorphicVariant: {
2847
- begin: "\\[",
2848
- end: "\\]",
727
+ keywords: {
2849
728
  patterns: [
729
+ {
730
+ comment: "reserved ocaml keyword",
731
+ name: "keyword.other.ocaml",
732
+ match: "\\b(and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|match|method|module|mutable|new|nonrec|object|of|open|private|rec|sig|struct|then|to|try|type|val|virtual|when|while|with)\\b(?!')"
733
+ }
2850
734
  ]
2851
735
  },
2852
- typeRecord: {
2853
- begin: "\\{",
2854
- end: "\\}",
2855
- captures: {
2856
- "0": {
2857
- name: "constant.language constant.numeric entity.other.attribute-name.id.css strong strong"
2858
- }
2859
- },
736
+ literals: {
2860
737
  patterns: [
2861
738
  {
2862
- begin: "(?<=\\{|;)",
2863
- end: "(:)|(=)|(;)|(with)|(?=\\})",
2864
- endCaptures: {
2865
- "1": {
2866
- name: "variable.other.class.js message.error variable.interpolation string.regexp strong"
2867
- },
2868
- "2": {
2869
- name: "support.type strong"
2870
- },
2871
- "3": {
2872
- name: "variable.other.class.js message.error variable.interpolation string.regexp"
2873
- },
2874
- "4": {
2875
- name: "variable.other.class.js message.error variable.interpolation string.regexp"
2876
- }
2877
- },
739
+ comment: "boolean literal",
740
+ name: "constant.language.boolean.ocaml",
741
+ match: "\\b(true|false)\\b"
742
+ },
743
+ {
744
+ comment: "floating point decimal literal with exponent",
745
+ name: "constant.numeric.decimal.float.ocaml",
746
+ match: "\\b([[:digit:]][[:digit:]_]*(\\.[[:digit:]_]*)?[eE][+-]?[[:digit:]][[:digit:]_]*[g-zG-Z]?)\\b"
747
+ },
748
+ {
749
+ comment: "floating point decimal literal",
750
+ name: "constant.numeric.decimal.float.ocaml",
751
+ match: "\\b([[:digit:]][[:digit:]_]*)(\\.[[:digit:]_]*[g-zG-Z]?\\b|\\.)"
752
+ },
753
+ {
754
+ comment: "floating point hexadecimal literal with exponent part",
755
+ name: "constant.numeric.hexadecimal.float.ocaml",
756
+ match: "\\b((0x|0X)[[:xdigit:]][[:xdigit:]_]*(\\.[[:xdigit:]_]*)?[pP][+-]?[[:digit:]][[:digit:]_]*[g-zG-Z]?)\\b"
757
+ },
758
+ {
759
+ comment: "floating point hexadecimal literal",
760
+ name: "constant.numeric.hexadecimal.float.ocaml",
761
+ match: "\\b((0x|0X)[[:xdigit:]][[:xdigit:]_]*)(\\.[[:xdigit:]_]*[g-zG-Z]?\\b|\\.)"
762
+ },
763
+ {
764
+ comment: "decimal integer literal",
765
+ name: "constant.numeric.decimal.integer.ocaml",
766
+ match: "\\b([[:digit:]][[:digit:]_]*[lLng-zG-Z]?)\\b"
767
+ },
768
+ {
769
+ comment: "hexadecimal integer literal",
770
+ name: "constant.numeric.hexadecimal.integer.ocaml",
771
+ match: "\\b((0x|0X)[[:xdigit:]][[:xdigit:]_]*[lLng-zG-Z]?)\\b"
772
+ },
773
+ {
774
+ comment: "octal integer literal",
775
+ name: "constant.numeric.octal.integer.ocaml",
776
+ match: "\\b((0o|0O)[0-7][0-7_]*[lLng-zG-Z]?)\\b"
777
+ },
778
+ {
779
+ comment: "binary integer literal",
780
+ name: "constant.numeric.binary.integer.ocaml",
781
+ match: "\\b((0b|0B)[0-1][0-1_]*[lLng-zG-Z]?)\\b"
782
+ },
783
+ {
784
+ comment: "unit literal",
785
+ name: "constant.language.unit.ocaml",
786
+ match: "\\(\\)"
787
+ },
788
+ {
789
+ comment: "parentheses",
790
+ begin: "\\(",
791
+ end: "\\)",
2878
792
  patterns: [
2879
793
  {
2880
- include: "#comment"
2881
- },
2882
- {
2883
- include: "#pathModulePrefixSimple"
2884
- },
2885
- {
2886
- match: "(?:(?!\\b(?:and|'|as|asr|assert|\\*|begin|class|:|,|@|constraint|do|done|downto|else|end|=|exception|external|false|for|\\.|fun|function|functor|>|-|if|in|include|inherit|initializer|land|lazy|\\{|\\(|\\[|<|let|lor|lsl|lsr|lxor|match|method|mod|module|mutable|new|nonrec|#|object|of|open|or|%|\\+|private|\\?|\"|rec|\\\\|\\}|\\)|\\]|;|sig|/|struct|then|~|to|true|try|type|val|\\||virtual|when|while|with)\\b(?:[^']|$))\\b(?=[[:lower:]_])[[:alpha:]_][[:word:]']*)",
2887
- name: "markup.inserted constant.language support.constant.property-value entity.name.filename emphasis"
794
+ include: "$self"
2888
795
  }
2889
796
  ]
2890
797
  },
2891
798
  {
2892
- begin: "(?:(?<=(?:[^[:word:]]with|^with))(?![[:word:]]))",
2893
- end: "(:)|(=)|(;)|(?=\\})",
2894
- endCaptures: {
2895
- "1": {
2896
- name: "variable.other.class.js message.error variable.interpolation string.regexp strong"
2897
- },
2898
- "2": {
2899
- name: "support.type strong"
2900
- },
2901
- "3": {
2902
- name: "variable.other.class.js message.error variable.interpolation string.regexp"
2903
- }
2904
- },
799
+ comment: "empty array",
800
+ name: "constant.language.array.ocaml",
801
+ match: "\\[\\|\\|\\]"
802
+ },
803
+ {
804
+ comment: "array",
805
+ begin: "\\[\\|",
806
+ end: "\\|\\]",
2905
807
  patterns: [
2906
808
  {
2907
- match: "(?:(?!\\b(?:and|'|as|asr|assert|\\*|begin|class|:|,|@|constraint|do|done|downto|else|end|=|exception|external|false|for|\\.|fun|function|functor|>|-|if|in|include|inherit|initializer|land|lazy|\\{|\\(|\\[|<|let|lor|lsl|lsr|lxor|match|method|mod|module|mutable|new|nonrec|#|object|of|open|or|%|\\+|private|\\?|\"|rec|\\\\|\\}|\\)|\\]|;|sig|/|struct|then|~|to|true|try|type|val|\\||virtual|when|while|with)\\b(?:[^']|$))\\b(?=[[:lower:]_])[[:alpha:]_][[:word:]']*)",
2908
- name: "markup.inserted constant.language support.constant.property-value entity.name.filename emphasis"
809
+ include: "$self"
2909
810
  }
2910
811
  ]
2911
812
  },
2912
813
  {
2913
- begin: "(?:(?<=(?:[^#\\-:!?.@*/&%^+<=>|~$]:|^:))(?![#\\-:!?.@*/&%^+<=>|~$]))",
2914
- end: "(;)|(=)|(?=\\})",
2915
- endCaptures: {
2916
- "1": {
2917
- name: "variable.other.class.js message.error variable.interpolation string.regexp"
2918
- },
2919
- "2": {
2920
- name: "support.type strong"
2921
- }
2922
- },
814
+ comment: "empty list",
815
+ name: "constant.language.list.ocaml",
816
+ match: "\\[\\]"
817
+ },
818
+ {
819
+ comment: "list",
820
+ begin: "\\[",
821
+ end: "]",
2923
822
  patterns: [
2924
823
  {
2925
- include: "#type"
824
+ include: "$self"
2926
825
  }
2927
826
  ]
2928
827
  },
2929
828
  {
2930
- begin: "(?:(?<=(?:[^#\\-:!?.@*/&%^+<=>|~$]=|^=))(?![#\\-:!?.@*/&%^+<=>|~$]))",
2931
- end: ";|(?=\\})",
2932
- endCaptures: {
2933
- "0": {
2934
- name: "variable.other.class.js message.error variable.interpolation string.regexp"
2935
- }
2936
- },
829
+ comment: "braces",
830
+ begin: "\\{",
831
+ end: "\\}",
2937
832
  patterns: [
2938
833
  {
2939
- include: "#type"
834
+ include: "$self"
2940
835
  }
2941
836
  ]
2942
837
  }
2943
838
  ]
2944
839
  },
2945
- variableModule: {
2946
- match: "(?:\\b(?=[[:upper:]])[[:alpha:]_][[:word:]']*)",
2947
- captures: {
2948
- "0": {
2949
- name: "string.other.link variable.language variable.parameter emphasis"
840
+ types: {
841
+ patterns: [
842
+ {
843
+ comment: "type parameter",
844
+ name: "storage.type.ocaml",
845
+ match: "'[[:alpha:]][[:word:]']*\\b|'_\\b"
846
+ },
847
+ {
848
+ comment: "weak type parameter",
849
+ name: "storage.type.weak.ocaml",
850
+ match: "'_[[:alpha:]][[:word:]']*\\b"
851
+ },
852
+ {
853
+ comment: "builtin type",
854
+ name: "support.type.ocaml",
855
+ match: "\\b(unit|bool|int|int32|int64|nativeint|float|char|bytes|string)\\b"
2950
856
  }
2951
- }
857
+ ]
2952
858
  },
2953
- variablePattern: {
2954
- match: "(\\b_\\b)|((?:(?!\\b(?:and|'|as|asr|assert|\\*|begin|class|:|,|@|constraint|do|done|downto|else|end|=|exception|external|false|for|\\.|fun|function|functor|>|-|if|in|include|inherit|initializer|land|lazy|\\{|\\(|\\[|<|let|lor|lsl|lsr|lxor|match|method|mod|module|mutable|new|nonrec|#|object|of|open|or|%|\\+|private|\\?|\"|rec|\\\\|\\}|\\)|\\]|;|sig|/|struct|then|~|to|true|try|type|val|\\||virtual|when|while|with)\\b(?:[^']|$))\\b(?=[[:lower:]_])[[:alpha:]_][[:word:]']*))",
2955
- captures: {
2956
- "1": {
2957
- name: "comment constant.regexp meta.separator.markdown"
859
+ identifiers: {
860
+ patterns: [
861
+ {
862
+ comment: "wildcard underscore",
863
+ name: "constant.language.ocaml",
864
+ match: "\\b_\\b"
2958
865
  },
2959
- "2": {
2960
- name: "string.other.link variable.language variable.parameter emphasis"
866
+ {
867
+ comment: "capital identifier for constructor, exception, or module",
868
+ name: "constant.language.capital-identifier.ocaml",
869
+ match: "\\b[[:upper:]][[:word:]']*('|\\b)"
870
+ },
871
+ {
872
+ comment: "lowercase identifier",
873
+ name: "source.ocaml",
874
+ match: "\\b[[:lower:]_][[:word:]']*('|\\b)"
875
+ },
876
+ {
877
+ comment: "polymorphic variant tag",
878
+ name: "constant.language.polymorphic-variant.ocaml",
879
+ match: "\\`[[:alpha:]][[:word:]']*\\b"
880
+ },
881
+ {
882
+ comment: "empty list (can be used as a constructor)",
883
+ name: "constant.language.list.ocaml",
884
+ match: "\\[\\]"
2961
885
  }
2962
- }
886
+ ]
2963
887
  }
2964
888
  };
2965
889
  var information_for_contributors = [
2966
- "This file has been converted from https://github.com/reasonml-editor/vscode-reasonml/blob/master/",
890
+ "This file has been converted from https://github.com/ocamllabs/vscode-ocaml-platform/blob/master/",
2967
891
  "If you want to provide a fix or improvement, please create a pull request against the original repository.",
2968
892
  "Once accepted there, we are happy to receive an update request."
2969
893
  ];