sparql.js 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. "use strict";
  2. /*!-----------------------------------------------------------------------------
  3. * Copyright (c) Microsoft Corporation. All rights reserved.
  4. * Version: 0.38.0(0e330ae453813de4e6cf272460fb79c7117073d0)
  5. * Released under the MIT license
  6. * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
  7. *-----------------------------------------------------------------------------*/
  8. define("vs/basic-languages/sparql/sparql", ["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/sparql/sparql.ts
  28. var sparql_exports = {};
  29. __export(sparql_exports, {
  30. conf: () => conf,
  31. language: () => language
  32. });
  33. var conf = {
  34. comments: {
  35. lineComment: "#"
  36. },
  37. brackets: [
  38. ["{", "}"],
  39. ["[", "]"],
  40. ["(", ")"]
  41. ],
  42. autoClosingPairs: [
  43. { open: "'", close: "'", notIn: ["string"] },
  44. { open: '"', close: '"', notIn: ["string"] },
  45. { open: "{", close: "}" },
  46. { open: "[", close: "]" },
  47. { open: "(", close: ")" }
  48. ]
  49. };
  50. var language = {
  51. defaultToken: "",
  52. tokenPostfix: ".rq",
  53. brackets: [
  54. { token: "delimiter.curly", open: "{", close: "}" },
  55. { token: "delimiter.parenthesis", open: "(", close: ")" },
  56. { token: "delimiter.square", open: "[", close: "]" },
  57. { token: "delimiter.angle", open: "<", close: ">" }
  58. ],
  59. keywords: [
  60. "add",
  61. "as",
  62. "asc",
  63. "ask",
  64. "base",
  65. "by",
  66. "clear",
  67. "construct",
  68. "copy",
  69. "create",
  70. "data",
  71. "delete",
  72. "desc",
  73. "describe",
  74. "distinct",
  75. "drop",
  76. "false",
  77. "filter",
  78. "from",
  79. "graph",
  80. "group",
  81. "having",
  82. "in",
  83. "insert",
  84. "limit",
  85. "load",
  86. "minus",
  87. "move",
  88. "named",
  89. "not",
  90. "offset",
  91. "optional",
  92. "order",
  93. "prefix",
  94. "reduced",
  95. "select",
  96. "service",
  97. "silent",
  98. "to",
  99. "true",
  100. "undef",
  101. "union",
  102. "using",
  103. "values",
  104. "where",
  105. "with"
  106. ],
  107. builtinFunctions: [
  108. "a",
  109. "abs",
  110. "avg",
  111. "bind",
  112. "bnode",
  113. "bound",
  114. "ceil",
  115. "coalesce",
  116. "concat",
  117. "contains",
  118. "count",
  119. "datatype",
  120. "day",
  121. "encode_for_uri",
  122. "exists",
  123. "floor",
  124. "group_concat",
  125. "hours",
  126. "if",
  127. "iri",
  128. "isblank",
  129. "isiri",
  130. "isliteral",
  131. "isnumeric",
  132. "isuri",
  133. "lang",
  134. "langmatches",
  135. "lcase",
  136. "max",
  137. "md5",
  138. "min",
  139. "minutes",
  140. "month",
  141. "now",
  142. "rand",
  143. "regex",
  144. "replace",
  145. "round",
  146. "sameterm",
  147. "sample",
  148. "seconds",
  149. "sha1",
  150. "sha256",
  151. "sha384",
  152. "sha512",
  153. "str",
  154. "strafter",
  155. "strbefore",
  156. "strdt",
  157. "strends",
  158. "strlang",
  159. "strlen",
  160. "strstarts",
  161. "struuid",
  162. "substr",
  163. "sum",
  164. "timezone",
  165. "tz",
  166. "ucase",
  167. "uri",
  168. "uuid",
  169. "year"
  170. ],
  171. ignoreCase: true,
  172. tokenizer: {
  173. root: [
  174. [/<[^\s\u00a0>]*>?/, "tag"],
  175. { include: "@strings" },
  176. [/#.*/, "comment"],
  177. [/[{}()\[\]]/, "@brackets"],
  178. [/[;,.]/, "delimiter"],
  179. [/[_\w\d]+:(\.(?=[\w_\-\\%])|[:\w_-]|\\[-\\_~.!$&'()*+,;=/?#@%]|%[a-f\d][a-f\d])*/, "tag"],
  180. [/:(\.(?=[\w_\-\\%])|[:\w_-]|\\[-\\_~.!$&'()*+,;=/?#@%]|%[a-f\d][a-f\d])+/, "tag"],
  181. [
  182. /[$?]?[_\w\d]+/,
  183. {
  184. cases: {
  185. "@keywords": { token: "keyword" },
  186. "@builtinFunctions": { token: "predefined.sql" },
  187. "@default": "identifier"
  188. }
  189. }
  190. ],
  191. [/\^\^/, "operator.sql"],
  192. [/\^[*+\-<>=&|^\/!?]*/, "operator.sql"],
  193. [/[*+\-<>=&|\/!?]/, "operator.sql"],
  194. [/@[a-z\d\-]*/, "metatag.html"],
  195. [/\s+/, "white"]
  196. ],
  197. strings: [
  198. [/'([^'\\]|\\.)*$/, "string.invalid"],
  199. [/'$/, "string.sql", "@pop"],
  200. [/'/, "string.sql", "@stringBody"],
  201. [/"([^"\\]|\\.)*$/, "string.invalid"],
  202. [/"$/, "string.sql", "@pop"],
  203. [/"/, "string.sql", "@dblStringBody"]
  204. ],
  205. stringBody: [
  206. [/[^\\']+/, "string.sql"],
  207. [/\\./, "string.escape"],
  208. [/'/, "string.sql", "@pop"]
  209. ],
  210. dblStringBody: [
  211. [/[^\\"]+/, "string.sql"],
  212. [/\\./, "string.escape"],
  213. [/"/, "string.sql", "@pop"]
  214. ]
  215. }
  216. };
  217. return __toCommonJS(sparql_exports);
  218. })();
  219. return moduleExports;
  220. });