st-U22OTGU4.js 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423
  1. import "./chunk-2LSFTFF7.js";
  2. // node_modules/.pnpm/monaco-editor@0.38.0/node_modules/monaco-editor/esm/vs/basic-languages/st/st.js
  3. var conf = {
  4. comments: {
  5. lineComment: "//",
  6. blockComment: ["(*", "*)"]
  7. },
  8. brackets: [
  9. ["{", "}"],
  10. ["[", "]"],
  11. ["(", ")"],
  12. ["var", "end_var"],
  13. ["var_input", "end_var"],
  14. ["var_output", "end_var"],
  15. ["var_in_out", "end_var"],
  16. ["var_temp", "end_var"],
  17. ["var_global", "end_var"],
  18. ["var_access", "end_var"],
  19. ["var_external", "end_var"],
  20. ["type", "end_type"],
  21. ["struct", "end_struct"],
  22. ["program", "end_program"],
  23. ["function", "end_function"],
  24. ["function_block", "end_function_block"],
  25. ["action", "end_action"],
  26. ["step", "end_step"],
  27. ["initial_step", "end_step"],
  28. ["transaction", "end_transaction"],
  29. ["configuration", "end_configuration"],
  30. ["tcp", "end_tcp"],
  31. ["recource", "end_recource"],
  32. ["channel", "end_channel"],
  33. ["library", "end_library"],
  34. ["folder", "end_folder"],
  35. ["binaries", "end_binaries"],
  36. ["includes", "end_includes"],
  37. ["sources", "end_sources"]
  38. ],
  39. autoClosingPairs: [
  40. { open: "[", close: "]" },
  41. { open: "{", close: "}" },
  42. { open: "(", close: ")" },
  43. { open: "/*", close: "*/" },
  44. { open: "'", close: "'", notIn: ["string_sq"] },
  45. { open: '"', close: '"', notIn: ["string_dq"] },
  46. { open: "var_input", close: "end_var" },
  47. { open: "var_output", close: "end_var" },
  48. { open: "var_in_out", close: "end_var" },
  49. { open: "var_temp", close: "end_var" },
  50. { open: "var_global", close: "end_var" },
  51. { open: "var_access", close: "end_var" },
  52. { open: "var_external", close: "end_var" },
  53. { open: "type", close: "end_type" },
  54. { open: "struct", close: "end_struct" },
  55. { open: "program", close: "end_program" },
  56. { open: "function", close: "end_function" },
  57. { open: "function_block", close: "end_function_block" },
  58. { open: "action", close: "end_action" },
  59. { open: "step", close: "end_step" },
  60. { open: "initial_step", close: "end_step" },
  61. { open: "transaction", close: "end_transaction" },
  62. { open: "configuration", close: "end_configuration" },
  63. { open: "tcp", close: "end_tcp" },
  64. { open: "recource", close: "end_recource" },
  65. { open: "channel", close: "end_channel" },
  66. { open: "library", close: "end_library" },
  67. { open: "folder", close: "end_folder" },
  68. { open: "binaries", close: "end_binaries" },
  69. { open: "includes", close: "end_includes" },
  70. { open: "sources", close: "end_sources" }
  71. ],
  72. surroundingPairs: [
  73. { open: "{", close: "}" },
  74. { open: "[", close: "]" },
  75. { open: "(", close: ")" },
  76. { open: '"', close: '"' },
  77. { open: "'", close: "'" },
  78. { open: "var", close: "end_var" },
  79. { open: "var_input", close: "end_var" },
  80. { open: "var_output", close: "end_var" },
  81. { open: "var_in_out", close: "end_var" },
  82. { open: "var_temp", close: "end_var" },
  83. { open: "var_global", close: "end_var" },
  84. { open: "var_access", close: "end_var" },
  85. { open: "var_external", close: "end_var" },
  86. { open: "type", close: "end_type" },
  87. { open: "struct", close: "end_struct" },
  88. { open: "program", close: "end_program" },
  89. { open: "function", close: "end_function" },
  90. { open: "function_block", close: "end_function_block" },
  91. { open: "action", close: "end_action" },
  92. { open: "step", close: "end_step" },
  93. { open: "initial_step", close: "end_step" },
  94. { open: "transaction", close: "end_transaction" },
  95. { open: "configuration", close: "end_configuration" },
  96. { open: "tcp", close: "end_tcp" },
  97. { open: "recource", close: "end_recource" },
  98. { open: "channel", close: "end_channel" },
  99. { open: "library", close: "end_library" },
  100. { open: "folder", close: "end_folder" },
  101. { open: "binaries", close: "end_binaries" },
  102. { open: "includes", close: "end_includes" },
  103. { open: "sources", close: "end_sources" }
  104. ],
  105. folding: {
  106. markers: {
  107. start: new RegExp("^\\s*#pragma\\s+region\\b"),
  108. end: new RegExp("^\\s*#pragma\\s+endregion\\b")
  109. }
  110. }
  111. };
  112. var language = {
  113. defaultToken: "",
  114. tokenPostfix: ".st",
  115. ignoreCase: true,
  116. brackets: [
  117. { token: "delimiter.curly", open: "{", close: "}" },
  118. { token: "delimiter.parenthesis", open: "(", close: ")" },
  119. { token: "delimiter.square", open: "[", close: "]" }
  120. ],
  121. keywords: [
  122. "if",
  123. "end_if",
  124. "elsif",
  125. "else",
  126. "case",
  127. "of",
  128. "to",
  129. "__try",
  130. "__catch",
  131. "__finally",
  132. "do",
  133. "with",
  134. "by",
  135. "while",
  136. "repeat",
  137. "end_while",
  138. "end_repeat",
  139. "end_case",
  140. "for",
  141. "end_for",
  142. "task",
  143. "retain",
  144. "non_retain",
  145. "constant",
  146. "with",
  147. "at",
  148. "exit",
  149. "return",
  150. "interval",
  151. "priority",
  152. "address",
  153. "port",
  154. "on_channel",
  155. "then",
  156. "iec",
  157. "file",
  158. "uses",
  159. "version",
  160. "packagetype",
  161. "displayname",
  162. "copyright",
  163. "summary",
  164. "vendor",
  165. "common_source",
  166. "from",
  167. "extends"
  168. ],
  169. constant: ["false", "true", "null"],
  170. defineKeywords: [
  171. "var",
  172. "var_input",
  173. "var_output",
  174. "var_in_out",
  175. "var_temp",
  176. "var_global",
  177. "var_access",
  178. "var_external",
  179. "end_var",
  180. "type",
  181. "end_type",
  182. "struct",
  183. "end_struct",
  184. "program",
  185. "end_program",
  186. "function",
  187. "end_function",
  188. "function_block",
  189. "end_function_block",
  190. "interface",
  191. "end_interface",
  192. "method",
  193. "end_method",
  194. "property",
  195. "end_property",
  196. "namespace",
  197. "end_namespace",
  198. "configuration",
  199. "end_configuration",
  200. "tcp",
  201. "end_tcp",
  202. "resource",
  203. "end_resource",
  204. "channel",
  205. "end_channel",
  206. "library",
  207. "end_library",
  208. "folder",
  209. "end_folder",
  210. "binaries",
  211. "end_binaries",
  212. "includes",
  213. "end_includes",
  214. "sources",
  215. "end_sources",
  216. "action",
  217. "end_action",
  218. "step",
  219. "initial_step",
  220. "end_step",
  221. "transaction",
  222. "end_transaction"
  223. ],
  224. typeKeywords: [
  225. "int",
  226. "sint",
  227. "dint",
  228. "lint",
  229. "usint",
  230. "uint",
  231. "udint",
  232. "ulint",
  233. "real",
  234. "lreal",
  235. "time",
  236. "date",
  237. "time_of_day",
  238. "date_and_time",
  239. "string",
  240. "bool",
  241. "byte",
  242. "word",
  243. "dword",
  244. "array",
  245. "pointer",
  246. "lword"
  247. ],
  248. operators: [
  249. "=",
  250. ">",
  251. "<",
  252. ":",
  253. ":=",
  254. "<=",
  255. ">=",
  256. "<>",
  257. "&",
  258. "+",
  259. "-",
  260. "*",
  261. "**",
  262. "MOD",
  263. "^",
  264. "or",
  265. "and",
  266. "not",
  267. "xor",
  268. "abs",
  269. "acos",
  270. "asin",
  271. "atan",
  272. "cos",
  273. "exp",
  274. "expt",
  275. "ln",
  276. "log",
  277. "sin",
  278. "sqrt",
  279. "tan",
  280. "sel",
  281. "max",
  282. "min",
  283. "limit",
  284. "mux",
  285. "shl",
  286. "shr",
  287. "rol",
  288. "ror",
  289. "indexof",
  290. "sizeof",
  291. "adr",
  292. "adrinst",
  293. "bitadr",
  294. "is_valid",
  295. "ref",
  296. "ref_to"
  297. ],
  298. builtinVariables: [],
  299. builtinFunctions: [
  300. "sr",
  301. "rs",
  302. "tp",
  303. "ton",
  304. "tof",
  305. "eq",
  306. "ge",
  307. "le",
  308. "lt",
  309. "ne",
  310. "round",
  311. "trunc",
  312. "ctd",
  313. "сtu",
  314. "ctud",
  315. "r_trig",
  316. "f_trig",
  317. "move",
  318. "concat",
  319. "delete",
  320. "find",
  321. "insert",
  322. "left",
  323. "len",
  324. "replace",
  325. "right",
  326. "rtc"
  327. ],
  328. symbols: /[=><!~?:&|+\-*\/\^%]+/,
  329. escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
  330. tokenizer: {
  331. root: [
  332. [/(\.\.)/, "delimiter"],
  333. [/\b(16#[0-9A-Fa-f\_]*)+\b/, "number.hex"],
  334. [/\b(2#[01\_]+)+\b/, "number.binary"],
  335. [/\b(8#[0-9\_]*)+\b/, "number.octal"],
  336. [/\b\d*\.\d+([eE][\-+]?\d+)?\b/, "number.float"],
  337. [/\b(L?REAL)#[0-9\_\.e]+\b/, "number.float"],
  338. [/\b(BYTE|(?:D|L)?WORD|U?(?:S|D|L)?INT)#[0-9\_]+\b/, "number"],
  339. [/\d+/, "number"],
  340. [/\b(T|DT|TOD)#[0-9:-_shmyd]+\b/, "tag"],
  341. [/\%(I|Q|M)(X|B|W|D|L)[0-9\.]+/, "tag"],
  342. [/\%(I|Q|M)[0-9\.]*/, "tag"],
  343. [/\b[A-Za-z]{1,6}#[0-9]+\b/, "tag"],
  344. [/\b(TO_|CTU_|CTD_|CTUD_|MUX_|SEL_)[A_Za-z]+\b/, "predefined"],
  345. [/\b[A_Za-z]+(_TO_)[A_Za-z]+\b/, "predefined"],
  346. [/[;]/, "delimiter"],
  347. [/[.]/, { token: "delimiter", next: "@params" }],
  348. [
  349. /[a-zA-Z_]\w*/,
  350. {
  351. cases: {
  352. "@operators": "operators",
  353. "@keywords": "keyword",
  354. "@typeKeywords": "type",
  355. "@defineKeywords": "variable",
  356. "@constant": "constant",
  357. "@builtinVariables": "predefined",
  358. "@builtinFunctions": "predefined",
  359. "@default": "identifier"
  360. }
  361. }
  362. ],
  363. { include: "@whitespace" },
  364. [/[{}()\[\]]/, "@brackets"],
  365. [/"([^"\\]|\\.)*$/, "string.invalid"],
  366. [/"/, { token: "string.quote", bracket: "@open", next: "@string_dq" }],
  367. [/'/, { token: "string.quote", bracket: "@open", next: "@string_sq" }],
  368. [/'[^\\']'/, "string"],
  369. [/(')(@escapes)(')/, ["string", "string.escape", "string"]],
  370. [/'/, "string.invalid"]
  371. ],
  372. params: [
  373. [/\b[A-Za-z0-9_]+\b(?=\()/, { token: "identifier", next: "@pop" }],
  374. [/\b[A-Za-z0-9_]+\b/, "variable.name", "@pop"]
  375. ],
  376. comment: [
  377. [/[^\/*]+/, "comment"],
  378. [/\/\*/, "comment", "@push"],
  379. ["\\*/", "comment", "@pop"],
  380. [/[\/*]/, "comment"]
  381. ],
  382. comment2: [
  383. [/[^\(*]+/, "comment"],
  384. [/\(\*/, "comment", "@push"],
  385. ["\\*\\)", "comment", "@pop"],
  386. [/[\(*]/, "comment"]
  387. ],
  388. whitespace: [
  389. [/[ \t\r\n]+/, "white"],
  390. [/\/\/.*$/, "comment"],
  391. [/\/\*/, "comment", "@comment"],
  392. [/\(\*/, "comment", "@comment2"]
  393. ],
  394. string_dq: [
  395. [/[^\\"]+/, "string"],
  396. [/@escapes/, "string.escape"],
  397. [/\\./, "string.escape.invalid"],
  398. [/"/, { token: "string.quote", bracket: "@close", next: "@pop" }]
  399. ],
  400. string_sq: [
  401. [/[^\\']+/, "string"],
  402. [/@escapes/, "string.escape"],
  403. [/\\./, "string.escape.invalid"],
  404. [/'/, { token: "string.quote", bracket: "@close", next: "@pop" }]
  405. ]
  406. }
  407. };
  408. export {
  409. conf,
  410. language
  411. };
  412. /*! Bundled license information:
  413. monaco-editor/esm/vs/basic-languages/st/st.js:
  414. (*!-----------------------------------------------------------------------------
  415. * Copyright (c) Microsoft Corporation. All rights reserved.
  416. * Version: 0.38.0(0e330ae453813de4e6cf272460fb79c7117073d0)
  417. * Released under the MIT license
  418. * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
  419. *-----------------------------------------------------------------------------*)
  420. */
  421. //# sourceMappingURL=st-U22OTGU4.js.map