sb.js 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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/sb/sb",[],()=>{
  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/sb/sb.ts
  17. var sb_exports = {};
  18. __export(sb_exports, {
  19. conf: () => conf,
  20. language: () => language
  21. });
  22. var conf = {
  23. comments: {
  24. lineComment: "'"
  25. },
  26. brackets: [
  27. ["(", ")"],
  28. ["[", "]"],
  29. ["If", "EndIf"],
  30. ["While", "EndWhile"],
  31. ["For", "EndFor"],
  32. ["Sub", "EndSub"]
  33. ],
  34. autoClosingPairs: [
  35. { open: '"', close: '"', notIn: ["string", "comment"] },
  36. { open: "(", close: ")", notIn: ["string", "comment"] },
  37. { open: "[", close: "]", notIn: ["string", "comment"] }
  38. ]
  39. };
  40. var language = {
  41. defaultToken: "",
  42. tokenPostfix: ".sb",
  43. ignoreCase: true,
  44. brackets: [
  45. { token: "delimiter.array", open: "[", close: "]" },
  46. { token: "delimiter.parenthesis", open: "(", close: ")" },
  47. { token: "keyword.tag-if", open: "If", close: "EndIf" },
  48. { token: "keyword.tag-while", open: "While", close: "EndWhile" },
  49. { token: "keyword.tag-for", open: "For", close: "EndFor" },
  50. { token: "keyword.tag-sub", open: "Sub", close: "EndSub" }
  51. ],
  52. keywords: [
  53. "Else",
  54. "ElseIf",
  55. "EndFor",
  56. "EndIf",
  57. "EndSub",
  58. "EndWhile",
  59. "For",
  60. "Goto",
  61. "If",
  62. "Step",
  63. "Sub",
  64. "Then",
  65. "To",
  66. "While"
  67. ],
  68. tagwords: ["If", "Sub", "While", "For"],
  69. operators: [">", "<", "<>", "<=", ">=", "And", "Or", "+", "-", "*", "/", "="],
  70. identifier: /[a-zA-Z_][\w]*/,
  71. symbols: /[=><:+\-*\/%\.,]+/,
  72. escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
  73. tokenizer: {
  74. root: [
  75. { include: "@whitespace" },
  76. [/(@identifier)(?=[.])/, "type"],
  77. [
  78. /@identifier/,
  79. {
  80. cases: {
  81. "@keywords": { token: "keyword.$0" },
  82. "@operators": "operator",
  83. "@default": "variable.name"
  84. }
  85. }
  86. ],
  87. [
  88. /([.])(@identifier)/,
  89. {
  90. cases: {
  91. $2: ["delimiter", "type.member"],
  92. "@default": ""
  93. }
  94. }
  95. ],
  96. [/\d*\.\d+/, "number.float"],
  97. [/\d+/, "number"],
  98. [/[()\[\]]/, "@brackets"],
  99. [
  100. /@symbols/,
  101. {
  102. cases: {
  103. "@operators": "operator",
  104. "@default": "delimiter"
  105. }
  106. }
  107. ],
  108. [/"([^"\\]|\\.)*$/, "string.invalid"],
  109. [/"/, "string", "@string"]
  110. ],
  111. whitespace: [
  112. [/[ \t\r\n]+/, ""],
  113. [/(\').*$/, "comment"]
  114. ],
  115. string: [
  116. [/[^\\"]+/, "string"],
  117. [/@escapes/, "string.escape"],
  118. [/\\./, "string.escape.invalid"],
  119. [/"C?/, "string", "@pop"]
  120. ]
  121. }
  122. };
  123. return sb_exports;
  124. })();
  125. return moduleExports;
  126. });