sun-form-v3 1.0.74 → 1.0.76

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. package/dist/css.worker-Dwc4fr67.js +11 -0
  2. package/dist/editor.worker-D8X-wirG.js +11 -0
  3. package/dist/html.worker-BrYAwuEC.js +11 -0
  4. package/dist/{index-CiOfmn33.js → index-DFhw3AXw.js} +38774 -67074
  5. package/dist/{javascript-Z0cEzpmH.js → javascript-Cg8yvIbj.js} +1 -1
  6. package/dist/json.worker-CrHwZjY-.js +11 -0
  7. package/dist/style.css +1 -1
  8. package/dist/sun-form-v3.es.js +1 -1
  9. package/dist/sun-form-v3.umd.js +220 -1394
  10. package/dist/ts.worker-yDFI3o-d.js +11 -0
  11. package/dist/{tsMode-DzIar2vL.js → tsMode-DC3WlIAp.js} +1 -1
  12. package/dist/{typescript-DF0dUYS_.js → typescript-qB7JvgzD.js} +1 -1
  13. package/package.json +3 -1
  14. package/dist/abap-DfvySaIJ.js +0 -1404
  15. package/dist/apex-B__0irD3.js +0 -332
  16. package/dist/azcli-CDMGhRmx.js +0 -74
  17. package/dist/bat-0Mk8aqzx.js +0 -106
  18. package/dist/bicep-BBi_I06Z.js +0 -108
  19. package/dist/cameligo-D0G_Zm6X.js +0 -180
  20. package/dist/clojure-o2ZKLeMp.js +0 -767
  21. package/dist/coffee-DOQff5VC.js +0 -238
  22. package/dist/cpp-CQGJnWhD.js +0 -395
  23. package/dist/csharp-C1jLsHl8.js +0 -332
  24. package/dist/csp-C_ttMQaW.js +0 -59
  25. package/dist/css-BC202kVV.js +0 -193
  26. package/dist/cssMode-CYSIZcJF.js +0 -1541
  27. package/dist/cypher-DwtEH7Fi.js +0 -269
  28. package/dist/dart-D9XknsP2.js +0 -287
  29. package/dist/dockerfile-DgsNjqqa.js +0 -136
  30. package/dist/ecl-BAMCHBl6.js +0 -462
  31. package/dist/elixir-CegIttP8.js +0 -575
  32. package/dist/flow9-9608t7UV.js +0 -148
  33. package/dist/freemarker2-DELGq5a7.js +0 -995
  34. package/dist/fsharp-CCtt9-1_.js +0 -223
  35. package/dist/go-CGUIPbct.js +0 -224
  36. package/dist/graphql-BNRIFFIn.js +0 -157
  37. package/dist/handlebars-Cycz5sVT.js +0 -425
  38. package/dist/hcl-C__KLIXe.js +0 -189
  39. package/dist/html-pEgLIMYL.js +0 -314
  40. package/dist/htmlMode-wBX2qW_D.js +0 -1551
  41. package/dist/ini-CeKYn_zA.js +0 -77
  42. package/dist/java-Dm24deQl.js +0 -238
  43. package/dist/jsonMode-DOH1aqKa.js +0 -1957
  44. package/dist/julia-BImNW7VE.js +0 -517
  45. package/dist/kotlin-BfE79GEb.js +0 -259
  46. package/dist/less-DglNOcaC.js +0 -168
  47. package/dist/lexon-BA0dRz9Q.js +0 -163
  48. package/dist/liquid-DWwdGb03.js +0 -246
  49. package/dist/lua-DMkWzJcm.js +0 -168
  50. package/dist/m3-sA-5shO8.js +0 -216
  51. package/dist/markdown-OYRB1igA.js +0 -235
  52. package/dist/mdx-Of9EufjP.js +0 -171
  53. package/dist/mips-rRzkJ_7G.js +0 -204
  54. package/dist/msdax-DoVJdUhd.js +0 -381
  55. package/dist/mysql-Ty44IHXo.js +0 -884
  56. package/dist/objective-c-VUfyhYrA.js +0 -189
  57. package/dist/pascal-DkASiYyw.js +0 -257
  58. package/dist/pascaligo-p-ELPlVO.js +0 -170
  59. package/dist/perl-Cjl1FxLZ.js +0 -632
  60. package/dist/pgsql-DjVenF7s.js +0 -857
  61. package/dist/php-CwvGzZOO.js +0 -506
  62. package/dist/pla-Br1iaBIV.js +0 -143
  63. package/dist/postiats-BaeP8zZY.js +0 -913
  64. package/dist/powerquery-CLCshuo8.js +0 -896
  65. package/dist/powershell-CZV50w5N.js +0 -245
  66. package/dist/protobuf-MV3XTewJ.js +0 -426
  67. package/dist/pug-DkDg4c4l.js +0 -408
  68. package/dist/python-CaZLJpKQ.js +0 -282
  69. package/dist/qsharp-BAtiKA97.js +0 -291
  70. package/dist/r-8ocrd-h-.js +0 -249
  71. package/dist/razor-Dz07fRRv.js +0 -556
  72. package/dist/redis-9sZiddxc.js +0 -308
  73. package/dist/redshift-DQfTOGC0.js +0 -815
  74. package/dist/restructuredtext-DXU-vkgr.js +0 -180
  75. package/dist/ruby-DotfqwMf.js +0 -517
  76. package/dist/rust-BIauJ5KN.js +0 -349
  77. package/dist/sb-CmWMvDEV.js +0 -121
  78. package/dist/scala-C81brEbk.js +0 -376
  79. package/dist/scheme-D0pcFz2x.js +0 -114
  80. package/dist/scss-BOdN2fGG.js +0 -268
  81. package/dist/shell-6E09eAkU.js +0 -227
  82. package/dist/solidity-CWStzA1K.js +0 -1373
  83. package/dist/sophia-76Sb6CWe.js +0 -205
  84. package/dist/sparql-BmZTkOWT.js +0 -207
  85. package/dist/sql-Cs9TBAW5.js +0 -859
  86. package/dist/st-B-rqE1Bu.js +0 -422
  87. package/dist/swift-Btsj6YxQ.js +0 -318
  88. package/dist/systemverilog-B3RHBRa2.js +0 -582
  89. package/dist/tcl-Dpj776pn.js +0 -238
  90. package/dist/twig-Bb9JmBsE.js +0 -398
  91. package/dist/typespec-CDWeg3SU.js +0 -123
  92. package/dist/vb-DEXnYwEI.js +0 -378
  93. package/dist/wgsl-D602c1lx.js +0 -445
  94. package/dist/xml-D6-A-jMv.js +0 -101
  95. package/dist/yaml-OnbiU7Fq.js +0 -212
