clojure.js 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782
  1. "use strict";
  2. /*!-----------------------------------------------------------------------------
  3. * Copyright (c) Microsoft Corporation. All rights reserved.
  4. * Version: 0.38.0(0e330ae453813de4e6cf272460fb79c7117073d0)
  5. * Released under the MIT license
  6. * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
  7. *-----------------------------------------------------------------------------*/
  8. define("vs/basic-languages/clojure/clojure", ["require"],(require)=>{
  9. var moduleExports = (() => {
  10. var __defProp = Object.defineProperty;
  11. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  12. var __getOwnPropNames = Object.getOwnPropertyNames;
  13. var __hasOwnProp = Object.prototype.hasOwnProperty;
  14. var __export = (target, all) => {
  15. for (var name in all)
  16. __defProp(target, name, { get: all[name], enumerable: true });
  17. };
  18. var __copyProps = (to, from, except, desc) => {
  19. if (from && typeof from === "object" || typeof from === "function") {
  20. for (let key of __getOwnPropNames(from))
  21. if (!__hasOwnProp.call(to, key) && key !== except)
  22. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  23. }
  24. return to;
  25. };
  26. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  27. // src/basic-languages/clojure/clojure.ts
  28. var clojure_exports = {};
  29. __export(clojure_exports, {
  30. conf: () => conf,
  31. language: () => language
  32. });
  33. var conf = {
  34. comments: {
  35. lineComment: ";;"
  36. },
  37. brackets: [
  38. ["[", "]"],
  39. ["(", ")"],
  40. ["{", "}"]
  41. ],
  42. autoClosingPairs: [
  43. { open: "[", close: "]" },
  44. { open: '"', close: '"' },
  45. { open: "(", close: ")" },
  46. { open: "{", close: "}" }
  47. ],
  48. surroundingPairs: [
  49. { open: "[", close: "]" },
  50. { open: '"', close: '"' },
  51. { open: "(", close: ")" },
  52. { open: "{", close: "}" }
  53. ]
  54. };
  55. var language = {
  56. defaultToken: "",
  57. ignoreCase: true,
  58. tokenPostfix: ".clj",
  59. brackets: [
  60. { open: "[", close: "]", token: "delimiter.square" },
  61. { open: "(", close: ")", token: "delimiter.parenthesis" },
  62. { open: "{", close: "}", token: "delimiter.curly" }
  63. ],
  64. constants: ["true", "false", "nil"],
  65. numbers: /^(?:[+\-]?\d+(?:(?:N|(?:[eE][+\-]?\d+))|(?:\.?\d*(?:M|(?:[eE][+\-]?\d+))?)|\/\d+|[xX][0-9a-fA-F]+|r[0-9a-zA-Z]+)?(?=[\\\[\]\s"#'(),;@^`{}~]|$))/,
  66. characters: /^(?:\\(?:backspace|formfeed|newline|return|space|tab|o[0-7]{3}|u[0-9A-Fa-f]{4}|x[0-9A-Fa-f]{4}|.)?(?=[\\\[\]\s"(),;@^`{}~]|$))/,
  67. escapes: /^\\(?:["'\\bfnrt]|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
  68. qualifiedSymbols: /^(?:(?:[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*(?:\.[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*)*\/)?(?:\/|[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*)*(?=[\\\[\]\s"(),;@^`{}~]|$))/,
  69. specialForms: [
  70. ".",
  71. "catch",
  72. "def",
  73. "do",
  74. "if",
  75. "monitor-enter",
  76. "monitor-exit",
  77. "new",
  78. "quote",
  79. "recur",
  80. "set!",
  81. "throw",
  82. "try",
  83. "var"
  84. ],
  85. coreSymbols: [
  86. "*",
  87. "*'",
  88. "*1",
  89. "*2",
  90. "*3",
  91. "*agent*",
  92. "*allow-unresolved-vars*",
  93. "*assert*",
  94. "*clojure-version*",
  95. "*command-line-args*",
  96. "*compile-files*",
  97. "*compile-path*",
  98. "*compiler-options*",
  99. "*data-readers*",
  100. "*default-data-reader-fn*",
  101. "*e",
  102. "*err*",
  103. "*file*",
  104. "*flush-on-newline*",
  105. "*fn-loader*",
  106. "*in*",
  107. "*math-context*",
  108. "*ns*",
  109. "*out*",
  110. "*print-dup*",
  111. "*print-length*",
  112. "*print-level*",
  113. "*print-meta*",
  114. "*print-namespace-maps*",
  115. "*print-readably*",
  116. "*read-eval*",
  117. "*reader-resolver*",
  118. "*source-path*",
  119. "*suppress-read*",
  120. "*unchecked-math*",
  121. "*use-context-classloader*",
  122. "*verbose-defrecords*",
  123. "*warn-on-reflection*",
  124. "+",
  125. "+'",
  126. "-",
  127. "-'",
  128. "->",
  129. "->>",
  130. "->ArrayChunk",
  131. "->Eduction",
  132. "->Vec",
  133. "->VecNode",
  134. "->VecSeq",
  135. "-cache-protocol-fn",
  136. "-reset-methods",
  137. "..",
  138. "/",
  139. "<",
  140. "<=",
  141. "=",
  142. "==",
  143. ">",
  144. ">=",
  145. "EMPTY-NODE",
  146. "Inst",
  147. "StackTraceElement->vec",
  148. "Throwable->map",
  149. "accessor",
  150. "aclone",
  151. "add-classpath",
  152. "add-watch",
  153. "agent",
  154. "agent-error",
  155. "agent-errors",
  156. "aget",
  157. "alength",
  158. "alias",
  159. "all-ns",
  160. "alter",
  161. "alter-meta!",
  162. "alter-var-root",
  163. "amap",
  164. "ancestors",
  165. "and",
  166. "any?",
  167. "apply",
  168. "areduce",
  169. "array-map",
  170. "as->",
  171. "aset",
  172. "aset-boolean",
  173. "aset-byte",
  174. "aset-char",
  175. "aset-double",
  176. "aset-float",
  177. "aset-int",
  178. "aset-long",
  179. "aset-short",
  180. "assert",
  181. "assoc",
  182. "assoc!",
  183. "assoc-in",
  184. "associative?",
  185. "atom",
  186. "await",
  187. "await-for",
  188. "await1",
  189. "bases",
  190. "bean",
  191. "bigdec",
  192. "bigint",
  193. "biginteger",
  194. "binding",
  195. "bit-and",
  196. "bit-and-not",
  197. "bit-clear",
  198. "bit-flip",
  199. "bit-not",
  200. "bit-or",
  201. "bit-set",
  202. "bit-shift-left",
  203. "bit-shift-right",
  204. "bit-test",
  205. "bit-xor",
  206. "boolean",
  207. "boolean-array",
  208. "boolean?",
  209. "booleans",
  210. "bound-fn",
  211. "bound-fn*",
  212. "bound?",
  213. "bounded-count",
  214. "butlast",
  215. "byte",
  216. "byte-array",
  217. "bytes",
  218. "bytes?",
  219. "case",
  220. "cast",
  221. "cat",
  222. "char",
  223. "char-array",
  224. "char-escape-string",
  225. "char-name-string",
  226. "char?",
  227. "chars",
  228. "chunk",
  229. "chunk-append",
  230. "chunk-buffer",
  231. "chunk-cons",
  232. "chunk-first",
  233. "chunk-next",
  234. "chunk-rest",
  235. "chunked-seq?",
  236. "class",
  237. "class?",
  238. "clear-agent-errors",
  239. "clojure-version",
  240. "coll?",
  241. "comment",
  242. "commute",
  243. "comp",
  244. "comparator",
  245. "compare",
  246. "compare-and-set!",
  247. "compile",
  248. "complement",
  249. "completing",
  250. "concat",
  251. "cond",
  252. "cond->",
  253. "cond->>",
  254. "condp",
  255. "conj",
  256. "conj!",
  257. "cons",
  258. "constantly",
  259. "construct-proxy",
  260. "contains?",
  261. "count",
  262. "counted?",
  263. "create-ns",
  264. "create-struct",
  265. "cycle",
  266. "dec",
  267. "dec'",
  268. "decimal?",
  269. "declare",
  270. "dedupe",
  271. "default-data-readers",
  272. "definline",
  273. "definterface",
  274. "defmacro",
  275. "defmethod",
  276. "defmulti",
  277. "defn",
  278. "defn-",
  279. "defonce",
  280. "defprotocol",
  281. "defrecord",
  282. "defstruct",
  283. "deftype",
  284. "delay",
  285. "delay?",
  286. "deliver",
  287. "denominator",
  288. "deref",
  289. "derive",
  290. "descendants",
  291. "destructure",
  292. "disj",
  293. "disj!",
  294. "dissoc",
  295. "dissoc!",
  296. "distinct",
  297. "distinct?",
  298. "doall",
  299. "dorun",
  300. "doseq",
  301. "dosync",
  302. "dotimes",
  303. "doto",
  304. "double",
  305. "double-array",
  306. "double?",
  307. "doubles",
  308. "drop",
  309. "drop-last",
  310. "drop-while",
  311. "eduction",
  312. "empty",
  313. "empty?",
  314. "ensure",
  315. "ensure-reduced",
  316. "enumeration-seq",
  317. "error-handler",
  318. "error-mode",
  319. "eval",
  320. "even?",
  321. "every-pred",
  322. "every?",
  323. "ex-data",
  324. "ex-info",
  325. "extend",
  326. "extend-protocol",
  327. "extend-type",
  328. "extenders",
  329. "extends?",
  330. "false?",
  331. "ffirst",
  332. "file-seq",
  333. "filter",
  334. "filterv",
  335. "find",
  336. "find-keyword",
  337. "find-ns",
  338. "find-protocol-impl",
  339. "find-protocol-method",
  340. "find-var",
  341. "first",
  342. "flatten",
  343. "float",
  344. "float-array",
  345. "float?",
  346. "floats",
  347. "flush",
  348. "fn",
  349. "fn?",
  350. "fnext",
  351. "fnil",
  352. "for",
  353. "force",
  354. "format",
  355. "frequencies",
  356. "future",
  357. "future-call",
  358. "future-cancel",
  359. "future-cancelled?",
  360. "future-done?",
  361. "future?",
  362. "gen-class",
  363. "gen-interface",
  364. "gensym",
  365. "get",
  366. "get-in",
  367. "get-method",
  368. "get-proxy-class",
  369. "get-thread-bindings",
  370. "get-validator",
  371. "group-by",
  372. "halt-when",
  373. "hash",
  374. "hash-combine",
  375. "hash-map",
  376. "hash-ordered-coll",
  377. "hash-set",
  378. "hash-unordered-coll",
  379. "ident?",
  380. "identical?",
  381. "identity",
  382. "if-let",
  383. "if-not",
  384. "if-some",
  385. "ifn?",
  386. "import",
  387. "in-ns",
  388. "inc",
  389. "inc'",
  390. "indexed?",
  391. "init-proxy",
  392. "inst-ms",
  393. "inst-ms*",
  394. "inst?",
  395. "instance?",
  396. "int",
  397. "int-array",
  398. "int?",
  399. "integer?",
  400. "interleave",
  401. "intern",
  402. "interpose",
  403. "into",
  404. "into-array",
  405. "ints",
  406. "io!",
  407. "isa?",
  408. "iterate",
  409. "iterator-seq",
  410. "juxt",
  411. "keep",
  412. "keep-indexed",
  413. "key",
  414. "keys",
  415. "keyword",
  416. "keyword?",
  417. "last",
  418. "lazy-cat",
  419. "lazy-seq",
  420. "let",
  421. "letfn",
  422. "line-seq",
  423. "list",
  424. "list*",
  425. "list?",
  426. "load",
  427. "load-file",
  428. "load-reader",
  429. "load-string",
  430. "loaded-libs",
  431. "locking",
  432. "long",
  433. "long-array",
  434. "longs",
  435. "loop",
  436. "macroexpand",
  437. "macroexpand-1",
  438. "make-array",
  439. "make-hierarchy",
  440. "map",
  441. "map-entry?",
  442. "map-indexed",
  443. "map?",
  444. "mapcat",
  445. "mapv",
  446. "max",
  447. "max-key",
  448. "memfn",
  449. "memoize",
  450. "merge",
  451. "merge-with",
  452. "meta",
  453. "method-sig",
  454. "methods",
  455. "min",
  456. "min-key",
  457. "mix-collection-hash",
  458. "mod",
  459. "munge",
  460. "name",
  461. "namespace",
  462. "namespace-munge",
  463. "nat-int?",
  464. "neg-int?",
  465. "neg?",
  466. "newline",
  467. "next",
  468. "nfirst",
  469. "nil?",
  470. "nnext",
  471. "not",
  472. "not-any?",
  473. "not-empty",
  474. "not-every?",
  475. "not=",
  476. "ns",
  477. "ns-aliases",
  478. "ns-imports",
  479. "ns-interns",
  480. "ns-map",
  481. "ns-name",
  482. "ns-publics",
  483. "ns-refers",
  484. "ns-resolve",
  485. "ns-unalias",
  486. "ns-unmap",
  487. "nth",
  488. "nthnext",
  489. "nthrest",
  490. "num",
  491. "number?",
  492. "numerator",
  493. "object-array",
  494. "odd?",
  495. "or",
  496. "parents",
  497. "partial",
  498. "partition",
  499. "partition-all",
  500. "partition-by",
  501. "pcalls",
  502. "peek",
  503. "persistent!",
  504. "pmap",
  505. "pop",
  506. "pop!",
  507. "pop-thread-bindings",
  508. "pos-int?",
  509. "pos?",
  510. "pr",
  511. "pr-str",
  512. "prefer-method",
  513. "prefers",
  514. "primitives-classnames",
  515. "print",
  516. "print-ctor",
  517. "print-dup",
  518. "print-method",
  519. "print-simple",
  520. "print-str",
  521. "printf",
  522. "println",
  523. "println-str",
  524. "prn",
  525. "prn-str",
  526. "promise",
  527. "proxy",
  528. "proxy-call-with-super",
  529. "proxy-mappings",
  530. "proxy-name",
  531. "proxy-super",
  532. "push-thread-bindings",
  533. "pvalues",
  534. "qualified-ident?",
  535. "qualified-keyword?",
  536. "qualified-symbol?",
  537. "quot",
  538. "rand",
  539. "rand-int",
  540. "rand-nth",
  541. "random-sample",
  542. "range",
  543. "ratio?",
  544. "rational?",
  545. "rationalize",
  546. "re-find",
  547. "re-groups",
  548. "re-matcher",
  549. "re-matches",
  550. "re-pattern",
  551. "re-seq",
  552. "read",
  553. "read-line",
  554. "read-string",
  555. "reader-conditional",
  556. "reader-conditional?",
  557. "realized?",
  558. "record?",
  559. "reduce",
  560. "reduce-kv",
  561. "reduced",
  562. "reduced?",
  563. "reductions",
  564. "ref",
  565. "ref-history-count",
  566. "ref-max-history",
  567. "ref-min-history",
  568. "ref-set",
  569. "refer",
  570. "refer-clojure",
  571. "reify",
  572. "release-pending-sends",
  573. "rem",
  574. "remove",
  575. "remove-all-methods",
  576. "remove-method",
  577. "remove-ns",
  578. "remove-watch",
  579. "repeat",
  580. "repeatedly",
  581. "replace",
  582. "replicate",
  583. "require",
  584. "reset!",
  585. "reset-meta!",
  586. "reset-vals!",
  587. "resolve",
  588. "rest",
  589. "restart-agent",
  590. "resultset-seq",
  591. "reverse",
  592. "reversible?",
  593. "rseq",
  594. "rsubseq",
  595. "run!",
  596. "satisfies?",
  597. "second",
  598. "select-keys",
  599. "send",
  600. "send-off",
  601. "send-via",
  602. "seq",
  603. "seq?",
  604. "seqable?",
  605. "seque",
  606. "sequence",
  607. "sequential?",
  608. "set",
  609. "set-agent-send-executor!",
  610. "set-agent-send-off-executor!",
  611. "set-error-handler!",
  612. "set-error-mode!",
  613. "set-validator!",
  614. "set?",
  615. "short",
  616. "short-array",
  617. "shorts",
  618. "shuffle",
  619. "shutdown-agents",
  620. "simple-ident?",
  621. "simple-keyword?",
  622. "simple-symbol?",
  623. "slurp",
  624. "some",
  625. "some->",
  626. "some->>",
  627. "some-fn",
  628. "some?",
  629. "sort",
  630. "sort-by",
  631. "sorted-map",
  632. "sorted-map-by",
  633. "sorted-set",
  634. "sorted-set-by",
  635. "sorted?",
  636. "special-symbol?",
  637. "spit",
  638. "split-at",
  639. "split-with",
  640. "str",
  641. "string?",
  642. "struct",
  643. "struct-map",
  644. "subs",
  645. "subseq",
  646. "subvec",
  647. "supers",
  648. "swap!",
  649. "swap-vals!",
  650. "symbol",
  651. "symbol?",
  652. "sync",
  653. "tagged-literal",
  654. "tagged-literal?",
  655. "take",
  656. "take-last",
  657. "take-nth",
  658. "take-while",
  659. "test",
  660. "the-ns",
  661. "thread-bound?",
  662. "time",
  663. "to-array",
  664. "to-array-2d",
  665. "trampoline",
  666. "transduce",
  667. "transient",
  668. "tree-seq",
  669. "true?",
  670. "type",
  671. "unchecked-add",
  672. "unchecked-add-int",
  673. "unchecked-byte",
  674. "unchecked-char",
  675. "unchecked-dec",
  676. "unchecked-dec-int",
  677. "unchecked-divide-int",
  678. "unchecked-double",
  679. "unchecked-float",
  680. "unchecked-inc",
  681. "unchecked-inc-int",
  682. "unchecked-int",
  683. "unchecked-long",
  684. "unchecked-multiply",
  685. "unchecked-multiply-int",
  686. "unchecked-negate",
  687. "unchecked-negate-int",
  688. "unchecked-remainder-int",
  689. "unchecked-short",
  690. "unchecked-subtract",
  691. "unchecked-subtract-int",
  692. "underive",
  693. "unquote",
  694. "unquote-splicing",
  695. "unreduced",
  696. "unsigned-bit-shift-right",
  697. "update",
  698. "update-in",
  699. "update-proxy",
  700. "uri?",
  701. "use",
  702. "uuid?",
  703. "val",
  704. "vals",
  705. "var-get",
  706. "var-set",
  707. "var?",
  708. "vary-meta",
  709. "vec",
  710. "vector",
  711. "vector-of",
  712. "vector?",
  713. "volatile!",
  714. "volatile?",
  715. "vreset!",
  716. "vswap!",
  717. "when",
  718. "when-first",
  719. "when-let",
  720. "when-not",
  721. "when-some",
  722. "while",
  723. "with-bindings",
  724. "with-bindings*",
  725. "with-in-str",
  726. "with-loading-context",
  727. "with-local-vars",
  728. "with-meta",
  729. "with-open",
  730. "with-out-str",
  731. "with-precision",
  732. "with-redefs",
  733. "with-redefs-fn",
  734. "xml-seq",
  735. "zero?",
  736. "zipmap"
  737. ],
  738. tokenizer: {
  739. root: [
  740. { include: "@whitespace" },
  741. [/@numbers/, "number"],
  742. [/@characters/, "string"],
  743. { include: "@string" },
  744. [/[()\[\]{}]/, "@brackets"],
  745. [/\/#"(?:\.|(?:")|[^"\n])*"\/g/, "regexp"],
  746. [/[#'@^`~]/, "meta"],
  747. [
  748. /@qualifiedSymbols/,
  749. {
  750. cases: {
  751. "^:.+$": "constant",
  752. "@specialForms": "keyword",
  753. "@coreSymbols": "keyword",
  754. "@constants": "constant",
  755. "@default": "identifier"
  756. }
  757. }
  758. ]
  759. ],
  760. whitespace: [
  761. [/[\s,]+/, "white"],
  762. [/;.*$/, "comment"],
  763. [/\(comment\b/, "comment", "@comment"]
  764. ],
  765. comment: [
  766. [/\(/, "comment", "@push"],
  767. [/\)/, "comment", "@pop"],
  768. [/[^()]/, "comment"]
  769. ],
  770. string: [[/"/, "string", "@multiLineString"]],
  771. multiLineString: [
  772. [/"/, "string", "@popall"],
  773. [/@escapes/, "string.escape"],
  774. [/./, "string"]
  775. ]
  776. }
  777. };
  778. return __toCommonJS(clojure_exports);
  779. })();
  780. return moduleExports;
  781. });