@codingame/monaco-vscode-standalone-languages 3.2.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 (163) hide show
  1. package/_.contribution.js +74 -0
  2. package/abap/abap.contribution.js +19 -0
  3. package/abap/abap.js +1406 -0
  4. package/apex/apex.contribution.js +20 -0
  5. package/apex/apex.js +338 -0
  6. package/azcli/azcli.contribution.js +19 -0
  7. package/azcli/azcli.js +76 -0
  8. package/bat/bat.contribution.js +19 -0
  9. package/bat/bat.js +108 -0
  10. package/bicep/bicep.contribution.js +19 -0
  11. package/bicep/bicep.js +117 -0
  12. package/cameligo/cameligo.contribution.js +19 -0
  13. package/cameligo/cameligo.js +182 -0
  14. package/clojure/clojure.contribution.js +19 -0
  15. package/clojure/clojure.js +769 -0
  16. package/coffee/coffee.contribution.js +20 -0
  17. package/coffee/coffee.js +240 -0
  18. package/cpp/cpp.contribution.js +29 -0
  19. package/cpp/cpp.js +409 -0
  20. package/csharp/csharp.contribution.js +19 -0
  21. package/csharp/csharp.js +334 -0
  22. package/csp/csp.contribution.js +19 -0
  23. package/csp/csp.js +61 -0
  24. package/css/css.contribution.js +20 -0
  25. package/css/css.js +193 -0
  26. package/cypher/cypher.contribution.js +19 -0
  27. package/cypher/cypher.js +271 -0
  28. package/dart/dart.contribution.js +20 -0
  29. package/dart/dart.js +289 -0
  30. package/dockerfile/dockerfile.contribution.js +20 -0
  31. package/dockerfile/dockerfile.js +138 -0
  32. package/ecl/ecl.contribution.js +19 -0
  33. package/ecl/ecl.js +464 -0
  34. package/elixir/elixir.contribution.js +19 -0
  35. package/elixir/elixir.js +577 -0
  36. package/flow9/flow9.contribution.js +19 -0
  37. package/flow9/flow9.js +150 -0
  38. package/freemarker2/freemarker2.contribution.js +73 -0
  39. package/freemarker2/freemarker2.js +1016 -0
  40. package/fsharp/fsharp.contribution.js +19 -0
  41. package/fsharp/fsharp.js +225 -0
  42. package/go/go.contribution.js +19 -0
  43. package/go/go.js +226 -0
  44. package/graphql/graphql.contribution.js +20 -0
  45. package/graphql/graphql.js +159 -0
  46. package/handlebars/handlebars.contribution.js +20 -0
  47. package/handlebars/handlebars.js +439 -0
  48. package/hcl/hcl.contribution.js +19 -0
  49. package/hcl/hcl.js +191 -0
  50. package/html/html.contribution.js +20 -0
  51. package/html/html.js +328 -0
  52. package/index.js +81 -0
  53. package/ini/ini.contribution.js +20 -0
  54. package/ini/ini.js +79 -0
  55. package/java/java.contribution.js +20 -0
  56. package/java/java.js +240 -0
  57. package/javascript/javascript.contribution.js +22 -0
  58. package/javascript/javascript.js +77 -0
  59. package/julia/julia.contribution.js +19 -0
  60. package/julia/julia.js +519 -0
  61. package/kotlin/kotlin.contribution.js +20 -0
  62. package/kotlin/kotlin.js +261 -0
  63. package/less/less.contribution.js +20 -0
  64. package/less/less.js +169 -0
  65. package/lexon/lexon.contribution.js +19 -0
  66. package/lexon/lexon.js +165 -0
  67. package/liquid/liquid.contribution.js +20 -0
  68. package/liquid/liquid.js +260 -0
  69. package/lua/lua.contribution.js +19 -0
  70. package/lua/lua.js +170 -0
  71. package/m3/m3.contribution.js +19 -0
  72. package/m3/m3.js +218 -0
  73. package/markdown/markdown.contribution.js +19 -0
  74. package/markdown/markdown.js +237 -0
  75. package/mdx/mdx.contribution.js +19 -0
  76. package/mdx/mdx.js +184 -0
  77. package/mips/mips.contribution.js +20 -0
  78. package/mips/mips.js +206 -0
  79. package/msdax/msdax.contribution.js +19 -0
  80. package/msdax/msdax.js +383 -0
  81. package/mysql/mysql.contribution.js +19 -0
  82. package/mysql/mysql.js +886 -0
  83. package/objective-c/objective-c.contribution.js +19 -0
  84. package/objective-c/objective-c.js +191 -0
  85. package/package.json +23 -0
  86. package/pascal/pascal.contribution.js +20 -0
  87. package/pascal/pascal.js +259 -0
  88. package/pascaligo/pascaligo.contribution.js +19 -0
  89. package/pascaligo/pascaligo.js +172 -0
  90. package/perl/perl.contribution.js +19 -0
  91. package/perl/perl.js +634 -0
  92. package/pgsql/pgsql.contribution.js +19 -0
  93. package/pgsql/pgsql.js +859 -0
  94. package/php/php.contribution.js +20 -0
  95. package/php/php.js +508 -0
  96. package/pla/pla.contribution.js +18 -0
  97. package/pla/pla.js +145 -0
  98. package/postiats/postiats.contribution.js +19 -0
  99. package/postiats/postiats.js +915 -0
  100. package/powerquery/powerquery.contribution.js +19 -0
  101. package/powerquery/powerquery.js +898 -0
  102. package/powershell/powershell.contribution.js +19 -0
  103. package/powershell/powershell.js +247 -0
  104. package/protobuf/protobuf.contribution.js +19 -0
  105. package/protobuf/protobuf.js +428 -0
  106. package/pug/pug.contribution.js +19 -0
  107. package/pug/pug.js +410 -0
  108. package/python/python.contribution.js +20 -0
  109. package/python/python.js +295 -0
  110. package/qsharp/qsharp.contribution.js +19 -0
  111. package/qsharp/qsharp.js +293 -0
  112. package/r/r.contribution.js +19 -0
  113. package/r/r.js +251 -0
  114. package/razor/razor.contribution.js +20 -0
  115. package/razor/razor.js +570 -0
  116. package/redis/redis.contribution.js +19 -0
  117. package/redis/redis.js +310 -0
  118. package/redshift/redshift.contribution.js +19 -0
  119. package/redshift/redshift.js +817 -0
  120. package/restructuredtext/restructuredtext.contribution.js +19 -0
  121. package/restructuredtext/restructuredtext.js +182 -0
  122. package/ruby/ruby.contribution.js +20 -0
  123. package/ruby/ruby.js +519 -0
  124. package/rust/rust.contribution.js +19 -0
  125. package/rust/rust.js +351 -0
  126. package/sb/sb.contribution.js +19 -0
  127. package/sb/sb.js +123 -0
  128. package/scala/scala.contribution.js +20 -0
  129. package/scala/scala.js +378 -0
  130. package/scheme/scheme.contribution.js +19 -0
  131. package/scheme/scheme.js +116 -0
  132. package/scss/scss.contribution.js +20 -0
  133. package/scss/scss.js +268 -0
  134. package/shell/shell.contribution.js +19 -0
  135. package/shell/shell.js +229 -0
  136. package/solidity/solidity.contribution.js +19 -0
  137. package/solidity/solidity.js +1375 -0
  138. package/sophia/sophia.contribution.js +19 -0
  139. package/sophia/sophia.js +207 -0
  140. package/sparql/sparql.contribution.js +19 -0
  141. package/sparql/sparql.js +209 -0
  142. package/sql/sql.contribution.js +19 -0
  143. package/sql/sql.js +861 -0
  144. package/st/st.contribution.js +19 -0
  145. package/st/st.js +424 -0
  146. package/swift/swift.contribution.js +20 -0
  147. package/swift/swift.js +320 -0
  148. package/systemverilog/systemverilog.contribution.js +29 -0
  149. package/systemverilog/systemverilog.js +584 -0
  150. package/tcl/tcl.contribution.js +19 -0
  151. package/tcl/tcl.js +240 -0
  152. package/twig/twig.contribution.js +20 -0
  153. package/twig/twig.js +400 -0
  154. package/typescript/typescript.contribution.js +20 -0
  155. package/typescript/typescript.js +362 -0
  156. package/vb/vb.contribution.js +19 -0
  157. package/vb/vb.js +380 -0
  158. package/wgsl/wgsl.contribution.js +19 -0
  159. package/wgsl/wgsl.js +461 -0
  160. package/xml/xml.contribution.js +39 -0
  161. package/xml/xml.js +114 -0
  162. package/yaml/yaml.contribution.js +20 -0
  163. package/yaml/yaml.js +225 -0
