@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,228 @@
1
+ const conf = {
2
+ comments: {
3
+ blockComment: ["<!--", "-->"]
4
+ },
5
+ brackets: [
6
+ ["{", "}"],
7
+ ["[", "]"],
8
+ ["(", ")"]
9
+ ],
10
+ autoClosingPairs: [
11
+ { open: "{", close: "}" },
12
+ { open: "[", close: "]" },
13
+ { open: "(", close: ")" },
14
+ { open: "<", close: ">", notIn: ["string"] }
15
+ ],
16
+ surroundingPairs: [
17
+ { open: "(", close: ")" },
18
+ { open: "[", close: "]" },
19
+ { open: "`", close: "`" }
20
+ ],
21
+ folding: {
22
+ markers: {
23
+ start: new RegExp("^\\s*<!--\\s*#?region\\b.*-->"),
24
+ end: new RegExp("^\\s*<!--\\s*#?endregion\\b.*-->")
25
+ }
26
+ }
27
+ };
28
+ const language = {
29
+ defaultToken: "",
30
+ tokenPostfix: ".md",
31
+ // escape codes
32
+ control: /[\\`*_\[\]{}()#+\-\.!]/,
33
+ noncontrol: /[^\\`*_\[\]{}()#+\-\.!]/,
34
+ escapes: /\\(?:@control)/,
35
+ // escape codes for javascript/CSS strings
36
+ jsescapes: /\\(?:[btnfr\\"']|[0-7][0-7]?|[0-3][0-7]{2})/,
37
+ // non matched elements
38
+ empty: [
39
+ "area",
40
+ "base",
41
+ "basefont",
42
+ "br",
43
+ "col",
44
+ "frame",
45
+ "hr",
46
+ "img",
47
+ "input",
48
+ "isindex",
49
+ "link",
50
+ "meta",
51
+ "param"
52
+ ],
53
+ tokenizer: {
54
+ root: [
55
+ // markdown tables
56
+ [/^\s*\|/, "@rematch", "@table_header"],
57
+ // headers (with #)
58
+ [/^(\s{0,3})(#+)((?:[^\\#]|@escapes)+)((?:#+)?)/, ["white", "keyword", "keyword", "keyword"]],
59
+ // headers (with =)
60
+ [/^\s*(=+|\-+)\s*$/, "keyword"],
61
+ // headers (with ***)
62
+ [/^\s*((\*[ ]?)+)\s*$/, "meta.separator"],
63
+ // quote
64
+ [/^\s*>+/, "comment"],
65
+ // list (starting with * or number)
66
+ [/^\s*([\*\-+:]|\d+\.)\s/, "keyword"],
67
+ // code block (4 spaces indent)
68
+ [/^(\t|[ ]{4})[^ ].*$/, "string"],
69
+ // code block (3 tilde)
70
+ [/^\s*~~~\s*((?:\w|[\/\-#])+)?\s*$/, { token: "string", next: "@codeblock" }],
71
+ // github style code blocks (with backticks and language)
72
+ [
73
+ /^\s*```\s*((?:\w|[\/\-#])+).*$/,
74
+ { token: "string", next: "@codeblockgh", nextEmbedded: "$1" }
75
+ ],
76
+ // github style code blocks (with backticks but no language)
77
+ [/^\s*```\s*$/, { token: "string", next: "@codeblock" }],
78
+ // markup within lines
79
+ { include: "@linecontent" }
80
+ ],
81
+ table_header: [
82
+ { include: "@table_common" },
83
+ [/[^\|]+/, "keyword.table.header"]
84
+ // table header
85
+ ],
86
+ table_body: [{ include: "@table_common" }, { include: "@linecontent" }],
87
+ table_common: [
88
+ [/\s*[\-:]+\s*/, { token: "keyword", switchTo: "table_body" }],
89
+ // header-divider
90
+ [/^\s*\|/, "keyword.table.left"],
91
+ // opening |
92
+ [/^\s*[^\|]/, "@rematch", "@pop"],
93
+ // exiting
94
+ [/^\s*$/, "@rematch", "@pop"],
95
+ // exiting
96
+ [
97
+ /\|/,
98
+ {
99
+ cases: {
100
+ "@eos": "keyword.table.right",
101
+ // closing |
102
+ "@default": "keyword.table.middle"
103
+ // inner |
104
+ }
105
+ }
106
+ ]
107
+ ],
108
+ codeblock: [
109
+ [/^\s*~~~\s*$/, { token: "string", next: "@pop" }],
110
+ [/^\s*```\s*$/, { token: "string", next: "@pop" }],
111
+ [/.*$/, "variable.source"]
112
+ ],
113
+ // github style code blocks
114
+ codeblockgh: [
115
+ [/```\s*$/, { token: "string", next: "@pop", nextEmbedded: "@pop" }],
116
+ [/[^`]+/, "variable.source"]
117
+ ],
118
+ linecontent: [
119
+ // escapes
120
+ [/&\w+;/, "string.escape"],
121
+ [/@escapes/, "escape"],
122
+ // various markup
123
+ [/\b__([^\\_]|@escapes|_(?!_))+__\b/, "strong"],
124
+ [/\*\*([^\\*]|@escapes|\*(?!\*))+\*\*/, "strong"],
125
+ [/\b_[^_]+_\b/, "emphasis"],
126
+ [/\*([^\\*]|@escapes)+\*/, "emphasis"],
127
+ [/`([^\\`]|@escapes)+`/, "variable"],
128
+ // links
129
+ [/\{+[^}]+\}+/, "string.target"],
130
+ [/(!?\[)((?:[^\]\\]|@escapes)*)(\]\([^\)]+\))/, ["string.link", "", "string.link"]],
131
+ [/(!?\[)((?:[^\]\\]|@escapes)*)(\])/, "string.link"],
132
+ // or html
133
+ { include: "html" }
134
+ ],
135
+ // Note: it is tempting to rather switch to the real HTML mode instead of building our own here
136
+ // but currently there is a limitation in Monarch that prevents us from doing it: The opening
137
+ // '<' would start the HTML mode, however there is no way to jump 1 character back to let the
138
+ // HTML mode also tokenize the opening angle bracket. Thus, even though we could jump to HTML,
139
+ // we cannot correctly tokenize it in that mode yet.
140
+ html: [
141
+ // html tags
142
+ [/<(\w+)\/>/, "tag"],
143
+ [
144
+ /<(\w+)(\-|\w)*/,
145
+ {
146
+ cases: {
147
+ "@empty": { token: "tag", next: "@tag.$1" },
148
+ "@default": { token: "tag", next: "@tag.$1" }
149
+ }
150
+ }
151
+ ],
152
+ [/<\/(\w+)(\-|\w)*\s*>/, { token: "tag" }],
153
+ [/<!--/, "comment", "@comment"]
154
+ ],
155
+ comment: [
156
+ [/[^<\-]+/, "comment.content"],
157
+ [/-->/, "comment", "@pop"],
158
+ [/<!--/, "comment.content.invalid"],
159
+ [/[<\-]/, "comment.content"]
160
+ ],
161
+ // Almost full HTML tag matching, complete with embedded scripts & styles
162
+ tag: [
163
+ [/[ \t\r\n]+/, "white"],
164
+ [
165
+ /(type)(\s*=\s*)(")([^"]+)(")/,
166
+ [
167
+ "attribute.name.html",
168
+ "delimiter.html",
169
+ "string.html",
170
+ { token: "string.html", switchTo: "@tag.$S2.$4" },
171
+ "string.html"
172
+ ]
173
+ ],
174
+ [
175
+ /(type)(\s*=\s*)(')([^']+)(')/,
176
+ [
177
+ "attribute.name.html",
178
+ "delimiter.html",
179
+ "string.html",
180
+ { token: "string.html", switchTo: "@tag.$S2.$4" },
181
+ "string.html"
182
+ ]
183
+ ],
184
+ [/(\w+)(\s*=\s*)("[^"]*"|'[^']*')/, ["attribute.name.html", "delimiter.html", "string.html"]],
185
+ [/\w+/, "attribute.name.html"],
186
+ [/\/>/, "tag", "@pop"],
187
+ [
188
+ />/,
189
+ {
190
+ cases: {
191
+ "$S2==style": {
192
+ token: "tag",
193
+ switchTo: "embeddedStyle",
194
+ nextEmbedded: "text/css"
195
+ },
196
+ "$S2==script": {
197
+ cases: {
198
+ $S3: {
199
+ token: "tag",
200
+ switchTo: "embeddedScript",
201
+ nextEmbedded: "$S3"
202
+ },
203
+ "@default": {
204
+ token: "tag",
205
+ switchTo: "embeddedScript",
206
+ nextEmbedded: "text/javascript"
207
+ }
208
+ }
209
+ },
210
+ "@default": { token: "tag", next: "@pop" }
211
+ }
212
+ }
213
+ ]
214
+ ],
215
+ embeddedStyle: [
216
+ [/[^<]+/, ""],
217
+ [/<\/style\s*>/, { token: "@rematch", next: "@pop", nextEmbedded: "@pop" }],
218
+ [/</, ""]
219
+ ],
220
+ embeddedScript: [
221
+ [/[^<]+/, ""],
222
+ [/<\/script\s*>/, { token: "@rematch", next: "@pop", nextEmbedded: "@pop" }],
223
+ [/</, ""]
224
+ ]
225
+ }
226
+ };
227
+
228
+ export { conf, language };
@@ -0,0 +1,8 @@
1
+ import { registerLanguage } from '../_.contribution.js';
2
+
3
+ registerLanguage({
4
+ id: "mdx",
5
+ extensions: [".mdx"],
6
+ aliases: ["MDX", "mdx"],
7
+ loader: () => import('./mdx.js')
8
+ });
package/mdx/mdx.js ADDED
@@ -0,0 +1,158 @@
1
+ import { languages } from 'monaco-editor';
2
+
3
+ const conf = {
4
+ comments: {
5
+ blockComment: ["{/*", "*/}"]
6
+ },
7
+ brackets: [["{", "}"]],
8
+ autoClosingPairs: [
9
+ { open: '"', close: '"' },
10
+ { open: "'", close: "'" },
11
+ { open: "\u201C", close: "\u201D" },
12
+ { open: "\u2018", close: "\u2019" },
13
+ { open: "`", close: "`" },
14
+ { open: "{", close: "}" },
15
+ { open: "(", close: ")" },
16
+ { open: "_", close: "_" },
17
+ { open: "**", close: "**" },
18
+ { open: "<", close: ">" }
19
+ ],
20
+ onEnterRules: [
21
+ {
22
+ beforeText: /^\s*- .+/,
23
+ action: { indentAction: languages.IndentAction.None, appendText: "- " }
24
+ },
25
+ {
26
+ beforeText: /^\s*\+ .+/,
27
+ action: { indentAction: languages.IndentAction.None, appendText: "+ " }
28
+ },
29
+ {
30
+ beforeText: /^\s*\* .+/,
31
+ action: { indentAction: languages.IndentAction.None, appendText: "* " }
32
+ },
33
+ {
34
+ beforeText: /^> /,
35
+ action: { indentAction: languages.IndentAction.None, appendText: "> " }
36
+ },
37
+ {
38
+ beforeText: /<\w+/,
39
+ action: { indentAction: languages.IndentAction.Indent }
40
+ },
41
+ {
42
+ beforeText: /\s+>\s*$/,
43
+ action: { indentAction: languages.IndentAction.Indent }
44
+ },
45
+ {
46
+ beforeText: /<\/\w+>/,
47
+ action: { indentAction: languages.IndentAction.Outdent }
48
+ },
49
+ ...Array.from({ length: 100 }, (_, index) => ({
50
+ beforeText: new RegExp(`^${index}\\. .+`),
51
+ action: { indentAction: languages.IndentAction.None, appendText: `${index + 1}. ` }
52
+ }))
53
+ ]
54
+ };
55
+ const language = {
56
+ defaultToken: "",
57
+ tokenPostfix: ".mdx",
58
+ control: /[!#()*+.[\\\]_`{}\-]/,
59
+ escapes: /\\@control/,
60
+ tokenizer: {
61
+ root: [
62
+ [/^---$/, { token: "meta.content", next: "@frontmatter", nextEmbedded: "yaml" }],
63
+ [/^\s*import/, { token: "keyword", next: "@import", nextEmbedded: "js" }],
64
+ [/^\s*export/, { token: "keyword", next: "@export", nextEmbedded: "js" }],
65
+ [/<\w+/, { token: "type.identifier", next: "@jsx" }],
66
+ [/<\/?\w+>/, "type.identifier"],
67
+ [
68
+ /^(\s*)(>*\s*)(#{1,6}\s)/,
69
+ [{ token: "white" }, { token: "comment" }, { token: "keyword", next: "@header" }]
70
+ ],
71
+ [/^(\s*)(>*\s*)([*+-])(\s+)/, ["white", "comment", "keyword", "white"]],
72
+ [/^(\s*)(>*\s*)(\d{1,9}\.)(\s+)/, ["white", "comment", "number", "white"]],
73
+ [/^(\s*)(>*\s*)(\d{1,9}\.)(\s+)/, ["white", "comment", "number", "white"]],
74
+ [/^(\s*)(>*\s*)(-{3,}|\*{3,}|_{3,})$/, ["white", "comment", "keyword"]],
75
+ [/`{3,}(\s.*)?$/, { token: "string", next: "@codeblock_backtick" }],
76
+ [/~{3,}(\s.*)?$/, { token: "string", next: "@codeblock_tilde" }],
77
+ [
78
+ /`{3,}(\S+).*$/,
79
+ { token: "string", next: "@codeblock_highlight_backtick", nextEmbedded: "$1" }
80
+ ],
81
+ [
82
+ /~{3,}(\S+).*$/,
83
+ { token: "string", next: "@codeblock_highlight_tilde", nextEmbedded: "$1" }
84
+ ],
85
+ [/^(\s*)(-{4,})$/, ["white", "comment"]],
86
+ [/^(\s*)(>+)/, ["white", "comment"]],
87
+ { include: "content" }
88
+ ],
89
+ content: [
90
+ [
91
+ /(\[)(.+)(]\()(.+)(\s+".*")(\))/,
92
+ ["", "string.link", "", "type.identifier", "string.link", ""]
93
+ ],
94
+ [/(\[)(.+)(]\()(.+)(\))/, ["", "type.identifier", "", "string.link", ""]],
95
+ [/(\[)(.+)(]\[)(.+)(])/, ["", "type.identifier", "", "type.identifier", ""]],
96
+ [/(\[)(.+)(]:\s+)(\S*)/, ["", "type.identifier", "", "string.link"]],
97
+ [/(\[)(.+)(])/, ["", "type.identifier", ""]],
98
+ [/`.*`/, "variable.source"],
99
+ [/_/, { token: "emphasis", next: "@emphasis_underscore" }],
100
+ [/\*(?!\*)/, { token: "emphasis", next: "@emphasis_asterisk" }],
101
+ [/\*\*/, { token: "strong", next: "@strong" }],
102
+ [/{/, { token: "delimiter.bracket", next: "@expression", nextEmbedded: "js" }]
103
+ ],
104
+ import: [[/'\s*(;|$)/, { token: "string", next: "@pop", nextEmbedded: "@pop" }]],
105
+ expression: [
106
+ [/{/, { token: "delimiter.bracket", next: "@expression" }],
107
+ [/}/, { token: "delimiter.bracket", next: "@pop", nextEmbedded: "@pop" }]
108
+ ],
109
+ export: [[/^\s*$/, { token: "delimiter.bracket", next: "@pop", nextEmbedded: "@pop" }]],
110
+ jsx: [
111
+ [/\s+/, ""],
112
+ [/(\w+)(=)("(?:[^"\\]|\\.)*")/, ["attribute.name", "operator", "string"]],
113
+ [/(\w+)(=)('(?:[^'\\]|\\.)*')/, ["attribute.name", "operator", "string"]],
114
+ [/(\w+(?=\s|>|={|$))/, ["attribute.name"]],
115
+ [/={/, { token: "delimiter.bracket", next: "@expression", nextEmbedded: "js" }],
116
+ [/>/, { token: "type.identifier", next: "@pop" }]
117
+ ],
118
+ header: [
119
+ [/.$/, { token: "keyword", next: "@pop" }],
120
+ { include: "content" },
121
+ [/./, { token: "keyword" }]
122
+ ],
123
+ strong: [
124
+ [/\*\*/, { token: "strong", next: "@pop" }],
125
+ { include: "content" },
126
+ [/./, { token: "strong" }]
127
+ ],
128
+ emphasis_underscore: [
129
+ [/_/, { token: "emphasis", next: "@pop" }],
130
+ { include: "content" },
131
+ [/./, { token: "emphasis" }]
132
+ ],
133
+ emphasis_asterisk: [
134
+ [/\*(?!\*)/, { token: "emphasis", next: "@pop" }],
135
+ { include: "content" },
136
+ [/./, { token: "emphasis" }]
137
+ ],
138
+ frontmatter: [[/^---$/, { token: "meta.content", nextEmbedded: "@pop", next: "@pop" }]],
139
+ codeblock_highlight_backtick: [
140
+ [/\s*`{3,}\s*$/, { token: "string", next: "@pop", nextEmbedded: "@pop" }],
141
+ [/.*$/, "variable.source"]
142
+ ],
143
+ codeblock_highlight_tilde: [
144
+ [/\s*~{3,}\s*$/, { token: "string", next: "@pop", nextEmbedded: "@pop" }],
145
+ [/.*$/, "variable.source"]
146
+ ],
147
+ codeblock_backtick: [
148
+ [/\s*`{3,}\s*$/, { token: "string", next: "@pop" }],
149
+ [/.*$/, "variable.source"]
150
+ ],
151
+ codeblock_tilde: [
152
+ [/\s*~{3,}\s*$/, { token: "string", next: "@pop" }],
153
+ [/.*$/, "variable.source"]
154
+ ]
155
+ }
156
+ };
157
+
158
+ export { conf, language };
@@ -0,0 +1,9 @@
1
+ import { registerLanguage } from '../_.contribution.js';
2
+
3
+ registerLanguage({
4
+ id: "mips",
5
+ extensions: [".s"],
6
+ aliases: ["MIPS", "MIPS-V"],
7
+ mimetypes: ["text/x-mips", "text/mips", "text/plaintext"],
8
+ loader: () => import('./mips.js')
9
+ });
package/mips/mips.js ADDED
@@ -0,0 +1,197 @@
1
+ const conf = {
2
+ wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#%\^\&\*\(\)\=\$\-\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
3
+ comments: {
4
+ blockComment: ["###", "###"],
5
+ lineComment: "#"
6
+ },
7
+ folding: {
8
+ markers: {
9
+ start: new RegExp("^\\s*#region\\b"),
10
+ end: new RegExp("^\\s*#endregion\\b")
11
+ }
12
+ }
13
+ };
14
+ const language = {
15
+ defaultToken: "",
16
+ ignoreCase: false,
17
+ tokenPostfix: ".mips",
18
+ regEx: /\/(?!\/\/)(?:[^\/\\]|\\.)*\/[igm]*/,
19
+ keywords: [
20
+ ".data",
21
+ ".text",
22
+ "syscall",
23
+ "trap",
24
+ "add",
25
+ "addu",
26
+ "addi",
27
+ "addiu",
28
+ "and",
29
+ "andi",
30
+ "div",
31
+ "divu",
32
+ "mult",
33
+ "multu",
34
+ "nor",
35
+ "or",
36
+ "ori",
37
+ "sll",
38
+ "slv",
39
+ "sra",
40
+ "srav",
41
+ "srl",
42
+ "srlv",
43
+ "sub",
44
+ "subu",
45
+ "xor",
46
+ "xori",
47
+ "lhi",
48
+ "lho",
49
+ "lhi",
50
+ "llo",
51
+ "slt",
52
+ "slti",
53
+ "sltu",
54
+ "sltiu",
55
+ "beq",
56
+ "bgtz",
57
+ "blez",
58
+ "bne",
59
+ "j",
60
+ "jal",
61
+ "jalr",
62
+ "jr",
63
+ "lb",
64
+ "lbu",
65
+ "lh",
66
+ "lhu",
67
+ "lw",
68
+ "li",
69
+ "la",
70
+ "sb",
71
+ "sh",
72
+ "sw",
73
+ "mfhi",
74
+ "mflo",
75
+ "mthi",
76
+ "mtlo",
77
+ "move"
78
+ ],
79
+ // we include these common regular expressions
80
+ symbols: /[\.,\:]+/,
81
+ escapes: /\\(?:[abfnrtv\\"'$]|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
82
+ // The main tokenizer for our languages
83
+ tokenizer: {
84
+ root: [
85
+ // identifiers and keywords
86
+ [/\$[a-zA-Z_]\w*/, "variable.predefined"],
87
+ [
88
+ /[.a-zA-Z_]\w*/,
89
+ {
90
+ cases: {
91
+ this: "variable.predefined",
92
+ "@keywords": { token: "keyword.$0" },
93
+ "@default": ""
94
+ }
95
+ }
96
+ ],
97
+ // whitespace
98
+ [/[ \t\r\n]+/, ""],
99
+ // Comments
100
+ [/#.*$/, "comment"],
101
+ // regular expressions
102
+ ["///", { token: "regexp", next: "@hereregexp" }],
103
+ [/^(\s*)(@regEx)/, ["", "regexp"]],
104
+ [/(\,)(\s*)(@regEx)/, ["delimiter", "", "regexp"]],
105
+ [/(\:)(\s*)(@regEx)/, ["delimiter", "", "regexp"]],
106
+ // delimiters
107
+ [/@symbols/, "delimiter"],
108
+ // numbers
109
+ [/\d+[eE]([\-+]?\d+)?/, "number.float"],
110
+ [/\d+\.\d+([eE][\-+]?\d+)?/, "number.float"],
111
+ [/0[xX][0-9a-fA-F]+/, "number.hex"],
112
+ [/0[0-7]+(?!\d)/, "number.octal"],
113
+ [/\d+/, "number"],
114
+ // delimiter: after number because of .\d floats
115
+ [/[,.]/, "delimiter"],
116
+ // strings:
117
+ [/"""/, "string", '@herestring."""'],
118
+ [/'''/, "string", "@herestring.'''"],
119
+ [
120
+ /"/,
121
+ {
122
+ cases: {
123
+ "@eos": "string",
124
+ "@default": { token: "string", next: '@string."' }
125
+ }
126
+ }
127
+ ],
128
+ [
129
+ /'/,
130
+ {
131
+ cases: {
132
+ "@eos": "string",
133
+ "@default": { token: "string", next: "@string.'" }
134
+ }
135
+ }
136
+ ]
137
+ ],
138
+ string: [
139
+ [/[^"'\#\\]+/, "string"],
140
+ [/@escapes/, "string.escape"],
141
+ [/\./, "string.escape.invalid"],
142
+ [/\./, "string.escape.invalid"],
143
+ [
144
+ /#{/,
145
+ {
146
+ cases: {
147
+ '$S2=="': {
148
+ token: "string",
149
+ next: "root.interpolatedstring"
150
+ },
151
+ "@default": "string"
152
+ }
153
+ }
154
+ ],
155
+ [
156
+ /["']/,
157
+ {
158
+ cases: {
159
+ "$#==$S2": { token: "string", next: "@pop" },
160
+ "@default": "string"
161
+ }
162
+ }
163
+ ],
164
+ [/#/, "string"]
165
+ ],
166
+ herestring: [
167
+ [
168
+ /("""|''')/,
169
+ {
170
+ cases: {
171
+ "$1==$S2": { token: "string", next: "@pop" },
172
+ "@default": "string"
173
+ }
174
+ }
175
+ ],
176
+ [/[^#\\'"]+/, "string"],
177
+ [/['"]+/, "string"],
178
+ [/@escapes/, "string.escape"],
179
+ [/\./, "string.escape.invalid"],
180
+ [/#{/, { token: "string.quote", next: "root.interpolatedstring" }],
181
+ [/#/, "string"]
182
+ ],
183
+ comment: [
184
+ [/[^#]+/, "comment"],
185
+ [/#/, "comment"]
186
+ ],
187
+ hereregexp: [
188
+ [/[^\\\/#]+/, "regexp"],
189
+ [/\\./, "regexp"],
190
+ [/#.*$/, "comment"],
191
+ ["///[igm]*", { token: "regexp", next: "@pop" }],
192
+ [/\//, "regexp"]
193
+ ]
194
+ }
195
+ };
196
+
197
+ export { conf, language };
@@ -0,0 +1,8 @@
1
+ import { registerLanguage } from '../_.contribution.js';
2
+
3
+ registerLanguage({
4
+ id: "msdax",
5
+ extensions: [".dax", ".msdax"],
6
+ aliases: ["DAX", "MSDAX"],
7
+ loader: () => import('./msdax.js')
8
+ });