@codingame/monaco-vscode-standalone-languages 23.2.1 → 23.2.2

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 (165) hide show
  1. package/_.contribution.js +48 -0
  2. package/abap/abap.contribution.js +8 -0
  3. package/abap/abap.js +1397 -0
  4. package/apex/apex.contribution.js +9 -0
  5. package/apex/apex.js +329 -0
  6. package/azcli/azcli.contribution.js +8 -0
  7. package/azcli/azcli.js +67 -0
  8. package/bat/bat.contribution.js +8 -0
  9. package/bat/bat.js +99 -0
  10. package/bicep/bicep.contribution.js +8 -0
  11. package/bicep/bicep.js +108 -0
  12. package/cameligo/cameligo.contribution.js +8 -0
  13. package/cameligo/cameligo.js +173 -0
  14. package/clojure/clojure.contribution.js +8 -0
  15. package/clojure/clojure.js +760 -0
  16. package/coffee/coffee.contribution.js +9 -0
  17. package/coffee/coffee.js +231 -0
  18. package/cpp/cpp.contribution.js +14 -0
  19. package/cpp/cpp.js +388 -0
  20. package/csharp/csharp.contribution.js +8 -0
  21. package/csharp/csharp.js +325 -0
  22. package/csp/csp.contribution.js +8 -0
  23. package/csp/csp.js +52 -0
  24. package/css/css.contribution.js +9 -0
  25. package/css/css.js +184 -0
  26. package/cypher/cypher.contribution.js +8 -0
  27. package/cypher/cypher.js +262 -0
  28. package/dart/dart.contribution.js +9 -0
  29. package/dart/dart.js +280 -0
  30. package/dockerfile/dockerfile.contribution.js +9 -0
  31. package/dockerfile/dockerfile.js +129 -0
  32. package/ecl/ecl.contribution.js +8 -0
  33. package/ecl/ecl.js +455 -0
  34. package/elixir/elixir.contribution.js +8 -0
  35. package/elixir/elixir.js +568 -0
  36. package/flow9/flow9.contribution.js +8 -0
  37. package/flow9/flow9.js +141 -0
  38. package/freemarker2/freemarker2.contribution.js +52 -0
  39. package/freemarker2/freemarker2.js +990 -0
  40. package/fsharp/fsharp.contribution.js +8 -0
  41. package/fsharp/fsharp.js +216 -0
  42. package/go/go.contribution.js +8 -0
  43. package/go/go.js +217 -0
  44. package/graphql/graphql.contribution.js +9 -0
  45. package/graphql/graphql.js +150 -0
  46. package/handlebars/handlebars.contribution.js +9 -0
  47. package/handlebars/handlebars.js +413 -0
  48. package/hcl/hcl.contribution.js +8 -0
  49. package/hcl/hcl.js +182 -0
  50. package/html/html.contribution.js +9 -0
  51. package/html/html.js +302 -0
  52. package/index.js +81 -48
  53. package/ini/ini.contribution.js +9 -0
  54. package/ini/ini.js +70 -0
  55. package/java/java.contribution.js +9 -0
  56. package/java/java.js +231 -0
  57. package/javascript/javascript.contribution.js +11 -0
  58. package/javascript/javascript.js +70 -0
  59. package/julia/julia.contribution.js +8 -0
  60. package/julia/julia.js +510 -0
  61. package/kotlin/kotlin.contribution.js +9 -0
  62. package/kotlin/kotlin.js +251 -0
  63. package/less/less.contribution.js +9 -0
  64. package/less/less.js +160 -0
  65. package/lexon/lexon.contribution.js +8 -0
  66. package/lexon/lexon.js +156 -0
  67. package/liquid/liquid.contribution.js +9 -0
  68. package/liquid/liquid.js +234 -0
  69. package/lua/lua.contribution.js +8 -0
  70. package/lua/lua.js +161 -0
  71. package/m3/m3.contribution.js +8 -0
  72. package/m3/m3.js +209 -0
  73. package/markdown/markdown.contribution.js +8 -0
  74. package/markdown/markdown.js +228 -0
  75. package/mdx/mdx.contribution.js +8 -0
  76. package/mdx/mdx.js +158 -0
  77. package/mips/mips.contribution.js +9 -0
  78. package/mips/mips.js +197 -0
  79. package/msdax/msdax.contribution.js +8 -0
  80. package/msdax/msdax.js +374 -0
  81. package/mysql/mysql.contribution.js +8 -0
  82. package/mysql/mysql.js +877 -0
  83. package/objective-c/objective-c.contribution.js +8 -0
  84. package/objective-c/objective-c.js +182 -0
  85. package/package.json +2 -2
  86. package/pascal/pascal.contribution.js +9 -0
  87. package/pascal/pascal.js +250 -0
  88. package/pascaligo/pascaligo.contribution.js +8 -0
  89. package/pascaligo/pascaligo.js +163 -0
  90. package/perl/perl.contribution.js +8 -0
  91. package/perl/perl.js +625 -0
  92. package/pgsql/pgsql.contribution.js +8 -0
  93. package/pgsql/pgsql.js +850 -0
  94. package/php/php.contribution.js +9 -0
  95. package/php/php.js +499 -0
  96. package/pla/pla.contribution.js +7 -0
  97. package/pla/pla.js +136 -0
  98. package/postiats/postiats.contribution.js +8 -0
  99. package/postiats/postiats.js +906 -0
  100. package/powerquery/powerquery.contribution.js +8 -0
  101. package/powerquery/powerquery.js +889 -0
  102. package/powershell/powershell.contribution.js +8 -0
  103. package/powershell/powershell.js +238 -0
  104. package/protobuf/protobuf.contribution.js +8 -0
  105. package/protobuf/protobuf.js +419 -0
  106. package/pug/pug.contribution.js +8 -0
  107. package/pug/pug.js +401 -0
  108. package/python/python.contribution.js +9 -0
  109. package/python/python.js +294 -0
  110. package/qsharp/qsharp.contribution.js +8 -0
  111. package/qsharp/qsharp.js +300 -0
  112. package/r/r.contribution.js +8 -0
  113. package/r/r.js +242 -0
  114. package/razor/razor.contribution.js +9 -0
  115. package/razor/razor.js +544 -0
  116. package/redis/redis.contribution.js +8 -0
  117. package/redis/redis.js +301 -0
  118. package/redshift/redshift.contribution.js +8 -0
  119. package/redshift/redshift.js +808 -0
  120. package/restructuredtext/restructuredtext.contribution.js +8 -0
  121. package/restructuredtext/restructuredtext.js +173 -0
  122. package/ruby/ruby.contribution.js +9 -0
  123. package/ruby/ruby.js +510 -0
  124. package/rust/rust.contribution.js +8 -0
  125. package/rust/rust.js +342 -0
  126. package/sb/sb.contribution.js +8 -0
  127. package/sb/sb.js +114 -0
  128. package/scala/scala.contribution.js +9 -0
  129. package/scala/scala.js +369 -0
  130. package/scheme/scheme.contribution.js +8 -0
  131. package/scheme/scheme.js +107 -0
  132. package/scss/scss.contribution.js +9 -0
  133. package/scss/scss.js +259 -0
  134. package/shell/shell.contribution.js +8 -0
  135. package/shell/shell.js +220 -0
  136. package/solidity/solidity.contribution.js +8 -0
  137. package/solidity/solidity.js +1366 -0
  138. package/sophia/sophia.contribution.js +8 -0
  139. package/sophia/sophia.js +198 -0
  140. package/sparql/sparql.contribution.js +8 -0
  141. package/sparql/sparql.js +200 -0
  142. package/sql/sql.contribution.js +8 -0
  143. package/sql/sql.js +852 -0
  144. package/st/st.contribution.js +8 -0
  145. package/st/st.js +415 -0
  146. package/swift/swift.contribution.js +9 -0
  147. package/swift/swift.js +311 -0
  148. package/systemverilog/systemverilog.contribution.js +14 -0
  149. package/systemverilog/systemverilog.js +575 -0
  150. package/tcl/tcl.contribution.js +8 -0
  151. package/tcl/tcl.js +231 -0
  152. package/twig/twig.contribution.js +9 -0
  153. package/twig/twig.js +391 -0
  154. package/typescript/typescript.contribution.js +11 -0
  155. package/typescript/typescript.js +336 -0
  156. package/typespec/typespec.contribution.js +8 -0
  157. package/typespec/typespec.js +126 -0
  158. package/vb/vb.contribution.js +8 -0
  159. package/vb/vb.js +371 -0
  160. package/wgsl/wgsl.contribution.js +8 -0
  161. package/wgsl/wgsl.js +452 -0
  162. package/xml/xml.contribution.js +28 -0
  163. package/xml/xml.js +88 -0
  164. package/yaml/yaml.contribution.js +9 -0
  165. package/yaml/yaml.js +199 -0