@@ -0,0 +1,19 @@
1
+ import { registerLanguage } from '../_.contribution.js';
2
+
3
+ /*!-----------------------------------------------------------------------------
4
+ * Copyright (c) Microsoft Corporation. All rights reserved.
5
+ * Version: 0.47.0(undefined)
6
+ * Released under the MIT license
7
+ * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
8
+ *-----------------------------------------------------------------------------*/
9
+
10
+ registerLanguage({
11
+ id: "objective-c",
12
+ extensions: [".m"],
13
+ aliases: ["Objective-C"],
14
+ loader: () => {
15
+ {
16
+ return import('./objective-c.js');
17
+ }
18
+ }
19
+ });
@@ -0,0 +1,191 @@
1
+ /*!-----------------------------------------------------------------------------
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Version: 0.47.0(undefined)
4
+ * Released under the MIT license
5
+ * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
6
+ *-----------------------------------------------------------------------------*/
7
+
8
+
9
+ // src/basic-languages/objective-c/objective-c.ts
10
+ var conf = {
11
+ comments: {
12
+ lineComment: "//",
13
+ blockComment: ["/*", "*/"]
14
+ },
15
+ brackets: [
16
+ ["{", "}"],
17
+ ["[", "]"],
18
+ ["(", ")"]
19
+ ],
20
+ autoClosingPairs: [
21
+ { open: "{", close: "}" },
22
+ { open: "[", close: "]" },
23
+ { open: "(", close: ")" },
24
+ { open: '"', close: '"' },
25
+ { open: "'", close: "'" }
26
+ ],
27
+ surroundingPairs: [
28
+ { open: "{", close: "}" },
29
+ { open: "[", close: "]" },
30
+ { open: "(", close: ")" },
31
+ { open: '"', close: '"' },
32
+ { open: "'", close: "'" }
33
+ ]
34
+ };
35
+ var language = {
36
+ defaultToken: "",
37
+ tokenPostfix: ".objective-c",
38
+ keywords: [
39
+ "#import",
40
+ "#include",
41
+ "#define",
42
+ "#else",
43
+ "#endif",
44
+ "#if",
45
+ "#ifdef",
46
+ "#ifndef",
47
+ "#ident",
48
+ "#undef",
49
+ "@class",
50
+ "@defs",
51
+ "@dynamic",
52
+ "@encode",
53
+ "@end",
54
+ "@implementation",
55
+ "@interface",
56
+ "@package",
57
+ "@private",
58
+ "@protected",
59
+ "@property",
60
+ "@protocol",
61
+ "@public",
62
+ "@selector",
63
+ "@synthesize",
64
+ "__declspec",
65
+ "assign",
66
+ "auto",
67
+ "BOOL",
68
+ "break",
69
+ "bycopy",
70
+ "byref",
71
+ "case",
72
+ "char",
73
+ "Class",
74
+ "const",
75
+ "copy",
76
+ "continue",
77
+ "default",
78
+ "do",
79
+ "double",
80
+ "else",
81
+ "enum",
82
+ "extern",
83
+ "FALSE",
84
+ "false",
85
+ "float",
86
+ "for",
87
+ "goto",
88
+ "if",
89
+ "in",
90
+ "int",
91
+ "id",
92
+ "inout",
93
+ "IMP",
94
+ "long",
95
+ "nil",
96
+ "nonatomic",
97
+ "NULL",
98
+ "oneway",
99
+ "out",
100
+ "private",
101
+ "public",
102
+ "protected",
103
+ "readwrite",
104
+ "readonly",
105
+ "register",
106
+ "return",
107
+ "SEL",
108
+ "self",
109
+ "short",
110
+ "signed",
111
+ "sizeof",
112
+ "static",
113
+ "struct",
114
+ "super",
115
+ "switch",
116
+ "typedef",
117
+ "TRUE",
118
+ "true",
119
+ "union",
120
+ "unsigned",
121
+ "volatile",
122
+ "void",
123
+ "while"
124
+ ],
125
+ decpart: /\d(_?\d)*/,
126
+ decimal: /0|@decpart/,
127
+ tokenizer: {
128
+ root: [
129
+ { include: "@comments" },
130
+ { include: "@whitespace" },
131
+ { include: "@numbers" },
132
+ { include: "@strings" },
133
+ [/[,:;]/, "delimiter"],
134
+ [/[{}\[\]()<>]/, "@brackets"],
135
+ [
136
+ /[a-zA-Z@#]\w*/,
137
+ {
138
+ cases: {
139
+ "@keywords": "keyword",
140
+ "@default": "identifier"
141
+ }
142
+ }
143
+ ],
144
+ [/[<>=\\+\\-\\*\\/\\^\\|\\~,]|and\\b|or\\b|not\\b]/, "operator"]
145
+ ],
146
+ whitespace: [[/\s+/, "white"]],
147
+ comments: [
148
+ ["\\/\\*", "comment", "@comment"],
149
+ ["\\/\\/+.*", "comment"]
150
+ ],
151
+ comment: [
152
+ ["\\*\\/", "comment", "@pop"],
153
+ [".", "comment"]
154
+ ],
155
+ numbers: [
156
+ [/0[xX][0-9a-fA-F]*(_?[0-9a-fA-F])*/, "number.hex"],
157
+ [
158
+ /@decimal((\.@decpart)?([eE][\-+]?@decpart)?)[fF]*/,
159
+ {
160
+ cases: {
161
+ "(\\d)*": "number",
162
+ $0: "number.float"
163
+ }
164
+ }
165
+ ]
166
+ ],
167
+ // Recognize strings, including those broken across lines with \ (but not without)
168
+ strings: [
169
+ [/'$/, "string.escape", "@popall"],
170
+ [/'/, "string.escape", "@stringBody"],
171
+ [/"$/, "string.escape", "@popall"],
172
+ [/"/, "string.escape", "@dblStringBody"]
173
+ ],
174
+ stringBody: [
175
+ [/[^\\']+$/, "string", "@popall"],
176
+ [/[^\\']+/, "string"],
177
+ [/\\./, "string"],
178
+ [/'/, "string.escape", "@popall"],
179
+ [/\\$/, "string"]
180
+ ],
181
+ dblStringBody: [
182
+ [/[^\\"]+$/, "string", "@popall"],
183
+ [/[^\\"]+/, "string"],
184
+ [/\\./, "string"],
185
+ [/"/, "string.escape", "@popall"],
186
+ [/\\$/, "string"]
187
+ ]
188
+ }
189
+ };
190
+
191
+ export { conf, language };
package/package.json ADDED
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "@codingame/monaco-vscode-standalone-languages",
3
+ "version": "3.2.0",
4
+ "keywords": [],
5
+ "author": {
6
+ "name": "CodinGame",
7
+ "url": "http://www.codingame.com"
8
+ },
9
+ "license": "MIT",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git@github.com:CodinGame/monaco-vscode-api.git"
13
+ },
14
+ "type": "module",
15
+ "private": false,
16
+ "description": "monaco-editor default language bundled to work with @codingame/monaco-vscode-api",
17
+ "main": "index.js",
18
+ "module": "index.js",
19
+ "types": "index.d.ts",
20
+ "dependencies": {
21
+ "monaco-editor": "npm:@codingame/monaco-vscode-editor-api@3.2.0"
22
+ }
23
+ }
@@ -0,0 +1,20 @@
1
+ import { registerLanguage } from '../_.contribution.js';
2
+
3
+ /*!-----------------------------------------------------------------------------
4
+ * Copyright (c) Microsoft Corporation. All rights reserved.
5
+ * Version: 0.47.0(undefined)
6
+ * Released under the MIT license
7
+ * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
8
+ *-----------------------------------------------------------------------------*/
9
+
10
+ registerLanguage({
11
+ id: "pascal",
12
+ extensions: [".pas", ".p", ".pp"],
13
+ aliases: ["Pascal", "pas"],
14
+ mimetypes: ["text/x-pascal-source", "text/x-pascal"],
15
+ loader: () => {
16
+ {
17
+ return import('./pascal.js');
18
+ }
19
+ }
20
+ });
@@ -0,0 +1,259 @@
1
+ /*!-----------------------------------------------------------------------------
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Version: 0.47.0(undefined)
4
+ * Released under the MIT license
5
+ * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
6
+ *-----------------------------------------------------------------------------*/
7
+
8
+
9
+ // src/basic-languages/pascal/pascal.ts
10
+ var conf = {
11
+ // the default separators except `@$`
12
+ wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
13
+ comments: {
14
+ lineComment: "//",
15
+ blockComment: ["{", "}"]
16
+ },
17
+ brackets: [
18
+ ["{", "}"],
19
+ ["[", "]"],
20
+ ["(", ")"],
21
+ ["<", ">"]
22
+ ],
23
+ autoClosingPairs: [
24
+ { open: "{", close: "}" },
25
+ { open: "[", close: "]" },
26
+ { open: "(", close: ")" },
27
+ { open: "<", close: ">" },
28
+ { open: "'", close: "'" }
29
+ ],
30
+ surroundingPairs: [
31
+ { open: "{", close: "}" },
32
+ { open: "[", close: "]" },
33
+ { open: "(", close: ")" },
34
+ { open: "<", close: ">" },
35
+ { open: "'", close: "'" }
36
+ ],
37
+ folding: {
38
+ markers: {
39
+ start: new RegExp("^\\s*\\{\\$REGION(\\s\\'.*\\')?\\}"),
40
+ end: new RegExp("^\\s*\\{\\$ENDREGION\\}")
41
+ }
42
+ }
43
+ };
44
+ var language = {
45
+ defaultToken: "",
46
+ tokenPostfix: ".pascal",
47
+ ignoreCase: true,
48
+ brackets: [
49
+ { open: "{", close: "}", token: "delimiter.curly" },
50
+ { open: "[", close: "]", token: "delimiter.square" },
51
+ { open: "(", close: ")", token: "delimiter.parenthesis" },
52
+ { open: "<", close: ">", token: "delimiter.angle" }
53
+ ],
54
+ keywords: [
55
+ "absolute",
56
+ "abstract",
57
+ "all",
58
+ "and_then",
59
+ "array",
60
+ "as",
61
+ "asm",
62
+ "attribute",
63
+ "begin",
64
+ "bindable",
65
+ "case",
66
+ "class",
67
+ "const",
68
+ "contains",
69
+ "default",
70
+ "div",
71
+ "else",
72
+ "end",
73
+ "except",
74
+ "exports",
75
+ "external",
76
+ "far",
77
+ "file",
78
+ "finalization",
79
+ "finally",
80
+ "forward",
81
+ "generic",
82
+ "goto",
83
+ "if",
84
+ "implements",
85
+ "import",
86
+ "in",
87
+ "index",
88
+ "inherited",
89
+ "initialization",
90
+ "interrupt",
91
+ "is",
92
+ "label",
93
+ "library",
94
+ "mod",
95
+ "module",
96
+ "name",
97
+ "near",
98
+ "not",
99
+ "object",
100
+ "of",
101
+ "on",
102
+ "only",
103
+ "operator",
104
+ "or_else",
105
+ "otherwise",
106
+ "override",
107
+ "package",
108
+ "packed",
109
+ "pow",
110
+ "private",
111
+ "program",
112
+ "protected",
113
+ "public",
114
+ "published",
115
+ "interface",
116
+ "implementation",
117
+ "qualified",
118
+ "read",
119
+ "record",
120
+ "resident",
121
+ "requires",
122
+ "resourcestring",
123
+ "restricted",
124
+ "segment",
125
+ "set",
126
+ "shl",
127
+ "shr",
128
+ "specialize",
129
+ "stored",
130
+ "strict",
131
+ "then",
132
+ "threadvar",
133
+ "to",
134
+ "try",
135
+ "type",
136
+ "unit",
137
+ "uses",
138
+ "var",
139
+ "view",
140
+ "virtual",
141
+ "dynamic",
142
+ "overload",
143
+ "reintroduce",
144
+ "with",
145
+ "write",
146
+ "xor",
147
+ "true",
148
+ "false",
149
+ "procedure",
150
+ "function",
151
+ "constructor",
152
+ "destructor",
153
+ "property",
154
+ "break",
155
+ "continue",
156
+ "exit",
157
+ "abort",
158
+ "while",
159
+ "do",
160
+ "for",
161
+ "raise",
162
+ "repeat",
163
+ "until"
164
+ ],
165
+ typeKeywords: [
166
+ "boolean",
167
+ "double",
168
+ "byte",
169
+ "integer",
170
+ "shortint",
171
+ "char",
172
+ "longint",
173
+ "float",
174
+ "string"
175
+ ],
176
+ operators: [
177
+ "=",
178
+ ">",
179
+ "<",
180
+ "<=",
181
+ ">=",
182
+ "<>",
183
+ ":",
184
+ ":=",
185
+ "and",
186
+ "or",
187
+ "+",
188
+ "-",
189
+ "*",
190
+ "/",
191
+ "@",
192
+ "&",
193
+ "^",
194
+ "%"
195
+ ],
196
+ // we include these common regular expressions
197
+ symbols: /[=><:@\^&|+\-*\/\^%]+/,
198
+ // The main tokenizer for our languages
199
+ tokenizer: {
200
+ root: [
201
+ // identifiers and keywords
202
+ [
203
+ /[a-zA-Z_][\w]*/,
204
+ {
205
+ cases: {
206
+ "@keywords": { token: "keyword.$0" },
207
+ "@default": "identifier"
208
+ }
209
+ }
210
+ ],
211
+ // whitespace
212
+ { include: "@whitespace" },
213
+ // delimiters and operators
214
+ [/[{}()\[\]]/, "@brackets"],
215
+ [/[<>](?!@symbols)/, "@brackets"],
216
+ [
217
+ /@symbols/,
218
+ {
219
+ cases: {
220
+ "@operators": "delimiter",
221
+ "@default": ""
222
+ }
223
+ }
224
+ ],
225
+ // numbers
226
+ [/\d*\.\d+([eE][\-+]?\d+)?/, "number.float"],
227
+ [/\$[0-9a-fA-F]{1,16}/, "number.hex"],
228
+ [/\d+/, "number"],
229
+ // delimiter: after number because of .\d floats
230
+ [/[;,.]/, "delimiter"],
231
+ // strings
232
+ [/'([^'\\]|\\.)*$/, "string.invalid"],
233
+ // non-teminated string
234
+ [/'/, "string", "@string"],
235
+ // characters
236
+ [/'[^\\']'/, "string"],
237
+ [/'/, "string.invalid"],
238
+ [/\#\d+/, "string"]
239
+ ],
240
+ comment: [
241
+ [/[^\*\}]+/, "comment"],
242
+ //[/\(\*/, 'comment', '@push' ], // nested comment not allowed :-(
243
+ [/\}/, "comment", "@pop"],
244
+ [/[\{]/, "comment"]
245
+ ],
246
+ string: [
247
+ [/[^\\']+/, "string"],
248
+ [/\\./, "string.escape.invalid"],
249
+ [/'/, { token: "string.quote", bracket: "@close", next: "@pop" }]
250
+ ],
251
+ whitespace: [
252
+ [/[ \t\r\n]+/, "white"],
253
+ [/\{/, "comment", "@comment"],
254
+ [/\/\/.*$/, "comment"]
255
+ ]
256
+ }
257
+ };
258
+
259
+ export { conf, language };
@@ -0,0 +1,19 @@
1
+ import { registerLanguage } from '../_.contribution.js';
2
+
3
+ /*!-----------------------------------------------------------------------------
4
+ * Copyright (c) Microsoft Corporation. All rights reserved.
5
+ * Version: 0.47.0(undefined)
6
+ * Released under the MIT license
7
+ * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
8
+ *-----------------------------------------------------------------------------*/
9
+
10
+ registerLanguage({
11
+ id: "pascaligo",
12
+ extensions: [".ligo"],
13
+ aliases: ["Pascaligo", "ligo"],
14
+ loader: () => {
15
+ {
16
+ return import('./pascaligo.js');
17
+ }
18
+ }
19
+ });
@@ -0,0 +1,172 @@
1
+ /*!-----------------------------------------------------------------------------
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Version: 0.47.0(undefined)
4
+ * Released under the MIT license
5
+ * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
6
+ *-----------------------------------------------------------------------------*/
7
+
8
+
9
+ // src/basic-languages/pascaligo/pascaligo.ts
10
+ var conf = {
11
+ comments: {
12
+ lineComment: "//",
13
+ blockComment: ["(*", "*)"]
14
+ },
15
+ brackets: [
16
+ ["{", "}"],
17
+ ["[", "]"],
18
+ ["(", ")"],
19
+ ["<", ">"]
20
+ ],
21
+ autoClosingPairs: [
22
+ { open: "{", close: "}" },
23
+ { open: "[", close: "]" },
24
+ { open: "(", close: ")" },
25
+ { open: "<", close: ">" },
26
+ { open: "'", close: "'" }
27
+ ],
28
+ surroundingPairs: [
29
+ { open: "{", close: "}" },
30
+ { open: "[", close: "]" },
31
+ { open: "(", close: ")" },
32
+ { open: "<", close: ">" },
33
+ { open: "'", close: "'" }
34
+ ]
35
+ };
36
+ var language = {
37
+ defaultToken: "",
38
+ tokenPostfix: ".pascaligo",
39
+ ignoreCase: true,
40
+ brackets: [
41
+ { open: "{", close: "}", token: "delimiter.curly" },
42
+ { open: "[", close: "]", token: "delimiter.square" },
43
+ { open: "(", close: ")", token: "delimiter.parenthesis" },
44
+ { open: "<", close: ">", token: "delimiter.angle" }
45
+ ],
46
+ keywords: [
47
+ "begin",
48
+ "block",
49
+ "case",
50
+ "const",
51
+ "else",
52
+ "end",
53
+ "fail",
54
+ "for",
55
+ "from",
56
+ "function",
57
+ "if",
58
+ "is",
59
+ "nil",
60
+ "of",
61
+ "remove",
62
+ "return",
63
+ "skip",
64
+ "then",
65
+ "type",
66
+ "var",
67
+ "while",
68
+ "with",
69
+ "option",
70
+ "None",
71
+ "transaction"
72
+ ],
73
+ typeKeywords: [
74
+ "bool",
75
+ "int",
76
+ "list",
77
+ "map",
78
+ "nat",
79
+ "record",
80
+ "string",
81
+ "unit",
82
+ "address",
83
+ "map",
84
+ "mtz",
85
+ "xtz"
86
+ ],
87
+ operators: [
88
+ "=",
89
+ ">",
90
+ "<",
91
+ "<=",
92
+ ">=",
93
+ "<>",
94
+ ":",
95
+ ":=",
96
+ "and",
97
+ "mod",
98
+ "or",
99
+ "+",
100
+ "-",
101
+ "*",
102
+ "/",
103
+ "@",
104
+ "&",
105
+ "^",
106
+ "%"
107
+ ],
108
+ // we include these common regular expressions
109
+ symbols: /[=><:@\^&|+\-*\/\^%]+/,
110
+ // The main tokenizer for our languages
111
+ tokenizer: {
112
+ root: [
113
+ // identifiers and keywords
114
+ [
115
+ /[a-zA-Z_][\w]*/,
116
+ {
117
+ cases: {
118
+ "@keywords": { token: "keyword.$0" },
119
+ "@default": "identifier"
120
+ }
121
+ }
122
+ ],
123
+ // whitespace
124
+ { include: "@whitespace" },
125
+ // delimiters and operators
126
+ [/[{}()\[\]]/, "@brackets"],
127
+ [/[<>](?!@symbols)/, "@brackets"],
128
+ [
129
+ /@symbols/,
130
+ {
131
+ cases: {
132
+ "@operators": "delimiter",
133
+ "@default": ""
134
+ }
135
+ }
136
+ ],
137
+ // numbers
138
+ [/\d*\.\d+([eE][\-+]?\d+)?/, "number.float"],
139
+ [/\$[0-9a-fA-F]{1,16}/, "number.hex"],
140
+ [/\d+/, "number"],
141
+ // delimiter: after number because of .\d floats
142
+ [/[;,.]/, "delimiter"],
143
+ // strings
144
+ [/'([^'\\]|\\.)*$/, "string.invalid"],
145
+ // non-teminated string
146
+ [/'/, "string", "@string"],
147
+ // characters
148
+ [/'[^\\']'/, "string"],
149
+ [/'/, "string.invalid"],
150
+ [/\#\d+/, "string"]
151
+ ],
152
+ /* */
153
+ comment: [
154
+ [/[^\(\*]+/, "comment"],
155
+ //[/\(\*/, 'comment', '@push' ], // nested comment not allowed :-(
156
+ [/\*\)/, "comment", "@pop"],
157
+ [/\(\*/, "comment"]
158
+ ],
159
+ string: [
160
+ [/[^\\']+/, "string"],
161
+ [/\\./, "string.escape.invalid"],
162
+ [/'/, { token: "string.quote", bracket: "@close", next: "@pop" }]
163
+ ],
164
+ whitespace: [
165
+ [/[ \t\r\n]+/, "white"],
166
+ [/\(\*/, "comment", "@comment"],
167
+ [/\/\/.*$/, "comment"]
168
+ ]
169
+ }
170
+ };
171
+
172
+ export { conf, language };