bc7e32df70298ba706312c5ed4b3cfe3.js 4.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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|search|outbound|inbound|any|graph|prune|options|shortest_path|to|in|return|filter|sort|limit|let|collect|remove|update|replace|insers|upsert|with");
  6. var builtinConstants = ("true|false");
  7. var builtinFunctions = ("append|contains_array|count|count_distinct|count_unique|first|flatten|intersection|last|length|minus|nth|outersection|pop|position|push|remove_nth|remove_value|remove_values|reverse|shift|slice|sorted|sorted_unique|union|union_distinct|unique|unshift|" +
  8. "date_now|date_iso8601|date_timestamp|is_datestring|date_dayofweek|date_year|date_month|date_day|date_hour|date_minute|date_second|date_millisecond|date_dayofyear|date_isoweek|date_leapyear|date_quarter|date_days_in_month|date_trunc|date_format|date_add|date_subtract|date_diff|date_compare|" +
  9. "attributes|count|has|is_same_collection|keep|length|matches|merge|merge_recursive|parse_identifier|translate|unset|unset_recursive|values|zip|" +
  10. "fulltext|" +
  11. "distance|geo_contains|geo_distance|geo_equals|geo_intersects|is_in_polygon|" +
  12. "not_null|first_list|first_document|check_document|collection_count|collections|count|current_user|document|length|hash|apply|assert|/ warn|call|fail|noopt|passthru|sleep|v8|version|" +
  13. "abs|acos|asin|atan|atan2|average|avg|ceil|cos|degrees|exp|exp2|floor|log|log2|log10|max|median|min|percentile|pi|pow|radians|rand|range|round|sin|sqrt|stddev_population|stddev_sample|stddev|sum|tan|variance_population|variance_sample|variance|" +
  14. "char_length|concat|concat_separator|contains|count|encode_uri_component|find_first|find_last|json_parse|json_stringify|left|length|levenshtein_distance|like|lower|ltrim|md5|random_token|regex_matches|regex_split|regex_test|regex_replace|reverse|right|rtrim|sha1|sha512|split|soundex|substitute|substring|tokens|to_base64|to_hex|trim|upper|uuid|" +
  15. "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|is_key|typename|");
  16. var keywordMapper = this.createKeywordMapper({
  17. "support.function": builtinFunctions,
  18. "keyword": keywords,
  19. "constant.language": builtinConstants
  20. }, "identifier", true);
  21. this.$rules = {
  22. "start": [{
  23. token: "comment",
  24. regex: "//.*$"
  25. }, {
  26. token: "string",
  27. regex: '".*?"'
  28. }, {
  29. token: "string",
  30. regex: "'.*?'"
  31. }, {
  32. token: "constant.numeric",
  33. regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
  34. }, {
  35. token: keywordMapper,
  36. regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
  37. }, {
  38. token: "keyword.operator",
  39. regex: "\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|="
  40. }, {
  41. token: "paren.lparen",
  42. regex: "[\\(]"
  43. }, {
  44. token: "paren.rparen",
  45. regex: "[\\)]"
  46. }, {
  47. token: "text",
  48. regex: "\\s+"
  49. }]
  50. };
  51. this.normalizeRules();
  52. };
  53. oop.inherits(AqlHighlightRules, TextHighlightRules);
  54. exports.AqlHighlightRules = AqlHighlightRules;
  55. });
  56. 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";
  57. var oop = require("../lib/oop");
  58. var TextMode = require("./text").Mode;
  59. var AqlHighlightRules = require("./aql_highlight_rules").AqlHighlightRules;
  60. var Mode = function () {
  61. this.HighlightRules = AqlHighlightRules;
  62. this.$behaviour = this.$defaultBehaviour;
  63. };
  64. oop.inherits(Mode, TextMode);
  65. (function () {
  66. this.lineCommentStart = "//";
  67. this.$id = "ace/mode/aql";
  68. }).call(Mode.prototype);
  69. exports.Mode = Mode;
  70. }); (function() {
  71. ace.require(["ace/mode/aql"], function(m) {
  72. if (typeof module == "object" && typeof exports == "object" && module) {
  73. module.exports = m;
  74. }
  75. });
  76. })();