scala-57RWGZP5.js 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362
  1. import "./chunk-2LSFTFF7.js";
  2. // node_modules/.pnpm/monaco-editor@0.38.0/node_modules/monaco-editor/esm/vs/basic-languages/scala/scala.js
  3. var conf = {
  4. wordPattern: /(unary_[@~!#%^&*()\-=+\\|:<>\/?]+)|([a-zA-Z_$][\w$]*?_=)|(`[^`]+`)|([a-zA-Z_$][\w$]*)/g,
  5. comments: {
  6. lineComment: "//",
  7. blockComment: ["/*", "*/"]
  8. },
  9. brackets: [
  10. ["{", "}"],
  11. ["[", "]"],
  12. ["(", ")"]
  13. ],
  14. autoClosingPairs: [
  15. { open: "{", close: "}" },
  16. { open: "[", close: "]" },
  17. { open: "(", close: ")" },
  18. { open: '"', close: '"' },
  19. { open: "'", close: "'" }
  20. ],
  21. surroundingPairs: [
  22. { open: "{", close: "}" },
  23. { open: "[", close: "]" },
  24. { open: "(", close: ")" },
  25. { open: '"', close: '"' },
  26. { open: "'", close: "'" }
  27. ],
  28. folding: {
  29. markers: {
  30. start: new RegExp("^\\s*//\\s*(?:(?:#?region\\b)|(?:<editor-fold\\b))"),
  31. end: new RegExp("^\\s*//\\s*(?:(?:#?endregion\\b)|(?:</editor-fold>))")
  32. }
  33. }
  34. };
  35. var language = {
  36. tokenPostfix: ".scala",
  37. keywords: [
  38. "asInstanceOf",
  39. "catch",
  40. "class",
  41. "classOf",
  42. "def",
  43. "do",
  44. "else",
  45. "extends",
  46. "finally",
  47. "for",
  48. "foreach",
  49. "forSome",
  50. "if",
  51. "import",
  52. "isInstanceOf",
  53. "macro",
  54. "match",
  55. "new",
  56. "object",
  57. "package",
  58. "return",
  59. "throw",
  60. "trait",
  61. "try",
  62. "type",
  63. "until",
  64. "val",
  65. "var",
  66. "while",
  67. "with",
  68. "yield",
  69. "given",
  70. "enum",
  71. "then"
  72. ],
  73. softKeywords: ["as", "export", "extension", "end", "derives", "on"],
  74. constants: ["true", "false", "null", "this", "super"],
  75. modifiers: [
  76. "abstract",
  77. "final",
  78. "implicit",
  79. "lazy",
  80. "override",
  81. "private",
  82. "protected",
  83. "sealed"
  84. ],
  85. softModifiers: ["inline", "opaque", "open", "transparent", "using"],
  86. name: /(?:[a-z_$][\w$]*|`[^`]+`)/,
  87. type: /(?:[A-Z][\w$]*)/,
  88. symbols: /[=><!~?:&|+\-*\/^\\%@#]+/,
  89. digits: /\d+(_+\d+)*/,
  90. hexdigits: /[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/,
  91. escapes: /\\(?:[btnfr\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
  92. fstring_conv: /[bBhHsScCdoxXeEfgGaAt]|[Tn](?:[HIklMSLNpzZsQ]|[BbhAaCYyjmde]|[RTrDFC])/,
  93. tokenizer: {
  94. root: [
  95. [/\braw"""/, { token: "string.quote", bracket: "@open", next: "@rawstringt" }],
  96. [/\braw"/, { token: "string.quote", bracket: "@open", next: "@rawstring" }],
  97. [/\bs"""/, { token: "string.quote", bracket: "@open", next: "@sstringt" }],
  98. [/\bs"/, { token: "string.quote", bracket: "@open", next: "@sstring" }],
  99. [/\bf""""/, { token: "string.quote", bracket: "@open", next: "@fstringt" }],
  100. [/\bf"/, { token: "string.quote", bracket: "@open", next: "@fstring" }],
  101. [/"""/, { token: "string.quote", bracket: "@open", next: "@stringt" }],
  102. [/"/, { token: "string.quote", bracket: "@open", next: "@string" }],
  103. [/(@digits)[eE]([\-+]?(@digits))?[fFdD]?/, "number.float", "@allowMethod"],
  104. [/(@digits)\.(@digits)([eE][\-+]?(@digits))?[fFdD]?/, "number.float", "@allowMethod"],
  105. [/0[xX](@hexdigits)[Ll]?/, "number.hex", "@allowMethod"],
  106. [/(@digits)[fFdD]/, "number.float", "@allowMethod"],
  107. [/(@digits)[lL]?/, "number", "@allowMethod"],
  108. [/\b_\*/, "key"],
  109. [/\b(_)\b/, "keyword", "@allowMethod"],
  110. [/\bimport\b/, "keyword", "@import"],
  111. [/\b(case)([ \t]+)(class)\b/, ["keyword.modifier", "white", "keyword"]],
  112. [/\bcase\b/, "keyword", "@case"],
  113. [/\bva[lr]\b/, "keyword", "@vardef"],
  114. [
  115. /\b(def)([ \t]+)((?:unary_)?@symbols|@name(?:_=)|@name)/,
  116. ["keyword", "white", "identifier"]
  117. ],
  118. [/@name(?=[ \t]*:(?!:))/, "variable"],
  119. [/(\.)(@name|@symbols)/, ["operator", { token: "@rematch", next: "@allowMethod" }]],
  120. [/([{(])(\s*)(@name(?=\s*=>))/, ["@brackets", "white", "variable"]],
  121. [
  122. /@name/,
  123. {
  124. cases: {
  125. "@keywords": "keyword",
  126. "@softKeywords": "keyword",
  127. "@modifiers": "keyword.modifier",
  128. "@softModifiers": "keyword.modifier",
  129. "@constants": {
  130. token: "constant",
  131. next: "@allowMethod"
  132. },
  133. "@default": {
  134. token: "identifier",
  135. next: "@allowMethod"
  136. }
  137. }
  138. }
  139. ],
  140. [/@type/, "type", "@allowMethod"],
  141. { include: "@whitespace" },
  142. [/@[a-zA-Z_$][\w$]*(?:\.[a-zA-Z_$][\w$]*)*/, "annotation"],
  143. [/[{(]/, "@brackets"],
  144. [/[})]/, "@brackets", "@allowMethod"],
  145. [/\[/, "operator.square"],
  146. [/](?!\s*(?:va[rl]|def|type)\b)/, "operator.square", "@allowMethod"],
  147. [/]/, "operator.square"],
  148. [/([=-]>|<-|>:|<:|:>|<%)(?=[\s\w()[\]{},\."'`])/, "keyword"],
  149. [/@symbols/, "operator"],
  150. [/[;,\.]/, "delimiter"],
  151. [/'[a-zA-Z$][\w$]*(?!')/, "attribute.name"],
  152. [/'[^\\']'/, "string", "@allowMethod"],
  153. [/(')(@escapes)(')/, ["string", "string.escape", { token: "string", next: "@allowMethod" }]],
  154. [/'/, "string.invalid"]
  155. ],
  156. import: [
  157. [/;/, "delimiter", "@pop"],
  158. [/^|$/, "", "@pop"],
  159. [/[ \t]+/, "white"],
  160. [/[\n\r]+/, "white", "@pop"],
  161. [/\/\*/, "comment", "@comment"],
  162. [/@name|@type/, "type"],
  163. [/[(){}]/, "@brackets"],
  164. [/[[\]]/, "operator.square"],
  165. [/[\.,]/, "delimiter"]
  166. ],
  167. allowMethod: [
  168. [/^|$/, "", "@pop"],
  169. [/[ \t]+/, "white"],
  170. [/[\n\r]+/, "white", "@pop"],
  171. [/\/\*/, "comment", "@comment"],
  172. [/(?==>[\s\w([{])/, "keyword", "@pop"],
  173. [
  174. /(@name|@symbols)(?=[ \t]*[[({"'`]|[ \t]+(?:[+-]?\.?\d|\w))/,
  175. {
  176. cases: {
  177. "@keywords": { token: "keyword", next: "@pop" },
  178. "->|<-|>:|<:|<%": { token: "keyword", next: "@pop" },
  179. "@default": { token: "@rematch", next: "@pop" }
  180. }
  181. }
  182. ],
  183. ["", "", "@pop"]
  184. ],
  185. comment: [
  186. [/[^\/*]+/, "comment"],
  187. [/\/\*/, "comment", "@push"],
  188. [/\*\//, "comment", "@pop"],
  189. [/[\/*]/, "comment"]
  190. ],
  191. case: [
  192. [/\b_\*/, "key"],
  193. [/\b(_|true|false|null|this|super)\b/, "keyword", "@allowMethod"],
  194. [/\bif\b|=>/, "keyword", "@pop"],
  195. [/`[^`]+`/, "identifier", "@allowMethod"],
  196. [/@name/, "variable", "@allowMethod"],
  197. [/:::?|\||@(?![a-z_$])/, "keyword"],
  198. { include: "@root" }
  199. ],
  200. vardef: [
  201. [/\b_\*/, "key"],
  202. [/\b(_|true|false|null|this|super)\b/, "keyword"],
  203. [/@name/, "variable"],
  204. [/:::?|\||@(?![a-z_$])/, "keyword"],
  205. [/=|:(?!:)/, "operator", "@pop"],
  206. [/$/, "white", "@pop"],
  207. { include: "@root" }
  208. ],
  209. string: [
  210. [/[^\\"\n\r]+/, "string"],
  211. [/@escapes/, "string.escape"],
  212. [/\\./, "string.escape.invalid"],
  213. [
  214. /"/,
  215. {
  216. token: "string.quote",
  217. bracket: "@close",
  218. switchTo: "@allowMethod"
  219. }
  220. ]
  221. ],
  222. stringt: [
  223. [/[^\\"\n\r]+/, "string"],
  224. [/@escapes/, "string.escape"],
  225. [/\\./, "string.escape.invalid"],
  226. [/"(?=""")/, "string"],
  227. [
  228. /"""/,
  229. {
  230. token: "string.quote",
  231. bracket: "@close",
  232. switchTo: "@allowMethod"
  233. }
  234. ],
  235. [/"/, "string"]
  236. ],
  237. fstring: [
  238. [/@escapes/, "string.escape"],
  239. [
  240. /"/,
  241. {
  242. token: "string.quote",
  243. bracket: "@close",
  244. switchTo: "@allowMethod"
  245. }
  246. ],
  247. [/\$\$/, "string"],
  248. [/(\$)([a-z_]\w*)/, ["operator", "identifier"]],
  249. [/\$\{/, "operator", "@interp"],
  250. [/%%/, "string"],
  251. [
  252. /(%)([\-#+ 0,(])(\d+|\.\d+|\d+\.\d+)(@fstring_conv)/,
  253. ["metatag", "keyword.modifier", "number", "metatag"]
  254. ],
  255. [/(%)(\d+|\.\d+|\d+\.\d+)(@fstring_conv)/, ["metatag", "number", "metatag"]],
  256. [/(%)([\-#+ 0,(])(@fstring_conv)/, ["metatag", "keyword.modifier", "metatag"]],
  257. [/(%)(@fstring_conv)/, ["metatag", "metatag"]],
  258. [/./, "string"]
  259. ],
  260. fstringt: [
  261. [/@escapes/, "string.escape"],
  262. [/"(?=""")/, "string"],
  263. [
  264. /"""/,
  265. {
  266. token: "string.quote",
  267. bracket: "@close",
  268. switchTo: "@allowMethod"
  269. }
  270. ],
  271. [/\$\$/, "string"],
  272. [/(\$)([a-z_]\w*)/, ["operator", "identifier"]],
  273. [/\$\{/, "operator", "@interp"],
  274. [/%%/, "string"],
  275. [
  276. /(%)([\-#+ 0,(])(\d+|\.\d+|\d+\.\d+)(@fstring_conv)/,
  277. ["metatag", "keyword.modifier", "number", "metatag"]
  278. ],
  279. [/(%)(\d+|\.\d+|\d+\.\d+)(@fstring_conv)/, ["metatag", "number", "metatag"]],
  280. [/(%)([\-#+ 0,(])(@fstring_conv)/, ["metatag", "keyword.modifier", "metatag"]],
  281. [/(%)(@fstring_conv)/, ["metatag", "metatag"]],
  282. [/./, "string"]
  283. ],
  284. sstring: [
  285. [/@escapes/, "string.escape"],
  286. [
  287. /"/,
  288. {
  289. token: "string.quote",
  290. bracket: "@close",
  291. switchTo: "@allowMethod"
  292. }
  293. ],
  294. [/\$\$/, "string"],
  295. [/(\$)([a-z_]\w*)/, ["operator", "identifier"]],
  296. [/\$\{/, "operator", "@interp"],
  297. [/./, "string"]
  298. ],
  299. sstringt: [
  300. [/@escapes/, "string.escape"],
  301. [/"(?=""")/, "string"],
  302. [
  303. /"""/,
  304. {
  305. token: "string.quote",
  306. bracket: "@close",
  307. switchTo: "@allowMethod"
  308. }
  309. ],
  310. [/\$\$/, "string"],
  311. [/(\$)([a-z_]\w*)/, ["operator", "identifier"]],
  312. [/\$\{/, "operator", "@interp"],
  313. [/./, "string"]
  314. ],
  315. interp: [[/{/, "operator", "@push"], [/}/, "operator", "@pop"], { include: "@root" }],
  316. rawstring: [
  317. [/[^"]/, "string"],
  318. [
  319. /"/,
  320. {
  321. token: "string.quote",
  322. bracket: "@close",
  323. switchTo: "@allowMethod"
  324. }
  325. ]
  326. ],
  327. rawstringt: [
  328. [/[^"]/, "string"],
  329. [/"(?=""")/, "string"],
  330. [
  331. /"""/,
  332. {
  333. token: "string.quote",
  334. bracket: "@close",
  335. switchTo: "@allowMethod"
  336. }
  337. ],
  338. [/"/, "string"]
  339. ],
  340. whitespace: [
  341. [/[ \t\r\n]+/, "white"],
  342. [/\/\*/, "comment", "@comment"],
  343. [/\/\/.*$/, "comment"]
  344. ]
  345. }
  346. };
  347. export {
  348. conf,
  349. language
  350. };
  351. /*! Bundled license information:
  352. monaco-editor/esm/vs/basic-languages/scala/scala.js:
  353. (*!-----------------------------------------------------------------------------
  354. * Copyright (c) Microsoft Corporation. All rights reserved.
  355. * Version: 0.38.0(0e330ae453813de4e6cf272460fb79c7117073d0)
  356. * Released under the MIT license
  357. * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
  358. *-----------------------------------------------------------------------------*)
  359. */
  360. //# sourceMappingURL=scala-57RWGZP5.js.map