source: node_modules/refractor/lang/aql.js@ e48199a

main
Last change on this file since e48199a was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago

Initial commit

  • Property mode set to 100644
File size: 1.5 KB
Line 
1'use strict'
2
3module.exports = aql
4aql.displayName = 'aql'
5aql.aliases = []
6function aql(Prism) {
7 Prism.languages.aql = {
8 comment: /\/\/.*|\/\*[\s\S]*?\*\//,
9 property: {
10 pattern:
11 /([{,]\s*)(?:(?!\d)\w+|(["'´`])(?:(?!\2)[^\\\r\n]|\\.)*\2)(?=\s*:)/,
12 lookbehind: true,
13 greedy: true
14 },
15 string: {
16 pattern: /(["'])(?:(?!\1)[^\\\r\n]|\\.)*\1/,
17 greedy: true
18 },
19 identifier: {
20 pattern: /([´`])(?:(?!\1)[^\\\r\n]|\\.)*\1/,
21 greedy: true
22 },
23 variable: /@@?\w+/,
24 keyword: [
25 {
26 pattern: /(\bWITH\s+)COUNT(?=\s+INTO\b)/i,
27 lookbehind: true
28 },
29 /\b(?:AGGREGATE|ALL|AND|ANY|ASC|COLLECT|DESC|DISTINCT|FILTER|FOR|GRAPH|IN|INBOUND|INSERT|INTO|K_PATHS|K_SHORTEST_PATHS|LET|LIKE|LIMIT|NONE|NOT|NULL|OR|OUTBOUND|REMOVE|REPLACE|RETURN|SHORTEST_PATH|SORT|UPDATE|UPSERT|WINDOW|WITH)\b/i, // pseudo keywords get a lookbehind to avoid false positives
30 {
31 pattern: /(^|[^\w.[])(?:KEEP|PRUNE|SEARCH|TO)\b/i,
32 lookbehind: true
33 },
34 {
35 pattern: /(^|[^\w.[])(?:CURRENT|NEW|OLD)\b/,
36 lookbehind: true
37 },
38 {
39 pattern: /\bOPTIONS(?=\s*\{)/i
40 }
41 ],
42 function: /\b(?!\d)\w+(?=\s*\()/,
43 boolean: /\b(?:false|true)\b/i,
44 range: {
45 pattern: /\.\./,
46 alias: 'operator'
47 },
48 number: [
49 /\b0b[01]+/i,
50 /\b0x[0-9a-f]+/i,
51 /(?:\B\.\d+|\b(?:0|[1-9]\d*)(?:\.\d+)?)(?:e[+-]?\d+)?/i
52 ],
53 operator: /\*{2,}|[=!]~|[!=<>]=?|&&|\|\||[-+*/%]/,
54 punctuation: /::|[?.:,;()[\]{}]/
55 }
56}
Note: See TracBrowser for help on using the repository browser.