Update ACE Editor to version 1.32.6

This commit is contained in:
Sebastian Serth
2024-02-13 14:46:36 +01:00
committed by Sebastian Serth
parent 0a473c7fd3
commit b00d45521b
481 changed files with 171566 additions and 125260 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,334 +1,330 @@
define("ace/ext/beautify/php_rules",["require","exports","module","ace/token_iterator"], function(require, exports, module) { define("ace/ext/beautify",["require","exports","module","ace/token_iterator"], function(require, exports, module){// [WIP]
"use strict"; "use strict";
var TokenIterator = require("ace/token_iterator").TokenIterator; var TokenIterator = require("../token_iterator").TokenIterator;
exports.newLines = [{ function is(token, type) {
type: 'support.php_tag', return token.type.lastIndexOf(type + ".xml") > -1;
value: '<?php' }
}, { exports.singletonTags = ["area", "base", "br", "col", "command", "embed", "hr", "html", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"];
type: 'support.php_tag', exports.blockTags = ["article", "aside", "blockquote", "body", "div", "dl", "fieldset", "footer", "form", "head", "header", "html", "nav", "ol", "p", "script", "section", "style", "table", "tbody", "tfoot", "thead", "ul"];
value: '<?' exports.formatOptions = {
}, { lineBreaksAfterCommasInCurlyBlock: true
type: 'support.php_tag',
value: '?>'
}, {
type: 'paren.lparen',
value: '{',
indent: true
}, {
type: 'paren.rparen',
breakBefore: true,
value: '}',
indent: false
}, {
type: 'paren.rparen',
breakBefore: true,
value: '})',
indent: false,
dontBreak: true
}, {
type: 'comment'
}, {
type: 'text',
value: ';'
}, {
type: 'text',
value: ':',
context: 'php'
}, {
type: 'keyword',
value: 'case',
indent: true,
dontBreak: true
}, {
type: 'keyword',
value: 'default',
indent: true,
dontBreak: true
}, {
type: 'keyword',
value: 'break',
indent: false,
dontBreak: true
}, {
type: 'punctuation.doctype.end',
value: '>'
}, {
type: 'meta.tag.punctuation.end',
value: '>'
}, {
type: 'meta.tag.punctuation.begin',
value: '<',
blockTag: true,
indent: true,
dontBreak: true
}, {
type: 'meta.tag.punctuation.begin',
value: '</',
indent: false,
breakBefore: true,
dontBreak: true
}, {
type: 'punctuation.operator',
value: ';'
}];
exports.spaces = [{
type: 'xml-pe',
prepend: true
},{
type: 'entity.other.attribute-name',
prepend: true
}, {
type: 'storage.type',
value: 'var',
append: true
}, {
type: 'storage.type',
value: 'function',
append: true
}, {
type: 'keyword.operator',
value: '='
}, {
type: 'keyword',
value: 'as',
prepend: true,
append: true
}, {
type: 'keyword',
value: 'function',
append: true
}, {
type: 'support.function',
next: /[^\(]/,
append: true
}, {
type: 'keyword',
value: 'or',
append: true,
prepend: true
}, {
type: 'keyword',
value: 'and',
append: true,
prepend: true
}, {
type: 'keyword',
value: 'case',
append: true
}, {
type: 'keyword.operator',
value: '||',
append: true,
prepend: true
}, {
type: 'keyword.operator',
value: '&&',
append: true,
prepend: true
}];
exports.singleTags = ['!doctype','area','base','br','hr','input','img','link','meta'];
exports.transform = function(iterator, maxPos, context) {
var token = iterator.getCurrentToken();
var newLines = exports.newLines;
var spaces = exports.spaces;
var singleTags = exports.singleTags;
var code = '';
var indentation = 0;
var dontBreak = false;
var tag;
var lastTag;
var lastToken = {};
var nextTag;
var nextToken = {};
var breakAdded = false;
var value = '';
while (token!==null) {
console.log(token);
if( !token ){
token = iterator.stepForward();
continue;
}
if( token.type == 'support.php_tag' && token.value != '?>' ){
context = 'php';
}
else if( token.type == 'support.php_tag' && token.value == '?>' ){
context = 'html';
}
else if( token.type == 'meta.tag.name.style' && context != 'css' ){
context = 'css';
}
else if( token.type == 'meta.tag.name.style' && context == 'css' ){
context = 'html';
}
else if( token.type == 'meta.tag.name.script' && context != 'js' ){
context = 'js';
}
else if( token.type == 'meta.tag.name.script' && context == 'js' ){
context = 'html';
}
nextToken = iterator.stepForward();
if (nextToken && nextToken.type.indexOf('meta.tag.name') == 0) {
nextTag = nextToken.value;
}
if ( lastToken.type == 'support.php_tag' && lastToken.value == '<?=') {
dontBreak = true;
}
if (token.type == 'meta.tag.name') {
token.value = token.value.toLowerCase();
}
if (token.type == 'text') {
token.value = token.value.trim();
}
if (!token.value) {
token = nextToken;
continue;
}
value = token.value;
for (var i in spaces) {
if (
token.type == spaces[i].type &&
(!spaces[i].value || token.value == spaces[i].value) &&
(
nextToken &&
(!spaces[i].next || spaces[i].next.test(nextToken.value))
)
) {
if (spaces[i].prepend) {
value = ' ' + token.value;
}
if (spaces[i].append) {
value += ' ';
}
}
}
if (token.type.indexOf('meta.tag.name') == 0) {
tag = token.value;
}
breakAdded = false;
for (i in newLines) {
if (
token.type == newLines[i].type &&
(
!newLines[i].value ||
token.value == newLines[i].value
) &&
(
!newLines[i].blockTag ||
singleTags.indexOf(nextTag) === -1
) &&
(
!newLines[i].context ||
newLines[i].context === context
)
) {
if (newLines[i].indent === false) {
indentation--;
}
if (
newLines[i].breakBefore &&
( !newLines[i].prev || newLines[i].prev.test(lastToken.value) )
) {
code += "\n";
breakAdded = true;
for (i = 0; i < indentation; i++) {
code += "\t";
}
}
break;
}
}
if (dontBreak===false) {
for (i in newLines) {
if (
lastToken.type == newLines[i].type &&
(
!newLines[i].value || lastToken.value == newLines[i].value
) &&
(
!newLines[i].blockTag ||
singleTags.indexOf(tag) === -1
) &&
(
!newLines[i].context ||
newLines[i].context === context
)
) {
if (newLines[i].indent === true) {
indentation++;
}
if (!newLines[i].dontBreak && !breakAdded) {
code += "\n";
for (i = 0; i < indentation; i++) {
code += "\t";
}
}
break;
}
}
}
code += value;
if ( lastToken.type == 'support.php_tag' && lastToken.value == '?>' ) {
dontBreak = false;
}
lastTag = tag;
lastToken = token;
token = nextToken;
if (token===null) {
break;
}
}
return code;
}; };
exports.beautify = function (session) {
});
define("ace/ext/beautify",["require","exports","module","ace/token_iterator","ace/ext/beautify/php_rules"], function(require, exports, module) {
"use strict";
var TokenIterator = require("ace/token_iterator").TokenIterator;
var phpTransform = require("./beautify/php_rules").transform;
exports.beautify = function(session) {
var iterator = new TokenIterator(session, 0, 0); var iterator = new TokenIterator(session, 0, 0);
var token = iterator.getCurrentToken(); var token = iterator.getCurrentToken();
var tabString = session.getTabString();
var context = session.$modeId.split("/").pop(); var singletonTags = exports.singletonTags;
var blockTags = exports.blockTags;
var code = phpTransform(iterator, context); var formatOptions = exports.formatOptions || {};
var nextToken;
var breakBefore = false;
var spaceBefore = false;
var spaceAfter = false;
var code = "";
var value = "";
var tagName = "";
var depth = 0;
var lastDepth = 0;
var lastIndent = 0;
var indent = 0;
var unindent = 0;
var roundDepth = 0;
var curlyDepth = 0;
var row;
var curRow = 0;
var rowsToAdd = 0;
var rowTokens = [];
var abort = false;
var i;
var indentNextLine = false;
var inTag = false;
var inCSS = false;
var inBlock = false;
var levels = { 0: 0 };
var parents = [];
var caseBody = false;
var trimNext = function () {
if (nextToken && nextToken.value && nextToken.type !== 'string.regexp')
nextToken.value = nextToken.value.replace(/^\s*/, "");
};
var trimLine = function () {
var end = code.length - 1;
while (true) {
if (end == 0)
break;
if (code[end] !== " ")
break;
end = end - 1;
}
code = code.slice(0, end + 1);
};
var trimCode = function () {
code = code.trimRight();
breakBefore = false;
};
while (token !== null) {
curRow = iterator.getCurrentTokenRow();
rowTokens = iterator.$rowTokens;
nextToken = iterator.stepForward();
if (typeof token !== "undefined") {
value = token.value;
unindent = 0;
inCSS = (tagName === "style" || session.$modeId === "ace/mode/css");
if (is(token, "tag-open")) {
inTag = true;
if (nextToken)
inBlock = (blockTags.indexOf(nextToken.value) !== -1);
if (value === "</") {
if (inBlock && !breakBefore && rowsToAdd < 1)
rowsToAdd++;
if (inCSS)
rowsToAdd = 1;
unindent = 1;
inBlock = false;
}
}
else if (is(token, "tag-close")) {
inTag = false;
}
else if (is(token, "comment.start")) {
inBlock = true;
}
else if (is(token, "comment.end")) {
inBlock = false;
}
if (!inTag && !rowsToAdd && token.type === "paren.rparen" && token.value.substr(0, 1) === "}") {
rowsToAdd++;
}
if (curRow !== row) {
rowsToAdd = curRow;
if (row)
rowsToAdd -= row;
}
if (rowsToAdd) {
trimCode();
for (; rowsToAdd > 0; rowsToAdd--)
code += "\n";
breakBefore = true;
if (!is(token, "comment") && !token.type.match(/^(comment|string)$/))
value = value.trimLeft();
}
if (value) {
if (token.type === "keyword" && value.match(/^(if|else|elseif|for|foreach|while|switch)$/)) {
parents[depth] = value;
trimNext();
spaceAfter = true;
if (value.match(/^(else|elseif)$/)) {
if (code.match(/\}[\s]*$/)) {
trimCode();
spaceBefore = true;
}
}
}
else if (token.type === "paren.lparen") {
trimNext();
if (value.substr(-1) === "{") {
spaceAfter = true;
indentNextLine = false;
if (!inTag)
rowsToAdd = 1;
}
if (value.substr(0, 1) === "{") {
spaceBefore = true;
if (code.substr(-1) !== '[' && code.trimRight().substr(-1) === '[') {
trimCode();
spaceBefore = false;
}
else if (code.trimRight().substr(-1) === ')') {
trimCode();
}
else {
trimLine();
}
}
}
else if (token.type === "paren.rparen") {
unindent = 1;
if (value.substr(0, 1) === "}") {
if (parents[depth - 1] === 'case')
unindent++;
if (code.trimRight().substr(-1) === '{') {
trimCode();
}
else {
spaceBefore = true;
if (inCSS)
rowsToAdd += 2;
}
}
if (value.substr(0, 1) === "]") {
if (code.substr(-1) !== '}' && code.trimRight().substr(-1) === '}') {
spaceBefore = false;
indent++;
trimCode();
}
}
if (value.substr(0, 1) === ")") {
if (code.substr(-1) !== '(' && code.trimRight().substr(-1) === '(') {
spaceBefore = false;
indent++;
trimCode();
}
}
trimLine();
}
else if ((token.type === "keyword.operator" || token.type === "keyword") && value.match(/^(=|==|===|!=|!==|&&|\|\||and|or|xor|\+=|.=|>|>=|<|<=|=>)$/)) {
trimCode();
trimNext();
spaceBefore = true;
spaceAfter = true;
}
else if (token.type === "punctuation.operator" && value === ';') {
trimCode();
trimNext();
spaceAfter = true;
if (inCSS)
rowsToAdd++;
}
else if (token.type === "punctuation.operator" && value.match(/^(:|,)$/)) {
trimCode();
trimNext();
if (value.match(/^(,)$/) && curlyDepth > 0 && roundDepth === 0 && formatOptions.lineBreaksAfterCommasInCurlyBlock) {
rowsToAdd++;
}
else {
spaceAfter = true;
breakBefore = false;
}
}
else if (token.type === "support.php_tag" && value === "?>" && !breakBefore) {
trimCode();
spaceBefore = true;
}
else if (is(token, "attribute-name") && code.substr(-1).match(/^\s$/)) {
spaceBefore = true;
}
else if (is(token, "attribute-equals")) {
trimLine();
trimNext();
}
else if (is(token, "tag-close")) {
trimLine();
if (value === "/>")
spaceBefore = true;
}
else if (token.type === "keyword" && value.match(/^(case|default)$/)) {
if (caseBody)
unindent = 1;
}
if (breakBefore && !(token.type.match(/^(comment)$/) && !value.substr(0, 1).match(/^[/#]$/)) && !(token.type.match(/^(string)$/) && !value.substr(0, 1).match(/^['"@]$/))) {
indent = lastIndent;
if (depth > lastDepth) {
indent++;
for (i = depth; i > lastDepth; i--)
levels[i] = indent;
}
else if (depth < lastDepth)
indent = levels[depth];
lastDepth = depth;
lastIndent = indent;
if (unindent)
indent -= unindent;
if (indentNextLine && !roundDepth) {
indent++;
indentNextLine = false;
}
for (i = 0; i < indent; i++)
code += tabString;
}
if (token.type === "keyword" && value.match(/^(case|default)$/)) {
if (caseBody === false) {
parents[depth] = value;
depth++;
caseBody = true;
}
}
else if (token.type === "keyword" && value.match(/^(break)$/)) {
if (parents[depth - 1] && parents[depth - 1].match(/^(case|default)$/)) {
depth--;
caseBody = false;
}
}
if (token.type === "paren.lparen") {
roundDepth += (value.match(/\(/g) || []).length;
curlyDepth += (value.match(/\{/g) || []).length;
depth += value.length;
}
if (token.type === "keyword" && value.match(/^(if|else|elseif|for|while)$/)) {
indentNextLine = true;
roundDepth = 0;
}
else if (!roundDepth && value.trim() && token.type !== "comment")
indentNextLine = false;
if (token.type === "paren.rparen") {
roundDepth -= (value.match(/\)/g) || []).length;
curlyDepth -= (value.match(/\}/g) || []).length;
for (i = 0; i < value.length; i++) {
depth--;
if (value.substr(i, 1) === '}' && parents[depth] === 'case') {
depth--;
}
}
}
if (token.type == "text")
value = value.replace(/\s+$/, " ");
if (spaceBefore && !breakBefore) {
trimLine();
if (code.substr(-1) !== "\n")
code += " ";
}
code += value;
if (spaceAfter)
code += " ";
breakBefore = false;
spaceBefore = false;
spaceAfter = false;
if ((is(token, "tag-close") && (inBlock || blockTags.indexOf(tagName) !== -1)) || (is(token, "doctype") && value === ">")) {
if (inBlock && nextToken && nextToken.value === "</")
rowsToAdd = -1;
else
rowsToAdd = 1;
}
if (nextToken && singletonTags.indexOf(nextToken.value) === -1) {
if (is(token, "tag-open") && value === "</") {
depth--;
}
else if (is(token, "tag-open") && value === "<") {
depth++;
}
else if (is(token, "tag-close") && value === "/>") {
depth--;
}
}
if (is(token, "tag-name")) {
tagName = value;
}
row = curRow;
}
}
token = nextToken;
}
code = code.trim();
session.doc.setValue(code); session.doc.setValue(code);
}; };
exports.commands = [{ exports.commands = [{
name: "beautify", name: "beautify",
exec: function(editor) { description: "Format selection (Beautify)",
exports.beautify(editor.session); exec: function (editor) {
}, exports.beautify(editor.session);
bindKey: "Ctrl-Shift-B" },
}]; bindKey: "Ctrl-Shift-B"
}];
}); }); (function() {
(function() { window.require(["ace/ext/beautify"], function(m) {
window.require(["ace/ext/beautify"], function() {}); if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})(); })();

View File

@ -1,540 +0,0 @@
define("ace/ext/chromevox",["require","exports","module","ace/editor","ace/config"], function(require, exports, module) {
var cvoxAce = {};
cvoxAce.SpeechProperty;
cvoxAce.Cursor;
cvoxAce.Token;
cvoxAce.Annotation;
var CONSTANT_PROP = {
'rate': 0.8,
'pitch': 0.4,
'volume': 0.9
};
var DEFAULT_PROP = {
'rate': 1,
'pitch': 0.5,
'volume': 0.9
};
var ENTITY_PROP = {
'rate': 0.8,
'pitch': 0.8,
'volume': 0.9
};
var KEYWORD_PROP = {
'rate': 0.8,
'pitch': 0.3,
'volume': 0.9
};
var STORAGE_PROP = {
'rate': 0.8,
'pitch': 0.7,
'volume': 0.9
};
var VARIABLE_PROP = {
'rate': 0.8,
'pitch': 0.8,
'volume': 0.9
};
var DELETED_PROP = {
'punctuationEcho': 'none',
'relativePitch': -0.6
};
var ERROR_EARCON = 'ALERT_NONMODAL';
var MODE_SWITCH_EARCON = 'ALERT_MODAL';
var NO_MATCH_EARCON = 'INVALID_KEYPRESS';
var INSERT_MODE_STATE = 'insertMode';
var COMMAND_MODE_STATE = 'start';
var REPLACE_LIST = [
{
substr: ';',
newSubstr: ' semicolon '
},
{
substr: ':',
newSubstr: ' colon '
}
];
var Command = {
SPEAK_ANNOT: 'annots',
SPEAK_ALL_ANNOTS: 'all_annots',
TOGGLE_LOCATION: 'toggle_location',
SPEAK_MODE: 'mode',
SPEAK_ROW_COL: 'row_col',
TOGGLE_DISPLACEMENT: 'toggle_displacement',
FOCUS_TEXT: 'focus_text'
};
var KEY_PREFIX = 'CONTROL + SHIFT ';
cvoxAce.editor = null;
var lastCursor = null;
var annotTable = {};
var shouldSpeakRowLocation = false;
var shouldSpeakDisplacement = false;
var changed = false;
var vimState = null;
var keyCodeToShortcutMap = {};
var cmdToShortcutMap = {};
var getKeyShortcutString = function(keyCode) {
return KEY_PREFIX + String.fromCharCode(keyCode);
};
var isVimMode = function() {
var keyboardHandler = cvoxAce.editor.keyBinding.getKeyboardHandler();
return keyboardHandler.$id === 'ace/keyboard/vim';
};
var getCurrentToken = function(cursor) {
return cvoxAce.editor.getSession().getTokenAt(cursor.row, cursor.column + 1);
};
var getCurrentLine = function(cursor) {
return cvoxAce.editor.getSession().getLine(cursor.row);
};
var onRowChange = function(currCursor) {
if (annotTable[currCursor.row]) {
cvox.Api.playEarcon(ERROR_EARCON);
}
if (shouldSpeakRowLocation) {
cvox.Api.stop();
speakChar(currCursor);
speakTokenQueue(getCurrentToken(currCursor));
speakLine(currCursor.row, 1);
} else {
speakLine(currCursor.row, 0);
}
};
var isWord = function(cursor) {
var line = getCurrentLine(cursor);
var lineSuffix = line.substr(cursor.column - 1);
if (cursor.column === 0) {
lineSuffix = ' ' + line;
}
var firstWordRegExp = /^\W(\w+)/;
var words = firstWordRegExp.exec(lineSuffix);
return words !== null;
};
var rules = {
'constant': {
prop: CONSTANT_PROP
},
'entity': {
prop: ENTITY_PROP
},
'keyword': {
prop: KEYWORD_PROP
},
'storage': {
prop: STORAGE_PROP
},
'variable': {
prop: VARIABLE_PROP
},
'meta': {
prop: DEFAULT_PROP,
replace: [
{
substr: '</',
newSubstr: ' closing tag '
},
{
substr: '/>',
newSubstr: ' close tag '
},
{
substr: '<',
newSubstr: ' tag start '
},
{
substr: '>',
newSubstr: ' tag end '
}
]
}
};
var DEFAULT_RULE = {
prop: DEFAULT_RULE
};
var expand = function(value, replaceRules) {
var newValue = value;
for (var i = 0; i < replaceRules.length; i++) {
var replaceRule = replaceRules[i];
var regexp = new RegExp(replaceRule.substr, 'g');
newValue = newValue.replace(regexp, replaceRule.newSubstr);
}
return newValue;
};
var mergeTokens = function(tokens, start, end) {
var newToken = {};
newToken.value = '';
newToken.type = tokens[start].type;
for (var j = start; j < end; j++) {
newToken.value += tokens[j].value;
}
return newToken;
};
var mergeLikeTokens = function(tokens) {
if (tokens.length <= 1) {
return tokens;
}
var newTokens = [];
var lastLikeIndex = 0;
for (var i = 1; i < tokens.length; i++) {
var lastLikeToken = tokens[lastLikeIndex];
var currToken = tokens[i];
if (getTokenRule(lastLikeToken) !== getTokenRule(currToken)) {
newTokens.push(mergeTokens(tokens, lastLikeIndex, i));
lastLikeIndex = i;
}
}
newTokens.push(mergeTokens(tokens, lastLikeIndex, tokens.length));
return newTokens;
};
var isRowWhiteSpace = function(row) {
var line = cvoxAce.editor.getSession().getLine(row);
var whiteSpaceRegexp = /^\s*$/;
return whiteSpaceRegexp.exec(line) !== null;
};
var speakLine = function(row, queue) {
var tokens = cvoxAce.editor.getSession().getTokens(row);
if (tokens.length === 0 || isRowWhiteSpace(row)) {
cvox.Api.playEarcon('EDITABLE_TEXT');
return;
}
tokens = mergeLikeTokens(tokens);
var firstToken = tokens[0];
tokens = tokens.filter(function(token) {
return token !== firstToken;
});
speakToken_(firstToken, queue);
tokens.forEach(speakTokenQueue);
};
var speakTokenFlush = function(token) {
speakToken_(token, 0);
};
var speakTokenQueue = function(token) {
speakToken_(token, 1);
};
var getTokenRule = function(token) {
if (!token || !token.type) {
return;
}
var split = token.type.split('.');
if (split.length === 0) {
return;
}
var type = split[0];
var rule = rules[type];
if (!rule) {
return DEFAULT_RULE;
}
return rule;
};
var speakToken_ = function(token, queue) {
var rule = getTokenRule(token);
var value = expand(token.value, REPLACE_LIST);
if (rule.replace) {
value = expand(value, rule.replace);
}
cvox.Api.speak(value, queue, rule.prop);
};
var speakChar = function(cursor) {
var line = getCurrentLine(cursor);
cvox.Api.speak(line[cursor.column], 1);
};
var speakDisplacement = function(lastCursor, currCursor) {
var line = getCurrentLine(currCursor);
var displace = line.substring(lastCursor.column, currCursor.column);
displace = displace.replace(/ /g, ' space ');
cvox.Api.speak(displace);
};
var speakCharOrWordOrLine = function(lastCursor, currCursor) {
if (Math.abs(lastCursor.column - currCursor.column) !== 1) {
var currLineLength = getCurrentLine(currCursor).length;
if (currCursor.column === 0 || currCursor.column === currLineLength) {
speakLine(currCursor.row, 0);
return;
}
if (isWord(currCursor)) {
cvox.Api.stop();
speakTokenQueue(getCurrentToken(currCursor));
return;
}
}
speakChar(currCursor);
};
var onColumnChange = function(lastCursor, currCursor) {
if (!cvoxAce.editor.selection.isEmpty()) {
speakDisplacement(lastCursor, currCursor);
cvox.Api.speak('selected', 1);
}
else if (shouldSpeakDisplacement) {
speakDisplacement(lastCursor, currCursor);
} else {
speakCharOrWordOrLine(lastCursor, currCursor);
}
};
var onCursorChange = function(evt) {
if (changed) {
changed = false;
return;
}
var currCursor = cvoxAce.editor.selection.getCursor();
if (currCursor.row !== lastCursor.row) {
onRowChange(currCursor);
} else {
onColumnChange(lastCursor, currCursor);
}
lastCursor = currCursor;
};
var onSelectionChange = function(evt) {
if (cvoxAce.editor.selection.isEmpty()) {
cvox.Api.speak('unselected');
}
};
var onChange = function(delta) {
switch (delta.action) {
case 'remove':
cvox.Api.speak(delta.text, 0, DELETED_PROP);
changed = true;
break;
case 'insert':
cvox.Api.speak(delta.text, 0);
changed = true;
break;
}
};
var isNewAnnotation = function(annot) {
var row = annot.row;
var col = annot.column;
return !annotTable[row] || !annotTable[row][col];
};
var populateAnnotations = function(annotations) {
annotTable = {};
for (var i = 0; i < annotations.length; i++) {
var annotation = annotations[i];
var row = annotation.row;
var col = annotation.column;
if (!annotTable[row]) {
annotTable[row] = {};
}
annotTable[row][col] = annotation;
}
};
var onAnnotationChange = function(evt) {
var annotations = cvoxAce.editor.getSession().getAnnotations();
var newAnnotations = annotations.filter(isNewAnnotation);
if (newAnnotations.length > 0) {
cvox.Api.playEarcon(ERROR_EARCON);
}
populateAnnotations(annotations);
};
var speakAnnot = function(annot) {
var annotText = annot.type + ' ' + annot.text + ' on ' +
rowColToString(annot.row, annot.column);
annotText = annotText.replace(';', 'semicolon');
cvox.Api.speak(annotText, 1);
};
var speakAnnotsByRow = function(row) {
var annots = annotTable[row];
for (var col in annots) {
speakAnnot(annots[col]);
}
};
var rowColToString = function(row, col) {
return 'row ' + (row + 1) + ' column ' + (col + 1);
};
var speakCurrRowAndCol = function() {
cvox.Api.speak(rowColToString(lastCursor.row, lastCursor.column));
};
var speakAllAnnots = function() {
for (var row in annotTable) {
speakAnnotsByRow(row);
}
};
var speakMode = function() {
if (!isVimMode()) {
return;
}
switch (cvoxAce.editor.keyBinding.$data.state) {
case INSERT_MODE_STATE:
cvox.Api.speak('Insert mode');
break;
case COMMAND_MODE_STATE:
cvox.Api.speak('Command mode');
break;
}
};
var toggleSpeakRowLocation = function() {
shouldSpeakRowLocation = !shouldSpeakRowLocation;
if (shouldSpeakRowLocation) {
cvox.Api.speak('Speak location on row change enabled.');
} else {
cvox.Api.speak('Speak location on row change disabled.');
}
};
var toggleSpeakDisplacement = function() {
shouldSpeakDisplacement = !shouldSpeakDisplacement;
if (shouldSpeakDisplacement) {
cvox.Api.speak('Speak displacement on column changes.');
} else {
cvox.Api.speak('Speak current character or word on column changes.');
}
};
var onKeyDown = function(evt) {
if (evt.ctrlKey && evt.shiftKey) {
var shortcut = keyCodeToShortcutMap[evt.keyCode];
if (shortcut) {
shortcut.func();
}
}
};
var onChangeStatus = function(evt, editor) {
if (!isVimMode()) {
return;
}
var state = editor.keyBinding.$data.state;
if (state === vimState) {
return;
}
switch (state) {
case INSERT_MODE_STATE:
cvox.Api.playEarcon(MODE_SWITCH_EARCON);
cvox.Api.setKeyEcho(true);
break;
case COMMAND_MODE_STATE:
cvox.Api.playEarcon(MODE_SWITCH_EARCON);
cvox.Api.setKeyEcho(false);
break;
}
vimState = state;
};
var contextMenuHandler = function(evt) {
var cmd = evt.detail['customCommand'];
var shortcut = cmdToShortcutMap[cmd];
if (shortcut) {
shortcut.func();
cvoxAce.editor.focus();
}
};
var initContextMenu = function() {
var ACTIONS = SHORTCUTS.map(function(shortcut) {
return {
desc: shortcut.desc + getKeyShortcutString(shortcut.keyCode),
cmd: shortcut.cmd
};
});
var body = document.querySelector('body');
body.setAttribute('contextMenuActions', JSON.stringify(ACTIONS));
body.addEventListener('ATCustomEvent', contextMenuHandler, true);
};
var onFindSearchbox = function(evt) {
if (evt.match) {
speakLine(lastCursor.row, 0);
} else {
cvox.Api.playEarcon(NO_MATCH_EARCON);
}
};
var focus = function() {
cvoxAce.editor.focus();
};
var SHORTCUTS = [
{
keyCode: 49,
func: function() {
speakAnnotsByRow(lastCursor.row);
},
cmd: Command.SPEAK_ANNOT,
desc: 'Speak annotations on line'
},
{
keyCode: 50,
func: speakAllAnnots,
cmd: Command.SPEAK_ALL_ANNOTS,
desc: 'Speak all annotations'
},
{
keyCode: 51,
func: speakMode,
cmd: Command.SPEAK_MODE,
desc: 'Speak Vim mode'
},
{
keyCode: 52,
func: toggleSpeakRowLocation,
cmd: Command.TOGGLE_LOCATION,
desc: 'Toggle speak row location'
},
{
keyCode: 53,
func: speakCurrRowAndCol,
cmd: Command.SPEAK_ROW_COL,
desc: 'Speak row and column'
},
{
keyCode: 54,
func: toggleSpeakDisplacement,
cmd: Command.TOGGLE_DISPLACEMENT,
desc: 'Toggle speak displacement'
},
{
keyCode: 55,
func: focus,
cmd: Command.FOCUS_TEXT,
desc: 'Focus text'
}
];
var onFocus = function(_, editor) {
cvoxAce.editor = editor;
editor.getSession().selection.on('changeCursor', onCursorChange);
editor.getSession().selection.on('changeSelection', onSelectionChange);
editor.getSession().on('change', onChange);
editor.getSession().on('changeAnnotation', onAnnotationChange);
editor.on('changeStatus', onChangeStatus);
editor.on('findSearchBox', onFindSearchbox);
editor.container.addEventListener('keydown', onKeyDown);
lastCursor = editor.selection.getCursor();
};
var init = function(editor) {
onFocus(null, editor);
SHORTCUTS.forEach(function(shortcut) {
keyCodeToShortcutMap[shortcut.keyCode] = shortcut;
cmdToShortcutMap[shortcut.cmd] = shortcut;
});
editor.on('focus', onFocus);
if (isVimMode()) {
cvox.Api.setKeyEcho(false);
}
initContextMenu();
};
function cvoxApiExists() {
return (typeof(cvox) !== 'undefined') && cvox && cvox.Api;
}
var tries = 0;
var MAX_TRIES = 15;
function watchForCvoxLoad(editor) {
if (cvoxApiExists()) {
init(editor);
} else {
tries++;
if (tries >= MAX_TRIES) {
return;
}
window.setTimeout(watchForCvoxLoad, 500, editor);
}
}
var Editor = require('../editor').Editor;
require('../config').defineOptions(Editor.prototype, 'editor', {
enableChromevoxEnhancements: {
set: function(val) {
if (val) {
watchForCvoxLoad(this);
}
},
value: true // turn it on by default or check for window.cvox
}
});
});
(function() {
window.require(["ace/ext/chromevox"], function() {});
})();

View File

@ -0,0 +1,202 @@
define("ace/ext/code_lens",["require","exports","module","ace/line_widgets","ace/lib/event","ace/lib/lang","ace/lib/dom","ace/editor","ace/config"], function(require, exports, module){"use strict";
var LineWidgets = require("../line_widgets").LineWidgets;
var event = require("../lib/event");
var lang = require("../lib/lang");
var dom = require("../lib/dom");
function clearLensElements(renderer) {
var textLayer = renderer.$textLayer;
var lensElements = textLayer.$lenses;
if (lensElements)
lensElements.forEach(function (el) { el.remove(); });
textLayer.$lenses = null;
}
function renderWidgets(changes, renderer) {
var changed = changes & renderer.CHANGE_LINES
|| changes & renderer.CHANGE_FULL
|| changes & renderer.CHANGE_SCROLL
|| changes & renderer.CHANGE_TEXT;
if (!changed)
return;
var session = renderer.session;
var lineWidgets = renderer.session.lineWidgets;
var textLayer = renderer.$textLayer;
var lensElements = textLayer.$lenses;
if (!lineWidgets) {
if (lensElements)
clearLensElements(renderer);
return;
}
var textCells = renderer.$textLayer.$lines.cells;
var config = renderer.layerConfig;
var padding = renderer.$padding;
if (!lensElements)
lensElements = textLayer.$lenses = [];
var index = 0;
for (var i = 0; i < textCells.length; i++) {
var row = textCells[i].row;
var widget = lineWidgets[row];
var lenses = widget && widget.lenses;
if (!lenses || !lenses.length)
continue;
var lensContainer = lensElements[index];
if (!lensContainer) {
lensContainer = lensElements[index]
= dom.buildDom(["div", { class: "ace_codeLens" }], renderer.container);
}
lensContainer.style.height = config.lineHeight + "px";
index++;
for (var j = 0; j < lenses.length; j++) {
var el = lensContainer.childNodes[2 * j];
if (!el) {
if (j != 0)
lensContainer.appendChild(dom.createTextNode("\xa0|\xa0"));
el = dom.buildDom(["a"], lensContainer);
}
el.textContent = lenses[j].title;
el.lensCommand = lenses[j];
}
while (lensContainer.childNodes.length > 2 * j - 1)
lensContainer.lastChild.remove();
var top = renderer.$cursorLayer.getPixelPosition({
row: row,
column: 0
}, true).top - config.lineHeight * widget.rowsAbove - config.offset;
lensContainer.style.top = top + "px";
var left = renderer.gutterWidth;
var indent = session.getLine(row).search(/\S|$/);
if (indent == -1)
indent = 0;
left += indent * config.characterWidth;
lensContainer.style.paddingLeft = padding + left + "px";
}
while (index < lensElements.length)
lensElements.pop().remove();
}
function clearCodeLensWidgets(session) {
if (!session.lineWidgets)
return;
var widgetManager = session.widgetManager;
session.lineWidgets.forEach(function (widget) {
if (widget && widget.lenses)
widgetManager.removeLineWidget(widget);
});
}
exports.setLenses = function (session, lenses) {
var firstRow = Number.MAX_VALUE;
clearCodeLensWidgets(session);
lenses && lenses.forEach(function (lens) {
var row = lens.start.row;
var column = lens.start.column;
var widget = session.lineWidgets && session.lineWidgets[row];
if (!widget || !widget.lenses) {
widget = session.widgetManager.$registerLineWidget({
rowCount: 1,
rowsAbove: 1,
row: row,
column: column,
lenses: []
});
}
widget.lenses.push(lens.command);
if (row < firstRow)
firstRow = row;
});
session._emit("changeFold", { data: { start: { row: firstRow } } });
return firstRow;
};
function attachToEditor(editor) {
editor.codeLensProviders = [];
editor.renderer.on("afterRender", renderWidgets);
if (!editor.$codeLensClickHandler) {
editor.$codeLensClickHandler = function (e) {
var command = e.target.lensCommand;
if (!command)
return;
editor.execCommand(command.id, command.arguments);
editor._emit("codeLensClick", e);
};
event.addListener(editor.container, "click", editor.$codeLensClickHandler, editor);
}
editor.$updateLenses = function () {
var session = editor.session;
if (!session)
return;
if (!session.widgetManager) {
session.widgetManager = new LineWidgets(session);
session.widgetManager.attach(editor);
}
var providersToWaitNum = editor.codeLensProviders.length;
var lenses = [];
editor.codeLensProviders.forEach(function (provider) {
provider.provideCodeLenses(session, function (err, payload) {
if (err)
return;
payload.forEach(function (lens) {
lenses.push(lens);
});
providersToWaitNum--;
if (providersToWaitNum == 0) {
applyLenses();
}
});
});
function applyLenses() {
var cursor = session.selection.cursor;
var oldRow = session.documentToScreenRow(cursor);
var scrollTop = session.getScrollTop();
var firstRow = exports.setLenses(session, lenses);
var lastDelta = session.$undoManager && session.$undoManager.$lastDelta;
if (lastDelta && lastDelta.action == "remove" && lastDelta.lines.length > 1)
return;
var row = session.documentToScreenRow(cursor);
var lineHeight = editor.renderer.layerConfig.lineHeight;
var top = session.getScrollTop() + (row - oldRow) * lineHeight;
if (firstRow == 0 && scrollTop < lineHeight / 4 && scrollTop > -lineHeight / 4) {
top = -lineHeight;
}
session.setScrollTop(top);
}
};
var updateLenses = lang.delayedCall(editor.$updateLenses);
editor.$updateLensesOnInput = function () {
updateLenses.delay(250);
};
editor.on("input", editor.$updateLensesOnInput);
}
function detachFromEditor(editor) {
editor.off("input", editor.$updateLensesOnInput);
editor.renderer.off("afterRender", renderWidgets);
if (editor.$codeLensClickHandler)
editor.container.removeEventListener("click", editor.$codeLensClickHandler);
}
exports.registerCodeLensProvider = function (editor, codeLensProvider) {
editor.setOption("enableCodeLens", true);
editor.codeLensProviders.push(codeLensProvider);
editor.$updateLensesOnInput();
};
exports.clear = function (session) {
exports.setLenses(session, null);
};
var Editor = require("../editor").Editor;
require("../config").defineOptions(Editor.prototype, "editor", {
enableCodeLens: {
set: function (val) {
if (val) {
attachToEditor(this);
}
else {
detachFromEditor(this);
}
}
}
});
dom.importCssString("\n.ace_codeLens {\n position: absolute;\n color: #aaa;\n font-size: 88%;\n background: inherit;\n width: 100%;\n display: flex;\n align-items: flex-end;\n pointer-events: none;\n}\n.ace_codeLens > a {\n cursor: pointer;\n pointer-events: auto;\n}\n.ace_codeLens > a:hover {\n color: #0000ff;\n text-decoration: underline;\n}\n.ace_dark > .ace_codeLens > a:hover {\n color: #4e94ce;\n}\n", "codelense.css", false);
}); (function() {
window.require(["ace/ext/code_lens"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

View File

@ -0,0 +1,459 @@
define("ace/ext/command_bar",["require","exports","module","ace/tooltip","ace/lib/event_emitter","ace/lib/lang","ace/lib/dom","ace/lib/oop","ace/lib/useragent"], function(require, exports, module){var __values = (this && this.__values) || function(o) {
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
if (m) return m.call(o);
if (o && typeof o.length === "number") return {
next: function () {
if (o && i >= o.length) o = void 0;
return { value: o && o[i++], done: !o };
}
};
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
var Tooltip = require("../tooltip").Tooltip;
var EventEmitter = require("../lib/event_emitter").EventEmitter;
var lang = require("../lib/lang");
var dom = require("../lib/dom");
var oop = require("../lib/oop");
var useragent = require("../lib/useragent");
var BUTTON_CLASS_NAME = 'command_bar_tooltip_button';
var VALUE_CLASS_NAME = 'command_bar_button_value';
var CAPTION_CLASS_NAME = 'command_bar_button_caption';
var KEYBINDING_CLASS_NAME = 'command_bar_keybinding';
var TOOLTIP_CLASS_NAME = 'command_bar_tooltip';
var MORE_OPTIONS_BUTTON_ID = 'MoreOptionsButton';
var defaultDelay = 100;
var defaultMaxElements = 4;
var minPosition = function (posA, posB) {
if (posB.row > posA.row) {
return posA;
}
else if (posB.row === posA.row && posB.column > posA.column) {
return posA;
}
return posB;
};
var keyDisplayMap = {
"Ctrl": { mac: "^" },
"Option": { mac: "⌥" },
"Command": { mac: "⌘" },
"Cmd": { mac: "⌘" },
"Shift": "⇧",
"Left": "←",
"Right": "→",
"Up": "↑",
"Down": "↓"
};
var CommandBarTooltip = /** @class */ (function () {
function CommandBarTooltip(parentNode, options) {
var e_1, _a;
options = options || {};
this.parentNode = parentNode;
this.tooltip = new Tooltip(this.parentNode);
this.moreOptions = new Tooltip(this.parentNode);
this.maxElementsOnTooltip = options.maxElementsOnTooltip || defaultMaxElements;
this.$alwaysShow = options.alwaysShow || false;
this.eventListeners = {};
this.elements = {};
this.commands = {};
this.tooltipEl = dom.buildDom(['div', { class: TOOLTIP_CLASS_NAME }], this.tooltip.getElement());
this.moreOptionsEl = dom.buildDom(['div', { class: TOOLTIP_CLASS_NAME + " tooltip_more_options" }], this.moreOptions.getElement());
this.$showTooltipTimer = lang.delayedCall(this.$showTooltip.bind(this), options.showDelay || defaultDelay);
this.$hideTooltipTimer = lang.delayedCall(this.$hideTooltip.bind(this), options.hideDelay || defaultDelay);
this.$tooltipEnter = this.$tooltipEnter.bind(this);
this.$onMouseMove = this.$onMouseMove.bind(this);
this.$onChangeScroll = this.$onChangeScroll.bind(this);
this.$onEditorChangeSession = this.$onEditorChangeSession.bind(this);
this.$scheduleTooltipForHide = this.$scheduleTooltipForHide.bind(this);
this.$preventMouseEvent = this.$preventMouseEvent.bind(this);
try {
for (var _b = __values(["mousedown", "mouseup", "click"]), _c = _b.next(); !_c.done; _c = _b.next()) {
var event = _c.value;
this.tooltip.getElement().addEventListener(event, this.$preventMouseEvent);
this.moreOptions.getElement().addEventListener(event, this.$preventMouseEvent);
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
}
finally { if (e_1) throw e_1.error; }
}
}
CommandBarTooltip.prototype.registerCommand = function (id, command) {
var registerForMainTooltip = Object.keys(this.commands).length < this.maxElementsOnTooltip;
if (!registerForMainTooltip && !this.elements[MORE_OPTIONS_BUTTON_ID]) {
this.$createCommand(MORE_OPTIONS_BUTTON_ID, {
name: "···",
exec:
function () {
this.$shouldHideMoreOptions = false;
this.$setMoreOptionsVisibility(!this.isMoreOptionsShown());
}.bind(this),
type: "checkbox",
getValue: function () {
return this.isMoreOptionsShown();
}.bind(this),
enabled: true
}, true);
}
this.$createCommand(id, command, registerForMainTooltip);
if (this.isShown()) {
this.updatePosition();
}
};
CommandBarTooltip.prototype.isShown = function () {
return !!this.tooltip && this.tooltip.isOpen;
};
CommandBarTooltip.prototype.isMoreOptionsShown = function () {
return !!this.moreOptions && this.moreOptions.isOpen;
};
CommandBarTooltip.prototype.getAlwaysShow = function () {
return this.$alwaysShow;
};
CommandBarTooltip.prototype.setAlwaysShow = function (alwaysShow) {
this.$alwaysShow = alwaysShow;
this.$updateOnHoverHandlers(!this.$alwaysShow);
this._signal("alwaysShow", this.$alwaysShow);
};
CommandBarTooltip.prototype.attach = function (editor) {
if (!editor || (this.isShown() && this.editor === editor)) {
return;
}
this.detach();
this.editor = editor;
this.editor.on("changeSession", this.$onEditorChangeSession);
if (this.editor.session) {
this.editor.session.on("changeScrollLeft", this.$onChangeScroll);
this.editor.session.on("changeScrollTop", this.$onChangeScroll);
}
if (this.getAlwaysShow()) {
this.$showTooltip();
}
else {
this.$updateOnHoverHandlers(true);
}
};
CommandBarTooltip.prototype.updatePosition = function () {
if (!this.editor) {
return;
}
var renderer = this.editor.renderer;
var ranges;
if (this.editor.selection.getAllRanges) {
ranges = this.editor.selection.getAllRanges();
}
else {
ranges = [this.editor.getSelectionRange()];
}
if (!ranges.length) {
return;
}
var minPos = minPosition(ranges[0].start, ranges[0].end);
for (var i = 0, range; range = ranges[i]; i++) {
minPos = minPosition(minPos, minPosition(range.start, range.end));
}
var pos = renderer.$cursorLayer.getPixelPosition(minPos, true);
var tooltipEl = this.tooltip.getElement();
var screenWidth = window.innerWidth;
var screenHeight = window.innerHeight;
var rect = this.editor.container.getBoundingClientRect();
pos.top += rect.top - renderer.layerConfig.offset;
pos.left += rect.left + renderer.gutterWidth - renderer.scrollLeft;
var cursorVisible = pos.top >= rect.top && pos.top <= rect.bottom &&
pos.left >= rect.left + renderer.gutterWidth && pos.left <= rect.right;
if (!cursorVisible && this.isShown()) {
this.$hideTooltip();
return;
}
else if (cursorVisible && !this.isShown() && this.getAlwaysShow()) {
this.$showTooltip();
return;
}
var top = pos.top - tooltipEl.offsetHeight;
var left = Math.min(screenWidth - tooltipEl.offsetWidth, pos.left);
var tooltipFits = top >= 0 && top + tooltipEl.offsetHeight <= screenHeight &&
left >= 0 && left + tooltipEl.offsetWidth <= screenWidth;
if (!tooltipFits) {
this.$hideTooltip();
return;
}
this.tooltip.setPosition(left, top);
if (this.isMoreOptionsShown()) {
top = top + tooltipEl.offsetHeight;
left = this.elements[MORE_OPTIONS_BUTTON_ID].getBoundingClientRect().left;
var moreOptionsEl = this.moreOptions.getElement();
var screenHeight = window.innerHeight;
if (top + moreOptionsEl.offsetHeight > screenHeight) {
top -= tooltipEl.offsetHeight + moreOptionsEl.offsetHeight;
}
if (left + moreOptionsEl.offsetWidth > screenWidth) {
left = screenWidth - moreOptionsEl.offsetWidth;
}
this.moreOptions.setPosition(left, top);
}
};
CommandBarTooltip.prototype.update = function () {
Object.keys(this.elements).forEach(this.$updateElement.bind(this));
};
CommandBarTooltip.prototype.detach = function () {
this.tooltip.hide();
this.moreOptions.hide();
this.$updateOnHoverHandlers(false);
if (this.editor) {
this.editor.off("changeSession", this.$onEditorChangeSession);
if (this.editor.session) {
this.editor.session.off("changeScrollLeft", this.$onChangeScroll);
this.editor.session.off("changeScrollTop", this.$onChangeScroll);
}
}
this.$mouseInTooltip = false;
this.editor = null;
};
CommandBarTooltip.prototype.destroy = function () {
if (this.tooltip && this.moreOptions) {
this.detach();
this.tooltip.destroy();
this.moreOptions.destroy();
}
this.eventListeners = {};
this.commands = {};
this.elements = {};
this.tooltip = this.moreOptions = this.parentNode = null;
};
CommandBarTooltip.prototype.$createCommand = function (id, command, forMainTooltip) {
var parentEl = forMainTooltip ? this.tooltipEl : this.moreOptionsEl;
var keyParts = [];
var bindKey = command.bindKey;
if (bindKey) {
if (typeof bindKey === 'object') {
bindKey = useragent.isMac ? bindKey.mac : bindKey.win;
}
bindKey = bindKey.split("|")[0];
keyParts = bindKey.split("-");
keyParts = keyParts.map(function (key) {
if (keyDisplayMap[key]) {
if (typeof keyDisplayMap[key] === 'string') {
return keyDisplayMap[key];
}
else if (useragent.isMac && keyDisplayMap[key].mac) {
return keyDisplayMap[key].mac;
}
}
return key;
});
}
var buttonNode;
if (forMainTooltip && command.iconCssClass) {
buttonNode = [
'div',
{
class: ["ace_icon_svg", command.iconCssClass].join(" "),
"aria-label": command.name + " (" + command.bindKey + ")"
}
];
}
else {
buttonNode = [
['div', { class: VALUE_CLASS_NAME }],
['div', { class: CAPTION_CLASS_NAME }, command.name]
];
if (keyParts.length) {
buttonNode.push([
'div',
{ class: KEYBINDING_CLASS_NAME },
keyParts.map(function (keyPart) {
return ['div', keyPart];
})
]);
}
}
dom.buildDom(['div', { class: [BUTTON_CLASS_NAME, command.cssClass || ""].join(" "), ref: id }, buttonNode], parentEl, this.elements);
this.commands[id] = command;
var eventListener =
function (e) {
if (this.editor) {
this.editor.focus();
}
this.$shouldHideMoreOptions = this.isMoreOptionsShown();
if (!this.elements[id].disabled && command.exec) {
command.exec(this.editor);
}
if (this.$shouldHideMoreOptions) {
this.$setMoreOptionsVisibility(false);
}
this.update();
e.preventDefault();
}.bind(this);
this.eventListeners[id] = eventListener;
this.elements[id].addEventListener('click', eventListener.bind(this));
this.$updateElement(id);
};
CommandBarTooltip.prototype.$setMoreOptionsVisibility = function (visible) {
if (visible) {
this.moreOptions.setTheme(this.editor.renderer.theme);
this.moreOptions.setClassName(TOOLTIP_CLASS_NAME + "_wrapper");
this.moreOptions.show();
this.update();
this.updatePosition();
}
else {
this.moreOptions.hide();
}
};
CommandBarTooltip.prototype.$onEditorChangeSession = function (e) {
if (e.oldSession) {
e.oldSession.off("changeScrollTop", this.$onChangeScroll);
e.oldSession.off("changeScrollLeft", this.$onChangeScroll);
}
this.detach();
};
CommandBarTooltip.prototype.$onChangeScroll = function () {
if (this.editor.renderer && (this.isShown() || this.getAlwaysShow())) {
this.editor.renderer.once("afterRender", this.updatePosition.bind(this));
}
};
CommandBarTooltip.prototype.$onMouseMove = function (e) {
if (this.$mouseInTooltip) {
return;
}
var cursorPosition = this.editor.getCursorPosition();
var cursorScreenPosition = this.editor.renderer.textToScreenCoordinates(cursorPosition.row, cursorPosition.column);
var lineHeight = this.editor.renderer.lineHeight;
var isInCurrentLine = e.clientY >= cursorScreenPosition.pageY && e.clientY < cursorScreenPosition.pageY + lineHeight;
if (isInCurrentLine) {
if (!this.isShown() && !this.$showTooltipTimer.isPending()) {
this.$showTooltipTimer.delay();
}
if (this.$hideTooltipTimer.isPending()) {
this.$hideTooltipTimer.cancel();
}
}
else {
if (this.isShown() && !this.$hideTooltipTimer.isPending()) {
this.$hideTooltipTimer.delay();
}
if (this.$showTooltipTimer.isPending()) {
this.$showTooltipTimer.cancel();
}
}
};
CommandBarTooltip.prototype.$preventMouseEvent = function (e) {
if (this.editor) {
this.editor.focus();
}
e.preventDefault();
};
CommandBarTooltip.prototype.$scheduleTooltipForHide = function () {
this.$mouseInTooltip = false;
this.$showTooltipTimer.cancel();
this.$hideTooltipTimer.delay();
};
CommandBarTooltip.prototype.$tooltipEnter = function () {
this.$mouseInTooltip = true;
if (this.$showTooltipTimer.isPending()) {
this.$showTooltipTimer.cancel();
}
if (this.$hideTooltipTimer.isPending()) {
this.$hideTooltipTimer.cancel();
}
};
CommandBarTooltip.prototype.$updateOnHoverHandlers = function (enableHover) {
var tooltipEl = this.tooltip.getElement();
var moreOptionsEl = this.moreOptions.getElement();
if (enableHover) {
if (this.editor) {
this.editor.on("mousemove", this.$onMouseMove);
this.editor.renderer.getMouseEventTarget().addEventListener("mouseout", this.$scheduleTooltipForHide, true);
}
tooltipEl.addEventListener('mouseenter', this.$tooltipEnter);
tooltipEl.addEventListener('mouseleave', this.$scheduleTooltipForHide);
moreOptionsEl.addEventListener('mouseenter', this.$tooltipEnter);
moreOptionsEl.addEventListener('mouseleave', this.$scheduleTooltipForHide);
}
else {
if (this.editor) {
this.editor.off("mousemove", this.$onMouseMove);
this.editor.renderer.getMouseEventTarget().removeEventListener("mouseout", this.$scheduleTooltipForHide, true);
}
tooltipEl.removeEventListener('mouseenter', this.$tooltipEnter);
tooltipEl.removeEventListener('mouseleave', this.$scheduleTooltipForHide);
moreOptionsEl.removeEventListener('mouseenter', this.$tooltipEnter);
moreOptionsEl.removeEventListener('mouseleave', this.$scheduleTooltipForHide);
}
};
CommandBarTooltip.prototype.$showTooltip = function () {
if (this.isShown()) {
return;
}
this.tooltip.setTheme(this.editor.renderer.theme);
this.tooltip.setClassName(TOOLTIP_CLASS_NAME + "_wrapper");
this.tooltip.show();
this.update();
this.updatePosition();
this._signal("show");
};
CommandBarTooltip.prototype.$hideTooltip = function () {
this.$mouseInTooltip = false;
if (!this.isShown()) {
return;
}
this.moreOptions.hide();
this.tooltip.hide();
this._signal("hide");
};
CommandBarTooltip.prototype.$updateElement = function (id) {
var command = this.commands[id];
if (!command) {
return;
}
var el = this.elements[id];
var commandEnabled = command.enabled;
if (typeof commandEnabled === 'function') {
commandEnabled = commandEnabled(this.editor);
}
if (typeof command.getValue === 'function') {
var value = command.getValue(this.editor);
if (command.type === 'text') {
el.textContent = value;
}
else if (command.type === 'checkbox') {
var domCssFn = value ? dom.addCssClass : dom.removeCssClass;
var isOnTooltip = el.parentElement === this.tooltipEl;
el.ariaChecked = value;
if (isOnTooltip) {
domCssFn(el, "ace_selected");
}
else {
el = el.querySelector("." + VALUE_CLASS_NAME);
domCssFn(el, "ace_checkmark");
}
}
}
if (commandEnabled && el.disabled) {
dom.removeCssClass(el, "ace_disabled");
el.ariaDisabled = el.disabled = false;
el.removeAttribute("disabled");
}
else if (!commandEnabled && !el.disabled) {
dom.addCssClass(el, "ace_disabled");
el.ariaDisabled = el.disabled = true;
el.setAttribute("disabled", "");
}
};
return CommandBarTooltip;
}());
oop.implement(CommandBarTooltip.prototype, EventEmitter);
dom.importCssString("\n.ace_tooltip.".concat(TOOLTIP_CLASS_NAME, "_wrapper {\n padding: 0;\n}\n\n.ace_tooltip .").concat(TOOLTIP_CLASS_NAME, " {\n padding: 1px 5px;\n display: flex;\n pointer-events: auto;\n}\n\n.ace_tooltip .").concat(TOOLTIP_CLASS_NAME, ".tooltip_more_options {\n padding: 1px;\n flex-direction: column;\n}\n\ndiv.").concat(BUTTON_CLASS_NAME, " {\n display: inline-flex;\n cursor: pointer;\n margin: 1px;\n border-radius: 2px;\n padding: 2px 5px;\n align-items: center;\n}\n\ndiv.").concat(BUTTON_CLASS_NAME, ".ace_selected,\ndiv.").concat(BUTTON_CLASS_NAME, ":hover:not(.ace_disabled) {\n background-color: rgba(0, 0, 0, 0.1);\n}\n\ndiv.").concat(BUTTON_CLASS_NAME, ".ace_disabled {\n color: #777;\n pointer-events: none;\n}\n\ndiv.").concat(BUTTON_CLASS_NAME, " .ace_icon_svg {\n height: 12px;\n background-color: #000;\n}\n\ndiv.").concat(BUTTON_CLASS_NAME, ".ace_disabled .ace_icon_svg {\n background-color: #777;\n}\n\n.").concat(TOOLTIP_CLASS_NAME, ".tooltip_more_options .").concat(BUTTON_CLASS_NAME, " {\n display: flex;\n}\n\n.").concat(TOOLTIP_CLASS_NAME, ".").concat(VALUE_CLASS_NAME, " {\n display: none;\n}\n\n.").concat(TOOLTIP_CLASS_NAME, ".tooltip_more_options .").concat(VALUE_CLASS_NAME, " {\n display: inline-block;\n width: 12px;\n}\n\n.").concat(CAPTION_CLASS_NAME, " {\n display: inline-block;\n}\n\n.").concat(KEYBINDING_CLASS_NAME, " {\n margin: 0 2px;\n display: inline-block;\n font-size: 8px;\n}\n\n.").concat(TOOLTIP_CLASS_NAME, ".tooltip_more_options .").concat(KEYBINDING_CLASS_NAME, " {\n margin-left: auto;\n}\n\n.").concat(KEYBINDING_CLASS_NAME, " div {\n display: inline-block;\n min-width: 8px;\n padding: 2px;\n margin: 0 1px;\n border-radius: 2px;\n background-color: #ccc;\n text-align: center;\n}\n\n.ace_dark.ace_tooltip .").concat(TOOLTIP_CLASS_NAME, " {\n background-color: #373737;\n color: #eee;\n}\n\n.ace_dark div.").concat(BUTTON_CLASS_NAME, ".ace_disabled {\n color: #979797;\n}\n\n.ace_dark div.").concat(BUTTON_CLASS_NAME, ".ace_selected,\n.ace_dark div.").concat(BUTTON_CLASS_NAME, ":hover:not(.ace_disabled) {\n background-color: rgba(255, 255, 255, 0.1);\n}\n\n.ace_dark div.").concat(BUTTON_CLASS_NAME, " .ace_icon_svg {\n background-color: #eee;\n}\n\n.ace_dark div.").concat(BUTTON_CLASS_NAME, ".ace_disabled .ace_icon_svg {\n background-color: #979797;\n}\n\n.ace_dark .").concat(BUTTON_CLASS_NAME, ".ace_disabled {\n color: #979797;\n}\n\n.ace_dark .").concat(KEYBINDING_CLASS_NAME, " div {\n background-color: #575757;\n}\n\n.ace_checkmark::before {\n content: '\u2713';\n}\n"), "commandbar.css", false);
exports.CommandBarTooltip = CommandBarTooltip;
exports.TOOLTIP_CLASS_NAME = TOOLTIP_CLASS_NAME;
exports.BUTTON_CLASS_NAME = BUTTON_CLASS_NAME;
}); (function() {
window.require(["ace/ext/command_bar"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

View File

@ -1,44 +1,37 @@
define("ace/ext/elastic_tabstops_lite",["require","exports","module","ace/editor","ace/config"], function(require, exports, module) { define("ace/ext/elastic_tabstops_lite",["require","exports","module","ace/editor","ace/config"], function(require, exports, module){"use strict";
"use strict"; var ElasticTabstopsLite = /** @class */ (function () {
function ElasticTabstopsLite(editor) {
var ElasticTabstopsLite = function(editor) { this.$editor = editor;
this.$editor = editor; var self = this;
var self = this; var changedRows = [];
var changedRows = []; var recordChanges = false;
var recordChanges = false; this.onAfterExec = function () {
this.onAfterExec = function() { recordChanges = false;
recordChanges = false; self.processRows(changedRows);
self.processRows(changedRows); changedRows = [];
changedRows = []; };
}; this.onExec = function () {
this.onExec = function() { recordChanges = true;
recordChanges = true; };
}; this.onChange = function (delta) {
this.onChange = function(delta) { if (recordChanges) {
if (recordChanges) { if (changedRows.indexOf(delta.start.row) == -1)
if (changedRows.indexOf(delta.start.row) == -1) changedRows.push(delta.start.row);
changedRows.push(delta.start.row); if (delta.end.row != delta.start.row)
if (delta.end.row != delta.start.row) changedRows.push(delta.end.row);
changedRows.push(delta.end.row); }
} };
}; }
}; ElasticTabstopsLite.prototype.processRows = function (rows) {
(function() {
this.processRows = function(rows) {
this.$inChange = true; this.$inChange = true;
var checkedRows = []; var checkedRows = [];
for (var r = 0, rowCount = rows.length; r < rowCount; r++) { for (var r = 0, rowCount = rows.length; r < rowCount; r++) {
var row = rows[r]; var row = rows[r];
if (checkedRows.indexOf(row) > -1) if (checkedRows.indexOf(row) > -1)
continue; continue;
var cellWidthObj = this.$findCellWidthsForBlock(row); var cellWidthObj = this.$findCellWidthsForBlock(row);
var cellWidths = this.$setBlockCellWidthsToMax(cellWidthObj.cellWidths); var cellWidths = this.$setBlockCellWidthsToMax(cellWidthObj.cellWidths);
var rowIndex = cellWidthObj.firstRow; var rowIndex = cellWidthObj.firstRow;
for (var w = 0, l = cellWidths.length; w < l; w++) { for (var w = 0, l = cellWidths.length; w < l; w++) {
var widths = cellWidths[w]; var widths = cellWidths[w];
checkedRows.push(rowIndex); checkedRows.push(rowIndex);
@ -48,68 +41,53 @@ var ElasticTabstopsLite = function(editor) {
} }
this.$inChange = false; this.$inChange = false;
}; };
ElasticTabstopsLite.prototype.$findCellWidthsForBlock = function (row) {
this.$findCellWidthsForBlock = function(row) {
var cellWidths = [], widths; var cellWidths = [], widths;
var rowIter = row; var rowIter = row;
while (rowIter >= 0) { while (rowIter >= 0) {
widths = this.$cellWidthsForRow(rowIter); widths = this.$cellWidthsForRow(rowIter);
if (widths.length == 0) if (widths.length == 0)
break; break;
cellWidths.unshift(widths); cellWidths.unshift(widths);
rowIter--; rowIter--;
} }
var firstRow = rowIter + 1; var firstRow = rowIter + 1;
rowIter = row; rowIter = row;
var numRows = this.$editor.session.getLength(); var numRows = this.$editor.session.getLength();
while (rowIter < numRows - 1) { while (rowIter < numRows - 1) {
rowIter++; rowIter++;
widths = this.$cellWidthsForRow(rowIter); widths = this.$cellWidthsForRow(rowIter);
if (widths.length == 0) if (widths.length == 0)
break; break;
cellWidths.push(widths); cellWidths.push(widths);
} }
return { cellWidths: cellWidths, firstRow: firstRow }; return { cellWidths: cellWidths, firstRow: firstRow };
}; };
ElasticTabstopsLite.prototype.$cellWidthsForRow = function (row) {
this.$cellWidthsForRow = function(row) {
var selectionColumns = this.$selectionColumnsForRow(row); var selectionColumns = this.$selectionColumnsForRow(row);
var tabs = [-1].concat(this.$tabsForRow(row)); var tabs = [-1].concat(this.$tabsForRow(row));
var widths = tabs.map(function(el) { return 0; } ).slice(1); var widths = tabs.map(function (el) { return 0; }).slice(1);
var line = this.$editor.session.getLine(row); var line = this.$editor.session.getLine(row);
for (var i = 0, len = tabs.length - 1; i < len; i++) { for (var i = 0, len = tabs.length - 1; i < len; i++) {
var leftEdge = tabs[i]+1; var leftEdge = tabs[i] + 1;
var rightEdge = tabs[i+1]; var rightEdge = tabs[i + 1];
var rightmostSelection = this.$rightmostSelectionInCell(selectionColumns, rightEdge); var rightmostSelection = this.$rightmostSelectionInCell(selectionColumns, rightEdge);
var cell = line.substring(leftEdge, rightEdge); var cell = line.substring(leftEdge, rightEdge);
widths[i] = Math.max(cell.replace(/\s+$/g,'').length, rightmostSelection - leftEdge); widths[i] = Math.max(cell.replace(/\s+$/g, '').length, rightmostSelection - leftEdge);
} }
return widths; return widths;
}; };
ElasticTabstopsLite.prototype.$selectionColumnsForRow = function (row) {
this.$selectionColumnsForRow = function(row) {
var selections = [], cursor = this.$editor.getCursorPosition(); var selections = [], cursor = this.$editor.getCursorPosition();
if (this.$editor.session.getSelection().isEmpty()) { if (this.$editor.session.getSelection().isEmpty()) {
if (row == cursor.row) if (row == cursor.row)
selections.push(cursor.column); selections.push(cursor.column);
} }
return selections; return selections;
}; };
ElasticTabstopsLite.prototype.$setBlockCellWidthsToMax = function (cellWidths) {
this.$setBlockCellWidthsToMax = function(cellWidths) {
var startingNewBlock = true, blockStartRow, blockEndRow, maxWidth; var startingNewBlock = true, blockStartRow, blockEndRow, maxWidth;
var columnInfo = this.$izip_longest(cellWidths); var columnInfo = this.$izip_longest(cellWidths);
for (var c = 0, l = columnInfo.length; c < l; c++) { for (var c = 0, l = columnInfo.length; c < l; c++) {
var column = columnInfo[c]; var column = columnInfo[c];
if (!column.push) { if (!column.push) {
@ -117,7 +95,6 @@ var ElasticTabstopsLite = function(editor) {
continue; continue;
} }
column.push(NaN); column.push(NaN);
for (var r = 0, s = column.length; r < s; r++) { for (var r = 0, s = column.length; r < s; r++) {
var width = column[r]; var width = column[r];
if (startingNewBlock) { if (startingNewBlock) {
@ -127,23 +104,18 @@ var ElasticTabstopsLite = function(editor) {
} }
if (isNaN(width)) { if (isNaN(width)) {
blockEndRow = r; blockEndRow = r;
for (var j = blockStartRow; j < blockEndRow; j++) { for (var j = blockStartRow; j < blockEndRow; j++) {
cellWidths[j][c] = maxWidth; cellWidths[j][c] = maxWidth;
} }
startingNewBlock = true; startingNewBlock = true;
} }
maxWidth = Math.max(maxWidth, width); maxWidth = Math.max(maxWidth, width);
} }
} }
return cellWidths; return cellWidths;
}; };
ElasticTabstopsLite.prototype.$rightmostSelectionInCell = function (selectionColumns, cellRightEdge) {
this.$rightmostSelectionInCell = function(selectionColumns, cellRightEdge) {
var rightmost = 0; var rightmost = 0;
if (selectionColumns.length) { if (selectionColumns.length) {
var lengths = []; var lengths = [];
for (var s = 0, length = selectionColumns.length; s < length; s++) { for (var s = 0, length = selectionColumns.length; s < length; s++) {
@ -154,70 +126,53 @@ var ElasticTabstopsLite = function(editor) {
} }
rightmost = Math.max.apply(Math, lengths); rightmost = Math.max.apply(Math, lengths);
} }
return rightmost; return rightmost;
}; };
ElasticTabstopsLite.prototype.$tabsForRow = function (row) {
this.$tabsForRow = function(row) { var rowTabs = [], line = this.$editor.session.getLine(row), re = /\t/g, match;
var rowTabs = [], line = this.$editor.session.getLine(row),
re = /\t/g, match;
while ((match = re.exec(line)) != null) { while ((match = re.exec(line)) != null) {
rowTabs.push(match.index); rowTabs.push(match.index);
} }
return rowTabs; return rowTabs;
}; };
ElasticTabstopsLite.prototype.$adjustRow = function (row, widths) {
this.$adjustRow = function(row, widths) {
var rowTabs = this.$tabsForRow(row); var rowTabs = this.$tabsForRow(row);
if (rowTabs.length == 0) if (rowTabs.length == 0)
return; return;
var bias = 0, location = -1; var bias = 0, location = -1;
var expandedSet = this.$izip(widths, rowTabs); var expandedSet = this.$izip(widths, rowTabs);
for (var i = 0, l = expandedSet.length; i < l; i++) { for (var i = 0, l = expandedSet.length; i < l; i++) {
var w = expandedSet[i][0], it = expandedSet[i][1]; var w = expandedSet[i][0], it = expandedSet[i][1];
location += 1 + w; location += 1 + w;
it += bias; it += bias;
var difference = location - it; var difference = location - it;
if (difference == 0) if (difference == 0)
continue; continue;
var partialLine = this.$editor.session.getLine(row).substr(0, it);
var partialLine = this.$editor.session.getLine(row).substr(0, it );
var strippedPartialLine = partialLine.replace(/\s*$/g, ""); var strippedPartialLine = partialLine.replace(/\s*$/g, "");
var ispaces = partialLine.length - strippedPartialLine.length; var ispaces = partialLine.length - strippedPartialLine.length;
if (difference > 0) { if (difference > 0) {
this.$editor.session.getDocument().insertInLine({row: row, column: it + 1}, Array(difference + 1).join(" ") + "\t"); this.$editor.session.getDocument().insertInLine({ row: row, column: it + 1 }, Array(difference + 1).join(" ") + "\t");
this.$editor.session.getDocument().removeInLine(row, it, it + 1); this.$editor.session.getDocument().removeInLine(row, it, it + 1);
bias += difference; bias += difference;
} }
if (difference < 0 && ispaces >= -difference) { if (difference < 0 && ispaces >= -difference) {
this.$editor.session.getDocument().removeInLine(row, it + difference, it); this.$editor.session.getDocument().removeInLine(row, it + difference, it);
bias += difference; bias += difference;
} }
} }
}; };
this.$izip_longest = function(iterables) { ElasticTabstopsLite.prototype.$izip_longest = function (iterables) {
if (!iterables[0]) if (!iterables[0])
return []; return [];
var longest = iterables[0].length; var longest = iterables[0].length;
var iterablesLength = iterables.length; var iterablesLength = iterables.length;
for (var i = 1; i < iterablesLength; i++) { for (var i = 1; i < iterablesLength; i++) {
var iLength = iterables[i].length; var iLength = iterables[i].length;
if (iLength > longest) if (iLength > longest)
longest = iLength; longest = iLength;
} }
var expandedSet = []; var expandedSet = [];
for (var l = 0; l < longest; l++) { for (var l = 0; l < longest; l++) {
var set = []; var set = [];
for (var i = 0; i < iterablesLength; i++) { for (var i = 0; i < iterablesLength; i++) {
@ -226,39 +181,34 @@ var ElasticTabstopsLite = function(editor) {
else else
set.push(iterables[i][l]); set.push(iterables[i][l]);
} }
expandedSet.push(set); expandedSet.push(set);
} }
return expandedSet; return expandedSet;
}; };
this.$izip = function(widths, tabs) { ElasticTabstopsLite.prototype.$izip = function (widths, tabs) {
var size = widths.length >= tabs.length ? tabs.length : widths.length; var size = widths.length >= tabs.length ? tabs.length : widths.length;
var expandedSet = []; var expandedSet = [];
for (var i = 0; i < size; i++) { for (var i = 0; i < size; i++) {
var set = [ widths[i], tabs[i] ]; var set = [widths[i], tabs[i]];
expandedSet.push(set); expandedSet.push(set);
} }
return expandedSet; return expandedSet;
}; };
return ElasticTabstopsLite;
}).call(ElasticTabstopsLite.prototype); }());
exports.ElasticTabstopsLite = ElasticTabstopsLite; exports.ElasticTabstopsLite = ElasticTabstopsLite;
var Editor = require("../editor").Editor; var Editor = require("../editor").Editor;
require("../config").defineOptions(Editor.prototype, "editor", { require("../config").defineOptions(Editor.prototype, "editor", {
useElasticTabstops: { useElasticTabstops: {
set: function(val) { set: function (val) {
if (val) { if (val) {
if (!this.elasticTabstops) if (!this.elasticTabstops)
this.elasticTabstops = new ElasticTabstopsLite(this); this.elasticTabstops = new ElasticTabstopsLite(this);
this.commands.on("afterExec", this.elasticTabstops.onAfterExec); this.commands.on("afterExec", this.elasticTabstops.onAfterExec);
this.commands.on("exec", this.elasticTabstops.onExec); this.commands.on("exec", this.elasticTabstops.onExec);
this.on("change", this.elasticTabstops.onChange); this.on("change", this.elasticTabstops.onChange);
} else if (this.elasticTabstops) { }
else if (this.elasticTabstops) {
this.commands.removeListener("afterExec", this.elasticTabstops.onAfterExec); this.commands.removeListener("afterExec", this.elasticTabstops.onAfterExec);
this.commands.removeListener("exec", this.elasticTabstops.onExec); this.commands.removeListener("exec", this.elasticTabstops.onExec);
this.removeListener("change", this.elasticTabstops.onChange); this.removeListener("change", this.elasticTabstops.onChange);
@ -267,8 +217,11 @@ require("../config").defineOptions(Editor.prototype, "editor", {
} }
}); });
}); }); (function() {
(function() { window.require(["ace/ext/elastic_tabstops_lite"], function(m) {
window.require(["ace/ext/elastic_tabstops_lite"], function() {}); if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})(); })();

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,9 @@
; ; (function() {
(function() { window.require(["ace/ext/error_marker"], function(m) {
window.require(["ace/ext/error_marker"], function() {}); if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})(); })();

View File

@ -0,0 +1,116 @@
define("ace/ext/hardwrap",["require","exports","module","ace/range","ace/editor","ace/config"], function(require, exports, module){"use strict";
var Range = require("../range").Range;
function hardWrap(editor, options) {
var max = options.column || editor.getOption("printMarginColumn");
var allowMerge = options.allowMerge != false;
var row = Math.min(options.startRow, options.endRow);
var endRow = Math.max(options.startRow, options.endRow);
var session = editor.session;
while (row <= endRow) {
var line = session.getLine(row);
if (line.length > max) {
var space = findSpace(line, max, 5);
if (space) {
var indentation = /^\s*/.exec(line)[0];
session.replace(new Range(row, space.start, row, space.end), "\n" + indentation);
}
endRow++;
}
else if (allowMerge && /\S/.test(line) && row != endRow) {
var nextLine = session.getLine(row + 1);
if (nextLine && /\S/.test(nextLine)) {
var trimmedLine = line.replace(/\s+$/, "");
var trimmedNextLine = nextLine.replace(/^\s+/, "");
var mergedLine = trimmedLine + " " + trimmedNextLine;
var space = findSpace(mergedLine, max, 5);
if (space && space.start > trimmedLine.length || mergedLine.length < max) {
var replaceRange = new Range(row, trimmedLine.length, row + 1, nextLine.length - trimmedNextLine.length);
session.replace(replaceRange, " ");
row--;
endRow--;
}
else if (trimmedLine.length < line.length) {
session.remove(new Range(row, trimmedLine.length, row, line.length));
}
}
}
row++;
}
function findSpace(line, max, min) {
if (line.length < max)
return;
var before = line.slice(0, max);
var after = line.slice(max);
var spaceAfter = /^(?:(\s+)|(\S+)(\s+))/.exec(after);
var spaceBefore = /(?:(\s+)|(\s+)(\S+))$/.exec(before);
var start = 0;
var end = 0;
if (spaceBefore && !spaceBefore[2]) {
start = max - spaceBefore[1].length;
end = max;
}
if (spaceAfter && !spaceAfter[2]) {
if (!start)
start = max;
end = max + spaceAfter[1].length;
}
if (start) {
return {
start: start,
end: end
};
}
if (spaceBefore && spaceBefore[2] && spaceBefore.index > min) {
return {
start: spaceBefore.index,
end: spaceBefore.index + spaceBefore[2].length
};
}
if (spaceAfter && spaceAfter[2]) {
start = max + spaceAfter[2].length;
return {
start: start,
end: start + spaceAfter[3].length
};
}
}
}
function wrapAfterInput(e) {
if (e.command.name == "insertstring" && /\S/.test(e.args)) {
var editor = e.editor;
var cursor = editor.selection.cursor;
if (cursor.column <= editor.renderer.$printMarginColumn)
return;
var lastDelta = editor.session.$undoManager.$lastDelta;
hardWrap(editor, {
startRow: cursor.row, endRow: cursor.row,
allowMerge: false
});
if (lastDelta != editor.session.$undoManager.$lastDelta)
editor.session.markUndoGroup();
}
}
var Editor = require("../editor").Editor;
require("../config").defineOptions(Editor.prototype, "editor", {
hardWrap: {
set: function (val) {
if (val) {
this.commands.on("afterExec", wrapAfterInput);
}
else {
this.commands.off("afterExec", wrapAfterInput);
}
},
value: false
}
});
exports.hardWrap = hardWrap;
}); (function() {
window.require(["ace/ext/hardwrap"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

File diff suppressed because it is too large Load Diff

View File

@ -1,125 +1,85 @@
define("ace/ext/menu_tools/overlay_page",["require","exports","module","ace/lib/dom"], function(require, exports, module) { define("ace/ext/menu_tools/settings_menu.css",["require","exports","module"], function(require, exports, module){module.exports = "#ace_settingsmenu, #kbshortcutmenu {\n background-color: #F7F7F7;\n color: black;\n box-shadow: -5px 4px 5px rgba(126, 126, 126, 0.55);\n padding: 1em 0.5em 2em 1em;\n overflow: auto;\n position: absolute;\n margin: 0;\n bottom: 0;\n right: 0;\n top: 0;\n z-index: 9991;\n cursor: default;\n}\n\n.ace_dark #ace_settingsmenu, .ace_dark #kbshortcutmenu {\n box-shadow: -20px 10px 25px rgba(126, 126, 126, 0.25);\n background-color: rgba(255, 255, 255, 0.6);\n color: black;\n}\n\n.ace_optionsMenuEntry:hover {\n background-color: rgba(100, 100, 100, 0.1);\n transition: all 0.3s\n}\n\n.ace_closeButton {\n background: rgba(245, 146, 146, 0.5);\n border: 1px solid #F48A8A;\n border-radius: 50%;\n padding: 7px;\n position: absolute;\n right: -8px;\n top: -8px;\n z-index: 100000;\n}\n.ace_closeButton{\n background: rgba(245, 146, 146, 0.9);\n}\n.ace_optionsMenuKey {\n color: darkslateblue;\n font-weight: bold;\n}\n.ace_optionsMenuCommand {\n color: darkcyan;\n font-weight: normal;\n}\n.ace_optionsMenuEntry input, .ace_optionsMenuEntry button {\n vertical-align: middle;\n}\n\n.ace_optionsMenuEntry button[ace_selected_button=true] {\n background: #e7e7e7;\n box-shadow: 1px 0px 2px 0px #adadad inset;\n border-color: #adadad;\n}\n.ace_optionsMenuEntry button {\n background: white;\n border: 1px solid lightgray;\n margin: 0px;\n}\n.ace_optionsMenuEntry button:hover{\n background: #f0f0f0;\n}";
});
define("ace/ext/menu_tools/overlay_page",["require","exports","module","ace/lib/dom","ace/ext/menu_tools/settings_menu.css"], function(require, exports, module){/*jslint indent: 4, maxerr: 50, white: true, browser: true, vars: true*/
'use strict'; 'use strict';
var dom = require("../../lib/dom"); var dom = require("../../lib/dom");
var cssText = "#ace_settingsmenu, #kbshortcutmenu {\ var cssText = require("./settings_menu.css");
background-color: #F7F7F7;\ dom.importCssString(cssText, "settings_menu.css", false);
color: black;\ module.exports.overlayPage = function overlayPage(editor, contentElement, callback) {
box-shadow: -5px 4px 5px rgba(126, 126, 126, 0.55);\
padding: 1em 0.5em 2em 1em;\
overflow: auto;\
position: absolute;\
margin: 0;\
bottom: 0;\
right: 0;\
top: 0;\
z-index: 9991;\
cursor: default;\
}\
.ace_dark #ace_settingsmenu, .ace_dark #kbshortcutmenu {\
box-shadow: -20px 10px 25px rgba(126, 126, 126, 0.25);\
background-color: rgba(255, 255, 255, 0.6);\
color: black;\
}\
.ace_optionsMenuEntry:hover {\
background-color: rgba(100, 100, 100, 0.1);\
-webkit-transition: all 0.5s;\
transition: all 0.3s\
}\
.ace_closeButton {\
background: rgba(245, 146, 146, 0.5);\
border: 1px solid #F48A8A;\
border-radius: 50%;\
padding: 7px;\
position: absolute;\
right: -8px;\
top: -8px;\
z-index: 1000;\
}\
.ace_closeButton{\
background: rgba(245, 146, 146, 0.9);\
}\
.ace_optionsMenuKey {\
color: darkslateblue;\
font-weight: bold;\
}\
.ace_optionsMenuCommand {\
color: darkcyan;\
font-weight: normal;\
}";
dom.importCssString(cssText);
module.exports.overlayPage = function overlayPage(editor, contentElement, top, right, bottom, left) {
top = top ? 'top: ' + top + ';' : '';
bottom = bottom ? 'bottom: ' + bottom + ';' : '';
right = right ? 'right: ' + right + ';' : '';
left = left ? 'left: ' + left + ';' : '';
var closer = document.createElement('div'); var closer = document.createElement('div');
var contentContainer = document.createElement('div'); var ignoreFocusOut = false;
function documentEscListener(e) { function documentEscListener(e) {
if (e.keyCode === 27) { if (e.keyCode === 27) {
closer.click(); close();
}
}
function close() {
if (!closer)
return;
document.removeEventListener('keydown', documentEscListener);
closer.parentNode.removeChild(closer);
if (editor) {
editor.focus();
}
closer = null;
callback && callback();
}
function setIgnoreFocusOut(ignore) {
ignoreFocusOut = ignore;
if (ignore) {
closer.style.pointerEvents = "none";
contentElement.style.pointerEvents = "auto";
} }
} }
closer.style.cssText = 'margin: 0; padding: 0; ' + closer.style.cssText = 'margin: 0; padding: 0; ' +
'position: fixed; top:0; bottom:0; left:0; right:0;' + 'position: fixed; top:0; bottom:0; left:0; right:0;' +
'z-index: 9990; ' + 'z-index: 9990; ' +
'background-color: rgba(0, 0, 0, 0.3);'; (editor ? 'background-color: rgba(0, 0, 0, 0.3);' : '');
closer.addEventListener('click', function() { closer.addEventListener('click', function (e) {
document.removeEventListener('keydown', documentEscListener); if (!ignoreFocusOut) {
closer.parentNode.removeChild(closer); close();
editor.focus(); }
closer = null;
}); });
document.addEventListener('keydown', documentEscListener); document.addEventListener('keydown', documentEscListener);
contentElement.addEventListener('click', function (e) {
contentContainer.style.cssText = top + right + bottom + left;
contentContainer.addEventListener('click', function(e) {
e.stopPropagation(); e.stopPropagation();
}); });
closer.appendChild(contentElement);
var wrapper = dom.createElement("div");
wrapper.style.position = "relative";
var closeButton = dom.createElement("div");
closeButton.className = "ace_closeButton";
closeButton.addEventListener('click', function() {
closer.click();
});
wrapper.appendChild(closeButton);
contentContainer.appendChild(wrapper);
contentContainer.appendChild(contentElement);
closer.appendChild(contentContainer);
document.body.appendChild(closer); document.body.appendChild(closer);
editor.blur(); if (editor) {
editor.blur();
}
return {
close: close,
setIgnoreFocusOut: setIgnoreFocusOut
};
}; };
}); });
define("ace/ext/menu_tools/get_editor_keyboard_shortcuts",["require","exports","module","ace/lib/keys"], function(require, exports, module) { define("ace/ext/menu_tools/get_editor_keyboard_shortcuts",["require","exports","module","ace/lib/keys"], function(require, exports, module){/*jslint indent: 4, maxerr: 50, white: true, browser: true, vars: true*/
"use strict"; "use strict"; var keys = require("../../lib/keys");
var keys = require("../../lib/keys"); module.exports.getEditorKeybordShortcuts = function (editor) {
module.exports.getEditorKeybordShortcuts = function(editor) {
var KEY_MODS = keys.KEY_MODS; var KEY_MODS = keys.KEY_MODS;
var keybindings = []; var keybindings = [];
var commandMap = {}; var commandMap = {};
editor.keyBinding.$handlers.forEach(function(handler) { editor.keyBinding.$handlers.forEach(function (handler) {
var ckb = handler.commandKeyBinding; var ckb = handler["commandKeyBinding"];
for (var i in ckb) { for (var i in ckb) {
var key = i.replace(/(^|-)\w/g, function(x) { return x.toUpperCase(); }); var key = i.replace(/(^|-)\w/g, function (x) { return x.toUpperCase(); });
var commands = ckb[i]; var commands = ckb[i];
if (!Array.isArray(commands)) if (!Array.isArray(commands))
commands = [commands]; commands = [commands];
commands.forEach(function(command) { commands.forEach(function (command) {
if (typeof command != "string") if (typeof command != "string")
command = command.name; command = command.name;
if (commandMap[command]) { if (commandMap[command]) {
commandMap[command].key += "|" + key; commandMap[command].key += "|" + key;
} else { }
commandMap[command] = {key: key, command: command}; else {
commandMap[command] = { key: key, command: command };
keybindings.push(commandMap[command]); keybindings.push(commandMap[command]);
} }
}); });
@ -130,41 +90,47 @@ module.exports.getEditorKeybordShortcuts = function(editor) {
}); });
define("ace/ext/keybinding_menu",["require","exports","module","ace/editor","ace/ext/menu_tools/overlay_page","ace/ext/menu_tools/get_editor_keyboard_shortcuts"], function(require, exports, module) { define("ace/ext/keybinding_menu",["require","exports","module","ace/editor","ace/ext/menu_tools/overlay_page","ace/ext/menu_tools/get_editor_keyboard_shortcuts"], function(require, exports, module){/*jslint indent: 4, maxerr: 50, white: true, browser: true, vars: true*/
"use strict"; "use strict";
var Editor = require("ace/editor").Editor; var Editor = require("../editor").Editor;
function showKeyboardShortcuts (editor) { function showKeyboardShortcuts(editor) {
if(!document.getElementById('kbshortcutmenu')) { if (!document.getElementById('kbshortcutmenu')) {
var overlayPage = require('./menu_tools/overlay_page').overlayPage; var overlayPage = require('./menu_tools/overlay_page').overlayPage;
var getEditorKeybordShortcuts = require('./menu_tools/get_editor_keyboard_shortcuts').getEditorKeybordShortcuts; var getEditorKeybordShortcuts = require('./menu_tools/get_editor_keyboard_shortcuts').getEditorKeybordShortcuts;
var kb = getEditorKeybordShortcuts(editor); var kb = getEditorKeybordShortcuts(editor);
var el = document.createElement('div'); var el = document.createElement('div');
var commands = kb.reduce(function(previous, current) { var commands = kb.reduce(function (previous, current) {
return previous + '<div class="ace_optionsMenuEntry"><span class="ace_optionsMenuCommand">' return previous + '<div class="ace_optionsMenuEntry"><span class="ace_optionsMenuCommand">'
+ current.command + '</span> : ' + current.command + '</span> : '
+ '<span class="ace_optionsMenuKey">' + current.key + '</span></div>'; + '<span class="ace_optionsMenuKey">' + current.key + '</span></div>';
}, ''); }, '');
el.id = 'kbshortcutmenu';
el.id = 'kbshortcutmenu'; el.innerHTML = '<h1>Keyboard Shortcuts</h1>' + commands + '</div>';
el.innerHTML = '<h1>Keyboard Shortcuts</h1>' + commands + '</div>'; overlayPage(editor, el);
overlayPage(editor, el, '0', '0', '0', null);
}
} }
module.exports.init = function(editor) { }
Editor.prototype.showKeyboardShortcuts = function() { module.exports.init = function (editor) {
showKeyboardShortcuts(this); Editor.prototype.showKeyboardShortcuts = function () {
}; showKeyboardShortcuts(this);
editor.commands.addCommands([{ };
editor.commands.addCommands([{
name: "showKeyboardShortcuts", name: "showKeyboardShortcuts",
bindKey: {win: "Ctrl-Alt-h", mac: "Command-Alt-h"}, bindKey: {
exec: function(editor, line) { win: "Ctrl-Alt-h",
mac: "Command-Alt-h"
},
exec:
function (editor, line) {
editor.showKeyboardShortcuts(); editor.showKeyboardShortcuts();
} }
}]); }]);
}; };
}); }); (function() {
(function() { window.require(["ace/ext/keybinding_menu"], function(m) {
window.require(["ace/ext/keybinding_menu"], function() {}); if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})(); })();

File diff suppressed because it is too large Load Diff

View File

@ -1,14 +1,12 @@
define("ace/ext/linking",["require","exports","module","ace/editor","ace/config"], function(require, exports, module) { define("ace/ext/linking",["require","exports","module","ace/editor","ace/config"], function(require, exports, module){var Editor = require("../editor").Editor;
var Editor = require("ace/editor").Editor;
require("../config").defineOptions(Editor.prototype, "editor", { require("../config").defineOptions(Editor.prototype, "editor", {
enableLinking: { enableLinking: {
set: function(val) { set: function (val) {
if (val) { if (val) {
this.on("click", onClick); this.on("click", onClick);
this.on("mousemove", onMouseMove); this.on("mousemove", onMouseMove);
} else { }
else {
this.off("click", onClick); this.off("click", onClick);
this.off("mousemove", onMouseMove); this.off("mousemove", onMouseMove);
} }
@ -16,46 +14,43 @@ require("../config").defineOptions(Editor.prototype, "editor", {
value: false value: false
} }
}); });
exports.previousLinkingHover = false; exports.previousLinkingHover = false;
function onMouseMove(e) { function onMouseMove(e) {
var editor = e.editor; var editor = e.editor;
var ctrl = e.getAccelKey(); var ctrl = e.getAccelKey();
if (ctrl) { if (ctrl) {
var editor = e.editor; var editor = e.editor;
var docPos = e.getDocumentPosition(); var docPos = e.getDocumentPosition();
var session = editor.session; var session = editor.session;
var token = session.getTokenAt(docPos.row, docPos.column); var token = session.getTokenAt(docPos.row, docPos.column);
if (exports.previousLinkingHover && exports.previousLinkingHover != token) { if (exports.previousLinkingHover && exports.previousLinkingHover != token) {
editor._emit("linkHoverOut"); editor._emit("linkHoverOut");
} }
editor._emit("linkHover", {position: docPos, token: token}); editor._emit("linkHover", { position: docPos, token: token });
exports.previousLinkingHover = token; exports.previousLinkingHover = token;
} else if (exports.previousLinkingHover) { }
else if (exports.previousLinkingHover) {
editor._emit("linkHoverOut"); editor._emit("linkHoverOut");
exports.previousLinkingHover = false; exports.previousLinkingHover = false;
} }
} }
function onClick(e) { function onClick(e) {
var ctrl = e.getAccelKey(); var ctrl = e.getAccelKey();
var button = e.getButton(); var button = e.getButton();
if (button == 0 && ctrl) { if (button == 0 && ctrl) {
var editor = e.editor; var editor = e.editor;
var docPos = e.getDocumentPosition(); var docPos = e.getDocumentPosition();
var session = editor.session; var session = editor.session;
var token = session.getTokenAt(docPos.row, docPos.column); var token = session.getTokenAt(docPos.row, docPos.column);
editor._emit("linkClick", { position: docPos, token: token });
editor._emit("linkClick", {position: docPos, token: token});
} }
} }
}); }); (function() {
(function() { window.require(["ace/ext/linking"], function(m) {
window.require(["ace/ext/linking"], function() {}); if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})(); })();

View File

@ -1,6 +1,4 @@
define("ace/ext/modelist",["require","exports","module"], function(require, exports, module) { define("ace/ext/modelist",["require","exports","module"], function(require, exports, module){"use strict";
"use strict";
var modes = []; var modes = [];
function getModeForPath(path) { function getModeForPath(path) {
var mode = modesByName.text; var mode = modesByName.text;
@ -13,174 +11,216 @@ function getModeForPath(path) {
} }
return mode; return mode;
} }
var Mode = /** @class */ (function () {
var Mode = function(name, caption, extensions) { function Mode(name, caption, extensions) {
this.name = name; this.name = name;
this.caption = caption; this.caption = caption;
this.mode = "ace/mode/" + name; this.mode = "ace/mode/" + name;
this.extensions = extensions; this.extensions = extensions;
var re; var re;
if (/\^/.test(extensions)) { if (/\^/.test(extensions)) {
re = extensions.replace(/\|(\^)?/g, function(a, b){ re = extensions.replace(/\|(\^)?/g, function (a, b) {
return "$|" + (b ? "^" : "^.*\\."); return "$|" + (b ? "^" : "^.*\\.");
}) + "$"; }) + "$";
} else { }
re = "^.*\\.(" + extensions + ")$"; else {
re = "^.*\\.(" + extensions + ")$";
}
this.extRe = new RegExp(re, "gi");
} }
Mode.prototype.supportsFile = function (filename) {
this.extRe = new RegExp(re, "gi"); return filename.match(this.extRe);
}; };
return Mode;
Mode.prototype.supportsFile = function(filename) { }());
return filename.match(this.extRe);
};
var supportedModes = { var supportedModes = {
ABAP: ["abap"], ABAP: ["abap"],
ABC: ["abc"], ABC: ["abc"],
ActionScript:["as"], ActionScript: ["as"],
ADA: ["ada|adb"], ADA: ["ada|adb"],
Alda: ["alda"],
Apache_Conf: ["^htaccess|^htgroups|^htpasswd|^conf|htaccess|htgroups|htpasswd"], Apache_Conf: ["^htaccess|^htgroups|^htpasswd|^conf|htaccess|htgroups|htpasswd"],
AsciiDoc: ["asciidoc|adoc"], Apex: ["apex|cls|trigger|tgr"],
Assembly_x86:["asm|a"], AQL: ["aql"],
AutoHotKey: ["ahk"], AsciiDoc: ["asciidoc|adoc"],
BatchFile: ["bat|cmd"], ASL: ["dsl|asl|asl.json"],
Bro: ["bro"], Assembly_x86: ["asm|a"],
C_Cpp: ["cpp|c|cc|cxx|h|hh|hpp|ino"], Astro: ["astro"],
C9Search: ["c9search_results"], AutoHotKey: ["ahk"],
Cirru: ["cirru|cr"], BatchFile: ["bat|cmd"],
Clojure: ["clj|cljs"], BibTeX: ["bib"],
Cobol: ["CBL|COB"], C_Cpp: ["cpp|c|cc|cxx|h|hh|hpp|ino"],
coffee: ["coffee|cf|cson|^Cakefile"], C9Search: ["c9search_results"],
ColdFusion: ["cfm"], Cirru: ["cirru|cr"],
CSharp: ["cs"], Clojure: ["clj|cljs"],
Cobol: ["CBL|COB"],
coffee: ["coffee|cf|cson|^Cakefile"],
ColdFusion: ["cfm|cfc"],
Crystal: ["cr"],
CSharp: ["cs"],
Csound_Document: ["csd"], Csound_Document: ["csd"],
Csound_Orchestra: ["orc"], Csound_Orchestra: ["orc"],
Csound_Score: ["sco"], Csound_Score: ["sco"],
CSS: ["css"], CSS: ["css"],
Curly: ["curly"], Curly: ["curly"],
D: ["d|di"], Cuttlefish: ["conf"],
Dart: ["dart"], D: ["d|di"],
Diff: ["diff|patch"], Dart: ["dart"],
Dockerfile: ["^Dockerfile"], Diff: ["diff|patch"],
Dot: ["dot"], Django: ["djt|html.djt|dj.html|djhtml"],
Drools: ["drl"], Dockerfile: ["^Dockerfile"],
Dummy: ["dummy"], Dot: ["dot"],
DummySyntax: ["dummy"], Drools: ["drl"],
Eiffel: ["e|ge"], Edifact: ["edi"],
EJS: ["ejs"], Eiffel: ["e|ge"],
Elixir: ["ex|exs"], EJS: ["ejs"],
Elm: ["elm"], Elixir: ["ex|exs"],
Erlang: ["erl|hrl"], Elm: ["elm"],
Forth: ["frt|fs|ldr|fth|4th"], Erlang: ["erl|hrl"],
Fortran: ["f|f90"], Flix: ["flix"],
FTL: ["ftl"], Forth: ["frt|fs|ldr|fth|4th"],
Gcode: ["gcode"], Fortran: ["f|f90"],
Gherkin: ["feature"], FSharp: ["fsi|fs|ml|mli|fsx|fsscript"],
Gitignore: ["^.gitignore"], FSL: ["fsl"],
Glsl: ["glsl|frag|vert"], FTL: ["ftl"],
Gobstones: ["gbs"], Gcode: ["gcode"],
golang: ["go"], Gherkin: ["feature"],
Gitignore: ["^.gitignore"],
Glsl: ["glsl|frag|vert"],
Gobstones: ["gbs"],
golang: ["go"],
GraphQLSchema: ["gql"], GraphQLSchema: ["gql"],
Groovy: ["groovy"], Groovy: ["groovy"],
HAML: ["haml"], HAML: ["haml"],
Handlebars: ["hbs|handlebars|tpl|mustache"], Handlebars: ["hbs|handlebars|tpl|mustache"],
Haskell: ["hs"], Haskell: ["hs"],
Haskell_Cabal: ["cabal"], Haskell_Cabal: ["cabal"],
haXe: ["hx"], haXe: ["hx"],
Hjson: ["hjson"], Hjson: ["hjson"],
HTML: ["html|htm|xhtml|vue|we|wpy"], HTML: ["html|htm|xhtml|vue|we|wpy"],
HTML_Elixir: ["eex|html.eex"], HTML_Elixir: ["eex|html.eex"],
HTML_Ruby: ["erb|rhtml|html.erb"], HTML_Ruby: ["erb|rhtml|html.erb"],
INI: ["ini|conf|cfg|prefs"], INI: ["ini|conf|cfg|prefs"],
Io: ["io"], Io: ["io"],
Jack: ["jack"], Ion: ["ion"],
Jade: ["jade|pug"], Jack: ["jack"],
Java: ["java"], Jade: ["jade|pug"],
JavaScript: ["js|jsm|jsx"], Java: ["java"],
JSON: ["json"], JavaScript: ["js|jsm|cjs|mjs"],
JSONiq: ["jq"], JEXL: ["jexl"],
JSP: ["jsp"], JSON: ["json"],
JSSM: ["jssm|jssm_state"], JSON5: ["json5"],
JSX: ["jsx"], JSONiq: ["jq"],
Julia: ["jl"], JSP: ["jsp"],
Kotlin: ["kt|kts"], JSSM: ["jssm|jssm_state"],
LaTeX: ["tex|latex|ltx|bib"], JSX: ["jsx"],
LESS: ["less"], Julia: ["jl"],
Liquid: ["liquid"], Kotlin: ["kt|kts"],
Lisp: ["lisp"], LaTeX: ["tex|latex|ltx|bib"],
LiveScript: ["ls"], Latte: ["latte"],
LogiQL: ["logic|lql"], LESS: ["less"],
LSL: ["lsl"], Liquid: ["liquid"],
Lua: ["lua"], Lisp: ["lisp"],
LuaPage: ["lp"], LiveScript: ["ls"],
Lucene: ["lucene"], Log: ["log"],
Makefile: ["^Makefile|^GNUmakefile|^makefile|^OCamlMakefile|make"], LogiQL: ["logic|lql"],
Markdown: ["md|markdown"], Logtalk: ["lgt"],
Mask: ["mask"], LSL: ["lsl"],
MATLAB: ["matlab"], Lua: ["lua"],
Maze: ["mz"], LuaPage: ["lp"],
MEL: ["mel"], Lucene: ["lucene"],
MUSHCode: ["mc|mush"], Makefile: ["^Makefile|^GNUmakefile|^makefile|^OCamlMakefile|make"],
MySQL: ["mysql"], Markdown: ["md|markdown"],
Nix: ["nix"], Mask: ["mask"],
NSIS: ["nsi|nsh"], MATLAB: ["matlab"],
ObjectiveC: ["m|mm"], Maze: ["mz"],
OCaml: ["ml|mli"], MediaWiki: ["wiki|mediawiki"],
Pascal: ["pas|p"], MEL: ["mel"],
Perl: ["pl|pm"], MIPS: ["s|asm"],
pgSQL: ["pgsql"], MIXAL: ["mixal"],
PHP: ["php|phtml|shtml|php3|php4|php5|phps|phpt|aw|ctp|module"], MUSHCode: ["mc|mush"],
Pig: ["pig"], MySQL: ["mysql"],
Powershell: ["ps1"], Nasal: ["nas"],
Praat: ["praat|praatscript|psc|proc"], Nginx: ["nginx|conf"],
Prolog: ["plg|prolog"], Nim: ["nim"],
Properties: ["properties"], Nix: ["nix"],
Protobuf: ["proto"], NSIS: ["nsi|nsh"],
Python: ["py"], Nunjucks: ["nunjucks|nunjs|nj|njk"],
R: ["r"], ObjectiveC: ["m|mm"],
Razor: ["cshtml|asp"], OCaml: ["ml|mli"],
RDoc: ["Rd"], Odin: ["odin"],
Red: ["red|reds"], PartiQL: ["partiql|pql"],
RHTML: ["Rhtml"], Pascal: ["pas|p"],
RST: ["rst"], Perl: ["pl|pm"],
Ruby: ["rb|ru|gemspec|rake|^Guardfile|^Rakefile|^Gemfile"], pgSQL: ["pgsql"],
Rust: ["rs"], PHP: ["php|inc|phtml|shtml|php3|php4|php5|phps|phpt|aw|ctp|module"],
SASS: ["sass"], PHP_Laravel_blade: ["blade.php"],
SCAD: ["scad"], Pig: ["pig"],
Scala: ["scala"], PLSQL: ["plsql"],
Scheme: ["scm|sm|rkt|oak|scheme"], Powershell: ["ps1"],
SCSS: ["scss"], Praat: ["praat|praatscript|psc|proc"],
SH: ["sh|bash|^.bashrc"], Prisma: ["prisma"],
SJS: ["sjs"], Prolog: ["plg|prolog"],
Smarty: ["smarty|tpl"], Properties: ["properties"],
snippets: ["snippets"], Protobuf: ["proto"],
Soy_Template:["soy"], PRQL: ["prql"],
Space: ["space"], Puppet: ["epp|pp"],
SQL: ["sql"], Python: ["py"],
SQLServer: ["sqlserver"], QML: ["qml"],
Stylus: ["styl|stylus"], R: ["r"],
SVG: ["svg"], Raku: ["raku|rakumod|rakutest|p6|pl6|pm6"],
Swift: ["swift"], Razor: ["cshtml|asp"],
Tcl: ["tcl"], RDoc: ["Rd"],
Tex: ["tex"], Red: ["red|reds"],
Text: ["txt"], RHTML: ["Rhtml"],
Textile: ["textile"], Robot: ["robot|resource"],
Toml: ["toml"], RST: ["rst"],
TSX: ["tsx"], Ruby: ["rb|ru|gemspec|rake|^Guardfile|^Rakefile|^Gemfile"],
Twig: ["twig|swig"], Rust: ["rs"],
Typescript: ["ts|typescript|str"], SaC: ["sac"],
Vala: ["vala"], SASS: ["sass"],
VBScript: ["vbs|vb"], SCAD: ["scad"],
Velocity: ["vm"], Scala: ["scala|sbt"],
Verilog: ["v|vh|sv|svh"], Scheme: ["scm|sm|rkt|oak|scheme"],
VHDL: ["vhd|vhdl"], Scrypt: ["scrypt"],
Wollok: ["wlk|wpgm|wtest"], SCSS: ["scss"],
XML: ["xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl|xaml"], SH: ["sh|bash|^.bashrc"],
XQuery: ["xq"], SJS: ["sjs"],
YAML: ["yaml|yml"], Slim: ["slim|skim"],
Django: ["html"] Smarty: ["smarty|tpl"],
Smithy: ["smithy"],
snippets: ["snippets"],
Soy_Template: ["soy"],
Space: ["space"],
SPARQL: ["rq"],
SQL: ["sql"],
SQLServer: ["sqlserver"],
Stylus: ["styl|stylus"],
SVG: ["svg"],
Swift: ["swift"],
Tcl: ["tcl"],
Terraform: ["tf", "tfvars", "terragrunt"],
Tex: ["tex"],
Text: ["txt"],
Textile: ["textile"],
Toml: ["toml"],
TSX: ["tsx"],
Turtle: ["ttl"],
Twig: ["twig|swig"],
Typescript: ["ts|mts|cts|typescript|str"],
Vala: ["vala"],
VBScript: ["vbs|vb"],
Velocity: ["vm"],
Verilog: ["v|vh|sv|svh"],
VHDL: ["vhd|vhdl"],
Visualforce: ["vfp|component|page"],
Wollok: ["wlk|wpgm|wtest"],
XML: ["xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl|xaml"],
XQuery: ["xq"],
YAML: ["yaml|yml"],
Zeek: ["zeek|bro"],
Zig: ["zig"]
}; };
var nameOverrides = { var nameOverrides = {
ObjectiveC: "Objective-C", ObjectiveC: "Objective-C",
CSharp: "C#", CSharp: "C#",
@ -192,7 +232,10 @@ var nameOverrides = {
coffee: "CoffeeScript", coffee: "CoffeeScript",
HTML_Ruby: "HTML (Ruby)", HTML_Ruby: "HTML (Ruby)",
HTML_Elixir: "HTML (Elixir)", HTML_Elixir: "HTML (Elixir)",
FTL: "FreeMarker" FTL: "FreeMarker",
PHP_Laravel_blade: "PHP (Blade Template)",
Perl6: "Perl 6",
AutoHotKey: "AutoHotkey / AutoIt"
}; };
var modesByName = {}; var modesByName = {};
for (var name in supportedModes) { for (var name in supportedModes) {
@ -203,15 +246,17 @@ for (var name in supportedModes) {
modesByName[filename] = mode; modesByName[filename] = mode;
modes.push(mode); modes.push(mode);
} }
module.exports = { module.exports = {
getModeForPath: getModeForPath, getModeForPath: getModeForPath,
modes: modes, modes: modes,
modesByName: modesByName modesByName: modesByName
}; };
}); }); (function() {
(function() { window.require(["ace/ext/modelist"], function(m) {
window.require(["ace/ext/modelist"], function() {}); if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})(); })();

View File

@ -1,502 +0,0 @@
define("ace/ext/searchbox",["require","exports","module","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/keyboard/hash_handler","ace/lib/keys"], function(require, exports, module) {
"use strict";
var dom = require("../lib/dom");
var lang = require("../lib/lang");
var event = require("../lib/event");
var searchboxCss = "\
.ace_search {\
background-color: #ddd;\
border: 1px solid #cbcbcb;\
border-top: 0 none;\
max-width: 325px;\
overflow: hidden;\
margin: 0;\
padding: 4px;\
padding-right: 6px;\
padding-bottom: 0;\
position: absolute;\
top: 0px;\
z-index: 99;\
white-space: normal;\
}\
.ace_search.left {\
border-left: 0 none;\
border-radius: 0px 0px 5px 0px;\
left: 0;\
}\
.ace_search.right {\
border-radius: 0px 0px 0px 5px;\
border-right: 0 none;\
right: 0;\
}\
.ace_search_form, .ace_replace_form {\
border-radius: 3px;\
border: 1px solid #cbcbcb;\
float: left;\
margin-bottom: 4px;\
overflow: hidden;\
}\
.ace_search_form.ace_nomatch {\
outline: 1px solid red;\
}\
.ace_search_field {\
background-color: white;\
color: black;\
border-right: 1px solid #cbcbcb;\
border: 0 none;\
-webkit-box-sizing: border-box;\
-moz-box-sizing: border-box;\
box-sizing: border-box;\
float: left;\
height: 22px;\
outline: 0;\
padding: 0 7px;\
width: 214px;\
margin: 0;\
}\
.ace_searchbtn,\
.ace_replacebtn {\
background: #fff;\
border: 0 none;\
border-left: 1px solid #dcdcdc;\
cursor: pointer;\
float: left;\
height: 22px;\
margin: 0;\
position: relative;\
}\
.ace_searchbtn:last-child,\
.ace_replacebtn:last-child {\
border-top-right-radius: 3px;\
border-bottom-right-radius: 3px;\
}\
.ace_searchbtn:disabled {\
background: none;\
cursor: default;\
}\
.ace_searchbtn {\
background-position: 50% 50%;\
background-repeat: no-repeat;\
width: 27px;\
}\
.ace_searchbtn.prev {\
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAFCAYAAAB4ka1VAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADFJREFUeNpiSU1NZUAC/6E0I0yACYskCpsJiySKIiY0SUZk40FyTEgCjGgKwTRAgAEAQJUIPCE+qfkAAAAASUVORK5CYII=); \
}\
.ace_searchbtn.next {\
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAFCAYAAAB4ka1VAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADRJREFUeNpiTE1NZQCC/0DMyIAKwGJMUAYDEo3M/s+EpvM/mkKwCQxYjIeLMaELoLMBAgwAU7UJObTKsvAAAAAASUVORK5CYII=); \
}\
.ace_searchbtn_close {\
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAcCAYAAABRVo5BAAAAZ0lEQVR42u2SUQrAMAhDvazn8OjZBilCkYVVxiis8H4CT0VrAJb4WHT3C5xU2a2IQZXJjiQIRMdkEoJ5Q2yMqpfDIo+XY4k6h+YXOyKqTIj5REaxloNAd0xiKmAtsTHqW8sR2W5f7gCu5nWFUpVjZwAAAABJRU5ErkJggg==) no-repeat 50% 0;\
border-radius: 50%;\
border: 0 none;\
color: #656565;\
cursor: pointer;\
float: right;\
font: 16px/16px Arial;\
height: 14px;\
margin: 5px 1px 9px 5px;\
padding: 0;\
text-align: center;\
width: 14px;\
}\
.ace_searchbtn_close:hover {\
background-color: #656565;\
background-position: 50% 100%;\
color: white;\
}\
.ace_replacebtn.prev {\
width: 54px\
}\
.ace_replacebtn.next {\
width: 27px\
}\
.ace_button {\
margin-left: 2px;\
cursor: pointer;\
-webkit-user-select: none;\
-moz-user-select: none;\
-o-user-select: none;\
-ms-user-select: none;\
user-select: none;\
overflow: hidden;\
opacity: 0.7;\
border: 1px solid rgba(100,100,100,0.23);\
padding: 1px;\
-moz-box-sizing: border-box;\
box-sizing: border-box;\
color: black;\
}\
.ace_button:hover {\
background-color: #eee;\
opacity:1;\
}\
.ace_button:active {\
background-color: #ddd;\
}\
.ace_button.checked {\
border-color: #3399ff;\
opacity:1;\
}\
.ace_search_options{\
margin-bottom: 3px;\
text-align: right;\
-webkit-user-select: none;\
-moz-user-select: none;\
-o-user-select: none;\
-ms-user-select: none;\
user-select: none;\
}";
var HashHandler = require("../keyboard/hash_handler").HashHandler;
var keyUtil = require("../lib/keys");
dom.importCssString(searchboxCss, "ace_searchbox");
var html = '<div class="ace_search right">\
<button type="button" action="hide" class="ace_searchbtn_close"></button>\
<div class="ace_search_form">\
<input class="ace_search_field" placeholder="Search for" spellcheck="false"></input>\
<button type="button" action="findNext" class="ace_searchbtn next"></button>\
<button type="button" action="findPrev" class="ace_searchbtn prev"></button>\
<button type="button" action="findAll" class="ace_searchbtn" title="Alt-Enter">All</button>\
</div>\
<div class="ace_replace_form">\
<input class="ace_search_field" placeholder="Replace with" spellcheck="false"></input>\
<button type="button" action="replaceAndFindNext" class="ace_replacebtn">Replace</button>\
<button type="button" action="replaceAll" class="ace_replacebtn">All</button>\
</div>\
<div class="ace_search_options">\
<span action="toggleRegexpMode" class="ace_button" title="RegExp Search">.*</span>\
<span action="toggleCaseSensitive" class="ace_button" title="CaseSensitive Search">Aa</span>\
<span action="toggleWholeWords" class="ace_button" title="Whole Word Search">\\b</span>\
</div>\
</div>'.replace(/>\s+/g, ">");
var SearchBox = function(editor, range, showReplaceForm) {
var div = dom.createElement("div");
div.innerHTML = html;
this.element = div.firstChild;
this.$init();
this.setEditor(editor);
};
(function() {
this.setEditor = function(editor) {
editor.searchBox = this;
editor.container.appendChild(this.element);
this.editor = editor;
};
this.$initElements = function(sb) {
this.searchBox = sb.querySelector(".ace_search_form");
this.replaceBox = sb.querySelector(".ace_replace_form");
this.searchOptions = sb.querySelector(".ace_search_options");
this.regExpOption = sb.querySelector("[action=toggleRegexpMode]");
this.caseSensitiveOption = sb.querySelector("[action=toggleCaseSensitive]");
this.wholeWordOption = sb.querySelector("[action=toggleWholeWords]");
this.searchInput = this.searchBox.querySelector(".ace_search_field");
this.replaceInput = this.replaceBox.querySelector(".ace_search_field");
};
this.$init = function() {
var sb = this.element;
this.$initElements(sb);
var _this = this;
event.addListener(sb, "mousedown", function(e) {
setTimeout(function(){
_this.activeInput.focus();
}, 0);
event.stopPropagation(e);
});
event.addListener(sb, "click", function(e) {
var t = e.target || e.srcElement;
var action = t.getAttribute("action");
if (action && _this[action])
_this[action]();
else if (_this.$searchBarKb.commands[action])
_this.$searchBarKb.commands[action].exec(_this);
event.stopPropagation(e);
});
event.addCommandKeyListener(sb, function(e, hashId, keyCode) {
var keyString = keyUtil.keyCodeToString(keyCode);
var command = _this.$searchBarKb.findKeyCommand(hashId, keyString);
if (command && command.exec) {
command.exec(_this);
event.stopEvent(e);
}
});
this.$onChange = lang.delayedCall(function() {
_this.find(false, false);
});
event.addListener(this.searchInput, "input", function() {
_this.$onChange.schedule(20);
});
event.addListener(this.searchInput, "focus", function() {
_this.activeInput = _this.searchInput;
_this.searchInput.value && _this.highlight();
});
event.addListener(this.replaceInput, "focus", function() {
_this.activeInput = _this.replaceInput;
_this.searchInput.value && _this.highlight();
});
};
this.$closeSearchBarKb = new HashHandler([{
bindKey: "Esc",
name: "closeSearchBar",
exec: function(editor) {
editor.searchBox.hide();
}
}]);
this.$searchBarKb = new HashHandler();
this.$searchBarKb.bindKeys({
"Ctrl-f|Command-f": function(sb) {
var isReplace = sb.isReplace = !sb.isReplace;
sb.replaceBox.style.display = isReplace ? "" : "none";
sb.searchInput.focus();
},
"Ctrl-H|Command-Option-F": function(sb) {
sb.replaceBox.style.display = "";
sb.replaceInput.focus();
},
"Ctrl-G|Command-G": function(sb) {
sb.findNext();
},
"Ctrl-Shift-G|Command-Shift-G": function(sb) {
sb.findPrev();
},
"esc": function(sb) {
setTimeout(function() { sb.hide();});
},
"Return": function(sb) {
if (sb.activeInput == sb.replaceInput)
sb.replace();
sb.findNext();
},
"Shift-Return": function(sb) {
if (sb.activeInput == sb.replaceInput)
sb.replace();
sb.findPrev();
},
"Alt-Return": function(sb) {
if (sb.activeInput == sb.replaceInput)
sb.replaceAll();
sb.findAll();
},
"Tab": function(sb) {
(sb.activeInput == sb.replaceInput ? sb.searchInput : sb.replaceInput).focus();
}
});
this.$searchBarKb.addCommands([{
name: "toggleRegexpMode",
bindKey: {win: "Alt-R|Alt-/", mac: "Ctrl-Alt-R|Ctrl-Alt-/"},
exec: function(sb) {
sb.regExpOption.checked = !sb.regExpOption.checked;
sb.$syncOptions();
}
}, {
name: "toggleCaseSensitive",
bindKey: {win: "Alt-C|Alt-I", mac: "Ctrl-Alt-R|Ctrl-Alt-I"},
exec: function(sb) {
sb.caseSensitiveOption.checked = !sb.caseSensitiveOption.checked;
sb.$syncOptions();
}
}, {
name: "toggleWholeWords",
bindKey: {win: "Alt-B|Alt-W", mac: "Ctrl-Alt-B|Ctrl-Alt-W"},
exec: function(sb) {
sb.wholeWordOption.checked = !sb.wholeWordOption.checked;
sb.$syncOptions();
}
}]);
this.$syncOptions = function() {
dom.setCssClass(this.regExpOption, "checked", this.regExpOption.checked);
dom.setCssClass(this.wholeWordOption, "checked", this.wholeWordOption.checked);
dom.setCssClass(this.caseSensitiveOption, "checked", this.caseSensitiveOption.checked);
this.find(false, false);
};
this.highlight = function(re) {
this.editor.session.highlight(re || this.editor.$search.$options.re);
this.editor.renderer.updateBackMarkers()
};
this.find = function(skipCurrent, backwards, preventScroll) {
var range = this.editor.find(this.searchInput.value, {
skipCurrent: skipCurrent,
backwards: backwards,
wrap: true,
regExp: this.regExpOption.checked,
caseSensitive: this.caseSensitiveOption.checked,
wholeWord: this.wholeWordOption.checked,
preventScroll: preventScroll
});
var noMatch = !range && this.searchInput.value;
dom.setCssClass(this.searchBox, "ace_nomatch", noMatch);
this.editor._emit("findSearchBox", { match: !noMatch });
this.highlight();
};
this.findNext = function() {
this.find(true, false);
};
this.findPrev = function() {
this.find(true, true);
};
this.findAll = function(){
var range = this.editor.findAll(this.searchInput.value, {
regExp: this.regExpOption.checked,
caseSensitive: this.caseSensitiveOption.checked,
wholeWord: this.wholeWordOption.checked
});
var noMatch = !range && this.searchInput.value;
dom.setCssClass(this.searchBox, "ace_nomatch", noMatch);
this.editor._emit("findSearchBox", { match: !noMatch });
this.highlight();
this.hide();
};
this.replace = function() {
if (!this.editor.getReadOnly())
this.editor.replace(this.replaceInput.value);
};
this.replaceAndFindNext = function() {
if (!this.editor.getReadOnly()) {
this.editor.replace(this.replaceInput.value);
this.findNext()
}
};
this.replaceAll = function() {
if (!this.editor.getReadOnly())
this.editor.replaceAll(this.replaceInput.value);
};
this.hide = function() {
this.element.style.display = "none";
this.editor.keyBinding.removeKeyboardHandler(this.$closeSearchBarKb);
this.editor.focus();
};
this.show = function(value, isReplace) {
this.element.style.display = "";
this.replaceBox.style.display = isReplace ? "" : "none";
this.isReplace = isReplace;
if (value)
this.searchInput.value = value;
this.find(false, false, true);
this.searchInput.focus();
this.searchInput.select();
this.editor.keyBinding.addKeyboardHandler(this.$closeSearchBarKb);
};
this.isFocused = function() {
var el = document.activeElement;
return el == this.searchInput || el == this.replaceInput;
}
}).call(SearchBox.prototype);
exports.SearchBox = SearchBox;
exports.Search = function(editor, isReplace) {
var sb = editor.searchBox || new SearchBox(editor);
sb.show(editor.session.getTextRange(), isReplace);
};
});
define("ace/ext/old_ie",["require","exports","module","ace/lib/useragent","ace/tokenizer","ace/ext/searchbox","ace/mode/text"], function(require, exports, module) {
"use strict";
var MAX_TOKEN_COUNT = 1000;
var useragent = require("../lib/useragent");
var TokenizerModule = require("../tokenizer");
function patch(obj, name, regexp, replacement) {
eval("obj['" + name + "']=" + obj[name].toString().replace(
regexp, replacement
));
}
if (useragent.isIE && useragent.isIE < 10 && window.top.document.compatMode === "BackCompat")
useragent.isOldIE = true;
if (typeof document != "undefined" && !document.documentElement.querySelector) {
useragent.isOldIE = true;
var qs = function(el, selector) {
if (selector.charAt(0) == ".") {
var classNeme = selector.slice(1);
} else {
var m = selector.match(/(\w+)=(\w+)/);
var attr = m && m[1];
var attrVal = m && m[2];
}
for (var i = 0; i < el.all.length; i++) {
var ch = el.all[i];
if (classNeme) {
if (ch.className.indexOf(classNeme) != -1)
return ch;
} else if (attr) {
if (ch.getAttribute(attr) == attrVal)
return ch;
}
}
};
var sb = require("./searchbox").SearchBox.prototype;
patch(
sb, "$initElements",
/([^\s=]*).querySelector\((".*?")\)/g,
"qs($1, $2)"
);
}
var compliantExecNpcg = /()??/.exec("")[1] === undefined;
if (compliantExecNpcg)
return;
var proto = TokenizerModule.Tokenizer.prototype;
TokenizerModule.Tokenizer_orig = TokenizerModule.Tokenizer;
proto.getLineTokens_orig = proto.getLineTokens;
patch(
TokenizerModule, "Tokenizer",
"ruleRegExps.push(adjustedregex);\n",
function(m) {
return m + '\
if (state[i].next && RegExp(adjustedregex).test(""))\n\
rule._qre = RegExp(adjustedregex, "g");\n\
';
}
);
TokenizerModule.Tokenizer.prototype = proto;
patch(
proto, "getLineTokens",
/if \(match\[i \+ 1\] === undefined\)\s*continue;/,
"if (!match[i + 1]) {\n\
if (value)continue;\n\
var qre = state[mapping[i]]._qre;\n\
if (!qre) continue;\n\
qre.lastIndex = lastIndex;\n\
if (!qre.exec(line) || qre.lastIndex != lastIndex)\n\
continue;\n\
}"
);
patch(
require("../mode/text").Mode.prototype, "getTokenizer",
/Tokenizer/,
"TokenizerModule.Tokenizer"
);
useragent.isOldIE = true;
});
(function() {
window.require(["ace/ext/old_ie"], function() {});
})();

View File

@ -0,0 +1,764 @@
define("ace/ext/menu_tools/settings_menu.css",["require","exports","module"], function(require, exports, module){module.exports = "#ace_settingsmenu, #kbshortcutmenu {\n background-color: #F7F7F7;\n color: black;\n box-shadow: -5px 4px 5px rgba(126, 126, 126, 0.55);\n padding: 1em 0.5em 2em 1em;\n overflow: auto;\n position: absolute;\n margin: 0;\n bottom: 0;\n right: 0;\n top: 0;\n z-index: 9991;\n cursor: default;\n}\n\n.ace_dark #ace_settingsmenu, .ace_dark #kbshortcutmenu {\n box-shadow: -20px 10px 25px rgba(126, 126, 126, 0.25);\n background-color: rgba(255, 255, 255, 0.6);\n color: black;\n}\n\n.ace_optionsMenuEntry:hover {\n background-color: rgba(100, 100, 100, 0.1);\n transition: all 0.3s\n}\n\n.ace_closeButton {\n background: rgba(245, 146, 146, 0.5);\n border: 1px solid #F48A8A;\n border-radius: 50%;\n padding: 7px;\n position: absolute;\n right: -8px;\n top: -8px;\n z-index: 100000;\n}\n.ace_closeButton{\n background: rgba(245, 146, 146, 0.9);\n}\n.ace_optionsMenuKey {\n color: darkslateblue;\n font-weight: bold;\n}\n.ace_optionsMenuCommand {\n color: darkcyan;\n font-weight: normal;\n}\n.ace_optionsMenuEntry input, .ace_optionsMenuEntry button {\n vertical-align: middle;\n}\n\n.ace_optionsMenuEntry button[ace_selected_button=true] {\n background: #e7e7e7;\n box-shadow: 1px 0px 2px 0px #adadad inset;\n border-color: #adadad;\n}\n.ace_optionsMenuEntry button {\n background: white;\n border: 1px solid lightgray;\n margin: 0px;\n}\n.ace_optionsMenuEntry button:hover{\n background: #f0f0f0;\n}";
});
define("ace/ext/menu_tools/overlay_page",["require","exports","module","ace/lib/dom","ace/ext/menu_tools/settings_menu.css"], function(require, exports, module){/*jslint indent: 4, maxerr: 50, white: true, browser: true, vars: true*/
'use strict';
var dom = require("../../lib/dom");
var cssText = require("./settings_menu.css");
dom.importCssString(cssText, "settings_menu.css", false);
module.exports.overlayPage = function overlayPage(editor, contentElement, callback) {
var closer = document.createElement('div');
var ignoreFocusOut = false;
function documentEscListener(e) {
if (e.keyCode === 27) {
close();
}
}
function close() {
if (!closer)
return;
document.removeEventListener('keydown', documentEscListener);
closer.parentNode.removeChild(closer);
if (editor) {
editor.focus();
}
closer = null;
callback && callback();
}
function setIgnoreFocusOut(ignore) {
ignoreFocusOut = ignore;
if (ignore) {
closer.style.pointerEvents = "none";
contentElement.style.pointerEvents = "auto";
}
}
closer.style.cssText = 'margin: 0; padding: 0; ' +
'position: fixed; top:0; bottom:0; left:0; right:0;' +
'z-index: 9990; ' +
(editor ? 'background-color: rgba(0, 0, 0, 0.3);' : '');
closer.addEventListener('click', function (e) {
if (!ignoreFocusOut) {
close();
}
});
document.addEventListener('keydown', documentEscListener);
contentElement.addEventListener('click', function (e) {
e.stopPropagation();
});
closer.appendChild(contentElement);
document.body.appendChild(closer);
if (editor) {
editor.blur();
}
return {
close: close,
setIgnoreFocusOut: setIgnoreFocusOut
};
};
});
define("ace/ext/modelist",["require","exports","module"], function(require, exports, module){"use strict";
var modes = [];
function getModeForPath(path) {
var mode = modesByName.text;
var fileName = path.split(/[\/\\]/).pop();
for (var i = 0; i < modes.length; i++) {
if (modes[i].supportsFile(fileName)) {
mode = modes[i];
break;
}
}
return mode;
}
var Mode = /** @class */ (function () {
function Mode(name, caption, extensions) {
this.name = name;
this.caption = caption;
this.mode = "ace/mode/" + name;
this.extensions = extensions;
var re;
if (/\^/.test(extensions)) {
re = extensions.replace(/\|(\^)?/g, function (a, b) {
return "$|" + (b ? "^" : "^.*\\.");
}) + "$";
}
else {
re = "^.*\\.(" + extensions + ")$";
}
this.extRe = new RegExp(re, "gi");
}
Mode.prototype.supportsFile = function (filename) {
return filename.match(this.extRe);
};
return Mode;
}());
var supportedModes = {
ABAP: ["abap"],
ABC: ["abc"],
ActionScript: ["as"],
ADA: ["ada|adb"],
Alda: ["alda"],
Apache_Conf: ["^htaccess|^htgroups|^htpasswd|^conf|htaccess|htgroups|htpasswd"],
Apex: ["apex|cls|trigger|tgr"],
AQL: ["aql"],
AsciiDoc: ["asciidoc|adoc"],
ASL: ["dsl|asl|asl.json"],
Assembly_x86: ["asm|a"],
Astro: ["astro"],
AutoHotKey: ["ahk"],
BatchFile: ["bat|cmd"],
BibTeX: ["bib"],
C_Cpp: ["cpp|c|cc|cxx|h|hh|hpp|ino"],
C9Search: ["c9search_results"],
Cirru: ["cirru|cr"],
Clojure: ["clj|cljs"],
Cobol: ["CBL|COB"],
coffee: ["coffee|cf|cson|^Cakefile"],
ColdFusion: ["cfm|cfc"],
Crystal: ["cr"],
CSharp: ["cs"],
Csound_Document: ["csd"],
Csound_Orchestra: ["orc"],
Csound_Score: ["sco"],
CSS: ["css"],
Curly: ["curly"],
Cuttlefish: ["conf"],
D: ["d|di"],
Dart: ["dart"],
Diff: ["diff|patch"],
Django: ["djt|html.djt|dj.html|djhtml"],
Dockerfile: ["^Dockerfile"],
Dot: ["dot"],
Drools: ["drl"],
Edifact: ["edi"],
Eiffel: ["e|ge"],
EJS: ["ejs"],
Elixir: ["ex|exs"],
Elm: ["elm"],
Erlang: ["erl|hrl"],
Flix: ["flix"],
Forth: ["frt|fs|ldr|fth|4th"],
Fortran: ["f|f90"],
FSharp: ["fsi|fs|ml|mli|fsx|fsscript"],
FSL: ["fsl"],
FTL: ["ftl"],
Gcode: ["gcode"],
Gherkin: ["feature"],
Gitignore: ["^.gitignore"],
Glsl: ["glsl|frag|vert"],
Gobstones: ["gbs"],
golang: ["go"],
GraphQLSchema: ["gql"],
Groovy: ["groovy"],
HAML: ["haml"],
Handlebars: ["hbs|handlebars|tpl|mustache"],
Haskell: ["hs"],
Haskell_Cabal: ["cabal"],
haXe: ["hx"],
Hjson: ["hjson"],
HTML: ["html|htm|xhtml|vue|we|wpy"],
HTML_Elixir: ["eex|html.eex"],
HTML_Ruby: ["erb|rhtml|html.erb"],
INI: ["ini|conf|cfg|prefs"],
Io: ["io"],
Ion: ["ion"],
Jack: ["jack"],
Jade: ["jade|pug"],
Java: ["java"],
JavaScript: ["js|jsm|cjs|mjs"],
JEXL: ["jexl"],
JSON: ["json"],
JSON5: ["json5"],
JSONiq: ["jq"],
JSP: ["jsp"],
JSSM: ["jssm|jssm_state"],
JSX: ["jsx"],
Julia: ["jl"],
Kotlin: ["kt|kts"],
LaTeX: ["tex|latex|ltx|bib"],
Latte: ["latte"],
LESS: ["less"],
Liquid: ["liquid"],
Lisp: ["lisp"],
LiveScript: ["ls"],
Log: ["log"],
LogiQL: ["logic|lql"],
Logtalk: ["lgt"],
LSL: ["lsl"],
Lua: ["lua"],
LuaPage: ["lp"],
Lucene: ["lucene"],
Makefile: ["^Makefile|^GNUmakefile|^makefile|^OCamlMakefile|make"],
Markdown: ["md|markdown"],
Mask: ["mask"],
MATLAB: ["matlab"],
Maze: ["mz"],
MediaWiki: ["wiki|mediawiki"],
MEL: ["mel"],
MIPS: ["s|asm"],
MIXAL: ["mixal"],
MUSHCode: ["mc|mush"],
MySQL: ["mysql"],
Nasal: ["nas"],
Nginx: ["nginx|conf"],
Nim: ["nim"],
Nix: ["nix"],
NSIS: ["nsi|nsh"],
Nunjucks: ["nunjucks|nunjs|nj|njk"],
ObjectiveC: ["m|mm"],
OCaml: ["ml|mli"],
Odin: ["odin"],
PartiQL: ["partiql|pql"],
Pascal: ["pas|p"],
Perl: ["pl|pm"],
pgSQL: ["pgsql"],
PHP: ["php|inc|phtml|shtml|php3|php4|php5|phps|phpt|aw|ctp|module"],
PHP_Laravel_blade: ["blade.php"],
Pig: ["pig"],
PLSQL: ["plsql"],
Powershell: ["ps1"],
Praat: ["praat|praatscript|psc|proc"],
Prisma: ["prisma"],
Prolog: ["plg|prolog"],
Properties: ["properties"],
Protobuf: ["proto"],
PRQL: ["prql"],
Puppet: ["epp|pp"],
Python: ["py"],
QML: ["qml"],
R: ["r"],
Raku: ["raku|rakumod|rakutest|p6|pl6|pm6"],
Razor: ["cshtml|asp"],
RDoc: ["Rd"],
Red: ["red|reds"],
RHTML: ["Rhtml"],
Robot: ["robot|resource"],
RST: ["rst"],
Ruby: ["rb|ru|gemspec|rake|^Guardfile|^Rakefile|^Gemfile"],
Rust: ["rs"],
SaC: ["sac"],
SASS: ["sass"],
SCAD: ["scad"],
Scala: ["scala|sbt"],
Scheme: ["scm|sm|rkt|oak|scheme"],
Scrypt: ["scrypt"],
SCSS: ["scss"],
SH: ["sh|bash|^.bashrc"],
SJS: ["sjs"],
Slim: ["slim|skim"],
Smarty: ["smarty|tpl"],
Smithy: ["smithy"],
snippets: ["snippets"],
Soy_Template: ["soy"],
Space: ["space"],
SPARQL: ["rq"],
SQL: ["sql"],
SQLServer: ["sqlserver"],
Stylus: ["styl|stylus"],
SVG: ["svg"],
Swift: ["swift"],
Tcl: ["tcl"],
Terraform: ["tf", "tfvars", "terragrunt"],
Tex: ["tex"],
Text: ["txt"],
Textile: ["textile"],
Toml: ["toml"],
TSX: ["tsx"],
Turtle: ["ttl"],
Twig: ["twig|swig"],
Typescript: ["ts|mts|cts|typescript|str"],
Vala: ["vala"],
VBScript: ["vbs|vb"],
Velocity: ["vm"],
Verilog: ["v|vh|sv|svh"],
VHDL: ["vhd|vhdl"],
Visualforce: ["vfp|component|page"],
Wollok: ["wlk|wpgm|wtest"],
XML: ["xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl|xaml"],
XQuery: ["xq"],
YAML: ["yaml|yml"],
Zeek: ["zeek|bro"],
Zig: ["zig"]
};
var nameOverrides = {
ObjectiveC: "Objective-C",
CSharp: "C#",
golang: "Go",
C_Cpp: "C and C++",
Csound_Document: "Csound Document",
Csound_Orchestra: "Csound",
Csound_Score: "Csound Score",
coffee: "CoffeeScript",
HTML_Ruby: "HTML (Ruby)",
HTML_Elixir: "HTML (Elixir)",
FTL: "FreeMarker",
PHP_Laravel_blade: "PHP (Blade Template)",
Perl6: "Perl 6",
AutoHotKey: "AutoHotkey / AutoIt"
};
var modesByName = {};
for (var name in supportedModes) {
var data = supportedModes[name];
var displayName = (nameOverrides[name] || name).replace(/_/g, " ");
var filename = name.toLowerCase();
var mode = new Mode(filename, displayName, data[0]);
modesByName[filename] = mode;
modes.push(mode);
}
module.exports = {
getModeForPath: getModeForPath,
modes: modes,
modesByName: modesByName
};
});
define("ace/ext/themelist",["require","exports","module"], function(require, exports, module){/**
* Generates a list of themes available when ace was built.
* @fileOverview Generates a list of themes available when ace was built.
* @author <a href="mailto:matthewkastor@gmail.com">
* Matthew Christopher Kastor-Inare III </a><br />
* ☭ Hial Atropa!! ☭
*/
"use strict";
var themeData = [
["Chrome"],
["Clouds"],
["Crimson Editor"],
["Dawn"],
["Dreamweaver"],
["Eclipse"],
["GitHub"],
["IPlastic"],
["Solarized Light"],
["TextMate"],
["Tomorrow"],
["XCode"],
["Kuroir"],
["KatzenMilch"],
["SQL Server", "sqlserver", "light"],
["CloudEditor", "cloud_editor", "light"],
["Ambiance", "ambiance", "dark"],
["Chaos", "chaos", "dark"],
["Clouds Midnight", "clouds_midnight", "dark"],
["Dracula", "", "dark"],
["Cobalt", "cobalt", "dark"],
["Gruvbox", "gruvbox", "dark"],
["Green on Black", "gob", "dark"],
["idle Fingers", "idle_fingers", "dark"],
["krTheme", "kr_theme", "dark"],
["Merbivore", "merbivore", "dark"],
["Merbivore Soft", "merbivore_soft", "dark"],
["Mono Industrial", "mono_industrial", "dark"],
["Monokai", "monokai", "dark"],
["Nord Dark", "nord_dark", "dark"],
["One Dark", "one_dark", "dark"],
["Pastel on dark", "pastel_on_dark", "dark"],
["Solarized Dark", "solarized_dark", "dark"],
["Terminal", "terminal", "dark"],
["Tomorrow Night", "tomorrow_night", "dark"],
["Tomorrow Night Blue", "tomorrow_night_blue", "dark"],
["Tomorrow Night Bright", "tomorrow_night_bright", "dark"],
["Tomorrow Night 80s", "tomorrow_night_eighties", "dark"],
["Twilight", "twilight", "dark"],
["Vibrant Ink", "vibrant_ink", "dark"],
["GitHub Dark", "github_dark", "dark"],
["CloudEditor Dark", "cloud_editor_dark", "dark"]
];
exports.themesByName = {};
exports.themes = themeData.map(function (data) {
var name = data[1] || data[0].replace(/ /g, "_").toLowerCase();
var theme = {
caption: data[0],
theme: "ace/theme/" + name,
isDark: data[2] == "dark",
name: name
};
exports.themesByName[name] = theme;
return theme;
});
});
define("ace/ext/options",["require","exports","module","ace/ext/menu_tools/overlay_page","ace/lib/dom","ace/lib/oop","ace/config","ace/lib/event_emitter","ace/ext/modelist","ace/ext/themelist"], function(require, exports, module){"use strict";
require("./menu_tools/overlay_page");
var dom = require("../lib/dom");
var oop = require("../lib/oop");
var config = require("../config");
var EventEmitter = require("../lib/event_emitter").EventEmitter;
var buildDom = dom.buildDom;
var modelist = require("./modelist");
var themelist = require("./themelist");
var themes = { Bright: [], Dark: [] };
themelist.themes.forEach(function (x) {
themes[x.isDark ? "Dark" : "Bright"].push({ caption: x.caption, value: x.theme });
});
var modes = modelist.modes.map(function (x) {
return { caption: x.caption, value: x.mode };
});
var optionGroups = {
Main: {
Mode: {
path: "mode",
type: "select",
items: modes
},
Theme: {
path: "theme",
type: "select",
items: themes
},
"Keybinding": {
type: "buttonBar",
path: "keyboardHandler",
items: [
{ caption: "Ace", value: null },
{ caption: "Vim", value: "ace/keyboard/vim" },
{ caption: "Emacs", value: "ace/keyboard/emacs" },
{ caption: "Sublime", value: "ace/keyboard/sublime" },
{ caption: "VSCode", value: "ace/keyboard/vscode" }
]
},
"Font Size": {
path: "fontSize",
type: "number",
defaultValue: 12,
defaults: [
{ caption: "12px", value: 12 },
{ caption: "24px", value: 24 }
]
},
"Soft Wrap": {
type: "buttonBar",
path: "wrap",
items: [
{ caption: "Off", value: "off" },
{ caption: "View", value: "free" },
{ caption: "margin", value: "printMargin" },
{ caption: "40", value: "40" }
]
},
"Cursor Style": {
path: "cursorStyle",
items: [
{ caption: "Ace", value: "ace" },
{ caption: "Slim", value: "slim" },
{ caption: "Smooth", value: "smooth" },
{ caption: "Smooth And Slim", value: "smooth slim" },
{ caption: "Wide", value: "wide" }
]
},
"Folding": {
path: "foldStyle",
items: [
{ caption: "Manual", value: "manual" },
{ caption: "Mark begin", value: "markbegin" },
{ caption: "Mark begin and end", value: "markbeginend" }
]
},
"Soft Tabs": [{
path: "useSoftTabs"
}, {
ariaLabel: "Tab Size",
path: "tabSize",
type: "number",
values: [2, 3, 4, 8, 16]
}],
"Overscroll": {
type: "buttonBar",
path: "scrollPastEnd",
items: [
{ caption: "None", value: 0 },
{ caption: "Half", value: 0.5 },
{ caption: "Full", value: 1 }
]
}
},
More: {
"Atomic soft tabs": {
path: "navigateWithinSoftTabs"
},
"Enable Behaviours": {
path: "behavioursEnabled"
},
"Wrap with quotes": {
path: "wrapBehavioursEnabled"
},
"Enable Auto Indent": {
path: "enableAutoIndent"
},
"Full Line Selection": {
type: "checkbox",
values: "text|line",
path: "selectionStyle"
},
"Highlight Active Line": {
path: "highlightActiveLine"
},
"Show Invisibles": {
path: "showInvisibles"
},
"Show Indent Guides": {
path: "displayIndentGuides"
},
"Highlight Indent Guides": {
path: "highlightIndentGuides"
},
"Persistent HScrollbar": {
path: "hScrollBarAlwaysVisible"
},
"Persistent VScrollbar": {
path: "vScrollBarAlwaysVisible"
},
"Animate scrolling": {
path: "animatedScroll"
},
"Show Gutter": {
path: "showGutter"
},
"Show Line Numbers": {
path: "showLineNumbers"
},
"Relative Line Numbers": {
path: "relativeLineNumbers"
},
"Fixed Gutter Width": {
path: "fixedWidthGutter"
},
"Show Print Margin": [{
path: "showPrintMargin"
}, {
ariaLabel: "Print Margin",
type: "number",
path: "printMarginColumn"
}],
"Indented Soft Wrap": {
path: "indentedSoftWrap"
},
"Highlight selected word": {
path: "highlightSelectedWord"
},
"Fade Fold Widgets": {
path: "fadeFoldWidgets"
},
"Use textarea for IME": {
path: "useTextareaForIME"
},
"Merge Undo Deltas": {
path: "mergeUndoDeltas",
items: [
{ caption: "Always", value: "always" },
{ caption: "Never", value: "false" },
{ caption: "Timed", value: "true" }
]
},
"Elastic Tabstops": {
path: "useElasticTabstops"
},
"Incremental Search": {
path: "useIncrementalSearch"
},
"Read-only": {
path: "readOnly"
},
"Copy without selection": {
path: "copyWithEmptySelection"
},
"Live Autocompletion": {
path: "enableLiveAutocompletion"
},
"Custom scrollbar": {
path: "customScrollbar"
},
"Use SVG gutter icons": {
path: "useSvgGutterIcons"
},
"Annotations for folded lines": {
path: "showFoldedAnnotations"
},
"Keyboard Accessibility Mode": {
path: "enableKeyboardAccessibility"
},
"Gutter tooltip follows mouse": {
path: "tooltipFollowsMouse",
defaultValue: true
}
}
};
var OptionPanel = /** @class */ (function () {
function OptionPanel(editor, element) {
this.editor = editor;
this.container = element || document.createElement("div");
this.groups = [];
this.options = {};
}
OptionPanel.prototype.add = function (config) {
if (config.Main)
oop.mixin(optionGroups.Main, config.Main);
if (config.More)
oop.mixin(optionGroups.More, config.More);
};
OptionPanel.prototype.render = function () {
this.container.innerHTML = "";
buildDom(["table", { role: "presentation", id: "controls" },
this.renderOptionGroup(optionGroups.Main),
["tr", null, ["td", { colspan: 2 },
["table", { role: "presentation", id: "more-controls" },
this.renderOptionGroup(optionGroups.More)
]
]],
["tr", null, ["td", { colspan: 2 }, "version " + config.version]]
], this.container);
};
OptionPanel.prototype.renderOptionGroup = function (group) {
return Object.keys(group).map(function (key, i) {
var item = group[key];
if (!item.position)
item.position = i / 10000;
if (!item.label)
item.label = key;
return item;
}).sort(function (a, b) {
return a.position - b.position;
}).map(function (item) {
return this.renderOption(item.label, item);
}, this);
};
OptionPanel.prototype.renderOptionControl = function (key, option) {
var self = this;
if (Array.isArray(option)) {
return option.map(function (x) {
return self.renderOptionControl(key, x);
});
}
var control;
var value = self.getOption(option);
if (option.values && option.type != "checkbox") {
if (typeof option.values == "string")
option.values = option.values.split("|");
option.items = option.values.map(function (v) {
return { value: v, name: v };
});
}
if (option.type == "buttonBar") {
control = ["div", { role: "group", "aria-labelledby": option.path + "-label" }, option.items.map(function (item) {
return ["button", {
value: item.value,
ace_selected_button: value == item.value,
'aria-pressed': value == item.value,
onclick: function () {
self.setOption(option, item.value);
var nodes = this.parentNode.querySelectorAll("[ace_selected_button]");
for (var i = 0; i < nodes.length; i++) {
nodes[i].removeAttribute("ace_selected_button");
nodes[i].setAttribute("aria-pressed", false);
}
this.setAttribute("ace_selected_button", true);
this.setAttribute("aria-pressed", true);
}
}, item.desc || item.caption || item.name];
})];
}
else if (option.type == "number") {
control = ["input", { type: "number", value: value || option.defaultValue, style: "width:3em", oninput: function () {
self.setOption(option, parseInt(this.value));
} }];
if (option.ariaLabel) {
control[1]["aria-label"] = option.ariaLabel;
}
else {
control[1].id = key;
}
if (option.defaults) {
control = [control, option.defaults.map(function (item) {
return ["button", { onclick: function () {
var input = this.parentNode.firstChild;
input.value = item.value;
input.oninput();
} }, item.caption];
})];
}
}
else if (option.items) {
var buildItems = function (items) {
return items.map(function (item) {
return ["option", { value: item.value || item.name }, item.desc || item.caption || item.name];
});
};
var items = Array.isArray(option.items)
? buildItems(option.items)
: Object.keys(option.items).map(function (key) {
return ["optgroup", { "label": key }, buildItems(option.items[key])];
});
control = ["select", { id: key, value: value, onchange: function () {
self.setOption(option, this.value);
} }, items];
}
else {
if (typeof option.values == "string")
option.values = option.values.split("|");
if (option.values)
value = value == option.values[1];
control = ["input", { type: "checkbox", id: key, checked: value || null, onchange: function () {
var value = this.checked;
if (option.values)
value = option.values[value ? 1 : 0];
self.setOption(option, value);
} }];
if (option.type == "checkedNumber") {
control = [control, []];
}
}
return control;
};
OptionPanel.prototype.renderOption = function (key, option) {
if (option.path && !option.onchange && !this.editor.$options[option.path])
return;
var path = Array.isArray(option) ? option[0].path : option.path;
this.options[path] = option;
var safeKey = "-" + path;
var safeId = path + "-label";
var control = this.renderOptionControl(safeKey, option);
return ["tr", { class: "ace_optionsMenuEntry" }, ["td",
["label", { for: safeKey, id: safeId }, key]
], ["td", control]];
};
OptionPanel.prototype.setOption = function (option, value) {
if (typeof option == "string")
option = this.options[option];
if (value == "false")
value = false;
if (value == "true")
value = true;
if (value == "null")
value = null;
if (value == "undefined")
value = undefined;
if (typeof value == "string" && parseFloat(value).toString() == value)
value = parseFloat(value);
if (option.onchange)
option.onchange(value);
else if (option.path)
this.editor.setOption(option.path, value);
this._signal("setOption", { name: option.path, value: value });
};
OptionPanel.prototype.getOption = function (option) {
if (option.getValue)
return option.getValue();
return this.editor.getOption(option.path);
};
return OptionPanel;
}());
oop.implement(OptionPanel.prototype, EventEmitter);
exports.OptionPanel = OptionPanel;
}); (function() {
window.require(["ace/ext/options"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

File diff suppressed because it is too large Load Diff

120
vendor/assets/javascripts/ace/ext-rtl.js vendored Normal file
View File

@ -0,0 +1,120 @@
define("ace/ext/rtl",["require","exports","module","ace/editor","ace/config"], function(require, exports, module){"use strict";
var commands = [{
name: "leftToRight",
bindKey: { win: "Ctrl-Alt-Shift-L", mac: "Command-Alt-Shift-L" },
exec: function (editor) {
editor.session.$bidiHandler.setRtlDirection(editor, false);
},
readOnly: true
}, {
name: "rightToLeft",
bindKey: { win: "Ctrl-Alt-Shift-R", mac: "Command-Alt-Shift-R" },
exec: function (editor) {
editor.session.$bidiHandler.setRtlDirection(editor, true);
},
readOnly: true
}];
var Editor = require("../editor").Editor;
require("../config").defineOptions(Editor.prototype, "editor", {
rtlText: {
set: function (val) {
if (val) {
this.on("change", onChange);
this.on("changeSelection", onChangeSelection);
this.renderer.on("afterRender", updateLineDirection);
this.commands.on("exec", onCommandEmitted);
this.commands.addCommands(commands);
}
else {
this.off("change", onChange);
this.off("changeSelection", onChangeSelection);
this.renderer.off("afterRender", updateLineDirection);
this.commands.off("exec", onCommandEmitted);
this.commands.removeCommands(commands);
clearTextLayer(this.renderer);
}
this.renderer.updateFull();
}
},
rtl: {
set: function (val) {
this.session.$bidiHandler.$isRtl = val;
if (val) {
this.setOption("rtlText", false);
this.renderer.on("afterRender", updateLineDirection);
this.session.$bidiHandler.seenBidi = true;
}
else {
this.renderer.off("afterRender", updateLineDirection);
clearTextLayer(this.renderer);
}
this.renderer.updateFull();
}
}
});
function onChangeSelection(e, editor) {
var lead = editor.getSelection().lead;
if (editor.session.$bidiHandler.isRtlLine(lead.row)) {
if (lead.column === 0) {
if (editor.session.$bidiHandler.isMoveLeftOperation && lead.row > 0) {
editor.getSelection().moveCursorTo(lead.row - 1, editor.session.getLine(lead.row - 1).length);
}
else {
if (editor.getSelection().isEmpty())
lead.column += 1;
else
lead.setPosition(lead.row, lead.column + 1);
}
}
}
}
function onCommandEmitted(commadEvent) {
commadEvent.editor.session.$bidiHandler.isMoveLeftOperation = /gotoleft|selectleft|backspace|removewordleft/.test(commadEvent.command.name);
}
function onChange(delta, editor) {
var session = editor.session;
session.$bidiHandler.currentRow = null;
if (session.$bidiHandler.isRtlLine(delta.start.row) && delta.action === 'insert' && delta.lines.length > 1) {
for (var row = delta.start.row; row < delta.end.row; row++) {
if (session.getLine(row + 1).charAt(0) !== session.$bidiHandler.RLE)
session.doc.$lines[row + 1] = session.$bidiHandler.RLE + session.getLine(row + 1);
}
}
}
function updateLineDirection(e, renderer) {
var session = renderer.session;
var $bidiHandler = session.$bidiHandler;
var cells = renderer.$textLayer.$lines.cells;
var width = renderer.layerConfig.width - renderer.layerConfig.padding + "px";
cells.forEach(function (cell) {
var style = cell.element.style;
if ($bidiHandler && $bidiHandler.isRtlLine(cell.row)) {
style.direction = "rtl";
style.textAlign = "right";
style.width = width;
}
else {
style.direction = "";
style.textAlign = "";
style.width = "";
}
});
}
function clearTextLayer(renderer) {
var lines = renderer.$textLayer.$lines;
lines.cells.forEach(clear);
lines.cellCache.forEach(clear);
function clear(cell) {
var style = cell.element.style;
style.direction = style.textAlign = style.width = "";
}
}
}); (function() {
window.require(["ace/ext/rtl"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

View File

@ -1,215 +1,60 @@
define("ace/ext/searchbox",["require","exports","module","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/keyboard/hash_handler","ace/lib/keys"], function(require, exports, module) { define("ace/ext/searchbox-css",["require","exports","module"], function(require, exports, module){module.exports = "\n\n/* ------------------------------------------------------------------------------------------\n * Editor Search Form\n * --------------------------------------------------------------------------------------- */\n.ace_search {\n background-color: #ddd;\n color: #666;\n border: 1px solid #cbcbcb;\n border-top: 0 none;\n overflow: hidden;\n margin: 0;\n padding: 4px 6px 0 4px;\n position: absolute;\n top: 0;\n z-index: 99;\n white-space: normal;\n}\n.ace_search.left {\n border-left: 0 none;\n border-radius: 0px 0px 5px 0px;\n left: 0;\n}\n.ace_search.right {\n border-radius: 0px 0px 0px 5px;\n border-right: 0 none;\n right: 0;\n}\n\n.ace_search_form, .ace_replace_form {\n margin: 0 20px 4px 0;\n overflow: hidden;\n line-height: 1.9;\n}\n.ace_replace_form {\n margin-right: 0;\n}\n.ace_search_form.ace_nomatch {\n outline: 1px solid red;\n}\n\n.ace_search_field {\n border-radius: 3px 0 0 3px;\n background-color: white;\n color: black;\n border: 1px solid #cbcbcb;\n border-right: 0 none;\n outline: 0;\n padding: 0;\n font-size: inherit;\n margin: 0;\n line-height: inherit;\n padding: 0 6px;\n min-width: 17em;\n vertical-align: top;\n min-height: 1.8em;\n box-sizing: content-box;\n}\n.ace_searchbtn {\n border: 1px solid #cbcbcb;\n line-height: inherit;\n display: inline-block;\n padding: 0 6px;\n background: #fff;\n border-right: 0 none;\n border-left: 1px solid #dcdcdc;\n cursor: pointer;\n margin: 0;\n position: relative;\n color: #666;\n}\n.ace_searchbtn:last-child {\n border-radius: 0 3px 3px 0;\n border-right: 1px solid #cbcbcb;\n}\n.ace_searchbtn:disabled {\n background: none;\n cursor: default;\n}\n.ace_searchbtn:hover {\n background-color: #eef1f6;\n}\n.ace_searchbtn.prev, .ace_searchbtn.next {\n padding: 0px 0.7em\n}\n.ace_searchbtn.prev:after, .ace_searchbtn.next:after {\n content: \"\";\n border: solid 2px #888;\n width: 0.5em;\n height: 0.5em;\n border-width: 2px 0 0 2px;\n display:inline-block;\n transform: rotate(-45deg);\n}\n.ace_searchbtn.next:after {\n border-width: 0 2px 2px 0 ;\n}\n.ace_searchbtn_close {\n background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAcCAYAAABRVo5BAAAAZ0lEQVR42u2SUQrAMAhDvazn8OjZBilCkYVVxiis8H4CT0VrAJb4WHT3C5xU2a2IQZXJjiQIRMdkEoJ5Q2yMqpfDIo+XY4k6h+YXOyKqTIj5REaxloNAd0xiKmAtsTHqW8sR2W5f7gCu5nWFUpVjZwAAAABJRU5ErkJggg==) no-repeat 50% 0;\n border-radius: 50%;\n border: 0 none;\n color: #656565;\n cursor: pointer;\n font: 16px/16px Arial;\n padding: 0;\n height: 14px;\n width: 14px;\n top: 9px;\n right: 7px;\n position: absolute;\n}\n.ace_searchbtn_close:hover {\n background-color: #656565;\n background-position: 50% 100%;\n color: white;\n}\n\n.ace_button {\n margin-left: 2px;\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n -o-user-select: none;\n -ms-user-select: none;\n user-select: none;\n overflow: hidden;\n opacity: 0.7;\n border: 1px solid rgba(100,100,100,0.23);\n padding: 1px;\n box-sizing: border-box!important;\n color: black;\n}\n\n.ace_button:hover {\n background-color: #eee;\n opacity:1;\n}\n.ace_button:active {\n background-color: #ddd;\n}\n\n.ace_button.checked {\n border-color: #3399ff;\n opacity:1;\n}\n\n.ace_search_options{\n margin-bottom: 3px;\n text-align: right;\n -webkit-user-select: none;\n -moz-user-select: none;\n -o-user-select: none;\n -ms-user-select: none;\n user-select: none;\n clear: both;\n}\n\n.ace_search_counter {\n float: left;\n font-family: arial;\n padding: 0 8px;\n}";
"use strict";
});
define("ace/ext/searchbox",["require","exports","module","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/ext/searchbox-css","ace/keyboard/hash_handler","ace/lib/keys","ace/config"], function(require, exports, module){"use strict";
var dom = require("../lib/dom"); var dom = require("../lib/dom");
var lang = require("../lib/lang"); var lang = require("../lib/lang");
var event = require("../lib/event"); var event = require("../lib/event");
var searchboxCss = "\ var searchboxCss = require("./searchbox-css");
.ace_search {\
background-color: #ddd;\
color: #666;\
border: 1px solid #cbcbcb;\
border-top: 0 none;\
overflow: hidden;\
margin: 0;\
padding: 4px 6px 0 4px;\
position: absolute;\
top: 0;\
z-index: 99;\
white-space: normal;\
}\
.ace_search.left {\
border-left: 0 none;\
border-radius: 0px 0px 5px 0px;\
left: 0;\
}\
.ace_search.right {\
border-radius: 0px 0px 0px 5px;\
border-right: 0 none;\
right: 0;\
}\
.ace_search_form, .ace_replace_form {\
margin: 0 20px 4px 0;\
overflow: hidden;\
line-height: 1.9;\
}\
.ace_replace_form {\
margin-right: 0;\
}\
.ace_search_form.ace_nomatch {\
outline: 1px solid red;\
}\
.ace_search_field {\
border-radius: 3px 0 0 3px;\
background-color: white;\
color: black;\
border: 1px solid #cbcbcb;\
border-right: 0 none;\
box-sizing: border-box!important;\
outline: 0;\
padding: 0;\
font-size: inherit;\
margin: 0;\
line-height: inherit;\
padding: 0 6px;\
min-width: 17em;\
vertical-align: top;\
}\
.ace_searchbtn {\
border: 1px solid #cbcbcb;\
line-height: inherit;\
display: inline-block;\
padding: 0 6px;\
background: #fff;\
border-right: 0 none;\
border-left: 1px solid #dcdcdc;\
cursor: pointer;\
margin: 0;\
position: relative;\
box-sizing: content-box!important;\
color: #666;\
}\
.ace_searchbtn:last-child {\
border-radius: 0 3px 3px 0;\
border-right: 1px solid #cbcbcb;\
}\
.ace_searchbtn:disabled {\
background: none;\
cursor: default;\
}\
.ace_searchbtn:hover {\
background-color: #eef1f6;\
}\
.ace_searchbtn.prev, .ace_searchbtn.next {\
padding: 0px 0.7em\
}\
.ace_searchbtn.prev:after, .ace_searchbtn.next:after {\
content: \"\";\
border: solid 2px #888;\
width: 0.5em;\
height: 0.5em;\
border-width: 2px 0 0 2px;\
display:inline-block;\
transform: rotate(-45deg);\
}\
.ace_searchbtn.next:after {\
border-width: 0 2px 2px 0 ;\
}\
.ace_searchbtn_close {\
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAcCAYAAABRVo5BAAAAZ0lEQVR42u2SUQrAMAhDvazn8OjZBilCkYVVxiis8H4CT0VrAJb4WHT3C5xU2a2IQZXJjiQIRMdkEoJ5Q2yMqpfDIo+XY4k6h+YXOyKqTIj5REaxloNAd0xiKmAtsTHqW8sR2W5f7gCu5nWFUpVjZwAAAABJRU5ErkJggg==) no-repeat 50% 0;\
border-radius: 50%;\
border: 0 none;\
color: #656565;\
cursor: pointer;\
font: 16px/16px Arial;\
padding: 0;\
height: 14px;\
width: 14px;\
top: 9px;\
right: 7px;\
position: absolute;\
}\
.ace_searchbtn_close:hover {\
background-color: #656565;\
background-position: 50% 100%;\
color: white;\
}\
.ace_button {\
margin-left: 2px;\
cursor: pointer;\
-webkit-user-select: none;\
-moz-user-select: none;\
-o-user-select: none;\
-ms-user-select: none;\
user-select: none;\
overflow: hidden;\
opacity: 0.7;\
border: 1px solid rgba(100,100,100,0.23);\
padding: 1px;\
box-sizing: border-box!important;\
color: black;\
}\
.ace_button:hover {\
background-color: #eee;\
opacity:1;\
}\
.ace_button:active {\
background-color: #ddd;\
}\
.ace_button.checked {\
border-color: #3399ff;\
opacity:1;\
}\
.ace_search_options{\
margin-bottom: 3px;\
text-align: right;\
-webkit-user-select: none;\
-moz-user-select: none;\
-o-user-select: none;\
-ms-user-select: none;\
user-select: none;\
clear: both;\
}\
.ace_search_counter {\
float: left;\
font-family: arial;\
padding: 0 8px;\
}";
var HashHandler = require("../keyboard/hash_handler").HashHandler; var HashHandler = require("../keyboard/hash_handler").HashHandler;
var keyUtil = require("../lib/keys"); var keyUtil = require("../lib/keys");
var nls = require("../config").nls;
var MAX_COUNT = 999; var MAX_COUNT = 999;
dom.importCssString(searchboxCss, "ace_searchbox", false);
dom.importCssString(searchboxCss, "ace_searchbox"); var SearchBox = /** @class */ (function () {
function SearchBox(editor, range, showReplaceForm) {
var html = '<div class="ace_search right">\ this.activeInput;
<span action="hide" class="ace_searchbtn_close"></span>\ var div = dom.createElement("div");
<div class="ace_search_form">\ dom.buildDom(["div", { class: "ace_search right" },
<input class="ace_search_field" placeholder="Search for" spellcheck="false"></input>\ ["span", { action: "hide", class: "ace_searchbtn_close" }],
<span action="findPrev" class="ace_searchbtn prev"></span>\ ["div", { class: "ace_search_form" },
<span action="findNext" class="ace_searchbtn next"></span>\ ["input", { class: "ace_search_field", placeholder: nls("Search for"), spellcheck: "false" }],
<span action="findAll" class="ace_searchbtn" title="Alt-Enter">All</span>\ ["span", { action: "findPrev", class: "ace_searchbtn prev" }, "\u200b"],
</div>\ ["span", { action: "findNext", class: "ace_searchbtn next" }, "\u200b"],
<div class="ace_replace_form">\ ["span", { action: "findAll", class: "ace_searchbtn", title: "Alt-Enter" }, nls("All")]
<input class="ace_search_field" placeholder="Replace with" spellcheck="false"></input>\ ],
<span action="replaceAndFindNext" class="ace_searchbtn">Replace</span>\ ["div", { class: "ace_replace_form" },
<span action="replaceAll" class="ace_searchbtn">All</span>\ ["input", { class: "ace_search_field", placeholder: nls("Replace with"), spellcheck: "false" }],
</div>\ ["span", { action: "replaceAndFindNext", class: "ace_searchbtn" }, nls("Replace")],
<div class="ace_search_options">\ ["span", { action: "replaceAll", class: "ace_searchbtn" }, nls("All")]
<span action="toggleReplace" class="ace_button" title="Toggel Replace mode"\ ],
style="float:left;margin-top:-2px;padding:0 5px;">+</span>\ ["div", { class: "ace_search_options" },
<span class="ace_search_counter"></span>\ ["span", { action: "toggleReplace", class: "ace_button", title: nls("Toggle Replace mode"),
<span action="toggleRegexpMode" class="ace_button" title="RegExp Search">.*</span>\ style: "float:left;margin-top:-2px;padding:0 5px;" }, "+"],
<span action="toggleCaseSensitive" class="ace_button" title="CaseSensitive Search">Aa</span>\ ["span", { class: "ace_search_counter" }],
<span action="toggleWholeWords" class="ace_button" title="Whole Word Search">\\b</span>\ ["span", { action: "toggleRegexpMode", class: "ace_button", title: nls("RegExp Search") }, ".*"],
<span action="searchInSelection" class="ace_button" title="Search In Selection">S</span>\ ["span", { action: "toggleCaseSensitive", class: "ace_button", title: nls("CaseSensitive Search") }, "Aa"],
</div>\ ["span", { action: "toggleWholeWords", class: "ace_button", title: nls("Whole Word Search") }, "\\b"],
</div>'.replace(/> +/g, ">"); ["span", { action: "searchInSelection", class: "ace_button", title: nls("Search In Selection") }, "S"]
]
var SearchBox = function(editor, range, showReplaceForm) { ], div);
var div = dom.createElement("div"); this.element = div.firstChild;
div.innerHTML = html; this.setSession = this.setSession.bind(this);
this.element = div.firstChild; this.$init();
this.setEditor(editor);
this.setSession = this.setSession.bind(this); dom.importCssString(searchboxCss, "ace_searchbox", editor.container);
}
this.$init(); SearchBox.prototype.setEditor = function (editor) {
this.setEditor(editor);
};
(function() {
this.setEditor = function(editor) {
editor.searchBox = this; editor.searchBox = this;
editor.renderer.scroller.appendChild(this.element); editor.renderer.scroller.appendChild(this.element);
this.editor = editor; this.editor = editor;
}; };
SearchBox.prototype.setSession = function (e) {
this.setSession = function(e) {
this.searchRange = null; this.searchRange = null;
this.$syncOptions(true); this.$syncOptions(true);
}; };
SearchBox.prototype.$initElements = function (sb) {
this.$initElements = function(sb) {
this.searchBox = sb.querySelector(".ace_search_form"); this.searchBox = sb.querySelector(".ace_search_form");
this.replaceBox = sb.querySelector(".ace_replace_form"); this.replaceBox = sb.querySelector(".ace_replace_form");
this.searchOption = sb.querySelector("[action=searchInSelection]"); this.searchOption = sb.querySelector("[action=searchInSelection]");
@ -221,20 +66,17 @@ var SearchBox = function(editor, range, showReplaceForm) {
this.replaceInput = this.replaceBox.querySelector(".ace_search_field"); this.replaceInput = this.replaceBox.querySelector(".ace_search_field");
this.searchCounter = sb.querySelector(".ace_search_counter"); this.searchCounter = sb.querySelector(".ace_search_counter");
}; };
SearchBox.prototype.$init = function () {
this.$init = function() {
var sb = this.element; var sb = this.element;
this.$initElements(sb); this.$initElements(sb);
var _this = this; var _this = this;
event.addListener(sb, "mousedown", function(e) { event.addListener(sb, "mousedown", function (e) {
setTimeout(function(){ setTimeout(function () {
_this.activeInput.focus(); _this.activeInput.focus();
}, 0); }, 0);
event.stopPropagation(e); event.stopPropagation(e);
}); });
event.addListener(sb, "click", function(e) { event.addListener(sb, "click", function (e) {
var t = e.target || e.srcElement; var t = e.target || e.srcElement;
var action = t.getAttribute("action"); var action = t.getAttribute("action");
if (action && _this[action]) if (action && _this[action])
@ -243,8 +85,7 @@ var SearchBox = function(editor, range, showReplaceForm) {
_this.$searchBarKb.commands[action].exec(_this); _this.$searchBarKb.commands[action].exec(_this);
event.stopPropagation(e); event.stopPropagation(e);
}); });
event.addCommandKeyListener(sb, function (e, hashId, keyCode) {
event.addCommandKeyListener(sb, function(e, hashId, keyCode) {
var keyString = keyUtil.keyCodeToString(keyCode); var keyString = keyUtil.keyCodeToString(keyCode);
var command = _this.$searchBarKb.findKeyCommand(hashId, keyString); var command = _this.$searchBarKb.findKeyCommand(hashId, keyString);
if (command && command.exec) { if (command && command.exec) {
@ -252,135 +93,48 @@ var SearchBox = function(editor, range, showReplaceForm) {
event.stopEvent(e); event.stopEvent(e);
} }
}); });
this.$onChange = lang.delayedCall(function () {
this.$onChange = lang.delayedCall(function() {
_this.find(false, false); _this.find(false, false);
}); });
event.addListener(this.searchInput, "input", function () {
event.addListener(this.searchInput, "input", function() {
_this.$onChange.schedule(20); _this.$onChange.schedule(20);
}); });
event.addListener(this.searchInput, "focus", function() { event.addListener(this.searchInput, "focus", function () {
_this.activeInput = _this.searchInput; _this.activeInput = _this.searchInput;
_this.searchInput.value && _this.highlight(); _this.searchInput.value && _this.highlight();
}); });
event.addListener(this.replaceInput, "focus", function() { event.addListener(this.replaceInput, "focus", function () {
_this.activeInput = _this.replaceInput; _this.activeInput = _this.replaceInput;
_this.searchInput.value && _this.highlight(); _this.searchInput.value && _this.highlight();
}); });
}; };
this.$closeSearchBarKb = new HashHandler([{ SearchBox.prototype.setSearchRange = function (range) {
bindKey: "Esc",
name: "closeSearchBar",
exec: function(editor) {
editor.searchBox.hide();
}
}]);
this.$searchBarKb = new HashHandler();
this.$searchBarKb.bindKeys({
"Ctrl-f|Command-f": function(sb) {
var isReplace = sb.isReplace = !sb.isReplace;
sb.replaceBox.style.display = isReplace ? "" : "none";
sb.replaceOption.checked = false;
sb.$syncOptions();
sb.searchInput.focus();
},
"Ctrl-H|Command-Option-F": function(sb) {
sb.replaceOption.checked = true;
sb.$syncOptions();
sb.replaceInput.focus();
},
"Ctrl-G|Command-G": function(sb) {
sb.findNext();
},
"Ctrl-Shift-G|Command-Shift-G": function(sb) {
sb.findPrev();
},
"esc": function(sb) {
setTimeout(function() { sb.hide();});
},
"Return": function(sb) {
if (sb.activeInput == sb.replaceInput)
sb.replace();
sb.findNext();
},
"Shift-Return": function(sb) {
if (sb.activeInput == sb.replaceInput)
sb.replace();
sb.findPrev();
},
"Alt-Return": function(sb) {
if (sb.activeInput == sb.replaceInput)
sb.replaceAll();
sb.findAll();
},
"Tab": function(sb) {
(sb.activeInput == sb.replaceInput ? sb.searchInput : sb.replaceInput).focus();
}
});
this.$searchBarKb.addCommands([{
name: "toggleRegexpMode",
bindKey: {win: "Alt-R|Alt-/", mac: "Ctrl-Alt-R|Ctrl-Alt-/"},
exec: function(sb) {
sb.regExpOption.checked = !sb.regExpOption.checked;
sb.$syncOptions();
}
}, {
name: "toggleCaseSensitive",
bindKey: {win: "Alt-C|Alt-I", mac: "Ctrl-Alt-R|Ctrl-Alt-I"},
exec: function(sb) {
sb.caseSensitiveOption.checked = !sb.caseSensitiveOption.checked;
sb.$syncOptions();
}
}, {
name: "toggleWholeWords",
bindKey: {win: "Alt-B|Alt-W", mac: "Ctrl-Alt-B|Ctrl-Alt-W"},
exec: function(sb) {
sb.wholeWordOption.checked = !sb.wholeWordOption.checked;
sb.$syncOptions();
}
}, {
name: "toggleReplace",
exec: function(sb) {
sb.replaceOption.checked = !sb.replaceOption.checked;
sb.$syncOptions();
}
}, {
name: "searchInSelection",
exec: function(sb) {
sb.searchOption.checked = !sb.searchRange;
sb.setSearchRange(sb.searchOption.checked && sb.editor.getSelectionRange());
sb.$syncOptions();
}
}]);
this.setSearchRange = function(range) {
this.searchRange = range; this.searchRange = range;
if (range) { if (range) {
this.searchRangeMarker = this.editor.session.addMarker(range, "ace_active-line"); this.searchRangeMarker = this.editor.session.addMarker(range, "ace_active-line");
} else if (this.searchRangeMarker) { }
else if (this.searchRangeMarker) {
this.editor.session.removeMarker(this.searchRangeMarker); this.editor.session.removeMarker(this.searchRangeMarker);
this.searchRangeMarker = null; this.searchRangeMarker = null;
} }
}; };
SearchBox.prototype.$syncOptions = function (preventScroll) {
this.$syncOptions = function(preventScroll) {
dom.setCssClass(this.replaceOption, "checked", this.searchRange); dom.setCssClass(this.replaceOption, "checked", this.searchRange);
dom.setCssClass(this.searchOption, "checked", this.searchOption.checked); dom.setCssClass(this.searchOption, "checked", this.searchOption.checked);
this.replaceOption.textContent = this.replaceOption.checked ? "-" : "+"; this.replaceOption.textContent = this.replaceOption.checked ? "-" : "+";
dom.setCssClass(this.regExpOption, "checked", this.regExpOption.checked); dom.setCssClass(this.regExpOption, "checked", this.regExpOption.checked);
dom.setCssClass(this.wholeWordOption, "checked", this.wholeWordOption.checked); dom.setCssClass(this.wholeWordOption, "checked", this.wholeWordOption.checked);
dom.setCssClass(this.caseSensitiveOption, "checked", this.caseSensitiveOption.checked); dom.setCssClass(this.caseSensitiveOption, "checked", this.caseSensitiveOption.checked);
this.replaceBox.style.display = this.replaceOption.checked ? "" : "none"; var readOnly = this.editor.getReadOnly();
this.replaceOption.style.display = readOnly ? "none" : "";
this.replaceBox.style.display = this.replaceOption.checked && !readOnly ? "" : "none";
this.find(false, false, preventScroll); this.find(false, false, preventScroll);
}; };
SearchBox.prototype.highlight = function (re) {
this.highlight = function(re) {
this.editor.session.highlight(re || this.editor.$search.$options.re); this.editor.session.highlight(re || this.editor.$search.$options.re);
this.editor.renderer.updateBackMarkers(); this.editor.renderer.updateBackMarkers();
}; };
this.find = function(skipCurrent, backwards, preventScroll) { SearchBox.prototype.find = function (skipCurrent, backwards, preventScroll) {
var range = this.editor.find(this.searchInput.value, { var range = this.editor.find(this.searchInput.value, {
skipCurrent: skipCurrent, skipCurrent: skipCurrent,
backwards: backwards, backwards: backwards,
@ -397,20 +151,19 @@ var SearchBox = function(editor, range, showReplaceForm) {
this.highlight(); this.highlight();
this.updateCounter(); this.updateCounter();
}; };
this.updateCounter = function() { SearchBox.prototype.updateCounter = function () {
var editor = this.editor; var editor = this.editor;
var regex = editor.$search.$options.re; var regex = editor.$search.$options.re;
var supportsUnicodeFlag = regex.unicode;
var all = 0; var all = 0;
var before = 0; var before = 0;
if (regex) { if (regex) {
var value = this.searchRange var value = this.searchRange
? editor.session.getTextRange(this.searchRange) ? editor.session.getTextRange(this.searchRange)
: editor.getValue(); : editor.getValue();
var offset = editor.session.doc.positionToIndex(editor.selection.anchor); var offset = editor.session.doc.positionToIndex(editor.selection.anchor);
if (this.searchRange) if (this.searchRange)
offset -= editor.session.doc.positionToIndex(this.searchRange.start); offset -= editor.session.doc.positionToIndex(this.searchRange.start);
var last = regex.lastIndex = 0; var last = regex.lastIndex = 0;
var m; var m;
while ((m = regex.exec(value))) { while ((m = regex.exec(value))) {
@ -421,21 +174,21 @@ var SearchBox = function(editor, range, showReplaceForm) {
if (all > MAX_COUNT) if (all > MAX_COUNT)
break; break;
if (!m[0]) { if (!m[0]) {
regex.lastIndex = last += 1; regex.lastIndex = last += lang.skipEmptyMatch(value, last, supportsUnicodeFlag);
if (last >= value.length) if (last >= value.length)
break; break;
} }
} }
} }
this.searchCounter.textContent = before + " of " + (all > MAX_COUNT ? MAX_COUNT + "+" : all); this.searchCounter.textContent = nls("$0 of $1", [before, (all > MAX_COUNT ? MAX_COUNT + "+" : all)]);
}; };
this.findNext = function() { SearchBox.prototype.findNext = function () {
this.find(true, false); this.find(true, false);
}; };
this.findPrev = function() { SearchBox.prototype.findPrev = function () {
this.find(true, true); this.find(true, true);
}; };
this.findAll = function(){ SearchBox.prototype.findAll = function () {
var range = this.editor.findAll(this.searchInput.value, { var range = this.editor.findAll(this.searchInput.value, {
regExp: this.regExpOption.checked, regExp: this.regExpOption.checked,
caseSensitive: this.caseSensitiveOption.checked, caseSensitive: this.caseSensitiveOption.checked,
@ -447,62 +200,145 @@ var SearchBox = function(editor, range, showReplaceForm) {
this.highlight(); this.highlight();
this.hide(); this.hide();
}; };
this.replace = function() { SearchBox.prototype.replace = function () {
if (!this.editor.getReadOnly()) if (!this.editor.getReadOnly())
this.editor.replace(this.replaceInput.value); this.editor.replace(this.replaceInput.value);
}; };
this.replaceAndFindNext = function() { SearchBox.prototype.replaceAndFindNext = function () {
if (!this.editor.getReadOnly()) { if (!this.editor.getReadOnly()) {
this.editor.replace(this.replaceInput.value); this.editor.replace(this.replaceInput.value);
this.findNext(); this.findNext();
} }
}; };
this.replaceAll = function() { SearchBox.prototype.replaceAll = function () {
if (!this.editor.getReadOnly()) if (!this.editor.getReadOnly())
this.editor.replaceAll(this.replaceInput.value); this.editor.replaceAll(this.replaceInput.value);
}; };
SearchBox.prototype.hide = function () {
this.hide = function() {
this.active = false; this.active = false;
this.setSearchRange(null); this.setSearchRange(null);
this.editor.off("changeSession", this.setSession); this.editor.off("changeSession", this.setSession);
this.element.style.display = "none"; this.element.style.display = "none";
this.editor.keyBinding.removeKeyboardHandler(this.$closeSearchBarKb); this.editor.keyBinding.removeKeyboardHandler(this.$closeSearchBarKb);
this.editor.focus(); this.editor.focus();
}; };
this.show = function(value, isReplace) { SearchBox.prototype.show = function (value, isReplace) {
this.active = true; this.active = true;
this.editor.on("changeSession", this.setSession); this.editor.on("changeSession", this.setSession);
this.element.style.display = ""; this.element.style.display = "";
this.replaceOption.checked = isReplace; this.replaceOption.checked = isReplace;
if (value) if (value)
this.searchInput.value = value; this.searchInput.value = value;
this.searchInput.focus(); this.searchInput.focus();
this.searchInput.select(); this.searchInput.select();
this.editor.keyBinding.addKeyboardHandler(this.$closeSearchBarKb); this.editor.keyBinding.addKeyboardHandler(this.$closeSearchBarKb);
this.$syncOptions(true); this.$syncOptions(true);
}; };
SearchBox.prototype.isFocused = function () {
this.isFocused = function() {
var el = document.activeElement; var el = document.activeElement;
return el == this.searchInput || el == this.replaceInput; return el == this.searchInput || el == this.replaceInput;
}; };
}).call(SearchBox.prototype); return SearchBox;
}());
var $searchBarKb = new HashHandler();
$searchBarKb.bindKeys({
"Ctrl-f|Command-f": function (sb) {
var isReplace = sb.isReplace = !sb.isReplace;
sb.replaceBox.style.display = isReplace ? "" : "none";
sb.replaceOption.checked = false;
sb.$syncOptions();
sb.searchInput.focus();
},
"Ctrl-H|Command-Option-F": function (sb) {
if (sb.editor.getReadOnly())
return;
sb.replaceOption.checked = true;
sb.$syncOptions();
sb.replaceInput.focus();
},
"Ctrl-G|Command-G": function (sb) {
sb.findNext();
},
"Ctrl-Shift-G|Command-Shift-G": function (sb) {
sb.findPrev();
},
"esc": function (sb) {
setTimeout(function () { sb.hide(); });
},
"Return": function (sb) {
if (sb.activeInput == sb.replaceInput)
sb.replace();
sb.findNext();
},
"Shift-Return": function (sb) {
if (sb.activeInput == sb.replaceInput)
sb.replace();
sb.findPrev();
},
"Alt-Return": function (sb) {
if (sb.activeInput == sb.replaceInput)
sb.replaceAll();
sb.findAll();
},
"Tab": function (sb) {
(sb.activeInput == sb.replaceInput ? sb.searchInput : sb.replaceInput).focus();
}
});
$searchBarKb.addCommands([{
name: "toggleRegexpMode",
bindKey: { win: "Alt-R|Alt-/", mac: "Ctrl-Alt-R|Ctrl-Alt-/" },
exec: function (sb) {
sb.regExpOption.checked = !sb.regExpOption.checked;
sb.$syncOptions();
}
}, {
name: "toggleCaseSensitive",
bindKey: { win: "Alt-C|Alt-I", mac: "Ctrl-Alt-R|Ctrl-Alt-I" },
exec: function (sb) {
sb.caseSensitiveOption.checked = !sb.caseSensitiveOption.checked;
sb.$syncOptions();
}
}, {
name: "toggleWholeWords",
bindKey: { win: "Alt-B|Alt-W", mac: "Ctrl-Alt-B|Ctrl-Alt-W" },
exec: function (sb) {
sb.wholeWordOption.checked = !sb.wholeWordOption.checked;
sb.$syncOptions();
}
}, {
name: "toggleReplace",
exec: function (sb) {
sb.replaceOption.checked = !sb.replaceOption.checked;
sb.$syncOptions();
}
}, {
name: "searchInSelection",
exec: function (sb) {
sb.searchOption.checked = !sb.searchRange;
sb.setSearchRange(sb.searchOption.checked && sb.editor.getSelectionRange());
sb.$syncOptions();
}
}]);
var $closeSearchBarKb = new HashHandler([{
bindKey: "Esc",
name: "closeSearchBar",
exec: function (editor) {
editor.searchBox.hide();
}
}]);
SearchBox.prototype.$searchBarKb = $searchBarKb;
SearchBox.prototype.$closeSearchBarKb = $closeSearchBarKb;
exports.SearchBox = SearchBox; exports.SearchBox = SearchBox;
exports.Search = function (editor, isReplace) {
exports.Search = function(editor, isReplace) {
var sb = editor.searchBox || new SearchBox(editor); var sb = editor.searchBox || new SearchBox(editor);
sb.show(editor.session.getTextRange(), isReplace); sb.show(editor.session.getTextRange(), isReplace);
}; };
}); }); (function() {
(function() { window.require(["ace/ext/searchbox"], function(m) {
window.require(["ace/ext/searchbox"], function() {}); if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})(); })();

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,45 @@
define("ace/ext/simple_tokenizer",["require","exports","module","ace/tokenizer","ace/layer/text_util"], function(require, exports, module){"use strict";
var Tokenizer = require("../tokenizer").Tokenizer;
var isTextToken = require("../layer/text_util").isTextToken;
var SimpleTokenizer = /** @class */ (function () {
function SimpleTokenizer(content, tokenizer) {
this._lines = content.split(/\r\n|\r|\n/);
this._states = [];
this._tokenizer = tokenizer;
}
SimpleTokenizer.prototype.getTokens = function (row) {
var line = this._lines[row];
var previousState = this._states[row - 1];
var data = this._tokenizer.getLineTokens(line, previousState);
this._states[row] = data.state;
return data.tokens;
};
SimpleTokenizer.prototype.getLength = function () {
return this._lines.length;
};
return SimpleTokenizer;
}());
function tokenize(content, highlightRules) {
var tokenizer = new SimpleTokenizer(content, new Tokenizer(highlightRules.getRules()));
var result = [];
for (var lineIndex = 0; lineIndex < tokenizer.getLength(); lineIndex++) {
var lineTokens = tokenizer.getTokens(lineIndex);
result.push(lineTokens.map(function (token) { return ({
className: isTextToken(token.type) ? undefined : "ace_" + token.type.replace(/\./g, " ace_"),
value: token.value
}); }));
}
return result;
}
module.exports = {
tokenize: tokenize
};
}); (function() {
window.require(["ace/ext/simple_tokenizer"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

View File

@ -1,8 +1,6 @@
define("ace/ext/spellcheck",["require","exports","module","ace/lib/event","ace/editor","ace/config"], function(require, exports, module) { define("ace/ext/spellcheck",["require","exports","module","ace/lib/event","ace/editor","ace/config"], function(require, exports, module){"use strict";
"use strict";
var event = require("../lib/event"); var event = require("../lib/event");
exports.contextMenuHandler = function (e) {
exports.contextMenuHandler = function(e){
var host = e.target; var host = e.target;
var text = host.textInput.getElement(); var text = host.textInput.getElement();
if (!host.selection.isEmpty()) if (!host.selection.isEmpty())
@ -10,7 +8,6 @@ exports.contextMenuHandler = function(e){
var c = host.getCursorPosition(); var c = host.getCursorPosition();
var r = host.session.getWordRange(c.row, c.column); var r = host.session.getWordRange(c.row, c.column);
var w = host.session.getTextRange(r); var w = host.session.getTextRange(r);
host.session.tokenRe.lastIndex = 0; host.session.tokenRe.lastIndex = 0;
if (!host.session.tokenRe.test(w)) if (!host.session.tokenRe.test(w))
return; return;
@ -20,15 +17,12 @@ exports.contextMenuHandler = function(e){
text.setSelectionRange(w.length, w.length + 1); text.setSelectionRange(w.length, w.length + 1);
text.setSelectionRange(0, 0); text.setSelectionRange(0, 0);
text.setSelectionRange(0, w.length); text.setSelectionRange(0, w.length);
var afterKeydown = false; var afterKeydown = false;
event.addListener(text, "keydown", function onKeydown() { event.addListener(text, "keydown", function onKeydown() {
event.removeListener(text, "keydown", onKeydown); event.removeListener(text, "keydown", onKeydown);
afterKeydown = true; afterKeydown = true;
}); });
host.textInput.setInputHandler(function (newVal) {
host.textInput.setInputHandler(function(newVal) {
console.log(newVal , value, text.selectionStart, text.selectionEnd);
if (newVal == value) if (newVal == value)
return ''; return '';
if (newVal.lastIndexOf(value, 0) === 0) if (newVal.lastIndexOf(value, 0) === 0)
@ -45,14 +39,13 @@ exports.contextMenuHandler = function(e){
return ""; return "";
} }
} }
return newVal; return newVal;
}); });
}; };
var Editor = require("../editor").Editor; var Editor = require("../editor").Editor;
require("../config").defineOptions(Editor.prototype, "editor", { require("../config").defineOptions(Editor.prototype, "editor", {
spellcheck: { spellcheck: {
set: function(val) { set: function (val) {
var text = this.textInput.getElement(); var text = this.textInput.getElement();
text.spellcheck = !!val; text.spellcheck = !!val;
if (!val) if (!val)
@ -64,8 +57,11 @@ require("../config").defineOptions(Editor.prototype, "editor", {
} }
}); });
}); }); (function() {
(function() { window.require(["ace/ext/spellcheck"], function(m) {
window.require(["ace/ext/spellcheck"], function() {}); if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})(); })();

View File

@ -1,174 +1,150 @@
define("ace/split",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/editor","ace/virtual_renderer","ace/edit_session"], function(require, exports, module) { define("ace/split",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/editor","ace/virtual_renderer","ace/edit_session"], function(require, exports, module){"use strict";
"use strict";
var oop = require("./lib/oop"); var oop = require("./lib/oop");
var lang = require("./lib/lang"); var lang = require("./lib/lang");
var EventEmitter = require("./lib/event_emitter").EventEmitter; var EventEmitter = require("./lib/event_emitter").EventEmitter;
var Editor = require("./editor").Editor; var Editor = require("./editor").Editor;
var Renderer = require("./virtual_renderer").VirtualRenderer; var Renderer = require("./virtual_renderer").VirtualRenderer;
var EditSession = require("./edit_session").EditSession; var EditSession = require("./edit_session").EditSession;
var Split;
Split = function (container, theme, splits) {
var Split = function(container, theme, splits) {
this.BELOW = 1; this.BELOW = 1;
this.BESIDE = 0; this.BESIDE = 0;
this.$container = container; this.$container = container;
this.$theme = theme; this.$theme = theme;
this.$splits = 0; this.$splits = 0;
this.$editorCSS = ""; this.$editorCSS = "";
this.$editors = []; this.$editors = [];
this.$orientation = this.BESIDE; this.$orientation = this.BESIDE;
this.setSplits(splits || 1); this.setSplits(splits || 1);
this.$cEditor = this.$editors[0]; this.$cEditor = this.$editors[0];
this.on("focus", function (editor) {
this.on("focus", function(editor) {
this.$cEditor = editor; this.$cEditor = editor;
}.bind(this)); }.bind(this));
}; };
(function () {
(function(){
oop.implement(this, EventEmitter); oop.implement(this, EventEmitter);
this.$createEditor = function () {
this.$createEditor = function() {
var el = document.createElement("div"); var el = document.createElement("div");
el.className = this.$editorCSS; el.className = this.$editorCSS;
el.style.cssText = "position: absolute; top:0px; bottom:0px"; el.style.cssText = "position: absolute; top:0px; bottom:0px";
this.$container.appendChild(el); this.$container.appendChild(el);
var editor = new Editor(new Renderer(el, this.$theme)); var editor = new Editor(new Renderer(el, this.$theme));
editor.on("focus", function () {
editor.on("focus", function() {
this._emit("focus", editor); this._emit("focus", editor);
}.bind(this)); }.bind(this));
this.$editors.push(editor); this.$editors.push(editor);
editor.setFontSize(this.$fontSize); editor.setFontSize(this.$fontSize);
return editor; return editor;
}; };
this.setSplits = function (splits) {
this.setSplits = function(splits) {
var editor; var editor;
if (splits < 1) { if (splits < 1) {
throw "The number of splits have to be > 0!"; throw "The number of splits have to be > 0!";
} }
if (splits == this.$splits) { if (splits == this.$splits) {
return; return;
} else if (splits > this.$splits) { }
else if (splits > this.$splits) {
while (this.$splits < this.$editors.length && this.$splits < splits) { while (this.$splits < this.$editors.length && this.$splits < splits) {
editor = this.$editors[this.$splits]; editor = this.$editors[this.$splits];
this.$container.appendChild(editor.container); this.$container.appendChild(editor.container);
editor.setFontSize(this.$fontSize); editor.setFontSize(this.$fontSize);
this.$splits ++; this.$splits++;
} }
while (this.$splits < splits) { while (this.$splits < splits) {
this.$createEditor(); this.$createEditor();
this.$splits ++; this.$splits++;
} }
} else { }
else {
while (this.$splits > splits) { while (this.$splits > splits) {
editor = this.$editors[this.$splits - 1]; editor = this.$editors[this.$splits - 1];
this.$container.removeChild(editor.container); this.$container.removeChild(editor.container);
this.$splits --; this.$splits--;
} }
} }
this.resize(); this.resize();
}; };
this.getSplits = function() { this.getSplits = function () {
return this.$splits; return this.$splits;
}; };
this.getEditor = function(idx) { this.getEditor = function (idx) {
return this.$editors[idx]; return this.$editors[idx];
}; };
this.getCurrentEditor = function() { this.getCurrentEditor = function () {
return this.$cEditor; return this.$cEditor;
}; };
this.focus = function() { this.focus = function () {
this.$cEditor.focus(); this.$cEditor.focus();
}; };
this.blur = function() { this.blur = function () {
this.$cEditor.blur(); this.$cEditor.blur();
}; };
this.setTheme = function(theme) { this.setTheme = function (theme) {
this.$editors.forEach(function(editor) { this.$editors.forEach(function (editor) {
editor.setTheme(theme); editor.setTheme(theme);
}); });
}; };
this.setKeyboardHandler = function(keybinding) { this.setKeyboardHandler = function (keybinding) {
this.$editors.forEach(function(editor) { this.$editors.forEach(function (editor) {
editor.setKeyboardHandler(keybinding); editor.setKeyboardHandler(keybinding);
}); });
}; };
this.forEach = function(callback, scope) { this.forEach = function (callback, scope) {
this.$editors.forEach(callback, scope); this.$editors.forEach(callback, scope);
}; };
this.$fontSize = ""; this.$fontSize = "";
this.setFontSize = function(size) { this.setFontSize = function (size) {
this.$fontSize = size; this.$fontSize = size;
this.forEach(function(editor) { this.forEach(function (editor) {
editor.setFontSize(size); editor.setFontSize(size);
}); });
}; };
this.$cloneSession = function (session) {
this.$cloneSession = function(session) {
var s = new EditSession(session.getDocument(), session.getMode()); var s = new EditSession(session.getDocument(), session.getMode());
var undoManager = session.getUndoManager(); var undoManager = session.getUndoManager();
if (undoManager) { s.setUndoManager(undoManager);
var undoManagerProxy = new UndoManagerProxy(undoManager, s);
s.setUndoManager(undoManagerProxy);
}
s.$informUndoManager = lang.delayedCall(function() { s.$deltas = []; });
s.setTabSize(session.getTabSize()); s.setTabSize(session.getTabSize());
s.setUseSoftTabs(session.getUseSoftTabs()); s.setUseSoftTabs(session.getUseSoftTabs());
s.setOverwrite(session.getOverwrite()); s.setOverwrite(session.getOverwrite());
s.setBreakpoints(session.getBreakpoints()); s.setBreakpoints(session.getBreakpoints());
s.setUseWrapMode(session.getUseWrapMode()); s.setUseWrapMode(session.getUseWrapMode());
s.setUseWorker(session.getUseWorker()); s.setUseWorker(session.getUseWorker());
s.setWrapLimitRange(session.$wrapLimitRange.min, s.setWrapLimitRange(session.$wrapLimitRange.min, session.$wrapLimitRange.max);
session.$wrapLimitRange.max);
s.$foldData = session.$cloneFoldData(); s.$foldData = session.$cloneFoldData();
return s; return s;
}; };
this.setSession = function(session, idx) { this.setSession = function (session, idx) {
var editor; var editor;
if (idx == null) { if (idx == null) {
editor = this.$cEditor; editor = this.$cEditor;
} else { }
else {
editor = this.$editors[idx]; editor = this.$editors[idx];
} }
var isUsed = this.$editors.some(function(editor) { var isUsed = this.$editors.some(function (editor) {
return editor.session === session; return editor.session === session;
}); });
if (isUsed) { if (isUsed) {
session = this.$cloneSession(session); session = this.$cloneSession(session);
} }
editor.setSession(session); editor.setSession(session);
return session; return session;
}; };
this.getOrientation = function() { this.getOrientation = function () {
return this.$orientation; return this.$orientation;
}; };
this.setOrientation = function(orientation) { this.setOrientation = function (orientation) {
if (this.$orientation == orientation) { if (this.$orientation == orientation) {
return; return;
} }
this.$orientation = orientation; this.$orientation = orientation;
this.resize(); this.resize();
}; };
this.resize = function() { this.resize = function () {
var width = this.$container.clientWidth; var width = this.$container.clientWidth;
var height = this.$container.clientHeight; var height = this.$container.clientHeight;
var editor; var editor;
if (this.$orientation == this.BESIDE) { if (this.$orientation == this.BESIDE) {
var editorWidth = width / this.$splits; var editorWidth = width / this.$splits;
for (var i = 0; i < this.$splits; i++) { for (var i = 0; i < this.$splits; i++) {
@ -179,7 +155,8 @@ var Split = function(container, theme, splits) {
editor.container.style.height = height + "px"; editor.container.style.height = height + "px";
editor.resize(); editor.resize();
} }
} else { }
else {
var editorHeight = height / this.$splits; var editorHeight = height / this.$splits;
for (var i = 0; i < this.$splits; i++) { for (var i = 0; i < this.$splits; i++) {
editor = this.$editors[i]; editor = this.$editors[i];
@ -191,56 +168,19 @@ var Split = function(container, theme, splits) {
} }
} }
}; };
}).call(Split.prototype); }).call(Split.prototype);
function UndoManagerProxy(undoManager, session) {
this.$u = undoManager;
this.$doc = session;
}
(function() {
this.execute = function(options) {
this.$u.execute(options);
};
this.undo = function() {
var selectionRange = this.$u.undo(true);
if (selectionRange) {
this.$doc.selection.setSelectionRange(selectionRange);
}
};
this.redo = function() {
var selectionRange = this.$u.redo(true);
if (selectionRange) {
this.$doc.selection.setSelectionRange(selectionRange);
}
};
this.reset = function() {
this.$u.reset();
};
this.hasUndo = function() {
return this.$u.hasUndo();
};
this.hasRedo = function() {
return this.$u.hasRedo();
};
}).call(UndoManagerProxy.prototype);
exports.Split = Split; exports.Split = Split;
}); });
define("ace/ext/split",["require","exports","module","ace/split"], function(require, exports, module) { define("ace/ext/split",["require","exports","module","ace/split"], function(require, exports, module){"use strict";
"use strict";
module.exports = require("../split"); module.exports = require("../split");
}); }); (function() {
(function() { window.require(["ace/ext/split"], function(m) {
window.require(["ace/ext/split"], function() {}); if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})(); })();

View File

@ -1,59 +1,74 @@
define("ace/ext/static_highlight",["require","exports","module","ace/edit_session","ace/layer/text","ace/config","ace/lib/dom"], function(require, exports, module) { define("ace/ext/static-css",["require","exports","module"], function(require, exports, module){module.exports = ".ace_static_highlight {\n font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'Source Code Pro', 'source-code-pro', 'Droid Sans Mono', monospace;\n font-size: 12px;\n white-space: pre-wrap\n}\n\n.ace_static_highlight .ace_gutter {\n width: 2em;\n text-align: right;\n padding: 0 3px 0 0;\n margin-right: 3px;\n contain: none;\n}\n\n.ace_static_highlight.ace_show_gutter .ace_line {\n padding-left: 2.6em;\n}\n\n.ace_static_highlight .ace_line { position: relative; }\n\n.ace_static_highlight .ace_gutter-cell {\n -moz-user-select: -moz-none;\n -khtml-user-select: none;\n -webkit-user-select: none;\n user-select: none;\n top: 0;\n bottom: 0;\n left: 0;\n position: absolute;\n}\n\n\n.ace_static_highlight .ace_gutter-cell:before {\n content: counter(ace_line, decimal);\n counter-increment: ace_line;\n}\n.ace_static_highlight {\n counter-reset: ace_line;\n}\n";
"use strict";
});
define("ace/ext/static_highlight",["require","exports","module","ace/edit_session","ace/layer/text","ace/ext/static-css","ace/config","ace/lib/dom","ace/lib/lang"], function(require, exports, module){"use strict";
var EditSession = require("../edit_session").EditSession; var EditSession = require("../edit_session").EditSession;
var TextLayer = require("../layer/text").Text; var TextLayer = require("../layer/text").Text;
var baseStyles = ".ace_static_highlight {\ var baseStyles = require("./static-css");
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', 'Droid Sans Mono', monospace;\
font-size: 12px;\
white-space: pre-wrap\
}\
.ace_static_highlight .ace_gutter {\
width: 2em;\
text-align: right;\
padding: 0 3px 0 0;\
margin-right: 3px;\
}\
.ace_static_highlight.ace_show_gutter .ace_line {\
padding-left: 2.6em;\
}\
.ace_static_highlight .ace_line { position: relative; }\
.ace_static_highlight .ace_gutter-cell {\
-moz-user-select: -moz-none;\
-khtml-user-select: none;\
-webkit-user-select: none;\
user-select: none;\
top: 0;\
bottom: 0;\
left: 0;\
position: absolute;\
}\
.ace_static_highlight .ace_gutter-cell:before {\
content: counter(ace_line, decimal);\
counter-increment: ace_line;\
}\
.ace_static_highlight {\
counter-reset: ace_line;\
}\
";
var config = require("../config"); var config = require("../config");
var dom = require("../lib/dom"); var dom = require("../lib/dom");
var escapeHTML = require("../lib/lang").escapeHTML;
var SimpleTextLayer = function() { var Element = /** @class */ (function () {
function Element(type) { this.className;
this.type = type;
this.style = {};
this.textContent = "";
}
Element.prototype.cloneNode = function () {
return this;
};
Element.prototype.appendChild = function (child) {
this.textContent += child.toString();
};
Element.prototype.toString = function () {
var stringBuilder = [];
if (this.type != "fragment") {
stringBuilder.push("<", this.type);
if (this.className)
stringBuilder.push(" class='", this.className, "'");
var styleStr = [];
for (var key in this.style) {
styleStr.push(key, ":", this.style[key]);
}
if (styleStr.length)
stringBuilder.push(" style='", styleStr.join(""), "'");
stringBuilder.push(">");
}
if (this.textContent) {
stringBuilder.push(this.textContent);
}
if (this.type != "fragment") {
stringBuilder.push("</", this.type, ">");
}
return stringBuilder.join("");
};
return Element;
}());
var simpleDom = {
createTextNode: function (/** @type {string} */ textContent, /** @type {any} */ element) {
return escapeHTML(textContent);
},
createElement: function (/** @type {string} */ type) {
return new Element(type);
},
createFragment: function () {
return new Element("fragment");
}
};
var SimpleTextLayer = function () {
this.config = {}; this.config = {};
this.dom = simpleDom;
}; };
SimpleTextLayer.prototype = TextLayer.prototype; SimpleTextLayer.prototype = TextLayer.prototype;
var highlight = function (el, opts, callback) {
var highlight = function(el, opts, callback) {
var m = el.className.match(/lang-(\w+)/); var m = el.className.match(/lang-(\w+)/);
var mode = opts.mode || m && ("ace/mode/" + m[1]); var mode = opts.mode || m && ("ace/mode/" + m[1]);
if (!mode) if (!mode)
return false; return false;
var theme = opts.theme || "ace/theme/textmate"; var theme = opts.theme || "ace/theme/textmate";
var data = ""; var data = "";
var nodes = []; var nodes = [];
if (el.firstElementChild) { if (el.firstElementChild) {
var textLen = 0; var textLen = 0;
for (var i = 0; i < el.childNodes.length; i++) { for (var i = 0; i < el.childNodes.length; i++) {
@ -61,18 +76,19 @@ var highlight = function(el, opts, callback) {
if (ch.nodeType == 3) { if (ch.nodeType == 3) {
textLen += ch.data.length; textLen += ch.data.length;
data += ch.data; data += ch.data;
} else { }
else {
nodes.push(textLen, ch); nodes.push(textLen, ch);
} }
} }
} else { }
data = dom.getInnerText(el); else {
data = el.textContent;
if (opts.trim) if (opts.trim)
data = data.trim(); data = data.trim();
} }
highlight.render(data, mode, theme, opts.firstLineNumber, !opts.showGutter, function (highlighted) { highlight.render(data, mode, theme, opts.firstLineNumber, !opts.showGutter, function (highlighted) {
dom.importCssString(highlighted.css, "ace_highlight"); dom.importCssString(highlighted.css, "ace_highlight", true);
el.innerHTML = highlighted.html; el.innerHTML = highlighted.html;
var container = el.firstChild.firstChild; var container = el.firstChild.firstChild;
for (var i = 0; i < nodes.length; i += 2) { for (var i = 0; i < nodes.length; i += 2) {
@ -84,12 +100,12 @@ var highlight = function(el, opts, callback) {
callback && callback(); callback && callback();
}); });
}; };
highlight.render = function(input, mode, theme, lineStart, disableGutter, callback) { highlight.render = function (input, mode, theme, lineStart, disableGutter, callback) {
var waiting = 1; var waiting = 1;
var modeCache = EditSession.prototype.$modes; var modeCache = EditSession.prototype.$modes;
if (typeof theme == "string") { if (typeof theme == "string") {
waiting++; waiting++;
config.loadModule(['theme', theme], function(m) { config.loadModule(['theme', theme], function (m) {
theme = m; theme = m;
--waiting || done(); --waiting || done();
}); });
@ -101,10 +117,10 @@ highlight.render = function(input, mode, theme, lineStart, disableGutter, callba
} }
if (typeof mode == "string") { if (typeof mode == "string") {
waiting++; waiting++;
config.loadModule(['mode', mode], function(m) { config.loadModule(['mode', mode], function (m) {
if (!modeCache[mode] || modeOptions) if (!modeCache[ /**@type{string}*/(mode)] || modeOptions)
modeCache[mode] = new m.Mode(modeOptions); modeCache[ /**@type{string}*/(mode)] = new m.Mode(modeOptions);
mode = modeCache[mode]; mode = modeCache[ /**@type{string}*/(mode)];
--waiting || done(); --waiting || done();
}); });
} }
@ -114,48 +130,55 @@ highlight.render = function(input, mode, theme, lineStart, disableGutter, callba
} }
return --waiting || done(); return --waiting || done();
}; };
highlight.renderSync = function(input, mode, theme, lineStart, disableGutter) { highlight.renderSync = function (input, mode, theme, lineStart, disableGutter) {
lineStart = parseInt(lineStart || 1, 10); lineStart = parseInt(lineStart || 1, 10);
var session = new EditSession(""); var session = new EditSession("");
session.setUseWorker(false); session.setUseWorker(false);
session.setMode(mode); session.setMode(mode);
var textLayer = new SimpleTextLayer(); var textLayer = new SimpleTextLayer();
textLayer.setSession(session); textLayer.setSession(session);
Object.keys(textLayer.$tabStrings).forEach(function (k) {
if (typeof textLayer.$tabStrings[k] == "string") {
var el = simpleDom.createFragment();
el.textContent = textLayer.$tabStrings[k];
textLayer.$tabStrings[k] = el;
}
});
session.setValue(input); session.setValue(input);
var length = session.getLength();
var stringBuilder = []; var outerEl = simpleDom.createElement("div");
var length = session.getLength(); outerEl.className = theme.cssClass;
var innerEl = simpleDom.createElement("div");
for(var ix = 0; ix < length; ix++) { innerEl.className = "ace_static_highlight" + (disableGutter ? "" : " ace_show_gutter");
stringBuilder.push("<div class='ace_line'>"); innerEl.style["counter-reset"] = "ace_line " + (lineStart - 1);
if (!disableGutter) for (var ix = 0; ix < length; ix++) {
stringBuilder.push("<span class='ace_gutter ace_gutter-cell' unselectable='on'>" + /*(ix + lineStart) + */ "</span>"); var lineEl = simpleDom.createElement("div");
textLayer.$renderLine(stringBuilder, ix, true, false); lineEl.className = "ace_line";
stringBuilder.push("\n</div>"); if (!disableGutter) {
var gutterEl = simpleDom.createElement("span");
gutterEl.className = "ace_gutter ace_gutter-cell";
gutterEl.textContent = "";
lineEl.appendChild(gutterEl);
}
textLayer.$renderLine(lineEl, ix, false);
lineEl.textContent += "\n";
innerEl.appendChild(lineEl);
} }
var html = "<div class='" + theme.cssClass + "'>" + outerEl.appendChild(innerEl);
"<div class='ace_static_highlight" + (disableGutter ? "" : " ace_show_gutter") +
"' style='counter-reset:ace_line " + (lineStart - 1) + "'>" +
stringBuilder.join("") +
"</div>" +
"</div>";
textLayer.destroy();
return { return {
css: baseStyles + theme.cssText, css: baseStyles + theme.cssText,
html: html, html: outerEl.toString(),
session: session session: session
}; };
}; };
module.exports = highlight; module.exports = highlight;
module.exports.highlight = highlight; module.exports.highlight = highlight;
});
(function() { }); (function() {
window.require(["ace/ext/static_highlight"], function() {}); window.require(["ace/ext/static_highlight"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})(); })();

View File

@ -1,40 +1,32 @@
define("ace/ext/statusbar",["require","exports","module","ace/lib/dom","ace/lib/lang"], function(require, exports, module) { define("ace/ext/statusbar",["require","exports","module","ace/lib/dom","ace/lib/lang"], function(require, exports, module){"use strict";
"use strict"; var dom = require("../lib/dom");
var dom = require("ace/lib/dom"); var lang = require("../lib/lang");
var lang = require("ace/lib/lang"); var StatusBar = /** @class */ (function () {
function StatusBar(editor, parentNode) {
var StatusBar = function(editor, parentNode) { this.element = dom.createElement("div");
this.element = dom.createElement("div"); this.element.className = "ace_status-indicator";
this.element.className = "ace_status-indicator"; this.element.style.cssText = "display: inline-block;";
this.element.style.cssText = "display: inline-block;"; parentNode.appendChild(this.element);
parentNode.appendChild(this.element); var statusUpdate = lang.delayedCall(function () {
this.updateStatus(editor);
var statusUpdate = lang.delayedCall(function(){ }.bind(this)).schedule.bind(null, 100);
this.updateStatus(editor); editor.on("changeStatus", statusUpdate);
}.bind(this)).schedule.bind(null, 100); editor.on("changeSelection", statusUpdate);
editor.on("keyboardActivity", statusUpdate);
editor.on("changeStatus", statusUpdate); }
editor.on("changeSelection", statusUpdate); StatusBar.prototype.updateStatus = function (editor) {
editor.on("keyboardActivity", statusUpdate);
};
(function(){
this.updateStatus = function(editor) {
var status = []; var status = [];
function add(str, separator) { function add(str, separator) {
str && status.push(str, separator || "|"); str && status.push(str, separator || "|");
} }
add(editor.keyBinding.getStatusText(editor)); add(editor.keyBinding.getStatusText(editor));
if (editor.commands.recording) if (editor.commands.recording)
add("REC"); add("REC");
var sel = editor.selection; var sel = editor.selection;
var c = sel.lead; var c = sel.lead;
if (!sel.isEmpty()) { if (!sel.isEmpty()) {
var r = editor.getSelectionRange(); var r = editor.getSelectionRange();
add("(" + (r.end.row - r.start.row) + ":" +(r.end.column - r.start.column) + ")", " "); add("(" + (r.end.row - r.start.row) + ":" + (r.end.column - r.start.column) + ")", " ");
} }
add(c.row + ":" + c.column, " "); add(c.row + ":" + c.column, " ");
if (sel.rangeCount) if (sel.rangeCount)
@ -42,12 +34,15 @@ var StatusBar = function(editor, parentNode) {
status.pop(); status.pop();
this.element.textContent = status.join(""); this.element.textContent = status.join("");
}; };
}).call(StatusBar.prototype); return StatusBar;
}());
exports.StatusBar = StatusBar; exports.StatusBar = StatusBar;
}); }); (function() {
(function() { window.require(["ace/ext/statusbar"], function(m) {
window.require(["ace/ext/statusbar"], function() {}); if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})(); })();

View File

@ -1,187 +1,47 @@
define("ace/theme/textmate",["require","exports","module","ace/lib/dom"], function(require, exports, module) { define("ace/ext/textarea",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/ace"], function(require, exports, module){"use strict";
"use strict";
exports.isDark = false;
exports.cssClass = "ace-tm";
exports.cssText = ".ace-tm .ace_gutter {\
background: #f0f0f0;\
color: #333;\
}\
.ace-tm .ace_print-margin {\
width: 1px;\
background: #e8e8e8;\
}\
.ace-tm .ace_fold {\
background-color: #6B72E6;\
}\
.ace-tm {\
background-color: #FFFFFF;\
color: black;\
}\
.ace-tm .ace_cursor {\
color: black;\
}\
.ace-tm .ace_invisible {\
color: rgb(191, 191, 191);\
}\
.ace-tm .ace_storage,\
.ace-tm .ace_keyword {\
color: blue;\
}\
.ace-tm .ace_constant {\
color: rgb(197, 6, 11);\
}\
.ace-tm .ace_constant.ace_buildin {\
color: rgb(88, 72, 246);\
}\
.ace-tm .ace_constant.ace_language {\
color: rgb(88, 92, 246);\
}\
.ace-tm .ace_constant.ace_library {\
color: rgb(6, 150, 14);\
}\
.ace-tm .ace_invalid {\
background-color: rgba(255, 0, 0, 0.1);\
color: red;\
}\
.ace-tm .ace_support.ace_function {\
color: rgb(60, 76, 114);\
}\
.ace-tm .ace_support.ace_constant {\
color: rgb(6, 150, 14);\
}\
.ace-tm .ace_support.ace_type,\
.ace-tm .ace_support.ace_class {\
color: rgb(109, 121, 222);\
}\
.ace-tm .ace_keyword.ace_operator {\
color: rgb(104, 118, 135);\
}\
.ace-tm .ace_string {\
color: rgb(3, 106, 7);\
}\
.ace-tm .ace_comment {\
color: rgb(76, 136, 107);\
}\
.ace-tm .ace_comment.ace_doc {\
color: rgb(0, 102, 255);\
}\
.ace-tm .ace_comment.ace_doc.ace_tag {\
color: rgb(128, 159, 191);\
}\
.ace-tm .ace_constant.ace_numeric {\
color: rgb(0, 0, 205);\
}\
.ace-tm .ace_variable {\
color: rgb(49, 132, 149);\
}\
.ace-tm .ace_xml-pe {\
color: rgb(104, 104, 91);\
}\
.ace-tm .ace_entity.ace_name.ace_function {\
color: #0000A2;\
}\
.ace-tm .ace_heading {\
color: rgb(12, 7, 255);\
}\
.ace-tm .ace_list {\
color:rgb(185, 6, 144);\
}\
.ace-tm .ace_meta.ace_tag {\
color:rgb(0, 22, 142);\
}\
.ace-tm .ace_string.ace_regex {\
color: rgb(255, 0, 0)\
}\
.ace-tm .ace_marker-layer .ace_selection {\
background: rgb(181, 213, 255);\
}\
.ace-tm.ace_multiselect .ace_selection.ace_start {\
box-shadow: 0 0 3px 0px white;\
}\
.ace-tm .ace_marker-layer .ace_step {\
background: rgb(252, 255, 0);\
}\
.ace-tm .ace_marker-layer .ace_stack {\
background: rgb(164, 229, 101);\
}\
.ace-tm .ace_marker-layer .ace_bracket {\
margin: -1px 0 0 -1px;\
border: 1px solid rgb(192, 192, 192);\
}\
.ace-tm .ace_marker-layer .ace_active-line {\
background: rgba(0, 0, 0, 0.07);\
}\
.ace-tm .ace_gutter-active-line {\
background-color : #dcdcdc;\
}\
.ace-tm .ace_marker-layer .ace_selected-word {\
background: rgb(250, 250, 255);\
border: 1px solid rgb(200, 200, 250);\
}\
.ace-tm .ace_indent-guide {\
background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==\") right repeat-y;\
}\
";
var dom = require("../lib/dom");
dom.importCssString(exports.cssText, exports.cssClass);
});
define("ace/ext/textarea",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/lib/net","ace/ace","ace/theme/textmate"], function(require, exports, module) {
"use strict";
var event = require("../lib/event"); var event = require("../lib/event");
var UA = require("../lib/useragent"); var UA = require("../lib/useragent");
var net = require("../lib/net");
var ace = require("../ace"); var ace = require("../ace");
require("../theme/textmate");
module.exports = exports = ace; module.exports = exports = ace;
var getCSSProperty = function(element, container, property) { var getCSSProperty = function (element, container, property) {
var ret = element.style[property]; var ret = element.style[property];
if (!ret) { if (!ret) {
if (window.getComputedStyle) { if (window.getComputedStyle) {
ret = window.getComputedStyle(element, '').getPropertyValue(property); ret = window.getComputedStyle(element, '').getPropertyValue(property);
} else { }
else {
ret = element.currentStyle[property]; ret = element.currentStyle[property];
} }
} }
if (!ret || ret == 'auto' || ret == 'intrinsic') { if (!ret || ret == 'auto' || ret == 'intrinsic') {
ret = container.style[property]; ret = container.style[property];
} }
return ret; return ret;
}; };
function applyStyles(elm, styles) { function applyStyles(elm, styles) {
for (var style in styles) { for (var style in styles) {
elm.style[style] = styles[style]; elm.style[style] = styles[style];
} }
} }
function setupContainer(element, getValue) { function setupContainer(element, getValue) {
if (element.type != 'textarea') { if (element.type != 'textarea') {
throw new Error("Textarea required!"); throw new Error("Textarea required!");
} }
var parentNode = element.parentNode; var parentNode = element.parentNode;
var container = document.createElement('div'); var container = document.createElement('div');
var resizeEvent = function() { var resizeEvent = function () {
var style = 'position:relative;'; var style = 'position:relative;';
[ [
'margin-top', 'margin-left', 'margin-right', 'margin-bottom' 'margin-top', 'margin-left', 'margin-right', 'margin-bottom'
].forEach(function(item) { ].forEach(function (item) {
style += item + ':' + style += item + ':' +
getCSSProperty(element, container, item) + ';'; getCSSProperty(element, container, item) + ';';
}); });
var width = getCSSProperty(element, container, 'width') || (element.clientWidth + "px"); var width = getCSSProperty(element, container, 'width') || (element.clientWidth + "px");
var height = getCSSProperty(element, container, 'height') || (element.clientHeight + "px"); var height = getCSSProperty(element, container, 'height') || (element.clientHeight + "px");
style += 'height:' + height + ';width:' + width + ';'; style += 'height:' + height + ';width:' + width + ';';
style += 'display:inline-block;'; style += 'display:inline-block;';
container.setAttribute('style', style); container.style.cssText = style;
}; };
event.addListener(window, 'resize', resizeEvent); event.addListener(window, 'resize', resizeEvent);
resizeEvent(); resizeEvent();
@ -189,7 +49,7 @@ function setupContainer(element, getValue) {
while (parentNode !== document) { while (parentNode !== document) {
if (parentNode.tagName.toUpperCase() === 'FORM') { if (parentNode.tagName.toUpperCase() === 'FORM') {
var oldSumit = parentNode.onsubmit; var oldSumit = parentNode.onsubmit;
parentNode.onsubmit = function(evt) { parentNode.onsubmit = function (evt) {
element.value = getValue(); element.value = getValue();
if (oldSumit) { if (oldSumit) {
oldSumit.call(this, evt); oldSumit.call(this, evt);
@ -201,10 +61,10 @@ function setupContainer(element, getValue) {
} }
return container; return container;
} }
exports.transformTextarea = function (element, options) {
exports.transformTextarea = function(element, options) { var isFocused = element.autofocus || document.activeElement == element;
var session; var session;
var container = setupContainer(element, function() { var container = setupContainer(element, function () {
return session.getValue(); return session.getValue();
}); });
element.style.display = 'none'; element.style.display = 'none';
@ -219,21 +79,16 @@ exports.transformTextarea = function(element, options) {
position: "absolute" position: "absolute"
}); });
container.appendChild(editorDiv); container.appendChild(editorDiv);
var settingOpener = document.createElement("div"); var settingOpener = document.createElement("div");
applyStyles(settingOpener, { applyStyles(settingOpener, {
position: "absolute", position: "absolute",
right: "0px", right: "0px",
bottom: "0px", bottom: "0px",
background: "red",
cursor: "nw-resize", cursor: "nw-resize",
borderStyle: "solid", border: "solid 9px",
borderWidth: "9px 8px 10px 9px", borderColor: "lightblue gray gray #ceade6",
width: "2px",
borderColor: "lightblue gray gray lightblue",
zIndex: 101 zIndex: 101
}); });
var settingDiv = document.createElement("div"); var settingDiv = document.createElement("div");
var settingDivStyles = { var settingDivStyles = {
top: "0px", top: "0px",
@ -251,71 +106,57 @@ exports.transformTextarea = function(element, options) {
}; };
if (!UA.isOldIE) { if (!UA.isOldIE) {
settingDivStyles.backgroundColor = "rgba(0, 0, 0, 0.6)"; settingDivStyles.backgroundColor = "rgba(0, 0, 0, 0.6)";
} else { }
else {
settingDivStyles.backgroundColor = "#333"; settingDivStyles.backgroundColor = "#333";
} }
applyStyles(settingDiv, settingDivStyles); applyStyles(settingDiv, settingDivStyles);
container.appendChild(settingDiv); container.appendChild(settingDiv);
options = options || exports.defaultOptions; options = options || exports.defaultOptions;
var editor = ace.edit(editorDiv); var editor = ace.edit(editorDiv);
session = editor.getSession(); session = editor.getSession();
session.setValue(element.value || element.innerHTML); session.setValue(element.value || element.innerHTML);
editor.focus(); if (isFocused)
editor.focus();
container.appendChild(settingOpener); container.appendChild(settingOpener);
setupApi(editor, editorDiv, settingDiv, ace, options, load); setupApi(editor, editorDiv, settingDiv, ace, options);
setupSettingPanel(settingDiv, settingOpener, editor); setupSettingPanel(settingDiv, settingOpener, editor);
var state = ""; var state = "";
event.addListener(settingOpener, "mousemove", function(e) { event.addListener(settingOpener, "mousemove", function (e) {
var rect = this.getBoundingClientRect(); var rect = this.getBoundingClientRect();
var x = e.clientX - rect.left, y = e.clientY - rect.top; var x = e.clientX - rect.left, y = e.clientY - rect.top;
if (x + y < (rect.width + rect.height)/2) { if (x + y < (rect.width + rect.height) / 2) {
this.style.cursor = "pointer"; this.style.cursor = "pointer";
state = "toggle"; state = "toggle";
} else { }
else {
state = "resize"; state = "resize";
this.style.cursor = "nw-resize"; this.style.cursor = "nw-resize";
} }
}); });
event.addListener(settingOpener, "mousedown", function (e) {
event.addListener(settingOpener, "mousedown", function(e) { e.preventDefault();
if (state == "toggle") { if (state == "toggle") {
editor.setDisplaySettings(); editor.setDisplaySettings();
return; return;
} }
container.style.zIndex = 100000; container.style.zIndex = "100000";
var rect = container.getBoundingClientRect(); var rect = container.getBoundingClientRect();
var startX = rect.width + rect.left - e.clientX; var startX = rect.width + rect.left - e.clientX;
var startY = rect.height + rect.top - e.clientY; var startY = rect.height + rect.top - e.clientY;
event.capture(settingOpener, function(e) { event.capture(settingOpener, function (e) {
container.style.width = e.clientX - rect.left + startX + "px"; container.style.width = e.clientX - rect.left + startX + "px";
container.style.height = e.clientY - rect.top + startY + "px"; container.style.height = e.clientY - rect.top + startY + "px";
editor.resize(); editor.resize();
}, function() {}); }, function () { });
}); });
return editor; return editor;
}; };
function setupApi(editor, editorDiv, settingDiv, ace, options) {
function load(url, module, callback) {
net.loadScript(url, function() {
require([module], callback);
});
}
function setupApi(editor, editorDiv, settingDiv, ace, options, loader) {
var session = editor.getSession();
var renderer = editor.renderer;
loader = loader || load;
function toBool(value) { function toBool(value) {
return value === "true" || value == true; return value === "true" || value == true;
} }
editor.setDisplaySettings = function (display) {
editor.setDisplaySettings = function(display) {
if (display == null) if (display == null)
display = settingDiv.style.display == "none"; display = settingDiv.style.display == "none";
if (display) { if (display) {
@ -325,21 +166,21 @@ function setupApi(editor, editorDiv, settingDiv, ace, options, loader) {
editor.removeListener("focus", onFocus); editor.removeListener("focus", onFocus);
settingDiv.style.display = "none"; settingDiv.style.display = "none";
}); });
} else { }
else {
editor.focus(); editor.focus();
} }
}; };
editor.$setOption = editor.setOption; editor.$setOption = editor.setOption;
editor.$getOption = editor.getOption; editor.$getOption = editor.getOption;
editor.setOption = function(key, value) { editor.setOption = function (key, value) {
switch (key) { switch (key) {
case "mode": case "mode":
editor.$setOption("mode", "ace/mode/" + value); editor.$setOption("mode", "ace/mode/" + value);
break; break;
case "theme": case "theme":
editor.$setOption("theme", "ace/theme/" + value); editor.$setOption("theme", "ace/theme/" + value);
break; break;
case "keybindings": case "keybindings":
switch (value) { switch (value) {
case "vim": case "vim":
@ -351,28 +192,23 @@ function setupApi(editor, editorDiv, settingDiv, ace, options, loader) {
default: default:
editor.setKeyboardHandler(null); editor.setKeyboardHandler(null);
} }
break; break;
case "wrap":
case "softWrap":
case "fontSize": case "fontSize":
editor.$setOption(key, value); editor.$setOption(key, value);
break; break;
default: default:
editor.$setOption(key, toBool(value)); editor.$setOption(key, toBool(value));
} }
}; };
editor.getOption = function (key) {
editor.getOption = function(key) {
switch (key) { switch (key) {
case "mode": case "mode":
return editor.$getOption("mode").substr("ace/mode/".length); return editor.$getOption("mode").substr("ace/mode/".length);
break; break;
case "theme": case "theme":
return editor.$getOption("theme").substr("ace/theme/".length); return editor.$getOption("theme").substr("ace/theme/".length);
break; break;
case "keybindings": case "keybindings":
var value = editor.getKeyboardHandler(); var value = editor.getKeyboardHandler();
switch (value && value.$id) { switch (value && value.$id) {
@ -383,78 +219,73 @@ function setupApi(editor, editorDiv, settingDiv, ace, options, loader) {
default: default:
return "ace"; return "ace";
} }
break; break;
default: default:
return editor.$getOption(key); return editor.$getOption(key);
} }
}; };
editor.setOptions(options); editor.setOptions(options);
return editor; return editor;
} }
function setupSettingPanel(settingDiv, settingOpener, editor) { function setupSettingPanel(settingDiv, settingOpener, editor) {
var BOOL = null; var BOOL = null;
var desc = { var desc = {
mode: "Mode:", mode: "Mode:",
wrap: "Soft Wrap:", wrap: "Soft Wrap:",
theme: "Theme:", theme: "Theme:",
fontSize: "Font Size:", fontSize: "Font Size:",
showGutter: "Display Gutter:", showGutter: "Display Gutter:",
keybindings: "Keyboard", keybindings: "Keyboard",
showPrintMargin: "Show Print Margin:", showPrintMargin: "Show Print Margin:",
useSoftTabs: "Use Soft Tabs:", useSoftTabs: "Use Soft Tabs:",
showInvisibles: "Show Invisibles" showInvisibles: "Show Invisibles"
}; };
var optionValues = { var optionValues = {
mode: { mode: {
text: "Plain", text: "Plain",
javascript: "JavaScript", javascript: "JavaScript",
xml: "XML", xml: "XML",
html: "HTML", html: "HTML",
css: "CSS", css: "CSS",
scss: "SCSS", scss: "SCSS",
python: "Python", python: "Python",
php: "PHP", php: "PHP",
java: "Java", java: "Java",
ruby: "Ruby", ruby: "Ruby",
c_cpp: "C/C++", c_cpp: "C/C++",
coffee: "CoffeeScript", coffee: "CoffeeScript",
json: "json", json: "json",
perl: "Perl", perl: "Perl",
clojure: "Clojure", clojure: "Clojure",
ocaml: "OCaml", ocaml: "OCaml",
csharp: "C#", csharp: "C#",
haxe: "haXe", haxe: "haXe",
svg: "SVG", svg: "SVG",
textile: "Textile", textile: "Textile",
groovy: "Groovy", groovy: "Groovy",
liquid: "Liquid", liquid: "Liquid",
Scala: "Scala" Scala: "Scala"
}, },
theme: { theme: {
clouds: "Clouds", clouds: "Clouds",
clouds_midnight: "Clouds Midnight", clouds_midnight: "Clouds Midnight",
cobalt: "Cobalt", cobalt: "Cobalt",
crimson_editor: "Crimson Editor", crimson_editor: "Crimson Editor",
dawn: "Dawn", dawn: "Dawn",
gob: "Green on Black", gob: "Green on Black",
eclipse: "Eclipse", eclipse: "Eclipse",
idle_fingers: "Idle Fingers", idle_fingers: "Idle Fingers",
kr_theme: "Kr Theme", kr_theme: "Kr Theme",
merbivore: "Merbivore", merbivore: "Merbivore",
merbivore_soft: "Merbivore Soft", merbivore_soft: "Merbivore Soft",
mono_industrial: "Mono Industrial", mono_industrial: "Mono Industrial",
monokai: "Monokai", monokai: "Monokai",
pastel_on_dark: "Pastel On Dark", pastel_on_dark: "Pastel On Dark",
solarized_dark: "Solarized Dark", solarized_dark: "Solarized Dark",
solarized_light: "Solarized Light", solarized_light: "Solarized Light",
textmate: "Textmate", textmate: "Textmate",
twilight: "Twilight", twilight: "Twilight",
vibrant_ink: "Vibrant Ink" vibrant_ink: "Vibrant Ink"
}, },
showGutter: BOOL, showGutter: BOOL,
fontSize: { fontSize: {
@ -465,48 +296,37 @@ function setupSettingPanel(settingDiv, settingOpener, editor) {
"16px": "16px" "16px": "16px"
}, },
wrap: { wrap: {
off: "Off", off: "Off",
40: "40", 40: "40",
80: "80", 80: "80",
free: "Free" free: "Free"
}, },
keybindings: { keybindings: {
ace: "ace", ace: "ace",
vim: "vim", vim: "vim",
emacs: "emacs" emacs: "emacs"
}, },
showPrintMargin: BOOL, showPrintMargin: BOOL,
useSoftTabs: BOOL, useSoftTabs: BOOL,
showInvisibles: BOOL showInvisibles: BOOL
}; };
var table = []; var table = [];
table.push("<table><tr><th>Setting</th><th>Value</th></tr>"); table.push("<table><tr><th>Setting</th><th>Value</th></tr>");
function renderOption(builder, option, obj, cValue) { function renderOption(builder, option, obj, cValue) {
if (!obj) { if (!obj) {
builder.push( builder.push("<input type='checkbox' title='", option, "' ", cValue + "" == "true" ? "checked='true'" : "", "'></input>");
"<input type='checkbox' title='", option, "' ",
cValue + "" == "true" ? "checked='true'" : "",
"'></input>"
);
return; return;
} }
builder.push("<select title='" + option + "'>"); builder.push("<select title='" + option + "'>");
for (var value in obj) { for (var value in obj) {
builder.push("<option value='" + value + "' "); builder.push("<option value='" + value + "' ");
if (cValue == value) { if (cValue == value) {
builder.push(" selected "); builder.push(" selected ");
} }
builder.push(">", obj[value], "</option>");
builder.push(">",
obj[value],
"</option>");
} }
builder.push("</select>"); builder.push("</select>");
} }
for (var option in exports.defaultOptions) { for (var option in exports.defaultOptions) {
table.push("<tr><td>", desc[option], "</td>"); table.push("<tr><td>", desc[option], "</td>");
table.push("<td>"); table.push("<td>");
@ -515,12 +335,11 @@ function setupSettingPanel(settingDiv, settingOpener, editor) {
} }
table.push("</table>"); table.push("</table>");
settingDiv.innerHTML = table.join(""); settingDiv.innerHTML = table.join("");
var onChange = function (e) {
var onChange = function(e) {
var select = e.currentTarget; var select = e.currentTarget;
editor.setOption(select.title, select.value); editor.setOption(select.title, select.value);
}; };
var onClick = function(e) { var onClick = function (e) {
var cb = e.currentTarget; var cb = e.currentTarget;
editor.setOption(cb.title, cb.checked); editor.setOption(cb.title, cb.checked);
}; };
@ -530,31 +349,32 @@ function setupSettingPanel(settingDiv, settingOpener, editor) {
var cbs = settingDiv.getElementsByTagName("input"); var cbs = settingDiv.getElementsByTagName("input");
for (var i = 0; i < cbs.length; i++) for (var i = 0; i < cbs.length; i++)
cbs[i].onclick = onClick; cbs[i].onclick = onClick;
var button = document.createElement("input"); var button = document.createElement("input");
button.type = "button"; button.type = "button";
button.value = "Hide"; button.value = "Hide";
event.addListener(button, "click", function() { event.addListener(button, "click", function () {
editor.setDisplaySettings(false); editor.setDisplaySettings(false);
}); });
settingDiv.appendChild(button); settingDiv.appendChild(button);
settingDiv.hideButton = button; settingDiv.hideButton = button;
} }
exports.defaultOptions = { exports.defaultOptions = {
mode: "javascript", mode: "javascript",
theme: "textmate", theme: "textmate",
wrap: "off", wrap: "off",
fontSize: "12px", fontSize: "12px",
showGutter: "false", showGutter: "false",
keybindings: "ace", keybindings: "ace",
showPrintMargin: "false", showPrintMargin: "false",
useSoftTabs: "true", useSoftTabs: "true",
showInvisibles: "false" showInvisibles: "false"
}; };
}); }); (function() {
(function() { window.require(["ace/ext/textarea"], function(m) {
window.require(["ace/ext/textarea"], function() {}); if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})(); })();

View File

@ -1,49 +1,57 @@
define("ace/ext/themelist",["require","exports","module","ace/lib/fixoldbrowsers"], function(require, exports, module) { define("ace/ext/themelist",["require","exports","module"], function(require, exports, module){/**
* Generates a list of themes available when ace was built.
* @fileOverview Generates a list of themes available when ace was built.
* @author <a href="mailto:matthewkastor@gmail.com">
* Matthew Christopher Kastor-Inare III </a><br />
* ☭ Hial Atropa!! ☭
*/
"use strict"; "use strict";
require("ace/lib/fixoldbrowsers");
var themeData = [ var themeData = [
["Chrome" ], ["Chrome"],
["Clouds" ], ["Clouds"],
["Crimson Editor" ], ["Crimson Editor"],
["Dawn" ], ["Dawn"],
["Dreamweaver" ], ["Dreamweaver"],
["Eclipse" ], ["Eclipse"],
["GitHub" ], ["GitHub"],
["IPlastic" ], ["IPlastic"],
["Solarized Light"], ["Solarized Light"],
["TextMate" ], ["TextMate"],
["Tomorrow" ], ["Tomorrow"],
["XCode" ], ["XCode"],
["Kuroir"], ["Kuroir"],
["KatzenMilch"], ["KatzenMilch"],
["SQL Server" ,"sqlserver" , "light"], ["SQL Server", "sqlserver", "light"],
["Ambiance" ,"ambiance" , "dark"], ["CloudEditor", "cloud_editor", "light"],
["Chaos" ,"chaos" , "dark"], ["Ambiance", "ambiance", "dark"],
["Clouds Midnight" ,"clouds_midnight" , "dark"], ["Chaos", "chaos", "dark"],
["Cobalt" ,"cobalt" , "dark"], ["Clouds Midnight", "clouds_midnight", "dark"],
["Gruvbox" ,"gruvbox" , "dark"], ["Dracula", "", "dark"],
["Green on Black" ,"gob" , "dark"], ["Cobalt", "cobalt", "dark"],
["idle Fingers" ,"idle_fingers" , "dark"], ["Gruvbox", "gruvbox", "dark"],
["krTheme" ,"kr_theme" , "dark"], ["Green on Black", "gob", "dark"],
["Merbivore" ,"merbivore" , "dark"], ["idle Fingers", "idle_fingers", "dark"],
["Merbivore Soft" ,"merbivore_soft" , "dark"], ["krTheme", "kr_theme", "dark"],
["Mono Industrial" ,"mono_industrial" , "dark"], ["Merbivore", "merbivore", "dark"],
["Monokai" ,"monokai" , "dark"], ["Merbivore Soft", "merbivore_soft", "dark"],
["Pastel on dark" ,"pastel_on_dark" , "dark"], ["Mono Industrial", "mono_industrial", "dark"],
["Solarized Dark" ,"solarized_dark" , "dark"], ["Monokai", "monokai", "dark"],
["Terminal" ,"terminal" , "dark"], ["Nord Dark", "nord_dark", "dark"],
["Tomorrow Night" ,"tomorrow_night" , "dark"], ["One Dark", "one_dark", "dark"],
["Tomorrow Night Blue" ,"tomorrow_night_blue" , "dark"], ["Pastel on dark", "pastel_on_dark", "dark"],
["Tomorrow Night Bright","tomorrow_night_bright" , "dark"], ["Solarized Dark", "solarized_dark", "dark"],
["Tomorrow Night 80s" ,"tomorrow_night_eighties" , "dark"], ["Terminal", "terminal", "dark"],
["Twilight" ,"twilight" , "dark"], ["Tomorrow Night", "tomorrow_night", "dark"],
["Vibrant Ink" ,"vibrant_ink" , "dark"] ["Tomorrow Night Blue", "tomorrow_night_blue", "dark"],
["Tomorrow Night Bright", "tomorrow_night_bright", "dark"],
["Tomorrow Night 80s", "tomorrow_night_eighties", "dark"],
["Twilight", "twilight", "dark"],
["Vibrant Ink", "vibrant_ink", "dark"],
["GitHub Dark", "github_dark", "dark"],
["CloudEditor Dark", "cloud_editor_dark", "dark"]
]; ];
exports.themesByName = {}; exports.themesByName = {};
exports.themes = themeData.map(function(data) { exports.themes = themeData.map(function (data) {
var name = data[1] || data[0].replace(/ /g, "_").toLowerCase(); var name = data[1] || data[0].replace(/ /g, "_").toLowerCase();
var theme = { var theme = {
caption: data[0], caption: data[0],
@ -55,8 +63,11 @@ exports.themes = themeData.map(function(data) {
return theme; return theme;
}); });
}); }); (function() {
(function() { window.require(["ace/ext/themelist"], function(m) {
window.require(["ace/ext/themelist"], function() {}); if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})(); })();

View File

@ -1,8 +1,6 @@
define("ace/ext/whitespace",["require","exports","module","ace/lib/lang"], function(require, exports, module) { define("ace/ext/whitespace",["require","exports","module","ace/lib/lang"], function(require, exports, module){"use strict";
"use strict";
var lang = require("../lib/lang"); var lang = require("../lib/lang");
exports.$detectIndentation = function(lines, fallback) { exports.$detectIndentation = function (lines, fallback) {
var stats = []; var stats = [];
var changes = []; var changes = [];
var tabIndents = 0; var tabIndents = 0;
@ -12,17 +10,16 @@ exports.$detectIndentation = function(lines, fallback) {
var line = lines[i]; var line = lines[i];
if (!/^\s*[^*+\-\s]/.test(line)) if (!/^\s*[^*+\-\s]/.test(line))
continue; continue;
if (line[0] == "\t") { if (line[0] == "\t") {
tabIndents++; tabIndents++;
prevSpaces = -Number.MAX_VALUE; prevSpaces = -Number.MAX_VALUE;
} else { }
else {
var spaces = line.match(/^ */)[0].length; var spaces = line.match(/^ */)[0].length;
if (spaces && line[spaces] != "\t") { if (spaces && line[spaces] != "\t") {
var diff = spaces - prevSpaces; var diff = spaces - prevSpaces;
if (diff > 0 && !(prevSpaces%diff) && !(spaces%diff)) if (diff > 0 && !(prevSpaces % diff) && !(spaces % diff))
changes[diff] = (changes[diff] || 0) + 1; changes[diff] = (changes[diff] || 0) + 1;
stats[spaces] = (stats[spaces] || 0) + 1; stats[spaces] = (stats[spaces] || 0) + 1;
} }
prevSpaces = spaces; prevSpaces = spaces;
@ -30,17 +27,14 @@ exports.$detectIndentation = function(lines, fallback) {
while (i < max && line[line.length - 1] == "\\") while (i < max && line[line.length - 1] == "\\")
line = lines[i++]; line = lines[i++];
} }
function getScore(indent) { function getScore(indent) {
var score = 0; var score = 0;
for (var i = indent; i < stats.length; i += indent) for (var i = indent; i < stats.length; i += indent)
score += stats[i] || 0; score += stats[i] || 0;
return score; return score;
} }
var changesTotal = changes.reduce(function (a, b) { return a + b; }, 0);
var changesTotal = changes.reduce(function(a,b){return a+b;}, 0); var first = { score: 0, length: 0 };
var first = {score: 0, length: 0};
var spaceIndents = 0; var spaceIndents = 0;
for (var i = 1; i < 12; i++) { for (var i = 1; i < 12; i++) {
var score = getScore(i); var score = getScore(i);
@ -49,110 +43,97 @@ exports.$detectIndentation = function(lines, fallback) {
score = stats[1] ? 0.9 : 0.8; score = stats[1] ? 0.9 : 0.8;
if (!stats.length) if (!stats.length)
score = 0; score = 0;
} else }
else
score /= spaceIndents; score /= spaceIndents;
if (changes[i]) if (changes[i])
score += changes[i] / changesTotal; score += changes[i] / changesTotal;
if (score > first.score) if (score > first.score)
first = {score: score, length: i}; first = { score: score, length: i };
} }
if (first.score && first.score > 1.4) if (first.score && first.score > 1.4)
var tabLength = first.length; var tabLength = first.length;
if (tabIndents > spaceIndents + 1) { if (tabIndents > spaceIndents + 1) {
if (tabLength == 1 || spaceIndents < tabIndents / 4 || first.score < 1.8) if (tabLength == 1 || spaceIndents < tabIndents / 4 || first.score < 1.8)
tabLength = undefined; tabLength = undefined;
return {ch: "\t", length: tabLength}; return { ch: "\t", length: tabLength };
} }
if (spaceIndents > tabIndents + 1) if (spaceIndents > tabIndents + 1)
return {ch: " ", length: tabLength}; return { ch: " ", length: tabLength };
}; };
exports.detectIndentation = function (session) {
exports.detectIndentation = function(session) {
var lines = session.getLines(0, 1000); var lines = session.getLines(0, 1000);
var indent = exports.$detectIndentation(lines) || {}; var indent = exports.$detectIndentation(lines) || {};
if (indent.ch) if (indent.ch)
session.setUseSoftTabs(indent.ch == " "); session.setUseSoftTabs(indent.ch == " ");
if (indent.length) if (indent.length)
session.setTabSize(indent.length); session.setTabSize(indent.length);
return indent; return indent;
}; };
exports.trimTrailingSpace = function(session, options) { exports.trimTrailingSpace = function (session, options) {
var doc = session.getDocument(); var doc = session.getDocument();
var lines = doc.getAllLines(); var lines = doc.getAllLines();
var min = options && options.trimEmpty ? -1 : 0; var min = options && options.trimEmpty ? -1 : 0;
var cursors = [], ci = -1; var cursors = [], ci = -1;
if (options && options.keepCursorPosition) { if (options && options.keepCursorPosition) {
if (session.selection.rangeCount) { if (session.selection.rangeCount) {
session.selection.rangeList.ranges.forEach(function(x, i, ranges) { session.selection.rangeList.ranges.forEach(function (x, i, ranges) {
var next = ranges[i + 1]; var next = ranges[i + 1];
if (next && next.cursor.row == x.cursor.row) if (next && next.cursor.row == x.cursor.row)
return; return;
cursors.push(x.cursor); cursors.push(x.cursor);
}); });
} else { }
else {
cursors.push(session.selection.getCursor()); cursors.push(session.selection.getCursor());
} }
ci = 0; ci = 0;
} }
var cursorRow = cursors[ci] && cursors[ci].row; var cursorRow = cursors[ci] && cursors[ci].row;
for (var i = 0, l = lines.length; i < l; i++) {
for (var i = 0, l=lines.length; i < l; i++) {
var line = lines[i]; var line = lines[i];
var index = line.search(/\s+$/); var index = line.search(/\s+$/);
if (i == cursorRow) { if (i == cursorRow) {
if (index < cursors[ci].column && index > min) if (index < cursors[ci].column && index > min)
index = cursors[ci].column; index = cursors[ci].column;
ci++; ci++;
cursorRow = cursors[ci] ? cursors[ci].row : -1; cursorRow = cursors[ci] ? cursors[ci].row : -1;
} }
if (index > min) if (index > min)
doc.removeInLine(i, index, line.length); doc.removeInLine(i, index, line.length);
} }
}; };
exports.convertIndentation = function (session, ch, len) {
exports.convertIndentation = function(session, ch, len) {
var oldCh = session.getTabString()[0]; var oldCh = session.getTabString()[0];
var oldLen = session.getTabSize(); var oldLen = session.getTabSize();
if (!len) len = oldLen; if (!len)
if (!ch) ch = oldCh; len = oldLen;
if (!ch)
var tab = ch == "\t" ? ch: lang.stringRepeat(ch, len); ch = oldCh;
var tab = ch == "\t" ? ch : lang.stringRepeat(ch, len);
var doc = session.doc; var doc = session.doc;
var lines = doc.getAllLines(); var lines = doc.getAllLines();
var cache = {}; var cache = {};
var spaceCache = {}; var spaceCache = {};
for (var i = 0, l=lines.length; i < l; i++) { for (var i = 0, l = lines.length; i < l; i++) {
var line = lines[i]; var line = lines[i];
var match = line.match(/^\s*/)[0]; var match = line.match(/^\s*/)[0];
if (match) { if (match) {
var w = session.$getStringScreenWidth(match)[0]; var w = session.$getStringScreenWidth(match)[0];
var tabCount = Math.floor(w/oldLen); var tabCount = Math.floor(w / oldLen);
var reminder = w%oldLen; var reminder = w % oldLen;
var toInsert = cache[tabCount] || (cache[tabCount] = lang.stringRepeat(tab, tabCount)); var toInsert = cache[tabCount] || (cache[tabCount] = lang.stringRepeat(tab, tabCount));
toInsert += spaceCache[reminder] || (spaceCache[reminder] = lang.stringRepeat(" ", reminder)); toInsert += spaceCache[reminder] || (spaceCache[reminder] = lang.stringRepeat(" ", reminder));
if (toInsert != match) { if (toInsert != match) {
doc.removeInLine(i, 0, match.length); doc.removeInLine(i, 0, match.length);
doc.insertInLine({row: i, column: 0}, toInsert); doc.insertInLine({ row: i, column: 0 }, toInsert);
} }
} }
} }
session.setTabSize(len); session.setTabSize(len);
session.setUseSoftTabs(ch == " "); session.setUseSoftTabs(ch == " ");
}; };
exports.$parseStringArg = function (text) {
exports.$parseStringArg = function(text) {
var indent = {}; var indent = {};
if (/t/.test(text)) if (/t/.test(text))
indent.ch = "\t"; indent.ch = "\t";
@ -163,8 +144,7 @@ exports.$parseStringArg = function(text) {
indent.length = parseInt(m[0], 10); indent.length = parseInt(m[0], 10);
return indent; return indent;
}; };
exports.$parseArg = function (arg) {
exports.$parseArg = function(arg) {
if (!arg) if (!arg)
return {}; return {};
if (typeof arg == "string") if (typeof arg == "string")
@ -173,34 +153,40 @@ exports.$parseArg = function(arg) {
return exports.$parseStringArg(arg.text); return exports.$parseStringArg(arg.text);
return arg; return arg;
}; };
exports.commands = [{ exports.commands = [{
name: "detectIndentation", name: "detectIndentation",
exec: function(editor) { description: "Detect indentation from content",
exports.detectIndentation(editor.session); exec: function (editor) {
} exports.detectIndentation(editor.session);
}, { }
name: "trimTrailingSpace", }, {
exec: function(editor) { name: "trimTrailingSpace",
exports.trimTrailingSpace(editor.session); description: "Trim trailing whitespace",
} exec: function (editor, args) {
}, { exports.trimTrailingSpace(editor.session, args);
name: "convertIndentation", }
exec: function(editor, arg) { }, {
var indent = exports.$parseArg(arg); name: "convertIndentation",
exports.convertIndentation(editor.session, indent.ch, indent.length); description: "Convert indentation to ...",
} exec: function (editor, arg) {
}, { var indent = exports.$parseArg(arg);
name: "setIndentation", exports.convertIndentation(editor.session, indent.ch, indent.length);
exec: function(editor, arg) { }
var indent = exports.$parseArg(arg); }, {
indent.length && editor.session.setTabSize(indent.length); name: "setIndentation",
indent.ch && editor.session.setUseSoftTabs(indent.ch == " "); description: "Set indentation",
} exec: function (editor, arg) {
}]; var indent = exports.$parseArg(arg);
indent.length && editor.session.setTabSize(indent.length);
indent.ch && editor.session.setUseSoftTabs(indent.ch == " ");
}
}];
}); }); (function() {
(function() { window.require(["ace/ext/whitespace"], function(m) {
window.require(["ace/ext/whitespace"], function() {}); if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})(); })();

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,409 @@
define("ace/keyboard/sublime",["require","exports","module","ace/keyboard/hash_handler"], function(require, exports, module){"use strict";
var HashHandler = require("../keyboard/hash_handler").HashHandler;
function moveBySubWords(editor, direction, extend) {
var selection = editor.selection;
var row = selection.lead.row;
var column = selection.lead.column;
var line = editor.session.getLine(row);
if (!line[column + direction]) {
var method = (extend ? "selectWord" : "moveCursorShortWord")
+ (direction == 1 ? "Right" : "Left");
return editor.selection[method]();
}
if (direction == -1)
column--;
while (line[column]) {
var type = getType(line[column]) + getType(line[column + direction]);
column += direction;
if (direction == 1) {
if (type == "WW" && getType(line[column + 1]) == "w")
break;
}
else {
if (type == "wW") {
if (getType(line[column - 1]) == "W") {
column -= 1;
break;
}
else {
continue;
}
}
if (type == "Ww")
break;
}
if (/w[s_oW]|_[sWo]|o[s_wW]|s[W]|W[so]/.test(type))
break;
}
if (direction == -1)
column++;
if (extend)
editor.selection.moveCursorTo(row, column);
else
editor.selection.moveTo(row, column);
function getType(x) {
if (!x)
return "-";
if (/\s/.test(x))
return "s";
if (x == "_")
return "_";
if (x.toUpperCase() == x && x.toLowerCase() != x)
return "W";
if (x.toUpperCase() != x && x.toLowerCase() == x)
return "w";
return "o";
}
}
exports.handler = new HashHandler();
exports.handler.addCommands([{
name: "find_all_under",
exec: function (editor) {
if (editor.selection.isEmpty())
editor.selection.selectWord();
editor.findAll();
},
readOnly: true
}, {
name: "find_under",
exec: function (editor) {
if (editor.selection.isEmpty())
editor.selection.selectWord();
editor.findNext();
},
readOnly: true
}, {
name: "find_under_prev",
exec: function (editor) {
if (editor.selection.isEmpty())
editor.selection.selectWord();
editor.findPrevious();
},
readOnly: true
}, {
name: "find_under_expand",
exec: function (editor) {
editor.selectMore(1, false, true);
},
scrollIntoView: "animate",
readOnly: true
}, {
name: "find_under_expand_skip",
exec: function (editor) {
editor.selectMore(1, true, true);
},
scrollIntoView: "animate",
readOnly: true
}, {
name: "delete_to_hard_bol",
exec: function (editor) {
var pos = editor.selection.getCursor();
editor.session.remove({
start: { row: pos.row, column: 0 },
end: pos
});
},
multiSelectAction: "forEach",
scrollIntoView: "cursor"
}, {
name: "delete_to_hard_eol",
exec: function (editor) {
var pos = editor.selection.getCursor();
editor.session.remove({
start: pos,
end: { row: pos.row, column: Infinity }
});
},
multiSelectAction: "forEach",
scrollIntoView: "cursor"
}, {
name: "moveToWordStartLeft",
exec: function (editor) {
editor.selection.moveCursorLongWordLeft();
editor.clearSelection();
},
multiSelectAction: "forEach",
scrollIntoView: "cursor"
}, {
name: "moveToWordEndRight",
exec: function (editor) {
editor.selection.moveCursorLongWordRight();
editor.clearSelection();
},
multiSelectAction: "forEach",
scrollIntoView: "cursor"
}, {
name: "selectToWordStartLeft",
exec: function (editor) {
var sel = editor.selection;
sel.$moveSelection(sel.moveCursorLongWordLeft);
},
multiSelectAction: "forEach",
scrollIntoView: "cursor"
}, {
name: "selectToWordEndRight",
exec: function (editor) {
var sel = editor.selection;
sel.$moveSelection(sel.moveCursorLongWordRight);
},
multiSelectAction: "forEach",
scrollIntoView: "cursor"
}, {
name: "selectSubWordRight",
exec: function (editor) {
moveBySubWords(editor, 1, true);
},
multiSelectAction: "forEach",
scrollIntoView: "cursor",
readOnly: true
}, {
name: "selectSubWordLeft",
exec: function (editor) {
moveBySubWords(editor, -1, true);
},
multiSelectAction: "forEach",
scrollIntoView: "cursor",
readOnly: true
}, {
name: "moveSubWordRight",
exec: function (editor) {
moveBySubWords(editor, 1);
},
multiSelectAction: "forEach",
scrollIntoView: "cursor",
readOnly: true
}, {
name: "moveSubWordLeft",
exec: function (editor) {
moveBySubWords(editor, -1);
},
multiSelectAction: "forEach",
scrollIntoView: "cursor",
readOnly: true
}]);
[{
bindKey: { mac: "cmd-k cmd-backspace|cmd-backspace", win: "ctrl-shift-backspace|ctrl-k ctrl-backspace" },
name: "removetolinestarthard"
}, {
bindKey: { mac: "cmd-k cmd-k|cmd-delete|ctrl-k", win: "ctrl-shift-delete|ctrl-k ctrl-k" },
name: "removetolineendhard"
}, {
bindKey: { mac: "cmd-shift-d", win: "ctrl-shift-d" },
name: "duplicateSelection"
}, {
bindKey: { mac: "cmd-l", win: "ctrl-l" },
name: "expandtoline"
},
{
bindKey: { mac: "cmd-shift-a", win: "ctrl-shift-a" },
name: "expandSelection",
args: { to: "tag" }
}, {
bindKey: { mac: "cmd-shift-j", win: "ctrl-shift-j" },
name: "expandSelection",
args: { to: "indentation" }
}, {
bindKey: { mac: "ctrl-shift-m", win: "ctrl-shift-m" },
name: "expandSelection",
args: { to: "brackets" }
}, {
bindKey: { mac: "cmd-shift-space", win: "ctrl-shift-space" },
name: "expandSelection",
args: { to: "scope" }
},
{
bindKey: { mac: "ctrl-cmd-g", win: "alt-f3" },
name: "find_all_under"
}, {
bindKey: { mac: "alt-cmd-g", win: "ctrl-f3" },
name: "find_under"
}, {
bindKey: { mac: "shift-alt-cmd-g", win: "ctrl-shift-f3" },
name: "find_under_prev"
}, {
bindKey: { mac: "cmd-g", win: "f3" },
name: "findnext"
}, {
bindKey: { mac: "shift-cmd-g", win: "shift-f3" },
name: "findprevious"
}, {
bindKey: { mac: "cmd-d", win: "ctrl-d" },
name: "find_under_expand"
}, {
bindKey: { mac: "cmd-k cmd-d", win: "ctrl-k ctrl-d" },
name: "find_under_expand_skip"
},
{
bindKey: { mac: "cmd-alt-[", win: "ctrl-shift-[" },
name: "toggleFoldWidget"
}, {
bindKey: { mac: "cmd-alt-]", win: "ctrl-shift-]" },
name: "unfold"
}, {
bindKey: { mac: "cmd-k cmd-0|cmd-k cmd-j", win: "ctrl-k ctrl-0|ctrl-k ctrl-j" },
name: "unfoldall"
}, {
bindKey: { mac: "cmd-k cmd-1", win: "ctrl-k ctrl-1" },
name: "foldOther",
args: { level: 1 }
},
{
bindKey: { win: "ctrl-left", mac: "alt-left" },
name: "moveToWordStartLeft"
}, {
bindKey: { win: "ctrl-right", mac: "alt-right" },
name: "moveToWordEndRight"
}, {
bindKey: { win: "ctrl-shift-left", mac: "alt-shift-left" },
name: "selectToWordStartLeft"
}, {
bindKey: { win: "ctrl-shift-right", mac: "alt-shift-right" },
name: "selectToWordEndRight"
},
{
bindKey: { mac: "ctrl-alt-shift-right|ctrl-shift-right", win: "alt-shift-right" },
name: "selectSubWordRight"
}, {
bindKey: { mac: "ctrl-alt-shift-left|ctrl-shift-left", win: "alt-shift-left" },
name: "selectSubWordLeft"
}, {
bindKey: { mac: "ctrl-alt-right|ctrl-right", win: "alt-right" },
name: "moveSubWordRight"
}, {
bindKey: { mac: "ctrl-alt-left|ctrl-left", win: "alt-left" },
name: "moveSubWordLeft"
},
{
bindKey: { mac: "ctrl-m", win: "ctrl-m" },
name: "jumptomatching",
args: { to: "brackets" }
},
{
bindKey: { mac: "ctrl-f6", win: "ctrl-f6" },
name: "goToNextError"
}, {
bindKey: { mac: "ctrl-shift-f6", win: "ctrl-shift-f6" },
name: "goToPreviousError"
},
{
bindKey: { mac: "ctrl-o" },
name: "splitline"
},
{
bindKey: { mac: "ctrl-shift-w", win: "alt-shift-w" },
name: "surrowndWithTag"
}, {
bindKey: { mac: "cmd-alt-.", win: "alt-." },
name: "close_tag"
},
{
bindKey: { mac: "cmd-j", win: "ctrl-j" },
name: "joinlines"
},
{
bindKey: { mac: "ctrl--", win: "alt--" },
name: "jumpBack"
}, {
bindKey: { mac: "ctrl-shift--", win: "alt-shift--" },
name: "jumpForward"
},
{
bindKey: { mac: "cmd-k cmd-l", win: "ctrl-k ctrl-l" },
name: "tolowercase"
}, {
bindKey: { mac: "cmd-k cmd-u", win: "ctrl-k ctrl-u" },
name: "touppercase"
},
{
bindKey: { mac: "cmd-shift-v", win: "ctrl-shift-v" },
name: "paste_and_indent"
}, {
bindKey: { mac: "cmd-k cmd-v|cmd-alt-v", win: "ctrl-k ctrl-v" },
name: "paste_from_history"
},
{
bindKey: { mac: "cmd-shift-enter", win: "ctrl-shift-enter" },
name: "addLineBefore"
}, {
bindKey: { mac: "cmd-enter", win: "ctrl-enter" },
name: "addLineAfter"
}, {
bindKey: { mac: "ctrl-shift-k", win: "ctrl-shift-k" },
name: "removeline"
}, {
bindKey: { mac: "ctrl-alt-up", win: "ctrl-up" },
name: "scrollup"
}, {
bindKey: { mac: "ctrl-alt-down", win: "ctrl-down" },
name: "scrolldown"
}, {
bindKey: { mac: "cmd-a", win: "ctrl-a" },
name: "selectall"
}, {
bindKey: { linux: "alt-shift-down", mac: "ctrl-shift-down", win: "ctrl-alt-down" },
name: "addCursorBelow"
}, {
bindKey: { linux: "alt-shift-up", mac: "ctrl-shift-up", win: "ctrl-alt-up" },
name: "addCursorAbove"
},
{
bindKey: { mac: "cmd-k cmd-c|ctrl-l", win: "ctrl-k ctrl-c" },
name: "centerselection"
},
{
bindKey: { mac: "f5", win: "f9" },
name: "sortlines"
},
{
bindKey: { mac: "ctrl-f5", win: "ctrl-f9" },
name: "sortlines",
args: { caseSensitive: true }
},
{
bindKey: { mac: "cmd-shift-l", win: "ctrl-shift-l" },
name: "splitSelectionIntoLines"
}, {
bindKey: { mac: "ctrl-cmd-down", win: "ctrl-shift-down" },
name: "movelinesdown"
}, {
bindKey: { mac: "ctrl-cmd-up", win: "ctrl-shift-up" },
name: "movelinesup"
}, {
bindKey: { mac: "alt-down", win: "alt-down" },
name: "modifyNumberDown"
}, {
bindKey: { mac: "alt-up", win: "alt-up" },
name: "modifyNumberUp"
}, {
bindKey: { mac: "cmd-/", win: "ctrl-/" },
name: "togglecomment"
}, {
bindKey: { mac: "cmd-alt-/", win: "ctrl-shift-/" },
name: "toggleBlockComment"
},
{
bindKey: { linux: "ctrl-alt-q", mac: "ctrl-q", win: "ctrl-q" },
name: "togglerecording"
}, {
bindKey: { linux: "ctrl-alt-shift-q", mac: "ctrl-shift-q", win: "ctrl-shift-q" },
name: "replaymacro"
},
{
bindKey: { mac: "ctrl-t", win: "ctrl-t" },
name: "transpose"
}
].forEach(function (binding) {
var command = exports.handler.commands[binding.name];
if (command)
command.bindKey = binding.bindKey;
exports.handler.bindKey(binding.bindKey, command || binding.name);
});
}); (function() {
window.require(["ace/keyboard/sublime"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,255 @@
define("ace/keyboard/vscode",["require","exports","module","ace/keyboard/hash_handler","ace/config"], function(require, exports, module){"use strict";
var HashHandler = require("../keyboard/hash_handler").HashHandler;
var config = require("../config");
exports.handler = new HashHandler();
exports.handler.$id = "ace/keyboard/vscode";
exports.handler.addCommands([{
name: "toggleWordWrap",
exec: function (editor) {
var wrapUsed = editor.session.getUseWrapMode();
editor.session.setUseWrapMode(!wrapUsed);
},
readOnly: true
}, {
name: "navigateToLastEditLocation",
exec: function (editor) {
var lastDelta = editor.session.getUndoManager().$lastDelta;
var range = (lastDelta.action == "remove") ? lastDelta.start : lastDelta.end;
editor.moveCursorTo(range.row, range.column);
editor.clearSelection();
}
}, {
name: "replaceAll",
exec: function (editor) {
if (!editor.searchBox) {
config.loadModule("ace/ext/searchbox", function (e) {
e.Search(editor, true);
});
}
else {
if (editor.searchBox.active === true && editor.searchBox.replaceOption.checked === true) {
editor.searchBox.replaceAll();
}
}
}
}, {
name: "replaceOne",
exec: function (editor) {
if (!editor.searchBox) {
config.loadModule("ace/ext/searchbox", function (e) {
e.Search(editor, true);
});
}
else {
if (editor.searchBox.active === true && editor.searchBox.replaceOption.checked === true) {
editor.searchBox.replace();
}
}
}
}, {
name: "selectAllMatches",
exec: function (editor) {
if (!editor.searchBox) {
config.loadModule("ace/ext/searchbox", function (e) {
e.Search(editor, false);
});
}
else {
if (editor.searchBox.active === true) {
editor.searchBox.findAll();
}
}
}
}, {
name: "toggleFindCaseSensitive",
exec: function (editor) {
config.loadModule("ace/ext/searchbox", function (e) {
e.Search(editor, false);
var sb = editor.searchBox;
sb.caseSensitiveOption.checked = !sb.caseSensitiveOption.checked;
sb.$syncOptions();
});
}
}, {
name: "toggleFindInSelection",
exec: function (editor) {
config.loadModule("ace/ext/searchbox", function (e) {
e.Search(editor, false);
var sb = editor.searchBox;
sb.searchOption.checked = !sb.searchRange;
sb.setSearchRange(sb.searchOption.checked && sb.editor.getSelectionRange());
sb.$syncOptions();
});
}
}, {
name: "toggleFindRegex",
exec: function (editor) {
config.loadModule("ace/ext/searchbox", function (e) {
e.Search(editor, false);
var sb = editor.searchBox;
sb.regExpOption.checked = !sb.regExpOption.checked;
sb.$syncOptions();
});
}
}, {
name: "toggleFindWholeWord",
exec: function (editor) {
config.loadModule("ace/ext/searchbox", function (e) {
e.Search(editor, false);
var sb = editor.searchBox;
sb.wholeWordOption.checked = !sb.wholeWordOption.checked;
sb.$syncOptions();
});
}
}, {
name: "removeSecondaryCursors",
exec: function (editor) {
var ranges = editor.selection.ranges;
if (ranges && ranges.length > 1)
editor.selection.toSingleRange(ranges[ranges.length - 1]);
else
editor.selection.clearSelection();
}
}]);
[{
bindKey: { mac: "Ctrl-G", win: "Ctrl-G" },
name: "gotoline"
}, {
bindKey: { mac: "Command-Shift-L|Command-F2", win: "Ctrl-Shift-L|Ctrl-F2" },
name: "findAll"
}, {
bindKey: { mac: "Shift-F8|Shift-Option-F8", win: "Shift-F8|Shift-Alt-F8" },
name: "goToPreviousError"
}, {
bindKey: { mac: "F8|Option-F8", win: "F8|Alt-F8" },
name: "goToNextError"
}, {
bindKey: { mac: "Command-Shift-P|F1", win: "Ctrl-Shift-P|F1" },
name: "openCommandPalette"
}, {
bindKey: { mac: "Shift-Option-Up", win: "Alt-Shift-Up" },
name: "copylinesup"
}, {
bindKey: { mac: "Shift-Option-Down", win: "Alt-Shift-Down" },
name: "copylinesdown"
}, {
bindKey: { mac: "Command-Shift-K", win: "Ctrl-Shift-K" },
name: "removeline"
}, {
bindKey: { mac: "Command-Enter", win: "Ctrl-Enter" },
name: "addLineAfter"
}, {
bindKey: { mac: "Command-Shift-Enter", win: "Ctrl-Shift-Enter" },
name: "addLineBefore"
}, {
bindKey: { mac: "Command-Shift-\\", win: "Ctrl-Shift-\\" },
name: "jumptomatching"
}, {
bindKey: { mac: "Command-]", win: "Ctrl-]" },
name: "blockindent"
}, {
bindKey: { mac: "Command-[", win: "Ctrl-[" },
name: "blockoutdent"
}, {
bindKey: { mac: "Ctrl-PageDown", win: "Alt-PageDown" },
name: "pagedown"
}, {
bindKey: { mac: "Ctrl-PageUp", win: "Alt-PageUp" },
name: "pageup"
}, {
bindKey: { mac: "Shift-Option-A", win: "Shift-Alt-A" },
name: "toggleBlockComment"
}, {
bindKey: { mac: "Option-Z", win: "Alt-Z" },
name: "toggleWordWrap"
}, {
bindKey: { mac: "Command-G", win: "F3|Ctrl-K Ctrl-D" },
name: "findnext"
}, {
bindKey: { mac: "Command-Shift-G", win: "Shift-F3" },
name: "findprevious"
}, {
bindKey: { mac: "Option-Enter", win: "Alt-Enter" },
name: "selectAllMatches"
}, {
bindKey: { mac: "Command-D", win: "Ctrl-D" },
name: "selectMoreAfter"
}, {
bindKey: { mac: "Command-K Command-D", win: "Ctrl-K Ctrl-D" },
name: "selectOrFindNext"
}, {
bindKey: { mac: "Shift-Option-I", win: "Shift-Alt-I" },
name: "splitSelectionIntoLines"
}, {
bindKey: { mac: "Command-K M", win: "Ctrl-K M" },
name: "modeSelect"
}, {
bindKey: { mac: "Command-Option-[", win: "Ctrl-Shift-[" },
name: "toggleFoldWidget"
}, {
bindKey: { mac: "Command-Option-]", win: "Ctrl-Shift-]" },
name: "toggleFoldWidget"
}, {
bindKey: { mac: "Command-K Command-0", win: "Ctrl-K Ctrl-0" },
name: "foldall"
}, {
bindKey: { mac: "Command-K Command-J", win: "Ctrl-K Ctrl-J" },
name: "unfoldall"
}, {
bindKey: { mac: "Command-K Command-1", win: "Ctrl-K Ctrl-1" },
name: "foldOther"
}, {
bindKey: { mac: "Command-K Command-Q", win: "Ctrl-K Ctrl-Q" },
name: "navigateToLastEditLocation"
}, {
bindKey: { mac: "Command-K Command-R|Command-K Command-S", win: "Ctrl-K Ctrl-R|Ctrl-K Ctrl-S" },
name: "showKeyboardShortcuts"
}, {
bindKey: { mac: "Command-K Command-X", win: "Ctrl-K Ctrl-X" },
name: "trimTrailingSpace"
}, {
bindKey: { mac: "Shift-Down|Command-Shift-Down", win: "Shift-Down|Ctrl-Shift-Down" },
name: "selectdown"
}, {
bindKey: { mac: "Shift-Up|Command-Shift-Up", win: "Shift-Up|Ctrl-Shift-Up" },
name: "selectup"
}, {
bindKey: { mac: "Command-Alt-Enter", win: "Ctrl-Alt-Enter" },
name: "replaceAll"
}, {
bindKey: { mac: "Command-Shift-1", win: "Ctrl-Shift-1" },
name: "replaceOne"
}, {
bindKey: { mac: "Option-C", win: "Alt-C" },
name: "toggleFindCaseSensitive"
}, {
bindKey: { mac: "Option-L", win: "Alt-L" },
name: "toggleFindInSelection"
}, {
bindKey: { mac: "Option-R", win: "Alt-R" },
name: "toggleFindRegex"
}, {
bindKey: { mac: "Option-W", win: "Alt-W" },
name: "toggleFindWholeWord"
}, {
bindKey: { mac: "Command-L", win: "Ctrl-L" },
name: "expandtoline"
}, {
bindKey: { mac: "Shift-Esc", win: "Shift-Esc" },
name: "removeSecondaryCursors"
}
].forEach(function (binding) {
var command = exports.handler.commands[binding.name];
if (command)
command.bindKey = binding.bindKey;
exports.handler.bindKey(binding.bindKey, command || binding.name);
});
}); (function() {
window.require(["ace/keyboard/vscode"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

View File

@ -1,15 +1,18 @@
define("ace/mode/abap_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { define("ace/mode/abap_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){/*
* based on
* " Vim ABAP syntax file
* " Language: SAP - ABAP/R4
* " Revision: 2.1
* " Maintainer: Marius Piedallu van Wyk <lailoken@gmail.com>
* " Last Change: 2012 Oct 23
*/
"use strict"; "use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var AbapHighlightRules = function () {
var AbapHighlightRules = function() {
var keywordMapper = this.createKeywordMapper({ var keywordMapper = this.createKeywordMapper({
"variable.language": "this", "variable.language": "this",
"keyword": "keyword": "ADD ALIAS ALIASES ASCENDING ASSERT ASSIGN ASSIGNING AT BACK" +
"ADD ALIAS ALIASES ASCENDING ASSERT ASSIGN ASSIGNING AT BACK" +
" CALL CASE CATCH CHECK CLASS CLEAR CLOSE CNT COLLECT COMMIT COMMUNICATION COMPUTE CONCATENATE CONDENSE CONSTANTS CONTINUE CONTROLS CONVERT CREATE CURRENCY" + " CALL CASE CATCH CHECK CLASS CLEAR CLOSE CNT COLLECT COMMIT COMMUNICATION COMPUTE CONCATENATE CONDENSE CONSTANTS CONTINUE CONTROLS CONVERT CREATE CURRENCY" +
" DATA DEFINE DEFINITION DEFERRED DELETE DESCENDING DESCRIBE DETAIL DIVIDE DO" + " DATA DEFINE DEFINITION DEFERRED DELETE DESCENDING DESCRIBE DETAIL DIVIDE DO" +
" ELSE ELSEIF ENDAT ENDCASE ENDCLASS ENDDO ENDEXEC ENDFORM ENDFUNCTION ENDIF ENDIFEND ENDINTERFACE ENDLOOP ENDMETHOD ENDMODULE ENDON ENDPROVIDE ENDSELECT ENDTRY ENDWHILE EVENT EVENTS EXEC EXIT EXPORT EXPORTING EXTRACT" + " ELSE ELSEIF ENDAT ENDCASE ENDCLASS ENDDO ENDEXEC ENDFORM ENDFUNCTION ENDIF ENDIFEND ENDINTERFACE ENDLOOP ENDMETHOD ENDMODULE ENDON ENDPROVIDE ENDSELECT ENDTRY ENDWHILE EVENT EVENTS EXEC EXIT EXPORT EXPORTING EXTRACT" +
@ -35,121 +38,108 @@ var AbapHighlightRules = function() {
" APPENDING CORRESPONDING FIELDS OF TABLE" + " APPENDING CORRESPONDING FIELDS OF TABLE" +
" LEFT RIGHT OUTER INNER JOIN AS CLIENT SPECIFIED BYPASSING BUFFER UP TO ROWS CONNECTING" + " LEFT RIGHT OUTER INNER JOIN AS CLIENT SPECIFIED BYPASSING BUFFER UP TO ROWS CONNECTING" +
" EQ NE LT LE GT GE NOT AND OR XOR IN LIKE BETWEEN", " EQ NE LT LE GT GE NOT AND OR XOR IN LIKE BETWEEN",
"constant.language": "constant.language": "TRUE FALSE NULL SPACE",
"TRUE FALSE NULL SPACE", "support.type": "c n i p f d t x string xstring decfloat16 decfloat34",
"support.type": "keyword.operator": "abs sign ceil floor trunc frac acos asin atan cos sin tan" +
"c n i p f d t x string xstring decfloat16 decfloat34",
"keyword.operator":
"abs sign ceil floor trunc frac acos asin atan cos sin tan" +
" abapOperator cosh sinh tanh exp log log10 sqrt" + " abapOperator cosh sinh tanh exp log log10 sqrt" +
" strlen xstrlen charlen numofchar dbmaxlen lines" " strlen xstrlen charlen numofchar dbmaxlen lines"
}, "text", true, " "); }, "text", true, " ");
var compoundKeywords = "WITH\\W+(?:HEADER\\W+LINE|FRAME|KEY)|NO\\W+STANDARD\\W+PAGE\\W+HEADING|" +
var compoundKeywords = "WITH\\W+(?:HEADER\\W+LINE|FRAME|KEY)|NO\\W+STANDARD\\W+PAGE\\W+HEADING|"+ "EXIT\\W+FROM\\W+STEP\\W+LOOP|BEGIN\\W+OF\\W+(?:BLOCK|LINE)|BEGIN\\W+OF|" +
"EXIT\\W+FROM\\W+STEP\\W+LOOP|BEGIN\\W+OF\\W+(?:BLOCK|LINE)|BEGIN\\W+OF|"+ "END\\W+OF\\W+(?:BLOCK|LINE)|END\\W+OF|NO\\W+INTERVALS|" +
"END\\W+OF\\W+(?:BLOCK|LINE)|END\\W+OF|NO\\W+INTERVALS|"+ "RESPECTING\\W+BLANKS|SEPARATED\\W+BY|USING\\W+(?:EDIT\\W+MASK)|" +
"RESPECTING\\W+BLANKS|SEPARATED\\W+BY|USING\\W+(?:EDIT\\W+MASK)|"+ "WHERE\\W+(?:LINE)|RADIOBUTTON\\W+GROUP|REF\\W+TO|" +
"WHERE\\W+(?:LINE)|RADIOBUTTON\\W+GROUP|REF\\W+TO|"+ "(?:PUBLIC|PRIVATE|PROTECTED)(?:\\W+SECTION)?|DELETING\\W+(?:TRAILING|LEADING)" +
"(?:PUBLIC|PRIVATE|PROTECTED)(?:\\W+SECTION)?|DELETING\\W+(?:TRAILING|LEADING)"+ "(?:ALL\\W+OCCURRENCES)|(?:FIRST|LAST)\\W+OCCURRENCE|INHERITING\\W+FROM|" +
"(?:ALL\\W+OCCURRENCES)|(?:FIRST|LAST)\\W+OCCURRENCE|INHERITING\\W+FROM|"+ "LINE-COUNT|ADD-CORRESPONDING|AUTHORITY-CHECK|BREAK-POINT|CLASS-DATA|CLASS-METHODS|" +
"LINE-COUNT|ADD-CORRESPONDING|AUTHORITY-CHECK|BREAK-POINT|CLASS-DATA|CLASS-METHODS|"+ "CLASS-METHOD|DIVIDE-CORRESPONDING|EDITOR-CALL|END-OF-DEFINITION|END-OF-PAGE|END-OF-SELECTION|" +
"CLASS-METHOD|DIVIDE-CORRESPONDING|EDITOR-CALL|END-OF-DEFINITION|END-OF-PAGE|END-OF-SELECTION|"+ "FIELD-GROUPS|FIELD-SYMBOLS|FUNCTION-POOL|MOVE-CORRESPONDING|MULTIPLY-CORRESPONDING|NEW-LINE|" +
"FIELD-GROUPS|FIELD-SYMBOLS|FUNCTION-POOL|MOVE-CORRESPONDING|MULTIPLY-CORRESPONDING|NEW-LINE|"+ "NEW-PAGE|NEW-SECTION|PRINT-CONTROL|RP-PROVIDE-FROM-LAST|SELECT-OPTIONS|SELECTION-SCREEN|" +
"NEW-PAGE|NEW-SECTION|PRINT-CONTROL|RP-PROVIDE-FROM-LAST|SELECT-OPTIONS|SELECTION-SCREEN|"+ "START-OF-SELECTION|SUBTRACT-CORRESPONDING|SYNTAX-CHECK|SYNTAX-TRACE|TOP-OF-PAGE|TYPE-POOL|" +
"START-OF-SELECTION|SUBTRACT-CORRESPONDING|SYNTAX-CHECK|SYNTAX-TRACE|TOP-OF-PAGE|TYPE-POOL|"+ "TYPE-POOLS|LINE-SIZE|LINE-COUNT|MESSAGE-ID|DISPLAY-MODE|READ(?:-ONLY)?|" +
"TYPE-POOLS|LINE-SIZE|LINE-COUNT|MESSAGE-ID|DISPLAY-MODE|READ(?:-ONLY)?|"+
"IS\\W+(?:NOT\\W+)?(?:ASSIGNED|BOUND|INITIAL|SUPPLIED)"; "IS\\W+(?:NOT\\W+)?(?:ASSIGNED|BOUND|INITIAL|SUPPLIED)";
this.$rules = { this.$rules = {
"start" : [ "start": [
{token : "string", regex : "`", next : "string"}, { token: "string", regex: "`", next: "string" },
{token : "string", regex : "'", next : "qstring"}, { token: "string", regex: "'", next: "qstring" },
{token : "doc.comment", regex : /^\*.+/}, { token: "doc.comment", regex: /^\*.+/ },
{token : "comment", regex : /".+$/}, { token: "comment", regex: /".+$/ },
{token : "invalid", regex: "\\.{2,}"}, { token: "invalid", regex: "\\.{2,}" },
{token : "keyword.operator", regex: /\W[\-+%=<>*]\W|\*\*|[~:,\.&$]|->*?|=>/}, { token: "keyword.operator", regex: /\W[\-+%=<>*]\W|\*\*|[~:,\.&$]|->*?|=>/ },
{token : "paren.lparen", regex : "[\\[({]"}, { token: "paren.lparen", regex: "[\\[({]" },
{token : "paren.rparen", regex : "[\\])}]"}, { token: "paren.rparen", regex: "[\\])}]" },
{token : "constant.numeric", regex: "[+-]?\\d+\\b"}, { token: "constant.numeric", regex: "[+-]?\\d+\\b" },
{token : "variable.parameter", regex : /sy|pa?\d\d\d\d\|t\d\d\d\.|innnn/}, { token: "variable.parameter", regex: /sy|pa?\d\d\d\d\|t\d\d\d\.|innnn/ },
{token : "keyword", regex : compoundKeywords}, { token: "keyword", regex: compoundKeywords },
{token : "variable.parameter", regex : /\w+-\w+(?:-\w+)*/}, { token: "variable.parameter", regex: /\w+-\w[\-\w]*/ },
{token : keywordMapper, regex : "\\b\\w+\\b"}, { token: keywordMapper, regex: "\\b\\w+\\b" },
{caseInsensitive: true} { caseInsensitive: true }
], ],
"qstring" : [ "qstring": [
{token : "constant.language.escape", regex : "''"}, { token: "constant.language.escape", regex: "''" },
{token : "string", regex : "'", next : "start"}, { token: "string", regex: "'", next: "start" },
{defaultToken : "string"} { defaultToken: "string" }
], ],
"string" : [ "string": [
{token : "constant.language.escape", regex : "``"}, { token: "constant.language.escape", regex: "``" },
{token : "string", regex : "`", next : "start"}, { token: "string", regex: "`", next: "start" },
{defaultToken : "string"} { defaultToken: "string" }
] ]
}; };
}; };
oop.inherits(AbapHighlightRules, TextHighlightRules); oop.inherits(AbapHighlightRules, TextHighlightRules);
exports.AbapHighlightRules = AbapHighlightRules; exports.AbapHighlightRules = AbapHighlightRules;
}); });
define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module) { define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../../lib/oop"); var oop = require("../../lib/oop");
var BaseFoldMode = require("./fold_mode").FoldMode; var BaseFoldMode = require("./fold_mode").FoldMode;
var Range = require("../../range").Range; var Range = require("../../range").Range;
var FoldMode = exports.FoldMode = function () { };
var FoldMode = exports.FoldMode = function() {};
oop.inherits(FoldMode, BaseFoldMode); oop.inherits(FoldMode, BaseFoldMode);
(function () {
(function() { this.commentBlock = function (session, row) {
this.getFoldWidgetRange = function(session, foldStyle, row) {
var range = this.indentationBlock(session, row);
if (range)
return range;
var re = /\S/; var re = /\S/;
var line = session.getLine(row); var line = session.getLine(row);
var startLevel = line.search(re); var startLevel = line.search(re);
if (startLevel == -1 || line[startLevel] != "#") if (startLevel == -1 || line[startLevel] != "#")
return; return;
var startColumn = line.length; var startColumn = line.length;
var maxRow = session.getLength(); var maxRow = session.getLength();
var startRow = row; var startRow = row;
var endRow = row; var endRow = row;
while (++row < maxRow) { while (++row < maxRow) {
line = session.getLine(row); line = session.getLine(row);
var level = line.search(re); var level = line.search(re);
if (level == -1) if (level == -1)
continue; continue;
if (line[level] != "#") if (line[level] != "#")
break; break;
endRow = row; endRow = row;
} }
if (endRow > startRow) { if (endRow > startRow) {
var endColumn = session.getLine(endRow).length; var endColumn = session.getLine(endRow).length;
return new Range(startRow, startColumn, endRow, endColumn); return new Range(startRow, startColumn, endRow, endColumn);
} }
}; };
this.getFoldWidget = function(session, foldStyle, row) { this.getFoldWidgetRange = function (session, foldStyle, row) {
var range = this.indentationBlock(session, row);
if (range)
return range;
range = this.commentBlock(session, row);
if (range)
return range;
};
this.getFoldWidget = function (session, foldStyle, row) {
var line = session.getLine(row); var line = session.getLine(row);
var indent = line.search(/\S/); var indent = line.search(/\S/);
var next = session.getLine(row + 1); var next = session.getLine(row + 1);
var prev = session.getLine(row - 1); var prev = session.getLine(row - 1);
var prevIndent = prev.search(/\S/); var prevIndent = prev.search(/\S/);
var nextIndent = next.search(/\S/); var nextIndent = next.search(/\S/);
if (indent == -1) { if (indent == -1) {
session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : ""; session.foldWidgets[row - 1] = prevIndent != -1 && prevIndent < nextIndent ? "start" : "";
return ""; return "";
} }
if (prevIndent == -1) { if (prevIndent == -1) {
@ -158,57 +148,53 @@ oop.inherits(FoldMode, BaseFoldMode);
session.foldWidgets[row + 1] = ""; session.foldWidgets[row + 1] = "";
return "start"; return "start";
} }
} else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") { }
else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") {
if (session.getLine(row - 2).search(/\S/) == -1) { if (session.getLine(row - 2).search(/\S/) == -1) {
session.foldWidgets[row - 1] = "start"; session.foldWidgets[row - 1] = "start";
session.foldWidgets[row + 1] = ""; session.foldWidgets[row + 1] = "";
return ""; return "";
} }
} }
if (prevIndent != -1 && prevIndent < indent)
if (prevIndent!= -1 && prevIndent < indent)
session.foldWidgets[row - 1] = "start"; session.foldWidgets[row - 1] = "start";
else else
session.foldWidgets[row - 1] = ""; session.foldWidgets[row - 1] = "";
if (indent < nextIndent) if (indent < nextIndent)
return "start"; return "start";
else else
return ""; return "";
}; };
}).call(FoldMode.prototype); }).call(FoldMode.prototype);
}); });
define("ace/mode/abap",["require","exports","module","ace/mode/abap_highlight_rules","ace/mode/folding/coffee","ace/range","ace/mode/text","ace/lib/oop"], function(require, exports, module) { define("ace/mode/abap",["require","exports","module","ace/mode/abap_highlight_rules","ace/mode/folding/coffee","ace/range","ace/mode/text","ace/lib/oop"], function(require, exports, module){"use strict";
"use strict";
var Rules = require("./abap_highlight_rules").AbapHighlightRules; var Rules = require("./abap_highlight_rules").AbapHighlightRules;
var FoldMode = require("./folding/coffee").FoldMode; var FoldMode = require("./folding/coffee").FoldMode;
var Range = require("../range").Range; var Range = require("../range").Range;
var TextMode = require("./text").Mode; var TextMode = require("./text").Mode;
var oop = require("../lib/oop"); var oop = require("../lib/oop");
function Mode() { function Mode() {
this.HighlightRules = Rules; this.HighlightRules = Rules;
this.foldingRules = new FoldMode(); this.foldingRules = new FoldMode();
} }
oop.inherits(Mode, TextMode); oop.inherits(Mode, TextMode);
(function () {
(function() {
this.lineCommentStart = '"'; this.lineCommentStart = '"';
this.getNextLineIndent = function (state, line, tab) {
this.getNextLineIndent = function(state, line, tab) {
var indent = this.$getIndent(line); var indent = this.$getIndent(line);
return indent; return indent;
}; };
this.$id = "ace/mode/abap"; this.$id = "ace/mode/abap";
}).call(Mode.prototype); }).call(Mode.prototype);
exports.Mode = Mode; exports.Mode = Mode;
}); }); (function() {
window.require(["ace/mode/abap"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

View File

@ -1,186 +1,160 @@
define("ace/mode/abc_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function (require, exports, module) { define("ace/mode/abc_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){/* This file was partially autogenerated from https://github.com/jimhawkridge/SublimeABC
"use strict";
var oop = require("../lib/oop"); Modifications
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var ABCHighlightRules = function () { - more classes to express the abc semantic
- added syntax highlighting for Zupfnoter conventions (https://github.com/bwl21/zupfnoter)
- separate note pitch and note duration - even if it looks the same
this.$rules = { ***********************************************************************************************/
start: [ "use strict";
{ var oop = require("../lib/oop");
token: ['zupfnoter.information.comment.line.percentage', 'information.keyword', 'in formation.keyword.embedded'], var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
regex: '(%%%%)(hn\\.[a-z]*)(.*)', var ABCHighlightRules = function () {
comment: 'Instruction Comment' this.$rules = {
}, start: [
{ {
token: ['information.comment.line.percentage', 'information.keyword.embedded'], token: ['zupfnoter.information.comment.line.percentage', 'information.keyword', 'in formation.keyword.embedded'],
regex: '(%%)(.*)', regex: '(%%%%)(hn\\.[a-z]*)(.*)',
comment: 'Instruction Comment' comment: 'Instruction Comment'
}, },
{
{ token: ['information.comment.line.percentage', 'information.keyword.embedded'],
token: 'comment.line.percentage', regex: '(%%)(.*)',
regex: '%.*', comment: 'Instruction Comment'
comment: 'Comments' },
}, {
token: 'comment.line.percentage',
{ regex: '%.*',
token: 'barline.keyword.operator', comment: 'Comments'
regex: '[\\[:]*[|:][|\\]:]*(?:\\[?[0-9]+)?|\\[[0-9]+', },
comment: 'Bar lines' {
}, token: 'barline.keyword.operator',
{ regex: '[\\[:]*[|:][|\\]:]*(?:\\[?[0-9]+)?|\\[[0-9]+',
token: ['information.keyword.embedded', 'information.argument.string.unquoted'], comment: 'Bar lines'
regex: '(\\[[A-Za-z]:)([^\\]]*\\])', },
comment: 'embedded Header lines' {
}, token: ['information.keyword.embedded', 'information.argument.string.unquoted'],
{ regex: '(\\[[A-Za-z]:)([^\\]]*\\])',
token: ['information.keyword', 'information.argument.string.unquoted'], comment: 'embedded Header lines'
regex: '^([A-Za-z]:)([^%\\\\]*)', },
comment: 'Header lines' {
}, token: ['information.keyword', 'information.argument.string.unquoted'],
{ regex: '^([A-Za-z]:)([^%\\\\]*)',
token: ['text', 'entity.name.function', 'string.unquoted', 'text'], comment: 'Header lines'
regex: '(\\[)([A-Z]:)(.*?)(\\])', },
comment: 'Inline fields' {
}, token: ['text', 'entity.name.function', 'string.unquoted', 'text'],
{ regex: '(\\[)([A-Z]:)(.*?)(\\])',
token: ['accent.constant.language', 'pitch.constant.numeric', 'duration.constant.numeric'], comment: 'Inline fields'
regex: '([\\^=_]*)([A-Ga-gz][,\']*)([0-9]*/*[><0-9]*)', },
comment: 'Notes' {
}, token: ['accent.constant.language', 'pitch.constant.numeric', 'duration.constant.numeric'],
{ regex: '([\\^=_]*)([A-Ga-gz][,\']*)([0-9]*/*[><0-9]*)',
token: 'zupfnoter.jumptarget.string.quoted', comment: 'Notes'
regex: '[\\"!]\\^\\:.*?[\\"!]', },
comment: 'Zupfnoter jumptarget' {
}, { token: 'zupfnoter.jumptarget.string.quoted',
token: 'zupfnoter.goto.string.quoted', regex: '[\\"!]\\^\\:.*?[\\"!]',
regex: '[\\"!]\\^\\@.*?[\\"!]', comment: 'Zupfnoter jumptarget'
comment: 'Zupfnoter goto' }, {
}, token: 'zupfnoter.goto.string.quoted',
{ regex: '[\\"!]\\^\\@.*?[\\"!]',
token: 'zupfnoter.annotation.string.quoted', comment: 'Zupfnoter goto'
regex: '[\\"!]\\^\\!.*?[\\"!]', },
comment: 'Zupfnoter annoation' {
}, token: 'zupfnoter.annotation.string.quoted',
{ regex: '[\\"!]\\^\\!.*?[\\"!]',
token: 'zupfnoter.annotationref.string.quoted', comment: 'Zupfnoter annoation'
regex: '[\\"!]\\^\\#.*?[\\"!]', },
comment: 'Zupfnoter annotation reference' {
}, token: 'zupfnoter.annotationref.string.quoted',
{ regex: '[\\"!]\\^\\#.*?[\\"!]',
token: 'chordname.string.quoted', comment: 'Zupfnoter annotation reference'
regex: '[\\"!]\\^.*?[\\"!]', },
comment: 'abc chord' {
}, token: 'chordname.string.quoted',
{ regex: '[\\"!]\\^.*?[\\"!]',
token: 'string.quoted', comment: 'abc chord'
regex: '[\\"!].*?[\\"!]', },
comment: 'abc annotation' {
} token: 'string.quoted',
regex: '[\\"!].*?[\\"!]',
] comment: 'abc annotation'
}; }
]
this.normalizeRules();
}; };
this.normalizeRules();
};
ABCHighlightRules.metaData = {
fileTypes: ['abc'],
name: 'ABC',
scopeName: 'text.abcnotation'
};
oop.inherits(ABCHighlightRules, TextHighlightRules);
exports.ABCHighlightRules = ABCHighlightRules;
ABCHighlightRules.metaData = {
fileTypes: ['abc'],
name: 'ABC',
scopeName: 'text.abcnotation'
};
oop.inherits(ABCHighlightRules, TextHighlightRules);
exports.ABCHighlightRules = ABCHighlightRules;
}); });
define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../../lib/oop"); var oop = require("../../lib/oop");
var Range = require("../../range").Range; var Range = require("../../range").Range;
var BaseFoldMode = require("./fold_mode").FoldMode; var BaseFoldMode = require("./fold_mode").FoldMode;
var FoldMode = exports.FoldMode = function (commentRegex) {
var FoldMode = exports.FoldMode = function(commentRegex) {
if (commentRegex) { if (commentRegex) {
this.foldingStartMarker = new RegExp( this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
);
this.foldingStopMarker = new RegExp(
this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
);
} }
}; };
oop.inherits(FoldMode, BaseFoldMode); oop.inherits(FoldMode, BaseFoldMode);
(function () {
(function() {
this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/; this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/; this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
this._getFoldWidgetBase = this.getFoldWidget; this._getFoldWidgetBase = this.getFoldWidget;
this.getFoldWidget = function(session, foldStyle, row) { this.getFoldWidget = function (session, foldStyle, row) {
var line = session.getLine(row); var line = session.getLine(row);
if (this.singleLineBlockCommentRe.test(line)) { if (this.singleLineBlockCommentRe.test(line)) {
if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
return ""; return "";
} }
var fw = this._getFoldWidgetBase(session, foldStyle, row); var fw = this._getFoldWidgetBase(session, foldStyle, row);
if (!fw && this.startRegionRe.test(line)) if (!fw && this.startRegionRe.test(line))
return "start"; // lineCommentRegionStart return "start"; // lineCommentRegionStart
return fw; return fw;
}; };
this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
var line = session.getLine(row); var line = session.getLine(row);
if (this.startRegionRe.test(line)) if (this.startRegionRe.test(line))
return this.getCommentRegionBlock(session, line, row); return this.getCommentRegionBlock(session, line, row);
var match = line.match(this.foldingStartMarker); var match = line.match(this.foldingStartMarker);
if (match) { if (match) {
var i = match.index; var i = match.index;
if (match[1]) if (match[1])
return this.openingBracketBlock(session, match[1], row, i); return this.openingBracketBlock(session, match[1], row, i);
var range = session.getCommentFoldRange(row, i + match[0].length, 1); var range = session.getCommentFoldRange(row, i + match[0].length, 1);
if (range && !range.isMultiLine()) { if (range && !range.isMultiLine()) {
if (forceMultiline) { if (forceMultiline) {
range = this.getSectionRange(session, row); range = this.getSectionRange(session, row);
} else if (foldStyle != "all") }
else if (foldStyle != "all")
range = null; range = null;
} }
return range; return range;
} }
if (foldStyle === "markbegin") if (foldStyle === "markbegin")
return; return;
var match = line.match(this.foldingStopMarker); var match = line.match(this.foldingStopMarker);
if (match) { if (match) {
var i = match.index + match[0].length; var i = match.index + match[0].length;
if (match[1]) if (match[1])
return this.closingBracketBlock(session, match[1], row, i); return this.closingBracketBlock(session, match[1], row, i);
return session.getCommentFoldRange(row, i, -1); return session.getCommentFoldRange(row, i, -1);
} }
}; };
this.getSectionRange = function (session, row) {
this.getSectionRange = function(session, row) {
var line = session.getLine(row); var line = session.getLine(row);
var startIndent = line.search(/\S/); var startIndent = line.search(/\S/);
var startRow = row; var startRow = row;
@ -193,69 +167,77 @@ oop.inherits(FoldMode, BaseFoldMode);
var indent = line.search(/\S/); var indent = line.search(/\S/);
if (indent === -1) if (indent === -1)
continue; continue;
if (startIndent > indent) if (startIndent > indent)
break; break;
var subRange = this.getFoldWidgetRange(session, "all", row); var subRange = this.getFoldWidgetRange(session, "all", row);
if (subRange) { if (subRange) {
if (subRange.start.row <= startRow) { if (subRange.start.row <= startRow) {
break; break;
} else if (subRange.isMultiLine()) { }
else if (subRange.isMultiLine()) {
row = subRange.end.row; row = subRange.end.row;
} else if (startIndent == indent) { }
else if (startIndent == indent) {
break; break;
} }
} }
endRow = row; endRow = row;
} }
return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
}; };
this.getCommentRegionBlock = function(session, line, row) { this.getCommentRegionBlock = function (session, line, row) {
var startColumn = line.search(/\s*$/); var startColumn = line.search(/\s*$/);
var maxRow = session.getLength(); var maxRow = session.getLength();
var startRow = row; var startRow = row;
var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
var depth = 1; var depth = 1;
while (++row < maxRow) { while (++row < maxRow) {
line = session.getLine(row); line = session.getLine(row);
var m = re.exec(line); var m = re.exec(line);
if (!m) continue; if (!m)
if (m[1]) depth--; continue;
else depth++; if (m[1])
depth--;
if (!depth) break; else
depth++;
if (!depth)
break;
} }
var endRow = row; var endRow = row;
if (endRow > startRow) { if (endRow > startRow) {
return new Range(startRow, startColumn, endRow, line.length); return new Range(startRow, startColumn, endRow, line.length);
} }
}; };
}).call(FoldMode.prototype); }).call(FoldMode.prototype);
}); });
define("ace/mode/abc",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/abc_highlight_rules","ace/mode/folding/cstyle"], function (require, exports, module) { define("ace/mode/abc",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/abc_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module){/*
"use strict"; THIS FILE WAS AUTOGENERATED BY mode.tmpl.js
*/
"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var ABCHighlightRules = require("./abc_highlight_rules").ABCHighlightRules;
var FoldMode = require("./folding/cstyle").FoldMode;
var Mode = function () {
this.HighlightRules = ABCHighlightRules;
this.foldingRules = new FoldMode();
this.$behaviour = this.$defaultBehaviour;
};
oop.inherits(Mode, TextMode);
(function () {
this.lineCommentStart = "%";
this.$id = "ace/mode/abc";
this.snippetFileId = "ace/snippets/abc";
}).call(Mode.prototype);
exports.Mode = Mode;
var oop = require("../lib/oop"); }); (function() {
var TextMode = require("./text").Mode; window.require(["ace/mode/abc"], function(m) {
var ABCHighlightRules = require("./abc_highlight_rules").ABCHighlightRules; if (typeof module == "object" && typeof exports == "object" && module) {
var FoldMode = require("./folding/cstyle").FoldMode; module.exports = m;
}
});
})();
var Mode = function () {
this.HighlightRules = ABCHighlightRules;
this.foldingRules = new FoldMode();
this.$behaviour = this.$defaultBehaviour;
};
oop.inherits(Mode, TextMode);
(function () {
this.$id = "ace/mode/abc";
}).call(Mode.prototype);
exports.Mode = Mode;
});

File diff suppressed because one or more lines are too long

View File

@ -1,87 +1,108 @@
define("ace/mode/ada_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { define("ace/mode/ada_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var AdaHighlightRules = function () {
var AdaHighlightRules = function() { var keywords = "abort|else|new|return|abs|elsif|not|reverse|abstract|end|null|accept|entry|select|" +
var keywords = "abort|else|new|return|abs|elsif|not|reverse|abstract|end|null|accept|entry|select|" + "access|exception|of|separate|aliased|exit|or|some|all|others|subtype|and|for|out|synchronized|" +
"access|exception|of|separate|aliased|exit|or|some|all|others|subtype|and|for|out|synchronized|" + "array|function|overriding|at|tagged|generic|package|task|begin|goto|pragma|terminate|" +
"array|function|overriding|at|tagged|generic|package|task|begin|goto|pragma|terminate|" + "body|private|then|if|procedure|type|case|in|protected|constant|interface|until|" +
"body|private|then|if|procedure|type|case|in|protected|constant|interface|until|" + "|is|raise|use|declare|range|delay|limited|record|when|delta|loop|rem|while|digits|renames|with|do|mod|requeue|xor";
"|is|raise|use|declare|range|delay|limited|record|when|delta|loop|rem|while|digits|renames|with|do|mod|requeue|xor"; var builtinConstants = ("true|false|null");
var builtinFunctions = ("count|min|max|avg|sum|rank|now|coalesce|main");
var builtinConstants = (
"true|false|null"
);
var builtinFunctions = (
"count|min|max|avg|sum|rank|now|coalesce|main"
);
var keywordMapper = this.createKeywordMapper({ var keywordMapper = this.createKeywordMapper({
"support.function": builtinFunctions, "support.function": builtinFunctions,
"keyword": keywords, "keyword": keywords,
"constant.language": builtinConstants "constant.language": builtinConstants
}, "identifier", true); }, "identifier", true);
this.$rules = { this.$rules = {
"start" : [ { "start": [{
token : "comment", token: "comment",
regex : "--.*$" regex: "--.*$"
}, { }, {
token : "string", // " string token: "string", // " string
regex : '".*?"' regex: '".*?"'
}, { }, {
token : "string", // ' string token: "string", // character
regex : "'.*?'" regex: "'.'"
}, { }, {
token : "constant.numeric", // float token: "constant.numeric", // float
regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
}, { }, {
token : keywordMapper, token: keywordMapper,
regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
}, { }, {
token : "keyword.operator", token: "keyword.operator",
regex : "\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|=" regex: "\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|="
}, { }, {
token : "paren.lparen", token: "paren.lparen",
regex : "[\\(]" regex: "[\\(]"
}, { }, {
token : "paren.rparen", token: "paren.rparen",
regex : "[\\)]" regex: "[\\)]"
}, { }, {
token : "text", token: "text",
regex : "\\s+" regex: "\\s+"
} ] }]
}; };
}; };
oop.inherits(AdaHighlightRules, TextHighlightRules); oop.inherits(AdaHighlightRules, TextHighlightRules);
exports.AdaHighlightRules = AdaHighlightRules; exports.AdaHighlightRules = AdaHighlightRules;
}); });
define("ace/mode/ada",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/ada_highlight_rules"], function(require, exports, module) { define("ace/mode/ada",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/ada_highlight_rules","ace/range"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextMode = require("./text").Mode; var TextMode = require("./text").Mode;
var AdaHighlightRules = require("./ada_highlight_rules").AdaHighlightRules; var AdaHighlightRules = require("./ada_highlight_rules").AdaHighlightRules;
var Range = require("../range").Range;
var Mode = function() { var Mode = function () {
this.HighlightRules = AdaHighlightRules; this.HighlightRules = AdaHighlightRules;
this.$behaviour = this.$defaultBehaviour; this.$behaviour = this.$defaultBehaviour;
}; };
oop.inherits(Mode, TextMode); oop.inherits(Mode, TextMode);
(function () {
(function() {
this.lineCommentStart = "--"; this.lineCommentStart = "--";
this.getNextLineIndent = function (state, line, tab) {
var indent = this.$getIndent(line);
var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
var tokens = tokenizedLine.tokens;
if (tokens.length && tokens[tokens.length - 1].type == "comment") {
return indent;
}
if (state == "start") {
var match = line.match(/^.*(begin|loop|then|is|do)\s*$/);
if (match) {
indent += tab;
}
}
return indent;
};
this.checkOutdent = function (state, line, input) {
var complete_line = line + input;
if (complete_line.match(/^\s*(begin|end)$/)) {
return true;
}
return false;
};
this.autoOutdent = function (state, session, row) {
var line = session.getLine(row);
var prevLine = session.getLine(row - 1);
var prevIndent = this.$getIndent(prevLine).length;
var indent = this.$getIndent(line).length;
if (indent <= prevIndent) {
return;
}
session.outdentRows(new Range(row, 0, row + 2, 0));
};
this.$id = "ace/mode/ada"; this.$id = "ace/mode/ada";
}).call(Mode.prototype); }).call(Mode.prototype);
exports.Mode = Mode; exports.Mode = Mode;
}); }); (function() {
window.require(["ace/mode/ada"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

View File

@ -0,0 +1,279 @@
define("ace/mode/alda_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){/* This file was autogenerated from ../../src/alda.JSON-tmLanguage (uuid: ) */
"use strict";
var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var AldaHighlightRules = function () {
this.$rules = {
pitch: [{
token: "variable.parameter.operator.pitch.alda",
regex: /(?:[+\-]+|\=)/
}, {
token: "",
regex: "",
next: "timing"
}],
timing: [{
token: "string.quoted.operator.timing.alda",
regex: /\d+(?:s|ms)?/
}, {
token: "",
regex: "",
next: "start"
}],
start: [{
token: [
"constant.language.instrument.alda",
"constant.language.instrument.alda",
"meta.part.call.alda",
"storage.type.nickname.alda",
"meta.part.call.alda"
],
regex: /^([a-zA-Z]{2}[\w\-+\'()]*)((?:\s*\/\s*[a-zA-Z]{2}[\w\-+\'()]*)*)(?:(\s*)(\"[a-zA-Z]{2}[\w\-+\'()]*\"))?(\s*:)/
}, {
token: [
"text",
"entity.other.inherited-class.voice.alda",
"text"
],
regex: /^(\s*)(V\d+)(:)/
}, {
token: "comment.line.number-sign.alda",
regex: /#.*$/
}, {
token: "entity.name.function.pipe.measure.alda",
regex: /\|/
}, {
token: "comment.block.inline.alda",
regex: /\(comment\b/,
push: [{
token: "comment.block.inline.alda",
regex: /\)/,
next: "pop"
}, {
defaultToken: "comment.block.inline.alda"
}]
}, {
token: "entity.name.function.marker.alda",
regex: /%[a-zA-Z]{2}[\w\-+\'()]*/
}, {
token: "entity.name.function.at-marker.alda",
regex: /@[a-zA-Z]{2}[\w\-+\'()]*/
}, {
token: "keyword.operator.octave-change.alda",
regex: /\bo\d+\b/
}, {
token: "keyword.operator.octave-shift.alda",
regex: /[><]/
}, {
token: "keyword.operator.repeat.alda",
regex: /\*\s*\d+/
}, {
token: "string.quoted.operator.timing.alda",
regex: /[.]|r\d*(?:s|ms)?/
}, {
token: "text",
regex: /([cdefgab])/,
next: "pitch"
}, {
token: "string.quoted.operator.timing.alda",
regex: /~/,
next: "timing"
}, {
token: "punctuation.section.embedded.cram.alda",
regex: /\}/,
next: "timing"
}, {
token: "constant.numeric.subchord.alda",
regex: /\//
}, {
todo: {
token: "punctuation.section.embedded.cram.alda",
regex: /\{/,
push: [{
token: "punctuation.section.embedded.cram.alda",
regex: /\}/,
next: "pop"
}, {
include: "$self"
}]
}
}, {
todo: {
token: "keyword.control.sequence.alda",
regex: /\[/,
push: [{
token: "keyword.control.sequence.alda",
regex: /\]/,
next: "pop"
}, {
include: "$self"
}]
}
}, {
token: "meta.inline.clojure.alda",
regex: /\(/,
push: [{
token: "meta.inline.clojure.alda",
regex: /\)/,
next: "pop"
}, {
include: "source.clojure"
}, {
defaultToken: "meta.inline.clojure.alda"
}]
}]
};
this.normalizeRules();
};
AldaHighlightRules.metaData = {
scopeName: "source.alda",
fileTypes: ["alda"],
name: "Alda"
};
oop.inherits(AldaHighlightRules, TextHighlightRules);
exports.AldaHighlightRules = AldaHighlightRules;
});
define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var Range = require("../../range").Range;
var BaseFoldMode = require("./fold_mode").FoldMode;
var FoldMode = exports.FoldMode = function (commentRegex) {
if (commentRegex) {
this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
}
};
oop.inherits(FoldMode, BaseFoldMode);
(function () {
this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
this._getFoldWidgetBase = this.getFoldWidget;
this.getFoldWidget = function (session, foldStyle, row) {
var line = session.getLine(row);
if (this.singleLineBlockCommentRe.test(line)) {
if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
return "";
}
var fw = this._getFoldWidgetBase(session, foldStyle, row);
if (!fw && this.startRegionRe.test(line))
return "start"; // lineCommentRegionStart
return fw;
};
this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
var line = session.getLine(row);
if (this.startRegionRe.test(line))
return this.getCommentRegionBlock(session, line, row);
var match = line.match(this.foldingStartMarker);
if (match) {
var i = match.index;
if (match[1])
return this.openingBracketBlock(session, match[1], row, i);
var range = session.getCommentFoldRange(row, i + match[0].length, 1);
if (range && !range.isMultiLine()) {
if (forceMultiline) {
range = this.getSectionRange(session, row);
}
else if (foldStyle != "all")
range = null;
}
return range;
}
if (foldStyle === "markbegin")
return;
var match = line.match(this.foldingStopMarker);
if (match) {
var i = match.index + match[0].length;
if (match[1])
return this.closingBracketBlock(session, match[1], row, i);
return session.getCommentFoldRange(row, i, -1);
}
};
this.getSectionRange = function (session, row) {
var line = session.getLine(row);
var startIndent = line.search(/\S/);
var startRow = row;
var startColumn = line.length;
row = row + 1;
var endRow = row;
var maxRow = session.getLength();
while (++row < maxRow) {
line = session.getLine(row);
var indent = line.search(/\S/);
if (indent === -1)
continue;
if (startIndent > indent)
break;
var subRange = this.getFoldWidgetRange(session, "all", row);
if (subRange) {
if (subRange.start.row <= startRow) {
break;
}
else if (subRange.isMultiLine()) {
row = subRange.end.row;
}
else if (startIndent == indent) {
break;
}
}
endRow = row;
}
return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
};
this.getCommentRegionBlock = function (session, line, row) {
var startColumn = line.search(/\s*$/);
var maxRow = session.getLength();
var startRow = row;
var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
var depth = 1;
while (++row < maxRow) {
line = session.getLine(row);
var m = re.exec(line);
if (!m)
continue;
if (m[1])
depth--;
else
depth++;
if (!depth)
break;
}
var endRow = row;
if (endRow > startRow) {
return new Range(startRow, startColumn, endRow, line.length);
}
};
}).call(FoldMode.prototype);
});
define("ace/mode/alda",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/alda_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module){/*
THIS FILE WAS AUTOGENERATED BY mode.tmpl.js
*/
"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var AldaHighlightRules = require("./alda_highlight_rules").AldaHighlightRules;
var FoldMode = require("./folding/cstyle").FoldMode;
var Mode = function () {
this.HighlightRules = AldaHighlightRules;
this.foldingRules = new FoldMode();
};
oop.inherits(Mode, TextMode);
(function () {
this.$id = "ace/mode/alda";
}).call(Mode.prototype);
exports.Mode = Mode;
}); (function() {
window.require(["ace/mode/alda"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

View File

@ -1,280 +1,236 @@
define("ace/mode/apache_conf_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { define("ace/mode/apache_conf_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){/* This file was autogenerated from https://raw.github.com/colinta/ApacheConf.tmLanguage/master/ApacheConf.tmLanguage (uuid: ) */
"use strict"; "use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var ApacheConfHighlightRules = function () {
var ApacheConfHighlightRules = function() { this.$rules = { start: [{ token: ['punctuation.definition.comment.apacheconf',
'comment.line.hash.ini',
this.$rules = { start: 'comment.line.hash.ini'],
[ { token: regex: '^((?:\\s)*)(#)(.*$)' },
[ 'punctuation.definition.comment.apacheconf', { token: ['punctuation.definition.tag.apacheconf',
'comment.line.hash.ini', 'entity.tag.apacheconf',
'comment.line.hash.ini' ], 'text',
regex: '^((?:\\s)*)(#)(.*$)' }, 'string.value.apacheconf',
{ token: 'punctuation.definition.tag.apacheconf'],
[ 'punctuation.definition.tag.apacheconf', regex: '(<)(Proxy|ProxyMatch|IfVersion|Directory|DirectoryMatch|Files|FilesMatch|IfDefine|IfModule|Limit|LimitExcept|Location|LocationMatch|VirtualHost)(?:(\\s)(.+?))?(>)' },
'entity.tag.apacheconf', { token: ['punctuation.definition.tag.apacheconf',
'text', 'entity.tag.apacheconf',
'string.value.apacheconf', 'punctuation.definition.tag.apacheconf'],
'punctuation.definition.tag.apacheconf' ], regex: '(</)(Proxy|ProxyMatch|IfVersion|Directory|DirectoryMatch|Files|FilesMatch|IfDefine|IfModule|Limit|LimitExcept|Location|LocationMatch|VirtualHost)(>)' },
regex: '(<)(Proxy|ProxyMatch|IfVersion|Directory|DirectoryMatch|Files|FilesMatch|IfDefine|IfModule|Limit|LimitExcept|Location|LocationMatch|VirtualHost)(?:(\\s)(.+?))?(>)' }, { token: ['keyword.alias.apacheconf', 'text',
{ token: 'string.regexp.apacheconf', 'text',
[ 'punctuation.definition.tag.apacheconf', 'string.replacement.apacheconf', 'text'],
'entity.tag.apacheconf', regex: '(Rewrite(?:Rule|Cond))(\\s+)(.+?)(\\s+)(.+?)($|\\s)' },
'punctuation.definition.tag.apacheconf' ], { token: ['keyword.alias.apacheconf', 'text',
regex: '(</)(Proxy|ProxyMatch|IfVersion|Directory|DirectoryMatch|Files|FilesMatch|IfDefine|IfModule|Limit|LimitExcept|Location|LocationMatch|VirtualHost)(>)' }, 'entity.status.apacheconf', 'text',
{ token: 'string.regexp.apacheconf', 'text',
[ 'keyword.alias.apacheconf', 'text', 'string.path.apacheconf', 'text'],
'string.regexp.apacheconf', 'text', regex: '(RedirectMatch)(?:(\\s+)(\\d\\d\\d|permanent|temp|seeother|gone))?(\\s+)(.+?)(\\s+)(?:(.+?)($|\\s))?' },
'string.replacement.apacheconf', 'text' ], { token: ['keyword.alias.apacheconf', 'text',
regex: '(Rewrite(?:Rule|Cond))(\\s+)(.+?)(\\s+)(.+?)($|\\s)' }, 'entity.status.apacheconf', 'text',
{ token: 'string.path.apacheconf', 'text',
[ 'keyword.alias.apacheconf', 'text', 'string.path.apacheconf', 'text'],
'entity.status.apacheconf', 'text', regex: '(Redirect)(?:(\\s+)(\\d\\d\\d|permanent|temp|seeother|gone))?(\\s+)(.+?)(\\s+)(?:(.+?)($|\\s))?' },
'string.regexp.apacheconf', 'text', { token: ['keyword.alias.apacheconf', 'text',
'string.path.apacheconf', 'text' ], 'string.regexp.apacheconf', 'text',
regex: '(RedirectMatch)(?:(\\s+)(\\d\\d\\d|permanent|temp|seeother|gone))?(\\s+)(.+?)(\\s+)(?:(.+?)($|\\s))?' }, 'string.path.apacheconf', 'text'],
{ token: regex: '(ScriptAliasMatch|AliasMatch)(\\s+)(.+?)(\\s+)(?:(.+?)(\\s))?' },
[ 'keyword.alias.apacheconf', 'text', { token: ['keyword.alias.apacheconf', 'text',
'entity.status.apacheconf', 'text', 'string.path.apacheconf', 'text',
'string.path.apacheconf', 'text', 'string.path.apacheconf', 'text'],
'string.path.apacheconf', 'text' ], regex: '(RedirectPermanent|RedirectTemp|ScriptAlias|Alias)(\\s+)(.+?)(\\s+)(?:(.+?)($|\\s))?' },
regex: '(Redirect)(?:(\\s+)(\\d\\d\\d|permanent|temp|seeother|gone))?(\\s+)(.+?)(\\s+)(?:(.+?)($|\\s))?' }, { token: 'keyword.core.apacheconf',
{ token: regex: '\\b(?:AcceptPathInfo|AccessFileName|AddDefaultCharset|AddOutputFilterByType|AllowEncodedSlashes|AllowOverride|AuthName|AuthType|CGIMapExtension|ContentDigest|DefaultType|DocumentRoot|EnableMMAP|EnableSendfile|ErrorDocument|ErrorLog|FileETag|ForceType|HostnameLookups|IdentityCheck|Include|KeepAlive|KeepAliveTimeout|LimitInternalRecursion|LimitRequestBody|LimitRequestFields|LimitRequestFieldSize|LimitRequestLine|LimitXMLRequestBody|LogLevel|MaxKeepAliveRequests|NameVirtualHost|Options|Require|RLimitCPU|RLimitMEM|RLimitNPROC|Satisfy|ScriptInterpreterSource|ServerAdmin|ServerAlias|ServerName|ServerPath|ServerRoot|ServerSignature|ServerTokens|SetHandler|SetInputFilter|SetOutputFilter|TimeOut|TraceEnable|UseCanonicalName)\\b' },
[ 'keyword.alias.apacheconf', 'text', { token: 'keyword.mpm.apacheconf',
'string.regexp.apacheconf', 'text', regex: '\\b(?:AcceptMutex|AssignUserID|BS2000Account|ChildPerUserID|CoreDumpDirectory|EnableExceptionHook|Group|Listen|ListenBacklog|LockFile|MaxClients|MaxMemFree|MaxRequestsPerChild|MaxRequestsPerThread|MaxSpareServers|MaxSpareThreads|MaxThreads|MaxThreadsPerChild|MinSpareServers|MinSpareThreads|NumServers|PidFile|ReceiveBufferSize|ScoreBoardFile|SendBufferSize|ServerLimit|StartServers|StartThreads|ThreadLimit|ThreadsPerChild|ThreadStackSize|User|Win32DisableAcceptEx)\\b' },
'string.path.apacheconf', 'text' ], { token: 'keyword.access.apacheconf',
regex: '(ScriptAliasMatch|AliasMatch)(\\s+)(.+?)(\\s+)(?:(.+?)(\\s))?' }, regex: '\\b(?:Allow|Deny|Order)\\b' },
{ token: { token: 'keyword.actions.apacheconf',
[ 'keyword.alias.apacheconf', 'text', regex: '\\b(?:Action|Script)\\b' },
'string.path.apacheconf', 'text', { token: 'keyword.alias.apacheconf',
'string.path.apacheconf', 'text' ], regex: '\\b(?:Alias|AliasMatch|Redirect|RedirectMatch|RedirectPermanent|RedirectTemp|ScriptAlias|ScriptAliasMatch)\\b' },
regex: '(RedirectPermanent|RedirectTemp|ScriptAlias|Alias)(\\s+)(.+?)(\\s+)(?:(.+?)($|\\s))?' }, { token: 'keyword.auth.apacheconf',
{ token: 'keyword.core.apacheconf', regex: '\\b(?:AuthAuthoritative|AuthGroupFile|AuthUserFile)\\b' },
regex: '\\b(?:AcceptPathInfo|AccessFileName|AddDefaultCharset|AddOutputFilterByType|AllowEncodedSlashes|AllowOverride|AuthName|AuthType|CGIMapExtension|ContentDigest|DefaultType|DocumentRoot|EnableMMAP|EnableSendfile|ErrorDocument|ErrorLog|FileETag|ForceType|HostnameLookups|IdentityCheck|Include|KeepAlive|KeepAliveTimeout|LimitInternalRecursion|LimitRequestBody|LimitRequestFields|LimitRequestFieldSize|LimitRequestLine|LimitXMLRequestBody|LogLevel|MaxKeepAliveRequests|NameVirtualHost|Options|Require|RLimitCPU|RLimitMEM|RLimitNPROC|Satisfy|ScriptInterpreterSource|ServerAdmin|ServerAlias|ServerName|ServerPath|ServerRoot|ServerSignature|ServerTokens|SetHandler|SetInputFilter|SetOutputFilter|TimeOut|TraceEnable|UseCanonicalName)\\b' }, { token: 'keyword.auth_anon.apacheconf',
{ token: 'keyword.mpm.apacheconf', regex: '\\b(?:Anonymous|Anonymous_Authoritative|Anonymous_LogEmail|Anonymous_MustGiveEmail|Anonymous_NoUserID|Anonymous_VerifyEmail)\\b' },
regex: '\\b(?:AcceptMutex|AssignUserID|BS2000Account|ChildPerUserID|CoreDumpDirectory|EnableExceptionHook|Group|Listen|ListenBacklog|LockFile|MaxClients|MaxMemFree|MaxRequestsPerChild|MaxRequestsPerThread|MaxSpareServers|MaxSpareThreads|MaxThreads|MaxThreadsPerChild|MinSpareServers|MinSpareThreads|NumServers|PidFile|ReceiveBufferSize|ScoreBoardFile|SendBufferSize|ServerLimit|StartServers|StartThreads|ThreadLimit|ThreadsPerChild|ThreadStackSize|User|Win32DisableAcceptEx)\\b' }, { token: 'keyword.auth_dbm.apacheconf',
{ token: 'keyword.access.apacheconf', regex: '\\b(?:AuthDBMAuthoritative|AuthDBMGroupFile|AuthDBMType|AuthDBMUserFile)\\b' },
regex: '\\b(?:Allow|Deny|Order)\\b' }, { token: 'keyword.auth_digest.apacheconf',
{ token: 'keyword.actions.apacheconf', regex: '\\b(?:AuthDigestAlgorithm|AuthDigestDomain|AuthDigestFile|AuthDigestGroupFile|AuthDigestNcCheck|AuthDigestNonceFormat|AuthDigestNonceLifetime|AuthDigestQop|AuthDigestShmemSize)\\b' },
regex: '\\b(?:Action|Script)\\b' }, { token: 'keyword.auth_ldap.apacheconf',
{ token: 'keyword.alias.apacheconf', regex: '\\b(?:AuthLDAPAuthoritative|AuthLDAPBindDN|AuthLDAPBindPassword|AuthLDAPCharsetConfig|AuthLDAPCompareDNOnServer|AuthLDAPDereferenceAliases|AuthLDAPEnabled|AuthLDAPFrontPageHack|AuthLDAPGroupAttribute|AuthLDAPGroupAttributeIsDN|AuthLDAPRemoteUserIsDN|AuthLDAPUrl)\\b' },
regex: '\\b(?:Alias|AliasMatch|Redirect|RedirectMatch|RedirectPermanent|RedirectTemp|ScriptAlias|ScriptAliasMatch)\\b' }, { token: 'keyword.autoindex.apacheconf',
{ token: 'keyword.auth.apacheconf', regex: '\\b(?:AddAlt|AddAltByEncoding|AddAltByType|AddDescription|AddIcon|AddIconByEncoding|AddIconByType|DefaultIcon|HeaderName|IndexIgnore|IndexOptions|IndexOrderDefault|ReadmeName)\\b' },
regex: '\\b(?:AuthAuthoritative|AuthGroupFile|AuthUserFile)\\b' }, { token: 'keyword.cache.apacheconf',
{ token: 'keyword.auth_anon.apacheconf', regex: '\\b(?:CacheDefaultExpire|CacheDisable|CacheEnable|CacheForceCompletion|CacheIgnoreCacheControl|CacheIgnoreHeaders|CacheIgnoreNoLastMod|CacheLastModifiedFactor|CacheMaxExpire)\\b' },
regex: '\\b(?:Anonymous|Anonymous_Authoritative|Anonymous_LogEmail|Anonymous_MustGiveEmail|Anonymous_NoUserID|Anonymous_VerifyEmail)\\b' }, { token: 'keyword.cern_meta.apacheconf',
{ token: 'keyword.auth_dbm.apacheconf', regex: '\\b(?:MetaDir|MetaFiles|MetaSuffix)\\b' },
regex: '\\b(?:AuthDBMAuthoritative|AuthDBMGroupFile|AuthDBMType|AuthDBMUserFile)\\b' }, { token: 'keyword.cgi.apacheconf',
{ token: 'keyword.auth_digest.apacheconf', regex: '\\b(?:ScriptLog|ScriptLogBuffer|ScriptLogLength)\\b' },
regex: '\\b(?:AuthDigestAlgorithm|AuthDigestDomain|AuthDigestFile|AuthDigestGroupFile|AuthDigestNcCheck|AuthDigestNonceFormat|AuthDigestNonceLifetime|AuthDigestQop|AuthDigestShmemSize)\\b' }, { token: 'keyword.cgid.apacheconf',
{ token: 'keyword.auth_ldap.apacheconf', regex: '\\b(?:ScriptLog|ScriptLogBuffer|ScriptLogLength|ScriptSock)\\b' },
regex: '\\b(?:AuthLDAPAuthoritative|AuthLDAPBindDN|AuthLDAPBindPassword|AuthLDAPCharsetConfig|AuthLDAPCompareDNOnServer|AuthLDAPDereferenceAliases|AuthLDAPEnabled|AuthLDAPFrontPageHack|AuthLDAPGroupAttribute|AuthLDAPGroupAttributeIsDN|AuthLDAPRemoteUserIsDN|AuthLDAPUrl)\\b' }, { token: 'keyword.charset_lite.apacheconf',
{ token: 'keyword.autoindex.apacheconf', regex: '\\b(?:CharsetDefault|CharsetOptions|CharsetSourceEnc)\\b' },
regex: '\\b(?:AddAlt|AddAltByEncoding|AddAltByType|AddDescription|AddIcon|AddIconByEncoding|AddIconByType|DefaultIcon|HeaderName|IndexIgnore|IndexOptions|IndexOrderDefault|ReadmeName)\\b' }, { token: 'keyword.dav.apacheconf',
{ token: 'keyword.cache.apacheconf', regex: '\\b(?:Dav|DavDepthInfinity|DavMinTimeout|DavLockDB)\\b' },
regex: '\\b(?:CacheDefaultExpire|CacheDisable|CacheEnable|CacheForceCompletion|CacheIgnoreCacheControl|CacheIgnoreHeaders|CacheIgnoreNoLastMod|CacheLastModifiedFactor|CacheMaxExpire)\\b' }, { token: 'keyword.deflate.apacheconf',
{ token: 'keyword.cern_meta.apacheconf', regex: '\\b(?:DeflateBufferSize|DeflateCompressionLevel|DeflateFilterNote|DeflateMemLevel|DeflateWindowSize)\\b' },
regex: '\\b(?:MetaDir|MetaFiles|MetaSuffix)\\b' }, { token: 'keyword.dir.apacheconf',
{ token: 'keyword.cgi.apacheconf', regex: '\\b(?:DirectoryIndex|DirectorySlash)\\b' },
regex: '\\b(?:ScriptLog|ScriptLogBuffer|ScriptLogLength)\\b' }, { token: 'keyword.disk_cache.apacheconf',
{ token: 'keyword.cgid.apacheconf', regex: '\\b(?:CacheDirLength|CacheDirLevels|CacheExpiryCheck|CacheGcClean|CacheGcDaily|CacheGcInterval|CacheGcMemUsage|CacheGcUnused|CacheMaxFileSize|CacheMinFileSize|CacheRoot|CacheSize|CacheTimeMargin)\\b' },
regex: '\\b(?:ScriptLog|ScriptLogBuffer|ScriptLogLength|ScriptSock)\\b' }, { token: 'keyword.dumpio.apacheconf',
{ token: 'keyword.charset_lite.apacheconf', regex: '\\b(?:DumpIOInput|DumpIOOutput)\\b' },
regex: '\\b(?:CharsetDefault|CharsetOptions|CharsetSourceEnc)\\b' }, { token: 'keyword.env.apacheconf',
{ token: 'keyword.dav.apacheconf', regex: '\\b(?:PassEnv|SetEnv|UnsetEnv)\\b' },
regex: '\\b(?:Dav|DavDepthInfinity|DavMinTimeout|DavLockDB)\\b' }, { token: 'keyword.expires.apacheconf',
{ token: 'keyword.deflate.apacheconf', regex: '\\b(?:ExpiresActive|ExpiresByType|ExpiresDefault)\\b' },
regex: '\\b(?:DeflateBufferSize|DeflateCompressionLevel|DeflateFilterNote|DeflateMemLevel|DeflateWindowSize)\\b' }, { token: 'keyword.ext_filter.apacheconf',
{ token: 'keyword.dir.apacheconf', regex: '\\b(?:ExtFilterDefine|ExtFilterOptions)\\b' },
regex: '\\b(?:DirectoryIndex|DirectorySlash)\\b' }, { token: 'keyword.file_cache.apacheconf',
{ token: 'keyword.disk_cache.apacheconf', regex: '\\b(?:CacheFile|MMapFile)\\b' },
regex: '\\b(?:CacheDirLength|CacheDirLevels|CacheExpiryCheck|CacheGcClean|CacheGcDaily|CacheGcInterval|CacheGcMemUsage|CacheGcUnused|CacheMaxFileSize|CacheMinFileSize|CacheRoot|CacheSize|CacheTimeMargin)\\b' }, { token: 'keyword.headers.apacheconf',
{ token: 'keyword.dumpio.apacheconf', regex: '\\b(?:Header|RequestHeader)\\b' },
regex: '\\b(?:DumpIOInput|DumpIOOutput)\\b' }, { token: 'keyword.imap.apacheconf',
{ token: 'keyword.env.apacheconf', regex: '\\b(?:ImapBase|ImapDefault|ImapMenu)\\b' },
regex: '\\b(?:PassEnv|SetEnv|UnsetEnv)\\b' }, { token: 'keyword.include.apacheconf',
{ token: 'keyword.expires.apacheconf', regex: '\\b(?:SSIEndTag|SSIErrorMsg|SSIStartTag|SSITimeFormat|SSIUndefinedEcho|XBitHack)\\b' },
regex: '\\b(?:ExpiresActive|ExpiresByType|ExpiresDefault)\\b' }, { token: 'keyword.isapi.apacheconf',
{ token: 'keyword.ext_filter.apacheconf', regex: '\\b(?:ISAPIAppendLogToErrors|ISAPIAppendLogToQuery|ISAPICacheFile|ISAPIFakeAsync|ISAPILogNotSupported|ISAPIReadAheadBuffer)\\b' },
regex: '\\b(?:ExtFilterDefine|ExtFilterOptions)\\b' }, { token: 'keyword.ldap.apacheconf',
{ token: 'keyword.file_cache.apacheconf', regex: '\\b(?:LDAPCacheEntries|LDAPCacheTTL|LDAPConnectionTimeout|LDAPOpCacheEntries|LDAPOpCacheTTL|LDAPSharedCacheFile|LDAPSharedCacheSize|LDAPTrustedCA|LDAPTrustedCAType)\\b' },
regex: '\\b(?:CacheFile|MMapFile)\\b' }, { token: 'keyword.log.apacheconf',
{ token: 'keyword.headers.apacheconf', regex: '\\b(?:BufferedLogs|CookieLog|CustomLog|LogFormat|TransferLog|ForensicLog)\\b' },
regex: '\\b(?:Header|RequestHeader)\\b' }, { token: 'keyword.mem_cache.apacheconf',
{ token: 'keyword.imap.apacheconf', regex: '\\b(?:MCacheMaxObjectCount|MCacheMaxObjectSize|MCacheMaxStreamingBuffer|MCacheMinObjectSize|MCacheRemovalAlgorithm|MCacheSize)\\b' },
regex: '\\b(?:ImapBase|ImapDefault|ImapMenu)\\b' }, { token: 'keyword.mime.apacheconf',
{ token: 'keyword.include.apacheconf', regex: '\\b(?:AddCharset|AddEncoding|AddHandler|AddInputFilter|AddLanguage|AddOutputFilter|AddType|DefaultLanguage|ModMimeUsePathInfo|MultiviewsMatch|RemoveCharset|RemoveEncoding|RemoveHandler|RemoveInputFilter|RemoveLanguage|RemoveOutputFilter|RemoveType|TypesConfig)\\b' },
regex: '\\b(?:SSIEndTag|SSIErrorMsg|SSIStartTag|SSITimeFormat|SSIUndefinedEcho|XBitHack)\\b' }, { token: 'keyword.misc.apacheconf',
{ token: 'keyword.isapi.apacheconf', regex: '\\b(?:ProtocolEcho|Example|AddModuleInfo|MimeMagicFile|CheckSpelling|ExtendedStatus|SuexecUserGroup|UserDir)\\b' },
regex: '\\b(?:ISAPIAppendLogToErrors|ISAPIAppendLogToQuery|ISAPICacheFile|ISAPIFakeAsync|ISAPILogNotSupported|ISAPIReadAheadBuffer)\\b' }, { token: 'keyword.negotiation.apacheconf',
{ token: 'keyword.ldap.apacheconf', regex: '\\b(?:CacheNegotiatedDocs|ForceLanguagePriority|LanguagePriority)\\b' },
regex: '\\b(?:LDAPCacheEntries|LDAPCacheTTL|LDAPConnectionTimeout|LDAPOpCacheEntries|LDAPOpCacheTTL|LDAPSharedCacheFile|LDAPSharedCacheSize|LDAPTrustedCA|LDAPTrustedCAType)\\b' }, { token: 'keyword.nw_ssl.apacheconf',
{ token: 'keyword.log.apacheconf', regex: '\\b(?:NWSSLTrustedCerts|NWSSLUpgradeable|SecureListen)\\b' },
regex: '\\b(?:BufferedLogs|CookieLog|CustomLog|LogFormat|TransferLog|ForensicLog)\\b' }, { token: 'keyword.proxy.apacheconf',
{ token: 'keyword.mem_cache.apacheconf', regex: '\\b(?:AllowCONNECT|NoProxy|ProxyBadHeader|ProxyBlock|ProxyDomain|ProxyErrorOverride|ProxyFtpDirCharset|ProxyIOBufferSize|ProxyMaxForwards|ProxyPass|ProxyPassReverse|ProxyPreserveHost|ProxyReceiveBufferSize|ProxyRemote|ProxyRemoteMatch|ProxyRequests|ProxyTimeout|ProxyVia)\\b' },
regex: '\\b(?:MCacheMaxObjectCount|MCacheMaxObjectSize|MCacheMaxStreamingBuffer|MCacheMinObjectSize|MCacheRemovalAlgorithm|MCacheSize)\\b' }, { token: 'keyword.rewrite.apacheconf',
{ token: 'keyword.mime.apacheconf', regex: '\\b(?:RewriteBase|RewriteCond|RewriteEngine|RewriteLock|RewriteLog|RewriteLogLevel|RewriteMap|RewriteOptions|RewriteRule)\\b' },
regex: '\\b(?:AddCharset|AddEncoding|AddHandler|AddInputFilter|AddLanguage|AddOutputFilter|AddType|DefaultLanguage|ModMimeUsePathInfo|MultiviewsMatch|RemoveCharset|RemoveEncoding|RemoveHandler|RemoveInputFilter|RemoveLanguage|RemoveOutputFilter|RemoveType|TypesConfig)\\b' }, { token: 'keyword.setenvif.apacheconf',
{ token: 'keyword.misc.apacheconf', regex: '\\b(?:BrowserMatch|BrowserMatchNoCase|SetEnvIf|SetEnvIfNoCase)\\b' },
regex: '\\b(?:ProtocolEcho|Example|AddModuleInfo|MimeMagicFile|CheckSpelling|ExtendedStatus|SuexecUserGroup|UserDir)\\b' }, { token: 'keyword.so.apacheconf',
{ token: 'keyword.negotiation.apacheconf', regex: '\\b(?:LoadFile|LoadModule)\\b' },
regex: '\\b(?:CacheNegotiatedDocs|ForceLanguagePriority|LanguagePriority)\\b' }, { token: 'keyword.ssl.apacheconf',
{ token: 'keyword.nw_ssl.apacheconf', regex: '\\b(?:SSLCACertificateFile|SSLCACertificatePath|SSLCARevocationFile|SSLCARevocationPath|SSLCertificateChainFile|SSLCertificateFile|SSLCertificateKeyFile|SSLCipherSuite|SSLEngine|SSLMutex|SSLOptions|SSLPassPhraseDialog|SSLProtocol|SSLProxyCACertificateFile|SSLProxyCACertificatePath|SSLProxyCARevocationFile|SSLProxyCARevocationPath|SSLProxyCipherSuite|SSLProxyEngine|SSLProxyMachineCertificateFile|SSLProxyMachineCertificatePath|SSLProxyProtocol|SSLProxyVerify|SSLProxyVerifyDepth|SSLRandomSeed|SSLRequire|SSLRequireSSL|SSLSessionCache|SSLSessionCacheTimeout|SSLUserName|SSLVerifyClient|SSLVerifyDepth)\\b' },
regex: '\\b(?:NWSSLTrustedCerts|NWSSLUpgradeable|SecureListen)\\b' }, { token: 'keyword.usertrack.apacheconf',
{ token: 'keyword.proxy.apacheconf', regex: '\\b(?:CookieDomain|CookieExpires|CookieName|CookieStyle|CookieTracking)\\b' },
regex: '\\b(?:AllowCONNECT|NoProxy|ProxyBadHeader|ProxyBlock|ProxyDomain|ProxyErrorOverride|ProxyFtpDirCharset|ProxyIOBufferSize|ProxyMaxForwards|ProxyPass|ProxyPassReverse|ProxyPreserveHost|ProxyReceiveBufferSize|ProxyRemote|ProxyRemoteMatch|ProxyRequests|ProxyTimeout|ProxyVia)\\b' }, { token: 'keyword.vhost_alias.apacheconf',
{ token: 'keyword.rewrite.apacheconf', regex: '\\b(?:VirtualDocumentRoot|VirtualDocumentRootIP|VirtualScriptAlias|VirtualScriptAliasIP)\\b' },
regex: '\\b(?:RewriteBase|RewriteCond|RewriteEngine|RewriteLock|RewriteLog|RewriteLogLevel|RewriteMap|RewriteOptions|RewriteRule)\\b' }, { token: ['keyword.php.apacheconf',
{ token: 'keyword.setenvif.apacheconf', 'text',
regex: '\\b(?:BrowserMatch|BrowserMatchNoCase|SetEnvIf|SetEnvIfNoCase)\\b' }, 'entity.property.apacheconf',
{ token: 'keyword.so.apacheconf', 'text',
regex: '\\b(?:LoadFile|LoadModule)\\b' }, 'string.value.apacheconf',
{ token: 'keyword.ssl.apacheconf', 'text'],
regex: '\\b(?:SSLCACertificateFile|SSLCACertificatePath|SSLCARevocationFile|SSLCARevocationPath|SSLCertificateChainFile|SSLCertificateFile|SSLCertificateKeyFile|SSLCipherSuite|SSLEngine|SSLMutex|SSLOptions|SSLPassPhraseDialog|SSLProtocol|SSLProxyCACertificateFile|SSLProxyCACertificatePath|SSLProxyCARevocationFile|SSLProxyCARevocationPath|SSLProxyCipherSuite|SSLProxyEngine|SSLProxyMachineCertificateFile|SSLProxyMachineCertificatePath|SSLProxyProtocol|SSLProxyVerify|SSLProxyVerifyDepth|SSLRandomSeed|SSLRequire|SSLRequireSSL|SSLSessionCache|SSLSessionCacheTimeout|SSLUserName|SSLVerifyClient|SSLVerifyDepth)\\b' }, regex: '\\b(php_value|php_flag)\\b(?:(\\s+)(.+?)(?:(\\s+)(.+?))?)?(\\s)' },
{ token: 'keyword.usertrack.apacheconf', { token: ['punctuation.variable.apacheconf',
regex: '\\b(?:CookieDomain|CookieExpires|CookieName|CookieStyle|CookieTracking)\\b' }, 'variable.env.apacheconf',
{ token: 'keyword.vhost_alias.apacheconf', 'variable.misc.apacheconf',
regex: '\\b(?:VirtualDocumentRoot|VirtualDocumentRootIP|VirtualScriptAlias|VirtualScriptAliasIP)\\b' }, 'punctuation.variable.apacheconf'],
{ token: regex: '(%\\{)(?:(HTTP_USER_AGENT|HTTP_REFERER|HTTP_COOKIE|HTTP_FORWARDED|HTTP_HOST|HTTP_PROXY_CONNECTION|HTTP_ACCEPT|REMOTE_ADDR|REMOTE_HOST|REMOTE_PORT|REMOTE_USER|REMOTE_IDENT|REQUEST_METHOD|SCRIPT_FILENAME|PATH_INFO|QUERY_STRING|AUTH_TYPE|DOCUMENT_ROOT|SERVER_ADMIN|SERVER_NAME|SERVER_ADDR|SERVER_PORT|SERVER_PROTOCOL|SERVER_SOFTWARE|TIME_YEAR|TIME_MON|TIME_DAY|TIME_HOUR|TIME_MIN|TIME_SEC|TIME_WDAY|TIME|API_VERSION|THE_REQUEST|REQUEST_URI|REQUEST_FILENAME|IS_SUBREQ|HTTPS)|(.*?))(\\})' },
[ 'keyword.php.apacheconf', { token: ['entity.mime-type.apacheconf', 'text'],
'text', regex: '\\b((?:text|image|application|video|audio)/.+?)(\\s)' },
'entity.property.apacheconf', { token: 'entity.helper.apacheconf',
'text', regex: '\\b(?:from|unset|set|on|off)\\b',
'string.value.apacheconf', caseInsensitive: true },
'text' ], { token: 'constant.integer.apacheconf', regex: '\\b\\d+\\b' },
regex: '\\b(php_value|php_flag)\\b(?:(\\s+)(.+?)(?:(\\s+)(.+?))?)?(\\s)' }, { token: ['text',
{ token: 'punctuation.definition.flag.apacheconf',
[ 'punctuation.variable.apacheconf', 'string.flag.apacheconf',
'variable.env.apacheconf', 'punctuation.definition.flag.apacheconf',
'variable.misc.apacheconf', 'text'],
'punctuation.variable.apacheconf' ], regex: '(\\s)(\\[)(.*?)(\\])(\\s)' }] };
regex: '(%\\{)(?:(HTTP_USER_AGENT|HTTP_REFERER|HTTP_COOKIE|HTTP_FORWARDED|HTTP_HOST|HTTP_PROXY_CONNECTION|HTTP_ACCEPT|REMOTE_ADDR|REMOTE_HOST|REMOTE_PORT|REMOTE_USER|REMOTE_IDENT|REQUEST_METHOD|SCRIPT_FILENAME|PATH_INFO|QUERY_STRING|AUTH_TYPE|DOCUMENT_ROOT|SERVER_ADMIN|SERVER_NAME|SERVER_ADDR|SERVER_PORT|SERVER_PROTOCOL|SERVER_SOFTWARE|TIME_YEAR|TIME_MON|TIME_DAY|TIME_HOUR|TIME_MIN|TIME_SEC|TIME_WDAY|TIME|API_VERSION|THE_REQUEST|REQUEST_URI|REQUEST_FILENAME|IS_SUBREQ|HTTPS)|(.*?))(\\})' },
{ token: [ 'entity.mime-type.apacheconf', 'text' ],
regex: '\\b((?:text|image|application|video|audio)/.+?)(\\s)' },
{ token: 'entity.helper.apacheconf',
regex: '\\b(?:from|unset|set|on|off)\\b',
caseInsensitive: true },
{ token: 'constant.integer.apacheconf', regex: '\\b\\d+\\b' },
{ token:
[ 'text',
'punctuation.definition.flag.apacheconf',
'string.flag.apacheconf',
'punctuation.definition.flag.apacheconf',
'text' ],
regex: '(\\s)(\\[)(.*?)(\\])(\\s)' } ] };
this.normalizeRules(); this.normalizeRules();
}; };
ApacheConfHighlightRules.metaData = { fileTypes: ['conf',
ApacheConfHighlightRules.metaData = { fileTypes: 'CONF',
[ 'conf', 'htaccess',
'CONF', 'HTACCESS',
'htaccess', 'htgroups',
'HTACCESS', 'HTGROUPS',
'htgroups', 'htpasswd',
'HTGROUPS', 'HTPASSWD',
'htpasswd', '.htaccess',
'HTPASSWD', '.HTACCESS',
'.htaccess', '.htgroups',
'.HTACCESS', '.HTGROUPS',
'.htgroups', '.htpasswd',
'.HTGROUPS', '.HTPASSWD'],
'.htpasswd', name: 'Apache Conf',
'.HTPASSWD' ], scopeName: 'source.apacheconf' };
name: 'Apache Conf',
scopeName: 'source.apacheconf' };
oop.inherits(ApacheConfHighlightRules, TextHighlightRules); oop.inherits(ApacheConfHighlightRules, TextHighlightRules);
exports.ApacheConfHighlightRules = ApacheConfHighlightRules; exports.ApacheConfHighlightRules = ApacheConfHighlightRules;
}); });
define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../../lib/oop"); var oop = require("../../lib/oop");
var Range = require("../../range").Range; var Range = require("../../range").Range;
var BaseFoldMode = require("./fold_mode").FoldMode; var BaseFoldMode = require("./fold_mode").FoldMode;
var FoldMode = exports.FoldMode = function (commentRegex) {
var FoldMode = exports.FoldMode = function(commentRegex) {
if (commentRegex) { if (commentRegex) {
this.foldingStartMarker = new RegExp( this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
);
this.foldingStopMarker = new RegExp(
this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
);
} }
}; };
oop.inherits(FoldMode, BaseFoldMode); oop.inherits(FoldMode, BaseFoldMode);
(function () {
(function() {
this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/; this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/; this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
this._getFoldWidgetBase = this.getFoldWidget; this._getFoldWidgetBase = this.getFoldWidget;
this.getFoldWidget = function(session, foldStyle, row) { this.getFoldWidget = function (session, foldStyle, row) {
var line = session.getLine(row); var line = session.getLine(row);
if (this.singleLineBlockCommentRe.test(line)) { if (this.singleLineBlockCommentRe.test(line)) {
if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
return ""; return "";
} }
var fw = this._getFoldWidgetBase(session, foldStyle, row); var fw = this._getFoldWidgetBase(session, foldStyle, row);
if (!fw && this.startRegionRe.test(line)) if (!fw && this.startRegionRe.test(line))
return "start"; // lineCommentRegionStart return "start"; // lineCommentRegionStart
return fw; return fw;
}; };
this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
var line = session.getLine(row); var line = session.getLine(row);
if (this.startRegionRe.test(line)) if (this.startRegionRe.test(line))
return this.getCommentRegionBlock(session, line, row); return this.getCommentRegionBlock(session, line, row);
var match = line.match(this.foldingStartMarker); var match = line.match(this.foldingStartMarker);
if (match) { if (match) {
var i = match.index; var i = match.index;
if (match[1]) if (match[1])
return this.openingBracketBlock(session, match[1], row, i); return this.openingBracketBlock(session, match[1], row, i);
var range = session.getCommentFoldRange(row, i + match[0].length, 1); var range = session.getCommentFoldRange(row, i + match[0].length, 1);
if (range && !range.isMultiLine()) { if (range && !range.isMultiLine()) {
if (forceMultiline) { if (forceMultiline) {
range = this.getSectionRange(session, row); range = this.getSectionRange(session, row);
} else if (foldStyle != "all") }
else if (foldStyle != "all")
range = null; range = null;
} }
return range; return range;
} }
if (foldStyle === "markbegin") if (foldStyle === "markbegin")
return; return;
var match = line.match(this.foldingStopMarker); var match = line.match(this.foldingStopMarker);
if (match) { if (match) {
var i = match.index + match[0].length; var i = match.index + match[0].length;
if (match[1]) if (match[1])
return this.closingBracketBlock(session, match[1], row, i); return this.closingBracketBlock(session, match[1], row, i);
return session.getCommentFoldRange(row, i, -1); return session.getCommentFoldRange(row, i, -1);
} }
}; };
this.getSectionRange = function (session, row) {
this.getSectionRange = function(session, row) {
var line = session.getLine(row); var line = session.getLine(row);
var startIndent = line.search(/\S/); var startIndent = line.search(/\S/);
var startRow = row; var startRow = row;
@ -287,70 +243,76 @@ oop.inherits(FoldMode, BaseFoldMode);
var indent = line.search(/\S/); var indent = line.search(/\S/);
if (indent === -1) if (indent === -1)
continue; continue;
if (startIndent > indent) if (startIndent > indent)
break; break;
var subRange = this.getFoldWidgetRange(session, "all", row); var subRange = this.getFoldWidgetRange(session, "all", row);
if (subRange) { if (subRange) {
if (subRange.start.row <= startRow) { if (subRange.start.row <= startRow) {
break; break;
} else if (subRange.isMultiLine()) { }
else if (subRange.isMultiLine()) {
row = subRange.end.row; row = subRange.end.row;
} else if (startIndent == indent) { }
else if (startIndent == indent) {
break; break;
} }
} }
endRow = row; endRow = row;
} }
return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
}; };
this.getCommentRegionBlock = function(session, line, row) { this.getCommentRegionBlock = function (session, line, row) {
var startColumn = line.search(/\s*$/); var startColumn = line.search(/\s*$/);
var maxRow = session.getLength(); var maxRow = session.getLength();
var startRow = row; var startRow = row;
var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
var depth = 1; var depth = 1;
while (++row < maxRow) { while (++row < maxRow) {
line = session.getLine(row); line = session.getLine(row);
var m = re.exec(line); var m = re.exec(line);
if (!m) continue; if (!m)
if (m[1]) depth--; continue;
else depth++; if (m[1])
depth--;
if (!depth) break; else
depth++;
if (!depth)
break;
} }
var endRow = row; var endRow = row;
if (endRow > startRow) { if (endRow > startRow) {
return new Range(startRow, startColumn, endRow, line.length); return new Range(startRow, startColumn, endRow, line.length);
} }
}; };
}).call(FoldMode.prototype); }).call(FoldMode.prototype);
}); });
define("ace/mode/apache_conf",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/apache_conf_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) { define("ace/mode/apache_conf",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/apache_conf_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module){/*
THIS FILE WAS AUTOGENERATED BY mode.tmpl.js
*/
"use strict"; "use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextMode = require("./text").Mode; var TextMode = require("./text").Mode;
var ApacheConfHighlightRules = require("./apache_conf_highlight_rules").ApacheConfHighlightRules; var ApacheConfHighlightRules = require("./apache_conf_highlight_rules").ApacheConfHighlightRules;
var FoldMode = require("./folding/cstyle").FoldMode; var FoldMode = require("./folding/cstyle").FoldMode;
var Mode = function () {
var Mode = function() {
this.HighlightRules = ApacheConfHighlightRules; this.HighlightRules = ApacheConfHighlightRules;
this.foldingRules = new FoldMode(); this.foldingRules = new FoldMode();
this.$behaviour = this.$defaultBehaviour; this.$behaviour = this.$defaultBehaviour;
}; };
oop.inherits(Mode, TextMode); oop.inherits(Mode, TextMode);
(function () {
(function() {
this.lineCommentStart = "#"; this.lineCommentStart = "#";
this.$id = "ace/mode/apache_conf"; this.$id = "ace/mode/apache_conf";
}).call(Mode.prototype); }).call(Mode.prototype);
exports.Mode = Mode; exports.Mode = Mode;
});
}); (function() {
window.require(["ace/mode/apache_conf"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

View File

@ -0,0 +1,402 @@
define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var DocCommentHighlightRules = function () {
this.$rules = {
"start": [
{
token: "comment.doc.tag",
regex: "@\\w+(?=\\s|$)"
}, DocCommentHighlightRules.getTagRule(), {
defaultToken: "comment.doc",
caseInsensitive: true
}
]
};
};
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getTagRule = function (start) {
return {
token: "comment.doc.tag.storage.type",
regex: "\\b(?:TODO|FIXME|XXX|HACK)\\b"
};
};
DocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
regex: "\\/\\*(?=\\*)",
next: start
};
};
DocCommentHighlightRules.getEndRule = function (start) {
return {
token: "comment.doc", // closing comment
regex: "\\*\\/",
next: start
};
};
exports.DocCommentHighlightRules = DocCommentHighlightRules;
});
define("ace/mode/apex_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules","ace/mode/doc_comment_highlight_rules"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextHighlightRules = require("../mode/text_highlight_rules").TextHighlightRules;
var DocCommentHighlightRules = require("../mode/doc_comment_highlight_rules").DocCommentHighlightRules;
var ApexHighlightRules = function () {
var mainKeywordMapper = this.createKeywordMapper({
"variable.language": "activate|any|autonomous|begin|bigdecimal|byte|cast|char|collect|const"
+ "|end|exit|export|float|goto|group|having|hint|import|inner|into|join|loop|number|object|of|outer"
+ "|parallel|pragma|retrieve|returning|search|short|stat|synchronized|then|this_month"
+ "|transaction|type|when",
"keyword": "private|protected|public|native|synchronized|abstract|threadsafe|transient|static|final"
+ "|and|array|as|asc|break|bulk|by|catch|class|commit|continue|convertcurrency"
+ "|delete|desc|do|else|enum|extends|false|final|finally|for|from|future|global"
+ "|if|implements|in|insert|instanceof|interface|last_90_days|last_month"
+ "|last_n_days|last_week|like|limit|list|map|merge|new|next_90_days|next_month|next_n_days"
+ "|next_week|not|null|nulls|on|or|override|package|return"
+ "|rollback|savepoint|select|set|sort|super|testmethod|this|this_week|throw|today"
+ "|tolabel|tomorrow|trigger|true|try|undelete|update|upsert|using|virtual|webservice"
+ "|where|while|yesterday|switch|case|default",
"storage.type": "def|boolean|byte|char|short|int|float|pblob|date|datetime|decimal|double|id|integer|long|string|time|void|blob|Object",
"constant.language": "true|false|null|after|before|count|excludes|first|includes|last|order|sharing|with",
"support.function": "system|apex|label|apexpages|userinfo|schema"
}, "identifier", true);
function keywordMapper(value) {
if (value.slice(-3) == "__c")
return "support.function";
return mainKeywordMapper(value);
}
function string(start, options) {
return {
regex: start + (options.multiline ? "" : "(?=.)"),
token: "string.start",
next: [{
regex: options.escape,
token: "character.escape"
}, {
regex: options.error,
token: "error.invalid"
}, {
regex: start + (options.multiline ? "" : "|$"),
token: "string.end",
next: options.next || "start"
}, {
defaultToken: "string"
}]
};
}
function comments() {
return [{
token: "comment",
regex: "\\/\\/(?=.)",
next: [
DocCommentHighlightRules.getTagRule(),
{ token: "comment", regex: "$|^", next: "start" },
{ defaultToken: "comment", caseInsensitive: true }
]
},
DocCommentHighlightRules.getStartRule("doc-start"),
{
token: "comment", // multi line comment
regex: /\/\*/,
next: [
DocCommentHighlightRules.getTagRule(),
{ token: "comment", regex: "\\*\\/", next: "start" },
{ defaultToken: "comment", caseInsensitive: true }
]
}
];
}
this.$rules = {
start: [
string("'", {
escape: /\\[nb'"\\]/,
error: /\\./,
multiline: false
}),
comments("c"),
{
type: "decoration",
token: [
"meta.package.apex",
"keyword.other.package.apex",
"meta.package.apex",
"storage.modifier.package.apex",
"meta.package.apex",
"punctuation.terminator.apex"
],
regex: /^(\s*)(package)\b(?:(\s*)([^ ;$]+)(\s*)((?:;)?))?/
}, {
regex: /@[a-zA-Z_$][a-zA-Z_$\d\u0080-\ufffe]*/,
token: "constant.language"
},
{
regex: /[a-zA-Z_$][a-zA-Z_$\d\u0080-\ufffe]*/,
token: keywordMapper
},
{
regex: "`#%",
token: "error.invalid"
}, {
token: "constant.numeric", // float
regex: /[+-]?\d+(?:(?:\.\d*)?(?:[LlDdEe][+-]?\d+)?)\b|\.\d+[LlDdEe]/
}, {
token: "keyword.operator",
regex: /--|\+\+|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|[!$%&*+\-~\/^]=?/,
next: "start"
}, {
token: "punctuation.operator",
regex: /[?:,;.]/,
next: "start"
}, {
token: "paren.lparen",
regex: /[\[]/,
next: "maybe_soql",
merge: false
}, {
token: "paren.lparen",
regex: /[\[({]/,
next: "start",
merge: false
}, {
token: "paren.rparen",
regex: /[\])}]/,
merge: false
}
],
maybe_soql: [{
regex: /\s+/,
token: "text"
}, {
regex: /(SELECT|FIND)\b/,
token: "keyword",
caseInsensitive: true,
next: "soql"
}, {
regex: "",
token: "none",
next: "start"
}],
soql: [{
regex: "(:?ASC|BY|CATEGORY|CUBE|DATA|DESC|END|FIND|FIRST|FOR|FROM|GROUP|HAVING|IN|LAST"
+ "|LIMIT|NETWORK|NULLS|OFFSET|ORDER|REFERENCE|RETURNING|ROLLUP|SCOPE|SELECT"
+ "|SNIPPET|TRACKING|TYPEOF|UPDATE|USING|VIEW|VIEWSTAT|WHERE|WITH|AND|OR)\\b",
token: "keyword",
caseInsensitive: true
}, {
regex: "(:?target_length|toLabel|convertCurrency|count|Contact|Account|User|FIELDS)\\b",
token: "support.function",
caseInsensitive: true
}, {
token: "paren.rparen",
regex: /[\]]/,
next: "start",
merge: false
},
string("'", {
escape: /\\[nb'"\\]/,
error: /\\./,
multiline: false,
next: "soql"
}),
string('"', {
escape: /\\[nb'"\\]/,
error: /\\./,
multiline: false,
next: "soql"
}),
{
regex: /\\./,
token: "character.escape"
},
{
regex: /[\?\&\|\!\{\}\[\]\(\)\^\~\*\:\"\'\+\-\,\.=\\\/]/,
token: "keyword.operator"
}],
"log-start": [{
token: "timestamp.invisible",
regex: /^[\d:.() ]+\|/,
next: "log-header"
}, {
token: "timestamp.invisible",
regex: /^ (Number of|Maximum)[^:]*:/,
next: "log-comment"
}, {
token: "invisible",
regex: /^Execute Anonymous:/,
next: "log-comment"
}, {
defaultToken: "text"
}],
"log-comment": [{
token: "log-comment",
regex: /.*$/,
next: "log-start"
}],
"log-header": [{
token: "timestamp.invisible",
regex: /((USER_DEBUG|\[\d+\]|DEBUG)\|)+/
},
{
token: "keyword",
regex: "(?:EXECUTION_FINISHED|EXECUTION_STARTED|CODE_UNIT_STARTED"
+ "|CUMULATIVE_LIMIT_USAGE|LIMIT_USAGE_FOR_NS"
+ "|CUMULATIVE_LIMIT_USAGE_END|CODE_UNIT_FINISHED)"
}, {
regex: "",
next: "log-start"
}]
};
this.embedRules(DocCommentHighlightRules, "doc-", [DocCommentHighlightRules.getEndRule("start")]);
this.normalizeRules();
};
oop.inherits(ApexHighlightRules, TextHighlightRules);
exports.ApexHighlightRules = ApexHighlightRules;
});
define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var Range = require("../../range").Range;
var BaseFoldMode = require("./fold_mode").FoldMode;
var FoldMode = exports.FoldMode = function (commentRegex) {
if (commentRegex) {
this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
}
};
oop.inherits(FoldMode, BaseFoldMode);
(function () {
this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
this._getFoldWidgetBase = this.getFoldWidget;
this.getFoldWidget = function (session, foldStyle, row) {
var line = session.getLine(row);
if (this.singleLineBlockCommentRe.test(line)) {
if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
return "";
}
var fw = this._getFoldWidgetBase(session, foldStyle, row);
if (!fw && this.startRegionRe.test(line))
return "start"; // lineCommentRegionStart
return fw;
};
this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
var line = session.getLine(row);
if (this.startRegionRe.test(line))
return this.getCommentRegionBlock(session, line, row);
var match = line.match(this.foldingStartMarker);
if (match) {
var i = match.index;
if (match[1])
return this.openingBracketBlock(session, match[1], row, i);
var range = session.getCommentFoldRange(row, i + match[0].length, 1);
if (range && !range.isMultiLine()) {
if (forceMultiline) {
range = this.getSectionRange(session, row);
}
else if (foldStyle != "all")
range = null;
}
return range;
}
if (foldStyle === "markbegin")
return;
var match = line.match(this.foldingStopMarker);
if (match) {
var i = match.index + match[0].length;
if (match[1])
return this.closingBracketBlock(session, match[1], row, i);
return session.getCommentFoldRange(row, i, -1);
}
};
this.getSectionRange = function (session, row) {
var line = session.getLine(row);
var startIndent = line.search(/\S/);
var startRow = row;
var startColumn = line.length;
row = row + 1;
var endRow = row;
var maxRow = session.getLength();
while (++row < maxRow) {
line = session.getLine(row);
var indent = line.search(/\S/);
if (indent === -1)
continue;
if (startIndent > indent)
break;
var subRange = this.getFoldWidgetRange(session, "all", row);
if (subRange) {
if (subRange.start.row <= startRow) {
break;
}
else if (subRange.isMultiLine()) {
row = subRange.end.row;
}
else if (startIndent == indent) {
break;
}
}
endRow = row;
}
return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
};
this.getCommentRegionBlock = function (session, line, row) {
var startColumn = line.search(/\s*$/);
var maxRow = session.getLength();
var startRow = row;
var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
var depth = 1;
while (++row < maxRow) {
line = session.getLine(row);
var m = re.exec(line);
if (!m)
continue;
if (m[1])
depth--;
else
depth++;
if (!depth)
break;
}
var endRow = row;
if (endRow > startRow) {
return new Range(startRow, startColumn, endRow, line.length);
}
};
}).call(FoldMode.prototype);
});
define("ace/mode/apex",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/apex_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module){/* caption: Apex; extensions: apex,cls,trigger,tgr */
"use strict";
var oop = require("../lib/oop");
var TextMode = require("../mode/text").Mode;
var ApexHighlightRules = require("./apex_highlight_rules").ApexHighlightRules;
var FoldMode = require("../mode/folding/cstyle").FoldMode;
function ApexMode() {
TextMode.call(this);
this.HighlightRules = ApexHighlightRules;
this.foldingRules = new FoldMode();
this.$behaviour = this.$defaultBehaviour;
}
oop.inherits(ApexMode, TextMode);
ApexMode.prototype.lineCommentStart = "//";
ApexMode.prototype.blockComment = {
start: "/*",
end: "*/"
};
exports.Mode = ApexMode;
}); (function() {
window.require(["ace/mode/apex"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

View File

@ -1,12 +1,8 @@
define("ace/mode/applescript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { define("ace/mode/applescript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var AppleScriptHighlightRules = function () {
var AppleScriptHighlightRules = function() { var keywords = ("about|above|after|against|and|around|as|at|back|before|beginning|" +
var keywords = (
"about|above|after|against|and|around|as|at|back|before|beginning|" +
"behind|below|beneath|beside|between|but|by|considering|" + "behind|below|beneath|beside|between|but|by|considering|" +
"contain|contains|continue|copy|div|does|eighth|else|end|equal|" + "contain|contains|continue|copy|div|does|eighth|else|end|equal|" +
"equals|error|every|exit|fifth|first|for|fourth|from|front|" + "equals|error|every|exit|fifth|first|for|fourth|from|front|" +
@ -14,32 +10,20 @@ var AppleScriptHighlightRules = function() {
"middle|mod|my|ninth|not|of|on|onto|or|over|prop|property|put|ref|" + "middle|mod|my|ninth|not|of|on|onto|or|over|prop|property|put|ref|" +
"reference|repeat|returning|script|second|set|seventh|since|" + "reference|repeat|returning|script|second|set|seventh|since|" +
"sixth|some|tell|tenth|that|the|then|third|through|thru|" + "sixth|some|tell|tenth|that|the|then|third|through|thru|" +
"timeout|times|to|transaction|try|until|where|while|whose|with|without" "timeout|times|to|transaction|try|until|where|while|whose|with|without");
); var builtinConstants = ("AppleScript|false|linefeed|return|pi|quote|result|space|tab|true");
var builtinFunctions = ("activate|beep|count|delay|launch|log|offset|read|round|run|say|" +
var builtinConstants = ( "summarize|write");
"AppleScript|false|linefeed|return|pi|quote|result|space|tab|true" var builtinTypes = ("alias|application|boolean|class|constant|date|file|integer|list|" +
);
var builtinFunctions = (
"activate|beep|count|delay|launch|log|offset|read|round|run|say|" +
"summarize|write"
);
var builtinTypes = (
"alias|application|boolean|class|constant|date|file|integer|list|" +
"number|real|record|string|text|character|characters|contents|day|" + "number|real|record|string|text|character|characters|contents|day|" +
"frontmost|id|item|length|month|name|paragraph|paragraphs|rest|" + "frontmost|id|item|length|month|name|paragraph|paragraphs|rest|" +
"reverse|running|time|version|weekday|word|words|year" "reverse|running|time|version|weekday|word|words|year");
);
var keywordMapper = this.createKeywordMapper({ var keywordMapper = this.createKeywordMapper({
"support.function": builtinFunctions, "support.function": builtinFunctions,
"constant.language": builtinConstants, "constant.language": builtinConstants,
"support.type": builtinTypes, "support.type": builtinTypes,
"keyword": keywords "keyword": keywords
}, "identifier"); }, "identifier");
this.$rules = { this.$rules = {
"start": [ "start": [
{ {
@ -47,12 +31,12 @@ var AppleScriptHighlightRules = function() {
regex: "--.*$" regex: "--.*$"
}, },
{ {
token : "comment", // multi line comment token: "comment", // multi line comment
regex : "\\(\\*", regex: "\\(\\*",
next : "comment" next: "comment"
}, },
{ {
token: "string", // " string token: "string", // " string
regex: '".*?"' regex: '".*?"'
}, },
{ {
@ -62,14 +46,14 @@ var AppleScriptHighlightRules = function() {
{ {
token: "support.function", token: "support.function",
regex: '\\b(clipboard info|the clipboard|info for|list (disks|folder)|' + regex: '\\b(clipboard info|the clipboard|info for|list (disks|folder)|' +
'mount volume|path to|(close|open for) access|(get|set) eof|' + 'mount volume|path to|(close|open for) access|(get|set) eof|' +
'current date|do shell script|get volume settings|random number|' + 'current date|do shell script|get volume settings|random number|' +
'set volume|system attribute|system info|time to GMT|' + 'set volume|system attribute|system info|time to GMT|' +
'(load|run|store) script|scripting components|' + '(load|run|store) script|scripting components|' +
'ASCII (character|number)|localized string|' + 'ASCII (character|number)|localized string|' +
'choose (application|color|file|file name|' + 'choose (application|color|file|file name|' +
'folder|from list|remote application|URL)|' + 'folder|from list|remote application|URL)|' +
'display (alert|dialog))\\b|^\\s*return\\b' 'display (alert|dialog))\\b|^\\s*return\\b'
}, },
{ {
token: "constant.language", token: "constant.language",
@ -78,9 +62,9 @@ var AppleScriptHighlightRules = function() {
{ {
token: "keyword", token: "keyword",
regex: '\\b(apart from|aside from|instead of|out of|greater than|' + regex: '\\b(apart from|aside from|instead of|out of|greater than|' +
"isn't|(doesn't|does not) (equal|come before|come after|contain)|" + "isn't|(doesn't|does not) (equal|come before|come after|contain)|" +
'(greater|less) than( or equal)?|(starts?|ends|begins?) with|' + '(greater|less) than( or equal)?|(starts?|ends|begins?) with|' +
'contained by|comes (before|after)|a (ref|reference))\\b' 'contained by|comes (before|after)|a (ref|reference))\\b'
}, },
{ {
token: keywordMapper, token: keywordMapper,
@ -97,98 +81,72 @@ var AppleScriptHighlightRules = function() {
} }
] ]
}; };
this.normalizeRules(); this.normalizeRules();
}; };
oop.inherits(AppleScriptHighlightRules, TextHighlightRules); oop.inherits(AppleScriptHighlightRules, TextHighlightRules);
exports.AppleScriptHighlightRules = AppleScriptHighlightRules; exports.AppleScriptHighlightRules = AppleScriptHighlightRules;
}); });
define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../../lib/oop"); var oop = require("../../lib/oop");
var Range = require("../../range").Range; var Range = require("../../range").Range;
var BaseFoldMode = require("./fold_mode").FoldMode; var BaseFoldMode = require("./fold_mode").FoldMode;
var FoldMode = exports.FoldMode = function (commentRegex) {
var FoldMode = exports.FoldMode = function(commentRegex) {
if (commentRegex) { if (commentRegex) {
this.foldingStartMarker = new RegExp( this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
);
this.foldingStopMarker = new RegExp(
this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
);
} }
}; };
oop.inherits(FoldMode, BaseFoldMode); oop.inherits(FoldMode, BaseFoldMode);
(function () {
(function() {
this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/; this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/; this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
this._getFoldWidgetBase = this.getFoldWidget; this._getFoldWidgetBase = this.getFoldWidget;
this.getFoldWidget = function(session, foldStyle, row) { this.getFoldWidget = function (session, foldStyle, row) {
var line = session.getLine(row); var line = session.getLine(row);
if (this.singleLineBlockCommentRe.test(line)) { if (this.singleLineBlockCommentRe.test(line)) {
if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
return ""; return "";
} }
var fw = this._getFoldWidgetBase(session, foldStyle, row); var fw = this._getFoldWidgetBase(session, foldStyle, row);
if (!fw && this.startRegionRe.test(line)) if (!fw && this.startRegionRe.test(line))
return "start"; // lineCommentRegionStart return "start"; // lineCommentRegionStart
return fw; return fw;
}; };
this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
var line = session.getLine(row); var line = session.getLine(row);
if (this.startRegionRe.test(line)) if (this.startRegionRe.test(line))
return this.getCommentRegionBlock(session, line, row); return this.getCommentRegionBlock(session, line, row);
var match = line.match(this.foldingStartMarker); var match = line.match(this.foldingStartMarker);
if (match) { if (match) {
var i = match.index; var i = match.index;
if (match[1]) if (match[1])
return this.openingBracketBlock(session, match[1], row, i); return this.openingBracketBlock(session, match[1], row, i);
var range = session.getCommentFoldRange(row, i + match[0].length, 1); var range = session.getCommentFoldRange(row, i + match[0].length, 1);
if (range && !range.isMultiLine()) { if (range && !range.isMultiLine()) {
if (forceMultiline) { if (forceMultiline) {
range = this.getSectionRange(session, row); range = this.getSectionRange(session, row);
} else if (foldStyle != "all") }
else if (foldStyle != "all")
range = null; range = null;
} }
return range; return range;
} }
if (foldStyle === "markbegin") if (foldStyle === "markbegin")
return; return;
var match = line.match(this.foldingStopMarker); var match = line.match(this.foldingStopMarker);
if (match) { if (match) {
var i = match.index + match[0].length; var i = match.index + match[0].length;
if (match[1]) if (match[1])
return this.closingBracketBlock(session, match[1], row, i); return this.closingBracketBlock(session, match[1], row, i);
return session.getCommentFoldRange(row, i, -1); return session.getCommentFoldRange(row, i, -1);
} }
}; };
this.getSectionRange = function (session, row) {
this.getSectionRange = function(session, row) {
var line = session.getLine(row); var line = session.getLine(row);
var startIndent = line.search(/\S/); var startIndent = line.search(/\S/);
var startRow = row; var startRow = row;
@ -201,71 +159,74 @@ oop.inherits(FoldMode, BaseFoldMode);
var indent = line.search(/\S/); var indent = line.search(/\S/);
if (indent === -1) if (indent === -1)
continue; continue;
if (startIndent > indent) if (startIndent > indent)
break; break;
var subRange = this.getFoldWidgetRange(session, "all", row); var subRange = this.getFoldWidgetRange(session, "all", row);
if (subRange) { if (subRange) {
if (subRange.start.row <= startRow) { if (subRange.start.row <= startRow) {
break; break;
} else if (subRange.isMultiLine()) { }
else if (subRange.isMultiLine()) {
row = subRange.end.row; row = subRange.end.row;
} else if (startIndent == indent) { }
else if (startIndent == indent) {
break; break;
} }
} }
endRow = row; endRow = row;
} }
return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
}; };
this.getCommentRegionBlock = function(session, line, row) { this.getCommentRegionBlock = function (session, line, row) {
var startColumn = line.search(/\s*$/); var startColumn = line.search(/\s*$/);
var maxRow = session.getLength(); var maxRow = session.getLength();
var startRow = row; var startRow = row;
var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
var depth = 1; var depth = 1;
while (++row < maxRow) { while (++row < maxRow) {
line = session.getLine(row); line = session.getLine(row);
var m = re.exec(line); var m = re.exec(line);
if (!m) continue; if (!m)
if (m[1]) depth--; continue;
else depth++; if (m[1])
depth--;
if (!depth) break; else
depth++;
if (!depth)
break;
} }
var endRow = row; var endRow = row;
if (endRow > startRow) { if (endRow > startRow) {
return new Range(startRow, startColumn, endRow, line.length); return new Range(startRow, startColumn, endRow, line.length);
} }
}; };
}).call(FoldMode.prototype); }).call(FoldMode.prototype);
}); });
define("ace/mode/applescript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/applescript_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) { define("ace/mode/applescript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/applescript_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextMode = require("./text").Mode; var TextMode = require("./text").Mode;
var AppleScriptHighlightRules = require("./applescript_highlight_rules").AppleScriptHighlightRules; var AppleScriptHighlightRules = require("./applescript_highlight_rules").AppleScriptHighlightRules;
var FoldMode = require("./folding/cstyle").FoldMode; var FoldMode = require("./folding/cstyle").FoldMode;
var Mode = function () {
var Mode = function() {
this.HighlightRules = AppleScriptHighlightRules; this.HighlightRules = AppleScriptHighlightRules;
this.foldingRules = new FoldMode(); this.foldingRules = new FoldMode();
this.$behaviour = this.$defaultBehaviour; this.$behaviour = this.$defaultBehaviour;
}; };
oop.inherits(Mode, TextMode); oop.inherits(Mode, TextMode);
(function () {
(function() {
this.lineCommentStart = "--"; this.lineCommentStart = "--";
this.blockComment = {start: "(*", end: "*)"}; this.blockComment = { start: "(*", end: "*)" };
this.$id = "ace/mode/applescript"; this.$id = "ace/mode/applescript";
}).call(Mode.prototype); }).call(Mode.prototype);
exports.Mode = Mode; exports.Mode = Mode;
});
}); (function() {
window.require(["ace/mode/applescript"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

View File

@ -0,0 +1,92 @@
define("ace/mode/aql_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var AqlHighlightRules = function () {
var keywords = ("for|return|filter|search|sort|limit|let|collect|asc|desc|in|into|insert|update|remove|replace|upsert|options|with|and|or|not|distinct|graph|shortest_path|outbound|inbound|any|all|none|at least|aggregate|like|k_shortest_paths|k_paths|all_shortest_paths|prune|window");
var builtinConstants = ("true|false");
var builtinFunctions = ("to_bool|to_number|to_string|to_array|to_list|is_null|is_bool|is_number|is_string|is_array|is_list|is_object|is_document|is_datestring|" +
"typename|json_stringify|json_parse|concat|concat_separator|char_length|lower|upper|substring|left|right|trim|reverse|contains|" +
"log|log2|log10|exp|exp2|sin|cos|tan|asin|acos|atan|atan2|radians|degrees|pi|regex_test|regex_replace|" +
"like|floor|ceil|round|abs|rand|sqrt|pow|length|count|min|max|average|avg|sum|product|median|variance_population|variance_sample|variance|percentile|" +
"bit_and|bit_or|bit_xor|bit_negate|bit_test|bit_popcount|bit_shift_left|bit_shift_right|bit_construct|bit_deconstruct|bit_to_string|bit_from_string|" +
"first|last|unique|outersection|interleave|in_range|jaccard|matches|merge|merge_recursive|has|attributes|keys|values|unset|unset_recursive|keep|keep_recursive|" +
"near|within|within_rectangle|is_in_polygon|distance|fulltext|stddev_sample|stddev_population|stddev|" +
"slice|nth|position|contains_array|translate|zip|call|apply|push|append|pop|shift|unshift|remove_value|remove_values|" +
"remove_nth|replace_nth|date_now|date_timestamp|date_iso8601|date_dayofweek|date_year|date_month|date_day|date_hour|" +
"date_minute|date_second|date_millisecond|date_dayofyear|date_isoweek|date_isoweekyear|date_leapyear|date_quarter|date_days_in_month|date_trunc|date_round|" +
"date_add|date_subtract|date_diff|date_compare|date_format|date_utctolocal|date_localtoutc|date_timezone|date_timezones|" +
"fail|passthru|v8|sleep|schema_get|schema_validate|shard_id|call_greenspun|version|noopt|noeval|not_null|" +
"first_list|first_document|parse_identifier|current_user|current_database|collection_count|pregel_result|" +
"collections|document|decode_rev|range|union|union_distinct|minus|intersection|flatten|is_same_collection|check_document|" +
"ltrim|rtrim|find_first|find_last|split|substitute|ipv4_to_number|ipv4_from_number|is_ipv4|md5|sha1|sha512|crc32|fnv64|hash|random_token|to_base64|" +
"to_hex|encode_uri_component|soundex|assert|warn|is_key|sorted|sorted_unique|count_distinct|count_unique|" +
"levenshtein_distance|levenshtein_match|regex_matches|regex_split|ngram_match|ngram_similarity|ngram_positional_similarity|uuid|" +
"tokens|exists|starts_with|phrase|min_match|bm25|tfidf|boost|analyzer|" +
"cosine_similarity|decay_exp|decay_gauss|decay_linear|l1_distance|l2_distance|minhash|minhash_count|minhash_error|minhash_match|" +
"geo_point|geo_multipoint|geo_polygon|geo_multipolygon|geo_linestring|geo_multilinestring|geo_contains|geo_intersects|" +
"geo_equals|geo_distance|geo_area|geo_in_range");
var keywordMapper = this.createKeywordMapper({
"support.function": builtinFunctions,
"keyword": keywords,
"constant.language": builtinConstants
}, "identifier", true);
this.$rules = {
"start": [{
token: "comment",
regex: "//.*$"
}, {
token: "string", // " string
regex: '".*?"'
}, {
token: "string", // ' string
regex: "'.*?'"
}, {
token: "constant.numeric", // float
regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
}, {
token: keywordMapper,
regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
}, {
token: "keyword.operator",
regex: "\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|="
}, {
token: "paren.lparen",
regex: "[\\(]"
}, {
token: "paren.rparen",
regex: "[\\)]"
}, {
token: "text",
regex: "\\s+"
}]
};
this.normalizeRules();
};
oop.inherits(AqlHighlightRules, TextHighlightRules);
exports.AqlHighlightRules = AqlHighlightRules;
});
define("ace/mode/aql",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/aql_highlight_rules"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var AqlHighlightRules = require("./aql_highlight_rules").AqlHighlightRules;
var Mode = function () {
this.HighlightRules = AqlHighlightRules;
this.$behaviour = this.$defaultBehaviour;
};
oop.inherits(Mode, TextMode);
(function () {
this.lineCommentStart = "//";
this.$id = "ace/mode/aql";
}).call(Mode.prototype);
exports.Mode = Mode;
}); (function() {
window.require(["ace/mode/aql"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

View File

@ -1,161 +1,138 @@
define("ace/mode/asciidoc_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { define("ace/mode/asciidoc_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var AsciidocHighlightRules = function () {
var AsciidocHighlightRules = function() {
var identifierRe = "[a-zA-Z\u00a1-\uffff]+\\b"; var identifierRe = "[a-zA-Z\u00a1-\uffff]+\\b";
this.$rules = { this.$rules = {
"start": [ "start": [
{token: "empty", regex: /$/}, { token: "empty", regex: /$/ },
{token: "literal", regex: /^\.{4,}\s*$/, next: "listingBlock"}, { token: "literal", regex: /^\.{4,}\s*$/, next: "listingBlock" },
{token: "literal", regex: /^-{4,}\s*$/, next: "literalBlock"}, { token: "literal", regex: /^-{4,}\s*$/, next: "literalBlock" },
{token: "string", regex: /^\+{4,}\s*$/, next: "passthroughBlock"}, { token: "string", regex: /^\+{4,}\s*$/, next: "passthroughBlock" },
{token: "keyword", regex: /^={4,}\s*$/}, { token: "keyword", regex: /^={4,}\s*$/ },
{token: "text", regex: /^\s*$/}, { token: "text", regex: /^\s*$/ },
{token: "empty", regex: "", next: "dissallowDelimitedBlock"} { token: "empty", regex: "", next: "dissallowDelimitedBlock" }
], ],
"dissallowDelimitedBlock": [ "dissallowDelimitedBlock": [
{include: "paragraphEnd"}, { include: "paragraphEnd" },
{token: "comment", regex: '^//.+$'}, { token: "comment", regex: '^//.+$' },
{token: "keyword", regex: "^(?:NOTE|TIP|IMPORTANT|WARNING|CAUTION):"}, { token: "keyword", regex: "^(?:NOTE|TIP|IMPORTANT|WARNING|CAUTION):" },
{ include: "listStart" },
{include: "listStart"}, { token: "literal", regex: /^\s+.+$/, next: "indentedBlock" },
{token: "literal", regex: /^\s+.+$/, next: "indentedBlock"}, { token: "empty", regex: "", next: "text" }
{token: "empty", regex: "", next: "text"}
], ],
"paragraphEnd": [ "paragraphEnd": [
{token: "doc.comment", regex: /^\/{4,}\s*$/, next: "commentBlock"}, { token: "doc.comment", regex: /^\/{4,}\s*$/, next: "commentBlock" },
{token: "tableBlock", regex: /^\s*[|!]=+\s*$/, next: "tableBlock"}, { token: "tableBlock", regex: /^\s*[|!]=+\s*$/, next: "tableBlock" },
{token: "keyword", regex: /^(?:--|''')\s*$/, next: "start"}, { token: "keyword", regex: /^(?:--|''')\s*$/, next: "start" },
{token: "option", regex: /^\[.*\]\s*$/, next: "start"}, { token: "option", regex: /^\[.*\]\s*$/, next: "start" },
{token: "pageBreak", regex: /^>{3,}$/, next: "start"}, { token: "pageBreak", regex: /^>{3,}$/, next: "start" },
{token: "literal", regex: /^\.{4,}\s*$/, next: "listingBlock"}, { token: "literal", regex: /^\.{4,}\s*$/, next: "listingBlock" },
{token: "titleUnderline", regex: /^(?:={2,}|-{2,}|~{2,}|\^{2,}|\+{2,})\s*$/, next: "start"}, { token: "titleUnderline", regex: /^(?:={2,}|-{2,}|~{2,}|\^{2,}|\+{2,})\s*$/, next: "start" },
{token: "singleLineTitle", regex: /^={1,5}\s+\S.*$/, next: "start"}, { token: "singleLineTitle", regex: /^={1,5}\s+\S.*$/, next: "start" },
{ token: "otherBlock", regex: /^(?:\*{2,}|_{2,})\s*$/, next: "start" },
{token: "otherBlock", regex: /^(?:\*{2,}|_{2,})\s*$/, next: "start"}, { token: "optionalTitle", regex: /^\.[^.\s].+$/, next: "start" }
{token: "optionalTitle", regex: /^\.[^.\s].+$/, next: "start"}
], ],
"listStart": [ "listStart": [
{token: "keyword", regex: /^\s*(?:\d+\.|[a-zA-Z]\.|[ixvmIXVM]+\)|\*{1,5}|-|\.{1,5})\s/, next: "listText"}, { token: "keyword", regex: /^\s*(?:\d+\.|[a-zA-Z]\.|[ixvmIXVM]+\)|\*{1,5}|-|\.{1,5})\s/, next: "listText" },
{token: "meta.tag", regex: /^.+(?::{2,4}|;;)(?: |$)/, next: "listText"}, { token: "meta.tag", regex: /^.+(?::{2,4}|;;)(?: |$)/, next: "listText" },
{token: "support.function.list.callout", regex: /^(?:<\d+>|\d+>|>) /, next: "text"}, { token: "support.function.list.callout", regex: /^(?:<\d+>|\d+>|>) /, next: "text" },
{token: "keyword", regex: /^\+\s*$/, next: "start"} { token: "keyword", regex: /^\+\s*$/, next: "start" }
], ],
"text": [ "text": [
{token: ["link", "variable.language"], regex: /((?:https?:\/\/|ftp:\/\/|file:\/\/|mailto:|callto:)[^\s\[]+)(\[.*?\])/}, { token: ["link", "variable.language"], regex: /((?:https?:\/\/|ftp:\/\/|file:\/\/|mailto:|callto:)[^\s\[]+)(\[.*?\])/ },
{token: "link", regex: /(?:https?:\/\/|ftp:\/\/|file:\/\/|mailto:|callto:)[^\s\[]+/}, { token: "link", regex: /(?:https?:\/\/|ftp:\/\/|file:\/\/|mailto:|callto:)[^\s\[]+/ },
{token: "link", regex: /\b[\w\.\/\-]+@[\w\.\/\-]+\b/}, { token: "link", regex: /\b[\w\.\/\-]+@[\w\.\/\-]+\b/ },
{include: "macros"}, { include: "macros" },
{include: "paragraphEnd"}, { include: "paragraphEnd" },
{token: "literal", regex:/\+{3,}/, next:"smallPassthrough"}, { token: "literal", regex: /\+{3,}/, next: "smallPassthrough" },
{token: "escape", regex: /\((?:C|TM|R)\)|\.{3}|->|<-|=>|<=|&#(?:\d+|x[a-fA-F\d]+);|(?: |^)--(?=\s+\S)/}, { token: "escape", regex: /\((?:C|TM|R)\)|\.{3}|->|<-|=>|<=|&#(?:\d+|x[a-fA-F\d]+);|(?: |^)--(?=\s+\S)/ },
{token: "escape", regex: /\\[_*'`+#]|\\{2}[_*'`+#]{2}/}, { token: "escape", regex: /\\[_*'`+#]|\\{2}[_*'`+#]{2}/ },
{token: "keyword", regex: /\s\+$/}, { token: "keyword", regex: /\s\+$/ },
{token: "text", regex: identifierRe}, { token: "text", regex: identifierRe },
{token: ["keyword", "string", "keyword"], { token: ["keyword", "string", "keyword"],
regex: /(<<[\w\d\-$]+,)(.*?)(>>|$)/}, regex: /(<<[\w\d\-$]+,)(.*?)(>>|$)/ },
{token: "keyword", regex: /<<[\w\d\-$]+,?|>>/}, { token: "keyword", regex: /<<[\w\d\-$]+,?|>>/ },
{token: "constant.character", regex: /\({2,3}.*?\){2,3}/}, { token: "constant.character", regex: /\({2,3}.*?\){2,3}/ },
{token: "keyword", regex: /\[\[.+?\]\]/}, { token: "keyword", regex: /\[\[.+?\]\]/ },
{token: "support", regex: /^\[{3}[\w\d =\-]+\]{3}/}, { token: "support", regex: /^\[{3}[\w\d =\-]+\]{3}/ },
{ include: "quotes" },
{include: "quotes"}, { token: "empty", regex: /^\s*$/, next: "start" }
{token: "empty", regex: /^\s*$/, next: "start"}
], ],
"listText": [ "listText": [
{include: "listStart"}, { include: "listStart" },
{include: "text"} { include: "text" }
], ],
"indentedBlock": [ "indentedBlock": [
{token: "literal", regex: /^[\s\w].+$/, next: "indentedBlock"}, { token: "literal", regex: /^[\s\w].+$/, next: "indentedBlock" },
{token: "literal", regex: "", next: "start"} { token: "literal", regex: "", next: "start" }
], ],
"listingBlock": [ "listingBlock": [
{token: "literal", regex: /^\.{4,}\s*$/, next: "dissallowDelimitedBlock"}, { token: "literal", regex: /^\.{4,}\s*$/, next: "dissallowDelimitedBlock" },
{token: "constant.numeric", regex: '<\\d+>'}, { token: "constant.numeric", regex: '<\\d+>' },
{token: "literal", regex: '[^<]+'}, { token: "literal", regex: '[^<]+' },
{token: "literal", regex: '<'} { token: "literal", regex: '<' }
], ],
"literalBlock": [ "literalBlock": [
{token: "literal", regex: /^-{4,}\s*$/, next: "dissallowDelimitedBlock"}, { token: "literal", regex: /^-{4,}\s*$/, next: "dissallowDelimitedBlock" },
{token: "constant.numeric", regex: '<\\d+>'}, { token: "constant.numeric", regex: '<\\d+>' },
{token: "literal", regex: '[^<]+'}, { token: "literal", regex: '[^<]+' },
{token: "literal", regex: '<'} { token: "literal", regex: '<' }
], ],
"passthroughBlock": [ "passthroughBlock": [
{token: "literal", regex: /^\+{4,}\s*$/, next: "dissallowDelimitedBlock"}, { token: "literal", regex: /^\+{4,}\s*$/, next: "dissallowDelimitedBlock" },
{token: "literal", regex: identifierRe + "|\\d+"}, { token: "literal", regex: identifierRe + "|\\d+" },
{include: "macros"}, { include: "macros" },
{token: "literal", regex: "."} { token: "literal", regex: "." }
], ],
"smallPassthrough": [ "smallPassthrough": [
{token: "literal", regex: /[+]{3,}/, next: "dissallowDelimitedBlock"}, { token: "literal", regex: /[+]{3,}/, next: "dissallowDelimitedBlock" },
{token: "literal", regex: /^\s*$/, next: "dissallowDelimitedBlock"}, { token: "literal", regex: /^\s*$/, next: "dissallowDelimitedBlock" },
{token: "literal", regex: identifierRe + "|\\d+"}, { token: "literal", regex: identifierRe + "|\\d+" },
{include: "macros"} { include: "macros" }
], ],
"commentBlock": [ "commentBlock": [
{token: "doc.comment", regex: /^\/{4,}\s*$/, next: "dissallowDelimitedBlock"}, { token: "doc.comment", regex: /^\/{4,}\s*$/, next: "dissallowDelimitedBlock" },
{token: "doc.comment", regex: '^.*$'} { token: "doc.comment", regex: '^.*$' }
], ],
"tableBlock": [ "tableBlock": [
{token: "tableBlock", regex: /^\s*\|={3,}\s*$/, next: "dissallowDelimitedBlock"}, { token: "tableBlock", regex: /^\s*\|={3,}\s*$/, next: "dissallowDelimitedBlock" },
{token: "tableBlock", regex: /^\s*!={3,}\s*$/, next: "innerTableBlock"}, { token: "tableBlock", regex: /^\s*!={3,}\s*$/, next: "innerTableBlock" },
{token: "tableBlock", regex: /\|/}, { token: "tableBlock", regex: /\|/ },
{include: "text", noEscape: true} { include: "text", noEscape: true }
], ],
"innerTableBlock": [ "innerTableBlock": [
{token: "tableBlock", regex: /^\s*!={3,}\s*$/, next: "tableBlock"}, { token: "tableBlock", regex: /^\s*!={3,}\s*$/, next: "tableBlock" },
{token: "tableBlock", regex: /^\s*|={3,}\s*$/, next: "dissallowDelimitedBlock"}, { token: "tableBlock", regex: /^\s*|={3,}\s*$/, next: "dissallowDelimitedBlock" },
{token: "tableBlock", regex: /!/} { token: "tableBlock", regex: /!/ }
], ],
"macros": [ "macros": [
{token: "macro", regex: /{[\w\-$]+}/}, { token: "macro", regex: /{[\w\-$]+}/ },
{token: ["text", "string", "text", "constant.character", "text"], regex: /({)([\w\-$]+)(:)?(.+)?(})/}, { token: ["text", "string", "text", "constant.character", "text"], regex: /({)([\w\-$]+)(:)?(.+)?(})/ },
{token: ["text", "markup.list.macro", "keyword", "string"], regex: /(\w+)(footnote(?:ref)?::?)([^\s\[]+)?(\[.*?\])?/}, { token: ["text", "markup.list.macro", "keyword", "string"], regex: /(\w+)(footnote(?:ref)?::?)([^\s\[]+)?(\[.*?\])?/ },
{token: ["markup.list.macro", "keyword", "string"], regex: /([a-zA-Z\-][\w\.\/\-]*::?)([^\s\[]+)(\[.*?\])?/}, { token: ["markup.list.macro", "keyword", "string"], regex: /([a-zA-Z\-][\w\.\/\-]*::?)([^\s\[]+)(\[.*?\])?/ },
{token: ["markup.list.macro", "keyword"], regex: /([a-zA-Z\-][\w\.\/\-]+::?)(\[.*?\])/}, { token: ["markup.list.macro", "keyword"], regex: /([a-zA-Z\-][\w\.\/\-]+::?)(\[.*?\])/ },
{token: "keyword", regex: /^:.+?:(?= |$)/} { token: "keyword", regex: /^:.+?:(?= |$)/ }
], ],
"quotes": [ "quotes": [
{token: "string.italic", regex: /__[^_\s].*?__/}, { token: "string.italic", regex: /__[^_\s].*?__/ },
{token: "string.italic", regex: quoteRule("_")}, { token: "string.italic", regex: quoteRule("_") },
{ token: "keyword.bold", regex: /\*\*[^*\s].*?\*\*/ },
{token: "keyword.bold", regex: /\*\*[^*\s].*?\*\*/}, { token: "keyword.bold", regex: quoteRule("\\*") },
{token: "keyword.bold", regex: quoteRule("\\*")}, { token: "literal", regex: quoteRule("\\+") },
{ token: "literal", regex: /\+\+[^+\s].*?\+\+/ },
{token: "literal", regex: quoteRule("\\+")}, { token: "literal", regex: /\$\$.+?\$\$/ },
{token: "literal", regex: /\+\+[^+\s].*?\+\+/}, { token: "literal", regex: quoteRule("`") },
{token: "literal", regex: /\$\$.+?\$\$/}, { token: "keyword", regex: quoteRule("^") },
{token: "literal", regex: quoteRule("`")}, { token: "keyword", regex: quoteRule("~") },
{ token: "keyword", regex: /##?/ },
{token: "keyword", regex: quoteRule("^")}, { token: "keyword", regex: /(?:\B|^)``|\b''/ }
{token: "keyword", regex: quoteRule("~")},
{token: "keyword", regex: /##?/},
{token: "keyword", regex: /(?:\B|^)``|\b''/}
] ]
}; };
function quoteRule(ch) { function quoteRule(ch) {
var prefix = /\w/.test(ch) ? "\\b" : "(?:\\B|^)"; var prefix = /\w/.test(ch) ? "\\b" : "(?:\\B|^)";
return prefix + ch + "[^" + ch + "].*?" + ch + "(?![\\w*])"; return prefix + ch + "[^" + ch + "].*?" + ch + "(?![\\w*])";
} }
var tokenMap = { var tokenMap = {
macro: "constant.character", macro: "constant.character",
tableBlock: "doc.comment", tableBlock: "doc.comment",
@ -169,49 +146,43 @@ var AsciidocHighlightRules = function() {
escape: "constant.language.escape", escape: "constant.language.escape",
link: "markup.underline.list" link: "markup.underline.list"
}; };
for (var state in this.$rules) { for (var state in this.$rules) {
var stateRules = this.$rules[state]; var stateRules = this.$rules[state];
for (var i = stateRules.length; i--; ) { for (var i = stateRules.length; i--;) {
var rule = stateRules[i]; var rule = stateRules[i];
if (rule.include || typeof rule == "string") { if (rule.include || typeof rule == "string") {
var args = [i, 1].concat(this.$rules[rule.include || rule]); var args = [i, 1].concat(this.$rules[rule.include || rule]);
if (rule.noEscape) { if (rule.noEscape) {
args = args.filter(function(x) { args = args.filter(function (x) {
return !x.next; return !x.next;
}); });
} }
stateRules.splice.apply(stateRules, args); stateRules.splice.apply(stateRules, args);
} else if (rule.token in tokenMap) { }
else if (rule.token in tokenMap) {
rule.token = tokenMap[rule.token]; rule.token = tokenMap[rule.token];
} }
} }
} }
}; };
oop.inherits(AsciidocHighlightRules, TextHighlightRules); oop.inherits(AsciidocHighlightRules, TextHighlightRules);
exports.AsciidocHighlightRules = AsciidocHighlightRules; exports.AsciidocHighlightRules = AsciidocHighlightRules;
}); });
define("ace/mode/folding/asciidoc",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module) { define("ace/mode/folding/asciidoc",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../../lib/oop"); var oop = require("../../lib/oop");
var BaseFoldMode = require("./fold_mode").FoldMode; var BaseFoldMode = require("./fold_mode").FoldMode;
var Range = require("../../range").Range; var Range = require("../../range").Range;
var FoldMode = exports.FoldMode = function () { };
var FoldMode = exports.FoldMode = function() {};
oop.inherits(FoldMode, BaseFoldMode); oop.inherits(FoldMode, BaseFoldMode);
(function () {
(function() {
this.foldingStartMarker = /^(?:\|={10,}|[\.\/=\-~^+]{4,}\s*$|={1,5} )/; this.foldingStartMarker = /^(?:\|={10,}|[\.\/=\-~^+]{4,}\s*$|={1,5} )/;
this.singleLineHeadingRe = /^={1,5}(?=\s+\S)/; this.singleLineHeadingRe = /^={1,5}(?=\s+\S)/;
this.getFoldWidget = function (session, foldStyle, row) {
this.getFoldWidget = function(session, foldStyle, row) {
var line = session.getLine(row); var line = session.getLine(row);
if (!this.foldingStartMarker.test(line)) if (!this.foldingStartMarker.test(line))
return ""; return "";
if (line[0] == "=") { if (line[0] == "=") {
if (this.singleLineHeadingRe.test(line)) if (this.singleLineHeadingRe.test(line))
return "start"; return "start";
@ -223,8 +194,7 @@ oop.inherits(FoldMode, BaseFoldMode);
return "end"; return "end";
return "start"; return "start";
}; };
this.getFoldWidgetRange = function (session, foldStyle, row) {
this.getFoldWidgetRange = function(session, foldStyle, row) {
var line = session.getLine(row); var line = session.getLine(row);
var startColumn = line.length; var startColumn = line.length;
var maxRow = session.getLength(); var maxRow = session.getLength();
@ -232,14 +202,12 @@ oop.inherits(FoldMode, BaseFoldMode);
var endRow = row; var endRow = row;
if (!line.match(this.foldingStartMarker)) if (!line.match(this.foldingStartMarker))
return; return;
var token; var token;
function getTokenType(row) { function getTokenType(row) {
token = session.getTokens(row)[0]; token = session.getTokens(row)[0];
return token && token.type; return token && token.type;
} }
var levels = ["=", "-", "~", "^", "+"];
var levels = ["=","-","~","^","+"];
var heading = "markup.heading"; var heading = "markup.heading";
var singleLineHeadingRe = this.singleLineHeadingRe; var singleLineHeadingRe = this.singleLineHeadingRe;
function getLevel() { function getLevel() {
@ -253,7 +221,6 @@ oop.inherits(FoldMode, BaseFoldMode);
} }
return level; return level;
} }
if (getTokenType(row) == heading) { if (getTokenType(row) == heading) {
var startHeadingLevel = getLevel(); var startHeadingLevel = getLevel();
while (++row < maxRow) { while (++row < maxRow) {
@ -263,23 +230,21 @@ oop.inherits(FoldMode, BaseFoldMode);
if (level <= startHeadingLevel) if (level <= startHeadingLevel)
break; break;
} }
var isSingleLineHeading = token && token.value.match(this.singleLineHeadingRe); var isSingleLineHeading = token && token.value.match(this.singleLineHeadingRe);
endRow = isSingleLineHeading ? row - 1 : row - 2; endRow = isSingleLineHeading ? row - 1 : row - 2;
if (endRow > startRow) { if (endRow > startRow) {
while (endRow > startRow && (!getTokenType(endRow) || token.value[0] == "[")) while (endRow > startRow && (!getTokenType(endRow) || token.value[0] == "["))
endRow--; endRow--;
} }
if (endRow > startRow) { if (endRow > startRow) {
var endColumn = session.getLine(endRow).length; var endColumn = session.getLine(endRow).length;
return new Range(startRow, startColumn, endRow, endColumn); return new Range(startRow, startColumn, endRow, endColumn);
} }
} else { }
else {
var state = session.bgTokenizer.getState(row); var state = session.bgTokenizer.getState(row);
if (state == "dissallowDelimitedBlock") { if (state == "dissallowDelimitedBlock") {
while (row -- > 0) { while (row-- > 0) {
if (session.bgTokenizer.getState(row).lastIndexOf("Block") == -1) if (session.bgTokenizer.getState(row).lastIndexOf("Block") == -1)
break; break;
} }
@ -288,7 +253,8 @@ oop.inherits(FoldMode, BaseFoldMode);
var endColumn = session.getLine(row).length; var endColumn = session.getLine(row).length;
return new Range(endRow, 5, startRow, startColumn - 5); return new Range(endRow, 5, startRow, startColumn - 5);
} }
} else { }
else {
while (++row < maxRow) { while (++row < maxRow) {
if (session.bgTokenizer.getState(row) == "dissallowDelimitedBlock") if (session.bgTokenizer.getState(row) == "dissallowDelimitedBlock")
break; break;
@ -301,42 +267,45 @@ oop.inherits(FoldMode, BaseFoldMode);
} }
} }
}; };
}).call(FoldMode.prototype); }).call(FoldMode.prototype);
}); });
define("ace/mode/asciidoc",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/asciidoc_highlight_rules","ace/mode/folding/asciidoc"], function(require, exports, module) { define("ace/mode/asciidoc",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/asciidoc_highlight_rules","ace/mode/folding/asciidoc"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextMode = require("./text").Mode; var TextMode = require("./text").Mode;
var AsciidocHighlightRules = require("./asciidoc_highlight_rules").AsciidocHighlightRules; var AsciidocHighlightRules = require("./asciidoc_highlight_rules").AsciidocHighlightRules;
var AsciidocFoldMode = require("./folding/asciidoc").FoldMode; var AsciidocFoldMode = require("./folding/asciidoc").FoldMode;
var Mode = function () {
var Mode = function() {
this.HighlightRules = AsciidocHighlightRules; this.HighlightRules = AsciidocHighlightRules;
this.foldingRules = new AsciidocFoldMode(); this.foldingRules = new AsciidocFoldMode();
}; };
oop.inherits(Mode, TextMode); oop.inherits(Mode, TextMode);
(function () {
(function() {
this.type = "text"; this.type = "text";
this.getNextLineIndent = function(state, line, tab) { this.getNextLineIndent = function (state, line, tab) {
if (state == "listblock") { if (state == "listblock") {
var match = /^((?:.+)?)([-+*][ ]+)/.exec(line); var match = /^((?:.+)?)([-+*][ ]+)/.exec(line);
if (match) { if (match) {
return new Array(match[1].length + 1).join(" ") + match[2]; return new Array(match[1].length + 1).join(" ") + match[2];
} else { }
else {
return ""; return "";
} }
} else { }
else {
return this.$getIndent(line); return this.$getIndent(line);
} }
}; };
this.$id = "ace/mode/asciidoc"; this.$id = "ace/mode/asciidoc";
}).call(Mode.prototype); }).call(Mode.prototype);
exports.Mode = Mode; exports.Mode = Mode;
});
}); (function() {
window.require(["ace/mode/asciidoc"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

View File

@ -0,0 +1,357 @@
define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var DocCommentHighlightRules = function () {
this.$rules = {
"start": [
{
token: "comment.doc.tag",
regex: "@\\w+(?=\\s|$)"
}, DocCommentHighlightRules.getTagRule(), {
defaultToken: "comment.doc",
caseInsensitive: true
}
]
};
};
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getTagRule = function (start) {
return {
token: "comment.doc.tag.storage.type",
regex: "\\b(?:TODO|FIXME|XXX|HACK)\\b"
};
};
DocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
regex: "\\/\\*(?=\\*)",
next: start
};
};
DocCommentHighlightRules.getEndRule = function (start) {
return {
token: "comment.doc", // closing comment
regex: "\\*\\/",
next: start
};
};
exports.DocCommentHighlightRules = DocCommentHighlightRules;
});
define("ace/mode/asl_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var ASLHighlightRules = function () {
var keywords = ("Default|DefinitionBlock|Device|Method|Else|ElseIf|For|Function|If|Include|Method|Return|" +
"Scope|Switch|Case|While|Break|BreakPoint|Continue|NoOp|Wait|True|False|" +
"AccessAs|Acquire|Alias|BankField|Buffer|Concatenate|ConcatenateResTemplate|" +
"CondRefOf|Connection|CopyObject|CreateBitField|CreateByteField|CreateDWordField|" +
"CreateField|CreateQWordField|CreateWordField|DataTableRegion|Debug|" +
"DMA|DWordIO|DWordMemory|DWordSpace|EisaId|EISAID|EndDependentFn|Event|ExtendedIO|" +
"ExtendedMemory|ExtendedSpace|External|Fatal|Field|FindSetLeftBit|FindSetRightBit|" +
"FixedDMA|FixedIO|Fprintf|FromBCD|GpioInt|GpioIo|I2CSerialBusV2|IndexField|" +
"Interrupt|IO|IRQ|IRQNoFlags|Load|LoadTable|Match|Memory32|Memory32Fixed|" +
"Mid|Mutex|Name|Notify|Offset|ObjectType|OperationRegion|Package|PowerResource|Printf|" +
"QWordIO|QWordMemory|QWordSpace|RawDataBuffer|Register|Release|Reset|ResourceTemplate|" +
"Signal|SizeOf|Sleep|SPISerialBusV2|Stall|StartDependentFn|StartDependentFnNoPri|" +
"Store|ThermalZone|Timer|ToBCD|ToBuffer|ToDecimalString|ToInteger|ToPLD|ToString|" +
"ToUUID|UARTSerialBusV2|Unicode|Unload|VendorLong|VendorShort|WordBusNumber|WordIO|" +
"WordSpace");
var keywordOperators = ("Add|And|Decrement|Divide|Increment|Index|LAnd|LEqual|LGreater|LGreaterEqual|" +
"LLess|LLessEqual|LNot|LNotEqual|LOr|Mod|Multiply|NAnd|NOr|Not|Or|RefOf|Revision|" +
"ShiftLeft|ShiftRight|Subtract|XOr|DerefOf");
var flags = ("AttribQuick|AttribSendReceive|AttribByte|AttribBytes|AttribRawBytes|" +
"AttribRawProcessBytes|AttribWord|AttribBlock|AttribProcessCall|AttribBlockProcessCall|" +
"AnyAcc|ByteAcc|WordAcc|DWordAcc|QWordAcc|BufferAcc|" +
"AddressRangeMemory|AddressRangeReserved|AddressRangeNVS|AddressRangeACPI|" +
"RegionSpaceKeyword|FFixedHW|PCC|" +
"AddressingMode7Bit|AddressingMode10Bit|" +
"DataBitsFive|DataBitsSix|DataBitsSeven|DataBitsEight|DataBitsNine|" +
"BusMaster|NotBusMaster|" +
"ClockPhaseFirst|ClockPhaseSecond|ClockPolarityLow|ClockPolarityHigh|" +
"SubDecode|PosDecode|" +
"BigEndianing|LittleEndian|" +
"FlowControlNone|FlowControlXon|FlowControlHardware|" +
"Edge|Level|ActiveHigh|ActiveLow|ActiveBoth|Decode16|Decode10|" +
"IoRestrictionNone|IoRestrictionInputOnly|IoRestrictionOutputOnly|" +
"IoRestrictionNoneAndPreserve|Lock|NoLock|MTR|MEQ|MLE|MLT|MGE|MGT|" +
"MaxFixed|MaxNotFixed|Cacheable|WriteCombining|Prefetchable|NonCacheable|" +
"MinFixed|MinNotFixed|" +
"ParityTypeNone|ParityTypeSpace|ParityTypeMark|ParityTypeOdd|ParityTypeEven|" +
"PullDefault|PullUp|PullDown|PullNone|PolarityHigh|PolarityLow|" +
"ISAOnlyRanges|NonISAOnlyRanges|EntireRange|ReadWrite|ReadOnly|" +
"UserDefRegionSpace|SystemIO|SystemMemory|PCI_Config|EmbeddedControl|" +
"SMBus|SystemCMOS|PciBarTarget|IPMI|GeneralPurposeIO|GenericSerialBus|" +
"ResourceConsumer|ResourceProducer|Serialized|NotSerialized|" +
"Shared|Exclusive|SharedAndWake|ExclusiveAndWake|ControllerInitiated|DeviceInitiated|" +
"StopBitsZero|StopBitsOne|StopBitsOnePlusHalf|StopBitsTwo|" +
"Width8Bit|Width16Bit|Width32Bit|Width64Bit|Width128Bit|Width256Bit|" +
"SparseTranslation|DenseTranslation|TypeTranslation|TypeStatic|" +
"Preserve|WriteAsOnes|WriteAsZeros|Transfer8|Transfer16|Transfer8_16|" +
"ThreeWireMode|FourWireMode");
var storageTypes = ("UnknownObj|IntObj|StrObj|BuffObj|PkgObj|FieldUnitObj|DeviceObj|" +
"EventObj|MethodObj|MutexObj|OpRegionObj|PowerResObj|ProcessorObj|" +
"ThermalZoneObj|BuffFieldObj|DDBHandleObj");
var builtinConstants = ("__FILE__|__PATH__|__LINE__|__DATE__|__IASL__");
var strNumbers = ("One|Ones|Zero");
var deprecated = ("Memory24|Processor");
var keywordMapper = this.createKeywordMapper({
"keyword": keywords,
"constant.numeric": strNumbers,
"keyword.operator": keywordOperators,
"constant.language": builtinConstants,
"storage.type": storageTypes,
"constant.library": flags,
"invalid.deprecated": deprecated
}, "identifier");
this.$rules = {
"start": [
{
token: "comment",
regex: "\\/\\/.*$"
},
DocCommentHighlightRules.getStartRule("doc-start"),
{
token: "comment", // multi line comment
regex: "\\/\\*",
next: "comment"
},
DocCommentHighlightRules.getStartRule("doc-start"),
{
token: "comment", // ignored fields / comments
regex: "\\\[",
next: "ignoredfield"
}, {
token: "variable",
regex: "\\Local[0-7]|\\Arg[0-6]"
}, {
token: "keyword", // pre-compiler directives
regex: "#\\s*(?:define|elif|else|endif|error|if|ifdef|ifndef|include|includebuffer|line|pragma|undef|warning)\\b",
next: "directive"
}, {
token: "string", // single line
regex: '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
}, {
token: "constant.character", // single line
regex: "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
}, {
token: "constant.numeric", // hex
regex: /0[xX][0-9a-fA-F]+\b/
}, {
token: "constant.numeric",
regex: /[0-9]+\b/
}, {
token: keywordMapper,
regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
}, {
token: "keyword.operator",
regex: /[!\~\*\/%+-<>\^|=&]/
}, {
token: "lparen",
regex: "[[({]"
}, {
token: "rparen",
regex: "[\\])}]"
}, {
token: "text",
regex: "\\s+"
}
],
"comment": [
{
token: "comment", // closing comment
regex: "\\*\\/",
next: "start"
}, {
defaultToken: "comment"
}
],
"ignoredfield": [
{
token: "comment", // closing ignored fields / comments
regex: "\\\]",
next: "start"
}, {
defaultToken: "comment"
}
],
"directive": [
{
token: "constant.other.multiline",
regex: /\\/
},
{
token: "constant.other.multiline",
regex: /.*\\/
},
{
token: "constant.other",
regex: "\\s*<.+?>*s",
next: "start"
},
{
token: "constant.other", // single line
regex: '\\s*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]*s',
next: "start"
},
{
token: "constant.other", // single line
regex: "\\s*['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']",
next: "start"
},
{
token: "constant.other",
regex: /[^\\\/]+/,
next: "start"
}
]
};
this.embedRules(DocCommentHighlightRules, "doc-", [DocCommentHighlightRules.getEndRule("start")]);
};
oop.inherits(ASLHighlightRules, TextHighlightRules);
exports.ASLHighlightRules = ASLHighlightRules;
});
define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var Range = require("../../range").Range;
var BaseFoldMode = require("./fold_mode").FoldMode;
var FoldMode = exports.FoldMode = function (commentRegex) {
if (commentRegex) {
this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
}
};
oop.inherits(FoldMode, BaseFoldMode);
(function () {
this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
this._getFoldWidgetBase = this.getFoldWidget;
this.getFoldWidget = function (session, foldStyle, row) {
var line = session.getLine(row);
if (this.singleLineBlockCommentRe.test(line)) {
if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
return "";
}
var fw = this._getFoldWidgetBase(session, foldStyle, row);
if (!fw && this.startRegionRe.test(line))
return "start"; // lineCommentRegionStart
return fw;
};
this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
var line = session.getLine(row);
if (this.startRegionRe.test(line))
return this.getCommentRegionBlock(session, line, row);
var match = line.match(this.foldingStartMarker);
if (match) {
var i = match.index;
if (match[1])
return this.openingBracketBlock(session, match[1], row, i);
var range = session.getCommentFoldRange(row, i + match[0].length, 1);
if (range && !range.isMultiLine()) {
if (forceMultiline) {
range = this.getSectionRange(session, row);
}
else if (foldStyle != "all")
range = null;
}
return range;
}
if (foldStyle === "markbegin")
return;
var match = line.match(this.foldingStopMarker);
if (match) {
var i = match.index + match[0].length;
if (match[1])
return this.closingBracketBlock(session, match[1], row, i);
return session.getCommentFoldRange(row, i, -1);
}
};
this.getSectionRange = function (session, row) {
var line = session.getLine(row);
var startIndent = line.search(/\S/);
var startRow = row;
var startColumn = line.length;
row = row + 1;
var endRow = row;
var maxRow = session.getLength();
while (++row < maxRow) {
line = session.getLine(row);
var indent = line.search(/\S/);
if (indent === -1)
continue;
if (startIndent > indent)
break;
var subRange = this.getFoldWidgetRange(session, "all", row);
if (subRange) {
if (subRange.start.row <= startRow) {
break;
}
else if (subRange.isMultiLine()) {
row = subRange.end.row;
}
else if (startIndent == indent) {
break;
}
}
endRow = row;
}
return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
};
this.getCommentRegionBlock = function (session, line, row) {
var startColumn = line.search(/\s*$/);
var maxRow = session.getLength();
var startRow = row;
var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
var depth = 1;
while (++row < maxRow) {
line = session.getLine(row);
var m = re.exec(line);
if (!m)
continue;
if (m[1])
depth--;
else
depth++;
if (!depth)
break;
}
var endRow = row;
if (endRow > startRow) {
return new Range(startRow, startColumn, endRow, line.length);
}
};
}).call(FoldMode.prototype);
});
define("ace/mode/asl",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/asl_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var ASLHighlightRules = require("./asl_highlight_rules").ASLHighlightRules;
var FoldMode = require("./folding/cstyle").FoldMode;
var Mode = function () {
this.HighlightRules = ASLHighlightRules;
this.foldingRules = new FoldMode();
this.$behaviour = this.$defaultBehaviour;
};
oop.inherits(Mode, TextMode);
(function () {
this.$id = "ace/mode/asl";
}).call(Mode.prototype);
exports.Mode = Mode;
}); (function() {
window.require(["ace/mode/asl"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

View File

@ -1,136 +1,116 @@
define("ace/mode/assembly_x86_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { define("ace/mode/assembly_x86_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){/* This file was autogenerated from Assembly x86.tmLanguage (uuid: ) */
"use strict"; "use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var AssemblyX86HighlightRules = function () {
var AssemblyX86HighlightRules = function() { this.$rules = { start: [{ token: 'keyword.control.assembly',
regex: '\\b(?:aaa|aad|aam|aas|adc|add|addpd|addps|addsd|addss|addsubpd|addsubps|aesdec|aesdeclast|aesenc|aesenclast|aesimc|aeskeygenassist|and|andpd|andps|andnpd|andnps|arpl|blendpd|blendps|blendvpd|blendvps|bound|bsf|bsr|bswap|bt|btc|btr|bts|cbw|cwde|cdqe|clc|cld|cflush|clts|cmc|cmov(?:n?e|ge?|ae?|le?|be?|n?o|n?z)|cmp|cmppd|cmpps|cmps|cnpsb|cmpsw|cmpsd|cmpsq|cmpss|cmpxchg|cmpxchg8b|cmpxchg16b|comisd|comiss|cpuid|crc32|cvtdq2pd|cvtdq2ps|cvtpd2dq|cvtpd2pi|cvtpd2ps|cvtpi2pd|cvtpi2ps|cvtps2dq|cvtps2pd|cvtps2pi|cvtsd2si|cvtsd2ss|cvts2sd|cvtsi2ss|cvtss2sd|cvtss2si|cvttpd2dq|cvtpd2pi|cvttps2dq|cvttps2pi|cvttps2dq|cvttps2pi|cvttsd2si|cvttss2si|cwd|cdq|cqo|daa|das|dec|div|divpd|divps|divsd|divss|dppd|dpps|emms|enter|extractps|f2xm1|fabs|fadd|faddp|fiadd|fbld|fbstp|fchs|fclex|fnclex|fcmov(?:n?e|ge?|ae?|le?|be?|n?o|n?z)|fcom|fcmop|fcompp|fcomi|fcomip|fucomi|fucomip|fcos|fdecstp|fdiv|fdivp|fidiv|fdivr|fdivrp|fidivr|ffree|ficom|ficomp|fild|fincstp|finit|fnint|fist|fistp|fisttp|fld|fld1|fldl2t|fldl2e|fldpi|fldlg2|fldln2|fldz|fldcw|fldenv|fmul|fmulp|fimul|fnop|fpatan|fprem|fprem1|fptan|frndint|frstor|fsave|fnsave|fscale|fsin|fsincos|fsqrt|fst|fstp|fstcw|fnstcw|fstenv|fnstenv|fsts|fnstsw|fsub|fsubp|fisub|fsubr|fsubrp|fisubr|ftst|fucom|fucomp|fucompp|fxam|fxch|fxrstor|fxsave|fxtract|fyl2x|fyl2xp1|haddpd|haddps|husbpd|hsubps|idiv|imul|in|inc|ins|insb|insw|insd|insertps|int|into|invd|invplg|invpcid|iret|iretd|iretq|lahf|lar|lddqu|ldmxcsr|lds|les|lfs|lgs|lss|lea|leave|lfence|lgdt|lidt|llgdt|lmsw|lock|lods|lodsb|lodsw|lodsd|lodsq|lsl|ltr|maskmovdqu|maskmovq|maxpd|maxps|maxsd|maxss|mfence|minpd|minps|minsd|minss|monitor|mov|movapd|movaps|movbe|movd|movq|movddup|movdqa|movdqu|movq2q|movhlps|movhpd|movhps|movlhps|movlpd|movlps|movmskpd|movmskps|movntdqa|movntdq|movnti|movntpd|movntps|movntq|movq|movq2dq|movs|movsb|movsw|movsd|movsq|movsd|movshdup|movsldup|movss|movsx|movsxd|movupd|movups|movzx|mpsadbw|mul|mulpd|mulps|mulsd|mulss|mwait|neg|not|or|orpd|orps|out|outs|outsb|outsw|outsd|pabsb|pabsw|pabsd|packsswb|packssdw|packusdw|packuswbpaddb|paddw|paddd|paddq|paddsb|paddsw|paddusb|paddusw|palignr|pand|pandn|pause|pavgb|pavgw|pblendvb|pblendw|pclmulqdq|pcmpeqb|pcmpeqw|pcmpeqd|pcmpeqq|pcmpestri|pcmpestrm|pcmptb|pcmptgw|pcmpgtd|pcmpgtq|pcmpistri|pcmpisrm|pextrb|pextrd|pextrq|pextrw|phaddw|phaddd|phaddsw|phinposuw|phsubw|phsubd|phsubsw|pinsrb|pinsrd|pinsrq|pinsrw|pmaddubsw|pmadddwd|pmaxsb|pmaxsd|pmaxsw|pmaxsw|pmaxub|pmaxud|pmaxuw|pminsb|pminsd|pminsw|pminub|pminud|pminuw|pmovmskb|pmovsx|pmovzx|pmuldq|pmulhrsw|pmulhuw|pmulhw|pmulld|pmullw|pmuludw|pop|popa|popad|popcnt|popf|popfd|popfq|por|prefetch|psadbw|pshufb|pshufd|pshufhw|pshuflw|pshufw|psignb|psignw|psignd|pslldq|psllw|pslld|psllq|psraw|psrad|psrldq|psrlw|psrld|psrlq|psubb|psubw|psubd|psubq|psubsb|psubsw|psubusb|psubusw|test|ptest|punpckhbw|punpckhwd|punpckhdq|punpckhddq|punpcklbw|punpcklwd|punpckldq|punpckldqd|push|pusha|pushad|pushf|pushfd|pxor|prcl|rcr|rol|ror|rcpps|rcpss|rdfsbase|rdgsbase|rdmsr|rdpmc|rdrand|rdtsc|rdtscp|rep|repe|repz|repne|repnz|roundpd|roundps|roundsd|roundss|rsm|rsqrps|rsqrtss|sahf|sal|sar|shl|shr|sbb|scas|scasb|scasw|scasd|set(?:n?e|ge?|ae?|le?|be?|n?o|n?z)|sfence|sgdt|shld|shrd|shufpd|shufps|sidt|sldt|smsw|sqrtpd|sqrtps|sqrtsd|sqrtss|stc|std|stmxcsr|stos|stosb|stosw|stosd|stosq|str|sub|subpd|subps|subsd|subss|swapgs|syscall|sysenter|sysexit|sysret|teset|ucomisd|ucomiss|ud2|unpckhpd|unpckhps|unpcklpd|unpcklps|vbroadcast|vcvtph2ps|vcvtp2sph|verr|verw|vextractf128|vinsertf128|vmaskmov|vpermilpd|vpermilps|vperm2f128|vtestpd|vtestps|vzeroall|vzeroupper|wait|fwait|wbinvd|wrfsbase|wrgsbase|wrmsr|xadd|xchg|xgetbv|xlat|xlatb|xor|xorpd|xorps|xrstor|xsave|xsaveopt|xsetbv|lzcnt|extrq|insertq|movntsd|movntss|vfmaddpd|vfmaddps|vfmaddsd|vfmaddss|vfmaddsubbpd|vfmaddsubps|vfmsubaddpd|vfmsubaddps|vfmsubpd|vfmsubps|vfmsubsd|vfnmaddpd|vfnmaddps|vfnmaddsd|vfnmaddss|vfnmsubpd|vfnmusbps|vfnmusbsd|vfnmusbss|cvt|xor|cli|sti|hlt|nop|lock|wait|enter|leave|ret|loop(?:n?e|n?z)?|call|j(?:mp|n?e|ge?|ae?|le?|be?|n?o|n?z))\\b',
this.$rules = { start: caseInsensitive: true },
[ { token: 'keyword.control.assembly', { token: 'variable.parameter.register.assembly',
regex: '\\b(?:aaa|aad|aam|aas|adc|add|addpd|addps|addsd|addss|addsubpd|addsubps|aesdec|aesdeclast|aesenc|aesenclast|aesimc|aeskeygenassist|and|andpd|andps|andnpd|andnps|arpl|blendpd|blendps|blendvpd|blendvps|bound|bsf|bsr|bswap|bt|btc|btr|bts|cbw|cwde|cdqe|clc|cld|cflush|clts|cmc|cmov(?:n?e|ge?|ae?|le?|be?|n?o|n?z)|cmp|cmppd|cmpps|cmps|cnpsb|cmpsw|cmpsd|cmpsq|cmpss|cmpxchg|cmpxchg8b|cmpxchg16b|comisd|comiss|cpuid|crc32|cvtdq2pd|cvtdq2ps|cvtpd2dq|cvtpd2pi|cvtpd2ps|cvtpi2pd|cvtpi2ps|cvtps2dq|cvtps2pd|cvtps2pi|cvtsd2si|cvtsd2ss|cvts2sd|cvtsi2ss|cvtss2sd|cvtss2si|cvttpd2dq|cvtpd2pi|cvttps2dq|cvttps2pi|cvttps2dq|cvttps2pi|cvttsd2si|cvttss2si|cwd|cdq|cqo|daa|das|dec|div|divpd|divps|divsd|divss|dppd|dpps|emms|enter|extractps|f2xm1|fabs|fadd|faddp|fiadd|fbld|fbstp|fchs|fclex|fnclex|fcmov(?:n?e|ge?|ae?|le?|be?|n?o|n?z)|fcom|fcmop|fcompp|fcomi|fcomip|fucomi|fucomip|fcos|fdecstp|fdiv|fdivp|fidiv|fdivr|fdivrp|fidivr|ffree|ficom|ficomp|fild|fincstp|finit|fnint|fist|fistp|fisttp|fld|fld1|fldl2t|fldl2e|fldpi|fldlg2|fldln2|fldz|fldcw|fldenv|fmul|fmulp|fimul|fnop|fpatan|fprem|fprem1|fptan|frndint|frstor|fsave|fnsave|fscale|fsin|fsincos|fsqrt|fst|fstp|fstcw|fnstcw|fstenv|fnstenv|fsts|fnstsw|fsub|fsubp|fisub|fsubr|fsubrp|fisubr|ftst|fucom|fucomp|fucompp|fxam|fxch|fxrstor|fxsave|fxtract|fyl2x|fyl2xp1|haddpd|haddps|husbpd|hsubps|idiv|imul|in|inc|ins|insb|insw|insd|insertps|int|into|invd|invplg|invpcid|iret|iretd|iretq|lahf|lar|lddqu|ldmxcsr|lds|les|lfs|lgs|lss|lea|leave|lfence|lgdt|lidt|llgdt|lmsw|lock|lods|lodsb|lodsw|lodsd|lodsq|lsl|ltr|maskmovdqu|maskmovq|maxpd|maxps|maxsd|maxss|mfence|minpd|minps|minsd|minss|monitor|mov|movapd|movaps|movbe|movd|movq|movddup|movdqa|movdqu|movq2q|movhlps|movhpd|movhps|movlhps|movlpd|movlps|movmskpd|movmskps|movntdqa|movntdq|movnti|movntpd|movntps|movntq|movq|movq2dq|movs|movsb|movsw|movsd|movsq|movsd|movshdup|movsldup|movss|movsx|movsxd|movupd|movups|movzx|mpsadbw|mul|mulpd|mulps|mulsd|mulss|mwait|neg|not|or|orpd|orps|out|outs|outsb|outsw|outsd|pabsb|pabsw|pabsd|packsswb|packssdw|packusdw|packuswbpaddb|paddw|paddd|paddq|paddsb|paddsw|paddusb|paddusw|palignr|pand|pandn|pause|pavgb|pavgw|pblendvb|pblendw|pclmulqdq|pcmpeqb|pcmpeqw|pcmpeqd|pcmpeqq|pcmpestri|pcmpestrm|pcmptb|pcmptgw|pcmpgtd|pcmpgtq|pcmpistri|pcmpisrm|pextrb|pextrd|pextrq|pextrw|phaddw|phaddd|phaddsw|phinposuw|phsubw|phsubd|phsubsw|pinsrb|pinsrd|pinsrq|pinsrw|pmaddubsw|pmadddwd|pmaxsb|pmaxsd|pmaxsw|pmaxsw|pmaxub|pmaxud|pmaxuw|pminsb|pminsd|pminsw|pminub|pminud|pminuw|pmovmskb|pmovsx|pmovzx|pmuldq|pmulhrsw|pmulhuw|pmulhw|pmulld|pmullw|pmuludw|pop|popa|popad|popcnt|popf|popfd|popfq|por|prefetch|psadbw|pshufb|pshufd|pshufhw|pshuflw|pshufw|psignb|psignw|psignd|pslldq|psllw|pslld|psllq|psraw|psrad|psrldq|psrlw|psrld|psrlq|psubb|psubw|psubd|psubq|psubsb|psubsw|psubusb|psubusw|test|ptest|punpckhbw|punpckhwd|punpckhdq|punpckhddq|punpcklbw|punpcklwd|punpckldq|punpckldqd|push|pusha|pushad|pushf|pushfd|pxor|prcl|rcr|rol|ror|rcpps|rcpss|rdfsbase|rdgsbase|rdmsr|rdpmc|rdrand|rdtsc|rdtscp|rep|repe|repz|repne|repnz|roundpd|roundps|roundsd|roundss|rsm|rsqrps|rsqrtss|sahf|sal|sar|shl|shr|sbb|scas|scasb|scasw|scasd|set(?:n?e|ge?|ae?|le?|be?|n?o|n?z)|sfence|sgdt|shld|shrd|shufpd|shufps|sidt|sldt|smsw|sqrtpd|sqrtps|sqrtsd|sqrtss|stc|std|stmxcsr|stos|stosb|stosw|stosd|stosq|str|sub|subpd|subps|subsd|subss|swapgs|syscall|sysenter|sysexit|sysret|teset|ucomisd|ucomiss|ud2|unpckhpd|unpckhps|unpcklpd|unpcklps|vbroadcast|vcvtph2ps|vcvtp2sph|verr|verw|vextractf128|vinsertf128|vmaskmov|vpermilpd|vpermilps|vperm2f128|vtestpd|vtestps|vzeroall|vzeroupper|wait|fwait|wbinvd|wrfsbase|wrgsbase|wrmsr|xadd|xchg|xgetbv|xlat|xlatb|xor|xorpd|xorps|xrstor|xsave|xsaveopt|xsetbv|lzcnt|extrq|insertq|movntsd|movntss|vfmaddpd|vfmaddps|vfmaddsd|vfmaddss|vfmaddsubbpd|vfmaddsubps|vfmsubaddpd|vfmsubaddps|vfmsubpd|vfmsubps|vfmsubsd|vfnmaddpd|vfnmaddps|vfnmaddsd|vfnmaddss|vfnmsubpd|vfnmusbps|vfnmusbsd|vfnmusbss|cvt|xor|cli|sti|hlt|nop|lock|wait|enter|leave|ret|loop(?:n?e|n?z)?|call|j(?:mp|n?e|ge?|ae?|le?|be?|n?o|n?z))\\b', regex: '\\b(?:CS|DS|ES|FS|GS|SS|RAX|EAX|RBX|EBX|RCX|ECX|RDX|EDX|RCX|RIP|EIP|IP|RSP|ESP|SP|RSI|ESI|SI|RDI|EDI|DI|RFLAGS|EFLAGS|FLAGS|R8-15|(?:Y|X)MM(?:[0-9]|10|11|12|13|14|15)|(?:A|B|C|D)(?:X|H|L)|CR(?:[0-4]|DR(?:[0-7]|TR6|TR7|EFER)))\\b',
caseInsensitive: true }, caseInsensitive: true },
{ token: 'variable.parameter.register.assembly', { token: 'constant.character.decimal.assembly',
regex: '\\b(?:CS|DS|ES|FS|GS|SS|RAX|EAX|RBX|EBX|RCX|ECX|RDX|EDX|RCX|RIP|EIP|IP|RSP|ESP|SP|RSI|ESI|SI|RDI|EDI|DI|RFLAGS|EFLAGS|FLAGS|R8-15|(?:Y|X)MM(?:[0-9]|10|11|12|13|14|15)|(?:A|B|C|D)(?:X|H|L)|CR(?:[0-4]|DR(?:[0-7]|TR6|TR7|EFER)))\\b', regex: '\\b[0-9]+\\b' },
caseInsensitive: true }, { token: 'constant.character.hexadecimal.assembly',
{ token: 'constant.character.decimal.assembly', regex: '\\b0x[A-F0-9]+\\b',
regex: '\\b[0-9]+\\b' }, caseInsensitive: true },
{ token: 'constant.character.hexadecimal.assembly', { token: 'constant.character.hexadecimal.assembly',
regex: '\\b0x[A-F0-9]+\\b', regex: '\\b[A-F0-9]+h\\b',
caseInsensitive: true }, caseInsensitive: true },
{ token: 'constant.character.hexadecimal.assembly', { token: 'string.assembly', regex: /'([^\\']|\\.)*'/ },
regex: '\\b[A-F0-9]+h\\b', { token: 'string.assembly', regex: /"([^\\"]|\\.)*"/ },
caseInsensitive: true }, { token: 'support.function.directive.assembly',
{ token: 'string.assembly', regex: /'([^\\']|\\.)*'/ }, regex: '^\\[',
{ token: 'string.assembly', regex: /"([^\\"]|\\.)*"/ }, push: [{ token: 'support.function.directive.assembly',
{ token: 'support.function.directive.assembly', regex: '\\]$',
regex: '^\\[', next: 'pop' },
push: { defaultToken: 'support.function.directive.assembly' }] },
[ { token: 'support.function.directive.assembly', { token: ['support.function.directive.assembly',
regex: '\\]$', 'support.function.directive.assembly',
next: 'pop' }, 'entity.name.function.assembly'],
{ defaultToken: 'support.function.directive.assembly' } ] }, regex: '(^struc)( )([_a-zA-Z][_a-zA-Z0-9]*)' },
{ token: { token: 'support.function.directive.assembly',
[ 'support.function.directive.assembly', regex: '^endstruc\\b' },
'support.function.directive.assembly', { token: ['support.function.directive.assembly',
'entity.name.function.assembly' ], 'entity.name.function.assembly',
regex: '(^struc)( )([_a-zA-Z][_a-zA-Z0-9]*)' }, 'support.function.directive.assembly',
{ token: 'support.function.directive.assembly', 'constant.character.assembly'],
regex: '^endstruc\\b' }, regex: '^(%macro )([_a-zA-Z][_a-zA-Z0-9]*)( )([0-9]+)' },
{ token: { token: 'support.function.directive.assembly',
[ 'support.function.directive.assembly', regex: '^%endmacro' },
'entity.name.function.assembly', { token: ['text',
'support.function.directive.assembly', 'support.function.directive.assembly',
'constant.character.assembly' ], 'text',
regex: '^(%macro )([_a-zA-Z][_a-zA-Z0-9]*)( )([0-9]+)' }, 'entity.name.function.assembly'],
{ token: 'support.function.directive.assembly', regex: '(\\s*)(%define|%xdefine|%idefine|%undef|%assign|%defstr|%strcat|%strlen|%substr|%00|%0|%rotate|%rep|%endrep|%include|\\$\\$|\\$|%unmacro|%if|%elif|%else|%endif|%(?:el)?ifdef|%(?:el)?ifmacro|%(?:el)?ifctx|%(?:el)?ifidn|%(?:el)?ifidni|%(?:el)?ifid|%(?:el)?ifnum|%(?:el)?ifstr|%(?:el)?iftoken|%(?:el)?ifempty|%(?:el)?ifenv|%pathsearch|%depend|%use|%push|%pop|%repl|%arg|%stacksize|%local|%error|%warning|%fatal|%line|%!|%comment|%endcomment|__NASM_VERSION_ID__|__NASM_VER__|__FILE__|__LINE__|__BITS__|__OUTPUT_FORMAT__|__DATE__|__TIME__|__DATE_NUM__|_TIME__NUM__|__UTC_DATE__|__UTC_TIME__|__UTC_DATE_NUM__|__UTC_TIME_NUM__|__POSIX_TIME__|__PASS__|ISTRUC|AT|IEND|BITS 16|BITS 32|BITS 64|USE16|USE32|__SECT__|ABSOLUTE|EXTERN|GLOBAL|COMMON|CPU|FLOAT)\\b( ?)((?:[_a-zA-Z][_a-zA-Z0-9]*)?)',
regex: '^%endmacro' }, caseInsensitive: true },
{ token: { token: 'support.function.directive.assembly',
[ 'text', regex: '\\b(?:d[bwdqtoy]|res[bwdqto]|equ|times|align|alignb|sectalign|section|ptr|byte|word|dword|qword|incbin)\\b',
'support.function.directive.assembly', caseInsensitive: true },
'text', { token: 'entity.name.function.assembly', regex: '^\\s*%%[\\w.]+?:$' },
'entity.name.function.assembly' ], { token: 'entity.name.function.assembly', regex: '^\\s*%\\$[\\w.]+?:$' },
regex: '(\\s*)(%define|%xdefine|%idefine|%undef|%assign|%defstr|%strcat|%strlen|%substr|%00|%0|%rotate|%rep|%endrep|%include|\\$\\$|\\$|%unmacro|%if|%elif|%else|%endif|%(?:el)?ifdef|%(?:el)?ifmacro|%(?:el)?ifctx|%(?:el)?ifidn|%(?:el)?ifidni|%(?:el)?ifid|%(?:el)?ifnum|%(?:el)?ifstr|%(?:el)?iftoken|%(?:el)?ifempty|%(?:el)?ifenv|%pathsearch|%depend|%use|%push|%pop|%repl|%arg|%stacksize|%local|%error|%warning|%fatal|%line|%!|%comment|%endcomment|__NASM_VERSION_ID__|__NASM_VER__|__FILE__|__LINE__|__BITS__|__OUTPUT_FORMAT__|__DATE__|__TIME__|__DATE_NUM__|_TIME__NUM__|__UTC_DATE__|__UTC_TIME__|__UTC_DATE_NUM__|__UTC_TIME_NUM__|__POSIX_TIME__|__PASS__|ISTRUC|AT|IEND|BITS 16|BITS 32|BITS 64|USE16|USE32|__SECT__|ABSOLUTE|EXTERN|GLOBAL|COMMON|CPU|FLOAT)\\b( ?)((?:[_a-zA-Z][_a-zA-Z0-9]*)?)', { token: 'entity.name.function.assembly', regex: '^[\\w.]+?:' },
caseInsensitive: true }, { token: 'entity.name.function.assembly', regex: '^[\\w.]+?\\b' },
{ token: 'support.function.directive.assembly', { token: 'comment.assembly', regex: ';.*$' }]
regex: '\\b(?:d[bwdqtoy]|res[bwdqto]|equ|times|align|alignb|sectalign|section|ptr|byte|word|dword|qword|incbin)\\b',
caseInsensitive: true },
{ token: 'entity.name.function.assembly', regex: '^\\s*%%[\\w.]+?:$' },
{ token: 'entity.name.function.assembly', regex: '^\\s*%\\$[\\w.]+?:$' },
{ token: 'entity.name.function.assembly', regex: '^[\\w.]+?:' },
{ token: 'entity.name.function.assembly', regex: '^[\\w.]+?\\b' },
{ token: 'comment.assembly', regex: ';.*$' } ]
}; };
this.normalizeRules(); this.normalizeRules();
}; };
AssemblyX86HighlightRules.metaData = { fileTypes: ['asm'],
AssemblyX86HighlightRules.metaData = { fileTypes: [ 'asm' ], name: 'Assembly x86',
name: 'Assembly x86', scopeName: 'source.assembly' };
scopeName: 'source.assembly' };
oop.inherits(AssemblyX86HighlightRules, TextHighlightRules); oop.inherits(AssemblyX86HighlightRules, TextHighlightRules);
exports.AssemblyX86HighlightRules = AssemblyX86HighlightRules; exports.AssemblyX86HighlightRules = AssemblyX86HighlightRules;
}); });
define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module) { define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../../lib/oop"); var oop = require("../../lib/oop");
var BaseFoldMode = require("./fold_mode").FoldMode; var BaseFoldMode = require("./fold_mode").FoldMode;
var Range = require("../../range").Range; var Range = require("../../range").Range;
var FoldMode = exports.FoldMode = function () { };
var FoldMode = exports.FoldMode = function() {};
oop.inherits(FoldMode, BaseFoldMode); oop.inherits(FoldMode, BaseFoldMode);
(function () {
(function() { this.commentBlock = function (session, row) {
this.getFoldWidgetRange = function(session, foldStyle, row) {
var range = this.indentationBlock(session, row);
if (range)
return range;
var re = /\S/; var re = /\S/;
var line = session.getLine(row); var line = session.getLine(row);
var startLevel = line.search(re); var startLevel = line.search(re);
if (startLevel == -1 || line[startLevel] != "#") if (startLevel == -1 || line[startLevel] != "#")
return; return;
var startColumn = line.length; var startColumn = line.length;
var maxRow = session.getLength(); var maxRow = session.getLength();
var startRow = row; var startRow = row;
var endRow = row; var endRow = row;
while (++row < maxRow) { while (++row < maxRow) {
line = session.getLine(row); line = session.getLine(row);
var level = line.search(re); var level = line.search(re);
if (level == -1) if (level == -1)
continue; continue;
if (line[level] != "#") if (line[level] != "#")
break; break;
endRow = row; endRow = row;
} }
if (endRow > startRow) { if (endRow > startRow) {
var endColumn = session.getLine(endRow).length; var endColumn = session.getLine(endRow).length;
return new Range(startRow, startColumn, endRow, endColumn); return new Range(startRow, startColumn, endRow, endColumn);
} }
}; };
this.getFoldWidget = function(session, foldStyle, row) { this.getFoldWidgetRange = function (session, foldStyle, row) {
var range = this.indentationBlock(session, row);
if (range)
return range;
range = this.commentBlock(session, row);
if (range)
return range;
};
this.getFoldWidget = function (session, foldStyle, row) {
var line = session.getLine(row); var line = session.getLine(row);
var indent = line.search(/\S/); var indent = line.search(/\S/);
var next = session.getLine(row + 1); var next = session.getLine(row + 1);
var prev = session.getLine(row - 1); var prev = session.getLine(row - 1);
var prevIndent = prev.search(/\S/); var prevIndent = prev.search(/\S/);
var nextIndent = next.search(/\S/); var nextIndent = next.search(/\S/);
if (indent == -1) { if (indent == -1) {
session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : ""; session.foldWidgets[row - 1] = prevIndent != -1 && prevIndent < nextIndent ? "start" : "";
return ""; return "";
} }
if (prevIndent == -1) { if (prevIndent == -1) {
@ -139,48 +119,52 @@ oop.inherits(FoldMode, BaseFoldMode);
session.foldWidgets[row + 1] = ""; session.foldWidgets[row + 1] = "";
return "start"; return "start";
} }
} else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") { }
else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") {
if (session.getLine(row - 2).search(/\S/) == -1) { if (session.getLine(row - 2).search(/\S/) == -1) {
session.foldWidgets[row - 1] = "start"; session.foldWidgets[row - 1] = "start";
session.foldWidgets[row + 1] = ""; session.foldWidgets[row + 1] = "";
return ""; return "";
} }
} }
if (prevIndent != -1 && prevIndent < indent)
if (prevIndent!= -1 && prevIndent < indent)
session.foldWidgets[row - 1] = "start"; session.foldWidgets[row - 1] = "start";
else else
session.foldWidgets[row - 1] = ""; session.foldWidgets[row - 1] = "";
if (indent < nextIndent) if (indent < nextIndent)
return "start"; return "start";
else else
return ""; return "";
}; };
}).call(FoldMode.prototype); }).call(FoldMode.prototype);
}); });
define("ace/mode/assembly_x86",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/assembly_x86_highlight_rules","ace/mode/folding/coffee"], function(require, exports, module) { define("ace/mode/assembly_x86",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/assembly_x86_highlight_rules","ace/mode/folding/coffee"], function(require, exports, module){/*
THIS FILE WAS AUTOGENERATED BY mode.tmpl.js
*/
"use strict"; "use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextMode = require("./text").Mode; var TextMode = require("./text").Mode;
var AssemblyX86HighlightRules = require("./assembly_x86_highlight_rules").AssemblyX86HighlightRules; var AssemblyX86HighlightRules = require("./assembly_x86_highlight_rules").AssemblyX86HighlightRules;
var FoldMode = require("./folding/coffee").FoldMode; var FoldMode = require("./folding/coffee").FoldMode;
var Mode = function () {
var Mode = function() {
this.HighlightRules = AssemblyX86HighlightRules; this.HighlightRules = AssemblyX86HighlightRules;
this.foldingRules = new FoldMode(); this.foldingRules = new FoldMode();
this.$behaviour = this.$defaultBehaviour; this.$behaviour = this.$defaultBehaviour;
}; };
oop.inherits(Mode, TextMode); oop.inherits(Mode, TextMode);
(function () {
(function() { this.lineCommentStart = [";"];
this.lineCommentStart = ";";
this.$id = "ace/mode/assembly_x86"; this.$id = "ace/mode/assembly_x86";
}).call(Mode.prototype); }).call(Mode.prototype);
exports.Mode = Mode; exports.Mode = Mode;
});
}); (function() {
window.require(["ace/mode/assembly_x86"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -1,146 +1,116 @@
define("ace/mode/batchfile_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { define("ace/mode/batchfile_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){/* This file was autogenerated from C:\Users\LED\AppData\Roaming\Sublime Text 2\Packages\Batch File\Batch File.tmLanguage (uuid: ) */
"use strict"; "use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var BatchFileHighlightRules = function () {
var BatchFileHighlightRules = function() { this.$rules = { start: [{ token: 'keyword.command.dosbatch',
regex: '\\b(?:append|assoc|at|attrib|break|cacls|cd|chcp|chdir|chkdsk|chkntfs|cls|cmd|color|comp|compact|convert|copy|date|del|dir|diskcomp|diskcopy|doskey|echo|endlocal|erase|fc|find|findstr|format|ftype|graftabl|help|keyb|label|md|mkdir|mode|more|move|path|pause|popd|print|prompt|pushd|rd|recover|ren|rename|replace|restore|rmdir|set|setlocal|shift|sort|start|subst|time|title|tree|type|ver|verify|vol|xcopy)\\b',
this.$rules = { start: caseInsensitive: true },
[ { token: 'keyword.command.dosbatch', { token: 'keyword.control.statement.dosbatch',
regex: '\\b(?:append|assoc|at|attrib|break|cacls|cd|chcp|chdir|chkdsk|chkntfs|cls|cmd|color|comp|compact|convert|copy|date|del|dir|diskcomp|diskcopy|doskey|echo|endlocal|erase|fc|find|findstr|format|ftype|graftabl|help|keyb|label|md|mkdir|mode|more|move|path|pause|popd|print|prompt|pushd|rd|recover|ren|rename|replace|restore|rmdir|set|setlocal|shift|sort|start|subst|time|title|tree|type|ver|verify|vol|xcopy)\\b', regex: '\\b(?:goto|call|exit)\\b',
caseInsensitive: true }, caseInsensitive: true },
{ token: 'keyword.control.statement.dosbatch', { token: 'keyword.control.conditional.if.dosbatch',
regex: '\\b(?:goto|call|exit)\\b', regex: '\\bif\\s+not\\s+(?:exist|defined|errorlevel|cmdextversion)\\b',
caseInsensitive: true }, caseInsensitive: true },
{ token: 'keyword.control.conditional.if.dosbatch', { token: 'keyword.control.conditional.dosbatch',
regex: '\\bif\\s+not\\s+(?:exist|defined|errorlevel|cmdextversion)\\b', regex: '\\b(?:if|else)\\b',
caseInsensitive: true }, caseInsensitive: true },
{ token: 'keyword.control.conditional.dosbatch', { token: 'keyword.control.repeat.dosbatch',
regex: '\\b(?:if|else)\\b', regex: '\\bfor\\b',
caseInsensitive: true }, caseInsensitive: true },
{ token: 'keyword.control.repeat.dosbatch', { token: 'keyword.operator.dosbatch',
regex: '\\bfor\\b', regex: '\\b(?:EQU|NEQ|LSS|LEQ|GTR|GEQ)\\b' },
caseInsensitive: true }, { token: ['doc.comment', 'comment'],
{ token: 'keyword.operator.dosbatch', regex: '(?:^|\\b)(rem)($|\\s.*$)',
regex: '\\b(?:EQU|NEQ|LSS|LEQ|GTR|GEQ)\\b' }, caseInsensitive: true },
{ token: ['doc.comment', 'comment'], { token: 'comment.line.colons.dosbatch',
regex: '(?:^|\\b)(rem)($|\\s.*$)', regex: '::.*$' },
caseInsensitive: true }, { include: 'variable' },
{ token: 'comment.line.colons.dosbatch', { token: 'punctuation.definition.string.begin.shell',
regex: '::.*$' }, regex: '"',
{ include: 'variable' }, push: [
{ token: 'punctuation.definition.string.begin.shell', { token: 'punctuation.definition.string.end.shell', regex: '"', next: 'pop' },
regex: '"', { include: 'variable' },
push: [ { defaultToken: 'string.quoted.double.dosbatch' }
{ token: 'punctuation.definition.string.end.shell', regex: '"', next: 'pop' }, ] },
{ include: 'variable' }, { token: 'keyword.operator.pipe.dosbatch', regex: '[|]' },
{ defaultToken: 'string.quoted.double.dosbatch' } ] }, { token: 'keyword.operator.redirect.shell',
{ token: 'keyword.operator.pipe.dosbatch', regex: '[|]' }, regex: '&>|\\d*>&\\d*|\\d*(?:>>|>|<)|\\d*<&|\\d*<>' }],
{ token: 'keyword.operator.redirect.shell',
regex: '&>|\\d*>&\\d*|\\d*(?:>>|>|<)|\\d*<&|\\d*<>' } ],
variable: [ variable: [
{ token: 'constant.numeric', regex: '%%\\w+|%[*\\d]|%\\w+%'}, { token: 'constant.numeric', regex: '%%\\w+|%[*\\d]|%\\w+%' },
{ token: 'constant.numeric', regex: '%~\\d+'}, { token: 'constant.numeric', regex: '%~\\d+' },
{ token: ['markup.list', 'constant.other', 'markup.list'], { token: ['markup.list', 'constant.other', 'markup.list'],
regex: '(%)(\\w+)(%?)' }]}; regex: '(%)(\\w+)(%?)' }
] };
this.normalizeRules(); this.normalizeRules();
}; };
BatchFileHighlightRules.metaData = { name: 'Batch File', BatchFileHighlightRules.metaData = { name: 'Batch File',
scopeName: 'source.dosbatch', scopeName: 'source.dosbatch',
fileTypes: [ 'bat' ] }; fileTypes: ['bat'] };
oop.inherits(BatchFileHighlightRules, TextHighlightRules); oop.inherits(BatchFileHighlightRules, TextHighlightRules);
exports.BatchFileHighlightRules = BatchFileHighlightRules; exports.BatchFileHighlightRules = BatchFileHighlightRules;
}); });
define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../../lib/oop"); var oop = require("../../lib/oop");
var Range = require("../../range").Range; var Range = require("../../range").Range;
var BaseFoldMode = require("./fold_mode").FoldMode; var BaseFoldMode = require("./fold_mode").FoldMode;
var FoldMode = exports.FoldMode = function (commentRegex) {
var FoldMode = exports.FoldMode = function(commentRegex) {
if (commentRegex) { if (commentRegex) {
this.foldingStartMarker = new RegExp( this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
);
this.foldingStopMarker = new RegExp(
this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
);
} }
}; };
oop.inherits(FoldMode, BaseFoldMode); oop.inherits(FoldMode, BaseFoldMode);
(function () {
(function() {
this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/; this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/; this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
this._getFoldWidgetBase = this.getFoldWidget; this._getFoldWidgetBase = this.getFoldWidget;
this.getFoldWidget = function(session, foldStyle, row) { this.getFoldWidget = function (session, foldStyle, row) {
var line = session.getLine(row); var line = session.getLine(row);
if (this.singleLineBlockCommentRe.test(line)) { if (this.singleLineBlockCommentRe.test(line)) {
if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
return ""; return "";
} }
var fw = this._getFoldWidgetBase(session, foldStyle, row); var fw = this._getFoldWidgetBase(session, foldStyle, row);
if (!fw && this.startRegionRe.test(line)) if (!fw && this.startRegionRe.test(line))
return "start"; // lineCommentRegionStart return "start"; // lineCommentRegionStart
return fw; return fw;
}; };
this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
var line = session.getLine(row); var line = session.getLine(row);
if (this.startRegionRe.test(line)) if (this.startRegionRe.test(line))
return this.getCommentRegionBlock(session, line, row); return this.getCommentRegionBlock(session, line, row);
var match = line.match(this.foldingStartMarker); var match = line.match(this.foldingStartMarker);
if (match) { if (match) {
var i = match.index; var i = match.index;
if (match[1]) if (match[1])
return this.openingBracketBlock(session, match[1], row, i); return this.openingBracketBlock(session, match[1], row, i);
var range = session.getCommentFoldRange(row, i + match[0].length, 1); var range = session.getCommentFoldRange(row, i + match[0].length, 1);
if (range && !range.isMultiLine()) { if (range && !range.isMultiLine()) {
if (forceMultiline) { if (forceMultiline) {
range = this.getSectionRange(session, row); range = this.getSectionRange(session, row);
} else if (foldStyle != "all") }
else if (foldStyle != "all")
range = null; range = null;
} }
return range; return range;
} }
if (foldStyle === "markbegin") if (foldStyle === "markbegin")
return; return;
var match = line.match(this.foldingStopMarker); var match = line.match(this.foldingStopMarker);
if (match) { if (match) {
var i = match.index + match[0].length; var i = match.index + match[0].length;
if (match[1]) if (match[1])
return this.closingBracketBlock(session, match[1], row, i); return this.closingBracketBlock(session, match[1], row, i);
return session.getCommentFoldRange(row, i, -1); return session.getCommentFoldRange(row, i, -1);
} }
}; };
this.getSectionRange = function (session, row) {
this.getSectionRange = function(session, row) {
var line = session.getLine(row); var line = session.getLine(row);
var startIndent = line.search(/\S/); var startIndent = line.search(/\S/);
var startRow = row; var startRow = row;
@ -153,71 +123,77 @@ oop.inherits(FoldMode, BaseFoldMode);
var indent = line.search(/\S/); var indent = line.search(/\S/);
if (indent === -1) if (indent === -1)
continue; continue;
if (startIndent > indent) if (startIndent > indent)
break; break;
var subRange = this.getFoldWidgetRange(session, "all", row); var subRange = this.getFoldWidgetRange(session, "all", row);
if (subRange) { if (subRange) {
if (subRange.start.row <= startRow) { if (subRange.start.row <= startRow) {
break; break;
} else if (subRange.isMultiLine()) { }
else if (subRange.isMultiLine()) {
row = subRange.end.row; row = subRange.end.row;
} else if (startIndent == indent) { }
else if (startIndent == indent) {
break; break;
} }
} }
endRow = row; endRow = row;
} }
return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
}; };
this.getCommentRegionBlock = function(session, line, row) { this.getCommentRegionBlock = function (session, line, row) {
var startColumn = line.search(/\s*$/); var startColumn = line.search(/\s*$/);
var maxRow = session.getLength(); var maxRow = session.getLength();
var startRow = row; var startRow = row;
var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
var depth = 1; var depth = 1;
while (++row < maxRow) { while (++row < maxRow) {
line = session.getLine(row); line = session.getLine(row);
var m = re.exec(line); var m = re.exec(line);
if (!m) continue; if (!m)
if (m[1]) depth--; continue;
else depth++; if (m[1])
depth--;
if (!depth) break; else
depth++;
if (!depth)
break;
} }
var endRow = row; var endRow = row;
if (endRow > startRow) { if (endRow > startRow) {
return new Range(startRow, startColumn, endRow, line.length); return new Range(startRow, startColumn, endRow, line.length);
} }
}; };
}).call(FoldMode.prototype); }).call(FoldMode.prototype);
}); });
define("ace/mode/batchfile",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/batchfile_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) { define("ace/mode/batchfile",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/batchfile_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module){/*
THIS FILE WAS AUTOGENERATED BY mode.tmpl.js
*/
"use strict"; "use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextMode = require("./text").Mode; var TextMode = require("./text").Mode;
var BatchFileHighlightRules = require("./batchfile_highlight_rules").BatchFileHighlightRules; var BatchFileHighlightRules = require("./batchfile_highlight_rules").BatchFileHighlightRules;
var FoldMode = require("./folding/cstyle").FoldMode; var FoldMode = require("./folding/cstyle").FoldMode;
var Mode = function () {
var Mode = function() {
this.HighlightRules = BatchFileHighlightRules; this.HighlightRules = BatchFileHighlightRules;
this.foldingRules = new FoldMode(); this.foldingRules = new FoldMode();
this.$behaviour = this.$defaultBehaviour; this.$behaviour = this.$defaultBehaviour;
}; };
oop.inherits(Mode, TextMode); oop.inherits(Mode, TextMode);
(function () {
(function() {
this.lineCommentStart = "::"; this.lineCommentStart = "::";
this.blockComment = ""; this.blockComment = "";
this.$id = "ace/mode/batchfile"; this.$id = "ace/mode/batchfile";
}).call(Mode.prototype); }).call(Mode.prototype);
exports.Mode = Mode; exports.Mode = Mode;
});
}); (function() {
window.require(["ace/mode/batchfile"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

View File

@ -0,0 +1,318 @@
define("ace/mode/bibtex_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var BibTeXHighlightRules = function () {
this.$rules = {
start: [
{
token: "comment",
regex: /@Comment\{/,
stateName: "bibtexComment",
push: [
{
token: "comment",
regex: /}/,
next: "pop"
}, {
token: "comment",
regex: /\{/,
push: "bibtexComment"
}, {
defaultToken: "comment"
}
]
}, {
token: [
"keyword", "text", "paren.lparen", "text", "variable", "text", "keyword.operator"
],
regex: /(@String)(\s*)(\{)(\s*)([a-zA-Z]*)(\s*)(=)/,
push: [
{
token: "paren.rparen",
regex: /\}/,
next: "pop"
}, {
include: "#misc"
}, {
defaultToken: "text"
}
]
}, {
token: [
"keyword", "text", "paren.lparen", "text", "variable", "text", "keyword.operator"
],
regex: /(@String)(\s*)(\()(\s*)([a-zA-Z]*)(\s*)(=)/,
push: [
{
token: "paren.rparen",
regex: /\)/,
next: "pop"
}, {
include: "#misc"
}, {
defaultToken: "text"
}
]
}, {
token: [
"keyword", "text", "paren.lparen"
],
regex: /(@preamble)(\s*)(\()/,
push: [
{
token: "paren.rparen",
regex: /\)/,
next: "pop"
}, {
include: "#misc"
}, {
defaultToken: "text"
}
]
}, {
token: [
"keyword", "text", "paren.lparen"
],
regex: /(@preamble)(\s*)(\{)/,
push: [
{
token: "paren.rparen",
regex: /\}/,
next: "pop"
}, {
include: "#misc"
}, {
defaultToken: "text"
}
]
}, {
token: [
"keyword", "text", "paren.lparen", "text", "support.class"
],
regex: /(@[a-zA-Z]+)(\s*)(\{)(\s*)([\w-]+)/,
push: [
{
token: "paren.rparen",
regex: /\}/,
next: "pop"
}, {
token: [
"variable", "text", "keyword.operator"
],
regex: /([a-zA-Z0-9\!\$\&\*\+\-\.\/\:\;\<\>\?\[\]\^\_\`\|]+)(\s*)(=)/,
push: [
{
token: "text",
regex: /(?=[,}])/,
next: "pop"
}, {
include: "#misc"
}, {
include: "#integer"
}, {
defaultToken: "text"
}
]
}, {
token: "punctuation",
regex: /,/
}, {
defaultToken: "text"
}
]
}, {
defaultToken: "comment"
}
],
"#integer": [
{
token: "constant.numeric.bibtex",
regex: /\d+/
}
],
"#misc": [
{
token: "string",
regex: /"/,
push: "#string_quotes"
}, {
token: "paren.lparen",
regex: /\{/,
push: "#string_braces"
}, {
token: "keyword.operator",
regex: /#/
}
],
"#string_braces": [
{
token: "paren.rparen",
regex: /\}/,
next: "pop"
}, {
token: "invalid.illegal",
regex: /@/
}, {
include: "#misc"
}, {
defaultToken: "string"
}
],
"#string_quotes": [
{
token: "string",
regex: /"/,
next: "pop"
}, {
include: "#misc"
}, {
defaultToken: "string"
}
]
};
this.normalizeRules();
};
oop.inherits(BibTeXHighlightRules, TextHighlightRules);
exports.BibTeXHighlightRules = BibTeXHighlightRules;
});
define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var Range = require("../../range").Range;
var BaseFoldMode = require("./fold_mode").FoldMode;
var FoldMode = exports.FoldMode = function (commentRegex) {
if (commentRegex) {
this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
}
};
oop.inherits(FoldMode, BaseFoldMode);
(function () {
this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
this._getFoldWidgetBase = this.getFoldWidget;
this.getFoldWidget = function (session, foldStyle, row) {
var line = session.getLine(row);
if (this.singleLineBlockCommentRe.test(line)) {
if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
return "";
}
var fw = this._getFoldWidgetBase(session, foldStyle, row);
if (!fw && this.startRegionRe.test(line))
return "start"; // lineCommentRegionStart
return fw;
};
this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
var line = session.getLine(row);
if (this.startRegionRe.test(line))
return this.getCommentRegionBlock(session, line, row);
var match = line.match(this.foldingStartMarker);
if (match) {
var i = match.index;
if (match[1])
return this.openingBracketBlock(session, match[1], row, i);
var range = session.getCommentFoldRange(row, i + match[0].length, 1);
if (range && !range.isMultiLine()) {
if (forceMultiline) {
range = this.getSectionRange(session, row);
}
else if (foldStyle != "all")
range = null;
}
return range;
}
if (foldStyle === "markbegin")
return;
var match = line.match(this.foldingStopMarker);
if (match) {
var i = match.index + match[0].length;
if (match[1])
return this.closingBracketBlock(session, match[1], row, i);
return session.getCommentFoldRange(row, i, -1);
}
};
this.getSectionRange = function (session, row) {
var line = session.getLine(row);
var startIndent = line.search(/\S/);
var startRow = row;
var startColumn = line.length;
row = row + 1;
var endRow = row;
var maxRow = session.getLength();
while (++row < maxRow) {
line = session.getLine(row);
var indent = line.search(/\S/);
if (indent === -1)
continue;
if (startIndent > indent)
break;
var subRange = this.getFoldWidgetRange(session, "all", row);
if (subRange) {
if (subRange.start.row <= startRow) {
break;
}
else if (subRange.isMultiLine()) {
row = subRange.end.row;
}
else if (startIndent == indent) {
break;
}
}
endRow = row;
}
return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
};
this.getCommentRegionBlock = function (session, line, row) {
var startColumn = line.search(/\s*$/);
var maxRow = session.getLength();
var startRow = row;
var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
var depth = 1;
while (++row < maxRow) {
line = session.getLine(row);
var m = re.exec(line);
if (!m)
continue;
if (m[1])
depth--;
else
depth++;
if (!depth)
break;
}
var endRow = row;
if (endRow > startRow) {
return new Range(startRow, startColumn, endRow, line.length);
}
};
}).call(FoldMode.prototype);
});
define("ace/mode/bibtex",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/bibtex_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var BibTeXHighlightRules = require("./bibtex_highlight_rules").BibTeXHighlightRules;
var FoldMode = require("./folding/cstyle").FoldMode;
var Mode = function () {
this.HighlightRules = BibTeXHighlightRules;
this.foldingRules = new FoldMode();
};
oop.inherits(Mode, TextMode);
(function () {
this.$id = "ace/mode/bibtex";
}).call(Mode.prototype);
exports.Mode = Mode;
}); (function() {
window.require(["ace/mode/bibtex"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

View File

@ -1,327 +0,0 @@
define("ace/mode/bro_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
"use strict";
var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var BroHighlightRules = function() {
this.$rules = {
start: [{
token: "punctuation.definition.comment.bro",
regex: /#/,
push: [{
token: "comment.line.number-sign.bro",
regex: /$/,
next: "pop"
}, {
defaultToken: "comment.line.number-sign.bro"
}]
}, {
token: "keyword.control.bro",
regex: /\b(?:break|case|continue|else|for|if|return|switch|next|when|timeout|schedule)\b/
}, {
token: [
"meta.function.bro",
"meta.function.bro",
"storage.type.bro",
"meta.function.bro",
"entity.name.function.bro",
"meta.function.bro"
],
regex: /^(\s*)(?:function|hook|event)(\s*)(.*)(\s*\()(.*)(\).*$)/
}, {
token: "storage.type.bro",
regex: /\b(?:bool|enum|double|int|count|port|addr|subnet|any|file|interval|time|string|table|vector|set|record|pattern|hook)\b/
}, {
token: "storage.modifier.bro",
regex: /\b(?:global|const|redef|local|&(?:optional|rotate_interval|rotate_size|add_func|del_func|expire_func|expire_create|expire_read|expire_write|persistent|synchronized|encrypt|mergeable|priority|group|type_column|log|error_handler))\b/
}, {
token: "keyword.operator.bro",
regex: /\s*(?:\||&&|(?:>|<|!)=?|==)\s*|\b!?in\b/
}, {
token: "constant.language.bro",
regex: /\b(?:T|F)\b/
}, {
token: "constant.numeric.bro",
regex: /\b(?:0(?:x|X)[0-9a-fA-F]*|(?:[0-9]+\.?[0-9]*|\.[0-9]+)(?:(?:e|E)(?:\+|-)?[0-9]+)?)(?:\/(?:tcp|udp|icmp)|\s*(?:u?sec|min|hr|day)s?)?\b/
}, {
token: "punctuation.definition.string.begin.bro",
regex: /"/,
push: [{
token: "punctuation.definition.string.end.bro",
regex: /"/,
next: "pop"
}, {
include: "#string_escaped_char"
}, {
include: "#string_placeholder"
}, {
defaultToken: "string.quoted.double.bro"
}]
}, {
token: "punctuation.definition.string.begin.bro",
regex: /\//,
push: [{
token: "punctuation.definition.string.end.bro",
regex: /\//,
next: "pop"
}, {
include: "#string_escaped_char"
}, {
include: "#string_placeholder"
}, {
defaultToken: "string.quoted.regex.bro"
}]
}, {
token: [
"meta.preprocessor.bro.load",
"keyword.other.special-method.bro"
],
regex: /^(\s*)(\@load(?:-sigs)?)\b/,
push: [{
token: [],
regex: /(?=\#)|$/,
next: "pop"
}, {
defaultToken: "meta.preprocessor.bro.load"
}]
}, {
token: [
"meta.preprocessor.bro.if",
"keyword.other.special-method.bro",
"meta.preprocessor.bro.if"
],
regex: /^(\s*)(\@endif|\@if(?:n?def)?)(.*$)/,
push: [{
token: [],
regex: /$/,
next: "pop"
}, {
defaultToken: "meta.preprocessor.bro.if"
}]
}],
"#disabled": [{
token: "text",
regex: /^\s*\@if(?:n?def)?\b.*$/,
push: [{
token: "text",
regex: /^\s*\@endif\b.*$/,
next: "pop"
}, {
include: "#disabled"
}, {
include: "#pragma-mark"
}],
comment: "eat nested preprocessor ifdefs"
}],
"#preprocessor-rule-other": [{
token: [
"text",
"meta.preprocessor.bro",
"meta.preprocessor.bro",
"text"
],
regex: /^(\s*)(@if)((?:n?def)?)\b(.*?)(?:(?=)|$)/,
push: [{
token: ["text", "meta.preprocessor.bro", "text"],
regex: /^(\s*)(@endif)\b(.*$)/,
next: "pop"
}, {
include: "$base"
}]
}],
"#string_escaped_char": [{
token: "constant.character.escape.bro",
regex: /\\(?:\\|[abefnprtv'"?]|[0-3]\d{,2}|[4-7]\d?|x[a-fA-F0-9]{,2})/
}, {
token: "invalid.illegal.unknown-escape.bro",
regex: /\\./
}],
"#string_placeholder": [{
token: "constant.other.placeholder.bro",
regex: /%(?:\d+\$)?[#0\- +']*[,;:_]?(?:-?\d+|\*(?:-?\d+\$)?)?(?:\.(?:-?\d+|\*(?:-?\d+\$)?)?)?(?:hh|h|ll|l|j|t|z|q|L|vh|vl|v|hv|hl)?[diouxXDOUeEfFgGaACcSspn%]/
}, {
token: "invalid.illegal.placeholder.bro",
regex: /%/
}]
};
this.normalizeRules();
};
BroHighlightRules.metaData = {
fileTypes: ["bro"],
foldingStartMarker: "^(\\@if(n?def)?)",
foldingStopMarker: "^\\@endif",
keyEquivalent: "@B",
name: "Bro",
scopeName: "source.bro"
};
oop.inherits(BroHighlightRules, TextHighlightRules);
exports.BroHighlightRules = BroHighlightRules;
});
define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) {
"use strict";
var oop = require("../../lib/oop");
var Range = require("../../range").Range;
var BaseFoldMode = require("./fold_mode").FoldMode;
var FoldMode = exports.FoldMode = function(commentRegex) {
if (commentRegex) {
this.foldingStartMarker = new RegExp(
this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start)
);
this.foldingStopMarker = new RegExp(
this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
);
}
};
oop.inherits(FoldMode, BaseFoldMode);
(function() {
this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/;
this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
this._getFoldWidgetBase = this.getFoldWidget;
this.getFoldWidget = function(session, foldStyle, row) {
var line = session.getLine(row);
if (this.singleLineBlockCommentRe.test(line)) {
if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
return "";
}
var fw = this._getFoldWidgetBase(session, foldStyle, row);
if (!fw && this.startRegionRe.test(line))
return "start"; // lineCommentRegionStart
return fw;
};
this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
var line = session.getLine(row);
if (this.startRegionRe.test(line))
return this.getCommentRegionBlock(session, line, row);
var match = line.match(this.foldingStartMarker);
if (match) {
var i = match.index;
if (match[1])
return this.openingBracketBlock(session, match[1], row, i);
var range = session.getCommentFoldRange(row, i + match[0].length, 1);
if (range && !range.isMultiLine()) {
if (forceMultiline) {
range = this.getSectionRange(session, row);
} else if (foldStyle != "all")
range = null;
}
return range;
}
if (foldStyle === "markbegin")
return;
var match = line.match(this.foldingStopMarker);
if (match) {
var i = match.index + match[0].length;
if (match[1])
return this.closingBracketBlock(session, match[1], row, i);
return session.getCommentFoldRange(row, i, -1);
}
};
this.getSectionRange = function(session, row) {
var line = session.getLine(row);
var startIndent = line.search(/\S/);
var startRow = row;
var startColumn = line.length;
row = row + 1;
var endRow = row;
var maxRow = session.getLength();
while (++row < maxRow) {
line = session.getLine(row);
var indent = line.search(/\S/);
if (indent === -1)
continue;
if (startIndent > indent)
break;
var subRange = this.getFoldWidgetRange(session, "all", row);
if (subRange) {
if (subRange.start.row <= startRow) {
break;
} else if (subRange.isMultiLine()) {
row = subRange.end.row;
} else if (startIndent == indent) {
break;
}
}
endRow = row;
}
return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
};
this.getCommentRegionBlock = function(session, line, row) {
var startColumn = line.search(/\s*$/);
var maxRow = session.getLength();
var startRow = row;
var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
var depth = 1;
while (++row < maxRow) {
line = session.getLine(row);
var m = re.exec(line);
if (!m) continue;
if (m[1]) depth--;
else depth++;
if (!depth) break;
}
var endRow = row;
if (endRow > startRow) {
return new Range(startRow, startColumn, endRow, line.length);
}
};
}).call(FoldMode.prototype);
});
define("ace/mode/bro",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/bro_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) {
"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var BroHighlightRules = require("./bro_highlight_rules").BroHighlightRules;
var FoldMode = require("./folding/cstyle").FoldMode;
var Mode = function() {
this.HighlightRules = BroHighlightRules;
this.foldingRules = new FoldMode();
};
oop.inherits(Mode, TextMode);
(function() {
this.$id = "ace/mode/bro";
}).call(Mode.prototype);
exports.Mode = Mode;
});

View File

@ -1,33 +1,29 @@
define("ace/mode/c9search_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) { define("ace/mode/c9search_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var lang = require("../lib/lang"); var lang = require("../lib/lang");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
function safeCreateRegexp(source, flag) { function safeCreateRegexp(source, flag) {
try { try {
return new RegExp(source, flag); return new RegExp(source, flag);
} catch(e) {} }
catch (e) { }
} }
var C9SearchHighlightRules = function () {
var C9SearchHighlightRules = function() {
this.$rules = { this.$rules = {
"start" : [ "start": [
{ {
tokenNames : ["c9searchresults.constant.numeric", "c9searchresults.text", "c9searchresults.text", "c9searchresults.keyword"], tokenNames: ["c9searchresults.constant.numeric", "c9searchresults.text", "c9searchresults.text", "c9searchresults.keyword"],
regex : /(^\s+[0-9]+)(:)(\d*\s?)([^\r\n]+)/, regex: /(^\s+[0-9]+)(:)(\d*\s?)([^\r\n]+)/,
onMatch : function(val, state, stack) { onMatch: function (val, state, stack) {
var values = this.splitRegex.exec(val); var values = this.splitRegex.exec(val);
var types = this.tokenNames; var types = this.tokenNames;
var tokens = [{ var tokens = [{
type: types[0], type: types[0],
value: values[1] value: values[1]
}, { }, {
type: types[1], type: types[1],
value: values[2] value: values[2]
}]; }];
if (values[3]) { if (values[3]) {
if (values[3] == " ") if (values[3] == " ")
tokens[1] = { type: types[1], value: values[2] + " " }; tokens[1] = { type: types[1], value: values[2] + " " };
@ -36,7 +32,6 @@ var C9SearchHighlightRules = function() {
} }
var regex = stack[1]; var regex = stack[1];
var str = values[4]; var str = values[4];
var m; var m;
var last = 0; var last = 0;
if (regex && regex.exec) { if (regex && regex.exec) {
@ -45,40 +40,37 @@ var C9SearchHighlightRules = function() {
var skipped = str.substring(last, m.index); var skipped = str.substring(last, m.index);
last = regex.lastIndex; last = regex.lastIndex;
if (skipped) if (skipped)
tokens.push({type: types[2], value: skipped}); tokens.push({ type: types[2], value: skipped });
if (m[0]) if (m[0])
tokens.push({type: types[3], value: m[0]}); tokens.push({ type: types[3], value: m[0] });
else if (!skipped) else if (!skipped)
break; break;
} }
} }
if (last < str.length) if (last < str.length)
tokens.push({type: types[2], value: str.substr(last)}); tokens.push({ type: types[2], value: str.substr(last) });
return tokens; return tokens;
} }
}, },
{ {
regex : "^Searching for [^\\r\\n]*$", regex: "^Searching for [^\\r\\n]*$",
onMatch: function(val, state, stack) { onMatch: function (val, state, stack) {
var parts = val.split("\x01"); var parts = val.split("\x01");
if (parts.length < 3) if (parts.length < 3)
return "text"; return "text";
var options, search;
var options, search, replace;
var i = 0; var i = 0;
var tokens = [{ var tokens = [{
value: parts[i++] + "'", value: parts[i++] + "'",
type: "text" type: "text"
}, { }, {
value: search = parts[i++], value: search = parts[i++],
type: "text" // "c9searchresults.keyword" type: "text" // "c9searchresults.keyword"
}, { }, {
value: "'" + parts[i++], value: "'" + parts[i++],
type: "text" type: "text"
}]; }];
if (parts[2] !== " in") { if (parts[2] !== " in") {
replace = parts[i];
tokens.push({ tokens.push({
value: "'" + parts[i++] + "'", value: "'" + parts[i++] + "'",
type: "text" type: "text"
@ -91,14 +83,15 @@ var C9SearchHighlightRules = function() {
value: " " + parts[i++] + " ", value: " " + parts[i++] + " ",
type: "text" type: "text"
}); });
if (parts[i+1]) { if (parts[i + 1]) {
options = parts[i+1]; options = parts[i + 1];
tokens.push({ tokens.push({
value: "(" + parts[i+1] + ")", value: "(" + parts[i + 1] + ")",
type: "text" type: "text"
}); });
i += 1; i += 1;
} else { }
else {
i -= 1; i -= 1;
} }
while (i++ < parts.length) { while (i++ < parts.length) {
@ -107,120 +100,93 @@ var C9SearchHighlightRules = function() {
type: "text" type: "text"
}); });
} }
if (search) { if (search) {
if (!/regex/.test(options)) if (!/regex/.test(options))
search = lang.escapeRegExp(search); search = lang.escapeRegExp(search);
if (/whole/.test(options)) if (/whole/.test(options))
search = "\\b" + search + "\\b"; search = "\\b" + search + "\\b";
} }
var regex = search && safeCreateRegexp("(" + search + ")", / sensitive/.test(options) ? "g" : "ig");
var regex = search && safeCreateRegexp(
"(" + search + ")",
/ sensitive/.test(options) ? "g" : "ig"
);
if (regex) { if (regex) {
stack[0] = state; stack[0] = state;
stack[1] = regex; stack[1] = regex;
} }
return tokens; return tokens;
} }
}, },
{ {
regex : "^(?=Found \\d+ matches)", regex: "^(?=Found \\d+ matches)",
token : "text", token: "text",
next : "numbers" next: "numbers"
}, },
{ {
token : "string", // single line token: "string", // single line
regex : "^\\S:?[^:]+", regex: "^\\S:?[^:]+",
next : "numbers" next: "numbers"
} }
], ],
numbers:[{ numbers: [{
regex : "\\d+", regex: "\\d+",
token : "constant.numeric" token: "constant.numeric"
}, { }, {
regex : "$", regex: "$",
token : "text", token: "text",
next : "start" next: "start"
}] }]
}; };
this.normalizeRules(); this.normalizeRules();
}; };
oop.inherits(C9SearchHighlightRules, TextHighlightRules); oop.inherits(C9SearchHighlightRules, TextHighlightRules);
exports.C9SearchHighlightRules = C9SearchHighlightRules; exports.C9SearchHighlightRules = C9SearchHighlightRules;
}); });
define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module){"use strict";
"use strict";
var Range = require("../range").Range; var Range = require("../range").Range;
var MatchingBraceOutdent = function () { };
var MatchingBraceOutdent = function() {}; (function () {
this.checkOutdent = function (line, input) {
(function() { if (!/^\s+$/.test(line))
this.checkOutdent = function(line, input) {
if (! /^\s+$/.test(line))
return false; return false;
return /^\s*\}/.test(input); return /^\s*\}/.test(input);
}; };
this.autoOutdent = function (doc, row) {
this.autoOutdent = function(doc, row) {
var line = doc.getLine(row); var line = doc.getLine(row);
var match = line.match(/^(\s*\})/); var match = line.match(/^(\s*\})/);
if (!match)
if (!match) return 0; return 0;
var column = match[1].length; var column = match[1].length;
var openBracePos = doc.findMatchingBracket({row: row, column: column}); var openBracePos = doc.findMatchingBracket({ row: row, column: column });
if (!openBracePos || openBracePos.row == row)
if (!openBracePos || openBracePos.row == row) return 0; return 0;
var indent = this.$getIndent(doc.getLine(openBracePos.row)); var indent = this.$getIndent(doc.getLine(openBracePos.row));
doc.replace(new Range(row, 0, row, column-1), indent); doc.replace(new Range(row, 0, row, column - 1), indent);
}; };
this.$getIndent = function (line) {
this.$getIndent = function(line) {
return line.match(/^\s*/)[0]; return line.match(/^\s*/)[0];
}; };
}).call(MatchingBraceOutdent.prototype); }).call(MatchingBraceOutdent.prototype);
exports.MatchingBraceOutdent = MatchingBraceOutdent; exports.MatchingBraceOutdent = MatchingBraceOutdent;
}); });
define("ace/mode/folding/c9search",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { define("ace/mode/folding/c9search",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../../lib/oop"); var oop = require("../../lib/oop");
var Range = require("../../range").Range; var Range = require("../../range").Range;
var BaseFoldMode = require("./fold_mode").FoldMode; var BaseFoldMode = require("./fold_mode").FoldMode;
var FoldMode = exports.FoldMode = function () { };
var FoldMode = exports.FoldMode = function() {};
oop.inherits(FoldMode, BaseFoldMode); oop.inherits(FoldMode, BaseFoldMode);
(function () {
(function() {
this.foldingStartMarker = /^(\S.*:|Searching for.*)$/; this.foldingStartMarker = /^(\S.*:|Searching for.*)$/;
this.foldingStopMarker = /^(\s+|Found.*)$/; this.foldingStopMarker = /^(\s+|Found.*)$/;
this.getFoldWidgetRange = function (session, foldStyle, row) {
this.getFoldWidgetRange = function(session, foldStyle, row) {
var lines = session.doc.getAllLines(row); var lines = session.doc.getAllLines(row);
var line = lines[row]; var line = lines[row];
var level1 = /^(Found.*|Searching for.*)$/; var level1 = /^(Found.*|Searching for.*)$/;
var level2 = /^(\S.*:|\s*)$/; var level2 = /^(\S.*:|\s*)$/;
var re = level1.test(line) ? level1 : level2; var re = level1.test(line) ? level1 : level2;
var startRow = row; var startRow = row;
var endRow = row; var endRow = row;
if (this.foldingStartMarker.test(line)) { if (this.foldingStartMarker.test(line)) {
for (var i = row + 1, l = session.getLength(); i < l; i++) { for (var i = row + 1, l = session.getLength(); i < l; i++) {
if (re.test(lines[i])) if (re.test(lines[i]))
@ -243,45 +209,42 @@ oop.inherits(FoldMode, BaseFoldMode);
return new Range(startRow, col, endRow, 0); return new Range(startRow, col, endRow, 0);
} }
}; };
}).call(FoldMode.prototype); }).call(FoldMode.prototype);
}); });
define("ace/mode/c9search",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/c9search_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/folding/c9search"], function(require, exports, module) { define("ace/mode/c9search",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/c9search_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/folding/c9search"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextMode = require("./text").Mode; var TextMode = require("./text").Mode;
var C9SearchHighlightRules = require("./c9search_highlight_rules").C9SearchHighlightRules; var C9SearchHighlightRules = require("./c9search_highlight_rules").C9SearchHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var C9StyleFoldMode = require("./folding/c9search").FoldMode; var C9StyleFoldMode = require("./folding/c9search").FoldMode;
var Mode = function () {
var Mode = function() {
this.HighlightRules = C9SearchHighlightRules; this.HighlightRules = C9SearchHighlightRules;
this.$outdent = new MatchingBraceOutdent(); this.$outdent = new MatchingBraceOutdent();
this.foldingRules = new C9StyleFoldMode(); this.foldingRules = new C9StyleFoldMode();
}; };
oop.inherits(Mode, TextMode); oop.inherits(Mode, TextMode);
(function () {
(function() { this.getNextLineIndent = function (state, line, tab) {
this.getNextLineIndent = function(state, line, tab) {
var indent = this.$getIndent(line); var indent = this.$getIndent(line);
return indent; return indent;
}; };
this.checkOutdent = function (state, line, input) {
this.checkOutdent = function(state, line, input) {
return this.$outdent.checkOutdent(line, input); return this.$outdent.checkOutdent(line, input);
}; };
this.autoOutdent = function (state, doc, row) {
this.autoOutdent = function(state, doc, row) {
this.$outdent.autoOutdent(doc, row); this.$outdent.autoOutdent(doc, row);
}; };
this.$id = "ace/mode/c9search"; this.$id = "ace/mode/c9search";
}).call(Mode.prototype); }).call(Mode.prototype);
exports.Mode = Mode; exports.Mode = Mode;
}); }); (function() {
window.require(["ace/mode/c9search"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

View File

@ -1,370 +1,300 @@
define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var DocCommentHighlightRules = function () {
var DocCommentHighlightRules = function() {
this.$rules = { this.$rules = {
"start" : [ { "start": [
token : "comment.doc.tag", {
regex : "@[\\w\\d_]+" // TODO: fix email addresses token: "comment.doc.tag",
}, regex: "@\\w+(?=\\s|$)"
DocCommentHighlightRules.getTagRule(), }, DocCommentHighlightRules.getTagRule(), {
{ defaultToken: "comment.doc",
defaultToken : "comment.doc", caseInsensitive: true
caseInsensitive: true }
}] ]
}; };
}; };
oop.inherits(DocCommentHighlightRules, TextHighlightRules); oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getTagRule = function (start) {
DocCommentHighlightRules.getTagRule = function(start) {
return { return {
token : "comment.doc.tag.storage.type", token: "comment.doc.tag.storage.type",
regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" regex: "\\b(?:TODO|FIXME|XXX|HACK)\\b"
}; };
}; };
DocCommentHighlightRules.getStartRule = function (start) {
DocCommentHighlightRules.getStartRule = function(start) {
return { return {
token : "comment.doc", // doc comment token: "comment.doc", // doc comment
regex : "\\/\\*(?=\\*)", regex: "\\/\\*(?=\\*)",
next : start next: start
}; };
}; };
DocCommentHighlightRules.getEndRule = function (start) { DocCommentHighlightRules.getEndRule = function (start) {
return { return {
token : "comment.doc", // closing comment token: "comment.doc", // closing comment
regex : "\\*\\/", regex: "\\*\\/",
next : start next: start
}; };
}; };
exports.DocCommentHighlightRules = DocCommentHighlightRules; exports.DocCommentHighlightRules = DocCommentHighlightRules;
}); });
define("ace/mode/c_cpp_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { define("ace/mode/c_cpp_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var cFunctions = exports.cFunctions = "\\b(?:hypot(?:f|l)?|s(?:scanf|ystem|nprintf|ca(?:nf|lb(?:n(?:f|l)?|ln(?:f|l)?))|i(?:n(?:h(?:f|l)?|f|l)?|gn(?:al|bit))|tr(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?)|error|pbrk|ftime|len|rchr|xfrm)|printf|et(?:jmp|vbuf|locale|buf)|qrt(?:f|l)?|w(?:scanf|printf)|rand)|n(?:e(?:arbyint(?:f|l)?|xt(?:toward(?:f|l)?|after(?:f|l)?))|an(?:f|l)?)|c(?:s(?:in(?:h(?:f|l)?|f|l)?|qrt(?:f|l)?)|cos(?:h(?:f)?|f|l)?|imag(?:f|l)?|t(?:ime|an(?:h(?:f|l)?|f|l)?)|o(?:s(?:h(?:f|l)?|f|l)?|nj(?:f|l)?|pysign(?:f|l)?)|p(?:ow(?:f|l)?|roj(?:f|l)?)|e(?:il(?:f|l)?|xp(?:f|l)?)|l(?:o(?:ck|g(?:f|l)?)|earerr)|a(?:sin(?:h(?:f|l)?|f|l)?|cos(?:h(?:f|l)?|f|l)?|tan(?:h(?:f|l)?|f|l)?|lloc|rg(?:f|l)?|bs(?:f|l)?)|real(?:f|l)?|brt(?:f|l)?)|t(?:ime|o(?:upper|lower)|an(?:h(?:f|l)?|f|l)?|runc(?:f|l)?|gamma(?:f|l)?|mp(?:nam|file))|i(?:s(?:space|n(?:ormal|an)|cntrl|inf|digit|u(?:nordered|pper)|p(?:unct|rint)|finite|w(?:space|c(?:ntrl|type)|digit|upper|p(?:unct|rint)|lower|al(?:num|pha)|graph|xdigit|blank)|l(?:ower|ess(?:equal|greater)?)|al(?:num|pha)|gr(?:eater(?:equal)?|aph)|xdigit|blank)|logb(?:f|l)?|max(?:div|abs))|di(?:v|fftime)|_Exit|unget(?:c|wc)|p(?:ow(?:f|l)?|ut(?:s|c(?:har)?|wc(?:har)?)|error|rintf)|e(?:rf(?:c(?:f|l)?|f|l)?|x(?:it|p(?:2(?:f|l)?|f|l|m1(?:f|l)?)?))|v(?:s(?:scanf|nprintf|canf|printf|w(?:scanf|printf))|printf|f(?:scanf|printf|w(?:scanf|printf))|w(?:scanf|printf)|a_(?:start|copy|end|arg))|qsort|f(?:s(?:canf|e(?:tpos|ek))|close|tell|open|dim(?:f|l)?|p(?:classify|ut(?:s|c|w(?:s|c))|rintf)|e(?:holdexcept|set(?:e(?:nv|xceptflag)|round)|clearexcept|testexcept|of|updateenv|r(?:aiseexcept|ror)|get(?:e(?:nv|xceptflag)|round))|flush|w(?:scanf|ide|printf|rite)|loor(?:f|l)?|abs(?:f|l)?|get(?:s|c|pos|w(?:s|c))|re(?:open|e|ad|xp(?:f|l)?)|m(?:in(?:f|l)?|od(?:f|l)?|a(?:f|l|x(?:f|l)?)?))|l(?:d(?:iv|exp(?:f|l)?)|o(?:ngjmp|cal(?:time|econv)|g(?:1(?:p(?:f|l)?|0(?:f|l)?)|2(?:f|l)?|f|l|b(?:f|l)?)?)|abs|l(?:div|abs|r(?:int(?:f|l)?|ound(?:f|l)?))|r(?:int(?:f|l)?|ound(?:f|l)?)|gamma(?:f|l)?)|w(?:scanf|c(?:s(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?|mbs)|pbrk|ftime|len|r(?:chr|tombs)|xfrm)|to(?:b|mb)|rtomb)|printf|mem(?:set|c(?:hr|py|mp)|move))|a(?:s(?:sert|ctime|in(?:h(?:f|l)?|f|l)?)|cos(?:h(?:f|l)?|f|l)?|t(?:o(?:i|f|l(?:l)?)|exit|an(?:h(?:f|l)?|2(?:f|l)?|f|l)?)|b(?:s|ort))|g(?:et(?:s|c(?:har)?|env|wc(?:har)?)|mtime)|r(?:int(?:f|l)?|ound(?:f|l)?|e(?:name|alloc|wind|m(?:ove|quo(?:f|l)?|ainder(?:f|l)?))|a(?:nd|ise))|b(?:search|towc)|m(?:odf(?:f|l)?|em(?:set|c(?:hr|py|mp)|move)|ktime|alloc|b(?:s(?:init|towcs|rtowcs)|towc|len|r(?:towc|len))))\\b"; var cFunctions = exports.cFunctions = "hypot|hypotf|hypotl|sscanf|system|snprintf|scanf|scalbn|scalbnf|scalbnl|scalbln|scalblnf|scalblnl|sin|sinh|sinhf|sinhl|sinf|sinl|signal|signbit|strstr|strspn|strncpy|strncat|strncmp|strcspn|strchr|strcoll|strcpy|strcat|strcmp|strtoimax|strtod|strtoul|strtoull|strtoumax|strtok|strtof|strtol|strtold|strtoll|strerror|strpbrk|strftime|strlen|strrchr|strxfrm|sprintf|setjmp|setvbuf|setlocale|setbuf|sqrt|sqrtf|sqrtl|swscanf|swprintf|srand|nearbyint|nearbyintf|nearbyintl|nexttoward|nexttowardf|nexttowardl|nextafter|nextafterf|nextafterl|nan|nanf|nanl|csin|csinh|csinhf|csinhl|csinf|csinl|csqrt|csqrtf|csqrtl|ccos|ccosh|ccoshf|ccosf|ccosl|cimag|cimagf|cimagl|ctime|ctan|ctanh|ctanhf|ctanhl|ctanf|ctanl|cos|cosh|coshf|coshl|cosf|cosl|conj|conjf|conjl|copysign|copysignf|copysignl|cpow|cpowf|cpowl|cproj|cprojf|cprojl|ceil|ceilf|ceill|cexp|cexpf|cexpl|clock|clog|clogf|clogl|clearerr|casin|casinh|casinhf|casinhl|casinf|casinl|cacos|cacosh|cacoshf|cacoshl|cacosf|cacosl|catan|catanh|catanhf|catanhl|catanf|catanl|calloc|carg|cargf|cargl|cabs|cabsf|cabsl|creal|crealf|creall|cbrt|cbrtf|cbrtl|time|toupper|tolower|tan|tanh|tanhf|tanhl|tanf|tanl|trunc|truncf|truncl|tgamma|tgammaf|tgammal|tmpnam|tmpfile|isspace|isnormal|isnan|iscntrl|isinf|isdigit|isunordered|isupper|ispunct|isprint|isfinite|iswspace|iswcntrl|iswctype|iswdigit|iswupper|iswpunct|iswprint|iswlower|iswalnum|iswalpha|iswgraph|iswxdigit|iswblank|islower|isless|islessequal|islessgreater|isalnum|isalpha|isgreater|isgreaterequal|isgraph|isxdigit|isblank|ilogb|ilogbf|ilogbl|imaxdiv|imaxabs|div|difftime|_Exit|ungetc|ungetwc|pow|powf|powl|puts|putc|putchar|putwc|putwchar|perror|printf|erf|erfc|erfcf|erfcl|erff|erfl|exit|exp|exp2|exp2f|exp2l|expf|expl|expm1|expm1f|expm1l|vsscanf|vsnprintf|vscanf|vsprintf|vswscanf|vswprintf|vprintf|vfscanf|vfprintf|vfwscanf|vfwprintf|vwscanf|vwprintf|va_start|va_copy|va_end|va_arg|qsort|fscanf|fsetpos|fseek|fclose|ftell|fopen|fdim|fdimf|fdiml|fpclassify|fputs|fputc|fputws|fputwc|fprintf|feholdexcept|fesetenv|fesetexceptflag|fesetround|feclearexcept|fetestexcept|feof|feupdateenv|feraiseexcept|ferror|fegetenv|fegetexceptflag|fegetround|fflush|fwscanf|fwide|fwprintf|fwrite|floor|floorf|floorl|fabs|fabsf|fabsl|fgets|fgetc|fgetpos|fgetws|fgetwc|freopen|free|fread|frexp|frexpf|frexpl|fmin|fminf|fminl|fmod|fmodf|fmodl|fma|fmaf|fmal|fmax|fmaxf|fmaxl|ldiv|ldexp|ldexpf|ldexpl|longjmp|localtime|localeconv|log|log1p|log1pf|log1pl|log10|log10f|log10l|log2|log2f|log2l|logf|logl|logb|logbf|logbl|labs|lldiv|llabs|llrint|llrintf|llrintl|llround|llroundf|llroundl|lrint|lrintf|lrintl|lround|lroundf|lroundl|lgamma|lgammaf|lgammal|wscanf|wcsstr|wcsspn|wcsncpy|wcsncat|wcsncmp|wcscspn|wcschr|wcscoll|wcscpy|wcscat|wcscmp|wcstoimax|wcstod|wcstoul|wcstoull|wcstoumax|wcstok|wcstof|wcstol|wcstold|wcstoll|wcstombs|wcspbrk|wcsftime|wcslen|wcsrchr|wcsrtombs|wcsxfrm|wctob|wctomb|wcrtomb|wprintf|wmemset|wmemchr|wmemcpy|wmemcmp|wmemmove|assert|asctime|asin|asinh|asinhf|asinhl|asinf|asinl|acos|acosh|acoshf|acoshl|acosf|acosl|atoi|atof|atol|atoll|atexit|atan|atanh|atanhf|atanhl|atan2|atan2f|atan2l|atanf|atanl|abs|abort|gets|getc|getchar|getenv|getwc|getwchar|gmtime|rint|rintf|rintl|round|roundf|roundl|rename|realloc|rewind|remove|remquo|remquof|remquol|remainder|remainderf|remainderl|rand|raise|bsearch|btowc|modf|modff|modfl|memset|memchr|memcpy|memcmp|memmove|mktime|malloc|mbsinit|mbstowcs|mbsrtowcs|mbtowc|mblen|mbrtowc|mbrlen";
var c_cppHighlightRules = function (extraKeywords) {
var c_cppHighlightRules = function() { var keywordControls = ("break|case|continue|default|do|else|for|goto|if|_Pragma|" +
"return|switch|while|catch|operator|try|throw|using");
var keywordControls = ( var storageType = ("asm|__asm__|auto|bool|_Bool|char|_Complex|double|enum|float|" +
"break|case|continue|default|do|else|for|goto|if|_Pragma|" + "_Imaginary|int|int8_t|int16_t|int32_t|int64_t|long|short|signed|size_t|struct|typedef|uint8_t|uint16_t|uint32_t|uint64_t|union|unsigned|void|" +
"return|switch|while|catch|operator|try|throw|using" "class|wchar_t|template|char16_t|char32_t");
); var storageModifiers = ("const|extern|register|restrict|static|volatile|inline|private|" +
var storageType = (
"asm|__asm__|auto|bool|_Bool|char|_Complex|double|enum|float|" +
"_Imaginary|int|long|short|signed|struct|typedef|union|unsigned|void|" +
"class|wchar_t|template|char16_t|char32_t"
);
var storageModifiers = (
"const|extern|register|restrict|static|volatile|inline|private|" +
"protected|public|friend|explicit|virtual|export|mutable|typename|" + "protected|public|friend|explicit|virtual|export|mutable|typename|" +
"constexpr|new|delete|alignas|alignof|decltype|noexcept|thread_local" "constexpr|new|delete|alignas|alignof|decltype|noexcept|thread_local");
); var keywordOperators = ("and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq|" +
"const_cast|dynamic_cast|reinterpret_cast|static_cast|sizeof|namespace");
var keywordOperators = ( var builtinConstants = ("NULL|true|false|TRUE|FALSE|nullptr");
"and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq" + var keywordMapper = this.$keywords = this.createKeywordMapper(Object.assign({
"const_cast|dynamic_cast|reinterpret_cast|static_cast|sizeof|namespace" "keyword.control": keywordControls,
); "storage.type": storageType,
"storage.modifier": storageModifiers,
var builtinConstants = ( "keyword.operator": keywordOperators,
"NULL|true|false|TRUE|FALSE|nullptr"
);
var keywordMapper = this.$keywords = this.createKeywordMapper({
"keyword.control" : keywordControls,
"storage.type" : storageType,
"storage.modifier" : storageModifiers,
"keyword.operator" : keywordOperators,
"variable.language": "this", "variable.language": "this",
"constant.language": builtinConstants "constant.language": builtinConstants,
}, "identifier"); "support.function.C99.c": cFunctions
}, extraKeywords), "identifier");
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b"; var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b";
var escapeRe = /\\(?:['"?\\abfnrtv]|[0-7]{1,3}|x[a-fA-F\d]{2}|u[a-fA-F\d]{4}U[a-fA-F\d]{8}|.)/.source; var escapeRe = /\\(?:['"?\\abfnrtv]|[0-7]{1,3}|x[a-fA-F\d]{2}|u[a-fA-F\d]{4}U[a-fA-F\d]{8}|.)/.source;
var formatRe = "%" var formatRe = "%"
+ /(\d+\$)?/.source // field (argument #) + /(\d+\$)?/.source // field (argument #)
+ /[#0\- +']*/.source // flags + /[#0\- +']*/.source // flags
+ /[,;:_]?/.source // separator character (AltiVec) + /[,;:_]?/.source // separator character (AltiVec)
+ /((-?\d+)|\*(-?\d+\$)?)?/.source // minimum field width + /((-?\d+)|\*(-?\d+\$)?)?/.source // minimum field width
+ /(\.((-?\d+)|\*(-?\d+\$)?)?)?/.source // precision + /(\.((-?\d+)|\*(-?\d+\$)?)?)?/.source // precision
+ /(hh|h|ll|l|j|t|z|q|L|vh|vl|v|hv|hl)?/.source // length modifier + /(hh|h|ll|l|j|t|z|q|L|vh|vl|v|hv|hl)?/.source // length modifier
+ /(\[[^"\]]+\]|[diouxXDOUeEfFgGaACcSspn%])/.source; // conversion type + /(\[[^"\]]+\]|[diouxXDOUeEfFgGaACcSspn%])/.source; // conversion type
this.$rules = { this.$rules = {
"start" : [ "start": [
{ {
token : "comment", token: "comment",
regex : "//$", regex: "//$",
next : "start" next: "start"
}, { }, {
token : "comment", token: "comment",
regex : "//", regex: "//",
next : "singleLineComment" next: "singleLineComment"
}, },
DocCommentHighlightRules.getStartRule("doc-start"), DocCommentHighlightRules.getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token: "comment", // multi line comment
regex : "\\/\\*", regex: "\\/\\*",
next : "comment" next: "comment"
}, { }, {
token : "string", // character token: "string", // character
regex : "'(?:" + escapeRe + "|.)?'" regex: "'(?:" + escapeRe + "|.)?'"
}, { }, {
token : "string.start", token: "string.start",
regex : '"', regex: '"',
stateName: "qqstring", stateName: "qqstring",
next: [ next: [
{ token: "string", regex: /\\\s*$/, next: "qqstring" }, { token: "string", regex: /\\\s*$/, next: "qqstring" },
{ token: "constant.language.escape", regex: escapeRe }, { token: "constant.language.escape", regex: escapeRe },
{ token: "constant.language.escape", regex: formatRe }, { token: "constant.language.escape", regex: formatRe },
{ token: "string.end", regex: '"|$', next: "start" }, { token: "string.end", regex: '"|$', next: "start" },
{ defaultToken: "string"} { defaultToken: "string" }
] ]
}, { }, {
token : "string.start", token: "string.start",
regex : 'R"\\(', regex: 'R"\\(',
stateName: "rawString", stateName: "rawString",
next: [ next: [
{ token: "string.end", regex: '\\)"', next: "start" }, { token: "string.end", regex: '\\)"', next: "start" },
{ defaultToken: "string"} { defaultToken: "string" }
] ]
}, { }, {
token : "constant.numeric", // hex token: "constant.numeric", // hex
regex : "0[xX][0-9a-fA-F]+(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b" regex: "0[xX][0-9a-fA-F]+(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b"
}, { }, {
token : "constant.numeric", // float token: "constant.numeric", // float
regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b" regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b"
}, { }, {
token : "keyword", // pre-compiler directives token: "keyword", // pre-compiler directives
regex : "#\\s*(?:include|import|pragma|line|define|undef)\\b", regex: "#\\s*(?:include|import|pragma|line|define|undef)\\b",
next : "directive" next: "directive"
}, { }, {
token : "keyword", // special case pre-compiler directive token: "keyword", // special case pre-compiler directive
regex : "#\\s*(?:endif|if|ifdef|else|elif|ifndef)\\b" regex: "#\\s*(?:endif|if|ifdef|else|elif|ifndef)\\b"
}, { }, {
token : "support.function.C99.c", token: keywordMapper,
regex : cFunctions regex: "[a-zA-Z_$][a-zA-Z0-9_$]*"
}, { }, {
token : keywordMapper, token: "keyword.operator",
regex : "[a-zA-Z_$][a-zA-Z0-9_$]*" regex: /--|\+\+|<<=|>>=|>>>=|<>|&&|\|\||\?:|[*%\/+\-&\^|~!<>=]=?/
}, { }, {
token : "keyword.operator", token: "punctuation.operator",
regex : /--|\+\+|<<=|>>=|>>>=|<>|&&|\|\||\?:|[*%\/+\-&\^|~!<>=]=?/ regex: "\\?|\\:|\\,|\\;|\\."
}, { }, {
token : "punctuation.operator", token: "paren.lparen",
regex : "\\?|\\:|\\,|\\;|\\." regex: "[[({]"
}, { }, {
token : "paren.lparen", token: "paren.rparen",
regex : "[[({]" regex: "[\\])}]"
}, { }, {
token : "paren.rparen", token: "text",
regex : "[\\])}]" regex: "\\s+"
}, {
token : "text",
regex : "\\s+"
} }
], ],
"comment" : [ "comment": [
{ {
token : "comment", // closing comment token: "comment", // closing comment
regex : "\\*\\/", regex: "\\*\\/",
next : "start" next: "start"
}, {
defaultToken : "comment"
}
],
"singleLineComment" : [
{
token : "comment",
regex : /\\$/,
next : "singleLineComment"
}, {
token : "comment",
regex : /$/,
next : "start"
}, { }, {
defaultToken: "comment" defaultToken: "comment"
} }
], ],
"directive" : [ "singleLineComment": [
{ {
token : "constant.other.multiline", token: "comment",
regex : /\\/ regex: /\\$/,
next: "singleLineComment"
}, {
token: "comment",
regex: /$/,
next: "start"
}, {
defaultToken: "comment"
}
],
"directive": [
{
token: "constant.other.multiline",
regex: /\\/
}, },
{ {
token : "constant.other.multiline", token: "constant.other.multiline",
regex : /.*\\/ regex: /.*\\/
}, },
{ {
token : "constant.other", token: "constant.other",
regex : "\\s*<.+?>", regex: "\\s*<.+?>",
next : "start" next: "start"
}, },
{ {
token : "constant.other", // single line token: "constant.other", // single line
regex : '\\s*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]', regex: '\\s*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]',
next : "start" next: "start"
}, },
{ {
token : "constant.other", // single line token: "constant.other", // single line
regex : "\\s*['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']", regex: "\\s*['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']",
next : "start" next: "start"
}, },
{ {
token : "constant.other", token: "constant.other",
regex : /[^\\\/]+/, regex: /[^\\\/]+/,
next : "start" next: "start"
} }
] ]
}; };
this.embedRules(DocCommentHighlightRules, "doc-", [DocCommentHighlightRules.getEndRule("start")]);
this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]);
this.normalizeRules(); this.normalizeRules();
}; };
oop.inherits(c_cppHighlightRules, TextHighlightRules); oop.inherits(c_cppHighlightRules, TextHighlightRules);
exports.c_cppHighlightRules = c_cppHighlightRules; exports.c_cppHighlightRules = c_cppHighlightRules;
}); });
define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module){"use strict";
"use strict";
var Range = require("../range").Range; var Range = require("../range").Range;
var MatchingBraceOutdent = function () { };
var MatchingBraceOutdent = function() {}; (function () {
this.checkOutdent = function (line, input) {
(function() { if (!/^\s+$/.test(line))
this.checkOutdent = function(line, input) {
if (! /^\s+$/.test(line))
return false; return false;
return /^\s*\}/.test(input); return /^\s*\}/.test(input);
}; };
this.autoOutdent = function (doc, row) {
this.autoOutdent = function(doc, row) {
var line = doc.getLine(row); var line = doc.getLine(row);
var match = line.match(/^(\s*\})/); var match = line.match(/^(\s*\})/);
if (!match)
if (!match) return 0; return 0;
var column = match[1].length; var column = match[1].length;
var openBracePos = doc.findMatchingBracket({row: row, column: column}); var openBracePos = doc.findMatchingBracket({ row: row, column: column });
if (!openBracePos || openBracePos.row == row)
if (!openBracePos || openBracePos.row == row) return 0; return 0;
var indent = this.$getIndent(doc.getLine(openBracePos.row)); var indent = this.$getIndent(doc.getLine(openBracePos.row));
doc.replace(new Range(row, 0, row, column-1), indent); doc.replace(new Range(row, 0, row, column - 1), indent);
}; };
this.$getIndent = function (line) {
this.$getIndent = function(line) {
return line.match(/^\s*/)[0]; return line.match(/^\s*/)[0];
}; };
}).call(MatchingBraceOutdent.prototype); }).call(MatchingBraceOutdent.prototype);
exports.MatchingBraceOutdent = MatchingBraceOutdent; exports.MatchingBraceOutdent = MatchingBraceOutdent;
}); });
define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../../lib/oop"); var oop = require("../../lib/oop");
var Range = require("../../range").Range; var Range = require("../../range").Range;
var BaseFoldMode = require("./fold_mode").FoldMode; var BaseFoldMode = require("./fold_mode").FoldMode;
var FoldMode = exports.FoldMode = function (commentRegex) {
var FoldMode = exports.FoldMode = function(commentRegex) {
if (commentRegex) { if (commentRegex) {
this.foldingStartMarker = new RegExp( this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
);
this.foldingStopMarker = new RegExp(
this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
);
} }
}; };
oop.inherits(FoldMode, BaseFoldMode); oop.inherits(FoldMode, BaseFoldMode);
(function () {
(function() {
this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/; this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/; this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
this._getFoldWidgetBase = this.getFoldWidget; this._getFoldWidgetBase = this.getFoldWidget;
this.getFoldWidget = function(session, foldStyle, row) { this.getFoldWidget = function (session, foldStyle, row) {
var line = session.getLine(row); var line = session.getLine(row);
if (this.singleLineBlockCommentRe.test(line)) { if (this.singleLineBlockCommentRe.test(line)) {
if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
return ""; return "";
} }
var fw = this._getFoldWidgetBase(session, foldStyle, row); var fw = this._getFoldWidgetBase(session, foldStyle, row);
if (!fw && this.startRegionRe.test(line)) if (!fw && this.startRegionRe.test(line))
return "start"; // lineCommentRegionStart return "start"; // lineCommentRegionStart
return fw; return fw;
}; };
this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
var line = session.getLine(row); var line = session.getLine(row);
if (this.startRegionRe.test(line)) if (this.startRegionRe.test(line))
return this.getCommentRegionBlock(session, line, row); return this.getCommentRegionBlock(session, line, row);
var match = line.match(this.foldingStartMarker); var match = line.match(this.foldingStartMarker);
if (match) { if (match) {
var i = match.index; var i = match.index;
if (match[1]) if (match[1])
return this.openingBracketBlock(session, match[1], row, i); return this.openingBracketBlock(session, match[1], row, i);
var range = session.getCommentFoldRange(row, i + match[0].length, 1); var range = session.getCommentFoldRange(row, i + match[0].length, 1);
if (range && !range.isMultiLine()) { if (range && !range.isMultiLine()) {
if (forceMultiline) { if (forceMultiline) {
range = this.getSectionRange(session, row); range = this.getSectionRange(session, row);
} else if (foldStyle != "all") }
else if (foldStyle != "all")
range = null; range = null;
} }
return range; return range;
} }
if (foldStyle === "markbegin") if (foldStyle === "markbegin")
return; return;
var match = line.match(this.foldingStopMarker); var match = line.match(this.foldingStopMarker);
if (match) { if (match) {
var i = match.index + match[0].length; var i = match.index + match[0].length;
if (match[1]) if (match[1])
return this.closingBracketBlock(session, match[1], row, i); return this.closingBracketBlock(session, match[1], row, i);
return session.getCommentFoldRange(row, i, -1); return session.getCommentFoldRange(row, i, -1);
} }
}; };
this.getSectionRange = function (session, row) {
this.getSectionRange = function(session, row) {
var line = session.getLine(row); var line = session.getLine(row);
var startIndent = line.search(/\S/); var startIndent = line.search(/\S/);
var startRow = row; var startRow = row;
@ -377,94 +307,82 @@ oop.inherits(FoldMode, BaseFoldMode);
var indent = line.search(/\S/); var indent = line.search(/\S/);
if (indent === -1) if (indent === -1)
continue; continue;
if (startIndent > indent) if (startIndent > indent)
break; break;
var subRange = this.getFoldWidgetRange(session, "all", row); var subRange = this.getFoldWidgetRange(session, "all", row);
if (subRange) { if (subRange) {
if (subRange.start.row <= startRow) { if (subRange.start.row <= startRow) {
break; break;
} else if (subRange.isMultiLine()) { }
else if (subRange.isMultiLine()) {
row = subRange.end.row; row = subRange.end.row;
} else if (startIndent == indent) { }
else if (startIndent == indent) {
break; break;
} }
} }
endRow = row; endRow = row;
} }
return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
}; };
this.getCommentRegionBlock = function(session, line, row) { this.getCommentRegionBlock = function (session, line, row) {
var startColumn = line.search(/\s*$/); var startColumn = line.search(/\s*$/);
var maxRow = session.getLength(); var maxRow = session.getLength();
var startRow = row; var startRow = row;
var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
var depth = 1; var depth = 1;
while (++row < maxRow) { while (++row < maxRow) {
line = session.getLine(row); line = session.getLine(row);
var m = re.exec(line); var m = re.exec(line);
if (!m) continue; if (!m)
if (m[1]) depth--; continue;
else depth++; if (m[1])
depth--;
if (!depth) break; else
depth++;
if (!depth)
break;
} }
var endRow = row; var endRow = row;
if (endRow > startRow) { if (endRow > startRow) {
return new Range(startRow, startColumn, endRow, line.length); return new Range(startRow, startColumn, endRow, line.length);
} }
}; };
}).call(FoldMode.prototype); }).call(FoldMode.prototype);
}); });
define("ace/mode/c_cpp",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/c_cpp_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) { define("ace/mode/c_cpp",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/c_cpp_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextMode = require("./text").Mode; var TextMode = require("./text").Mode;
var c_cppHighlightRules = require("./c_cpp_highlight_rules").c_cppHighlightRules; var c_cppHighlightRules = require("./c_cpp_highlight_rules").c_cppHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var Range = require("../range").Range;
var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
var CStyleFoldMode = require("./folding/cstyle").FoldMode; var CStyleFoldMode = require("./folding/cstyle").FoldMode;
var Mode = function () {
var Mode = function() {
this.HighlightRules = c_cppHighlightRules; this.HighlightRules = c_cppHighlightRules;
this.$outdent = new MatchingBraceOutdent(); this.$outdent = new MatchingBraceOutdent();
this.$behaviour = new CstyleBehaviour(); this.$behaviour = this.$defaultBehaviour;
this.foldingRules = new CStyleFoldMode(); this.foldingRules = new CStyleFoldMode();
}; };
oop.inherits(Mode, TextMode); oop.inherits(Mode, TextMode);
(function () {
(function() {
this.lineCommentStart = "//"; this.lineCommentStart = "//";
this.blockComment = {start: "/*", end: "*/"}; this.blockComment = { start: "/*", end: "*/" };
this.getNextLineIndent = function (state, line, tab) {
this.getNextLineIndent = function(state, line, tab) {
var indent = this.$getIndent(line); var indent = this.$getIndent(line);
var tokenizedLine = this.getTokenizer().getLineTokens(line, state); var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
var tokens = tokenizedLine.tokens; var tokens = tokenizedLine.tokens;
var endState = tokenizedLine.state; var endState = tokenizedLine.state;
if (tokens.length && tokens[tokens.length - 1].type == "comment") {
if (tokens.length && tokens[tokens.length-1].type == "comment") {
return indent; return indent;
} }
if (state == "start") { if (state == "start") {
var match = line.match(/^.*[\{\(\[]\s*$/); var match = line.match(/^.*[\{\(\[]\s*$/);
if (match) { if (match) {
indent += tab; indent += tab;
} }
} else if (state == "doc-start") { }
else if (state == "doc-start") {
if (endState == "start") { if (endState == "start") {
return ""; return "";
} }
@ -476,20 +394,24 @@ oop.inherits(Mode, TextMode);
indent += "* "; indent += "* ";
} }
} }
return indent; return indent;
}; };
this.checkOutdent = function (state, line, input) {
this.checkOutdent = function(state, line, input) {
return this.$outdent.checkOutdent(line, input); return this.$outdent.checkOutdent(line, input);
}; };
this.autoOutdent = function (state, doc, row) {
this.autoOutdent = function(state, doc, row) {
this.$outdent.autoOutdent(doc, row); this.$outdent.autoOutdent(doc, row);
}; };
this.$id = "ace/mode/c_cpp"; this.$id = "ace/mode/c_cpp";
this.snippetFileId = "ace/snippets/c_cpp";
}).call(Mode.prototype); }).call(Mode.prototype);
exports.Mode = Mode; exports.Mode = Mode;
});
}); (function() {
window.require(["ace/mode/c_cpp"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

View File

@ -1,153 +1,141 @@
define("ace/mode/cirru_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { define("ace/mode/cirru_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var CirruHighlightRules = function() { var CirruHighlightRules = function () {
this.$rules = { this.$rules = {
start: [{ start: [{
token: 'constant.numeric', token: 'constant.numeric',
regex: /[\d\.]+/ regex: /[\d\.]+/
}, { }, {
token: 'comment.line.double-dash', token: 'comment.line.double-dash',
regex: /--/, regex: /--/,
next: 'comment' next: 'comment'
}, { }, {
token: 'storage.modifier', token: 'storage.modifier',
regex: /\(/ regex: /\(/
}, { }, {
token: 'storage.modifier', token: 'storage.modifier',
regex: /,/, regex: /,/,
next: 'line' next: 'line'
}, { }, {
token: 'support.function', token: 'support.function',
regex: /[^\(\)"\s]+/, regex: /[^\(\)"\s{}\[\]]+/,
next: 'line' next: 'line'
}, { }, {
token: 'string.quoted.double', token: 'string.quoted.double',
regex: /"/, regex: /"/,
next: 'string' next: 'string'
}, { }, {
token: 'storage.modifier', token: 'storage.modifier',
regex: /\)/ regex: /\)/
}], }],
comment: [{ comment: [{
token: 'comment.line.double-dash', token: 'comment.line.double-dash',
regex: / +[^\n]+/, regex: / +[^\n]+/,
next: 'start' next: 'start'
}], }],
string: [{ string: [{
token: 'string.quoted.double', token: 'string.quoted.double',
regex: /"/, regex: /"/,
next: 'line' next: 'line'
}, { }, {
token: 'constant.character.escape', token: 'constant.character.escape',
regex: /\\/, regex: /\\/,
next: 'escape' next: 'escape'
}, { }, {
token: 'string.quoted.double', token: 'string.quoted.double',
regex: /[^\\"]+/ regex: /[^\\"]+/
}], }],
escape: [{ escape: [{
token: 'constant.character.escape', token: 'constant.character.escape',
regex: /./, regex: /./,
next: 'string' next: 'string'
}], }],
line: [{ line: [{
token: 'constant.numeric', token: 'constant.numeric',
regex: /[\d\.]+/ regex: /[\d\.]+/
}, { }, {
token: 'markup.raw', token: 'markup.raw',
regex: /^\s*/, regex: /^\s*/,
next: 'start' next: 'start'
}, { }, {
token: 'storage.modifier', token: 'storage.modifier',
regex: /\$/, regex: /\$/,
next: 'start' next: 'start'
}, { }, {
token: 'variable.parameter', token: 'variable.parameter',
regex: /[^\(\)"\s]+/ regex: /[^\(\)"\s{}\[\]]+/
}, { }, {
token: 'storage.modifier', token: 'storage.modifier',
regex: /\(/, regex: /\(/,
next: 'start' next: 'start'
}, { }, {
token: 'storage.modifier', token: 'storage.modifier',
regex: /\)/ regex: /\)/
}, { }, {
token: 'markup.raw', token: 'markup.raw',
regex: /^ */, regex: /^ */,
next: 'start' next: 'start'
}, { }, {
token: 'string.quoted.double', token: 'string.quoted.double',
regex: /"/, regex: /"/,
next: 'string' next: 'string'
}] }]
}; };
}; };
oop.inherits(CirruHighlightRules, TextHighlightRules); oop.inherits(CirruHighlightRules, TextHighlightRules);
exports.CirruHighlightRules = CirruHighlightRules; exports.CirruHighlightRules = CirruHighlightRules;
}); });
define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module) { define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../../lib/oop"); var oop = require("../../lib/oop");
var BaseFoldMode = require("./fold_mode").FoldMode; var BaseFoldMode = require("./fold_mode").FoldMode;
var Range = require("../../range").Range; var Range = require("../../range").Range;
var FoldMode = exports.FoldMode = function () { };
var FoldMode = exports.FoldMode = function() {};
oop.inherits(FoldMode, BaseFoldMode); oop.inherits(FoldMode, BaseFoldMode);
(function () {
(function() { this.commentBlock = function (session, row) {
this.getFoldWidgetRange = function(session, foldStyle, row) {
var range = this.indentationBlock(session, row);
if (range)
return range;
var re = /\S/; var re = /\S/;
var line = session.getLine(row); var line = session.getLine(row);
var startLevel = line.search(re); var startLevel = line.search(re);
if (startLevel == -1 || line[startLevel] != "#") if (startLevel == -1 || line[startLevel] != "#")
return; return;
var startColumn = line.length; var startColumn = line.length;
var maxRow = session.getLength(); var maxRow = session.getLength();
var startRow = row; var startRow = row;
var endRow = row; var endRow = row;
while (++row < maxRow) { while (++row < maxRow) {
line = session.getLine(row); line = session.getLine(row);
var level = line.search(re); var level = line.search(re);
if (level == -1) if (level == -1)
continue; continue;
if (line[level] != "#") if (line[level] != "#")
break; break;
endRow = row; endRow = row;
} }
if (endRow > startRow) { if (endRow > startRow) {
var endColumn = session.getLine(endRow).length; var endColumn = session.getLine(endRow).length;
return new Range(startRow, startColumn, endRow, endColumn); return new Range(startRow, startColumn, endRow, endColumn);
} }
}; };
this.getFoldWidget = function(session, foldStyle, row) { this.getFoldWidgetRange = function (session, foldStyle, row) {
var range = this.indentationBlock(session, row);
if (range)
return range;
range = this.commentBlock(session, row);
if (range)
return range;
};
this.getFoldWidget = function (session, foldStyle, row) {
var line = session.getLine(row); var line = session.getLine(row);
var indent = line.search(/\S/); var indent = line.search(/\S/);
var next = session.getLine(row + 1); var next = session.getLine(row + 1);
var prev = session.getLine(row - 1); var prev = session.getLine(row - 1);
var prevIndent = prev.search(/\S/); var prevIndent = prev.search(/\S/);
var nextIndent = next.search(/\S/); var nextIndent = next.search(/\S/);
if (indent == -1) { if (indent == -1) {
session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : ""; session.foldWidgets[row - 1] = prevIndent != -1 && prevIndent < nextIndent ? "start" : "";
return ""; return "";
} }
if (prevIndent == -1) { if (prevIndent == -1) {
@ -156,48 +144,49 @@ oop.inherits(FoldMode, BaseFoldMode);
session.foldWidgets[row + 1] = ""; session.foldWidgets[row + 1] = "";
return "start"; return "start";
} }
} else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") { }
else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") {
if (session.getLine(row - 2).search(/\S/) == -1) { if (session.getLine(row - 2).search(/\S/) == -1) {
session.foldWidgets[row - 1] = "start"; session.foldWidgets[row - 1] = "start";
session.foldWidgets[row + 1] = ""; session.foldWidgets[row + 1] = "";
return ""; return "";
} }
} }
if (prevIndent != -1 && prevIndent < indent)
if (prevIndent!= -1 && prevIndent < indent)
session.foldWidgets[row - 1] = "start"; session.foldWidgets[row - 1] = "start";
else else
session.foldWidgets[row - 1] = ""; session.foldWidgets[row - 1] = "";
if (indent < nextIndent) if (indent < nextIndent)
return "start"; return "start";
else else
return ""; return "";
}; };
}).call(FoldMode.prototype); }).call(FoldMode.prototype);
}); });
define("ace/mode/cirru",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/cirru_highlight_rules","ace/mode/folding/coffee"], function(require, exports, module) { define("ace/mode/cirru",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/cirru_highlight_rules","ace/mode/folding/coffee"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextMode = require("./text").Mode; var TextMode = require("./text").Mode;
var CirruHighlightRules = require("./cirru_highlight_rules").CirruHighlightRules; var CirruHighlightRules = require("./cirru_highlight_rules").CirruHighlightRules;
var CoffeeFoldMode = require("./folding/coffee").FoldMode; var CoffeeFoldMode = require("./folding/coffee").FoldMode;
var Mode = function () {
var Mode = function() {
this.HighlightRules = CirruHighlightRules; this.HighlightRules = CirruHighlightRules;
this.foldingRules = new CoffeeFoldMode(); this.foldingRules = new CoffeeFoldMode();
this.$behaviour = this.$defaultBehaviour; this.$behaviour = this.$defaultBehaviour;
}; };
oop.inherits(Mode, TextMode); oop.inherits(Mode, TextMode);
(function () {
(function() {
this.lineCommentStart = "--"; this.lineCommentStart = "--";
this.$id = "ace/mode/cirru"; this.$id = "ace/mode/cirru";
}).call(Mode.prototype); }).call(Mode.prototype);
exports.Mode = Mode; exports.Mode = Mode;
});
}); (function() {
window.require(["ace/mode/cirru"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

View File

@ -1,15 +1,8 @@
define("ace/mode/clojure_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { define("ace/mode/clojure_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var ClojureHighlightRules = function () {
var builtinFunctions = ('* *1 *2 *3 *agent* *allow-unresolved-vars* *assert* *clojure-version* ' +
var ClojureHighlightRules = function() {
var builtinFunctions = (
'* *1 *2 *3 *agent* *allow-unresolved-vars* *assert* *clojure-version* ' +
'*command-line-args* *compile-files* *compile-path* *e *err* *file* ' + '*command-line-args* *compile-files* *compile-path* *e *err* *file* ' +
'*flush-on-newline* *in* *macro-meta* *math-context* *ns* *out* ' + '*flush-on-newline* *in* *macro-meta* *math-context* *ns* *out* ' +
'*print-dup* *print-length* *print-level* *print-meta* *print-readably* ' + '*print-dup* *print-length* *print-level* *print-meta* *print-readably* ' +
@ -76,172 +69,183 @@ var ClojureHighlightRules = function() {
'var? vary-meta vec vector vector? when when-first when-let when-not ' + 'var? vary-meta vec vector vector? when when-first when-let when-not ' +
'while with-bindings with-bindings* with-in-str with-loading-context ' + 'while with-bindings with-bindings* with-in-str with-loading-context ' +
'with-local-vars with-meta with-open with-out-str with-precision xml-seq ' + 'with-local-vars with-meta with-open with-out-str with-precision xml-seq ' +
'zero? zipmap' 'zero? zipmap');
);
var keywords = ('throw try var ' + var keywords = ('throw try var ' +
'def do fn if let loop monitor-enter monitor-exit new quote recur set!' 'def do fn if let loop monitor-enter monitor-exit new quote recur set!');
);
var buildinConstants = ("true false nil"); var buildinConstants = ("true false nil");
var keywordMapper = this.createKeywordMapper({ var keywordMapper = this.createKeywordMapper({
"keyword": keywords, "keyword": keywords,
"constant.language": buildinConstants, "constant.language": buildinConstants,
"support.function": builtinFunctions "support.function": builtinFunctions
}, "identifier", false, " "); }, "identifier", false, " ");
this.$rules = { this.$rules = {
"start" : [ "start": [
{ {
token : "comment", token: "comment",
regex : ";.*$" regex: ";.*$"
}, { }, {
token : "keyword", //parens token: "keyword", //parens
regex : "[\\(|\\)]" regex: "[\\(|\\)]"
}, { }, {
token : "keyword", //lists token: "keyword", //lists
regex : "[\\'\\(]" regex: "[\\'\\(]"
}, { }, {
token : "keyword", //vectors token: "keyword", //vectors
regex : "[\\[|\\]]" regex: "[\\[|\\]]"
}, { }, {
token : "keyword", //sets and maps token: "string.regexp", //Regular Expressions
regex : "[\\{|\\}|\\#\\{|\\#\\}]" regex: '#"',
next: "regex"
}, { }, {
token : "keyword", // ampersands token: "keyword", //sets and maps
regex : '[\\&]' regex: "[\\{|\\}|\\#\\{|\\#\\}]"
}, { }, {
token : "keyword", // metadata token: "keyword", // ampersands
regex : '[\\#\\^\\{]' regex: '[\\&]'
}, { }, {
token : "keyword", // anonymous fn syntactic sugar token: "keyword", // metadata
regex : '[\\%]' regex: '[\\#\\^\\{]'
}, { }, {
token : "keyword", // deref reader macro token: "keyword", // anonymous fn syntactic sugar
regex : '[@]' regex: '[\\%]'
}, { }, {
token : "constant.numeric", // hex token: "keyword", // deref reader macro
regex : "0[xX][0-9a-fA-F]+\\b" regex: '[@]'
}, { }, {
token : "constant.numeric", // float token: "constant.numeric", // hex
regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" regex: "0[xX][0-9a-fA-F]+\\b"
}, { }, {
token : "constant.language", token: "constant.numeric", // float
regex : '[!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+||=|!=|<=|>=|<>|<|>|!|&&]' regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
}, { }, {
token : keywordMapper, token: "constant.language",
regex : "[a-zA-Z_$][a-zA-Z0-9_$\\-]*\\b" regex: '[!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+||=|!=|<=|>=|<>|<|>|!|&&]'
}, { }, {
token : "string", // single line token: keywordMapper,
regex : '"', regex: "[a-zA-Z_$][a-zA-Z0-9_$\\-]*\\b"
}, {
token: "string", // single line
regex: '"',
next: "string" next: "string"
}, { }, {
token : "constant", // symbol token: "constant", // symbol
regex : /:[^()\[\]{}'"\^%`,;\s]+/ regex: /:[^()\[\]{}'"\^%`,;\s]+/
}, {
token : "string.regexp", //Regular Expressions
regex : '/#"(?:\\.|(?:\\")|[^""\n])*"/g'
} }
], ],
"string" : [ "string": [
{ {
token : "constant.language.escape", token: "constant.language.escape",
regex : "\\\\.|\\\\$" regex: "\\\\.|\\\\$"
}, { }, {
token : "string", token: "string",
regex : '[^"\\\\]+' regex: '"',
next: "start"
}, { }, {
token : "string", defaultToken: "string"
regex : '"', }
next : "start" ],
"regex": [
{
token: "regexp.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
}, {
token: "string.regexp",
regex: '"',
next: "start"
}, {
token: "constant.language.escape",
regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/
}, {
token: "constant.language.delimiter",
regex: /\|/
}, {
token: "constant.language.escape",
regex: /\[\^?/,
next: "regex_character_class"
}, {
defaultToken: "string.regexp"
}
],
"regex_character_class": [
{
token: "regexp.charclass.keyword.operator",
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
}, {
token: "constant.language.escape",
regex: "]",
next: "regex"
}, {
token: "constant.language.escape",
regex: "-"
}, {
defaultToken: "string.regexp.charachterclass"
} }
] ]
}; };
}; };
oop.inherits(ClojureHighlightRules, TextHighlightRules); oop.inherits(ClojureHighlightRules, TextHighlightRules);
exports.ClojureHighlightRules = ClojureHighlightRules; exports.ClojureHighlightRules = ClojureHighlightRules;
}); });
define("ace/mode/matching_parens_outdent",["require","exports","module","ace/range"], function(require, exports, module) { define("ace/mode/matching_parens_outdent",["require","exports","module","ace/range"], function(require, exports, module){"use strict";
"use strict";
var Range = require("../range").Range; var Range = require("../range").Range;
var MatchingParensOutdent = function () { };
var MatchingParensOutdent = function() {}; (function () {
this.checkOutdent = function (line, input) {
(function() { if (!/^\s+$/.test(line))
this.checkOutdent = function(line, input) {
if (! /^\s+$/.test(line))
return false; return false;
return /^\s*\)/.test(input); return /^\s*\)/.test(input);
}; };
this.autoOutdent = function (doc, row) {
this.autoOutdent = function(doc, row) {
var line = doc.getLine(row); var line = doc.getLine(row);
var match = line.match(/^(\s*\))/); var match = line.match(/^(\s*\))/);
if (!match)
if (!match) return 0; return 0;
var column = match[1].length; var column = match[1].length;
var openBracePos = doc.findMatchingBracket({row: row, column: column}); var openBracePos = doc.findMatchingBracket({ row: row, column: column });
if (!openBracePos || openBracePos.row == row)
if (!openBracePos || openBracePos.row == row) return 0; return 0;
var indent = this.$getIndent(doc.getLine(openBracePos.row)); var indent = this.$getIndent(doc.getLine(openBracePos.row));
doc.replace(new Range(row, 0, row, column-1), indent); doc.replace(new Range(row, 0, row, column - 1), indent);
}; };
this.$getIndent = function (line) {
this.$getIndent = function(line) {
var match = line.match(/^(\s+)/); var match = line.match(/^(\s+)/);
if (match) { if (match) {
return match[1]; return match[1];
} }
return ""; return "";
}; };
}).call(MatchingParensOutdent.prototype); }).call(MatchingParensOutdent.prototype);
exports.MatchingParensOutdent = MatchingParensOutdent; exports.MatchingParensOutdent = MatchingParensOutdent;
}); });
define("ace/mode/clojure",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/clojure_highlight_rules","ace/mode/matching_parens_outdent"], function(require, exports, module) { define("ace/mode/clojure",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/clojure_highlight_rules","ace/mode/matching_parens_outdent"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextMode = require("./text").Mode; var TextMode = require("./text").Mode;
var ClojureHighlightRules = require("./clojure_highlight_rules").ClojureHighlightRules; var ClojureHighlightRules = require("./clojure_highlight_rules").ClojureHighlightRules;
var MatchingParensOutdent = require("./matching_parens_outdent").MatchingParensOutdent; var MatchingParensOutdent = require("./matching_parens_outdent").MatchingParensOutdent;
var Mode = function () {
var Mode = function() {
this.HighlightRules = ClojureHighlightRules; this.HighlightRules = ClojureHighlightRules;
this.$outdent = new MatchingParensOutdent(); this.$outdent = new MatchingParensOutdent();
this.$behaviour = this.$defaultBehaviour; this.$behaviour = this.$defaultBehaviour;
}; };
oop.inherits(Mode, TextMode); oop.inherits(Mode, TextMode);
(function () {
(function() {
this.lineCommentStart = ";"; this.lineCommentStart = ";";
this.minorIndentFunctions = ["defn", "defn-", "defmacro", "def", "deftest", "testing"]; this.minorIndentFunctions = ["defn", "defn-", "defmacro", "def", "deftest", "testing"];
this.$toIndent = function (str) {
this.$toIndent = function(str) { return str.split('').map(function (ch) {
return str.split('').map(function(ch) {
if (/\s/.exec(ch)) { if (/\s/.exec(ch)) {
return ch; return ch;
} else { }
else {
return ' '; return ' ';
} }
}).join(''); }).join('');
}; };
this.$calculateIndent = function (line, tab) {
this.$calculateIndent = function(line, tab) {
var baseIndent = this.$getIndent(line); var baseIndent = this.$getIndent(line);
var delta = 0; var delta = 0;
var isParen, ch; var isParen, ch;
@ -250,10 +254,12 @@ oop.inherits(Mode, TextMode);
if (ch === '(') { if (ch === '(') {
delta--; delta--;
isParen = true; isParen = true;
} else if (ch === '(' || ch === '[' || ch === '{') { }
else if (ch === '(' || ch === '[' || ch === '{') {
delta--; delta--;
isParen = false; isParen = false;
} else if (ch === ')' || ch === ']' || ch === '}') { }
else if (ch === ')' || ch === ']' || ch === '}') {
delta++; delta++;
} }
if (delta < 0) { if (delta < 0) {
@ -267,41 +273,50 @@ oop.inherits(Mode, TextMode);
while (true) { while (true) {
ch = line[i]; ch = line[i];
if (ch === ' ' || ch === '\t') { if (ch === ' ' || ch === '\t') {
if(this.minorIndentFunctions.indexOf(fn) !== -1) { if (this.minorIndentFunctions.indexOf(fn) !== -1) {
return this.$toIndent(line.substring(0, iBefore - 1) + tab); return this.$toIndent(line.substring(0, iBefore - 1) + tab);
} else { }
else {
return this.$toIndent(line.substring(0, i + 1)); return this.$toIndent(line.substring(0, i + 1));
} }
} else if (ch === undefined) { }
else if (ch === undefined) {
return this.$toIndent(line.substring(0, iBefore - 1) + tab); return this.$toIndent(line.substring(0, iBefore - 1) + tab);
} }
fn += line[i]; fn += line[i];
i++; i++;
} }
} else if(delta < 0 && !isParen) { }
return this.$toIndent(line.substring(0, i+1)); else if (delta < 0 && !isParen) {
} else if(delta > 0) { return this.$toIndent(line.substring(0, i + 1));
}
else if (delta > 0) {
baseIndent = baseIndent.substring(0, baseIndent.length - tab.length); baseIndent = baseIndent.substring(0, baseIndent.length - tab.length);
return baseIndent; return baseIndent;
} else { }
else {
return baseIndent; return baseIndent;
} }
}; };
this.getNextLineIndent = function (state, line, tab) {
this.getNextLineIndent = function(state, line, tab) {
return this.$calculateIndent(line, tab); return this.$calculateIndent(line, tab);
}; };
this.checkOutdent = function (state, line, input) {
this.checkOutdent = function(state, line, input) {
return this.$outdent.checkOutdent(line, input); return this.$outdent.checkOutdent(line, input);
}; };
this.autoOutdent = function (state, doc, row) {
this.autoOutdent = function(state, doc, row) {
this.$outdent.autoOutdent(doc, row); this.$outdent.autoOutdent(doc, row);
}; };
this.$id = "ace/mode/clojure"; this.$id = "ace/mode/clojure";
this.snippetFileId = "ace/snippets/clojure";
}).call(Mode.prototype); }).call(Mode.prototype);
exports.Mode = Mode; exports.Mode = Mode;
});
}); (function() {
window.require(["ace/mode/clojure"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

View File

@ -1,94 +1,82 @@
define("ace/mode/cobol_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { define("ace/mode/cobol_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var CobolHighlightRules = function () {
var CobolHighlightRules = function() { var keywords = "ACCEPT|MERGE|SUM|ADD||MESSAGE|TABLE|ADVANCING|MODE|TAPE|" +
var keywords = "ACCEPT|MERGE|SUM|ADD||MESSAGE|TABLE|ADVANCING|MODE|TAPE|" + "AFTER|MULTIPLY|TEST|ALL|NEGATIVE|TEXT|ALPHABET|NEXT|THAN|" +
"AFTER|MULTIPLY|TEST|ALL|NEGATIVE|TEXT|ALPHABET|NEXT|THAN|" + "ALSO|NO|THEN|ALTERNATE|NOT|THROUGH|AND|NUMBER|THRU|ANY|OCCURS|" +
"ALSO|NO|THEN|ALTERNATE|NOT|THROUGH|AND|NUMBER|THRU|ANY|OCCURS|" + "TIME|ARE|OF|TO|AREA|OFF|TOP||ASCENDING|OMITTED|TRUE|ASSIGN|ON|TYPE|AT|OPEN|" +
"TIME|ARE|OF|TO|AREA|OFF|TOP||ASCENDING|OMITTED|TRUE|ASSIGN|ON|TYPE|AT|OPEN|" + "UNIT|AUTHOR|OR|UNTIL|BEFORE|OTHER|UP|BLANK|OUTPUT|USE|BLOCK|PAGE|USING|BOTTOM|" +
"UNIT|AUTHOR|OR|UNTIL|BEFORE|OTHER|UP|BLANK|OUTPUT|USE|BLOCK|PAGE|USING|BOTTOM|" + "PERFORM|VALUE|BY|PIC|VALUES|CALL|PICTURE|WHEN|CANCEL|PLUS|WITH|CD|POINTER|WRITE|" +
"PERFORM|VALUE|BY|PIC|VALUES|CALL|PICTURE|WHEN|CANCEL|PLUS|WITH|CD|POINTER|WRITE|" + "CHARACTER|POSITION||ZERO|CLOSE|POSITIVE|ZEROS|COLUMN|PROCEDURE|ZEROES|COMMA|PROGRAM|" +
"CHARACTER|POSITION||ZERO|CLOSE|POSITIVE|ZEROS|COLUMN|PROCEDURE|ZEROES|COMMA|PROGRAM|" + "COMMON|PROGRAM-ID|COMMUNICATION|QUOTE|COMP|RANDOM|COMPUTE|READ|CONTAINS|RECEIVE|CONFIGURATION|" +
"COMMON|PROGRAM-ID|COMMUNICATION|QUOTE|COMP|RANDOM|COMPUTE|READ|CONTAINS|RECEIVE|CONFIGURATION|" + "RECORD|CONTINUE|REDEFINES|CONTROL|REFERENCE|COPY|REMAINDER|COUNT|REPLACE|DATA|REPORT|DATE|RESERVE|" +
"RECORD|CONTINUE|REDEFINES|CONTROL|REFERENCE|COPY|REMAINDER|COUNT|REPLACE|DATA|REPORT|DATE|RESERVE|" + "DAY|RESET|DELETE|RETURN|DESTINATION|REWIND|DISABLE|REWRITE|DISPLAY|RIGHT|DIVIDE|RUN|DOWN|SAME|" +
"DAY|RESET|DELETE|RETURN|DESTINATION|REWIND|DISABLE|REWRITE|DISPLAY|RIGHT|DIVIDE|RUN|DOWN|SAME|" + "ELSE|SEARCH|ENABLE|SECTION|END|SELECT|ENVIRONMENT|SENTENCE|EQUAL|SET|ERROR|SIGN|EXIT|SEQUENTIAL|" +
"ELSE|SEARCH|ENABLE|SECTION|END|SELECT|ENVIRONMENT|SENTENCE|EQUAL|SET|ERROR|SIGN|EXIT|SEQUENTIAL|" + "EXTERNAL|SIZE|FLASE|SORT|FILE|SOURCE|LENGTH|SPACE|LESS|STANDARD|LIMIT|START|LINE|STOP|LOCK|STRING|LOW-VALUE|SUBTRACT";
"EXTERNAL|SIZE|FLASE|SORT|FILE|SOURCE|LENGTH|SPACE|LESS|STANDARD|LIMIT|START|LINE|STOP|LOCK|STRING|LOW-VALUE|SUBTRACT"; var builtinConstants = ("true|false|null");
var builtinFunctions = ("count|min|max|avg|sum|rank|now|coalesce|main");
var builtinConstants = (
"true|false|null"
);
var builtinFunctions = (
"count|min|max|avg|sum|rank|now|coalesce|main"
);
var keywordMapper = this.createKeywordMapper({ var keywordMapper = this.createKeywordMapper({
"support.function": builtinFunctions, "support.function": builtinFunctions,
"keyword": keywords, "keyword": keywords,
"constant.language": builtinConstants "constant.language": builtinConstants
}, "identifier", true); }, "identifier", true);
this.$rules = { this.$rules = {
"start" : [ { "start": [{
token : "comment", token: "comment",
regex : "\\*.*$" regex: "\\*.*$"
}, { }, {
token : "string", // " string token: "string", // " string
regex : '".*?"' regex: '".*?"'
}, { }, {
token : "string", // ' string token: "string", // ' string
regex : "'.*?'" regex: "'.*?'"
}, { }, {
token : "constant.numeric", // float token: "constant.numeric", // float
regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
}, { }, {
token : keywordMapper, token: keywordMapper,
regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
}, { }, {
token : "keyword.operator", token: "keyword.operator",
regex : "\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|=" regex: "\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|="
}, { }, {
token : "paren.lparen", token: "paren.lparen",
regex : "[\\(]" regex: "[\\(]"
}, { }, {
token : "paren.rparen", token: "paren.rparen",
regex : "[\\)]" regex: "[\\)]"
}, { }, {
token : "text", token: "text",
regex : "\\s+" regex: "\\s+"
} ] }]
}; };
}; };
oop.inherits(CobolHighlightRules, TextHighlightRules); oop.inherits(CobolHighlightRules, TextHighlightRules);
exports.CobolHighlightRules = CobolHighlightRules; exports.CobolHighlightRules = CobolHighlightRules;
}); });
define("ace/mode/cobol",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/cobol_highlight_rules"], function(require, exports, module) { define("ace/mode/cobol",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/cobol_highlight_rules"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextMode = require("./text").Mode; var TextMode = require("./text").Mode;
var CobolHighlightRules = require("./cobol_highlight_rules").CobolHighlightRules; var CobolHighlightRules = require("./cobol_highlight_rules").CobolHighlightRules;
var Mode = function () {
var Mode = function() {
this.HighlightRules = CobolHighlightRules; this.HighlightRules = CobolHighlightRules;
this.$behaviour = this.$defaultBehaviour; this.$behaviour = this.$defaultBehaviour;
}; };
oop.inherits(Mode, TextMode); oop.inherits(Mode, TextMode);
(function () {
(function() {
this.lineCommentStart = "*"; this.lineCommentStart = "*";
this.$id = "ace/mode/cobol"; this.$id = "ace/mode/cobol";
}).call(Mode.prototype); }).call(Mode.prototype);
exports.Mode = Mode; exports.Mode = Mode;
}); }); (function() {
window.require(["ace/mode/cobol"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

View File

@ -1,300 +1,253 @@
define("ace/mode/coffee_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { define("ace/mode/coffee_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
"use strict"; var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var oop = require("../lib/oop"); oop.inherits(CoffeeHighlightRules, TextHighlightRules);
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; function CoffeeHighlightRules() {
var identifier = "[$A-Za-z_\\x7f-\\uffff][$\\w\\x7f-\\uffff]*";
oop.inherits(CoffeeHighlightRules, TextHighlightRules); var keywords = ("this|throw|then|try|typeof|super|switch|return|break|by|continue|" +
"catch|class|in|instanceof|is|isnt|if|else|extends|for|own|" +
function CoffeeHighlightRules() { "finally|function|while|when|new|no|not|delete|debugger|do|loop|of|off|" +
var identifier = "[$A-Za-z_\\x7f-\\uffff][$\\w\\x7f-\\uffff]*"; "or|on|unless|until|and|yes|yield|export|import|default");
var langConstant = ("true|false|null|undefined|NaN|Infinity");
var keywords = ( var illegal = ("case|const|function|var|void|with|enum|implements|" +
"this|throw|then|try|typeof|super|switch|return|break|by|continue|" + "interface|let|package|private|protected|public|static");
"catch|class|in|instanceof|is|isnt|if|else|extends|for|own|" + var supportClass = ("Array|Boolean|Date|Function|Number|Object|RegExp|ReferenceError|String|" +
"finally|function|while|when|new|no|not|delete|debugger|do|loop|of|off|" + "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" +
"or|on|unless|until|and|yes" "SyntaxError|TypeError|URIError|" +
); "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
"Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray");
var langConstant = ( var supportFunction = ("Math|JSON|isNaN|isFinite|parseInt|parseFloat|encodeURI|" +
"true|false|null|undefined|NaN|Infinity" "encodeURIComponent|decodeURI|decodeURIComponent|String|");
); var variableLanguage = ("window|arguments|prototype|document");
var keywordMapper = this.createKeywordMapper({
var illegal = ( "keyword": keywords,
"case|const|default|function|var|void|with|enum|export|implements|" + "constant.language": langConstant,
"interface|let|package|private|protected|public|static|yield" "invalid.illegal": illegal,
); "language.support.class": supportClass,
"language.support.function": supportFunction,
var supportClass = ( "variable.language": variableLanguage
"Array|Boolean|Date|Function|Number|Object|RegExp|ReferenceError|String|" + }, "identifier");
"Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + var functionRule = {
"SyntaxError|TypeError|URIError|" + token: ["paren.lparen", "variable.parameter", "paren.rparen", "text", "storage.type"],
"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + regex: /(?:(\()((?:"[^")]*?"|'[^')]*?'|\/[^\/)]*?\/|[^()"'\/])*?)(\))(\s*))?([\-=]>)/.source
"Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray" };
); var stringEscape = /\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)/;
this.$rules = {
var supportFunction = ( start: [
"Math|JSON|isNaN|isFinite|parseInt|parseFloat|encodeURI|" + {
"encodeURIComponent|decodeURI|decodeURIComponent|String|" token: "constant.numeric",
); regex: "(?:0x[\\da-fA-F]+|(?:\\d+(?:\\.\\d+)?|\\.\\d+)(?:[eE][+-]?\\d+)?)"
}, {
var variableLanguage = ( stateName: "qdoc",
"window|arguments|prototype|document" token: "string", regex: "'''", next: [
); { token: "string", regex: "'''", next: "start" },
{ token: "constant.language.escape", regex: stringEscape },
var keywordMapper = this.createKeywordMapper({ { defaultToken: "string" }
"keyword": keywords, ]
"constant.language": langConstant, }, {
"invalid.illegal": illegal, stateName: "qqdoc",
"language.support.class": supportClass, token: "string",
"language.support.function": supportFunction, regex: '"""',
"variable.language": variableLanguage next: [
}, "identifier"); { token: "string", regex: '"""', next: "start" },
{ token: "paren.string", regex: '#{', push: "start" },
var functionRule = { { token: "constant.language.escape", regex: stringEscape },
token: ["paren.lparen", "variable.parameter", "paren.rparen", "text", "storage.type"], { defaultToken: "string" }
regex: /(?:(\()((?:"[^")]*?"|'[^')]*?'|\/[^\/)]*?\/|[^()"'\/])*?)(\))(\s*))?([\-=]>)/.source ]
}; }, {
stateName: "qstring",
var stringEscape = /\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)/; token: "string", regex: "'", next: [
{ token: "string", regex: "'", next: "start" },
this.$rules = { { token: "constant.language.escape", regex: stringEscape },
start : [ { defaultToken: "string" }
{ ]
token : "constant.numeric", }, {
regex : "(?:0x[\\da-fA-F]+|(?:\\d+(?:\\.\\d+)?|\\.\\d+)(?:[eE][+-]?\\d+)?)" stateName: "qqstring",
}, { token: "string.start", regex: '"', next: [
stateName: "qdoc", { token: "string.end", regex: '"', next: "start" },
token : "string", regex : "'''", next : [ { token: "paren.string", regex: '#{', push: "start" },
{token : "string", regex : "'''", next : "start"}, { token: "constant.language.escape", regex: stringEscape },
{token : "constant.language.escape", regex : stringEscape}, { defaultToken: "string" }
{defaultToken: "string"} ]
] }, {
}, { stateName: "js",
stateName: "qqdoc", token: "string", regex: "`", next: [
token : "string", { token: "string", regex: "`", next: "start" },
regex : '"""', { token: "constant.language.escape", regex: stringEscape },
next : [ { defaultToken: "string" }
{token : "string", regex : '"""', next : "start"}, ]
{token : "paren.string", regex : '#{', push : "start"}, }, {
{token : "constant.language.escape", regex : stringEscape}, regex: "[{}]", onMatch: function (val, state, stack) {
{defaultToken: "string"} this.next = "";
] if (val == "{" && stack.length) {
}, { stack.unshift("start", state);
stateName: "qstring",
token : "string", regex : "'", next : [
{token : "string", regex : "'", next : "start"},
{token : "constant.language.escape", regex : stringEscape},
{defaultToken: "string"}
]
}, {
stateName: "qqstring",
token : "string.start", regex : '"', next : [
{token : "string.end", regex : '"', next : "start"},
{token : "paren.string", regex : '#{', push : "start"},
{token : "constant.language.escape", regex : stringEscape},
{defaultToken: "string"}
]
}, {
stateName: "js",
token : "string", regex : "`", next : [
{token : "string", regex : "`", next : "start"},
{token : "constant.language.escape", regex : stringEscape},
{defaultToken: "string"}
]
}, {
regex: "[{}]", onMatch: function(val, state, stack) {
this.next = "";
if (val == "{" && stack.length) {
stack.unshift("start", state);
return "paren";
}
if (val == "}" && stack.length) {
stack.shift();
this.next = stack.shift() || "";
if (this.next.indexOf("string") != -1)
return "paren.string";
}
return "paren"; return "paren";
} }
}, { if (val == "}" && stack.length) {
token : "string.regex", stack.shift();
regex : "///", this.next = stack.shift() || "";
next : "heregex" if (this.next.indexOf("string") != -1)
}, { return "paren.string";
token : "string.regex", }
regex : /(?:\/(?![\s=])[^[\/\n\\]*(?:(?:\\[\s\S]|\[[^\]\n\\]*(?:\\[\s\S][^\]\n\\]*)*])[^[\/\n\\]*)*\/)(?:[imgy]{0,4})(?!\w)/ return "paren";
}, { }
token : "comment",
regex : "###(?!#)",
next : "comment"
}, {
token : "comment",
regex : "#.*"
}, {
token : ["punctuation.operator", "text", "identifier"],
regex : "(\\.)(\\s*)(" + illegal + ")"
}, {
token : "punctuation.operator",
regex : "\\.{1,3}"
}, {
token : ["keyword", "text", "language.support.class",
"text", "keyword", "text", "language.support.class"],
regex : "(class)(\\s+)(" + identifier + ")(?:(\\s+)(extends)(\\s+)(" + identifier + "))?"
}, {
token : ["entity.name.function", "text", "keyword.operator", "text"].concat(functionRule.token),
regex : "(" + identifier + ")(\\s*)([=:])(\\s*)" + functionRule.regex
},
functionRule,
{
token : "variable",
regex : "@(?:" + identifier + ")?"
}, {
token: keywordMapper,
regex : identifier
}, {
token : "punctuation.operator",
regex : "\\,|\\."
}, {
token : "storage.type",
regex : "[\\-=]>"
}, {
token : "keyword.operator",
regex : "(?:[-+*/%<>&|^!?=]=|>>>=?|\\-\\-|\\+\\+|::|&&=|\\|\\|=|<<=|>>=|\\?\\.|\\.{2,3}|[!*+-=><])"
}, {
token : "paren.lparen",
regex : "[({[]"
}, {
token : "paren.rparen",
regex : "[\\]})]"
}, {
token : "text",
regex : "\\s+"
}],
heregex : [{
token : "string.regex",
regex : '.*?///[imgy]{0,4}',
next : "start"
}, { }, {
token : "comment.regex", token: "string.regex",
regex : "\\s+(?:#.*)?" regex: "///",
next: "heregex"
}, { }, {
token : "string.regex", token: "string.regex",
regex : "\\S+" regex: /(?:\/(?![\s=])[^[\/\n\\]*(?:(?:\\[\s\S]|\[[^\]\n\\]*(?:\\[\s\S][^\]\n\\]*)*])[^[\/\n\\]*)*\/)(?:[imgy]{0,4})(?!\w)/
}, {
token: "comment",
regex: "###(?!#)",
next: "comment"
}, {
token: "comment",
regex: "#.*"
}, {
token: ["punctuation.operator", "text", "identifier"],
regex: "(\\.)(\\s*)(" + illegal + ")"
}, {
token: "punctuation.operator",
regex: "\\.{1,3}"
}, {
token: ["keyword", "text", "language.support.class",
"text", "keyword", "text", "language.support.class"],
regex: "(class)(\\s+)(" + identifier + ")(?:(\\s+)(extends)(\\s+)(" + identifier + "))?"
}, {
token: ["entity.name.function", "text", "keyword.operator", "text"].concat(functionRule.token),
regex: "(" + identifier + ")(\\s*)([=:])(\\s*)" + functionRule.regex
},
functionRule,
{
token: "variable",
regex: "@(?:" + identifier + ")?"
}, {
token: keywordMapper,
regex: identifier
}, {
token: "punctuation.operator",
regex: "\\,|\\."
}, {
token: "storage.type",
regex: "[\\-=]>"
}, {
token: "keyword.operator",
regex: "(?:[-+*/%<>&|^!?=]=|>>>=?|\\-\\-|\\+\\+|::|&&=|\\|\\|=|<<=|>>=|\\?\\.|\\.{2,3}|[!*+-=><])"
}, {
token: "paren.lparen",
regex: "[({[]"
}, {
token: "paren.rparen",
regex: "[\\]})]"
}, {
token: "text",
regex: "\\s+"
}
],
heregex: [{
token: "string.regex",
regex: '.*?///[imgy]{0,4}',
next: "start"
}, {
token: "comment.regex",
regex: "\\s+(?:#.*)?"
}, {
token: "string.regex",
regex: "\\S+"
}], }],
comment: [{
comment : [{ token: "comment",
token : "comment", regex: '###',
regex : '###', next: "start"
next : "start"
}, { }, {
defaultToken : "comment" defaultToken: "comment"
}] }]
}; };
this.normalizeRules(); this.normalizeRules();
} }
exports.CoffeeHighlightRules = CoffeeHighlightRules;
exports.CoffeeHighlightRules = CoffeeHighlightRules;
}); });
define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module){"use strict";
"use strict";
var Range = require("../range").Range; var Range = require("../range").Range;
var MatchingBraceOutdent = function () { };
var MatchingBraceOutdent = function() {}; (function () {
this.checkOutdent = function (line, input) {
(function() { if (!/^\s+$/.test(line))
this.checkOutdent = function(line, input) {
if (! /^\s+$/.test(line))
return false; return false;
return /^\s*\}/.test(input); return /^\s*\}/.test(input);
}; };
this.autoOutdent = function (doc, row) {
this.autoOutdent = function(doc, row) {
var line = doc.getLine(row); var line = doc.getLine(row);
var match = line.match(/^(\s*\})/); var match = line.match(/^(\s*\})/);
if (!match)
if (!match) return 0; return 0;
var column = match[1].length; var column = match[1].length;
var openBracePos = doc.findMatchingBracket({row: row, column: column}); var openBracePos = doc.findMatchingBracket({ row: row, column: column });
if (!openBracePos || openBracePos.row == row)
if (!openBracePos || openBracePos.row == row) return 0; return 0;
var indent = this.$getIndent(doc.getLine(openBracePos.row)); var indent = this.$getIndent(doc.getLine(openBracePos.row));
doc.replace(new Range(row, 0, row, column-1), indent); doc.replace(new Range(row, 0, row, column - 1), indent);
}; };
this.$getIndent = function (line) {
this.$getIndent = function(line) {
return line.match(/^\s*/)[0]; return line.match(/^\s*/)[0];
}; };
}).call(MatchingBraceOutdent.prototype); }).call(MatchingBraceOutdent.prototype);
exports.MatchingBraceOutdent = MatchingBraceOutdent; exports.MatchingBraceOutdent = MatchingBraceOutdent;
}); });
define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module) { define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../../lib/oop"); var oop = require("../../lib/oop");
var BaseFoldMode = require("./fold_mode").FoldMode; var BaseFoldMode = require("./fold_mode").FoldMode;
var Range = require("../../range").Range; var Range = require("../../range").Range;
var FoldMode = exports.FoldMode = function () { };
var FoldMode = exports.FoldMode = function() {};
oop.inherits(FoldMode, BaseFoldMode); oop.inherits(FoldMode, BaseFoldMode);
(function () {
(function() { this.commentBlock = function (session, row) {
this.getFoldWidgetRange = function(session, foldStyle, row) {
var range = this.indentationBlock(session, row);
if (range)
return range;
var re = /\S/; var re = /\S/;
var line = session.getLine(row); var line = session.getLine(row);
var startLevel = line.search(re); var startLevel = line.search(re);
if (startLevel == -1 || line[startLevel] != "#") if (startLevel == -1 || line[startLevel] != "#")
return; return;
var startColumn = line.length; var startColumn = line.length;
var maxRow = session.getLength(); var maxRow = session.getLength();
var startRow = row; var startRow = row;
var endRow = row; var endRow = row;
while (++row < maxRow) { while (++row < maxRow) {
line = session.getLine(row); line = session.getLine(row);
var level = line.search(re); var level = line.search(re);
if (level == -1) if (level == -1)
continue; continue;
if (line[level] != "#") if (line[level] != "#")
break; break;
endRow = row; endRow = row;
} }
if (endRow > startRow) { if (endRow > startRow) {
var endColumn = session.getLine(endRow).length; var endColumn = session.getLine(endRow).length;
return new Range(startRow, startColumn, endRow, endColumn); return new Range(startRow, startColumn, endRow, endColumn);
} }
}; };
this.getFoldWidget = function(session, foldStyle, row) { this.getFoldWidgetRange = function (session, foldStyle, row) {
var range = this.indentationBlock(session, row);
if (range)
return range;
range = this.commentBlock(session, row);
if (range)
return range;
};
this.getFoldWidget = function (session, foldStyle, row) {
var line = session.getLine(row); var line = session.getLine(row);
var indent = line.search(/\S/); var indent = line.search(/\S/);
var next = session.getLine(row + 1); var next = session.getLine(row + 1);
var prev = session.getLine(row - 1); var prev = session.getLine(row - 1);
var prevIndent = prev.search(/\S/); var prevIndent = prev.search(/\S/);
var nextIndent = next.search(/\S/); var nextIndent = next.search(/\S/);
if (indent == -1) { if (indent == -1) {
session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : ""; session.foldWidgets[row - 1] = prevIndent != -1 && prevIndent < nextIndent ? "start" : "";
return ""; return "";
} }
if (prevIndent == -1) { if (prevIndent == -1) {
@ -303,32 +256,28 @@ oop.inherits(FoldMode, BaseFoldMode);
session.foldWidgets[row + 1] = ""; session.foldWidgets[row + 1] = "";
return "start"; return "start";
} }
} else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") { }
else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") {
if (session.getLine(row - 2).search(/\S/) == -1) { if (session.getLine(row - 2).search(/\S/) == -1) {
session.foldWidgets[row - 1] = "start"; session.foldWidgets[row - 1] = "start";
session.foldWidgets[row + 1] = ""; session.foldWidgets[row + 1] = "";
return ""; return "";
} }
} }
if (prevIndent != -1 && prevIndent < indent)
if (prevIndent!= -1 && prevIndent < indent)
session.foldWidgets[row - 1] = "start"; session.foldWidgets[row - 1] = "start";
else else
session.foldWidgets[row - 1] = ""; session.foldWidgets[row - 1] = "";
if (indent < nextIndent) if (indent < nextIndent)
return "start"; return "start";
else else
return ""; return "";
}; };
}).call(FoldMode.prototype); }).call(FoldMode.prototype);
}); });
define("ace/mode/coffee",["require","exports","module","ace/mode/coffee_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/folding/coffee","ace/range","ace/mode/text","ace/worker/worker_client","ace/lib/oop"], function(require, exports, module) { define("ace/mode/coffee",["require","exports","module","ace/mode/coffee_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/folding/coffee","ace/range","ace/mode/text","ace/worker/worker_client","ace/lib/oop"], function(require, exports, module){"use strict";
"use strict";
var Rules = require("./coffee_highlight_rules").CoffeeHighlightRules; var Rules = require("./coffee_highlight_rules").CoffeeHighlightRules;
var Outdent = require("./matching_brace_outdent").MatchingBraceOutdent; var Outdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var FoldMode = require("./folding/coffee").FoldMode; var FoldMode = require("./folding/coffee").FoldMode;
@ -336,57 +285,51 @@ var Range = require("../range").Range;
var TextMode = require("./text").Mode; var TextMode = require("./text").Mode;
var WorkerClient = require("../worker/worker_client").WorkerClient; var WorkerClient = require("../worker/worker_client").WorkerClient;
var oop = require("../lib/oop"); var oop = require("../lib/oop");
function Mode() { function Mode() {
this.HighlightRules = Rules; this.HighlightRules = Rules;
this.$outdent = new Outdent(); this.$outdent = new Outdent();
this.foldingRules = new FoldMode(); this.foldingRules = new FoldMode();
} }
oop.inherits(Mode, TextMode); oop.inherits(Mode, TextMode);
(function () {
(function() {
var indenter = /(?:[({[=:]|[-=]>|\b(?:else|try|(?:swi|ca)tch(?:\s+[$A-Za-z_\x7f-\uffff][$\w\x7f-\uffff]*)?|finally))\s*$|^\s*(else\b\s*)?(?:if|for|while|loop)\b(?!.*\bthen\b)/; var indenter = /(?:[({[=:]|[-=]>|\b(?:else|try|(?:swi|ca)tch(?:\s+[$A-Za-z_\x7f-\uffff][$\w\x7f-\uffff]*)?|finally))\s*$|^\s*(else\b\s*)?(?:if|for|while|loop)\b(?!.*\bthen\b)/;
this.lineCommentStart = "#"; this.lineCommentStart = "#";
this.blockComment = {start: "###", end: "###"}; this.blockComment = { start: "###", end: "###" };
this.getNextLineIndent = function (state, line, tab) {
this.getNextLineIndent = function(state, line, tab) {
var indent = this.$getIndent(line); var indent = this.$getIndent(line);
var tokens = this.getTokenizer().getLineTokens(line, state).tokens; var tokens = this.getTokenizer().getLineTokens(line, state).tokens;
if (!(tokens.length && tokens[tokens.length - 1].type === 'comment') && if (!(tokens.length && tokens[tokens.length - 1].type === 'comment') &&
state === 'start' && indenter.test(line)) state === 'start' && indenter.test(line))
indent += tab; indent += tab;
return indent; return indent;
}; };
this.checkOutdent = function (state, line, input) {
this.checkOutdent = function(state, line, input) {
return this.$outdent.checkOutdent(line, input); return this.$outdent.checkOutdent(line, input);
}; };
this.autoOutdent = function (state, doc, row) {
this.autoOutdent = function(state, doc, row) {
this.$outdent.autoOutdent(doc, row); this.$outdent.autoOutdent(doc, row);
}; };
this.createWorker = function (session) {
this.createWorker = function(session) {
var worker = new WorkerClient(["ace"], "ace/mode/coffee_worker", "Worker"); var worker = new WorkerClient(["ace"], "ace/mode/coffee_worker", "Worker");
worker.attachToDocument(session.getDocument()); worker.attachToDocument(session.getDocument());
worker.on("annotate", function (e) {
worker.on("annotate", function(e) {
session.setAnnotations(e.data); session.setAnnotations(e.data);
}); });
worker.on("terminate", function () {
worker.on("terminate", function() {
session.clearAnnotations(); session.clearAnnotations();
}); });
return worker; return worker;
}; };
this.$id = "ace/mode/coffee"; this.$id = "ace/mode/coffee";
this.snippetFileId = "ace/snippets/coffee";
}).call(Mode.prototype); }).call(Mode.prototype);
exports.Mode = Mode; exports.Mode = Mode;
}); }); (function() {
window.require(["ace/mode/coffee"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,586 @@
define("ace/mode/crystal_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var CrystalHighlightRules = function () {
var builtinFunctions = ("puts|initialize|previous_def|typeof|as|pointerof|sizeof|instance_sizeof");
var keywords = ("if|end|else|elsif|unless|case|when|break|while|next|until|def|return|class|new|getter|setter|property|lib"
+ "|fun|do|struct|private|protected|public|module|super|abstract|include|extend|begin|enum|raise|yield|with"
+ "|alias|rescue|ensure|macro|uninitialized|union|type|require");
var buildinConstants = ("true|TRUE|false|FALSE|nil|NIL|__LINE__|__END_LINE__|__FILE__|__DIR__");
var builtinVariables = ("$DEBUG|$defout|$FILENAME|$LOAD_PATH|$SAFE|$stdin|$stdout|$stderr|$VERBOSE|" +
"root_url|flash|session|cookies|params|request|response|logger|self");
var keywordMapper = this.$keywords = this.createKeywordMapper({
"keyword": keywords,
"constant.language": buildinConstants,
"variable.language": builtinVariables,
"support.function": builtinFunctions
}, "identifier");
var hexNumber = "(?:0[xX][\\dA-Fa-f]+)";
var decNumber = "(?:[0-9][\\d_]*)";
var octNumber = "(?:0o[0-7][0-7]*)";
var binNumber = "(?:0[bB][01]+)";
var intNumber = "(?:[+-]?)(?:" + hexNumber + "|" + decNumber + "|" + octNumber + "|" + binNumber + ")(?:_?[iIuU](?:8|16|32|64))?\\b";
var escapeExpression = /\\(?:[nsrtvfbae'"\\]|[0-7]{3}|x[\da-fA-F]{2}|u[\da-fA-F]{4}|u{[\da-fA-F]{1,6}})/;
var extEscapeExspresssion = /\\(?:[nsrtvfbae'"\\]|[0-7]{3}|x[\da-fA-F]{2}|u[\da-fA-F]{4}|u{[\da-fA-F]{1,6}}|u{(:?[\da-fA-F]{2}\s)*[\da-fA-F]{2}})/;
this.$rules = {
"start": [
{
token: "comment",
regex: "#.*$"
}, {
token: "string.regexp",
regex: "[/]",
push: [{
token: "constant.language.escape",
regex: extEscapeExspresssion
}, {
token: "string.regexp",
regex: "[/][imx]*(?=[).,;\\s]|$)",
next: "pop"
}, {
defaultToken: "string.regexp"
}]
},
[{
regex: "[{}]", onMatch: function (val, state, stack) {
this.next = val == "{" ? this.nextState : "";
if (val == "{" && stack.length) {
stack.unshift("start", state);
return "paren.lparen";
}
if (val == "}" && stack.length) {
stack.shift();
this.next = stack.shift();
if (this.next.indexOf("string") != -1)
return "paren.end";
}
return val == "{" ? "paren.lparen" : "paren.rparen";
},
nextState: "start"
}, {
token: "string.start",
regex: /"/,
push: [{
token: "constant.language.escape",
regex: extEscapeExspresssion
}, {
token: "string",
regex: /\\#{/
}, {
token: "paren.start",
regex: /#{/,
push: "start"
}, {
token: "string.end",
regex: /"/,
next: "pop"
}, {
defaultToken: "string"
}]
}, {
token: "string.start",
regex: /`/,
push: [{
token: "constant.language.escape",
regex: extEscapeExspresssion
}, {
token: "string",
regex: /\\#{/
}, {
token: "paren.start",
regex: /#{/,
push: "start"
}, {
token: "string.end",
regex: /`/,
next: "pop"
}, {
defaultToken: "string"
}]
}, {
stateName: "rpstring",
token: "string.start",
regex: /%[Qx]?\(/,
push: [{
token: "constant.language.escape",
regex: extEscapeExspresssion
}, {
token: "string.start",
regex: /\(/,
push: "rpstring"
}, {
token: "string.end",
regex: /\)/,
next: "pop"
}, {
token: "paren.start",
regex: /#{/,
push: "start"
}, {
defaultToken: "string"
}]
}, {
stateName: "spstring",
token: "string.start",
regex: /%[Qx]?\[/,
push: [{
token: "constant.language.escape",
regex: extEscapeExspresssion
}, {
token: "string.start",
regex: /\[/,
push: "spstring"
}, {
token: "string.end",
regex: /]/,
next: "pop"
}, {
token: "paren.start",
regex: /#{/,
push: "start"
}, {
defaultToken: "string"
}]
}, {
stateName: "fpstring",
token: "string.start",
regex: /%[Qx]?{/,
push: [{
token: "constant.language.escape",
regex: extEscapeExspresssion
}, {
token: "string.start",
regex: /{/,
push: "fpstring"
}, {
token: "string.end",
regex: /}/,
next: "pop"
}, {
token: "paren.start",
regex: /#{/,
push: "start"
}, {
defaultToken: "string"
}]
}, {
stateName: "tpstring",
token: "string.start",
regex: /%[Qx]?</,
push: [{
token: "constant.language.escape",
regex: extEscapeExspresssion
}, {
token: "string.start",
regex: /</,
push: "tpstring"
}, {
token: "string.end",
regex: />/,
next: "pop"
}, {
token: "paren.start",
regex: /#{/,
push: "start"
}, {
defaultToken: "string"
}]
}, {
stateName: "ppstring",
token: "string.start",
regex: /%[Qx]?\|/,
push: [{
token: "constant.language.escape",
regex: extEscapeExspresssion
}, {
token: "string.end",
regex: /\|/,
next: "pop"
}, {
token: "paren.start",
regex: /#{/,
push: "start"
}, {
defaultToken: "string"
}]
}, {
stateName: "rpqstring",
token: "string.start",
regex: /%[qwir]\(/,
push: [{
token: "string.start",
regex: /\(/,
push: "rpqstring"
}, {
token: "string.end",
regex: /\)/,
next: "pop"
}, {
defaultToken: "string"
}]
}, {
stateName: "spqstring",
token: "string.start",
regex: /%[qwir]\[/,
push: [{
token: "string.start",
regex: /\[/,
push: "spqstring"
}, {
token: "string.end",
regex: /]/,
next: "pop"
}, {
defaultToken: "string"
}]
}, {
stateName: "fpqstring",
token: "string.start",
regex: /%[qwir]{/,
push: [{
token: "string.start",
regex: /{/,
push: "fpqstring"
}, {
token: "string.end",
regex: /}/,
next: "pop"
}, {
defaultToken: "string"
}]
}, {
stateName: "tpqstring",
token: "string.start",
regex: /%[qwir]</,
push: [{
token: "string.start",
regex: /</,
push: "tpqstring"
}, {
token: "string.end",
regex: />/,
next: "pop"
}, {
defaultToken: "string"
}]
}, {
stateName: "ppqstring",
token: "string.start",
regex: /%[qwir]\|/,
push: [{
token: "string.end",
regex: /\|/,
next: "pop"
}, {
defaultToken: "string"
}]
}, {
token: "string.start",
regex: /'/,
push: [{
token: "constant.language.escape",
regex: escapeExpression
}, {
token: "string.end",
regex: /'|$/,
next: "pop"
}, {
defaultToken: "string"
}]
}], {
token: "text", // namespaces aren't symbols
regex: "::"
}, {
token: "variable.instance", // instance variable
regex: "@{1,2}[a-zA-Z_\\d]+"
}, {
token: "variable.fresh", // fresh variable
regex: "%[a-zA-Z_\\d]+"
}, {
token: "support.class", // class name
regex: "[A-Z][a-zA-Z_\\d]+"
}, {
token: "constant.other.symbol", // symbol
regex: "[:](?:(?:===|<=>|\\[]\\?|\\[]=|\\[]|>>|\\*\\*|<<|==|!=|>=|<=|!~|=~|<|\\+|-|\\*|\\/|%|&|\\||\\^|>|!|~)|(?:(?:[A-Za-z_]|[@$](?=[a-zA-Z0-9_]))[a-zA-Z0-9_]*[!=?]?))"
}, {
token: "constant.numeric", // float
regex: "[+-]?\\d(?:\\d|_(?=\\d))*(?:(?:\\.\\d(?:\\d|_(?=\\d))*)?(?:[eE][+-]?\\d+)?)?(?:_?[fF](?:32|64))?\\b"
}, {
token: "constant.numeric",
regex: intNumber
}, {
token: "constant.other.symbol",
regex: ':"',
push: [{
token: "constant.language.escape",
regex: extEscapeExspresssion
}, {
token: "constant.other.symbol",
regex: '"',
next: "pop"
}, {
defaultToken: "constant.other.symbol"
}]
}, {
token: "constant.language.boolean",
regex: "(?:true|false)\\b"
}, {
token: "support.function",
regex: "(?:is_a\\?|nil\\?|responds_to\\?|as\\?)"
}, {
token: keywordMapper,
regex: "[a-zA-Z_$][a-zA-Z0-9_$!?]*\\b"
}, {
token: "variable.system",
regex: "\\$\\!|\\$\\?"
}, {
token: "punctuation.separator.key-value",
regex: "=>"
}, {
stateName: "heredoc",
onMatch: function (value, currentState, stack) {
var next = "heredoc";
var tokens = value.split(this.splitRegex);
stack.push(next, tokens[3]);
return [
{ type: "constant", value: tokens[1] },
{ type: "string", value: tokens[2] },
{ type: "support.class", value: tokens[3] },
{ type: "string", value: tokens[4] }
];
},
regex: "(<<-)([']?)([\\w]+)([']?)",
rules: {
heredoc: [{
token: "string",
regex: "^ +"
}, {
onMatch: function (value, currentState, stack) {
if (value === stack[1]) {
stack.shift();
stack.shift();
this.next = stack[0] || "start";
return "support.class";
}
this.next = "";
return "string";
},
regex: ".*$",
next: "start"
}]
}
}, {
regex: "$",
token: "empty",
next: function (currentState, stack) {
if (stack[0] === "heredoc")
return stack[0];
return currentState;
}
}, {
token: "punctuation.operator",
regex: /[.]\s*(?![.])/,
push: [{
token: "punctuation.operator",
regex: /[.]\s*(?![.])/
}, {
token: "support.function",
regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
}, {
regex: "",
token: "empty",
next: "pop"
}]
}, {
token: "keyword.operator",
regex: "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|\\?|\\:|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\^|\\|"
}, {
token: "punctuation.operator",
regex: /[?:,;.]/
}, {
token: "paren.lparen",
regex: "[[({]"
}, {
token: "paren.rparen",
regex: "[\\])}]"
}, {
token: "text",
regex: "\\s+"
}
]
};
this.normalizeRules();
};
oop.inherits(CrystalHighlightRules, TextHighlightRules);
exports.CrystalHighlightRules = CrystalHighlightRules;
});
define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module){"use strict";
var Range = require("../range").Range;
var MatchingBraceOutdent = function () { };
(function () {
this.checkOutdent = function (line, input) {
if (!/^\s+$/.test(line))
return false;
return /^\s*\}/.test(input);
};
this.autoOutdent = function (doc, row) {
var line = doc.getLine(row);
var match = line.match(/^(\s*\})/);
if (!match)
return 0;
var column = match[1].length;
var openBracePos = doc.findMatchingBracket({ row: row, column: column });
if (!openBracePos || openBracePos.row == row)
return 0;
var indent = this.$getIndent(doc.getLine(openBracePos.row));
doc.replace(new Range(row, 0, row, column - 1), indent);
};
this.$getIndent = function (line) {
return line.match(/^\s*/)[0];
};
}).call(MatchingBraceOutdent.prototype);
exports.MatchingBraceOutdent = MatchingBraceOutdent;
});
define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var BaseFoldMode = require("./fold_mode").FoldMode;
var Range = require("../../range").Range;
var FoldMode = exports.FoldMode = function () { };
oop.inherits(FoldMode, BaseFoldMode);
(function () {
this.commentBlock = function (session, row) {
var re = /\S/;
var line = session.getLine(row);
var startLevel = line.search(re);
if (startLevel == -1 || line[startLevel] != "#")
return;
var startColumn = line.length;
var maxRow = session.getLength();
var startRow = row;
var endRow = row;
while (++row < maxRow) {
line = session.getLine(row);
var level = line.search(re);
if (level == -1)
continue;
if (line[level] != "#")
break;
endRow = row;
}
if (endRow > startRow) {
var endColumn = session.getLine(endRow).length;
return new Range(startRow, startColumn, endRow, endColumn);
}
};
this.getFoldWidgetRange = function (session, foldStyle, row) {
var range = this.indentationBlock(session, row);
if (range)
return range;
range = this.commentBlock(session, row);
if (range)
return range;
};
this.getFoldWidget = function (session, foldStyle, row) {
var line = session.getLine(row);
var indent = line.search(/\S/);
var next = session.getLine(row + 1);
var prev = session.getLine(row - 1);
var prevIndent = prev.search(/\S/);
var nextIndent = next.search(/\S/);
if (indent == -1) {
session.foldWidgets[row - 1] = prevIndent != -1 && prevIndent < nextIndent ? "start" : "";
return "";
}
if (prevIndent == -1) {
if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") {
session.foldWidgets[row - 1] = "";
session.foldWidgets[row + 1] = "";
return "start";
}
}
else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") {
if (session.getLine(row - 2).search(/\S/) == -1) {
session.foldWidgets[row - 1] = "start";
session.foldWidgets[row + 1] = "";
return "";
}
}
if (prevIndent != -1 && prevIndent < indent)
session.foldWidgets[row - 1] = "start";
else
session.foldWidgets[row - 1] = "";
if (indent < nextIndent)
return "start";
else
return "";
};
}).call(FoldMode.prototype);
});
define("ace/mode/crystal",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/crystal_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/folding/coffee"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var CrystalHighlightRules = require("./crystal_highlight_rules").CrystalHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var Range = require("../range").Range;
var FoldMode = require("./folding/coffee").FoldMode;
var Mode = function () {
this.HighlightRules = CrystalHighlightRules;
this.$outdent = new MatchingBraceOutdent();
this.$behaviour = this.$defaultBehaviour;
this.foldingRules = new FoldMode();
};
oop.inherits(Mode, TextMode);
(function () {
this.lineCommentStart = "#";
this.getNextLineIndent = function (state, line, tab) {
var indent = this.$getIndent(line);
var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
var tokens = tokenizedLine.tokens;
if (tokens.length && tokens[tokens.length - 1].type == "comment") {
return indent;
}
if (state == "start") {
var match = line.match(/^.*[\{\(\[]\s*$/);
var startingClassOrMethod = line.match(/^\s*(class|def|module)\s.*$/);
var startingDoBlock = line.match(/.*do(\s*|\s+\|.*\|\s*)$/);
var startingConditional = line.match(/^\s*(if|else|when)\s*/);
if (match || startingClassOrMethod || startingDoBlock || startingConditional) {
indent += tab;
}
}
return indent;
};
this.checkOutdent = function (state, line, input) {
return /^\s+(end|else)$/.test(line + input) || this.$outdent.checkOutdent(line, input);
};
this.autoOutdent = function (state, session, row) {
var line = session.getLine(row);
if (/}/.test(line))
return this.$outdent.autoOutdent(session, row);
var indent = this.$getIndent(line);
var prevLine = session.getLine(row - 1);
var prevIndent = this.$getIndent(prevLine);
var tab = session.getTabString();
if (prevIndent.length <= indent.length) {
if (indent.slice(-tab.length) == tab)
session.remove(new Range(row, indent.length - tab.length, row, indent.length));
}
};
this.$id = "ace/mode/crystal";
}).call(Mode.prototype);
exports.Mode = Mode;
}); (function() {
window.require(["ace/mode/crystal"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

View File

@ -1,272 +1,221 @@
define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var DocCommentHighlightRules = function () {
var DocCommentHighlightRules = function() {
this.$rules = { this.$rules = {
"start" : [ { "start": [
token : "comment.doc.tag", {
regex : "@[\\w\\d_]+" // TODO: fix email addresses token: "comment.doc.tag",
}, regex: "@\\w+(?=\\s|$)"
DocCommentHighlightRules.getTagRule(), }, DocCommentHighlightRules.getTagRule(), {
{ defaultToken: "comment.doc",
defaultToken : "comment.doc", caseInsensitive: true
caseInsensitive: true }
}] ]
}; };
}; };
oop.inherits(DocCommentHighlightRules, TextHighlightRules); oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getTagRule = function (start) {
DocCommentHighlightRules.getTagRule = function(start) {
return { return {
token : "comment.doc.tag.storage.type", token: "comment.doc.tag.storage.type",
regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" regex: "\\b(?:TODO|FIXME|XXX|HACK)\\b"
}; };
}; };
DocCommentHighlightRules.getStartRule = function (start) {
DocCommentHighlightRules.getStartRule = function(start) {
return { return {
token : "comment.doc", // doc comment token: "comment.doc", // doc comment
regex : "\\/\\*(?=\\*)", regex: "\\/\\*(?=\\*)",
next : start next: start
}; };
}; };
DocCommentHighlightRules.getEndRule = function (start) { DocCommentHighlightRules.getEndRule = function (start) {
return { return {
token : "comment.doc", // closing comment token: "comment.doc", // closing comment
regex : "\\*\\/", regex: "\\*\\/",
next : start next: start
}; };
}; };
exports.DocCommentHighlightRules = DocCommentHighlightRules; exports.DocCommentHighlightRules = DocCommentHighlightRules;
}); });
define("ace/mode/csharp_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { define("ace/mode/csharp_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var CSharpHighlightRules = function () {
var CSharpHighlightRules = function() {
var keywordMapper = this.createKeywordMapper({ var keywordMapper = this.createKeywordMapper({
"variable.language": "this", "variable.language": "this",
"keyword": "abstract|event|new|struct|as|explicit|null|switch|base|extern|object|this|bool|false|operator|throw|break|finally|out|true|byte|fixed|override|try|case|float|params|typeof|catch|for|private|uint|char|foreach|protected|ulong|checked|goto|public|unchecked|class|if|readonly|unsafe|const|implicit|ref|ushort|continue|in|return|using|decimal|int|sbyte|virtual|default|interface|sealed|volatile|delegate|internal|partial|short|void|do|is|sizeof|while|double|lock|stackalloc|else|long|static|enum|namespace|string|var|dynamic", "keyword": "abstract|async|await|event|new|struct|as|explicit|null|switch|base|extern|object|this|bool|false|operator|throw|break|finally|out|true|byte|fixed|override|try|case|float|params|typeof|catch|for|private|uint|char|foreach|protected|ulong|checked|goto|public|unchecked|class|if|readonly|unsafe|const|implicit|ref|ushort|continue|in|return|using|decimal|int|sbyte|virtual|default|interface|sealed|volatile|delegate|internal|partial|short|void|do|is|sizeof|while|double|lock|stackalloc|else|long|static|enum|namespace|string|var|dynamic",
"constant.language": "null|true|false" "constant.language": "null|true|false"
}, "identifier"); }, "identifier");
this.$rules = { this.$rules = {
"start" : [ "start": [
{ {
token : "comment", token: "comment",
regex : "\\/\\/.*$" regex: "\\/\\/.*$"
}, },
DocCommentHighlightRules.getStartRule("doc-start"), DocCommentHighlightRules.getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token: "comment", // multi line comment
regex : "\\/\\*", regex: "\\/\\*",
next : "comment" next: "comment"
}, { }, {
token : "string", // character token: "string", // character
regex : /'(?:.|\\(:?u[\da-fA-F]+|x[\da-fA-F]+|[tbrf'"n]))?'/ regex: /'(?:.|\\(:?u[\da-fA-F]+|x[\da-fA-F]+|[tbrf'"n]))?'/
}, { }, {
token : "string", start : '"', end : '"|$', next: [ token: "string", start: '"', end: '"|$', next: [
{token: "constant.language.escape", regex: /\\(:?u[\da-fA-F]+|x[\da-fA-F]+|[tbrf'"n])/}, { token: "constant.language.escape", regex: /\\(:?u[\da-fA-F]+|x[\da-fA-F]+|[tbrf'"n])/ },
{token: "invalid", regex: /\\./} { token: "invalid", regex: /\\./ }
] ]
}, { }, {
token : "string", start : '@"', end : '"', next:[ token: "string", start: '@"', end: '"', next: [
{token: "constant.language.escape", regex: '""'} { token: "constant.language.escape", regex: '""' }
] ]
}, { }, {
token : "string", start : /\$"/, end : '"|$', next: [ token: "string", start: /\$"/, end: '"|$', next: [
{token: "constant.language.escape", regex: /\\(:?$)|{{/}, { token: "constant.language.escape", regex: /\\(:?$)|{{/ },
{token: "constant.language.escape", regex: /\\(:?u[\da-fA-F]+|x[\da-fA-F]+|[tbrf'"n])/}, { token: "constant.language.escape", regex: /\\(:?u[\da-fA-F]+|x[\da-fA-F]+|[tbrf'"n])/ },
{token: "invalid", regex: /\\./} { token: "invalid", regex: /\\./ }
] ]
}, { }, {
token : "constant.numeric", // hex token: "constant.numeric", // hex
regex : "0[xX][0-9a-fA-F]+\\b" regex: "0[xX][0-9a-fA-F]+\\b"
}, { }, {
token : "constant.numeric", // float token: "constant.numeric", // float
regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
}, { }, {
token : "constant.language.boolean", token: "constant.language.boolean",
regex : "(?:true|false)\\b" regex: "(?:true|false)\\b"
}, { }, {
token : keywordMapper, token: keywordMapper,
regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
}, { }, {
token : "keyword.operator", token: "keyword.operator",
regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)" regex: "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"
}, { }, {
token : "keyword", token: "keyword",
regex : "^\\s*#(if|else|elif|endif|define|undef|warning|error|line|region|endregion|pragma)" regex: "^\\s*#(if|else|elif|endif|define|undef|warning|error|line|region|endregion|pragma)"
}, { }, {
token : "punctuation.operator", token: "punctuation.operator",
regex : "\\?|\\:|\\,|\\;|\\." regex: "\\?|\\:|\\,|\\;|\\."
}, { }, {
token : "paren.lparen", token: "paren.lparen",
regex : "[[({]" regex: "[[({]"
}, { }, {
token : "paren.rparen", token: "paren.rparen",
regex : "[\\])}]" regex: "[\\])}]"
}, { }, {
token : "text", token: "text",
regex : "\\s+" regex: "\\s+"
} }
], ],
"comment" : [ "comment": [
{ {
token : "comment", // closing comment token: "comment", // closing comment
regex : "\\*\\/", regex: "\\*\\/",
next : "start" next: "start"
}, { }, {
defaultToken : "comment" defaultToken: "comment"
} }
] ]
}; };
this.embedRules(DocCommentHighlightRules, "doc-", [DocCommentHighlightRules.getEndRule("start")]);
this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]);
this.normalizeRules(); this.normalizeRules();
}; };
oop.inherits(CSharpHighlightRules, TextHighlightRules); oop.inherits(CSharpHighlightRules, TextHighlightRules);
exports.CSharpHighlightRules = CSharpHighlightRules; exports.CSharpHighlightRules = CSharpHighlightRules;
}); });
define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module){"use strict";
"use strict";
var Range = require("../range").Range; var Range = require("../range").Range;
var MatchingBraceOutdent = function () { };
var MatchingBraceOutdent = function() {}; (function () {
this.checkOutdent = function (line, input) {
(function() { if (!/^\s+$/.test(line))
this.checkOutdent = function(line, input) {
if (! /^\s+$/.test(line))
return false; return false;
return /^\s*\}/.test(input); return /^\s*\}/.test(input);
}; };
this.autoOutdent = function (doc, row) {
this.autoOutdent = function(doc, row) {
var line = doc.getLine(row); var line = doc.getLine(row);
var match = line.match(/^(\s*\})/); var match = line.match(/^(\s*\})/);
if (!match)
if (!match) return 0; return 0;
var column = match[1].length; var column = match[1].length;
var openBracePos = doc.findMatchingBracket({row: row, column: column}); var openBracePos = doc.findMatchingBracket({ row: row, column: column });
if (!openBracePos || openBracePos.row == row)
if (!openBracePos || openBracePos.row == row) return 0; return 0;
var indent = this.$getIndent(doc.getLine(openBracePos.row)); var indent = this.$getIndent(doc.getLine(openBracePos.row));
doc.replace(new Range(row, 0, row, column-1), indent); doc.replace(new Range(row, 0, row, column - 1), indent);
}; };
this.$getIndent = function (line) {
this.$getIndent = function(line) {
return line.match(/^\s*/)[0]; return line.match(/^\s*/)[0];
}; };
}).call(MatchingBraceOutdent.prototype); }).call(MatchingBraceOutdent.prototype);
exports.MatchingBraceOutdent = MatchingBraceOutdent; exports.MatchingBraceOutdent = MatchingBraceOutdent;
}); });
define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../../lib/oop"); var oop = require("../../lib/oop");
var Range = require("../../range").Range; var Range = require("../../range").Range;
var BaseFoldMode = require("./fold_mode").FoldMode; var BaseFoldMode = require("./fold_mode").FoldMode;
var FoldMode = exports.FoldMode = function (commentRegex) {
var FoldMode = exports.FoldMode = function(commentRegex) {
if (commentRegex) { if (commentRegex) {
this.foldingStartMarker = new RegExp( this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
);
this.foldingStopMarker = new RegExp(
this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
);
} }
}; };
oop.inherits(FoldMode, BaseFoldMode); oop.inherits(FoldMode, BaseFoldMode);
(function () {
(function() {
this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/; this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/; this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
this._getFoldWidgetBase = this.getFoldWidget; this._getFoldWidgetBase = this.getFoldWidget;
this.getFoldWidget = function(session, foldStyle, row) { this.getFoldWidget = function (session, foldStyle, row) {
var line = session.getLine(row); var line = session.getLine(row);
if (this.singleLineBlockCommentRe.test(line)) { if (this.singleLineBlockCommentRe.test(line)) {
if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
return ""; return "";
} }
var fw = this._getFoldWidgetBase(session, foldStyle, row); var fw = this._getFoldWidgetBase(session, foldStyle, row);
if (!fw && this.startRegionRe.test(line)) if (!fw && this.startRegionRe.test(line))
return "start"; // lineCommentRegionStart return "start"; // lineCommentRegionStart
return fw; return fw;
}; };
this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
var line = session.getLine(row); var line = session.getLine(row);
if (this.startRegionRe.test(line)) if (this.startRegionRe.test(line))
return this.getCommentRegionBlock(session, line, row); return this.getCommentRegionBlock(session, line, row);
var match = line.match(this.foldingStartMarker); var match = line.match(this.foldingStartMarker);
if (match) { if (match) {
var i = match.index; var i = match.index;
if (match[1]) if (match[1])
return this.openingBracketBlock(session, match[1], row, i); return this.openingBracketBlock(session, match[1], row, i);
var range = session.getCommentFoldRange(row, i + match[0].length, 1); var range = session.getCommentFoldRange(row, i + match[0].length, 1);
if (range && !range.isMultiLine()) { if (range && !range.isMultiLine()) {
if (forceMultiline) { if (forceMultiline) {
range = this.getSectionRange(session, row); range = this.getSectionRange(session, row);
} else if (foldStyle != "all") }
else if (foldStyle != "all")
range = null; range = null;
} }
return range; return range;
} }
if (foldStyle === "markbegin") if (foldStyle === "markbegin")
return; return;
var match = line.match(this.foldingStopMarker); var match = line.match(this.foldingStopMarker);
if (match) { if (match) {
var i = match.index + match[0].length; var i = match.index + match[0].length;
if (match[1]) if (match[1])
return this.closingBracketBlock(session, match[1], row, i); return this.closingBracketBlock(session, match[1], row, i);
return session.getCommentFoldRange(row, i, -1); return session.getCommentFoldRange(row, i, -1);
} }
}; };
this.getSectionRange = function (session, row) {
this.getSectionRange = function(session, row) {
var line = session.getLine(row); var line = session.getLine(row);
var startIndent = line.search(/\S/); var startIndent = line.search(/\S/);
var startRow = row; var startRow = row;
@ -279,77 +228,67 @@ oop.inherits(FoldMode, BaseFoldMode);
var indent = line.search(/\S/); var indent = line.search(/\S/);
if (indent === -1) if (indent === -1)
continue; continue;
if (startIndent > indent) if (startIndent > indent)
break; break;
var subRange = this.getFoldWidgetRange(session, "all", row); var subRange = this.getFoldWidgetRange(session, "all", row);
if (subRange) { if (subRange) {
if (subRange.start.row <= startRow) { if (subRange.start.row <= startRow) {
break; break;
} else if (subRange.isMultiLine()) { }
else if (subRange.isMultiLine()) {
row = subRange.end.row; row = subRange.end.row;
} else if (startIndent == indent) { }
else if (startIndent == indent) {
break; break;
} }
} }
endRow = row; endRow = row;
} }
return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
}; };
this.getCommentRegionBlock = function(session, line, row) { this.getCommentRegionBlock = function (session, line, row) {
var startColumn = line.search(/\s*$/); var startColumn = line.search(/\s*$/);
var maxRow = session.getLength(); var maxRow = session.getLength();
var startRow = row; var startRow = row;
var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
var depth = 1; var depth = 1;
while (++row < maxRow) { while (++row < maxRow) {
line = session.getLine(row); line = session.getLine(row);
var m = re.exec(line); var m = re.exec(line);
if (!m) continue; if (!m)
if (m[1]) depth--; continue;
else depth++; if (m[1])
depth--;
if (!depth) break; else
depth++;
if (!depth)
break;
} }
var endRow = row; var endRow = row;
if (endRow > startRow) { if (endRow > startRow) {
return new Range(startRow, startColumn, endRow, line.length); return new Range(startRow, startColumn, endRow, line.length);
} }
}; };
}).call(FoldMode.prototype); }).call(FoldMode.prototype);
}); });
define("ace/mode/folding/csharp",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/cstyle"], function(require, exports, module) { define("ace/mode/folding/csharp",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../../lib/oop"); var oop = require("../../lib/oop");
var Range = require("../../range").Range; var Range = require("../../range").Range;
var CFoldMode = require("./cstyle").FoldMode; var CFoldMode = require("./cstyle").FoldMode;
var FoldMode = exports.FoldMode = function (commentRegex) {
var FoldMode = exports.FoldMode = function(commentRegex) {
if (commentRegex) { if (commentRegex) {
this.foldingStartMarker = new RegExp( this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
);
this.foldingStopMarker = new RegExp(
this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
);
} }
}; };
oop.inherits(FoldMode, CFoldMode); oop.inherits(FoldMode, CFoldMode);
(function () {
(function() {
this.usingRe = /^\s*using \S/; this.usingRe = /^\s*using \S/;
this.getFoldWidgetRangeBase = this.getFoldWidgetRange; this.getFoldWidgetRangeBase = this.getFoldWidgetRange;
this.getFoldWidgetBase = this.getFoldWidget; this.getFoldWidgetBase = this.getFoldWidget;
this.getFoldWidget = function (session, foldStyle, row) {
this.getFoldWidget = function(session, foldStyle, row) {
var fw = this.getFoldWidgetBase(session, foldStyle, row); var fw = this.getFoldWidgetBase(session, foldStyle, row);
if (!fw) { if (!fw) {
var line = session.getLine(row); var line = session.getLine(row);
@ -365,47 +304,38 @@ oop.inherits(FoldMode, CFoldMode);
} }
return fw; return fw;
}; };
this.getFoldWidgetRange = function (session, foldStyle, row) {
this.getFoldWidgetRange = function(session, foldStyle, row) {
var range = this.getFoldWidgetRangeBase(session, foldStyle, row); var range = this.getFoldWidgetRangeBase(session, foldStyle, row);
if (range) if (range)
return range; return range;
var line = session.getLine(row); var line = session.getLine(row);
if (this.usingRe.test(line)) if (this.usingRe.test(line))
return this.getUsingStatementBlock(session, line, row); return this.getUsingStatementBlock(session, line, row);
if (/^\s*#region\b/.test(line)) if (/^\s*#region\b/.test(line))
return this.getRegionBlock(session, line, row); return this.getRegionBlock(session, line, row);
}; };
this.getUsingStatementBlock = function (session, line, row) {
this.getUsingStatementBlock = function(session, line, row) {
var startColumn = line.match(this.usingRe)[0].length - 1; var startColumn = line.match(this.usingRe)[0].length - 1;
var maxRow = session.getLength(); var maxRow = session.getLength();
var startRow = row; var startRow = row;
var endRow = row; var endRow = row;
while (++row < maxRow) { while (++row < maxRow) {
line = session.getLine(row); line = session.getLine(row);
if (/^\s*$/.test(line)) if (/^\s*$/.test(line))
continue; continue;
if (!this.usingRe.test(line)) if (!this.usingRe.test(line))
break; break;
endRow = row; endRow = row;
} }
if (endRow > startRow) { if (endRow > startRow) {
var endColumn = session.getLine(endRow).length; var endColumn = session.getLine(endRow).length;
return new Range(startRow, startColumn, endRow, endColumn); return new Range(startRow, startColumn, endRow, endColumn);
} }
}; };
this.getRegionBlock = function (session, line, row) {
this.getRegionBlock = function(session, line, row) {
var startColumn = line.search(/\s*$/); var startColumn = line.search(/\s*$/);
var maxRow = session.getLength(); var maxRow = session.getLength();
var startRow = row; var startRow = row;
var re = /^\s*#(end)?region\b/; var re = /^\s*#(end)?region\b/;
var depth = 1; var depth = 1;
while (++row < maxRow) { while (++row < maxRow) {
@ -417,79 +347,67 @@ oop.inherits(FoldMode, CFoldMode);
depth--; depth--;
else else
depth++; depth++;
if (!depth) if (!depth)
break; break;
} }
var endRow = row; var endRow = row;
if (endRow > startRow) { if (endRow > startRow) {
return new Range(startRow, startColumn, endRow, line.length); return new Range(startRow, startColumn, endRow, line.length);
} }
}; };
}).call(FoldMode.prototype); }).call(FoldMode.prototype);
}); });
define("ace/mode/csharp",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/csharp_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/behaviour/cstyle","ace/mode/folding/csharp"], function(require, exports, module) { define("ace/mode/csharp",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/csharp_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/folding/csharp"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextMode = require("./text").Mode; var TextMode = require("./text").Mode;
var CSharpHighlightRules = require("./csharp_highlight_rules").CSharpHighlightRules; var CSharpHighlightRules = require("./csharp_highlight_rules").CSharpHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
var CStyleFoldMode = require("./folding/csharp").FoldMode; var CStyleFoldMode = require("./folding/csharp").FoldMode;
var Mode = function () {
var Mode = function() {
this.HighlightRules = CSharpHighlightRules; this.HighlightRules = CSharpHighlightRules;
this.$outdent = new MatchingBraceOutdent(); this.$outdent = new MatchingBraceOutdent();
this.$behaviour = new CstyleBehaviour(); this.$behaviour = this.$defaultBehaviour;
this.foldingRules = new CStyleFoldMode(); this.foldingRules = new CStyleFoldMode();
}; };
oop.inherits(Mode, TextMode); oop.inherits(Mode, TextMode);
(function () {
(function() {
this.lineCommentStart = "//"; this.lineCommentStart = "//";
this.blockComment = {start: "/*", end: "*/"}; this.blockComment = { start: "/*", end: "*/" };
this.getNextLineIndent = function (state, line, tab) {
this.getNextLineIndent = function(state, line, tab) {
var indent = this.$getIndent(line); var indent = this.$getIndent(line);
var tokenizedLine = this.getTokenizer().getLineTokens(line, state); var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
var tokens = tokenizedLine.tokens; var tokens = tokenizedLine.tokens;
if (tokens.length && tokens[tokens.length - 1].type == "comment") {
if (tokens.length && tokens[tokens.length-1].type == "comment") {
return indent; return indent;
} }
if (state == "start") { if (state == "start") {
var match = line.match(/^.*[\{\(\[]\s*$/); var match = line.match(/^.*[\{\(\[]\s*$/);
if (match) { if (match) {
indent += tab; indent += tab;
} }
} }
return indent; return indent;
}; };
this.checkOutdent = function (state, line, input) {
this.checkOutdent = function(state, line, input) {
return this.$outdent.checkOutdent(line, input); return this.$outdent.checkOutdent(line, input);
}; };
this.autoOutdent = function (state, doc, row) {
this.autoOutdent = function(state, doc, row) {
this.$outdent.autoOutdent(doc, row); this.$outdent.autoOutdent(doc, row);
}; };
this.createWorker = function (session) {
this.createWorker = function(session) {
return null; return null;
}; };
this.$id = "ace/mode/csharp"; this.$id = "ace/mode/csharp";
}).call(Mode.prototype); }).call(Mode.prototype);
exports.Mode = Mode; exports.Mode = Mode;
});
}); (function() {
window.require(["ace/mode/csharp"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,188 +1,183 @@
define("ace/mode/csound_preprocessor_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { define("ace/mode/csound_preprocessor_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var CsoundPreprocessorHighlightRules = function (embeddedRulePrefix) {
var CsoundPreprocessorHighlightRules = function() { this.embeddedRulePrefix = embeddedRulePrefix === undefined ? "" : embeddedRulePrefix;
this.semicolonComments = { this.semicolonComments = {
token : "comment.line.semicolon.csound", token: "comment.line.semicolon.csound",
regex : ";.*$" regex: ";.*$"
}; };
this.comments = [ this.comments = [
{ {
token : "punctuation.definition.comment.begin.csound", token: "punctuation.definition.comment.begin.csound",
regex : "/\\*", regex: "/\\*",
push : [ push: [
{ {
token : "punctuation.definition.comment.end.csound", token: "punctuation.definition.comment.end.csound",
regex : "\\*/", regex: "\\*/",
next : "pop" next: "pop"
}, { }, {
defaultToken: "comment.block.csound" defaultToken: "comment.block.csound"
} }
] ]
}, { }, {
token : "comment.line.double-slash.csound", token: "comment.line.double-slash.csound",
regex : "//.*$" regex: "//.*$"
}, },
this.semicolonComments this.semicolonComments
]; ];
this.macroUses = [ this.macroUses = [
{ {
token : ["entity.name.function.preprocessor.csound", "punctuation.definition.macro-parameter-value-list.begin.csound"], token: ["entity.name.function.preprocessor.csound", "punctuation.definition.macro-parameter-value-list.begin.csound"],
regex : /(\$[A-Z_a-z]\w*\.?)(\()/, regex: /(\$[A-Z_a-z]\w*\.?)(\()/,
next : "macro parameter value list" next: "macro parameter value list"
}, { }, {
token : "entity.name.function.preprocessor.csound", token: "entity.name.function.preprocessor.csound",
regex : /\$[A-Z_a-z]\w*(?:\.|\b)/ regex: /\$[A-Z_a-z]\w*(?:\.|\b)/
} }
]; ];
this.numbers = [ this.numbers = [
{ {
token : "constant.numeric.float.csound", token: "constant.numeric.float.csound",
regex : /(?:\d+[Ee][+-]?\d+)|(?:\d+\.\d*|\d*\.\d+)(?:[Ee][+-]?\d+)?/ regex: /(?:\d+[Ee][+-]?\d+)|(?:\d+\.\d*|\d*\.\d+)(?:[Ee][+-]?\d+)?/
}, { }, {
token : ["storage.type.number.csound", "constant.numeric.integer.hexadecimal.csound"], token: ["storage.type.number.csound", "constant.numeric.integer.hexadecimal.csound"],
regex : /(0[Xx])([0-9A-Fa-f]+)/ regex: /(0[Xx])([0-9A-Fa-f]+)/
}, { }, {
token : "constant.numeric.integer.decimal.csound", token: "constant.numeric.integer.decimal.csound",
regex : /\d+/ regex: /\d+/
} }
]; ];
this.bracedStringContents = [ this.bracedStringContents = [
{ {
token : "constant.character.escape.csound", token: "constant.character.escape.csound",
regex : /\\(?:[\\abnrt"]|[0-7]{1,3})/ regex: /\\(?:[\\abnrt"]|[0-7]{1,3})/
}, },
{ {
token : "constant.character.placeholder.csound", token: "constant.character.placeholder.csound",
regex : /%[#0\- +]*\d*(?:\.\d+)?[diuoxXfFeEgGaAcs]/ regex: /%[#0\- +]*\d*(?:\.\d+)?[diuoxXfFeEgGaAcs]/
}, { }, {
token : "constant.character.escape.csound", token: "constant.character.escape.csound",
regex : /%%/ regex: /%%/
} }
]; ];
this.quotedStringContents = [ this.quotedStringContents = [
this.macroUses, this.macroUses,
this.bracedStringContents this.bracedStringContents
]; ];
var start = [ var start = [
this.comments, this.comments,
{ {
token : "keyword.preprocessor.csound", token: "keyword.preprocessor.csound",
regex : /#(?:e(?:nd(?:if)?|lse)\b|##)|@@?[ \t]*\d+/ regex: /#(?:e(?:nd(?:if)?|lse)\b|##)|@@?[ \t]*\d+/
}, { }, {
token : "keyword.preprocessor.csound", token: "keyword.preprocessor.csound",
regex : /#include/, regex: /#include/,
push : [ push: [
this.comments, this.comments,
{ {
token : "string.csound", token: "string.csound",
regex : /([^ \t])(?:.*?\1)/, regex: /([^ \t])(?:.*?\1)/,
next : "pop" next: "pop"
} }
] ]
}, { }, {
token : "keyword.preprocessor.csound", token: "keyword.preprocessor.csound",
regex : /#[ \t]*define/, regex: /#includestr/,
next : "define directive" push: [
this.comments,
{
token: "string.csound",
regex: /([^ \t])(?:.*?\1)/,
next: "pop"
}
]
}, { }, {
token : "keyword.preprocessor.csound", token: "keyword.preprocessor.csound",
regex : /#(?:ifn?def|undef)\b/, regex: /#[ \t]*define/,
next : "macro directive" next: "define directive"
}, {
token: "keyword.preprocessor.csound",
regex: /#(?:ifn?def|undef)\b/,
next: "macro directive"
}, },
this.macroUses this.macroUses
]; ];
this.$rules = { this.$rules = {
"start": start, "start": start,
"define directive": [ "define directive": [
this.comments, this.comments,
{ {
token : "entity.name.function.preprocessor.csound", token: "entity.name.function.preprocessor.csound",
regex : /[A-Z_a-z]\w*/ regex: /[A-Z_a-z]\w*/
}, { }, {
token : "punctuation.definition.macro-parameter-name-list.begin.csound", token: "punctuation.definition.macro-parameter-name-list.begin.csound",
regex : /\(/, regex: /\(/,
next : "macro parameter name list" next: "macro parameter name list"
}, { }, {
token : "punctuation.definition.macro.begin.csound", token: "punctuation.definition.macro.begin.csound",
regex : /#/, regex: /#/,
next : "macro body" next: "macro body"
} }
], ],
"macro parameter name list": [ "macro parameter name list": [
{ {
token : "variable.parameter.preprocessor.csound", token: "variable.parameter.preprocessor.csound",
regex : /[A-Z_a-z]\w*/ regex: /[A-Z_a-z]\w*/
}, { }, {
token : "punctuation.definition.macro-parameter-name-list.end.csound", token: "punctuation.definition.macro-parameter-name-list.end.csound",
regex : /\)/, regex: /\)/,
next : "define directive" next: "define directive"
} }
], ],
"macro body": [ "macro body": [
{ {
token : "constant.character.escape.csound", token: "constant.character.escape.csound",
regex : /\\#/ regex: /\\#/
}, { }, {
token : "punctuation.definition.macro.end.csound", token: "punctuation.definition.macro.end.csound",
regex : /#/, regex: /#/,
next : "start" next: "start"
}, },
start start
], ],
"macro directive": [ "macro directive": [
this.comments, this.comments,
{ {
token : "entity.name.function.preprocessor.csound", token: "entity.name.function.preprocessor.csound",
regex : /[A-Z_a-z]\w*/, regex: /[A-Z_a-z]\w*/,
next : "start" next: "start"
} }
], ],
"macro parameter value list": [ "macro parameter value list": [
{ {
token : "punctuation.definition.macro-parameter-value-list.end.csound", token: "punctuation.definition.macro-parameter-value-list.end.csound",
regex : /\)/, regex: /\)/,
next : "start" next: "start"
}, { }, {
token : "punctuation.definition.string.begin.csound", token: "punctuation.definition.string.begin.csound",
regex : /"/, regex: /"/,
next : "macro parameter value quoted string" next: "macro parameter value quoted string"
}, this.pushRule({ }, this.pushRule({
token : "punctuation.macro-parameter-value-parenthetical.begin.csound", token: "punctuation.macro-parameter-value-parenthetical.begin.csound",
regex : /\(/, regex: /\(/,
next : "macro parameter value parenthetical" next: "macro parameter value parenthetical"
}), { }), {
token : "punctuation.macro-parameter-value-separator.csound", token: "punctuation.macro-parameter-value-separator.csound",
regex : "[#']" regex: "[#']"
} }
], ],
"macro parameter value quoted string": [ "macro parameter value quoted string": [
{ {
token : "constant.character.escape.csound", token: "constant.character.escape.csound",
regex : /\\[#'()]/ regex: /\\[#'()]/
}, { }, {
token : "invalid.illegal.csound", token: "invalid.illegal.csound",
regex : /[#'()]/ regex: /[#'()]/
}, { }, {
token : "punctuation.definition.string.end.csound", token: "punctuation.definition.string.end.csound",
regex : /"/, regex: /"/,
next : "macro parameter value list" next: "macro parameter value list"
}, },
this.quotedStringContents, this.quotedStringContents,
{ {
@ -191,35 +186,38 @@ var CsoundPreprocessorHighlightRules = function() {
], ],
"macro parameter value parenthetical": [ "macro parameter value parenthetical": [
{ {
token : "constant.character.escape.csound", token: "constant.character.escape.csound",
regex : /\\\)/ regex: /\\\)/
}, this.popRule({ }, this.popRule({
token : "punctuation.macro-parameter-value-parenthetical.end.csound", token: "punctuation.macro-parameter-value-parenthetical.end.csound",
regex : /\)/ regex: /\)/
}), this.pushRule({ }), this.pushRule({
token : "punctuation.macro-parameter-value-parenthetical.begin.csound", token: "punctuation.macro-parameter-value-parenthetical.begin.csound",
regex : /\(/, regex: /\(/,
next : "macro parameter value parenthetical" next: "macro parameter value parenthetical"
}), }),
start start
] ]
}; };
}; };
oop.inherits(CsoundPreprocessorHighlightRules, TextHighlightRules); oop.inherits(CsoundPreprocessorHighlightRules, TextHighlightRules);
(function () {
(function() { this.pushRule = function (params) {
if (Array.isArray(params.next)) {
this.pushRule = function(params) { for (var i = 0; i < params.next.length; i++) {
params.next[i] = this.embeddedRulePrefix + params.next[i];
}
}
return { return {
regex : params.regex, onMatch: function(value, currentState, stack, line) { regex: params.regex, onMatch: function (value, currentState, stack, line) {
if (stack.length === 0) if (stack.length === 0)
stack.push(currentState); stack.push(currentState);
if (Array.isArray(params.next)) { if (Array.isArray(params.next)) {
for (var i = 0; i < params.next.length; i++) { for (var i = 0; i < params.next.length; i++) {
stack.push(params.next[i]); stack.push(params.next[i]);
} }
} else { }
else {
stack.push(params.next); stack.push(params.next);
} }
this.next = stack[stack.length - 1]; this.next = stack[stack.length - 1];
@ -227,220 +225,185 @@ oop.inherits(CsoundPreprocessorHighlightRules, TextHighlightRules);
}, },
get next() { return Array.isArray(params.next) ? params.next[params.next.length - 1] : params.next; }, get next() { return Array.isArray(params.next) ? params.next[params.next.length - 1] : params.next; },
set next(next) { set next(next) {
if (Array.isArray(params.next)) { if (!Array.isArray(params.next)) {
var oldNext = params.next[params.next.length - 1];
var oldNextIndex = oldNext.length - 1;
var newNextIndex = next.length - 1;
if (newNextIndex > oldNextIndex) {
while (oldNextIndex >= 0 && newNextIndex >= 0) {
if (oldNext.charAt(oldNextIndex) !== next.charAt(newNextIndex)) {
var prefix = next.substr(0, newNextIndex);
for (var i = 0; i < params.next.length; i++) {
params.next[i] = prefix + params.next[i];
}
break;
}
oldNextIndex--;
newNextIndex--;
}
}
} else {
params.next = next; params.next = next;
} }
}, },
get token() { return params.token; } get token() { return params.token; }
}; };
}; };
this.popRule = function (params) {
this.popRule = function(params) { if (params.next) {
params.next = this.embeddedRulePrefix + params.next;
}
return { return {
regex : params.regex, onMatch: function(value, currentState, stack, line) { regex: params.regex, onMatch: function (value, currentState, stack, line) {
stack.pop(); stack.pop();
if (params.next) { if (params.next) {
stack.push(params.next); stack.push(params.next);
this.next = stack[stack.length - 1]; this.next = stack[stack.length - 1];
} else { }
else {
this.next = stack.length > 1 ? stack[stack.length - 1] : stack.pop(); this.next = stack.length > 1 ? stack[stack.length - 1] : stack.pop();
} }
return params.token; return params.token;
} }
}; };
}; };
}).call(CsoundPreprocessorHighlightRules.prototype); }).call(CsoundPreprocessorHighlightRules.prototype);
exports.CsoundPreprocessorHighlightRules = CsoundPreprocessorHighlightRules; exports.CsoundPreprocessorHighlightRules = CsoundPreprocessorHighlightRules;
}); });
define("ace/mode/csound_score_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/csound_preprocessor_highlight_rules"], function(require, exports, module) { define("ace/mode/csound_score_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/csound_preprocessor_highlight_rules"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var CsoundPreprocessorHighlightRules = require("./csound_preprocessor_highlight_rules").CsoundPreprocessorHighlightRules; var CsoundPreprocessorHighlightRules = require("./csound_preprocessor_highlight_rules").CsoundPreprocessorHighlightRules;
var CsoundScoreHighlightRules = function (embeddedRulePrefix) {
var CsoundScoreHighlightRules = function() { CsoundPreprocessorHighlightRules.call(this, embeddedRulePrefix);
CsoundPreprocessorHighlightRules.call(this);
this.quotedStringContents.push({ this.quotedStringContents.push({
token : "invalid.illegal.csound-score", token: "invalid.illegal.csound-score",
regex : /[^"]*$/ regex: /[^"]*$/
}); });
var start = this.$rules.start; var start = this.$rules.start;
start.push( start.push({
{ token: "keyword.control.csound-score",
token : "keyword.control.csound-score", regex: /[aBbCdefiqstvxy]/
regex : /[abCdefiqstvxy]/ }, {
}, { token: "invalid.illegal.csound-score",
token : "invalid.illegal.csound-score", regex: /w/
regex : /w/ }, {
}, { token: "constant.numeric.language.csound-score",
token : "constant.numeric.language.csound-score", regex: /z/
regex : /z/ }, {
}, { token: ["keyword.control.csound-score", "constant.numeric.integer.decimal.csound-score"],
token : ["keyword.control.csound-score", "constant.numeric.integer.decimal.csound-score"], regex: /([nNpP][pP])(\d+)/
regex : /([nNpP][pP])(\d+)/ }, {
}, { token: "keyword.other.csound-score",
token : "keyword.other.csound-score", regex: /[mn]/,
regex : /[mn]/, push: [
push : [
{
token : "empty",
regex : /$/,
next : "pop"
},
this.comments,
{
token : "entity.name.label.csound-score",
regex : /[A-Z_a-z]\w*/
}
]
}, {
token : "keyword.preprocessor.csound-score",
regex : /r\b/,
next : "repeat section"
},
this.numbers,
{
token : "keyword.operator.csound-score",
regex : "[!+\\-*/^%&|<>#~.]"
},
this.pushRule({
token : "punctuation.definition.string.begin.csound-score",
regex : /"/,
next : "quoted string"
}),
this.pushRule({
token : "punctuation.braced-loop.begin.csound-score",
regex : /{/,
next : "loop after left brace"
})
);
this.addRules({
"repeat section": [
{ {
token : "empty", token: "empty",
regex : /$/, regex: /$/,
next : "start" next: "pop"
}, },
this.comments, this.comments,
{ {
token : "constant.numeric.integer.decimal.csound-score", token: "entity.name.label.csound-score",
regex : /\d+/, regex: /[A-Z_a-z]\w*/
next : "repeat section before label" }
]
}, {
token: "keyword.preprocessor.csound-score",
regex: /r\b/,
next: "repeat section"
}, this.numbers, {
token: "keyword.operator.csound-score",
regex: "[!+\\-*/^%&|<>#~.]"
}, this.pushRule({
token: "punctuation.definition.string.begin.csound-score",
regex: /"/,
next: "quoted string"
}), this.pushRule({
token: "punctuation.braced-loop.begin.csound-score",
regex: /{/,
next: "loop after left brace"
}));
this.addRules({
"repeat section": [
{
token: "empty",
regex: /$/,
next: "start"
},
this.comments,
{
token: "constant.numeric.integer.decimal.csound-score",
regex: /\d+/,
next: "repeat section before label"
} }
], ],
"repeat section before label": [ "repeat section before label": [
{ {
token : "empty", token: "empty",
regex : /$/, regex: /$/,
next : "start" next: "start"
}, },
this.comments, this.comments,
{ {
token : "entity.name.label.csound-score", token: "entity.name.label.csound-score",
regex : /[A-Z_a-z]\w*/, regex: /[A-Z_a-z]\w*/,
next : "start" next: "start"
} }
], ],
"quoted string": [ "quoted string": [
this.popRule({ this.popRule({
token : "punctuation.definition.string.end.csound-score", token: "punctuation.definition.string.end.csound-score",
regex : /"/ regex: /"/
}), }),
this.quotedStringContents, this.quotedStringContents,
{ {
defaultToken: "string.quoted.csound-score" defaultToken: "string.quoted.csound-score"
} }
], ],
"loop after left brace": [ "loop after left brace": [
this.popRule({ this.popRule({
token : "constant.numeric.integer.decimal.csound-score", token: "constant.numeric.integer.decimal.csound-score",
regex : /\d+/, regex: /\d+/,
next : "loop after repeat count" next: "loop after repeat count"
}), }),
this.comments, this.comments,
{ {
token : "invalid.illegal.csound", token: "invalid.illegal.csound",
regex : /\S.*/ regex: /\S.*/
} }
], ],
"loop after repeat count": [ "loop after repeat count": [
this.popRule({ this.popRule({
token : "entity.name.function.preprocessor.csound-score", token: "entity.name.function.preprocessor.csound-score",
regex : /[A-Z_a-z]\w*\b/, regex: /[A-Z_a-z]\w*\b/,
next : "loop after macro name" next: "loop after macro name"
}), }),
this.comments, this.comments,
{ {
token : "invalid.illegal.csound", token: "invalid.illegal.csound",
regex : /\S.*/ regex: /\S.*/
} }
], ],
"loop after macro name": [ "loop after macro name": [
start, start,
this.popRule({ this.popRule({
token : "punctuation.braced-loop.end.csound-score", token: "punctuation.braced-loop.end.csound-score",
regex : /}/ regex: /}/
}) })
] ]
}); });
this.normalizeRules(); this.normalizeRules();
}; };
oop.inherits(CsoundScoreHighlightRules, CsoundPreprocessorHighlightRules); oop.inherits(CsoundScoreHighlightRules, CsoundPreprocessorHighlightRules);
exports.CsoundScoreHighlightRules = CsoundScoreHighlightRules; exports.CsoundScoreHighlightRules = CsoundScoreHighlightRules;
}); });
define("ace/mode/csound_score",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/csound_score_highlight_rules"], function(require, exports, module) { define("ace/mode/csound_score",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/csound_score_highlight_rules"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextMode = require("./text").Mode; var TextMode = require("./text").Mode;
var CsoundScoreHighlightRules = require("./csound_score_highlight_rules").CsoundScoreHighlightRules; var CsoundScoreHighlightRules = require("./csound_score_highlight_rules").CsoundScoreHighlightRules;
var Mode = function () {
var Mode = function() {
this.HighlightRules = CsoundScoreHighlightRules; this.HighlightRules = CsoundScoreHighlightRules;
}; };
oop.inherits(Mode, TextMode); oop.inherits(Mode, TextMode);
(function () {
(function() {
this.lineCommentStart = ";"; this.lineCommentStart = ";";
this.blockComment = {start: "/*", end: "*/"}; this.blockComment = { start: "/*", end: "*/" };
this.$id = "ace/mode/csound_score";
}).call(Mode.prototype); }).call(Mode.prototype);
exports.Mode = Mode; exports.Mode = Mode;
});
}); (function() {
window.require(["ace/mode/csound_score"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

View File

@ -0,0 +1,59 @@
define("ace/mode/csp_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){/*
EXPLANATION
This highlight rules were created to help developer spot typos when working
with Content-Security-Policy (CSP). See:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/
*/
"use strict";
var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var CspHighlightRules = function () {
var keywordMapper = this.createKeywordMapper({
"constant.language": "child-src|connect-src|default-src|font-src|frame-src|img-src|manifest-src|media-src|object-src"
+ "|script-src|style-src|worker-src|base-uri|plugin-types|sandbox|disown-opener|form-action|frame-ancestors|report-uri"
+ "|report-to|upgrade-insecure-requests|block-all-mixed-content|require-sri-for|reflected-xss|referrer|policy-uri",
"variable": "'none'|'self'|'unsafe-inline'|'unsafe-eval'|'strict-dynamic'|'unsafe-hashed-attributes'"
}, "identifier", true);
this.$rules = {
start: [{
token: "string.link",
regex: /https?:[^;\s]*/
}, {
token: "operator.punctuation",
regex: /;/
}, {
token: keywordMapper,
regex: /[^\s;]+/
}]
};
};
oop.inherits(CspHighlightRules, TextHighlightRules);
exports.CspHighlightRules = CspHighlightRules;
});
define("ace/mode/csp",["require","exports","module","ace/mode/text","ace/mode/csp_highlight_rules","ace/lib/oop"], function(require, exports, module){/*
THIS FILE WAS AUTOGENERATED BY mode.tmpl.js
*/
"use strict";
var TextMode = require("./text").Mode;
var CspHighlightRules = require("./csp_highlight_rules").CspHighlightRules;
var oop = require("../lib/oop");
var Mode = function () {
this.HighlightRules = CspHighlightRules;
};
oop.inherits(Mode, TextMode);
(function () {
this.$id = "ace/mode/csp";
}).call(Mode.prototype);
exports.Mode = Mode;
}); (function() {
window.require(["ace/mode/csp"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

View File

@ -1,21 +1,16 @@
define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) { define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var lang = require("../lib/lang"); var lang = require("../lib/lang");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var supportType = exports.supportType = "align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|border|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|bottom|box-shadow|box-sizing|caption-side|clear|clip|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|min-height|min-width|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index"; var supportType = exports.supportType = "align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|border|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|bottom|box-shadow|box-sizing|caption-side|clear|clip|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|max-zoom|min-height|min-width|min-zoom|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|user-select|user-zoom|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index";
var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters"; var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters";
var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero"; var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|flex-end|flex-start|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero|zoom";
var supportConstantColor = exports.supportConstantColor = "aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen"; var supportConstantColor = exports.supportConstantColor = "aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen";
var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace"; var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace";
var numRe = exports.numRe = "\\-?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+))"; var numRe = exports.numRe = "\\-?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+))";
var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b"; var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b"; var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b";
var CssHighlightRules = function () {
var CssHighlightRules = function() {
var keywordMapper = this.createKeywordMapper({ var keywordMapper = this.createKeywordMapper({
"support.function": supportFunction, "support.function": supportFunction,
"support.constant": supportConstant, "support.constant": supportConstant,
@ -23,282 +18,261 @@ var CssHighlightRules = function() {
"support.constant.color": supportConstantColor, "support.constant.color": supportConstantColor,
"support.constant.fonts": supportConstantFonts "support.constant.fonts": supportConstantFonts
}, "text", true); }, "text", true);
this.$rules = { this.$rules = {
"start" : [{ "start": [{
include : ["strings", "url", "comments"] include: ["strings", "url", "comments"]
}, { }, {
token: "paren.lparen", token: "paren.lparen",
regex: "\\{", regex: "\\{",
next: "ruleset" next: "ruleset"
}, { }, {
token: "paren.rparen", token: "paren.rparen",
regex: "\\}" regex: "\\}"
}, { }, {
token: "string", token: "string",
regex: "@", regex: "@(?!viewport)",
next: "media" next: "media"
}, { }, {
token: "keyword", token: "keyword",
regex: "#[a-z0-9-_]+" regex: "#[a-z0-9-_]+"
}, { }, {
token: "keyword", token: "keyword",
regex: "%" regex: "%"
}, { }, {
token: "variable", token: "variable",
regex: "\\.[a-z0-9-_]+" regex: "\\.[a-z0-9-_]+"
}, { }, {
token: "string", token: "string",
regex: ":[a-z0-9-_]+" regex: ":[a-z0-9-_]+"
}, { }, {
token : "constant.numeric", token: "constant.numeric",
regex : numRe regex: numRe
}, { }, {
token: "constant", token: "constant",
regex: "[a-z0-9-_]+" regex: "[a-z0-9-_]+"
}, { }, {
caseInsensitive: true caseInsensitive: true
}], }],
"media": [{ "media": [{
include : ["strings", "url", "comments"] include: ["strings", "url", "comments"]
}, {
token: "paren.lparen",
regex: "\\{",
next: "start"
}, {
token: "paren.rparen",
regex: "\\}",
next: "start"
}, {
token: "string",
regex: ";",
next: "start"
}, {
token: "keyword",
regex: "(?:media|supports|document|charset|import|namespace|media|supports|document"
+ "|page|font|keyframes|viewport|counter-style|font-feature-values"
+ "|swash|ornaments|annotation|stylistic|styleset|character-variant)"
}],
"comments" : [{
token: "comment", // multi line comment
regex: "\\/\\*",
push: [{
token : "comment",
regex : "\\*\\/",
next : "pop"
}, { }, {
defaultToken : "comment" token: "paren.lparen",
}] regex: "\\{",
}], next: "start"
}, {
"ruleset" : [{ token: "paren.rparen",
regex : "-(webkit|ms|moz|o)-", regex: "\\}",
token : "text" next: "start"
}, { }, {
token : "paren.rparen", token: "string",
regex : "\\}", regex: ";",
next : "start" next: "start"
}, { }, {
include : ["strings", "url", "comments"] token: "keyword",
}, { regex: "(?:media|supports|document|charset|import|namespace|media|supports|document"
token : ["constant.numeric", "keyword"], + "|page|font|keyframes|viewport|counter-style|font-feature-values"
regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)" + "|swash|ornaments|annotation|stylistic|styleset|character-variant)"
}, { }],
token : "constant.numeric", "comments": [{
regex : numRe token: "comment", // multi line comment
}, { regex: "\\/\\*",
token : "constant.numeric", // hex6 color push: [{
regex : "#[a-f0-9]{6}" token: "comment",
}, { regex: "\\*\\/",
token : "constant.numeric", // hex3 color next: "pop"
regex : "#[a-f0-9]{3}" }, {
}, { defaultToken: "comment"
token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"], }]
regex : pseudoElements }],
}, { "ruleset": [{
token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"], regex: "-(webkit|ms|moz|o)-",
regex : pseudoClasses token: "text"
}, { }, {
include: "url" token: "punctuation.operator",
}, { regex: "[:;]"
token : keywordMapper, }, {
regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*" token: "paren.rparen",
}, { regex: "\\}",
caseInsensitive: true next: "start"
}], }, {
include: ["strings", "url", "comments"]
}, {
token: ["constant.numeric", "keyword"],
regex: "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vmax|vmin|vm|vw|%)"
}, {
token: "constant.numeric",
regex: numRe
}, {
token: "constant.numeric", // hex6 color
regex: "#[a-f0-9]{6}"
}, {
token: "constant.numeric", // hex3 color
regex: "#[a-f0-9]{3}"
}, {
token: ["punctuation", "entity.other.attribute-name.pseudo-element.css"],
regex: pseudoElements
}, {
token: ["punctuation", "entity.other.attribute-name.pseudo-class.css"],
regex: pseudoClasses
}, {
include: "url"
}, {
token: keywordMapper,
regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
}, {
caseInsensitive: true
}],
url: [{ url: [{
token : "support.function", token: "support.function",
regex : "(?:url(:?-prefix)?|domain|regexp)\\(", regex: "(?:url(:?-prefix)?|domain|regexp)\\(",
push: [{ push: [{
token : "support.function", token: "support.function",
regex : "\\)", regex: "\\)",
next : "pop" next: "pop"
}, { }, {
defaultToken: "string" defaultToken: "string"
}] }]
}], }],
strings: [{ strings: [{
token : "string.start", token: "string.start",
regex : "'", regex: "'",
push : [{ push: [{
token : "string.end", token: "string.end",
regex : "'|$", regex: "'|$",
next: "pop" next: "pop"
}, {
include: "escapes"
}, {
token: "constant.language.escape",
regex: /\\$/,
consumeLineEnd: true
}, {
defaultToken: "string"
}]
}, { }, {
include : "escapes" token: "string.start",
}, { regex: '"',
token : "constant.language.escape", push: [{
regex : /\\$/, token: "string.end",
consumeLineEnd: true regex: '"|$',
}, { next: "pop"
defaultToken: "string" }, {
}] include: "escapes"
}, { }, {
token : "string.start", token: "constant.language.escape",
regex : '"', regex: /\\$/,
push : [{ consumeLineEnd: true
token : "string.end", }, {
regex : '"|$', defaultToken: "string"
next: "pop" }]
}, { }],
include : "escapes"
}, {
token : "constant.language.escape",
regex : /\\$/,
consumeLineEnd: true
}, {
defaultToken: "string"
}]
}],
escapes: [{ escapes: [{
token : "constant.language.escape", token: "constant.language.escape",
regex : /\\([a-fA-F\d]{1,6}|[^a-fA-F\d])/ regex: /\\([a-fA-F\d]{1,6}|[^a-fA-F\d])/
}] }]
}; };
this.normalizeRules(); this.normalizeRules();
}; };
oop.inherits(CssHighlightRules, TextHighlightRules); oop.inherits(CssHighlightRules, TextHighlightRules);
exports.CssHighlightRules = CssHighlightRules; exports.CssHighlightRules = CssHighlightRules;
}); });
define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module){"use strict";
"use strict";
var Range = require("../range").Range; var Range = require("../range").Range;
var MatchingBraceOutdent = function () { };
var MatchingBraceOutdent = function() {}; (function () {
this.checkOutdent = function (line, input) {
(function() { if (!/^\s+$/.test(line))
this.checkOutdent = function(line, input) {
if (! /^\s+$/.test(line))
return false; return false;
return /^\s*\}/.test(input); return /^\s*\}/.test(input);
}; };
this.autoOutdent = function (doc, row) {
this.autoOutdent = function(doc, row) {
var line = doc.getLine(row); var line = doc.getLine(row);
var match = line.match(/^(\s*\})/); var match = line.match(/^(\s*\})/);
if (!match)
if (!match) return 0; return 0;
var column = match[1].length; var column = match[1].length;
var openBracePos = doc.findMatchingBracket({row: row, column: column}); var openBracePos = doc.findMatchingBracket({ row: row, column: column });
if (!openBracePos || openBracePos.row == row)
if (!openBracePos || openBracePos.row == row) return 0; return 0;
var indent = this.$getIndent(doc.getLine(openBracePos.row)); var indent = this.$getIndent(doc.getLine(openBracePos.row));
doc.replace(new Range(row, 0, row, column-1), indent); doc.replace(new Range(row, 0, row, column - 1), indent);
}; };
this.$getIndent = function (line) {
this.$getIndent = function(line) {
return line.match(/^\s*/)[0]; return line.match(/^\s*/)[0];
}; };
}).call(MatchingBraceOutdent.prototype); }).call(MatchingBraceOutdent.prototype);
exports.MatchingBraceOutdent = MatchingBraceOutdent; exports.MatchingBraceOutdent = MatchingBraceOutdent;
}); });
define("ace/mode/css_completions",["require","exports","module"], function(require, exports, module) { define("ace/mode/css_completions",["require","exports","module"], function(require, exports, module){"use strict";
"use strict";
var propertyMap = { var propertyMap = {
"background": {"#$0": 1}, "background": { "#$0": 1 },
"background-color": {"#$0": 1, "transparent": 1, "fixed": 1}, "background-color": { "#$0": 1, "transparent": 1, "fixed": 1 },
"background-image": {"url('/$0')": 1}, "background-image": { "url('/$0')": 1 },
"background-repeat": {"repeat": 1, "repeat-x": 1, "repeat-y": 1, "no-repeat": 1, "inherit": 1}, "background-repeat": { "repeat": 1, "repeat-x": 1, "repeat-y": 1, "no-repeat": 1, "inherit": 1 },
"background-position": {"bottom":2, "center":2, "left":2, "right":2, "top":2, "inherit":2}, "background-position": { "bottom": 2, "center": 2, "left": 2, "right": 2, "top": 2, "inherit": 2 },
"background-attachment": {"scroll": 1, "fixed": 1}, "background-attachment": { "scroll": 1, "fixed": 1 },
"background-size": {"cover": 1, "contain": 1}, "background-size": { "cover": 1, "contain": 1 },
"background-clip": {"border-box": 1, "padding-box": 1, "content-box": 1}, "background-clip": { "border-box": 1, "padding-box": 1, "content-box": 1 },
"background-origin": {"border-box": 1, "padding-box": 1, "content-box": 1}, "background-origin": { "border-box": 1, "padding-box": 1, "content-box": 1 },
"border": {"solid $0": 1, "dashed $0": 1, "dotted $0": 1, "#$0": 1}, "border": { "solid $0": 1, "dashed $0": 1, "dotted $0": 1, "#$0": 1 },
"border-color": {"#$0": 1}, "border-color": { "#$0": 1 },
"border-style": {"solid":2, "dashed":2, "dotted":2, "double":2, "groove":2, "hidden":2, "inherit":2, "inset":2, "none":2, "outset":2, "ridged":2}, "border-style": { "solid": 2, "dashed": 2, "dotted": 2, "double": 2, "groove": 2, "hidden": 2, "inherit": 2, "inset": 2, "none": 2, "outset": 2, "ridged": 2 },
"border-collapse": {"collapse": 1, "separate": 1}, "border-collapse": { "collapse": 1, "separate": 1 },
"bottom": {"px": 1, "em": 1, "%": 1}, "bottom": { "px": 1, "em": 1, "%": 1 },
"clear": {"left": 1, "right": 1, "both": 1, "none": 1}, "clear": { "left": 1, "right": 1, "both": 1, "none": 1 },
"color": {"#$0": 1, "rgb(#$00,0,0)": 1}, "color": { "#$0": 1, "rgb(#$00,0,0)": 1 },
"cursor": {"default": 1, "pointer": 1, "move": 1, "text": 1, "wait": 1, "help": 1, "progress": 1, "n-resize": 1, "ne-resize": 1, "e-resize": 1, "se-resize": 1, "s-resize": 1, "sw-resize": 1, "w-resize": 1, "nw-resize": 1}, "cursor": { "default": 1, "pointer": 1, "move": 1, "text": 1, "wait": 1, "help": 1, "progress": 1, "n-resize": 1, "ne-resize": 1, "e-resize": 1, "se-resize": 1, "s-resize": 1, "sw-resize": 1, "w-resize": 1, "nw-resize": 1 },
"display": {"none": 1, "block": 1, "inline": 1, "inline-block": 1, "table-cell": 1}, "display": { "none": 1, "block": 1, "inline": 1, "inline-block": 1, "table-cell": 1 },
"empty-cells": {"show": 1, "hide": 1}, "empty-cells": { "show": 1, "hide": 1 },
"float": {"left": 1, "right": 1, "none": 1}, "float": { "left": 1, "right": 1, "none": 1 },
"font-family": {"Arial":2,"Comic Sans MS":2,"Consolas":2,"Courier New":2,"Courier":2,"Georgia":2,"Monospace":2,"Sans-Serif":2, "Segoe UI":2,"Tahoma":2,"Times New Roman":2,"Trebuchet MS":2,"Verdana": 1}, "font-family": { "Arial": 2, "Comic Sans MS": 2, "Consolas": 2, "Courier New": 2, "Courier": 2, "Georgia": 2, "Monospace": 2, "Sans-Serif": 2, "Segoe UI": 2, "Tahoma": 2, "Times New Roman": 2, "Trebuchet MS": 2, "Verdana": 1 },
"font-size": {"px": 1, "em": 1, "%": 1}, "font-size": { "px": 1, "em": 1, "%": 1 },
"font-weight": {"bold": 1, "normal": 1}, "font-weight": { "bold": 1, "normal": 1 },
"font-style": {"italic": 1, "normal": 1}, "font-style": { "italic": 1, "normal": 1 },
"font-variant": {"normal": 1, "small-caps": 1}, "font-variant": { "normal": 1, "small-caps": 1 },
"height": {"px": 1, "em": 1, "%": 1}, "height": { "px": 1, "em": 1, "%": 1 },
"left": {"px": 1, "em": 1, "%": 1}, "left": { "px": 1, "em": 1, "%": 1 },
"letter-spacing": {"normal": 1}, "letter-spacing": { "normal": 1 },
"line-height": {"normal": 1}, "line-height": { "normal": 1 },
"list-style-type": {"none": 1, "disc": 1, "circle": 1, "square": 1, "decimal": 1, "decimal-leading-zero": 1, "lower-roman": 1, "upper-roman": 1, "lower-greek": 1, "lower-latin": 1, "upper-latin": 1, "georgian": 1, "lower-alpha": 1, "upper-alpha": 1}, "list-style-type": { "none": 1, "disc": 1, "circle": 1, "square": 1, "decimal": 1, "decimal-leading-zero": 1, "lower-roman": 1, "upper-roman": 1, "lower-greek": 1, "lower-latin": 1, "upper-latin": 1, "georgian": 1, "lower-alpha": 1, "upper-alpha": 1 },
"margin": {"px": 1, "em": 1, "%": 1}, "margin": { "px": 1, "em": 1, "%": 1 },
"margin-right": {"px": 1, "em": 1, "%": 1}, "margin-right": { "px": 1, "em": 1, "%": 1 },
"margin-left": {"px": 1, "em": 1, "%": 1}, "margin-left": { "px": 1, "em": 1, "%": 1 },
"margin-top": {"px": 1, "em": 1, "%": 1}, "margin-top": { "px": 1, "em": 1, "%": 1 },
"margin-bottom": {"px": 1, "em": 1, "%": 1}, "margin-bottom": { "px": 1, "em": 1, "%": 1 },
"max-height": {"px": 1, "em": 1, "%": 1}, "max-height": { "px": 1, "em": 1, "%": 1 },
"max-width": {"px": 1, "em": 1, "%": 1}, "max-width": { "px": 1, "em": 1, "%": 1 },
"min-height": {"px": 1, "em": 1, "%": 1}, "min-height": { "px": 1, "em": 1, "%": 1 },
"min-width": {"px": 1, "em": 1, "%": 1}, "min-width": { "px": 1, "em": 1, "%": 1 },
"overflow": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1}, "overflow": { "hidden": 1, "visible": 1, "auto": 1, "scroll": 1 },
"overflow-x": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1}, "overflow-x": { "hidden": 1, "visible": 1, "auto": 1, "scroll": 1 },
"overflow-y": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1}, "overflow-y": { "hidden": 1, "visible": 1, "auto": 1, "scroll": 1 },
"padding": {"px": 1, "em": 1, "%": 1}, "padding": { "px": 1, "em": 1, "%": 1 },
"padding-top": {"px": 1, "em": 1, "%": 1}, "padding-top": { "px": 1, "em": 1, "%": 1 },
"padding-right": {"px": 1, "em": 1, "%": 1}, "padding-right": { "px": 1, "em": 1, "%": 1 },
"padding-bottom": {"px": 1, "em": 1, "%": 1}, "padding-bottom": { "px": 1, "em": 1, "%": 1 },
"padding-left": {"px": 1, "em": 1, "%": 1}, "padding-left": { "px": 1, "em": 1, "%": 1 },
"page-break-after": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1}, "page-break-after": { "auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1 },
"page-break-before": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1}, "page-break-before": { "auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1 },
"position": {"absolute": 1, "relative": 1, "fixed": 1, "static": 1}, "position": { "absolute": 1, "relative": 1, "fixed": 1, "static": 1 },
"right": {"px": 1, "em": 1, "%": 1}, "right": { "px": 1, "em": 1, "%": 1 },
"table-layout": {"fixed": 1, "auto": 1}, "table-layout": { "fixed": 1, "auto": 1 },
"text-decoration": {"none": 1, "underline": 1, "line-through": 1, "blink": 1}, "text-decoration": { "none": 1, "underline": 1, "line-through": 1, "blink": 1 },
"text-align": {"left": 1, "right": 1, "center": 1, "justify": 1}, "text-align": { "left": 1, "right": 1, "center": 1, "justify": 1 },
"text-transform": {"capitalize": 1, "uppercase": 1, "lowercase": 1, "none": 1}, "text-transform": { "capitalize": 1, "uppercase": 1, "lowercase": 1, "none": 1 },
"top": {"px": 1, "em": 1, "%": 1}, "top": { "px": 1, "em": 1, "%": 1 },
"vertical-align": {"top": 1, "bottom": 1}, "vertical-align": { "top": 1, "bottom": 1 },
"visibility": {"hidden": 1, "visible": 1}, "visibility": { "hidden": 1, "visible": 1 },
"white-space": {"nowrap": 1, "normal": 1, "pre": 1, "pre-line": 1, "pre-wrap": 1}, "white-space": { "nowrap": 1, "normal": 1, "pre": 1, "pre-line": 1, "pre-wrap": 1 },
"width": {"px": 1, "em": 1, "%": 1}, "width": { "px": 1, "em": 1, "%": 1 },
"word-spacing": {"normal": 1}, "word-spacing": { "normal": 1 },
"filter": {"alpha(opacity=$0100)": 1}, "filter": { "alpha(opacity=$0100)": 1 },
"text-shadow": { "$02px 2px 2px #777": 1 },
"text-shadow": {"$02px 2px 2px #777": 1}, "text-overflow": { "ellipsis-word": 1, "clip": 1, "ellipsis": 1 },
"text-overflow": {"ellipsis-word": 1, "clip": 1, "ellipsis": 1},
"-moz-border-radius": 1, "-moz-border-radius": 1,
"-moz-border-radius-topright": 1, "-moz-border-radius-topright": 1,
"-moz-border-radius-bottomright": 1, "-moz-border-radius-bottomright": 1,
@ -311,113 +285,93 @@ var propertyMap = {
"-webkit-border-bottom-left-radius": 1, "-webkit-border-bottom-left-radius": 1,
"-moz-box-shadow": 1, "-moz-box-shadow": 1,
"-webkit-box-shadow": 1, "-webkit-box-shadow": 1,
"transform": {"rotate($00deg)": 1, "skew($00deg)": 1}, "transform": { "rotate($00deg)": 1, "skew($00deg)": 1 },
"-moz-transform": {"rotate($00deg)": 1, "skew($00deg)": 1}, "-moz-transform": { "rotate($00deg)": 1, "skew($00deg)": 1 },
"-webkit-transform": {"rotate($00deg)": 1, "skew($00deg)": 1 } "-webkit-transform": { "rotate($00deg)": 1, "skew($00deg)": 1 }
}; };
var CssCompletions = function () {
var CssCompletions = function() {
}; };
(function () {
(function() {
this.completionsDefined = false; this.completionsDefined = false;
this.defineCompletions = function () {
this.defineCompletions = function() {
if (document) { if (document) {
var style = document.createElement('c').style; var style = document.createElement('c').style;
for (var i in style) { for (var i in style) {
if (typeof style[i] !== 'string') if (typeof style[i] !== 'string')
continue; continue;
var name = i.replace(/[A-Z]/g, function (x) {
var name = i.replace(/[A-Z]/g, function(x) {
return '-' + x.toLowerCase(); return '-' + x.toLowerCase();
}); });
if (!propertyMap.hasOwnProperty(name)) if (!propertyMap.hasOwnProperty(name))
propertyMap[name] = 1; propertyMap[name] = 1;
} }
} }
this.completionsDefined = true; this.completionsDefined = true;
}; };
this.getCompletions = function (state, session, pos, prefix) {
this.getCompletions = function(state, session, pos, prefix) {
if (!this.completionsDefined) { if (!this.completionsDefined) {
this.defineCompletions(); this.defineCompletions();
} }
if (state === 'ruleset' || session.$mode.$id == "ace/mode/scss") {
var token = session.getTokenAt(pos.row, pos.column);
if (!token)
return [];
if (state==='ruleset'){
var line = session.getLine(pos.row).substr(0, pos.column); var line = session.getLine(pos.row).substr(0, pos.column);
var inParens = /\([^)]*$/.test(line);
if (inParens) {
line = line.substr(line.lastIndexOf('(') + 1);
}
if (/:[^;]+$/.test(line)) { if (/:[^;]+$/.test(line)) {
/([\w\-]+):[^:]*$/.test(line); /([\w\-]+):[^:]*$/.test(line);
return this.getPropertyValueCompletions(state, session, pos, prefix); return this.getPropertyValueCompletions(state, session, pos, prefix);
} else { }
return this.getPropertyCompletions(state, session, pos, prefix); else {
return this.getPropertyCompletions(state, session, pos, prefix, inParens);
} }
} }
return []; return [];
}; };
this.getPropertyCompletions = function (state, session, pos, prefix, skipSemicolon) {
this.getPropertyCompletions = function(state, session, pos, prefix) { skipSemicolon = skipSemicolon || false;
var properties = Object.keys(propertyMap); var properties = Object.keys(propertyMap);
return properties.map(function(property){ return properties.map(function (property) {
return { return {
caption: property, caption: property,
snippet: property + ': $0;', snippet: property + ': $0' + (skipSemicolon ? '' : ';'),
meta: "property", meta: "property",
score: Number.MAX_VALUE score: 1000000
}; };
}); });
}; };
this.getPropertyValueCompletions = function (state, session, pos, prefix) {
this.getPropertyValueCompletions = function(state, session, pos, prefix) {
var line = session.getLine(pos.row).substr(0, pos.column); var line = session.getLine(pos.row).substr(0, pos.column);
var property = (/([\w\-]+):[^:]*$/.exec(line) || {})[1]; var property = (/([\w\-]+):[^:]*$/.exec(line) || {})[1];
if (!property) if (!property)
return []; return [];
var values = []; var values = [];
if (property in propertyMap && typeof propertyMap[property] === "object") { if (property in propertyMap && typeof propertyMap[property] === "object") {
values = Object.keys(propertyMap[property]); values = Object.keys(propertyMap[property]);
} }
return values.map(function(value){ return values.map(function (value) {
return { return {
caption: value, caption: value,
snippet: value, snippet: value,
meta: "property value", meta: "property value",
score: Number.MAX_VALUE score: 1000000
}; };
}); });
}; };
}).call(CssCompletions.prototype); }).call(CssCompletions.prototype);
exports.CssCompletions = CssCompletions; exports.CssCompletions = CssCompletions;
}); });
define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"], function(require, exports, module) { define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../../lib/oop"); var oop = require("../../lib/oop");
var Behaviour = require("../behaviour").Behaviour; var Behaviour = require("../behaviour").Behaviour;
var CstyleBehaviour = require("./cstyle").CstyleBehaviour; var CstyleBehaviour = require("./cstyle").CstyleBehaviour;
var TokenIterator = require("../../token_iterator").TokenIterator; var TokenIterator = require("../../token_iterator").TokenIterator;
var CssBehaviour = function () { var CssBehaviour = function () {
this.inherit(CstyleBehaviour); this.inherit(CstyleBehaviour);
this.add("colon", "insertion", function (state, action, editor, session, text) { this.add("colon", "insertion", function (state, action, editor, session, text) {
if (text === ':') { if (text === ':' && editor.selection.isEmpty()) {
var cursor = editor.getCursorPosition(); var cursor = editor.getCursorPosition();
var iterator = new TokenIterator(session, cursor.row, cursor.column); var iterator = new TokenIterator(session, cursor.row, cursor.column);
var token = iterator.getCurrentToken(); var token = iterator.getCurrentToken();
@ -429,20 +383,19 @@ var CssBehaviour = function () {
var rightChar = line.substring(cursor.column, cursor.column + 1); var rightChar = line.substring(cursor.column, cursor.column + 1);
if (rightChar === ':') { if (rightChar === ':') {
return { return {
text: '', text: '',
selection: [1, 1] selection: [1, 1]
}; };
} }
if (!line.substring(cursor.column).match(/^\s*;/)) { if (/^(\s+[^;]|\s*$)/.test(line.substring(cursor.column))) {
return { return {
text: ':;', text: ':;',
selection: [1, 1] selection: [1, 1]
}; };
} }
} }
} }
}); });
this.add("colon", "deletion", function (state, action, editor, session, range) { this.add("colon", "deletion", function (state, action, editor, session, range) {
var selected = session.doc.getTextRange(range); var selected = session.doc.getTextRange(range);
if (!range.isMultiLine() && selected === ':') { if (!range.isMultiLine() && selected === ':') {
@ -456,116 +409,102 @@ var CssBehaviour = function () {
var line = session.doc.getLine(range.start.row); var line = session.doc.getLine(range.start.row);
var rightChar = line.substring(range.end.column, range.end.column + 1); var rightChar = line.substring(range.end.column, range.end.column + 1);
if (rightChar === ';') { if (rightChar === ';') {
range.end.column ++; range.end.column++;
return range; return range;
} }
} }
} }
}); });
this.add("semicolon", "insertion", function (state, action, editor, session, text) { this.add("semicolon", "insertion", function (state, action, editor, session, text) {
if (text === ';') { if (text === ';' && editor.selection.isEmpty()) {
var cursor = editor.getCursorPosition(); var cursor = editor.getCursorPosition();
var line = session.doc.getLine(cursor.row); var line = session.doc.getLine(cursor.row);
var rightChar = line.substring(cursor.column, cursor.column + 1); var rightChar = line.substring(cursor.column, cursor.column + 1);
if (rightChar === ';') { if (rightChar === ';') {
return { return {
text: '', text: '',
selection: [1, 1] selection: [1, 1]
};
}
}
});
this.add("!important", "insertion", function (state, action, editor, session, text) {
if (text === '!' && editor.selection.isEmpty()) {
var cursor = editor.getCursorPosition();
var line = session.doc.getLine(cursor.row);
if (/^\s*(;|}|$)/.test(line.substring(cursor.column))) {
return {
text: '!important',
selection: [10, 10]
}; };
} }
} }
}); });
}; };
oop.inherits(CssBehaviour, CstyleBehaviour); oop.inherits(CssBehaviour, CstyleBehaviour);
exports.CssBehaviour = CssBehaviour; exports.CssBehaviour = CssBehaviour;
}); });
define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../../lib/oop"); var oop = require("../../lib/oop");
var Range = require("../../range").Range; var Range = require("../../range").Range;
var BaseFoldMode = require("./fold_mode").FoldMode; var BaseFoldMode = require("./fold_mode").FoldMode;
var FoldMode = exports.FoldMode = function (commentRegex) {
var FoldMode = exports.FoldMode = function(commentRegex) {
if (commentRegex) { if (commentRegex) {
this.foldingStartMarker = new RegExp( this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
);
this.foldingStopMarker = new RegExp(
this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
);
} }
}; };
oop.inherits(FoldMode, BaseFoldMode); oop.inherits(FoldMode, BaseFoldMode);
(function () {
(function() {
this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/; this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/; this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
this._getFoldWidgetBase = this.getFoldWidget; this._getFoldWidgetBase = this.getFoldWidget;
this.getFoldWidget = function(session, foldStyle, row) { this.getFoldWidget = function (session, foldStyle, row) {
var line = session.getLine(row); var line = session.getLine(row);
if (this.singleLineBlockCommentRe.test(line)) { if (this.singleLineBlockCommentRe.test(line)) {
if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
return ""; return "";
} }
var fw = this._getFoldWidgetBase(session, foldStyle, row); var fw = this._getFoldWidgetBase(session, foldStyle, row);
if (!fw && this.startRegionRe.test(line)) if (!fw && this.startRegionRe.test(line))
return "start"; // lineCommentRegionStart return "start"; // lineCommentRegionStart
return fw; return fw;
}; };
this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
var line = session.getLine(row); var line = session.getLine(row);
if (this.startRegionRe.test(line)) if (this.startRegionRe.test(line))
return this.getCommentRegionBlock(session, line, row); return this.getCommentRegionBlock(session, line, row);
var match = line.match(this.foldingStartMarker); var match = line.match(this.foldingStartMarker);
if (match) { if (match) {
var i = match.index; var i = match.index;
if (match[1]) if (match[1])
return this.openingBracketBlock(session, match[1], row, i); return this.openingBracketBlock(session, match[1], row, i);
var range = session.getCommentFoldRange(row, i + match[0].length, 1); var range = session.getCommentFoldRange(row, i + match[0].length, 1);
if (range && !range.isMultiLine()) { if (range && !range.isMultiLine()) {
if (forceMultiline) { if (forceMultiline) {
range = this.getSectionRange(session, row); range = this.getSectionRange(session, row);
} else if (foldStyle != "all") }
else if (foldStyle != "all")
range = null; range = null;
} }
return range; return range;
} }
if (foldStyle === "markbegin") if (foldStyle === "markbegin")
return; return;
var match = line.match(this.foldingStopMarker); var match = line.match(this.foldingStopMarker);
if (match) { if (match) {
var i = match.index + match[0].length; var i = match.index + match[0].length;
if (match[1]) if (match[1])
return this.closingBracketBlock(session, match[1], row, i); return this.closingBracketBlock(session, match[1], row, i);
return session.getCommentFoldRange(row, i, -1); return session.getCommentFoldRange(row, i, -1);
} }
}; };
this.getSectionRange = function (session, row) {
this.getSectionRange = function(session, row) {
var line = session.getLine(row); var line = session.getLine(row);
var startIndent = line.search(/\S/); var startIndent = line.search(/\S/);
var startRow = row; var startRow = row;
@ -578,54 +517,52 @@ oop.inherits(FoldMode, BaseFoldMode);
var indent = line.search(/\S/); var indent = line.search(/\S/);
if (indent === -1) if (indent === -1)
continue; continue;
if (startIndent > indent) if (startIndent > indent)
break; break;
var subRange = this.getFoldWidgetRange(session, "all", row); var subRange = this.getFoldWidgetRange(session, "all", row);
if (subRange) { if (subRange) {
if (subRange.start.row <= startRow) { if (subRange.start.row <= startRow) {
break; break;
} else if (subRange.isMultiLine()) { }
else if (subRange.isMultiLine()) {
row = subRange.end.row; row = subRange.end.row;
} else if (startIndent == indent) { }
else if (startIndent == indent) {
break; break;
} }
} }
endRow = row; endRow = row;
} }
return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
}; };
this.getCommentRegionBlock = function(session, line, row) { this.getCommentRegionBlock = function (session, line, row) {
var startColumn = line.search(/\s*$/); var startColumn = line.search(/\s*$/);
var maxRow = session.getLength(); var maxRow = session.getLength();
var startRow = row; var startRow = row;
var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
var depth = 1; var depth = 1;
while (++row < maxRow) { while (++row < maxRow) {
line = session.getLine(row); line = session.getLine(row);
var m = re.exec(line); var m = re.exec(line);
if (!m) continue; if (!m)
if (m[1]) depth--; continue;
else depth++; if (m[1])
depth--;
if (!depth) break; else
depth++;
if (!depth)
break;
} }
var endRow = row; var endRow = row;
if (endRow > startRow) { if (endRow > startRow) {
return new Range(startRow, startColumn, endRow, line.length); return new Range(startRow, startColumn, endRow, line.length);
} }
}; };
}).call(FoldMode.prototype); }).call(FoldMode.prototype);
}); });
define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/css_completions","ace/mode/behaviour/css","ace/mode/folding/cstyle"], function(require, exports, module) { define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/css_completions","ace/mode/behaviour/css","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextMode = require("./text").Mode; var TextMode = require("./text").Mode;
var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
@ -634,8 +571,7 @@ var WorkerClient = require("../worker/worker_client").WorkerClient;
var CssCompletions = require("./css_completions").CssCompletions; var CssCompletions = require("./css_completions").CssCompletions;
var CssBehaviour = require("./behaviour/css").CssBehaviour; var CssBehaviour = require("./behaviour/css").CssBehaviour;
var CStyleFoldMode = require("./folding/cstyle").FoldMode; var CStyleFoldMode = require("./folding/cstyle").FoldMode;
var Mode = function () {
var Mode = function() {
this.HighlightRules = CssHighlightRules; this.HighlightRules = CssHighlightRules;
this.$outdent = new MatchingBraceOutdent(); this.$outdent = new MatchingBraceOutdent();
this.$behaviour = new CssBehaviour(); this.$behaviour = new CssBehaviour();
@ -643,57 +579,51 @@ var Mode = function() {
this.foldingRules = new CStyleFoldMode(); this.foldingRules = new CStyleFoldMode();
}; };
oop.inherits(Mode, TextMode); oop.inherits(Mode, TextMode);
(function () {
(function() {
this.foldingRules = "cStyle"; this.foldingRules = "cStyle";
this.blockComment = {start: "/*", end: "*/"}; this.blockComment = { start: "/*", end: "*/" };
this.getNextLineIndent = function (state, line, tab) {
this.getNextLineIndent = function(state, line, tab) {
var indent = this.$getIndent(line); var indent = this.$getIndent(line);
var tokens = this.getTokenizer().getLineTokens(line, state).tokens; var tokens = this.getTokenizer().getLineTokens(line, state).tokens;
if (tokens.length && tokens[tokens.length-1].type == "comment") { if (tokens.length && tokens[tokens.length - 1].type == "comment") {
return indent; return indent;
} }
var match = line.match(/^.*\{\s*$/); var match = line.match(/^.*\{\s*$/);
if (match) { if (match) {
indent += tab; indent += tab;
} }
return indent; return indent;
}; };
this.checkOutdent = function (state, line, input) {
this.checkOutdent = function(state, line, input) {
return this.$outdent.checkOutdent(line, input); return this.$outdent.checkOutdent(line, input);
}; };
this.autoOutdent = function (state, doc, row) {
this.autoOutdent = function(state, doc, row) {
this.$outdent.autoOutdent(doc, row); this.$outdent.autoOutdent(doc, row);
}; };
this.getCompletions = function (state, session, pos, prefix) {
this.getCompletions = function(state, session, pos, prefix) {
return this.$completer.getCompletions(state, session, pos, prefix); return this.$completer.getCompletions(state, session, pos, prefix);
}; };
this.createWorker = function (session) {
this.createWorker = function(session) {
var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker"); var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker");
worker.attachToDocument(session.getDocument()); worker.attachToDocument(session.getDocument());
worker.on("annotate", function (e) {
worker.on("annotate", function(e) {
session.setAnnotations(e.data); session.setAnnotations(e.data);
}); });
worker.on("terminate", function () {
worker.on("terminate", function() {
session.clearAnnotations(); session.clearAnnotations();
}); });
return worker; return worker;
}; };
this.$id = "ace/mode/css"; this.$id = "ace/mode/css";
this.snippetFileId = "ace/snippets/css";
}).call(Mode.prototype); }).call(Mode.prototype);
exports.Mode = Mode; exports.Mode = Mode;
}); }); (function() {
window.require(["ace/mode/css"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,56 @@
define("ace/mode/cuttlefish_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var CuttlefishHighlightRules = function () {
this.$rules = {
start: [{
token: ['text', 'comment'],
regex: /^([ \t]*)(#.*)$/
}, {
token: ['text', 'keyword', 'text', 'string', 'text', 'comment'],
regex: /^([ \t]*)(include)([ \t]*)([A-Za-z0-9-\_\.\*\/]+)([ \t]*)(#.*)?$/
}, {
token: ['text', 'keyword', 'text', 'operator', 'text', 'string', 'text', 'comment'],
regex: /^([ \t]*)([A-Za-z0-9-_]+(?:\.[A-Za-z0-9-_]+)*)([ \t]*)(=)([ \t]*)([^ \t#][^#]*?)([ \t]*)(#.*)?$/
}, {
defaultToken: 'invalid'
}]
};
this.normalizeRules();
};
CuttlefishHighlightRules.metaData = {
fileTypes: ['conf'],
keyEquivalent: '^~C',
name: 'Cuttlefish',
scopeName: 'source.conf'
};
oop.inherits(CuttlefishHighlightRules, TextHighlightRules);
exports.CuttlefishHighlightRules = CuttlefishHighlightRules;
});
define("ace/mode/cuttlefish",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/cuttlefish_highlight_rules"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var CuttlefishHighlightRules = require("./cuttlefish_highlight_rules").CuttlefishHighlightRules;
var Mode = function () {
this.HighlightRules = CuttlefishHighlightRules;
this.foldingRules = null;
this.$behaviour = this.$defaultBehaviour;
};
oop.inherits(Mode, TextMode);
(function () {
this.lineCommentStart = "#";
this.blockComment = null;
this.$id = "ace/mode/cuttlefish";
}).call(Mode.prototype);
exports.Mode = Mode;
}); (function() {
window.require(["ace/mode/cuttlefish"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

View File

@ -1,262 +1,222 @@
define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var DocCommentHighlightRules = function () {
var DocCommentHighlightRules = function() {
this.$rules = { this.$rules = {
"start" : [ { "start": [
token : "comment.doc.tag", {
regex : "@[\\w\\d_]+" // TODO: fix email addresses token: "comment.doc.tag",
}, regex: "@\\w+(?=\\s|$)"
DocCommentHighlightRules.getTagRule(), }, DocCommentHighlightRules.getTagRule(), {
{ defaultToken: "comment.doc",
defaultToken : "comment.doc", caseInsensitive: true
caseInsensitive: true }
}] ]
}; };
}; };
oop.inherits(DocCommentHighlightRules, TextHighlightRules); oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getTagRule = function (start) {
DocCommentHighlightRules.getTagRule = function(start) {
return { return {
token : "comment.doc.tag.storage.type", token: "comment.doc.tag.storage.type",
regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" regex: "\\b(?:TODO|FIXME|XXX|HACK)\\b"
}; };
}; };
DocCommentHighlightRules.getStartRule = function (start) {
DocCommentHighlightRules.getStartRule = function(start) {
return { return {
token : "comment.doc", // doc comment token: "comment.doc", // doc comment
regex : "\\/\\*(?=\\*)", regex: "\\/\\*(?=\\*)",
next : start next: start
}; };
}; };
DocCommentHighlightRules.getEndRule = function (start) { DocCommentHighlightRules.getEndRule = function (start) {
return { return {
token : "comment.doc", // closing comment token: "comment.doc", // closing comment
regex : "\\*\\/", regex: "\\*\\/",
next : start next: start
}; };
}; };
exports.DocCommentHighlightRules = DocCommentHighlightRules; exports.DocCommentHighlightRules = DocCommentHighlightRules;
}); });
define("ace/mode/d_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { define("ace/mode/d_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var DHighlightRules = function () {
var DHighlightRules = function() { var keywords = ("this|super|import|module|body|mixin|__traits|invariant|alias|asm|delete|" +
"typeof|typeid|sizeof|cast|new|in|is|typedef|__vector|__parameters");
var keywords = ( var keywordControls = ("break|case|continue|default|do|else|for|foreach|foreach_reverse|goto|if|" +
"this|super|import|module|body|mixin|__traits|invariant|alias|asm|delete|"+ "return|switch|while|catch|try|throw|finally|version|assert|unittest|with");
"typeof|typeid|sizeof|cast|new|in|is|typedef|__vector|__parameters" var types = ("auto|bool|char|dchar|wchar|byte|ubyte|float|double|real|" +
);
var keywordControls = (
"break|case|continue|default|do|else|for|foreach|foreach_reverse|goto|if|" +
"return|switch|while|catch|try|throw|finally|version|assert|unittest|with"
);
var types = (
"auto|bool|char|dchar|wchar|byte|ubyte|float|double|real|" +
"cfloat|creal|cdouble|cent|ifloat|ireal|idouble|" + "cfloat|creal|cdouble|cent|ifloat|ireal|idouble|" +
"int|long|short|void|uint|ulong|ushort|ucent|" + "int|long|short|void|uint|ulong|ushort|ucent|" +
"function|delegate|string|wstring|dstring|size_t|ptrdiff_t|hash_t|Object" "function|delegate|string|wstring|dstring|size_t|ptrdiff_t|hash_t|Object");
); var modifiers = ("abstract|align|debug|deprecated|export|extern|const|final|in|inout|out|" +
var modifiers = (
"abstract|align|debug|deprecated|export|extern|const|final|in|inout|out|" +
"ref|immutable|lazy|nothrow|override|package|pragma|private|protected|" + "ref|immutable|lazy|nothrow|override|package|pragma|private|protected|" +
"public|pure|scope|shared|__gshared|synchronized|static|volatile" "public|pure|scope|shared|__gshared|synchronized|static|volatile");
); var storages = ("class|struct|union|template|interface|enum|macro");
var stringEscapesSeq = {
var storages = (
"class|struct|union|template|interface|enum|macro"
);
var stringEscapesSeq = {
token: "constant.language.escape", token: "constant.language.escape",
regex: "\\\\(?:(?:x[0-9A-F]{2})|(?:[0-7]{1,3})|(?:['\"\\?0abfnrtv\\\\])|" + regex: "\\\\(?:(?:x[0-9A-F]{2})|(?:[0-7]{1,3})|(?:['\"\\?0abfnrtv\\\\])|" +
"(?:u[0-9a-fA-F]{4})|(?:U[0-9a-fA-F]{8}))" "(?:u[0-9a-fA-F]{4})|(?:U[0-9a-fA-F]{8}))"
}; };
var builtinConstants = ("null|true|false|" +
var builtinConstants = ( "__DATE__|__EOF__|__TIME__|__TIMESTAMP__|__VENDOR__|__VERSION__|" +
"null|true|false|"+ "__FILE__|__MODULE__|__LINE__|__FUNCTION__|__PRETTY_FUNCTION__");
"__DATE__|__EOF__|__TIME__|__TIMESTAMP__|__VENDOR__|__VERSION__|"+ var operators = ("/|/\\=|&|&\\=|&&|\\|\\|\\=|\\|\\||\\-|\\-\\=|\\-\\-|\\+|" +
"__FILE__|__MODULE__|__LINE__|__FUNCTION__|__PRETTY_FUNCTION__"
);
var operators = (
"/|/\\=|&|&\\=|&&|\\|\\|\\=|\\|\\||\\-|\\-\\=|\\-\\-|\\+|" +
"\\+\\=|\\+\\+|\\<|\\<\\=|\\<\\<|\\<\\<\\=|\\<\\>|\\<\\>\\=|\\>|\\>\\=|\\>\\>\\=|" + "\\+\\=|\\+\\+|\\<|\\<\\=|\\<\\<|\\<\\<\\=|\\<\\>|\\<\\>\\=|\\>|\\>\\=|\\>\\>\\=|" +
"\\>\\>\\>\\=|\\>\\>|\\>\\>\\>|\\!|\\!\\=|\\!\\<\\>|\\!\\<\\>\\=|\\!\\<|\\!\\<\\=|" + "\\>\\>\\>\\=|\\>\\>|\\>\\>\\>|\\!|\\!\\=|\\!\\<\\>|\\!\\<\\>\\=|\\!\\<|\\!\\<\\=|" +
"\\!\\>|\\!\\>\\=|\\?|\\$|\\=|\\=\\=|\\*|\\*\\=|%|%\\=|" + "\\!\\>|\\!\\>\\=|\\?|\\$|\\=|\\=\\=|\\*|\\*\\=|%|%\\=|" +
"\\^|\\^\\=|\\^\\^|\\^\\^\\=|~|~\\=|\\=\\>|#" "\\^|\\^\\=|\\^\\^|\\^\\^\\=|~|~\\=|\\=\\>|#");
);
var keywordMapper = this.$keywords = this.createKeywordMapper({ var keywordMapper = this.$keywords = this.createKeywordMapper({
"keyword.modifier" : modifiers, "keyword.modifier": modifiers,
"keyword.control" : keywordControls, "keyword.control": keywordControls,
"keyword.type" : types, "keyword.type": types,
"keyword": keywords, "keyword": keywords,
"keyword.storage": storages, "keyword.storage": storages,
"punctation": "\\.|\\,|;|\\.\\.|\\.\\.\\.", "punctation": "\\.|\\,|;|\\.\\.|\\.\\.\\.",
"keyword.operator" : operators, "keyword.operator": operators,
"constant.language": builtinConstants "constant.language": builtinConstants
}, "identifier"); }, "identifier");
var identifierRe = "[a-zA-Z_\u00a1-\uffff][a-zA-Z\\d_\u00a1-\uffff]*\\b"; var identifierRe = "[a-zA-Z_\u00a1-\uffff][a-zA-Z\\d_\u00a1-\uffff]*\\b";
this.$rules = { this.$rules = {
"start" : [ "start": [
{ //-------------------------------------------------------- COMMENTS {
token : "comment", token: "comment",
regex : "\\/\\/.*$" regex: "\\/\\/.*$"
}, },
DocCommentHighlightRules.getStartRule("doc-start"), DocCommentHighlightRules.getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token: "comment", // multi line comment
regex : "\\/\\*", regex: "\\/\\*",
next : "star-comment" next: "star-comment"
}, { }, {
token: "comment.shebang", token: "comment.shebang",
regex: "^\\s*#!.*" regex: "^\\s*#!.*"
}, { }, {
token : "comment", token: "comment",
regex : "\\/\\+", regex: "\\/\\+",
next: "plus-comment" next: "plus-comment"
}, { //-------------------------------------------------------- STRINGS }, {
onMatch: function(value, currentState, state) { onMatch: function (value, currentState, state) {
state.unshift(this.next, value.substr(2)); state.unshift(this.next, value.substr(2));
return "string"; return "string";
}, },
regex: 'q"(?:[\\[\\(\\{\\<]+)', regex: 'q"(?:[\\[\\(\\{\\<]+)',
next: 'operator-heredoc-string' next: 'operator-heredoc-string'
}, { }, {
onMatch: function(value, currentState, state) { onMatch: function (value, currentState, state) {
state.unshift(this.next, value.substr(2)); state.unshift(this.next, value.substr(2));
return "string"; return "string";
}, },
regex: 'q"(?:[a-zA-Z_]+)$', regex: 'q"(?:[a-zA-Z_]+)$',
next: 'identifier-heredoc-string' next: 'identifier-heredoc-string'
}, { }, {
token : "string", // multi line string start token: "string", // multi line string start
regex : '[xr]?"', regex: '[xr]?"',
next : "quote-string" next: "quote-string"
}, { }, {
token : "string", // multi line string start token: "string", // multi line string start
regex : '[xr]?`', regex: '[xr]?`',
next : "backtick-string" next: "backtick-string"
}, {
token: "string", // single line
regex: "[xr]?['](?:(?:\\\\.)|(?:[^'\\\\]))*?['][cdw]?"
}, { }, {
token : "string", // single line
regex : "[xr]?['](?:(?:\\\\.)|(?:[^'\\\\]))*?['][cdw]?"
}, { //-------------------------------------------------------- RULES
token: ["keyword", "text", "paren.lparen"], token: ["keyword", "text", "paren.lparen"],
regex: /(asm)(\s*)({)/, regex: /(asm)(\s*)({)/,
next: "d-asm" next: "d-asm"
}, { }, {
token: ["keyword", "text", "paren.lparen", "constant.language"], token: ["keyword", "text", "paren.lparen", "constant.language"],
regex: "(__traits)(\\s*)(\\()("+identifierRe+")" regex: "(__traits)(\\s*)(\\()(" + identifierRe + ")"
}, { // import|module abc
token: ["keyword", "text", "variable.module"],
regex: "(import|module)(\\s+)((?:"+identifierRe+"\\.?)*)"
}, { // storage Name
token: ["keyword.storage", "text", "entity.name.type"],
regex: "("+storages+")(\\s*)("+identifierRe+")"
}, { // alias|typedef foo bar;
token: ["keyword", "text", "variable.storage", "text"],
regex: "(alias|typedef)(\\s*)("+identifierRe+")(\\s*)"
}, { //-------------------------------------------------------- OTHERS
token : "constant.numeric", // hex
regex : "0[xX][0-9a-fA-F_]+(l|ul|u|f|F|L|U|UL)?\\b"
}, { }, {
token : "constant.numeric", // float token: ["keyword", "text", "variable.module"],
regex : "[+-]?\\d[\\d_]*(?:(?:\\.[\\d_]*)?(?:[eE][+-]?[\\d_]+)?)?(l|ul|u|f|F|L|U|UL)?\\b" regex: "(import|module)(\\s+)((?:" + identifierRe + "\\.?)*)"
}, {
token: ["keyword.storage", "text", "entity.name.type"],
regex: "(" + storages + ")(\\s*)(" + identifierRe + ")"
}, {
token: ["keyword", "text", "variable.storage", "text"],
regex: "(alias|typedef)(\\s*)(" + identifierRe + ")(\\s*)"
}, {
token: "constant.numeric", // hex
regex: "0[xX][0-9a-fA-F_]+(l|ul|u|f|F|L|U|UL)?\\b"
}, {
token: "constant.numeric", // float
regex: "[+-]?\\d[\\d_]*(?:(?:\\.[\\d_]*)?(?:[eE][+-]?[\\d_]+)?)?(l|ul|u|f|F|L|U|UL)?\\b"
}, { }, {
token: "entity.other.attribute-name", token: "entity.other.attribute-name",
regex: "@"+identifierRe regex: "@" + identifierRe
}, { }, {
token : keywordMapper, token: keywordMapper,
regex : "[a-zA-Z_][a-zA-Z0-9_]*\\b" regex: "[a-zA-Z_][a-zA-Z0-9_]*\\b"
}, { }, {
token : "keyword.operator", token: "keyword.operator",
regex : operators regex: operators
}, { }, {
token : "punctuation.operator", token: "punctuation.operator",
regex : "\\?|\\:|\\,|\\;|\\.|\\:" regex: "\\?|\\:|\\,|\\;|\\.|\\:"
}, { }, {
token : "paren.lparen", token: "paren.lparen",
regex : "[[({]" regex: "[[({]"
}, { }, {
token : "paren.rparen", token: "paren.rparen",
regex : "[\\])}]" regex: "[\\])}]"
}, { }, {
token : "text", token: "text",
regex : "\\s+" regex: "\\s+"
} }
], ],
"star-comment" : [ "star-comment": [
{ {
token : "comment", // closing comment token: "comment", // closing comment
regex : "\\*\\/", regex: "\\*\\/",
next : "start" next: "start"
}, { }, {
defaultToken: 'comment' defaultToken: 'comment'
} }
], ],
"plus-comment" : [ "plus-comment": [
{ {
token : "comment", // closing comment token: "comment", // closing comment
regex : "\\+\\/", regex: "\\+\\/",
next : "start" next: "start"
}, { }, {
defaultToken: 'comment' defaultToken: 'comment'
} }
], ],
"quote-string": [
"quote-string" : [ stringEscapesSeq,
stringEscapesSeq, {
{ token: "string",
token : "string", regex: '"[cdw]?',
regex : '"[cdw]?', next: "start"
next : "start"
}, { }, {
defaultToken: 'string' defaultToken: 'string'
} }
], ],
"backtick-string": [
"backtick-string" : [ stringEscapesSeq,
stringEscapesSeq, {
{ token: "string",
token : "string", regex: '`[cdw]?',
regex : '`[cdw]?', next: "start"
next : "start"
}, { }, {
defaultToken: 'string' defaultToken: 'string'
} }
], ],
"operator-heredoc-string": [ "operator-heredoc-string": [
{ {
onMatch: function(value, currentState, state) { onMatch: function (value, currentState, state) {
value = value.substring(value.length-2, value.length-1); value = value.substring(value.length - 2, value.length - 1);
var map = {'>':'<',']':'[',')':'(','}':'{'}; var map = { '>': '<', ']': '[', ')': '(', '}': '{' };
if(Object.keys(map).indexOf(value) != -1) if (Object.keys(map).indexOf(value) != -1)
value = map[value]; value = map[value];
if(value != state[1]) return "string"; if (value != state[1])
return "string";
state.shift(); state.shift();
state.shift(); state.shift();
return "string"; return "string";
}, },
regex: '(?:[\\]\\)}>]+)"', regex: '(?:[\\]\\)}>]+)"',
@ -266,15 +226,14 @@ var DHighlightRules = function() {
regex: '[^\\]\\)}>]+' regex: '[^\\]\\)}>]+'
} }
], ],
"identifier-heredoc-string": [ "identifier-heredoc-string": [
{ {
onMatch: function(value, currentState, state) { onMatch: function (value, currentState, state) {
value = value.substring(0, value.length-1); value = value.substring(0, value.length - 1);
if(value != state[1]) return "string"; if (value != state[1])
return "string";
state.shift(); state.shift();
state.shift(); state.shift();
return "string"; return "string";
}, },
regex: '^(?:[A-Za-z_][a-zA-Z0-9]+)"', regex: '^(?:[A-Za-z_][a-zA-Z0-9]+)"',
@ -284,7 +243,6 @@ var DHighlightRules = function() {
regex: '[^\\]\\)}>]+' regex: '[^\\]\\)}>]+'
} }
], ],
"d-asm": [ "d-asm": [
{ {
token: "paren.rparen", token: "paren.rparen",
@ -308,7 +266,7 @@ var DHighlightRules = function() {
regex: '[a-zA-Z]+' regex: '[a-zA-Z]+'
}, { }, {
token: 'string', token: 'string',
regex: '".*"' regex: '"[^"]*"'
}, { }, {
token: 'comment', token: 'comment',
regex: '//.*$' regex: '//.*$'
@ -328,109 +286,82 @@ var DHighlightRules = function() {
} }
] ]
}; };
this.embedRules(DocCommentHighlightRules, "doc-", [DocCommentHighlightRules.getEndRule("start")]);
this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]);
}; };
DHighlightRules.metaData = { DHighlightRules.metaData = {
comment: 'D language', comment: 'D language',
fileTypes: [ 'd', 'di' ], fileTypes: ['d', 'di'],
firstLineMatch: '^#!.*\\b[glr]?dmd\\b.', firstLineMatch: '^#!.*\\b[glr]?dmd\\b.',
foldingStartMarker: '(?x)/\\*\\*(?!\\*)|^(?![^{]*?//|[^{]*?/\\*(?!.*?\\*/.*?\\{)).*?\\{\\s*($|//|/\\*(?!.*?\\*/.*\\S))', foldingStartMarker: '(?x)/\\*\\*(?!\\*)|^(?![^{]*?//|[^{]*?/\\*(?!.*?\\*/.*?\\{)).*?\\{\\s*($|//|/\\*(?!.*?\\*/.*\\S))',
foldingStopMarker: '(?<!\\*)\\*\\*/|^\\s*\\}', foldingStopMarker: '(?<!\\*)\\*\\*/|^\\s*\\}',
keyEquivalent: '^~D', keyEquivalent: '^~D',
name: 'D', name: 'D',
scopeName: 'source.d' scopeName: 'source.d'
}; };
oop.inherits(DHighlightRules, TextHighlightRules); oop.inherits(DHighlightRules, TextHighlightRules);
exports.DHighlightRules = DHighlightRules; exports.DHighlightRules = DHighlightRules;
}); });
define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../../lib/oop"); var oop = require("../../lib/oop");
var Range = require("../../range").Range; var Range = require("../../range").Range;
var BaseFoldMode = require("./fold_mode").FoldMode; var BaseFoldMode = require("./fold_mode").FoldMode;
var FoldMode = exports.FoldMode = function (commentRegex) {
var FoldMode = exports.FoldMode = function(commentRegex) {
if (commentRegex) { if (commentRegex) {
this.foldingStartMarker = new RegExp( this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
);
this.foldingStopMarker = new RegExp(
this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
);
} }
}; };
oop.inherits(FoldMode, BaseFoldMode); oop.inherits(FoldMode, BaseFoldMode);
(function () {
(function() {
this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/; this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/; this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
this._getFoldWidgetBase = this.getFoldWidget; this._getFoldWidgetBase = this.getFoldWidget;
this.getFoldWidget = function(session, foldStyle, row) { this.getFoldWidget = function (session, foldStyle, row) {
var line = session.getLine(row); var line = session.getLine(row);
if (this.singleLineBlockCommentRe.test(line)) { if (this.singleLineBlockCommentRe.test(line)) {
if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
return ""; return "";
} }
var fw = this._getFoldWidgetBase(session, foldStyle, row); var fw = this._getFoldWidgetBase(session, foldStyle, row);
if (!fw && this.startRegionRe.test(line)) if (!fw && this.startRegionRe.test(line))
return "start"; // lineCommentRegionStart return "start"; // lineCommentRegionStart
return fw; return fw;
}; };
this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
var line = session.getLine(row); var line = session.getLine(row);
if (this.startRegionRe.test(line)) if (this.startRegionRe.test(line))
return this.getCommentRegionBlock(session, line, row); return this.getCommentRegionBlock(session, line, row);
var match = line.match(this.foldingStartMarker); var match = line.match(this.foldingStartMarker);
if (match) { if (match) {
var i = match.index; var i = match.index;
if (match[1]) if (match[1])
return this.openingBracketBlock(session, match[1], row, i); return this.openingBracketBlock(session, match[1], row, i);
var range = session.getCommentFoldRange(row, i + match[0].length, 1); var range = session.getCommentFoldRange(row, i + match[0].length, 1);
if (range && !range.isMultiLine()) { if (range && !range.isMultiLine()) {
if (forceMultiline) { if (forceMultiline) {
range = this.getSectionRange(session, row); range = this.getSectionRange(session, row);
} else if (foldStyle != "all") }
else if (foldStyle != "all")
range = null; range = null;
} }
return range; return range;
} }
if (foldStyle === "markbegin") if (foldStyle === "markbegin")
return; return;
var match = line.match(this.foldingStopMarker); var match = line.match(this.foldingStopMarker);
if (match) { if (match) {
var i = match.index + match[0].length; var i = match.index + match[0].length;
if (match[1]) if (match[1])
return this.closingBracketBlock(session, match[1], row, i); return this.closingBracketBlock(session, match[1], row, i);
return session.getCommentFoldRange(row, i, -1); return session.getCommentFoldRange(row, i, -1);
} }
}; };
this.getSectionRange = function (session, row) {
this.getSectionRange = function(session, row) {
var line = session.getLine(row); var line = session.getLine(row);
var startIndent = line.search(/\S/); var startIndent = line.search(/\S/);
var startRow = row; var startRow = row;
@ -443,71 +374,77 @@ oop.inherits(FoldMode, BaseFoldMode);
var indent = line.search(/\S/); var indent = line.search(/\S/);
if (indent === -1) if (indent === -1)
continue; continue;
if (startIndent > indent) if (startIndent > indent)
break; break;
var subRange = this.getFoldWidgetRange(session, "all", row); var subRange = this.getFoldWidgetRange(session, "all", row);
if (subRange) { if (subRange) {
if (subRange.start.row <= startRow) { if (subRange.start.row <= startRow) {
break; break;
} else if (subRange.isMultiLine()) { }
else if (subRange.isMultiLine()) {
row = subRange.end.row; row = subRange.end.row;
} else if (startIndent == indent) { }
else if (startIndent == indent) {
break; break;
} }
} }
endRow = row; endRow = row;
} }
return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
}; };
this.getCommentRegionBlock = function(session, line, row) { this.getCommentRegionBlock = function (session, line, row) {
var startColumn = line.search(/\s*$/); var startColumn = line.search(/\s*$/);
var maxRow = session.getLength(); var maxRow = session.getLength();
var startRow = row; var startRow = row;
var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
var depth = 1; var depth = 1;
while (++row < maxRow) { while (++row < maxRow) {
line = session.getLine(row); line = session.getLine(row);
var m = re.exec(line); var m = re.exec(line);
if (!m) continue; if (!m)
if (m[1]) depth--; continue;
else depth++; if (m[1])
depth--;
if (!depth) break; else
depth++;
if (!depth)
break;
} }
var endRow = row; var endRow = row;
if (endRow > startRow) { if (endRow > startRow) {
return new Range(startRow, startColumn, endRow, line.length); return new Range(startRow, startColumn, endRow, line.length);
} }
}; };
}).call(FoldMode.prototype); }).call(FoldMode.prototype);
}); });
define("ace/mode/d",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/d_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) { define("ace/mode/d",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/d_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module){/*
THIS FILE WAS AUTOGENERATED BY mode.tmpl.js
*/
"use strict"; "use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextMode = require("./text").Mode; var TextMode = require("./text").Mode;
var DHighlightRules = require("./d_highlight_rules").DHighlightRules; var DHighlightRules = require("./d_highlight_rules").DHighlightRules;
var FoldMode = require("./folding/cstyle").FoldMode; var FoldMode = require("./folding/cstyle").FoldMode;
var Mode = function () {
var Mode = function() {
this.HighlightRules = DHighlightRules; this.HighlightRules = DHighlightRules;
this.foldingRules = new FoldMode(); this.foldingRules = new FoldMode();
this.$behaviour = this.$defaultBehaviour; this.$behaviour = this.$defaultBehaviour;
}; };
oop.inherits(Mode, TextMode); oop.inherits(Mode, TextMode);
(function () {
(function() {
this.lineCommentStart = "//"; this.lineCommentStart = "//";
this.blockComment = {start: "/*", end: "*/"}; this.blockComment = { start: "/*", end: "*/" };
this.$id = "ace/mode/d"; this.$id = "ace/mode/d";
}).call(Mode.prototype); }).call(Mode.prototype);
exports.Mode = Mode; exports.Mode = Mode;
});
}); (function() {
window.require(["ace/mode/d"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

File diff suppressed because it is too large Load Diff

View File

@ -1,17 +1,13 @@
define("ace/mode/diff_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { define("ace/mode/diff_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var DiffHighlightRules = function () {
var DiffHighlightRules = function() {
this.$rules = { this.$rules = {
"start" : [{ "start": [{
regex: "^(?:\\*{15}|={67}|-{3}|\\+{3})$", regex: "^(?:\\*{15}|={67}|-{3}|\\+{3})$",
token: "punctuation.definition.separator.diff", token: "punctuation.definition.separator.diff",
"name": "keyword" "name": "keyword"
}, { //diff.range.unified }, {
regex: "^(@@)(\\s*.+?\\s*)(@@)(.*)$", regex: "^(@@)(\\s*.+?\\s*)(@@)(.*)$",
token: [ token: [
"constant", "constant",
@ -19,7 +15,7 @@ var DiffHighlightRules = function() {
"constant", "constant",
"comment.doc.tag" "comment.doc.tag"
] ]
}, { //diff.range.normal }, {
regex: "^(\\d+)([,\\d]+)(a|d|c)(\\d+)([,\\d]+)(.*)$", regex: "^(\\d+)([,\\d]+)(a|d|c)(\\d+)([,\\d]+)(.*)$",
token: [ token: [
"constant.numeric", "constant.numeric",
@ -36,14 +32,14 @@ var DiffHighlightRules = function() {
"constant.numeric", "constant.numeric",
"meta.tag" "meta.tag"
] ]
}, { // added }, {
regex: "^([!+>])(.*?)(\\s*)$", regex: "^([!+>])(.*?)(\\s*)$",
token: [ token: [
"support.constant", "support.constant",
"text", "text",
"invalid" "invalid"
] ]
}, { // removed }, {
regex: "^([<\\-])(.*?)(\\s*)$", regex: "^([<\\-])(.*?)(\\s*)$",
token: [ token: [
"support.function", "support.function",
@ -69,71 +65,65 @@ var DiffHighlightRules = function() {
] ]
}; };
}; };
oop.inherits(DiffHighlightRules, TextHighlightRules); oop.inherits(DiffHighlightRules, TextHighlightRules);
exports.DiffHighlightRules = DiffHighlightRules; exports.DiffHighlightRules = DiffHighlightRules;
}); });
define("ace/mode/folding/diff",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module) { define("ace/mode/folding/diff",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../../lib/oop"); var oop = require("../../lib/oop");
var BaseFoldMode = require("./fold_mode").FoldMode; var BaseFoldMode = require("./fold_mode").FoldMode;
var Range = require("../../range").Range; var Range = require("../../range").Range;
var FoldMode = exports.FoldMode = function (levels, flag) {
var FoldMode = exports.FoldMode = function(levels, flag) { this.regExpList = levels;
this.regExpList = levels; this.flag = flag;
this.flag = flag; this.foldingStartMarker = RegExp("^(" + levels.join("|") + ")", this.flag);
this.foldingStartMarker = RegExp("^(" + levels.join("|") + ")", this.flag);
}; };
oop.inherits(FoldMode, BaseFoldMode); oop.inherits(FoldMode, BaseFoldMode);
(function () {
(function() { this.getFoldWidgetRange = function (session, foldStyle, row) {
this.getFoldWidgetRange = function(session, foldStyle, row) {
var line = session.getLine(row); var line = session.getLine(row);
var start = {row: row, column: line.length}; var start = { row: row, column: line.length };
var regList = this.regExpList; var regList = this.regExpList;
for (var i = 1; i <= regList.length; i++) { for (var i = 1; i <= regList.length; i++) {
var re = RegExp("^(" + regList.slice(0, i).join("|") + ")", this.flag); var re = RegExp("^(" + regList.slice(0, i).join("|") + ")", this.flag);
if (re.test(line)) if (re.test(line))
break; break;
} }
for (var l = session.getLength(); ++row < l;) {
for (var l = session.getLength(); ++row < l; ) {
line = session.getLine(row); line = session.getLine(row);
if (re.test(line)) if (re.test(line))
break; break;
} }
if (row == start.row + 1) if (row == start.row + 1)
return; return;
return Range.fromPoints(start, {row: row - 1, column: line.length}); return new Range(start.row, start.column, row - 1, line.length);
}; };
}).call(FoldMode.prototype); }).call(FoldMode.prototype);
}); });
define("ace/mode/diff",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/diff_highlight_rules","ace/mode/folding/diff"], function(require, exports, module) { define("ace/mode/diff",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/diff_highlight_rules","ace/mode/folding/diff"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextMode = require("./text").Mode; var TextMode = require("./text").Mode;
var HighlightRules = require("./diff_highlight_rules").DiffHighlightRules; var HighlightRules = require("./diff_highlight_rules").DiffHighlightRules;
var FoldMode = require("./folding/diff").FoldMode; var FoldMode = require("./folding/diff").FoldMode;
var Mode = function () {
var Mode = function() {
this.HighlightRules = HighlightRules; this.HighlightRules = HighlightRules;
this.foldingRules = new FoldMode(["diff", "index", "\\+{3}", "@@|\\*{5}"], "i"); this.foldingRules = new FoldMode(["diff", "@@|\\*{5}"], "i");
}; };
oop.inherits(Mode, TextMode); oop.inherits(Mode, TextMode);
(function () {
(function() {
this.$id = "ace/mode/diff"; this.$id = "ace/mode/diff";
this.snippetFileId = "ace/snippets/diff";
}).call(Mode.prototype); }).call(Mode.prototype);
exports.Mode = Mode; exports.Mode = Mode;
}); }); (function() {
window.require(["ace/mode/diff"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

File diff suppressed because it is too large Load Diff

View File

@ -1,305 +1,264 @@
define("ace/mode/sh_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { define("ace/mode/sh_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var reservedKeywords = exports.reservedKeywords = ('!|{|}|case|do|done|elif|else|' +
var reservedKeywords = exports.reservedKeywords = ( 'esac|fi|for|if|in|then|until|while|' +
'!|{|}|case|do|done|elif|else|'+ '&|;|export|local|read|typeset|unset|' +
'esac|fi|for|if|in|then|until|while|'+ 'elif|select|set|function|declare|readonly');
'&|;|export|local|read|typeset|unset|'+ var languageConstructs = exports.languageConstructs = ('[|]|alias|bg|bind|break|builtin|' +
'elif|select|set|function|declare|readonly' 'cd|command|compgen|complete|continue|' +
); 'dirs|disown|echo|enable|eval|exec|' +
'exit|fc|fg|getopts|hash|help|history|' +
var languageConstructs = exports.languageConstructs = ( 'jobs|kill|let|logout|popd|printf|pushd|' +
'[|]|alias|bg|bind|break|builtin|'+ 'pwd|return|set|shift|shopt|source|' +
'cd|command|compgen|complete|continue|'+ 'suspend|test|times|trap|type|ulimit|' +
'dirs|disown|echo|enable|eval|exec|'+ 'umask|unalias|wait');
'exit|fc|fg|getopts|hash|help|history|'+ var ShHighlightRules = function () {
'jobs|kill|let|logout|popd|printf|pushd|'+
'pwd|return|set|shift|shopt|source|'+
'suspend|test|times|trap|type|ulimit|'+
'umask|unalias|wait'
);
var ShHighlightRules = function() {
var keywordMapper = this.createKeywordMapper({ var keywordMapper = this.createKeywordMapper({
"keyword": reservedKeywords, "keyword": reservedKeywords,
"support.function.builtin": languageConstructs, "support.function.builtin": languageConstructs,
"invalid.deprecated": "debugger" "invalid.deprecated": "debugger"
}, "identifier"); }, "identifier");
var integer = "(?:(?:[1-9]\\d*)|(?:0))"; var integer = "(?:(?:[1-9]\\d*)|(?:0))";
var fraction = "(?:\\.\\d+)"; var fraction = "(?:\\.\\d+)";
var intPart = "(?:\\d+)"; var intPart = "(?:\\d+)";
var pointFloat = "(?:(?:" + intPart + "?" + fraction + ")|(?:" + intPart + "\\.))"; var pointFloat = "(?:(?:" + intPart + "?" + fraction + ")|(?:" + intPart + "\\.))";
var exponentFloat = "(?:(?:" + pointFloat + "|" + intPart + ")" + ")"; var exponentFloat = "(?:(?:" + pointFloat + "|" + intPart + ")" + ")";
var floatNumber = "(?:" + exponentFloat + "|" + pointFloat + ")"; var floatNumber = "(?:" + exponentFloat + "|" + pointFloat + ")";
var fileDescriptor = "(?:&" + intPart + ")"; var fileDescriptor = "(?:&" + intPart + ")";
var variableName = "[a-zA-Z_][a-zA-Z0-9_]*"; var variableName = "[a-zA-Z_][a-zA-Z0-9_]*";
var variable = "(?:" + variableName + "(?==))"; var variable = "(?:" + variableName + "(?==))";
var builtinVariable = "(?:\\$(?:SHLVL|\\$|\\!|\\?))"; var builtinVariable = "(?:\\$(?:SHLVL|\\$|\\!|\\?))";
var func = "(?:" + variableName + "\\s*\\(\\))"; var func = "(?:" + variableName + "\\s*\\(\\))";
this.$rules = { this.$rules = {
"start" : [{ "start": [{
token : "constant", token: "constant",
regex : /\\./ regex: /\\./
}, {
token : ["text", "comment"],
regex : /(^|\s)(#.*)$/
}, {
token : "string.start",
regex : '"',
push : [{
token : "constant.language.escape",
regex : /\\(?:[$`"\\]|$)/
}, { }, {
include : "variables" token: ["text", "comment"],
regex: /(^|\s)(#.*)$/
}, { }, {
token : "keyword.operator", token: "string.start",
regex : /`/ // TODO highlight ` regex: '"',
push: [{
token: "constant.language.escape",
regex: /\\(?:[$`"\\]|$)/
}, {
include: "variables"
}, {
token: "keyword.operator",
regex: /`/ // TODO highlight `
}, {
token: "string.end",
regex: '"',
next: "pop"
}, {
defaultToken: "string"
}]
}, { }, {
token : "string.end", token: "string",
regex : '"', regex: "\\$'",
push: [{
token: "constant.language.escape",
regex: /\\(?:[abeEfnrtv\\'"]|x[a-fA-F\d]{1,2}|u[a-fA-F\d]{4}([a-fA-F\d]{4})?|c.|\d{1,3})/
}, {
token: "string",
regex: "'",
next: "pop"
}, {
defaultToken: "string"
}]
}, {
regex: "<<<",
token: "keyword.operator"
}, {
stateName: "heredoc",
regex: "(<<-?)(\\s*)(['\"`]?)([\\w\\-]+)(['\"`]?)",
onMatch: function (value, currentState, stack) {
var next = value[2] == '-' ? "indentedHeredoc" : "heredoc";
var tokens = value.split(this.splitRegex);
stack.push(next, tokens[4]);
return [
{ type: "constant", value: tokens[1] },
{ type: "text", value: tokens[2] },
{ type: "string", value: tokens[3] },
{ type: "support.class", value: tokens[4] },
{ type: "string", value: tokens[5] }
];
},
rules: {
heredoc: [{
onMatch: function (value, currentState, stack) {
if (value === stack[1]) {
stack.shift();
stack.shift();
this.next = stack[0] || "start";
return "support.class";
}
this.next = "";
return "string";
},
regex: ".*$",
next: "start"
}],
indentedHeredoc: [{
token: "string",
regex: "^\t+"
}, {
onMatch: function (value, currentState, stack) {
if (value === stack[1]) {
stack.shift();
stack.shift();
this.next = stack[0] || "start";
return "support.class";
}
this.next = "";
return "string";
},
regex: ".*$",
next: "start"
}]
}
}, {
regex: "$",
token: "empty",
next: function (currentState, stack) {
if (stack[0] === "heredoc" || stack[0] === "indentedHeredoc")
return stack[0];
return currentState;
}
}, {
token: ["keyword", "text", "text", "text", "variable"],
regex: /(declare|local|readonly)(\s+)(?:(-[fixar]+)(\s+))?([a-zA-Z_][a-zA-Z0-9_]*\b)/
}, {
token: "variable.language",
regex: builtinVariable
}, {
token: "variable",
regex: variable
}, {
include: "variables"
}, {
token: "support.function",
regex: func
}, {
token: "support.function",
regex: fileDescriptor
}, {
token: "string", // ' string
start: "'", end: "'"
}, {
token: "constant.numeric", // float
regex: floatNumber
}, {
token: "constant.numeric", // integer
regex: integer + "\\b"
}, {
token: keywordMapper,
regex: "[a-zA-Z_][a-zA-Z0-9_]*\\b"
}, {
token: "keyword.operator",
regex: "\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|~|<|>|<=|=>|=|!=|[%&|`]"
}, {
token: "punctuation.operator",
regex: ";"
}, {
token: "paren.lparen",
regex: "[\\[\\(\\{]"
}, {
token: "paren.rparen",
regex: "[\\]]"
}, {
token: "paren.rparen",
regex: "[\\)\\}]",
next: "pop" next: "pop"
}, { }],
defaultToken: "string"
}]
}, {
token : "string",
regex : "\\$'",
push : [{
token : "constant.language.escape",
regex : /\\(?:[abeEfnrtv\\'"]|x[a-fA-F\d]{1,2}|u[a-fA-F\d]{4}([a-fA-F\d]{4})?|c.|\d{1,3})/
}, {
token : "string",
regex : "'",
next: "pop"
}, {
defaultToken: "string"
}]
}, {
regex : "<<<",
token : "keyword.operator"
}, {
stateName: "heredoc",
regex : "(<<-?)(\\s*)(['\"`]?)([\\w\\-]+)(['\"`]?)",
onMatch : function(value, currentState, stack) {
var next = value[2] == '-' ? "indentedHeredoc" : "heredoc";
var tokens = value.split(this.splitRegex);
stack.push(next, tokens[4]);
return [
{type:"constant", value: tokens[1]},
{type:"text", value: tokens[2]},
{type:"string", value: tokens[3]},
{type:"support.class", value: tokens[4]},
{type:"string", value: tokens[5]}
];
},
rules: {
heredoc: [{
onMatch: function(value, currentState, stack) {
if (value === stack[1]) {
stack.shift();
stack.shift();
this.next = stack[0] || "start";
return "support.class";
}
this.next = "";
return "string";
},
regex: ".*$",
next: "start"
}],
indentedHeredoc: [{
token: "string",
regex: "^\t+"
}, {
onMatch: function(value, currentState, stack) {
if (value === stack[1]) {
stack.shift();
stack.shift();
this.next = stack[0] || "start";
return "support.class";
}
this.next = "";
return "string";
},
regex: ".*$",
next: "start"
}]
}
}, {
regex : "$",
token : "empty",
next : function(currentState, stack) {
if (stack[0] === "heredoc" || stack[0] === "indentedHeredoc")
return stack[0];
return currentState;
}
}, {
token : ["keyword", "text", "text", "text", "variable"],
regex : /(declare|local|readonly)(\s+)(?:(-[fixar]+)(\s+))?([a-zA-Z_][a-zA-Z0-9_]*\b)/
}, {
token : "variable.language",
regex : builtinVariable
}, {
token : "variable",
regex : variable
}, {
include : "variables"
}, {
token : "support.function",
regex : func
}, {
token : "support.function",
regex : fileDescriptor
}, {
token : "string", // ' string
start : "'", end : "'"
}, {
token : "constant.numeric", // float
regex : floatNumber
}, {
token : "constant.numeric", // integer
regex : integer + "\\b"
}, {
token : keywordMapper,
regex : "[a-zA-Z_][a-zA-Z0-9_]*\\b"
}, {
token : "keyword.operator",
regex : "\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|~|<|>|<=|=>|=|!=|[%&|`]"
}, {
token : "punctuation.operator",
regex : ";"
}, {
token : "paren.lparen",
regex : "[\\[\\(\\{]"
}, {
token : "paren.rparen",
regex : "[\\]]"
}, {
token : "paren.rparen",
regex : "[\\)\\}]",
next : "pop"
}],
variables: [{ variables: [{
token : "variable", token: "variable",
regex : /(\$)(\w+)/ regex: /(\$)(\w+)/
}, { }, {
token : ["variable", "paren.lparen"], token: ["variable", "paren.lparen"],
regex : /(\$)(\()/, regex: /(\$)(\()/,
push : "start" push: "start"
}, { }, {
token : ["variable", "paren.lparen", "keyword.operator", "variable", "keyword.operator"], token: ["variable", "paren.lparen", "keyword.operator", "variable", "keyword.operator"],
regex : /(\$)(\{)([#!]?)(\w+|[*@#?\-$!0_])(:[?+\-=]?|##?|%%?|,,?\/|\^\^?)?/, regex: /(\$)(\{)([#!]?)(\w+|[*@#?\-$!0_])(:[?+\-=]?|##?|%%?|,,?\/|\^\^?)?/,
push : "start" push: "start"
}, { }, {
token : "variable", token: "variable",
regex : /\$[*@#?\-$!0_]/ regex: /\$[*@#?\-$!0_]/
}, { }, {
token : ["variable", "paren.lparen"], token: ["variable", "paren.lparen"],
regex : /(\$)(\{)/, regex: /(\$)(\{)/,
push : "start" push: "start"
}] }]
}; };
this.normalizeRules(); this.normalizeRules();
}; };
oop.inherits(ShHighlightRules, TextHighlightRules); oop.inherits(ShHighlightRules, TextHighlightRules);
exports.ShHighlightRules = ShHighlightRules; exports.ShHighlightRules = ShHighlightRules;
}); });
define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../../lib/oop"); var oop = require("../../lib/oop");
var Range = require("../../range").Range; var Range = require("../../range").Range;
var BaseFoldMode = require("./fold_mode").FoldMode; var BaseFoldMode = require("./fold_mode").FoldMode;
var FoldMode = exports.FoldMode = function (commentRegex) {
var FoldMode = exports.FoldMode = function(commentRegex) {
if (commentRegex) { if (commentRegex) {
this.foldingStartMarker = new RegExp( this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
);
this.foldingStopMarker = new RegExp(
this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
);
} }
}; };
oop.inherits(FoldMode, BaseFoldMode); oop.inherits(FoldMode, BaseFoldMode);
(function () {
(function() {
this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/; this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/; this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
this._getFoldWidgetBase = this.getFoldWidget; this._getFoldWidgetBase = this.getFoldWidget;
this.getFoldWidget = function(session, foldStyle, row) { this.getFoldWidget = function (session, foldStyle, row) {
var line = session.getLine(row); var line = session.getLine(row);
if (this.singleLineBlockCommentRe.test(line)) { if (this.singleLineBlockCommentRe.test(line)) {
if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
return ""; return "";
} }
var fw = this._getFoldWidgetBase(session, foldStyle, row); var fw = this._getFoldWidgetBase(session, foldStyle, row);
if (!fw && this.startRegionRe.test(line)) if (!fw && this.startRegionRe.test(line))
return "start"; // lineCommentRegionStart return "start"; // lineCommentRegionStart
return fw; return fw;
}; };
this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
var line = session.getLine(row); var line = session.getLine(row);
if (this.startRegionRe.test(line)) if (this.startRegionRe.test(line))
return this.getCommentRegionBlock(session, line, row); return this.getCommentRegionBlock(session, line, row);
var match = line.match(this.foldingStartMarker); var match = line.match(this.foldingStartMarker);
if (match) { if (match) {
var i = match.index; var i = match.index;
if (match[1]) if (match[1])
return this.openingBracketBlock(session, match[1], row, i); return this.openingBracketBlock(session, match[1], row, i);
var range = session.getCommentFoldRange(row, i + match[0].length, 1); var range = session.getCommentFoldRange(row, i + match[0].length, 1);
if (range && !range.isMultiLine()) { if (range && !range.isMultiLine()) {
if (forceMultiline) { if (forceMultiline) {
range = this.getSectionRange(session, row); range = this.getSectionRange(session, row);
} else if (foldStyle != "all") }
else if (foldStyle != "all")
range = null; range = null;
} }
return range; return range;
} }
if (foldStyle === "markbegin") if (foldStyle === "markbegin")
return; return;
var match = line.match(this.foldingStopMarker); var match = line.match(this.foldingStopMarker);
if (match) { if (match) {
var i = match.index + match[0].length; var i = match.index + match[0].length;
if (match[1]) if (match[1])
return this.closingBracketBlock(session, match[1], row, i); return this.closingBracketBlock(session, match[1], row, i);
return session.getCommentFoldRange(row, i, -1); return session.getCommentFoldRange(row, i, -1);
} }
}; };
this.getSectionRange = function (session, row) {
this.getSectionRange = function(session, row) {
var line = session.getLine(row); var line = session.getLine(row);
var startIndent = line.search(/\S/); var startIndent = line.search(/\S/);
var startRow = row; var startRow = row;
@ -312,93 +271,80 @@ oop.inherits(FoldMode, BaseFoldMode);
var indent = line.search(/\S/); var indent = line.search(/\S/);
if (indent === -1) if (indent === -1)
continue; continue;
if (startIndent > indent) if (startIndent > indent)
break; break;
var subRange = this.getFoldWidgetRange(session, "all", row); var subRange = this.getFoldWidgetRange(session, "all", row);
if (subRange) { if (subRange) {
if (subRange.start.row <= startRow) { if (subRange.start.row <= startRow) {
break; break;
} else if (subRange.isMultiLine()) { }
else if (subRange.isMultiLine()) {
row = subRange.end.row; row = subRange.end.row;
} else if (startIndent == indent) { }
else if (startIndent == indent) {
break; break;
} }
} }
endRow = row; endRow = row;
} }
return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
}; };
this.getCommentRegionBlock = function(session, line, row) { this.getCommentRegionBlock = function (session, line, row) {
var startColumn = line.search(/\s*$/); var startColumn = line.search(/\s*$/);
var maxRow = session.getLength(); var maxRow = session.getLength();
var startRow = row; var startRow = row;
var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
var depth = 1; var depth = 1;
while (++row < maxRow) { while (++row < maxRow) {
line = session.getLine(row); line = session.getLine(row);
var m = re.exec(line); var m = re.exec(line);
if (!m) continue; if (!m)
if (m[1]) depth--; continue;
else depth++; if (m[1])
depth--;
if (!depth) break; else
depth++;
if (!depth)
break;
} }
var endRow = row; var endRow = row;
if (endRow > startRow) { if (endRow > startRow) {
return new Range(startRow, startColumn, endRow, line.length); return new Range(startRow, startColumn, endRow, line.length);
} }
}; };
}).call(FoldMode.prototype); }).call(FoldMode.prototype);
}); });
define("ace/mode/sh",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/sh_highlight_rules","ace/range","ace/mode/folding/cstyle","ace/mode/behaviour/cstyle"], function(require, exports, module) { define("ace/mode/sh",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/sh_highlight_rules","ace/range","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextMode = require("./text").Mode; var TextMode = require("./text").Mode;
var ShHighlightRules = require("./sh_highlight_rules").ShHighlightRules; var ShHighlightRules = require("./sh_highlight_rules").ShHighlightRules;
var Range = require("../range").Range; var Range = require("../range").Range;
var CStyleFoldMode = require("./folding/cstyle").FoldMode; var CStyleFoldMode = require("./folding/cstyle").FoldMode;
var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; var Mode = function () {
var Mode = function() {
this.HighlightRules = ShHighlightRules; this.HighlightRules = ShHighlightRules;
this.foldingRules = new CStyleFoldMode(); this.foldingRules = new CStyleFoldMode();
this.$behaviour = new CstyleBehaviour(); this.$behaviour = this.$defaultBehaviour;
}; };
oop.inherits(Mode, TextMode); oop.inherits(Mode, TextMode);
(function () {
(function() {
this.lineCommentStart = "#"; this.lineCommentStart = "#";
this.getNextLineIndent = function (state, line, tab) {
this.getNextLineIndent = function(state, line, tab) {
var indent = this.$getIndent(line); var indent = this.$getIndent(line);
var tokenizedLine = this.getTokenizer().getLineTokens(line, state); var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
var tokens = tokenizedLine.tokens; var tokens = tokenizedLine.tokens;
if (tokens.length && tokens[tokens.length - 1].type == "comment") {
if (tokens.length && tokens[tokens.length-1].type == "comment") {
return indent; return indent;
} }
if (state == "start") { if (state == "start") {
var match = line.match(/^.*[\{\(\[:]\s*$/); var match = line.match(/^.*[\{\(\[:]\s*$/);
if (match) { if (match) {
indent += tab; indent += tab;
} }
} }
return indent; return indent;
}; };
var outdents = { var outdents = {
"pass": 1, "pass": 1,
"return": 1, "return": 1,
@ -406,49 +352,38 @@ oop.inherits(Mode, TextMode);
"break": 1, "break": 1,
"continue": 1 "continue": 1
}; };
this.checkOutdent = function (state, line, input) {
this.checkOutdent = function(state, line, input) {
if (input !== "\r\n" && input !== "\r" && input !== "\n") if (input !== "\r\n" && input !== "\r" && input !== "\n")
return false; return false;
var tokens = this.getTokenizer().getLineTokens(line.trim(), state).tokens; var tokens = this.getTokenizer().getLineTokens(line.trim(), state).tokens;
if (!tokens) if (!tokens)
return false; return false;
do { do {
var last = tokens.pop(); var last = tokens.pop();
} while (last && (last.type == "comment" || (last.type == "text" && last.value.match(/^\s+$/)))); } while (last && (last.type == "comment" || (last.type == "text" && last.value.match(/^\s+$/))));
if (!last) if (!last)
return false; return false;
return (last.type == "keyword" && outdents[last.value]); return (last.type == "keyword" && outdents[last.value]);
}; };
this.autoOutdent = function (state, doc, row) {
this.autoOutdent = function(state, doc, row) {
row += 1; row += 1;
var indent = this.$getIndent(doc.getLine(row)); var indent = this.$getIndent(doc.getLine(row));
var tab = doc.getTabString(); var tab = doc.getTabString();
if (indent.slice(-tab.length) == tab) if (indent.slice(-tab.length) == tab)
doc.remove(new Range(row, indent.length-tab.length, row, indent.length)); doc.remove(new Range(row, indent.length - tab.length, row, indent.length));
}; };
this.$id = "ace/mode/sh"; this.$id = "ace/mode/sh";
this.snippetFileId = "ace/snippets/sh";
}).call(Mode.prototype); }).call(Mode.prototype);
exports.Mode = Mode; exports.Mode = Mode;
}); });
define("ace/mode/dockerfile_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/sh_highlight_rules"], function(require, exports, module) { define("ace/mode/dockerfile_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/sh_highlight_rules"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var ShHighlightRules = require("./sh_highlight_rules").ShHighlightRules; var ShHighlightRules = require("./sh_highlight_rules").ShHighlightRules;
var DockerfileHighlightRules = function () {
var DockerfileHighlightRules = function() {
ShHighlightRules.call(this); ShHighlightRules.call(this);
var startRules = this.$rules.start; var startRules = this.$rules.start;
for (var i = 0; i < startRules.length; i++) { for (var i = 0; i < startRules.length; i++) {
if (startRules[i].token == "variable.language") { if (startRules[i].token == "variable.language") {
@ -460,33 +395,33 @@ var DockerfileHighlightRules = function() {
break; break;
} }
} }
}; };
oop.inherits(DockerfileHighlightRules, ShHighlightRules); oop.inherits(DockerfileHighlightRules, ShHighlightRules);
exports.DockerfileHighlightRules = DockerfileHighlightRules; exports.DockerfileHighlightRules = DockerfileHighlightRules;
}); });
define("ace/mode/dockerfile",["require","exports","module","ace/lib/oop","ace/mode/sh","ace/mode/dockerfile_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) { define("ace/mode/dockerfile",["require","exports","module","ace/lib/oop","ace/mode/sh","ace/mode/dockerfile_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var ShMode = require("./sh").Mode; var ShMode = require("./sh").Mode;
var DockerfileHighlightRules = require("./dockerfile_highlight_rules").DockerfileHighlightRules; var DockerfileHighlightRules = require("./dockerfile_highlight_rules").DockerfileHighlightRules;
var CStyleFoldMode = require("./folding/cstyle").FoldMode; var CStyleFoldMode = require("./folding/cstyle").FoldMode;
var Mode = function () {
var Mode = function() {
ShMode.call(this); ShMode.call(this);
this.HighlightRules = DockerfileHighlightRules; this.HighlightRules = DockerfileHighlightRules;
this.foldingRules = new CStyleFoldMode(); this.foldingRules = new CStyleFoldMode();
}; };
oop.inherits(Mode, ShMode); oop.inherits(Mode, ShMode);
(function () {
(function() {
this.$id = "ace/mode/dockerfile"; this.$id = "ace/mode/dockerfile";
}).call(Mode.prototype); }).call(Mode.prototype);
exports.Mode = Mode; exports.Mode = Mode;
});
}); (function() {
window.require(["ace/mode/dockerfile"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

View File

@ -1,152 +1,122 @@
define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module){"use strict";
"use strict";
var Range = require("../range").Range; var Range = require("../range").Range;
var MatchingBraceOutdent = function () { };
var MatchingBraceOutdent = function() {}; (function () {
this.checkOutdent = function (line, input) {
(function() { if (!/^\s+$/.test(line))
this.checkOutdent = function(line, input) {
if (! /^\s+$/.test(line))
return false; return false;
return /^\s*\}/.test(input); return /^\s*\}/.test(input);
}; };
this.autoOutdent = function (doc, row) {
this.autoOutdent = function(doc, row) {
var line = doc.getLine(row); var line = doc.getLine(row);
var match = line.match(/^(\s*\})/); var match = line.match(/^(\s*\})/);
if (!match)
if (!match) return 0; return 0;
var column = match[1].length; var column = match[1].length;
var openBracePos = doc.findMatchingBracket({row: row, column: column}); var openBracePos = doc.findMatchingBracket({ row: row, column: column });
if (!openBracePos || openBracePos.row == row)
if (!openBracePos || openBracePos.row == row) return 0; return 0;
var indent = this.$getIndent(doc.getLine(openBracePos.row)); var indent = this.$getIndent(doc.getLine(openBracePos.row));
doc.replace(new Range(row, 0, row, column-1), indent); doc.replace(new Range(row, 0, row, column - 1), indent);
}; };
this.$getIndent = function (line) {
this.$getIndent = function(line) {
return line.match(/^\s*/)[0]; return line.match(/^\s*/)[0];
}; };
}).call(MatchingBraceOutdent.prototype); }).call(MatchingBraceOutdent.prototype);
exports.MatchingBraceOutdent = MatchingBraceOutdent; exports.MatchingBraceOutdent = MatchingBraceOutdent;
}); });
define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var DocCommentHighlightRules = function () {
var DocCommentHighlightRules = function() {
this.$rules = { this.$rules = {
"start" : [ { "start": [
token : "comment.doc.tag", {
regex : "@[\\w\\d_]+" // TODO: fix email addresses token: "comment.doc.tag",
}, regex: "@\\w+(?=\\s|$)"
DocCommentHighlightRules.getTagRule(), }, DocCommentHighlightRules.getTagRule(), {
{ defaultToken: "comment.doc",
defaultToken : "comment.doc", caseInsensitive: true
caseInsensitive: true }
}] ]
}; };
}; };
oop.inherits(DocCommentHighlightRules, TextHighlightRules); oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getTagRule = function (start) {
DocCommentHighlightRules.getTagRule = function(start) {
return { return {
token : "comment.doc.tag.storage.type", token: "comment.doc.tag.storage.type",
regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" regex: "\\b(?:TODO|FIXME|XXX|HACK)\\b"
}; };
}; };
DocCommentHighlightRules.getStartRule = function (start) {
DocCommentHighlightRules.getStartRule = function(start) {
return { return {
token : "comment.doc", // doc comment token: "comment.doc", // doc comment
regex : "\\/\\*(?=\\*)", regex: "\\/\\*(?=\\*)",
next : start next: start
}; };
}; };
DocCommentHighlightRules.getEndRule = function (start) { DocCommentHighlightRules.getEndRule = function (start) {
return { return {
token : "comment.doc", // closing comment token: "comment.doc", // closing comment
regex : "\\*\\/", regex: "\\*\\/",
next : start next: start
}; };
}; };
exports.DocCommentHighlightRules = DocCommentHighlightRules; exports.DocCommentHighlightRules = DocCommentHighlightRules;
}); });
define("ace/mode/dot_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules","ace/mode/doc_comment_highlight_rules"], function(require, exports, module) { define("ace/mode/dot_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules","ace/mode/doc_comment_highlight_rules"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var lang = require("../lib/lang"); var lang = require("../lib/lang");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
var DotHighlightRules = function () {
var DotHighlightRules = function() { var keywords = lang.arrayToMap(("strict|node|edge|graph|digraph|subgraph").split("|"));
var attributes = lang.arrayToMap(("damping|k|url|area|arrowhead|arrowsize|arrowtail|aspect|bb|bgcolor|center|charset|clusterrank|color|colorscheme|comment|compound|concentrate|constraint|decorate|defaultdist|dim|dimen|dir|diredgeconstraints|distortion|dpi|edgeurl|edgehref|edgetarget|edgetooltip|epsilon|esep|fillcolor|fixedsize|fontcolor|fontname|fontnames|fontpath|fontsize|forcelabels|gradientangle|group|headurl|head_lp|headclip|headhref|headlabel|headport|headtarget|headtooltip|height|href|id|image|imagepath|imagescale|label|labelurl|label_scheme|labelangle|labeldistance|labelfloat|labelfontcolor|labelfontname|labelfontsize|labelhref|labeljust|labelloc|labeltarget|labeltooltip|landscape|layer|layerlistsep|layers|layerselect|layersep|layout|len|levels|levelsgap|lhead|lheight|lp|ltail|lwidth|margin|maxiter|mclimit|mindist|minlen|mode|model|mosek|nodesep|nojustify|normalize|nslimit|nslimit1|ordering|orientation|outputorder|overlap|overlap_scaling|pack|packmode|pad|page|pagedir|pencolor|penwidth|peripheries|pin|pos|quadtree|quantum|rank|rankdir|ranksep|ratio|rects|regular|remincross|repulsiveforce|resolution|root|rotate|rotation|samehead|sametail|samplepoints|scale|searchsize|sep|shape|shapefile|showboxes|sides|size|skew|smoothing|sortv|splines|start|style|stylesheet|tailurl|tail_lp|tailclip|tailhref|taillabel|tailport|tailtarget|tailtooltip|target|tooltip|truecolor|vertices|viewport|voro_margin|weight|width|xlabel|xlp|z").split("|"));
var keywords = lang.arrayToMap( this.$rules = {
("strict|node|edge|graph|digraph|subgraph").split("|") "start": [
);
var attributes = lang.arrayToMap(
("damping|k|url|area|arrowhead|arrowsize|arrowtail|aspect|bb|bgcolor|center|charset|clusterrank|color|colorscheme|comment|compound|concentrate|constraint|decorate|defaultdist|dim|dimen|dir|diredgeconstraints|distortion|dpi|edgeurl|edgehref|edgetarget|edgetooltip|epsilon|esep|fillcolor|fixedsize|fontcolor|fontname|fontnames|fontpath|fontsize|forcelabels|gradientangle|group|headurl|head_lp|headclip|headhref|headlabel|headport|headtarget|headtooltip|height|href|id|image|imagepath|imagescale|label|labelurl|label_scheme|labelangle|labeldistance|labelfloat|labelfontcolor|labelfontname|labelfontsize|labelhref|labeljust|labelloc|labeltarget|labeltooltip|landscape|layer|layerlistsep|layers|layerselect|layersep|layout|len|levels|levelsgap|lhead|lheight|lp|ltail|lwidth|margin|maxiter|mclimit|mindist|minlen|mode|model|mosek|nodesep|nojustify|normalize|nslimit|nslimit1|ordering|orientation|outputorder|overlap|overlap_scaling|pack|packmode|pad|page|pagedir|pencolor|penwidth|peripheries|pin|pos|quadtree|quantum|rank|rankdir|ranksep|ratio|rects|regular|remincross|repulsiveforce|resolution|root|rotate|rotation|samehead|sametail|samplepoints|scale|searchsize|sep|shape|shapefile|showboxes|sides|size|skew|smoothing|sortv|splines|start|style|stylesheet|tailurl|tail_lp|tailclip|tailhref|taillabel|tailport|tailtarget|tailtooltip|target|tooltip|truecolor|vertices|viewport|voro_margin|weight|width|xlabel|xlp|z").split("|")
);
this.$rules = {
"start" : [
{ {
token : "comment", token: "comment",
regex : /\/\/.*$/ regex: /\/\/.*$/
}, { }, {
token : "comment", token: "comment",
regex : /#.*$/ regex: /#.*$/
}, { }, {
token : "comment", // multi line comment token: "comment", // multi line comment
merge : true, merge: true,
regex : /\/\*/, regex: /\/\*/,
next : "comment" next: "comment"
}, { }, {
token : "string", token: "string",
regex : "'(?=.)", regex: "'(?=.)",
next : "qstring" next: "qstring"
}, { }, {
token : "string", token: "string",
regex : '"(?=.)', regex: '"(?=.)',
next : "qqstring" next: "qqstring"
}, { }, {
token : "constant.numeric", token: "constant.numeric",
regex : /[+\-]?\d+(?:(?:\.\d*)?(?:[eE][+\-]?\d+)?)?\b/ regex: /[+\-]?\d+(?:(?:\.\d*)?(?:[eE][+\-]?\d+)?)?\b/
}, { }, {
token : "keyword.operator", token: "keyword.operator",
regex : /\+|=|\->/ regex: /\+|=|\->/
}, { }, {
token : "punctuation.operator", token: "punctuation.operator",
regex : /,|;/ regex: /,|;/
}, { }, {
token : "paren.lparen", token: "paren.lparen",
regex : /[\[{]/ regex: /[\[{]/
}, { }, {
token : "paren.rparen", token: "paren.rparen",
regex : /[\]}]/ regex: /[\]}]/
}, { }, {
token: "comment", token: "comment",
regex: /^#!.*$/ regex: /^#!.*$/
}, { }, {
token: function(value) { token: function (value) {
if (keywords.hasOwnProperty(value.toLowerCase())) { if (keywords.hasOwnProperty(value.toLowerCase())) {
return "keyword"; return "keyword";
} }
@ -158,143 +128,117 @@ var DotHighlightRules = function() {
} }
}, },
regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*" regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
}
],
"comment" : [
{
token : "comment", // closing comment
regex : "\\*\\/",
next : "start"
}, {
defaultToken : "comment"
} }
], ],
"qqstring" : [ "comment": [
{ {
token : "string", token: "comment", // closing comment
regex : '[^"\\\\]+', regex: "\\*\\/",
merge : true next: "start"
}, { }, {
token : "string", defaultToken: "comment"
regex : "\\\\$",
next : "qqstring",
merge : true
}, {
token : "string",
regex : '"|$',
next : "start",
merge : true
} }
], ],
"qstring" : [ "qqstring": [
{ {
token : "string", token: "string",
regex : "[^'\\\\]+", regex: '[^"\\\\]+',
merge : true merge: true
}, { }, {
token : "string", token: "string",
regex : "\\\\$", regex: "\\\\$",
next : "qstring", next: "qqstring",
merge : true merge: true
}, { }, {
token : "string", token: "string",
regex : "'|$", regex: '"|$',
next : "start", next: "start",
merge : true merge: true
}
],
"qstring": [
{
token: "string",
regex: "[^'\\\\]+",
merge: true
}, {
token: "string",
regex: "\\\\$",
next: "qstring",
merge: true
}, {
token: "string",
regex: "'|$",
next: "start",
merge: true
} }
] ]
}; };
}; };
oop.inherits(DotHighlightRules, TextHighlightRules); oop.inherits(DotHighlightRules, TextHighlightRules);
exports.DotHighlightRules = DotHighlightRules; exports.DotHighlightRules = DotHighlightRules;
}); });
define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../../lib/oop"); var oop = require("../../lib/oop");
var Range = require("../../range").Range; var Range = require("../../range").Range;
var BaseFoldMode = require("./fold_mode").FoldMode; var BaseFoldMode = require("./fold_mode").FoldMode;
var FoldMode = exports.FoldMode = function (commentRegex) {
var FoldMode = exports.FoldMode = function(commentRegex) {
if (commentRegex) { if (commentRegex) {
this.foldingStartMarker = new RegExp( this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
);
this.foldingStopMarker = new RegExp(
this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
);
} }
}; };
oop.inherits(FoldMode, BaseFoldMode); oop.inherits(FoldMode, BaseFoldMode);
(function () {
(function() {
this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/; this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/; this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
this._getFoldWidgetBase = this.getFoldWidget; this._getFoldWidgetBase = this.getFoldWidget;
this.getFoldWidget = function(session, foldStyle, row) { this.getFoldWidget = function (session, foldStyle, row) {
var line = session.getLine(row); var line = session.getLine(row);
if (this.singleLineBlockCommentRe.test(line)) { if (this.singleLineBlockCommentRe.test(line)) {
if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
return ""; return "";
} }
var fw = this._getFoldWidgetBase(session, foldStyle, row); var fw = this._getFoldWidgetBase(session, foldStyle, row);
if (!fw && this.startRegionRe.test(line)) if (!fw && this.startRegionRe.test(line))
return "start"; // lineCommentRegionStart return "start"; // lineCommentRegionStart
return fw; return fw;
}; };
this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
var line = session.getLine(row); var line = session.getLine(row);
if (this.startRegionRe.test(line)) if (this.startRegionRe.test(line))
return this.getCommentRegionBlock(session, line, row); return this.getCommentRegionBlock(session, line, row);
var match = line.match(this.foldingStartMarker); var match = line.match(this.foldingStartMarker);
if (match) { if (match) {
var i = match.index; var i = match.index;
if (match[1]) if (match[1])
return this.openingBracketBlock(session, match[1], row, i); return this.openingBracketBlock(session, match[1], row, i);
var range = session.getCommentFoldRange(row, i + match[0].length, 1); var range = session.getCommentFoldRange(row, i + match[0].length, 1);
if (range && !range.isMultiLine()) { if (range && !range.isMultiLine()) {
if (forceMultiline) { if (forceMultiline) {
range = this.getSectionRange(session, row); range = this.getSectionRange(session, row);
} else if (foldStyle != "all") }
else if (foldStyle != "all")
range = null; range = null;
} }
return range; return range;
} }
if (foldStyle === "markbegin") if (foldStyle === "markbegin")
return; return;
var match = line.match(this.foldingStopMarker); var match = line.match(this.foldingStopMarker);
if (match) { if (match) {
var i = match.index + match[0].length; var i = match.index + match[0].length;
if (match[1]) if (match[1])
return this.closingBracketBlock(session, match[1], row, i); return this.closingBracketBlock(session, match[1], row, i);
return session.getCommentFoldRange(row, i, -1); return session.getCommentFoldRange(row, i, -1);
} }
}; };
this.getSectionRange = function (session, row) {
this.getSectionRange = function(session, row) {
var line = session.getLine(row); var line = session.getLine(row);
var startIndent = line.search(/\S/); var startIndent = line.search(/\S/);
var startRow = row; var startRow = row;
@ -307,104 +251,98 @@ oop.inherits(FoldMode, BaseFoldMode);
var indent = line.search(/\S/); var indent = line.search(/\S/);
if (indent === -1) if (indent === -1)
continue; continue;
if (startIndent > indent) if (startIndent > indent)
break; break;
var subRange = this.getFoldWidgetRange(session, "all", row); var subRange = this.getFoldWidgetRange(session, "all", row);
if (subRange) { if (subRange) {
if (subRange.start.row <= startRow) { if (subRange.start.row <= startRow) {
break; break;
} else if (subRange.isMultiLine()) { }
else if (subRange.isMultiLine()) {
row = subRange.end.row; row = subRange.end.row;
} else if (startIndent == indent) { }
else if (startIndent == indent) {
break; break;
} }
} }
endRow = row; endRow = row;
} }
return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
}; };
this.getCommentRegionBlock = function(session, line, row) { this.getCommentRegionBlock = function (session, line, row) {
var startColumn = line.search(/\s*$/); var startColumn = line.search(/\s*$/);
var maxRow = session.getLength(); var maxRow = session.getLength();
var startRow = row; var startRow = row;
var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
var depth = 1; var depth = 1;
while (++row < maxRow) { while (++row < maxRow) {
line = session.getLine(row); line = session.getLine(row);
var m = re.exec(line); var m = re.exec(line);
if (!m) continue; if (!m)
if (m[1]) depth--; continue;
else depth++; if (m[1])
depth--;
if (!depth) break; else
depth++;
if (!depth)
break;
} }
var endRow = row; var endRow = row;
if (endRow > startRow) { if (endRow > startRow) {
return new Range(startRow, startColumn, endRow, line.length); return new Range(startRow, startColumn, endRow, line.length);
} }
}; };
}).call(FoldMode.prototype); }).call(FoldMode.prototype);
}); });
define("ace/mode/dot",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/matching_brace_outdent","ace/mode/dot_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) { define("ace/mode/dot",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/matching_brace_outdent","ace/mode/dot_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextMode = require("./text").Mode; var TextMode = require("./text").Mode;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var DotHighlightRules = require("./dot_highlight_rules").DotHighlightRules; var DotHighlightRules = require("./dot_highlight_rules").DotHighlightRules;
var DotFoldMode = require("./folding/cstyle").FoldMode; var DotFoldMode = require("./folding/cstyle").FoldMode;
var Mode = function () {
var Mode = function() {
this.HighlightRules = DotHighlightRules; this.HighlightRules = DotHighlightRules;
this.$outdent = new MatchingBraceOutdent(); this.$outdent = new MatchingBraceOutdent();
this.foldingRules = new DotFoldMode(); this.foldingRules = new DotFoldMode();
this.$behaviour = this.$defaultBehaviour; this.$behaviour = this.$defaultBehaviour;
}; };
oop.inherits(Mode, TextMode); oop.inherits(Mode, TextMode);
(function () {
(function() {
this.lineCommentStart = ["//", "#"]; this.lineCommentStart = ["//", "#"];
this.blockComment = {start: "/*", end: "*/"}; this.blockComment = { start: "/*", end: "*/" };
this.getNextLineIndent = function (state, line, tab) {
this.getNextLineIndent = function(state, line, tab) {
var indent = this.$getIndent(line); var indent = this.$getIndent(line);
var tokenizedLine = this.getTokenizer().getLineTokens(line, state); var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
var tokens = tokenizedLine.tokens; var tokens = tokenizedLine.tokens;
var endState = tokenizedLine.state; var endState = tokenizedLine.state;
if (tokens.length && tokens[tokens.length - 1].type == "comment") {
if (tokens.length && tokens[tokens.length-1].type == "comment") {
return indent; return indent;
} }
if (state == "start") { if (state == "start") {
var match = line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/); var match = line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/);
if (match) { if (match) {
indent += tab; indent += tab;
} }
} }
return indent; return indent;
}; };
this.checkOutdent = function (state, line, input) {
this.checkOutdent = function(state, line, input) {
return this.$outdent.checkOutdent(line, input); return this.$outdent.checkOutdent(line, input);
}; };
this.autoOutdent = function (state, doc, row) {
this.autoOutdent = function(state, doc, row) {
this.$outdent.autoOutdent(doc, row); this.$outdent.autoOutdent(doc, row);
}; };
this.$id = "ace/mode/dot"; this.$id = "ace/mode/dot";
}).call(Mode.prototype); }).call(Mode.prototype);
exports.Mode = Mode; exports.Mode = Mode;
});
}); (function() {
window.require(["ace/mode/dot"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

View File

@ -1,187 +1,308 @@
define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var DocCommentHighlightRules = function () {
var DocCommentHighlightRules = function() {
this.$rules = { this.$rules = {
"start" : [ { "start": [
token : "comment.doc.tag", {
regex : "@[\\w\\d_]+" // TODO: fix email addresses token: "comment.doc.tag",
}, regex: "@\\w+(?=\\s|$)"
DocCommentHighlightRules.getTagRule(), }, DocCommentHighlightRules.getTagRule(), {
{ defaultToken: "comment.doc",
defaultToken : "comment.doc", caseInsensitive: true
caseInsensitive: true }
}] ]
}; };
}; };
oop.inherits(DocCommentHighlightRules, TextHighlightRules); oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getTagRule = function (start) {
DocCommentHighlightRules.getTagRule = function(start) {
return { return {
token : "comment.doc.tag.storage.type", token: "comment.doc.tag.storage.type",
regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" regex: "\\b(?:TODO|FIXME|XXX|HACK)\\b"
}; };
}; };
DocCommentHighlightRules.getStartRule = function (start) {
DocCommentHighlightRules.getStartRule = function(start) {
return { return {
token : "comment.doc", // doc comment token: "comment.doc", // doc comment
regex : "\\/\\*(?=\\*)", regex: "\\/\\*(?=\\*)",
next : start next: start
}; };
}; };
DocCommentHighlightRules.getEndRule = function (start) { DocCommentHighlightRules.getEndRule = function (start) {
return { return {
token : "comment.doc", // closing comment token: "comment.doc", // closing comment
regex : "\\*\\/", regex: "\\*\\/",
next : start next: start
}; };
}; };
exports.DocCommentHighlightRules = DocCommentHighlightRules; exports.DocCommentHighlightRules = DocCommentHighlightRules;
}); });
define("ace/mode/java_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { define("ace/mode/java_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var JavaHighlightRules = function () {
var JavaHighlightRules = function() { var identifierRe = "[a-zA-Z_$][a-zA-Z0-9_$]*";
var keywords = ( var keywords = ("abstract|continue|for|new|switch|" +
"abstract|continue|for|new|switch|" + "assert|default|goto|package|synchronized|" +
"assert|default|goto|package|synchronized|" + "boolean|do|if|private|this|" +
"boolean|do|if|private|this|" + "break|double|implements|protected|throw|" +
"break|double|implements|protected|throw|" + "byte|else|import|public|throws|" +
"byte|else|import|public|throws|" + "case|enum|instanceof|return|transient|" +
"case|enum|instanceof|return|transient|" + "catch|extends|int|short|try|" +
"catch|extends|int|short|try|" + "char|final|interface|static|void|" +
"char|final|interface|static|void|" + "class|finally|long|strictfp|volatile|" +
"class|finally|long|strictfp|volatile|" + "const|float|native|super|while|" +
"const|float|native|super|while" "var|exports|opens|requires|uses|yield|" +
); "module|permits|(?:non\\-)?sealed|var|" +
"provides|to|when|" +
"open|record|transitive|with");
var buildinConstants = ("null|Infinity|NaN|undefined"); var buildinConstants = ("null|Infinity|NaN|undefined");
var langClasses = ("AbstractMethodError|AssertionError|ClassCircularityError|" +
"ClassFormatError|Deprecated|EnumConstantNotPresentException|" +
var langClasses = ( "ExceptionInInitializerError|IllegalAccessError|" +
"AbstractMethodError|AssertionError|ClassCircularityError|"+ "IllegalThreadStateException|InstantiationError|InternalError|" +
"ClassFormatError|Deprecated|EnumConstantNotPresentException|"+ "NegativeArraySizeException|NoSuchFieldError|Override|Process|" +
"ExceptionInInitializerError|IllegalAccessError|"+ "ProcessBuilder|SecurityManager|StringIndexOutOfBoundsException|" +
"IllegalThreadStateException|InstantiationError|InternalError|"+ "SuppressWarnings|TypeNotPresentException|UnknownError|" +
"NegativeArraySizeException|NoSuchFieldError|Override|Process|"+ "UnsatisfiedLinkError|UnsupportedClassVersionError|VerifyError|" +
"ProcessBuilder|SecurityManager|StringIndexOutOfBoundsException|"+ "InstantiationException|IndexOutOfBoundsException|" +
"SuppressWarnings|TypeNotPresentException|UnknownError|"+ "ArrayIndexOutOfBoundsException|CloneNotSupportedException|" +
"UnsatisfiedLinkError|UnsupportedClassVersionError|VerifyError|"+ "NoSuchFieldException|IllegalArgumentException|NumberFormatException|" +
"InstantiationException|IndexOutOfBoundsException|"+ "SecurityException|Void|InheritableThreadLocal|IllegalStateException|" +
"ArrayIndexOutOfBoundsException|CloneNotSupportedException|"+ "InterruptedException|NoSuchMethodException|IllegalAccessException|" +
"NoSuchFieldException|IllegalArgumentException|NumberFormatException|"+ "UnsupportedOperationException|Enum|StrictMath|Package|Compiler|" +
"SecurityException|Void|InheritableThreadLocal|IllegalStateException|"+ "Readable|Runtime|StringBuilder|Math|IncompatibleClassChangeError|" +
"InterruptedException|NoSuchMethodException|IllegalAccessException|"+ "NoSuchMethodError|ThreadLocal|RuntimePermission|ArithmeticException|" +
"UnsupportedOperationException|Enum|StrictMath|Package|Compiler|"+ "NullPointerException|Long|Integer|Short|Byte|Double|Number|Float|" +
"Readable|Runtime|StringBuilder|Math|IncompatibleClassChangeError|"+ "Character|Boolean|StackTraceElement|Appendable|StringBuffer|" +
"NoSuchMethodError|ThreadLocal|RuntimePermission|ArithmeticException|"+ "Iterable|ThreadGroup|Runnable|Thread|IllegalMonitorStateException|" +
"NullPointerException|Long|Integer|Short|Byte|Double|Number|Float|"+ "StackOverflowError|OutOfMemoryError|VirtualMachineError|" +
"Character|Boolean|StackTraceElement|Appendable|StringBuffer|"+ "ArrayStoreException|ClassCastException|LinkageError|" +
"Iterable|ThreadGroup|Runnable|Thread|IllegalMonitorStateException|"+ "NoClassDefFoundError|ClassNotFoundException|RuntimeException|" +
"StackOverflowError|OutOfMemoryError|VirtualMachineError|"+ "Exception|ThreadDeath|Error|Throwable|System|ClassLoader|" +
"ArrayStoreException|ClassCastException|LinkageError|"+ "Cloneable|Class|CharSequence|Comparable|String|Object");
"NoClassDefFoundError|ClassNotFoundException|RuntimeException|"+
"Exception|ThreadDeath|Error|Throwable|System|ClassLoader|"+
"Cloneable|Class|CharSequence|Comparable|String|Object"
);
var keywordMapper = this.createKeywordMapper({ var keywordMapper = this.createKeywordMapper({
"variable.language": "this", "variable.language": "this",
"keyword": keywords,
"constant.language": buildinConstants, "constant.language": buildinConstants,
"support.function": langClasses "support.function": langClasses
}, "identifier"); }, "identifier");
this.$rules = { this.$rules = {
"start" : [ "start": [
{ {
token : "comment", token: "comment",
regex : "\\/\\/.*$" regex: "\\/\\/.*$"
}, },
DocCommentHighlightRules.getStartRule("doc-start"), DocCommentHighlightRules.getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token: "comment", // multi line comment
regex : "\\/\\*", regex: "\\/\\*",
next : "comment" next: "comment"
},
{ include: "multiline-strings" },
{ include: "strings" },
{ include: "constants" },
{
regex: "(open(?:\\s+))?module(?=\\s*\\w)",
token: "keyword",
next: [{
regex: "{",
token: "paren.lparen",
next: [{
regex: "}",
token: "paren.rparen",
next: "start"
}, {
regex: "\\b(requires|transitive|exports|opens|to|uses|provides|with)\\b",
token: "keyword"
}]
}, {
token: "text",
regex: "\\s+"
}, {
token: "identifier",
regex: "\\w+"
}, {
token: "punctuation.operator",
regex: "."
}, {
token: "text",
regex: "\\s+"
}, {
regex: "", // exit if there is anything else
next: "start"
}]
},
{ include: "statements" }
],
"comment": [
{
token: "comment", // closing comment
regex: "\\*\\/",
next: "start"
}, { }, {
token : "string", // single line defaultToken: "comment"
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
}, {
token : "string", // single line
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
}, {
token : "constant.numeric", // hex
regex : /0(?:[xX][0-9a-fA-F][0-9a-fA-F_]*|[bB][01][01_]*)[LlSsDdFfYy]?\b/
}, {
token : "constant.numeric", // float
regex : /[+-]?\d[\d_]*(?:(?:\.[\d_]*)?(?:[eE][+-]?[\d_]+)?)?[LlSsDdFfYy]?\b/
}, {
token : "constant.language.boolean",
regex : "(?:true|false)\\b"
}, {
token : keywordMapper,
regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
}, {
token : "keyword.operator",
regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"
}, {
token : "lparen",
regex : "[[({]"
}, {
token : "rparen",
regex : "[\\])}]"
}, {
token : "text",
regex : "\\s+"
} }
], ],
"comment" : [ "strings": [
{ {
token : "comment", // closing comment token: ["punctuation", "string"],
regex : "\\*\\/", regex: /(\.)(")/,
next : "start" push: [
{
token: "lparen",
regex: /\\\{/,
push: [
{
token: "text",
regex: /$/,
next: "start"
}, {
token: "rparen",
regex: /}/,
next: "pop"
}, {
include: "strings"
}, {
include: "constants"
}, {
include: "statements"
}
]
}, {
token: "string",
regex: /"/,
next: "pop"
}, {
defaultToken: "string"
}
]
}, { }, {
defaultToken : "comment" token: "string", // single line
regex: '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
}, {
token: "string", // single line
regex: "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
}
],
"multiline-strings": [
{
token: ["punctuation", "string"],
regex: /(\.)(""")/,
push: [
{
token: "string",
regex: '"""',
next: "pop"
}, {
token: "lparen",
regex: /\\\{/,
push: [
{
token: "text",
regex: /$/,
next: "start"
}, {
token: "rparen",
regex: /}/,
next: "pop"
}, {
include: "multiline-strings"
}, {
include: "strings"
}, {
include: "constants"
}, {
include: "statements"
}
]
}, {
token: "constant.language.escape",
regex: /\\./
}, {
defaultToken: "string"
}
]
},
{
token: "string",
regex: '"""',
push: [
{
token: "string",
regex: '"""',
next: "pop"
}, {
token: "constant.language.escape",
regex: /\\./
}, {
defaultToken: "string"
}
]
}
],
"constants": [
{
token: "constant.numeric", // hex
regex: /0(?:[xX][0-9a-fA-F][0-9a-fA-F_]*|[bB][01][01_]*)[LlSsDdFfYy]?\b/
}, {
token: "constant.numeric", // float
regex: /[+-]?\d[\d_]*(?:(?:\.[\d_]*)?(?:[eE][+-]?[\d_]+)?)?[LlSsDdFfYy]?\b/
}, {
token: "constant.language.boolean",
regex: "(?:true|false)\\b"
}
],
"statements": [
{
token: ["keyword", "text", "identifier"],
regex: "(record)(\\s+)(" + identifierRe + ")\\b"
},
{
token: "keyword",
regex: "(?:" + keywords + ")\\b"
}, {
token: "storage.type.annotation",
regex: "@" + identifierRe + "\\b"
}, {
token: "entity.name.function",
regex: identifierRe + "(?=\\()"
}, {
token: keywordMapper, // TODO: Unicode escape sequences
regex: identifierRe + "\\b"
}, {
token: "keyword.operator",
regex: "!|\\$|%|&|\\||\\^|\\*|\\/|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?|\\:|\\*=|\\/=|%=|\\+=|\\-=|&=|\\|=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"
}, {
token: "lparen",
regex: "[[({]"
}, {
token: "rparen",
regex: "[\\])}]"
}, {
token: "text",
regex: "\\s+"
} }
] ]
}; };
this.embedRules(DocCommentHighlightRules, "doc-", [DocCommentHighlightRules.getEndRule("start")]);
this.embedRules(DocCommentHighlightRules, "doc-", this.normalizeRules();
[ DocCommentHighlightRules.getEndRule("start") ]);
}; };
oop.inherits(JavaHighlightRules, TextHighlightRules); oop.inherits(JavaHighlightRules, TextHighlightRules);
exports.JavaHighlightRules = JavaHighlightRules; exports.JavaHighlightRules = JavaHighlightRules;
}); });
define("ace/mode/drools_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules","ace/mode/java_highlight_rules","ace/mode/doc_comment_highlight_rules"], function(require, exports, module) { define("ace/mode/drools_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules","ace/mode/java_highlight_rules","ace/mode/doc_comment_highlight_rules"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var JavaHighlightRules = require("./java_highlight_rules").JavaHighlightRules; var JavaHighlightRules = require("./java_highlight_rules").JavaHighlightRules;
var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*"; var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
var packageIdentifierRe = "[a-zA-Z\\$_\u00a1-\uffff][\\.a-zA-Z\\d\\$_\u00a1-\uffff]*"; var packageIdentifierRe = "[a-zA-Z\\$_\u00a1-\uffff][\\.a-zA-Z\\d\\$_\u00a1-\uffff]*";
var DroolsHighlightRules = function () {
var DroolsHighlightRules = function() {
var keywords = ("date|effective|expires|lock|on|active|no|loop|auto|focus" + var keywords = ("date|effective|expires|lock|on|active|no|loop|auto|focus" +
"|activation|group|agenda|ruleflow|duration|timer|calendars|refract|direct" + "|activation|group|agenda|ruleflow|duration|timer|calendars|refract|direct" +
"|dialect|salience|enabled|attributes|extends|template" + "|dialect|salience|enabled|attributes|extends|template" +
@ -191,222 +312,201 @@ var DroolsHighlightRules = function() {
"|int|long|float|double|this|void|class|new|case|final|if|else|for|while|do" + "|int|long|float|double|this|void|class|new|case|final|if|else|for|while|do" +
"|default|try|catch|finally|switch|synchronized|return|throw|break|continue|assert" + "|default|try|catch|finally|switch|synchronized|return|throw|break|continue|assert" +
"|modify|static|public|protected|private|abstract|native|transient|volatile" + "|modify|static|public|protected|private|abstract|native|transient|volatile" +
"|strictfp|throws|interface|enum|implements|type|window|trait|no-loop|str" "|strictfp|throws|interface|enum|implements|type|window|trait|no-loop|str");
); var langClasses = ("AbstractMethodError|AssertionError|ClassCircularityError|" +
"ClassFormatError|Deprecated|EnumConstantNotPresentException|" +
var langClasses = ( "ExceptionInInitializerError|IllegalAccessError|" +
"AbstractMethodError|AssertionError|ClassCircularityError|"+ "IllegalThreadStateException|InstantiationError|InternalError|" +
"ClassFormatError|Deprecated|EnumConstantNotPresentException|"+ "NegativeArraySizeException|NoSuchFieldError|Override|Process|" +
"ExceptionInInitializerError|IllegalAccessError|"+ "ProcessBuilder|SecurityManager|StringIndexOutOfBoundsException|" +
"IllegalThreadStateException|InstantiationError|InternalError|"+ "SuppressWarnings|TypeNotPresentException|UnknownError|" +
"NegativeArraySizeException|NoSuchFieldError|Override|Process|"+ "UnsatisfiedLinkError|UnsupportedClassVersionError|VerifyError|" +
"ProcessBuilder|SecurityManager|StringIndexOutOfBoundsException|"+ "InstantiationException|IndexOutOfBoundsException|" +
"SuppressWarnings|TypeNotPresentException|UnknownError|"+ "ArrayIndexOutOfBoundsException|CloneNotSupportedException|" +
"UnsatisfiedLinkError|UnsupportedClassVersionError|VerifyError|"+ "NoSuchFieldException|IllegalArgumentException|NumberFormatException|" +
"InstantiationException|IndexOutOfBoundsException|"+ "SecurityException|Void|InheritableThreadLocal|IllegalStateException|" +
"ArrayIndexOutOfBoundsException|CloneNotSupportedException|"+ "InterruptedException|NoSuchMethodException|IllegalAccessException|" +
"NoSuchFieldException|IllegalArgumentException|NumberFormatException|"+ "UnsupportedOperationException|Enum|StrictMath|Package|Compiler|" +
"SecurityException|Void|InheritableThreadLocal|IllegalStateException|"+ "Readable|Runtime|StringBuilder|Math|IncompatibleClassChangeError|" +
"InterruptedException|NoSuchMethodException|IllegalAccessException|"+ "NoSuchMethodError|ThreadLocal|RuntimePermission|ArithmeticException|" +
"UnsupportedOperationException|Enum|StrictMath|Package|Compiler|"+ "NullPointerException|Long|Integer|Short|Byte|Double|Number|Float|" +
"Readable|Runtime|StringBuilder|Math|IncompatibleClassChangeError|"+ "Character|Boolean|StackTraceElement|Appendable|StringBuffer|" +
"NoSuchMethodError|ThreadLocal|RuntimePermission|ArithmeticException|"+ "Iterable|ThreadGroup|Runnable|Thread|IllegalMonitorStateException|" +
"NullPointerException|Long|Integer|Short|Byte|Double|Number|Float|"+ "StackOverflowError|OutOfMemoryError|VirtualMachineError|" +
"Character|Boolean|StackTraceElement|Appendable|StringBuffer|"+ "ArrayStoreException|ClassCastException|LinkageError|" +
"Iterable|ThreadGroup|Runnable|Thread|IllegalMonitorStateException|"+ "NoClassDefFoundError|ClassNotFoundException|RuntimeException|" +
"StackOverflowError|OutOfMemoryError|VirtualMachineError|"+ "Exception|ThreadDeath|Error|Throwable|System|ClassLoader|" +
"ArrayStoreException|ClassCastException|LinkageError|"+ "Cloneable|Class|CharSequence|Comparable|String|Object");
"NoClassDefFoundError|ClassNotFoundException|RuntimeException|"+
"Exception|ThreadDeath|Error|Throwable|System|ClassLoader|"+
"Cloneable|Class|CharSequence|Comparable|String|Object"
);
var keywordMapper = this.createKeywordMapper({ var keywordMapper = this.createKeywordMapper({
"variable.language": "this", "variable.language": "this",
"keyword": keywords, "keyword": keywords,
"constant.language": "null", "constant.language": "null",
"support.class" : langClasses, "support.class": langClasses,
"support.function" : "retract|update|modify|insert" "support.function": "retract|update|modify|insert"
}, "identifier"); }, "identifier");
var stringRules = function () {
var stringRules = function() {
return [{
token : "string", // single line
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
}, {
token : "string", // single line
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
}];
};
var basicPreRules = function(blockCommentRules) {
return [{ return [{
token : "comment", token: "string", // single line
regex : "\\/\\/.*$" regex: '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
}, }, {
DocCommentHighlightRules.getStartRule("doc-start"), token: "string", // single line
{ regex: "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
token : "comment", // multi line comment }];
regex : "\\/\\*", };
next : blockCommentRules var basicPreRules = function (blockCommentRules) {
}, { return [{
token : "constant.numeric", // hex token: "comment",
regex : "0[xX][0-9a-fA-F]+\\b" regex: "\\/\\/.*$"
}, { },
token : "constant.numeric", // float DocCommentHighlightRules.getStartRule("doc-start"),
regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" {
}, { token: "comment", // multi line comment
token : "constant.language.boolean", regex: "\\/\\*",
regex : "(?:true|false)\\b" next: blockCommentRules
}]; }, {
}; token: "constant.numeric", // hex
regex: "0[xX][0-9a-fA-F]+\\b"
var blockCommentRules = function(returnRule) { }, {
token: "constant.numeric", // float
regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
}, {
token: "constant.language.boolean",
regex: "(?:true|false)\\b"
}];
};
var blockCommentRules = function (returnRule) {
return [ return [
{ {
token : "comment.block", // closing comment token: "comment.block", // closing comment
regex : "\\*\\/", regex: "\\*\\/",
next : returnRule next: returnRule
}, { }, {
defaultToken : "comment.block" defaultToken: "comment.block"
} }
]; ];
}; };
var basicPostRules = function () {
var basicPostRules = function() {
return [{ return [{
token : keywordMapper, token: keywordMapper,
regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
}, { }, {
token : "keyword.operator", token: "keyword.operator",
regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)" regex: "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"
}, { }, {
token : "lparen", token: "lparen",
regex : "[[({]" regex: "[[({]"
}, { }, {
token : "rparen", token: "rparen",
regex : "[\\])}]" regex: "[\\])}]"
}, { }, {
token : "text", token: "text",
regex : "\\s+" regex: "\\s+"
}]; }];
}; };
this.$rules = { this.$rules = {
"start" : [].concat(basicPreRules("block.comment"), [ "start": [].concat(basicPreRules("block.comment"), [
{
token : "entity.name.type",
regex : "@[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
}, {
token : ["keyword","text","entity.name.type"],
regex : "(package)(\\s+)(" + packageIdentifierRe +")"
}, {
token : ["keyword","text","keyword","text","entity.name.type"],
regex : "(import)(\\s+)(function)(\\s+)(" + packageIdentifierRe +")"
}, {
token : ["keyword","text","entity.name.type"],
regex : "(import)(\\s+)(" + packageIdentifierRe +")"
}, {
token : ["keyword","text","entity.name.type","text","variable"],
regex : "(global)(\\s+)(" + packageIdentifierRe +")(\\s+)(" + identifierRe +")"
}, {
token : ["keyword","text","keyword","text","entity.name.type"],
regex : "(declare)(\\s+)(trait)(\\s+)(" + identifierRe +")"
}, {
token : ["keyword","text","entity.name.type"],
regex : "(declare)(\\s+)(" + identifierRe +")"
}, {
token : ["keyword","text","entity.name.type"],
regex : "(extends)(\\s+)(" + packageIdentifierRe +")"
}, {
token : ["keyword","text"],
regex : "(rule)(\\s+)",
next : "asset.name"
}],
stringRules(),
[{
token : ["variable.other","text","text"],
regex : "(" + identifierRe + ")(\\s*)(:)"
}, {
token : ["keyword","text"],
regex : "(query)(\\s+)",
next : "asset.name"
}, {
token : ["keyword","text"],
regex : "(when)(\\s*)"
}, {
token : ["keyword","text"],
regex : "(then)(\\s*)",
next : "java-start"
}, {
token : "paren.lparen",
regex : /[\[({]/
}, {
token : "paren.rparen",
regex : /[\])}]/
}], basicPostRules()),
"block.comment" : blockCommentRules("start"),
"asset.name" : [
{ {
token : "entity.name", token: "entity.name.type",
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' regex: "@[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
}, { }, {
token : "entity.name", token: ["keyword", "text", "entity.name.type"],
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" regex: "(package)(\\s+)(" + packageIdentifierRe + ")"
}, { }, {
token : "entity.name", token: ["keyword", "text", "keyword", "text", "entity.name.type"],
regex : identifierRe regex: "(import)(\\s+)(function)(\\s+)(" + packageIdentifierRe + ")"
}, {
token: ["keyword", "text", "entity.name.type"],
regex: "(import)(\\s+)(" + packageIdentifierRe + ")"
}, {
token: ["keyword", "text", "entity.name.type", "text", "variable"],
regex: "(global)(\\s+)(" + packageIdentifierRe + ")(\\s+)(" + identifierRe + ")"
}, {
token: ["keyword", "text", "keyword", "text", "entity.name.type"],
regex: "(declare)(\\s+)(trait)(\\s+)(" + identifierRe + ")"
}, {
token: ["keyword", "text", "entity.name.type"],
regex: "(declare)(\\s+)(" + identifierRe + ")"
}, {
token: ["keyword", "text", "entity.name.type"],
regex: "(extends)(\\s+)(" + packageIdentifierRe + ")"
}, {
token: ["keyword", "text"],
regex: "(rule)(\\s+)",
next: "asset.name"
}
], stringRules(), [{
token: ["variable.other", "text", "text"],
regex: "(" + identifierRe + ")(\\s*)(:)"
}, {
token: ["keyword", "text"],
regex: "(query)(\\s+)",
next: "asset.name"
}, {
token: ["keyword", "text"],
regex: "(when)(\\s*)"
}, {
token: ["keyword", "text"],
regex: "(then)(\\s*)",
next: "java-start"
}, {
token: "paren.lparen",
regex: /[\[({]/
}, {
token: "paren.rparen",
regex: /[\])}]/
}], basicPostRules()),
"block.comment": blockCommentRules("start"),
"asset.name": [
{
token: "entity.name",
regex: '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
}, {
token: "entity.name",
regex: "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
}, {
token: "entity.name",
regex: identifierRe
}, { }, {
regex: "", regex: "",
token: "empty", token: "empty",
next: "start" next: "start"
}] }
]
}; };
this.embedRules(DocCommentHighlightRules, "doc-", this.embedRules(DocCommentHighlightRules, "doc-", [DocCommentHighlightRules.getEndRule("start")]);
[ DocCommentHighlightRules.getEndRule("start") ]);
this.embedRules(JavaHighlightRules, "java-", [ this.embedRules(JavaHighlightRules, "java-", [
{ {
token : "support.function", token: "support.function",
regex: "\\b(insert|modify|retract|update)\\b" regex: "\\b(insert|modify|retract|update)\\b"
}, { }, {
token : "keyword", token: "keyword",
regex: "\\bend\\b", regex: "\\bend\\b",
next : "start" next: "start"
}]); }
]);
}; };
oop.inherits(DroolsHighlightRules, TextHighlightRules); oop.inherits(DroolsHighlightRules, TextHighlightRules);
exports.DroolsHighlightRules = DroolsHighlightRules; exports.DroolsHighlightRules = DroolsHighlightRules;
}); });
define("ace/mode/folding/drools",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode","ace/token_iterator"], function(require, exports, module) { define("ace/mode/folding/drools",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode","ace/token_iterator"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../../lib/oop"); var oop = require("../../lib/oop");
var Range = require("../../range").Range; var Range = require("../../range").Range;
var BaseFoldMode = require("./fold_mode").FoldMode; var BaseFoldMode = require("./fold_mode").FoldMode;
var TokenIterator = require("../../token_iterator").TokenIterator; var TokenIterator = require("../../token_iterator").TokenIterator;
var FoldMode = exports.FoldMode = function () { };
var FoldMode = exports.FoldMode = function() {};
oop.inherits(FoldMode, BaseFoldMode); oop.inherits(FoldMode, BaseFoldMode);
(function () {
(function() {
this.foldingStartMarker = /\b(rule|declare|query|when|then)\b/; this.foldingStartMarker = /\b(rule|declare|query|when|then)\b/;
this.foldingStopMarker = /\bend\b/; this.foldingStopMarker = /\bend\b/;
this.getFoldWidgetRange = function (session, foldStyle, row) {
this.getFoldWidgetRange = function(session, foldStyle, row) {
var line = session.getLine(row); var line = session.getLine(row);
var match = line.match(this.foldingStartMarker); var match = line.match(this.foldingStartMarker);
if (match) { if (match) {
var i = match.index; var i = match.index;
if (match[1]) { if (match[1]) {
var position = {row: row, column: line.length}; var position = { row: row, column: line.length };
var iterator = new TokenIterator(session, position.row, position.column); var iterator = new TokenIterator(session, position.row, position.column);
var seek = "end"; var seek = "end";
var token = iterator.getCurrentToken(); var token = iterator.getCurrentToken();
@ -415,7 +515,7 @@ oop.inherits(FoldMode, BaseFoldMode);
} }
while (token) { while (token) {
if (token.value == seek) { if (token.value == seek) {
return Range.fromPoints(position ,{ return Range.fromPoints(position, {
row: iterator.getCurrentTokenRow(), row: iterator.getCurrentTokenRow(),
column: iterator.getCurrentTokenColumn() column: iterator.getCurrentTokenColumn()
}); });
@ -423,35 +523,35 @@ oop.inherits(FoldMode, BaseFoldMode);
token = iterator.stepForward(); token = iterator.stepForward();
} }
} }
} }
}; };
}).call(FoldMode.prototype); }).call(FoldMode.prototype);
}); });
define("ace/mode/drools",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/drools_highlight_rules","ace/mode/folding/drools"], function(require, exports, module) { define("ace/mode/drools",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/drools_highlight_rules","ace/mode/folding/drools"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextMode = require("./text").Mode; var TextMode = require("./text").Mode;
var DroolsHighlightRules = require("./drools_highlight_rules").DroolsHighlightRules; var DroolsHighlightRules = require("./drools_highlight_rules").DroolsHighlightRules;
var DroolsFoldMode = require("./folding/drools").FoldMode; var DroolsFoldMode = require("./folding/drools").FoldMode;
var Mode = function () {
var Mode = function() {
this.HighlightRules = DroolsHighlightRules; this.HighlightRules = DroolsHighlightRules;
this.foldingRules = new DroolsFoldMode(); this.foldingRules = new DroolsFoldMode();
this.$behaviour = this.$defaultBehaviour; this.$behaviour = this.$defaultBehaviour;
}; };
oop.inherits(Mode, TextMode); oop.inherits(Mode, TextMode);
(function () {
(function() {
this.lineCommentStart = "//"; this.lineCommentStart = "//";
this.$id = "ace/mode/drools"; this.$id = "ace/mode/drools";
this.snippetFileId = "ace/snippets/drools";
}).call(Mode.prototype); }).call(Mode.prototype);
exports.Mode = Mode; exports.Mode = Mode;
}); }); (function() {
window.require(["ace/mode/drools"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

View File

@ -0,0 +1,130 @@
define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var DocCommentHighlightRules = function () {
this.$rules = {
"start": [
{
token: "comment.doc.tag",
regex: "@\\w+(?=\\s|$)"
}, DocCommentHighlightRules.getTagRule(), {
defaultToken: "comment.doc",
caseInsensitive: true
}
]
};
};
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getTagRule = function (start) {
return {
token: "comment.doc.tag.storage.type",
regex: "\\b(?:TODO|FIXME|XXX|HACK)\\b"
};
};
DocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
regex: "\\/\\*(?=\\*)",
next: start
};
};
DocCommentHighlightRules.getEndRule = function (start) {
return {
token: "comment.doc", // closing comment
regex: "\\*\\/",
next: start
};
};
exports.DocCommentHighlightRules = DocCommentHighlightRules;
});
define("ace/mode/edifact_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var EdifactHighlightRules = function () {
var header = ("UNH");
var segment = ("ADR|AGR|AJT|ALC|ALI|APP|APR|ARD|ARR|ASI|ATT|AUT|" +
"BAS|BGM|BII|BUS|" +
"CAV|CCD|CCI|CDI|CDS|CDV|CED|CIN|CLA|CLI|CMP|CNI|CNT|COD|COM|COT|CPI|CPS|CPT|CST|CTA|CUX|" +
"DAM|DFN|DGS|DII|DIM|DLI|DLM|DMS|DOC|DRD|DSG|DSI|DTM|" +
"EDT|EFI|ELM|ELU|ELV|EMP|EQA|EQD|EQN|ERC|ERP|EVE|FCA|FII|FNS|FNT|FOR|FSQ|FTX|" +
"GDS|GEI|GID|GIN|GIR|GOR|GPO|GRU|HAN|HYN|ICD|IDE|IFD|IHC|IMD|IND|INP|INV|IRQ|" +
"LAN|LIN|LOC|MEA|MEM|MKS|MOA|MSG|MTD|NAD|NAT|" +
"PAC|PAI|PAS|PCC|PCD|PCI|PDI|PER|PGI|PIA|PNA|POC|PRC|PRI|PRV|PSD|PTY|PYT|" +
"QRS|QTY|QUA|QVR|" +
"RCS|REL|RFF|RJL|RNG|ROD|RSL|RTE|" +
"SAL|SCC|SCD|SEG|SEL|SEQ|SFI|SGP|SGU|SPR|SPS|STA|STC|STG|STS|" +
"TAX|TCC|TDT|TEM|TMD|TMP|TOD|TPL|TRU|TSR|" +
"UNB|UNZ|UNT|UGH|UGT|UNS|" +
"VLI");
var header = ("UNH");
var buildinConstants = ("null|Infinity|NaN|undefined");
var langClasses = ("");
var keywords = ("BY|SE|ON|INV|JP|UNOA");
var keywordMapper = this.createKeywordMapper({
"variable.language": "this",
"keyword": keywords,
"entity.name.segment": segment,
"entity.name.header": header,
"constant.language": buildinConstants,
"support.function": langClasses
}, "identifier");
this.$rules = {
"start": [
{
token: "punctuation.operator",
regex: "\\+.\\+"
}, {
token: "constant.language.boolean",
regex: "(?:true|false)\\b"
}, {
token: keywordMapper,
regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
}, {
token: "keyword.operator",
regex: "\\+"
}, {
token: "punctuation.operator",
regex: "\\:|'"
}, {
token: "identifier",
regex: "\\:D\\:"
}
]
};
this.embedRules(DocCommentHighlightRules, "doc-", [DocCommentHighlightRules.getEndRule("start")]);
};
EdifactHighlightRules.metaData = { fileTypes: ['edi'],
keyEquivalent: '^~E',
name: 'Edifact',
scopeName: 'source.edifact' };
oop.inherits(EdifactHighlightRules, TextHighlightRules);
exports.EdifactHighlightRules = EdifactHighlightRules;
});
define("ace/mode/edifact",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/edifact_highlight_rules"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var EdifactHighlightRules = require("./edifact_highlight_rules").EdifactHighlightRules;
var Mode = function () {
this.HighlightRules = EdifactHighlightRules;
this.$behaviour = this.$defaultBehaviour;
};
oop.inherits(Mode, TextMode);
(function () {
this.$id = "ace/mode/edifact";
this.snippetFileId = "ace/snippets/edifact";
}).call(Mode.prototype);
exports.Mode = Mode;
}); (function() {
window.require(["ace/mode/edifact"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

View File

@ -1,25 +1,17 @@
define("ace/mode/eiffel_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { define("ace/mode/eiffel_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var EiffelHighlightRules = function () {
var EiffelHighlightRules = function() {
var keywords = "across|agent|alias|all|attached|as|assign|attribute|check|" + var keywords = "across|agent|alias|all|attached|as|assign|attribute|check|" +
"class|convert|create|debug|deferred|detachable|do|else|elseif|end|" + "class|convert|create|debug|deferred|detachable|do|else|elseif|end|" +
"ensure|expanded|export|external|feature|from|frozen|if|inherit|" + "ensure|expanded|export|external|feature|from|frozen|if|inherit|" +
"inspect|invariant|like|local|loop|not|note|obsolete|old|once|" + "inspect|invariant|like|local|loop|not|note|obsolete|old|once|" +
"Precursor|redefine|rename|require|rescue|retry|select|separate|" + "Precursor|redefine|rename|require|rescue|retry|select|separate|" +
"some|then|undefine|until|variant|when"; "some|then|undefine|until|variant|when";
var operatorKeywords = "and|implies|or|xor"; var operatorKeywords = "and|implies|or|xor";
var languageConstants = "Void"; var languageConstants = "Void";
var booleanConstants = "True|False"; var booleanConstants = "True|False";
var languageVariables = "Current|Result"; var languageVariables = "Current|Result";
var keywordMapper = this.createKeywordMapper({ var keywordMapper = this.createKeywordMapper({
"constant.language": languageConstants, "constant.language": languageConstants,
"constant.language.boolean": booleanConstants, "constant.language.boolean": booleanConstants,
@ -27,102 +19,102 @@ var EiffelHighlightRules = function() {
"keyword.operator": operatorKeywords, "keyword.operator": operatorKeywords,
"keyword": keywords "keyword": keywords
}, "identifier", true); }, "identifier", true);
var simpleString = /(?:[^"%\b\f\v]|%[A-DFHLNQR-V%'"()<>]|%\/(?:0[xX][\da-fA-F](?:_*[\da-fA-F])*|0[cC][0-7](?:_*[0-7])*|0[bB][01](?:_*[01])*|\d(?:_*\d)*)\/)+?/; var simpleString = /(?:[^"%\b\f\v]|%[A-DFHLNQR-V%'"()<>]|%\/(?:0[xX][\da-fA-F](?:_*[\da-fA-F])*|0[cC][0-7](?:_*[0-7])*|0[bB][01](?:_*[01])*|\d(?:_*\d)*)\/)+?/;
this.$rules = { this.$rules = {
"start": [{ "start": [{
token : "string.quoted.other", // Aligned-verbatim-strings (verbatim option not supported) token: "string.quoted.other", // Aligned-verbatim-strings (verbatim option not supported)
regex : /"\[/, regex: /"\[/,
next: "aligned_verbatim_string" next: "aligned_verbatim_string"
}, { }, {
token : "string.quoted.other", // Non-aligned-verbatim-strings (verbatim option not supported) token: "string.quoted.other", // Non-aligned-verbatim-strings (verbatim option not supported)
regex : /"\{/, regex: /"\{/,
next: "non-aligned_verbatim_string" next: "non-aligned_verbatim_string"
}, { }, {
token : "string.quoted.double", token: "string.quoted.double",
regex : /"(?:[^%\b\f\n\r\v]|%[A-DFHLNQR-V%'"()<>]|%\/(?:0[xX][\da-fA-F](?:_*[\da-fA-F])*|0[cC][0-7](?:_*[0-7])*|0[bB][01](?:_*[01])*|\d(?:_*\d)*)\/)*?"/ regex: /"(?:[^%\b\f\n\r\v]|%[A-DFHLNQR-V%'"()<>]|%\/(?:0[xX][\da-fA-F](?:_*[\da-fA-F])*|0[cC][0-7](?:_*[0-7])*|0[bB][01](?:_*[01])*|\d(?:_*\d)*)\/)*?"/
}, { }, {
token : "comment.line.double-dash", token: "comment.line.double-dash",
regex : /--.*/ regex: /--.*/
}, { }, {
token : "constant.character", token: "constant.character",
regex : /'(?:[^%\b\f\n\r\t\v]|%[A-DFHLNQR-V%'"()<>]|%\/(?:0[xX][\da-fA-F](?:_*[\da-fA-F])*|0[cC][0-7](?:_*[0-7])*|0[bB][01](?:_*[01])*|\d(?:_*\d)*)\/)'/ regex: /'(?:[^%\b\f\n\r\t\v]|%[A-DFHLNQR-V%'"()<>]|%\/(?:0[xX][\da-fA-F](?:_*[\da-fA-F])*|0[cC][0-7](?:_*[0-7])*|0[bB][01](?:_*[01])*|\d(?:_*\d)*)\/)'/
}, { }, {
token : "constant.numeric", // hexa | octal | bin token: "constant.numeric", // hexa | octal | bin
regex : /\b0(?:[xX][\da-fA-F](?:_*[\da-fA-F])*|[cC][0-7](?:_*[0-7])*|[bB][01](?:_*[01])*)\b/ regex: /\b0(?:[xX][\da-fA-F](?:_*[\da-fA-F])*|[cC][0-7](?:_*[0-7])*|[bB][01](?:_*[01])*)\b/
}, { }, {
token : "constant.numeric", token: "constant.numeric",
regex : /(?:\d(?:_*\d)*)?\.(?:(?:\d(?:_*\d)*)?[eE][+-]?)?\d(?:_*\d)*|\d(?:_*\d)*\.?/ regex: /(?:\d(?:_*\d)*)?\.(?:(?:\d(?:_*\d)*)?[eE][+-]?)?\d(?:_*\d)*|\d(?:_*\d)*\.?/
}, { }, {
token : "paren.lparen", token: "paren.lparen",
regex : /[\[({]|<<|\|\(/ regex: /[\[({]|<<|\|\(/
}, { }, {
token : "paren.rparen", token: "paren.rparen",
regex : /[\])}]|>>|\|\)/ regex: /[\])}]|>>|\|\)/
}, { }, {
token : "keyword.operator", // punctuation token: "keyword.operator", // punctuation
regex : /:=|->|\.(?=\w)|[;,:?]/ regex: /:=|->|\.(?=\w)|[;,:?]/
}, { }, {
token : "keyword.operator", token: "keyword.operator",
regex : /\\\\|\|\.\.\||\.\.|\/[~\/]?|[><\/]=?|[-+*^=~]/ regex: /\\\\|\|\.\.\||\.\.|\/[~\/]?|[><\/]=?|[-+*^=~]/
}, { }, {
token : function (v) { token: function (v) {
var result = keywordMapper(v); var result = keywordMapper(v);
if (result === "identifier" && v === v.toUpperCase()) { if (result === "identifier" && v === v.toUpperCase()) {
result = "entity.name.type"; result = "entity.name.type";
} }
return result; return result;
}, },
regex : /[a-zA-Z][a-zA-Z\d_]*\b/ regex: /[a-zA-Z][a-zA-Z\d_]*\b/
}, { }, {
token : "text", token: "text",
regex : /\s+/ regex: /\s+/
} }
], ],
"aligned_verbatim_string" : [{ "aligned_verbatim_string": [{
token : "string", token: "string",
regex : /]"/, regex: /]"/,
next : "start" next: "start"
}, { }, {
token : "string", token: "string",
regex : simpleString regex: simpleString
} }
], ],
"non-aligned_verbatim_string" : [{ "non-aligned_verbatim_string": [{
token : "string.quoted.other", token: "string.quoted.other",
regex : /}"/, regex: /}"/,
next : "start" next: "start"
}, { }, {
token : "string.quoted.other", token: "string.quoted.other",
regex : simpleString regex: simpleString
} }
]}; ]
};
}; };
oop.inherits(EiffelHighlightRules, TextHighlightRules); oop.inherits(EiffelHighlightRules, TextHighlightRules);
exports.EiffelHighlightRules = EiffelHighlightRules; exports.EiffelHighlightRules = EiffelHighlightRules;
}); });
define("ace/mode/eiffel",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/eiffel_highlight_rules"], function(require, exports, module) { define("ace/mode/eiffel",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/eiffel_highlight_rules"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextMode = require("./text").Mode; var TextMode = require("./text").Mode;
var EiffelHighlightRules = require("./eiffel_highlight_rules").EiffelHighlightRules; var EiffelHighlightRules = require("./eiffel_highlight_rules").EiffelHighlightRules;
var Mode = function () {
var Mode = function() {
this.HighlightRules = EiffelHighlightRules; this.HighlightRules = EiffelHighlightRules;
this.$behaviour = this.$defaultBehaviour; this.$behaviour = this.$defaultBehaviour;
}; };
oop.inherits(Mode, TextMode); oop.inherits(Mode, TextMode);
(function () {
(function() {
this.lineCommentStart = "--"; this.lineCommentStart = "--";
this.$id = "ace/mode/eiffel"; this.$id = "ace/mode/eiffel";
}).call(Mode.prototype); }).call(Mode.prototype);
exports.Mode = Mode; exports.Mode = Mode;
}); }); (function() {
window.require(["ace/mode/eiffel"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

File diff suppressed because it is too large Load Diff

View File

@ -1,444 +1,389 @@
define("ace/mode/elixir_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { define("ace/mode/elixir_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){/* This file was autogenerated from https://raw.githubusercontent.com/elixir-lang/elixir-tmbundle/master/Syntaxes/Elixir.tmLanguage (uuid: ) */
"use strict"; "use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var ElixirHighlightRules = function () {
var ElixirHighlightRules = function() { this.$rules = { start: [{ token: ['meta.module.elixir',
'keyword.control.module.elixir',
this.$rules = { start: 'meta.module.elixir',
[ { token: 'entity.name.type.module.elixir'],
[ 'meta.module.elixir', regex: '^(\\s*)(defmodule)(\\s+)((?:[A-Z]\\w*\\s*\\.\\s*)*[A-Z]\\w*)' },
'keyword.control.module.elixir', { token: 'comment.documentation.heredoc',
'meta.module.elixir', regex: '@(?:module|type)?doc (?:~[a-z])?"""',
'entity.name.type.module.elixir' ], push: [{ token: 'comment.documentation.heredoc',
regex: '^(\\s*)(defmodule)(\\s+)((?:[A-Z]\\w*\\s*\\.\\s*)*[A-Z]\\w*)' }, regex: '\\s*"""',
{ token: 'comment.documentation.heredoc', next: 'pop' },
regex: '@(?:module|type)?doc (?:~[a-z])?"""', { include: '#interpolated_elixir' },
push: { include: '#escaped_char' },
[ { token: 'comment.documentation.heredoc', { defaultToken: 'comment.documentation.heredoc' }],
regex: '\\s*"""', comment: '@doc with heredocs is treated as documentation' },
next: 'pop' }, { token: 'comment.documentation.heredoc',
{ include: '#interpolated_elixir' }, regex: '@(?:module|type)?doc ~[A-Z]"""',
{ include: '#escaped_char' }, push: [{ token: 'comment.documentation.heredoc',
{ defaultToken: 'comment.documentation.heredoc' } ], regex: '\\s*"""',
comment: '@doc with heredocs is treated as documentation' }, next: 'pop' },
{ token: 'comment.documentation.heredoc', { defaultToken: 'comment.documentation.heredoc' }],
regex: '@(?:module|type)?doc ~[A-Z]"""', comment: '@doc with heredocs is treated as documentation' },
push: { token: 'comment.documentation.heredoc',
[ { token: 'comment.documentation.heredoc', regex: '@(?:module|type)?doc (?:~[a-z])?\'\'\'',
regex: '\\s*"""', push: [{ token: 'comment.documentation.heredoc',
next: 'pop' }, regex: '\\s*\'\'\'',
{ defaultToken: 'comment.documentation.heredoc' } ], next: 'pop' },
comment: '@doc with heredocs is treated as documentation' }, { include: '#interpolated_elixir' },
{ token: 'comment.documentation.heredoc', { include: '#escaped_char' },
regex: '@(?:module|type)?doc (?:~[a-z])?\'\'\'', { defaultToken: 'comment.documentation.heredoc' }],
push: comment: '@doc with heredocs is treated as documentation' },
[ { token: 'comment.documentation.heredoc', { token: 'comment.documentation.heredoc',
regex: '\\s*\'\'\'', regex: '@(?:module|type)?doc ~[A-Z]\'\'\'',
next: 'pop' }, push: [{ token: 'comment.documentation.heredoc',
{ include: '#interpolated_elixir' }, regex: '\\s*\'\'\'',
{ include: '#escaped_char' }, next: 'pop' },
{ defaultToken: 'comment.documentation.heredoc' } ], { defaultToken: 'comment.documentation.heredoc' }],
comment: '@doc with heredocs is treated as documentation' }, comment: '@doc with heredocs is treated as documentation' },
{ token: 'comment.documentation.heredoc', { token: 'comment.documentation.false',
regex: '@(?:module|type)?doc ~[A-Z]\'\'\'', regex: '@(?:module|type)?doc false',
push: comment: '@doc false is treated as documentation' },
[ { token: 'comment.documentation.heredoc', { token: 'comment.documentation.string',
regex: '\\s*\'\'\'', regex: '@(?:module|type)?doc "',
next: 'pop' }, push: [{ token: 'comment.documentation.string',
{ defaultToken: 'comment.documentation.heredoc' } ], regex: '"',
comment: '@doc with heredocs is treated as documentation' }, next: 'pop' },
{ token: 'comment.documentation.false', { include: '#interpolated_elixir' },
regex: '@(?:module|type)?doc false', { include: '#escaped_char' },
comment: '@doc false is treated as documentation' }, { defaultToken: 'comment.documentation.string' }],
{ token: 'comment.documentation.string', comment: '@doc with string is treated as documentation' },
regex: '@(?:module|type)?doc "', { token: 'keyword.control.elixir',
push: regex: '\\b(?:do|end|case|bc|lc|for|if|cond|unless|try|receive|fn|defmodule|defp?|defprotocol|defimpl|defrecord|defstruct|defmacrop?|defdelegate|defcallback|defmacrocallback|defexception|defoverridable|exit|after|rescue|catch|else|raise|throw|import|require|alias|use|quote|unquote|super)\\b(?![?!])',
[ { token: 'comment.documentation.string', TODO: 'FIXME: regexp doesn\'t have js equivalent',
regex: '"', originalRegex: '(?<!\\.)\\b(do|end|case|bc|lc|for|if|cond|unless|try|receive|fn|defmodule|defp?|defprotocol|defimpl|defrecord|defstruct|defmacrop?|defdelegate|defcallback|defmacrocallback|defexception|defoverridable|exit|after|rescue|catch|else|raise|throw|import|require|alias|use|quote|unquote|super)\\b(?![?!])' },
next: 'pop' }, { token: 'keyword.operator.elixir',
{ include: '#interpolated_elixir' }, regex: '\\b(?:and|not|or|when|xor|in|inlist|inbits)\\b',
{ include: '#escaped_char' }, TODO: 'FIXME: regexp doesn\'t have js equivalent',
{ defaultToken: 'comment.documentation.string' } ], originalRegex: '(?<!\\.)\\b(and|not|or|when|xor|in|inlist|inbits)\\b',
comment: '@doc with string is treated as documentation' }, comment: ' as above, just doesn\'t need a \'end\' and does a logic operation' },
{ token: 'keyword.control.elixir', { token: 'constant.language.elixir',
regex: '\\b(?:do|end|case|bc|lc|for|if|cond|unless|try|receive|fn|defmodule|defp?|defprotocol|defimpl|defrecord|defstruct|defmacrop?|defdelegate|defcallback|defmacrocallback|defexception|defoverridable|exit|after|rescue|catch|else|raise|throw|import|require|alias|use|quote|unquote|super)\\b(?![?!])', regex: '\\b(?:nil|true|false)\\b(?![?!])' },
TODO: 'FIXME: regexp doesn\'t have js equivalent', { token: 'variable.language.elixir',
originalRegex: '(?<!\\.)\\b(do|end|case|bc|lc|for|if|cond|unless|try|receive|fn|defmodule|defp?|defprotocol|defimpl|defrecord|defstruct|defmacrop?|defdelegate|defcallback|defmacrocallback|defexception|defoverridable|exit|after|rescue|catch|else|raise|throw|import|require|alias|use|quote|unquote|super)\\b(?![?!])' }, regex: '\\b__(?:CALLER|ENV|MODULE|DIR)__\\b(?![?!])' },
{ token: 'keyword.operator.elixir', { token: ['punctuation.definition.variable.elixir',
regex: '\\b(?:and|not|or|when|xor|in|inlist|inbits)\\b', 'variable.other.readwrite.module.elixir'],
TODO: 'FIXME: regexp doesn\'t have js equivalent', regex: '(@)([a-zA-Z_]\\w*)' },
originalRegex: '(?<!\\.)\\b(and|not|or|when|xor|in|inlist|inbits)\\b', { token: ['punctuation.definition.variable.elixir',
comment: ' as above, just doesn\'t need a \'end\' and does a logic operation' }, 'variable.other.anonymous.elixir'],
{ token: 'constant.language.elixir', regex: '(&)(\\d*)' },
regex: '\\b(?:nil|true|false)\\b(?![?!])' }, { token: 'variable.other.constant.elixir',
{ token: 'variable.language.elixir', regex: '\\b[A-Z]\\w*\\b' },
regex: '\\b__(?:CALLER|ENV|MODULE|DIR)__\\b(?![?!])' }, { token: 'constant.numeric.elixir',
{ token: regex: '\\b(?:0x[\\da-fA-F](?:_?[\\da-fA-F])*|\\d(?:_?\\d)*(?:\\.(?![^[:space:][:digit:]])(?:_?\\d)*)?(?:[eE][-+]?\\d(?:_?\\d)*)?|0b[01]+|0o[0-7]+)\\b',
[ 'punctuation.definition.variable.elixir', TODO: 'FIXME: regexp doesn\'t have js equivalent',
'variable.other.readwrite.module.elixir' ], originalRegex: '\\b(0x\\h(?>_?\\h)*|\\d(?>_?\\d)*(\\.(?![^[:space:][:digit:]])(?>_?\\d)*)?([eE][-+]?\\d(?>_?\\d)*)?|0b[01]+|0o[0-7]+)\\b' },
regex: '(@)([a-zA-Z_]\\w*)' }, { token: 'punctuation.definition.constant.elixir',
{ token: regex: ':\'',
[ 'punctuation.definition.variable.elixir', push: [{ token: 'punctuation.definition.constant.elixir',
'variable.other.anonymous.elixir' ], regex: '\'',
regex: '(&)(\\d*)' }, next: 'pop' },
{ token: 'variable.other.constant.elixir', { include: '#interpolated_elixir' },
regex: '\\b[A-Z]\\w*\\b' }, { include: '#escaped_char' },
{ token: 'constant.numeric.elixir', { defaultToken: 'constant.other.symbol.single-quoted.elixir' }] },
regex: '\\b(?:0x[\\da-fA-F](?:_?[\\da-fA-F])*|\\d(?:_?\\d)*(?:\\.(?![^[:space:][:digit:]])(?:_?\\d)*)?(?:[eE][-+]?\\d(?:_?\\d)*)?|0b[01]+|0o[0-7]+)\\b', { token: 'punctuation.definition.constant.elixir',
TODO: 'FIXME: regexp doesn\'t have js equivalent', regex: ':"',
originalRegex: '\\b(0x\\h(?>_?\\h)*|\\d(?>_?\\d)*(\\.(?![^[:space:][:digit:]])(?>_?\\d)*)?([eE][-+]?\\d(?>_?\\d)*)?|0b[01]+|0o[0-7]+)\\b' }, push: [{ token: 'punctuation.definition.constant.elixir',
{ token: 'punctuation.definition.constant.elixir', regex: '"',
regex: ':\'', next: 'pop' },
push: { include: '#interpolated_elixir' },
[ { token: 'punctuation.definition.constant.elixir', { include: '#escaped_char' },
{ defaultToken: 'constant.other.symbol.double-quoted.elixir' }] },
{ token: 'punctuation.definition.string.begin.elixir',
regex: '(?:\'\'\')',
TODO: 'FIXME: regexp doesn\'t have js equivalent',
originalRegex: '(?>\'\'\')',
push: [{ token: 'punctuation.definition.string.end.elixir',
regex: '^\\s*\'\'\'',
next: 'pop' },
{ include: '#interpolated_elixir' },
{ include: '#escaped_char' },
{ defaultToken: 'support.function.variable.quoted.single.heredoc.elixir' }],
comment: 'Single-quoted heredocs' },
{ token: 'punctuation.definition.string.begin.elixir',
regex: '\'', regex: '\'',
next: 'pop' }, push: [{ token: 'punctuation.definition.string.end.elixir',
{ include: '#interpolated_elixir' }, regex: '\'',
{ include: '#escaped_char' }, next: 'pop' },
{ defaultToken: 'constant.other.symbol.single-quoted.elixir' } ] }, { include: '#interpolated_elixir' },
{ token: 'punctuation.definition.constant.elixir', { include: '#escaped_char' },
regex: ':"', { defaultToken: 'support.function.variable.quoted.single.elixir' }],
push: comment: 'single quoted string (allows for interpolation)' },
[ { token: 'punctuation.definition.constant.elixir', { token: 'punctuation.definition.string.begin.elixir',
regex: '(?:""")',
TODO: 'FIXME: regexp doesn\'t have js equivalent',
originalRegex: '(?>""")',
push: [{ token: 'punctuation.definition.string.end.elixir',
regex: '^\\s*"""',
next: 'pop' },
{ include: '#interpolated_elixir' },
{ include: '#escaped_char' },
{ defaultToken: 'string.quoted.double.heredoc.elixir' }],
comment: 'Double-quoted heredocs' },
{ token: 'punctuation.definition.string.begin.elixir',
regex: '"', regex: '"',
next: 'pop' }, push: [{ token: 'punctuation.definition.string.end.elixir',
{ include: '#interpolated_elixir' }, regex: '"',
{ include: '#escaped_char' }, next: 'pop' },
{ defaultToken: 'constant.other.symbol.double-quoted.elixir' } ] }, { include: '#interpolated_elixir' },
{ token: 'punctuation.definition.string.begin.elixir', { include: '#escaped_char' },
regex: '(?:\'\'\')', { defaultToken: 'string.quoted.double.elixir' }],
TODO: 'FIXME: regexp doesn\'t have js equivalent', comment: 'double quoted string (allows for interpolation)' },
originalRegex: '(?>\'\'\')', { token: 'punctuation.definition.string.begin.elixir',
push: regex: '~[a-z](?:""")',
[ { token: 'punctuation.definition.string.end.elixir', TODO: 'FIXME: regexp doesn\'t have js equivalent',
regex: '^\\s*\'\'\'', originalRegex: '~[a-z](?>""")',
next: 'pop' }, push: [{ token: 'punctuation.definition.string.end.elixir',
{ include: '#interpolated_elixir' }, regex: '^\\s*"""',
{ include: '#escaped_char' }, next: 'pop' },
{ defaultToken: 'support.function.variable.quoted.single.heredoc.elixir' } ], { include: '#interpolated_elixir' },
comment: 'Single-quoted heredocs' }, { include: '#escaped_char' },
{ token: 'punctuation.definition.string.begin.elixir', { defaultToken: 'string.quoted.double.heredoc.elixir' }],
regex: '\'', comment: 'Double-quoted heredocs sigils' },
push: { token: 'punctuation.definition.string.begin.elixir',
[ { token: 'punctuation.definition.string.end.elixir', regex: '~[a-z]\\{',
regex: '\'', push: [{ token: 'punctuation.definition.string.end.elixir',
next: 'pop' }, regex: '\\}[a-z]*',
{ include: '#interpolated_elixir' }, next: 'pop' },
{ include: '#escaped_char' }, { include: '#interpolated_elixir' },
{ defaultToken: 'support.function.variable.quoted.single.elixir' } ], { include: '#escaped_char' },
comment: 'single quoted string (allows for interpolation)' }, { defaultToken: 'string.interpolated.elixir' }],
{ token: 'punctuation.definition.string.begin.elixir', comment: 'sigil (allow for interpolation)' },
regex: '(?:""")', { token: 'punctuation.definition.string.begin.elixir',
TODO: 'FIXME: regexp doesn\'t have js equivalent', regex: '~[a-z]\\[',
originalRegex: '(?>""")', push: [{ token: 'punctuation.definition.string.end.elixir',
push: regex: '\\][a-z]*',
[ { token: 'punctuation.definition.string.end.elixir', next: 'pop' },
regex: '^\\s*"""', { include: '#interpolated_elixir' },
next: 'pop' }, { include: '#escaped_char' },
{ include: '#interpolated_elixir' }, { defaultToken: 'string.interpolated.elixir' }],
{ include: '#escaped_char' }, comment: 'sigil (allow for interpolation)' },
{ defaultToken: 'string.quoted.double.heredoc.elixir' } ], { token: 'punctuation.definition.string.begin.elixir',
comment: 'Double-quoted heredocs' }, regex: '~[a-z]\\<',
{ token: 'punctuation.definition.string.begin.elixir', push: [{ token: 'punctuation.definition.string.end.elixir',
regex: '"', regex: '\\>[a-z]*',
push: next: 'pop' },
[ { token: 'punctuation.definition.string.end.elixir', { include: '#interpolated_elixir' },
regex: '"', { include: '#escaped_char' },
next: 'pop' }, { defaultToken: 'string.interpolated.elixir' }],
{ include: '#interpolated_elixir' }, comment: 'sigil (allow for interpolation)' },
{ include: '#escaped_char' }, { token: 'punctuation.definition.string.begin.elixir',
{ defaultToken: 'string.quoted.double.elixir' } ], regex: '~[a-z]\\(',
comment: 'double quoted string (allows for interpolation)' }, push: [{ token: 'punctuation.definition.string.end.elixir',
{ token: 'punctuation.definition.string.begin.elixir', regex: '\\)[a-z]*',
regex: '~[a-z](?:""")', next: 'pop' },
TODO: 'FIXME: regexp doesn\'t have js equivalent', { include: '#interpolated_elixir' },
originalRegex: '~[a-z](?>""")', { include: '#escaped_char' },
push: { defaultToken: 'string.interpolated.elixir' }],
[ { token: 'punctuation.definition.string.end.elixir', comment: 'sigil (allow for interpolation)' },
regex: '^\\s*"""', { token: 'punctuation.definition.string.begin.elixir',
next: 'pop' }, regex: '~[a-z][^\\w]',
{ include: '#interpolated_elixir' }, push: [{ token: 'punctuation.definition.string.end.elixir',
{ include: '#escaped_char' }, regex: '[^\\w][a-z]*',
{ defaultToken: 'string.quoted.double.heredoc.elixir' } ], next: 'pop' },
comment: 'Double-quoted heredocs sigils' }, { include: '#interpolated_elixir' },
{ token: 'punctuation.definition.string.begin.elixir', { include: '#escaped_char' },
regex: '~[a-z]\\{', { include: '#escaped_char' },
push: { defaultToken: 'string.interpolated.elixir' }],
[ { token: 'punctuation.definition.string.end.elixir', comment: 'sigil (allow for interpolation)' },
regex: '\\}[a-z]*', { token: 'punctuation.definition.string.begin.elixir',
next: 'pop' }, regex: '~[A-Z](?:""")',
{ include: '#interpolated_elixir' }, TODO: 'FIXME: regexp doesn\'t have js equivalent',
{ include: '#escaped_char' }, originalRegex: '~[A-Z](?>""")',
{ defaultToken: 'string.interpolated.elixir' } ], push: [{ token: 'punctuation.definition.string.end.elixir',
comment: 'sigil (allow for interpolation)' }, regex: '^\\s*"""',
{ token: 'punctuation.definition.string.begin.elixir', next: 'pop' },
regex: '~[a-z]\\[', { defaultToken: 'string.quoted.other.literal.upper.elixir' }],
push: comment: 'Double-quoted heredocs sigils' },
[ { token: 'punctuation.definition.string.end.elixir', { token: 'punctuation.definition.string.begin.elixir',
regex: '\\][a-z]*', regex: '~[A-Z]\\{',
next: 'pop' }, push: [{ token: 'punctuation.definition.string.end.elixir',
{ include: '#interpolated_elixir' }, regex: '\\}[a-z]*',
{ include: '#escaped_char' }, next: 'pop' },
{ defaultToken: 'string.interpolated.elixir' } ], { defaultToken: 'string.quoted.other.literal.upper.elixir' }],
comment: 'sigil (allow for interpolation)' }, comment: 'sigil (without interpolation)' },
{ token: 'punctuation.definition.string.begin.elixir', { token: 'punctuation.definition.string.begin.elixir',
regex: '~[a-z]\\<', regex: '~[A-Z]\\[',
push: push: [{ token: 'punctuation.definition.string.end.elixir',
[ { token: 'punctuation.definition.string.end.elixir', regex: '\\][a-z]*',
regex: '\\>[a-z]*', next: 'pop' },
next: 'pop' }, { defaultToken: 'string.quoted.other.literal.upper.elixir' }],
{ include: '#interpolated_elixir' }, comment: 'sigil (without interpolation)' },
{ include: '#escaped_char' }, { token: 'punctuation.definition.string.begin.elixir',
{ defaultToken: 'string.interpolated.elixir' } ], regex: '~[A-Z]\\<',
comment: 'sigil (allow for interpolation)' }, push: [{ token: 'punctuation.definition.string.end.elixir',
{ token: 'punctuation.definition.string.begin.elixir', regex: '\\>[a-z]*',
regex: '~[a-z]\\(', next: 'pop' },
push: { defaultToken: 'string.quoted.other.literal.upper.elixir' }],
[ { token: 'punctuation.definition.string.end.elixir', comment: 'sigil (without interpolation)' },
regex: '\\)[a-z]*', { token: 'punctuation.definition.string.begin.elixir',
next: 'pop' }, regex: '~[A-Z]\\(',
{ include: '#interpolated_elixir' }, push: [{ token: 'punctuation.definition.string.end.elixir',
{ include: '#escaped_char' }, regex: '\\)[a-z]*',
{ defaultToken: 'string.interpolated.elixir' } ], next: 'pop' },
comment: 'sigil (allow for interpolation)' }, { defaultToken: 'string.quoted.other.literal.upper.elixir' }],
{ token: 'punctuation.definition.string.begin.elixir', comment: 'sigil (without interpolation)' },
regex: '~[a-z][^\\w]', { token: 'punctuation.definition.string.begin.elixir',
push: regex: '~[A-Z][^\\w]',
[ { token: 'punctuation.definition.string.end.elixir', push: [{ token: 'punctuation.definition.string.end.elixir',
regex: '[^\\w][a-z]*', regex: '[^\\w][a-z]*',
next: 'pop' }, next: 'pop' },
{ include: '#interpolated_elixir' }, { defaultToken: 'string.quoted.other.literal.upper.elixir' }],
{ include: '#escaped_char' }, comment: 'sigil (without interpolation)' },
{ include: '#escaped_char' }, { token: ['punctuation.definition.constant.elixir', 'constant.other.symbol.elixir'],
{ defaultToken: 'string.interpolated.elixir' } ], regex: '(:)([a-zA-Z_][\\w@]*(?:[?!]|=(?![>=]))?|\\<\\>|===?|!==?|<<>>|<<<|>>>|~~~|::|<\\-|\\|>|=>|~|~=|=|/|\\\\\\\\|\\*\\*?|\\.\\.?\\.?|>=?|<=?|&&?&?|\\+\\+?|\\-\\-?|\\|\\|?\\|?|\\!|@|\\%?\\{\\}|%|\\[\\]|\\^(?:\\^\\^)?)',
comment: 'sigil (allow for interpolation)' }, TODO: 'FIXME: regexp doesn\'t have js equivalent',
{ token: 'punctuation.definition.string.begin.elixir', originalRegex: '(?<!:)(:)(?>[a-zA-Z_][\\w@]*(?>[?!]|=(?![>=]))?|\\<\\>|===?|!==?|<<>>|<<<|>>>|~~~|::|<\\-|\\|>|=>|~|~=|=|/|\\\\\\\\|\\*\\*?|\\.\\.?\\.?|>=?|<=?|&&?&?|\\+\\+?|\\-\\-?|\\|\\|?\\|?|\\!|@|\\%?\\{\\}|%|\\[\\]|\\^(\\^\\^)?)',
regex: '~[A-Z](?:""")', comment: 'symbols' },
TODO: 'FIXME: regexp doesn\'t have js equivalent', { token: 'punctuation.definition.constant.elixir',
originalRegex: '~[A-Z](?>""")', regex: '(?:[a-zA-Z_][\\w@]*(?:[?!])?):(?!:)',
push: TODO: 'FIXME: regexp doesn\'t have js equivalent',
[ { token: 'punctuation.definition.string.end.elixir', originalRegex: '(?>[a-zA-Z_][\\w@]*(?>[?!])?)(:)(?!:)',
regex: '^\\s*"""', comment: 'symbols' },
next: 'pop' }, { token: ['punctuation.definition.comment.elixir',
{ defaultToken: 'string.quoted.other.literal.upper.elixir' } ], 'comment.line.number-sign.elixir'],
comment: 'Double-quoted heredocs sigils' }, regex: '(#)(.*)' },
{ token: 'punctuation.definition.string.begin.elixir', { token: 'constant.numeric.elixir',
regex: '~[A-Z]\\{', regex: '\\?(?:\\\\(?:x[\\da-fA-F]{1,2}(?![\\da-fA-F])\\b|[^xMC])|[^\\s\\\\])',
push: TODO: 'FIXME: regexp doesn\'t have js equivalent',
[ { token: 'punctuation.definition.string.end.elixir', originalRegex: '(?<!\\w)\\?(\\\\(x\\h{1,2}(?!\\h)\\b|[^xMC])|[^\\s\\\\])',
regex: '\\}[a-z]*', comment: '\n\t\t\tmatches questionmark-letters.\n\n\t\t\texamples (1st alternation = hex):\n\t\t\t?\\x1 ?\\x61\n\n\t\t\texamples (2rd alternation = escaped):\n\t\t\t?\\n ?\\b\n\n\t\t\texamples (3rd alternation = normal):\n\t\t\t?a ?A ?0 \n\t\t\t?* ?" ?( \n\t\t\t?. ?#\n\t\t\t\n\t\t\tthe negative lookbehind prevents against matching\n\t\t\tp(42.tainted?)\n\t\t\t' },
next: 'pop' }, { token: 'keyword.operator.assignment.augmented.elixir',
{ defaultToken: 'string.quoted.other.literal.upper.elixir' } ], regex: '\\+=|\\-=|\\|\\|=|~=|&&=' },
comment: 'sigil (without interpolation)' }, { token: 'keyword.operator.comparison.elixir',
{ token: 'punctuation.definition.string.begin.elixir', regex: '===?|!==?|<=?|>=?' },
regex: '~[A-Z]\\[', { token: 'keyword.operator.bitwise.elixir',
push: regex: '\\|{3}|&{3}|\\^{3}|<{3}|>{3}|~{3}' },
[ { token: 'punctuation.definition.string.end.elixir', { token: 'keyword.operator.logical.elixir',
regex: '\\][a-z]*', regex: '!+|\\bnot\\b|&&|\\band\\b|\\|\\||\\bor\\b|\\bxor\\b',
next: 'pop' }, originalRegex: '(?<=[ \\t])!+|\\bnot\\b|&&|\\band\\b|\\|\\||\\bor\\b|\\bxor\\b' },
{ defaultToken: 'string.quoted.other.literal.upper.elixir' } ], { token: 'keyword.operator.arithmetic.elixir',
comment: 'sigil (without interpolation)' }, regex: '\\*|\\+|\\-|/' },
{ token: 'punctuation.definition.string.begin.elixir', { token: 'keyword.operator.other.elixir',
regex: '~[A-Z]\\<', regex: '\\||\\+\\+|\\-\\-|\\*\\*|\\\\\\\\|\\<\\-|\\<\\>|\\<\\<|\\>\\>|\\:\\:|\\.\\.|\\|>|~|=>' },
push: { token: 'keyword.operator.assignment.elixir', regex: '=' },
[ { token: 'punctuation.definition.string.end.elixir', { token: 'punctuation.separator.other.elixir', regex: ':' },
regex: '\\>[a-z]*', { token: 'punctuation.separator.statement.elixir',
next: 'pop' }, regex: '\\;' },
{ defaultToken: 'string.quoted.other.literal.upper.elixir' } ], { token: 'punctuation.separator.object.elixir', regex: ',' },
comment: 'sigil (without interpolation)' }, { token: 'punctuation.separator.method.elixir', regex: '\\.' },
{ token: 'punctuation.definition.string.begin.elixir', { token: 'punctuation.section.scope.elixir', regex: '\\{|\\}' },
regex: '~[A-Z]\\(', { token: 'punctuation.section.array.elixir', regex: '\\[|\\]' },
push: { token: 'punctuation.section.function.elixir',
[ { token: 'punctuation.definition.string.end.elixir', regex: '\\(|\\)' }],
regex: '\\)[a-z]*', '#escaped_char': [{ token: 'constant.character.escape.elixir',
next: 'pop' }, regex: '\\\\(?:x[\\da-fA-F]{1,2}|.)' }],
{ defaultToken: 'string.quoted.other.literal.upper.elixir' } ], '#interpolated_elixir': [{ token: ['source.elixir.embedded.source',
comment: 'sigil (without interpolation)' }, 'source.elixir.embedded.source.empty'],
{ token: 'punctuation.definition.string.begin.elixir', regex: '(#\\{)(\\})' },
regex: '~[A-Z][^\\w]', { todo: { token: 'punctuation.section.embedded.elixir',
push: regex: '#\\{',
[ { token: 'punctuation.definition.string.end.elixir', push: [{ token: 'punctuation.section.embedded.elixir',
regex: '[^\\w][a-z]*', regex: '\\}',
next: 'pop' }, next: 'pop' },
{ defaultToken: 'string.quoted.other.literal.upper.elixir' } ], { include: '#nest_curly_and_self' },
comment: 'sigil (without interpolation)' }, { include: '$self' },
{ token: ['punctuation.definition.constant.elixir', 'constant.other.symbol.elixir'], { defaultToken: 'source.elixir.embedded.source' }] } }],
regex: '(:)([a-zA-Z_][\\w@]*(?:[?!]|=(?![>=]))?|\\<\\>|===?|!==?|<<>>|<<<|>>>|~~~|::|<\\-|\\|>|=>|~|~=|=|/|\\\\\\\\|\\*\\*?|\\.\\.?\\.?|>=?|<=?|&&?&?|\\+\\+?|\\-\\-?|\\|\\|?\\|?|\\!|@|\\%?\\{\\}|%|\\[\\]|\\^(?:\\^\\^)?)', '#nest_curly_and_self': [{ token: 'punctuation.section.scope.elixir',
TODO: 'FIXME: regexp doesn\'t have js equivalent', regex: '\\{',
originalRegex: '(?<!:)(:)(?>[a-zA-Z_][\\w@]*(?>[?!]|=(?![>=]))?|\\<\\>|===?|!==?|<<>>|<<<|>>>|~~~|::|<\\-|\\|>|=>|~|~=|=|/|\\\\\\\\|\\*\\*?|\\.\\.?\\.?|>=?|<=?|&&?&?|\\+\\+?|\\-\\-?|\\|\\|?\\|?|\\!|@|\\%?\\{\\}|%|\\[\\]|\\^(\\^\\^)?)', push: [{ token: 'punctuation.section.scope.elixir',
comment: 'symbols' }, regex: '\\}',
{ token: 'punctuation.definition.constant.elixir', next: 'pop' },
regex: '(?:[a-zA-Z_][\\w@]*(?:[?!])?):(?!:)', { include: '#nest_curly_and_self' }] },
TODO: 'FIXME: regexp doesn\'t have js equivalent', { include: '$self' }],
originalRegex: '(?>[a-zA-Z_][\\w@]*(?>[?!])?)(:)(?!:)', '#regex_sub': [{ include: '#interpolated_elixir' },
comment: 'symbols' }, { include: '#escaped_char' },
{ token: { token: ['punctuation.definition.arbitrary-repitition.elixir',
[ 'punctuation.definition.comment.elixir', 'string.regexp.arbitrary-repitition.elixir',
'comment.line.number-sign.elixir' ], 'string.regexp.arbitrary-repitition.elixir',
regex: '(#)(.*)' }, 'punctuation.definition.arbitrary-repitition.elixir'],
{ token: 'constant.numeric.elixir', regex: '(\\{)(\\d+)((?:,\\d+)?)(\\})' },
regex: '\\?(?:\\\\(?:x[\\da-fA-F]{1,2}(?![\\da-fA-F])\\b|[^xMC])|[^\\s\\\\])', { token: 'punctuation.definition.character-class.elixir',
TODO: 'FIXME: regexp doesn\'t have js equivalent', regex: '\\[(?:\\^?\\])?',
originalRegex: '(?<!\\w)\\?(\\\\(x\\h{1,2}(?!\\h)\\b|[^xMC])|[^\\s\\\\])', push: [{ token: 'punctuation.definition.character-class.elixir',
comment: '\n\t\t\tmatches questionmark-letters.\n\n\t\t\texamples (1st alternation = hex):\n\t\t\t?\\x1 ?\\x61\n\n\t\t\texamples (2rd alternation = escaped):\n\t\t\t?\\n ?\\b\n\n\t\t\texamples (3rd alternation = normal):\n\t\t\t?a ?A ?0 \n\t\t\t?* ?" ?( \n\t\t\t?. ?#\n\t\t\t\n\t\t\tthe negative lookbehind prevents against matching\n\t\t\tp(42.tainted?)\n\t\t\t' }, regex: '\\]',
{ token: 'keyword.operator.assignment.augmented.elixir', next: 'pop' },
regex: '\\+=|\\-=|\\|\\|=|~=|&&=' }, { include: '#escaped_char' },
{ token: 'keyword.operator.comparison.elixir', { defaultToken: 'string.regexp.character-class.elixir' }] },
regex: '===?|!==?|<=?|>=?' }, { token: 'punctuation.definition.group.elixir',
{ token: 'keyword.operator.bitwise.elixir', regex: '\\(',
regex: '\\|{3}|&{3}|\\^{3}|<{3}|>{3}|~{3}' }, push: [{ token: 'punctuation.definition.group.elixir',
{ token: 'keyword.operator.logical.elixir', regex: '\\)',
regex: '!+|\\bnot\\b|&&|\\band\\b|\\|\\||\\bor\\b|\\bxor\\b', next: 'pop' },
originalRegex: '(?<=[ \\t])!+|\\bnot\\b|&&|\\band\\b|\\|\\||\\bor\\b|\\bxor\\b' }, { include: '#regex_sub' },
{ token: 'keyword.operator.arithmetic.elixir', { defaultToken: 'string.regexp.group.elixir' }] },
regex: '\\*|\\+|\\-|/' }, { token: ['punctuation.definition.comment.elixir',
{ token: 'keyword.operator.other.elixir', 'comment.line.number-sign.elixir'],
regex: '\\||\\+\\+|\\-\\-|\\*\\*|\\\\\\\\|\\<\\-|\\<\\>|\\<\\<|\\>\\>|\\:\\:|\\.\\.|\\|>|~|=>' }, regex: '(?:^|\\s)(#)(\\s[[a-zA-Z0-9,. \\t?!-][^\\x00-\\x7F]]*$)',
{ token: 'keyword.operator.assignment.elixir', regex: '=' }, originalRegex: '(?<=^|\\s)(#)\\s[[a-zA-Z0-9,. \\t?!-][^\\x{00}-\\x{7F}]]*$',
{ token: 'punctuation.separator.other.elixir', regex: ':' }, comment: 'We are restrictive in what we allow to go after the comment character to avoid false positives, since the availability of comments depend on regexp flags.' }] };
{ token: 'punctuation.separator.statement.elixir',
regex: '\\;' },
{ token: 'punctuation.separator.object.elixir', regex: ',' },
{ token: 'punctuation.separator.method.elixir', regex: '\\.' },
{ token: 'punctuation.section.scope.elixir', regex: '\\{|\\}' },
{ token: 'punctuation.section.array.elixir', regex: '\\[|\\]' },
{ token: 'punctuation.section.function.elixir',
regex: '\\(|\\)' } ],
'#escaped_char':
[ { token: 'constant.character.escape.elixir',
regex: '\\\\(?:x[\\da-fA-F]{1,2}|.)' } ],
'#interpolated_elixir':
[ { token:
[ 'source.elixir.embedded.source',
'source.elixir.embedded.source.empty' ],
regex: '(#\\{)(\\})' },
{ todo:
{ token: 'punctuation.section.embedded.elixir',
regex: '#\\{',
push:
[ { token: 'punctuation.section.embedded.elixir',
regex: '\\}',
next: 'pop' },
{ include: '#nest_curly_and_self' },
{ include: '$self' },
{ defaultToken: 'source.elixir.embedded.source' } ] } } ],
'#nest_curly_and_self':
[ { token: 'punctuation.section.scope.elixir',
regex: '\\{',
push:
[ { token: 'punctuation.section.scope.elixir',
regex: '\\}',
next: 'pop' },
{ include: '#nest_curly_and_self' } ] },
{ include: '$self' } ],
'#regex_sub':
[ { include: '#interpolated_elixir' },
{ include: '#escaped_char' },
{ token:
[ 'punctuation.definition.arbitrary-repitition.elixir',
'string.regexp.arbitrary-repitition.elixir',
'string.regexp.arbitrary-repitition.elixir',
'punctuation.definition.arbitrary-repitition.elixir' ],
regex: '(\\{)(\\d+)((?:,\\d+)?)(\\})' },
{ token: 'punctuation.definition.character-class.elixir',
regex: '\\[(?:\\^?\\])?',
push:
[ { token: 'punctuation.definition.character-class.elixir',
regex: '\\]',
next: 'pop' },
{ include: '#escaped_char' },
{ defaultToken: 'string.regexp.character-class.elixir' } ] },
{ token: 'punctuation.definition.group.elixir',
regex: '\\(',
push:
[ { token: 'punctuation.definition.group.elixir',
regex: '\\)',
next: 'pop' },
{ include: '#regex_sub' },
{ defaultToken: 'string.regexp.group.elixir' } ] },
{ token:
[ 'punctuation.definition.comment.elixir',
'comment.line.number-sign.elixir' ],
regex: '(?:^|\\s)(#)(\\s[[a-zA-Z0-9,. \\t?!-][^\\x00-\\x7F]]*$)',
originalRegex: '(?<=^|\\s)(#)\\s[[a-zA-Z0-9,. \\t?!-][^\\x{00}-\\x{7F}]]*$',
comment: 'We are restrictive in what we allow to go after the comment character to avoid false positives, since the availability of comments depend on regexp flags.' } ] };
this.normalizeRules(); this.normalizeRules();
}; };
ElixirHighlightRules.metaData = { comment: 'Textmate bundle for Elixir Programming Language.', ElixirHighlightRules.metaData = { comment: 'Textmate bundle for Elixir Programming Language.',
fileTypes: [ 'ex', 'exs' ], fileTypes: ['ex', 'exs'],
firstLineMatch: '^#!/.*\\belixir', firstLineMatch: '^#!/.*\\belixir',
foldingStartMarker: '(after|else|catch|rescue|\\-\\>|\\{|\\[|do)\\s*$', foldingStartMarker: '(after|else|catch|rescue|\\-\\>|\\{|\\[|do)\\s*$',
foldingStopMarker: '^\\s*((\\}|\\]|after|else|catch|rescue)\\s*$|end\\b)', foldingStopMarker: '^\\s*((\\}|\\]|after|else|catch|rescue)\\s*$|end\\b)',
keyEquivalent: '^~E', keyEquivalent: '^~E',
name: 'Elixir', name: 'Elixir',
scopeName: 'source.elixir' }; scopeName: 'source.elixir' };
oop.inherits(ElixirHighlightRules, TextHighlightRules); oop.inherits(ElixirHighlightRules, TextHighlightRules);
exports.ElixirHighlightRules = ElixirHighlightRules; exports.ElixirHighlightRules = ElixirHighlightRules;
}); });
define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module) { define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../../lib/oop"); var oop = require("../../lib/oop");
var BaseFoldMode = require("./fold_mode").FoldMode; var BaseFoldMode = require("./fold_mode").FoldMode;
var Range = require("../../range").Range; var Range = require("../../range").Range;
var FoldMode = exports.FoldMode = function () { };
var FoldMode = exports.FoldMode = function() {};
oop.inherits(FoldMode, BaseFoldMode); oop.inherits(FoldMode, BaseFoldMode);
(function () {
(function() { this.commentBlock = function (session, row) {
this.getFoldWidgetRange = function(session, foldStyle, row) {
var range = this.indentationBlock(session, row);
if (range)
return range;
var re = /\S/; var re = /\S/;
var line = session.getLine(row); var line = session.getLine(row);
var startLevel = line.search(re); var startLevel = line.search(re);
if (startLevel == -1 || line[startLevel] != "#") if (startLevel == -1 || line[startLevel] != "#")
return; return;
var startColumn = line.length; var startColumn = line.length;
var maxRow = session.getLength(); var maxRow = session.getLength();
var startRow = row; var startRow = row;
var endRow = row; var endRow = row;
while (++row < maxRow) { while (++row < maxRow) {
line = session.getLine(row); line = session.getLine(row);
var level = line.search(re); var level = line.search(re);
if (level == -1) if (level == -1)
continue; continue;
if (line[level] != "#") if (line[level] != "#")
break; break;
endRow = row; endRow = row;
} }
if (endRow > startRow) { if (endRow > startRow) {
var endColumn = session.getLine(endRow).length; var endColumn = session.getLine(endRow).length;
return new Range(startRow, startColumn, endRow, endColumn); return new Range(startRow, startColumn, endRow, endColumn);
} }
}; };
this.getFoldWidget = function(session, foldStyle, row) { this.getFoldWidgetRange = function (session, foldStyle, row) {
var range = this.indentationBlock(session, row);
if (range)
return range;
range = this.commentBlock(session, row);
if (range)
return range;
};
this.getFoldWidget = function (session, foldStyle, row) {
var line = session.getLine(row); var line = session.getLine(row);
var indent = line.search(/\S/); var indent = line.search(/\S/);
var next = session.getLine(row + 1); var next = session.getLine(row + 1);
var prev = session.getLine(row - 1); var prev = session.getLine(row - 1);
var prevIndent = prev.search(/\S/); var prevIndent = prev.search(/\S/);
var nextIndent = next.search(/\S/); var nextIndent = next.search(/\S/);
if (indent == -1) { if (indent == -1) {
session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : ""; session.foldWidgets[row - 1] = prevIndent != -1 && prevIndent < nextIndent ? "start" : "";
return ""; return "";
} }
if (prevIndent == -1) { if (prevIndent == -1) {
@ -447,48 +392,52 @@ oop.inherits(FoldMode, BaseFoldMode);
session.foldWidgets[row + 1] = ""; session.foldWidgets[row + 1] = "";
return "start"; return "start";
} }
} else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") { }
else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") {
if (session.getLine(row - 2).search(/\S/) == -1) { if (session.getLine(row - 2).search(/\S/) == -1) {
session.foldWidgets[row - 1] = "start"; session.foldWidgets[row - 1] = "start";
session.foldWidgets[row + 1] = ""; session.foldWidgets[row + 1] = "";
return ""; return "";
} }
} }
if (prevIndent != -1 && prevIndent < indent)
if (prevIndent!= -1 && prevIndent < indent)
session.foldWidgets[row - 1] = "start"; session.foldWidgets[row - 1] = "start";
else else
session.foldWidgets[row - 1] = ""; session.foldWidgets[row - 1] = "";
if (indent < nextIndent) if (indent < nextIndent)
return "start"; return "start";
else else
return ""; return "";
}; };
}).call(FoldMode.prototype); }).call(FoldMode.prototype);
}); });
define("ace/mode/elixir",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/elixir_highlight_rules","ace/mode/folding/coffee"], function(require, exports, module) { define("ace/mode/elixir",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/elixir_highlight_rules","ace/mode/folding/coffee"], function(require, exports, module){/*
THIS FILE WAS AUTOGENERATED BY mode.tmpl.js
*/
"use strict"; "use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextMode = require("./text").Mode; var TextMode = require("./text").Mode;
var ElixirHighlightRules = require("./elixir_highlight_rules").ElixirHighlightRules; var ElixirHighlightRules = require("./elixir_highlight_rules").ElixirHighlightRules;
var FoldMode = require("./folding/coffee").FoldMode; var FoldMode = require("./folding/coffee").FoldMode;
var Mode = function () {
var Mode = function() {
this.HighlightRules = ElixirHighlightRules; this.HighlightRules = ElixirHighlightRules;
this.foldingRules = new FoldMode(); this.foldingRules = new FoldMode();
this.$behaviour = this.$defaultBehaviour; this.$behaviour = this.$defaultBehaviour;
}; };
oop.inherits(Mode, TextMode); oop.inherits(Mode, TextMode);
(function () {
(function() {
this.lineCommentStart = "#"; this.lineCommentStart = "#";
this.$id = "ace/mode/elixir"; this.$id = "ace/mode/elixir";
}).call(Mode.prototype); }).call(Mode.prototype);
exports.Mode = Mode; exports.Mode = Mode;
});
}); (function() {
window.require(["ace/mode/elixir"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

View File

@ -1,222 +1,191 @@
define("ace/mode/elm_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { define("ace/mode/elm_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){// TODO check with https://github.com/deadfoxygrandpa/Elm.tmLanguage
"use strict"; "use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var ElmHighlightRules = function () {
var ElmHighlightRules = function() {
var keywordMapper = this.createKeywordMapper({ var keywordMapper = this.createKeywordMapper({
"keyword": "as|case|class|data|default|deriving|do|else|export|foreign|" + "keyword": "as|case|class|data|default|deriving|do|else|export|foreign|" +
"hiding|jsevent|if|import|in|infix|infixl|infixr|instance|let|" + "hiding|jsevent|if|import|in|infix|infixl|infixr|instance|let|" +
"module|newtype|of|open|then|type|where|_|port|\u03BB" "module|newtype|of|open|then|type|where|_|port|\u03BB"
}, "identifier"); }, "identifier");
var escapeRe = /\\(\d+|['"\\&trnbvf])/; var escapeRe = /\\(\d+|['"\\&trnbvf])/;
var smallRe = /[a-z_]/.source; var smallRe = /[a-z_]/.source;
var largeRe = /[A-Z]/.source; var largeRe = /[A-Z]/.source;
var idRe = /[a-z_A-Z0-9']/.source; var idRe = /[a-z_A-Z0-9']/.source;
this.$rules = { this.$rules = {
start: [{ start: [{
token: "string.start", token: "string.start",
regex: '"', regex: '"',
next: "string" next: "string"
}, { }, {
token: "string.character", token: "string.character",
regex: "'(?:" + escapeRe.source + "|.)'?" regex: "'(?:" + escapeRe.source + "|.)'?"
}, { }, {
regex: /0(?:[xX][0-9A-Fa-f]+|[oO][0-7]+)|\d+(\.\d+)?([eE][-+]?\d*)?/, regex: /0(?:[xX][0-9A-Fa-f]+|[oO][0-7]+)|\d+(\.\d+)?([eE][-+]?\d*)?/,
token: "constant.numeric" token: "constant.numeric"
}, { }, {
token: "comment", token: "comment",
regex: "--.*" regex: "--.*"
}, { }, {
token : "keyword", token: "keyword",
regex : /\.\.|\||:|=|\\|"|->|<-|\u2192/ regex: /\.\.|\||:|=|\\|"|->|<-|\u2192/
}, { }, {
token : "keyword.operator", token: "keyword.operator",
regex : /[-!#$%&*+.\/<=>?@\\^|~:\u03BB\u2192]+/ regex: /[-!#$%&*+.\/<=>?@\\^|~:\u03BB\u2192]+/
}, { }, {
token : "operator.punctuation", token: "operator.punctuation",
regex : /[,;`]/ regex: /[,;`]/
}, { }, {
regex : largeRe + idRe + "+\\.?", regex: largeRe + idRe + "+\\.?",
token : function(value) { token: function (value) {
if (value[value.length - 1] == ".") if (value[value.length - 1] == ".")
return "entity.name.function"; return "entity.name.function";
return "constant.language"; return "constant.language";
} }
}, { }, {
regex : "^" + smallRe + idRe + "+", regex: "^" + smallRe + idRe + "+",
token : function(value) { token: function (value) {
return "constant.language"; return "constant.language";
} }
}, { }, {
token : keywordMapper, token: keywordMapper,
regex : "[\\w\\xff-\\u218e\\u2455-\\uffff]+\\b" regex: "[\\w\\xff-\\u218e\\u2455-\\uffff]+\\b"
}, { }, {
regex: "{-#?", regex: "{-#?",
token: "comment.start", token: "comment.start",
onMatch: function(value, currentState, stack) { onMatch: function (value, currentState, stack) {
this.next = value.length == 2 ? "blockComment" : "docComment"; this.next = value.length == 2 ? "blockComment" : "docComment";
return this.token; return this.token;
} }
}, { }, {
token: "variable.language", token: "variable.language",
regex: /\[markdown\|/, regex: /\[markdown\|/,
next: "markdown" next: "markdown"
}, { }, {
token: "paren.lparen", token: "paren.lparen",
regex: /[\[({]/ regex: /[\[({]/
}, { }, {
token: "paren.rparen", token: "paren.rparen",
regex: /[\])}]/ regex: /[\])}]/
} ], }],
markdown: [{ markdown: [{
regex: /\|\]/, regex: /\|\]/,
next: "start" next: "start"
}, { }, {
defaultToken : "string" defaultToken: "string"
}], }],
blockComment: [{ blockComment: [{
regex: "{-", regex: "{-",
token: "comment.start", token: "comment.start",
push: "blockComment" push: "blockComment"
}, { }, {
regex: "-}", regex: "-}",
token: "comment.end", token: "comment.end",
next: "pop" next: "pop"
}, { }, {
defaultToken: "comment" defaultToken: "comment"
}], }],
docComment: [{ docComment: [{
regex: "{-", regex: "{-",
token: "comment.start", token: "comment.start",
push: "docComment" push: "docComment"
}, { }, {
regex: "-}", regex: "-}",
token: "comment.end", token: "comment.end",
next: "pop" next: "pop"
}, { }, {
defaultToken: "doc.comment" defaultToken: "doc.comment"
}], }],
string: [{ string: [{
token: "constant.language.escape", token: "constant.language.escape",
regex: escapeRe regex: escapeRe
}, { }, {
token: "text", token: "text",
regex: /\\(\s|$)/, regex: /\\(\s|$)/,
next: "stringGap" next: "stringGap"
}, { }, {
token: "string.end", token: "string.end",
regex: '"', regex: '"',
next: "start" next: "start"
}, { }, {
defaultToken: "string" defaultToken: "string"
}], }],
stringGap: [{ stringGap: [{
token: "text", token: "text",
regex: /\\/, regex: /\\/,
next: "string" next: "string"
}, { }, {
token: "error", token: "error",
regex: "", regex: "",
next: "start" next: "start"
}] }]
}; };
this.normalizeRules(); this.normalizeRules();
}; };
oop.inherits(ElmHighlightRules, TextHighlightRules); oop.inherits(ElmHighlightRules, TextHighlightRules);
exports.ElmHighlightRules = ElmHighlightRules; exports.ElmHighlightRules = ElmHighlightRules;
}); });
define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../../lib/oop"); var oop = require("../../lib/oop");
var Range = require("../../range").Range; var Range = require("../../range").Range;
var BaseFoldMode = require("./fold_mode").FoldMode; var BaseFoldMode = require("./fold_mode").FoldMode;
var FoldMode = exports.FoldMode = function (commentRegex) {
var FoldMode = exports.FoldMode = function(commentRegex) {
if (commentRegex) { if (commentRegex) {
this.foldingStartMarker = new RegExp( this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
);
this.foldingStopMarker = new RegExp(
this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
);
} }
}; };
oop.inherits(FoldMode, BaseFoldMode); oop.inherits(FoldMode, BaseFoldMode);
(function () {
(function() {
this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/; this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/; this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
this._getFoldWidgetBase = this.getFoldWidget; this._getFoldWidgetBase = this.getFoldWidget;
this.getFoldWidget = function(session, foldStyle, row) { this.getFoldWidget = function (session, foldStyle, row) {
var line = session.getLine(row); var line = session.getLine(row);
if (this.singleLineBlockCommentRe.test(line)) { if (this.singleLineBlockCommentRe.test(line)) {
if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
return ""; return "";
} }
var fw = this._getFoldWidgetBase(session, foldStyle, row); var fw = this._getFoldWidgetBase(session, foldStyle, row);
if (!fw && this.startRegionRe.test(line)) if (!fw && this.startRegionRe.test(line))
return "start"; // lineCommentRegionStart return "start"; // lineCommentRegionStart
return fw; return fw;
}; };
this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
var line = session.getLine(row); var line = session.getLine(row);
if (this.startRegionRe.test(line)) if (this.startRegionRe.test(line))
return this.getCommentRegionBlock(session, line, row); return this.getCommentRegionBlock(session, line, row);
var match = line.match(this.foldingStartMarker); var match = line.match(this.foldingStartMarker);
if (match) { if (match) {
var i = match.index; var i = match.index;
if (match[1]) if (match[1])
return this.openingBracketBlock(session, match[1], row, i); return this.openingBracketBlock(session, match[1], row, i);
var range = session.getCommentFoldRange(row, i + match[0].length, 1); var range = session.getCommentFoldRange(row, i + match[0].length, 1);
if (range && !range.isMultiLine()) { if (range && !range.isMultiLine()) {
if (forceMultiline) { if (forceMultiline) {
range = this.getSectionRange(session, row); range = this.getSectionRange(session, row);
} else if (foldStyle != "all") }
else if (foldStyle != "all")
range = null; range = null;
} }
return range; return range;
} }
if (foldStyle === "markbegin") if (foldStyle === "markbegin")
return; return;
var match = line.match(this.foldingStopMarker); var match = line.match(this.foldingStopMarker);
if (match) { if (match) {
var i = match.index + match[0].length; var i = match.index + match[0].length;
if (match[1]) if (match[1])
return this.closingBracketBlock(session, match[1], row, i); return this.closingBracketBlock(session, match[1], row, i);
return session.getCommentFoldRange(row, i, -1); return session.getCommentFoldRange(row, i, -1);
} }
}; };
this.getSectionRange = function (session, row) {
this.getSectionRange = function(session, row) {
var line = session.getLine(row); var line = session.getLine(row);
var startIndent = line.search(/\S/); var startIndent = line.search(/\S/);
var startRow = row; var startRow = row;
@ -229,71 +198,77 @@ oop.inherits(FoldMode, BaseFoldMode);
var indent = line.search(/\S/); var indent = line.search(/\S/);
if (indent === -1) if (indent === -1)
continue; continue;
if (startIndent > indent) if (startIndent > indent)
break; break;
var subRange = this.getFoldWidgetRange(session, "all", row); var subRange = this.getFoldWidgetRange(session, "all", row);
if (subRange) { if (subRange) {
if (subRange.start.row <= startRow) { if (subRange.start.row <= startRow) {
break; break;
} else if (subRange.isMultiLine()) { }
else if (subRange.isMultiLine()) {
row = subRange.end.row; row = subRange.end.row;
} else if (startIndent == indent) { }
else if (startIndent == indent) {
break; break;
} }
} }
endRow = row; endRow = row;
} }
return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
}; };
this.getCommentRegionBlock = function(session, line, row) { this.getCommentRegionBlock = function (session, line, row) {
var startColumn = line.search(/\s*$/); var startColumn = line.search(/\s*$/);
var maxRow = session.getLength(); var maxRow = session.getLength();
var startRow = row; var startRow = row;
var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
var depth = 1; var depth = 1;
while (++row < maxRow) { while (++row < maxRow) {
line = session.getLine(row); line = session.getLine(row);
var m = re.exec(line); var m = re.exec(line);
if (!m) continue; if (!m)
if (m[1]) depth--; continue;
else depth++; if (m[1])
depth--;
if (!depth) break; else
depth++;
if (!depth)
break;
} }
var endRow = row; var endRow = row;
if (endRow > startRow) { if (endRow > startRow) {
return new Range(startRow, startColumn, endRow, line.length); return new Range(startRow, startColumn, endRow, line.length);
} }
}; };
}).call(FoldMode.prototype); }).call(FoldMode.prototype);
}); });
define("ace/mode/elm",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/elm_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) { define("ace/mode/elm",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/elm_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module){/*
THIS FILE WAS AUTOGENERATED BY mode.tmpl.js
*/
"use strict"; "use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextMode = require("./text").Mode; var TextMode = require("./text").Mode;
var HighlightRules = require("./elm_highlight_rules").ElmHighlightRules; var HighlightRules = require("./elm_highlight_rules").ElmHighlightRules;
var FoldMode = require("./folding/cstyle").FoldMode; var FoldMode = require("./folding/cstyle").FoldMode;
var Mode = function () {
var Mode = function() {
this.HighlightRules = HighlightRules; this.HighlightRules = HighlightRules;
this.foldingRules = new FoldMode(); this.foldingRules = new FoldMode();
this.$behaviour = this.$defaultBehaviour; this.$behaviour = this.$defaultBehaviour;
}; };
oop.inherits(Mode, TextMode); oop.inherits(Mode, TextMode);
(function () {
(function() {
this.lineCommentStart = "--"; this.lineCommentStart = "--";
this.blockComment = {start: "{-", end: "-}", nestable: true}; this.blockComment = { start: "{-", end: "-}", nestable: true };
this.$id = "ace/mode/elm"; this.$id = "ace/mode/elm";
}).call(Mode.prototype); }).call(Mode.prototype);
exports.Mode = Mode; exports.Mode = Mode;
});
}); (function() {
window.require(["ace/mode/elm"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,164 @@
define("ace/mode/flix_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var FlixHighlightRules = function () {
var keywords = ("use|checked_cast|checked_ecast|unchecked_cast|masked_cast|as|discard|from|" +
"into|inject|project|solve|query|where|select|force|import|region|red|deref");
var controlKeywords = ("choose|debug|do|for|forA|forM|foreach|yield|if|else|case|" +
"match|typematch|try|catch|resume|spawn|par|branch|jumpto");
var operators = "not|and|or|fix";
var declarations = "eff|def|law|enum|case|type|alias|class|instance|mod|let";
var modifiers = "with|without|opaque|lazy|lawful|pub|override|sealed|static";
var primitives = "Unit|Bool|Char|Float32|Float64|Int8|Int16|Int32|Int64|BigInt|String";
var keywordMapper = this.createKeywordMapper({
"keyword": keywords,
"keyword.control": controlKeywords,
"keyword.operator": operators,
"storage.type": declarations,
"storage.modifier": modifiers,
"support.type": primitives
}, "identifier");
this.$rules = {
"start": [
{
token: "comment.line",
regex: "\\/\\/.*$"
}, {
token: "comment.block",
regex: "\\/\\*",
next: "comment"
}, {
token: "string",
regex: '"',
next: "string"
}, {
token: "string.regexp",
regex: 'regex"',
next: "regex"
}, {
token: "constant.character",
regex: "'",
next: "char"
}, {
token: "constant.numeric", // hex
regex: "0x[a-fA-F0-9](_*[a-fA-F0-9])*(i8|i16|i32|i64|ii)?\\b"
}, {
token: "constant.numeric", // float
regex: "[0-9](_*[0-9])*\\.[0-9](_*[0-9])*(f32|f64)?\\b"
}, {
token: "constant.numeric", // integer
regex: "[0-9](_*[0-9])*(i8|i16|i32|i64|ii)?\\b"
}, {
token: "constant.language.boolean",
regex: "(true|false)\\b"
}, {
token: "constant.language",
regex: "null\\b"
}, {
token: "keyword.operator",
regex: "\\->|~>|<\\-|=>"
}, {
token: "storage.modifier",
regex: "@(Deprecated|Experimental|Internal|ParallelWhenPure|Parallel|LazyWhenPure|Lazy|Skip|Test)\\b"
}, {
token: "keyword", // hole
regex: "(\\?\\?\\?|\\?[a-zA-Z0-9]+)"
}, {
token: keywordMapper,
regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
}, {
token: "paren.lparen",
regex: "[[({]"
}, {
token: "paren.rparen",
regex: "[\\])}]"
}, {
token: "text",
regex: "\\s+"
}
],
"comment": [
{
token: "comment.block",
regex: "\\*\\/",
next: "start"
}, {
defaultToken: "comment.block"
}
],
"string": [
{
token: "constant.character.escape", // unicode
regex: "\\\\(u[0-9a-fA-F]{4})"
}, {
token: "constant.character.escape",
regex: '\\\\.'
}, {
token: "string",
regex: '"',
next: "start"
}, {
token: "string",
regex: '[^"\\\\]+'
}
],
"regex": [
{
token: "constant.character.escape", // unicode
regex: "\\\\(u[0-9a-fA-F]{4})"
}, {
token: "constant.character.escape",
regex: '\\\\.'
}, {
token: "string.regexp",
regex: '"',
next: "start"
}, {
token: "string.regexp",
regex: '[^"\\\\]+'
}
],
"char": [
{
token: "constant.character.escape", // unicode
regex: "\\\\(u[0-9a-fA-F]{4})"
}, {
token: "constant.character.escape",
regex: '\\\\.'
}, {
token: "constant.character",
regex: "'",
next: "start"
}, {
token: "constant.character",
regex: "[^'\\\\]+"
}
]
};
};
oop.inherits(FlixHighlightRules, TextHighlightRules);
exports.FlixHighlightRules = FlixHighlightRules;
});
define("ace/mode/flix",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/flix_highlight_rules"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var FlixHighlightRules = require("./flix_highlight_rules").FlixHighlightRules;
var Mode = function () {
this.HighlightRules = FlixHighlightRules;
};
oop.inherits(Mode, TextMode);
(function () {
this.$id = "ace/mode/flix";
}).call(Mode.prototype);
exports.Mode = Mode;
}); (function() {
window.require(["ace/mode/flix"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

View File

@ -1,213 +1,170 @@
define("ace/mode/forth_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { define("ace/mode/forth_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){/* This file was autogenerated from https://raw.github.com/vze26m98/Forth.tmbundle/master/Syntaxes/Forth.tmLanguage (uuid: ) */
"use strict"; "use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var ForthHighlightRules = function () {
var ForthHighlightRules = function() { this.$rules = { start: [{ include: '#forth' }],
'#comment': [{ token: 'comment.line.double-dash.forth',
this.$rules = { start: [ { include: '#forth' } ], regex: '(?:^|\\s)--\\s.*$',
'#comment': comment: 'line comments for iForth' },
[ { token: 'comment.line.double-dash.forth', { token: 'comment.line.backslash.forth',
regex: '(?:^|\\s)--\\s.*$', regex: '(?:^|\\s)\\\\[\\s\\S]*$',
comment: 'line comments for iForth' }, comment: 'ANSI line comment' },
{ token: 'comment.line.backslash.forth', { token: 'comment.line.backslash-g.forth',
regex: '(?:^|\\s)\\\\[\\s\\S]*$', regex: '(?:^|\\s)\\\\[Gg] .*$',
comment: 'ANSI line comment' }, comment: 'gForth line comment' },
{ token: 'comment.line.backslash-g.forth', { token: 'comment.block.forth',
regex: '(?:^|\\s)\\\\[Gg] .*$', regex: '(?:^|\\s)\\(\\*(?=\\s|$)',
comment: 'gForth line comment' }, push: [{ token: 'comment.block.forth',
{ token: 'comment.block.forth', regex: '(?:^|\\s)\\*\\)(?=\\s|$)',
regex: '(?:^|\\s)\\(\\*(?=\\s|$)', next: 'pop' },
push: { defaultToken: 'comment.block.forth' }],
[ { token: 'comment.block.forth', comment: 'multiline comments for iForth' },
regex: '(?:^|\\s)\\*\\)(?=\\s|$)', { token: 'comment.block.documentation.forth',
next: 'pop' }, regex: '\\bDOC\\b',
{ defaultToken: 'comment.block.forth' } ],
comment: 'multiline comments for iForth' },
{ token: 'comment.block.documentation.forth',
regex: '\\bDOC\\b',
caseInsensitive: true,
push:
[ { token: 'comment.block.documentation.forth',
regex: '\\bENDDOC\\b',
caseInsensitive: true, caseInsensitive: true,
next: 'pop' }, push: [{ token: 'comment.block.documentation.forth',
{ defaultToken: 'comment.block.documentation.forth' } ], regex: '\\bENDDOC\\b',
comment: 'documentation comments for iForth' }, caseInsensitive: true,
{ token: 'comment.line.parentheses.forth', next: 'pop' },
regex: '(?:^|\\s)\\.?\\( [^)]*\\)', { defaultToken: 'comment.block.documentation.forth' }],
comment: 'ANSI line comment' } ], comment: 'documentation comments for iForth' },
'#constant': { token: 'comment.line.parentheses.forth',
[ { token: 'constant.language.forth', regex: '(?:^|\\s)\\.?\\( [^)]*\\)',
regex: '(?:^|\\s)(?:TRUE|FALSE|BL|PI|CELL|C/L|R/O|W/O|R/W)(?=\\s|$)', comment: 'ANSI line comment' }],
caseInsensitive: true}, '#constant': [{ token: 'constant.language.forth',
{ token: 'constant.numeric.forth', regex: '(?:^|\\s)(?:TRUE|FALSE|BL|PI|CELL|C/L|R/O|W/O|R/W)(?=\\s|$)',
regex: '(?:^|\\s)[$#%]?[-+]?[0-9]+(?:\\.[0-9]*e-?[0-9]+|\\.?[0-9a-fA-F]*)(?=\\s|$)'}, caseInsensitive: true },
{ token: 'constant.character.forth', { token: 'constant.numeric.forth',
regex: '(?:^|\\s)(?:[&^]\\S|(?:"|\')\\S(?:"|\'))(?=\\s|$)'}], regex: '(?:^|\\s)[$#%]?[-+]?[0-9]+(?:\\.[0-9]*e-?[0-9]+|\\.?[0-9a-fA-F]*)(?=\\s|$)' },
'#forth': { token: 'constant.character.forth',
[ { include: '#constant' }, regex: '(?:^|\\s)(?:[&^]\\S|(?:"|\')\\S(?:"|\'))(?=\\s|$)' }],
{ include: '#comment' }, '#forth': [{ include: '#constant' },
{ include: '#string' }, { include: '#comment' },
{ include: '#word' }, { include: '#string' },
{ include: '#variable' }, { include: '#word' },
{ include: '#storage' }, { include: '#variable' },
{ include: '#word-def' } ], { include: '#storage' },
'#storage': { include: '#word-def' }],
[ { token: 'storage.type.forth', '#storage': [{ token: 'storage.type.forth',
regex: '(?:^|\\s)(?:2CONSTANT|2VARIABLE|ALIAS|CONSTANT|CREATE-INTERPRET/COMPILE[:]?|CREATE|DEFER|FCONSTANT|FIELD|FVARIABLE|USER|VALUE|VARIABLE|VOCABULARY)(?=\\s|$)', regex: '(?:^|\\s)(?:2CONSTANT|2VARIABLE|ALIAS|CONSTANT|CREATE-INTERPRET/COMPILE[:]?|CREATE|DEFER|FCONSTANT|FIELD|FVARIABLE|USER|VALUE|VARIABLE|VOCABULARY)(?=\\s|$)',
caseInsensitive: true}], caseInsensitive: true }],
'#string': '#string': [{ token: 'string.quoted.double.forth',
[ { token: 'string.quoted.double.forth', regex: '(ABORT" |BREAK" |\\." |C" |0"|S\\\\?" )([^"]+")',
regex: '(ABORT" |BREAK" |\\." |C" |0"|S\\\\?" )([^"]+")', caseInsensitive: true },
caseInsensitive: true}, { token: 'string.unquoted.forth',
{ token: 'string.unquoted.forth', regex: '(?:INCLUDE|NEEDS|REQUIRE|USE)[ ]\\S+(?=\\s|$)',
regex: '(?:INCLUDE|NEEDS|REQUIRE|USE)[ ]\\S+(?=\\s|$)', caseInsensitive: true }],
caseInsensitive: true}], '#variable': [{ token: 'variable.language.forth',
'#variable': regex: '\\b(?:I|J)\\b',
[ { token: 'variable.language.forth', caseInsensitive: true }],
regex: '\\b(?:I|J)\\b', '#word': [{ token: 'keyword.control.immediate.forth',
caseInsensitive: true } ], regex: '(?:^|\\s)\\[(?:\\?DO|\\+LOOP|AGAIN|BEGIN|DEFINED|DO|ELSE|ENDIF|FOR|IF|IFDEF|IFUNDEF|LOOP|NEXT|REPEAT|THEN|UNTIL|WHILE)\\](?=\\s|$)',
'#word': caseInsensitive: true },
[ { token: 'keyword.control.immediate.forth', { token: 'keyword.other.immediate.forth',
regex: '(?:^|\\s)\\[(?:\\?DO|\\+LOOP|AGAIN|BEGIN|DEFINED|DO|ELSE|ENDIF|FOR|IF|IFDEF|IFUNDEF|LOOP|NEXT|REPEAT|THEN|UNTIL|WHILE)\\](?=\\s|$)', regex: '(?:^|\\s)(?:COMPILE-ONLY|IMMEDIATE|IS|RESTRICT|TO|WHAT\'S|])(?=\\s|$)',
caseInsensitive: true}, caseInsensitive: true },
{ token: 'keyword.other.immediate.forth', { token: 'keyword.control.compile-only.forth',
regex: '(?:^|\\s)(?:COMPILE-ONLY|IMMEDIATE|IS|RESTRICT|TO|WHAT\'S|])(?=\\s|$)', regex: '(?:^|\\s)(?:-DO|\\-LOOP|\\?DO|\\?LEAVE|\\+DO|\\+LOOP|ABORT\\"|AGAIN|AHEAD|BEGIN|CASE|DO|ELSE|ENDCASE|ENDIF|ENDOF|ENDTRY\\-IFERROR|ENDTRY|FOR|IF|IFERROR|LEAVE|LOOP|NEXT|RECOVER|REPEAT|RESTORE|THEN|TRY|U\\-DO|U\\+DO|UNTIL|WHILE)(?=\\s|$)',
caseInsensitive: true}, caseInsensitive: true },
{ token: 'keyword.control.compile-only.forth', { token: 'keyword.other.compile-only.forth',
regex: '(?:^|\\s)(?:-DO|\\-LOOP|\\?DO|\\?LEAVE|\\+DO|\\+LOOP|ABORT\\"|AGAIN|AHEAD|BEGIN|CASE|DO|ELSE|ENDCASE|ENDIF|ENDOF|ENDTRY\\-IFERROR|ENDTRY|FOR|IF|IFERROR|LEAVE|LOOP|NEXT|RECOVER|REPEAT|RESTORE|THEN|TRY|U\\-DO|U\\+DO|UNTIL|WHILE)(?=\\s|$)', regex: '(?:^|\\s)(?:\\?DUP-0=-IF|\\?DUP-IF|\\)|\\[|\\[\'\\]|\\[CHAR\\]|\\[COMPILE\\]|\\[IS\\]|\\[TO\\]|<COMPILATION|<INTERPRETATION|ASSERT\\(|ASSERT0\\(|ASSERT1\\(|ASSERT2\\(|ASSERT3\\(|COMPILATION>|DEFERS|DOES>|INTERPRETATION>|OF|POSTPONE)(?=\\s|$)',
caseInsensitive: true}, caseInsensitive: true },
{ token: 'keyword.other.compile-only.forth', { token: 'keyword.other.non-immediate.forth',
regex: '(?:^|\\s)(?:\\?DUP-0=-IF|\\?DUP-IF|\\)|\\[|\\[\'\\]|\\[CHAR\\]|\\[COMPILE\\]|\\[IS\\]|\\[TO\\]|<COMPILATION|<INTERPRETATION|ASSERT\\(|ASSERT0\\(|ASSERT1\\(|ASSERT2\\(|ASSERT3\\(|COMPILATION>|DEFERS|DOES>|INTERPRETATION>|OF|POSTPONE)(?=\\s|$)', regex: '(?:^|\\s)(?:\'|<IS>|<TO>|CHAR|END-STRUCT|INCLUDE[D]?|LOAD|NEEDS|REQUIRE[D]?|REVISION|SEE|STRUCT|THRU|USE)(?=\\s|$)',
caseInsensitive: true}, caseInsensitive: true },
{ token: 'keyword.other.non-immediate.forth', { token: 'keyword.other.warning.forth',
regex: '(?:^|\\s)(?:\'|<IS>|<TO>|CHAR|END-STRUCT|INCLUDE[D]?|LOAD|NEEDS|REQUIRE[D]?|REVISION|SEE|STRUCT|THRU|USE)(?=\\s|$)', regex: '(?:^|\\s)(?:~~|BREAK:|BREAK"|DBG)(?=\\s|$)',
caseInsensitive: true}, caseInsensitive: true }],
{ token: 'keyword.other.warning.forth', '#word-def': [{ token: ['keyword.other.compile-only.forth',
regex: '(?:^|\\s)(?:~~|BREAK:|BREAK"|DBG)(?=\\s|$)', 'keyword.other.compile-only.forth',
caseInsensitive: true}], 'meta.block.forth',
'#word-def': 'entity.name.function.forth'],
[ { token: regex: '(:NONAME)|(^:|\\s:)(\\s)(\\S+)(?=\\s|$)',
[ 'keyword.other.compile-only.forth',
'keyword.other.compile-only.forth',
'meta.block.forth',
'entity.name.function.forth' ],
regex: '(:NONAME)|(^:|\\s:)(\\s)(\\S+)(?=\\s|$)',
caseInsensitive: true,
push:
[ { token: 'keyword.other.compile-only.forth',
regex: ';(?:CODE)?',
caseInsensitive: true, caseInsensitive: true,
next: 'pop' }, push: [{ token: 'keyword.other.compile-only.forth',
{ include: '#constant' }, regex: ';(?:CODE)?',
{ include: '#comment' }, caseInsensitive: true,
{ include: '#string' }, next: 'pop' },
{ include: '#word' }, { include: '#constant' },
{ include: '#variable' }, { include: '#comment' },
{ include: '#storage' }, { include: '#string' },
{ defaultToken: 'meta.block.forth' } ] } ] }; { include: '#word' },
{ include: '#variable' },
{ include: '#storage' },
{ defaultToken: 'meta.block.forth' }] }] };
this.normalizeRules(); this.normalizeRules();
}; };
ForthHighlightRules.metaData = { fileTypes: ['frt', 'fs', 'ldr', 'fth', '4th'],
ForthHighlightRules.metaData = { fileTypes: [ 'frt', 'fs', 'ldr', 'fth', '4th' ], foldingStartMarker: '/\\*\\*|\\{\\s*$',
foldingStartMarker: '/\\*\\*|\\{\\s*$', foldingStopMarker: '\\*\\*/|^\\s*\\}',
foldingStopMarker: '\\*\\*/|^\\s*\\}', keyEquivalent: '^~F',
keyEquivalent: '^~F', name: 'Forth',
name: 'Forth', scopeName: 'source.forth' };
scopeName: 'source.forth' };
oop.inherits(ForthHighlightRules, TextHighlightRules); oop.inherits(ForthHighlightRules, TextHighlightRules);
exports.ForthHighlightRules = ForthHighlightRules; exports.ForthHighlightRules = ForthHighlightRules;
}); });
define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../../lib/oop"); var oop = require("../../lib/oop");
var Range = require("../../range").Range; var Range = require("../../range").Range;
var BaseFoldMode = require("./fold_mode").FoldMode; var BaseFoldMode = require("./fold_mode").FoldMode;
var FoldMode = exports.FoldMode = function (commentRegex) {
var FoldMode = exports.FoldMode = function(commentRegex) {
if (commentRegex) { if (commentRegex) {
this.foldingStartMarker = new RegExp( this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
);
this.foldingStopMarker = new RegExp(
this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
);
} }
}; };
oop.inherits(FoldMode, BaseFoldMode); oop.inherits(FoldMode, BaseFoldMode);
(function () {
(function() {
this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/; this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/; this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
this._getFoldWidgetBase = this.getFoldWidget; this._getFoldWidgetBase = this.getFoldWidget;
this.getFoldWidget = function(session, foldStyle, row) { this.getFoldWidget = function (session, foldStyle, row) {
var line = session.getLine(row); var line = session.getLine(row);
if (this.singleLineBlockCommentRe.test(line)) { if (this.singleLineBlockCommentRe.test(line)) {
if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
return ""; return "";
} }
var fw = this._getFoldWidgetBase(session, foldStyle, row); var fw = this._getFoldWidgetBase(session, foldStyle, row);
if (!fw && this.startRegionRe.test(line)) if (!fw && this.startRegionRe.test(line))
return "start"; // lineCommentRegionStart return "start"; // lineCommentRegionStart
return fw; return fw;
}; };
this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
var line = session.getLine(row); var line = session.getLine(row);
if (this.startRegionRe.test(line)) if (this.startRegionRe.test(line))
return this.getCommentRegionBlock(session, line, row); return this.getCommentRegionBlock(session, line, row);
var match = line.match(this.foldingStartMarker); var match = line.match(this.foldingStartMarker);
if (match) { if (match) {
var i = match.index; var i = match.index;
if (match[1]) if (match[1])
return this.openingBracketBlock(session, match[1], row, i); return this.openingBracketBlock(session, match[1], row, i);
var range = session.getCommentFoldRange(row, i + match[0].length, 1); var range = session.getCommentFoldRange(row, i + match[0].length, 1);
if (range && !range.isMultiLine()) { if (range && !range.isMultiLine()) {
if (forceMultiline) { if (forceMultiline) {
range = this.getSectionRange(session, row); range = this.getSectionRange(session, row);
} else if (foldStyle != "all") }
else if (foldStyle != "all")
range = null; range = null;
} }
return range; return range;
} }
if (foldStyle === "markbegin") if (foldStyle === "markbegin")
return; return;
var match = line.match(this.foldingStopMarker); var match = line.match(this.foldingStopMarker);
if (match) { if (match) {
var i = match.index + match[0].length; var i = match.index + match[0].length;
if (match[1]) if (match[1])
return this.closingBracketBlock(session, match[1], row, i); return this.closingBracketBlock(session, match[1], row, i);
return session.getCommentFoldRange(row, i, -1); return session.getCommentFoldRange(row, i, -1);
} }
}; };
this.getSectionRange = function (session, row) {
this.getSectionRange = function(session, row) {
var line = session.getLine(row); var line = session.getLine(row);
var startIndent = line.search(/\S/); var startIndent = line.search(/\S/);
var startRow = row; var startRow = row;
@ -220,71 +177,77 @@ oop.inherits(FoldMode, BaseFoldMode);
var indent = line.search(/\S/); var indent = line.search(/\S/);
if (indent === -1) if (indent === -1)
continue; continue;
if (startIndent > indent) if (startIndent > indent)
break; break;
var subRange = this.getFoldWidgetRange(session, "all", row); var subRange = this.getFoldWidgetRange(session, "all", row);
if (subRange) { if (subRange) {
if (subRange.start.row <= startRow) { if (subRange.start.row <= startRow) {
break; break;
} else if (subRange.isMultiLine()) { }
else if (subRange.isMultiLine()) {
row = subRange.end.row; row = subRange.end.row;
} else if (startIndent == indent) { }
else if (startIndent == indent) {
break; break;
} }
} }
endRow = row; endRow = row;
} }
return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
}; };
this.getCommentRegionBlock = function(session, line, row) { this.getCommentRegionBlock = function (session, line, row) {
var startColumn = line.search(/\s*$/); var startColumn = line.search(/\s*$/);
var maxRow = session.getLength(); var maxRow = session.getLength();
var startRow = row; var startRow = row;
var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
var depth = 1; var depth = 1;
while (++row < maxRow) { while (++row < maxRow) {
line = session.getLine(row); line = session.getLine(row);
var m = re.exec(line); var m = re.exec(line);
if (!m) continue; if (!m)
if (m[1]) depth--; continue;
else depth++; if (m[1])
depth--;
if (!depth) break; else
depth++;
if (!depth)
break;
} }
var endRow = row; var endRow = row;
if (endRow > startRow) { if (endRow > startRow) {
return new Range(startRow, startColumn, endRow, line.length); return new Range(startRow, startColumn, endRow, line.length);
} }
}; };
}).call(FoldMode.prototype); }).call(FoldMode.prototype);
}); });
define("ace/mode/forth",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/forth_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) { define("ace/mode/forth",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/forth_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module){/*
THIS FILE WAS AUTOGENERATED BY mode.tmpl.js
*/
"use strict"; "use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextMode = require("./text").Mode; var TextMode = require("./text").Mode;
var ForthHighlightRules = require("./forth_highlight_rules").ForthHighlightRules; var ForthHighlightRules = require("./forth_highlight_rules").ForthHighlightRules;
var FoldMode = require("./folding/cstyle").FoldMode; var FoldMode = require("./folding/cstyle").FoldMode;
var Mode = function () {
var Mode = function() {
this.HighlightRules = ForthHighlightRules; this.HighlightRules = ForthHighlightRules;
this.foldingRules = new FoldMode(); this.foldingRules = new FoldMode();
this.$behaviour = this.$defaultBehaviour; this.$behaviour = this.$defaultBehaviour;
}; };
oop.inherits(Mode, TextMode); oop.inherits(Mode, TextMode);
(function () {
(function() {
this.lineCommentStart = "--"; this.lineCommentStart = "--";
this.blockComment = null; this.blockComment = null;
this.$id = "ace/mode/forth"; this.$id = "ace/mode/forth";
}).call(Mode.prototype); }).call(Mode.prototype);
exports.Mode = Mode; exports.Mode = Mode;
});
}); (function() {
window.require(["ace/mode/forth"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

View File

@ -1,68 +1,47 @@
define("ace/mode/fortran_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { define("ace/mode/fortran_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){/* Derived from Python highlighing rules */
"use strict"; "use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var FortranHighlightRules = function () {
var FortranHighlightRules = function() { var keywords = ("call|case|contains|continue|cycle|do|else|elseif|end|enddo|endif|function|" +
"if|implicit|in|include|inout|intent|module|none|only|out|print|program|return|" +
var keywords = (
"call|case|contains|continue|cycle|do|else|elseif|end|enddo|endif|function|"+
"if|implicit|in|include|inout|intent|module|none|only|out|print|program|return|"+
"select|status|stop|subroutine|" + "select|status|stop|subroutine|" +
"return|then|use|while|write|"+ "return|then|use|while|write|" +
"CALL|CASE|CONTAINS|CONTINUE|CYCLE|DO|ELSE|ELSEIF|END|ENDDO|ENDIF|FUNCTION|"+ "CALL|CASE|CONTAINS|CONTINUE|CYCLE|DO|ELSE|ELSEIF|END|ENDDO|ENDIF|FUNCTION|" +
"IF|IMPLICIT|IN|INCLUDE|INOUT|INTENT|MODULE|NONE|ONLY|OUT|PRINT|PROGRAM|RETURN|"+ "IF|IMPLICIT|IN|INCLUDE|INOUT|INTENT|MODULE|NONE|ONLY|OUT|PRINT|PROGRAM|RETURN|" +
"SELECT|STATUS|STOP|SUBROUTINE|" + "SELECT|STATUS|STOP|SUBROUTINE|" +
"RETURN|THEN|USE|WHILE|WRITE" "RETURN|THEN|USE|WHILE|WRITE");
); var keywordOperators = ("and|or|not|eq|ne|gt|ge|lt|le|" +
"AND|OR|NOT|EQ|NE|GT|GE|LT|LE");
var keywordOperators = ( var builtinConstants = ("true|false|TRUE|FALSE");
"and|or|not|eq|ne|gt|ge|lt|le|" + var builtinFunctions = ("abs|achar|acos|acosh|adjustl|adjustr|aimag|aint|all|allocate|" +
"AND|OR|NOT|EQ|NE|GT|GE|LT|LE" "anint|any|asin|asinh|associated|atan|atan2|atanh|" +
); "bessel_j0|bessel_j1|bessel_jn|bessel_y0|bessel_y1|bessel_yn|" +
"bge|bgt|bit_size|ble|blt|btest|ceiling|char|cmplx|conjg|cos|cosh|" +
var builtinConstants = ( "count|cpu_time|cshift|date_and_time|dble|deallocate|digits|dim|dot_product|dprod|" +
"true|false|TRUE|FALSE" "dshiftl|dshiftr|dsqrt|eoshift|epsilon|erf|erfc|erfc_scaled|exp|float|floor|" +
); "format|fraction|gamma|input|len|lge|lgt|lle|llt|log|log10|maskl|maskr|matmul|max|maxloc|maxval|" +
"merge|min|minloc|minval|mod|modulo|nint|not|norm2|null|nullify|pack|parity|popcnt|poppar|" +
var builtinFunctions = ( "precision|present|product|radix|random_number|random_seed|range|repeat|reshape|round|" +
"abs|achar|acos|acosh|adjustl|adjustr|aimag|aint|all|allocate|"+ "rrspacing|same_type_as|scale|scan|selected_char_kind|selected_int_kind|selected_real_kind|" +
"anint|any|asin|asinh|associated|atan|atan2|atanh|"+ "set_exponent|shape|shifta|shiftl|shiftr|sign|sin|sinh|size|sngl|spacing|spread|" +
"bessel_j0|bessel_j1|bessel_jn|bessel_y0|bessel_y1|bessel_yn|"+
"bge|bgt|bit_size|ble|blt|btest|ceiling|char|cmplx|conjg|cos|cosh|"+
"count|cpu_time|cshift|date_and_time|dble|deallocate|digits|dim|dot_product|dprod|"+
"dshiftl|dshiftr|dsqrt|eoshift|epsilon|erf|erfc|erfc_scaled|exp|float|floor|"+
"format|fraction|gamma|input|len|lge|lgt|lle|llt|log|log10|maskl|maskr|matmul|max|maxloc|maxval|"+
"merge|min|minloc|minval|mod|modulo|nint|not|norm2|null|nullify|pack|parity|popcnt|poppar|"+
"precision|present|product|radix|random_number|random_seed|range|repeat|reshape|round|"+
"rrspacing|same_type_as|scale|scan|selected_char_kind|selected_int_kind|selected_real_kind|"+
"set_exponent|shape|shifta|shiftl|shiftr|sign|sin|sinh|size|sngl|spacing|spread|"+
"sqrt|sum|system_clock|tan|tanh|tiny|trailz|transfer|transpose|trim|ubound|unpack|verify|" + "sqrt|sum|system_clock|tan|tanh|tiny|trailz|transfer|transpose|trim|ubound|unpack|verify|" +
"ABS|ACHAR|ACOS|ACOSH|ADJUSTL|ADJUSTR|AIMAG|AINT|ALL|ALLOCATE|"+ "ABS|ACHAR|ACOS|ACOSH|ADJUSTL|ADJUSTR|AIMAG|AINT|ALL|ALLOCATE|" +
"ANINT|ANY|ASIN|ASINH|ASSOCIATED|ATAN|ATAN2|ATANH|"+ "ANINT|ANY|ASIN|ASINH|ASSOCIATED|ATAN|ATAN2|ATANH|" +
"BESSEL_J0|BESSEL_J1|BESSEL_JN|BESSEL_Y0|BESSEL_Y1|BESSEL_YN|"+ "BESSEL_J0|BESSEL_J1|BESSEL_JN|BESSEL_Y0|BESSEL_Y1|BESSEL_YN|" +
"BGE|BGT|BIT_SIZE|BLE|BLT|BTEST|CEILING|CHAR|CMPLX|CONJG|COS|COSH|"+ "BGE|BGT|BIT_SIZE|BLE|BLT|BTEST|CEILING|CHAR|CMPLX|CONJG|COS|COSH|" +
"COUNT|CPU_TIME|CSHIFT|DATE_AND_TIME|DBLE|DEALLOCATE|DIGITS|DIM|DOT_PRODUCT|DPROD|"+ "COUNT|CPU_TIME|CSHIFT|DATE_AND_TIME|DBLE|DEALLOCATE|DIGITS|DIM|DOT_PRODUCT|DPROD|" +
"DSHIFTL|DSHIFTR|DSQRT|EOSHIFT|EPSILON|ERF|ERFC|ERFC_SCALED|EXP|FLOAT|FLOOR|"+ "DSHIFTL|DSHIFTR|DSQRT|EOSHIFT|EPSILON|ERF|ERFC|ERFC_SCALED|EXP|FLOAT|FLOOR|" +
"FORMAT|FRACTION|GAMMA|INPUT|LEN|LGE|LGT|LLE|LLT|LOG|LOG10|MASKL|MASKR|MATMUL|MAX|MAXLOC|MAXVAL|"+ "FORMAT|FRACTION|GAMMA|INPUT|LEN|LGE|LGT|LLE|LLT|LOG|LOG10|MASKL|MASKR|MATMUL|MAX|MAXLOC|MAXVAL|" +
"MERGE|MIN|MINLOC|MINVAL|MOD|MODULO|NINT|NOT|NORM2|NULL|NULLIFY|PACK|PARITY|POPCNT|POPPAR|"+ "MERGE|MIN|MINLOC|MINVAL|MOD|MODULO|NINT|NOT|NORM2|NULL|NULLIFY|PACK|PARITY|POPCNT|POPPAR|" +
"PRECISION|PRESENT|PRODUCT|RADIX|RANDOM_NUMBER|RANDOM_SEED|RANGE|REPEAT|RESHAPE|ROUND|"+ "PRECISION|PRESENT|PRODUCT|RADIX|RANDOM_NUMBER|RANDOM_SEED|RANGE|REPEAT|RESHAPE|ROUND|" +
"RRSPACING|SAME_TYPE_AS|SCALE|SCAN|SELECTED_CHAR_KIND|SELECTED_INT_KIND|SELECTED_REAL_KIND|"+ "RRSPACING|SAME_TYPE_AS|SCALE|SCAN|SELECTED_CHAR_KIND|SELECTED_INT_KIND|SELECTED_REAL_KIND|" +
"SET_EXPONENT|SHAPE|SHIFTA|SHIFTL|SHIFTR|SIGN|SIN|SINH|SIZE|SNGL|SPACING|SPREAD|"+ "SET_EXPONENT|SHAPE|SHIFTA|SHIFTL|SHIFTR|SIGN|SIN|SINH|SIZE|SNGL|SPACING|SPREAD|" +
"SQRT|SUM|SYSTEM_CLOCK|TAN|TANH|TINY|TRAILZ|TRANSFER|TRANSPOSE|TRIM|UBOUND|UNPACK|VERIFY" "SQRT|SUM|SYSTEM_CLOCK|TAN|TANH|TINY|TRAILZ|TRANSFER|TRANSPOSE|TRIM|UBOUND|UNPACK|VERIFY");
); var storageType = ("logical|character|integer|real|type|" +
"LOGICAL|CHARACTER|INTEGER|REAL|TYPE");
var storageType = ( var storageModifiers = ("allocatable|dimension|intent|parameter|pointer|target|private|public|" +
"logical|character|integer|real|type|" + "ALLOCATABLE|DIMENSION|INTENT|PARAMETER|POINTER|TARGET|PRIVATE|PUBLIC");
"LOGICAL|CHARACTER|INTEGER|REAL|TYPE"
);
var storageModifiers = (
"allocatable|dimension|intent|parameter|pointer|target|private|public|" +
"ALLOCATABLE|DIMENSION|INTENT|PARAMETER|POINTER|TARGET|PRIVATE|PUBLIC"
);
var keywordMapper = this.createKeywordMapper({ var keywordMapper = this.createKeywordMapper({
"invalid.deprecated": "debugger", "invalid.deprecated": "debugger",
"support.function": builtinFunctions, "support.function": builtinFunctions,
@ -70,219 +49,189 @@ var FortranHighlightRules = function() {
"keyword": keywords, "keyword": keywords,
"keyword.operator": keywordOperators, "keyword.operator": keywordOperators,
"storage.type": storageType, "storage.type": storageType,
"storage.modifier" : storageModifiers "storage.modifier": storageModifiers
}, "identifier"); }, "identifier");
var strPre = "(?:r|u|ur|R|U|UR|Ur|uR)?"; var strPre = "(?:r|u|ur|R|U|UR|Ur|uR)?";
var decimalInteger = "(?:(?:[1-9]\\d*)|(?:0))"; var decimalInteger = "(?:(?:[1-9]\\d*)|(?:0))";
var octInteger = "(?:0[oO]?[0-7]+)"; var octInteger = "(?:0[oO]?[0-7]+)";
var hexInteger = "(?:0[xX][\\dA-Fa-f]+)"; var hexInteger = "(?:0[xX][\\dA-Fa-f]+)";
var binInteger = "(?:0[bB][01]+)"; var binInteger = "(?:0[bB][01]+)";
var integer = "(?:" + decimalInteger + "|" + octInteger + "|" + hexInteger + "|" + binInteger + ")"; var integer = "(?:" + decimalInteger + "|" + octInteger + "|" + hexInteger + "|" + binInteger + ")";
var exponent = "(?:[eE][+-]?\\d+)"; var exponent = "(?:[eE][+-]?\\d+)";
var fraction = "(?:\\.\\d+)"; var fraction = "(?:\\.\\d+)";
var intPart = "(?:\\d+)"; var intPart = "(?:\\d+)";
var pointFloat = "(?:(?:" + intPart + "?" + fraction + ")|(?:" + intPart + "\\.))"; var pointFloat = "(?:(?:" + intPart + "?" + fraction + ")|(?:" + intPart + "\\.))";
var exponentFloat = "(?:(?:" + pointFloat + "|" + intPart + ")" + exponent + ")"; var exponentFloat = "(?:(?:" + pointFloat + "|" + intPart + ")" + exponent + ")";
var floatNumber = "(?:" + exponentFloat + "|" + pointFloat + ")"; var floatNumber = "(?:" + exponentFloat + "|" + pointFloat + ")";
var stringEscape = "\\\\(x[0-9A-Fa-f]{2}|[0-7]{3}|[\\\\abfnrtv'\"]|U[0-9A-Fa-f]{8}|u[0-9A-Fa-f]{4})";
var stringEscape = "\\\\(x[0-9A-Fa-f]{2}|[0-7]{3}|[\\\\abfnrtv'\"]|U[0-9A-Fa-f]{8}|u[0-9A-Fa-f]{4})";
this.$rules = { this.$rules = {
"start" : [ { "start": [{
token : "comment", token: "comment",
regex : "!.*$" regex: "!.*$"
}, { }, {
token : "string", // multi line """ string start token: "string", // multi line """ string start
regex : strPre + '"{3}', regex: strPre + '"{3}',
next : "qqstring3" next: "qqstring3"
}, { }, {
token : "string", // " string token: "string", // " string
regex : strPre + '"(?=.)', regex: strPre + '"(?=.)',
next : "qqstring" next: "qqstring"
}, { }, {
token : "string", // multi line ''' string start token: "string", // multi line ''' string start
regex : strPre + "'{3}", regex: strPre + "'{3}",
next : "qstring3" next: "qstring3"
}, { }, {
token : "string", // ' string token: "string", // ' string
regex : strPre + "'(?=.)", regex: strPre + "'(?=.)",
next : "qstring" next: "qstring"
}, { }, {
token : "constant.numeric", // imaginary token: "constant.numeric", // imaginary
regex : "(?:" + floatNumber + "|\\d+)[jJ]\\b" regex: "(?:" + floatNumber + "|\\d+)[jJ]\\b"
}, { }, {
token : "constant.numeric", // float token: "constant.numeric", // float
regex : floatNumber regex: floatNumber
}, { }, {
token : "constant.numeric", // long integer token: "constant.numeric", // long integer
regex : integer + "[lL]\\b" regex: integer + "[lL]\\b"
}, { }, {
token : "constant.numeric", // integer token: "constant.numeric", // integer
regex : integer + "\\b" regex: integer + "\\b"
}, { }, {
token : "keyword", // pre-compiler directives token: "keyword", // pre-compiler directives
regex : "#\\s*(?:include|import|define|undef|INCLUDE|IMPORT|DEFINE|UNDEF)\\b" regex: "#\\s*(?:include|import|define|undef|INCLUDE|IMPORT|DEFINE|UNDEF)\\b"
}, { }, {
token : "keyword", // special case pre-compiler directive token: "keyword", // special case pre-compiler directive
regex : "#\\s*(?:endif|ifdef|else|elseif|ifndef|ENDIF|IFDEF|ELSE|ELSEIF|IFNDEF)\\b" regex: "#\\s*(?:endif|ifdef|else|elseif|ifndef|ENDIF|IFDEF|ELSE|ELSEIF|IFNDEF)\\b"
}, { }, {
token : keywordMapper, token: keywordMapper,
regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
}, { }, {
token : "keyword.operator", token: "keyword.operator",
regex : "\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|%|<<|>>|&|\\||\\^|~|<|>|<=|=>|==|!=|<>|=" regex: "\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|%|<<|>>|&|\\||\\^|~|<|>|<=|=>|==|!=|<>|="
}, { }, {
token : "paren.lparen", token: "paren.lparen",
regex : "[\\[\\(\\{]" regex: "[\\[\\(\\{]"
}, { }, {
token : "paren.rparen", token: "paren.rparen",
regex : "[\\]\\)\\}]" regex: "[\\]\\)\\}]"
}, { }, {
token : "text", token: "text",
regex : "\\s+" regex: "\\s+"
} ], }],
"qqstring3" : [ { "qqstring3": [{
token : "constant.language.escape", token: "constant.language.escape",
regex : stringEscape regex: stringEscape
}, { }, {
token : "string", // multi line """ string end token: "string", // multi line """ string end
regex : '"{3}', regex: '"{3}',
next : "start" next: "start"
}, { }, {
defaultToken : "string" defaultToken: "string"
} ], }],
"qstring3" : [ { "qstring3": [{
token : "constant.language.escape", token: "constant.language.escape",
regex : stringEscape regex: stringEscape
}, { }, {
token : "string", // multi line """ string end token: "string", // multi line """ string end
regex : '"{3}', regex: '"{3}',
next : "start" next: "start"
}, { }, {
defaultToken : "string" defaultToken: "string"
} ], }],
"qqstring" : [{ "qqstring": [{
token : "constant.language.escape", token: "constant.language.escape",
regex : stringEscape regex: stringEscape
}, { }, {
token : "string", token: "string",
regex : "\\\\$", regex: "\\\\$",
next : "qqstring" next: "qqstring"
}, { }, {
token : "string", token: "string",
regex : '"|$', regex: '"|$',
next : "start" next: "start"
}, { }, {
defaultToken: "string" defaultToken: "string"
}], }],
"qstring" : [{ "qstring": [{
token : "constant.language.escape", token: "constant.language.escape",
regex : stringEscape regex: stringEscape
}, { }, {
token : "string", token: "string",
regex : "\\\\$", regex: "\\\\$",
next : "qstring" next: "qstring"
}, { }, {
token : "string", token: "string",
regex : "'|$", regex: "'|$",
next : "start" next: "start"
}, { }, {
defaultToken: "string" defaultToken: "string"
}] }]
}; };
}; };
oop.inherits(FortranHighlightRules, TextHighlightRules); oop.inherits(FortranHighlightRules, TextHighlightRules);
exports.FortranHighlightRules = FortranHighlightRules; exports.FortranHighlightRules = FortranHighlightRules;
}); });
define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../../lib/oop"); var oop = require("../../lib/oop");
var Range = require("../../range").Range; var Range = require("../../range").Range;
var BaseFoldMode = require("./fold_mode").FoldMode; var BaseFoldMode = require("./fold_mode").FoldMode;
var FoldMode = exports.FoldMode = function (commentRegex) {
var FoldMode = exports.FoldMode = function(commentRegex) {
if (commentRegex) { if (commentRegex) {
this.foldingStartMarker = new RegExp( this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
);
this.foldingStopMarker = new RegExp(
this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
);
} }
}; };
oop.inherits(FoldMode, BaseFoldMode); oop.inherits(FoldMode, BaseFoldMode);
(function () {
(function() {
this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/; this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/; this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
this._getFoldWidgetBase = this.getFoldWidget; this._getFoldWidgetBase = this.getFoldWidget;
this.getFoldWidget = function(session, foldStyle, row) { this.getFoldWidget = function (session, foldStyle, row) {
var line = session.getLine(row); var line = session.getLine(row);
if (this.singleLineBlockCommentRe.test(line)) { if (this.singleLineBlockCommentRe.test(line)) {
if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
return ""; return "";
} }
var fw = this._getFoldWidgetBase(session, foldStyle, row); var fw = this._getFoldWidgetBase(session, foldStyle, row);
if (!fw && this.startRegionRe.test(line)) if (!fw && this.startRegionRe.test(line))
return "start"; // lineCommentRegionStart return "start"; // lineCommentRegionStart
return fw; return fw;
}; };
this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
var line = session.getLine(row); var line = session.getLine(row);
if (this.startRegionRe.test(line)) if (this.startRegionRe.test(line))
return this.getCommentRegionBlock(session, line, row); return this.getCommentRegionBlock(session, line, row);
var match = line.match(this.foldingStartMarker); var match = line.match(this.foldingStartMarker);
if (match) { if (match) {
var i = match.index; var i = match.index;
if (match[1]) if (match[1])
return this.openingBracketBlock(session, match[1], row, i); return this.openingBracketBlock(session, match[1], row, i);
var range = session.getCommentFoldRange(row, i + match[0].length, 1); var range = session.getCommentFoldRange(row, i + match[0].length, 1);
if (range && !range.isMultiLine()) { if (range && !range.isMultiLine()) {
if (forceMultiline) { if (forceMultiline) {
range = this.getSectionRange(session, row); range = this.getSectionRange(session, row);
} else if (foldStyle != "all") }
else if (foldStyle != "all")
range = null; range = null;
} }
return range; return range;
} }
if (foldStyle === "markbegin") if (foldStyle === "markbegin")
return; return;
var match = line.match(this.foldingStopMarker); var match = line.match(this.foldingStopMarker);
if (match) { if (match) {
var i = match.index + match[0].length; var i = match.index + match[0].length;
if (match[1]) if (match[1])
return this.closingBracketBlock(session, match[1], row, i); return this.closingBracketBlock(session, match[1], row, i);
return session.getCommentFoldRange(row, i, -1); return session.getCommentFoldRange(row, i, -1);
} }
}; };
this.getSectionRange = function (session, row) {
this.getSectionRange = function(session, row) {
var line = session.getLine(row); var line = session.getLine(row);
var startIndent = line.search(/\S/); var startIndent = line.search(/\S/);
var startRow = row; var startRow = row;
@ -295,91 +244,81 @@ oop.inherits(FoldMode, BaseFoldMode);
var indent = line.search(/\S/); var indent = line.search(/\S/);
if (indent === -1) if (indent === -1)
continue; continue;
if (startIndent > indent) if (startIndent > indent)
break; break;
var subRange = this.getFoldWidgetRange(session, "all", row); var subRange = this.getFoldWidgetRange(session, "all", row);
if (subRange) { if (subRange) {
if (subRange.start.row <= startRow) { if (subRange.start.row <= startRow) {
break; break;
} else if (subRange.isMultiLine()) { }
else if (subRange.isMultiLine()) {
row = subRange.end.row; row = subRange.end.row;
} else if (startIndent == indent) { }
else if (startIndent == indent) {
break; break;
} }
} }
endRow = row; endRow = row;
} }
return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
}; };
this.getCommentRegionBlock = function(session, line, row) { this.getCommentRegionBlock = function (session, line, row) {
var startColumn = line.search(/\s*$/); var startColumn = line.search(/\s*$/);
var maxRow = session.getLength(); var maxRow = session.getLength();
var startRow = row; var startRow = row;
var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
var depth = 1; var depth = 1;
while (++row < maxRow) { while (++row < maxRow) {
line = session.getLine(row); line = session.getLine(row);
var m = re.exec(line); var m = re.exec(line);
if (!m) continue; if (!m)
if (m[1]) depth--; continue;
else depth++; if (m[1])
depth--;
if (!depth) break; else
depth++;
if (!depth)
break;
} }
var endRow = row; var endRow = row;
if (endRow > startRow) { if (endRow > startRow) {
return new Range(startRow, startColumn, endRow, line.length); return new Range(startRow, startColumn, endRow, line.length);
} }
}; };
}).call(FoldMode.prototype); }).call(FoldMode.prototype);
}); });
define("ace/mode/fortran",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/fortran_highlight_rules","ace/mode/folding/cstyle","ace/range"], function(require, exports, module) { define("ace/mode/fortran",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/fortran_highlight_rules","ace/mode/folding/cstyle","ace/range"], function(require, exports, module){/* Derived from Python rules */
"use strict"; "use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextMode = require("./text").Mode; var TextMode = require("./text").Mode;
var FortranHighlightRules = require("./fortran_highlight_rules").FortranHighlightRules; var FortranHighlightRules = require("./fortran_highlight_rules").FortranHighlightRules;
var CStyleFoldMode = require("./folding/cstyle").FoldMode; var CStyleFoldMode = require("./folding/cstyle").FoldMode;
var Range = require("../range").Range; var Range = require("../range").Range;
var Mode = function () {
var Mode = function() {
this.HighlightRules = FortranHighlightRules; this.HighlightRules = FortranHighlightRules;
this.foldingRules = new CStyleFoldMode(); this.foldingRules = new CStyleFoldMode();
this.$behaviour = this.$defaultBehaviour; this.$behaviour = this.$defaultBehaviour;
}; };
oop.inherits(Mode, TextMode); oop.inherits(Mode, TextMode);
(function () {
(function() {
this.lineCommentStart = "!"; this.lineCommentStart = "!";
this.getNextLineIndent = function (state, line, tab) {
this.getNextLineIndent = function(state, line, tab) {
var indent = this.$getIndent(line); var indent = this.$getIndent(line);
var tokenizedLine = this.getTokenizer().getLineTokens(line, state); var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
var tokens = tokenizedLine.tokens; var tokens = tokenizedLine.tokens;
if (tokens.length && tokens[tokens.length - 1].type == "comment") {
if (tokens.length && tokens[tokens.length-1].type == "comment") {
return indent; return indent;
} }
if (state == "start") { if (state == "start") {
var match = line.match(/^.*[\{\(\[:]\s*$/); var match = line.match(/^.*[\{\(\[:]\s*$/);
if (match) { if (match) {
indent += tab; indent += tab;
} }
} }
return indent; return indent;
}; };
var outdents = { var outdents = {
"return": 1, "return": 1,
"break": 1, "break": 1,
@ -388,36 +327,35 @@ oop.inherits(Mode, TextMode);
"BREAK": 1, "BREAK": 1,
"CONTINUE": 1 "CONTINUE": 1
}; };
this.checkOutdent = function (state, line, input) {
this.checkOutdent = function(state, line, input) {
if (input !== "\r\n" && input !== "\r" && input !== "\n") if (input !== "\r\n" && input !== "\r" && input !== "\n")
return false; return false;
var tokens = this.getTokenizer().getLineTokens(line.trim(), state).tokens; var tokens = this.getTokenizer().getLineTokens(line.trim(), state).tokens;
if (!tokens) if (!tokens)
return false; return false;
do { do {
var last = tokens.pop(); var last = tokens.pop();
} while (last && (last.type == "comment" || (last.type == "text" && last.value.match(/^\s+$/)))); } while (last && (last.type == "comment" || (last.type == "text" && last.value.match(/^\s+$/))));
if (!last) if (!last)
return false; return false;
return (last.type == "keyword" && outdents[last.value]); return (last.type == "keyword" && outdents[last.value]);
}; };
this.autoOutdent = function (state, doc, row) {
this.autoOutdent = function(state, doc, row) {
row += 1; row += 1;
var indent = this.$getIndent(doc.getLine(row)); var indent = this.$getIndent(doc.getLine(row));
var tab = doc.getTabString(); var tab = doc.getTabString();
if (indent.slice(-tab.length) == tab) if (indent.slice(-tab.length) == tab)
doc.remove(new Range(row, indent.length-tab.length, row, indent.length)); doc.remove(new Range(row, indent.length - tab.length, row, indent.length));
}; };
this.$id = "ace/mode/fortran"; this.$id = "ace/mode/fortran";
}).call(Mode.prototype); }).call(Mode.prototype);
exports.Mode = Mode; exports.Mode = Mode;
});
}); (function() {
window.require(["ace/mode/fortran"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

View File

@ -0,0 +1,277 @@
define("ace/mode/fsharp_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var FSharpHighlightRules = function () {
var keywordMapper = this.createKeywordMapper({
"variable": "this",
"keyword": 'abstract|assert|base|begin|class|default|delegate|done|downcast|downto|elif\
|else|exception|extern|false|finally|function|global|inherit|inline|interface|internal|lazy|match\
|member|module|mutable|namespace|open|or|override|private|public|rec|return|return!|select|static\
|struct|then|to|true|try|typeof|upcast|use|use!|val|void|when|while|with|yield|yield!|__SOURCE_DIRECTORY__\
|as|asr|land|lor|lsl|lsr|lxor|mod|sig|atomic|break|checked|component|const|constraint|constructor|continue\
|eager|event|external|fixed|functor|include|method|mixin|object|parallel|process|protected|pure|sealed|tailcall\
|trait|virtual|volatile|and|do|end|for|fun|if|in|let|let!|new|not|null|of|endif',
"constant": "true|false"
}, "identifier");
var floatNumber = "(?:(?:(?:(?:(?:(?:\\d+)?(?:\\.\\d+))|(?:(?:\\d+)\\.))|(?:\\d+))(?:[eE][+-]?\\d+))|(?:(?:(?:\\d+)?(?:\\.\\d+))|(?:(?:\\d+)\\.)))";
this.$rules = {
"start": [
{
token: "variable.classes",
regex: '\\[\\<[.]*\\>\\]'
},
{
token: "comment",
regex: '//.*$'
},
{
token: "comment.start",
regex: /\(\*(?!\))/,
push: "blockComment"
},
{
token: "string",
regex: "'.'"
},
{
token: "string",
regex: '"""',
next: [{
token: "constant.language.escape",
regex: /\\./,
next: "qqstring"
}, {
token: "string",
regex: '"""',
next: "start"
}, {
defaultToken: "string"
}]
},
{
token: "string",
regex: '"',
next: [{
token: "constant.language.escape",
regex: /\\./,
next: "qqstring"
}, {
token: "string",
regex: '"',
next: "start"
}, {
defaultToken: "string"
}]
},
{
token: ["verbatim.string", "string"],
regex: '(@?)(")',
stateName: "qqstring",
next: [{
token: "constant.language.escape",
regex: '""'
}, {
token: "string",
regex: '"',
next: "start"
}, {
defaultToken: "string"
}]
},
{
token: "constant.float",
regex: "(?:" + floatNumber + "|\\d+)[jJ]\\b"
},
{
token: "constant.float",
regex: floatNumber
},
{
token: "constant.integer",
regex: "(?:(?:(?:[1-9]\\d*)|(?:0))|(?:0[oO]?[0-7]+)|(?:0[xX][\\dA-Fa-f]+)|(?:0[bB][01]+))\\b"
},
{
token: ["keyword.type", "variable"],
regex: "(type\\s)([a-zA-Z0-9_$\-]*\\b)"
},
{
token: keywordMapper,
regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
},
{
token: "keyword.operator",
regex: "\\+\\.|\\-\\.|\\*\\.|\\/\\.|#|;;|\\+|\\-|\\*|\\*\\*\\/|\\/\\/|%|<<|>>|&|\\||\\^|~|<|>|<=|=>|==|!=|<>|<-|=|\\(\\*\\)"
},
{
token: "paren.lparen",
regex: "[[({]"
},
{
token: "paren.rparen",
regex: "[\\])}]"
}
],
blockComment: [{
regex: /\(\*\)/,
token: "comment"
}, {
regex: /\(\*(?!\))/,
token: "comment.start",
push: "blockComment"
}, {
regex: /\*\)/,
token: "comment.end",
next: "pop"
}, {
defaultToken: "comment"
}]
};
this.normalizeRules();
};
oop.inherits(FSharpHighlightRules, TextHighlightRules);
exports.FSharpHighlightRules = FSharpHighlightRules;
});
define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var Range = require("../../range").Range;
var BaseFoldMode = require("./fold_mode").FoldMode;
var FoldMode = exports.FoldMode = function (commentRegex) {
if (commentRegex) {
this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
}
};
oop.inherits(FoldMode, BaseFoldMode);
(function () {
this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
this._getFoldWidgetBase = this.getFoldWidget;
this.getFoldWidget = function (session, foldStyle, row) {
var line = session.getLine(row);
if (this.singleLineBlockCommentRe.test(line)) {
if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
return "";
}
var fw = this._getFoldWidgetBase(session, foldStyle, row);
if (!fw && this.startRegionRe.test(line))
return "start"; // lineCommentRegionStart
return fw;
};
this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
var line = session.getLine(row);
if (this.startRegionRe.test(line))
return this.getCommentRegionBlock(session, line, row);
var match = line.match(this.foldingStartMarker);
if (match) {
var i = match.index;
if (match[1])
return this.openingBracketBlock(session, match[1], row, i);
var range = session.getCommentFoldRange(row, i + match[0].length, 1);
if (range && !range.isMultiLine()) {
if (forceMultiline) {
range = this.getSectionRange(session, row);
}
else if (foldStyle != "all")
range = null;
}
return range;
}
if (foldStyle === "markbegin")
return;
var match = line.match(this.foldingStopMarker);
if (match) {
var i = match.index + match[0].length;
if (match[1])
return this.closingBracketBlock(session, match[1], row, i);
return session.getCommentFoldRange(row, i, -1);
}
};
this.getSectionRange = function (session, row) {
var line = session.getLine(row);
var startIndent = line.search(/\S/);
var startRow = row;
var startColumn = line.length;
row = row + 1;
var endRow = row;
var maxRow = session.getLength();
while (++row < maxRow) {
line = session.getLine(row);
var indent = line.search(/\S/);
if (indent === -1)
continue;
if (startIndent > indent)
break;
var subRange = this.getFoldWidgetRange(session, "all", row);
if (subRange) {
if (subRange.start.row <= startRow) {
break;
}
else if (subRange.isMultiLine()) {
row = subRange.end.row;
}
else if (startIndent == indent) {
break;
}
}
endRow = row;
}
return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
};
this.getCommentRegionBlock = function (session, line, row) {
var startColumn = line.search(/\s*$/);
var maxRow = session.getLength();
var startRow = row;
var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
var depth = 1;
while (++row < maxRow) {
line = session.getLine(row);
var m = re.exec(line);
if (!m)
continue;
if (m[1])
depth--;
else
depth++;
if (!depth)
break;
}
var endRow = row;
if (endRow > startRow) {
return new Range(startRow, startColumn, endRow, line.length);
}
};
}).call(FoldMode.prototype);
});
define("ace/mode/fsharp",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/fsharp_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var FSharpHighlightRules = require("./fsharp_highlight_rules").FSharpHighlightRules;
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
var Mode = function () {
TextMode.call(this);
this.HighlightRules = FSharpHighlightRules;
this.foldingRules = new CStyleFoldMode();
};
oop.inherits(Mode, TextMode);
(function () {
this.lineCommentStart = "//";
this.blockComment = { start: "(*", end: "*)", nestable: true };
this.$id = "ace/mode/fsharp";
}).call(Mode.prototype);
exports.Mode = Mode;
}); (function() {
window.require(["ace/mode/fsharp"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

View File

@ -0,0 +1,226 @@
define("ace/mode/fsl_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var FSLHighlightRules = function () {
this.$rules = {
start: [{
token: "punctuation.definition.comment.mn",
regex: /\/\*/,
push: [{
token: "punctuation.definition.comment.mn",
regex: /\*\//,
next: "pop"
}, {
defaultToken: "comment.block.fsl"
}]
}, {
token: "comment.line.fsl",
regex: /\/\//,
push: [{
token: "comment.line.fsl",
regex: /$/,
next: "pop"
}, {
defaultToken: "comment.line.fsl"
}]
}, {
token: "entity.name.function",
regex: /\${/,
push: [{
token: "entity.name.function",
regex: /}/,
next: "pop"
}, {
defaultToken: "keyword.other"
}],
comment: "js outcalls"
}, {
token: "constant.numeric",
regex: /[0-9]*\.[0-9]*\.[0-9]*/,
comment: "semver"
}, {
token: "constant.language.fslLanguage",
regex: "(?:"
+ "graph_layout|machine_name|machine_author|machine_license|machine_comment|machine_language"
+ "|machine_version|machine_reference|npm_name|graph_layout|on_init|on_halt|on_end|on_terminate|on_finalize|on_transition"
+ "|on_action|on_stochastic_action|on_legal|on_main|on_forced|on_validation|on_validation_failure|on_transition_refused|on_forced_transition_refused"
+ "|on_action_refused|on_enter|on_exit|start_states|end_states|terminal_states|final_states|fsl_version"
+ ")\\s*:"
}, {
token: "keyword.control.transition.fslArrow",
regex: /<->|<-|->|<=>|=>|<=|<~>|~>|<~|<-=>|<=->|<-~>|<~->|<=~>|<~=>/
}, {
token: "constant.numeric.fslProbability",
regex: /[0-9]+%/,
comment: "edge probability annotation"
}, {
token: "constant.character.fslAction",
regex: /\'[^']*\'/,
comment: "action annotation"
}, {
token: "string.quoted.double.fslLabel.doublequoted",
regex: /\"[^"]*\"/,
comment: "fsl label annotation"
}, {
token: "entity.name.tag.fslLabel.atom",
regex: /[a-zA-Z0-9_.+&()#@!?,]/,
comment: "fsl label annotation"
}]
};
this.normalizeRules();
};
FSLHighlightRules.metaData = {
fileTypes: ["fsl", "fsl_state"],
name: "FSL",
scopeName: "source.fsl"
};
oop.inherits(FSLHighlightRules, TextHighlightRules);
exports.FSLHighlightRules = FSLHighlightRules;
});
define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var Range = require("../../range").Range;
var BaseFoldMode = require("./fold_mode").FoldMode;
var FoldMode = exports.FoldMode = function (commentRegex) {
if (commentRegex) {
this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
}
};
oop.inherits(FoldMode, BaseFoldMode);
(function () {
this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
this._getFoldWidgetBase = this.getFoldWidget;
this.getFoldWidget = function (session, foldStyle, row) {
var line = session.getLine(row);
if (this.singleLineBlockCommentRe.test(line)) {
if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
return "";
}
var fw = this._getFoldWidgetBase(session, foldStyle, row);
if (!fw && this.startRegionRe.test(line))
return "start"; // lineCommentRegionStart
return fw;
};
this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
var line = session.getLine(row);
if (this.startRegionRe.test(line))
return this.getCommentRegionBlock(session, line, row);
var match = line.match(this.foldingStartMarker);
if (match) {
var i = match.index;
if (match[1])
return this.openingBracketBlock(session, match[1], row, i);
var range = session.getCommentFoldRange(row, i + match[0].length, 1);
if (range && !range.isMultiLine()) {
if (forceMultiline) {
range = this.getSectionRange(session, row);
}
else if (foldStyle != "all")
range = null;
}
return range;
}
if (foldStyle === "markbegin")
return;
var match = line.match(this.foldingStopMarker);
if (match) {
var i = match.index + match[0].length;
if (match[1])
return this.closingBracketBlock(session, match[1], row, i);
return session.getCommentFoldRange(row, i, -1);
}
};
this.getSectionRange = function (session, row) {
var line = session.getLine(row);
var startIndent = line.search(/\S/);
var startRow = row;
var startColumn = line.length;
row = row + 1;
var endRow = row;
var maxRow = session.getLength();
while (++row < maxRow) {
line = session.getLine(row);
var indent = line.search(/\S/);
if (indent === -1)
continue;
if (startIndent > indent)
break;
var subRange = this.getFoldWidgetRange(session, "all", row);
if (subRange) {
if (subRange.start.row <= startRow) {
break;
}
else if (subRange.isMultiLine()) {
row = subRange.end.row;
}
else if (startIndent == indent) {
break;
}
}
endRow = row;
}
return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
};
this.getCommentRegionBlock = function (session, line, row) {
var startColumn = line.search(/\s*$/);
var maxRow = session.getLength();
var startRow = row;
var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
var depth = 1;
while (++row < maxRow) {
line = session.getLine(row);
var m = re.exec(line);
if (!m)
continue;
if (m[1])
depth--;
else
depth++;
if (!depth)
break;
}
var endRow = row;
if (endRow > startRow) {
return new Range(startRow, startColumn, endRow, line.length);
}
};
}).call(FoldMode.prototype);
});
define("ace/mode/fsl",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/fsl_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module){/*
THIS FILE WAS AUTOGENERATED BY mode.tmpl.js
*/
"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var FSLHighlightRules = require("./fsl_highlight_rules").FSLHighlightRules;
var FoldMode = require("./folding/cstyle").FoldMode;
var Mode = function () {
this.HighlightRules = FSLHighlightRules;
this.foldingRules = new FoldMode();
};
oop.inherits(Mode, TextMode);
(function () {
this.lineCommentStart = "//";
this.blockComment = { start: "/*", end: "*/" };
this.$id = "ace/mode/fsl";
this.snippetFileId = "ace/snippets/fsl";
}).call(Mode.prototype);
exports.Mode = Mode;
}); (function() {
window.require(["ace/mode/fsl"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

File diff suppressed because it is too large Load Diff

View File

@ -1,86 +1,74 @@
define("ace/mode/gcode_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { define("ace/mode/gcode_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
"use strict"; var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var oop = require("../lib/oop"); var GcodeHighlightRules = function () {
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; var keywords = ("IF|DO|WHILE|ENDWHILE|CALL|ENDIF|SUB|ENDSUB|GOTO|REPEAT|ENDREPEAT|CALL");
var builtinConstants = ("PI");
var GcodeHighlightRules = function() { var builtinFunctions = ("ATAN|ABS|ACOS|ASIN|SIN|COS|EXP|FIX|FUP|ROUND|LN|TAN");
var keywordMapper = this.createKeywordMapper({
var keywords = ( "support.function": builtinFunctions,
"IF|DO|WHILE|ENDWHILE|CALL|ENDIF|SUB|ENDSUB|GOTO|REPEAT|ENDREPEAT|CALL" "keyword": keywords,
); "constant.language": builtinConstants
}, "identifier", true);
var builtinConstants = ( this.$rules = {
"PI" "start": [{
); token: "comment",
regex: "\\(.*\\)"
var builtinFunctions = (
"ATAN|ABS|ACOS|ASIN|SIN|COS|EXP|FIX|FUP|ROUND|LN|TAN"
);
var keywordMapper = this.createKeywordMapper({
"support.function": builtinFunctions,
"keyword": keywords,
"constant.language": builtinConstants
}, "identifier", true);
this.$rules = {
"start" : [ {
token : "comment",
regex : "\\(.*\\)"
}, { }, {
token : "comment", // block number token: "comment", // block number
regex : "([N])([0-9]+)" regex: "([N])([0-9]+)"
}, { }, {
token : "string", // " string token: "string", // " string
regex : "([G])([0-9]+\\.?[0-9]?)" regex: "([G])([0-9]+\\.?[0-9]?)"
}, { }, {
token : "string", // ' string token: "string", // ' string
regex : "([M])([0-9]+\\.?[0-9]?)" regex: "([M])([0-9]+\\.?[0-9]?)"
}, { }, {
token : "constant.numeric", // float token: "constant.numeric", // float
regex : "([-+]?([0-9]*\\.?[0-9]+\\.?))|(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)" regex: "([-+]?([0-9]*\\.?[0-9]+\\.?))|(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)"
}, { }, {
token : keywordMapper, token: keywordMapper,
regex : "[A-Z]" regex: "[A-Z]"
}, { }, {
token : "keyword.operator", token: "keyword.operator",
regex : "EQ|LT|GT|NE|GE|LE|OR|XOR" regex: "EQ|LT|GT|NE|GE|LE|OR|XOR"
}, { }, {
token : "paren.lparen", token: "paren.lparen",
regex : "[\\[]" regex: "[\\[]"
}, { }, {
token : "paren.rparen", token: "paren.rparen",
regex : "[\\]]" regex: "[\\]]"
}, { }, {
token : "text", token: "text",
regex : "\\s+" regex: "\\s+"
} ] }]
};
}; };
};
oop.inherits(GcodeHighlightRules, TextHighlightRules);
exports.GcodeHighlightRules = GcodeHighlightRules;
oop.inherits(GcodeHighlightRules, TextHighlightRules);
exports.GcodeHighlightRules = GcodeHighlightRules;
}); });
define("ace/mode/gcode",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/gcode_highlight_rules","ace/range"], function(require, exports, module) { define("ace/mode/gcode",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/gcode_highlight_rules","ace/range"], function(require, exports, module){"use strict";
"use strict"; var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var GcodeHighlightRules = require("./gcode_highlight_rules").GcodeHighlightRules;
var Range = require("../range").Range;
var Mode = function () {
this.HighlightRules = GcodeHighlightRules;
this.$behaviour = this.$defaultBehaviour;
};
oop.inherits(Mode, TextMode);
(function () {
this.$id = "ace/mode/gcode";
}).call(Mode.prototype);
exports.Mode = Mode;
var oop = require("../lib/oop"); }); (function() {
var TextMode = require("./text").Mode; window.require(["ace/mode/gcode"], function(m) {
var GcodeHighlightRules = require("./gcode_highlight_rules").GcodeHighlightRules; if (typeof module == "object" && typeof exports == "object" && module) {
var Range = require("../range").Range; module.exports = m;
}
});
})();
var Mode = function() {
this.HighlightRules = GcodeHighlightRules;
this.$behaviour = this.$defaultBehaviour;
};
oop.inherits(Mode, TextMode);
(function() {
this.$id = "ace/mode/gcode";
}).call(Mode.prototype);
exports.Mode = Mode;
});

View File

@ -1,163 +1,154 @@
define("ace/mode/gherkin_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { define("ace/mode/gherkin_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){var oop = require("../lib/oop");
var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var stringEscape = "\\\\(x[0-9A-Fa-f]{2}|[0-7]{3}|[\\\\abfnrtv'\"]|U[0-9A-Fa-f]{8}|u[0-9A-Fa-f]{4})"; var stringEscape = "\\\\(x[0-9A-Fa-f]{2}|[0-7]{3}|[\\\\abfnrtv'\"]|U[0-9A-Fa-f]{8}|u[0-9A-Fa-f]{4})";
var GherkinHighlightRules = function () {
var GherkinHighlightRules = function() {
var languages = [{ var languages = [{
name: "en", name: "en",
labels: "Feature|Background|Scenario(?: Outline)?|Examples", labels: "Feature|Background|Scenario(?: Outline)?|Examples",
keywords: "Given|When|Then|And|But" keywords: "Given|When|Then|And|But"
}]; }
];
var labels = languages.map(function(l) { var labels = languages.map(function (l) {
return l.labels; return l.labels;
}).join("|"); }).join("|");
var keywords = languages.map(function(l) { var keywords = languages.map(function (l) {
return l.keywords; return l.keywords;
}).join("|"); }).join("|");
this.$rules = { this.$rules = {
start : [{ start: [{
token: "constant.numeric", token: "constant.numeric",
regex: "(?:(?:[1-9]\\d*)|(?:0))" regex: "(?:(?:[1-9]\\d*)|(?:0))"
}, {
token : "comment",
regex : "#.*$"
}, {
token : "keyword",
regex : "(?:" + labels + "):|(?:" + keywords + ")\\b"
}, {
token : "keyword",
regex : "\\*"
}, {
token : "string", // multi line """ string start
regex : '"{3}',
next : "qqstring3"
}, {
token : "string", // " string
regex : '"',
next : "qqstring"
}, {
token : "text",
regex : "^\\s*(?=@[\\w])",
next : [{
token : "text",
regex : "\\s+"
}, { }, {
token : "variable.parameter", token: "comment",
regex : "@[\\w]+" regex: "#.*$"
}, { }, {
token : "empty", token: "keyword",
regex : "", regex: "(?:" + labels + "):|(?:" + keywords + ")\\b"
next : "start" }, {
token: "keyword",
regex: "\\*"
}, {
token: "string", // multi line """ string start
regex: '"{3}',
next: "qqstring3"
}, {
token: "string", // " string
regex: '"',
next: "qqstring"
}, {
token: "text",
regex: "^\\s*(?=@[\\w])",
next: [{
token: "text",
regex: "\\s+"
}, {
token: "variable.parameter",
regex: "@[\\w]+"
}, {
token: "empty",
regex: "",
next: "start"
}]
}, {
token: "comment",
regex: "<[^>]+>"
}, {
token: "comment",
regex: "\\|(?=.)",
next: "table-item"
}, {
token: "comment",
regex: "\\|$",
next: "start"
}],
"qqstring3": [{
token: "constant.language.escape",
regex: stringEscape
}, {
token: "string", // multi line """ string end
regex: '"{3}',
next: "start"
}, {
defaultToken: "string"
}],
"qqstring": [{
token: "constant.language.escape",
regex: stringEscape
}, {
token: "string",
regex: "\\\\$",
next: "qqstring"
}, {
token: "string",
regex: '"|$',
next: "start"
}, {
defaultToken: "string"
}],
"table-item": [{
token: "comment",
regex: /$/,
next: "start"
}, {
token: "comment",
regex: /\|/
}, {
token: "string",
regex: /\\./
}, {
defaultToken: "string"
}] }]
}, {
token : "comment",
regex : "<[^>]+>"
}, {
token : "comment",
regex : "\\|(?=.)",
next : "table-item"
}, {
token : "comment",
regex : "\\|$",
next : "start"
}],
"qqstring3" : [ {
token : "constant.language.escape",
regex : stringEscape
}, {
token : "string", // multi line """ string end
regex : '"{3}',
next : "start"
}, {
defaultToken : "string"
}],
"qqstring" : [{
token : "constant.language.escape",
regex : stringEscape
}, {
token : "string",
regex : "\\\\$",
next : "qqstring"
}, {
token : "string",
regex : '"|$',
next : "start"
}, {
defaultToken: "string"
}],
"table-item" : [{
token : "comment",
regex : /$/,
next : "start"
}, {
token : "comment",
regex : /\|/
}, {
token : "string",
regex : /\\./
}, {
defaultToken : "string"
}]
}; };
this.normalizeRules(); this.normalizeRules();
}; };
oop.inherits(GherkinHighlightRules, TextHighlightRules); oop.inherits(GherkinHighlightRules, TextHighlightRules);
exports.GherkinHighlightRules = GherkinHighlightRules; exports.GherkinHighlightRules = GherkinHighlightRules;
}); });
define("ace/mode/gherkin",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/gherkin_highlight_rules"], function(require, exports, module) { define("ace/mode/gherkin",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/gherkin_highlight_rules"], function(require, exports, module){var oop = require("../lib/oop");
var oop = require("../lib/oop");
var TextMode = require("./text").Mode; var TextMode = require("./text").Mode;
var GherkinHighlightRules = require("./gherkin_highlight_rules").GherkinHighlightRules; var GherkinHighlightRules = require("./gherkin_highlight_rules").GherkinHighlightRules;
var Mode = function () {
var Mode = function() {
this.HighlightRules = GherkinHighlightRules; this.HighlightRules = GherkinHighlightRules;
this.$behaviour = this.$defaultBehaviour; this.$behaviour = this.$defaultBehaviour;
}; };
oop.inherits(Mode, TextMode); oop.inherits(Mode, TextMode);
(function () {
(function() {
this.lineCommentStart = "#"; this.lineCommentStart = "#";
this.$id = "ace/mode/gherkin"; this.$id = "ace/mode/gherkin";
this.getNextLineIndent = function (state, line, tab) {
this.getNextLineIndent = function(state, line, tab) {
var indent = this.$getIndent(line); var indent = this.$getIndent(line);
var space2 = " "; var space2 = " ";
var tokenizedLine = this.getTokenizer().getLineTokens(line, state); var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
var tokens = tokenizedLine.tokens; var tokens = tokenizedLine.tokens;
if (line.match("[ ]*\\|")) {
console.log(state);
if(line.match("[ ]*\\|")) {
indent += "| "; indent += "| ";
} }
if (tokens.length && tokens[tokens.length - 1].type == "comment") {
if (tokens.length && tokens[tokens.length-1].type == "comment") {
return indent; return indent;
} }
if (state == "start") { if (state == "start") {
if (line.match("Scenario:|Feature:|Scenario Outline:|Background:")) { if (line.match("Scenario:|Feature:|Scenario Outline:|Background:")) {
indent += space2; indent += space2;
} else if(line.match("(Given|Then).+(:)$|Examples:")) { }
else if (line.match("(Given|Then).+(:)$|Examples:")) {
indent += space2; indent += space2;
} else if(line.match("\\*.+")) { }
else if (line.match("\\*.+")) {
indent += "* "; indent += "* ";
} }
} }
return indent; return indent;
}; };
}).call(Mode.prototype); }).call(Mode.prototype);
exports.Mode = Mode; exports.Mode = Mode;
});
}); (function() {
window.require(["ace/mode/gherkin"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

View File

@ -1,52 +1,49 @@
define("ace/mode/gitignore_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { define("ace/mode/gitignore_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var GitignoreHighlightRules = function () {
var GitignoreHighlightRules = function() {
this.$rules = { this.$rules = {
"start" : [ "start": [
{ {
token : "comment", token: "comment",
regex : /^\s*#.*$/ regex: /^\s*#.*$/
}, { }, {
token : "keyword", // negated patterns token: "keyword", // negated patterns
regex : /^\s*!.*$/ regex: /^\s*!.*$/
} }
] ]
}; };
this.normalizeRules(); this.normalizeRules();
}; };
GitignoreHighlightRules.metaData = { GitignoreHighlightRules.metaData = {
fileTypes: ['gitignore'], fileTypes: ['gitignore'],
name: 'Gitignore' name: 'Gitignore'
}; };
oop.inherits(GitignoreHighlightRules, TextHighlightRules); oop.inherits(GitignoreHighlightRules, TextHighlightRules);
exports.GitignoreHighlightRules = GitignoreHighlightRules; exports.GitignoreHighlightRules = GitignoreHighlightRules;
}); });
define("ace/mode/gitignore",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/gitignore_highlight_rules"], function(require, exports, module) { define("ace/mode/gitignore",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/gitignore_highlight_rules"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextMode = require("./text").Mode; var TextMode = require("./text").Mode;
var GitignoreHighlightRules = require("./gitignore_highlight_rules").GitignoreHighlightRules; var GitignoreHighlightRules = require("./gitignore_highlight_rules").GitignoreHighlightRules;
var Mode = function () {
var Mode = function() {
this.HighlightRules = GitignoreHighlightRules; this.HighlightRules = GitignoreHighlightRules;
this.$behaviour = this.$defaultBehaviour; this.$behaviour = this.$defaultBehaviour;
}; };
oop.inherits(Mode, TextMode); oop.inherits(Mode, TextMode);
(function () {
(function() {
this.lineCommentStart = "#"; this.lineCommentStart = "#";
this.$id = "ace/mode/gitignore"; this.$id = "ace/mode/gitignore";
}).call(Mode.prototype); }).call(Mode.prototype);
exports.Mode = Mode; exports.Mode = Mode;
});
}); (function() {
window.require(["ace/mode/gitignore"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

View File

@ -1,370 +1,300 @@
define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var DocCommentHighlightRules = function () {
var DocCommentHighlightRules = function() {
this.$rules = { this.$rules = {
"start" : [ { "start": [
token : "comment.doc.tag", {
regex : "@[\\w\\d_]+" // TODO: fix email addresses token: "comment.doc.tag",
}, regex: "@\\w+(?=\\s|$)"
DocCommentHighlightRules.getTagRule(), }, DocCommentHighlightRules.getTagRule(), {
{ defaultToken: "comment.doc",
defaultToken : "comment.doc", caseInsensitive: true
caseInsensitive: true }
}] ]
}; };
}; };
oop.inherits(DocCommentHighlightRules, TextHighlightRules); oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getTagRule = function (start) {
DocCommentHighlightRules.getTagRule = function(start) {
return { return {
token : "comment.doc.tag.storage.type", token: "comment.doc.tag.storage.type",
regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" regex: "\\b(?:TODO|FIXME|XXX|HACK)\\b"
}; };
}; };
DocCommentHighlightRules.getStartRule = function (start) {
DocCommentHighlightRules.getStartRule = function(start) {
return { return {
token : "comment.doc", // doc comment token: "comment.doc", // doc comment
regex : "\\/\\*(?=\\*)", regex: "\\/\\*(?=\\*)",
next : start next: start
}; };
}; };
DocCommentHighlightRules.getEndRule = function (start) { DocCommentHighlightRules.getEndRule = function (start) {
return { return {
token : "comment.doc", // closing comment token: "comment.doc", // closing comment
regex : "\\*\\/", regex: "\\*\\/",
next : start next: start
}; };
}; };
exports.DocCommentHighlightRules = DocCommentHighlightRules; exports.DocCommentHighlightRules = DocCommentHighlightRules;
}); });
define("ace/mode/c_cpp_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { define("ace/mode/c_cpp_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var cFunctions = exports.cFunctions = "\\b(?:hypot(?:f|l)?|s(?:scanf|ystem|nprintf|ca(?:nf|lb(?:n(?:f|l)?|ln(?:f|l)?))|i(?:n(?:h(?:f|l)?|f|l)?|gn(?:al|bit))|tr(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?)|error|pbrk|ftime|len|rchr|xfrm)|printf|et(?:jmp|vbuf|locale|buf)|qrt(?:f|l)?|w(?:scanf|printf)|rand)|n(?:e(?:arbyint(?:f|l)?|xt(?:toward(?:f|l)?|after(?:f|l)?))|an(?:f|l)?)|c(?:s(?:in(?:h(?:f|l)?|f|l)?|qrt(?:f|l)?)|cos(?:h(?:f)?|f|l)?|imag(?:f|l)?|t(?:ime|an(?:h(?:f|l)?|f|l)?)|o(?:s(?:h(?:f|l)?|f|l)?|nj(?:f|l)?|pysign(?:f|l)?)|p(?:ow(?:f|l)?|roj(?:f|l)?)|e(?:il(?:f|l)?|xp(?:f|l)?)|l(?:o(?:ck|g(?:f|l)?)|earerr)|a(?:sin(?:h(?:f|l)?|f|l)?|cos(?:h(?:f|l)?|f|l)?|tan(?:h(?:f|l)?|f|l)?|lloc|rg(?:f|l)?|bs(?:f|l)?)|real(?:f|l)?|brt(?:f|l)?)|t(?:ime|o(?:upper|lower)|an(?:h(?:f|l)?|f|l)?|runc(?:f|l)?|gamma(?:f|l)?|mp(?:nam|file))|i(?:s(?:space|n(?:ormal|an)|cntrl|inf|digit|u(?:nordered|pper)|p(?:unct|rint)|finite|w(?:space|c(?:ntrl|type)|digit|upper|p(?:unct|rint)|lower|al(?:num|pha)|graph|xdigit|blank)|l(?:ower|ess(?:equal|greater)?)|al(?:num|pha)|gr(?:eater(?:equal)?|aph)|xdigit|blank)|logb(?:f|l)?|max(?:div|abs))|di(?:v|fftime)|_Exit|unget(?:c|wc)|p(?:ow(?:f|l)?|ut(?:s|c(?:har)?|wc(?:har)?)|error|rintf)|e(?:rf(?:c(?:f|l)?|f|l)?|x(?:it|p(?:2(?:f|l)?|f|l|m1(?:f|l)?)?))|v(?:s(?:scanf|nprintf|canf|printf|w(?:scanf|printf))|printf|f(?:scanf|printf|w(?:scanf|printf))|w(?:scanf|printf)|a_(?:start|copy|end|arg))|qsort|f(?:s(?:canf|e(?:tpos|ek))|close|tell|open|dim(?:f|l)?|p(?:classify|ut(?:s|c|w(?:s|c))|rintf)|e(?:holdexcept|set(?:e(?:nv|xceptflag)|round)|clearexcept|testexcept|of|updateenv|r(?:aiseexcept|ror)|get(?:e(?:nv|xceptflag)|round))|flush|w(?:scanf|ide|printf|rite)|loor(?:f|l)?|abs(?:f|l)?|get(?:s|c|pos|w(?:s|c))|re(?:open|e|ad|xp(?:f|l)?)|m(?:in(?:f|l)?|od(?:f|l)?|a(?:f|l|x(?:f|l)?)?))|l(?:d(?:iv|exp(?:f|l)?)|o(?:ngjmp|cal(?:time|econv)|g(?:1(?:p(?:f|l)?|0(?:f|l)?)|2(?:f|l)?|f|l|b(?:f|l)?)?)|abs|l(?:div|abs|r(?:int(?:f|l)?|ound(?:f|l)?))|r(?:int(?:f|l)?|ound(?:f|l)?)|gamma(?:f|l)?)|w(?:scanf|c(?:s(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?|mbs)|pbrk|ftime|len|r(?:chr|tombs)|xfrm)|to(?:b|mb)|rtomb)|printf|mem(?:set|c(?:hr|py|mp)|move))|a(?:s(?:sert|ctime|in(?:h(?:f|l)?|f|l)?)|cos(?:h(?:f|l)?|f|l)?|t(?:o(?:i|f|l(?:l)?)|exit|an(?:h(?:f|l)?|2(?:f|l)?|f|l)?)|b(?:s|ort))|g(?:et(?:s|c(?:har)?|env|wc(?:har)?)|mtime)|r(?:int(?:f|l)?|ound(?:f|l)?|e(?:name|alloc|wind|m(?:ove|quo(?:f|l)?|ainder(?:f|l)?))|a(?:nd|ise))|b(?:search|towc)|m(?:odf(?:f|l)?|em(?:set|c(?:hr|py|mp)|move)|ktime|alloc|b(?:s(?:init|towcs|rtowcs)|towc|len|r(?:towc|len))))\\b"; var cFunctions = exports.cFunctions = "hypot|hypotf|hypotl|sscanf|system|snprintf|scanf|scalbn|scalbnf|scalbnl|scalbln|scalblnf|scalblnl|sin|sinh|sinhf|sinhl|sinf|sinl|signal|signbit|strstr|strspn|strncpy|strncat|strncmp|strcspn|strchr|strcoll|strcpy|strcat|strcmp|strtoimax|strtod|strtoul|strtoull|strtoumax|strtok|strtof|strtol|strtold|strtoll|strerror|strpbrk|strftime|strlen|strrchr|strxfrm|sprintf|setjmp|setvbuf|setlocale|setbuf|sqrt|sqrtf|sqrtl|swscanf|swprintf|srand|nearbyint|nearbyintf|nearbyintl|nexttoward|nexttowardf|nexttowardl|nextafter|nextafterf|nextafterl|nan|nanf|nanl|csin|csinh|csinhf|csinhl|csinf|csinl|csqrt|csqrtf|csqrtl|ccos|ccosh|ccoshf|ccosf|ccosl|cimag|cimagf|cimagl|ctime|ctan|ctanh|ctanhf|ctanhl|ctanf|ctanl|cos|cosh|coshf|coshl|cosf|cosl|conj|conjf|conjl|copysign|copysignf|copysignl|cpow|cpowf|cpowl|cproj|cprojf|cprojl|ceil|ceilf|ceill|cexp|cexpf|cexpl|clock|clog|clogf|clogl|clearerr|casin|casinh|casinhf|casinhl|casinf|casinl|cacos|cacosh|cacoshf|cacoshl|cacosf|cacosl|catan|catanh|catanhf|catanhl|catanf|catanl|calloc|carg|cargf|cargl|cabs|cabsf|cabsl|creal|crealf|creall|cbrt|cbrtf|cbrtl|time|toupper|tolower|tan|tanh|tanhf|tanhl|tanf|tanl|trunc|truncf|truncl|tgamma|tgammaf|tgammal|tmpnam|tmpfile|isspace|isnormal|isnan|iscntrl|isinf|isdigit|isunordered|isupper|ispunct|isprint|isfinite|iswspace|iswcntrl|iswctype|iswdigit|iswupper|iswpunct|iswprint|iswlower|iswalnum|iswalpha|iswgraph|iswxdigit|iswblank|islower|isless|islessequal|islessgreater|isalnum|isalpha|isgreater|isgreaterequal|isgraph|isxdigit|isblank|ilogb|ilogbf|ilogbl|imaxdiv|imaxabs|div|difftime|_Exit|ungetc|ungetwc|pow|powf|powl|puts|putc|putchar|putwc|putwchar|perror|printf|erf|erfc|erfcf|erfcl|erff|erfl|exit|exp|exp2|exp2f|exp2l|expf|expl|expm1|expm1f|expm1l|vsscanf|vsnprintf|vscanf|vsprintf|vswscanf|vswprintf|vprintf|vfscanf|vfprintf|vfwscanf|vfwprintf|vwscanf|vwprintf|va_start|va_copy|va_end|va_arg|qsort|fscanf|fsetpos|fseek|fclose|ftell|fopen|fdim|fdimf|fdiml|fpclassify|fputs|fputc|fputws|fputwc|fprintf|feholdexcept|fesetenv|fesetexceptflag|fesetround|feclearexcept|fetestexcept|feof|feupdateenv|feraiseexcept|ferror|fegetenv|fegetexceptflag|fegetround|fflush|fwscanf|fwide|fwprintf|fwrite|floor|floorf|floorl|fabs|fabsf|fabsl|fgets|fgetc|fgetpos|fgetws|fgetwc|freopen|free|fread|frexp|frexpf|frexpl|fmin|fminf|fminl|fmod|fmodf|fmodl|fma|fmaf|fmal|fmax|fmaxf|fmaxl|ldiv|ldexp|ldexpf|ldexpl|longjmp|localtime|localeconv|log|log1p|log1pf|log1pl|log10|log10f|log10l|log2|log2f|log2l|logf|logl|logb|logbf|logbl|labs|lldiv|llabs|llrint|llrintf|llrintl|llround|llroundf|llroundl|lrint|lrintf|lrintl|lround|lroundf|lroundl|lgamma|lgammaf|lgammal|wscanf|wcsstr|wcsspn|wcsncpy|wcsncat|wcsncmp|wcscspn|wcschr|wcscoll|wcscpy|wcscat|wcscmp|wcstoimax|wcstod|wcstoul|wcstoull|wcstoumax|wcstok|wcstof|wcstol|wcstold|wcstoll|wcstombs|wcspbrk|wcsftime|wcslen|wcsrchr|wcsrtombs|wcsxfrm|wctob|wctomb|wcrtomb|wprintf|wmemset|wmemchr|wmemcpy|wmemcmp|wmemmove|assert|asctime|asin|asinh|asinhf|asinhl|asinf|asinl|acos|acosh|acoshf|acoshl|acosf|acosl|atoi|atof|atol|atoll|atexit|atan|atanh|atanhf|atanhl|atan2|atan2f|atan2l|atanf|atanl|abs|abort|gets|getc|getchar|getenv|getwc|getwchar|gmtime|rint|rintf|rintl|round|roundf|roundl|rename|realloc|rewind|remove|remquo|remquof|remquol|remainder|remainderf|remainderl|rand|raise|bsearch|btowc|modf|modff|modfl|memset|memchr|memcpy|memcmp|memmove|mktime|malloc|mbsinit|mbstowcs|mbsrtowcs|mbtowc|mblen|mbrtowc|mbrlen";
var c_cppHighlightRules = function (extraKeywords) {
var c_cppHighlightRules = function() { var keywordControls = ("break|case|continue|default|do|else|for|goto|if|_Pragma|" +
"return|switch|while|catch|operator|try|throw|using");
var keywordControls = ( var storageType = ("asm|__asm__|auto|bool|_Bool|char|_Complex|double|enum|float|" +
"break|case|continue|default|do|else|for|goto|if|_Pragma|" + "_Imaginary|int|int8_t|int16_t|int32_t|int64_t|long|short|signed|size_t|struct|typedef|uint8_t|uint16_t|uint32_t|uint64_t|union|unsigned|void|" +
"return|switch|while|catch|operator|try|throw|using" "class|wchar_t|template|char16_t|char32_t");
); var storageModifiers = ("const|extern|register|restrict|static|volatile|inline|private|" +
var storageType = (
"asm|__asm__|auto|bool|_Bool|char|_Complex|double|enum|float|" +
"_Imaginary|int|long|short|signed|struct|typedef|union|unsigned|void|" +
"class|wchar_t|template|char16_t|char32_t"
);
var storageModifiers = (
"const|extern|register|restrict|static|volatile|inline|private|" +
"protected|public|friend|explicit|virtual|export|mutable|typename|" + "protected|public|friend|explicit|virtual|export|mutable|typename|" +
"constexpr|new|delete|alignas|alignof|decltype|noexcept|thread_local" "constexpr|new|delete|alignas|alignof|decltype|noexcept|thread_local");
); var keywordOperators = ("and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq|" +
"const_cast|dynamic_cast|reinterpret_cast|static_cast|sizeof|namespace");
var keywordOperators = ( var builtinConstants = ("NULL|true|false|TRUE|FALSE|nullptr");
"and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq" + var keywordMapper = this.$keywords = this.createKeywordMapper(Object.assign({
"const_cast|dynamic_cast|reinterpret_cast|static_cast|sizeof|namespace" "keyword.control": keywordControls,
); "storage.type": storageType,
"storage.modifier": storageModifiers,
var builtinConstants = ( "keyword.operator": keywordOperators,
"NULL|true|false|TRUE|FALSE|nullptr"
);
var keywordMapper = this.$keywords = this.createKeywordMapper({
"keyword.control" : keywordControls,
"storage.type" : storageType,
"storage.modifier" : storageModifiers,
"keyword.operator" : keywordOperators,
"variable.language": "this", "variable.language": "this",
"constant.language": builtinConstants "constant.language": builtinConstants,
}, "identifier"); "support.function.C99.c": cFunctions
}, extraKeywords), "identifier");
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b"; var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b";
var escapeRe = /\\(?:['"?\\abfnrtv]|[0-7]{1,3}|x[a-fA-F\d]{2}|u[a-fA-F\d]{4}U[a-fA-F\d]{8}|.)/.source; var escapeRe = /\\(?:['"?\\abfnrtv]|[0-7]{1,3}|x[a-fA-F\d]{2}|u[a-fA-F\d]{4}U[a-fA-F\d]{8}|.)/.source;
var formatRe = "%" var formatRe = "%"
+ /(\d+\$)?/.source // field (argument #) + /(\d+\$)?/.source // field (argument #)
+ /[#0\- +']*/.source // flags + /[#0\- +']*/.source // flags
+ /[,;:_]?/.source // separator character (AltiVec) + /[,;:_]?/.source // separator character (AltiVec)
+ /((-?\d+)|\*(-?\d+\$)?)?/.source // minimum field width + /((-?\d+)|\*(-?\d+\$)?)?/.source // minimum field width
+ /(\.((-?\d+)|\*(-?\d+\$)?)?)?/.source // precision + /(\.((-?\d+)|\*(-?\d+\$)?)?)?/.source // precision
+ /(hh|h|ll|l|j|t|z|q|L|vh|vl|v|hv|hl)?/.source // length modifier + /(hh|h|ll|l|j|t|z|q|L|vh|vl|v|hv|hl)?/.source // length modifier
+ /(\[[^"\]]+\]|[diouxXDOUeEfFgGaACcSspn%])/.source; // conversion type + /(\[[^"\]]+\]|[diouxXDOUeEfFgGaACcSspn%])/.source; // conversion type
this.$rules = { this.$rules = {
"start" : [ "start": [
{ {
token : "comment", token: "comment",
regex : "//$", regex: "//$",
next : "start" next: "start"
}, { }, {
token : "comment", token: "comment",
regex : "//", regex: "//",
next : "singleLineComment" next: "singleLineComment"
}, },
DocCommentHighlightRules.getStartRule("doc-start"), DocCommentHighlightRules.getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token: "comment", // multi line comment
regex : "\\/\\*", regex: "\\/\\*",
next : "comment" next: "comment"
}, { }, {
token : "string", // character token: "string", // character
regex : "'(?:" + escapeRe + "|.)?'" regex: "'(?:" + escapeRe + "|.)?'"
}, { }, {
token : "string.start", token: "string.start",
regex : '"', regex: '"',
stateName: "qqstring", stateName: "qqstring",
next: [ next: [
{ token: "string", regex: /\\\s*$/, next: "qqstring" }, { token: "string", regex: /\\\s*$/, next: "qqstring" },
{ token: "constant.language.escape", regex: escapeRe }, { token: "constant.language.escape", regex: escapeRe },
{ token: "constant.language.escape", regex: formatRe }, { token: "constant.language.escape", regex: formatRe },
{ token: "string.end", regex: '"|$', next: "start" }, { token: "string.end", regex: '"|$', next: "start" },
{ defaultToken: "string"} { defaultToken: "string" }
] ]
}, { }, {
token : "string.start", token: "string.start",
regex : 'R"\\(', regex: 'R"\\(',
stateName: "rawString", stateName: "rawString",
next: [ next: [
{ token: "string.end", regex: '\\)"', next: "start" }, { token: "string.end", regex: '\\)"', next: "start" },
{ defaultToken: "string"} { defaultToken: "string" }
] ]
}, { }, {
token : "constant.numeric", // hex token: "constant.numeric", // hex
regex : "0[xX][0-9a-fA-F]+(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b" regex: "0[xX][0-9a-fA-F]+(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b"
}, { }, {
token : "constant.numeric", // float token: "constant.numeric", // float
regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b" regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b"
}, { }, {
token : "keyword", // pre-compiler directives token: "keyword", // pre-compiler directives
regex : "#\\s*(?:include|import|pragma|line|define|undef)\\b", regex: "#\\s*(?:include|import|pragma|line|define|undef)\\b",
next : "directive" next: "directive"
}, { }, {
token : "keyword", // special case pre-compiler directive token: "keyword", // special case pre-compiler directive
regex : "#\\s*(?:endif|if|ifdef|else|elif|ifndef)\\b" regex: "#\\s*(?:endif|if|ifdef|else|elif|ifndef)\\b"
}, { }, {
token : "support.function.C99.c", token: keywordMapper,
regex : cFunctions regex: "[a-zA-Z_$][a-zA-Z0-9_$]*"
}, { }, {
token : keywordMapper, token: "keyword.operator",
regex : "[a-zA-Z_$][a-zA-Z0-9_$]*" regex: /--|\+\+|<<=|>>=|>>>=|<>|&&|\|\||\?:|[*%\/+\-&\^|~!<>=]=?/
}, { }, {
token : "keyword.operator", token: "punctuation.operator",
regex : /--|\+\+|<<=|>>=|>>>=|<>|&&|\|\||\?:|[*%\/+\-&\^|~!<>=]=?/ regex: "\\?|\\:|\\,|\\;|\\."
}, { }, {
token : "punctuation.operator", token: "paren.lparen",
regex : "\\?|\\:|\\,|\\;|\\." regex: "[[({]"
}, { }, {
token : "paren.lparen", token: "paren.rparen",
regex : "[[({]" regex: "[\\])}]"
}, { }, {
token : "paren.rparen", token: "text",
regex : "[\\])}]" regex: "\\s+"
}, {
token : "text",
regex : "\\s+"
} }
], ],
"comment" : [ "comment": [
{ {
token : "comment", // closing comment token: "comment", // closing comment
regex : "\\*\\/", regex: "\\*\\/",
next : "start" next: "start"
}, {
defaultToken : "comment"
}
],
"singleLineComment" : [
{
token : "comment",
regex : /\\$/,
next : "singleLineComment"
}, {
token : "comment",
regex : /$/,
next : "start"
}, { }, {
defaultToken: "comment" defaultToken: "comment"
} }
], ],
"directive" : [ "singleLineComment": [
{ {
token : "constant.other.multiline", token: "comment",
regex : /\\/ regex: /\\$/,
next: "singleLineComment"
}, {
token: "comment",
regex: /$/,
next: "start"
}, {
defaultToken: "comment"
}
],
"directive": [
{
token: "constant.other.multiline",
regex: /\\/
}, },
{ {
token : "constant.other.multiline", token: "constant.other.multiline",
regex : /.*\\/ regex: /.*\\/
}, },
{ {
token : "constant.other", token: "constant.other",
regex : "\\s*<.+?>", regex: "\\s*<.+?>",
next : "start" next: "start"
}, },
{ {
token : "constant.other", // single line token: "constant.other", // single line
regex : '\\s*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]', regex: '\\s*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]',
next : "start" next: "start"
}, },
{ {
token : "constant.other", // single line token: "constant.other", // single line
regex : "\\s*['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']", regex: "\\s*['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']",
next : "start" next: "start"
}, },
{ {
token : "constant.other", token: "constant.other",
regex : /[^\\\/]+/, regex: /[^\\\/]+/,
next : "start" next: "start"
} }
] ]
}; };
this.embedRules(DocCommentHighlightRules, "doc-", [DocCommentHighlightRules.getEndRule("start")]);
this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]);
this.normalizeRules(); this.normalizeRules();
}; };
oop.inherits(c_cppHighlightRules, TextHighlightRules); oop.inherits(c_cppHighlightRules, TextHighlightRules);
exports.c_cppHighlightRules = c_cppHighlightRules; exports.c_cppHighlightRules = c_cppHighlightRules;
}); });
define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module){"use strict";
"use strict";
var Range = require("../range").Range; var Range = require("../range").Range;
var MatchingBraceOutdent = function () { };
var MatchingBraceOutdent = function() {}; (function () {
this.checkOutdent = function (line, input) {
(function() { if (!/^\s+$/.test(line))
this.checkOutdent = function(line, input) {
if (! /^\s+$/.test(line))
return false; return false;
return /^\s*\}/.test(input); return /^\s*\}/.test(input);
}; };
this.autoOutdent = function (doc, row) {
this.autoOutdent = function(doc, row) {
var line = doc.getLine(row); var line = doc.getLine(row);
var match = line.match(/^(\s*\})/); var match = line.match(/^(\s*\})/);
if (!match)
if (!match) return 0; return 0;
var column = match[1].length; var column = match[1].length;
var openBracePos = doc.findMatchingBracket({row: row, column: column}); var openBracePos = doc.findMatchingBracket({ row: row, column: column });
if (!openBracePos || openBracePos.row == row)
if (!openBracePos || openBracePos.row == row) return 0; return 0;
var indent = this.$getIndent(doc.getLine(openBracePos.row)); var indent = this.$getIndent(doc.getLine(openBracePos.row));
doc.replace(new Range(row, 0, row, column-1), indent); doc.replace(new Range(row, 0, row, column - 1), indent);
}; };
this.$getIndent = function (line) {
this.$getIndent = function(line) {
return line.match(/^\s*/)[0]; return line.match(/^\s*/)[0];
}; };
}).call(MatchingBraceOutdent.prototype); }).call(MatchingBraceOutdent.prototype);
exports.MatchingBraceOutdent = MatchingBraceOutdent; exports.MatchingBraceOutdent = MatchingBraceOutdent;
}); });
define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../../lib/oop"); var oop = require("../../lib/oop");
var Range = require("../../range").Range; var Range = require("../../range").Range;
var BaseFoldMode = require("./fold_mode").FoldMode; var BaseFoldMode = require("./fold_mode").FoldMode;
var FoldMode = exports.FoldMode = function (commentRegex) {
var FoldMode = exports.FoldMode = function(commentRegex) {
if (commentRegex) { if (commentRegex) {
this.foldingStartMarker = new RegExp( this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
);
this.foldingStopMarker = new RegExp(
this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
);
} }
}; };
oop.inherits(FoldMode, BaseFoldMode); oop.inherits(FoldMode, BaseFoldMode);
(function () {
(function() {
this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/; this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/; this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
this._getFoldWidgetBase = this.getFoldWidget; this._getFoldWidgetBase = this.getFoldWidget;
this.getFoldWidget = function(session, foldStyle, row) { this.getFoldWidget = function (session, foldStyle, row) {
var line = session.getLine(row); var line = session.getLine(row);
if (this.singleLineBlockCommentRe.test(line)) { if (this.singleLineBlockCommentRe.test(line)) {
if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
return ""; return "";
} }
var fw = this._getFoldWidgetBase(session, foldStyle, row); var fw = this._getFoldWidgetBase(session, foldStyle, row);
if (!fw && this.startRegionRe.test(line)) if (!fw && this.startRegionRe.test(line))
return "start"; // lineCommentRegionStart return "start"; // lineCommentRegionStart
return fw; return fw;
}; };
this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
var line = session.getLine(row); var line = session.getLine(row);
if (this.startRegionRe.test(line)) if (this.startRegionRe.test(line))
return this.getCommentRegionBlock(session, line, row); return this.getCommentRegionBlock(session, line, row);
var match = line.match(this.foldingStartMarker); var match = line.match(this.foldingStartMarker);
if (match) { if (match) {
var i = match.index; var i = match.index;
if (match[1]) if (match[1])
return this.openingBracketBlock(session, match[1], row, i); return this.openingBracketBlock(session, match[1], row, i);
var range = session.getCommentFoldRange(row, i + match[0].length, 1); var range = session.getCommentFoldRange(row, i + match[0].length, 1);
if (range && !range.isMultiLine()) { if (range && !range.isMultiLine()) {
if (forceMultiline) { if (forceMultiline) {
range = this.getSectionRange(session, row); range = this.getSectionRange(session, row);
} else if (foldStyle != "all") }
else if (foldStyle != "all")
range = null; range = null;
} }
return range; return range;
} }
if (foldStyle === "markbegin") if (foldStyle === "markbegin")
return; return;
var match = line.match(this.foldingStopMarker); var match = line.match(this.foldingStopMarker);
if (match) { if (match) {
var i = match.index + match[0].length; var i = match.index + match[0].length;
if (match[1]) if (match[1])
return this.closingBracketBlock(session, match[1], row, i); return this.closingBracketBlock(session, match[1], row, i);
return session.getCommentFoldRange(row, i, -1); return session.getCommentFoldRange(row, i, -1);
} }
}; };
this.getSectionRange = function (session, row) {
this.getSectionRange = function(session, row) {
var line = session.getLine(row); var line = session.getLine(row);
var startIndent = line.search(/\S/); var startIndent = line.search(/\S/);
var startRow = row; var startRow = row;
@ -377,94 +307,82 @@ oop.inherits(FoldMode, BaseFoldMode);
var indent = line.search(/\S/); var indent = line.search(/\S/);
if (indent === -1) if (indent === -1)
continue; continue;
if (startIndent > indent) if (startIndent > indent)
break; break;
var subRange = this.getFoldWidgetRange(session, "all", row); var subRange = this.getFoldWidgetRange(session, "all", row);
if (subRange) { if (subRange) {
if (subRange.start.row <= startRow) { if (subRange.start.row <= startRow) {
break; break;
} else if (subRange.isMultiLine()) { }
else if (subRange.isMultiLine()) {
row = subRange.end.row; row = subRange.end.row;
} else if (startIndent == indent) { }
else if (startIndent == indent) {
break; break;
} }
} }
endRow = row; endRow = row;
} }
return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
}; };
this.getCommentRegionBlock = function(session, line, row) { this.getCommentRegionBlock = function (session, line, row) {
var startColumn = line.search(/\s*$/); var startColumn = line.search(/\s*$/);
var maxRow = session.getLength(); var maxRow = session.getLength();
var startRow = row; var startRow = row;
var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
var depth = 1; var depth = 1;
while (++row < maxRow) { while (++row < maxRow) {
line = session.getLine(row); line = session.getLine(row);
var m = re.exec(line); var m = re.exec(line);
if (!m) continue; if (!m)
if (m[1]) depth--; continue;
else depth++; if (m[1])
depth--;
if (!depth) break; else
depth++;
if (!depth)
break;
} }
var endRow = row; var endRow = row;
if (endRow > startRow) { if (endRow > startRow) {
return new Range(startRow, startColumn, endRow, line.length); return new Range(startRow, startColumn, endRow, line.length);
} }
}; };
}).call(FoldMode.prototype); }).call(FoldMode.prototype);
}); });
define("ace/mode/c_cpp",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/c_cpp_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) { define("ace/mode/c_cpp",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/c_cpp_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextMode = require("./text").Mode; var TextMode = require("./text").Mode;
var c_cppHighlightRules = require("./c_cpp_highlight_rules").c_cppHighlightRules; var c_cppHighlightRules = require("./c_cpp_highlight_rules").c_cppHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var Range = require("../range").Range;
var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
var CStyleFoldMode = require("./folding/cstyle").FoldMode; var CStyleFoldMode = require("./folding/cstyle").FoldMode;
var Mode = function () {
var Mode = function() {
this.HighlightRules = c_cppHighlightRules; this.HighlightRules = c_cppHighlightRules;
this.$outdent = new MatchingBraceOutdent(); this.$outdent = new MatchingBraceOutdent();
this.$behaviour = new CstyleBehaviour(); this.$behaviour = this.$defaultBehaviour;
this.foldingRules = new CStyleFoldMode(); this.foldingRules = new CStyleFoldMode();
}; };
oop.inherits(Mode, TextMode); oop.inherits(Mode, TextMode);
(function () {
(function() {
this.lineCommentStart = "//"; this.lineCommentStart = "//";
this.blockComment = {start: "/*", end: "*/"}; this.blockComment = { start: "/*", end: "*/" };
this.getNextLineIndent = function (state, line, tab) {
this.getNextLineIndent = function(state, line, tab) {
var indent = this.$getIndent(line); var indent = this.$getIndent(line);
var tokenizedLine = this.getTokenizer().getLineTokens(line, state); var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
var tokens = tokenizedLine.tokens; var tokens = tokenizedLine.tokens;
var endState = tokenizedLine.state; var endState = tokenizedLine.state;
if (tokens.length && tokens[tokens.length - 1].type == "comment") {
if (tokens.length && tokens[tokens.length-1].type == "comment") {
return indent; return indent;
} }
if (state == "start") { if (state == "start") {
var match = line.match(/^.*[\{\(\[]\s*$/); var match = line.match(/^.*[\{\(\[]\s*$/);
if (match) { if (match) {
indent += tab; indent += tab;
} }
} else if (state == "doc-start") { }
else if (state == "doc-start") {
if (endState == "start") { if (endState == "start") {
return ""; return "";
} }
@ -476,42 +394,31 @@ oop.inherits(Mode, TextMode);
indent += "* "; indent += "* ";
} }
} }
return indent; return indent;
}; };
this.checkOutdent = function (state, line, input) {
this.checkOutdent = function(state, line, input) {
return this.$outdent.checkOutdent(line, input); return this.$outdent.checkOutdent(line, input);
}; };
this.autoOutdent = function (state, doc, row) {
this.autoOutdent = function(state, doc, row) {
this.$outdent.autoOutdent(doc, row); this.$outdent.autoOutdent(doc, row);
}; };
this.$id = "ace/mode/c_cpp"; this.$id = "ace/mode/c_cpp";
this.snippetFileId = "ace/snippets/c_cpp";
}).call(Mode.prototype); }).call(Mode.prototype);
exports.Mode = Mode; exports.Mode = Mode;
}); });
define("ace/mode/glsl_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/c_cpp_highlight_rules"], function(require, exports, module) { define("ace/mode/glsl_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/c_cpp_highlight_rules"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var c_cppHighlightRules = require("./c_cpp_highlight_rules").c_cppHighlightRules; var c_cppHighlightRules = require("./c_cpp_highlight_rules").c_cppHighlightRules;
var glslHighlightRules = function () {
var glslHighlightRules = function() { var keywords = ("attribute|const|uniform|varying|break|continue|do|for|while|" +
var keywords = (
"attribute|const|uniform|varying|break|continue|do|for|while|" +
"if|else|in|out|inout|float|int|void|bool|true|false|" + "if|else|in|out|inout|float|int|void|bool|true|false|" +
"lowp|mediump|highp|precision|invariant|discard|return|mat2|mat3|" + "lowp|mediump|highp|precision|invariant|discard|return|mat2|mat3|" +
"mat4|vec2|vec3|vec4|ivec2|ivec3|ivec4|bvec2|bvec3|bvec4|sampler2D|" + "mat4|vec2|vec3|vec4|ivec2|ivec3|ivec4|bvec2|bvec3|bvec4|sampler2D|" +
"samplerCube|struct" "samplerCube|struct");
); var buildinConstants = ("radians|degrees|sin|cos|tan|asin|acos|atan|pow|" +
var buildinConstants = (
"radians|degrees|sin|cos|tan|asin|acos|atan|pow|" +
"exp|log|exp2|log2|sqrt|inversesqrt|abs|sign|floor|ceil|fract|mod|" + "exp|log|exp2|log2|sqrt|inversesqrt|abs|sign|floor|ceil|fract|mod|" +
"min|max|clamp|mix|step|smoothstep|length|distance|dot|cross|" + "min|max|clamp|mix|step|smoothstep|length|distance|dot|cross|" +
"normalize|faceforward|reflect|refract|matrixCompMult|lessThan|" + "normalize|faceforward|reflect|refract|matrixCompMult|lessThan|" +
@ -523,50 +430,46 @@ var glslHighlightRules = function() {
"gl_MaxTextureImageUnits|gl_MaxFragmentUniformVectors|gl_MaxDrawBuffers|" + "gl_MaxTextureImageUnits|gl_MaxFragmentUniformVectors|gl_MaxDrawBuffers|" +
"gl_DepthRangeParameters|gl_DepthRange|" + "gl_DepthRangeParameters|gl_DepthRange|" +
"gl_Position|gl_PointSize|" + "gl_Position|gl_PointSize|" +
"gl_FragCoord|gl_FrontFacing|gl_PointCoord|gl_FragColor|gl_FragData" "gl_FragCoord|gl_FrontFacing|gl_PointCoord|gl_FragColor|gl_FragData");
);
var keywordMapper = this.createKeywordMapper({ var keywordMapper = this.createKeywordMapper({
"variable.language": "this", "variable.language": "this",
"keyword": keywords, "keyword": keywords,
"constant.language": buildinConstants "constant.language": buildinConstants
}, "identifier"); }, "identifier");
this.$rules = new c_cppHighlightRules().$rules; this.$rules = new c_cppHighlightRules().$rules;
this.$rules.start.forEach(function(rule) { this.$rules.start.forEach(function (rule) {
if (typeof rule.token == "function") if (typeof rule.token == "function")
rule.token = keywordMapper; rule.token = keywordMapper;
}); });
}; };
oop.inherits(glslHighlightRules, c_cppHighlightRules); oop.inherits(glslHighlightRules, c_cppHighlightRules);
exports.glslHighlightRules = glslHighlightRules; exports.glslHighlightRules = glslHighlightRules;
}); });
define("ace/mode/glsl",["require","exports","module","ace/lib/oop","ace/mode/c_cpp","ace/mode/glsl_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) { define("ace/mode/glsl",["require","exports","module","ace/lib/oop","ace/mode/c_cpp","ace/mode/glsl_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var CMode = require("./c_cpp").Mode; var CMode = require("./c_cpp").Mode;
var glslHighlightRules = require("./glsl_highlight_rules").glslHighlightRules; var glslHighlightRules = require("./glsl_highlight_rules").glslHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var Range = require("../range").Range;
var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
var CStyleFoldMode = require("./folding/cstyle").FoldMode; var CStyleFoldMode = require("./folding/cstyle").FoldMode;
var Mode = function () {
var Mode = function() {
this.HighlightRules = glslHighlightRules; this.HighlightRules = glslHighlightRules;
this.$outdent = new MatchingBraceOutdent(); this.$outdent = new MatchingBraceOutdent();
this.$behaviour = new CstyleBehaviour(); this.$behaviour = this.$defaultBehaviour;
this.foldingRules = new CStyleFoldMode(); this.foldingRules = new CStyleFoldMode();
}; };
oop.inherits(Mode, CMode); oop.inherits(Mode, CMode);
(function () {
(function() {
this.$id = "ace/mode/glsl"; this.$id = "ace/mode/glsl";
}).call(Mode.prototype); }).call(Mode.prototype);
exports.Mode = Mode; exports.Mode = Mode;
});
}); (function() {
window.require(["ace/mode/glsl"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

File diff suppressed because it is too large Load Diff

View File

@ -1,296 +1,238 @@
define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var DocCommentHighlightRules = function () {
var DocCommentHighlightRules = function() {
this.$rules = { this.$rules = {
"start" : [ { "start": [
token : "comment.doc.tag", {
regex : "@[\\w\\d_]+" // TODO: fix email addresses token: "comment.doc.tag",
}, regex: "@\\w+(?=\\s|$)"
DocCommentHighlightRules.getTagRule(), }, DocCommentHighlightRules.getTagRule(), {
{ defaultToken: "comment.doc",
defaultToken : "comment.doc", caseInsensitive: true
caseInsensitive: true }
}] ]
}; };
}; };
oop.inherits(DocCommentHighlightRules, TextHighlightRules); oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getTagRule = function (start) {
DocCommentHighlightRules.getTagRule = function(start) {
return { return {
token : "comment.doc.tag.storage.type", token: "comment.doc.tag.storage.type",
regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" regex: "\\b(?:TODO|FIXME|XXX|HACK)\\b"
}; };
}; };
DocCommentHighlightRules.getStartRule = function (start) {
DocCommentHighlightRules.getStartRule = function(start) {
return { return {
token : "comment.doc", // doc comment token: "comment.doc", // doc comment
regex : "\\/\\*(?=\\*)", regex: "\\/\\*(?=\\*)",
next : start next: start
}; };
}; };
DocCommentHighlightRules.getEndRule = function (start) { DocCommentHighlightRules.getEndRule = function (start) {
return { return {
token : "comment.doc", // closing comment token: "comment.doc", // closing comment
regex : "\\*\\/", regex: "\\*\\/",
next : start next: start
}; };
}; };
exports.DocCommentHighlightRules = DocCommentHighlightRules; exports.DocCommentHighlightRules = DocCommentHighlightRules;
}); });
define("ace/mode/golang_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { define("ace/mode/golang_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module){var oop = require("../lib/oop");
var oop = require("../lib/oop"); var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; var GolangHighlightRules = function () {
var keywords = ("else|break|case|return|goto|if|const|select|" +
var GolangHighlightRules = function() { "continue|struct|default|switch|for|range|" +
var keywords = ( "func|import|package|chan|defer|fallthrough|go|interface|map|range|" +
"else|break|case|return|goto|if|const|select|" + "select|type|var");
"continue|struct|default|switch|for|range|" + var builtinTypes = ("string|uint8|uint16|uint32|uint64|int8|int16|int32|int64|float32|" +
"func|import|package|chan|defer|fallthrough|go|interface|map|range|" + "float64|complex64|complex128|byte|rune|uint|int|uintptr|bool|error");
"select|type|var" var builtinFunctions = ("new|close|cap|copy|panic|panicln|print|println|len|make|delete|real|recover|imag|append");
); var builtinConstants = ("nil|true|false|iota");
var builtinTypes = ( var keywordMapper = this.createKeywordMapper({
"string|uint8|uint16|uint32|uint64|int8|int16|int32|int64|float32|" + "keyword": keywords,
"float64|complex64|complex128|byte|rune|uint|int|uintptr|bool|error" "constant.language": builtinConstants,
); "support.function": builtinFunctions,
var builtinFunctions = ( "support.type": builtinTypes
"new|close|cap|copy|panic|panicln|print|println|len|make|delete|real|recover|imag|append" }, "");
); var stringEscapeRe = "\\\\(?:[0-7]{3}|x\\h{2}|u{4}|U\\h{6}|[abfnrtv'\"\\\\])".replace(/\\h/g, "[a-fA-F\\d]");
var builtinConstants = ("nil|true|false|iota"); this.$rules = {
"start": [
var keywordMapper = this.createKeywordMapper({ {
"keyword": keywords, token: "comment",
"constant.language": builtinConstants, regex: "\\/\\/.*$"
"support.function": builtinFunctions, },
"support.type": builtinTypes DocCommentHighlightRules.getStartRule("doc-start"),
}, ""); {
token: "comment.start", // multi line comment
var stringEscapeRe = "\\\\(?:[0-7]{3}|x\\h{2}|u{4}|U\\h{6}|[abfnrtv'\"\\\\])".replace(/\\h/g, "[a-fA-F\\d]"); regex: "\\/\\*",
next: "comment"
this.$rules = { }, {
"start" : [ token: "string", // single line
{ regex: /"(?:[^"\\]|\\.)*?"/
token : "comment", }, {
regex : "\\/\\/.*$" token: "string", // raw
}, regex: '`',
DocCommentHighlightRules.getStartRule("doc-start"), next: "bqstring"
{ }, {
token : "comment.start", // multi line comment token: "constant.numeric", // rune
regex : "\\/\\*", regex: "'(?:[^\\'\uD800-\uDBFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|" + stringEscapeRe.replace('"', '') + ")'"
next : "comment" }, {
}, { token: "constant.numeric", // hex
token : "string", // single line regex: "0[xX][0-9a-fA-F]+\\b"
regex : /"(?:[^"\\]|\\.)*?"/ }, {
}, { token: "constant.numeric", // float
token : "string", // raw regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
regex : '`', }, {
next : "bqstring" token: ["keyword", "text", "entity.name.function"],
}, { regex: "(func)(\\s+)([a-zA-Z_$][a-zA-Z0-9_$]*)\\b"
token : "constant.numeric", // rune }, {
regex : "'(?:[^\\'\uD800-\uDBFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|" + stringEscapeRe.replace('"', '') + ")'" token: function (val) {
}, { if (val[val.length - 1] == "(") {
token : "constant.numeric", // hex return [{
regex : "0[xX][0-9a-fA-F]+\\b"
}, {
token : "constant.numeric", // float
regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
}, {
token : ["keyword", "text", "entity.name.function"],
regex : "(func)(\\s+)([a-zA-Z_$][a-zA-Z0-9_$]*)\\b"
}, {
token : function(val) {
if (val[val.length - 1] == "(") {
return [{
type: keywordMapper(val.slice(0, -1)) || "support.function", type: keywordMapper(val.slice(0, -1)) || "support.function",
value: val.slice(0, -1) value: val.slice(0, -1)
}, { }, {
type: "paren.lparen", type: "paren.lparen",
value: val.slice(-1) value: val.slice(-1)
}]; }];
} }
return keywordMapper(val) || "identifier";
return keywordMapper(val) || "identifier"; },
}, regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b\\(?"
regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b\\(?" }, {
}, { token: "keyword.operator",
token : "keyword.operator", regex: "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|==|=|!=|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^="
regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|==|=|!=|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=" }, {
}, { token: "punctuation.operator",
token : "punctuation.operator", regex: "\\?|\\:|\\,|\\;|\\."
regex : "\\?|\\:|\\,|\\;|\\." }, {
}, { token: "paren.lparen",
token : "paren.lparen", regex: "[[({]"
regex : "[[({]" }, {
}, { token: "paren.rparen",
token : "paren.rparen", regex: "[\\])}]"
regex : "[\\])}]" }, {
}, { token: "text",
token : "text", regex: "\\s+"
regex : "\\s+" }
} ],
], "comment": [
"comment" : [ {
{ token: "comment.end",
token : "comment.end", regex: "\\*\\/",
regex : "\\*\\/", next: "start"
next : "start" }, {
}, { defaultToken: "comment"
defaultToken : "comment" }
} ],
], "bqstring": [
"bqstring" : [ {
{ token: "string",
token : "string", regex: '`',
regex : '`', next: "start"
next : "start" }, {
}, { defaultToken: "string"
defaultToken : "string" }
} ]
]
};
this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]);
}; };
oop.inherits(GolangHighlightRules, TextHighlightRules); this.embedRules(DocCommentHighlightRules, "doc-", [DocCommentHighlightRules.getEndRule("start")]);
};
oop.inherits(GolangHighlightRules, TextHighlightRules);
exports.GolangHighlightRules = GolangHighlightRules;
exports.GolangHighlightRules = GolangHighlightRules;
}); });
define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module){"use strict";
"use strict";
var Range = require("../range").Range; var Range = require("../range").Range;
var MatchingBraceOutdent = function () { };
var MatchingBraceOutdent = function() {}; (function () {
this.checkOutdent = function (line, input) {
(function() { if (!/^\s+$/.test(line))
this.checkOutdent = function(line, input) {
if (! /^\s+$/.test(line))
return false; return false;
return /^\s*\}/.test(input); return /^\s*\}/.test(input);
}; };
this.autoOutdent = function (doc, row) {
this.autoOutdent = function(doc, row) {
var line = doc.getLine(row); var line = doc.getLine(row);
var match = line.match(/^(\s*\})/); var match = line.match(/^(\s*\})/);
if (!match)
if (!match) return 0; return 0;
var column = match[1].length; var column = match[1].length;
var openBracePos = doc.findMatchingBracket({row: row, column: column}); var openBracePos = doc.findMatchingBracket({ row: row, column: column });
if (!openBracePos || openBracePos.row == row)
if (!openBracePos || openBracePos.row == row) return 0; return 0;
var indent = this.$getIndent(doc.getLine(openBracePos.row)); var indent = this.$getIndent(doc.getLine(openBracePos.row));
doc.replace(new Range(row, 0, row, column-1), indent); doc.replace(new Range(row, 0, row, column - 1), indent);
}; };
this.$getIndent = function (line) {
this.$getIndent = function(line) {
return line.match(/^\s*/)[0]; return line.match(/^\s*/)[0];
}; };
}).call(MatchingBraceOutdent.prototype); }).call(MatchingBraceOutdent.prototype);
exports.MatchingBraceOutdent = MatchingBraceOutdent; exports.MatchingBraceOutdent = MatchingBraceOutdent;
}); });
define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../../lib/oop"); var oop = require("../../lib/oop");
var Range = require("../../range").Range; var Range = require("../../range").Range;
var BaseFoldMode = require("./fold_mode").FoldMode; var BaseFoldMode = require("./fold_mode").FoldMode;
var FoldMode = exports.FoldMode = function (commentRegex) {
var FoldMode = exports.FoldMode = function(commentRegex) {
if (commentRegex) { if (commentRegex) {
this.foldingStartMarker = new RegExp( this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
);
this.foldingStopMarker = new RegExp(
this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
);
} }
}; };
oop.inherits(FoldMode, BaseFoldMode); oop.inherits(FoldMode, BaseFoldMode);
(function () {
(function() {
this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/; this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/; this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
this._getFoldWidgetBase = this.getFoldWidget; this._getFoldWidgetBase = this.getFoldWidget;
this.getFoldWidget = function(session, foldStyle, row) { this.getFoldWidget = function (session, foldStyle, row) {
var line = session.getLine(row); var line = session.getLine(row);
if (this.singleLineBlockCommentRe.test(line)) { if (this.singleLineBlockCommentRe.test(line)) {
if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
return ""; return "";
} }
var fw = this._getFoldWidgetBase(session, foldStyle, row); var fw = this._getFoldWidgetBase(session, foldStyle, row);
if (!fw && this.startRegionRe.test(line)) if (!fw && this.startRegionRe.test(line))
return "start"; // lineCommentRegionStart return "start"; // lineCommentRegionStart
return fw; return fw;
}; };
this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
var line = session.getLine(row); var line = session.getLine(row);
if (this.startRegionRe.test(line)) if (this.startRegionRe.test(line))
return this.getCommentRegionBlock(session, line, row); return this.getCommentRegionBlock(session, line, row);
var match = line.match(this.foldingStartMarker); var match = line.match(this.foldingStartMarker);
if (match) { if (match) {
var i = match.index; var i = match.index;
if (match[1]) if (match[1])
return this.openingBracketBlock(session, match[1], row, i); return this.openingBracketBlock(session, match[1], row, i);
var range = session.getCommentFoldRange(row, i + match[0].length, 1); var range = session.getCommentFoldRange(row, i + match[0].length, 1);
if (range && !range.isMultiLine()) { if (range && !range.isMultiLine()) {
if (forceMultiline) { if (forceMultiline) {
range = this.getSectionRange(session, row); range = this.getSectionRange(session, row);
} else if (foldStyle != "all") }
else if (foldStyle != "all")
range = null; range = null;
} }
return range; return range;
} }
if (foldStyle === "markbegin") if (foldStyle === "markbegin")
return; return;
var match = line.match(this.foldingStopMarker); var match = line.match(this.foldingStopMarker);
if (match) { if (match) {
var i = match.index + match[0].length; var i = match.index + match[0].length;
if (match[1]) if (match[1])
return this.closingBracketBlock(session, match[1], row, i); return this.closingBracketBlock(session, match[1], row, i);
return session.getCommentFoldRange(row, i, -1); return session.getCommentFoldRange(row, i, -1);
} }
}; };
this.getSectionRange = function (session, row) {
this.getSectionRange = function(session, row) {
var line = session.getLine(row); var line = session.getLine(row);
var startIndent = line.search(/\S/); var startIndent = line.search(/\S/);
var startRow = row; var startRow = row;
@ -303,104 +245,97 @@ oop.inherits(FoldMode, BaseFoldMode);
var indent = line.search(/\S/); var indent = line.search(/\S/);
if (indent === -1) if (indent === -1)
continue; continue;
if (startIndent > indent) if (startIndent > indent)
break; break;
var subRange = this.getFoldWidgetRange(session, "all", row); var subRange = this.getFoldWidgetRange(session, "all", row);
if (subRange) { if (subRange) {
if (subRange.start.row <= startRow) { if (subRange.start.row <= startRow) {
break; break;
} else if (subRange.isMultiLine()) { }
else if (subRange.isMultiLine()) {
row = subRange.end.row; row = subRange.end.row;
} else if (startIndent == indent) { }
else if (startIndent == indent) {
break; break;
} }
} }
endRow = row; endRow = row;
} }
return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
}; };
this.getCommentRegionBlock = function(session, line, row) { this.getCommentRegionBlock = function (session, line, row) {
var startColumn = line.search(/\s*$/); var startColumn = line.search(/\s*$/);
var maxRow = session.getLength(); var maxRow = session.getLength();
var startRow = row; var startRow = row;
var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
var depth = 1; var depth = 1;
while (++row < maxRow) { while (++row < maxRow) {
line = session.getLine(row); line = session.getLine(row);
var m = re.exec(line); var m = re.exec(line);
if (!m) continue; if (!m)
if (m[1]) depth--; continue;
else depth++; if (m[1])
depth--;
if (!depth) break; else
depth++;
if (!depth)
break;
} }
var endRow = row; var endRow = row;
if (endRow > startRow) { if (endRow > startRow) {
return new Range(startRow, startColumn, endRow, line.length); return new Range(startRow, startColumn, endRow, line.length);
} }
}; };
}).call(FoldMode.prototype); }).call(FoldMode.prototype);
}); });
define("ace/mode/golang",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/golang_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) { define("ace/mode/golang",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/golang_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/folding/cstyle"], function(require, exports, module){var oop = require("../lib/oop");
var oop = require("../lib/oop");
var TextMode = require("./text").Mode; var TextMode = require("./text").Mode;
var GolangHighlightRules = require("./golang_highlight_rules").GolangHighlightRules; var GolangHighlightRules = require("./golang_highlight_rules").GolangHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
var CStyleFoldMode = require("./folding/cstyle").FoldMode; var CStyleFoldMode = require("./folding/cstyle").FoldMode;
var Mode = function () {
var Mode = function() {
this.HighlightRules = GolangHighlightRules; this.HighlightRules = GolangHighlightRules;
this.$outdent = new MatchingBraceOutdent(); this.$outdent = new MatchingBraceOutdent();
this.foldingRules = new CStyleFoldMode(); this.foldingRules = new CStyleFoldMode();
this.$behaviour = new CstyleBehaviour(); this.$behaviour = this.$defaultBehaviour;
}; };
oop.inherits(Mode, TextMode); oop.inherits(Mode, TextMode);
(function () {
(function() {
this.lineCommentStart = "//"; this.lineCommentStart = "//";
this.blockComment = {start: "/*", end: "*/"}; this.blockComment = { start: "/*", end: "*/" };
this.getNextLineIndent = function (state, line, tab) {
this.getNextLineIndent = function(state, line, tab) {
var indent = this.$getIndent(line); var indent = this.$getIndent(line);
var tokenizedLine = this.getTokenizer().getLineTokens(line, state); var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
var tokens = tokenizedLine.tokens; var tokens = tokenizedLine.tokens;
var endState = tokenizedLine.state; var endState = tokenizedLine.state;
if (tokens.length && tokens[tokens.length - 1].type == "comment") {
if (tokens.length && tokens[tokens.length-1].type == "comment") {
return indent; return indent;
} }
if (state == "start") { if (state == "start") {
var match = line.match(/^.*[\{\(\[]\s*$/); var match = line.match(/^.*[\{\(\[]\s*$/);
if (match) { if (match) {
indent += tab; indent += tab;
} }
} }
return indent; return indent;
};//end getNextLineIndent }; //end getNextLineIndent
this.checkOutdent = function (state, line, input) {
this.checkOutdent = function(state, line, input) {
return this.$outdent.checkOutdent(line, input); return this.$outdent.checkOutdent(line, input);
}; };
this.autoOutdent = function (state, doc, row) {
this.autoOutdent = function(state, doc, row) {
this.$outdent.autoOutdent(doc, row); this.$outdent.autoOutdent(doc, row);
}; };
this.$id = "ace/mode/golang"; this.$id = "ace/mode/golang";
}).call(Mode.prototype); }).call(Mode.prototype);
exports.Mode = Mode; exports.Mode = Mode;
});
}); (function() {
window.require(["ace/mode/golang"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

View File

@ -1,131 +1,95 @@
define("ace/mode/graphqlschema_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { define("ace/mode/graphqlschema_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var GraphQLSchemaHighlightRules = function () {
var GraphQLSchemaHighlightRules = function() { var keywords = ("type|interface|union|enum|schema|input|implements|extends|scalar");
var dataTypes = ("Int|Float|String|ID|Boolean");
var keywords = (
"type|interface|union|enum|schema|input|implements|extends|scalar"
);
var dataTypes = (
"Int|Float|String|ID|Boolean"
);
var keywordMapper = this.createKeywordMapper({ var keywordMapper = this.createKeywordMapper({
"keyword": keywords, "keyword": keywords,
"storage.type": dataTypes "storage.type": dataTypes
}, "identifier"); }, "identifier");
this.$rules = { this.$rules = {
"start" : [ { "start": [{
token : "comment", token: "comment",
regex : "#.*$" regex: "#.*$"
}, { }, {
token : "paren.lparen", token: "paren.lparen",
regex : /[\[({]/, regex: /[\[({]/,
next : "start" next: "start"
}, { }, {
token : "paren.rparen", token: "paren.rparen",
regex : /[\])}]/ regex: /[\])}]/
}, { }, {
token : keywordMapper, token: keywordMapper,
regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
} ] }]
}; };
this.normalizeRules(); this.normalizeRules();
}; };
oop.inherits(GraphQLSchemaHighlightRules, TextHighlightRules); oop.inherits(GraphQLSchemaHighlightRules, TextHighlightRules);
exports.GraphQLSchemaHighlightRules = GraphQLSchemaHighlightRules; exports.GraphQLSchemaHighlightRules = GraphQLSchemaHighlightRules;
}); });
define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../../lib/oop"); var oop = require("../../lib/oop");
var Range = require("../../range").Range; var Range = require("../../range").Range;
var BaseFoldMode = require("./fold_mode").FoldMode; var BaseFoldMode = require("./fold_mode").FoldMode;
var FoldMode = exports.FoldMode = function (commentRegex) {
var FoldMode = exports.FoldMode = function(commentRegex) {
if (commentRegex) { if (commentRegex) {
this.foldingStartMarker = new RegExp( this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
);
this.foldingStopMarker = new RegExp(
this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
);
} }
}; };
oop.inherits(FoldMode, BaseFoldMode); oop.inherits(FoldMode, BaseFoldMode);
(function () {
(function() {
this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/; this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/; this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
this._getFoldWidgetBase = this.getFoldWidget; this._getFoldWidgetBase = this.getFoldWidget;
this.getFoldWidget = function(session, foldStyle, row) { this.getFoldWidget = function (session, foldStyle, row) {
var line = session.getLine(row); var line = session.getLine(row);
if (this.singleLineBlockCommentRe.test(line)) { if (this.singleLineBlockCommentRe.test(line)) {
if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
return ""; return "";
} }
var fw = this._getFoldWidgetBase(session, foldStyle, row); var fw = this._getFoldWidgetBase(session, foldStyle, row);
if (!fw && this.startRegionRe.test(line)) if (!fw && this.startRegionRe.test(line))
return "start"; // lineCommentRegionStart return "start"; // lineCommentRegionStart
return fw; return fw;
}; };
this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
var line = session.getLine(row); var line = session.getLine(row);
if (this.startRegionRe.test(line)) if (this.startRegionRe.test(line))
return this.getCommentRegionBlock(session, line, row); return this.getCommentRegionBlock(session, line, row);
var match = line.match(this.foldingStartMarker); var match = line.match(this.foldingStartMarker);
if (match) { if (match) {
var i = match.index; var i = match.index;
if (match[1]) if (match[1])
return this.openingBracketBlock(session, match[1], row, i); return this.openingBracketBlock(session, match[1], row, i);
var range = session.getCommentFoldRange(row, i + match[0].length, 1); var range = session.getCommentFoldRange(row, i + match[0].length, 1);
if (range && !range.isMultiLine()) { if (range && !range.isMultiLine()) {
if (forceMultiline) { if (forceMultiline) {
range = this.getSectionRange(session, row); range = this.getSectionRange(session, row);
} else if (foldStyle != "all") }
else if (foldStyle != "all")
range = null; range = null;
} }
return range; return range;
} }
if (foldStyle === "markbegin") if (foldStyle === "markbegin")
return; return;
var match = line.match(this.foldingStopMarker); var match = line.match(this.foldingStopMarker);
if (match) { if (match) {
var i = match.index + match[0].length; var i = match.index + match[0].length;
if (match[1]) if (match[1])
return this.closingBracketBlock(session, match[1], row, i); return this.closingBracketBlock(session, match[1], row, i);
return session.getCommentFoldRange(row, i, -1); return session.getCommentFoldRange(row, i, -1);
} }
}; };
this.getSectionRange = function (session, row) {
this.getSectionRange = function(session, row) {
var line = session.getLine(row); var line = session.getLine(row);
var startIndent = line.search(/\S/); var startIndent = line.search(/\S/);
var startRow = row; var startRow = row;
@ -138,69 +102,73 @@ oop.inherits(FoldMode, BaseFoldMode);
var indent = line.search(/\S/); var indent = line.search(/\S/);
if (indent === -1) if (indent === -1)
continue; continue;
if (startIndent > indent) if (startIndent > indent)
break; break;
var subRange = this.getFoldWidgetRange(session, "all", row); var subRange = this.getFoldWidgetRange(session, "all", row);
if (subRange) { if (subRange) {
if (subRange.start.row <= startRow) { if (subRange.start.row <= startRow) {
break; break;
} else if (subRange.isMultiLine()) { }
else if (subRange.isMultiLine()) {
row = subRange.end.row; row = subRange.end.row;
} else if (startIndent == indent) { }
else if (startIndent == indent) {
break; break;
} }
} }
endRow = row; endRow = row;
} }
return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
}; };
this.getCommentRegionBlock = function(session, line, row) { this.getCommentRegionBlock = function (session, line, row) {
var startColumn = line.search(/\s*$/); var startColumn = line.search(/\s*$/);
var maxRow = session.getLength(); var maxRow = session.getLength();
var startRow = row; var startRow = row;
var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
var depth = 1; var depth = 1;
while (++row < maxRow) { while (++row < maxRow) {
line = session.getLine(row); line = session.getLine(row);
var m = re.exec(line); var m = re.exec(line);
if (!m) continue; if (!m)
if (m[1]) depth--; continue;
else depth++; if (m[1])
depth--;
if (!depth) break; else
depth++;
if (!depth)
break;
} }
var endRow = row; var endRow = row;
if (endRow > startRow) { if (endRow > startRow) {
return new Range(startRow, startColumn, endRow, line.length); return new Range(startRow, startColumn, endRow, line.length);
} }
}; };
}).call(FoldMode.prototype); }).call(FoldMode.prototype);
}); });
define("ace/mode/graphqlschema",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/graphqlschema_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) { define("ace/mode/graphqlschema",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/graphqlschema_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextMode = require("./text").Mode; var TextMode = require("./text").Mode;
var GraphQLSchemaHighlightRules = require("./graphqlschema_highlight_rules").GraphQLSchemaHighlightRules; var GraphQLSchemaHighlightRules = require("./graphqlschema_highlight_rules").GraphQLSchemaHighlightRules;
var FoldMode = require("./folding/cstyle").FoldMode; var FoldMode = require("./folding/cstyle").FoldMode;
var Mode = function () {
var Mode = function() {
this.HighlightRules = GraphQLSchemaHighlightRules; this.HighlightRules = GraphQLSchemaHighlightRules;
this.foldingRules = new FoldMode(); this.foldingRules = new FoldMode();
}; };
oop.inherits(Mode, TextMode); oop.inherits(Mode, TextMode);
(function () {
(function() {
this.lineCommentStart = "#"; this.lineCommentStart = "#";
this.$id = "ace/mode/graphqlschema"; this.$id = "ace/mode/graphqlschema";
this.snippetFileId = "ace/snippets/graphqlschema";
}).call(Mode.prototype); }).call(Mode.prototype);
exports.Mode = Mode; exports.Mode = Mode;
});
}); (function() {
window.require(["ace/mode/graphqlschema"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,295 +1,240 @@
define("ace/mode/haskell_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { define("ace/mode/haskell_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){/* This file was autogenerated from tm bundles\haskell.tmbundle\Syntaxes\Haskell.plist (uuid: ) */
"use strict"; "use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var HaskellHighlightRules = function () {
var HaskellHighlightRules = function() { this.$rules = { start: [{ token: ['punctuation.definition.entity.haskell',
'keyword.operator.function.infix.haskell',
this.$rules = { start: 'punctuation.definition.entity.haskell'],
[ { token: regex: '(`)([a-zA-Z_\']*?)(`)',
[ 'punctuation.definition.entity.haskell', comment: 'In case this regex seems unusual for an infix operator, note that Haskell allows any ordinary function application (elem 4 [1..10]) to be rewritten as an infix expression (4 `elem` [1..10]).' },
'keyword.operator.function.infix.haskell', { token: 'constant.language.unit.haskell', regex: '\\(\\)' },
'punctuation.definition.entity.haskell' ], { token: 'constant.language.empty-list.haskell',
regex: '(`)([a-zA-Z_\']*?)(`)', regex: '\\[\\]' },
comment: 'In case this regex seems unusual for an infix operator, note that Haskell allows any ordinary function application (elem 4 [1..10]) to be rewritten as an infix expression (4 `elem` [1..10]).' }, { token: 'keyword.other.haskell',
{ token: 'constant.language.unit.haskell', regex: '\\(\\)' }, regex: '\\b(module|signature)\\b',
{ token: 'constant.language.empty-list.haskell', push: [{ token: 'keyword.other.haskell', regex: '\\bwhere\\b', next: 'pop' },
regex: '\\[\\]' }, { include: '#module_name' },
{ token: 'keyword.other.haskell', { include: '#module_exports' },
regex: '\\b(module|signature)\\b', { token: 'invalid', regex: '[a-z]+' },
push: { defaultToken: 'meta.declaration.module.haskell' }] },
[ { token: 'keyword.other.haskell', regex: '\\bwhere\\b', next: 'pop' }, { token: 'keyword.other.haskell',
{ include: '#module_name' }, regex: '\\bclass\\b',
{ include: '#module_exports' }, push: [{ token: 'keyword.other.haskell',
{ token: 'invalid', regex: '[a-z]+' }, regex: '\\bwhere\\b',
{ defaultToken: 'meta.declaration.module.haskell' } ] }, next: 'pop' },
{ token: 'keyword.other.haskell', { token: 'support.class.prelude.haskell',
regex: '\\bclass\\b', regex: '\\b(?:Monad|Functor|Eq|Ord|Read|Show|Num|(?:Frac|Ra)tional|Enum|Bounded|Real(?:Frac|Float)?|Integral|Floating)\\b' },
push: { token: 'entity.other.inherited-class.haskell',
[ { token: 'keyword.other.haskell', regex: '[A-Z][A-Za-z_\']*' },
regex: '\\bwhere\\b', { token: 'variable.other.generic-type.haskell',
next: 'pop' }, regex: '\\b[a-z][a-zA-Z0-9_\']*\\b' },
{ token: 'support.class.prelude.haskell', { defaultToken: 'meta.declaration.class.haskell' }] },
regex: '\\b(?:Monad|Functor|Eq|Ord|Read|Show|Num|(?:Frac|Ra)tional|Enum|Bounded|Real(?:Frac|Float)?|Integral|Floating)\\b' }, { token: 'keyword.other.haskell',
{ token: 'entity.other.inherited-class.haskell', regex: '\\binstance\\b',
regex: '[A-Z][A-Za-z_\']*' }, push: [{ token: 'keyword.other.haskell',
{ token: 'variable.other.generic-type.haskell', regex: '\\bwhere\\b|$',
regex: '\\b[a-z][a-zA-Z0-9_\']*\\b' }, next: 'pop' },
{ defaultToken: 'meta.declaration.class.haskell' } ] }, { include: '#type_signature' },
{ token: 'keyword.other.haskell', { defaultToken: 'meta.declaration.instance.haskell' }] },
regex: '\\binstance\\b', { token: 'keyword.other.haskell',
push: regex: 'import',
[ { token: 'keyword.other.haskell', push: [{ token: 'meta.import.haskell', regex: '$|;|^', next: 'pop' },
regex: '\\bwhere\\b|$', { token: 'keyword.other.haskell', regex: 'qualified|as|hiding' },
next: 'pop' }, { include: '#module_name' },
{ include: '#type_signature' }, { include: '#module_exports' },
{ defaultToken: 'meta.declaration.instance.haskell' } ] }, { defaultToken: 'meta.import.haskell' }] },
{ token: 'keyword.other.haskell', { token: ['keyword.other.haskell', 'meta.deriving.haskell'],
regex: 'import', regex: '(deriving)(\\s*\\()',
push: push: [{ token: 'meta.deriving.haskell', regex: '\\)', next: 'pop' },
[ { token: 'meta.import.haskell', regex: '$|;|^', next: 'pop' }, { token: 'entity.other.inherited-class.haskell',
{ token: 'keyword.other.haskell', regex: 'qualified|as|hiding' }, regex: '\\b[A-Z][a-zA-Z_\']*' },
{ include: '#module_name' }, { defaultToken: 'meta.deriving.haskell' }] },
{ include: '#module_exports' }, { token: 'keyword.other.haskell',
{ defaultToken: 'meta.import.haskell' } ] }, regex: '\\b(?:deriving|where|data|type|case|of|let|in|newtype|default)\\b' },
{ token: [ 'keyword.other.haskell', 'meta.deriving.haskell' ], { token: 'keyword.operator.haskell', regex: '\\binfix[lr]?\\b' },
regex: '(deriving)(\\s*\\()', { token: 'keyword.control.haskell',
push: regex: '\\b(?:do|if|then|else)\\b' },
[ { token: 'meta.deriving.haskell', regex: '\\)', next: 'pop' }, { token: 'constant.numeric.float.haskell',
{ token: 'entity.other.inherited-class.haskell', regex: '\\b(?:[0-9]+\\.[0-9]+(?:[eE][+-]?[0-9]+)?|[0-9]+[eE][+-]?[0-9]+)\\b',
regex: '\\b[A-Z][a-zA-Z_\']*' }, comment: 'Floats are always decimal' },
{ defaultToken: 'meta.deriving.haskell' } ] }, { token: 'constant.numeric.haskell',
{ token: 'keyword.other.haskell', regex: '\\b(?:[0-9]+|0(?:[xX][0-9a-fA-F]+|[oO][0-7]+))\\b' },
regex: '\\b(?:deriving|where|data|type|case|of|let|in|newtype|default)\\b' }, { token: ['meta.preprocessor.c',
{ token: 'keyword.operator.haskell', regex: '\\binfix[lr]?\\b' }, 'punctuation.definition.preprocessor.c',
{ token: 'keyword.control.haskell', 'meta.preprocessor.c'],
regex: '\\b(?:do|if|then|else)\\b' }, regex: '^(\\s*)(#)(\\s*\\w+)',
{ token: 'constant.numeric.float.haskell', comment: 'In addition to Haskell\'s "native" syntax, GHC permits the C preprocessor to be run on a source file.' },
regex: '\\b(?:[0-9]+\\.[0-9]+(?:[eE][+-]?[0-9]+)?|[0-9]+[eE][+-]?[0-9]+)\\b', { include: '#pragma' },
comment: 'Floats are always decimal' }, { token: 'punctuation.definition.string.begin.haskell',
{ token: 'constant.numeric.haskell',
regex: '\\b(?:[0-9]+|0(?:[xX][0-9a-fA-F]+|[oO][0-7]+))\\b' },
{ token:
[ 'meta.preprocessor.c',
'punctuation.definition.preprocessor.c',
'meta.preprocessor.c' ],
regex: '^(\\s*)(#)(\\s*\\w+)',
comment: 'In addition to Haskell\'s "native" syntax, GHC permits the C preprocessor to be run on a source file.' },
{ include: '#pragma' },
{ token: 'punctuation.definition.string.begin.haskell',
regex: '"',
push:
[ { token: 'punctuation.definition.string.end.haskell',
regex: '"', regex: '"',
next: 'pop' }, push: [{ token: 'punctuation.definition.string.end.haskell',
{ token: 'constant.character.escape.haskell', regex: '"',
regex: '\\\\(?:NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|[abfnrtv\\\\\\"\'\\&])' }, next: 'pop' },
{ token: 'constant.character.escape.octal.haskell', { token: 'constant.character.escape.haskell',
regex: '\\\\o[0-7]+|\\\\x[0-9A-Fa-f]+|\\\\[0-9]+' }, regex: '\\\\(?:NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|[abfnrtv\\\\\\"\'\\&])' },
{ token: 'constant.character.escape.control.haskell', { token: 'constant.character.escape.octal.haskell',
regex: '\\^[A-Z@\\[\\]\\\\\\^_]' }, regex: '\\\\o[0-7]+|\\\\x[0-9A-Fa-f]+|\\\\[0-9]+' },
{ defaultToken: 'string.quoted.double.haskell' } ] }, { token: 'constant.character.escape.control.haskell',
{ token: regex: '\\^[A-Z@\\[\\]\\\\\\^_]' },
[ 'punctuation.definition.string.begin.haskell', { defaultToken: 'string.quoted.double.haskell' }] },
'string.quoted.single.haskell', { token: ['punctuation.definition.string.begin.haskell',
'constant.character.escape.haskell', 'string.quoted.single.haskell',
'constant.character.escape.octal.haskell', 'constant.character.escape.haskell',
'constant.character.escape.hexadecimal.haskell', 'constant.character.escape.octal.haskell',
'constant.character.escape.control.haskell', 'constant.character.escape.hexadecimal.haskell',
'punctuation.definition.string.end.haskell' ], 'constant.character.escape.control.haskell',
regex: '(\')(?:([\\ -\\[\\]-~])|(\\\\(?:NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|[abfnrtv\\\\\\"\'\\&]))|(\\\\o[0-7]+)|(\\\\x[0-9A-Fa-f]+)|(\\^[A-Z@\\[\\]\\\\\\^_]))(\')' }, 'punctuation.definition.string.end.haskell'],
{ token: regex: '(\')(?:([\\ -\\[\\]-~])|(\\\\(?:NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|[abfnrtv\\\\\\"\'\\&]))|(\\\\o[0-7]+)|(\\\\x[0-9A-Fa-f]+)|(\\^[A-Z@\\[\\]\\\\\\^_]))(\')' },
[ 'meta.function.type-declaration.haskell', { token: ['meta.function.type-declaration.haskell',
'entity.name.function.haskell', 'entity.name.function.haskell',
'meta.function.type-declaration.haskell', 'meta.function.type-declaration.haskell',
'keyword.other.double-colon.haskell' ], 'keyword.other.double-colon.haskell'],
regex: '^(\\s*)([a-z_][a-zA-Z0-9_\']*|\\([|!%$+\\-.,=</>]+\\))(\\s*)(::)', regex: '^(\\s*)([a-z_][a-zA-Z0-9_\']*|\\([|!%$+\\-.,=</>]+\\))(\\s*)(::)',
push: push: [{ token: 'meta.function.type-declaration.haskell',
[ { token: 'meta.function.type-declaration.haskell', regex: '$',
regex: '$', next: 'pop' },
next: 'pop' }, { include: '#type_signature' },
{ include: '#type_signature' }, { defaultToken: 'meta.function.type-declaration.haskell' }] },
{ defaultToken: 'meta.function.type-declaration.haskell' } ] }, { token: 'support.constant.haskell',
{ token: 'support.constant.haskell', regex: '\\b(?:Just|Nothing|Left|Right|True|False|LT|EQ|GT|\\(\\)|\\[\\])\\b' },
regex: '\\b(?:Just|Nothing|Left|Right|True|False|LT|EQ|GT|\\(\\)|\\[\\])\\b' }, { token: 'constant.other.haskell', regex: '\\b[A-Z]\\w*\\b' },
{ token: 'constant.other.haskell', regex: '\\b[A-Z]\\w*\\b' }, { include: '#comments' },
{ include: '#comments' }, { token: 'support.function.prelude.haskell',
{ token: 'support.function.prelude.haskell', regex: '\\b(?:abs|acos|acosh|all|and|any|appendFile|applyM|asTypeOf|asin|asinh|atan|atan2|atanh|break|catch|ceiling|compare|concat|concatMap|const|cos|cosh|curry|cycle|decodeFloat|div|divMod|drop|dropWhile|elem|encodeFloat|enumFrom|enumFromThen|enumFromThenTo|enumFromTo|error|even|exp|exponent|fail|filter|flip|floatDigits|floatRadix|floatRange|floor|fmap|foldl|foldl1|foldr|foldr1|fromEnum|fromInteger|fromIntegral|fromRational|fst|gcd|getChar|getContents|getLine|head|id|init|interact|ioError|isDenormalized|isIEEE|isInfinite|isNaN|isNegativeZero|iterate|last|lcm|length|lex|lines|log|logBase|lookup|map|mapM|mapM_|max|maxBound|maximum|maybe|min|minBound|minimum|mod|negate|not|notElem|null|odd|or|otherwise|pi|pred|print|product|properFraction|putChar|putStr|putStrLn|quot|quotRem|read|readFile|readIO|readList|readLn|readParen|reads|readsPrec|realToFrac|recip|rem|repeat|replicate|return|reverse|round|scaleFloat|scanl|scanl1|scanr|scanr1|seq|sequence|sequence_|show|showChar|showList|showParen|showString|shows|showsPrec|significand|signum|sin|sinh|snd|span|splitAt|sqrt|subtract|succ|sum|tail|take|takeWhile|tan|tanh|toEnum|toInteger|toRational|truncate|uncurry|undefined|unlines|until|unwords|unzip|unzip3|userError|words|writeFile|zip|zip3|zipWith|zipWith3)\\b' },
regex: '\\b(?:abs|acos|acosh|all|and|any|appendFile|applyM|asTypeOf|asin|asinh|atan|atan2|atanh|break|catch|ceiling|compare|concat|concatMap|const|cos|cosh|curry|cycle|decodeFloat|div|divMod|drop|dropWhile|elem|encodeFloat|enumFrom|enumFromThen|enumFromThenTo|enumFromTo|error|even|exp|exponent|fail|filter|flip|floatDigits|floatRadix|floatRange|floor|fmap|foldl|foldl1|foldr|foldr1|fromEnum|fromInteger|fromIntegral|fromRational|fst|gcd|getChar|getContents|getLine|head|id|init|interact|ioError|isDenormalized|isIEEE|isInfinite|isNaN|isNegativeZero|iterate|last|lcm|length|lex|lines|log|logBase|lookup|map|mapM|mapM_|max|maxBound|maximum|maybe|min|minBound|minimum|mod|negate|not|notElem|null|odd|or|otherwise|pi|pred|print|product|properFraction|putChar|putStr|putStrLn|quot|quotRem|read|readFile|readIO|readList|readLn|readParen|reads|readsPrec|realToFrac|recip|rem|repeat|replicate|return|reverse|round|scaleFloat|scanl|scanl1|scanr|scanr1|seq|sequence|sequence_|show|showChar|showList|showParen|showString|shows|showsPrec|significand|signum|sin|sinh|snd|span|splitAt|sqrt|subtract|succ|sum|tail|take|takeWhile|tan|tanh|toEnum|toInteger|toRational|truncate|uncurry|undefined|unlines|until|unwords|unzip|unzip3|userError|words|writeFile|zip|zip3|zipWith|zipWith3)\\b' }, { include: '#infix_op' },
{ include: '#infix_op' }, { token: 'keyword.operator.haskell',
{ token: 'keyword.operator.haskell', regex: '[|!%$?~+:\\-.=</>\\\\]+',
regex: '[|!%$?~+:\\-.=</>\\\\]+', comment: 'In case this regex seems overly general, note that Haskell permits the definition of new operators which can be nearly any string of punctuation characters, such as $%^&*.' },
comment: 'In case this regex seems overly general, note that Haskell permits the definition of new operators which can be nearly any string of punctuation characters, such as $%^&*.' }, { token: 'punctuation.separator.comma.haskell', regex: ',' }],
{ token: 'punctuation.separator.comma.haskell', regex: ',' } ], '#block_comment': [{ token: 'punctuation.definition.comment.haskell',
'#block_comment': regex: '\\{-(?!#)',
[ { token: 'punctuation.definition.comment.haskell', push: [{ include: '#block_comment' },
regex: '\\{-(?!#)', { token: 'punctuation.definition.comment.haskell',
push: regex: '-\\}',
[ { include: '#block_comment' }, next: 'pop' },
{ token: 'punctuation.definition.comment.haskell', { defaultToken: 'comment.block.haskell' }] }],
regex: '-\\}', '#comments': [{ token: 'punctuation.definition.comment.haskell',
next: 'pop' }, regex: '--.*',
{ defaultToken: 'comment.block.haskell' } ] } ], push_: [{ token: 'comment.line.double-dash.haskell',
'#comments': regex: '$',
[ { token: 'punctuation.definition.comment.haskell', next: 'pop' },
regex: '--.*', { defaultToken: 'comment.line.double-dash.haskell' }] },
push_: { include: '#block_comment' }],
[ { token: 'comment.line.double-dash.haskell', '#infix_op': [{ token: 'entity.name.function.infix.haskell',
regex: '$', regex: '\\([|!%$+:\\-.=</>]+\\)|\\(,+\\)' }],
next: 'pop' }, '#module_exports': [{ token: 'meta.declaration.exports.haskell',
{ defaultToken: 'comment.line.double-dash.haskell' } ] }, regex: '\\(',
{ include: '#block_comment' } ], push: [{ token: 'meta.declaration.exports.haskell.end',
'#infix_op': regex: '\\)',
[ { token: 'entity.name.function.infix.haskell', next: 'pop' },
regex: '\\([|!%$+:\\-.=</>]+\\)|\\(,+\\)' } ], { token: 'entity.name.function.haskell',
'#module_exports': regex: '\\b[a-z][a-zA-Z_\']*' },
[ { token: 'meta.declaration.exports.haskell', { token: 'storage.type.haskell', regex: '\\b[A-Z][A-Za-z_\']*' },
regex: '\\(', { token: 'punctuation.separator.comma.haskell', regex: ',' },
push: { include: '#infix_op' },
[ { token: 'meta.declaration.exports.haskell.end', { token: 'meta.other.unknown.haskell',
regex: '\\)', regex: '\\(.*?\\)',
next: 'pop' }, comment: 'So named because I don\'t know what to call this.' },
{ token: 'entity.name.function.haskell', { defaultToken: 'meta.declaration.exports.haskell.end' }] }],
regex: '\\b[a-z][a-zA-Z_\']*' }, '#module_name': [{ token: 'support.other.module.haskell',
{ token: 'storage.type.haskell', regex: '\\b[A-Z][A-Za-z_\']*' }, regex: '[A-Z][A-Za-z._\']*' }],
{ token: 'punctuation.separator.comma.haskell', regex: ',' }, '#pragma': [{ token: 'meta.preprocessor.haskell',
{ include: '#infix_op' }, regex: '\\{-#',
{ token: 'meta.other.unknown.haskell', push: [{ token: 'meta.preprocessor.haskell',
regex: '\\(.*?\\)', regex: '#-\\}',
comment: 'So named because I don\'t know what to call this.' }, next: 'pop' },
{ defaultToken: 'meta.declaration.exports.haskell.end' } ] } ], { token: 'keyword.other.preprocessor.haskell',
'#module_name': regex: '\\b(?:LANGUAGE|UNPACK|INLINE)\\b' },
[ { token: 'support.other.module.haskell', { defaultToken: 'meta.preprocessor.haskell' }] }],
regex: '[A-Z][A-Za-z._\']*' } ], '#type_signature': [{ token: ['meta.class-constraint.haskell',
'#pragma': 'entity.other.inherited-class.haskell',
[ { token: 'meta.preprocessor.haskell', 'meta.class-constraint.haskell',
regex: '\\{-#', 'variable.other.generic-type.haskell',
push: 'meta.class-constraint.haskell',
[ { token: 'meta.preprocessor.haskell', 'keyword.other.big-arrow.haskell'],
regex: '#-\\}', regex: '(\\(\\s*)([A-Z][A-Za-z]*)(\\s+)([a-z][A-Za-z_\']*)(\\)\\s*)(=>)' },
next: 'pop' }, { include: '#pragma' },
{ token: 'keyword.other.preprocessor.haskell', { token: 'keyword.other.arrow.haskell', regex: '->' },
regex: '\\b(?:LANGUAGE|UNPACK|INLINE)\\b' }, { token: 'keyword.other.big-arrow.haskell', regex: '=>' },
{ defaultToken: 'meta.preprocessor.haskell' } ] } ], { token: 'support.type.prelude.haskell',
'#type_signature': regex: '\\b(?:Int(?:eger)?|Maybe|Either|Bool|Float|Double|Char|String|Ordering|ShowS|ReadS|FilePath|IO(?:Error)?)\\b' },
[ { token: { token: 'variable.other.generic-type.haskell',
[ 'meta.class-constraint.haskell', regex: '\\b[a-z][a-zA-Z0-9_\']*\\b' },
'entity.other.inherited-class.haskell', { token: 'storage.type.haskell',
'meta.class-constraint.haskell', regex: '\\b[A-Z][a-zA-Z0-9_\']*\\b' },
'variable.other.generic-type.haskell', { token: 'support.constant.unit.haskell', regex: '\\(\\)' },
'meta.class-constraint.haskell', { include: '#comments' }] };
'keyword.other.big-arrow.haskell' ],
regex: '(\\(\\s*)([A-Z][A-Za-z]*)(\\s+)([a-z][A-Za-z_\']*)(\\)\\s*)(=>)' },
{ include: '#pragma' },
{ token: 'keyword.other.arrow.haskell', regex: '->' },
{ token: 'keyword.other.big-arrow.haskell', regex: '=>' },
{ token: 'support.type.prelude.haskell',
regex: '\\b(?:Int(?:eger)?|Maybe|Either|Bool|Float|Double|Char|String|Ordering|ShowS|ReadS|FilePath|IO(?:Error)?)\\b' },
{ token: 'variable.other.generic-type.haskell',
regex: '\\b[a-z][a-zA-Z0-9_\']*\\b' },
{ token: 'storage.type.haskell',
regex: '\\b[A-Z][a-zA-Z0-9_\']*\\b' },
{ token: 'support.constant.unit.haskell', regex: '\\(\\)' },
{ include: '#comments' } ] };
this.normalizeRules(); this.normalizeRules();
}; };
HaskellHighlightRules.metaData = { fileTypes: ['hs'],
HaskellHighlightRules.metaData = { fileTypes: [ 'hs' ], keyEquivalent: '^~H',
keyEquivalent: '^~H', name: 'Haskell',
name: 'Haskell', scopeName: 'source.haskell' };
scopeName: 'source.haskell' };
oop.inherits(HaskellHighlightRules, TextHighlightRules); oop.inherits(HaskellHighlightRules, TextHighlightRules);
exports.HaskellHighlightRules = HaskellHighlightRules; exports.HaskellHighlightRules = HaskellHighlightRules;
}); });
define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../../lib/oop"); var oop = require("../../lib/oop");
var Range = require("../../range").Range; var Range = require("../../range").Range;
var BaseFoldMode = require("./fold_mode").FoldMode; var BaseFoldMode = require("./fold_mode").FoldMode;
var FoldMode = exports.FoldMode = function (commentRegex) {
var FoldMode = exports.FoldMode = function(commentRegex) {
if (commentRegex) { if (commentRegex) {
this.foldingStartMarker = new RegExp( this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
);
this.foldingStopMarker = new RegExp(
this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
);
} }
}; };
oop.inherits(FoldMode, BaseFoldMode); oop.inherits(FoldMode, BaseFoldMode);
(function () {
(function() {
this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/; this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/; this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
this._getFoldWidgetBase = this.getFoldWidget; this._getFoldWidgetBase = this.getFoldWidget;
this.getFoldWidget = function(session, foldStyle, row) { this.getFoldWidget = function (session, foldStyle, row) {
var line = session.getLine(row); var line = session.getLine(row);
if (this.singleLineBlockCommentRe.test(line)) { if (this.singleLineBlockCommentRe.test(line)) {
if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
return ""; return "";
} }
var fw = this._getFoldWidgetBase(session, foldStyle, row); var fw = this._getFoldWidgetBase(session, foldStyle, row);
if (!fw && this.startRegionRe.test(line)) if (!fw && this.startRegionRe.test(line))
return "start"; // lineCommentRegionStart return "start"; // lineCommentRegionStart
return fw; return fw;
}; };
this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
var line = session.getLine(row); var line = session.getLine(row);
if (this.startRegionRe.test(line)) if (this.startRegionRe.test(line))
return this.getCommentRegionBlock(session, line, row); return this.getCommentRegionBlock(session, line, row);
var match = line.match(this.foldingStartMarker); var match = line.match(this.foldingStartMarker);
if (match) { if (match) {
var i = match.index; var i = match.index;
if (match[1]) if (match[1])
return this.openingBracketBlock(session, match[1], row, i); return this.openingBracketBlock(session, match[1], row, i);
var range = session.getCommentFoldRange(row, i + match[0].length, 1); var range = session.getCommentFoldRange(row, i + match[0].length, 1);
if (range && !range.isMultiLine()) { if (range && !range.isMultiLine()) {
if (forceMultiline) { if (forceMultiline) {
range = this.getSectionRange(session, row); range = this.getSectionRange(session, row);
} else if (foldStyle != "all") }
else if (foldStyle != "all")
range = null; range = null;
} }
return range; return range;
} }
if (foldStyle === "markbegin") if (foldStyle === "markbegin")
return; return;
var match = line.match(this.foldingStopMarker); var match = line.match(this.foldingStopMarker);
if (match) { if (match) {
var i = match.index + match[0].length; var i = match.index + match[0].length;
if (match[1]) if (match[1])
return this.closingBracketBlock(session, match[1], row, i); return this.closingBracketBlock(session, match[1], row, i);
return session.getCommentFoldRange(row, i, -1); return session.getCommentFoldRange(row, i, -1);
} }
}; };
this.getSectionRange = function (session, row) {
this.getSectionRange = function(session, row) {
var line = session.getLine(row); var line = session.getLine(row);
var startIndent = line.search(/\S/); var startIndent = line.search(/\S/);
var startRow = row; var startRow = row;
@ -302,71 +247,78 @@ oop.inherits(FoldMode, BaseFoldMode);
var indent = line.search(/\S/); var indent = line.search(/\S/);
if (indent === -1) if (indent === -1)
continue; continue;
if (startIndent > indent) if (startIndent > indent)
break; break;
var subRange = this.getFoldWidgetRange(session, "all", row); var subRange = this.getFoldWidgetRange(session, "all", row);
if (subRange) { if (subRange) {
if (subRange.start.row <= startRow) { if (subRange.start.row <= startRow) {
break; break;
} else if (subRange.isMultiLine()) { }
else if (subRange.isMultiLine()) {
row = subRange.end.row; row = subRange.end.row;
} else if (startIndent == indent) { }
else if (startIndent == indent) {
break; break;
} }
} }
endRow = row; endRow = row;
} }
return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
}; };
this.getCommentRegionBlock = function(session, line, row) { this.getCommentRegionBlock = function (session, line, row) {
var startColumn = line.search(/\s*$/); var startColumn = line.search(/\s*$/);
var maxRow = session.getLength(); var maxRow = session.getLength();
var startRow = row; var startRow = row;
var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
var depth = 1; var depth = 1;
while (++row < maxRow) { while (++row < maxRow) {
line = session.getLine(row); line = session.getLine(row);
var m = re.exec(line); var m = re.exec(line);
if (!m) continue; if (!m)
if (m[1]) depth--; continue;
else depth++; if (m[1])
depth--;
if (!depth) break; else
depth++;
if (!depth)
break;
} }
var endRow = row; var endRow = row;
if (endRow > startRow) { if (endRow > startRow) {
return new Range(startRow, startColumn, endRow, line.length); return new Range(startRow, startColumn, endRow, line.length);
} }
}; };
}).call(FoldMode.prototype); }).call(FoldMode.prototype);
}); });
define("ace/mode/haskell",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/haskell_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) { define("ace/mode/haskell",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/haskell_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module){/*
THIS FILE WAS AUTOGENERATED BY mode.tmpl.js
*/
"use strict"; "use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextMode = require("./text").Mode; var TextMode = require("./text").Mode;
var HaskellHighlightRules = require("./haskell_highlight_rules").HaskellHighlightRules; var HaskellHighlightRules = require("./haskell_highlight_rules").HaskellHighlightRules;
var FoldMode = require("./folding/cstyle").FoldMode; var FoldMode = require("./folding/cstyle").FoldMode;
var Mode = function () {
var Mode = function() {
this.HighlightRules = HaskellHighlightRules; this.HighlightRules = HaskellHighlightRules;
this.foldingRules = new FoldMode(); this.foldingRules = new FoldMode();
this.$behaviour = this.$defaultBehaviour; this.$behaviour = this.$defaultBehaviour;
}; };
oop.inherits(Mode, TextMode); oop.inherits(Mode, TextMode);
(function () {
(function() {
this.lineCommentStart = "--"; this.lineCommentStart = "--";
this.blockComment = null; this.blockComment = null;
this.$id = "ace/mode/haskell"; this.$id = "ace/mode/haskell";
this.snippetFileId = "ace/snippets/haskell";
}).call(Mode.prototype); }).call(Mode.prototype);
exports.Mode = Mode; exports.Mode = Mode;
});
}); (function() {
window.require(["ace/mode/haskell"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

View File

@ -1,134 +1,135 @@
define("ace/mode/haskell_cabal_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { define("ace/mode/haskell_cabal_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){/**
* Haskell Cabal files highlighter (https://www.haskell.org/cabal/users-guide/developing-packages.html)
**/
"use strict"; "use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var CabalHighlightRules = function () {
var CabalHighlightRules = function() {
this.$rules = { this.$rules = {
"start" : [ "start": [
{ {
token : "comment", token: "comment",
regex : "^\\s*--.*$" regex: "^\\s*--.*$"
}, { }, {
token: ["keyword"], token: ["keyword"],
regex: /^(\s*\w.*?)(:(?:\s+|$))/ regex: /^(\s*\w.*?)(:(?:\s+|$))/
}, { }, {
token : "constant.numeric", // float token: "constant.numeric", // float
regex : /[\d_]+(?:(?:[\.\d_]*)?)/ regex: /[\d_]+(?:(?:[\.\d_]*)?)/
}, { }, {
token : "constant.language.boolean", token: "constant.language.boolean",
regex : "(?:true|false|TRUE|FALSE|True|False|yes|no)\\b" regex: "(?:true|false|TRUE|FALSE|True|False|yes|no)\\b"
}, { }, {
token : "markup.heading", token: "markup.heading",
regex : /^(\w.*)$/ regex: /^(\w.*)$/
} }
]}; ]
};
}; };
oop.inherits(CabalHighlightRules, TextHighlightRules); oop.inherits(CabalHighlightRules, TextHighlightRules);
exports.CabalHighlightRules = CabalHighlightRules; exports.CabalHighlightRules = CabalHighlightRules;
}); });
define("ace/mode/folding/haskell_cabal",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module) { define("ace/mode/folding/haskell_cabal",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module){/*
* Folding mode for Cabal files (Haskell): allow folding each seaction, including
* the initial general section.
*/
"use strict"; "use strict";
var oop = require("../../lib/oop"); var oop = require("../../lib/oop");
var BaseFoldMode = require("./fold_mode").FoldMode; var BaseFoldMode = require("./fold_mode").FoldMode;
var Range = require("../../range").Range; var Range = require("../../range").Range;
var FoldMode = exports.FoldMode = function () { };
var FoldMode = exports.FoldMode = function() {};
oop.inherits(FoldMode, BaseFoldMode); oop.inherits(FoldMode, BaseFoldMode);
(function () {
(function() { this.isHeading = function (session, row) {
this.isHeading = function (session,row) { var heading = "markup.heading";
var heading = "markup.heading"; var token = session.getTokens(row)[0];
var token = session.getTokens(row)[0]; return row == 0 || (token && token.type.lastIndexOf(heading, 0) === 0);
return row==0 || (token && token.type.lastIndexOf(heading, 0) === 0); };
}; this.getFoldWidget = function (session, foldStyle, row) {
if (this.isHeading(session, row)) {
this.getFoldWidget = function(session, foldStyle, row) { return "start";
if (this.isHeading(session,row)){
return "start";
} else if (foldStyle === "markbeginend" && !(/^\s*$/.test(session.getLine(row)))){
var maxRow = session.getLength();
while (++row < maxRow) {
if (!(/^\s*$/.test(session.getLine(row)))){
break;
}
} }
if (row==maxRow || this.isHeading(session,row)){ else if (foldStyle === "markbeginend" && !(/^\s*$/.test(session.getLine(row)))) {
return "end"; var maxRow = session.getLength();
} while (++row < maxRow) {
} if (!(/^\s*$/.test(session.getLine(row)))) {
return ""; break;
}; }
}
if (row == maxRow || this.isHeading(session, row)) {
this.getFoldWidgetRange = function(session, foldStyle, row) { return "end";
var line = session.getLine(row); }
var startColumn = line.length;
var maxRow = session.getLength();
var startRow = row;
var endRow = row;
if (this.isHeading(session,row)) {
while (++row < maxRow) {
if (this.isHeading(session,row)){
row--;
break;
}
}
endRow = row;
if (endRow > startRow) {
while (endRow > startRow && /^\s*$/.test(session.getLine(endRow)))
endRow--;
}
if (endRow > startRow) {
var endColumn = session.getLine(endRow).length;
return new Range(startRow, startColumn, endRow, endColumn);
}
} else if (this.getFoldWidget(session, foldStyle, row)==="end"){
var endRow = row;
var endColumn = session.getLine(endRow).length;
while (--row>=0){
if (this.isHeading(session,row)){
break;
}
} }
return "";
};
this.getFoldWidgetRange = function (session, foldStyle, row) {
var line = session.getLine(row); var line = session.getLine(row);
var startColumn = line.length; var startColumn = line.length;
return new Range(row, startColumn, endRow, endColumn); var maxRow = session.getLength();
} var startRow = row;
var endRow = row;
if (this.isHeading(session, row)) {
while (++row < maxRow) {
if (this.isHeading(session, row)) {
row--;
break;
}
}
endRow = row;
if (endRow > startRow) {
while (endRow > startRow && /^\s*$/.test(session.getLine(endRow)))
endRow--;
}
if (endRow > startRow) {
var endColumn = session.getLine(endRow).length;
return new Range(startRow, startColumn, endRow, endColumn);
}
}
else if (this.getFoldWidget(session, foldStyle, row) === "end") {
var endRow = row;
var endColumn = session.getLine(endRow).length;
while (--row >= 0) {
if (this.isHeading(session, row)) {
break;
}
}
var line = session.getLine(row);
var startColumn = line.length;
return new Range(row, startColumn, endRow, endColumn);
}
}; };
}).call(FoldMode.prototype); }).call(FoldMode.prototype);
}); });
define("ace/mode/haskell_cabal",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/haskell_cabal_highlight_rules","ace/mode/folding/haskell_cabal"], function(require, exports, module) { define("ace/mode/haskell_cabal",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/haskell_cabal_highlight_rules","ace/mode/folding/haskell_cabal"], function(require, exports, module){/**
* Haskell Cabal files mode (https://www.haskell.org/cabal/users-guide/developing-packages.html)
**/
"use strict"; "use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextMode = require("./text").Mode; var TextMode = require("./text").Mode;
var CabalHighlightRules = require("./haskell_cabal_highlight_rules").CabalHighlightRules; var CabalHighlightRules = require("./haskell_cabal_highlight_rules").CabalHighlightRules;
var FoldMode = require("./folding/haskell_cabal").FoldMode; var FoldMode = require("./folding/haskell_cabal").FoldMode;
var Mode = function () {
var Mode = function() {
this.HighlightRules = CabalHighlightRules; this.HighlightRules = CabalHighlightRules;
this.foldingRules = new FoldMode(); this.foldingRules = new FoldMode();
this.$behaviour = this.$defaultBehaviour; this.$behaviour = this.$defaultBehaviour;
}; };
oop.inherits(Mode, TextMode); oop.inherits(Mode, TextMode);
(function () {
(function() {
this.lineCommentStart = "--"; this.lineCommentStart = "--";
this.blockComment = null; this.blockComment = null;
this.$id = "ace/mode/haskell_cabal"; this.$id = "ace/mode/haskell_cabal";
}).call(Mode.prototype); }).call(Mode.prototype);
exports.Mode = Mode; exports.Mode = Mode;
});
}); (function() {
window.require(["ace/mode/haskell_cabal"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

View File

@ -1,269 +1,210 @@
define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var DocCommentHighlightRules = function () {
var DocCommentHighlightRules = function() {
this.$rules = { this.$rules = {
"start" : [ { "start": [
token : "comment.doc.tag", {
regex : "@[\\w\\d_]+" // TODO: fix email addresses token: "comment.doc.tag",
}, regex: "@\\w+(?=\\s|$)"
DocCommentHighlightRules.getTagRule(), }, DocCommentHighlightRules.getTagRule(), {
{ defaultToken: "comment.doc",
defaultToken : "comment.doc", caseInsensitive: true
caseInsensitive: true }
}] ]
}; };
}; };
oop.inherits(DocCommentHighlightRules, TextHighlightRules); oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getTagRule = function (start) {
DocCommentHighlightRules.getTagRule = function(start) {
return { return {
token : "comment.doc.tag.storage.type", token: "comment.doc.tag.storage.type",
regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" regex: "\\b(?:TODO|FIXME|XXX|HACK)\\b"
}; };
}; };
DocCommentHighlightRules.getStartRule = function (start) {
DocCommentHighlightRules.getStartRule = function(start) {
return { return {
token : "comment.doc", // doc comment token: "comment.doc", // doc comment
regex : "\\/\\*(?=\\*)", regex: "\\/\\*(?=\\*)",
next : start next: start
}; };
}; };
DocCommentHighlightRules.getEndRule = function (start) { DocCommentHighlightRules.getEndRule = function (start) {
return { return {
token : "comment.doc", // closing comment token: "comment.doc", // closing comment
regex : "\\*\\/", regex: "\\*\\/",
next : start next: start
}; };
}; };
exports.DocCommentHighlightRules = DocCommentHighlightRules; exports.DocCommentHighlightRules = DocCommentHighlightRules;
}); });
define("ace/mode/haxe_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) { define("ace/mode/haxe_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var HaxeHighlightRules = function () {
var HaxeHighlightRules = function() { var keywords = ("break|case|cast|catch|class|continue|default|else|enum|extends|for|function|if|implements|import|in|inline|interface|new|override|package|private|public|return|static|super|switch|this|throw|trace|try|typedef|untyped|var|while|Array|Void|Bool|Int|UInt|Float|Dynamic|String|List|Hash|IntHash|Error|Unknown|Type|Std");
var buildinConstants = ("null|true|false");
var keywords = (
"break|case|cast|catch|class|continue|default|else|enum|extends|for|function|if|implements|import|in|inline|interface|new|override|package|private|public|return|static|super|switch|this|throw|trace|try|typedef|untyped|var|while|Array|Void|Bool|Int|UInt|Float|Dynamic|String|List|Hash|IntHash|Error|Unknown|Type|Std"
);
var buildinConstants = (
"null|true|false"
);
var keywordMapper = this.createKeywordMapper({ var keywordMapper = this.createKeywordMapper({
"variable.language": "this", "variable.language": "this",
"keyword": keywords, "keyword": keywords,
"constant.language": buildinConstants "constant.language": buildinConstants
}, "identifier"); }, "identifier");
this.$rules = { this.$rules = {
"start" : [ "start": [
{ {
token : "comment", token: "comment",
regex : "\\/\\/.*$" regex: "\\/\\/.*$"
}, },
DocCommentHighlightRules.getStartRule("doc-start"), DocCommentHighlightRules.getStartRule("doc-start"),
{ {
token : "comment", // multi line comment token: "comment", // multi line comment
regex : "\\/\\*", regex: "\\/\\*",
next : "comment" next: "comment"
}, { }, {
token : "string.regexp", token: "string.regexp",
regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)" regex: "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"
}, { }, {
token : "string", // single line token: "string", // single line
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' regex: '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
}, { }, {
token : "string", // single line token: "string", // single line
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" regex: "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
}, { }, {
token : "constant.numeric", // hex token: "constant.numeric", // hex
regex : "0[xX][0-9a-fA-F]+\\b" regex: "0[xX][0-9a-fA-F]+\\b"
}, { }, {
token : "constant.numeric", // float token: "constant.numeric", // float
regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
}, { }, {
token : "constant.language.boolean", token: "constant.language.boolean",
regex : "(?:true|false)\\b" regex: "(?:true|false)\\b"
}, { }, {
token : keywordMapper, token: keywordMapper,
regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
}, { }, {
token : "keyword.operator", token: "keyword.operator",
regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)" regex: "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"
}, { }, {
token : "punctuation.operator", token: "punctuation.operator",
regex : "\\?|\\:|\\,|\\;|\\." regex: "\\?|\\:|\\,|\\;|\\."
}, { }, {
token : "paren.lparen", token: "paren.lparen",
regex : "[[({<]" regex: "[[({<]"
}, { }, {
token : "paren.rparen", token: "paren.rparen",
regex : "[\\])}>]" regex: "[\\])}>]"
}, { }, {
token : "text", token: "text",
regex : "\\s+" regex: "\\s+"
} }
], ],
"comment" : [ "comment": [
{ {
token : "comment", // closing comment token: "comment", // closing comment
regex : "\\*\\/", regex: "\\*\\/",
next : "start" next: "start"
}, { }, {
defaultToken : "comment" defaultToken: "comment"
} }
] ]
}; };
this.embedRules(DocCommentHighlightRules, "doc-", [DocCommentHighlightRules.getEndRule("start")]);
this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]);
}; };
oop.inherits(HaxeHighlightRules, TextHighlightRules); oop.inherits(HaxeHighlightRules, TextHighlightRules);
exports.HaxeHighlightRules = HaxeHighlightRules; exports.HaxeHighlightRules = HaxeHighlightRules;
}); });
define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module){"use strict";
"use strict";
var Range = require("../range").Range; var Range = require("../range").Range;
var MatchingBraceOutdent = function () { };
var MatchingBraceOutdent = function() {}; (function () {
this.checkOutdent = function (line, input) {
(function() { if (!/^\s+$/.test(line))
this.checkOutdent = function(line, input) {
if (! /^\s+$/.test(line))
return false; return false;
return /^\s*\}/.test(input); return /^\s*\}/.test(input);
}; };
this.autoOutdent = function (doc, row) {
this.autoOutdent = function(doc, row) {
var line = doc.getLine(row); var line = doc.getLine(row);
var match = line.match(/^(\s*\})/); var match = line.match(/^(\s*\})/);
if (!match)
if (!match) return 0; return 0;
var column = match[1].length; var column = match[1].length;
var openBracePos = doc.findMatchingBracket({row: row, column: column}); var openBracePos = doc.findMatchingBracket({ row: row, column: column });
if (!openBracePos || openBracePos.row == row)
if (!openBracePos || openBracePos.row == row) return 0; return 0;
var indent = this.$getIndent(doc.getLine(openBracePos.row)); var indent = this.$getIndent(doc.getLine(openBracePos.row));
doc.replace(new Range(row, 0, row, column-1), indent); doc.replace(new Range(row, 0, row, column - 1), indent);
}; };
this.$getIndent = function (line) {
this.$getIndent = function(line) {
return line.match(/^\s*/)[0]; return line.match(/^\s*/)[0];
}; };
}).call(MatchingBraceOutdent.prototype); }).call(MatchingBraceOutdent.prototype);
exports.MatchingBraceOutdent = MatchingBraceOutdent; exports.MatchingBraceOutdent = MatchingBraceOutdent;
}); });
define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../../lib/oop"); var oop = require("../../lib/oop");
var Range = require("../../range").Range; var Range = require("../../range").Range;
var BaseFoldMode = require("./fold_mode").FoldMode; var BaseFoldMode = require("./fold_mode").FoldMode;
var FoldMode = exports.FoldMode = function (commentRegex) {
var FoldMode = exports.FoldMode = function(commentRegex) {
if (commentRegex) { if (commentRegex) {
this.foldingStartMarker = new RegExp( this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
);
this.foldingStopMarker = new RegExp(
this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
);
} }
}; };
oop.inherits(FoldMode, BaseFoldMode); oop.inherits(FoldMode, BaseFoldMode);
(function () {
(function() {
this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/; this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/; this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
this._getFoldWidgetBase = this.getFoldWidget; this._getFoldWidgetBase = this.getFoldWidget;
this.getFoldWidget = function(session, foldStyle, row) { this.getFoldWidget = function (session, foldStyle, row) {
var line = session.getLine(row); var line = session.getLine(row);
if (this.singleLineBlockCommentRe.test(line)) { if (this.singleLineBlockCommentRe.test(line)) {
if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
return ""; return "";
} }
var fw = this._getFoldWidgetBase(session, foldStyle, row); var fw = this._getFoldWidgetBase(session, foldStyle, row);
if (!fw && this.startRegionRe.test(line)) if (!fw && this.startRegionRe.test(line))
return "start"; // lineCommentRegionStart return "start"; // lineCommentRegionStart
return fw; return fw;
}; };
this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
var line = session.getLine(row); var line = session.getLine(row);
if (this.startRegionRe.test(line)) if (this.startRegionRe.test(line))
return this.getCommentRegionBlock(session, line, row); return this.getCommentRegionBlock(session, line, row);
var match = line.match(this.foldingStartMarker); var match = line.match(this.foldingStartMarker);
if (match) { if (match) {
var i = match.index; var i = match.index;
if (match[1]) if (match[1])
return this.openingBracketBlock(session, match[1], row, i); return this.openingBracketBlock(session, match[1], row, i);
var range = session.getCommentFoldRange(row, i + match[0].length, 1); var range = session.getCommentFoldRange(row, i + match[0].length, 1);
if (range && !range.isMultiLine()) { if (range && !range.isMultiLine()) {
if (forceMultiline) { if (forceMultiline) {
range = this.getSectionRange(session, row); range = this.getSectionRange(session, row);
} else if (foldStyle != "all") }
else if (foldStyle != "all")
range = null; range = null;
} }
return range; return range;
} }
if (foldStyle === "markbegin") if (foldStyle === "markbegin")
return; return;
var match = line.match(this.foldingStopMarker); var match = line.match(this.foldingStopMarker);
if (match) { if (match) {
var i = match.index + match[0].length; var i = match.index + match[0].length;
if (match[1]) if (match[1])
return this.closingBracketBlock(session, match[1], row, i); return this.closingBracketBlock(session, match[1], row, i);
return session.getCommentFoldRange(row, i, -1); return session.getCommentFoldRange(row, i, -1);
} }
}; };
this.getSectionRange = function (session, row) {
this.getSectionRange = function(session, row) {
var line = session.getLine(row); var line = session.getLine(row);
var startIndent = line.search(/\S/); var startIndent = line.search(/\S/);
var startRow = row; var startRow = row;
@ -276,104 +217,97 @@ oop.inherits(FoldMode, BaseFoldMode);
var indent = line.search(/\S/); var indent = line.search(/\S/);
if (indent === -1) if (indent === -1)
continue; continue;
if (startIndent > indent) if (startIndent > indent)
break; break;
var subRange = this.getFoldWidgetRange(session, "all", row); var subRange = this.getFoldWidgetRange(session, "all", row);
if (subRange) { if (subRange) {
if (subRange.start.row <= startRow) { if (subRange.start.row <= startRow) {
break; break;
} else if (subRange.isMultiLine()) { }
else if (subRange.isMultiLine()) {
row = subRange.end.row; row = subRange.end.row;
} else if (startIndent == indent) { }
else if (startIndent == indent) {
break; break;
} }
} }
endRow = row; endRow = row;
} }
return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
}; };
this.getCommentRegionBlock = function(session, line, row) { this.getCommentRegionBlock = function (session, line, row) {
var startColumn = line.search(/\s*$/); var startColumn = line.search(/\s*$/);
var maxRow = session.getLength(); var maxRow = session.getLength();
var startRow = row; var startRow = row;
var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
var depth = 1; var depth = 1;
while (++row < maxRow) { while (++row < maxRow) {
line = session.getLine(row); line = session.getLine(row);
var m = re.exec(line); var m = re.exec(line);
if (!m) continue; if (!m)
if (m[1]) depth--; continue;
else depth++; if (m[1])
depth--;
if (!depth) break; else
depth++;
if (!depth)
break;
} }
var endRow = row; var endRow = row;
if (endRow > startRow) { if (endRow > startRow) {
return new Range(startRow, startColumn, endRow, line.length); return new Range(startRow, startColumn, endRow, line.length);
} }
}; };
}).call(FoldMode.prototype); }).call(FoldMode.prototype);
}); });
define("ace/mode/haxe",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/haxe_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) { define("ace/mode/haxe",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/haxe_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextMode = require("./text").Mode; var TextMode = require("./text").Mode;
var HaxeHighlightRules = require("./haxe_highlight_rules").HaxeHighlightRules; var HaxeHighlightRules = require("./haxe_highlight_rules").HaxeHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
var CStyleFoldMode = require("./folding/cstyle").FoldMode; var CStyleFoldMode = require("./folding/cstyle").FoldMode;
var Mode = function () {
var Mode = function() {
this.HighlightRules = HaxeHighlightRules; this.HighlightRules = HaxeHighlightRules;
this.$outdent = new MatchingBraceOutdent(); this.$outdent = new MatchingBraceOutdent();
this.$behaviour = new CstyleBehaviour(); this.$behaviour = this.$defaultBehaviour;
this.foldingRules = new CStyleFoldMode(); this.foldingRules = new CStyleFoldMode();
}; };
oop.inherits(Mode, TextMode); oop.inherits(Mode, TextMode);
(function () {
(function() {
this.lineCommentStart = "//"; this.lineCommentStart = "//";
this.blockComment = {start: "/*", end: "*/"}; this.blockComment = { start: "/*", end: "*/" };
this.getNextLineIndent = function (state, line, tab) {
this.getNextLineIndent = function(state, line, tab) {
var indent = this.$getIndent(line); var indent = this.$getIndent(line);
var tokenizedLine = this.getTokenizer().getLineTokens(line, state); var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
var tokens = tokenizedLine.tokens; var tokens = tokenizedLine.tokens;
if (tokens.length && tokens[tokens.length - 1].type == "comment") {
if (tokens.length && tokens[tokens.length-1].type == "comment") {
return indent; return indent;
} }
if (state == "start") { if (state == "start") {
var match = line.match(/^.*[\{\(\[]\s*$/); var match = line.match(/^.*[\{\(\[]\s*$/);
if (match) { if (match) {
indent += tab; indent += tab;
} }
} }
return indent; return indent;
}; };
this.checkOutdent = function (state, line, input) {
this.checkOutdent = function(state, line, input) {
return this.$outdent.checkOutdent(line, input); return this.$outdent.checkOutdent(line, input);
}; };
this.autoOutdent = function (state, doc, row) {
this.autoOutdent = function(state, doc, row) {
this.$outdent.autoOutdent(doc, row); this.$outdent.autoOutdent(doc, row);
}; };
this.$id = "ace/mode/haxe"; this.$id = "ace/mode/haxe";
}).call(Mode.prototype); }).call(Mode.prototype);
exports.Mode = Mode; exports.Mode = Mode;
});
}); (function() {
window.require(["ace/mode/haxe"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

View File

@ -1,172 +1,167 @@
define("ace/mode/hjson_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { define("ace/mode/hjson_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){/* This file was autogenerated from Hjson.tmLanguage (uuid: ) */
"use strict"; "use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var HjsonHighlightRules = function () {
var HjsonHighlightRules = function() {
this.$rules = { this.$rules = {
start: [{ start: [{
include: "#comments" include: "#comments"
}, { }, {
include: "#rootObject" include: "#rootObject"
}, {
include: "#value"
}],
"#array": [{
token: "paren.lparen",
regex: /\[/,
push: [{
token: "paren.rparen",
regex: /\]/,
next: "pop"
}, { }, {
include: "#value" include: "#value"
}],
"#array": [{
token: "paren.lparen",
regex: /\[/,
push: [{
token: "paren.rparen",
regex: /\]/,
next: "pop"
}, {
include: "#value"
}, {
include: "#comments"
}, {
token: "text",
regex: /,|$/
}, {
token: "invalid.illegal",
regex: /[^\s\]]/
}, {
defaultToken: "array"
}]
}],
"#comments": [{
token: [
"comment.punctuation",
"comment.line"
],
regex: /(#)(.*$)/
}, {
token: "comment.punctuation",
regex: /\/\*/,
push: [{
token: "comment.punctuation",
regex: /\*\//,
next: "pop"
}, {
defaultToken: "comment.block"
}]
}, {
token: [
"comment.punctuation",
"comment.line"
],
regex: /(\/\/)(.*$)/
}],
"#constant": [{
token: "constant",
regex: /\b(?:true|false|null)\b/
}],
"#keyname": [{
token: "keyword",
regex: /(?:[^,\{\[\}\]\s]+|"(?:[^"\\]|\\.)*")\s*(?=:)/
}],
"#mstring": [{
token: "string",
regex: /'''/,
push: [{
token: "string",
regex: /'''/,
next: "pop"
}, {
defaultToken: "string"
}]
}],
"#number": [{
token: "constant.numeric",
regex: /-?(?:0|[1-9]\d*)(?:(?:\.\d+)?(?:[eE][+-]?\d+)?)?/,
comment: "handles integer and decimal numbers"
}],
"#object": [{
token: "paren.lparen",
regex: /\{/,
push: [{
token: "paren.rparen",
regex: /\}/,
next: "pop"
}, {
include: "#keyname"
}, {
include: "#value"
}, {
token: "text",
regex: /:/
}, {
token: "text",
regex: /,/
}, {
defaultToken: "paren"
}]
}],
"#rootObject": [{
token: "paren",
regex: /(?=\s*(?:[^,\{\[\}\]\s]+|"(?:[^"\\]|\\.)*")\s*:)/,
push: [{
token: "paren.rparen",
regex: /---none---/,
next: "pop"
}, {
include: "#keyname"
}, {
include: "#value"
}, {
token: "text",
regex: /:/
}, {
token: "text",
regex: /,/
}, {
defaultToken: "paren"
}]
}],
"#string": [{
token: "string",
regex: /"/,
push: [{
token: "string",
regex: /"/,
next: "pop"
}, {
token: "constant.language.escape",
regex: /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/
}, {
token: "invalid.illegal",
regex: /\\./
}, {
defaultToken: "string"
}]
}],
"#ustring": [{
token: "string",
regex: /\b[^:,0-9\-\{\[\}\]\s].*$/
}],
"#value": [{
include: "#constant"
}, {
include: "#number"
}, {
include: "#string"
}, {
include: "#array"
}, {
include: "#object"
}, { }, {
include: "#comments" include: "#comments"
}, { }, {
token: "text", include: "#mstring"
regex: /,|$/
}, { }, {
token: "invalid.illegal", include: "#ustring"
regex: /[^\s\]]/
}, {
defaultToken: "array"
}] }]
}],
"#comments": [{
token: [
"comment.punctuation",
"comment.line"
],
regex: /(#)(.*$)/
}, {
token: "comment.punctuation",
regex: /\/\*/,
push: [{
token: "comment.punctuation",
regex: /\*\//,
next: "pop"
}, {
defaultToken: "comment.block"
}]
}, {
token: [
"comment.punctuation",
"comment.line"
],
regex: /(\/\/)(.*$)/
}],
"#constant": [{
token: "constant",
regex: /\b(?:true|false|null)\b/
}],
"#keyname": [{
token: "keyword",
regex: /(?:[^,\{\[\}\]\s]+|"(?:[^"\\]|\\.)*")\s*(?=:)/
}],
"#mstring": [{
token: "string",
regex: /'''/,
push: [{
token: "string",
regex: /'''/,
next: "pop"
}, {
defaultToken: "string"
}]
}],
"#number": [{
token: "constant.numeric",
regex: /-?(?:0|[1-9]\d*)(?:(?:\.\d+)?(?:[eE][+-]?\d+)?)?/,
comment: "handles integer and decimal numbers"
}],
"#object": [{
token: "paren.lparen",
regex: /\{/,
push: [{
token: "paren.rparen",
regex: /\}/,
next: "pop"
}, {
include: "#keyname"
}, {
include: "#value"
}, {
token: "text",
regex: /:/
}, {
token: "text",
regex: /,/
}, {
defaultToken: "paren"
}]
}],
"#rootObject": [{
token: "paren",
regex: /(?=\s*(?:[^,\{\[\}\]\s]+|"(?:[^"\\]|\\.)*")\s*:)/,
push: [{
token: "paren.rparen",
regex: /---none---/,
next: "pop"
}, {
include: "#keyname"
}, {
include: "#value"
}, {
token: "text",
regex: /:/
}, {
token: "text",
regex: /,/
}, {
defaultToken: "paren"
}]
}],
"#string": [{
token: "string",
regex: /"/,
push: [{
token: "string",
regex: /"/,
next: "pop"
}, {
token: "constant.language.escape",
regex: /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/
}, {
token: "invalid.illegal",
regex: /\\./
}, {
defaultToken: "string"
}]
}],
"#ustring": [{
token: "string",
regex: /\b[^:,0-9\-\{\[\}\]\s].*$/
}],
"#value": [{
include: "#constant"
}, {
include: "#number"
}, {
include: "#string"
}, {
include: "#array"
}, {
include: "#object"
}, {
include: "#comments"
}, {
include: "#mstring"
}, {
include: "#ustring"
}]
}; };
this.normalizeRules(); this.normalizeRules();
}; };
HjsonHighlightRules.metaData = { HjsonHighlightRules.metaData = {
fileTypes: ["hjson"], fileTypes: ["hjson"],
foldingStartMarker: "(?x: # turn on extended mode\n ^ # a line beginning with\n \\s* # some optional space\n [{\\[] # the start of an object or array\n (?! # but not followed by\n .* # whatever\n [}\\]] # and the close of an object or array\n ,? # an optional comma\n \\s* # some optional space\n $ # at the end of the line\n )\n | # ...or...\n [{\\[] # the start of an object or array\n \\s* # some optional space\n $ # at the end of the line\n )", foldingStartMarker: "(?x: # turn on extended mode\n ^ # a line beginning with\n \\s* # some optional space\n [{\\[] # the start of an object or array\n (?! # but not followed by\n .* # whatever\n [}\\]] # and the close of an object or array\n ,? # an optional comma\n \\s* # some optional space\n $ # at the end of the line\n )\n | # ...or...\n [{\\[] # the start of an object or array\n \\s* # some optional space\n $ # at the end of the line\n )",
@ -175,96 +170,70 @@ HjsonHighlightRules.metaData = {
name: "Hjson", name: "Hjson",
scopeName: "source.hjson" scopeName: "source.hjson"
}; };
oop.inherits(HjsonHighlightRules, TextHighlightRules); oop.inherits(HjsonHighlightRules, TextHighlightRules);
exports.HjsonHighlightRules = HjsonHighlightRules; exports.HjsonHighlightRules = HjsonHighlightRules;
}); });
define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../../lib/oop"); var oop = require("../../lib/oop");
var Range = require("../../range").Range; var Range = require("../../range").Range;
var BaseFoldMode = require("./fold_mode").FoldMode; var BaseFoldMode = require("./fold_mode").FoldMode;
var FoldMode = exports.FoldMode = function (commentRegex) {
var FoldMode = exports.FoldMode = function(commentRegex) {
if (commentRegex) { if (commentRegex) {
this.foldingStartMarker = new RegExp( this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
);
this.foldingStopMarker = new RegExp(
this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
);
} }
}; };
oop.inherits(FoldMode, BaseFoldMode); oop.inherits(FoldMode, BaseFoldMode);
(function () {
(function() {
this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/; this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/; this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
this._getFoldWidgetBase = this.getFoldWidget; this._getFoldWidgetBase = this.getFoldWidget;
this.getFoldWidget = function(session, foldStyle, row) { this.getFoldWidget = function (session, foldStyle, row) {
var line = session.getLine(row); var line = session.getLine(row);
if (this.singleLineBlockCommentRe.test(line)) { if (this.singleLineBlockCommentRe.test(line)) {
if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
return ""; return "";
} }
var fw = this._getFoldWidgetBase(session, foldStyle, row); var fw = this._getFoldWidgetBase(session, foldStyle, row);
if (!fw && this.startRegionRe.test(line)) if (!fw && this.startRegionRe.test(line))
return "start"; // lineCommentRegionStart return "start"; // lineCommentRegionStart
return fw; return fw;
}; };
this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
var line = session.getLine(row); var line = session.getLine(row);
if (this.startRegionRe.test(line)) if (this.startRegionRe.test(line))
return this.getCommentRegionBlock(session, line, row); return this.getCommentRegionBlock(session, line, row);
var match = line.match(this.foldingStartMarker); var match = line.match(this.foldingStartMarker);
if (match) { if (match) {
var i = match.index; var i = match.index;
if (match[1]) if (match[1])
return this.openingBracketBlock(session, match[1], row, i); return this.openingBracketBlock(session, match[1], row, i);
var range = session.getCommentFoldRange(row, i + match[0].length, 1); var range = session.getCommentFoldRange(row, i + match[0].length, 1);
if (range && !range.isMultiLine()) { if (range && !range.isMultiLine()) {
if (forceMultiline) { if (forceMultiline) {
range = this.getSectionRange(session, row); range = this.getSectionRange(session, row);
} else if (foldStyle != "all") }
else if (foldStyle != "all")
range = null; range = null;
} }
return range; return range;
} }
if (foldStyle === "markbegin") if (foldStyle === "markbegin")
return; return;
var match = line.match(this.foldingStopMarker); var match = line.match(this.foldingStopMarker);
if (match) { if (match) {
var i = match.index + match[0].length; var i = match.index + match[0].length;
if (match[1]) if (match[1])
return this.closingBracketBlock(session, match[1], row, i); return this.closingBracketBlock(session, match[1], row, i);
return session.getCommentFoldRange(row, i, -1); return session.getCommentFoldRange(row, i, -1);
} }
}; };
this.getSectionRange = function (session, row) {
this.getSectionRange = function(session, row) {
var line = session.getLine(row); var line = session.getLine(row);
var startIndent = line.search(/\S/); var startIndent = line.search(/\S/);
var startRow = row; var startRow = row;
@ -277,70 +246,73 @@ oop.inherits(FoldMode, BaseFoldMode);
var indent = line.search(/\S/); var indent = line.search(/\S/);
if (indent === -1) if (indent === -1)
continue; continue;
if (startIndent > indent) if (startIndent > indent)
break; break;
var subRange = this.getFoldWidgetRange(session, "all", row); var subRange = this.getFoldWidgetRange(session, "all", row);
if (subRange) { if (subRange) {
if (subRange.start.row <= startRow) { if (subRange.start.row <= startRow) {
break; break;
} else if (subRange.isMultiLine()) { }
else if (subRange.isMultiLine()) {
row = subRange.end.row; row = subRange.end.row;
} else if (startIndent == indent) { }
else if (startIndent == indent) {
break; break;
} }
} }
endRow = row; endRow = row;
} }
return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
}; };
this.getCommentRegionBlock = function(session, line, row) { this.getCommentRegionBlock = function (session, line, row) {
var startColumn = line.search(/\s*$/); var startColumn = line.search(/\s*$/);
var maxRow = session.getLength(); var maxRow = session.getLength();
var startRow = row; var startRow = row;
var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
var depth = 1; var depth = 1;
while (++row < maxRow) { while (++row < maxRow) {
line = session.getLine(row); line = session.getLine(row);
var m = re.exec(line); var m = re.exec(line);
if (!m) continue; if (!m)
if (m[1]) depth--; continue;
else depth++; if (m[1])
depth--;
if (!depth) break; else
depth++;
if (!depth)
break;
} }
var endRow = row; var endRow = row;
if (endRow > startRow) { if (endRow > startRow) {
return new Range(startRow, startColumn, endRow, line.length); return new Range(startRow, startColumn, endRow, line.length);
} }
}; };
}).call(FoldMode.prototype); }).call(FoldMode.prototype);
}); });
define("ace/mode/hjson",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/hjson_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) { define("ace/mode/hjson",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/hjson_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
"use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextMode = require("./text").Mode; var TextMode = require("./text").Mode;
var HjsonHighlightRules = require("./hjson_highlight_rules").HjsonHighlightRules; var HjsonHighlightRules = require("./hjson_highlight_rules").HjsonHighlightRules;
var FoldMode = require("./folding/cstyle").FoldMode; var FoldMode = require("./folding/cstyle").FoldMode;
var Mode = function () {
var Mode = function() {
this.HighlightRules = HjsonHighlightRules; this.HighlightRules = HjsonHighlightRules;
this.foldingRules = new FoldMode(); this.foldingRules = new FoldMode();
}; };
oop.inherits(Mode, TextMode); oop.inherits(Mode, TextMode);
(function () {
(function() {
this.lineCommentStart = "//"; this.lineCommentStart = "//";
this.blockComment = { start: "/*", end: "*/" }; this.blockComment = { start: "/*", end: "*/" };
this.$id = "ace/mode/hjson"; this.$id = "ace/mode/hjson";
}).call(Mode.prototype); }).call(Mode.prototype);
exports.Mode = Mode; exports.Mode = Mode;
});
}); (function() {
window.require(["ace/mode/hjson"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More