apex.js 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336
  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/apex/apex",[],()=>{
  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/apex/apex.ts
  17. var apex_exports = {};
  18. __export(apex_exports, {
  19. conf: () => conf,
  20. language: () => language
  21. });
  22. var conf = {
  23. wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
  24. comments: {
  25. lineComment: "//",
  26. blockComment: ["/*", "*/"]
  27. },
  28. brackets: [
  29. ["{", "}"],
  30. ["[", "]"],
  31. ["(", ")"]
  32. ],
  33. autoClosingPairs: [
  34. { open: "{", close: "}" },
  35. { open: "[", close: "]" },
  36. { open: "(", close: ")" },
  37. { open: '"', close: '"' },
  38. { open: "'", close: "'" }
  39. ],
  40. surroundingPairs: [
  41. { open: "{", close: "}" },
  42. { open: "[", close: "]" },
  43. { open: "(", close: ")" },
  44. { open: '"', close: '"' },
  45. { open: "'", close: "'" },
  46. { open: "<", close: ">" }
  47. ],
  48. folding: {
  49. markers: {
  50. start: new RegExp("^\\s*//\\s*(?:(?:#?region\\b)|(?:<editor-fold\\b))"),
  51. end: new RegExp("^\\s*//\\s*(?:(?:#?endregion\\b)|(?:</editor-fold>))")
  52. }
  53. }
  54. };
  55. var keywords = [
  56. "abstract",
  57. "activate",
  58. "and",
  59. "any",
  60. "array",
  61. "as",
  62. "asc",
  63. "assert",
  64. "autonomous",
  65. "begin",
  66. "bigdecimal",
  67. "blob",
  68. "boolean",
  69. "break",
  70. "bulk",
  71. "by",
  72. "case",
  73. "cast",
  74. "catch",
  75. "char",
  76. "class",
  77. "collect",
  78. "commit",
  79. "const",
  80. "continue",
  81. "convertcurrency",
  82. "decimal",
  83. "default",
  84. "delete",
  85. "desc",
  86. "do",
  87. "double",
  88. "else",
  89. "end",
  90. "enum",
  91. "exception",
  92. "exit",
  93. "export",
  94. "extends",
  95. "false",
  96. "final",
  97. "finally",
  98. "float",
  99. "for",
  100. "from",
  101. "future",
  102. "get",
  103. "global",
  104. "goto",
  105. "group",
  106. "having",
  107. "hint",
  108. "if",
  109. "implements",
  110. "import",
  111. "in",
  112. "inner",
  113. "insert",
  114. "instanceof",
  115. "int",
  116. "interface",
  117. "into",
  118. "join",
  119. "last_90_days",
  120. "last_month",
  121. "last_n_days",
  122. "last_week",
  123. "like",
  124. "limit",
  125. "list",
  126. "long",
  127. "loop",
  128. "map",
  129. "merge",
  130. "native",
  131. "new",
  132. "next_90_days",
  133. "next_month",
  134. "next_n_days",
  135. "next_week",
  136. "not",
  137. "null",
  138. "nulls",
  139. "number",
  140. "object",
  141. "of",
  142. "on",
  143. "or",
  144. "outer",
  145. "override",
  146. "package",
  147. "parallel",
  148. "pragma",
  149. "private",
  150. "protected",
  151. "public",
  152. "retrieve",
  153. "return",
  154. "returning",
  155. "rollback",
  156. "savepoint",
  157. "search",
  158. "select",
  159. "set",
  160. "short",
  161. "sort",
  162. "stat",
  163. "static",
  164. "strictfp",
  165. "super",
  166. "switch",
  167. "synchronized",
  168. "system",
  169. "testmethod",
  170. "then",
  171. "this",
  172. "this_month",
  173. "this_week",
  174. "throw",
  175. "throws",
  176. "today",
  177. "tolabel",
  178. "tomorrow",
  179. "transaction",
  180. "transient",
  181. "trigger",
  182. "true",
  183. "try",
  184. "type",
  185. "undelete",
  186. "update",
  187. "upsert",
  188. "using",
  189. "virtual",
  190. "void",
  191. "volatile",
  192. "webservice",
  193. "when",
  194. "where",
  195. "while",
  196. "yesterday"
  197. ];
  198. var uppercaseFirstLetter = (lowercase) => lowercase.charAt(0).toUpperCase() + lowercase.substr(1);
  199. var keywordsWithCaseVariations = [];
  200. keywords.forEach((lowercase) => {
  201. keywordsWithCaseVariations.push(lowercase);
  202. keywordsWithCaseVariations.push(lowercase.toUpperCase());
  203. keywordsWithCaseVariations.push(uppercaseFirstLetter(lowercase));
  204. });
  205. var language = {
  206. defaultToken: "",
  207. tokenPostfix: ".apex",
  208. keywords: keywordsWithCaseVariations,
  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. symbols: /[=><!~?:&|+\-*\/\^%]+/,
  249. escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
  250. digits: /\d+(_+\d+)*/,
  251. octaldigits: /[0-7]+(_+[0-7]+)*/,
  252. binarydigits: /[0-1]+(_+[0-1]+)*/,
  253. hexdigits: /[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/,
  254. tokenizer: {
  255. root: [
  256. [
  257. /[a-z_$][\w$]*/,
  258. {
  259. cases: {
  260. "@keywords": { token: "keyword.$0" },
  261. "@default": "identifier"
  262. }
  263. }
  264. ],
  265. [
  266. /[A-Z][\w\$]*/,
  267. {
  268. cases: {
  269. "@keywords": { token: "keyword.$0" },
  270. "@default": "type.identifier"
  271. }
  272. }
  273. ],
  274. { include: "@whitespace" },
  275. [/[{}()\[\]]/, "@brackets"],
  276. [/[<>](?!@symbols)/, "@brackets"],
  277. [
  278. /@symbols/,
  279. {
  280. cases: {
  281. "@operators": "delimiter",
  282. "@default": ""
  283. }
  284. }
  285. ],
  286. [/@\s*[a-zA-Z_\$][\w\$]*/, "annotation"],
  287. [/(@digits)[eE]([\-+]?(@digits))?[fFdD]?/, "number.float"],
  288. [/(@digits)\.(@digits)([eE][\-+]?(@digits))?[fFdD]?/, "number.float"],
  289. [/(@digits)[fFdD]/, "number.float"],
  290. [/(@digits)[lL]?/, "number"],
  291. [/[;,.]/, "delimiter"],
  292. [/"([^"\\]|\\.)*$/, "string.invalid"],
  293. [/'([^'\\]|\\.)*$/, "string.invalid"],
  294. [/"/, "string", '@string."'],
  295. [/'/, "string", "@string.'"],
  296. [/'[^\\']'/, "string"],
  297. [/(')(@escapes)(')/, ["string", "string.escape", "string"]],
  298. [/'/, "string.invalid"]
  299. ],
  300. whitespace: [
  301. [/[ \t\r\n]+/, ""],
  302. [/\/\*\*(?!\/)/, "comment.doc", "@apexdoc"],
  303. [/\/\*/, "comment", "@comment"],
  304. [/\/\/.*$/, "comment"]
  305. ],
  306. comment: [
  307. [/[^\/*]+/, "comment"],
  308. [/\*\//, "comment", "@pop"],
  309. [/[\/*]/, "comment"]
  310. ],
  311. apexdoc: [
  312. [/[^\/*]+/, "comment.doc"],
  313. [/\*\//, "comment.doc", "@pop"],
  314. [/[\/*]/, "comment.doc"]
  315. ],
  316. string: [
  317. [/[^\\"']+/, "string"],
  318. [/@escapes/, "string.escape"],
  319. [/\\./, "string.escape.invalid"],
  320. [
  321. /["']/,
  322. {
  323. cases: {
  324. "$#==$S2": { token: "string", next: "@pop" },
  325. "@default": "string"
  326. }
  327. }
  328. ]
  329. ]
  330. }
  331. };
  332. return apex_exports;
  333. })();
  334. return moduleExports;
  335. });