clojure.js 15 KB

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