@@ -1,995 +0,0 @@
1
- import { m as f } from "./index-CiOfmn33.js";
2
- /*!-----------------------------------------------------------------------------
3
- * Copyright (c) Microsoft Corporation. All rights reserved.
4
- * Version: 0.49.0(383fdf3fc0e1e1a024068b8d0fd4f3dcbae74d04)
5
- * Released under the MIT license
6
- * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
7
- *-----------------------------------------------------------------------------*/
8
- var F = Object.defineProperty, b = Object.getOwnPropertyDescriptor, x = Object.getOwnPropertyNames, $ = Object.prototype.hasOwnProperty, v = (t, n, _, e) => {
9
- if (n && typeof n == "object" || typeof n == "function")
10
- for (let o of x(n))
11
- !$.call(t, o) && o !== _ && F(t, o, { get: () => n[o], enumerable: !(e = b(n, o)) || e.enumerable });
12
- return t;
13
- }, E = (t, n, _) => (v(t, n, "default"), _), r = {};
14
- E(r, f);
15
- var d = [
16
- "assign",
17
- "flush",
18
- "ftl",
19
- "return",
20
- "global",
21
- "import",
22
- "include",
23
- "break",
24
- "continue",
25
- "local",
26
- "nested",
27
- "nt",
28
- "setting",
29
- "stop",
30
- "t",
31
- "lt",
32
- "rt",
33
- "fallback"
34
- ], s = [
35
- "attempt",
36
- "autoesc",
37
- "autoEsc",
38
- "compress",
39
- "comment",
40
- "escape",
41
- "noescape",
42
- "function",
43
- "if",
44
- "list",
45
- "items",
46
- "sep",
47
- "macro",
48
- "noparse",
49
- "noParse",
50
- "noautoesc",
51
- "noAutoEsc",
52
- "outputformat",
53
- "switch",
54
- "visit",
55
- "recurse"
56
- ], a = {
57
- close: ">",
58
- id: "angle",
59
- open: "<"
60
- }, u = {
61
- close: "\\]",
62
- id: "bracket",
63
- open: "\\["
64
- }, D = {
65
- close: "[>\\]]",
66
- id: "auto",
67
- open: "[<\\[]"
68
- }, k = {
69
- close: "\\}",
70
- id: "dollar",
71
- open1: "\\$",
72
- open2: "\\{"
73
- }, p = {
74
- close: "\\]",
75
- id: "bracket",
76
- open1: "\\[",
77
- open2: "="
78
- };
79
- function l(t) {
80
- return {
81
- brackets: [
82
- ["<", ">"],
83
- ["[", "]"],
84
- ["(", ")"],
85
- ["{", "}"]
86
- ],
87
- comments: {
88
- blockComment: [`${t.open}--`, `--${t.close}`]
89
- },
90
- autoCloseBefore: `
91
- \r }]),.:;=`,
92
- autoClosingPairs: [
93
- { open: "{", close: "}" },
94
- { open: "[", close: "]" },
95
- { open: "(", close: ")" },
96
- { open: '"', close: '"', notIn: ["string"] },
97
- { open: "'", close: "'", notIn: ["string"] }
98
- ],
99
- surroundingPairs: [
100
- { open: '"', close: '"' },
101
- { open: "'", close: "'" },
102
- { open: "{", close: "}" },
103
- { open: "[", close: "]" },
104
- { open: "(", close: ")" },
105
- { open: "<", close: ">" }
106
- ],
107
- folding: {
108
- markers: {
109
- start: new RegExp(
110
- `${t.open}#(?:${s.join("|")})([^/${t.close}]*(?!/)${t.close})[^${t.open}]*$`
111
- ),
112
- end: new RegExp(`${t.open}/#(?:${s.join("|")})[\\r\\n\\t ]*>`)
113
- }
114
- },
115
- onEnterRules: [
116
- {
117
- beforeText: new RegExp(
118
- `${t.open}#(?!(?:${d.join("|")}))([a-zA-Z_]+)([^/${t.close}]*(?!/)${t.close})[^${t.open}]*$`
119
- ),
120
- afterText: new RegExp(`^${t.open}/#([a-zA-Z_]+)[\\r\\n\\t ]*${t.close}$`),
121
- action: {
122
- indentAction: r.languages.IndentAction.IndentOutdent
123
- }
124
- },
125
- {
126
- beforeText: new RegExp(
127
- `${t.open}#(?!(?:${d.join("|")}))([a-zA-Z_]+)([^/${t.close}]*(?!/)${t.close})[^${t.open}]*$`
128
- ),
129
- action: { indentAction: r.languages.IndentAction.Indent }
130
- }
131
- ]
132
- };
133
- }
134
- function g() {
135
- return {
136
- // Cannot set block comment delimiter in auto mode...
137
- // It depends on the content and the cursor position of the file...
138
- brackets: [
139
- ["<", ">"],
140
- ["[", "]"],
141
- ["(", ")"],
142
- ["{", "}"]
143
- ],
144
- autoCloseBefore: `
145
- \r }]),.:;=`,
146
- autoClosingPairs: [
147
- { open: "{", close: "}" },
148
- { open: "[", close: "]" },
149
- { open: "(", close: ")" },
150
- { open: '"', close: '"', notIn: ["string"] },
151
- { open: "'", close: "'", notIn: ["string"] }
152
- ],
153
- surroundingPairs: [
154
- { open: '"', close: '"' },
155
- { open: "'", close: "'" },
156
- { open: "{", close: "}" },
157
- { open: "[", close: "]" },
158
- { open: "(", close: ")" },
159
- { open: "<", close: ">" }
160
- ],
161
- folding: {
162
- markers: {
163
- start: new RegExp(`[<\\[]#(?:${s.join("|")})([^/>\\]]*(?!/)[>\\]])[^<\\[]*$`),
164
- end: new RegExp(`[<\\[]/#(?:${s.join("|")})[\\r\\n\\t ]*>`)
165
- }
166
- },
167
- onEnterRules: [
168
- {
169
- beforeText: new RegExp(
170
- `[<\\[]#(?!(?:${d.join("|")}))([a-zA-Z_]+)([^/>\\]]*(?!/)[>\\]])[^[<\\[]]*$`
171
- ),
172
- afterText: new RegExp("^[<\\[]/#([a-zA-Z_]+)[\\r\\n\\t ]*[>\\]]$"),
173
- action: {
174
- indentAction: r.languages.IndentAction.IndentOutdent
175
- }
176
- },
177
- {
178
- beforeText: new RegExp(
179
- `[<\\[]#(?!(?:${d.join("|")}))([a-zA-Z_]+)([^/>\\]]*(?!/)[>\\]])[^[<\\[]]*$`
180
- ),
181
- action: { indentAction: r.languages.IndentAction.Indent }
182
- }
183
- ]
184
- };
185
- }
186
- function i(t, n) {
187
- const _ = `_${t.id}_${n.id}`, e = (c) => c.replace(/__id__/g, _), o = (c) => {
188
- const m = c.source.replace(/__id__/g, _);
189
- return new RegExp(m, c.flags);
190
- };
191
- return {
192
- // Settings
193
- unicode: !0,
194
- includeLF: !1,
195
- start: e("default__id__"),
196
- ignoreCase: !1,
197
- defaultToken: "invalid",
198
- tokenPostfix: ".freemarker2",
199
- brackets: [
200
- { open: "{", close: "}", token: "delimiter.curly" },
201
- { open: "[", close: "]", token: "delimiter.square" },
202
- { open: "(", close: ")", token: "delimiter.parenthesis" },
203
- { open: "<", close: ">", token: "delimiter.angle" }
204
- ],
205
- // Dynamic RegExp
206
- [e("open__id__")]: new RegExp(t.open),
207
- [e("close__id__")]: new RegExp(t.close),
208
- [e("iOpen1__id__")]: new RegExp(n.open1),
209
- [e("iOpen2__id__")]: new RegExp(n.open2),
210
- [e("iClose__id__")]: new RegExp(n.close),
211
- // <#START_TAG : "<" | "<#" | "[#">
212
- // <#END_TAG : "</" | "</#" | "[/#">
213
- [e("startTag__id__")]: o(/(@open__id__)(#)/),
214
- [e("endTag__id__")]: o(/(@open__id__)(\/#)/),
215
- [e("startOrEndTag__id__")]: o(/(@open__id__)(\/?#)/),
216
- // <#CLOSE_TAG1 : (<BLANK>)* (">" | "]")>
217
- [e("closeTag1__id__")]: o(/((?:@blank)*)(@close__id__)/),
218
- // <#CLOSE_TAG2 : (<BLANK>)* ("/")? (">" | "]")>
219
- [e("closeTag2__id__")]: o(/((?:@blank)*\/?)(@close__id__)/),
220
- // Static RegExp
221
- // <#BLANK : " " | "\t" | "\n" | "\r">
222
- blank: /[ \t\n\r]/,
223
- // <FALSE : "false">
224
- // <TRUE : "true">
225
- // <IN : "in">
226
- // <AS : "as">
227
- // <USING : "using">
228
- keywords: ["false", "true", "in", "as", "using"],
229
- // Directive names that cannot have an expression parameters and cannot be self-closing
230
- // E.g. <#if id==2> ... </#if>
231
- directiveStartCloseTag1: /attempt|recover|sep|auto[eE]sc|no(?:autoe|AutoE)sc|compress|default|no[eE]scape|comment|no[pP]arse/,
232
- // Directive names that cannot have an expression parameter and can be self-closing
233
- // E.g. <#if> ... <#else> ... </#if>
234
- // E.g. <#if> ... <#else /></#if>
235
- directiveStartCloseTag2: /else|break|continue|return|stop|flush|t|lt|rt|nt|nested|recurse|fallback|ftl/,
236
- // Directive names that can have an expression parameter and cannot be self-closing
237
- // E.g. <#if id==2> ... </#if>
238
- 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/,
239
- // Directive names that can have an end tag
240
- // E.g. </#if>
241
- 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/,
242
- // <#ESCAPED_CHAR :
243
- // "\\"
244
- // (
245
- // ("n" | "t" | "r" | "f" | "b" | "g" | "l" | "a" | "\\" | "'" | "\"" | "{" | "=")
246
- // |
247
- // ("x" ["0"-"9", "A"-"F", "a"-"f"])
248
- // )
249
- // >
250
- // Note: While the JavaCC tokenizer rule only specifies one hex digit,
251
- // FreeMarker actually interprets up to 4 hex digits.
252
- escapedChar: /\\(?:[ntrfbgla\\'"\{=]|(?:x[0-9A-Fa-f]{1,4}))/,
253
- // <#ASCII_DIGIT: ["0" - "9"]>
254
- asciiDigit: /[0-9]/,
255
- // <INTEGER : (["0"-"9"])+>
256
- integer: /[0-9]+/,
257
- // <#NON_ESCAPED_ID_START_CHAR:
258
- // [
259
- // // This was generated on JDK 1.8.0_20 Win64 with src/main/misc/identifierChars/IdentifierCharGenerator.java
260
- // ...
261
- // ]
262
- 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]/,
263
- // <#ESCAPED_ID_CHAR: "\\" ("-" | "." | ":" | "#")>
264
- escapedIdChar: /\\[\-\.:#]/,
265
- // <#ID_START_CHAR: <NON_ESCAPED_ID_START_CHAR>|<ESCAPED_ID_CHAR>>
266
- idStartChar: /(?:@nonEscapedIdStartChar)|(?:@escapedIdChar)/,
267
- // <ID: <ID_START_CHAR> (<ID_START_CHAR>|<ASCII_DIGIT>)*>
268
- id: /(?:@idStartChar)(?:(?:@idStartChar)|(?:@asciiDigit))*/,
269
- // Certain keywords / operators are allowed to index hashes
270
- //
271
- // Expression DotVariable(Expression exp) :
272
- // {
273
- // Token t;
274
- // }
275
- // {
276
- // <DOT>
277
- // (
278
- // t = <ID> | t = <TIMES> | t = <DOUBLE_STAR>
279
- // |
280
- // (
281
- // t = <LESS_THAN>
282
- // |
283
- // t = <LESS_THAN_EQUALS>
284
- // |
285
- // t = <ESCAPED_GT>
286
- // |
287
- // t = <ESCAPED_GTE>
288
- // |
289
- // t = <FALSE>
290
- // |
291
- // t = <TRUE>
292
- // |
293
- // t = <IN>
294
- // |
295
- // t = <AS>
296
- // |
297
- // t = <USING>
298
- // )
299
- // {
300
- // if (!Character.isLetter(t.image.charAt(0))) {
301
- // throw new ParseException(t.image + " is not a valid identifier.", template, t);
302
- // }
303
- // }
304
- // )
305
- // {
306
- // notListLiteral(exp, "hash");
307
- // notStringLiteral(exp, "hash");
308
- // notBooleanLiteral(exp, "hash");
309
- // Dot dot = new Dot(exp, t.image);
310
- // dot.setLocation(template, exp, t);
311
- // return dot;
312
- // }
313
- // }
314
- specialHashKeys: /\*\*|\*|false|true|in|as|using/,
315
- // <DOUBLE_EQUALS : "==">
316
- // <EQUALS : "=">
317
- // <NOT_EQUALS : "!=">
318
- // <PLUS_EQUALS : "+=">
319
- // <MINUS_EQUALS : "-=">
320
- // <TIMES_EQUALS : "*=">
321
- // <DIV_EQUALS : "/=">
322
- // <MOD_EQUALS : "%=">
323
- // <PLUS_PLUS : "++">
324
- // <MINUS_MINUS : "--">
325
- // <LESS_THAN_EQUALS : "lte" | "\\lte" | "<=" | "&lt;=">
326
- // <LESS_THAN : "lt" | "\\lt" | "<" | "&lt;">
327
- // <ESCAPED_GTE : "gte" | "\\gte" | "&gt;=">
328
- // <ESCAPED_GT: "gt" | "\\gt" | "&gt;">
329
- // <DOUBLE_STAR : "**">
330
- // <PLUS : "+">
331
- // <MINUS : "-">
332
- // <TIMES : "*">
333
- // <PERCENT : "%">
334
- // <AND : "&" | "&&" | "&amp;&amp;" | "\\and" >
335
- // <OR : "|" | "||">
336
- // <EXCLAM : "!">
337
- // <COMMA : ",">
338
- // <SEMICOLON : ";">
339
- // <COLON : ":">
340
- // <ELLIPSIS : "...">
341
- // <DOT_DOT_ASTERISK : "..*" >
342
- // <DOT_DOT_LESS : "..<" | "..!" >
343
- // <DOT_DOT : "..">
344
- // <EXISTS : "??">
345
- // <BUILT_IN : "?">
346
- // <LAMBDA_ARROW : "->" | "-&gt;">
347
- namedSymbols: /&lt;=|&gt;=|\\lte|\\lt|&lt;|\\gte|\\gt|&gt;|&amp;&amp;|\\and|-&gt;|->|==|!=|\+=|-=|\*=|\/=|%=|\+\+|--|<=|&&|\|\||:|\.\.\.|\.\.\*|\.\.<|\.\.!|\?\?|=|<|\+|-|\*|\/|%|\||\.\.|\?|!|&|\.|,|;/,
348
- arrows: ["->", "-&gt;"],
349
- delimiters: [";", ":", ",", "."],
350
- stringOperators: ["lte", "lt", "gte", "gt"],
351
- noParseTags: ["noparse", "noParse", "comment"],
352
- tokenizer: {
353
- // Parser states
354
- // Plain text
355
- [e("default__id__")]: [
356
- { include: e("@directive_token__id__") },
357
- { include: e("@interpolation_and_text_token__id__") }
358
- ],
359
- // A FreeMarker expression inside a directive, e.g. <#if 2<3>
360
- [e("fmExpression__id__.directive")]: [
361
- { include: e("@blank_and_expression_comment_token__id__") },
362
- { include: e("@directive_end_token__id__") },
363
- { include: e("@expression_token__id__") }
364
- ],
365
- // A FreeMarker expression inside an interpolation, e.g. ${2+3}
366
- [e("fmExpression__id__.interpolation")]: [
367
- { include: e("@blank_and_expression_comment_token__id__") },
368
- { include: e("@expression_token__id__") },
369
- { include: e("@greater_operators_token__id__") }
370
- ],
371
- // In an expression and inside a not-yet closed parenthesis / bracket
372
- [e("inParen__id__.plain")]: [
373
- { include: e("@blank_and_expression_comment_token__id__") },
374
- { include: e("@directive_end_token__id__") },
375
- { include: e("@expression_token__id__") }
376
- ],
377
- [e("inParen__id__.gt")]: [
378
- { include: e("@blank_and_expression_comment_token__id__") },
379
- { include: e("@expression_token__id__") },
380
- { include: e("@greater_operators_token__id__") }
381
- ],
382
- // Expression for the unified call, e.g. <@createMacro() ... >
383
- [e("noSpaceExpression__id__")]: [
384
- { include: e("@no_space_expression_end_token__id__") },
385
- { include: e("@directive_end_token__id__") },
386
- { include: e("@expression_token__id__") }
387
- ],
388
- // For the function of a unified call. Special case for when the
389
- // expression is a simple identifier.
390
- // <@join [1,2] ",">
391
- // <@null!join [1,2] ",">
392
- [e("unifiedCall__id__")]: [{ include: e("@unified_call_token__id__") }],
393
- // For singly and doubly quoted string (that may contain interpolations)
394
- [e("singleString__id__")]: [{ include: e("@string_single_token__id__") }],
395
- [e("doubleString__id__")]: [{ include: e("@string_double_token__id__") }],
396
- // For singly and doubly quoted string (that may not contain interpolations)
397
- [e("rawSingleString__id__")]: [{ include: e("@string_single_raw_token__id__") }],
398
- [e("rawDoubleString__id__")]: [{ include: e("@string_double_raw_token__id__") }],
399
- // For a comment in an expression
400
- // ${ 1 + <#-- comment --> 2}
401
- [e("expressionComment__id__")]: [{ include: e("@expression_comment_token__id__") }],
402
- // For <#noparse> ... </#noparse>
403
- // For <#noParse> ... </#noParse>
404
- // For <#comment> ... </#comment>
405
- [e("noParse__id__")]: [{ include: e("@no_parse_token__id__") }],
406
- // For <#-- ... -->
407
- [e("terseComment__id__")]: [{ include: e("@terse_comment_token__id__") }],
408
- // Common rules
409
- [e("directive_token__id__")]: [
410
- // <ATTEMPT : <START_TAG> "attempt" <CLOSE_TAG1>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
411
- // <RECOVER : <START_TAG> "recover" <CLOSE_TAG1>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
412
- // <SEP : <START_TAG> "sep" <CLOSE_TAG1>>
413
- // <AUTOESC : <START_TAG> "auto" ("e"|"E") "sc" <CLOSE_TAG1>> {
414
- // handleTagSyntaxAndSwitch(matchedToken, getTagNamingConvention(matchedToken, 4), DEFAULT);
415
- // }
416
- // <NOAUTOESC : <START_TAG> "no" ("autoe"|"AutoE") "sc" <CLOSE_TAG1>> {
417
- // handleTagSyntaxAndSwitch(matchedToken, getTagNamingConvention(matchedToken, 2), DEFAULT);
418
- // }
419
- // <COMPRESS : <START_TAG> "compress" <CLOSE_TAG1>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
420
- // <DEFAUL : <START_TAG> "default" <CLOSE_TAG1>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
421
- // <NOESCAPE : <START_TAG> "no" ("e" | "E") "scape" <CLOSE_TAG1>> {
422
- // handleTagSyntaxAndSwitch(matchedToken, getTagNamingConvention(matchedToken, 2), DEFAULT);
423
- // }
424
- //
425
- // <COMMENT : <START_TAG> "comment" <CLOSE_TAG1>> {
426
- // handleTagSyntaxAndSwitch(matchedToken, NO_PARSE); noparseTag = "comment";
427
- // }
428
- // <NOPARSE: <START_TAG> "no" ("p" | "P") "arse" <CLOSE_TAG1>> {
429
- // int tagNamingConvention = getTagNamingConvention(matchedToken, 2);
430
- // handleTagSyntaxAndSwitch(matchedToken, tagNamingConvention, NO_PARSE);
431
- // noparseTag = tagNamingConvention == Configuration.CAMEL_CASE_NAMING_CONVENTION ? "noParse" : "noparse";
432
- // }
433
- [
434
- o(/(?:@startTag__id__)(@directiveStartCloseTag1)(?:@closeTag1__id__)/),
435
- t.id === "auto" ? {
436
- cases: {
437
- "$1==<": { token: "@rematch", switchTo: `@default_angle_${n.id}` },
438
- "$1==[": { token: "@rematch", switchTo: `@default_bracket_${n.id}` }
439
- }
440
- } : [
441
- { token: "@brackets.directive" },
442
- { token: "delimiter.directive" },
443
- {
444
- cases: {
445
- "@noParseTags": { token: "tag", next: e("@noParse__id__.$3") },
446
- "@default": { token: "tag" }
447
- }
448
- },
449
- { token: "delimiter.directive" },
450
- { token: "@brackets.directive" }
451
- ]
452
- ],
453
- // <ELSE : <START_TAG> "else" <CLOSE_TAG2>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
454
- // <BREAK : <START_TAG> "break" <CLOSE_TAG2>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
455
- // <CONTINUE : <START_TAG> "continue" <CLOSE_TAG2>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
456
- // <SIMPLE_RETURN : <START_TAG> "return" <CLOSE_TAG2>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
457
- // <HALT : <START_TAG> "stop" <CLOSE_TAG2>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
458
- // <FLUSH : <START_TAG> "flush" <CLOSE_TAG2>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
459
- // <TRIM : <START_TAG> "t" <CLOSE_TAG2>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
460
- // <LTRIM : <START_TAG> "lt" <CLOSE_TAG2>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
461
- // <RTRIM : <START_TAG> "rt" <CLOSE_TAG2>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
462
- // <NOTRIM : <START_TAG> "nt" <CLOSE_TAG2>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
463
- // <SIMPLE_NESTED : <START_TAG> "nested" <CLOSE_TAG2>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
464
- // <SIMPLE_RECURSE : <START_TAG> "recurse" <CLOSE_TAG2>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
465
- // <FALLBACK : <START_TAG> "fallback" <CLOSE_TAG2>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
466
- // <TRIVIAL_FTL_HEADER : ("<#ftl" | "[#ftl") ("/")? (">" | "]")> { ftlHeader(matchedToken); }
467
- [
468
- o(/(?:@startTag__id__)(@directiveStartCloseTag2)(?:@closeTag2__id__)/),
469
- t.id === "auto" ? {
470
- cases: {
471
- "$1==<": { token: "@rematch", switchTo: `@default_angle_${n.id}` },
472
- "$1==[": { token: "@rematch", switchTo: `@default_bracket_${n.id}` }
473
- }
474
- } : [
475
- { token: "@brackets.directive" },
476
- { token: "delimiter.directive" },
477
- { token: "tag" },
478
- { token: "delimiter.directive" },
479
- { token: "@brackets.directive" }
480
- ]
481
- ],
482
- // <IF : <START_TAG> "if" <BLANK>> { handleTagSyntaxAndSwitch(matchedToken, FM_EXPRESSION); }
483
- // <ELSE_IF : <START_TAG> "else" ("i" | "I") "f" <BLANK>> {
484
- // handleTagSyntaxAndSwitch(matchedToken, getTagNamingConvention(matchedToken, 4), FM_EXPRESSION);
485
- // }
486
- // <LIST : <START_TAG> "list" <BLANK>> { handleTagSyntaxAndSwitch(matchedToken, FM_EXPRESSION); }
487
- // <FOREACH : <START_TAG> "for" ("e" | "E") "ach" <BLANK>> {
488
- // handleTagSyntaxAndSwitch(matchedToken, getTagNamingConvention(matchedToken, 3), FM_EXPRESSION);
489
- // }
490
- // <SWITCH : <START_TAG> "switch" <BLANK>> { handleTagSyntaxAndSwitch(matchedToken, FM_EXPRESSION); }
491
- // <CASE : <START_TAG> "case" <BLANK>> { handleTagSyntaxAndSwitch(matchedToken, FM_EXPRESSION); }
492
- // <ASSIGN : <START_TAG> "assign" <BLANK>> { handleTagSyntaxAndSwitch(matchedToken, FM_EXPRESSION); }
493
- // <GLOBALASSIGN : <START_TAG> "global" <BLANK>> { handleTagSyntaxAndSwitch(matchedToken, FM_EXPRESSION); }
494
- // <LOCALASSIGN : <START_TAG> "local" <BLANK>> { handleTagSyntaxAndSwitch(matchedToken, FM_EXPRESSION); }
495
- // <_INCLUDE : <START_TAG> "include" <BLANK>> { handleTagSyntaxAndSwitch(matchedToken, FM_EXPRESSION); }
496
- // <IMPORT : <START_TAG> "import" <BLANK>> { handleTagSyntaxAndSwitch(matchedToken, FM_EXPRESSION); }
497
- // <FUNCTION : <START_TAG> "function" <BLANK>> { handleTagSyntaxAndSwitch(matchedToken, FM_EXPRESSION); }
498
- // <MACRO : <START_TAG> "macro" <BLANK>> { handleTagSyntaxAndSwitch(matchedToken, FM_EXPRESSION); }
499
- // <TRANSFORM : <START_TAG> "transform" <BLANK>> { handleTagSyntaxAndSwitch(matchedToken, FM_EXPRESSION); }
500
- // <VISIT : <START_TAG> "visit" <BLANK>> { handleTagSyntaxAndSwitch(matchedToken, FM_EXPRESSION); }
501
- // <STOP : <START_TAG> "stop" <BLANK>> { handleTagSyntaxAndSwitch(matchedToken, FM_EXPRESSION); }
502
- // <RETURN : <START_TAG> "return" <BLANK>> { handleTagSyntaxAndSwitch(matchedToken, FM_EXPRESSION); }
503
- // <CALL : <START_TAG> "call" <BLANK>> { handleTagSyntaxAndSwitch(matchedToken, FM_EXPRESSION); }
504
- // <SETTING : <START_TAG> "setting" <BLANK>> { handleTagSyntaxAndSwitch(matchedToken, FM_EXPRESSION); }
505
- // <OUTPUTFORMAT : <START_TAG> "output" ("f"|"F") "ormat" <BLANK>> {
506
- // handleTagSyntaxAndSwitch(matchedToken, getTagNamingConvention(matchedToken, 6), FM_EXPRESSION);
507
- // }
508
- // <NESTED : <START_TAG> "nested" <BLANK>> { handleTagSyntaxAndSwitch(matchedToken, FM_EXPRESSION); }
509
- // <RECURSE : <START_TAG> "recurse" <BLANK>> { handleTagSyntaxAndSwitch(matchedToken, FM_EXPRESSION); }
510
- // <ESCAPE : <START_TAG> "escape" <BLANK>> { handleTagSyntaxAndSwitch(matchedToken, FM_EXPRESSION); }
511
- //
512
- // Note: FreeMarker grammar appears to treat the FTL header as a special case,
513
- // in order to remove new lines after the header (?), but since we only need
514
- // to tokenize for highlighting, we can include this directive here.
515
- // <FTL_HEADER : ("<#ftl" | "[#ftl") <BLANK>> { ftlHeader(matchedToken); }
516
- //
517
- // Note: FreeMarker grammar appears to treat the items directive as a special case for
518
- // the AST parsing process, but since we only need to tokenize, we can include this
519
- // directive here.
520
- // <ITEMS : <START_TAG> "items" (<BLANK>)+ <AS> <BLANK>> { handleTagSyntaxAndSwitch(matchedToken, FM_EXPRESSION); }
521
- [
522
- o(/(?:@startTag__id__)(@directiveStartBlank)(@blank)/),
523
- t.id === "auto" ? {
524
- cases: {
525
- "$1==<": { token: "@rematch", switchTo: `@default_angle_${n.id}` },
526
- "$1==[": { token: "@rematch", switchTo: `@default_bracket_${n.id}` }
527
- }
528
- } : [
529
- { token: "@brackets.directive" },
530
- { token: "delimiter.directive" },
531
- { token: "tag" },
532
- { token: "", next: e("@fmExpression__id__.directive") }
533
- ]
534
- ],
535
- // <END_IF : <END_TAG> "if" <CLOSE_TAG1>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
536
- // <END_LIST : <END_TAG> "list" <CLOSE_TAG1>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
537
- // <END_SEP : <END_TAG> "sep" <CLOSE_TAG1>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
538
- // <END_RECOVER : <END_TAG> "recover" <CLOSE_TAG1>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
539
- // <END_ATTEMPT : <END_TAG> "attempt" <CLOSE_TAG1>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
540
- // <END_FOREACH : <END_TAG> "for" ("e" | "E") "ach" <CLOSE_TAG1>> {
541
- // handleTagSyntaxAndSwitch(matchedToken, getTagNamingConvention(matchedToken, 3), DEFAULT);
542
- // }
543
- // <END_LOCAL : <END_TAG> "local" <CLOSE_TAG1>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
544
- // <END_GLOBAL : <END_TAG> "global" <CLOSE_TAG1>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
545
- // <END_ASSIGN : <END_TAG> "assign" <CLOSE_TAG1>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
546
- // <END_FUNCTION : <END_TAG> "function" <CLOSE_TAG1>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
547
- // <END_MACRO : <END_TAG> "macro" <CLOSE_TAG1>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
548
- // <END_OUTPUTFORMAT : <END_TAG> "output" ("f" | "F") "ormat" <CLOSE_TAG1>> {
549
- // handleTagSyntaxAndSwitch(matchedToken, getTagNamingConvention(matchedToken, 6), DEFAULT);
550
- // }
551
- // <END_AUTOESC : <END_TAG> "auto" ("e" | "E") "sc" <CLOSE_TAG1>> {
552
- // handleTagSyntaxAndSwitch(matchedToken, getTagNamingConvention(matchedToken, 4), DEFAULT);
553
- // }
554
- // <END_NOAUTOESC : <END_TAG> "no" ("autoe"|"AutoE") "sc" <CLOSE_TAG1>> {
555
- // handleTagSyntaxAndSwitch(matchedToken, getTagNamingConvention(matchedToken, 2), DEFAULT);
556
- // }
557
- // <END_COMPRESS : <END_TAG> "compress" <CLOSE_TAG1>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
558
- // <END_TRANSFORM : <END_TAG> "transform" <CLOSE_TAG1>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
559
- // <END_SWITCH : <END_TAG> "switch" <CLOSE_TAG1>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
560
- // <END_ESCAPE : <END_TAG> "escape" <CLOSE_TAG1>> { handleTagSyntaxAndSwitch(matchedToken, DEFAULT); }
561
- // <END_NOESCAPE : <END_TAG> "no" ("e" | "E") "scape" <CLOSE_TAG1>> {
562
- // handleTagSyntaxAndSwitch(matchedToken, getTagNamingConvention(matchedToken, 2), DEFAULT);
563
- // }
564
- [
565
- o(/(?:@endTag__id__)(@directiveEndCloseTag1)(?:@closeTag1__id__)/),
566
- t.id === "auto" ? {
567
- cases: {
568
- "$1==<": { token: "@rematch", switchTo: `@default_angle_${n.id}` },
569
- "$1==[": { token: "@rematch", switchTo: `@default_bracket_${n.id}` }
570
- }
571
- } : [
572
- { token: "@brackets.directive" },
573
- { token: "delimiter.directive" },
574
- { token: "tag" },
575
- { token: "delimiter.directive" },
576
- { token: "@brackets.directive" }
577
- ]
578
- ],
579
- // <UNIFIED_CALL : "<@" | "[@" > { unifiedCall(matchedToken); }
580
- [
581
- o(/(@open__id__)(@)/),
582
- t.id === "auto" ? {
583
- cases: {
584
- "$1==<": { token: "@rematch", switchTo: `@default_angle_${n.id}` },
585
- "$1==[": { token: "@rematch", switchTo: `@default_bracket_${n.id}` }
586
- }
587
- } : [
588
- { token: "@brackets.directive" },
589
- { token: "delimiter.directive", next: e("@unifiedCall__id__") }
590
- ]
591
- ],
592
- // <UNIFIED_CALL_END : ("<" | "[") "/@" ((<ID>) ("."<ID>)*)? <CLOSE_TAG1>> { unifiedCallEnd(matchedToken); }
593
- [
594
- o(/(@open__id__)(\/@)((?:(?:@id)(?:\.(?:@id))*)?)(?:@closeTag1__id__)/),
595
- [
596
- { token: "@brackets.directive" },
597
- { token: "delimiter.directive" },
598
- { token: "tag" },
599
- { token: "delimiter.directive" },
600
- { token: "@brackets.directive" }
601
- ]
602
- ],
603
- // <TERSE_COMMENT : ("<" | "[") "#--" > { noparseTag = "-->"; handleTagSyntaxAndSwitch(matchedToken, NO_PARSE); }
604
- [
605
- o(/(@open__id__)#--/),
606
- t.id === "auto" ? {
607
- cases: {
608
- "$1==<": { token: "@rematch", switchTo: `@default_angle_${n.id}` },
609
- "$1==[": { token: "@rematch", switchTo: `@default_bracket_${n.id}` }
610
- }
611
- } : { token: "comment", next: e("@terseComment__id__") }
612
- ],
613
- // <UNKNOWN_DIRECTIVE : ("[#" | "[/#" | "<#" | "</#") (["a"-"z", "A"-"Z", "_"])+>
614
- [
615
- o(/(?:@startOrEndTag__id__)([a-zA-Z_]+)/),
616
- t.id === "auto" ? {
617
- cases: {
618
- "$1==<": { token: "@rematch", switchTo: `@default_angle_${n.id}` },
619
- "$1==[": { token: "@rematch", switchTo: `@default_bracket_${n.id}` }
620
- }
621
- } : [
622
- { token: "@brackets.directive" },
623
- { token: "delimiter.directive" },
624
- { token: "tag.invalid", next: e("@fmExpression__id__.directive") }
625
- ]
626
- ]
627
- ],
628
- // <DEFAULT, NO_DIRECTIVE> TOKEN :
629
- [e("interpolation_and_text_token__id__")]: [
630
- // <DOLLAR_INTERPOLATION_OPENING : "${"> { startInterpolation(matchedToken); }
631
- // <SQUARE_BRACKET_INTERPOLATION_OPENING : "[="> { startInterpolation(matchedToken); }
632
- [
633
- o(/(@iOpen1__id__)(@iOpen2__id__)/),
634
- [
635
- { token: n.id === "bracket" ? "@brackets.interpolation" : "delimiter.interpolation" },
636
- {
637
- token: n.id === "bracket" ? "delimiter.interpolation" : "@brackets.interpolation",
638
- next: e("@fmExpression__id__.interpolation")
639
- }
640
- ]
641
- ],
642
- // <STATIC_TEXT_FALSE_ALARM : "$" | "#" | "<" | "[" | "{"> // to handle a lone dollar sign or "<" or "# or <@ with whitespace after"
643
- // <STATIC_TEXT_WS : ("\n" | "\r" | "\t" | " ")+>
644
- // <STATIC_TEXT_NON_WS : (~["$", "<", "#", "[", "{", "\n", "\r", "\t", " "])+>
645
- [/[\$#<\[\{]|(?:@blank)+|[^\$<#\[\{\n\r\t ]+/, { token: "source" }]
646
- ],
647
- // <STRING_LITERAL :
648
- // (
649
- // "\""
650
- // ((~["\"", "\\"]) | <ESCAPED_CHAR>)*
651
- // "\""
652
- // )
653
- // |
654
- // (
655
- // "'"
656
- // ((~["'", "\\"]) | <ESCAPED_CHAR>)*
657
- // "'"
658
- // )
659
- // >
660
- [e("string_single_token__id__")]: [
661
- [/[^'\\]/, { token: "string" }],
662
- [/@escapedChar/, { token: "string.escape" }],
663
- [/'/, { token: "string", next: "@pop" }]
664
- ],
665
- [e("string_double_token__id__")]: [
666
- [/[^"\\]/, { token: "string" }],
667
- [/@escapedChar/, { token: "string.escape" }],
668
- [/"/, { token: "string", next: "@pop" }]
669
- ],
670
- // <RAW_STRING : "r" (("\"" (~["\""])* "\"") | ("'" (~["'"])* "'"))>
671
- [e("string_single_raw_token__id__")]: [
672
- [/[^']+/, { token: "string.raw" }],
673
- [/'/, { token: "string.raw", next: "@pop" }]
674
- ],
675
- [e("string_double_raw_token__id__")]: [
676
- [/[^"]+/, { token: "string.raw" }],
677
- [/"/, { token: "string.raw", next: "@pop" }]
678
- ],
679
- // <FM_EXPRESSION, IN_PAREN, NO_SPACE_EXPRESSION, NAMED_PARAMETER_EXPRESSION> TOKEN :
680
- [e("expression_token__id__")]: [
681
- // Strings
682
- [
683
- /(r?)(['"])/,
684
- {
685
- cases: {
686
- "r'": [
687
- { token: "keyword" },
688
- { token: "string.raw", next: e("@rawSingleString__id__") }
689
- ],
690
- 'r"': [
691
- { token: "keyword" },
692
- { token: "string.raw", next: e("@rawDoubleString__id__") }
693
- ],
694
- "'": [{ token: "source" }, { token: "string", next: e("@singleString__id__") }],
695
- '"': [{ token: "source" }, { token: "string", next: e("@doubleString__id__") }]
696
- }
697
- }
698
- ],
699
- // Numbers
700
- // <INTEGER : (["0"-"9"])+>
701
- // <DECIMAL : <INTEGER> "." <INTEGER>>
702
- [
703
- /(?:@integer)(?:\.(?:@integer))?/,
704
- {
705
- cases: {
706
- "(?:@integer)": { token: "number" },
707
- "@default": { token: "number.float" }
708
- }
709
- }
710
- ],
711
- // Special hash keys that must not be treated as identifiers
712
- // after a period, e.g. a.** is accessing the key "**" of a
713
- [
714
- /(\.)(@blank*)(@specialHashKeys)/,
715
- [{ token: "delimiter" }, { token: "" }, { token: "identifier" }]
716
- ],
717
- // Symbols / operators
718
- [
719
- /(?:@namedSymbols)/,
720
- {
721
- cases: {
722
- "@arrows": { token: "meta.arrow" },
723
- "@delimiters": { token: "delimiter" },
724
- "@default": { token: "operators" }
725
- }
726
- }
727
- ],
728
- // Identifiers
729
- [
730
- /@id/,
731
- {
732
- cases: {
733
- "@keywords": { token: "keyword.$0" },
734
- "@stringOperators": { token: "operators" },
735
- "@default": { token: "identifier" }
736
- }
737
- }
738
- ],
739
- // <OPEN_BRACKET : "[">
740
- // <CLOSE_BRACKET : "]">
741
- // <OPEN_PAREN : "(">
742
- // <CLOSE_PAREN : ")">
743
- // <OPENING_CURLY_BRACKET : "{">
744
- // <CLOSING_CURLY_BRACKET : "}">
745
- [
746
- /[\[\]\(\)\{\}]/,
747
- {
748
- cases: {
749
- "\\[": {
750
- cases: {
751
- "$S2==gt": { token: "@brackets", next: e("@inParen__id__.gt") },
752
- "@default": { token: "@brackets", next: e("@inParen__id__.plain") }
753
- }
754
- },
755
- "\\]": {
756
- cases: {
757
- ...n.id === "bracket" ? {
758
- "$S2==interpolation": { token: "@brackets.interpolation", next: "@popall" }
759
- } : {},
760
- // This cannot happen while in auto mode, since this applies only to an
761
- // fmExpression inside a directive. But once we encounter the start of a
762
- // directive, we can establish the tag syntax mode.
763
- ...t.id === "bracket" ? {
764
- "$S2==directive": { token: "@brackets.directive", next: "@popall" }
765
- } : {},
766
- // Ignore mismatched paren
767
- [e("$S1==inParen__id__")]: { token: "@brackets", next: "@pop" },
768
- "@default": { token: "@brackets" }
769
- }
770
- },
771
- "\\(": { token: "@brackets", next: e("@inParen__id__.gt") },
772
- "\\)": {
773
- cases: {
774
- [e("$S1==inParen__id__")]: { token: "@brackets", next: "@pop" },
775
- "@default": { token: "@brackets" }
776
- }
777
- },
778
- "\\{": {
779
- cases: {
780
- "$S2==gt": { token: "@brackets", next: e("@inParen__id__.gt") },
781
- "@default": { token: "@brackets", next: e("@inParen__id__.plain") }
782
- }
783
- },
784
- "\\}": {
785
- cases: {
786
- ...n.id === "bracket" ? {} : {
787
- "$S2==interpolation": { token: "@brackets.interpolation", next: "@popall" }
788
- },
789
- // Ignore mismatched paren
790
- [e("$S1==inParen__id__")]: { token: "@brackets", next: "@pop" },
791
- "@default": { token: "@brackets" }
792
- }
793
- }
794
- }
795
- }
796
- ],
797
- // <OPEN_MISPLACED_INTERPOLATION : "${" | "#{" | "[=">
798
- [/\$\{/, { token: "delimiter.invalid" }]
799
- ],
800
- // <FM_EXPRESSION, IN_PAREN, NAMED_PARAMETER_EXPRESSION> SKIP :
801
- [e("blank_and_expression_comment_token__id__")]: [
802
- // < ( " " | "\t" | "\n" | "\r" )+ >
803
- [/(?:@blank)+/, { token: "" }],
804
- // < ("<" | "[") ("#" | "!") "--"> : EXPRESSION_COMMENT
805
- [/[<\[][#!]--/, { token: "comment", next: e("@expressionComment__id__") }]
806
- ],
807
- // <FM_EXPRESSION, NO_SPACE_EXPRESSION, NAMED_PARAMETER_EXPRESSION> TOKEN :
808
- [e("directive_end_token__id__")]: [
809
- // <DIRECTIVE_END : ">">
810
- // {
811
- // if (inFTLHeader) {
812
- // eatNewline();
813
- // inFTLHeader = false;
814
- // }
815
- // if (squBracTagSyntax || postInterpolationLexState != -1 /* We are in an interpolation */) {
816
- // matchedToken.kind = NATURAL_GT;
817
- // } else {
818
- // SwitchTo(DEFAULT);
819
- // }
820
- // }
821
- // This cannot happen while in auto mode, since this applies only to an
822
- // fmExpression inside a directive. But once we encounter the start of a
823
- // directive, we can establish the tag syntax mode.
824
- [
825
- />/,
826
- t.id === "bracket" ? { token: "operators" } : { token: "@brackets.directive", next: "@popall" }
827
- ],
828
- // <EMPTY_DIRECTIVE_END : "/>" | "/]">
829
- // It is a syntax error to end a tag with the wrong close token
830
- // Let's indicate that to the user by not closing the tag
831
- [
832
- o(/(\/)(@close__id__)/),
833
- [{ token: "delimiter.directive" }, { token: "@brackets.directive", next: "@popall" }]
834
- ]
835
- ],
836
- // <IN_PAREN> TOKEN :
837
- [e("greater_operators_token__id__")]: [
838
- // <NATURAL_GT : ">">
839
- [/>/, { token: "operators" }],
840
- // <NATURAL_GTE : ">=">
841
- [/>=/, { token: "operators" }]
842
- ],
843
- // <NO_SPACE_EXPRESSION> TOKEN :
844
- [e("no_space_expression_end_token__id__")]: [
845
- // <TERMINATING_WHITESPACE : (["\n", "\r", "\t", " "])+> : FM_EXPRESSION
846
- [/(?:@blank)+/, { token: "", switchTo: e("@fmExpression__id__.directive") }]
847
- ],
848
- [e("unified_call_token__id__")]: [
849
- // Special case for a call where the expression is just an ID
850
- // <UNIFIED_CALL> <ID> <BLANK>+
851
- [
852
- /(@id)((?:@blank)+)/,
853
- [{ token: "tag" }, { token: "", next: e("@fmExpression__id__.directive") }]
854
- ],
855
- [
856
- o(/(@id)(\/?)(@close__id__)/),
857
- [
858
- { token: "tag" },
859
- { token: "delimiter.directive" },
860
- { token: "@brackets.directive", next: "@popall" }
861
- ]
862
- ],
863
- [/./, { token: "@rematch", next: e("@noSpaceExpression__id__") }]
864
- ],
865
- // <NO_PARSE> TOKEN :
866
- [e("no_parse_token__id__")]: [
867
- // <MAYBE_END :
868
- // ("<" | "[")
869
- // "/"
870
- // ("#")?
871
- // (["a"-"z", "A"-"Z"])+
872
- // ( " " | "\t" | "\n" | "\r" )*
873
- // (">" | "]")
874
- // >
875
- [
876
- o(/(@open__id__)(\/#?)([a-zA-Z]+)((?:@blank)*)(@close__id__)/),
877
- {
878
- cases: {
879
- "$S2==$3": [
880
- { token: "@brackets.directive" },
881
- { token: "delimiter.directive" },
882
- { token: "tag" },
883
- { token: "" },
884
- { token: "@brackets.directive", next: "@popall" }
885
- ],
886
- "$S2==comment": [
887
- { token: "comment" },
888
- { token: "comment" },
889
- { token: "comment" },
890
- { token: "comment" },
891
- { token: "comment" }
892
- ],
893
- "@default": [
894
- { token: "source" },
895
- { token: "source" },
896
- { token: "source" },
897
- { token: "source" },
898
- { token: "source" }
899
- ]
900
- }
901
- }
902
- ],
903
- // <KEEP_GOING : (~["<", "[", "-"])+>
904
- // <LONE_LESS_THAN_OR_DASH : ["<", "[", "-"]>
905
- [
906
- /[^<\[\-]+|[<\[\-]/,
907
- {
908
- cases: {
909
- "$S2==comment": { token: "comment" },
910
- "@default": { token: "source" }
911
- }
912
- }
913
- ]
914
- ],
915
- // <EXPRESSION_COMMENT> SKIP:
916
- [e("expression_comment_token__id__")]: [
917
- // < "-->" | "--]">
918
- [
919
- /--[>\]]/,
920
- {
921
- token: "comment",
922
- next: "@pop"
923
- }
924
- ],
925
- // < (~["-", ">", "]"])+ >
926
- // < ">">
927
- // < "]">
928
- // < "-">
929
- [/[^\->\]]+|[>\]\-]/, { token: "comment" }]
930
- ],
931
- [e("terse_comment_token__id__")]: [
932
- // <TERSE_COMMENT_END : "-->" | "--]">
933
- [o(/--(?:@close__id__)/), { token: "comment", next: "@popall" }],
934
- // <KEEP_GOING : (~["<", "[", "-"])+>
935
- // <LONE_LESS_THAN_OR_DASH : ["<", "[", "-"]>
936
- [/[^<\[\-]+|[<\[\-]/, { token: "comment" }]
937
- ]
938
- }
939
- };
940
- }
941
- function A(t) {
942
- const n = i(a, t), _ = i(u, t), e = i(D, t);
943
- return {
944
- // Angle and bracket syntax mode
945
- // We switch to one of these once we have determined the mode
946
- ...n,
947
- ..._,
948
- ...e,
949
- // Settings
950
- unicode: !0,
951
- includeLF: !1,
952
- start: `default_auto_${t.id}`,
953
- ignoreCase: !1,
954
- defaultToken: "invalid",
955
- tokenPostfix: ".freemarker2",
956
- brackets: [
957
- { open: "{", close: "}", token: "delimiter.curly" },
958
- { open: "[", close: "]", token: "delimiter.square" },
959
- { open: "(", close: ")", token: "delimiter.parenthesis" },
960
- { open: "<", close: ">", token: "delimiter.angle" }
961
- ],
962
- tokenizer: {
963
- ...n.tokenizer,
964
- ..._.tokenizer,
965
- ...e.tokenizer
966
- }
967
- };
968
- }
969
- var C = {
970
- conf: l(a),
971
- language: i(a, k)
972
- }, w = {
973
- conf: l(u),
974
- language: i(u, k)
975
- }, T = {
976
- conf: l(a),
977
- language: i(a, p)
978
- }, h = {
979
- conf: l(u),
980
- language: i(u, p)
981
- }, S = {
982
- conf: g(),
983
- language: A(k)
984
- }, P = {
985
- conf: g(),
986
- language: A(p)
987
- };
988
- export {
989
- T as TagAngleInterpolationBracket,
990
- C as TagAngleInterpolationDollar,
991
- P as TagAutoInterpolationBracket,
992
- S as TagAutoInterpolationDollar,
993
- h as TagBracketInterpolationBracket,
994
- w as TagBracketInterpolationDollar
995
- };