sparql.js 4.7 KB

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