@inspectr/ui 1.8.0 → 1.8.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 (90) hide show
  1. package/dist/abap-Bs8kvjsq.js +1398 -0
  2. package/dist/apex-Dspwrl5m.js +326 -0
  3. package/dist/azcli-k1BiOau1.js +68 -0
  4. package/dist/bat-BIP72KWc.js +100 -0
  5. package/dist/bicep-VhQeYhS3.js +102 -0
  6. package/dist/cameligo-DnuAXtHg.js +174 -0
  7. package/dist/clojure-BAuDPsal.js +761 -0
  8. package/dist/coffee-BV06qSnj.js +232 -0
  9. package/dist/cpp-Cz8Jeyrf.js +389 -0
  10. package/dist/csharp-F6hhlXFb.js +326 -0
  11. package/dist/csp-KzlEHCyI.js +53 -0
  12. package/dist/css-e4FKntZ3.js +187 -0
  13. package/dist/cssMode-CCxwJWiv.js +1571 -0
  14. package/dist/cypher-CpvDGKRr.js +263 -0
  15. package/dist/dart-DdHeFWR0.js +281 -0
  16. package/dist/dockerfile-aoNXDcio.js +130 -0
  17. package/dist/ecl-C4Q0DYuA.js +456 -0
  18. package/dist/editor.main-CP-oXbVe.js +110802 -0
  19. package/dist/elixir-C9X42b0T.js +569 -0
  20. package/dist/flow9-Bff42pfB.js +142 -0
  21. package/dist/freemarker2-BZveqxNO.js +989 -0
  22. package/dist/fsharp-C6vPAsHG.js +217 -0
  23. package/dist/go-DEr8zx9f.js +218 -0
  24. package/dist/graphql-BiNBBRFh.js +151 -0
  25. package/dist/handlebars-DFLvXTZ8.js +419 -0
  26. package/dist/hcl-2T9lKuFg.js +183 -0
  27. package/dist/html-DxXqfwFE.js +308 -0
  28. package/dist/htmlMode-C9gIo-LK.js +1581 -0
  29. package/dist/ini-CZGtssYM.js +71 -0
  30. package/dist/inspectr-ui.es.js +14597 -14415
  31. package/dist/inspectr-ui.umd.js +1180 -125
  32. package/dist/java-B260NeH3.js +232 -0
  33. package/dist/javascript-CYYD6pGr.js +70 -0
  34. package/dist/jsonMode-jVbIoPc6.js +1996 -0
  35. package/dist/julia-kuNLM9c5.js +511 -0
  36. package/dist/kotlin-Bz6kAefA.js +253 -0
  37. package/dist/less-AZUtS89I.js +162 -0
  38. package/dist/lexon-BcmgnyRb.js +157 -0
  39. package/dist/liquid-PYsubg5u.js +240 -0
  40. package/dist/lua-Dz1RbATg.js +162 -0
  41. package/dist/m3-CIMooLFn.js +210 -0
  42. package/dist/markdown-C1BsCK9P.js +229 -0
  43. package/dist/mdx-DRJsmowz.js +165 -0
  44. package/dist/mips-BovsnfLQ.js +198 -0
  45. package/dist/msdax-CiRB2ZB-.js +375 -0
  46. package/dist/mysql-BwdpPE19.js +878 -0
  47. package/dist/objective-c-D4nfHfso.js +183 -0
  48. package/dist/pascal--j5-PYtz.js +251 -0
  49. package/dist/pascaligo-C7TcJxNL.js +164 -0
  50. package/dist/perl-BzEWqUb5.js +626 -0
  51. package/dist/pgsql-B_KZ0mGX.js +851 -0
  52. package/dist/php-A19QHzQV.js +500 -0
  53. package/dist/pla-COeKY1hA.js +137 -0
  54. package/dist/postiats-BfMp7zJL.js +907 -0
  55. package/dist/powerquery-B0TS_5Gb.js +890 -0
  56. package/dist/powershell-5jSbKdYB.js +239 -0
  57. package/dist/protobuf-YgnOutn3.js +420 -0
  58. package/dist/pug-DLej6kn5.js +402 -0
  59. package/dist/python-M8MItOfu.js +301 -0
  60. package/dist/qsharp-AhjqtSHB.js +301 -0
  61. package/dist/r-D-F4P80w.js +243 -0
  62. package/dist/razor-CkROrZip.js +550 -0
  63. package/dist/redis-hwwIlMnV.js +302 -0
  64. package/dist/redshift-Bcm_kjEG.js +809 -0
  65. package/dist/restructuredtext-CrdzfPP-.js +174 -0
  66. package/dist/ruby-QC2UNm1s.js +511 -0
  67. package/dist/rust-5aqiQ3L5.js +343 -0
  68. package/dist/sb-B1g1ZfLJ.js +115 -0
  69. package/dist/scala-C2U4R5Gb.js +370 -0
  70. package/dist/scheme-DeFRbslr.js +108 -0
  71. package/dist/scss-RSTCiCmI.js +262 -0
  72. package/dist/shell-BpF-iNu8.js +221 -0
  73. package/dist/solidity-C00r2mbQ.js +1367 -0
  74. package/dist/sophia-DVW5ZKDB.js +199 -0
  75. package/dist/sparql-B0nmpxeX.js +201 -0
  76. package/dist/sql-CJwKPERn.js +853 -0
  77. package/dist/st-DPlKG5DT.js +416 -0
  78. package/dist/swift-YZBAbVHV.js +309 -0
  79. package/dist/systemverilog-CDQSaH63.js +576 -0
  80. package/dist/tcl-Dlu8sp6Q.js +232 -0
  81. package/dist/tsMode-D1me_v4f.js +886 -0
  82. package/dist/twig-C5TO7-kw.js +392 -0
  83. package/dist/typescript-D8U3Pc3R.js +343 -0
  84. package/dist/typespec-BsmjDEu7.js +117 -0
  85. package/dist/ui.css +1 -1
  86. package/dist/vb-ChHvIDrk.js +372 -0
  87. package/dist/wgsl-XEp1ju8c.js +439 -0
  88. package/dist/xml-CTIvZv70.js +95 -0
  89. package/dist/yaml-BgbINe9U.js +206 -0
  90. package/package.json +3 -1
