Projekt

Obecné

Profil

Stáhnout (5.37 KB) Statistiky
| Větev: | Tag: | Revize:
1
ace.define("ace/mode/doc_comment_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 DocCommentHighlightRules = function() {
8
    this.$rules = {
9
        "start" : [ {
10
            token : "comment.doc.tag",
11
            regex : "@[\\w\\d_]+" // TODO: fix email addresses
12
        }, 
13
        DocCommentHighlightRules.getTagRule(),
14
        {
15
            defaultToken : "comment.doc",
16
            caseInsensitive: true
17
        }]
18
    };
19
};
20

    
21
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
22

    
23
DocCommentHighlightRules.getTagRule = function(start) {
24
    return {
25
        token : "comment.doc.tag.storage.type",
26
        regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b"
27
    };
28
};
29

    
30
DocCommentHighlightRules.getStartRule = function(start) {
31
    return {
32
        token : "comment.doc", // doc comment
33
        regex : "\\/\\*(?=\\*)",
34
        next  : start
35
    };
36
};
37

    
38
DocCommentHighlightRules.getEndRule = function (start) {
39
    return {
40
        token : "comment.doc", // closing comment
41
        regex : "\\*\\/",
42
        next  : start
43
    };
44
};
45

    
46

    
47
exports.DocCommentHighlightRules = DocCommentHighlightRules;
48

    
49
});
50

    
51
ace.define("ace/mode/edifact_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) {
52
    "use strict";
53
    
54
    var oop = require("../lib/oop");
55
    var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
56
    var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
57
    
58
    var EdifactHighlightRules = function() {
59
    
60
        var header = (
61
            "UNH"
62
        );
63
        var segment = (
64
            "ADR|AGR|AJT|ALC|ALI|APP|APR|ARD|ARR|ASI|ATT|AUT|"+
65
            "BAS|BGM|BII|BUS|"+
66
            "CAV|CCD|CCI|CDI|CDS|CDV|CED|CIN|CLA|CLI|CMP|CNI|CNT|COD|COM|COT|CPI|CPS|CPT|CST|CTA|CUX|"+
67
            "DAM|DFN|DGS|DII|DIM|DLI|DLM|DMS|DOC|DRD|DSG|DSI|DTM|"+
68
            "EDT|EFI|ELM|ELU|ELV|EMP|EQA|EQD|EQN|ERC|ERP|EVE|FCA|FII|FNS|FNT|FOR|FSQ|FTX|"+
69
            "GDS|GEI|GID|GIN|GIR|GOR|GPO|GRU|HAN|HYN|ICD|IDE|IFD|IHC|IMD|IND|INP|INV|IRQ|"+
70
            "LAN|LIN|LOC|MEA|MEM|MKS|MOA|MSG|MTD|NAD|NAT|"+
71
            "PAC|PAI|PAS|PCC|PCD|PCI|PDI|PER|PGI|PIA|PNA|POC|PRC|PRI|PRV|PSD|PTY|PYT|"+
72
            "QRS|QTY|QUA|QVR|"+
73
            "RCS|REL|RFF|RJL|RNG|ROD|RSL|RTE|"+
74
            "SAL|SCC|SCD|SEG|SEL|SEQ|SFI|SGP|SGU|SPR|SPS|STA|STC|STG|STS|"+
75
            "TAX|TCC|TDT|TEM|TMD|TMP|TOD|TPL|TRU|TSR|"+
76
            "UNB|UNZ|UNT|UGH|UGT|UNS|"+
77
            "VLI"
78
        );
79
    
80
        var header = (
81
            "UNH"
82
        );
83
    
84
        var buildinConstants = ("null|Infinity|NaN|undefined");
85
        var langClasses = (
86
            ""
87
        );
88
    
89
        var keywords = (
90
            "BY|SE|ON|INV|JP|UNOA"
91
        );
92
    
93
        var keywordMapper = this.createKeywordMapper({
94
            "variable.language": "this",
95
            "keyword": keywords,
96
            "entity.name.segment":segment,
97
            "entity.name.header":header,
98
            "constant.language": buildinConstants,
99
            "support.function": langClasses
100
        }, "identifier");
101
    
102
        this.$rules = {
103
            "start" : [
104
                {
105
                    token : "punctuation.operator",
106
                    regex : "\\+.\\+"
107
                }, {
108
                    token : "constant.language.boolean",
109
                    regex : "(?:true|false)\\b"
110
                }, {
111
                    token : keywordMapper,
112
                    regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
113
                }, {
114
                    token : "keyword.operator",
115
                    regex : "\\+"
116
                }, {
117
                    token : "punctuation.operator",
118
                    regex : "\\:|'"
119
                },{
120
                    token : "identifier",
121
                    regex : "\\:D\\:"
122
                }
123
            ]
124
        };
125
    
126
        this.embedRules(DocCommentHighlightRules, "doc-",
127
            [ DocCommentHighlightRules.getEndRule("start") ]);
128
    };
129
    
130
    EdifactHighlightRules.metaData = { fileTypes: [ 'edi' ],
131
          keyEquivalent: '^~E',
132
          name: 'Edifact',
133
          scopeName: 'source.edifact' };
134
    
135
    oop.inherits(EdifactHighlightRules, TextHighlightRules);
136
    
137
    exports.EdifactHighlightRules = EdifactHighlightRules;
138
    });
139

    
140
ace.define("ace/mode/edifact",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/edifact_highlight_rules"], function(require, exports, module) {
141
"use strict";
142

    
143
var oop = require("../lib/oop");
144
var TextMode = require("./text").Mode;
145
var EdifactHighlightRules = require("./edifact_highlight_rules").EdifactHighlightRules;
146

    
147
var Mode = function() {
148
   
149
    this.HighlightRules = EdifactHighlightRules;
150
};
151
oop.inherits(Mode, TextMode);
152

    
153
(function() {
154
    this.$id = "ace/mode/edifact";
155
    this.snippetFileId = "ace/snippets/edifact";
156
}).call(Mode.prototype);
157

    
158
exports.Mode = Mode;
159
});                (function() {
160
                    ace.require(["ace/mode/edifact"], function(m) {
161
                        if (typeof module == "object" && typeof exports == "object" && module) {
162
                            module.exports = m;
163
                        }
164
                    });
165
                })();
166
            
(63-63/244)