@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,8 @@
1
+ import { registerLanguage } from '../_.contribution.js';
2
+
3
+ registerLanguage({
4
+ id: "powershell",
5
+ extensions: [".ps1", ".psm1", ".psd1"],
6
+ aliases: ["PowerShell", "powershell", "ps", "ps1"],
7
+ loader: () => import('./powershell.js')
8
+ });
@@ -0,0 +1,238 @@
1
+ const conf = {
2
+ // the default separators except `$-`
3
+ wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#%\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
4
+ comments: {
5
+ lineComment: "#",
6
+ blockComment: ["<#", "#>"]
7
+ },
8
+ brackets: [
9
+ ["{", "}"],
10
+ ["[", "]"],
11
+ ["(", ")"]
12
+ ],
13
+ autoClosingPairs: [
14
+ { open: "{", close: "}" },
15
+ { open: "[", close: "]" },
16
+ { open: "(", close: ")" },
17
+ { open: '"', close: '"', notIn: ["string"] },
18
+ { open: "'", close: "'", notIn: ["string", "comment"] }
19
+ ],
20
+ surroundingPairs: [
21
+ { open: "{", close: "}" },
22
+ { open: "[", close: "]" },
23
+ { open: "(", close: ")" },
24
+ { open: '"', close: '"' },
25
+ { open: "'", close: "'" }
26
+ ],
27
+ folding: {
28
+ markers: {
29
+ start: new RegExp("^\\s*#region\\b"),
30
+ end: new RegExp("^\\s*#endregion\\b")
31
+ }
32
+ }
33
+ };
34
+ const language = {
35
+ defaultToken: "",
36
+ ignoreCase: true,
37
+ tokenPostfix: ".ps1",
38
+ brackets: [
39
+ { token: "delimiter.curly", open: "{", close: "}" },
40
+ { token: "delimiter.square", open: "[", close: "]" },
41
+ { token: "delimiter.parenthesis", open: "(", close: ")" }
42
+ ],
43
+ keywords: [
44
+ "begin",
45
+ "break",
46
+ "catch",
47
+ "class",
48
+ "continue",
49
+ "data",
50
+ "define",
51
+ "do",
52
+ "dynamicparam",
53
+ "else",
54
+ "elseif",
55
+ "end",
56
+ "exit",
57
+ "filter",
58
+ "finally",
59
+ "for",
60
+ "foreach",
61
+ "from",
62
+ "function",
63
+ "if",
64
+ "in",
65
+ "param",
66
+ "process",
67
+ "return",
68
+ "switch",
69
+ "throw",
70
+ "trap",
71
+ "try",
72
+ "until",
73
+ "using",
74
+ "var",
75
+ "while",
76
+ "workflow",
77
+ "parallel",
78
+ "sequence",
79
+ "inlinescript",
80
+ "configuration"
81
+ ],
82
+ helpKeywords: /SYNOPSIS|DESCRIPTION|PARAMETER|EXAMPLE|INPUTS|OUTPUTS|NOTES|LINK|COMPONENT|ROLE|FUNCTIONALITY|FORWARDHELPTARGETNAME|FORWARDHELPCATEGORY|REMOTEHELPRUNSPACE|EXTERNALHELP/,
83
+ // we include these common regular expressions
84
+ symbols: /[=><!~?&%|+\-*\/\^;\.,]+/,
85
+ escapes: /`(?:[abfnrtv\\"'$]|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
86
+ // The main tokenizer for our languages
87
+ tokenizer: {
88
+ root: [
89
+ // commands and keywords
90
+ [
91
+ /[a-zA-Z_][\w-]*/,
92
+ {
93
+ cases: {
94
+ "@keywords": { token: "keyword.$0" },
95
+ "@default": ""
96
+ }
97
+ }
98
+ ],
99
+ // whitespace
100
+ [/[ \t\r\n]+/, ""],
101
+ // labels
102
+ [/^:\w*/, "metatag"],
103
+ // variables
104
+ [
105
+ /\$(\{((global|local|private|script|using):)?[\w]+\}|((global|local|private|script|using):)?[\w]+)/,
106
+ "variable"
107
+ ],
108
+ // Comments
109
+ [/<#/, "comment", "@comment"],
110
+ [/#.*$/, "comment"],
111
+ // delimiters
112
+ [/[{}()\[\]]/, "@brackets"],
113
+ [/@symbols/, "delimiter"],
114
+ // numbers
115
+ [/\d*\.\d+([eE][\-+]?\d+)?/, "number.float"],
116
+ [/0[xX][0-9a-fA-F_]*[0-9a-fA-F]/, "number.hex"],
117
+ [/\d+?/, "number"],
118
+ // delimiter: after number because of .\d floats
119
+ [/[;,.]/, "delimiter"],
120
+ // strings:
121
+ [/\@"/, "string", '@herestring."'],
122
+ [/\@'/, "string", "@herestring.'"],
123
+ [
124
+ /"/,
125
+ {
126
+ cases: {
127
+ "@eos": "string",
128
+ "@default": { token: "string", next: '@string."' }
129
+ }
130
+ }
131
+ ],
132
+ [
133
+ /'/,
134
+ {
135
+ cases: {
136
+ "@eos": "string",
137
+ "@default": { token: "string", next: "@string.'" }
138
+ }
139
+ }
140
+ ]
141
+ ],
142
+ string: [
143
+ [
144
+ /[^"'\$`]+/,
145
+ {
146
+ cases: {
147
+ "@eos": { token: "string", next: "@popall" },
148
+ "@default": "string"
149
+ }
150
+ }
151
+ ],
152
+ [
153
+ /@escapes/,
154
+ {
155
+ cases: {
156
+ "@eos": { token: "string.escape", next: "@popall" },
157
+ "@default": "string.escape"
158
+ }
159
+ }
160
+ ],
161
+ [
162
+ /`./,
163
+ {
164
+ cases: {
165
+ "@eos": {
166
+ token: "string.escape.invalid",
167
+ next: "@popall"
168
+ },
169
+ "@default": "string.escape.invalid"
170
+ }
171
+ }
172
+ ],
173
+ [
174
+ /\$[\w]+$/,
175
+ {
176
+ cases: {
177
+ '$S2=="': { token: "variable", next: "@popall" },
178
+ "@default": { token: "string", next: "@popall" }
179
+ }
180
+ }
181
+ ],
182
+ [
183
+ /\$[\w]+/,
184
+ {
185
+ cases: {
186
+ '$S2=="': "variable",
187
+ "@default": "string"
188
+ }
189
+ }
190
+ ],
191
+ [
192
+ /["']/,
193
+ {
194
+ cases: {
195
+ "$#==$S2": { token: "string", next: "@pop" },
196
+ "@default": {
197
+ cases: {
198
+ "@eos": { token: "string", next: "@popall" },
199
+ "@default": "string"
200
+ }
201
+ }
202
+ }
203
+ }
204
+ ]
205
+ ],
206
+ herestring: [
207
+ [
208
+ /^\s*(["'])@/,
209
+ {
210
+ cases: {
211
+ "$1==$S2": { token: "string", next: "@pop" },
212
+ "@default": "string"
213
+ }
214
+ }
215
+ ],
216
+ [/[^\$`]+/, "string"],
217
+ [/@escapes/, "string.escape"],
218
+ [/`./, "string.escape.invalid"],
219
+ [
220
+ /\$[\w]+/,
221
+ {
222
+ cases: {
223
+ '$S2=="': "variable",
224
+ "@default": "string"
225
+ }
226
+ }
227
+ ]
228
+ ],
229
+ comment: [
230
+ [/[^#\.]+/, "comment"],
231
+ [/#>/, "comment", "@pop"],
232
+ [/(\.)(@helpKeywords)(?!\w)/, { token: "comment.keyword.$2" }],
233
+ [/[\.#]/, "comment"]
234
+ ]
235
+ }
236
+ };
237
+
238
+ export { conf, language };
@@ -0,0 +1,8 @@
1
+ import { registerLanguage } from '../_.contribution.js';
2
+
3
+ registerLanguage({
4
+ id: "proto",
5
+ extensions: [".proto"],
6
+ aliases: ["protobuf", "Protocol Buffers"],
7
+ loader: () => import('./protobuf.js')
8
+ });
@@ -0,0 +1,419 @@
1
+ const namedLiterals = ["true", "false"];
2
+ const conf = {
3
+ comments: {
4
+ lineComment: "//",
5
+ blockComment: ["/*", "*/"]
6
+ },
7
+ brackets: [
8
+ ["{", "}"],
9
+ ["[", "]"],
10
+ ["(", ")"],
11
+ ["<", ">"]
12
+ ],
13
+ surroundingPairs: [
14
+ { open: "{", close: "}" },
15
+ { open: "[", close: "]" },
16
+ { open: "(", close: ")" },
17
+ { open: "<", close: ">" },
18
+ { open: '"', close: '"' },
19
+ { open: "'", close: "'" }
20
+ ],
21
+ autoClosingPairs: [
22
+ { open: "{", close: "}" },
23
+ { open: "[", close: "]" },
24
+ { open: "(", close: ")" },
25
+ { open: "<", close: ">" },
26
+ { open: '"', close: '"', notIn: ["string"] },
27
+ { open: "'", close: "'", notIn: ["string"] }
28
+ ],
29
+ autoCloseBefore: ".,=}])>' \n ",
30
+ indentationRules: {
31
+ increaseIndentPattern: new RegExp("^((?!\\/\\/).)*(\\{[^}\"'`]*|\\([^)\"'`]*|\\[[^\\]\"'`]*)$"),
32
+ decreaseIndentPattern: new RegExp("^((?!.*?\\/\\*).*\\*/)?\\s*[\\}\\]].*$")
33
+ }
34
+ };
35
+ const language = {
36
+ defaultToken: "",
37
+ tokenPostfix: ".proto",
38
+ brackets: [
39
+ { open: "{", close: "}", token: "delimiter.curly" },
40
+ { open: "[", close: "]", token: "delimiter.square" },
41
+ { open: "(", close: ")", token: "delimiter.parenthesis" },
42
+ { open: "<", close: ">", token: "delimiter.angle" }
43
+ ],
44
+ symbols: /[=><!~?:&|+\-*/^%]+/,
45
+ keywords: [
46
+ "syntax",
47
+ "import",
48
+ "weak",
49
+ "public",
50
+ "package",
51
+ "option",
52
+ "repeated",
53
+ "oneof",
54
+ "map",
55
+ "reserved",
56
+ "to",
57
+ "max",
58
+ "enum",
59
+ "message",
60
+ "service",
61
+ "rpc",
62
+ "stream",
63
+ "returns",
64
+ "package",
65
+ "optional",
66
+ "true",
67
+ "false"
68
+ ],
69
+ builtinTypes: [
70
+ "double",
71
+ "float",
72
+ "int32",
73
+ "int64",
74
+ "uint32",
75
+ "uint64",
76
+ "sint32",
77
+ "sint64",
78
+ "fixed32",
79
+ "fixed64",
80
+ "sfixed32",
81
+ "sfixed64",
82
+ "bool",
83
+ "string",
84
+ "bytes"
85
+ ],
86
+ operators: ["=", "+", "-"],
87
+ namedLiterals,
88
+ escapes: `\\\\(u{[0-9A-Fa-f]+}|n|r|t|\\\\|'|\\\${)`,
89
+ identifier: /[a-zA-Z]\w*/,
90
+ fullIdentifier: /@identifier(?:\s*\.\s*@identifier)*/,
91
+ optionName: /(?:@identifier|\(\s*@fullIdentifier\s*\))(?:\s*\.\s*@identifier)*/,
92
+ messageName: /@identifier/,
93
+ enumName: /@identifier/,
94
+ messageType: /\.?\s*(?:@identifier\s*\.\s*)*@messageName/,
95
+ enumType: /\.?\s*(?:@identifier\s*\.\s*)*@enumName/,
96
+ floatLit: /[0-9]+\s*\.\s*[0-9]*(?:@exponent)?|[0-9]+@exponent|\.[0-9]+(?:@exponent)?/,
97
+ exponent: /[eE]\s*[+-]?\s*[0-9]+/,
98
+ boolLit: /true\b|false\b/,
99
+ decimalLit: /[1-9][0-9]*/,
100
+ octalLit: /0[0-7]*/,
101
+ hexLit: /0[xX][0-9a-fA-F]+/,
102
+ type: /double|float|int32|int64|uint32|uint64|sint32|sint64|fixed32|fixed64|sfixed32|sfixed64|bool|string|bytes|@messageType|@enumType/,
103
+ keyType: /int32|int64|uint32|uint64|sint32|sint64|fixed32|fixed64|sfixed32|sfixed64|bool|string/,
104
+ tokenizer: {
105
+ root: [
106
+ { include: "@whitespace" },
107
+ [/syntax/, "keyword"],
108
+ [/=/, "operators"],
109
+ [/;/, "delimiter"],
110
+ [
111
+ /(")(proto3)(")/,
112
+ ["string.quote", "string", { token: "string.quote", switchTo: "@topLevel.proto3" }]
113
+ ],
114
+ [
115
+ /(")(proto2)(")/,
116
+ ["string.quote", "string", { token: "string.quote", switchTo: "@topLevel.proto2" }]
117
+ ],
118
+ [
119
+ // If no `syntax` provided, regarded as proto2
120
+ /.*?/,
121
+ { token: "", switchTo: "@topLevel.proto2" }
122
+ ]
123
+ ],
124
+ topLevel: [
125
+ // whitespace
126
+ { include: "@whitespace" },
127
+ { include: "@constant" },
128
+ [/=/, "operators"],
129
+ [/[;.]/, "delimiter"],
130
+ [
131
+ /@fullIdentifier/,
132
+ {
133
+ cases: {
134
+ option: { token: "keyword", next: "@option.$S2" },
135
+ enum: { token: "keyword", next: "@enumDecl.$S2" },
136
+ message: { token: "keyword", next: "@messageDecl.$S2" },
137
+ service: { token: "keyword", next: "@serviceDecl.$S2" },
138
+ extend: {
139
+ cases: {
140
+ "$S2==proto2": { token: "keyword", next: "@extendDecl.$S2" }
141
+ }
142
+ },
143
+ "@keywords": "keyword",
144
+ "@default": "identifier"
145
+ }
146
+ }
147
+ ]
148
+ ],
149
+ enumDecl: [
150
+ { include: "@whitespace" },
151
+ [/@identifier/, "type.identifier"],
152
+ [/{/, { token: "@brackets", bracket: "@open", switchTo: "@enumBody.$S2" }]
153
+ ],
154
+ enumBody: [
155
+ { include: "@whitespace" },
156
+ { include: "@constant" },
157
+ [/=/, "operators"],
158
+ [/;/, "delimiter"],
159
+ [/option\b/, "keyword", "@option.$S2"],
160
+ [/@identifier/, "identifier"],
161
+ [/\[/, { token: "@brackets", bracket: "@open", next: "@options.$S2" }],
162
+ [/}/, { token: "@brackets", bracket: "@close", next: "@pop" }]
163
+ ],
164
+ messageDecl: [
165
+ { include: "@whitespace" },
166
+ [/@identifier/, "type.identifier"],
167
+ [/{/, { token: "@brackets", bracket: "@open", switchTo: "@messageBody.$S2" }]
168
+ ],
169
+ messageBody: [
170
+ { include: "@whitespace" },
171
+ { include: "@constant" },
172
+ [/=/, "operators"],
173
+ [/;/, "delimiter"],
174
+ [
175
+ "(map)(s*)(<)",
176
+ ["keyword", "white", { token: "@brackets", bracket: "@open", next: "@map.$S2" }]
177
+ ],
178
+ [
179
+ /@identifier/,
180
+ {
181
+ cases: {
182
+ option: { token: "keyword", next: "@option.$S2" },
183
+ enum: { token: "keyword", next: "@enumDecl.$S2" },
184
+ message: { token: "keyword", next: "@messageDecl.$S2" },
185
+ oneof: { token: "keyword", next: "@oneofDecl.$S2" },
186
+ extensions: {
187
+ cases: {
188
+ "$S2==proto2": { token: "keyword", next: "@reserved.$S2" }
189
+ }
190
+ },
191
+ reserved: { token: "keyword", next: "@reserved.$S2" },
192
+ "(?:repeated|optional)": { token: "keyword", next: "@field.$S2" },
193
+ required: {
194
+ cases: {
195
+ "$S2==proto2": { token: "keyword", next: "@field.$S2" }
196
+ }
197
+ },
198
+ "$S2==proto3": { token: "@rematch", next: "@field.$S2" }
199
+ }
200
+ }
201
+ ],
202
+ [/\[/, { token: "@brackets", bracket: "@open", next: "@options.$S2" }],
203
+ [/}/, { token: "@brackets", bracket: "@close", next: "@pop" }]
204
+ ],
205
+ extendDecl: [
206
+ { include: "@whitespace" },
207
+ [/@identifier/, "type.identifier"],
208
+ [/{/, { token: "@brackets", bracket: "@open", switchTo: "@extendBody.$S2" }]
209
+ ],
210
+ extendBody: [
211
+ { include: "@whitespace" },
212
+ { include: "@constant" },
213
+ [/;/, "delimiter"],
214
+ [/(?:repeated|optional|required)/, "keyword", "@field.$S2"],
215
+ [/\[/, { token: "@brackets", bracket: "@open", next: "@options.$S2" }],
216
+ [/}/, { token: "@brackets", bracket: "@close", next: "@pop" }]
217
+ ],
218
+ options: [
219
+ { include: "@whitespace" },
220
+ { include: "@constant" },
221
+ [/;/, "delimiter"],
222
+ [/@optionName/, "annotation"],
223
+ [/[()]/, "annotation.brackets"],
224
+ [/=/, "operator"],
225
+ [/\]/, { token: "@brackets", bracket: "@close", next: "@pop" }]
226
+ ],
227
+ option: [
228
+ { include: "@whitespace" },
229
+ [/@optionName/, "annotation"],
230
+ [/[()]/, "annotation.brackets"],
231
+ [/=/, "operator", "@pop"]
232
+ ],
233
+ oneofDecl: [
234
+ { include: "@whitespace" },
235
+ [/@identifier/, "identifier"],
236
+ [/{/, { token: "@brackets", bracket: "@open", switchTo: "@oneofBody.$S2" }]
237
+ ],
238
+ oneofBody: [
239
+ { include: "@whitespace" },
240
+ { include: "@constant" },
241
+ [/;/, "delimiter"],
242
+ [/(@identifier)(\s*)(=)/, ["identifier", "white", "delimiter"]],
243
+ [
244
+ /@fullIdentifier|\./,
245
+ {
246
+ cases: {
247
+ "@builtinTypes": "keyword",
248
+ "@default": "type.identifier"
249
+ }
250
+ }
251
+ ],
252
+ [/\[/, { token: "@brackets", bracket: "@open", next: "@options.$S2" }],
253
+ [/}/, { token: "@brackets", bracket: "@close", next: "@pop" }]
254
+ ],
255
+ reserved: [
256
+ { include: "@whitespace" },
257
+ [/,/, "delimiter"],
258
+ [/;/, "delimiter", "@pop"],
259
+ { include: "@constant" },
260
+ [/to\b|max\b/, "keyword"]
261
+ ],
262
+ map: [
263
+ { include: "@whitespace" },
264
+ [
265
+ /@fullIdentifier|\./,
266
+ {
267
+ cases: {
268
+ "@builtinTypes": "keyword",
269
+ "@default": "type.identifier"
270
+ }
271
+ }
272
+ ],
273
+ [/,/, "delimiter"],
274
+ [/>/, { token: "@brackets", bracket: "@close", switchTo: "identifier" }]
275
+ ],
276
+ field: [
277
+ { include: "@whitespace" },
278
+ [
279
+ "group",
280
+ {
281
+ cases: {
282
+ "$S2==proto2": { token: "keyword", switchTo: "@groupDecl.$S2" }
283
+ }
284
+ }
285
+ ],
286
+ [/(@identifier)(\s*)(=)/, ["identifier", "white", { token: "delimiter", next: "@pop" }]],
287
+ [
288
+ /@fullIdentifier|\./,
289
+ {
290
+ cases: {
291
+ "@builtinTypes": "keyword",
292
+ "@default": "type.identifier"
293
+ }
294
+ }
295
+ ]
296
+ ],
297
+ groupDecl: [
298
+ { include: "@whitespace" },
299
+ [/@identifier/, "identifier"],
300
+ ["=", "operator"],
301
+ [/{/, { token: "@brackets", bracket: "@open", switchTo: "@messageBody.$S2" }],
302
+ { include: "@constant" }
303
+ ],
304
+ type: [
305
+ { include: "@whitespace" },
306
+ [/@identifier/, "type.identifier", "@pop"],
307
+ [/./, "delimiter"]
308
+ ],
309
+ identifier: [{ include: "@whitespace" }, [/@identifier/, "identifier", "@pop"]],
310
+ serviceDecl: [
311
+ { include: "@whitespace" },
312
+ [/@identifier/, "identifier"],
313
+ [/{/, { token: "@brackets", bracket: "@open", switchTo: "@serviceBody.$S2" }]
314
+ ],
315
+ serviceBody: [
316
+ { include: "@whitespace" },
317
+ { include: "@constant" },
318
+ [/;/, "delimiter"],
319
+ [/option\b/, "keyword", "@option.$S2"],
320
+ [/rpc\b/, "keyword", "@rpc.$S2"],
321
+ [/\[/, { token: "@brackets", bracket: "@open", next: "@options.$S2" }],
322
+ [/}/, { token: "@brackets", bracket: "@close", next: "@pop" }]
323
+ ],
324
+ rpc: [
325
+ { include: "@whitespace" },
326
+ [/@identifier/, "identifier"],
327
+ [/\(/, { token: "@brackets", bracket: "@open", switchTo: "@request.$S2" }],
328
+ [/{/, { token: "@brackets", bracket: "@open", next: "@methodOptions.$S2" }],
329
+ [/;/, "delimiter", "@pop"]
330
+ ],
331
+ request: [
332
+ { include: "@whitespace" },
333
+ [
334
+ /@messageType/,
335
+ {
336
+ cases: {
337
+ stream: { token: "keyword", next: "@type.$S2" },
338
+ "@default": "type.identifier"
339
+ }
340
+ }
341
+ ],
342
+ [/\)/, { token: "@brackets", bracket: "@close", switchTo: "@returns.$S2" }]
343
+ ],
344
+ returns: [
345
+ { include: "@whitespace" },
346
+ [/returns\b/, "keyword"],
347
+ [/\(/, { token: "@brackets", bracket: "@open", switchTo: "@response.$S2" }]
348
+ ],
349
+ response: [
350
+ { include: "@whitespace" },
351
+ [
352
+ /@messageType/,
353
+ {
354
+ cases: {
355
+ stream: { token: "keyword", next: "@type.$S2" },
356
+ "@default": "type.identifier"
357
+ }
358
+ }
359
+ ],
360
+ [/\)/, { token: "@brackets", bracket: "@close", switchTo: "@rpc.$S2" }]
361
+ ],
362
+ methodOptions: [
363
+ { include: "@whitespace" },
364
+ { include: "@constant" },
365
+ [/;/, "delimiter"],
366
+ ["option", "keyword"],
367
+ [/@optionName/, "annotation"],
368
+ [/[()]/, "annotation.brackets"],
369
+ [/=/, "operator"],
370
+ [/}/, { token: "@brackets", bracket: "@close", next: "@pop" }]
371
+ ],
372
+ comment: [
373
+ [/[^\/*]+/, "comment"],
374
+ [/\/\*/, "comment", "@push"],
375
+ // nested comment
376
+ ["\\*/", "comment", "@pop"],
377
+ [/[\/*]/, "comment"]
378
+ ],
379
+ string: [
380
+ [/[^\\"]+/, "string"],
381
+ [/@escapes/, "string.escape"],
382
+ [/\\./, "string.escape.invalid"],
383
+ [/"/, { token: "string.quote", bracket: "@close", next: "@pop" }]
384
+ ],
385
+ stringSingle: [
386
+ [/[^\\']+/, "string"],
387
+ [/@escapes/, "string.escape"],
388
+ [/\\./, "string.escape.invalid"],
389
+ [/'/, { token: "string.quote", bracket: "@close", next: "@pop" }]
390
+ ],
391
+ constant: [
392
+ ["@boolLit", "keyword.constant"],
393
+ ["@hexLit", "number.hex"],
394
+ ["@octalLit", "number.octal"],
395
+ ["@decimalLit", "number"],
396
+ ["@floatLit", "number.float"],
397
+ [/("([^"\\]|\\.)*|'([^'\\]|\\.)*)$/, "string.invalid"],
398
+ // non-terminated string
399
+ [/"/, { token: "string.quote", bracket: "@open", next: "@string" }],
400
+ [/'/, { token: "string.quote", bracket: "@open", next: "@stringSingle" }],
401
+ [/{/, { token: "@brackets", bracket: "@open", next: "@prototext" }],
402
+ [/identifier/, "identifier"]
403
+ ],
404
+ whitespace: [
405
+ [/[ \t\r\n]+/, "white"],
406
+ [/\/\*/, "comment", "@comment"],
407
+ [/\/\/.*$/, "comment"]
408
+ ],
409
+ prototext: [
410
+ { include: "@whitespace" },
411
+ { include: "@constant" },
412
+ [/@identifier/, "identifier"],
413
+ [/[:;]/, "delimiter"],
414
+ [/}/, { token: "@brackets", bracket: "@close", next: "@pop" }]
415
+ ]
416
+ }
417
+ };
418
+
419
+ export { conf, language };
@@ -0,0 +1,8 @@
1
+ import { registerLanguage } from '../_.contribution.js';
2
+
3
+ registerLanguage({
4
+ id: "pug",
5
+ extensions: [".jade", ".pug"],
6
+ aliases: ["Pug", "Jade", "jade"],
7
+ loader: () => import('./pug.js')
8
+ });