tcl.js 6.1 KB

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