cameligo.js 4.8 KB

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