corrade-nucleus-nucleons – Blame information for rev 20

Subversion Repositories:
Rev:
Rev Author Line No. Line
20 office 1 ace.define("ace/mode/praat_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 PraatHighlightRules = function() {
8  
9 var keywords = (
10 "if|then|else|elsif|elif|endif|fi|" +
11 "endfor|endproc|" + // related keywords specified below
12 "while|endwhile|" +
13 "repeat|until|" +
14 "select|plus|minus|" +
15 "assert|asserterror"
16 );
17  
18 var predefinedVariables = (
19 "macintosh|windows|unix|" +
20 "praatVersion|praatVersion\\$" +
21 "pi|undefined|" +
22 "newline\\$|tab\\$|" +
23 "shellDirectory\\$|homeDirectory\\$|preferencesDirectory\\$|" +
24 "temporaryDirectory\\$|defaultDirectory\\$"
25 );
26 var directives = (
27 "clearinfo|endSendPraat"
28 );
29  
30 var functions = (
31 "writeInfo|writeInfoLine|appendInfo|appendInfoLine|info\\$|" +
32 "writeFile|writeFileLine|appendFile|appendFileLine|" +
33 "abs|round|floor|ceiling|min|max|imin|imax|" +
34 "sqrt|sin|cos|tan|arcsin|arccos|arctan|arctan2|sinc|sincpi|" +
35 "exp|ln|lnBeta|lnGamma|log10|log2|" +
36 "sinh|cosh|tanh|arcsinh|arccosh|arctanh|" +
37 "sigmoid|invSigmoid|erf|erfc|" +
38 "random(?:Uniform|Integer|Gauss|Poisson|Binomial)|" +
39 "gaussP|gaussQ|invGaussQ|incompleteGammaP|incompleteBeta|" +
40 "chiSquareP|chiSquareQ|invChiSquareQ|studentP|studentQ|invStudentQ|" +
41 "fisherP|fisherQ|invFisherQ|" +
42 "binomialP|binomialQ|invBinomialP|invBinomialQ|" +
43 "hertzToBark|barkToHerz|" +
44 "hertzToMel|melToHertz|" +
45 "hertzToSemitones|semitonesToHerz|" +
46 "erb|hertzToErb|erbToHertz|" +
47 "phonToDifferenceLimens|differenceLimensToPhon|" +
48 "soundPressureToPhon|" +
49 "beta|beta2|besselI|besselK|" +
50 "numberOfColumns|numberOfRows|" +
51 "selected|selected\\$|numberOfSelected|variableExists|"+
52 "index|rindex|startsWith|endsWith|"+
53 "index_regex|rindex_regex|replace_regex\\$|"+
54 "length|extractWord\\$|extractLine\\$|extractNumber|" +
55 "left\\$|right\\$|mid\\$|replace\\$|" +
56 "date\\$|fixed\\$|percent\\$|" +
57 "zero#|linear#|randomUniform#|randomInteger#|randomGauss#|" +
58 "beginPause|endPause|" +
59 "demoShow|demoWindowTitle|demoInput|demoWaitForInput|" +
60 "demoClicked|demoClickedIn|demoX|demoY|" +
61 "demoKeyPressed|demoKey\\$|" +
62 "demoExtraControlKeyPressed|demoShiftKeyPressed|"+
63 "demoCommandKeyPressed|demoOptionKeyPressed|" +
64 "environment\\$|chooseReadFile\\$|" +
65 "chooseDirectory\\$|createDirectory|fileReadable|deleteFile|" +
66 "selectObject|removeObject|plusObject|minusObject|" +
67 "runScript|exitScript|" +
68 "beginSendPraat|endSendPraat|" +
69 "objectsAreIdentical"
70 );
71  
72 var objectTypes = (
73 "Activation|AffineTransform|AmplitudeTier|Art|Artword|Autosegment|" +
74 "BarkFilter|CCA|Categories|Cepstrum|Cepstrumc|ChebyshevSeries|" +
75 "ClassificationTable|Cochleagram|Collection|Configuration|" +
76 "Confusion|ContingencyTable|Corpus|Correlation|Covariance|" +
77 "CrossCorrelationTable|CrossCorrelationTables|DTW|Diagonalizer|" +
78 "Discriminant|Dissimilarity|Distance|Distributions|DurationTier|" +
79 "EEG|ERP|ERPTier|Eigen|Excitation|Excitations|ExperimentMFC|FFNet|" +
80 "FeatureWeights|Formant|FormantFilter|FormantGrid|FormantPoint|" +
81 "FormantTier|GaussianMixture|HMM|HMM_Observation|" +
82 "HMM_ObservationSequence|HMM_State|HMM_StateSequence|Harmonicity|" +
83 "ISpline|Index|Intensity|IntensityTier|IntervalTier|KNN|KlattGrid|" +
84 "KlattTable|LFCC|LPC|Label|LegendreSeries|LinearRegression|" +
85 "LogisticRegression|LongSound|Ltas|MFCC|MSpline|ManPages|" +
86 "Manipulation|Matrix|MelFilter|MixingMatrix|Movie|Network|" +
87 "OTGrammar|OTHistory|OTMulti|PCA|PairDistribution|ParamCurve|" +
88 "Pattern|Permutation|Pitch|PitchTier|PointProcess|Polygon|" +
89 "Polynomial|Procrustes|RealPoint|RealTier|ResultsMFC|Roots|SPINET|" +
90 "SSCP|SVD|Salience|ScalarProduct|Similarity|SimpleString|" +
91 "SortedSetOfString|Sound|Speaker|Spectrogram|Spectrum|SpectrumTier|" +
92 "SpeechSynthesizer|SpellingChecker|Strings|StringsIndex|Table|" +
93 "TableOfReal|TextGrid|TextInterval|TextPoint|TextTier|Tier|" +
94 "Transition|VocalTract|Weight|WordList"
95 );
96  
97 this.$rules = {
98 "start" : [
99 {
100 token : "string.interpolated",
101 regex : /'((?:[a-z][a-zA-Z0-9_]*)(?:\$|#|:[0-9]+)?)'/
102 }, {
103 token : ["text", "text", "keyword.operator", "text", "keyword"],
104 regex : /(^\s*)(?:([a-z][a-zA-Z0-9_]*\$?\s+)(=)(\s+))?(stopwatch)/
105 }, {
106 token : ["text", "keyword", "text", "string"],
107 regex : /(^\s*)(print(?:line|tab)?|echo|exit|pause|send(?:praat|socket)|include|execute|system(?:_nocheck)?)(\s+)(.*)/
108 }, {
109 token : ["text", "keyword"],
110 regex : "(^\\s*)(" + directives + ")$"
111 }, {
112 token : ["text", "keyword.operator", "text"],
113 regex : /(\s+)((?:\+|-|\/|\*|<|>)=?|==?|!=|%|\^|\||and|or|not)(\s+)/
114 <|> }, {
115 <|> token : ["text", "text", "keyword.operator", "text", "keyword", "text", "keyword"],
116 <|> regex : /(^\s*)(?:([a-z][a-zA-Z0-9_]*\$?\s+)(=)(\s+))?(?:((?:no)?warn|(?:unix_)?nocheck|noprogress)(\s+))?((?:[A-Z][^.:"]+)(?:$|(?:\.{3}|:)))/
117 <|> }, {
118 <|> token : ["text", "keyword", "text", "keyword"],
119 <|> regex : /(^\s*)(?:(demo)?(\s+))((?:[A-Z][^.:"]+)(?:$|(?:\.{3}|:)))/
120 <|> }, {
121 <|> token : ["text", "keyword", "text", "keyword"],
122 <|> regex : /^(\s*)(?:(demo)(\s+))?(10|12|14|16|24)$/
123 <|> }, {
124 <|> token : ["text", "support.function", "text"],
125 <|> regex : /(\s*)(do\$?)(\s*:\s*|\s*\(\s*)/
126 <|> }, {
127 <|> token : "entity.name.type",
128 <|> regex : "(" + objectTypes + ")"
129 <|> }, {
130 <|> token : "variable.language",
131 <|> regex : "(" + predefinedVariables + ")"
132 <|> }, {
133 <|> token : ["support.function", "text"],
134 <|> regex : "((?:" + functions + ")\\$?)(\\s*(?::|\\())"
135 <|> }, {
136 <|> token : "keyword",
137 <|> regex : /(\bfor\b)/,
138 <|> next : "for"
139 <|> }, {
140 <|> token : "keyword",
141 <|> regex : "(\\b(?:" + keywords + ")\\b)"
142 <|> }, {
143 <|> token : "string",
144 <|> regex : /"[^"]*"/
145 <|> }, {
146 <|> token : "string",
147 <|> regex : /"[^"]*$/,
148 <|> next : "brokenstring"
149 <|> }, {
150 <|> token : ["text", "keyword", "text", "entity.name.section"],
151 <|> regex : /(^\s*)(\bform\b)(\s+)(.*)/,
152 <|> next : "form"
153 <|> }, {
154 <|> token : "constant.numeric",
155 <|> regex : /\b[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/
156 <|> }, {
157 <|> token : ["keyword", "text", "entity.name.function"],
158 <|> regex : /(procedure)(\s+)(\S+)/
159 <|> }, {
160 <|> token : ["entity.name.function", "text"],
161 <|> regex : /(@\S+)(:|\s*\()/
162 <|> }, {
163 <|> token : ["text", "keyword", "text", "entity.name.function"],
164 <|> regex : /(^\s*)(call)(\s+)(\S+)/
165 <|> }, {
166 <|> token : "comment",
167 <|> regex : /(^\s*#|;).*$/
168 <|> }, {
169 <|> token : "text",
170 <|> regex : /\s+/
171 <|> }
172 <|> ],
173 <|> "form" : [
174 <|> {
175 <|> token : ["keyword", "text", "constant.numeric"],
176 <|> regex : /((?:optionmenu|choice)\s+)(\S+:\s+)([0-9]+)/
177 <|> }, {
178 <|> token : ["keyword", "constant.numeric"],
179 <|> regex : /((?:option|button)\s+)([+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b)/
180 <|> }, {
181 <|> token : ["keyword", "string"],
182 <|> regex : /((?:option|button)\s+)(.*)/
183 <|> }, {
184 <|> token : ["keyword", "text", "string"],
185 <|> regex : /((?:sentence|text)\s+)(\S+\s*)(.*)/
186 <|> }, {
187 <|> token : ["keyword", "text", "string", "invalid.illegal"],
188 <|> regex : /(word\s+)(\S+\s*)(\S+)?(\s.*)?/
189 <|> }, {
190 <|> token : ["keyword", "text", "constant.language"],
191 <|> regex : /(boolean\s+)(\S+\s*)(0|1|"?(?:yes|no)"?)/
192 <|> }, {
193 <|> token : ["keyword", "text", "constant.numeric"],
194 <|> regex : /((?:real|natural|positive|integer)\s+)(\S+\s*)([+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b)/
195 <|> }, {
196 <|> token : ["keyword", "string"],
197 <|> regex : /(comment\s+)(.*)/
198 <|> }, {
199 <|> token : "keyword",
200 <|> regex : 'endform',
201 <|> next : "start"
202 <|> }
203 <|> ],
204 <|> "for" : [
205 <|> {
206 <|> token : ["keyword", "text", "constant.numeric", "text"],
207 <|> regex : /(from|to)(\s+)([+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?)(\s*)/
208 <|> }, {
209 <|> token : ["keyword", "text"],
210 <|> regex : /(from|to)(\s+\S+\s*)/
211 <|> }, {
212 <|> token : "text",
213 <|> regex : /$/,
214 <|> next : "start"
215 <|> }
216 <|> ],
217 <|> "brokenstring" : [
218 <|> {
219 <|> token : ["text", "string"],
220 <|> regex : /(\s*\.{3})([^"]*)/
221 <|> }, {
222 <|> token : "string",
223 <|> regex : /"/,
224 <|> next : "start"
225 <|> }
226 <|> ]
227 <|> };
228 <|>};
229  
230 <|>oop.inherits(PraatHighlightRules, TextHighlightRules);
231  
232 <|>exports.PraatHighlightRules = PraatHighlightRules;
233 <|>});
234  
235 <|>ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) {
236 <|>"use strict";
237  
238 <|>var Range = require("../range").Range;
239  
240 <|>var MatchingBraceOutdent = function() {};
241  
242 <|>(function() {
243  
244 <|> this.checkOutdent = function(line, input) {
245 <|> if (! /^\s+$/.test(line))
246 <|> return false;
247  
248 <|> return /^\s*\}/.test(input);
249 <|> };
250  
251 <|> this.autoOutdent = function(doc, row) {
252 <|> var line = doc.getLine(row);
253 <|> var match = line.match(/^(\s*\})/);
254  
255 <|> if (!match) return 0;
256  
257 <|> var column = match[1].length;
258 <|> var openBracePos = doc.findMatchingBracket({row: row, column: column});
259  
260 <|> if (!openBracePos || openBracePos.row == row) return 0;
261  
262 <|> var indent = this.$getIndent(doc.getLine(openBracePos.row));
263 <|> doc.replace(new Range(row, 0, row, column-1), indent);
264 <|> };
265  
266 <|> this.$getIndent = function(line) {
267 <|> return line.match(/^\s*/)[0];
268 <|> };
269  
270 <|>}).call(MatchingBraceOutdent.prototype);
271  
272 <|>exports.MatchingBraceOutdent = MatchingBraceOutdent;
273 <|>});
274  
275 <|>ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) {
276 <|>"use strict";
277  
278 <|>var oop = require("../../lib/oop");
279 <|>var Range = require("../../range").Range;
280 <|>var BaseFoldMode = require("./fold_mode").FoldMode;
281  
282 <|>var FoldMode = exports.FoldMode = function(commentRegex) {
283 <|> if (commentRegex) {
284 <|> this.foldingStartMarker = new RegExp(
285 <|> this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start)
286 <|> );
287 <|> this.foldingStopMarker = new RegExp(
288 <|> this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
289 <|> );
290 <|> }
291 <|>};
292 <|>oop.inherits(FoldMode, BaseFoldMode);
293  
294 <|>(function() {
295  
296 <|> this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;
297 <|> this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
298 <|> this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/;
299 <|> this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
300 <|> this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
301 <|> this._getFoldWidgetBase = this.getFoldWidget;
302 <|> this.getFoldWidget = function(session, foldStyle, row) {
303 <|> var line = session.getLine(row);
304  
305 <|> if (this.singleLineBlockCommentRe.test(line)) {
306 <|> if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
307 <|> return "";
308 <|> }
309  
310 <|> var fw = this._getFoldWidgetBase(session, foldStyle, row);
311  
312 <|> if (!fw && this.startRegionRe.test(line))
313 <|> return "start"; // lineCommentRegionStart
314  
315 <|> return fw;
316 <|> };
317  
318 <|> this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
319 <|> var line = session.getLine(row);
320  
321 <|> if (this.startRegionRe.test(line))
322 <|> return this.getCommentRegionBlock(session, line, row);
323  
324 <|> var match = line.match(this.foldingStartMarker);
325 <|> if (match) {
326 <|> var i = match.index;
327  
328 <|> if (match[1])
329 <|> return this.openingBracketBlock(session, match[1], row, i);
330  
331 <|> var range = session.getCommentFoldRange(row, i + match[0].length, 1);
332  
333 <|> if (range && !range.isMultiLine()) {
334 <|> if (forceMultiline) {
335 <|> range = this.getSectionRange(session, row);
336 <|> } else if (foldStyle != "all")
337 <|> range = null;
338 <|> }
339  
340 <|> return range;
341 <|> }
342  
343 <|> if (foldStyle === "markbegin")
344 <|> return;
345  
346 <|> var match = line.match(this.foldingStopMarker);
347 <|> if (match) {
348 <|> var i = match.index + match[0].length;
349  
350 <|> if (match[1])
351 <|> return this.closingBracketBlock(session, match[1], row, i);
352  
353 <|> return session.getCommentFoldRange(row, i, -1);
354 <|> }
355 <|> };
356  
357 <|> this.getSectionRange = function(session, row) {
358 <|> var line = session.getLine(row);
359 <|> var startIndent = line.search(/\S/);
360 <|> var startRow = row;
361 <|> var startColumn = line.length;
362 <|> row = row + 1;
363 <|> var endRow = row;
364 <|> var maxRow = session.getLength();
365 <|> while (++row < maxRow) {
366 <|> line = session.getLine(row);
367 <|> var indent = line.search(/\S/);
368 <|> if (indent === -1)
369 <|> continue;
370 <|> if (startIndent > indent)
371 <|> break;
372 <|> var subRange = this.getFoldWidgetRange(session, "all", row);
373  
374 <|> if (subRange) {
375 <|> if (subRange.start.row <= startRow) {
376 <|> break;
377 <|> } else if (subRange.isMultiLine()) {
378 <|> row = subRange.end.row;
379 <|> } else if (startIndent == indent) {
380 <|> break;
381 <|> }
382 <|> }
383 <|> endRow = row;
384 <|> }
385  
386 <|> return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
387 <|> };
388 <|> this.getCommentRegionBlock = function(session, line, row) {
389 <|> var startColumn = line.search(/\s*$/);
390 <|> var maxRow = session.getLength();
391 <|> var startRow = row;
392  
393 <|> var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
394 <|> var depth = 1;
395 <|> while (++row < maxRow) {
396 <|> line = session.getLine(row);
397 <|> var m = re.exec(line);
398 <|> if (!m) continue;
399 <|> if (m[1]) depth--;
400 <|> else depth++;
401  
402 <|> if (!depth) break;
403 <|> }
404  
405 <|> var endRow = row;
406 <|> if (endRow > startRow) {
407 <|> return new Range(startRow, startColumn, endRow, line.length);
408 <|> }
409 <|> };
410  
411 <|>}).call(FoldMode.prototype);
412  
413 <|>});
414  
415 <|>ace.define("ace/mode/praat",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/praat_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/folding/cstyle"], function(require, exports, module) {
416 <|>"use strict";
417  
418 <|>var oop = require("../lib/oop");
419 <|>var TextMode = require("./text").Mode;
420 <|>var PraatHighlightRules = require("./praat_highlight_rules").PraatHighlightRules;
421 <|>var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
422 <|>var CStyleFoldMode = require("./folding/cstyle").FoldMode;
423  
424 <|>var Mode = function() {
425 <|> this.HighlightRules = PraatHighlightRules;
426 <|> this.$outdent = new MatchingBraceOutdent();
427 <|> this.foldingRules = new CStyleFoldMode();
428 <|> this.$behaviour = this.$defaultBehaviour;
429 <|>};
430 <|>oop.inherits(Mode, TextMode);
431  
432 <|>(function() {
433  
434 <|> this.lineCommentStart = "#";
435  
436 <|> this.getNextLineIndent = function(state, line, tab) {
437 <|> var indent = this.$getIndent(line);
438  
439 <|> var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
440 <|> var tokens = tokenizedLine.tokens;
441  
442 <|> if (tokens.length && tokens[tokens.length-1].type == "comment") {
443 <|> return indent;
444 <|> }
445  
446 <|> if (state == "start") {
447 <|> var match = line.match(/^.*[\{\(\[:]\s*$/);
448 <|> if (match) {
449 <|> indent += tab;
450 <|> }
451 <|> }
452  
453 <|> return indent;
454 <|> };
455  
456 <|> this.checkOutdent = function(state, line, input) {
457 <|> return this.$outdent.checkOutdent(line, input);
458 <|> };
459  
460 <|> this.autoOutdent = function(state, doc, row) {
461 <|> this.$outdent.autoOutdent(doc, row);
462 <|> };
463  
464 <|> this.$id = "ace/mode/praat";
465 <|>}).call(Mode.prototype);
466  
467 <|>exports.Mode = Mode;
468 <|>});