java.js 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  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/java/java",[],()=>{
  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/java/java.ts
  17. var java_exports = {};
  18. __export(java_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 language = {
  56. defaultToken: "",
  57. tokenPostfix: ".java",
  58. keywords: [
  59. "abstract",
  60. "continue",
  61. "for",
  62. "new",
  63. "switch",
  64. "assert",
  65. "default",
  66. "goto",
  67. "package",
  68. "synchronized",
  69. "boolean",
  70. "do",
  71. "if",
  72. "private",
  73. "this",
  74. "break",
  75. "double",
  76. "implements",
  77. "protected",
  78. "throw",
  79. "byte",
  80. "else",
  81. "import",
  82. "public",
  83. "throws",
  84. "case",
  85. "enum",
  86. "instanceof",
  87. "return",
  88. "transient",
  89. "catch",
  90. "extends",
  91. "int",
  92. "short",
  93. "try",
  94. "char",
  95. "final",
  96. "interface",
  97. "static",
  98. "void",
  99. "class",
  100. "finally",
  101. "long",
  102. "strictfp",
  103. "volatile",
  104. "const",
  105. "float",
  106. "native",
  107. "super",
  108. "while",
  109. "true",
  110. "false",
  111. "yield",
  112. "record",
  113. "sealed",
  114. "non-sealed",
  115. "permits"
  116. ],
  117. operators: [
  118. "=",
  119. ">",
  120. "<",
  121. "!",
  122. "~",
  123. "?",
  124. ":",
  125. "==",
  126. "<=",
  127. ">=",
  128. "!=",
  129. "&&",
  130. "||",
  131. "++",
  132. "--",
  133. "+",
  134. "-",
  135. "*",
  136. "/",
  137. "&",
  138. "|",
  139. "^",
  140. "%",
  141. "<<",
  142. ">>",
  143. ">>>",
  144. "+=",
  145. "-=",
  146. "*=",
  147. "/=",
  148. "&=",
  149. "|=",
  150. "^=",
  151. "%=",
  152. "<<=",
  153. ">>=",
  154. ">>>="
  155. ],
  156. symbols: /[=><!~?:&|+\-*\/\^%]+/,
  157. escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
  158. digits: /\d+(_+\d+)*/,
  159. octaldigits: /[0-7]+(_+[0-7]+)*/,
  160. binarydigits: /[0-1]+(_+[0-1]+)*/,
  161. hexdigits: /[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/,
  162. tokenizer: {
  163. root: [
  164. ["non-sealed", "keyword.non-sealed"],
  165. [
  166. /[a-zA-Z_$][\w$]*/,
  167. {
  168. cases: {
  169. "@keywords": { token: "keyword.$0" },
  170. "@default": "identifier"
  171. }
  172. }
  173. ],
  174. { include: "@whitespace" },
  175. [/[{}()\[\]]/, "@brackets"],
  176. [/[<>](?!@symbols)/, "@brackets"],
  177. [
  178. /@symbols/,
  179. {
  180. cases: {
  181. "@operators": "delimiter",
  182. "@default": ""
  183. }
  184. }
  185. ],
  186. [/@\s*[a-zA-Z_\$][\w\$]*/, "annotation"],
  187. [/(@digits)[eE]([\-+]?(@digits))?[fFdD]?/, "number.float"],
  188. [/(@digits)\.(@digits)([eE][\-+]?(@digits))?[fFdD]?/, "number.float"],
  189. [/0[xX](@hexdigits)[Ll]?/, "number.hex"],
  190. [/0(@octaldigits)[Ll]?/, "number.octal"],
  191. [/0[bB](@binarydigits)[Ll]?/, "number.binary"],
  192. [/(@digits)[fFdD]/, "number.float"],
  193. [/(@digits)[lL]?/, "number"],
  194. [/[;,.]/, "delimiter"],
  195. [/"([^"\\]|\\.)*$/, "string.invalid"],
  196. [/"""/, "string", "@multistring"],
  197. [/"/, "string", "@string"],
  198. [/'[^\\']'/, "string"],
  199. [/(')(@escapes)(')/, ["string", "string.escape", "string"]],
  200. [/'/, "string.invalid"]
  201. ],
  202. whitespace: [
  203. [/[ \t\r\n]+/, ""],
  204. [/\/\*\*(?!\/)/, "comment.doc", "@javadoc"],
  205. [/\/\*/, "comment", "@comment"],
  206. [/\/\/.*$/, "comment"]
  207. ],
  208. comment: [
  209. [/[^\/*]+/, "comment"],
  210. [/\*\//, "comment", "@pop"],
  211. [/[\/*]/, "comment"]
  212. ],
  213. javadoc: [
  214. [/[^\/*]+/, "comment.doc"],
  215. [/\/\*/, "comment.doc.invalid"],
  216. [/\*\//, "comment.doc", "@pop"],
  217. [/[\/*]/, "comment.doc"]
  218. ],
  219. string: [
  220. [/[^\\"]+/, "string"],
  221. [/@escapes/, "string.escape"],
  222. [/\\./, "string.escape.invalid"],
  223. [/"/, "string", "@pop"]
  224. ],
  225. multistring: [
  226. [/[^\\"]+/, "string"],
  227. [/@escapes/, "string.escape"],
  228. [/\\./, "string.escape.invalid"],
  229. [/"""/, "string", "@pop"],
  230. [/./, "string"]
  231. ]
  232. }
  233. };
  234. return java_exports;
  235. })();
  236. return moduleExports;
  237. });