corrade-nucleus-nucleons – Blame information for rev 20

Subversion Repositories:
Rev:
Rev Author Line No. Line
20 office 1 define("ace/mode/pascal_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 PascalHighlightRules = function() {
8  
9 this.$rules = { start:
10 [ { caseInsensitive: true,
11 token: 'keyword.control.pascal',
12 regex: '\\b(?:(absolute|abstract|all|and|and_then|array|as|asm|attribute|begin|bindable|case|class|const|constructor|destructor|div|do|do|else|end|except|export|exports|external|far|file|finalization|finally|for|forward|goto|if|implementation|import|in|inherited|initialization|interface|interrupt|is|label|library|mod|module|name|near|nil|not|object|of|only|operator|or|or_else|otherwise|packed|pow|private|program|property|protected|public|published|qualified|record|repeat|resident|restricted|segment|set|shl|shr|then|to|try|type|unit|until|uses|value|var|view|virtual|while|with|xor))\\b' },
13 { caseInsensitive: true,
14 token:
15 [ 'variable.pascal', "text",
16 'storage.type.prototype.pascal',
17 'entity.name.function.prototype.pascal' ],
18 regex: '\\b(function|procedure)(\\s+)(\\w+)(\\.\\w+)?(?=(?:\\(.*?\\))?;\\s*(?:attribute|forward|external))' },
19 { caseInsensitive: true,
20 token:
21 [ 'variable.pascal', "text",
22 'storage.type.function.pascal',
23 'entity.name.function.pascal' ],
24 regex: '\\b(function|procedure)(\\s+)(\\w+)(\\.\\w+)?' },
25 { token: 'constant.numeric.pascal',
26 regex: '\\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b' },
27 { token: 'punctuation.definition.comment.pascal',
28 regex: '--.*$',
29 push_:
30 [ { token: 'comment.line.double-dash.pascal.one',
31 regex: '$',
32 next: 'pop' },
33 { defaultToken: 'comment.line.double-dash.pascal.one' } ] },
34 { token: 'punctuation.definition.comment.pascal',
35 regex: '//.*$',
36 push_:
37 [ { token: 'comment.line.double-slash.pascal.two',
38 regex: '$',
39 next: 'pop' },
40 { defaultToken: 'comment.line.double-slash.pascal.two' } ] },
41 { token: 'punctuation.definition.comment.pascal',
42 regex: '\\(\\*',
43 push:
44 [ { token: 'punctuation.definition.comment.pascal',
45 regex: '\\*\\)',
46 next: 'pop' },
47 { defaultToken: 'comment.block.pascal.one' } ] },
48 { token: 'punctuation.definition.comment.pascal',
49 regex: '\\{',
50 push:
51 [ { token: 'punctuation.definition.comment.pascal',
52 regex: '\\}',
53 next: 'pop' },
54 { defaultToken: 'comment.block.pascal.two' } ] },
55 { token: 'punctuation.definition.string.begin.pascal',
56 regex: '"',
57 push:
58 [ { token: 'constant.character.escape.pascal', regex: '\\\\.' },
59 { token: 'punctuation.definition.string.end.pascal',
60 regex: '"',
61 next: 'pop' },
62 { defaultToken: 'string.quoted.double.pascal' } ]
63 },
64 { token: 'punctuation.definition.string.begin.pascal',
65 regex: '\'',
66 push:
67 [ { token: 'constant.character.escape.apostrophe.pascal',
68 regex: '\'\'' },
69 { token: 'punctuation.definition.string.end.pascal',
70 regex: '\'',
71 next: 'pop' },
72 { defaultToken: 'string.quoted.single.pascal' } ] },
73 { token: 'keyword.operator',
74 regex: '[+\\-;,/*%]|:=|=' } ] }
75  
76 this.normalizeRules();
77 };
78  
79 oop.inherits(PascalHighlightRules, TextHighlightRules);
80  
81 exports.PascalHighlightRules = PascalHighlightRules;
82 });
83  
84 define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module) {
85 "use strict";
86  
87 var oop = require("../../lib/oop");
88 var BaseFoldMode = require("./fold_mode").FoldMode;
89 var Range = require("../../range").Range;
90  
91 var FoldMode = exports.FoldMode = function() {};
92 oop.inherits(FoldMode, BaseFoldMode);
93  
94 (function() {
95  
96 this.getFoldWidgetRange = function(session, foldStyle, row) {
97 var range = this.indentationBlock(session, row);
98 if (range)
99 return range;
100  
101 var re = /\S/;
102 var line = session.getLine(row);
103 var startLevel = line.search(re);
104 if (startLevel == -1 || line[startLevel] != "#")
105 return;
106  
107 var startColumn = line.length;
108 var maxRow = session.getLength();
109 var startRow = row;
110 var endRow = row;
111  
112 while (++row < maxRow) {
113 line = session.getLine(row);
114 var level = line.search(re);
115  
116 if (level == -1)
117 continue;
118  
119 if (line[level] != "#")
120 break;
121  
122 endRow = row;
123 }
124  
125 if (endRow > startRow) {
126 var endColumn = session.getLine(endRow).length;
127 return new Range(startRow, startColumn, endRow, endColumn);
128 }
129 };
130 this.getFoldWidget = function(session, foldStyle, row) {
131 var line = session.getLine(row);
132 var indent = line.search(/\S/);
133 var next = session.getLine(row + 1);
134 var prev = session.getLine(row - 1);
135 var prevIndent = prev.search(/\S/);
136 var nextIndent = next.search(/\S/);
137  
138 if (indent == -1) {
139 session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : "";
140 return "";
141 }
142 if (prevIndent == -1) {
143 if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") {
144 session.foldWidgets[row - 1] = "";
145 session.foldWidgets[row + 1] = "";
146 return "start";
147 }
148 } else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") {
149 if (session.getLine(row - 2).search(/\S/) == -1) {
150 session.foldWidgets[row - 1] = "start";
151 session.foldWidgets[row + 1] = "";
152 return "";
153 }
154 }
155  
156 if (prevIndent!= -1 && prevIndent < indent)
157 session.foldWidgets[row - 1] = "start";
158 else
159 session.foldWidgets[row - 1] = "";
160  
161 if (indent < nextIndent)
162 return "start";
163 else
164 return "";
165 };
166  
167 }).call(FoldMode.prototype);
168  
169 });
170  
171 define("ace/mode/pascal",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/pascal_highlight_rules","ace/mode/folding/coffee"], function(require, exports, module) {
172 "use strict";
173  
174 var oop = require("../lib/oop");
175 var TextMode = require("./text").Mode;
176 var PascalHighlightRules = require("./pascal_highlight_rules").PascalHighlightRules;
177 var FoldMode = require("./folding/coffee").FoldMode;
178  
179 var Mode = function() {
180 this.HighlightRules = PascalHighlightRules;
181 this.foldingRules = new FoldMode();
182 this.$behaviour = this.$defaultBehaviour;
183 };
184 oop.inherits(Mode, TextMode);
185  
186 (function() {
187  
188 this.lineCommentStart = ["--", "//"];
189 this.blockComment = [
190 {start: "(*", end: "*)"},
191 {start: "{", end: "}"}
192 ];
193  
194 this.$id = "ace/mode/pascal";
195 }).call(Mode.prototype);
196  
197 exports.Mode = Mode;
198 });