| 1 |
ace.define("ace/mode/aql_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict"; |
| 2 |
var oop = require("../lib/oop"); |
| 3 |
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; |
| 4 |
var AqlHighlightRules = function () { |
| 5 |
var keywords = ("for|return|filter|search|sort|limit|let|collect|asc|desc|in|into|insert|update|remove|replace|upsert|options|with|and|or|not|distinct|graph|shortest_path|outbound|inbound|any|all|none|at least|aggregate|like|k_shortest_paths|k_paths|all_shortest_paths|prune|window"); |
| 6 |
var builtinConstants = ("true|false"); |
| 7 |
var builtinFunctions = ("to_bool|to_number|to_string|to_array|to_list|is_null|is_bool|is_number|is_string|is_array|is_list|is_object|is_document|is_datestring|" + |
| 8 |
"typename|json_stringify|json_parse|concat|concat_separator|char_length|lower|upper|substring|left|right|trim|reverse|contains|" + |
| 9 |
"log|log2|log10|exp|exp2|sin|cos|tan|asin|acos|atan|atan2|radians|degrees|pi|regex_test|regex_replace|" + |
| 10 |
"like|floor|ceil|round|abs|rand|sqrt|pow|length|count|min|max|average|avg|sum|product|median|variance_population|variance_sample|variance|percentile|" + |
| 11 |
"bit_and|bit_or|bit_xor|bit_negate|bit_test|bit_popcount|bit_shift_left|bit_shift_right|bit_construct|bit_deconstruct|bit_to_string|bit_from_string|" + |
| 12 |
"first|last|unique|outersection|interleave|in_range|jaccard|matches|merge|merge_recursive|has|attributes|keys|values|unset|unset_recursive|keep|keep_recursive|" + |
| 13 |
"near|within|within_rectangle|is_in_polygon|distance|fulltext|stddev_sample|stddev_population|stddev|" + |
| 14 |
"slice|nth|position|contains_array|translate|zip|call|apply|push|append|pop|shift|unshift|remove_value|remove_values|" + |
| 15 |
"remove_nth|replace_nth|date_now|date_timestamp|date_iso8601|date_dayofweek|date_year|date_month|date_day|date_hour|" + |
| 16 |
"date_minute|date_second|date_millisecond|date_dayofyear|date_isoweek|date_isoweekyear|date_leapyear|date_quarter|date_days_in_month|date_trunc|date_round|" + |
| 17 |
"date_add|date_subtract|date_diff|date_compare|date_format|date_utctolocal|date_localtoutc|date_timezone|date_timezones|" + |
| 18 |
"fail|passthru|v8|sleep|schema_get|schema_validate|shard_id|call_greenspun|version|noopt|noeval|not_null|" + |
| 19 |
"first_list|first_document|parse_identifier|current_user|current_database|collection_count|pregel_result|" + |
| 20 |
"collections|document|decode_rev|range|union|union_distinct|minus|intersection|flatten|is_same_collection|check_document|" + |
| 21 |
"ltrim|rtrim|find_first|find_last|split|substitute|ipv4_to_number|ipv4_from_number|is_ipv4|md5|sha1|sha512|crc32|fnv64|hash|random_token|to_base64|" + |
| 22 |
"to_hex|encode_uri_component|soundex|assert|warn|is_key|sorted|sorted_unique|count_distinct|count_unique|" + |
| 23 |
"levenshtein_distance|levenshtein_match|regex_matches|regex_split|ngram_match|ngram_similarity|ngram_positional_similarity|uuid|" + |
| 24 |
"tokens|exists|starts_with|phrase|min_match|bm25|tfidf|boost|analyzer|" + |
| 25 |
"cosine_similarity|decay_exp|decay_gauss|decay_linear|l1_distance|l2_distance|minhash|minhash_count|minhash_error|minhash_match|" + |
| 26 |
"geo_point|geo_multipoint|geo_polygon|geo_multipolygon|geo_linestring|geo_multilinestring|geo_contains|geo_intersects|" + |
| 27 |
"geo_equals|geo_distance|geo_area|geo_in_range"); |
| 28 |
var keywordMapper = this.createKeywordMapper({ |
| 29 |
"support.function": builtinFunctions, |
| 30 |
"keyword": keywords, |
| 31 |
"constant.language": builtinConstants |
| 32 |
}, "identifier", true); |
| 33 |
this.$rules = { |
| 34 |
"start": [{ |
| 35 |
token: "comment", |
| 36 |
regex: "//.*$" |
| 37 |
}, { |
| 38 |
token: "string", |
| 39 |
regex: '".*?"' |
| 40 |
}, { |
| 41 |
token: "string", |
| 42 |
regex: "'.*?'" |
| 43 |
}, { |
| 44 |
token: "constant.numeric", |
| 45 |
regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" |
| 46 |
}, { |
| 47 |
token: keywordMapper, |
| 48 |
regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" |
| 49 |
}, { |
| 50 |
token: "keyword.operator", |
| 51 |
regex: "\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|=" |
| 52 |
}, { |
| 53 |
token: "paren.lparen", |
| 54 |
regex: "[\\(]" |
| 55 |
}, { |
| 56 |
token: "paren.rparen", |
| 57 |
regex: "[\\)]" |
| 58 |
}, { |
| 59 |
token: "text", |
| 60 |
regex: "\\s+" |
| 61 |
}] |
| 62 |
}; |
| 63 |
this.normalizeRules(); |
| 64 |
}; |
| 65 |
oop.inherits(AqlHighlightRules, TextHighlightRules); |
| 66 |
exports.AqlHighlightRules = AqlHighlightRules; |
| 67 |
|
| 68 |
}); |
| 69 |
|
| 70 |
ace.define("ace/mode/aql",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/aql_highlight_rules"], function(require, exports, module){"use strict"; |
| 71 |
var oop = require("../lib/oop"); |
| 72 |
var TextMode = require("./text").Mode; |
| 73 |
var AqlHighlightRules = require("./aql_highlight_rules").AqlHighlightRules; |
| 74 |
var Mode = function () { |
| 75 |
this.HighlightRules = AqlHighlightRules; |
| 76 |
this.$behaviour = this.$defaultBehaviour; |
| 77 |
}; |
| 78 |
oop.inherits(Mode, TextMode); |
| 79 |
(function () { |
| 80 |
this.lineCommentStart = "//"; |
| 81 |
this.$id = "ace/mode/aql"; |
| 82 |
}).call(Mode.prototype); |
| 83 |
exports.Mode = Mode; |
| 84 |
|
| 85 |
}); (function() { |
| 86 |
ace.require(["ace/mode/aql"], function(m) { |
| 87 |
if (typeof module == "object" && typeof exports == "object" && module) { |
| 88 |
module.exports = m; |
| 89 |
} |
| 90 |
}); |
| 91 |
})(); |
| 92 |
|