cameligo.js 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  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/cameligo/cameligo",[],()=>{
  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/cameligo/cameligo.ts
  17. var cameligo_exports = {};
  18. __export(cameligo_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. ],
  33. autoClosingPairs: [
  34. { open: "{", close: "}" },
  35. { open: "[", close: "]" },
  36. { open: "(", close: ")" },
  37. { open: "<", close: ">" },
  38. { open: "'", close: "'" },
  39. { open: '"', close: '"' },
  40. { open: "(*", close: "*)" }
  41. ],
  42. surroundingPairs: [
  43. { open: "{", close: "}" },
  44. { open: "[", close: "]" },
  45. { open: "(", close: ")" },
  46. { open: "<", close: ">" },
  47. { open: "'", close: "'" },
  48. { open: '"', close: '"' },
  49. { open: "(*", close: "*)" }
  50. ]
  51. };
  52. var language = {
  53. defaultToken: "",
  54. tokenPostfix: ".cameligo",
  55. ignoreCase: true,
  56. brackets: [
  57. { open: "{", close: "}", token: "delimiter.curly" },
  58. { open: "[", close: "]", token: "delimiter.square" },
  59. { open: "(", close: ")", token: "delimiter.parenthesis" },
  60. { open: "<", close: ">", token: "delimiter.angle" }
  61. ],
  62. keywords: [
  63. "abs",
  64. "assert",
  65. "block",
  66. "Bytes",
  67. "case",
  68. "Crypto",
  69. "Current",
  70. "else",
  71. "failwith",
  72. "false",
  73. "for",
  74. "fun",
  75. "if",
  76. "in",
  77. "let",
  78. "let%entry",
  79. "let%init",
  80. "List",
  81. "list",
  82. "Map",
  83. "map",
  84. "match",
  85. "match%nat",
  86. "mod",
  87. "not",
  88. "operation",
  89. "Operation",
  90. "of",
  91. "record",
  92. "Set",
  93. "set",
  94. "sender",
  95. "skip",
  96. "source",
  97. "String",
  98. "then",
  99. "to",
  100. "true",
  101. "type",
  102. "with"
  103. ],
  104. typeKeywords: ["int", "unit", "string", "tz", "nat", "bool"],
  105. operators: [
  106. "=",
  107. ">",
  108. "<",
  109. "<=",
  110. ">=",
  111. "<>",
  112. ":",
  113. ":=",
  114. "and",
  115. "mod",
  116. "or",
  117. "+",
  118. "-",
  119. "*",
  120. "/",
  121. "@",
  122. "&",
  123. "^",
  124. "%",
  125. "->",
  126. "<-",
  127. "&&",
  128. "||"
  129. ],
  130. symbols: /[=><:@\^&|+\-*\/\^%]+/,
  131. tokenizer: {
  132. root: [
  133. [
  134. /[a-zA-Z_][\w]*/,
  135. {
  136. cases: {
  137. "@keywords": { token: "keyword.$0" },
  138. "@default": "identifier"
  139. }
  140. }
  141. ],
  142. { include: "@whitespace" },
  143. [/[{}()\[\]]/, "@brackets"],
  144. [/[<>](?!@symbols)/, "@brackets"],
  145. [
  146. /@symbols/,
  147. {
  148. cases: {
  149. "@operators": "delimiter",
  150. "@default": ""
  151. }
  152. }
  153. ],
  154. [/\d*\.\d+([eE][\-+]?\d+)?/, "number.float"],
  155. [/\$[0-9a-fA-F]{1,16}/, "number.hex"],
  156. [/\d+/, "number"],
  157. [/[;,.]/, "delimiter"],
  158. [/'([^'\\]|\\.)*$/, "string.invalid"],
  159. [/'/, "string", "@string"],
  160. [/'[^\\']'/, "string"],
  161. [/'/, "string.invalid"],
  162. [/\#\d+/, "string"]
  163. ],
  164. comment: [
  165. [/[^\(\*]+/, "comment"],
  166. [/\*\)/, "comment", "@pop"],
  167. [/\(\*/, "comment"]
  168. ],
  169. string: [
  170. [/[^\\']+/, "string"],
  171. [/\\./, "string.escape.invalid"],
  172. [/'/, { token: "string.quote", bracket: "@close", next: "@pop" }]
  173. ],
  174. whitespace: [
  175. [/[ \t\r\n]+/, "white"],
  176. [/\(\*/, "comment", "@comment"],
  177. [/\/\/.*$/, "comment"]
  178. ]
  179. }
  180. };
  181. return cameligo_exports;
  182. })();
  183. return moduleExports;
  184. });