objective-c.js 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. "use strict";
  2. /*!-----------------------------------------------------------------------------
  3. * Copyright (c) Microsoft Corporation. All rights reserved.
  4. * Version: 0.38.0(0e330ae453813de4e6cf272460fb79c7117073d0)
  5. * Released under the MIT license
  6. * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
  7. *-----------------------------------------------------------------------------*/
  8. define("vs/basic-languages/objective-c/objective-c", ["require"],(require)=>{
  9. var moduleExports = (() => {
  10. var __defProp = Object.defineProperty;
  11. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  12. var __getOwnPropNames = Object.getOwnPropertyNames;
  13. var __hasOwnProp = Object.prototype.hasOwnProperty;
  14. var __export = (target, all) => {
  15. for (var name in all)
  16. __defProp(target, name, { get: all[name], enumerable: true });
  17. };
  18. var __copyProps = (to, from, except, desc) => {
  19. if (from && typeof from === "object" || typeof from === "function") {
  20. for (let key of __getOwnPropNames(from))
  21. if (!__hasOwnProp.call(to, key) && key !== except)
  22. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  23. }
  24. return to;
  25. };
  26. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  27. // src/basic-languages/objective-c/objective-c.ts
  28. var objective_c_exports = {};
  29. __export(objective_c_exports, {
  30. conf: () => conf,
  31. language: () => language
  32. });
  33. var conf = {
  34. comments: {
  35. lineComment: "//",
  36. blockComment: ["/*", "*/"]
  37. },
  38. brackets: [
  39. ["{", "}"],
  40. ["[", "]"],
  41. ["(", ")"]
  42. ],
  43. autoClosingPairs: [
  44. { open: "{", close: "}" },
  45. { open: "[", close: "]" },
  46. { open: "(", close: ")" },
  47. { open: '"', close: '"' },
  48. { open: "'", close: "'" }
  49. ],
  50. surroundingPairs: [
  51. { open: "{", close: "}" },
  52. { open: "[", close: "]" },
  53. { open: "(", close: ")" },
  54. { open: '"', close: '"' },
  55. { open: "'", close: "'" }
  56. ]
  57. };
  58. var language = {
  59. defaultToken: "",
  60. tokenPostfix: ".objective-c",
  61. keywords: [
  62. "#import",
  63. "#include",
  64. "#define",
  65. "#else",
  66. "#endif",
  67. "#if",
  68. "#ifdef",
  69. "#ifndef",
  70. "#ident",
  71. "#undef",
  72. "@class",
  73. "@defs",
  74. "@dynamic",
  75. "@encode",
  76. "@end",
  77. "@implementation",
  78. "@interface",
  79. "@package",
  80. "@private",
  81. "@protected",
  82. "@property",
  83. "@protocol",
  84. "@public",
  85. "@selector",
  86. "@synthesize",
  87. "__declspec",
  88. "assign",
  89. "auto",
  90. "BOOL",
  91. "break",
  92. "bycopy",
  93. "byref",
  94. "case",
  95. "char",
  96. "Class",
  97. "const",
  98. "copy",
  99. "continue",
  100. "default",
  101. "do",
  102. "double",
  103. "else",
  104. "enum",
  105. "extern",
  106. "FALSE",
  107. "false",
  108. "float",
  109. "for",
  110. "goto",
  111. "if",
  112. "in",
  113. "int",
  114. "id",
  115. "inout",
  116. "IMP",
  117. "long",
  118. "nil",
  119. "nonatomic",
  120. "NULL",
  121. "oneway",
  122. "out",
  123. "private",
  124. "public",
  125. "protected",
  126. "readwrite",
  127. "readonly",
  128. "register",
  129. "return",
  130. "SEL",
  131. "self",
  132. "short",
  133. "signed",
  134. "sizeof",
  135. "static",
  136. "struct",
  137. "super",
  138. "switch",
  139. "typedef",
  140. "TRUE",
  141. "true",
  142. "union",
  143. "unsigned",
  144. "volatile",
  145. "void",
  146. "while"
  147. ],
  148. decpart: /\d(_?\d)*/,
  149. decimal: /0|@decpart/,
  150. tokenizer: {
  151. root: [
  152. { include: "@comments" },
  153. { include: "@whitespace" },
  154. { include: "@numbers" },
  155. { include: "@strings" },
  156. [/[,:;]/, "delimiter"],
  157. [/[{}\[\]()<>]/, "@brackets"],
  158. [
  159. /[a-zA-Z@#]\w*/,
  160. {
  161. cases: {
  162. "@keywords": "keyword",
  163. "@default": "identifier"
  164. }
  165. }
  166. ],
  167. [/[<>=\\+\\-\\*\\/\\^\\|\\~,]|and\\b|or\\b|not\\b]/, "operator"]
  168. ],
  169. whitespace: [[/\s+/, "white"]],
  170. comments: [
  171. ["\\/\\*", "comment", "@comment"],
  172. ["\\/\\/+.*", "comment"]
  173. ],
  174. comment: [
  175. ["\\*\\/", "comment", "@pop"],
  176. [".", "comment"]
  177. ],
  178. numbers: [
  179. [/0[xX][0-9a-fA-F]*(_?[0-9a-fA-F])*/, "number.hex"],
  180. [
  181. /@decimal((\.@decpart)?([eE][\-+]?@decpart)?)[fF]*/,
  182. {
  183. cases: {
  184. "(\\d)*": "number",
  185. $0: "number.float"
  186. }
  187. }
  188. ]
  189. ],
  190. strings: [
  191. [/'$/, "string.escape", "@popall"],
  192. [/'/, "string.escape", "@stringBody"],
  193. [/"$/, "string.escape", "@popall"],
  194. [/"/, "string.escape", "@dblStringBody"]
  195. ],
  196. stringBody: [
  197. [/[^\\']+$/, "string", "@popall"],
  198. [/[^\\']+/, "string"],
  199. [/\\./, "string"],
  200. [/'/, "string.escape", "@popall"],
  201. [/\\$/, "string"]
  202. ],
  203. dblStringBody: [
  204. [/[^\\"]+$/, "string", "@popall"],
  205. [/[^\\"]+/, "string"],
  206. [/\\./, "string"],
  207. [/"/, "string.escape", "@popall"],
  208. [/\\$/, "string"]
  209. ]
  210. }
  211. };
  212. return __toCommonJS(objective_c_exports);
  213. })();
  214. return moduleExports;
  215. });