@kong-ui-public/monaco-editor 0.3.0 → 0.3.1-pr.2622.ca1f578c8.0

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