Lines Matching refs:mode

24     function compileSubModes(mode, language) {  argument
25 mode.sub_modes = [];
26 for (var i = 0; i < mode.contains.length; i++) {
28 if (language.modes[j].className == mode.contains[i]) {
29 mode.sub_modes[mode.sub_modes.length] = language.modes[j];
35 function subMode(lexem, mode) { argument
36 if (!mode.contains) {
39 if (!mode.sub_modes) {
40 compileSubModes(mode, language);
42 for (var i = 0; i < mode.sub_modes.length; i++) {
43 if (mode.sub_modes[i].beginRe.test(lexem)) {
44 return mode.sub_modes[i];
60 function isIllegal(lexem, mode) { argument
61 return mode.illegalRe && mode.illegalRe.test(lexem);
64 function compileTerminators(mode, language) { argument
73 if (mode.contains)
75 if (contains(mode.contains, language.modes[i].className)) {
88 if (mode.illegal) {
89 addTerminator(mode.illegal);
100 var mode = modes[modes.length - 1];
101 if (!mode.terminators) {
102 mode.terminators = compileTerminators(mode, language);
105 var match = mode.terminators.exec(value);
114 function keywordMatch(mode, match) { argument
116 for (var className in mode.keywordGroups) {
117 if (!mode.keywordGroups.hasOwnProperty(className))
119 var value = mode.keywordGroups[className].hasOwnProperty(match_str);
126 function processKeywords(buffer, mode) { argument
127 if (!mode.keywords || !mode.lexems)
129 if (!mode.lexemsRe) {
130 var lexems_re = '(' + mode.lexems[0];
131 for (var i = 1; i < mode.lexems.length; i++)
132 lexems_re += '|' + mode.lexems[i];
134 mode.lexemsRe = langRe(language, lexems_re, true);
138 mode.lexemsRe.lastIndex = 0;
139 var match = mode.lexemsRe.exec(buffer);
142 var keyword_match = keywordMatch(mode, match);
149 last_index = mode.lexemsRe.lastIndex;
150 match = mode.lexemsRe.exec(buffer);
156 function processBuffer(buffer, mode) { argument
157 if (mode.subLanguage && selected_languages[mode.subLanguage]) {
158 var result = highlight(mode.subLanguage, buffer);
163 return processKeywords(buffer, mode);
167 function startNewMode(mode, lexem) { argument
168 var markup = mode.noMarkup?'':'<span class="' + mode.className + '">';
169 if (mode.returnBegin) {
171 mode.buffer = '';
172 } else if (mode.excludeBegin) {
174 mode.buffer = '';
177 mode.buffer = lexem;
179 modes[modes.length] = mode;
423 var mode = 'm' + (language.case_insensitive ? 'i' : '') + (global ? 'g' : '');
424 return new RegExp(value, mode);
449 function compileModeKeywords(mode) { argument
450 if (!mode.keywordGroups) {
451 for (var key in mode.keywords) {
452 if (!mode.keywords.hasOwnProperty(key))
454 if (mode.keywords[key] instanceof Object)
455 mode.keywordGroups = mode.keywords;
457 mode.keywordGroups = {'keyword': mode.keywords};