1
|
ace.define("ace/mode/vhdl_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 VHDLHighlightRules = function() {
|
8
|
|
9
|
|
10
|
|
11
|
var keywords = "access|after|ailas|all|architecture|assert|attribute|"+
|
12
|
"begin|block|buffer|bus|case|component|configuration|"+
|
13
|
"disconnect|downto|else|elsif|end|entity|file|for|function|"+
|
14
|
"generate|generic|guarded|if|impure|in|inertial|inout|is|"+
|
15
|
"label|linkage|literal|loop|mapnew|next|of|on|open|others|"+
|
16
|
"out|port|process|pure|range|record|reject|report|return|"+
|
17
|
"select|severity|shared|signal|subtype|then|to|transport|"+
|
18
|
"type|unaffected|united|until|wait|when|while|with";
|
19
|
|
20
|
var storageType = "bit|bit_vector|boolean|character|integer|line|natural|"+
|
21
|
"positive|real|register|signed|std_logic|"+
|
22
|
"std_logic_vector|string||text|time|unsigned|variable";
|
23
|
|
24
|
var storageModifiers = "array|constant";
|
25
|
|
26
|
var keywordOperators = "abs|and|mod|nand|nor|not|rem|rol|ror|sla|sll|sra"+
|
27
|
"srl|xnor|xor";
|
28
|
|
29
|
var builtinConstants = (
|
30
|
"true|false|null"
|
31
|
);
|
32
|
|
33
|
|
34
|
var keywordMapper = this.createKeywordMapper({
|
35
|
"keyword.operator": keywordOperators,
|
36
|
"keyword": keywords,
|
37
|
"constant.language": builtinConstants,
|
38
|
"storage.modifier": storageModifiers,
|
39
|
"storage.type": storageType
|
40
|
}, "identifier", true);
|
41
|
|
42
|
this.$rules = {
|
43
|
"start" : [ {
|
44
|
token : "comment",
|
45
|
regex : "--.*$"
|
46
|
}, {
|
47
|
token : "string", // " string
|
48
|
regex : '".*?"'
|
49
|
}, {
|
50
|
token : "string", // ' string
|
51
|
regex : "'.*?'"
|
52
|
}, {
|
53
|
token : "constant.numeric", // float
|
54
|
regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
|
55
|
}, {
|
56
|
token : "keyword", // pre-compiler directives
|
57
|
regex : "\\s*(?:library|package|use)\\b"
|
58
|
}, {
|
59
|
token : keywordMapper,
|
60
|
regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
|
61
|
}, {
|
62
|
token : "keyword.operator",
|
63
|
regex : "&|\\*|\\+|\\-|\\/|<|=|>|\\||=>|\\*\\*|:=|\\/=|>=|<=|<>"
|
64
|
}, {
|
65
|
token : "punctuation.operator",
|
66
|
regex : "\\'|\\:|\\,|\\;|\\."
|
67
|
},{
|
68
|
token : "paren.lparen",
|
69
|
regex : "[[(]"
|
70
|
}, {
|
71
|
token : "paren.rparen",
|
72
|
regex : "[\\])]"
|
73
|
}, {
|
74
|
token : "text",
|
75
|
regex : "\\s+"
|
76
|
} ]
|
77
|
|
78
|
|
79
|
};
|
80
|
};
|
81
|
|
82
|
oop.inherits(VHDLHighlightRules, TextHighlightRules);
|
83
|
|
84
|
exports.VHDLHighlightRules = VHDLHighlightRules;
|
85
|
});
|
86
|
|
87
|
ace.define("ace/mode/vhdl",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/vhdl_highlight_rules"], function(require, exports, module) {
|
88
|
"use strict";
|
89
|
|
90
|
var oop = require("../lib/oop");
|
91
|
var TextMode = require("./text").Mode;
|
92
|
var VHDLHighlightRules = require("./vhdl_highlight_rules").VHDLHighlightRules;
|
93
|
|
94
|
var Mode = function() {
|
95
|
this.HighlightRules = VHDLHighlightRules;
|
96
|
this.$behaviour = this.$defaultBehaviour;
|
97
|
};
|
98
|
oop.inherits(Mode, TextMode);
|
99
|
|
100
|
(function() {
|
101
|
|
102
|
this.lineCommentStart = "--";
|
103
|
|
104
|
this.$id = "ace/mode/vhdl";
|
105
|
}).call(Mode.prototype);
|
106
|
|
107
|
exports.Mode = Mode;
|
108
|
|
109
|
}); (function() {
|
110
|
ace.require(["ace/mode/vhdl"], function(m) {
|
111
|
if (typeof module == "object" && typeof exports == "object" && module) {
|
112
|
module.exports = m;
|
113
|
}
|
114
|
});
|
115
|
})();
|
116
|
|