corrade-nucleus-nucleons – Blame information for rev 20

Subversion Repositories:
Rev:
Rev Author Line No. Line
20 office 1 ace.define("ace/mode/latex_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 LatexHighlightRules = function() {
8  
9 this.$rules = {
10 "start" : [{
11 token : "comment",
12 regex : "%.*$"
13 }, {
14 token : ["keyword", "lparen", "variable.parameter", "rparen", "lparen", "storage.type", "rparen"],
15 regex : "(\\\\(?:documentclass|usepackage|input))(?:(\\[)([^\\]]*)(\\]))?({)([^}]*)(})"
16 }, {
17 token : ["keyword","lparen", "variable.parameter", "rparen"],
18 regex : "(\\\\(?:label|v?ref|cite(?:[^{]*)))(?:({)([^}]*)(}))?"
19 }, {
20 token : ["storage.type", "lparen", "variable.parameter", "rparen"],
21 regex : "(\\\\(?:begin|end))({)(\\w*)(})"
22 }, {
23 token : "storage.type",
24 regex : "\\\\[a-zA-Z]+"
25 }, {
26 token : "lparen",
27 regex : "[[({]"
28 }, {
29 token : "rparen",
30 regex : "[\\])}]"
31 }, {
32 token : "constant.character.escape",
33 regex : "\\\\[^a-zA-Z]?"
34 }, {
35 token : "string",
36 regex : "\\${1,2}",
37 next : "equation"
38 }],
39 "equation" : [{
40 token : "comment",
41 regex : "%.*$"
42 }, {
43 token : "string",
44 regex : "\\${1,2}",
45 next : "start"
46 }, {
47 token : "constant.character.escape",
48 regex : "\\\\(?:[^a-zA-Z]|[a-zA-Z]+)"
49 }, {
50 token : "error",
51 regex : "^\\s*$",
52 next : "start"
53 }, {
54 defaultToken : "string"
55 }]
56  
57 };
58 };
59 oop.inherits(LatexHighlightRules, TextHighlightRules);
60  
61 exports.LatexHighlightRules = LatexHighlightRules;
62  
63 });
64  
65 ace.define("ace/mode/rdoc_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules","ace/mode/latex_highlight_rules"], function(require, exports, module) {
66 "use strict";
67  
68 var oop = require("../lib/oop");
69 var lang = require("../lib/lang");
70 var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
71 var LaTeXHighlightRules = require("./latex_highlight_rules");
72  
73 var RDocHighlightRules = function() {
74  
75 this.$rules = {
76 "start" : [
77 {
78 token : "comment",
79 regex : "%.*$"
80 }, {
81 token : "text", // non-command
82 regex : "\\\\[$&%#\\{\\}]"
83 }, {
84 token : "keyword", // command
85 regex : "\\\\(?:name|alias|method|S3method|S4method|item|code|preformatted|kbd|pkg|var|env|option|command|author|email|url|source|cite|acronym|href|code|preformatted|link|eqn|deqn|keyword|usage|examples|dontrun|dontshow|figure|if|ifelse|Sexpr|RdOpts|inputencoding|usepackage)\\b",
86 next : "nospell"
87 }, {
88 token : "keyword", // command
89 regex : "\\\\(?:[a-zA-Z0-9]+|[^a-zA-Z0-9])"
90 }, {
91 token : "paren.keyword.operator",
92 regex : "[[({]"
93 }, {
94 token : "paren.keyword.operator",
95 regex : "[\\])}]"
96 }, {
97 token : "text",
98 regex : "\\s+"
99 }
100 ],
101 "nospell" : [
102 {
103 token : "comment",
104 regex : "%.*$",
105 next : "start"
106 }, {
107 token : "nospell.text", // non-command
108 regex : "\\\\[$&%#\\{\\}]"
109 }, {
110 token : "keyword", // command
111 regex : "\\\\(?:name|alias|method|S3method|S4method|item|code|preformatted|kbd|pkg|var|env|option|command|author|email|url|source|cite|acronym|href|code|preformatted|link|eqn|deqn|keyword|usage|examples|dontrun|dontshow|figure|if|ifelse|Sexpr|RdOpts|inputencoding|usepackage)\\b"
112 }, {
113 token : "keyword", // command
114 regex : "\\\\(?:[a-zA-Z0-9]+|[^a-zA-Z0-9])",
115 next : "start"
116 }, {
117 token : "paren.keyword.operator",
118 regex : "[[({]"
119 }, {
120 token : "paren.keyword.operator",
121 regex : "[\\])]"
122 }, {
123 token : "paren.keyword.operator",
124 regex : "}",
125 next : "start"
126 }, {
127 token : "nospell.text",
128 regex : "\\s+"
129 }, {
130 token : "nospell.text",
131 regex : "\\w+"
132 }
133 ]
134 };
135 };
136  
137 oop.inherits(RDocHighlightRules, TextHighlightRules);
138  
139 exports.RDocHighlightRules = RDocHighlightRules;
140 });
141  
142 ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) {
143 "use strict";
144  
145 var Range = require("../range").Range;
146  
147 var MatchingBraceOutdent = function() {};
148  
149 (function() {
150  
151 this.checkOutdent = function(line, input) {
152 if (! /^\s+$/.test(line))
153 return false;
154  
155 return /^\s*\}/.test(input);
156 };
157  
158 this.autoOutdent = function(doc, row) {
159 var line = doc.getLine(row);
160 var match = line.match(/^(\s*\})/);
161  
162 if (!match) return 0;
163  
164 var column = match[1].length;
165 var openBracePos = doc.findMatchingBracket({row: row, column: column});
166  
167 if (!openBracePos || openBracePos.row == row) return 0;
168  
169 var indent = this.$getIndent(doc.getLine(openBracePos.row));
170 doc.replace(new Range(row, 0, row, column-1), indent);
171 };
172  
173 this.$getIndent = function(line) {
174 return line.match(/^\s*/)[0];
175 };
176  
177 }).call(MatchingBraceOutdent.prototype);
178  
179 exports.MatchingBraceOutdent = MatchingBraceOutdent;
180 });
181  
182 ace.define("ace/mode/rdoc",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/rdoc_highlight_rules","ace/mode/matching_brace_outdent"], function(require, exports, module) {
183 "use strict";
184  
185 var oop = require("../lib/oop");
186 var TextMode = require("./text").Mode;
187 var RDocHighlightRules = require("./rdoc_highlight_rules").RDocHighlightRules;
188 var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
189  
190 var Mode = function(suppressHighlighting) {
191 this.HighlightRules = RDocHighlightRules;
192 this.$outdent = new MatchingBraceOutdent();
193 this.$behaviour = this.$defaultBehaviour;
194 };
195 oop.inherits(Mode, TextMode);
196  
197 (function() {
198 this.getNextLineIndent = function(state, line, tab) {
199 return this.$getIndent(line);
200 };
201 this.$id = "ace/mode/rdoc";
202 }).call(Mode.prototype);
203  
204 exports.Mode = Mode;
205 });