tcl.js 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  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/tcl/tcl", ["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/tcl/tcl.ts
  28. var tcl_exports = {};
  29. __export(tcl_exports, {
  30. conf: () => conf,
  31. language: () => language
  32. });
  33. var conf = {
  34. brackets: [
  35. ["{", "}"],
  36. ["[", "]"],
  37. ["(", ")"]
  38. ],
  39. autoClosingPairs: [
  40. { open: "{", close: "}" },
  41. { open: "[", close: "]" },
  42. { open: "(", close: ")" },
  43. { open: '"', close: '"' },
  44. { open: "'", close: "'" }
  45. ],
  46. surroundingPairs: [
  47. { open: "{", close: "}" },
  48. { open: "[", close: "]" },
  49. { open: "(", close: ")" },
  50. { open: '"', close: '"' },
  51. { open: "'", close: "'" }
  52. ]
  53. };
  54. var language = {
  55. tokenPostfix: ".tcl",
  56. specialFunctions: [
  57. "set",
  58. "unset",
  59. "rename",
  60. "variable",
  61. "proc",
  62. "coroutine",
  63. "foreach",
  64. "incr",
  65. "append",
  66. "lappend",
  67. "linsert",
  68. "lreplace"
  69. ],
  70. mainFunctions: [
  71. "if",
  72. "then",
  73. "elseif",
  74. "else",
  75. "case",
  76. "switch",
  77. "while",
  78. "for",
  79. "break",
  80. "continue",
  81. "return",
  82. "package",
  83. "namespace",
  84. "catch",
  85. "exit",
  86. "eval",
  87. "expr",
  88. "uplevel",
  89. "upvar"
  90. ],
  91. builtinFunctions: [
  92. "file",
  93. "info",
  94. "concat",
  95. "join",
  96. "lindex",
  97. "list",
  98. "llength",
  99. "lrange",
  100. "lsearch",
  101. "lsort",
  102. "split",
  103. "array",
  104. "parray",
  105. "binary",
  106. "format",
  107. "regexp",
  108. "regsub",
  109. "scan",
  110. "string",
  111. "subst",
  112. "dict",
  113. "cd",
  114. "clock",
  115. "exec",
  116. "glob",
  117. "pid",
  118. "pwd",
  119. "close",
  120. "eof",
  121. "fblocked",
  122. "fconfigure",
  123. "fcopy",
  124. "fileevent",
  125. "flush",
  126. "gets",
  127. "open",
  128. "puts",
  129. "read",
  130. "seek",
  131. "socket",
  132. "tell",
  133. "interp",
  134. "after",
  135. "auto_execok",
  136. "auto_load",
  137. "auto_mkindex",
  138. "auto_reset",
  139. "bgerror",
  140. "error",
  141. "global",
  142. "history",
  143. "load",
  144. "source",
  145. "time",
  146. "trace",
  147. "unknown",
  148. "unset",
  149. "update",
  150. "vwait",
  151. "winfo",
  152. "wm",
  153. "bind",
  154. "event",
  155. "pack",
  156. "place",
  157. "grid",
  158. "font",
  159. "bell",
  160. "clipboard",
  161. "destroy",
  162. "focus",
  163. "grab",
  164. "lower",
  165. "option",
  166. "raise",
  167. "selection",
  168. "send",
  169. "tk",
  170. "tkwait",
  171. "tk_bisque",
  172. "tk_focusNext",
  173. "tk_focusPrev",
  174. "tk_focusFollowsMouse",
  175. "tk_popup",
  176. "tk_setPalette"
  177. ],
  178. symbols: /[=><!~?:&|+\-*\/\^%]+/,
  179. brackets: [
  180. { open: "(", close: ")", token: "delimiter.parenthesis" },
  181. { open: "{", close: "}", token: "delimiter.curly" },
  182. { open: "[", close: "]", token: "delimiter.square" }
  183. ],
  184. escapes: /\\(?:[abfnrtv\\"'\[\]\{\};\$]|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
  185. variables: /(?:\$+(?:(?:\:\:?)?[a-zA-Z_]\w*)+)/,
  186. tokenizer: {
  187. root: [
  188. [
  189. /[a-zA-Z_]\w*/,
  190. {
  191. cases: {
  192. "@specialFunctions": {
  193. token: "keyword.flow",
  194. next: "@specialFunc"
  195. },
  196. "@mainFunctions": "keyword",
  197. "@builtinFunctions": "variable",
  198. "@default": "operator.scss"
  199. }
  200. }
  201. ],
  202. [/\s+\-+(?!\d|\.)\w*|{\*}/, "metatag"],
  203. { include: "@whitespace" },
  204. [/[{}()\[\]]/, "@brackets"],
  205. [/@symbols/, "operator"],
  206. [/\$+(?:\:\:)?\{/, { token: "identifier", next: "@nestedVariable" }],
  207. [/@variables/, "type.identifier"],
  208. [/\.(?!\d|\.)[\w\-]*/, "operator.sql"],
  209. [/\d+(\.\d+)?/, "number"],
  210. [/\d+/, "number"],
  211. [/;/, "delimiter"],
  212. [/"/, { token: "string.quote", bracket: "@open", next: "@dstring" }],
  213. [/'/, { token: "string.quote", bracket: "@open", next: "@sstring" }]
  214. ],
  215. dstring: [
  216. [/\[/, { token: "@brackets", next: "@nestedCall" }],
  217. [/\$+(?:\:\:)?\{/, { token: "identifier", next: "@nestedVariable" }],
  218. [/@variables/, "type.identifier"],
  219. [/[^\\$\[\]"]+/, "string"],
  220. [/@escapes/, "string.escape"],
  221. [/"/, { token: "string.quote", bracket: "@close", next: "@pop" }]
  222. ],
  223. sstring: [
  224. [/\[/, { token: "@brackets", next: "@nestedCall" }],
  225. [/\$+(?:\:\:)?\{/, { token: "identifier", next: "@nestedVariable" }],
  226. [/@variables/, "type.identifier"],
  227. [/[^\\$\[\]']+/, "string"],
  228. [/@escapes/, "string.escape"],
  229. [/'/, { token: "string.quote", bracket: "@close", next: "@pop" }]
  230. ],
  231. whitespace: [
  232. [/[ \t\r\n]+/, "white"],
  233. [/#.*\\$/, { token: "comment", next: "@newlineComment" }],
  234. [/#.*(?!\\)$/, "comment"]
  235. ],
  236. newlineComment: [
  237. [/.*\\$/, "comment"],
  238. [/.*(?!\\)$/, { token: "comment", next: "@pop" }]
  239. ],
  240. nestedVariable: [
  241. [/[^\{\}\$]+/, "type.identifier"],
  242. [/\}/, { token: "identifier", next: "@pop" }]
  243. ],
  244. nestedCall: [
  245. [/\[/, { token: "@brackets", next: "@nestedCall" }],
  246. [/\]/, { token: "@brackets", next: "@pop" }],
  247. { include: "root" }
  248. ],
  249. specialFunc: [
  250. [/"/, { token: "string", next: "@dstring" }],
  251. [/'/, { token: "string", next: "@sstring" }],
  252. [/\S+/, { token: "type", next: "@pop" }]
  253. ]
  254. }
  255. };
  256. return __toCommonJS(tcl_exports);
  257. })();
  258. return moduleExports;
  259. });