Projekt

Obecné

Profil

Stáhnout (3.47 KB) Statistiky
| Větev: | Tag: | Revize:
1
ace.define("ace/mode/lisp_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 LispHighlightRules = function() {
8
    var keywordControl = "case|do|let|loop|if|else|when";
9
    var keywordOperator = "eq|neq|and|or";
10
    var constantLanguage = "null|nil";
11
    var supportFunctions = "cons|car|cdr|cond|lambda|format|setq|setf|quote|eval|append|list|listp|memberp|t|load|progn";
12

    
13
    var keywordMapper = this.createKeywordMapper({
14
        "keyword.control": keywordControl,
15
        "keyword.operator": keywordOperator,
16
        "constant.language": constantLanguage,
17
        "support.function": supportFunctions
18
    }, "identifier", true);
19

    
20
    this.$rules = 
21
        {
22
    "start": [
23
        {
24
            token : "comment",
25
            regex : ";.*$"
26
        },
27
        {
28
            token: ["storage.type.function-type.lisp", "text", "entity.name.function.lisp"],
29
            regex: "(?:\\b(?:(defun|defmethod|defmacro))\\b)(\\s+)((?:\\w|\\-|\\!|\\?)*)"
30
        },
31
        {
32
            token: ["punctuation.definition.constant.character.lisp", "constant.character.lisp"],
33
            regex: "(#)((?:\\w|[\\\\+-=<>'\"&#])+)"
34
        },
35
        {
36
            token: ["punctuation.definition.variable.lisp", "variable.other.global.lisp", "punctuation.definition.variable.lisp"],
37
            regex: "(\\*)(\\S*)(\\*)"
38
        },
39
        {
40
            token : "constant.numeric", // hex
41
            regex : "0[xX][0-9a-fA-F]+(?:L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b"
42
        }, 
43
        {
44
            token : "constant.numeric", // float
45
            regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?(?:L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b"
46
        },
47
        {
48
                token : keywordMapper,
49
                regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
50
        },
51
        {
52
            token : "string",
53
            regex : '"(?=.)',
54
            next  : "qqstring"
55
        }
56
    ],
57
    "qqstring": [
58
        {
59
            token: "constant.character.escape.lisp",
60
            regex: "\\\\."
61
        },
62
        {
63
            token : "string",
64
            regex : '[^"\\\\]+'
65
        }, {
66
            token : "string",
67
            regex : "\\\\$",
68
            next  : "qqstring"
69
        }, {
70
            token : "string",
71
            regex : '"|$',
72
            next  : "start"
73
        }
74
    ]
75
};
76

    
77
};
78

    
79
oop.inherits(LispHighlightRules, TextHighlightRules);
80

    
81
exports.LispHighlightRules = LispHighlightRules;
82
});
83

    
84
ace.define("ace/mode/lisp",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/lisp_highlight_rules"], function(require, exports, module) {
85
"use strict";
86

    
87
var oop = require("../lib/oop");
88
var TextMode = require("./text").Mode;
89
var LispHighlightRules = require("./lisp_highlight_rules").LispHighlightRules;
90

    
91
var Mode = function() {
92
    this.HighlightRules = LispHighlightRules;
93
    this.$behaviour = this.$defaultBehaviour;
94
};
95
oop.inherits(Mode, TextMode);
96

    
97
(function() {
98
       
99
    this.lineCommentStart = ";";
100
    
101
    this.$id = "ace/mode/lisp";
102
}).call(Mode.prototype);
103

    
104
exports.Mode = Mode;
105
});                (function() {
106
                    ace.require(["ace/mode/lisp"], function(m) {
107
                        if (typeof module == "object" && typeof exports == "object" && module) {
108
                            module.exports = m;
109
                        }
110
                    });
111
                })();
112
            
(108-108/244)