objective-c.js 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  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/objective-c/objective-c",[],()=>{
  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/objective-c/objective-c.ts
  17. var objective_c_exports = {};
  18. __export(objective_c_exports, {
  19. conf: () => conf,
  20. language: () => language
  21. });
  22. var conf = {
  23. comments: {
  24. lineComment: "//",
  25. blockComment: ["/*", "*/"]
  26. },
  27. brackets: [
  28. ["{", "}"],
  29. ["[", "]"],
  30. ["(", ")"]
  31. ],
  32. autoClosingPairs: [
  33. { open: "{", close: "}" },
  34. { open: "[", close: "]" },
  35. { open: "(", close: ")" },
  36. { open: '"', close: '"' },
  37. { open: "'", close: "'" }
  38. ],
  39. surroundingPairs: [
  40. { open: "{", close: "}" },
  41. { open: "[", close: "]" },
  42. { open: "(", close: ")" },
  43. { open: '"', close: '"' },
  44. { open: "'", close: "'" }
  45. ]
  46. };
  47. var language = {
  48. defaultToken: "",
  49. tokenPostfix: ".objective-c",
  50. keywords: [
  51. "#import",
  52. "#include",
  53. "#define",
  54. "#else",
  55. "#endif",
  56. "#if",
  57. "#ifdef",
  58. "#ifndef",
  59. "#ident",
  60. "#undef",
  61. "@class",
  62. "@defs",
  63. "@dynamic",
  64. "@encode",
  65. "@end",
  66. "@implementation",
  67. "@interface",
  68. "@package",
  69. "@private",
  70. "@protected",
  71. "@property",
  72. "@protocol",
  73. "@public",
  74. "@selector",
  75. "@synthesize",
  76. "__declspec",
  77. "assign",
  78. "auto",
  79. "BOOL",
  80. "break",
  81. "bycopy",
  82. "byref",
  83. "case",
  84. "char",
  85. "Class",
  86. "const",
  87. "copy",
  88. "continue",
  89. "default",
  90. "do",
  91. "double",
  92. "else",
  93. "enum",
  94. "extern",
  95. "FALSE",
  96. "false",
  97. "float",
  98. "for",
  99. "goto",
  100. "if",
  101. "in",
  102. "int",
  103. "id",
  104. "inout",
  105. "IMP",
  106. "long",
  107. "nil",
  108. "nonatomic",
  109. "NULL",
  110. "oneway",
  111. "out",
  112. "private",
  113. "public",
  114. "protected",
  115. "readwrite",
  116. "readonly",
  117. "register",
  118. "return",
  119. "SEL",
  120. "self",
  121. "short",
  122. "signed",
  123. "sizeof",
  124. "static",
  125. "struct",
  126. "super",
  127. "switch",
  128. "typedef",
  129. "TRUE",
  130. "true",
  131. "union",
  132. "unsigned",
  133. "volatile",
  134. "void",
  135. "while"
  136. ],
  137. decpart: /\d(_?\d)*/,
  138. decimal: /0|@decpart/,
  139. tokenizer: {
  140. root: [
  141. { include: "@comments" },
  142. { include: "@whitespace" },
  143. { include: "@numbers" },
  144. { include: "@strings" },
  145. [/[,:;]/, "delimiter"],
  146. [/[{}\[\]()<>]/, "@brackets"],
  147. [
  148. /[a-zA-Z@#]\w*/,
  149. {
  150. cases: {
  151. "@keywords": "keyword",
  152. "@default": "identifier"
  153. }
  154. }
  155. ],
  156. [/[<>=\\+\\-\\*\\/\\^\\|\\~,]|and\\b|or\\b|not\\b]/, "operator"]
  157. ],
  158. whitespace: [[/\s+/, "white"]],
  159. comments: [
  160. ["\\/\\*", "comment", "@comment"],
  161. ["\\/\\/+.*", "comment"]
  162. ],
  163. comment: [
  164. ["\\*\\/", "comment", "@pop"],
  165. [".", "comment"]
  166. ],
  167. numbers: [
  168. [/0[xX][0-9a-fA-F]*(_?[0-9a-fA-F])*/, "number.hex"],
  169. [
  170. /@decimal((\.@decpart)?([eE][\-+]?@decpart)?)[fF]*/,
  171. {
  172. cases: {
  173. "(\\d)*": "number",
  174. $0: "number.float"
  175. }
  176. }
  177. ]
  178. ],
  179. strings: [
  180. [/'$/, "string.escape", "@popall"],
  181. [/'/, "string.escape", "@stringBody"],
  182. [/"$/, "string.escape", "@popall"],
  183. [/"/, "string.escape", "@dblStringBody"]
  184. ],
  185. stringBody: [
  186. [/[^\\']+$/, "string", "@popall"],
  187. [/[^\\']+/, "string"],
  188. [/\\./, "string"],
  189. [/'/, "string.escape", "@popall"],
  190. [/\\$/, "string"]
  191. ],
  192. dblStringBody: [
  193. [/[^\\"]+$/, "string", "@popall"],
  194. [/[^\\"]+/, "string"],
  195. [/\\./, "string"],
  196. [/"/, "string.escape", "@popall"],
  197. [/\\$/, "string"]
  198. ]
  199. }
  200. };
  201. return objective_c_exports;
  202. })();
  203. return moduleExports;
  204. });