@@ -0,0 +1,9 @@
1
+ import { registerLanguage } from '../_.contribution.js';
2
+
3
+ registerLanguage({
4
+ id: "coffeescript",
5
+ extensions: [".coffee"],
6
+ aliases: ["CoffeeScript", "coffeescript", "coffee"],
7
+ mimetypes: ["text/x-coffeescript", "text/coffeescript"],
8
+ loader: () => import('./coffee.js')
9
+ });
@@ -0,0 +1,231 @@
1
+ const conf = {
2
+ wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#%\^\&\*\(\)\=\$\-\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
3
+ comments: {
4
+ blockComment: ["###", "###"],
5
+ lineComment: "#"
6
+ },
7
+ brackets: [
8
+ ["{", "}"],
9
+ ["[", "]"],
10
+ ["(", ")"]
11
+ ],
12
+ autoClosingPairs: [
13
+ { open: "{", close: "}" },
14
+ { open: "[", close: "]" },
15
+ { open: "(", close: ")" },
16
+ { open: '"', close: '"' },
17
+ { open: "'", close: "'" }
18
+ ],
19
+ surroundingPairs: [
20
+ { open: "{", close: "}" },
21
+ { open: "[", close: "]" },
22
+ { open: "(", close: ")" },
23
+ { open: '"', close: '"' },
24
+ { open: "'", close: "'" }
25
+ ],
26
+ folding: {
27
+ markers: {
28
+ start: new RegExp("^\\s*#region\\b"),
29
+ end: new RegExp("^\\s*#endregion\\b")
30
+ }
31
+ }
32
+ };
33
+ const language = {
34
+ defaultToken: "",
35
+ ignoreCase: true,
36
+ tokenPostfix: ".coffee",
37
+ brackets: [
38
+ { open: "{", close: "}", token: "delimiter.curly" },
39
+ { open: "[", close: "]", token: "delimiter.square" },
40
+ { open: "(", close: ")", token: "delimiter.parenthesis" }
41
+ ],
42
+ regEx: /\/(?!\/\/)(?:[^\/\\]|\\.)*\/[igm]*/,
43
+ keywords: [
44
+ "and",
45
+ "or",
46
+ "is",
47
+ "isnt",
48
+ "not",
49
+ "on",
50
+ "yes",
51
+ "@",
52
+ "no",
53
+ "off",
54
+ "true",
55
+ "false",
56
+ "null",
57
+ "this",
58
+ "new",
59
+ "delete",
60
+ "typeof",
61
+ "in",
62
+ "instanceof",
63
+ "return",
64
+ "throw",
65
+ "break",
66
+ "continue",
67
+ "debugger",
68
+ "if",
69
+ "else",
70
+ "switch",
71
+ "for",
72
+ "while",
73
+ "do",
74
+ "try",
75
+ "catch",
76
+ "finally",
77
+ "class",
78
+ "extends",
79
+ "super",
80
+ "undefined",
81
+ "then",
82
+ "unless",
83
+ "until",
84
+ "loop",
85
+ "of",
86
+ "by",
87
+ "when"
88
+ ],
89
+ // we include these common regular expressions
90
+ symbols: /[=><!~?&%|+\-*\/\^\.,\:]+/,
91
+ escapes: /\\(?:[abfnrtv\\"'$]|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
92
+ // The main tokenizer for our languages
93
+ tokenizer: {
94
+ root: [
95
+ // identifiers and keywords
96
+ [/\@[a-zA-Z_]\w*/, "variable.predefined"],
97
+ [
98
+ /[a-zA-Z_]\w*/,
99
+ {
100
+ cases: {
101
+ this: "variable.predefined",
102
+ "@keywords": { token: "keyword.$0" },
103
+ "@default": ""
104
+ }
105
+ }
106
+ ],
107
+ // whitespace
108
+ [/[ \t\r\n]+/, ""],
109
+ // Comments
110
+ [/###/, "comment", "@comment"],
111
+ [/#.*$/, "comment"],
112
+ // regular expressions
113
+ ["///", { token: "regexp", next: "@hereregexp" }],
114
+ [/^(\s*)(@regEx)/, ["", "regexp"]],
115
+ [/(\()(\s*)(@regEx)/, ["@brackets", "", "regexp"]],
116
+ [/(\,)(\s*)(@regEx)/, ["delimiter", "", "regexp"]],
117
+ [/(\=)(\s*)(@regEx)/, ["delimiter", "", "regexp"]],
118
+ [/(\:)(\s*)(@regEx)/, ["delimiter", "", "regexp"]],
119
+ [/(\[)(\s*)(@regEx)/, ["@brackets", "", "regexp"]],
120
+ [/(\!)(\s*)(@regEx)/, ["delimiter", "", "regexp"]],
121
+ [/(\&)(\s*)(@regEx)/, ["delimiter", "", "regexp"]],
122
+ [/(\|)(\s*)(@regEx)/, ["delimiter", "", "regexp"]],
123
+ [/(\?)(\s*)(@regEx)/, ["delimiter", "", "regexp"]],
124
+ [/(\{)(\s*)(@regEx)/, ["@brackets", "", "regexp"]],
125
+ [/(\;)(\s*)(@regEx)/, ["", "", "regexp"]],
126
+ // delimiters
127
+ [
128
+ /}/,
129
+ {
130
+ cases: {
131
+ "$S2==interpolatedstring": {
132
+ token: "string",
133
+ next: "@pop"
134
+ },
135
+ "@default": "@brackets"
136
+ }
137
+ }
138
+ ],
139
+ [/[{}()\[\]]/, "@brackets"],
140
+ [/@symbols/, "delimiter"],
141
+ // numbers
142
+ [/\d+[eE]([\-+]?\d+)?/, "number.float"],
143
+ [/\d+\.\d+([eE][\-+]?\d+)?/, "number.float"],
144
+ [/0[xX][0-9a-fA-F]+/, "number.hex"],
145
+ [/0[0-7]+(?!\d)/, "number.octal"],
146
+ [/\d+/, "number"],
147
+ // delimiter: after number because of .\d floats
148
+ [/[,.]/, "delimiter"],
149
+ // strings:
150
+ [/"""/, "string", '@herestring."""'],
151
+ [/'''/, "string", "@herestring.'''"],
152
+ [
153
+ /"/,
154
+ {
155
+ cases: {
156
+ "@eos": "string",
157
+ "@default": { token: "string", next: '@string."' }
158
+ }
159
+ }
160
+ ],
161
+ [
162
+ /'/,
163
+ {
164
+ cases: {
165
+ "@eos": "string",
166
+ "@default": { token: "string", next: "@string.'" }
167
+ }
168
+ }
169
+ ]
170
+ ],
171
+ string: [
172
+ [/[^"'\#\\]+/, "string"],
173
+ [/@escapes/, "string.escape"],
174
+ [/\./, "string.escape.invalid"],
175
+ [/\./, "string.escape.invalid"],
176
+ [
177
+ /#{/,
178
+ {
179
+ cases: {
180
+ '$S2=="': {
181
+ token: "string",
182
+ next: "root.interpolatedstring"
183
+ },
184
+ "@default": "string"
185
+ }
186
+ }
187
+ ],
188
+ [
189
+ /["']/,
190
+ {
191
+ cases: {
192
+ "$#==$S2": { token: "string", next: "@pop" },
193
+ "@default": "string"
194
+ }
195
+ }
196
+ ],
197
+ [/#/, "string"]
198
+ ],
199
+ herestring: [
200
+ [
201
+ /("""|''')/,
202
+ {
203
+ cases: {
204
+ "$1==$S2": { token: "string", next: "@pop" },
205
+ "@default": "string"
206
+ }
207
+ }
208
+ ],
209
+ [/[^#\\'"]+/, "string"],
210
+ [/['"]+/, "string"],
211
+ [/@escapes/, "string.escape"],
212
+ [/\./, "string.escape.invalid"],
213
+ [/#{/, { token: "string.quote", next: "root.interpolatedstring" }],
214
+ [/#/, "string"]
215
+ ],
216
+ comment: [
217
+ [/[^#]+/, "comment"],
218
+ [/###/, "comment", "@pop"],
219
+ [/#/, "comment"]
220
+ ],
221
+ hereregexp: [
222
+ [/[^\\\/#]+/, "regexp"],
223
+ [/\\./, "regexp"],
224
+ [/#.*$/, "comment"],
225
+ ["///[igm]*", { token: "regexp", next: "@pop" }],
226
+ [/\//, "regexp"]
227
+ ]
228
+ }
229
+ };
230
+
231
+ export { conf, language };
@@ -0,0 +1,14 @@
1
+ import { registerLanguage } from '../_.contribution.js';
2
+
3
+ registerLanguage({
4
+ id: "c",
5
+ extensions: [".c", ".h"],
6
+ aliases: ["C", "c"],
7
+ loader: () => import('./cpp.js')
8
+ });
9
+ registerLanguage({
10
+ id: "cpp",
11
+ extensions: [".cpp", ".cc", ".cxx", ".hpp", ".hh", ".hxx"],
12
+ aliases: ["C++", "Cpp", "cpp"],
13
+ loader: () => import('./cpp.js')
14
+ });
package/cpp/cpp.js ADDED
@@ -0,0 +1,388 @@
1
+ const conf = {
2
+ comments: {
3
+ lineComment: "//",
4
+ blockComment: ["/*", "*/"]
5
+ },
6
+ brackets: [
7
+ ["{", "}"],
8
+ ["[", "]"],
9
+ ["(", ")"]
10
+ ],
11
+ autoClosingPairs: [
12
+ { open: "[", close: "]" },
13
+ { open: "{", close: "}" },
14
+ { open: "(", close: ")" },
15
+ { open: "'", close: "'", notIn: ["string", "comment"] },
16
+ { open: '"', close: '"', notIn: ["string"] }
17
+ ],
18
+ surroundingPairs: [
19
+ { open: "{", close: "}" },
20
+ { open: "[", close: "]" },
21
+ { open: "(", close: ")" },
22
+ { open: '"', close: '"' },
23
+ { open: "'", close: "'" }
24
+ ],
25
+ folding: {
26
+ markers: {
27
+ start: new RegExp("^\\s*#pragma\\s+region\\b"),
28
+ end: new RegExp("^\\s*#pragma\\s+endregion\\b")
29
+ }
30
+ }
31
+ };
32
+ const language = {
33
+ defaultToken: "",
34
+ tokenPostfix: ".cpp",
35
+ brackets: [
36
+ { token: "delimiter.curly", open: "{", close: "}" },
37
+ { token: "delimiter.parenthesis", open: "(", close: ")" },
38
+ { token: "delimiter.square", open: "[", close: "]" },
39
+ { token: "delimiter.angle", open: "<", close: ">" }
40
+ ],
41
+ keywords: [
42
+ "abstract",
43
+ "amp",
44
+ "array",
45
+ "auto",
46
+ "bool",
47
+ "break",
48
+ "case",
49
+ "catch",
50
+ "char",
51
+ "class",
52
+ "const",
53
+ "constexpr",
54
+ "const_cast",
55
+ "continue",
56
+ "cpu",
57
+ "decltype",
58
+ "default",
59
+ "delegate",
60
+ "delete",
61
+ "do",
62
+ "double",
63
+ "dynamic_cast",
64
+ "each",
65
+ "else",
66
+ "enum",
67
+ "event",
68
+ "explicit",
69
+ "export",
70
+ "extern",
71
+ "false",
72
+ "final",
73
+ "finally",
74
+ "float",
75
+ "for",
76
+ "friend",
77
+ "gcnew",
78
+ "generic",
79
+ "goto",
80
+ "if",
81
+ "in",
82
+ "initonly",
83
+ "inline",
84
+ "int",
85
+ "interface",
86
+ "interior_ptr",
87
+ "internal",
88
+ "literal",
89
+ "long",
90
+ "mutable",
91
+ "namespace",
92
+ "new",
93
+ "noexcept",
94
+ "nullptr",
95
+ "__nullptr",
96
+ "operator",
97
+ "override",
98
+ "partial",
99
+ "pascal",
100
+ "pin_ptr",
101
+ "private",
102
+ "property",
103
+ "protected",
104
+ "public",
105
+ "ref",
106
+ "register",
107
+ "reinterpret_cast",
108
+ "restrict",
109
+ "return",
110
+ "safe_cast",
111
+ "sealed",
112
+ "short",
113
+ "signed",
114
+ "sizeof",
115
+ "static",
116
+ "static_assert",
117
+ "static_cast",
118
+ "struct",
119
+ "switch",
120
+ "template",
121
+ "this",
122
+ "thread_local",
123
+ "throw",
124
+ "tile_static",
125
+ "true",
126
+ "try",
127
+ "typedef",
128
+ "typeid",
129
+ "typename",
130
+ "union",
131
+ "unsigned",
132
+ "using",
133
+ "virtual",
134
+ "void",
135
+ "volatile",
136
+ "wchar_t",
137
+ "where",
138
+ "while",
139
+ "_asm",
140
+ // reserved word with one underscores
141
+ "_based",
142
+ "_cdecl",
143
+ "_declspec",
144
+ "_fastcall",
145
+ "_if_exists",
146
+ "_if_not_exists",
147
+ "_inline",
148
+ "_multiple_inheritance",
149
+ "_pascal",
150
+ "_single_inheritance",
151
+ "_stdcall",
152
+ "_virtual_inheritance",
153
+ "_w64",
154
+ "__abstract",
155
+ // reserved word with two underscores
156
+ "__alignof",
157
+ "__asm",
158
+ "__assume",
159
+ "__based",
160
+ "__box",
161
+ "__builtin_alignof",
162
+ "__cdecl",
163
+ "__clrcall",
164
+ "__declspec",
165
+ "__delegate",
166
+ "__event",
167
+ "__except",
168
+ "__fastcall",
169
+ "__finally",
170
+ "__forceinline",
171
+ "__gc",
172
+ "__hook",
173
+ "__identifier",
174
+ "__if_exists",
175
+ "__if_not_exists",
176
+ "__inline",
177
+ "__int128",
178
+ "__int16",
179
+ "__int32",
180
+ "__int64",
181
+ "__int8",
182
+ "__interface",
183
+ "__leave",
184
+ "__m128",
185
+ "__m128d",
186
+ "__m128i",
187
+ "__m256",
188
+ "__m256d",
189
+ "__m256i",
190
+ "__m512",
191
+ "__m512d",
192
+ "__m512i",
193
+ "__m64",
194
+ "__multiple_inheritance",
195
+ "__newslot",
196
+ "__nogc",
197
+ "__noop",
198
+ "__nounwind",
199
+ "__novtordisp",
200
+ "__pascal",
201
+ "__pin",
202
+ "__pragma",
203
+ "__property",
204
+ "__ptr32",
205
+ "__ptr64",
206
+ "__raise",
207
+ "__restrict",
208
+ "__resume",
209
+ "__sealed",
210
+ "__single_inheritance",
211
+ "__stdcall",
212
+ "__super",
213
+ "__thiscall",
214
+ "__try",
215
+ "__try_cast",
216
+ "__typeof",
217
+ "__unaligned",
218
+ "__unhook",
219
+ "__uuidof",
220
+ "__value",
221
+ "__virtual_inheritance",
222
+ "__w64",
223
+ "__wchar_t"
224
+ ],
225
+ operators: [
226
+ "=",
227
+ ">",
228
+ "<",
229
+ "!",
230
+ "~",
231
+ "?",
232
+ ":",
233
+ "==",
234
+ "<=",
235
+ ">=",
236
+ "!=",
237
+ "&&",
238
+ "||",
239
+ "++",
240
+ "--",
241
+ "+",
242
+ "-",
243
+ "*",
244
+ "/",
245
+ "&",
246
+ "|",
247
+ "^",
248
+ "%",
249
+ "<<",
250
+ ">>",
251
+ "+=",
252
+ "-=",
253
+ "*=",
254
+ "/=",
255
+ "&=",
256
+ "|=",
257
+ "^=",
258
+ "%=",
259
+ "<<=",
260
+ ">>="
261
+ ],
262
+ // we include these common regular expressions
263
+ symbols: /[=><!~?:&|+\-*\/\^%]+/,
264
+ escapes: /\\(?:[0abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
265
+ integersuffix: /([uU](ll|LL|l|L)|(ll|LL|l|L)?[uU]?)/,
266
+ floatsuffix: /[fFlL]?/,
267
+ encoding: /u|u8|U|L/,
268
+ // The main tokenizer for our languages
269
+ tokenizer: {
270
+ root: [
271
+ // C++ 11 Raw String
272
+ [/@encoding?R\"(?:([^ ()\\\t]*))\(/, { token: "string.raw.begin", next: "@raw.$1" }],
273
+ // identifiers and keywords
274
+ [
275
+ /[a-zA-Z_]\w*/,
276
+ {
277
+ cases: {
278
+ "@keywords": { token: "keyword.$0" },
279
+ "@default": "identifier"
280
+ }
281
+ }
282
+ ],
283
+ // The preprocessor checks must be before whitespace as they check /^\s*#/ which
284
+ // otherwise fails to match later after other whitespace has been removed.
285
+ // Inclusion
286
+ [/^\s*#\s*include/, { token: "keyword.directive.include", next: "@include" }],
287
+ // Preprocessor directive
288
+ [/^\s*#\s*\w+/, "keyword.directive"],
289
+ // whitespace
290
+ { include: "@whitespace" },
291
+ // [[ attributes ]].
292
+ [/\[\s*\[/, { token: "annotation", next: "@annotation" }],
293
+ // delimiters and operators
294
+ [/[{}()<>\[\]]/, "@brackets"],
295
+ [
296
+ /@symbols/,
297
+ {
298
+ cases: {
299
+ "@operators": "delimiter",
300
+ "@default": ""
301
+ }
302
+ }
303
+ ],
304
+ // numbers
305
+ [/\d*\d+[eE]([\-+]?\d+)?(@floatsuffix)/, "number.float"],
306
+ [/\d*\.\d+([eE][\-+]?\d+)?(@floatsuffix)/, "number.float"],
307
+ [/0[xX][0-9a-fA-F']*[0-9a-fA-F](@integersuffix)/, "number.hex"],
308
+ [/0[0-7']*[0-7](@integersuffix)/, "number.octal"],
309
+ [/0[bB][0-1']*[0-1](@integersuffix)/, "number.binary"],
310
+ [/\d[\d']*\d(@integersuffix)/, "number"],
311
+ [/\d(@integersuffix)/, "number"],
312
+ // delimiter: after number because of .\d floats
313
+ [/[;,.]/, "delimiter"],
314
+ // strings
315
+ [/"([^"\\]|\\.)*$/, "string.invalid"],
316
+ // non-teminated string
317
+ [/"/, "string", "@string"],
318
+ // characters
319
+ [/'[^\\']'/, "string"],
320
+ [/(')(@escapes)(')/, ["string", "string.escape", "string"]],
321
+ [/'/, "string.invalid"]
322
+ ],
323
+ whitespace: [
324
+ [/[ \t\r\n]+/, ""],
325
+ [/\/\*\*(?!\/)/, "comment.doc", "@doccomment"],
326
+ [/\/\*/, "comment", "@comment"],
327
+ [/\/\/.*\\$/, "comment", "@linecomment"],
328
+ [/\/\/.*$/, "comment"]
329
+ ],
330
+ comment: [
331
+ [/[^\/*]+/, "comment"],
332
+ [/\*\//, "comment", "@pop"],
333
+ [/[\/*]/, "comment"]
334
+ ],
335
+ //For use with continuous line comments
336
+ linecomment: [
337
+ [/.*[^\\]$/, "comment", "@pop"],
338
+ [/[^]+/, "comment"]
339
+ ],
340
+ //Identical copy of comment above, except for the addition of .doc
341
+ doccomment: [
342
+ [/[^\/*]+/, "comment.doc"],
343
+ [/\*\//, "comment.doc", "@pop"],
344
+ [/[\/*]/, "comment.doc"]
345
+ ],
346
+ string: [
347
+ [/[^\\"]+/, "string"],
348
+ [/@escapes/, "string.escape"],
349
+ [/\\./, "string.escape.invalid"],
350
+ [/"/, "string", "@pop"]
351
+ ],
352
+ raw: [
353
+ [/[^)]+/, "string.raw"],
354
+ [/\)$S2\"/, { token: "string.raw.end", next: "@pop" }],
355
+ [/\)/, "string.raw"]
356
+ ],
357
+ annotation: [
358
+ { include: "@whitespace" },
359
+ [/using|alignas/, "keyword"],
360
+ [/[a-zA-Z0-9_]+/, "annotation"],
361
+ [/[,:]/, "delimiter"],
362
+ [/[()]/, "@brackets"],
363
+ [/\]\s*\]/, { token: "annotation", next: "@pop" }]
364
+ ],
365
+ include: [
366
+ [
367
+ /(\s*)(<)([^<>]*)(>)/,
368
+ [
369
+ "",
370
+ "keyword.directive.include.begin",
371
+ "string.include.identifier",
372
+ { token: "keyword.directive.include.end", next: "@pop" }
373
+ ]
374
+ ],
375
+ [
376
+ /(\s*)(")([^"]*)(")/,
377
+ [
378
+ "",
379
+ "keyword.directive.include.begin",
380
+ "string.include.identifier",
381
+ { token: "keyword.directive.include.end", next: "@pop" }
382
+ ]
383
+ ]
384
+ ]
385
+ }
386
+ };
387
+
388
+ export { conf, language };
@@ -0,0 +1,8 @@
1
+ import { registerLanguage } from '../_.contribution.js';
2
+
3
+ registerLanguage({
4
+ id: "csharp",
5
+ extensions: [".cs", ".csx", ".cake"],
6
+ aliases: ["C#", "csharp"],
7
+ loader: () => import('./csharp.js')
8
+ });