online-compiler-widget 0.0.4 → 1.0.3

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 (161) hide show
  1. package/dist/abap-CrvW7_qN.js +1398 -0
  2. package/dist/apex-BAOI8p1v.js +327 -0
  3. package/dist/assets/css.worker-Cb0JI69t.js +93 -0
  4. package/dist/assets/html.worker-BNFZMwEc.js +470 -0
  5. package/dist/assets/json.worker-BCybXpia.js +58 -0
  6. package/dist/assets/ts.worker-DAVh1bw1.js +67731 -0
  7. package/dist/azcli-BlCk_UqW.js +68 -0
  8. package/dist/bat-DPoEelVx.js +100 -0
  9. package/dist/bicep-Cp1F394l.js +102 -0
  10. package/dist/cameligo-CWqtSlQs.js +174 -0
  11. package/dist/clojure-CKBp32Gf.js +761 -0
  12. package/dist/coffee-CDo6vc-J.js +232 -0
  13. package/dist/cpp-DokufPgf.js +389 -0
  14. package/dist/csharp-BQi3szM0.js +326 -0
  15. package/dist/csp-BSGtCCZ-.js +53 -0
  16. package/dist/css-DEPFDJfb.js +187 -0
  17. package/dist/cssMode-nHrB9Mnr.js +141 -0
  18. package/dist/cypher-DAb1vOxS.js +263 -0
  19. package/dist/dart-C8p4jewR.js +281 -0
  20. package/dist/dockerfile-DP0iLFPN.js +130 -0
  21. package/dist/ecl-BDQHA6fi.js +456 -0
  22. package/dist/elixir-D4II6kDM.js +569 -0
  23. package/dist/flow9-StcnL-VB.js +142 -0
  24. package/dist/freemarker2-BoiXdkJM.js +982 -0
  25. package/dist/fsharp-DdUVp3EN.js +217 -0
  26. package/dist/go-D1-I258M.js +218 -0
  27. package/dist/graphql-DWkL3f8U.js +151 -0
  28. package/dist/handlebars-C7PJzkmo.js +412 -0
  29. package/dist/hcl-D_0MNifv.js +183 -0
  30. package/dist/html-D_xe_tUa.js +301 -0
  31. package/dist/htmlMode-Dk_luXu_.js +152 -0
  32. package/dist/index-Ds0EJmOd.js +129200 -0
  33. package/dist/index.js +14 -0
  34. package/dist/ini-C4I2-MT7.js +71 -0
  35. package/dist/java-OBvaP_SS.js +232 -0
  36. package/dist/javascript-CUK67ITD.js +70 -0
  37. package/dist/jsonMode-BIAYTpVF.js +569 -0
  38. package/dist/julia-BmDH8Kkf.js +511 -0
  39. package/dist/kotlin-Dhu5AGOD.js +252 -0
  40. package/dist/less-CzmjXREq.js +162 -0
  41. package/dist/lexon-CV2c4pN9.js +157 -0
  42. package/dist/liquid-Cgsk8EmK.js +233 -0
  43. package/dist/lspLanguageFeatures-HqO1l9Me.js +1458 -0
  44. package/dist/lua-CFY5U8qF.js +162 -0
  45. package/dist/m3-BL_AnZVh.js +210 -0
  46. package/dist/markdown-CWKQPXCv.js +229 -0
  47. package/dist/mdx-QboWmT4M.js +158 -0
  48. package/dist/mips-ButYmJ5E.js +198 -0
  49. package/dist/msdax-C3cnXqDh.js +375 -0
  50. package/dist/mysql-YlSHaf6G.js +878 -0
  51. package/dist/objective-c-Dwnlproe.js +183 -0
  52. package/dist/pascal-UzGbSWEN.js +251 -0
  53. package/dist/pascaligo-CslTgu68.js +164 -0
  54. package/dist/perl-oj6r_mgw.js +626 -0
  55. package/dist/pgsql-DSBO0Mev.js +851 -0
  56. package/dist/php-YzCD--7j.js +500 -0
  57. package/dist/pla-CmylB8vQ.js +137 -0
  58. package/dist/postiats-CLFW5gNY.js +907 -0
  59. package/dist/powerquery-CmOWUvlh.js +890 -0
  60. package/dist/powershell-fHQcmBLK.js +239 -0
  61. package/dist/protobuf-p5BArb-9.js +420 -0
  62. package/dist/pug-gVdUDvqf.js +402 -0
  63. package/dist/python-kIZaMFF7.js +294 -0
  64. package/dist/qsharp-DnrWSUlt.js +301 -0
  65. package/dist/r-Cv309K2z.js +243 -0
  66. package/dist/razor-ms2cCMGp.js +543 -0
  67. package/dist/redis-DTcS4wMj.js +302 -0
  68. package/dist/redshift-hLxZVESM.js +809 -0
  69. package/dist/restructuredtext-C898lK4f.js +174 -0
  70. package/dist/ruby-CgKtnJIQ.js +511 -0
  71. package/dist/rust-bj8oxVnh.js +343 -0
  72. package/dist/sb-DWynz26l.js +115 -0
  73. package/dist/scala-BL5z1UEd.js +370 -0
  74. package/dist/scheme-DUJsH6VU.js +108 -0
  75. package/dist/scss-CxjmhvaL.js +262 -0
  76. package/dist/shell-D14Zs1dF.js +221 -0
  77. package/dist/solidity-WyRm-BGK.js +1367 -0
  78. package/dist/sophia-CKk-_Oa5.js +199 -0
  79. package/dist/sparql-DHtmINMZ.js +201 -0
  80. package/dist/sql-Dqaj5JHC.js +853 -0
  81. package/dist/st-Bj2IIaop.js +416 -0
  82. package/dist/style.css +1 -0
  83. package/dist/swift-DwxP72iM.js +312 -0
  84. package/dist/systemverilog-D7wJfuql.js +576 -0
  85. package/dist/tcl-0ApMt-eC.js +232 -0
  86. package/dist/tsMode-BiXWAJYS.js +946 -0
  87. package/dist/twig-DxwbdmvQ.js +392 -0
  88. package/dist/typescript-ByMmjZ38.js +336 -0
  89. package/dist/typespec-Fd-JwSuS.js +117 -0
  90. package/dist/vb-CxuyYE1I.js +372 -0
  91. package/dist/wgsl-DoEGc31J.js +439 -0
  92. package/dist/xml-iOXTZgNN.js +88 -0
  93. package/dist/yaml-RRlyy-QW.js +199 -0
  94. package/package.json +41 -36
  95. package/FileStorage/obj/FileStorage.csproj.EntityFrameworkCore.targets +0 -28
  96. package/README.md +0 -1
  97. package/eslint.config.js +0 -26
  98. package/index.html +0 -13
  99. package/index.tsx +0 -3
  100. package/openapitools.json +0 -7
  101. package/pnpm-workspace.yaml +0 -2
  102. package/public/vite.svg +0 -1
  103. package/src/App.css +0 -49
  104. package/src/App.tsx +0 -84
  105. package/src/api/.openapi-generator/FILES +0 -25
  106. package/src/api/.openapi-generator/VERSION +0 -1
  107. package/src/api/.openapi-generator-ignore +0 -23
  108. package/src/api/api.ts +0 -1312
  109. package/src/api/base.ts +0 -62
  110. package/src/api/common.ts +0 -113
  111. package/src/api/configuration.ts +0 -121
  112. package/src/api/docs/CompilationError.md +0 -26
  113. package/src/api/docs/CompileRequest.md +0 -22
  114. package/src/api/docs/CompileResult.md +0 -28
  115. package/src/api/docs/CompilerApi.md +0 -263
  116. package/src/api/docs/CreateFileDto.md +0 -22
  117. package/src/api/docs/CreateProjectRequest.md +0 -20
  118. package/src/api/docs/FileApi.md +0 -274
  119. package/src/api/docs/ProcessStatus.md +0 -28
  120. package/src/api/docs/ProjectApi.md +0 -362
  121. package/src/api/docs/ProjectInfo.md +0 -24
  122. package/src/api/docs/ProjectStats.md +0 -28
  123. package/src/api/docs/RenameFileDto.md +0 -20
  124. package/src/api/docs/RenameProjectRequest.md +0 -20
  125. package/src/api/docs/RunRequest.md +0 -24
  126. package/src/api/docs/RunResult.md +0 -30
  127. package/src/api/docs/RunningProjectInfo.md +0 -26
  128. package/src/api/docs/UpdateFileDto.md +0 -20
  129. package/src/api/git_push.sh +0 -57
  130. package/src/api/index.ts +0 -18
  131. package/src/assets/Badge.svg +0 -17
  132. package/src/assets/closeIcon.svg +0 -20
  133. package/src/assets/documentIcon.svg +0 -11
  134. package/src/assets/history.svg +0 -11
  135. package/src/assets/output.svg +0 -12
  136. package/src/assets/plus.svg +0 -20
  137. package/src/assets/react.svg +0 -1
  138. package/src/assets/save-icon.svg +0 -11
  139. package/src/assets/shield.svg +0 -10
  140. package/src/assets/start.svg +0 -11
  141. package/src/assets/stop.svg +0 -11
  142. package/src/components/CompilerWidget.module.scss +0 -169
  143. package/src/components/CompilerWidget.tsx +0 -331
  144. package/src/components/FileExplorer.module.scss +0 -372
  145. package/src/components/FileExplorer.tsx +0 -285
  146. package/src/components/MonacoEditorWrapper.module.scss +0 -29
  147. package/src/components/MonacoEditorWrapper.tsx +0 -74
  148. package/src/components/OutputPanel.module.scss +0 -123
  149. package/src/components/OutputPanel.tsx +0 -53
  150. package/src/components/RunContainer.module.scss +0 -150
  151. package/src/components/RunContainer.tsx +0 -34
  152. package/src/hooks/useCompiler.ts +0 -228
  153. package/src/hooks/useInitialNodes.ts +0 -0
  154. package/src/index.css +0 -78
  155. package/src/main.tsx +0 -8
  156. package/src/types/EditorDocument.ts +0 -8
  157. package/swagger.json +0 -1020
  158. package/tsconfig.app.json +0 -29
  159. package/tsconfig.json +0 -7
  160. package/tsconfig.node.json +0 -26
  161. package/vite.config.ts +0 -8
@@ -0,0 +1,982 @@
1
+ import { l as c } from "./index-Ds0EJmOd.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
+ };