rust-UFTH4T2C.js 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  1. import "./chunk-2LSFTFF7.js";
  2. // node_modules/.pnpm/monaco-editor@0.38.0/node_modules/monaco-editor/esm/vs/basic-languages/rust/rust.js
  3. var conf = {
  4. comments: {
  5. lineComment: "//",
  6. blockComment: ["/*", "*/"]
  7. },
  8. brackets: [
  9. ["{", "}"],
  10. ["[", "]"],
  11. ["(", ")"]
  12. ],
  13. autoClosingPairs: [
  14. { open: "[", close: "]" },
  15. { open: "{", close: "}" },
  16. { open: "(", close: ")" },
  17. { open: '"', close: '"', notIn: ["string"] }
  18. ],
  19. surroundingPairs: [
  20. { open: "{", close: "}" },
  21. { open: "[", close: "]" },
  22. { open: "(", close: ")" },
  23. { open: '"', close: '"' },
  24. { open: "'", close: "'" }
  25. ],
  26. folding: {
  27. markers: {
  28. start: new RegExp("^\\s*#pragma\\s+region\\b"),
  29. end: new RegExp("^\\s*#pragma\\s+endregion\\b")
  30. }
  31. }
  32. };
  33. var language = {
  34. tokenPostfix: ".rust",
  35. defaultToken: "invalid",
  36. keywords: [
  37. "as",
  38. "async",
  39. "await",
  40. "box",
  41. "break",
  42. "const",
  43. "continue",
  44. "crate",
  45. "dyn",
  46. "else",
  47. "enum",
  48. "extern",
  49. "false",
  50. "fn",
  51. "for",
  52. "if",
  53. "impl",
  54. "in",
  55. "let",
  56. "loop",
  57. "match",
  58. "mod",
  59. "move",
  60. "mut",
  61. "pub",
  62. "ref",
  63. "return",
  64. "self",
  65. "static",
  66. "struct",
  67. "super",
  68. "trait",
  69. "true",
  70. "try",
  71. "type",
  72. "unsafe",
  73. "use",
  74. "where",
  75. "while",
  76. "catch",
  77. "default",
  78. "union",
  79. "static",
  80. "abstract",
  81. "alignof",
  82. "become",
  83. "do",
  84. "final",
  85. "macro",
  86. "offsetof",
  87. "override",
  88. "priv",
  89. "proc",
  90. "pure",
  91. "sizeof",
  92. "typeof",
  93. "unsized",
  94. "virtual",
  95. "yield"
  96. ],
  97. typeKeywords: [
  98. "Self",
  99. "m32",
  100. "m64",
  101. "m128",
  102. "f80",
  103. "f16",
  104. "f128",
  105. "int",
  106. "uint",
  107. "float",
  108. "char",
  109. "bool",
  110. "u8",
  111. "u16",
  112. "u32",
  113. "u64",
  114. "f32",
  115. "f64",
  116. "i8",
  117. "i16",
  118. "i32",
  119. "i64",
  120. "str",
  121. "Option",
  122. "Either",
  123. "c_float",
  124. "c_double",
  125. "c_void",
  126. "FILE",
  127. "fpos_t",
  128. "DIR",
  129. "dirent",
  130. "c_char",
  131. "c_schar",
  132. "c_uchar",
  133. "c_short",
  134. "c_ushort",
  135. "c_int",
  136. "c_uint",
  137. "c_long",
  138. "c_ulong",
  139. "size_t",
  140. "ptrdiff_t",
  141. "clock_t",
  142. "time_t",
  143. "c_longlong",
  144. "c_ulonglong",
  145. "intptr_t",
  146. "uintptr_t",
  147. "off_t",
  148. "dev_t",
  149. "ino_t",
  150. "pid_t",
  151. "mode_t",
  152. "ssize_t"
  153. ],
  154. constants: ["true", "false", "Some", "None", "Left", "Right", "Ok", "Err"],
  155. supportConstants: [
  156. "EXIT_FAILURE",
  157. "EXIT_SUCCESS",
  158. "RAND_MAX",
  159. "EOF",
  160. "SEEK_SET",
  161. "SEEK_CUR",
  162. "SEEK_END",
  163. "_IOFBF",
  164. "_IONBF",
  165. "_IOLBF",
  166. "BUFSIZ",
  167. "FOPEN_MAX",
  168. "FILENAME_MAX",
  169. "L_tmpnam",
  170. "TMP_MAX",
  171. "O_RDONLY",
  172. "O_WRONLY",
  173. "O_RDWR",
  174. "O_APPEND",
  175. "O_CREAT",
  176. "O_EXCL",
  177. "O_TRUNC",
  178. "S_IFIFO",
  179. "S_IFCHR",
  180. "S_IFBLK",
  181. "S_IFDIR",
  182. "S_IFREG",
  183. "S_IFMT",
  184. "S_IEXEC",
  185. "S_IWRITE",
  186. "S_IREAD",
  187. "S_IRWXU",
  188. "S_IXUSR",
  189. "S_IWUSR",
  190. "S_IRUSR",
  191. "F_OK",
  192. "R_OK",
  193. "W_OK",
  194. "X_OK",
  195. "STDIN_FILENO",
  196. "STDOUT_FILENO",
  197. "STDERR_FILENO"
  198. ],
  199. supportMacros: [
  200. "format!",
  201. "print!",
  202. "println!",
  203. "panic!",
  204. "format_args!",
  205. "unreachable!",
  206. "write!",
  207. "writeln!"
  208. ],
  209. operators: [
  210. "!",
  211. "!=",
  212. "%",
  213. "%=",
  214. "&",
  215. "&=",
  216. "&&",
  217. "*",
  218. "*=",
  219. "+",
  220. "+=",
  221. "-",
  222. "-=",
  223. "->",
  224. ".",
  225. "..",
  226. "...",
  227. "/",
  228. "/=",
  229. ":",
  230. ";",
  231. "<<",
  232. "<<=",
  233. "<",
  234. "<=",
  235. "=",
  236. "==",
  237. "=>",
  238. ">",
  239. ">=",
  240. ">>",
  241. ">>=",
  242. "@",
  243. "^",
  244. "^=",
  245. "|",
  246. "|=",
  247. "||",
  248. "_",
  249. "?",
  250. "#"
  251. ],
  252. escapes: /\\([nrt0\"''\\]|x\h{2}|u\{\h{1,6}\})/,
  253. delimiters: /[,]/,
  254. symbols: /[\#\!\%\&\*\+\-\.\/\:\;\<\=\>\@\^\|_\?]+/,
  255. intSuffixes: /[iu](8|16|32|64|128|size)/,
  256. floatSuffixes: /f(32|64)/,
  257. tokenizer: {
  258. root: [
  259. [/r(#*)"/, { token: "string.quote", bracket: "@open", next: "@stringraw.$1" }],
  260. [
  261. /[a-zA-Z][a-zA-Z0-9_]*!?|_[a-zA-Z0-9_]+/,
  262. {
  263. cases: {
  264. "@typeKeywords": "keyword.type",
  265. "@keywords": "keyword",
  266. "@supportConstants": "keyword",
  267. "@supportMacros": "keyword",
  268. "@constants": "keyword",
  269. "@default": "identifier"
  270. }
  271. }
  272. ],
  273. [/\$/, "identifier"],
  274. [/'[a-zA-Z_][a-zA-Z0-9_]*(?=[^\'])/, "identifier"],
  275. [/'(\S|@escapes)'/, "string.byteliteral"],
  276. [/"/, { token: "string.quote", bracket: "@open", next: "@string" }],
  277. { include: "@numbers" },
  278. { include: "@whitespace" },
  279. [
  280. /@delimiters/,
  281. {
  282. cases: {
  283. "@keywords": "keyword",
  284. "@default": "delimiter"
  285. }
  286. }
  287. ],
  288. [/[{}()\[\]<>]/, "@brackets"],
  289. [/@symbols/, { cases: { "@operators": "operator", "@default": "" } }]
  290. ],
  291. whitespace: [
  292. [/[ \t\r\n]+/, "white"],
  293. [/\/\*/, "comment", "@comment"],
  294. [/\/\/.*$/, "comment"]
  295. ],
  296. comment: [
  297. [/[^\/*]+/, "comment"],
  298. [/\/\*/, "comment", "@push"],
  299. ["\\*/", "comment", "@pop"],
  300. [/[\/*]/, "comment"]
  301. ],
  302. string: [
  303. [/[^\\"]+/, "string"],
  304. [/@escapes/, "string.escape"],
  305. [/\\./, "string.escape.invalid"],
  306. [/"/, { token: "string.quote", bracket: "@close", next: "@pop" }]
  307. ],
  308. stringraw: [
  309. [/[^"#]+/, { token: "string" }],
  310. [
  311. /"(#*)/,
  312. {
  313. cases: {
  314. "$1==$S2": { token: "string.quote", bracket: "@close", next: "@pop" },
  315. "@default": { token: "string" }
  316. }
  317. }
  318. ],
  319. [/["#]/, { token: "string" }]
  320. ],
  321. numbers: [
  322. [/(0o[0-7_]+)(@intSuffixes)?/, { token: "number" }],
  323. [/(0b[0-1_]+)(@intSuffixes)?/, { token: "number" }],
  324. [/[\d][\d_]*(\.[\d][\d_]*)?[eE][+-][\d_]+(@floatSuffixes)?/, { token: "number" }],
  325. [/\b(\d\.?[\d_]*)(@floatSuffixes)?\b/, { token: "number" }],
  326. [/(0x[\da-fA-F]+)_?(@intSuffixes)?/, { token: "number" }],
  327. [/[\d][\d_]*(@intSuffixes?)?/, { token: "number" }]
  328. ]
  329. }
  330. };
  331. export {
  332. conf,
  333. language
  334. };
  335. /*! Bundled license information:
  336. monaco-editor/esm/vs/basic-languages/rust/rust.js:
  337. (*!-----------------------------------------------------------------------------
  338. * Copyright (c) Microsoft Corporation. All rights reserved.
  339. * Version: 0.38.0(0e330ae453813de4e6cf272460fb79c7117073d0)
  340. * Released under the MIT license
  341. * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
  342. *-----------------------------------------------------------------------------*)
  343. */
  344. //# sourceMappingURL=rust-UFTH4T2C.js.map