@@ -0,0 +1,989 @@
1
+ import { m as f } from "./editor.main-CP-oXbVe.js";
2
+ var F = Object.defineProperty, b = Object.getOwnPropertyDescriptor, x = Object.getOwnPropertyNames, $ = Object.prototype.hasOwnProperty, v = (t, n, _, e) => {
3
+ if (n && typeof n == "object" || typeof n == "function")
4
+ for (let o of x(n))
5
+ !$.call(t, o) && o !== _ && F(t, o, { get: () => n[o], enumerable: !(e = b(n, o)) || e.enumerable });
6
+ return t;
7
+ }, E = (t, n, _) => (v(t, n, "default"), _), r = {};
8
+ E(r, f);
9
+ var d = [
10
+ "assign",
11
+ "flush",
12
+ "ftl",
13
+ "return",
14
+ "global",
15
+ "import",
16
+ "include",
17
+ "break",
18
+ "continue",
19
+ "local",
20
+ "nested",
21
+ "nt",
22
+ "setting",
23
+ "stop",
24
+ "t",
25
+ "lt",
26
+ "rt",
27
+ "fallback"
28
+ ], s = [
29
+ "attempt",
30
+ "autoesc",
31
+ "autoEsc",
32
+ "compress",
33
+ "comment",
34
+ "escape",
35
+ "noescape",
36
+ "function",
37
+ "if",
38
+ "list",
39
+ "items",
40
+ "sep",
41
+ "macro",
42
+ "noparse",
43
+ "noParse",
44
+ "noautoesc",
45
+ "noAutoEsc",
46
+ "outputformat",
47
+ "switch",
48
+ "visit",
49
+ "recurse"
50
+ ], a = {
51
+ close: ">",
52
+ id: "angle",
53
+ open: "<"
54
+ }, u = {
55
+ close: "\\]",
56
+ id: "bracket",
57
+ open: "\\["
58
+ }, D = {
59
+ close: "[>\\]]",
60
+ id: "auto",
61
+ open: "[<\\[]"
62
+ }, k = {
63
+ close: "\\}",
64
+ id: "dollar",
65
+ open1: "\\$",
66
+ open2: "\\{"
67
+ }, p = {
68
+ close: "\\]",
69
+ id: "bracket",
70
+ open1: "\\[",
71
+ open2: "="
72
+ };
73
+ function l(t) {
74
+ return {
75
+ brackets: [
76
+ ["<", ">"],
77
+ ["[", "]"],
78
+ ["(", ")"],
79
+ ["{", "}"]
80
+ ],
81
+ comments: {
82
+ blockComment: [`${t.open}--`, `--${t.close}`]
83
+ },
84
+ autoCloseBefore: `
85
+ \r }]),.:;=`,
86
+ autoClosingPairs: [
87
+ { open: "{", close: "}" },
88
+ { open: "[", close: "]" },
89
+ { open: "(", close: ")" },
90
+ { open: '"', close: '"', notIn: ["string"] },
91
+ { open: "'", close: "'", notIn: ["string"] }
92
+ ],
93
+ surroundingPairs: [
94
+ { open: '"', close: '"' },
95
+ { open: "'", close: "'" },
96
+ { open: "{", close: "}" },
97
+ { open: "[", close: "]" },
98
+ { open: "(", close: ")" },
99
+ { open: "<", close: ">" }
100
+ ],
101
+ folding: {
102
+ markers: {
103
+ start: new RegExp(
104
+ `${t.open}#(?:${s.join("|")})([^/${t.close}]*(?!/)${t.close})[^${t.open}]*$`
105
+ ),
106
+ end: new RegExp(`${t.open}/#(?:${s.join("|")})[\\r\\n\\t ]*>`)
107
+ }
108
+ },
109
+ onEnterRules: [
110
+ {
111
+ beforeText: new RegExp(
112
+ `${t.open}#(?!(?:${d.join("|")}))([a-zA-Z_]+)([^/${t.close}]*(?!/)${t.close})[^${t.open}]*$`
113
+ ),
114
+ afterText: new RegExp(`^${t.open}/#([a-zA-Z_]+)[\\r\\n\\t ]*${t.close}$`),
115
+ action: {
116
+ indentAction: r.languages.IndentAction.IndentOutdent
117
+ }
118
+ },
119
+ {
120
+ beforeText: new RegExp(
121
+ `${t.open}#(?!(?:${d.join("|")}))([a-zA-Z_]+)([^/${t.close}]*(?!/)${t.close})[^${t.open}]*$`
122
+ ),
123
+ action: { indentAction: r.languages.IndentAction.Indent }
124
+ }
125
+ ]
126
+ };
127
+ }
128
+ function g() {
129
+ return {
130
+ // Cannot set block comment delimiter in auto mode...
131
+ // It depends on the content and the cursor position of the file...
132
+ brackets: [
133
+ ["<", ">"],
134
+ ["[", "]"],
135
+ ["(", ")"],
136
+ ["{", "}"]
137
+ ],
138
+ autoCloseBefore: `
139
+ \r }]),.:;=`,
140
+ autoClosingPairs: [
141
+ { open: "{", close: "}" },
142
+ { open: "[", close: "]" },
143
+ { open: "(", close: ")" },
144
+ { open: '"', close: '"', notIn: ["string"] },
145
+ { open: "'", close: "'", notIn: ["string"] }
146
+ ],
147
+ surroundingPairs: [
148
+ { open: '"', close: '"' },
149
+ { open: "'", close: "'" },
150
+ { open: "{", close: "}" },
151
+ { open: "[", close: "]" },
152
+ { open: "(", close: ")" },
153
+ { open: "<", close: ">" }
154
+ ],
155
+ folding: {
156
+ markers: {
157
+ start: new RegExp(`[<\\[]#(?:${s.join("|")})([^/>\\]]*(?!/)[>\\]])[^<\\[]*$`),
158
+ end: new RegExp(`[<\\[]/#(?:${s.join("|")})[\\r\\n\\t ]*>`)
159
+ }
160
+ },
161
+ onEnterRules: [
162
+ {
163
+ beforeText: new RegExp(
164
+ `[<\\[]#(?!(?:${d.join("|")}))([a-zA-Z_]+)([^/>\\]]*(?!/)[>\\]])[^[<\\[]]*$`
165
+ ),
166
+ afterText: new RegExp("^[<\\[]/#([a-zA-Z_]+)[\\r\\n\\t ]*[>\\]]$"),
167
+ action: {
168
+ indentAction: r.languages.IndentAction.IndentOutdent
169
+ }
170
+ },
171
+ {
172
+ beforeText: new RegExp(
173
+ `[<\\[]#(?!(?:${d.join("|")}))([a-zA-Z_]+)([^/>\\]]*(?!/)[>\\]])[^[<\\[]]*$`
174
+ ),
175
+ action: { indentAction: r.languages.IndentAction.Indent }
176
+ }
177
+ ]
178
+ };
179
+ }
180
+ function i(t, n) {
181
+ const _ = `_${t.id}_${n.id}`, e = (c) => c.replace(/__id__/g, _), o = (c) => {
182
+ const m = c.source.replace(/__id__/g, _);
183
+ return new RegExp(m, c.flags);
184
+ };
185
+ return {
186
+ // Settings
187
+ unicode: !0,
188
+ includeLF: !1,
189
+ start: e("default__id__"),
190
+ ignoreCase: !1,
191
+ defaultToken: "invalid",
192
+ tokenPostfix: ".freemarker2",
193
+ brackets: [
194
+ { open: "{", close: "}", token: "delimiter.curly" },
195
+ { open: "[", close: "]", token: "delimiter.square" },
196
+ { open: "(", close: ")", token: "delimiter.parenthesis" },
197
+ { open: "<", close: ">", token: "delimiter.angle" }
198
+ ],
199
+ // Dynamic RegExp
200
+ [e("open__id__")]: new RegExp(t.open),
201
+ [e("close__id__")]: new RegExp(t.close),
202
+ [e("iOpen1__id__")]: new RegExp(n.open1),
203
+ [e("iOpen2__id__")]: new RegExp(n.open2),
204
+ [e("iClose__id__")]: new RegExp(n.close),
205
+ // <#START_TAG : "<" | "<#" | "[#">
206
+ // <#END_TAG : "</" | "</#" | "[/#">
207
+ [e("startTag__id__")]: o(/(@open__id__)(#)/),
208
+ [e("endTag__id__")]: o(/(@open__id__)(\/#)/),
209
+ [e("startOrEndTag__id__")]: o(/(@open__id__)(\/?#)/),
210
+ // <#CLOSE_TAG1 : (<BLANK>)* (">" | "]")>
211
+ [e("closeTag1__id__")]: o(/((?:@blank)*)(@close__id__)/),
212
+ // <#CLOSE_TAG2 : (<BLANK>)* ("/")? (">" | "]")>
213
+ [e("closeTag2__id__")]: o(/((?:@blank)*\/?)(@close__id__)/),
214
+ // Static RegExp
215
+ // <#BLANK : " " | "\t" | "\n" | "\r">
216
+ blank: /[ \t\n\r]/,
217
+ // <FALSE : "false">
218
+ // <TRUE : "true">
219
+ // <IN : "in">
220
+ // <AS : "as">
221
+ // <USING : "using">
222
+ keywords: ["false", "true", "in", "as", "using"],
223
+ // Directive names that cannot have an expression parameters and cannot be self-closing
224
+ // E.g. <#if id==2> ... </#if>
225
+ directiveStartCloseTag1: /attempt|recover|sep|auto[eE]sc|no(?:autoe|AutoE)sc|compress|default|no[eE]scape|comment|no[pP]arse/,
226
+ // Directive names that cannot have an expression parameter and can be self-closing
227
+ // E.g. <#if> ... <#else> ... </#if>
228
+ // E.g. <#if> ... <#else /></#if>
229
+ directiveStartCloseTag2: /else|break|continue|return|stop|flush|t|lt|rt|nt|nested|recurse|fallback|ftl/,
230
+ // Directive names that can have an expression parameter and cannot be self-closing
231
+ // E.g. <#if id==2> ... </#if>
232
+ directiveStartBlank: /if|else[iI]f|list|for[eE]ach|switch|case|assign|global|local|include|import|function|macro|transform|visit|stop|return|call|setting|output[fF]ormat|nested|recurse|escape|ftl|items/,
233
+ // Directive names that can have an end tag
234
+ // E.g. </#if>
235
+ directiveEndCloseTag1: /if|list|items|sep|recover|attempt|for[eE]ach|local|global|assign|function|macro|output[fF]ormat|auto[eE]sc|no(?:autoe|AutoE)sc|compress|transform|switch|escape|no[eE]scape/,
236
+ // <#ESCAPED_CHAR :
237
+ // "\\"
238
+ // (
239
+ // ("n" | "t" | "r" | "f" | "b" | "g" | "l" | "a" | "\\" | "'" | "\"" | "{" | "=")
240
+ // |
241
+ // ("x" ["0"-"9", "A"-"F", "a"-"f"])
242
+ // )
243
+ // >
244
+ // Note: While the JavaCC tokenizer rule only specifies one hex digit,
245
+ // FreeMarker actually interprets up to 4 hex digits.
246
+ escapedChar: /\\(?:[ntrfbgla\\'"\{=]|(?:x[0-9A-Fa-f]{1,4}))/,
247
+ // <#ASCII_DIGIT: ["0" - "9"]>
248
+ asciiDigit: /[0-9]/,
249
+ // <INTEGER : (["0"-"9"])+>
250
+ integer: /[0-9]+/,
251
+ // <#NON_ESCAPED_ID_START_CHAR:
252
+ // [
253
+ // // This was generated on JDK 1.8.0_20 Win64 with src/main/misc/identifierChars/IdentifierCharGenerator.java
254
+ // ...
255
+ // ]
256
+ nonEscapedIdStartChar: /[\$@-Z_a-z\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u1FFF\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183-\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3006\u3031-\u3035\u303B-\u303C\u3040-\u318F\u31A0-\u31BA\u31F0-\u31FF\u3300-\u337F\u3400-\u4DB5\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5-\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40-\uFB41\uFB43-\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,
257
+ // <#ESCAPED_ID_CHAR: "\\" ("-" | "." | ":" | "#")>
258
+ escapedIdChar: /\\[\-\.:#]/,
259
+ // <#ID_START_CHAR: <NON_ESCAPED_ID_START_CHAR>|<ESCAPED_ID_CHAR>>
260
+ idStartChar: /(?:@nonEscapedIdStartChar)|(?:@escapedIdChar)/,
261
+ // <ID: <ID_START_CHAR> (<ID_START_CHAR>|<ASCII_DIGIT>)*>
262
+ id: /(?:@idStartChar)(?:(?:@idStartChar)|(?:@asciiDigit))*/,
263
+ // Certain keywords / operators are allowed to index hashes
264
+ //
265
+ // Expression DotVariable(Expression exp) :
266
+ // {
267
+ // Token t;
268
+ // }
269
+ // {
270
+ // <DOT>
271
+ // (
272
+ // t = <ID> | t = <TIMES> | t = <DOUBLE_STAR>
273
+ // |
274
+ // (
275
+ // t = <LESS_THAN>
276
+ // |
277
+ // t = <LESS_THAN_EQUALS>
278
+ // |
279
+ // t = <ESCAPED_GT>
280
+ // |
281
+ // t = <ESCAPED_GTE>
282
+ // |
283
+ // t = <FALSE>
284
+ // |
285
+ // t = <TRUE>
286
+ // |
287
+ // t = <IN>
288
+ // |
289
+ // t = <AS>
290
+ // |
291
+ // t = <USING>
292
+ // )
293
+ // {
294
+ // if (!Character.isLetter(t.image.charAt(0))) {
295
+ // throw new ParseException(t.image + " is not a valid identifier.", template, t);
296
+ // }
297
+ // }
298
+ // )
299
+ // {
300
+ // notListLiteral(exp, "hash");
301
+ // notStringLiteral(exp, "hash");
302
+ // notBooleanLiteral(exp, "hash");
303
+ // Dot dot = new Dot(exp, t.image);
304
+ // dot.setLocation(template, exp, t);
305
+ // return dot;
306
+ // }
307
+ // }
308
+ specialHashKeys: /\*\*|\*|false|true|in|as|using/,
309
+ // <DOUBLE_EQUALS : "==">
310
+ // <EQUALS : "=">
311
+ // <NOT_EQUALS : "!=">
312
+ // <PLUS_EQUALS : "+=">
313
+ // <MINUS_EQUALS : "-=">
314
+ // <TIMES_EQUALS : "*=">
315
+ // <DIV_EQUALS : "/=">
316
+ // <MOD_EQUALS : "%=">
317
+ // <PLUS_PLUS : "++">
318
+ // <MINUS_MINUS : "--">
319
+ // <LESS_THAN_EQUALS : "lte" | "\\lte" | "<=" | "&lt;=">
320
+ // <LESS_THAN : "lt" | "\\lt" | "<" | "&lt;">
321
+ // <ESCAPED_GTE : "gte" | "\\gte" | "&gt;=">
322
+ // <ESCAPED_GT: "gt" | "\\gt" | "&gt;">
323
+ // <DOUBLE_STAR : "**">
324
+ // <PLUS : "+">
325
+ // <MINUS : "-">
326
+ // <TIMES : "*">
327
+ // <PERCENT : "%">
328
+ // <AND : "&" | "&&" | "&amp;&amp;" | "\\and" >
329
+ // <OR : "|" | "||">
330
+ // <EXCLAM : "!">
331
+ // <COMMA : ",">
332
+ // <SEMICOLON : ";">
333
+ // <COLON : ":">
334
+ // <ELLIPSIS : "...">
335
+ // <DOT_DOT_ASTERISK : "..*" >
336
+ // <DOT_DOT_LESS : "..<" | "..!" >
337
+ // <DOT_DOT : "..">
338
+ // <EXISTS : "??">
339
+ // <BUILT_IN : "?">
340
+ // <LAMBDA_ARROW : "->" | "-&gt;">
341
+ namedSymbols: /&lt;=|&gt;=|\\lte|\\lt|&lt;|\\gte|\\gt|&gt;|&amp;&amp;|\\and|-&gt;|->|==|!=|\+=|-=|\*=|\/=|%=|\+\+|--|<=|&&|\|\||:|\.\.\.|\.\.\*|\.\.<|\.\.!|\?\?|=|<|\+|-|\*|\/|%|\||\.\.|\?|!|&|\.|,|;/,
342
+ arrows: ["->", "-&gt;"],
343
+ delimiters: [";", ":", ",", "."],
344
+ stringOperators: ["lte", "lt", "gte", "gt"],
345
+ noParseTags: ["noparse", "noParse", "comment"],
346
+ tokenizer: {
347
+ // Parser states
348
+ // Plain text
349
+ [e("default__id__")]: [
350
+ { include: e("@directive_token__id__") },
351
+ { include: e("@interpolation_and_text_token__id__") }
352
+ ],
353
+ // A FreeMarker expression inside a directive, e.g. <#if 2<3>
354
+ [e("fmExpression__id__.directive")]: [
355
+ { include: e("@blank_and_expression_comment_token__id__") },
356
+ { include: e("@directive_end_token__id__") },
357
+ { include: e("@expression_token__id__") }
358
+ ],
359
+ // A FreeMarker expression inside an interpolation, e.g. ${2+3}
360
+ [e("fmExpression__id__.interpolation")]: [
361
+ { include: e("@blank_and_expression_comment_token__id__") },
362
+ { include: e("@expression_token__id__") },
363
+ { include: e("@greater_operators_token__id__") }
364
+ ],
365
+ // In an expression and inside a not-yet closed parenthesis / bracket
366
+ [e("inParen__id__.plain")]: [
367
+ { include: e("@blank_and_expression_comment_token__id__") },
368
+ { include: e("@directive_end_token__id__") },
369
+ { include: e("@expression_token__id__") }
370
+ ],
371
+ [e("inParen__id__.gt")]: [
372
+ { include: e("@blank_and_expression_comment_token__id__") },
373
+ { include: e("@expression_token__id__") },
374
+ { include: e("@greater_operators_token__id__") }
375
+ ],
376
+ // Expression for the unified call, e.g. <@createMacro() ... >
377
+ [e("noSpaceExpression__id__")]: [
378
+ { include: e("@no_space_expression_end_token__id__") },
379
+ { include: e("@directive_end_token__id__") },
380
+ { include: e("@expression_token__id__") }
381
+ ],
382
+ // For the function of a unified call. Special case for when the
383
+ // expression is a simple identifier.
384
+ // <@join [1,2] ",">
385
+ // <@null!join [1,2] ",">
386
+ [e("unifiedCall__id__")]: [{ include: e("@unified_call_token__id__") }],
387
+ // For singly and doubly quoted string (that may contain interpolations)
388
+ [e("singleString__id__")]: [{ include: e("@string_single_token__id__") }],
389
+ [e("doubleString__id__")]: [{ include: e("@string_double_token__id__") }],
390
+ // For singly and doubly quoted string (that may not contain interpolations)
391
+ [e("rawSingleString__id__")]: [{ include: e("@string_single_raw_token__id__") }],
392
+ [e("rawDoubleString__id__")]: [{ include: e("@string_double_raw_token__id__") }],
393
+ // For a comment in an expression
394
+ // ${ 1 + <#-- comment --> 2}
395
+ [e("expressionComment__id__")]: [{ include: e("@expression_comment_token__id__") }],
396
+ // For <#noparse> ... </#noparse>
397
+ // For <#noParse> ... </#noParse>
398
+ // For <#comment> ... </#comment>
399
+ [e("noParse__id__")]: [{ include: e("@no_parse_token__id__") }],
400
+ // For <#-- ... -->
401
+ [e("terseComment__id__")]: [{ include: e("@terse_comment_token__id__") }],
402
+ // Common rules
403
+ [e("directive_token__id__")]: [
404
+ // <ATTEMPT : <START_TAG> "attempt" <CLOSE_TAG1>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
405
+ // <RECOVER : <START_TAG> "recover" <CLOSE_TAG1>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
406
+ // <SEP : <START_TAG> "sep" <CLOSE_TAG1>>
407
+ // <AUTOESC : <START_TAG> "auto" ("e"|"E") "sc" <CLOSE_TAG1>> {
408
+ // handleTagSyntaxAndSwitch(matchedToken, getTagNamingConvention(matchedToken, 4), DEFAULT);
409
+ // }
410
+ // <NOAUTOESC : <START_TAG> "no" ("autoe"|"AutoE") "sc" <CLOSE_TAG1>> {
411
+ // handleTagSyntaxAndSwitch(matchedToken, getTagNamingConvention(matchedToken, 2), DEFAULT);
412
+ // }
413
+ // <COMPRESS : <START_TAG> "compress" <CLOSE_TAG1>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
414
+ // <DEFAUL : <START_TAG> "default" <CLOSE_TAG1>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
415
+ // <NOESCAPE : <START_TAG> "no" ("e" | "E") "scape" <CLOSE_TAG1>> {
416
+ // handleTagSyntaxAndSwitch(matchedToken, getTagNamingConvention(matchedToken, 2), DEFAULT);
417
+ // }
418
+ //
419
+ // <COMMENT : <START_TAG> "comment" <CLOSE_TAG1>> {
420
+ // handleTagSyntaxAndSwitch(matchedToken, NO_PARSE); noparseTag = "comment";
421
+ // }
422
+ // <NOPARSE: <START_TAG> "no" ("p" | "P") "arse" <CLOSE_TAG1>> {
423
+ // int tagNamingConvention = getTagNamingConvention(matchedToken, 2);
424
+ // handleTagSyntaxAndSwitch(matchedToken, tagNamingConvention, NO_PARSE);
425
+ // noparseTag = tagNamingConvention == Configuration.CAMEL_CASE_NAMING_CONVENTION ? "noParse" : "noparse";
426
+ // }
427
+ [
428
+ o(/(?:@startTag__id__)(@directiveStartCloseTag1)(?:@closeTag1__id__)/),
429
+ t.id === "auto" ? {
430
+ cases: {
431
+ "$1==<": { token: "@rematch", switchTo: `@default_angle_${n.id}` },
432
+ "$1==[": { token: "@rematch", switchTo: `@default_bracket_${n.id}` }
433
+ }
434
+ } : [
435
+ { token: "@brackets.directive" },
436
+ { token: "delimiter.directive" },
437
+ {
438
+ cases: {
439
+ "@noParseTags": { token: "tag", next: e("@noParse__id__.$3") },
440
+ "@default": { token: "tag" }
441
+ }
442
+ },
443
+ { token: "delimiter.directive" },
444
+ { token: "@brackets.directive" }
445
+ ]
446
+ ],
447
+ // <ELSE : <START_TAG> "else" <CLOSE_TAG2>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
448
+ // <BREAK : <START_TAG> "break" <CLOSE_TAG2>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
449
+ // <CONTINUE : <START_TAG> "continue" <CLOSE_TAG2>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
450
+ // <SIMPLE_RETURN : <START_TAG> "return" <CLOSE_TAG2>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
451
+ // <HALT : <START_TAG> "stop" <CLOSE_TAG2>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
452
+ // <FLUSH : <START_TAG> "flush" <CLOSE_TAG2>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
453
+ // <TRIM : <START_TAG> "t" <CLOSE_TAG2>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
454
+ // <LTRIM : <START_TAG> "lt" <CLOSE_TAG2>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
455
+ // <RTRIM : <START_TAG> "rt" <CLOSE_TAG2>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
456
+ // <NOTRIM : <START_TAG> "nt" <CLOSE_TAG2>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
457
+ // <SIMPLE_NESTED : <START_TAG> "nested" <CLOSE_TAG2>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
458
+ // <SIMPLE_RECURSE : <START_TAG> "recurse" <CLOSE_TAG2>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
459
+ // <FALLBACK : <START_TAG> "fallback" <CLOSE_TAG2>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
460
+ // <TRIVIAL_FTL_HEADER : ("<#ftl" | "[#ftl") ("/")? (">" | "]")> { ftlHeader(matchedToken); }
461
+ [
462
+ o(/(?:@startTag__id__)(@directiveStartCloseTag2)(?:@closeTag2__id__)/),
463
+ t.id === "auto" ? {
464
+ cases: {
465
+ "$1==<": { token: "@rematch", switchTo: `@default_angle_${n.id}` },
466
+ "$1==[": { token: "@rematch", switchTo: `@default_bracket_${n.id}` }
467
+ }
468
+ } : [
469
+ { token: "@brackets.directive" },
470
+ { token: "delimiter.directive" },
471
+ { token: "tag" },
472
+ { token: "delimiter.directive" },
473
+ { token: "@brackets.directive" }
474
+ ]
475
+ ],
476
+ // <IF : <START_TAG> "if" <BLANK>> { handleTagSyntaxAndSwitch(matchedToken, FM_EXPRESSION); }
477
+ // <ELSE_IF : <START_TAG> "else" ("i" | "I") "f" <BLANK>> {
478
+ // handleTagSyntaxAndSwitch(matchedToken, getTagNamingConvention(matchedToken, 4), FM_EXPRESSION);
479
+ // }
480
+ // <LIST : <START_TAG> "list" <BLANK>> { handleTagSyntaxAndSwitch(matchedToken, FM_EXPRESSION); }
481
+ // <FOREACH : <START_TAG> "for" ("e" | "E") "ach" <BLANK>> {
482
+ // handleTagSyntaxAndSwitch(matchedToken, getTagNamingConvention(matchedToken, 3), FM_EXPRESSION);
483
+ // }
484
+ // <SWITCH : <START_TAG> "switch" <BLANK>> { handleTagSyntaxAndSwitch(matchedToken, FM_EXPRESSION); }
485
+ // <CASE : <START_TAG> "case" <BLANK>> { handleTagSyntaxAndSwitch(matchedToken, FM_EXPRESSION); }
486
+ // <ASSIGN : <START_TAG> "assign" <BLANK>> { handleTagSyntaxAndSwitch(matchedToken, FM_EXPRESSION); }
487
+ // <GLOBALASSIGN : <START_TAG> "global" <BLANK>> { handleTagSyntaxAndSwitch(matchedToken, FM_EXPRESSION); }
488
+ // <LOCALASSIGN : <START_TAG> "local" <BLANK>> { handleTagSyntaxAndSwitch(matchedToken, FM_EXPRESSION); }
489
+ // <_INCLUDE : <START_TAG> "include" <BLANK>> { handleTagSyntaxAndSwitch(matchedToken, FM_EXPRESSION); }
490
+ // <IMPORT : <START_TAG> "import" <BLANK>> { handleTagSyntaxAndSwitch(matchedToken, FM_EXPRESSION); }
491
+ // <FUNCTION : <START_TAG> "function" <BLANK>> { handleTagSyntaxAndSwitch(matchedToken, FM_EXPRESSION); }
492
+ // <MACRO : <START_TAG> "macro" <BLANK>> { handleTagSyntaxAndSwitch(matchedToken, FM_EXPRESSION); }
493
+ // <TRANSFORM : <START_TAG> "transform" <BLANK>> { handleTagSyntaxAndSwitch(matchedToken, FM_EXPRESSION); }
494
+ // <VISIT : <START_TAG> "visit" <BLANK>> { handleTagSyntaxAndSwitch(matchedToken, FM_EXPRESSION); }
495
+ // <STOP : <START_TAG> "stop" <BLANK>> { handleTagSyntaxAndSwitch(matchedToken, FM_EXPRESSION); }
496
+ // <RETURN : <START_TAG> "return" <BLANK>> { handleTagSyntaxAndSwitch(matchedToken, FM_EXPRESSION); }
497
+ // <CALL : <START_TAG> "call" <BLANK>> { handleTagSyntaxAndSwitch(matchedToken, FM_EXPRESSION); }
498
+ // <SETTING : <START_TAG> "setting" <BLANK>> { handleTagSyntaxAndSwitch(matchedToken, FM_EXPRESSION); }
499
+ // <OUTPUTFORMAT : <START_TAG> "output" ("f"|"F") "ormat" <BLANK>> {
500
+ // handleTagSyntaxAndSwitch(matchedToken, getTagNamingConvention(matchedToken, 6), FM_EXPRESSION);
501
+ // }
502
+ // <NESTED : <START_TAG> "nested" <BLANK>> { handleTagSyntaxAndSwitch(matchedToken, FM_EXPRESSION); }
503
+ // <RECURSE : <START_TAG> "recurse" <BLANK>> { handleTagSyntaxAndSwitch(matchedToken, FM_EXPRESSION); }
504
+ // <ESCAPE : <START_TAG> "escape" <BLANK>> { handleTagSyntaxAndSwitch(matchedToken, FM_EXPRESSION); }
505
+ //
506
+ // Note: FreeMarker grammar appears to treat the FTL header as a special case,
507
+ // in order to remove new lines after the header (?), but since we only need
508
+ // to tokenize for highlighting, we can include this directive here.
509
+ // <FTL_HEADER : ("<#ftl" | "[#ftl") <BLANK>> { ftlHeader(matchedToken); }
510
+ //
511
+ // Note: FreeMarker grammar appears to treat the items directive as a special case for
512
+ // the AST parsing process, but since we only need to tokenize, we can include this
513
+ // directive here.
514
+ // <ITEMS : <START_TAG> "items" (<BLANK>)+ <AS> <BLANK>> { handleTagSyntaxAndSwitch(matchedToken, FM_EXPRESSION); }
515
+ [
516
+ o(/(?:@startTag__id__)(@directiveStartBlank)(@blank)/),
517
+ t.id === "auto" ? {
518
+ cases: {
519
+ "$1==<": { token: "@rematch", switchTo: `@default_angle_${n.id}` },
520
+ "$1==[": { token: "@rematch", switchTo: `@default_bracket_${n.id}` }
521
+ }
522
+ } : [
523
+ { token: "@brackets.directive" },
524
+ { token: "delimiter.directive" },
525
+ { token: "tag" },
526
+ { token: "", next: e("@fmExpression__id__.directive") }
527
+ ]
528
+ ],
529
+ // <END_IF : <END_TAG> "if" <CLOSE_TAG1>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
530
+ // <END_LIST : <END_TAG> "list" <CLOSE_TAG1>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
531
+ // <END_SEP : <END_TAG> "sep" <CLOSE_TAG1>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
532
+ // <END_RECOVER : <END_TAG> "recover" <CLOSE_TAG1>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
533
+ // <END_ATTEMPT : <END_TAG> "attempt" <CLOSE_TAG1>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
534
+ // <END_FOREACH : <END_TAG> "for" ("e" | "E") "ach" <CLOSE_TAG1>> {
535
+ // handleTagSyntaxAndSwitch(matchedToken, getTagNamingConvention(matchedToken, 3), DEFAULT);
536
+ // }
537
+ // <END_LOCAL : <END_TAG> "local" <CLOSE_TAG1>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
538
+ // <END_GLOBAL : <END_TAG> "global" <CLOSE_TAG1>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
539
+ // <END_ASSIGN : <END_TAG> "assign" <CLOSE_TAG1>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
540
+ // <END_FUNCTION : <END_TAG> "function" <CLOSE_TAG1>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
541
+ // <END_MACRO : <END_TAG> "macro" <CLOSE_TAG1>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
542
+ // <END_OUTPUTFORMAT : <END_TAG> "output" ("f" | "F") "ormat" <CLOSE_TAG1>> {
543
+ // handleTagSyntaxAndSwitch(matchedToken, getTagNamingConvention(matchedToken, 6), DEFAULT);
544
+ // }
545
+ // <END_AUTOESC : <END_TAG> "auto" ("e" | "E") "sc" <CLOSE_TAG1>> {
546
+ // handleTagSyntaxAndSwitch(matchedToken, getTagNamingConvention(matchedToken, 4), DEFAULT);
547
+ // }
548
+ // <END_NOAUTOESC : <END_TAG> "no" ("autoe"|"AutoE") "sc" <CLOSE_TAG1>> {
549
+ // handleTagSyntaxAndSwitch(matchedToken, getTagNamingConvention(matchedToken, 2), DEFAULT);
550
+ // }
551
+ // <END_COMPRESS : <END_TAG> "compress" <CLOSE_TAG1>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
552
+ // <END_TRANSFORM : <END_TAG> "transform" <CLOSE_TAG1>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
553
+ // <END_SWITCH : <END_TAG> "switch" <CLOSE_TAG1>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
554
+ // <END_ESCAPE : <END_TAG> "escape" <CLOSE_TAG1>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
555
+ // <END_NOESCAPE : <END_TAG> "no" ("e" | "E") "scape" <CLOSE_TAG1>> {
556
+ // handleTagSyntaxAndSwitch(matchedToken, getTagNamingConvention(matchedToken, 2), DEFAULT);
557
+ // }
558
+ [
559
+ o(/(?:@endTag__id__)(@directiveEndCloseTag1)(?:@closeTag1__id__)/),
560
+ t.id === "auto" ? {
561
+ cases: {
562
+ "$1==<": { token: "@rematch", switchTo: `@default_angle_${n.id}` },
563
+ "$1==[": { token: "@rematch", switchTo: `@default_bracket_${n.id}` }
564
+ }
565
+ } : [
566
+ { token: "@brackets.directive" },
567
+ { token: "delimiter.directive" },
568
+ { token: "tag" },
569
+ { token: "delimiter.directive" },
570
+ { token: "@brackets.directive" }
571
+ ]
572
+ ],
573
+ // <UNIFIED_CALL : "<@" | "[@" > { unifiedCall(matchedToken); }
574
+ [
575
+ o(/(@open__id__)(@)/),
576
+ t.id === "auto" ? {
577
+ cases: {
578
+ "$1==<": { token: "@rematch", switchTo: `@default_angle_${n.id}` },
579
+ "$1==[": { token: "@rematch", switchTo: `@default_bracket_${n.id}` }
580
+ }
581
+ } : [
582
+ { token: "@brackets.directive" },
583
+ { token: "delimiter.directive", next: e("@unifiedCall__id__") }
584
+ ]
585
+ ],
586
+ // <UNIFIED_CALL_END : ("<" | "[") "/@" ((<ID>) ("."<ID>)*)? <CLOSE_TAG1>> { unifiedCallEnd(matchedToken); }
587
+ [
588
+ o(/(@open__id__)(\/@)((?:(?:@id)(?:\.(?:@id))*)?)(?:@closeTag1__id__)/),
589
+ [
590
+ { token: "@brackets.directive" },
591
+ { token: "delimiter.directive" },
592
+ { token: "tag" },
593
+ { token: "delimiter.directive" },
594
+ { token: "@brackets.directive" }
595
+ ]
596
+ ],
597
+ // <TERSE_COMMENT : ("<" | "[") "#--" > { noparseTag = "-->"; handleTagSyntaxAndSwitch(matchedToken, NO_PARSE); }
598
+ [
599
+ o(/(@open__id__)#--/),
600
+ t.id === "auto" ? {
601
+ cases: {
602
+ "$1==<": { token: "@rematch", switchTo: `@default_angle_${n.id}` },
603
+ "$1==[": { token: "@rematch", switchTo: `@default_bracket_${n.id}` }
604
+ }
605
+ } : { token: "comment", next: e("@terseComment__id__") }
606
+ ],
607
+ // <UNKNOWN_DIRECTIVE : ("[#" | "[/#" | "<#" | "</#") (["a"-"z", "A"-"Z", "_"])+>
608
+ [
609
+ o(/(?:@startOrEndTag__id__)([a-zA-Z_]+)/),
610
+ t.id === "auto" ? {
611
+ cases: {
612
+ "$1==<": { token: "@rematch", switchTo: `@default_angle_${n.id}` },
613
+ "$1==[": { token: "@rematch", switchTo: `@default_bracket_${n.id}` }
614
+ }
615
+ } : [
616
+ { token: "@brackets.directive" },
617
+ { token: "delimiter.directive" },
618
+ { token: "tag.invalid", next: e("@fmExpression__id__.directive") }
619
+ ]
620
+ ]
621
+ ],
622
+ // <DEFAULT, NO_DIRECTIVE> TOKEN :
623
+ [e("interpolation_and_text_token__id__")]: [
624
+ // <DOLLAR_INTERPOLATION_OPENING : "${"> { startInterpolation(matchedToken); }
625
+ // <SQUARE_BRACKET_INTERPOLATION_OPENING : "[="> { startInterpolation(matchedToken); }
626
+ [
627
+ o(/(@iOpen1__id__)(@iOpen2__id__)/),
628
+ [
629
+ { token: n.id === "bracket" ? "@brackets.interpolation" : "delimiter.interpolation" },
630
+ {
631
+ token: n.id === "bracket" ? "delimiter.interpolation" : "@brackets.interpolation",
632
+ next: e("@fmExpression__id__.interpolation")
633
+ }
634
+ ]
635
+ ],
636
+ // <STATIC_TEXT_FALSE_ALARM : "$" | "#" | "<" | "[" | "{"> // to handle a lone dollar sign or "<" or "# or <@ with whitespace after"
637
+ // <STATIC_TEXT_WS : ("\n" | "\r" | "\t" | " ")+>
638
+ // <STATIC_TEXT_NON_WS : (~["$", "<", "#", "[", "{", "\n", "\r", "\t", " "])+>
639
+ [/[\$#<\[\{]|(?:@blank)+|[^\$<#\[\{\n\r\t ]+/, { token: "source" }]
640
+ ],
641
+ // <STRING_LITERAL :
642
+ // (
643
+ // "\""
644
+ // ((~["\"", "\\"]) | <ESCAPED_CHAR>)*
645
+ // "\""
646
+ // )
647
+ // |
648
+ // (
649
+ // "'"
650
+ // ((~["'", "\\"]) | <ESCAPED_CHAR>)*
651
+ // "'"
652
+ // )
653
+ // >
654
+ [e("string_single_token__id__")]: [
655
+ [/[^'\\]/, { token: "string" }],
656
+ [/@escapedChar/, { token: "string.escape" }],
657
+ [/'/, { token: "string", next: "@pop" }]
658
+ ],
659
+ [e("string_double_token__id__")]: [
660
+ [/[^"\\]/, { token: "string" }],
661
+ [/@escapedChar/, { token: "string.escape" }],
662
+ [/"/, { token: "string", next: "@pop" }]
663
+ ],
664
+ // <RAW_STRING : "r" (("\"" (~["\""])* "\"") | ("'" (~["'"])* "'"))>
665
+ [e("string_single_raw_token__id__")]: [
666
+ [/[^']+/, { token: "string.raw" }],
667
+ [/'/, { token: "string.raw", next: "@pop" }]
668
+ ],
669
+ [e("string_double_raw_token__id__")]: [
670
+ [/[^"]+/, { token: "string.raw" }],
671
+ [/"/, { token: "string.raw", next: "@pop" }]
672
+ ],
673
+ // <FM_EXPRESSION, IN_PAREN, NO_SPACE_EXPRESSION, NAMED_PARAMETER_EXPRESSION> TOKEN :
674
+ [e("expression_token__id__")]: [
675
+ // Strings
676
+ [
677
+ /(r?)(['"])/,
678
+ {
679
+ cases: {
680
+ "r'": [
681
+ { token: "keyword" },
682
+ { token: "string.raw", next: e("@rawSingleString__id__") }
683
+ ],
684
+ 'r"': [
685
+ { token: "keyword" },
686
+ { token: "string.raw", next: e("@rawDoubleString__id__") }
687
+ ],
688
+ "'": [{ token: "source" }, { token: "string", next: e("@singleString__id__") }],
689
+ '"': [{ token: "source" }, { token: "string", next: e("@doubleString__id__") }]
690
+ }
691
+ }
692
+ ],
693
+ // Numbers
694
+ // <INTEGER : (["0"-"9"])+>
695
+ // <DECIMAL : <INTEGER> "." <INTEGER>>
696
+ [
697
+ /(?:@integer)(?:\.(?:@integer))?/,
698
+ {
699
+ cases: {
700
+ "(?:@integer)": { token: "number" },
701
+ "@default": { token: "number.float" }
702
+ }
703
+ }
704
+ ],
705
+ // Special hash keys that must not be treated as identifiers
706
+ // after a period, e.g. a.** is accessing the key "**" of a
707
+ [
708
+ /(\.)(@blank*)(@specialHashKeys)/,
709
+ [{ token: "delimiter" }, { token: "" }, { token: "identifier" }]
710
+ ],
711
+ // Symbols / operators
712
+ [
713
+ /(?:@namedSymbols)/,
714
+ {
715
+ cases: {
716
+ "@arrows": { token: "meta.arrow" },
717
+ "@delimiters": { token: "delimiter" },
718
+ "@default": { token: "operators" }
719
+ }
720
+ }
721
+ ],
722
+ // Identifiers
723
+ [
724
+ /@id/,
725
+ {
726
+ cases: {
727
+ "@keywords": { token: "keyword.$0" },
728
+ "@stringOperators": { token: "operators" },
729
+ "@default": { token: "identifier" }
730
+ }
731
+ }
732
+ ],
733
+ // <OPEN_BRACKET : "[">
734
+ // <CLOSE_BRACKET : "]">
735
+ // <OPEN_PAREN : "(">
736
+ // <CLOSE_PAREN : ")">
737
+ // <OPENING_CURLY_BRACKET : "{">
738
+ // <CLOSING_CURLY_BRACKET : "}">
739
+ [
740
+ /[\[\]\(\)\{\}]/,
741
+ {
742
+ cases: {
743
+ "\\[": {
744
+ cases: {
745
+ "$S2==gt": { token: "@brackets", next: e("@inParen__id__.gt") },
746
+ "@default": { token: "@brackets", next: e("@inParen__id__.plain") }
747
+ }
748
+ },
749
+ "\\]": {
750
+ cases: {
751
+ ...n.id === "bracket" ? {
752
+ "$S2==interpolation": { token: "@brackets.interpolation", next: "@popall" }
753
+ } : {},
754
+ // This cannot happen while in auto mode, since this applies only to an
755
+ // fmExpression inside a directive. But once we encounter the start of a
756
+ // directive, we can establish the tag syntax mode.
757
+ ...t.id === "bracket" ? {
758
+ "$S2==directive": { token: "@brackets.directive", next: "@popall" }
759
+ } : {},
760
+ // Ignore mismatched paren
761
+ [e("$S1==inParen__id__")]: { token: "@brackets", next: "@pop" },
762
+ "@default": { token: "@brackets" }
763
+ }
764
+ },
765
+ "\\(": { token: "@brackets", next: e("@inParen__id__.gt") },
766
+ "\\)": {
767
+ cases: {
768
+ [e("$S1==inParen__id__")]: { token: "@brackets", next: "@pop" },
769
+ "@default": { token: "@brackets" }
770
+ }
771
+ },
772
+ "\\{": {
773
+ cases: {
774
+ "$S2==gt": { token: "@brackets", next: e("@inParen__id__.gt") },
775
+ "@default": { token: "@brackets", next: e("@inParen__id__.plain") }
776
+ }
777
+ },
778
+ "\\}": {
779
+ cases: {
780
+ ...n.id === "bracket" ? {} : {
781
+ "$S2==interpolation": { token: "@brackets.interpolation", next: "@popall" }
782
+ },
783
+ // Ignore mismatched paren
784
+ [e("$S1==inParen__id__")]: { token: "@brackets", next: "@pop" },
785
+ "@default": { token: "@brackets" }
786
+ }
787
+ }
788
+ }
789
+ }
790
+ ],
791
+ // <OPEN_MISPLACED_INTERPOLATION : "${" | "#{" | "[=">
792
+ [/\$\{/, { token: "delimiter.invalid" }]
793
+ ],
794
+ // <FM_EXPRESSION, IN_PAREN, NAMED_PARAMETER_EXPRESSION> SKIP :
795
+ [e("blank_and_expression_comment_token__id__")]: [
796
+ // < ( " " | "\t" | "\n" | "\r" )+ >
797
+ [/(?:@blank)+/, { token: "" }],
798
+ // < ("<" | "[") ("#" | "!") "--"> : EXPRESSION_COMMENT
799
+ [/[<\[][#!]--/, { token: "comment", next: e("@expressionComment__id__") }]
800
+ ],
801
+ // <FM_EXPRESSION, NO_SPACE_EXPRESSION, NAMED_PARAMETER_EXPRESSION> TOKEN :
802
+ [e("directive_end_token__id__")]: [
803
+ // <DIRECTIVE_END : ">">
804
+ // {
805
+ // if (inFTLHeader) {
806
+ // eatNewline();
807
+ // inFTLHeader = false;
808
+ // }
809
+ // if (squBracTagSyntax || postInterpolationLexState != -1 /* We are in an interpolation */) {
810
+ // matchedToken.kind = NATURAL_GT;
811
+ // } else {
812
+ // SwitchTo(DEFAULT);
813
+ // }
814
+ // }
815
+ // This cannot happen while in auto mode, since this applies only to an
816
+ // fmExpression inside a directive. But once we encounter the start of a
817
+ // directive, we can establish the tag syntax mode.
818
+ [
819
+ />/,
820
+ t.id === "bracket" ? { token: "operators" } : { token: "@brackets.directive", next: "@popall" }
821
+ ],
822
+ // <EMPTY_DIRECTIVE_END : "/>" | "/]">
823
+ // It is a syntax error to end a tag with the wrong close token
824
+ // Let's indicate that to the user by not closing the tag
825
+ [
826
+ o(/(\/)(@close__id__)/),
827
+ [{ token: "delimiter.directive" }, { token: "@brackets.directive", next: "@popall" }]
828
+ ]
829
+ ],
830
+ // <IN_PAREN> TOKEN :
831
+ [e("greater_operators_token__id__")]: [
832
+ // <NATURAL_GT : ">">
833
+ [/>/, { token: "operators" }],
834
+ // <NATURAL_GTE : ">=">
835
+ [/>=/, { token: "operators" }]
836
+ ],
837
+ // <NO_SPACE_EXPRESSION> TOKEN :
838
+ [e("no_space_expression_end_token__id__")]: [
839
+ // <TERMINATING_WHITESPACE : (["\n", "\r", "\t", " "])+> : FM_EXPRESSION
840
+ [/(?:@blank)+/, { token: "", switchTo: e("@fmExpression__id__.directive") }]
841
+ ],
842
+ [e("unified_call_token__id__")]: [
843
+ // Special case for a call where the expression is just an ID
844
+ // <UNIFIED_CALL> <ID> <BLANK>+
845
+ [
846
+ /(@id)((?:@blank)+)/,
847
+ [{ token: "tag" }, { token: "", next: e("@fmExpression__id__.directive") }]
848
+ ],
849
+ [
850
+ o(/(@id)(\/?)(@close__id__)/),
851
+ [
852
+ { token: "tag" },
853
+ { token: "delimiter.directive" },
854
+ { token: "@brackets.directive", next: "@popall" }
855
+ ]
856
+ ],
857
+ [/./, { token: "@rematch", next: e("@noSpaceExpression__id__") }]
858
+ ],
859
+ // <NO_PARSE> TOKEN :
860
+ [e("no_parse_token__id__")]: [
861
+ // <MAYBE_END :
862
+ // ("<" | "[")
863
+ // "/"
864
+ // ("#")?
865
+ // (["a"-"z", "A"-"Z"])+
866
+ // ( " " | "\t" | "\n" | "\r" )*
867
+ // (">" | "]")
868
+ // >
869
+ [
870
+ o(/(@open__id__)(\/#?)([a-zA-Z]+)((?:@blank)*)(@close__id__)/),
871
+ {
872
+ cases: {
873
+ "$S2==$3": [
874
+ { token: "@brackets.directive" },
875
+ { token: "delimiter.directive" },
876
+ { token: "tag" },
877
+ { token: "" },
878
+ { token: "@brackets.directive", next: "@popall" }
879
+ ],
880
+ "$S2==comment": [
881
+ { token: "comment" },
882
+ { token: "comment" },
883
+ { token: "comment" },
884
+ { token: "comment" },
885
+ { token: "comment" }
886
+ ],
887
+ "@default": [
888
+ { token: "source" },
889
+ { token: "source" },
890
+ { token: "source" },
891
+ { token: "source" },
892
+ { token: "source" }
893
+ ]
894
+ }
895
+ }
896
+ ],
897
+ // <KEEP_GOING : (~["<", "[", "-"])+>
898
+ // <LONE_LESS_THAN_OR_DASH : ["<", "[", "-"]>
899
+ [
900
+ /[^<\[\-]+|[<\[\-]/,
901
+ {
902
+ cases: {
903
+ "$S2==comment": { token: "comment" },
904
+ "@default": { token: "source" }
905
+ }
906
+ }
907
+ ]
908
+ ],
909
+ // <EXPRESSION_COMMENT> SKIP:
910
+ [e("expression_comment_token__id__")]: [
911
+ // < "-->" | "--]">
912
+ [
913
+ /--[>\]]/,
914
+ {
915
+ token: "comment",
916
+ next: "@pop"
917
+ }
918
+ ],
919
+ // < (~["-", ">", "]"])+ >
920
+ // < ">">
921
+ // < "]">
922
+ // < "-">
923
+ [/[^\->\]]+|[>\]\-]/, { token: "comment" }]
924
+ ],
925
+ [e("terse_comment_token__id__")]: [
926
+ // <TERSE_COMMENT_END : "-->" | "--]">
927
+ [o(/--(?:@close__id__)/), { token: "comment", next: "@popall" }],
928
+ // <KEEP_GOING : (~["<", "[", "-"])+>
929
+ // <LONE_LESS_THAN_OR_DASH : ["<", "[", "-"]>
930
+ [/[^<\[\-]+|[<\[\-]/, { token: "comment" }]
931
+ ]
932
+ }
933
+ };
934
+ }
935
+ function A(t) {
936
+ const n = i(a, t), _ = i(u, t), e = i(D, t);
937
+ return {
938
+ // Angle and bracket syntax mode
939
+ // We switch to one of these once we have determined the mode
940
+ ...n,
941
+ ..._,
942
+ ...e,
943
+ // Settings
944
+ unicode: !0,
945
+ includeLF: !1,
946
+ start: `default_auto_${t.id}`,
947
+ ignoreCase: !1,
948
+ defaultToken: "invalid",
949
+ tokenPostfix: ".freemarker2",
950
+ brackets: [
951
+ { open: "{", close: "}", token: "delimiter.curly" },
952
+ { open: "[", close: "]", token: "delimiter.square" },
953
+ { open: "(", close: ")", token: "delimiter.parenthesis" },
954
+ { open: "<", close: ">", token: "delimiter.angle" }
955
+ ],
956
+ tokenizer: {
957
+ ...n.tokenizer,
958
+ ..._.tokenizer,
959
+ ...e.tokenizer
960
+ }
961
+ };
962
+ }
963
+ var C = {
964
+ conf: l(a),
965
+ language: i(a, k)
966
+ }, w = {
967
+ conf: l(u),
968
+ language: i(u, k)
969
+ }, T = {
970
+ conf: l(a),
971
+ language: i(a, p)
972
+ }, h = {
973
+ conf: l(u),
974
+ language: i(u, p)
975
+ }, S = {
976
+ conf: g(),
977
+ language: A(k)
978
+ }, P = {
979
+ conf: g(),
980
+ language: A(p)
981
+ };
982
+ export {
983
+ T as TagAngleInterpolationBracket,
984
+ C as TagAngleInterpolationDollar,
985
+ P as TagAutoInterpolationBracket,
986
+ S as TagAutoInterpolationDollar,
987
+ h as TagBracketInterpolationBracket,
988
+ w as TagBracketInterpolationDollar
989
+ };