Projekt

Obecné

Profil

Stáhnout (4.6 KB) Statistiky
| Větev: | Tag: | Revize:
1
ace.define("ace/mode/aql_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
2
  "use strict";
3

    
4
  var oop = require("../lib/oop");
5
  var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
6

    
7
  var AqlHighlightRules = function() {
8

    
9
      var keywords = (
10
          "for|search|outbound|inbound|any|graph|prune|options|shortest_path|to|in|return|filter|sort|limit|let|collect|remove|update|replace|insers|upsert|with"
11
      );
12

    
13
      var builtinConstants = (
14
          "true|false"
15
      );
16

    
17
      var builtinFunctions = (
18
          "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|" +
19
          "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|" +
20
          "attributes|count|has|is_same_collection|keep|length|matches|merge|merge_recursive|parse_identifier|translate|unset|unset_recursive|values|zip|" +
21
          "fulltext|" +
22
          "distance|geo_contains|geo_distance|geo_equals|geo_intersects|is_in_polygon|" +
23
          "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|" +
24
          "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|" +
25
          "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|" +
26
          "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|"
27
      );
28

    
29
      var keywordMapper = this.createKeywordMapper({
30
          "support.function": builtinFunctions,
31
          "keyword": keywords,
32
          "constant.language": builtinConstants
33
      }, "identifier", true);
34

    
35
      this.$rules = {
36
          "start" : [ {
37
              token : "comment",
38
              regex : "//.*$"
39
          }, {
40
              token : "string",           // " string
41
              regex : '".*?"'
42
          }, {
43
              token : "string",           // ' string
44
              regex : "'.*?'"
45
          }, {
46
              token : "constant.numeric", // float
47
              regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
48
          }, {
49
              token : keywordMapper,
50
              regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
51
          }, {
52
              token : "keyword.operator",
53
              regex : "\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|="
54
          }, {
55
              token : "paren.lparen",
56
              regex : "[\\(]"
57
          }, {
58
              token : "paren.rparen",
59
              regex : "[\\)]"
60
          }, {
61
              token : "text",
62
              regex : "\\s+"
63
          } ]
64
      };
65
      this.normalizeRules();
66
  };
67

    
68
  oop.inherits(AqlHighlightRules, TextHighlightRules);
69

    
70
  exports.AqlHighlightRules = AqlHighlightRules;
71
  });
72

    
73
ace.define("ace/mode/aql",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/aql_highlight_rules"], function(require, exports, module) {
74
  "use strict";
75

    
76
  var oop = require("../lib/oop");
77
  var TextMode = require("./text").Mode;
78
  var AqlHighlightRules = require("./aql_highlight_rules").AqlHighlightRules;
79

    
80
  var Mode = function() {
81
      this.HighlightRules = AqlHighlightRules;
82
      this.$behaviour = this.$defaultBehaviour;
83
  };
84
  oop.inherits(Mode, TextMode);
85

    
86
  (function() {
87

    
88
      this.lineCommentStart = "//";
89

    
90
      this.$id = "ace/mode/aql";
91
  }).call(Mode.prototype);
92

    
93
  exports.Mode = Mode;
94

    
95
  });                (function() {
96
                    ace.require(["ace/mode/aql"], function(m) {
97
                        if (typeof module == "object" && typeof exports == "object" && module) {
98
                            module.exports = m;
99
                        }
100
                    });
101
                })();
102
            
(35-35/244)