flow9.js 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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/flow9/flow9", ["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/flow9/flow9.ts
  28. var flow9_exports = {};
  29. __export(flow9_exports, {
  30. conf: () => conf,
  31. language: () => language
  32. });
  33. var conf = {
  34. comments: {
  35. blockComment: ["/*", "*/"],
  36. lineComment: "//"
  37. },
  38. brackets: [
  39. ["{", "}"],
  40. ["[", "]"],
  41. ["(", ")"]
  42. ],
  43. autoClosingPairs: [
  44. { open: "{", close: "}", notIn: ["string"] },
  45. { open: "[", close: "]", notIn: ["string"] },
  46. { open: "(", close: ")", notIn: ["string"] },
  47. { open: '"', close: '"', notIn: ["string"] },
  48. { open: "'", close: "'", notIn: ["string"] }
  49. ],
  50. surroundingPairs: [
  51. { open: "{", close: "}" },
  52. { open: "[", close: "]" },
  53. { open: "(", close: ")" },
  54. { open: '"', close: '"' },
  55. { open: "'", close: "'" },
  56. { open: "<", close: ">" }
  57. ]
  58. };
  59. var language = {
  60. defaultToken: "",
  61. tokenPostfix: ".flow",
  62. keywords: [
  63. "import",
  64. "require",
  65. "export",
  66. "forbid",
  67. "native",
  68. "if",
  69. "else",
  70. "cast",
  71. "unsafe",
  72. "switch",
  73. "default"
  74. ],
  75. types: [
  76. "io",
  77. "mutable",
  78. "bool",
  79. "int",
  80. "double",
  81. "string",
  82. "flow",
  83. "void",
  84. "ref",
  85. "true",
  86. "false",
  87. "with"
  88. ],
  89. operators: [
  90. "=",
  91. ">",
  92. "<",
  93. "<=",
  94. ">=",
  95. "==",
  96. "!",
  97. "!=",
  98. ":=",
  99. "::=",
  100. "&&",
  101. "||",
  102. "+",
  103. "-",
  104. "*",
  105. "/",
  106. "@",
  107. "&",
  108. "%",
  109. ":",
  110. "->",
  111. "\\",
  112. "$",
  113. "??",
  114. "^"
  115. ],
  116. symbols: /[@$=><!~?:&|+\-*\\\/\^%]+/,
  117. escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
  118. tokenizer: {
  119. root: [
  120. [
  121. /[a-zA-Z_]\w*/,
  122. {
  123. cases: {
  124. "@keywords": "keyword",
  125. "@types": "type",
  126. "@default": "identifier"
  127. }
  128. }
  129. ],
  130. { include: "@whitespace" },
  131. [/[{}()\[\]]/, "delimiter"],
  132. [/[<>](?!@symbols)/, "delimiter"],
  133. [
  134. /@symbols/,
  135. {
  136. cases: {
  137. "@operators": "delimiter",
  138. "@default": ""
  139. }
  140. }
  141. ],
  142. [/((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)/, "number"],
  143. [/[;,.]/, "delimiter"],
  144. [/"([^"\\]|\\.)*$/, "string.invalid"],
  145. [/"/, "string", "@string"]
  146. ],
  147. whitespace: [
  148. [/[ \t\r\n]+/, ""],
  149. [/\/\*/, "comment", "@comment"],
  150. [/\/\/.*$/, "comment"]
  151. ],
  152. comment: [
  153. [/[^\/*]+/, "comment"],
  154. [/\*\//, "comment", "@pop"],
  155. [/[\/*]/, "comment"]
  156. ],
  157. string: [
  158. [/[^\\"]+/, "string"],
  159. [/@escapes/, "string.escape"],
  160. [/\\./, "string.escape.invalid"],
  161. [/"/, "string", "@pop"]
  162. ]
  163. }
  164. };
  165. return __toCommonJS(flow9_exports);
  166. })();
  167. return moduleExports;
  168. });