",
- lastLineNumber = i + 1
- );
-
- if (foldWidgets) {
- var c = foldWidgets[i];
- if (c == null)
- c = foldWidgets[i] = this.session.getFoldWidget(i);
- if (c)
- html.push(
- ""
- );
- }
-
- html.push("
");
-
- i++;
- }
-
- this.element = dom.setInnerHtml(this.element, html.join(""));
- this.element.style.height = config.minHeight + "px";
-
- if (this.session.$useWrapMode)
- lastLineNumber = this.session.getLength();
-
- var gutterWidth = ("" + lastLineNumber).length * config.characterWidth;
- var padding = this.$padding || this.$computePadding();
- gutterWidth += padding.left + padding.right;
- if (gutterWidth !== this.gutterWidth) {
- this.gutterWidth = gutterWidth;
- this.element.style.width = Math.ceil(this.gutterWidth) + "px";
- this._emit("changeGutterWidth", gutterWidth);
- }
- };
-
- this.$showFoldWidgets = true;
- this.setShowFoldWidgets = function(show) {
- if (show)
- dom.addCssClass(this.element, "ace_folding-enabled");
- else
- dom.removeCssClass(this.element, "ace_folding-enabled");
-
- this.$showFoldWidgets = show;
- this.$padding = null;
- };
-
- this.getShowFoldWidgets = function() {
- return this.$showFoldWidgets;
- };
-
- this.$computePadding = function() {
- if (!this.element.firstChild)
- return {left: 0, right: 0};
- var style = dom.computedStyle(this.element.firstChild);
- this.$padding = {}
- this.$padding.left = parseInt(style.paddingLeft) + 1;
- this.$padding.right = parseInt(style.paddingRight);
- return this.$padding;
- };
-
- this.getRegion = function(point) {
- var padding = this.$padding || this.$computePadding();
- var rect = this.element.getBoundingClientRect();
- if (point.x < padding.left + rect.left)
- return "markers";
- if (this.$showFoldWidgets && point.x > rect.right - padding.right)
- return "foldWidgets";
- };
-
-}).call(Gutter.prototype);
-
-exports.Gutter = Gutter;
-
-});
-
-define('ace/layer/marker', ['require', 'exports', 'module' , 'ace/range', 'ace/lib/dom'], function(require, exports, module) {
-
-
-var Range = require("../range").Range;
-var dom = require("../lib/dom");
-
-var Marker = function(parentEl) {
- this.element = dom.createElement("div");
- this.element.className = "ace_layer ace_marker-layer";
- parentEl.appendChild(this.element);
-};
-
-(function() {
-
- this.$padding = 0;
-
- this.setPadding = function(padding) {
- this.$padding = padding;
- };
- this.setSession = function(session) {
- this.session = session;
- };
-
- this.setMarkers = function(markers) {
- this.markers = markers;
- };
-
- this.update = function(config) {
- var config = config || this.config;
- if (!config)
- return;
-
- this.config = config;
-
-
- var html = [];
- for (var key in this.markers) {
- var marker = this.markers[key];
-
- if (!marker.range) {
- marker.update(html, this, this.session, config);
- continue;
- }
-
- var range = marker.range.clipRows(config.firstRow, config.lastRow);
- if (range.isEmpty()) continue;
-
- range = range.toScreenRange(this.session);
- if (marker.renderer) {
- var top = this.$getTop(range.start.row, config);
- var left = this.$padding + range.start.column * config.characterWidth;
- marker.renderer(html, range, left, top, config);
- } else if (marker.type == "fullLine") {
- this.drawFullLineMarker(html, range, marker.clazz, config);
- } else if (range.isMultiLine()) {
- if (marker.type == "text")
- this.drawTextMarker(html, range, marker.clazz, config);
- else
- this.drawMultiLineMarker(html, range, marker.clazz, config);
- } else {
- this.drawSingleLineMarker(html, range, marker.clazz + " ace_start", config);
- }
- }
- this.element = dom.setInnerHtml(this.element, html.join(""));
- };
-
- this.$getTop = function(row, layerConfig) {
- return (row - layerConfig.firstRowScreen) * layerConfig.lineHeight;
- };
- this.drawTextMarker = function(stringBuilder, range, clazz, layerConfig) {
- var row = range.start.row;
-
- var lineRange = new Range(
- row, range.start.column,
- row, this.session.getScreenLastRowColumn(row)
- );
- this.drawSingleLineMarker(stringBuilder, lineRange, clazz + " ace_start", layerConfig, 1, "text");
- row = range.end.row;
- lineRange = new Range(row, 0, row, range.end.column);
- this.drawSingleLineMarker(stringBuilder, lineRange, clazz, layerConfig, 0, "text");
-
- for (row = range.start.row + 1; row < range.end.row; row++) {
- lineRange.start.row = row;
- lineRange.end.row = row;
- lineRange.end.column = this.session.getScreenLastRowColumn(row);
- this.drawSingleLineMarker(stringBuilder, lineRange, clazz, layerConfig, 1, "text");
- }
- };
- this.drawMultiLineMarker = function(stringBuilder, range, clazz, config, type) {
- var padding = this.$padding;
- var height = config.lineHeight;
- var top = this.$getTop(range.start.row, config);
- var left = padding + range.start.column * config.characterWidth;
-
- stringBuilder.push(
- "")
-
- this.$renderLine(html, row, false, row == foldStart ? foldLine : false);
-
- if (this.$useLineGroups())
- html.push("
"); // end the line group
-
- row++;
- }
- this.element = dom.setInnerHtml(this.element, html.join(""));
- };
-
- this.$textToken = {
- "text": true,
- "rparen": true,
- "lparen": true
- };
-
- this.$renderToken = function(stringBuilder, screenColumn, token, value) {
- var self = this;
- var replaceReg = /\t|&|<|( +)|([\x00-\x1f\x80-\xa0\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\u3000\uFEFF])|[\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3000-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]/g;
- var replaceFunc = function(c, a, b, tabIdx, idx4) {
- if (a) {
- return self.showInvisibles ?
- ""
- );
- }
-
- split ++;
- screenColumn = 0;
- splitChars = splits[split] || Number.MAX_VALUE;
- }
- if (value.length != 0) {
- chars += value.length;
- screenColumn = this.$renderToken(
- stringBuilder, screenColumn, token, value
- );
- }
- }
- }
- };
-
- this.$renderSimpleLine = function(stringBuilder, tokens) {
- var screenColumn = 0;
- var token = tokens[0];
- var value = token.value;
- if (this.displayIndentGuides)
- value = this.renderIndentGuide(stringBuilder, value);
- if (value)
- screenColumn = this.$renderToken(stringBuilder, screenColumn, token, value);
- for (var i = 1; i < tokens.length; i++) {
- token = tokens[i];
- value = token.value;
- screenColumn = this.$renderToken(stringBuilder, screenColumn, token, value);
- }
- };
- this.$renderLine = function(stringBuilder, row, onlyContents, foldLine) {
- if (!foldLine && foldLine != false)
- foldLine = this.session.getFoldLine(row);
-
- if (foldLine)
- var tokens = this.$getFoldLineTokens(row, foldLine);
- else
- var tokens = this.session.getTokens(row);
-
-
- if (!onlyContents) {
- stringBuilder.push(
- "
"
- );
- }
-
- if (tokens.length) {
- var splits = this.session.getRowSplitData(row);
- if (splits && splits.length)
- this.$renderWrappedLine(stringBuilder, tokens, splits, onlyContents);
- else
- this.$renderSimpleLine(stringBuilder, tokens);
- }
-
- if (this.showInvisibles) {
- if (foldLine)
- row = foldLine.end.row
-
- stringBuilder.push(
- "",
- row == this.session.getLength() - 1 ? this.EOF_CHAR : this.EOL_CHAR,
- ""
- );
- }
- if (!onlyContents)
- stringBuilder.push("
");
- };
-
- this.$getFoldLineTokens = function(row, foldLine) {
- var session = this.session;
- var renderTokens = [];
-
- function addTokens(tokens, from, to) {
- var idx = 0, col = 0;
- while ((col + tokens[idx].value.length) < from) {
- col += tokens[idx].value.length;
- idx++;
-
- if (idx == tokens.length)
- return;
- }
- if (col != from) {
- var value = tokens[idx].value.substring(from - col);
- if (value.length > (to - from))
- value = value.substring(0, to - from);
-
- renderTokens.push({
- type: tokens[idx].type,
- value: value
- });
-
- col = from + value.length;
- idx += 1;
- }
-
- while (col < to && idx < tokens.length) {
- var value = tokens[idx].value;
- if (value.length + col > to) {
- renderTokens.push({
- type: tokens[idx].type,
- value: value.substring(0, to - col)
- });
- } else
- renderTokens.push(tokens[idx]);
- col += value.length;
- idx += 1;
- }
- }
-
- var tokens = session.getTokens(row);
- foldLine.walk(function(placeholder, row, column, lastColumn, isNewRow) {
- if (placeholder != null) {
- renderTokens.push({
- type: "fold",
- value: placeholder
- });
- } else {
- if (isNewRow)
- tokens = session.getTokens(row);
-
- if (tokens.length)
- addTokens(tokens, lastColumn, column);
- }
- }, foldLine.end.row, this.session.getLine(foldLine.end.row).length);
-
- return renderTokens;
- };
-
- this.$useLineGroups = function() {
- return this.session.getUseWrapMode();
- };
-
- this.destroy = function() {
- clearInterval(this.$pollSizeChangesTimer);
- if (this.$measureNode)
- this.$measureNode.parentNode.removeChild(this.$measureNode);
- delete this.$measureNode;
- };
-
-}).call(Text.prototype);
-
-exports.Text = Text;
-
-});
-
-define('ace/layer/cursor', ['require', 'exports', 'module' , 'ace/lib/dom'], function(require, exports, module) {
-
-
-var dom = require("../lib/dom");
-
-var Cursor = function(parentEl) {
- this.element = dom.createElement("div");
- this.element.className = "ace_layer ace_cursor-layer";
- parentEl.appendChild(this.element);
-
- this.isVisible = false;
- this.isBlinking = true;
- this.blinkInterval = 1000;
- this.smoothBlinking = false;
-
- this.cursors = [];
- this.cursor = this.addCursor();
- dom.addCssClass(this.element, "ace_hidden-cursors");
-};
-
-(function() {
-
- this.$padding = 0;
- this.setPadding = function(padding) {
- this.$padding = padding;
- };
-
- this.setSession = function(session) {
- this.session = session;
- };
-
- this.setBlinking = function(blinking) {
- if (blinking != this.isBlinking){
- this.isBlinking = blinking;
- this.restartTimer();
- }
- };
-
- this.setBlinkInterval = function(blinkInterval) {
- if (blinkInterval != this.blinkInterval){
- this.blinkInterval = blinkInterval;
- this.restartTimer();
- }
- };
-
- this.setSmoothBlinking = function(smoothBlinking) {
- if (smoothBlinking != this.smoothBlinking) {
- this.smoothBlinking = smoothBlinking;
- if (smoothBlinking)
- dom.addCssClass(this.element, "ace_smooth-blinking");
- else
- dom.removeCssClass(this.element, "ace_smooth-blinking");
- this.restartTimer();
- }
- };
-
- this.addCursor = function() {
- var el = dom.createElement("div");
- el.className = "ace_cursor";
- this.element.appendChild(el);
- this.cursors.push(el);
- return el;
- };
-
- this.removeCursor = function() {
- if (this.cursors.length > 1) {
- var el = this.cursors.pop();
- el.parentNode.removeChild(el);
- return el;
- }
- };
-
- this.hideCursor = function() {
- this.isVisible = false;
- dom.addCssClass(this.element, "ace_hidden-cursors");
- this.restartTimer();
- };
-
- this.showCursor = function() {
- this.isVisible = true;
- dom.removeCssClass(this.element, "ace_hidden-cursors");
- this.restartTimer();
- };
-
- this.restartTimer = function() {
- clearInterval(this.intervalId);
- clearTimeout(this.timeoutId);
- if (this.smoothBlinking)
- dom.removeCssClass(this.element, "ace_smooth-blinking");
- for (var i = this.cursors.length; i--; )
- this.cursors[i].style.opacity = "";
-
- if (!this.isBlinking || !this.blinkInterval || !this.isVisible)
- return;
-
- if (this.smoothBlinking)
- setTimeout(function(){
- dom.addCssClass(this.element, "ace_smooth-blinking");
- }.bind(this));
-
- var blink = function(){
- this.timeoutId = setTimeout(function() {
- for (var i = this.cursors.length; i--; ) {
- this.cursors[i].style.opacity = 0;
- }
- }.bind(this), 0.6 * this.blinkInterval);
- }.bind(this);
-
- this.intervalId = setInterval(function() {
- for (var i = this.cursors.length; i--; ) {
- this.cursors[i].style.opacity = "";
- }
- blink();
- }.bind(this), this.blinkInterval);
-
- blink();
- };
-
- this.getPixelPosition = function(position, onScreen) {
- if (!this.config || !this.session)
- return {left : 0, top : 0};
-
- if (!position)
- position = this.session.selection.getCursor();
- var pos = this.session.documentToScreenPosition(position);
- var cursorLeft = this.$padding + pos.column * this.config.characterWidth;
- var cursorTop = (pos.row - (onScreen ? this.config.firstRowScreen : 0)) *
- this.config.lineHeight;
-
- return {left : cursorLeft, top : cursorTop};
- };
-
- this.update = function(config) {
- this.config = config;
-
- var selections = this.session.$selectionMarkers;
- var i = 0, cursorIndex = 0;
-
- if (selections === undefined || selections.length === 0){
- selections = [{cursor: null}];
- }
-
- for (var i = selections.length; i--; ) {
- var pixelPos = this.getPixelPosition(selections[i].cursor, true);
- if ((pixelPos.top > config.height + config.offset ||
- pixelPos.top < -config.offset) && i > 1) {
- continue;
- }
-
- var style = (this.cursors[cursorIndex++] || this.addCursor()).style;
-
- style.left = pixelPos.left + "px";
- style.top = pixelPos.top + "px";
- style.width = config.characterWidth + "px";
- style.height = config.lineHeight + "px";
- }
- while (this.cursors.length > cursorIndex)
- this.removeCursor();
-
- var overwrite = this.session.getOverwrite();
- this.$setOverwrite(overwrite);
- this.$pixelPos = pixelPos;
- this.restartTimer();
- };
-
- this.$setOverwrite = function(overwrite) {
- if (overwrite != this.overwrite) {
- this.overwrite = overwrite;
- if (overwrite)
- dom.addCssClass(this.element, "ace_overwrite-cursors");
- else
- dom.removeCssClass(this.element, "ace_overwrite-cursors");
- }
- };
-
- this.destroy = function() {
- clearInterval(this.intervalId);
- clearTimeout(this.timeoutId);
- };
-
-}).call(Cursor.prototype);
-
-exports.Cursor = Cursor;
-
-});
-
-define('ace/scrollbar', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/dom', 'ace/lib/event', 'ace/lib/event_emitter'], function(require, exports, module) {
-
-
-var oop = require("./lib/oop");
-var dom = require("./lib/dom");
-var event = require("./lib/event");
-var EventEmitter = require("./lib/event_emitter").EventEmitter;
-var ScrollBar = function(parent) {
- this.element = dom.createElement("div");
- this.element.className = "ace_scrollbar";
-
- this.inner = dom.createElement("div");
- this.inner.className = "ace_scrollbar-inner";
- this.element.appendChild(this.inner);
-
- parent.appendChild(this.element);
- this.width = dom.scrollbarWidth(parent.ownerDocument);
- this.element.style.width = (this.width || 15) + 5 + "px";
-
- event.addListener(this.element, "scroll", this.onScroll.bind(this));
-};
-
-(function() {
- oop.implement(this, EventEmitter);
- this.onScroll = function() {
- if (!this.skipEvent) {
- this.scrollTop = this.element.scrollTop;
- this._emit("scroll", {data: this.scrollTop});
- }
- this.skipEvent = false;
- };
- this.getWidth = function() {
- return this.width;
- };
- this.setHeight = function(height) {
- this.element.style.height = height + "px";
- };
- this.setInnerHeight = function(height) {
- this.inner.style.height = height + "px";
- };
- this.setScrollTop = function(scrollTop) {
- if (this.scrollTop != scrollTop) {
- this.skipEvent = true;
- this.scrollTop = this.element.scrollTop = scrollTop;
- }
- };
-
-}).call(ScrollBar.prototype);
-
-exports.ScrollBar = ScrollBar;
-});
-
-define('ace/renderloop', ['require', 'exports', 'module' , 'ace/lib/event'], function(require, exports, module) {
-
-
-var event = require("./lib/event");
-
-
-var RenderLoop = function(onRender, win) {
- this.onRender = onRender;
- this.pending = false;
- this.changes = 0;
- this.window = win || window;
-};
-
-(function() {
-
-
- this.schedule = function(change) {
- this.changes = this.changes | change;
- if (!this.pending) {
- this.pending = true;
- var _self = this;
- event.nextFrame(function() {
- _self.pending = false;
- var changes;
- while (changes = _self.changes) {
- _self.changes = 0;
- _self.onRender(changes);
- }
- }, this.window);
- }
- };
-
-}).call(RenderLoop.prototype);
-
-exports.RenderLoop = RenderLoop;
-});
-
-define('ace/multi_select', ['require', 'exports', 'module' , 'ace/range_list', 'ace/range', 'ace/selection', 'ace/mouse/multi_select_handler', 'ace/lib/event', 'ace/lib/lang', 'ace/commands/multi_select_commands', 'ace/search', 'ace/edit_session', 'ace/editor'], function(require, exports, module) {
-
-var RangeList = require("./range_list").RangeList;
-var Range = require("./range").Range;
-var Selection = require("./selection").Selection;
-var onMouseDown = require("./mouse/multi_select_handler").onMouseDown;
-var event = require("./lib/event");
-var lang = require("./lib/lang");
-var commands = require("./commands/multi_select_commands");
-exports.commands = commands.defaultCommands.concat(commands.multiSelectCommands);
-var Search = require("./search").Search;
-var search = new Search();
-
-function find(session, needle, dir) {
- search.$options.wrap = true;
- search.$options.needle = needle;
- search.$options.backwards = dir == -1;
- return search.find(session);
-}
-var EditSession = require("./edit_session").EditSession;
-(function() {
- this.getSelectionMarkers = function() {
- return this.$selectionMarkers;
- };
-}).call(EditSession.prototype);
-(function() {
- this.ranges = null;
- this.rangeList = null;
- this.addRange = function(range, $blockChangeEvents) {
- if (!range)
- return;
-
- if (!this.inMultiSelectMode && this.rangeCount == 0) {
- var oldRange = this.toOrientedRange();
- if (range.intersects(oldRange))
- return $blockChangeEvents || this.fromOrientedRange(range);
-
- this.rangeList.add(oldRange);
- this.$onAddRange(oldRange);
- }
-
- if (!range.cursor)
- range.cursor = range.end;
-
- var removed = this.rangeList.add(range);
-
- this.$onAddRange(range);
-
- if (removed.length)
- this.$onRemoveRange(removed);
-
- if (this.rangeCount > 1 && !this.inMultiSelectMode) {
- this._emit("multiSelect");
- this.inMultiSelectMode = true;
- this.session.$undoSelect = false;
- this.rangeList.attach(this.session);
- }
-
- return $blockChangeEvents || this.fromOrientedRange(range);
- };
-
- this.toSingleRange = function(range) {
- range = range || this.ranges[0];
- var removed = this.rangeList.removeAll();
- if (removed.length)
- this.$onRemoveRange(removed);
-
- range && this.fromOrientedRange(range);
- };
- this.substractPoint = function(pos) {
- var removed = this.rangeList.substractPoint(pos);
- if (removed) {
- this.$onRemoveRange(removed);
- return removed[0];
- }
- };
- this.mergeOverlappingRanges = function() {
- var removed = this.rangeList.merge();
- if (removed.length)
- this.$onRemoveRange(removed);
- else if(this.ranges[0])
- this.fromOrientedRange(this.ranges[0]);
- };
-
- this.$onAddRange = function(range) {
- this.rangeCount = this.rangeList.ranges.length;
- this.ranges.unshift(range);
- this._emit("addRange", {range: range});
- };
-
- this.$onRemoveRange = function(removed) {
- this.rangeCount = this.rangeList.ranges.length;
- if (this.rangeCount == 1 && this.inMultiSelectMode) {
- var lastRange = this.rangeList.ranges.pop();
- removed.push(lastRange);
- this.rangeCount = 0;
- }
-
- for (var i = removed.length; i--; ) {
- var index = this.ranges.indexOf(removed[i]);
- this.ranges.splice(index, 1);
- }
-
- this._emit("removeRange", {ranges: removed});
-
- if (this.rangeCount == 0 && this.inMultiSelectMode) {
- this.inMultiSelectMode = false;
- this._emit("singleSelect");
- this.session.$undoSelect = true;
- this.rangeList.detach(this.session);
- }
-
- lastRange = lastRange || this.ranges[0];
- if (lastRange && !lastRange.isEqual(this.getRange()))
- this.fromOrientedRange(lastRange);
- };
- this.$initRangeList = function() {
- if (this.rangeList)
- return;
-
- this.rangeList = new RangeList();
- this.ranges = [];
- this.rangeCount = 0;
- };
- this.getAllRanges = function() {
- return this.rangeList.ranges.concat();
- };
-
- this.splitIntoLines = function () {
- if (this.rangeCount > 1) {
- var ranges = this.rangeList.ranges;
- var lastRange = ranges[ranges.length - 1];
- var range = Range.fromPoints(ranges[0].start, lastRange.end);
-
- this.toSingleRange();
- this.setSelectionRange(range, lastRange.cursor == lastRange.start);
- } else {
- var range = this.getRange();
- var isBackwards = this.isBackwards();
- var startRow = range.start.row;
- var endRow = range.end.row;
- if (startRow == endRow) {
- if (isBackwards)
- var start = range.end, end = range.start;
- else
- var start = range.start, end = range.end;
-
- this.addRange(Range.fromPoints(end, end));
- this.addRange(Range.fromPoints(start, start));
- return;
- }
-
- var rectSel = [];
- var r = this.getLineRange(startRow, true);
- r.start.column = range.start.column;
- rectSel.push(r);
-
- for (var i = startRow + 1; i < endRow; i++)
- rectSel.push(this.getLineRange(i, true));
-
- r = this.getLineRange(endRow, true);
- r.end.column = range.end.column;
- rectSel.push(r);
-
- rectSel.forEach(this.addRange, this);
- }
- };
- this.toggleBlockSelection = function () {
- if (this.rangeCount > 1) {
- var ranges = this.rangeList.ranges;
- var lastRange = ranges[ranges.length - 1];
- var range = Range.fromPoints(ranges[0].start, lastRange.end);
-
- this.toSingleRange();
- this.setSelectionRange(range, lastRange.cursor == lastRange.start);
- } else {
- var cursor = this.session.documentToScreenPosition(this.selectionLead);
- var anchor = this.session.documentToScreenPosition(this.selectionAnchor);
-
- var rectSel = this.rectangularRangeBlock(cursor, anchor);
- rectSel.forEach(this.addRange, this);
- }
- };
- this.rectangularRangeBlock = function(screenCursor, screenAnchor, includeEmptyLines) {
- var rectSel = [];
-
- var xBackwards = screenCursor.column < screenAnchor.column;
- if (xBackwards) {
- var startColumn = screenCursor.column;
- var endColumn = screenAnchor.column;
- } else {
- var startColumn = screenAnchor.column;
- var endColumn = screenCursor.column;
- }
-
- var yBackwards = screenCursor.row < screenAnchor.row;
- if (yBackwards) {
- var startRow = screenCursor.row;
- var endRow = screenAnchor.row;
- } else {
- var startRow = screenAnchor.row;
- var endRow = screenCursor.row;
- }
-
- if (startColumn < 0)
- startColumn = 0;
- if (startRow < 0)
- startRow = 0;
-
- if (startRow == endRow)
- includeEmptyLines = true;
-
- for (var row = startRow; row <= endRow; row++) {
- var range = Range.fromPoints(
- this.session.screenToDocumentPosition(row, startColumn),
- this.session.screenToDocumentPosition(row, endColumn)
- );
- if (range.isEmpty()) {
- if (docEnd && isSamePoint(range.end, docEnd))
- break;
- var docEnd = range.end;
- }
- range.cursor = xBackwards ? range.start : range.end;
- rectSel.push(range);
- }
-
- if (yBackwards)
- rectSel.reverse();
-
- if (!includeEmptyLines) {
- var end = rectSel.length - 1;
- while (rectSel[end].isEmpty() && end > 0)
- end--;
- if (end > 0) {
- var start = 0;
- while (rectSel[start].isEmpty())
- start++;
- }
- for (var i = end; i >= start; i--) {
- if (rectSel[i].isEmpty())
- rectSel.splice(i, 1);
- }
- }
-
- return rectSel;
- };
-}).call(Selection.prototype);
-var Editor = require("./editor").Editor;
-(function() {
- this.updateSelectionMarkers = function() {
- this.renderer.updateCursor();
- this.renderer.updateBackMarkers();
- };
- this.addSelectionMarker = function(orientedRange) {
- if (!orientedRange.cursor)
- orientedRange.cursor = orientedRange.end;
-
- var style = this.getSelectionStyle();
- orientedRange.marker = this.session.addMarker(orientedRange, "ace_selection", style);
-
- this.session.$selectionMarkers.push(orientedRange);
- this.session.selectionMarkerCount = this.session.$selectionMarkers.length;
- return orientedRange;
- };
- this.removeSelectionMarker = function(range) {
- if (!range.marker)
- return;
- this.session.removeMarker(range.marker);
- var index = this.session.$selectionMarkers.indexOf(range);
- if (index != -1)
- this.session.$selectionMarkers.splice(index, 1);
- this.session.selectionMarkerCount = this.session.$selectionMarkers.length;
- };
-
- this.removeSelectionMarkers = function(ranges) {
- var markerList = this.session.$selectionMarkers;
- for (var i = ranges.length; i--; ) {
- var range = ranges[i];
- if (!range.marker)
- continue;
- this.session.removeMarker(range.marker);
- var index = markerList.indexOf(range);
- if (index != -1)
- markerList.splice(index, 1);
- }
- this.session.selectionMarkerCount = markerList.length;
- };
-
- this.$onAddRange = function(e) {
- this.addSelectionMarker(e.range);
- this.renderer.updateCursor();
- this.renderer.updateBackMarkers();
- };
-
- this.$onRemoveRange = function(e) {
- this.removeSelectionMarkers(e.ranges);
- this.renderer.updateCursor();
- this.renderer.updateBackMarkers();
- };
-
- this.$onMultiSelect = function(e) {
- if (this.inMultiSelectMode)
- return;
- this.inMultiSelectMode = true;
-
- this.setStyle("ace_multiselect");
- this.keyBinding.addKeyboardHandler(commands.keyboardHandler);
- this.commands.on("exec", this.$onMultiSelectExec);
-
- this.renderer.updateCursor();
- this.renderer.updateBackMarkers();
- };
-
- this.$onSingleSelect = function(e) {
- if (this.session.multiSelect.inVirtualMode)
- return;
- this.inMultiSelectMode = false;
-
- this.unsetStyle("ace_multiselect");
- this.keyBinding.removeKeyboardHandler(commands.keyboardHandler);
-
- this.commands.removeEventListener("exec", this.$onMultiSelectExec);
- this.renderer.updateCursor();
- this.renderer.updateBackMarkers();
- };
-
- this.$onMultiSelectExec = function(e) {
- var command = e.command;
- var editor = e.editor;
- if (!editor.multiSelect)
- return;
- if (!command.multiSelectAction) {
- command.exec(editor, e.args || {});
- editor.multiSelect.addRange(editor.multiSelect.toOrientedRange());
- editor.multiSelect.mergeOverlappingRanges();
- } else if (command.multiSelectAction == "forEach") {
- editor.forEachSelection(command, e.args);
- } else if (command.multiSelectAction == "single") {
- editor.exitMultiSelectMode();
- command.exec(editor, e.args || {});
- } else {
- command.multiSelectAction(editor, e.args || {});
- }
- e.preventDefault();
- };
- this.forEachSelection = function(cmd, args) {
- if (this.inVirtualSelectionMode)
- return;
-
- var session = this.session;
- var selection = this.selection;
- var rangeList = selection.rangeList;
-
- var reg = selection._eventRegistry;
- selection._eventRegistry = {};
-
- var tmpSel = new Selection(session);
- this.inVirtualSelectionMode = true;
- for (var i = rangeList.ranges.length; i--;) {
- tmpSel.fromOrientedRange(rangeList.ranges[i]);
- this.selection = session.selection = tmpSel;
- cmd.exec(this, args || {});
- tmpSel.toOrientedRange(rangeList.ranges[i]);
- }
- tmpSel.detach();
-
- this.selection = session.selection = selection;
- this.inVirtualSelectionMode = false;
- selection._eventRegistry = reg;
- selection.mergeOverlappingRanges();
-
- this.onCursorChange();
- this.onSelectionChange();
- };
- this.exitMultiSelectMode = function() {
- if (this.inVirtualSelectionMode)
- return;
- this.multiSelect.toSingleRange();
- };
-
- this.getCopyText = function() {
- var text = "";
- if (this.inMultiSelectMode) {
- var ranges = this.multiSelect.rangeList.ranges;
- text = [];
- for (var i = 0; i < ranges.length; i++) {
- text.push(this.session.getTextRange(ranges[i]));
- }
- text = text.join(this.session.getDocument().getNewLineCharacter());
- } else if (!this.selection.isEmpty()) {
- text = this.session.getTextRange(this.getSelectionRange());
- }
-
- return text;
- };
- this.onPaste = function(text) {
- if (this.$readOnly)
- return;
-
- this._emit("paste", text);
- if (!this.inMultiSelectMode)
- return this.insert(text);
-
- var lines = text.split(/\r\n|\r|\n/);
- var ranges = this.selection.rangeList.ranges;
-
- if (lines.length > ranges.length || (lines.length <= 2 || !lines[1]))
- return this.commands.exec("insertstring", this, text);
-
- for (var i = ranges.length; i--; ) {
- var range = ranges[i];
- if (!range.isEmpty())
- this.session.remove(range);
-
- this.session.insert(range.start, lines[i]);
- }
- };
- this.findAll = function(needle, options, additive) {
- options = options || {};
- options.needle = needle || options.needle;
- this.$search.set(options);
-
- var ranges = this.$search.findAll(this.session);
- if (!ranges.length)
- return 0;
-
- this.$blockScrolling += 1;
- var selection = this.multiSelect;
-
- if (!additive)
- selection.toSingleRange(ranges[0]);
-
- for (var i = ranges.length; i--; )
- selection.addRange(ranges[i], true);
-
- this.$blockScrolling -= 1;
-
- return ranges.length;
- };
- this.selectMoreLines = function(dir, skip) {
- var range = this.selection.toOrientedRange();
- var isBackwards = range.cursor == range.end;
-
- var screenLead = this.session.documentToScreenPosition(range.cursor);
- if (this.selection.$desiredColumn)
- screenLead.column = this.selection.$desiredColumn;
-
- var lead = this.session.screenToDocumentPosition(screenLead.row + dir, screenLead.column);
-
- if (!range.isEmpty()) {
- var screenAnchor = this.session.documentToScreenPosition(isBackwards ? range.end : range.start);
- var anchor = this.session.screenToDocumentPosition(screenAnchor.row + dir, screenAnchor.column);
- } else {
- var anchor = lead;
- }
-
- if (isBackwards) {
- var newRange = Range.fromPoints(lead, anchor);
- newRange.cursor = newRange.start;
- } else {
- var newRange = Range.fromPoints(anchor, lead);
- newRange.cursor = newRange.end;
- }
-
- newRange.desiredColumn = screenLead.column;
- if (!this.selection.inMultiSelectMode) {
- this.selection.addRange(range);
- } else {
- if (skip)
- var toRemove = range.cursor;
- }
-
- this.selection.addRange(newRange);
- if (toRemove)
- this.selection.substractPoint(toRemove);
- };
- this.transposeSelections = function(dir) {
- var session = this.session;
- var sel = session.multiSelect;
- var all = sel.ranges;
-
- for (var i = all.length; i--; ) {
- var range = all[i];
- if (range.isEmpty()) {
- var tmp = session.getWordRange(range.start.row, range.start.column);
- range.start.row = tmp.start.row;
- range.start.column = tmp.start.column;
- range.end.row = tmp.end.row;
- range.end.column = tmp.end.column;
- }
- }
- sel.mergeOverlappingRanges();
-
- var words = [];
- for (var i = all.length; i--; ) {
- var range = all[i];
- words.unshift(session.getTextRange(range));
- }
-
- if (dir < 0)
- words.unshift(words.pop());
- else
- words.push(words.shift());
-
- for (var i = all.length; i--; ) {
- var range = all[i];
- var tmp = range.clone();
- session.replace(range, words[i]);
- range.start.row = tmp.start.row;
- range.start.column = tmp.start.column;
- }
- };
- this.selectMore = function(dir, skip) {
- var session = this.session;
- var sel = session.multiSelect;
-
- var range = sel.toOrientedRange();
- if (range.isEmpty()) {
- var range = session.getWordRange(range.start.row, range.start.column);
- range.cursor = range.end;
- this.multiSelect.addRange(range);
- }
- var needle = session.getTextRange(range);
-
- var newRange = find(session, needle, dir);
- if (newRange) {
- newRange.cursor = dir == -1 ? newRange.start : newRange.end;
- this.multiSelect.addRange(newRange);
- }
- if (skip)
- this.multiSelect.substractPoint(range.cursor);
- };
- this.alignCursors = function() {
- var session = this.session;
- var sel = session.multiSelect;
- var ranges = sel.ranges;
-
- if (!ranges.length) {
- var range = this.selection.getRange();
- var fr = range.start.row, lr = range.end.row;
- var lines = this.session.doc.removeLines(fr, lr);
- lines = this.$reAlignText(lines);
- this.session.doc.insertLines(fr, lines);
- range.start.column = 0;
- range.end.column = lines[lines.length - 1].length;
- this.selection.setRange(range);
- } else {
- var row = -1;
- var sameRowRanges = ranges.filter(function(r) {
- if (r.cursor.row == row)
- return true;
- row = r.cursor.row;
- });
- sel.$onRemoveRange(sameRowRanges);
-
- var maxCol = 0;
- var minSpace = Infinity;
- var spaceOffsets = ranges.map(function(r) {
- var p = r.cursor;
- var line = session.getLine(p.row);
- var spaceOffset = line.substr(p.column).search(/\S/g);
- if (spaceOffset == -1)
- spaceOffset = 0;
-
- if (p.column > maxCol)
- maxCol = p.column;
- if (spaceOffset < minSpace)
- minSpace = spaceOffset;
- return spaceOffset;
- });
- ranges.forEach(function(r, i) {
- var p = r.cursor;
- var l = maxCol - p.column;
- var d = spaceOffsets[i] - minSpace;
- if (l > d)
- session.insert(p, lang.stringRepeat(" ", l - d));
- else
- session.remove(new Range(p.row, p.column, p.row, p.column - l + d));
-
- r.start.column = r.end.column = maxCol;
- r.start.row = r.end.row = p.row;
- r.cursor = r.end;
- });
- sel.fromOrientedRange(ranges[0]);
- this.renderer.updateCursor();
- this.renderer.updateBackMarkers();
- }
- };
-
- this.$reAlignText = function(lines) {
- var isLeftAligned = true, isRightAligned = true;
- var startW, textW, endW;
-
- return lines.map(function(line) {
- var m = line.match(/(\s*)(.*?)(\s*)([=:].*)/);
- if (!m)
- return [line];
-
- if (startW == null) {
- startW = m[1].length;
- textW = m[2].length;
- endW = m[3].length;
- return m;
- }
-
- if (startW + textW + endW != m[1].length + m[2].length + m[3].length)
- isRightAligned = false;
- if (startW != m[1].length)
- isLeftAligned = false;
-
- if (startW > m[1].length)
- startW = m[1].length;
- if (textW < m[2].length)
- textW = m[2].length;
- if (endW > m[3].length)
- endW = m[3].length;
-
- return m;
- }).map(isLeftAligned ? isRightAligned ? alignRight : alignLeft : unAlign);
-
- function spaces(n) {
- return lang.stringRepeat(" ", n);
- }
-
- function alignLeft(m) {
- return !m[2] ? m[0] : spaces(startW) + m[2]
- + spaces(textW - m[2].length + endW)
- + m[4].replace(/^([=:])\s+/, "$1 ")
- }
- function alignRight(m) {
- return !m[2] ? m[0] : spaces(startW + textW - m[2].length) + m[2]
- + spaces(endW, " ")
- + m[4].replace(/^([=:])\s+/, "$1 ")
- }
- function unAlign(m) {
- return !m[2] ? m[0] : spaces(startW) + m[2]
- + spaces(endW)
- + m[4].replace(/^([=:])\s+/, "$1 ")
- }
- }
-}).call(Editor.prototype);
-
-
-function isSamePoint(p1, p2) {
- return p1.row == p2.row && p1.column == p2.column;
-}
-exports.onSessionChange = function(e) {
- var session = e.session;
- if (!session.multiSelect) {
- session.$selectionMarkers = [];
- session.selection.$initRangeList();
- session.multiSelect = session.selection;
- }
- this.multiSelect = session.multiSelect;
-
- var oldSession = e.oldSession;
- if (oldSession) {
- if (oldSession.multiSelect && oldSession.multiSelect.editor == this)
- oldSession.multiSelect.editor = null;
-
- session.multiSelect.removeEventListener("addRange", this.$onAddRange);
- session.multiSelect.removeEventListener("removeRange", this.$onRemoveRange);
- session.multiSelect.removeEventListener("multiSelect", this.$onMultiSelect);
- session.multiSelect.removeEventListener("singleSelect", this.$onSingleSelect);
- }
-
- session.multiSelect.on("addRange", this.$onAddRange);
- session.multiSelect.on("removeRange", this.$onRemoveRange);
- session.multiSelect.on("multiSelect", this.$onMultiSelect);
- session.multiSelect.on("singleSelect", this.$onSingleSelect);
-
- if (this.inMultiSelectMode != session.selection.inMultiSelectMode) {
- if (session.selection.inMultiSelectMode)
- this.$onMultiSelect();
- else
- this.$onSingleSelect();
- }
-};
-function MultiSelect(editor) {
- editor.$onAddRange = editor.$onAddRange.bind(editor);
- editor.$onRemoveRange = editor.$onRemoveRange.bind(editor);
- editor.$onMultiSelect = editor.$onMultiSelect.bind(editor);
- editor.$onSingleSelect = editor.$onSingleSelect.bind(editor);
-
- exports.onSessionChange.call(editor, editor);
- editor.on("changeSession", exports.onSessionChange.bind(editor));
-
- editor.on("mousedown", onMouseDown);
- editor.commands.addCommands(commands.defaultCommands);
-
- addAltCursorListeners(editor);
-}
-
-function addAltCursorListeners(editor){
- var el = editor.textInput.getElement();
- var altCursor = false;
- var contentEl = editor.renderer.content;
- event.addListener(el, "keydown", function(e) {
- if (e.keyCode == 18 && !(e.ctrlKey || e.shiftKey || e.metaKey)) {
- if (!altCursor) {
- contentEl.style.cursor = "crosshair";
- altCursor = true;
- }
- } else if (altCursor) {
- contentEl.style.cursor = "";
- }
- });
-
- event.addListener(el, "keyup", reset);
- event.addListener(el, "blur", reset);
- function reset() {
- if (altCursor) {
- contentEl.style.cursor = "";
- altCursor = false;
- }
- }
-}
-
-exports.MultiSelect = MultiSelect;
-
-});
-
-define('ace/range_list', ['require', 'exports', 'module' ], function(require, exports, module) {
-
-
-
-var RangeList = function() {
- this.ranges = [];
-};
-
-(function() {
- this.comparePoints = function(p1, p2) {
- return p1.row - p2.row || p1.column - p2.column;
- };
-
- this.pointIndex = function(pos, startIndex) {
- var list = this.ranges;
-
- for (var i = startIndex || 0; i < list.length; i++) {
- var range = list[i];
- var cmp = this.comparePoints(pos, range.end);
-
- if (cmp > 0)
- continue;
- if (cmp == 0)
- return i;
- cmp = this.comparePoints(pos, range.start);
- if (cmp >= 0)
- return i;
-
- return -i-1;
- }
- return -i - 1;
- };
-
- this.add = function(range) {
- var startIndex = this.pointIndex(range.start);
- if (startIndex < 0)
- startIndex = -startIndex - 1;
-
- var endIndex = this.pointIndex(range.end, startIndex);
-
- if (endIndex < 0)
- endIndex = -endIndex - 1;
- else
- endIndex++;
-
- return this.ranges.splice(startIndex, endIndex - startIndex, range);
- };
-
- this.addList = function(list) {
- var removed = [];
- for (var i = list.length; i--; ) {
- removed.push.call(removed, this.add(list[i]));
- }
- return removed;
- };
-
- this.substractPoint = function(pos) {
- var i = this.pointIndex(pos);
-
- if (i >= 0)
- return this.ranges.splice(i, 1);
- };
- this.merge = function() {
- var removed = [];
- var list = this.ranges;
- var next = list[0], range;
- for (var i = 1; i < list.length; i++) {
- range = next;
- next = list[i];
- var cmp = this.comparePoints(range.end, next.start);
- if (cmp < 0)
- continue;
-
- if (cmp == 0 && !(range.isEmpty() || next.isEmpty()))
- continue;
-
- if (this.comparePoints(range.end, next.end) < 0) {
- range.end.row = next.end.row;
- range.end.column = next.end.column;
- }
-
- list.splice(i, 1);
- removed.push(next);
- next = range;
- i--;
- }
-
- return removed;
- };
-
- this.contains = function(row, column) {
- return this.pointIndex({row: row, column: column}) >= 0;
- };
-
- this.containsPoint = function(pos) {
- return this.pointIndex(pos) >= 0;
- };
-
- this.rangeAtPoint = function(pos) {
- var i = this.pointIndex(pos);
- if (i >= 0)
- return this.ranges[i];
- };
-
-
- this.clipRows = function(startRow, endRow) {
- var list = this.ranges;
- if (list[0].start.row > endRow || list[list.length - 1].start.row < startRow)
- return [];
-
- var startIndex = this.pointIndex({row: startRow, column: 0});
- if (startIndex < 0)
- startIndex = -startIndex - 1;
- var endIndex = this.pointIndex({row: endRow, column: 0}, startIndex);
- if (endIndex < 0)
- endIndex = -endIndex - 1;
-
- var clipped = [];
- for (var i = startIndex; i < endIndex; i++) {
- clipped.push(list[i]);
- }
- return clipped;
- };
-
- this.removeAll = function() {
- return this.ranges.splice(0, this.ranges.length);
- };
-
- this.attach = function(session) {
- if (this.session)
- this.detach();
-
- this.session = session;
- this.onChange = this.$onChange.bind(this);
-
- this.session.on('change', this.onChange);
- };
-
- this.detach = function() {
- if (!this.session)
- return;
- this.session.removeListener('change', this.onChange);
- this.session = null;
- };
-
- this.$onChange = function(e) {
- var changeRange = e.data.range;
- if (e.data.action[0] == "i"){
- var start = changeRange.start;
- var end = changeRange.end;
- } else {
- var end = changeRange.start;
- var start = changeRange.end;
- }
- var startRow = start.row;
- var endRow = end.row;
- var lineDif = endRow - startRow;
-
- var colDiff = -start.column + end.column;
- var ranges = this.ranges;
-
- for (var i = 0, n = ranges.length; i < n; i++) {
- var r = ranges[i];
- if (r.end.row < startRow)
- continue;
- if (r.start.row > startRow)
- break;
-
- if (r.start.row == startRow && r.start.column >= start.column ) {
- r.start.column += colDiff;
- r.start.row += lineDif;
- }
- if (r.end.row == startRow && r.end.column >= start.column) {
- r.end.column += colDiff;
- r.end.row += lineDif;
- }
- }
-
- if (lineDif != 0 && i < n) {
- for (; i < n; i++) {
- var r = ranges[i];
- r.start.row += lineDif;
- r.end.row += lineDif;
- }
- }
- };
-
-}).call(RangeList.prototype);
-
-exports.RangeList = RangeList;
-});
-
-define('ace/mouse/multi_select_handler', ['require', 'exports', 'module' , 'ace/lib/event'], function(require, exports, module) {
-
-var event = require("../lib/event");
-function isSamePoint(p1, p2) {
- return p1.row == p2.row && p1.column == p2.column;
-}
-
-function onMouseDown(e) {
- var ev = e.domEvent;
- var alt = ev.altKey;
- var shift = ev.shiftKey;
- var ctrl = e.getAccelKey();
- var button = e.getButton();
-
- if (e.editor.inMultiSelectMode && button == 2) {
- e.editor.textInput.onContextMenu(e.domEvent);
- return;
- }
-
- if (!ctrl && !alt) {
- if (button == 0 && e.editor.inMultiSelectMode)
- e.editor.exitMultiSelectMode();
- return;
- }
-
- var editor = e.editor;
- var selection = editor.selection;
- var isMultiSelect = editor.inMultiSelectMode;
- var pos = e.getDocumentPosition();
- var cursor = selection.getCursor();
- var inSelection = e.inSelection() || (selection.isEmpty() && isSamePoint(pos, cursor));
-
-
- var mouseX = e.x, mouseY = e.y;
- var onMouseSelection = function(e) {
- mouseX = e.clientX;
- mouseY = e.clientY;
- };
-
- var blockSelect = function() {
- var newCursor = editor.renderer.pixelToScreenCoordinates(mouseX, mouseY);
- var cursor = session.screenToDocumentPosition(newCursor.row, newCursor.column);
-
- if (isSamePoint(screenCursor, newCursor)
- && isSamePoint(cursor, selection.selectionLead))
- return;
- screenCursor = newCursor;
-
- editor.selection.moveCursorToPosition(cursor);
- editor.selection.clearSelection();
- editor.renderer.scrollCursorIntoView();
-
- editor.removeSelectionMarkers(rectSel);
- rectSel = selection.rectangularRangeBlock(screenCursor, screenAnchor);
- rectSel.forEach(editor.addSelectionMarker, editor);
- editor.updateSelectionMarkers();
- };
-
- var session = editor.session;
- var screenAnchor = editor.renderer.pixelToScreenCoordinates(mouseX, mouseY);
- var screenCursor = screenAnchor;
-
-
-
- if (ctrl && !shift && !alt && button == 0) {
- if (!isMultiSelect && inSelection)
- return; // dragging
-
- if (!isMultiSelect) {
- var range = selection.toOrientedRange();
- editor.addSelectionMarker(range);
- }
-
- var oldRange = selection.rangeList.rangeAtPoint(pos);
-
- event.capture(editor.container, function(){}, function() {
- var tmpSel = selection.toOrientedRange();
-
- if (oldRange && tmpSel.isEmpty() && isSamePoint(oldRange.cursor, tmpSel.cursor))
- selection.substractPoint(tmpSel.cursor);
- else {
- if (range) {
- editor.removeSelectionMarker(range);
- selection.addRange(range);
- }
- selection.addRange(tmpSel);
- }
- });
-
- } else if (!shift && alt && button == 0) {
- e.stop();
-
- if (isMultiSelect && !ctrl)
- selection.toSingleRange();
- else if (!isMultiSelect && ctrl)
- selection.addRange();
-
- selection.moveCursorToPosition(pos);
- selection.clearSelection();
-
- var rectSel = [];
-
- var onMouseSelectionEnd = function(e) {
- clearInterval(timerId);
- editor.removeSelectionMarkers(rectSel);
- for (var i = 0; i < rectSel.length; i++)
- selection.addRange(rectSel[i]);
- };
-
- var onSelectionInterval = blockSelect;
-
- event.capture(editor.container, onMouseSelection, onMouseSelectionEnd);
- var timerId = setInterval(function() {onSelectionInterval();}, 20);
-
- return e.preventDefault();
- }
-}
-
-
-exports.onMouseDown = onMouseDown;
-
-});
-
-define('ace/commands/multi_select_commands', ['require', 'exports', 'module' , 'ace/keyboard/hash_handler'], function(require, exports, module) {
-exports.defaultCommands = [{
- name: "addCursorAbove",
- exec: function(editor) { editor.selectMoreLines(-1); },
- bindKey: {win: "Ctrl-Alt-Up", mac: "Ctrl-Alt-Up"},
- readonly: true
-}, {
- name: "addCursorBelow",
- exec: function(editor) { editor.selectMoreLines(1); },
- bindKey: {win: "Ctrl-Alt-Down", mac: "Ctrl-Alt-Down"},
- readonly: true
-}, {
- name: "addCursorAboveSkipCurrent",
- exec: function(editor) { editor.selectMoreLines(-1, true); },
- bindKey: {win: "Ctrl-Alt-Shift-Up", mac: "Ctrl-Alt-Shift-Up"},
- readonly: true
-}, {
- name: "addCursorBelowSkipCurrent",
- exec: function(editor) { editor.selectMoreLines(1, true); },
- bindKey: {win: "Ctrl-Alt-Shift-Down", mac: "Ctrl-Alt-Shift-Down"},
- readonly: true
-}, {
- name: "selectMoreBefore",
- exec: function(editor) { editor.selectMore(-1); },
- bindKey: {win: "Ctrl-Alt-Left", mac: "Ctrl-Alt-Left"},
- readonly: true
-}, {
- name: "selectMoreAfter",
- exec: function(editor) { editor.selectMore(1); },
- bindKey: {win: "Ctrl-Alt-Right", mac: "Ctrl-Alt-Right"},
- readonly: true
-}, {
- name: "selectNextBefore",
- exec: function(editor) { editor.selectMore(-1, true); },
- bindKey: {win: "Ctrl-Alt-Shift-Left", mac: "Ctrl-Alt-Shift-Left"},
- readonly: true
-}, {
- name: "selectNextAfter",
- exec: function(editor) { editor.selectMore(1, true); },
- bindKey: {win: "Ctrl-Alt-Shift-Right", mac: "Ctrl-Alt-Shift-Right"},
- readonly: true
-}, {
- name: "splitIntoLines",
- exec: function(editor) { editor.multiSelect.splitIntoLines(); },
- bindKey: {win: "Ctrl-Alt-L", mac: "Ctrl-Alt-L"},
- readonly: true
-}, {
- name: "alignCursors",
- exec: function(editor) { editor.alignCursors(); },
- bindKey: {win: "Ctrl-Alt-A", mac: "Ctrl-Alt-A"}
-}];
-exports.multiSelectCommands = [{
- name: "singleSelection",
- bindKey: "esc",
- exec: function(editor) { editor.exitMultiSelectMode(); },
- readonly: true,
- isAvailable: function(editor) {return editor && editor.inMultiSelectMode}
-}];
-
-var HashHandler = require("../keyboard/hash_handler").HashHandler;
-exports.keyboardHandler = new HashHandler(exports.multiSelectCommands);
-
-});
-
-define('ace/worker/worker_client', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/event_emitter', 'ace/config'], function(require, exports, module) {
-
-
-var oop = require("../lib/oop");
-var EventEmitter = require("../lib/event_emitter").EventEmitter;
-var config = require("../config");
-
-var WorkerClient = function(topLevelNamespaces, mod, classname) {
- this.changeListener = this.changeListener.bind(this);
- this.onMessage = this.onMessage.bind(this);
- this.onError = this.onError.bind(this);
-
- var workerUrl;
- if (config.get("packaged")) {
- workerUrl = config.moduleUrl(mod, "worker");
- } else {
- var normalizePath = this.$normalizePath;
- if (typeof require.supports !== "undefined" && require.supports.indexOf("ucjs2-pinf-0") >= 0) {
- workerUrl = require.nameToUrl("ace/worker/worker_sourcemint");
- } else {
- if (require.nameToUrl && !require.toUrl)
- require.toUrl = require.nameToUrl;
- workerUrl = normalizePath(require.toUrl("ace/worker/worker", null, "_"));
- }
-
- var tlns = {};
- topLevelNamespaces.forEach(function(ns) {
- tlns[ns] = normalizePath(require.toUrl(ns, null, "_").replace(/.js(\?.*)?$/, ""));
- });
- }
-
- this.$worker = new Worker(workerUrl);
- this.$worker.postMessage({
- init : true,
- tlns: tlns,
- module: mod,
- classname: classname
- });
-
- this.callbackId = 1;
- this.callbacks = {};
-
- this.$worker.onerror = this.onError;
- this.$worker.onmessage = this.onMessage;
-};
-
-(function(){
-
- oop.implement(this, EventEmitter);
-
- this.onError = function(e) {
- window.console && console.log && console.log(e);
- throw e;
- };
-
- this.onMessage = function(e) {
- var msg = e.data;
- switch(msg.type) {
- case "log":
- window.console && console.log && console.log.apply(console, msg.data);
- break;
-
- case "event":
- this._emit(msg.name, {data: msg.data});
- break;
-
- case "call":
- var callback = this.callbacks[msg.id];
- if (callback) {
- callback(msg.data);
- delete this.callbacks[msg.id];
- }
- break;
- }
- };
-
- this.$normalizePath = function(path) {
- if (!location.host) // needed for file:// protocol
- return path;
- path = path.replace(/^[a-z]+:\/\/[^\/]+/, ""); // Remove domain name and rebuild it
- path = location.protocol + "//" + location.host
- + (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, ""))
- + "/" + path.replace(/^[\/]+/, "");
- return path;
- };
-
- this.terminate = function() {
- this._emit("terminate", {});
- this.$worker.terminate();
- this.$worker = null;
- this.$doc.removeEventListener("change", this.changeListener);
- this.$doc = null;
- };
-
- this.send = function(cmd, args) {
- this.$worker.postMessage({command: cmd, args: args});
- };
-
- this.call = function(cmd, args, callback) {
- if (callback) {
- var id = this.callbackId++;
- this.callbacks[id] = callback;
- args.push(id);
- }
- this.send(cmd, args);
- };
-
- this.emit = function(event, data) {
- try {
- this.$worker.postMessage({event: event, data: {data: data.data}});
- }
- catch(ex) {}
- };
-
- this.attachToDocument = function(doc) {
- if(this.$doc)
- this.terminate();
-
- this.$doc = doc;
- this.call("setValue", [doc.getValue()]);
- doc.on("change", this.changeListener);
- };
-
- this.changeListener = function(e) {
- e.range = {
- start: e.data.range.start,
- end: e.data.range.end
- };
- this.emit("change", e);
- };
-
-}).call(WorkerClient.prototype);
-
-
-var UIWorkerClient = function(topLevelNamespaces, mod, classname) {
- this.changeListener = this.changeListener.bind(this);
- this.callbackId = 1;
- this.callbacks = {};
- this.messageBuffer = [];
-
- var main = null;
- var sender = Object.create(EventEmitter);
- var _self = this;
-
- this.$worker = {}
- this.$worker.postMessage = function(e) {
- _self.messageBuffer.push(e);
- main && setTimeout(processNext);
- };
-
- var processNext = function() {
- var msg = _self.messageBuffer.shift();
- if (msg.command)
- main[msg.command].apply(main, msg.args);
- else if (msg.event)
- sender._emit(msg.event, msg.data);
- };
-
- sender.postMessage = function(msg) {
- _self.onMessage({data: msg});
- };
- sender.callback = function(data, callbackId) {
- this.postMessage({type: "call", id: callbackId, data: data});
- };
- sender.emit = function(name, data) {
- this.postMessage({type: "event", name: name, data: data});
- };
-
- require([mod], function(Main) {
- main = new Main[classname](sender);
- while (_self.messageBuffer.length)
- processNext();
- });
-};
-
-UIWorkerClient.prototype = WorkerClient.prototype;
-
-exports.UIWorkerClient = UIWorkerClient;
-exports.WorkerClient = WorkerClient;
-
-});
-define('ace/placeholder', ['require', 'exports', 'module' , 'ace/range', 'ace/lib/event_emitter', 'ace/lib/oop'], function(require, exports, module) {
-
-
-var Range = require("./range").Range;
-var EventEmitter = require("./lib/event_emitter").EventEmitter;
-var oop = require("./lib/oop");
-
-var PlaceHolder = function(session, length, pos, others, mainClass, othersClass) {
- var _self = this;
- this.length = length;
- this.session = session;
- this.doc = session.getDocument();
- this.mainClass = mainClass;
- this.othersClass = othersClass;
- this.$onUpdate = this.onUpdate.bind(this);
- this.doc.on("change", this.$onUpdate);
- this.$others = others;
-
- this.$onCursorChange = function() {
- setTimeout(function() {
- _self.onCursorChange();
- });
- };
-
- this.$pos = pos;
- var undoStack = session.getUndoManager().$undoStack || session.getUndoManager().$undostack || {length: -1};
- this.$undoStackDepth = undoStack.length;
- this.setup();
-
- session.selection.on("changeCursor", this.$onCursorChange);
-};
-
-(function() {
-
- oop.implement(this, EventEmitter);
- this.setup = function() {
- var _self = this;
- var doc = this.doc;
- var session = this.session;
- var pos = this.$pos;
-
- this.pos = doc.createAnchor(pos.row, pos.column);
- this.markerId = session.addMarker(new Range(pos.row, pos.column, pos.row, pos.column + this.length), this.mainClass, null, false);
- this.pos.on("change", function(event) {
- session.removeMarker(_self.markerId);
- _self.markerId = session.addMarker(new Range(event.value.row, event.value.column, event.value.row, event.value.column+_self.length), _self.mainClass, null, false);
- });
- this.others = [];
- this.$others.forEach(function(other) {
- var anchor = doc.createAnchor(other.row, other.column);
- _self.others.push(anchor);
- });
- session.setUndoSelect(false);
- };
- this.showOtherMarkers = function() {
- if(this.othersActive) return;
- var session = this.session;
- var _self = this;
- this.othersActive = true;
- this.others.forEach(function(anchor) {
- anchor.markerId = session.addMarker(new Range(anchor.row, anchor.column, anchor.row, anchor.column+_self.length), _self.othersClass, null, false);
- anchor.on("change", function(event) {
- session.removeMarker(anchor.markerId);
- anchor.markerId = session.addMarker(new Range(event.value.row, event.value.column, event.value.row, event.value.column+_self.length), _self.othersClass, null, false);
- });
- });
- };
- this.hideOtherMarkers = function() {
- if(!this.othersActive) return;
- this.othersActive = false;
- for (var i = 0; i < this.others.length; i++) {
- this.session.removeMarker(this.others[i].markerId);
- }
- };
- this.onUpdate = function(event) {
- var delta = event.data;
- var range = delta.range;
- if(range.start.row !== range.end.row) return;
- if(range.start.row !== this.pos.row) return;
- if (this.$updating) return;
- this.$updating = true;
- var lengthDiff = delta.action === "insertText" ? range.end.column - range.start.column : range.start.column - range.end.column;
-
- if(range.start.column >= this.pos.column && range.start.column <= this.pos.column + this.length + 1) {
- var distanceFromStart = range.start.column - this.pos.column;
- this.length += lengthDiff;
- if(!this.session.$fromUndo) {
- if(delta.action === "insertText") {
- for (var i = this.others.length - 1; i >= 0; i--) {
- var otherPos = this.others[i];
- var newPos = {row: otherPos.row, column: otherPos.column + distanceFromStart};
- if(otherPos.row === range.start.row && range.start.column < otherPos.column)
- newPos.column += lengthDiff;
- this.doc.insert(newPos, delta.text);
- }
- } else if(delta.action === "removeText") {
- for (var i = this.others.length - 1; i >= 0; i--) {
- var otherPos = this.others[i];
- var newPos = {row: otherPos.row, column: otherPos.column + distanceFromStart};
- if(otherPos.row === range.start.row && range.start.column < otherPos.column)
- newPos.column += lengthDiff;
- this.doc.remove(new Range(newPos.row, newPos.column, newPos.row, newPos.column - lengthDiff));
- }
- }
- if(range.start.column === this.pos.column && delta.action === "insertText") {
- setTimeout(function() {
- this.pos.setPosition(this.pos.row, this.pos.column - lengthDiff);
- for (var i = 0; i < this.others.length; i++) {
- var other = this.others[i];
- var newPos = {row: other.row, column: other.column - lengthDiff};
- if(other.row === range.start.row && range.start.column < other.column)
- newPos.column += lengthDiff;
- other.setPosition(newPos.row, newPos.column);
- }
- }.bind(this), 0);
- }
- else if(range.start.column === this.pos.column && delta.action === "removeText") {
- setTimeout(function() {
- for (var i = 0; i < this.others.length; i++) {
- var other = this.others[i];
- if(other.row === range.start.row && range.start.column < other.column) {
- other.setPosition(other.row, other.column - lengthDiff);
- }
- }
- }.bind(this), 0);
- }
- }
- this.pos._emit("change", {value: this.pos});
- for (var i = 0; i < this.others.length; i++) {
- this.others[i]._emit("change", {value: this.others[i]});
- }
- }
- this.$updating = false;
- };
-
- this.onCursorChange = function(event) {
- if (this.$updating) return;
- var pos = this.session.selection.getCursor();
- if(pos.row === this.pos.row && pos.column >= this.pos.column && pos.column <= this.pos.column + this.length) {
- this.showOtherMarkers();
- this._emit("cursorEnter", event);
- } else {
- this.hideOtherMarkers();
- this._emit("cursorLeave", event);
- }
- };
- this.detach = function() {
- this.session.removeMarker(this.markerId);
- this.hideOtherMarkers();
- this.doc.removeEventListener("change", this.$onUpdate);
- this.session.selection.removeEventListener("changeCursor", this.$onCursorChange);
- this.pos.detach();
- for (var i = 0; i < this.others.length; i++) {
- this.others[i].detach();
- }
- this.session.setUndoSelect(true);
- };
- this.cancel = function() {
- if(this.$undoStackDepth === -1)
- throw Error("Canceling placeholders only supported with undo manager attached to session.");
- var undoManager = this.session.getUndoManager();
- var undosRequired = (undoManager.$undoStack || undoManager.$undostack).length - this.$undoStackDepth;
- for (var i = 0; i < undosRequired; i++) {
- undoManager.undo(true);
- }
- };
-}).call(PlaceHolder.prototype);
-
-
-exports.PlaceHolder = PlaceHolder;
-});
-
-define('ace/mode/folding/fold_mode', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
-
-
-var Range = require("../../range").Range;
-
-var FoldMode = exports.FoldMode = function() {};
-
-(function() {
-
- this.foldingStartMarker = null;
- this.foldingStopMarker = null;
- this.getFoldWidget = function(session, foldStyle, row) {
- var line = session.getLine(row);
- if (this.foldingStartMarker.test(line))
- return "start";
- if (foldStyle == "markbeginend"
- && this.foldingStopMarker
- && this.foldingStopMarker.test(line))
- return "end";
- return "";
- };
-
- this.getFoldWidgetRange = function(session, foldStyle, row) {
- return null;
- };
-
- this.indentationBlock = function(session, row, column) {
- var re = /\S/;
- var line = session.getLine(row);
- var startLevel = line.search(re);
- if (startLevel == -1)
- return;
-
- var startColumn = column || line.length;
- var maxRow = session.getLength();
- var startRow = row;
- var endRow = row;
-
- while (++row < maxRow) {
- var level = session.getLine(row).search(re);
-
- if (level == -1)
- continue;
-
- if (level <= startLevel)
- break;
-
- endRow = row;
- }
-
- if (endRow > startRow) {
- var endColumn = session.getLine(endRow).length;
- return new Range(startRow, startColumn, endRow, endColumn);
- }
- };
-
- this.openingBracketBlock = function(session, bracket, row, column, typeRe) {
- var start = {row: row, column: column + 1};
- var end = session.$findClosingBracket(bracket, start, typeRe);
- if (!end)
- return;
-
- var fw = session.foldWidgets[end.row];
- if (fw == null)
- fw = this.getFoldWidget(session, end.row);
-
- if (fw == "start" && end.row > start.row) {
- end.row --;
- end.column = session.getLine(end.row).length;
- }
- return Range.fromPoints(start, end);
- };
-
- this.closingBracketBlock = function(session, bracket, row, column, typeRe) {
- var end = {row: row, column: column};
- var start = session.$findOpeningBracket(bracket, end);
-
- if (!start)
- return;
-
- start.column++;
- end.column--;
-
- return Range.fromPoints(start, end);
- };
-}).call(FoldMode.prototype);
-
-});
-;
- (function() {
- window.require(["ace/ace"], function(a) {
- a && a.config.init();
- if (!window.ace)
- window.ace = {};
- for (var key in a) if (a.hasOwnProperty(key))
- ace[key] = a[key];
- });
- })();
-
\ No newline at end of file
diff --git a/public/libs/ace/ext-searchbox.js b/public/libs/ace/ext-searchbox.js
deleted file mode 100644
index 7f3a383..0000000
--- a/public/libs/ace/ext-searchbox.js
+++ /dev/null
@@ -1,353 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Distributed under the BSD license:
- *
- * Copyright (c) 2010, Ajax.org B.V.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of Ajax.org B.V. nor the
- * names of its contributors may be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * ***** END LICENSE BLOCK ***** */
-
-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) {
-
-
-var dom = require("../lib/dom");
-var lang = require("../lib/lang");
-var event = require("../lib/event");
-var searchboxCss = "\
-/* ------------------------------------------------------------------------------------------\
-* Editor Search Form\
-* --------------------------------------------------------------------------------------- */\
-.ace_search {\
-background-color: #ddd;\
-border: 1px solid #cbcbcb;\
-border-top: 0 none;\
-max-width: 297px;\
-overflow: hidden;\
-margin: 0;\
-padding: 4px;\
-padding-right: 6px;\
-padding-bottom: 0;\
-position: absolute;\
-top: 0px;\
-z-index: 99;\
-}\
-.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_field {\
-background-color: white;\
-border-right: 1px solid #cbcbcb;\
-border: 0 none;\
--webkit-box-sizing: border-box;\
--moz-box-sizing: border-box;\
-box-sizing: border-box;\
-display: block;\
-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;\
-display: block;\
-float: left;\
-height: 22px;\
-margin: 0;\
-padding: 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;\
-display: block;\
-float: right;\
-font-family: Arial;\
-font-size: 16px;\
-height: 14px;\
-line-height: 16px;\
-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\
-}";
-var HashHandler = require("../keyboard/hash_handler").HashHandler;
-var keyUtil = require("../lib/keys");
-
-dom.importCssString(searchboxCss, "ace_searchbox");
-
-var html = '
\
-
\
-
\
- \
- \
- \
-
\
-
\
- \
- \
- \
-
\
-
'.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.$init = function() {
- var sb = this.element;
-
- this.searchBox = sb.querySelector(".ace_search_form");
- this.replaceBox = sb.querySelector(".ace_replace_form");
- this.searchInput = this.searchBox.querySelector(".ace_search_field");
- this.replaceInput = this.replaceBox.querySelector(".ace_search_field");
-
- 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;
- var action = t.getAttribute("action");
- if (action && _this[action])
- _this[action]();
- 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;
- });
- event.addListener(this.replaceInput, "focus", function() {
- _this.activeInput = _this.replaceInput;
- });
- };
- 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|Ctrl-H|Command-Option-F": function(sb) {
- var isReplace = sb.isReplace = !sb.isReplace;
- sb.replaceBox.style.display = isReplace ? "" : "none";
- sb[isReplace ? "replaceInput" : "searchInput"].focus();
- },
- "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();
- },
- "Tab": function(sb) {
- (sb.activeInput == sb.replaceInput ? sb.searchInput : sb.replaceInput).focus();
- }
- });
-
-
- this.find = function(skipCurrent, backwards) {
- this.editor.find(this.searchInput.value, {
- skipCurrent: skipCurrent,
- backwards: backwards,
- wrap: true
- });
- this.editor.session.highlight(this.editor.$search.$options.re);
- };
- this.findNext = function() {
- this.find(true, false);
- };
- this.findPrev = function() {
- this.find(true, true);
- };
- this.replace = function() {
- this.editor.replace(this.replaceInput.value);
- this.findNext();
- };
- this.replaceAll = function() {
- this.editor.replaceAll(this.replaceInput.value);
- };
-
- this.hide = function () {
- this.element.style.display = "none";
- this.editor.keyBinding.removeKeyboardHandler(this.$searchKeybingin);
- 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.searchInput.focus();
- this.searchInput.select();
-
- this.editor.keyBinding.addKeyboardHandler(this.$closeSearchBarKb);
- };
-
-}).call(SearchBox.prototype);
-
-exports.SearchBox = SearchBox;
-
-exports.Search = function(editor, isReplace) {
- var sb = editor.searchBox || new SearchBox(editor);
- sb.show(editor.session.getTextRange(), isReplace);
-};
-
-
-exports.ISearch = function(session, options) {
- this.$changeListener = this.$changeListener.bind(this);
- this.startRange = session.selection.toOrientedRange();
- this.options = options || {};
-};
-
-(function(){
- this.setSession = function(session) {
- if (this.session) {
- this.session.removeListener(this.$changeListener);
- }
- this.session = session;
- this.session.addListener(this.$changeListener);
- };
- this.setSearchString = function() {
-
- };
- this.getValue = function() {
- if (this.value == null)
- this.value = this.session.getValue();
- return this.value;
- };
- this.$changeListener = function() {
- this.value = null;
- };
- this.find = function() {
-
- };
- this.$edgeBefore = function() {
- this.cursor = this.startRange[this.options.backwards ? "start" : "end"];
- };
- this.$edgeAfter = function() {
-
- };
- this.next = function(dir) {
-
- };
-}).call(exports.ISearch.prototype);
-
-
-});
\ No newline at end of file
diff --git a/public/libs/ace/ext-static_highlight.js b/public/libs/ace/ext-static_highlight.js
deleted file mode 100644
index 1bab072..0000000
--- a/public/libs/ace/ext-static_highlight.js
+++ /dev/null
@@ -1,96 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Distributed under the BSD license:
- *
- * Copyright (c) 2010, Ajax.org B.V.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of Ajax.org B.V. nor the
- * names of its contributors may be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * ***** END LICENSE BLOCK ***** */
-
-define('ace/ext/static_highlight', ['require', 'exports', 'module' , 'ace/edit_session', 'ace/layer/text'], function(require, exports, module) {
-
-
-var EditSession = require("../edit_session").EditSession;
-var TextLayer = require("../layer/text").Text;
-var baseStyles = ".ace_editor {\
-font-family: 'Monaco', 'Menlo', 'Droid Sans Mono', 'Courier New', monospace;\
-font-size: 12px;\
-}\
-.ace_editor .ace_gutter { \
-width: 25px !important;\
-display: block;\
-float: left;\
-text-align: right; \
-padding: 0 3px 0 0; \
-margin-right: 3px;\
-}\
-.ace_line { clear: both; }\
-*.ace_gutter-cell {\
--moz-user-select: -moz-none;\
--khtml-user-select: none;\
--webkit-user-select: none;\
-user-select: none;\
-}";
-
-exports.render = function(input, mode, theme, lineStart, disableGutter) {
- lineStart = parseInt(lineStart || 1, 10);
-
- var session = new EditSession("");
- session.setMode(mode);
- session.setUseWorker(false);
-
- var textLayer = new TextLayer(document.createElement("div"));
- textLayer.setSession(session);
- textLayer.config = {
- characterWidth: 10,
- lineHeight: 20
- };
-
- session.setValue(input);
-
- var stringBuilder = [];
- var length = session.getLength();
-
- for(var ix = 0; ix < length; ix++) {
- stringBuilder.push("
");
- if (!disableGutter)
- stringBuilder.push("" + (ix + lineStart) + "");
- textLayer.$renderLine(stringBuilder, ix, true, false);
- stringBuilder.push("
");
- }
- var html = "
".replace(/:cssClass/, theme.cssClass).replace(/:code/, stringBuilder.join(""));
-
- textLayer.destroy();
-
- return {
- css: baseStyles + theme.cssText,
- html: html
- };
-};
-
-});
diff --git a/public/libs/ace/ext-textarea.js b/public/libs/ace/ext-textarea.js
deleted file mode 100644
index 71159ea..0000000
--- a/public/libs/ace/ext-textarea.js
+++ /dev/null
@@ -1,626 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Distributed under the BSD license:
- *
- * Copyright (c) 2010, Ajax.org B.V.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of Ajax.org B.V. nor the
- * names of its contributors may be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * ***** END LICENSE BLOCK ***** */
-
-define('ace/ext/textarea', ['require', 'exports', 'module' , 'ace/lib/event', 'ace/lib/useragent', 'ace/lib/net', 'ace/ace', 'ace/theme/textmate', 'ace/mode/text'], function(require, exports, module) {
-
-
-var event = require("../lib/event");
-var UA = require("../lib/useragent");
-var net = require("../lib/net");
-var ace = require("../ace");
-
-require("../theme/textmate");
-
-module.exports = exports = ace;
-var getCSSProperty = function(element, container, property) {
- var ret = element.style[property];
-
- if (!ret) {
- if (window.getComputedStyle) {
- ret = window.getComputedStyle(element, '').getPropertyValue(property);
- } else {
- ret = element.currentStyle[property];
- }
- }
-
- if (!ret || ret == 'auto' || ret == 'intrinsic') {
- ret = container.style[property];
- }
- return ret;
-};
-
-function applyStyles(elm, styles) {
- for (var style in styles) {
- elm.style[style] = styles[style];
- }
-}
-
-function setupContainer(element, getValue) {
- if (element.type != 'textarea') {
- throw "Textarea required!";
- }
-
- var parentNode = element.parentNode;
- var container = document.createElement('div');
- var resizeEvent = function() {
- var style = 'position:relative;';
- [
- 'margin-top', 'margin-left', 'margin-right', 'margin-bottom'
- ].forEach(function(item) {
- style += item + ':' +
- getCSSProperty(element, container, item) + ';';
- });
- var width = getCSSProperty(element, container, 'width') || (element.clientWidth + "px");
- var height = getCSSProperty(element, container, 'height') || (element.clientHeight + "px");
- style += 'height:' + height + ';width:' + width + ';';
- style += 'display:inline-block;';
- container.setAttribute('style', style);
- };
- event.addListener(window, 'resize', resizeEvent);
- resizeEvent();
- parentNode.insertBefore(container, element.nextSibling);
- while (parentNode !== document) {
- if (parentNode.tagName.toUpperCase() === 'FORM') {
- var oldSumit = parentNode.onsubmit;
- parentNode.onsubmit = function(evt) {
- element.value = getValue();
- if (oldSumit) {
- oldSumit.call(this, evt);
- }
- };
- break;
- }
- parentNode = parentNode.parentNode;
- }
- return container;
-}
-
-exports.transformTextarea = function(element, loader) {
- var session;
- var container = setupContainer(element, function() {
- return session.getValue();
- });
- element.style.display = 'none';
- container.style.background = 'white';
- var editorDiv = document.createElement("div");
- applyStyles(editorDiv, {
- top: "0px",
- left: "0px",
- right: "0px",
- bottom: "0px",
- border: "1px solid gray",
- position: "absolute"
- });
- container.appendChild(editorDiv);
-
- var settingOpener = document.createElement("div");
- applyStyles(settingOpener, {
- position: "absolute",
- right: "0px",
- bottom: "0px",
- background: "red",
- cursor: "nw-resize",
- borderStyle: "solid",
- borderWidth: "9px 8px 10px 9px",
- width: "2px",
- borderColor: "lightblue gray gray lightblue",
- zIndex: 101
- });
-
- var settingDiv = document.createElement("div");
- var settingDivStyles = {
- top: "0px",
- left: "20%",
- right: "0px",
- bottom: "0px",
- position: "absolute",
- padding: "5px",
- zIndex: 100,
- color: "white",
- display: "none",
- overflow: "auto",
- fontSize: "14px",
- boxShadow: "-5px 2px 3px gray"
- };
- if (!UA.isOldIE) {
- settingDivStyles.backgroundColor = "rgba(0, 0, 0, 0.6)";
- } else {
- settingDivStyles.backgroundColor = "#333";
- }
-
- applyStyles(settingDiv, settingDivStyles);
- container.appendChild(settingDiv);
- var options = {};
-
- var editor = ace.edit(editorDiv);
- session = editor.getSession();
-
- session.setValue(element.value || element.innerHTML);
- editor.focus();
- container.appendChild(settingOpener);
- setupApi(editor, editorDiv, settingDiv, ace, options, loader);
- setupSettingPanel(settingDiv, settingOpener, editor, options);
-
- var state = "";
- event.addListener(settingOpener, "mousemove", function(e) {
- var rect = this.getBoundingClientRect();
- var x = e.clientX - rect.left, y = e.clientY - rect.top;
- if (x + y < (rect.width + rect.height)/2) {
- this.style.cursor = "pointer";
- state = "toggle";
- } else {
- state = "resize";
- this.style.cursor = "nw-resize";
- }
- });
-
- event.addListener(settingOpener, "mousedown", function(e) {
- if (state == "toggle") {
- editor.setDisplaySettings();
- return;
- }
- container.style.zIndex = 100000;
- var rect = container.getBoundingClientRect();
- var startX = rect.width + rect.left - e.clientX;
- var startY = rect.height + rect.top - e.clientY;
- event.capture(settingOpener, function(e) {
- container.style.width = e.clientX - rect.left + startX + "px";
- container.style.height = e.clientY - rect.top + startY + "px";
- editor.resize();
- }, function() {});
- });
-
- return editor;
-};
-
-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) {
- return value === "true" || value == true;
- }
-
- editor.setDisplaySettings = function(display) {
- if (display == null)
- display = settingDiv.style.display == "none";
- if (display) {
- settingDiv.style.display = "block";
- settingDiv.hideButton.focus();
- editor.on("focus", function onFocus() {
- editor.removeListener("focus", onFocus);
- settingDiv.style.display = "none"
- });
- } else {
- editor.focus();
- };
- };
-
- editor.setOption = function(key, value) {
- if (options[key] == value) return;
-
- switch (key) {
- case "gutter":
- renderer.setShowGutter(toBool(value));
- break;
-
- case "mode":
- if (value != "text") {
- loader("mode-" + value + ".js", "ace/mode/" + value, function() {
- var aceMode = require("../mode/" + value).Mode;
- session.setMode(new aceMode());
- });
- } else {
- session.setMode(new (require("../mode/text").Mode));
- }
- break;
-
- case "theme":
- if (value != "textmate") {
- loader("theme-" + value + ".js", "ace/theme/" + value, function() {
- editor.setTheme("ace/theme/" + value);
- });
- } else {
- editor.setTheme("ace/theme/textmate");
- }
- break;
-
- case "fontSize":
- editorDiv.style.fontSize = value;
- break;
-
- case "keybindings":
- switch (value) {
- case "vim":
- editor.setKeyboardHandler("ace/keyboard/vim");
- break;
- case "emacs":
- editor.setKeyboardHandler("ace/keyboard/emacs");
- break;
- default:
- editor.setKeyboardHandler(null);
- }
- break;
-
- case "softWrap":
- switch (value) {
- case "off":
- session.setUseWrapMode(false);
- renderer.setPrintMarginColumn(80);
- break;
- case "40":
- session.setUseWrapMode(true);
- session.setWrapLimitRange(40, 40);
- renderer.setPrintMarginColumn(40);
- break;
- case "80":
- session.setUseWrapMode(true);
- session.setWrapLimitRange(80, 80);
- renderer.setPrintMarginColumn(80);
- break;
- case "free":
- session.setUseWrapMode(true);
- session.setWrapLimitRange(null, null);
- renderer.setPrintMarginColumn(80);
- break;
- }
- break;
-
- case "useSoftTabs":
- session.setUseSoftTabs(toBool(value));
- break;
-
- case "showPrintMargin":
- renderer.setShowPrintMargin(toBool(value));
- break;
-
- case "showInvisibles":
- editor.setShowInvisibles(toBool(value));
- break;
- }
-
- options[key] = value;
- };
-
- editor.getOption = function(key) {
- return options[key];
- };
-
- editor.getOptions = function() {
- return options;
- };
-
- for (var option in exports.options) {
- editor.setOption(option, exports.options[option]);
- }
-
- return editor;
-}
-
-function setupSettingPanel(settingDiv, settingOpener, editor, options) {
- var BOOL = null;
-
- var desc = {
- mode: "Mode:",
- gutter: "Display Gutter:",
- theme: "Theme:",
- fontSize: "Font Size:",
- softWrap: "Soft Wrap:",
- keybindings: "Keyboard",
- showPrintMargin: "Show Print Margin:",
- useSoftTabs: "Use Soft Tabs:",
- showInvisibles: "Show Invisibles"
- };
-
- var optionValues = {
- mode: {
- text: "Plain",
- javascript: "JavaScript",
- xml: "XML",
- html: "HTML",
- css: "CSS",
- scss: "SCSS",
- python: "Python",
- php: "PHP",
- java: "Java",
- ruby: "Ruby",
- c_cpp: "C/C++",
- coffee: "CoffeeScript",
- json: "json",
- perl: "Perl",
- clojure: "Clojure",
- ocaml: "OCaml",
- csharp: "C#",
- haxe: "haXe",
- svg: "SVG",
- textile: "Textile",
- groovy: "Groovy",
- liquid: "Liquid",
- Scala: "Scala"
- },
- theme: {
- clouds: "Clouds",
- clouds_midnight: "Clouds Midnight",
- cobalt: "Cobalt",
- crimson_editor: "Crimson Editor",
- dawn: "Dawn",
- eclipse: "Eclipse",
- idle_fingers: "Idle Fingers",
- kr_theme: "Kr Theme",
- merbivore: "Merbivore",
- merbivore_soft: "Merbivore Soft",
- mono_industrial: "Mono Industrial",
- monokai: "Monokai",
- pastel_on_dark: "Pastel On Dark",
- solarized_dark: "Solarized Dark",
- solarized_light: "Solarized Light",
- textmate: "Textmate",
- twilight: "Twilight",
- vibrant_ink: "Vibrant Ink"
- },
- gutter: BOOL,
- fontSize: {
- "10px": "10px",
- "11px": "11px",
- "12px": "12px",
- "14px": "14px",
- "16px": "16px"
- },
- softWrap: {
- off: "Off",
- 40: "40",
- 80: "80",
- free: "Free"
- },
- keybindings: {
- ace: "ace",
- vim: "vim",
- emacs: "emacs"
- },
- showPrintMargin: BOOL,
- useSoftTabs: BOOL,
- showInvisibles: BOOL
- };
-
- var table = [];
- table.push("
| Setting | Value |
");
-
- function renderOption(builder, option, obj, cValue) {
- if (!obj) {
- builder.push(
- ""
- );
- return
- }
- builder.push("");
- }
-
- for (var option in options) {
- table.push("| ", desc[option], " | ");
- table.push("");
- renderOption(table, option, optionValues[option], options[option]);
- table.push(" |
");
- }
- table.push("
");
- settingDiv.innerHTML = table.join("");
-
- var onChange = function(e) {
- var select = e.currentTarget;
- editor.setOption(select.title, select.value);
- };
- var onClick = function(e) {
- var cb = e.currentTarget;
- editor.setOption(cb.title, cb.checked);
- };
- var selects = settingDiv.getElementsByTagName("select");
- for (var i = 0; i < selects.length; i++)
- selects[i].onchange = onChange;
- var cbs = settingDiv.getElementsByTagName("input");
- for (var i = 0; i < cbs.length; i++)
- cbs[i].onclick = onClick;
-
-
- var button = document.createElement("input");
- button.type = "button";
- button.value = "Hide";
- event.addListener(button, "click", function() {
- editor.setDisplaySettings(false);
- });
- settingDiv.appendChild(button);
- settingDiv.hideButton = button;
-}
-exports.options = {
- mode: "text",
- theme: "textmate",
- gutter: "false",
- fontSize: "12px",
- softWrap: "off",
- keybindings: "ace",
- showPrintMargin: "false",
- useSoftTabs: "true",
- showInvisibles: "false"
-};
-
-});
-
-define('ace/theme/textmate', ['require', 'exports', 'module' , 'ace/lib/dom'], function(require, exports, module) {
-
-
-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 .ace_scroller {\
-background-color: #FFFFFF;\
-}\
-.ace-tm .ace_cursor {\
-border-left: 2px solid black;\
-}\
-.ace-tm .ace_overwrite-cursors .ace_cursor {\
-border-left: 0px;\
-border-bottom: 1px solid 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_markup.ace_heading {\
-color: rgb(12, 7, 255);\
-}\
-.ace-tm .ace_markup.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;\
-border-radius: 2px;\
-}\
-.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);
-});
diff --git a/public/libs/ace/keybinding-emacs.js b/public/libs/ace/keybinding-emacs.js
deleted file mode 100644
index b0e63c4..0000000
--- a/public/libs/ace/keybinding-emacs.js
+++ /dev/null
@@ -1,453 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Distributed under the BSD license:
- *
- * Copyright (c) 2010, Ajax.org B.V.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of Ajax.org B.V. nor the
- * names of its contributors may be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * ***** END LICENSE BLOCK ***** */
-
-define('ace/keyboard/emacs', ['require', 'exports', 'module' , 'ace/lib/dom', 'ace/keyboard/hash_handler', 'ace/lib/keys'], function(require, exports, module) {
-
-
-var dom = require("../lib/dom");
-
-var screenToTextBlockCoordinates = function(x, y) {
- var canvasPos = this.scroller.getBoundingClientRect();
-
- var col = Math.floor(
- (x + this.scrollLeft - canvasPos.left - this.$padding) / this.characterWidth
- );
- var row = Math.floor(
- (y + this.scrollTop - canvasPos.top) / this.lineHeight
- );
-
- return this.session.screenToDocumentPosition(row, col);
-};
-
-var HashHandler = require("./hash_handler").HashHandler;
-exports.handler = new HashHandler();
-
-var initialized = false;
-var $formerLongWords;
-var $formerLineStart;
-
-exports.handler.attach = function(editor) {
- if (!initialized) {
- initialized = true;
-
- dom.importCssString('\
- .emacs-mode .ace_cursor{\
- border: 2px rgba(50,250,50,0.8) solid!important;\
- -moz-box-sizing: border-box!important;\
- -webkit-box-sizing: border-box!important;\
- box-sizing: border-box!important;\
- background-color: rgba(0,250,0,0.9);\
- opacity: 0.5;\
- }\
- .emacs-mode .ace_cursor.ace_hidden{\
- opacity: 1;\
- background-color: transparent;\
- }\
- .emacs-mode .ace_overwrite-cursors .ace_cursor {\
- opacity: 1;\
- background-color: transparent;\
- border-width: 0 0 2px 2px !important;\
- }\
- .emacs-mode .ace_text-layer {\
- z-index: 4\
- }\
- .emacs-mode .ace_cursor-layer {\
- z-index: 2\
- }', 'emacsMode'
- );
- }
- $formerLongWords = editor.session.$selectLongWords;
- editor.session.$selectLongWords = true;
- $formerLineStart = editor.session.$useEmacsStyleLineStart;
- editor.session.$useEmacsStyleLineStart = true;
-
- editor.session.$emacsMark = null;
-
- exports.markMode = function() {
- return editor.session.$emacsMark;
- }
-
- exports.setMarkMode = function(p) {
- editor.session.$emacsMark = p;
- }
-
- editor.on("click",$resetMarkMode);
-
- editor.on("changeSession",$kbSessionChange);
-
- editor.renderer.screenToTextCoordinates = screenToTextBlockCoordinates;
-
- editor.setStyle("emacs-mode");
-
-};
-
-exports.handler.detach = function(editor) {
-
- delete editor.renderer.screenToTextCoordinates;
-
- editor.session.$selectLongWords = $formerLongWords;
- editor.session.$useEmacsStyleLineStart = $formerLineStart;
-
-
- editor.removeEventListener("click",$resetMarkMode);
- editor.removeEventListener("changeSession",$kbSessionChange);
-
- editor.unsetStyle("emacs-mode");
-};
-
-var $kbSessionChange = function(e) {
- if (e.oldSession) {
- e.oldSession.$selectLongWords = $formerLongWords;
- e.oldSession.$useEmacsStyleLineStart = $formerLineStart;
- }
-
- $formerLongWords = e.session.$selectLongWords;
- e.session.$selectLongWords = true;
- $formerLineStart = e.session.$useEmacsStyleLineStart;
- e.session.$useEmacsStyleLineStart = true;
-
- if (!e.session.hasOwnProperty('$emacsMark'))
- e.session.$emacsMark = null;
-}
-
-var $resetMarkMode = function(e) {
- e.editor.session.$emacsMark = null;
-}
-
-var keys = require("../lib/keys").KEY_MODS;
-var eMods = {
- C: "ctrl", S: "shift", M: "alt"
-};
-["S-C-M", "S-C", "S-M", "C-M", "S", "C", "M"].forEach(function(c) {
- var hashId = 0;
- c.split("-").forEach(function(c){
- hashId = hashId | keys[eMods[c]];
- });
- eMods[hashId] = c.toLowerCase() + "-";
-});
-
-exports.handler.bindKey = function(key, command) {
- if (!key)
- return;
-
- var ckb = this.commmandKeyBinding;
- key.split("|").forEach(function(keyPart) {
- keyPart = keyPart.toLowerCase();
- ckb[keyPart] = command;
- keyPart = keyPart.split(" ")[0];
- if (!ckb[keyPart])
- ckb[keyPart] = "null";
- }, this);
-};
-
-
-exports.handler.handleKeyboard = function(data, hashId, key, keyCode) {
- if (hashId == -1) {
- exports.setMarkMode(null);
- if (data.count) {
- var str = Array(data.count + 1).join(key);
- data.count = null;
- return {command: "insertstring", args: str};
- }
- }
-
- if (key == "\x00")
- return;
-
- var modifier = eMods[hashId];
- if (modifier == "c-" || data.universalArgument) {
- var count = parseInt(key[key.length - 1]);
- if (count) {
- data.count = count;
- return {command: "null"};
- }
- }
- data.universalArgument = false;
-
- if (modifier)
- key = modifier + key;
-
- if (data.keyChain)
- key = data.keyChain += " " + key;
-
- var command = this.commmandKeyBinding[key];
- data.keyChain = command == "null" ? key : "";
-
- if (!command)
- return;
-
- if (command == "null")
- return {command: "null"};
-
- if (command == "universalArgument") {
- data.universalArgument = true;
- return {command: "null"};
- }
-
- if (typeof command != "string") {
- var args = command.args;
- command = command.command;
- if (command == "goorselect") {
- command = args[0];
- if (exports.markMode()) {
- command = args[1];
- }
- args = null;
- }
- }
-
- if (typeof command == "string") {
- if (command == "insertstring" ||
- command == "splitline" ||
- command == "togglecomment") {
- exports.setMarkMode(null);
- }
- command = this.commands[command] || data.editor.commands.commands[command];
- }
-
- if (!command.readonly && !command.isYank)
- data.lastCommand = null;
-
- if (data.count) {
- var count = data.count;
- data.count = 0;
- return {
- args: args,
- command: {
- exec: function(editor, args) {
- for (var i = 0; i < count; i++)
- command.exec(editor, args);
- }
- }
- };
- }
-
- return {command: command, args: args};
-};
-
-exports.emacsKeys = {
- "Up|C-p" : {command: "goorselect", args: ["golineup","selectup"]},
- "Down|C-n" : {command: "goorselect", args: ["golinedown","selectdown"]},
- "Left|C-b" : {command: "goorselect", args: ["gotoleft","selectleft"]},
- "Right|C-f" : {command: "goorselect", args: ["gotoright","selectright"]},
- "C-Left|M-b" : {command: "goorselect", args: ["gotowordleft","selectwordleft"]},
- "C-Right|M-f" : {command: "goorselect", args: ["gotowordright","selectwordright"]},
- "Home|C-a" : {command: "goorselect", args: ["gotolinestart","selecttolinestart"]},
- "End|C-e" : {command: "goorselect", args: ["gotolineend","selecttolineend"]},
- "C-Home|S-M-,": {command: "goorselect", args: ["gotostart","selecttostart"]},
- "C-End|S-M-." : {command: "goorselect", args: ["gotoend","selecttoend"]},
- "S-Up|S-C-p" : "selectup",
- "S-Down|S-C-n" : "selectdown",
- "S-Left|S-C-b" : "selectleft",
- "S-Right|S-C-f" : "selectright",
- "S-C-Left|S-M-b" : "selectwordleft",
- "S-C-Right|S-M-f" : "selectwordright",
- "S-Home|S-C-a" : "selecttolinestart",
- "S-End|S-C-e" : "selecttolineend",
- "S-C-Home" : "selecttostart",
- "S-C-End" : "selecttoend",
-
- "C-l" : "recenterTopBottom",
- "M-s" : "centerselection",
- "M-g": "gotoline",
- "C-x C-p": "selectall",
- "C-Down": {command: "goorselect", args: ["gotopagedown","selectpagedown"]},
- "C-Up": {command: "goorselect", args: ["gotopageup","selectpageup"]},
- "PageDown|C-v": {command: "goorselect", args: ["gotopagedown","selectpagedown"]},
- "PageUp|M-v": {command: "goorselect", args: ["gotopageup","selectpageup"]},
- "S-C-Down": "selectpagedown",
- "S-C-Up": "selectpageup",
- "C-s": "findnext",
- "C-r": "findprevious",
- "M-C-s": "findnext",
- "M-C-r": "findprevious",
- "S-M-5": "replace",
- "Backspace": "backspace",
- "Delete|C-d": "del",
- "Return|C-m": {command: "insertstring", args: "\n"}, // "newline"
- "C-o": "splitline",
-
- "M-d|C-Delete": {command: "killWord", args: "right"},
- "C-Backspace|M-Backspace|M-Delete": {command: "killWord", args: "left"},
- "C-k": "killLine",
-
- "C-y|S-Delete": "yank",
- "M-y": "yankRotate",
- "C-g": "keyboardQuit",
-
- "C-w": "killRegion",
- "M-w": "killRingSave",
- "C-Space": "setMark",
- "C-x C-x": "exchangePointAndMark",
-
- "C-t": "transposeletters",
- "M-u": "touppercase", // Doesn't work
- "M-l": "tolowercase",
- "M-/": "autocomplete", // Doesn't work
- "C-u": "universalArgument",
-
- "M-;": "togglecomment",
-
- "C-/|C-x u|S-C--|C-z": "undo",
- "S-C-/|S-C-x u|C--|S-C-z": "redo", //infinite undo?
- "C-x r": "selectRectangularRegion"
-};
-
-
-exports.handler.bindKeys(exports.emacsKeys);
-
-exports.handler.addCommands({
- recenterTopBottom: function(editor) {
- var renderer = editor.renderer;
- var pos = renderer.$cursorLayer.getPixelPosition();
- var h = renderer.$size.scrollerHeight - renderer.lineHeight;
- var scrollTop = renderer.scrollTop;
- if (Math.abs(pos.top - scrollTop) < 2) {
- scrollTop = pos.top - h;
- } else if (Math.abs(pos.top - scrollTop - h * 0.5) < 2) {
- scrollTop = pos.top;
- } else {
- scrollTop = pos.top - h * 0.5;
- }
- editor.session.setScrollTop(scrollTop);
- },
- selectRectangularRegion: function(editor) {
- editor.multiSelect.toggleBlockSelection();
- },
- setMark: function(editor) {
- var markMode = exports.markMode();
-
- if (markMode) {
-
- cp = editor.getCursorPosition();
- if (editor.selection.isEmpty() &&
- markMode.row == cp.row && markMode.column == cp.column) {
- exports.setMarkMode(null);
- return;
- }
- }
- markMode = editor.getCursorPosition();
- exports.setMarkMode(markMode);
- editor.selection.setSelectionAnchor(markMode.row, markMode.column);
-
- },
- exchangePointAndMark: {
- exec: function(editor) {
- var range = editor.selection.getRange();
-
- editor.selection.setSelectionRange(range, !editor.selection.isBackwards());
- },
- readonly: true,
- multiselectAction: "forEach"
- },
- killWord: {
- exec: function(editor, dir) {
- editor.clearSelection();
- if (dir == "left")
- editor.selection.selectWordLeft();
- else
- editor.selection.selectWordRight();
-
- var range = editor.getSelectionRange();
- var text = editor.session.getTextRange(range);
- exports.killRing.add(text);
-
- editor.session.remove(range);
- editor.clearSelection();
- },
- multiselectAction: "forEach"
- },
- killLine: function(editor) {
- exports.setMarkMode(null);
- var pos = editor.getCursorPosition();
-
- if (pos.column == 0 &&
- editor.session.doc.getLine(pos.row).length == 0) {
- editor.selection.selectLine();
- } else {
- editor.clearSelection();
- editor.selection.selectLineEnd();
-
- }
- var range = editor.getSelectionRange();
- var text = editor.session.getTextRange(range);
- exports.killRing.add(text);
-
- editor.session.remove(range);
- editor.clearSelection();
- },
- yank: function(editor) {
- editor.onPaste(exports.killRing.get());
- editor.keyBinding.$data.lastCommand = "yank";
- },
- yankRotate: function(editor) {
- if (editor.keyBinding.$data.lastCommand != "yank")
- return;
-
- editor.undo();
- editor.onPaste(exports.killRing.rotate());
- editor.keyBinding.$data.lastCommand = "yank";
- },
- killRegion: function(editor) {
- exports.killRing.add(editor.getCopyText());
- editor.commands.byName.cut.exec(editor);
- },
- killRingSave: function(editor) {
- exports.killRing.add(editor.getCopyText());
- }
-});
-
-var commands = exports.handler.commands;
-commands.yank.isYank = true;
-commands.yankRotate.isYank = true;
-
-exports.killRing = {
- $data: [],
- add: function(str) {
- str && this.$data.push(str);
- if (this.$data.length > 30)
- this.$data.shift();
- },
- get: function() {
- return this.$data[this.$data.length - 1] || "";
- },
- pop: function() {
- if (this.$data.length > 1)
- this.$data.pop();
- return this.get();
- },
- rotate: function() {
- this.$data.unshift(this.$data.pop());
- return this.get();
- }
-};
-
-
-});
diff --git a/public/libs/ace/keybinding-vim.js b/public/libs/ace/keybinding-vim.js
deleted file mode 100644
index f54ba4a..0000000
--- a/public/libs/ace/keybinding-vim.js
+++ /dev/null
@@ -1,1646 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Distributed under the BSD license:
- *
- * Copyright (c) 2010, Ajax.org B.V.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of Ajax.org B.V. nor the
- * names of its contributors may be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * ***** END LICENSE BLOCK ***** */
-
-define('ace/keyboard/vim', ['require', 'exports', 'module' , 'ace/keyboard/vim/commands', 'ace/keyboard/vim/maps/util', 'ace/lib/useragent'], function(require, exports, module) {
-
-
-var cmds = require("./vim/commands");
-var coreCommands = cmds.coreCommands;
-var util = require("./vim/maps/util");
-var useragent = require("../lib/useragent");
-
-var startCommands = {
- "i": {
- command: coreCommands.start
- },
- "I": {
- command: coreCommands.startBeginning
- },
- "a": {
- command: coreCommands.append
- },
- "A": {
- command: coreCommands.appendEnd
- },
- "ctrl-f": {
- command: "gotopagedown"
- },
- "ctrl-b": {
- command: "gotopageup"
- }
-};
-
-exports.handler = {
- handleMacRepeat: function(data, hashId, key) {
- if (hashId == -1) {
- data.inputChar = key;
- data.lastEvent = "input";
- } else if (data.inputChar && data.$lastHash == hashId && data.$lastKey == key) {
- if (data.lastEvent == "input") {
- data.lastEvent = "input1";
- } else if (data.lastEvent == "input1") {
- return true;
- }
- } else {
- data.$lastHash = hashId;
- data.$lastKey = key;
- data.lastEvent = "keypress";
- }
- },
-
- handleKeyboard: function(data, hashId, key, keyCode, e) {
- if (hashId != 0 && (key == "" || key == "\x00"))
- return null;
-
- if (hashId == 1)
- key = "ctrl-" + key;
-
- if ((key == "esc" && hashId == 0) || key == "ctrl-[") {
- return {command: coreCommands.stop};
- } else if (data.state == "start") {
- if (useragent.isMac && this.handleMacRepeat(data, hashId, key)) {
- hashId = -1;
- key = data.inputChar;
- }
-
- if (hashId == -1 || hashId == 1 || hashId == 0 && key.length > 1) {
- if (cmds.inputBuffer.idle && startCommands[key])
- return startCommands[key];
- return {
- command: {
- exec: function(editor) {
- return cmds.inputBuffer.push(editor, key);
- }
- }
- };
- } // if no modifier || shift: wait for input.
- else if (key.length == 1 && (hashId == 0 || hashId == 4)) {
- return {command: "null", passEvent: true};
- } else if (key == "esc" && hashId == 0) {
- return {command: coreCommands.stop};
- }
- } else {
- if (key == "ctrl-w") {
- return {command: "removewordleft"};
- }
- }
- },
-
- attach: function(editor) {
- editor.on("click", exports.onCursorMove);
- if (util.currentMode !== "insert")
- cmds.coreCommands.stop.exec(editor);
- editor.$vimModeHandler = this;
- },
-
- detach: function(editor) {
- editor.removeListener("click", exports.onCursorMove);
- util.noMode(editor);
- util.currentMode = "normal";
- },
-
- actions: cmds.actions,
- getStatusText: function() {
- if (util.currentMode == "insert")
- return "INSERT";
- if (util.onVisualMode)
- return (util.onVisualLineMode ? "VISUAL LINE " : "VISUAL ") + cmds.inputBuffer.status;
- return cmds.inputBuffer.status;
- }
-};
-
-
-exports.onCursorMove = function(e) {
- cmds.onCursorMove(e.editor, e);
- exports.onCursorMove.scheduled = false;
-};
-
-});
-
-define('ace/keyboard/vim/commands', ['require', 'exports', 'module' , 'ace/keyboard/vim/maps/util', 'ace/keyboard/vim/maps/motions', 'ace/keyboard/vim/maps/operators', 'ace/keyboard/vim/maps/aliases', 'ace/keyboard/vim/registers'], function(require, exports, module) {
-
-"never use strict";
-
-var util = require("./maps/util");
-var motions = require("./maps/motions");
-var operators = require("./maps/operators");
-var alias = require("./maps/aliases");
-var registers = require("./registers");
-
-var NUMBER = 1;
-var OPERATOR = 2;
-var MOTION = 3;
-var ACTION = 4;
-var HMARGIN = 8; // Minimum amount of line separation between margins;
-
-var repeat = function repeat(fn, count, args) {
- while (0 < count--)
- fn.apply(this, args);
-};
-
-var ensureScrollMargin = function(editor) {
- var renderer = editor.renderer;
- var pos = renderer.$cursorLayer.getPixelPosition();
-
- var top = pos.top;
-
- var margin = HMARGIN * renderer.layerConfig.lineHeight;
- if (2 * margin > renderer.$size.scrollerHeight)
- margin = renderer.$size.scrollerHeight / 2;
-
- if (renderer.scrollTop > top - margin) {
- renderer.session.setScrollTop(top - margin);
- }
-
- if (renderer.scrollTop + renderer.$size.scrollerHeight < top + margin + renderer.lineHeight) {
- renderer.session.setScrollTop(top + margin + renderer.lineHeight - renderer.$size.scrollerHeight);
- }
-};
-
-var actions = exports.actions = {
- "z": {
- param: true,
- fn: function(editor, range, count, param) {
- switch (param) {
- case "z":
- editor.renderer.alignCursor(null, 0.5);
- break;
- case "t":
- editor.renderer.alignCursor(null, 0);
- break;
- case "b":
- editor.renderer.alignCursor(null, 1);
- break;
- }
- }
- },
- "r": {
- param: true,
- fn: function(editor, range, count, param) {
- if (param && param.length) {
- repeat(function() { editor.insert(param); }, count || 1);
- editor.navigateLeft();
- }
- }
- },
- "R": {
- fn: function(editor, range, count, param) {
- util.insertMode(editor);
- editor.setOverwrite(true);
- }
- },
- "~": {
- fn: function(editor, range, count) {
- repeat(function() {
- var range = editor.selection.getRange();
- if (range.isEmpty())
- range.end.column++;
- var text = editor.session.getTextRange(range);
- var toggled = text.toUpperCase();
- if (toggled == text)
- editor.navigateRight();
- else
- editor.session.replace(range, toggled);
- }, count || 1);
- }
- },
- "*": {
- fn: function(editor, range, count, param) {
- editor.selection.selectWord();
- editor.findNext();
- ensureScrollMargin(editor);
- var r = editor.selection.getRange();
- editor.selection.setSelectionRange(r, true);
- }
- },
- "#": {
- fn: function(editor, range, count, param) {
- editor.selection.selectWord();
- editor.findPrevious();
- ensureScrollMargin(editor);
- var r = editor.selection.getRange();
- editor.selection.setSelectionRange(r, true);
- }
- },
- "m": {
- param: true,
- fn: function(editor, range, count, param) {
- var s = editor.session;
- var markers = s.vimMarkers || (s.vimMarkers = {});
- var c = editor.getCursorPosition();
- if (!markers[param]) {
- markers[param] = editor.session.doc.createAnchor(c);
- }
- markers[param].setPosition(c.row, c.column, true);
- }
- },
- "n": {
- fn: function(editor, range, count, param) {
- var options = editor.getLastSearchOptions();
- options.backwards = false;
-
- editor.selection.moveCursorRight();
- editor.selection.clearSelection();
- editor.findNext(options);
-
- ensureScrollMargin(editor);
- var r = editor.selection.getRange();
- r.end.row = r.start.row;
- r.end.column = r.start.column;
- editor.selection.setSelectionRange(r, true);
- }
- },
- "N": {
- fn: function(editor, range, count, param) {
- var options = editor.getLastSearchOptions();
- options.backwards = true;
-
- editor.findPrevious(options);
- ensureScrollMargin(editor);
- var r = editor.selection.getRange();
- r.end.row = r.start.row;
- r.end.column = r.start.column;
- editor.selection.setSelectionRange(r, true);
- }
- },
- "v": {
- fn: function(editor, range, count, param) {
- editor.selection.selectRight();
- util.visualMode(editor, false);
- },
- acceptsMotion: true
- },
- "V": {
- fn: function(editor, range, count, param) {
- var row = editor.getCursorPosition().row;
- editor.selection.clearSelection();
- editor.selection.moveCursorTo(row, 0);
- editor.selection.selectLineEnd();
- editor.selection.visualLineStart = row;
-
- util.visualMode(editor, true);
- },
- acceptsMotion: true
- },
- "Y": {
- fn: function(editor, range, count, param) {
- util.copyLine(editor);
- }
- },
- "p": {
- fn: function(editor, range, count, param) {
- var defaultReg = registers._default;
-
- editor.setOverwrite(false);
- if (defaultReg.isLine) {
- var pos = editor.getCursorPosition();
- var lines = defaultReg.text.split("\n");
- editor.session.getDocument().insertLines(pos.row + 1, lines);
- editor.moveCursorTo(pos.row + 1, 0);
- }
- else {
- editor.navigateRight();
- editor.insert(defaultReg.text);
- editor.navigateLeft();
- }
- editor.setOverwrite(true);
- editor.selection.clearSelection();
- }
- },
- "P": {
- fn: function(editor, range, count, param) {
- var defaultReg = registers._default;
- editor.setOverwrite(false);
-
- if (defaultReg.isLine) {
- var pos = editor.getCursorPosition();
- var lines = defaultReg.text.split("\n");
- editor.session.getDocument().insertLines(pos.row, lines);
- editor.moveCursorTo(pos.row, 0);
- }
- else {
- editor.insert(defaultReg.text);
- }
- editor.setOverwrite(true);
- editor.selection.clearSelection();
- }
- },
- "J": {
- fn: function(editor, range, count, param) {
- var session = editor.session;
- range = editor.getSelectionRange();
- var pos = {row: range.start.row, column: range.start.column};
- count = count || range.end.row - range.start.row;
- var maxRow = Math.min(pos.row + (count || 1), session.getLength() - 1);
-
- range.start.column = session.getLine(pos.row).length;
- range.end.column = session.getLine(maxRow).length;
- range.end.row = maxRow;
-
- var text = "";
- for (var i = pos.row; i < maxRow; i++) {
- var nextLine = session.getLine(i + 1);
- text += " " + /^\s*(.*)$/.exec(nextLine)[1] || "";
- }
-
- session.replace(range, text);
- editor.moveCursorTo(pos.row, pos.column);
- }
- },
- "u": {
- fn: function(editor, range, count, param) {
- count = parseInt(count || 1, 10);
- for (var i = 0; i < count; i++) {
- editor.undo();
- }
- editor.selection.clearSelection();
- }
- },
- "ctrl-r": {
- fn: function(editor, range, count, param) {
- count = parseInt(count || 1, 10);
- for (var i = 0; i < count; i++) {
- editor.redo();
- }
- editor.selection.clearSelection();
- }
- },
- ":": {
- fn: function(editor, range, count, param) {
- }
- },
- "/": {
- fn: function(editor, range, count, param) {
- }
- },
- "?": {
- fn: function(editor, range, count, param) {
- }
- },
- ".": {
- fn: function(editor, range, count, param) {
- util.onInsertReplaySequence = inputBuffer.lastInsertCommands;
- var previous = inputBuffer.previous;
- if (previous) // If there is a previous action
- inputBuffer.exec(editor, previous.action, previous.param);
- }
- },
- "ctrl-x": {
- fn: function(editor, range, count, param) {
- editor.modifyNumber(-(count || 1));
- }
- },
- "ctrl-a": {
- fn: function(editor, range, count, param) {
- editor.modifyNumber(count || 1);
- }
- },
-};
-
-var inputBuffer = exports.inputBuffer = {
- accepting: [NUMBER, OPERATOR, MOTION, ACTION],
- currentCmd: null,
- currentCount: "",
- status: "",
- operator: null,
- motion: null,
-
- lastInsertCommands: [],
-
- push: function(editor, ch, keyId) {
- var isKeyHandled = true;
- this.idle = false;
- var wObj = this.waitingForParam;
- if (wObj) {
- this.exec(editor, wObj, ch);
- }
- else if (!(ch === "0" && !this.currentCount.length) &&
- (ch.match(/^\d+$/) && this.isAccepting(NUMBER))) {
- this.currentCount += ch;
- this.currentCmd = NUMBER;
- this.accepting = [NUMBER, OPERATOR, MOTION, ACTION];
- }
- else if (!this.operator && this.isAccepting(OPERATOR) && operators[ch]) {
- this.operator = {
- ch: ch,
- count: this.getCount()
- };
- this.currentCmd = OPERATOR;
- this.accepting = [NUMBER, MOTION, ACTION];
- this.exec(editor, { operator: this.operator });
- }
- else if (motions[ch] && this.isAccepting(MOTION)) {
- this.currentCmd = MOTION;
-
- var ctx = {
- operator: this.operator,
- motion: {
- ch: ch,
- count: this.getCount()
- }
- };
-
- if (motions[ch].param)
- this.waitForParam(ctx);
- else
- this.exec(editor, ctx);
- }
- else if (alias[ch] && this.isAccepting(MOTION)) {
- alias[ch].operator.count = this.getCount();
- this.exec(editor, alias[ch]);
- }
- else if (actions[ch] && this.isAccepting(ACTION)) {
- var actionObj = {
- action: {
- fn: actions[ch].fn,
- count: this.getCount()
- }
- };
-
- if (actions[ch].param) {
- this.waitForParam(actionObj);
- }
- else {
- this.exec(editor, actionObj);
- }
-
- if (actions[ch].acceptsMotion)
- this.idle = false;
- }
- else if (this.operator) {
- this.exec(editor, { operator: this.operator }, ch);
- }
- else {
- isKeyHandled = ch.length == 1;
- this.reset();
- }
-
- if (this.waitingForParam || this.motion || this.operator) {
- this.status += ch;
- } else if (this.currentCount) {
- this.status = this.currentCount;
- } else if (this.status) {
- this.status = "";
- } else {
- return isKeyHandled;
- }
- editor._emit("changeStatus");
- return isKeyHandled;
- },
-
- waitForParam: function(cmd) {
- this.waitingForParam = cmd;
- },
-
- getCount: function() {
- var count = this.currentCount;
- this.currentCount = "";
- return count && parseInt(count, 10);
- },
-
- exec: function(editor, action, param) {
- var m = action.motion;
- var o = action.operator;
- var a = action.action;
-
- if (!param)
- param = action.param;
-
- if (o) {
- this.previous = {
- action: action,
- param: param
- };
- }
-
- if (o && !editor.selection.isEmpty()) {
- if (operators[o.ch].selFn) {
- operators[o.ch].selFn(editor, editor.getSelectionRange(), o.count, param);
- this.reset();
- }
- return;
- }
- else if (!m && !a && o && param) {
- operators[o.ch].fn(editor, null, o.count, param);
- this.reset();
- }
- else if (m) {
- var run = function(fn) {
- if (fn && typeof fn === "function") { // There should always be a motion
- if (m.count && !motionObj.handlesCount)
- repeat(fn, m.count, [editor, null, m.count, param]);
- else
- fn(editor, null, m.count, param);
- }
- };
-
- var motionObj = motions[m.ch];
- var selectable = motionObj.sel;
-
- if (!o) {
- if ((util.onVisualMode || util.onVisualLineMode) && selectable)
- run(motionObj.sel);
- else
- run(motionObj.nav);
- }
- else if (selectable) {
- repeat(function() {
- run(motionObj.sel);
- operators[o.ch].fn(editor, editor.getSelectionRange(), o.count, param);
- }, o.count || 1);
- }
- this.reset();
- }
- else if (a) {
- a.fn(editor, editor.getSelectionRange(), a.count, param);
- this.reset();
- }
- handleCursorMove(editor);
- },
-
- isAccepting: function(type) {
- return this.accepting.indexOf(type) !== -1;
- },
-
- reset: function() {
- this.operator = null;
- this.motion = null;
- this.currentCount = "";
- this.status = "";
- this.accepting = [NUMBER, OPERATOR, MOTION, ACTION];
- this.idle = true;
- this.waitingForParam = null;
- }
-};
-
-function setPreviousCommand(fn) {
- inputBuffer.previous = { action: { action: { fn: fn } } };
-}
-
-exports.coreCommands = {
- start: {
- exec: function start(editor) {
- util.insertMode(editor);
- setPreviousCommand(start);
- }
- },
- startBeginning: {
- exec: function startBeginning(editor) {
- editor.navigateLineStart();
- util.insertMode(editor);
- setPreviousCommand(startBeginning);
- }
- },
- stop: {
- exec: function stop(editor) {
- inputBuffer.reset();
- util.onVisualMode = false;
- util.onVisualLineMode = false;
- inputBuffer.lastInsertCommands = util.normalMode(editor);
- }
- },
- append: {
- exec: function append(editor) {
- var pos = editor.getCursorPosition();
- var lineLen = editor.session.getLine(pos.row).length;
- if (lineLen)
- editor.navigateRight();
- util.insertMode(editor);
- setPreviousCommand(append);
- }
- },
- appendEnd: {
- exec: function appendEnd(editor) {
- editor.navigateLineEnd();
- util.insertMode(editor);
- setPreviousCommand(appendEnd);
- }
- }
-};
-
-var handleCursorMove = exports.onCursorMove = function(editor, e) {
- if (util.currentMode === 'insert' || handleCursorMove.running)
- return;
- else if(!editor.selection.isEmpty()) {
- handleCursorMove.running = true;
- if (util.onVisualLineMode) {
- var originRow = editor.selection.visualLineStart;
- var cursorRow = editor.getCursorPosition().row;
- if(originRow <= cursorRow) {
- var endLine = editor.session.getLine(cursorRow);
- editor.selection.clearSelection();
- editor.selection.moveCursorTo(originRow, 0);
- editor.selection.selectTo(cursorRow, endLine.length);
- } else {
- var endLine = editor.session.getLine(originRow);
- editor.selection.clearSelection();
- editor.selection.moveCursorTo(originRow, endLine.length);
- editor.selection.selectTo(cursorRow, 0);
- }
- }
- handleCursorMove.running = false;
- return;
- }
- else {
- if (e && (util.onVisualLineMode || util.onVisualMode)) {
- editor.selection.clearSelection();
- util.normalMode(editor);
- }
-
- handleCursorMove.running = true;
- var pos = editor.getCursorPosition();
- var lineLen = editor.session.getLine(pos.row).length;
-
- if (lineLen && pos.column === lineLen)
- editor.navigateLeft();
- handleCursorMove.running = false;
- }
-};
-});
-define('ace/keyboard/vim/maps/util', ['require', 'exports', 'module' , 'ace/keyboard/vim/registers', 'ace/lib/dom'], function(require, exports, module) {
-var registers = require("../registers");
-
-var dom = require("../../../lib/dom");
-dom.importCssString('.insert-mode .ace_cursor{\
- border-left: 2px solid #333333;\
-}\
-.ace_dark.insert-mode .ace_cursor{\
- border-left: 2px solid #eeeeee;\
-}\
-.normal-mode .ace_cursor{\
- border: 0!important;\
- background-color: red;\
- opacity: 0.5;\
-}', 'vimMode');
-
-module.exports = {
- onVisualMode: false,
- onVisualLineMode: false,
- currentMode: 'normal',
- noMode: function(editor) {
- editor.unsetStyle('insert-mode');
- editor.unsetStyle('normal-mode');
- if (editor.commands.recording)
- editor.commands.toggleRecording(editor);
- editor.setOverwrite(false);
- },
- insertMode: function(editor) {
- this.currentMode = 'insert';
- editor.setStyle('insert-mode');
- editor.unsetStyle('normal-mode');
-
- editor.setOverwrite(false);
- editor.keyBinding.$data.buffer = "";
- editor.keyBinding.$data.state = "insertMode";
- this.onVisualMode = false;
- this.onVisualLineMode = false;
- if(this.onInsertReplaySequence) {
- editor.commands.macro = this.onInsertReplaySequence;
- editor.commands.replay(editor);
- this.onInsertReplaySequence = null;
- this.normalMode(editor);
- } else {
- editor._emit("changeStatus");
- if(!editor.commands.recording)
- editor.commands.toggleRecording(editor);
- }
- },
- normalMode: function(editor) {
- this.currentMode = 'normal';
-
- editor.unsetStyle('insert-mode');
- editor.setStyle('normal-mode');
- editor.clearSelection();
-
- var pos;
- if (!editor.getOverwrite()) {
- pos = editor.getCursorPosition();
- if (pos.column > 0)
- editor.navigateLeft();
- }
-
- editor.setOverwrite(true);
- editor.keyBinding.$data.buffer = "";
- editor.keyBinding.$data.state = "start";
- this.onVisualMode = false;
- this.onVisualLineMode = false;
- editor._emit("changeStatus");
- if (editor.commands.recording) {
- editor.commands.toggleRecording(editor);
- return editor.commands.macro;
- }
- else {
- return [];
- }
- },
- visualMode: function(editor, lineMode) {
- if (
- (this.onVisualLineMode && lineMode)
- || (this.onVisualMode && !lineMode)
- ) {
- this.normalMode(editor);
- return;
- }
-
- editor.setStyle('insert-mode');
- editor.unsetStyle('normal-mode');
-
- editor._emit("changeStatus");
- if (lineMode) {
- this.onVisualLineMode = true;
- } else {
- this.onVisualMode = true;
- this.onVisualLineMode = false;
- }
- },
- getRightNthChar: function(editor, cursor, ch, n) {
- var line = editor.getSession().getLine(cursor.row);
- var matches = line.substr(cursor.column + 1).split(ch);
-
- return n < matches.length ? matches.slice(0, n).join(ch).length : null;
- },
- getLeftNthChar: function(editor, cursor, ch, n) {
- var line = editor.getSession().getLine(cursor.row);
- var matches = line.substr(0, cursor.column).split(ch);
-
- return n < matches.length ? matches.slice(-1 * n).join(ch).length : null;
- },
- toRealChar: function(ch) {
- if (ch.length === 1)
- return ch;
-
- if (/^shift-./.test(ch))
- return ch[ch.length - 1].toUpperCase();
- else
- return "";
- },
- copyLine: function(editor) {
- var pos = editor.getCursorPosition();
- editor.selection.clearSelection();
- editor.moveCursorTo(pos.row, pos.column);
- editor.selection.selectLine();
- registers._default.isLine = true;
- registers._default.text = editor.getCopyText().replace(/\n$/, "");
- editor.selection.clearSelection();
- editor.moveCursorTo(pos.row, pos.column);
- }
-};
-});
-
-define('ace/keyboard/vim/registers', ['require', 'exports', 'module' ], function(require, exports, module) {
-
-"never use strict";
-
-module.exports = {
- _default: {
- text: "",
- isLine: false
- }
-};
-
-});
-
-
-define('ace/keyboard/vim/maps/motions', ['require', 'exports', 'module' , 'ace/keyboard/vim/maps/util', 'ace/search', 'ace/range'], function(require, exports, module) {
-
-
-var util = require("./util");
-
-var keepScrollPosition = function(editor, fn) {
- var scrollTopRow = editor.renderer.getScrollTopRow();
- var initialRow = editor.getCursorPosition().row;
- var diff = initialRow - scrollTopRow;
- fn && fn.call(editor);
- editor.renderer.scrollToRow(editor.getCursorPosition().row - diff);
-};
-
-function Motion(m) {
- if (typeof m == "function") {
- var getPos = m;
- m = this;
- } else {
- var getPos = m.getPos;
- }
- m.nav = function(editor, range, count, param) {
- var a = getPos(editor, range, count, param, false);
- if (!a)
- return;
- editor.clearSelection();
- editor.moveCursorTo(a.row, a.column);
- };
- m.sel = function(editor, range, count, param) {
- var a = getPos(editor, range, count, param, true);
- if (!a)
- return;
- editor.selection.selectTo(a.row, a.column);
- };
- return m;
-}
-
-var nonWordRe = /[\s.\/\\()\"'-:,.;<>~!@#$%^&*|+=\[\]{}`~?]/;
-var wordSeparatorRe = /[.\/\\()\"'-:,.;<>~!@#$%^&*|+=\[\]{}`~?]/;
-var whiteRe = /\s/;
-var StringStream = function(editor, cursor) {
- var sel = editor.selection;
- this.range = sel.getRange();
- cursor = cursor || sel.selectionLead;
- this.row = cursor.row;
- this.col = cursor.column;
- var line = editor.session.getLine(this.row);
- var maxRow = editor.session.getLength();
- this.ch = line[this.col] || '\n';
- this.skippedLines = 0;
-
- this.next = function() {
- this.ch = line[++this.col] || this.handleNewLine(1);
- return this.ch;
- };
- this.prev = function() {
- this.ch = line[--this.col] || this.handleNewLine(-1);
- return this.ch;
- };
- this.peek = function(dir) {
- var ch = line[this.col + dir];
- if (ch)
- return ch;
- if (dir == -1)
- return '\n';
- if (this.col == line.length - 1)
- return '\n';
- return editor.session.getLine(this.row + 1)[0] || '\n';
- };
-
- this.handleNewLine = function(dir) {
- if (dir == 1){
- if (this.col == line.length)
- return '\n';
- if (this.row == maxRow - 1)
- return '';
- this.col = 0;
- this.row ++;
- line = editor.session.getLine(this.row);
- this.skippedLines++;
- return line[0] || '\n';
- }
- if (dir == -1) {
- if (this.row === 0)
- return '';
- this.row --;
- line = editor.session.getLine(this.row);
- this.col = line.length;
- this.skippedLines--;
- return '\n';
- }
- };
- this.debug = function() {
- console.log(line.substring(0, this.col)+'|'+this.ch+'\''+this.col+'\''+line.substr(this.col+1));
- };
-};
-
-var Search = require("../../../search").Search;
-var search = new Search();
-
-function find(editor, needle, dir) {
- search.$options.needle = needle;
- search.$options.backwards = dir == -1;
- return search.find(editor.session);
-}
-
-var Range = require("../../../range").Range;
-
-module.exports = {
- "w": new Motion(function(editor) {
- var str = new StringStream(editor);
-
- if (str.ch && wordSeparatorRe.test(str.ch)) {
- while (str.ch && wordSeparatorRe.test(str.ch))
- str.next();
- } else {
- while (str.ch && !nonWordRe.test(str.ch))
- str.next();
- }
- while (str.ch && whiteRe.test(str.ch) && str.skippedLines < 2)
- str.next();
-
- str.skippedLines == 2 && str.prev();
- return {column: str.col, row: str.row};
- }),
- "W": new Motion(function(editor) {
- var str = new StringStream(editor);
- while(str.ch && !(whiteRe.test(str.ch) && !whiteRe.test(str.peek(1))) && str.skippedLines < 2)
- str.next();
- if (str.skippedLines == 2)
- str.prev();
- else
- str.next();
-
- return {column: str.col, row: str.row};
- }),
- "b": new Motion(function(editor) {
- var str = new StringStream(editor);
-
- str.prev();
- while (str.ch && whiteRe.test(str.ch) && str.skippedLines > -2)
- str.prev();
-
- if (str.ch && wordSeparatorRe.test(str.ch)) {
- while (str.ch && wordSeparatorRe.test(str.ch))
- str.prev();
- } else {
- while (str.ch && !nonWordRe.test(str.ch))
- str.prev();
- }
- str.ch && str.next();
- return {column: str.col, row: str.row};
- }),
- "B": new Motion(function(editor) {
- var str = new StringStream(editor);
- str.prev();
- while(str.ch && !(!whiteRe.test(str.ch) && whiteRe.test(str.peek(-1))) && str.skippedLines > -2)
- str.prev();
-
- if (str.skippedLines == -2)
- str.next();
-
- return {column: str.col, row: str.row};
- }),
- "e": new Motion(function(editor) {
- var str = new StringStream(editor);
-
- str.next();
- while (str.ch && whiteRe.test(str.ch))
- str.next();
-
- if (str.ch && wordSeparatorRe.test(str.ch)) {
- while (str.ch && wordSeparatorRe.test(str.ch))
- str.next();
- } else {
- while (str.ch && !nonWordRe.test(str.ch))
- str.next();
- }
- str.ch && str.prev();
- return {column: str.col, row: str.row};
- }),
- "E": new Motion(function(editor) {
- var str = new StringStream(editor);
- str.next();
- while(str.ch && !(!whiteRe.test(str.ch) && whiteRe.test(str.peek(1))))
- str.next();
-
- return {column: str.col, row: str.row};
- }),
-
- "l": {
- nav: function(editor) {
- var pos = editor.getCursorPosition();
- var col = pos.column;
- var lineLen = editor.session.getLine(pos.row).length;
- if (lineLen && col !== lineLen)
- editor.navigateRight();
- },
- sel: function(editor) {
- var pos = editor.getCursorPosition();
- var col = pos.column;
- var lineLen = editor.session.getLine(pos.row).length;
- if (lineLen && col !== lineLen) //In selection mode you can select the newline
- editor.selection.selectRight();
- }
- },
- "h": {
- nav: function(editor) {
- var pos = editor.getCursorPosition();
- if (pos.column > 0)
- editor.navigateLeft();
- },
- sel: function(editor) {
- var pos = editor.getCursorPosition();
- if (pos.column > 0)
- editor.selection.selectLeft();
- }
- },
- "H": {
- nav: function(editor) {
- var row = editor.renderer.getScrollTopRow();
- editor.moveCursorTo(row);
- },
- sel: function(editor) {
- var row = editor.renderer.getScrollTopRow();
- editor.selection.selectTo(row);
- }
- },
- "M": {
- nav: function(editor) {
- var topRow = editor.renderer.getScrollTopRow();
- var bottomRow = editor.renderer.getScrollBottomRow();
- var row = topRow + ((bottomRow - topRow) / 2);
- editor.moveCursorTo(row);
- },
- sel: function(editor) {
- var topRow = editor.renderer.getScrollTopRow();
- var bottomRow = editor.renderer.getScrollBottomRow();
- var row = topRow + ((bottomRow - topRow) / 2);
- editor.selection.selectTo(row);
- }
- },
- "L": {
- nav: function(editor) {
- var row = editor.renderer.getScrollBottomRow();
- editor.moveCursorTo(row);
- },
- sel: function(editor) {
- var row = editor.renderer.getScrollBottomRow();
- editor.selection.selectTo(row);
- }
- },
- "k": {
- nav: function(editor) {
- editor.navigateUp();
- },
- sel: function(editor) {
- editor.selection.selectUp();
- }
- },
- "j": {
- nav: function(editor) {
- editor.navigateDown();
- },
- sel: function(editor) {
- editor.selection.selectDown();
- }
- },
-
- "i": {
- param: true,
- sel: function(editor, range, count, param) {
- switch (param) {
- case "w":
- editor.selection.selectWord();
- break;
- case "W":
- editor.selection.selectAWord();
- break;
- case "(":
- case "{":
- case "[":
- var cursor = editor.getCursorPosition();
- var end = editor.session.$findClosingBracket(param, cursor, /paren/);
- if (!end)
- return;
- var start = editor.session.$findOpeningBracket(editor.session.$brackets[param], cursor, /paren/);
- if (!start)
- return;
- start.column ++;
- editor.selection.setSelectionRange(Range.fromPoints(start, end));
- break;
- case "'":
- case '"':
- case "/":
- var end = find(editor, param, 1);
- if (!end)
- return;
- var start = find(editor, param, -1);
- if (!start)
- return;
- editor.selection.setSelectionRange(Range.fromPoints(start.end, end.start));
- break;
- }
- }
- },
- "a": {
- param: true,
- sel: function(editor, range, count, param) {
- switch (param) {
- case "w":
- editor.selection.selectAWord();
- break;
- case "W":
- editor.selection.selectAWord();
- break;
- case "(":
- case "{":
- case "[":
- var cursor = editor.getCursorPosition();
- var end = editor.session.$findClosingBracket(param, cursor, /paren/);
- if (!end)
- return;
- var start = editor.session.$findOpeningBracket(editor.session.$brackets[param], cursor, /paren/);
- if (!start)
- return;
- end.column ++;
- editor.selection.setSelectionRange(Range.fromPoints(start, end));
- break;
- case "'":
- case "\"":
- case "/":
- var end = find(editor, param, 1);
- if (!end)
- return;
- var start = find(editor, param, -1);
- if (!start)
- return;
- end.column ++;
- editor.selection.setSelectionRange(Range.fromPoints(start.start, end.end));
- break;
- }
- }
- },
-
- "f": new Motion({
- param: true,
- handlesCount: true,
- getPos: function(editor, range, count, param, isSel) {
- var cursor = editor.getCursorPosition();
- var column = util.getRightNthChar(editor, cursor, param, count || 1);
-
- if (typeof column === "number") {
- cursor.column += column + (isSel ? 2 : 1);
- return cursor;
- }
- }
- }),
- "F": new Motion({
- param: true,
- handlesCount: true,
- getPos: function(editor, range, count, param, isSel) {
- var cursor = editor.getCursorPosition();
- var column = util.getLeftNthChar(editor, cursor, param, count || 1);
-
- if (typeof column === "number") {
- cursor.column -= column + 1;
- return cursor;
- }
- }
- }),
- "t": new Motion({
- param: true,
- handlesCount: true,
- getPos: function(editor, range, count, param, isSel) {
- var cursor = editor.getCursorPosition();
- var column = util.getRightNthChar(editor, cursor, param, count || 1);
-
- if (typeof column === "number") {
- cursor.column += column + (isSel ? 1 : 0);
- return cursor;
- }
- }
- }),
- "T": new Motion({
- param: true,
- handlesCount: true,
- getPos: function(editor, range, count, param, isSel) {
- var cursor = editor.getCursorPosition();
- var column = util.getLeftNthChar(editor, cursor, param, count || 1);
-
- if (typeof column === "number") {
- cursor.column -= column;
- return cursor;
- }
- }
- }),
-
- "^": {
- nav: function(editor) {
- editor.navigateLineStart();
- },
- sel: function(editor) {
- editor.selection.selectLineStart();
- }
- },
- "$": {
- nav: function(editor) {
- editor.navigateLineEnd();
- },
- sel: function(editor) {
- editor.selection.selectLineEnd();
- }
- },
- "0": new Motion(function(ed) {
- return {row: ed.selection.lead.row, column: 0};
- }),
- "G": {
- nav: function(editor, range, count, param) {
- if (!count && count !== 0) { // Stupid JS
- count = editor.session.getLength();
- }
- editor.gotoLine(count);
- },
- sel: function(editor, range, count, param) {
- if (!count && count !== 0) { // Stupid JS
- count = editor.session.getLength();
- }
- editor.selection.selectTo(count, 0);
- }
- },
- "g": {
- param: true,
- nav: function(editor, range, count, param) {
- switch(param) {
- case "m":
- console.log("Middle line");
- break;
- case "e":
- console.log("End of prev word");
- break;
- case "g":
- editor.gotoLine(count || 0);
- case "u":
- editor.gotoLine(count || 0);
- case "U":
- editor.gotoLine(count || 0);
- }
- },
- sel: function(editor, range, count, param) {
- switch(param) {
- case "m":
- console.log("Middle line");
- break;
- case "e":
- console.log("End of prev word");
- break;
- case "g":
- editor.selection.selectTo(count || 0, 0);
- }
- }
- },
- "o": {
- nav: function(editor, range, count, param) {
- count = count || 1;
- var content = "";
- while (0 < count--)
- content += "\n";
-
- if (content.length) {
- editor.navigateLineEnd()
- editor.insert(content);
- util.insertMode(editor);
- }
- }
- },
- "O": {
- nav: function(editor, range, count, param) {
- var row = editor.getCursorPosition().row;
- count = count || 1;
- var content = "";
- while (0 < count--)
- content += "\n";
-
- if (content.length) {
- if(row > 0) {
- editor.navigateUp();
- editor.navigateLineEnd()
- editor.insert(content);
- } else {
- editor.session.insert({row: 0, column: 0}, content);
- editor.navigateUp();
- }
- util.insertMode(editor);
- }
- }
- },
- "%": new Motion(function(editor){
- var brRe = /[\[\]{}()]/g;
- var cursor = editor.getCursorPosition();
- var ch = editor.session.getLine(cursor.row)[cursor.column];
- if (!brRe.test(ch)) {
- var range = find(editor, brRe);
- if (!range)
- return;
- cursor = range.start;
- }
- var match = editor.session.findMatchingBracket({
- row: cursor.row,
- column: cursor.column + 1
- });
-
- return match;
- }),
- "{": new Motion(function(ed) {
- var session = ed.session;
- var row = session.selection.lead.row;
- while(row > 0 && !/\S/.test(session.getLine(row)))
- row--;
- while(/\S/.test(session.getLine(row)))
- row--;
- return {column: 0, row: row};
- }),
- "}": new Motion(function(ed) {
- var session = ed.session;
- var l = session.getLength();
- var row = session.selection.lead.row;
- while(row < l && !/\S/.test(session.getLine(row)))
- row++;
- while(/\S/.test(session.getLine(row)))
- row++;
- return {column: 0, row: row};
- }),
- "ctrl-d": {
- nav: function(editor, range, count, param) {
- editor.selection.clearSelection();
- keepScrollPosition(editor, editor.gotoPageDown);
- },
- sel: function(editor, range, count, param) {
- keepScrollPosition(editor, editor.selectPageDown);
- }
- },
- "ctrl-u": {
- nav: function(editor, range, count, param) {
- editor.selection.clearSelection();
- keepScrollPosition(editor, editor.gotoPageUp);
- },
- sel: function(editor, range, count, param) {
- keepScrollPosition(editor, editor.selectPageUp);
- }
- },
- "`": new Motion({
- param: true,
- handlesCount: true,
- getPos: function(editor, range, count, param, isSel) {
- var s = editor.session;
- var marker = s.vimMarkers && s.vimMarkers[param];
- if (marker) {
- return marker.getPosition();
- }
- }
- }),
- "'": new Motion({
- param: true,
- handlesCount: true,
- getPos: function(editor, range, count, param, isSel) {
- var s = editor.session;
- var marker = s.vimMarkers && s.vimMarkers[param];
- if (marker) {
- var pos = marker.getPosition();
- var line = editor.session.getLine(pos.row);
- pos.column = line.search(/\S/);
- if (pos.column == -1)
- pos.column = line.length;
- return pos;
- }
- }
- }),
-};
-
-module.exports.backspace = module.exports.left = module.exports.h;
-module.exports.right = module.exports.l;
-module.exports.up = module.exports.k;
-module.exports.down = module.exports.j;
-module.exports.pagedown = module.exports["ctrl-d"];
-module.exports.pageup = module.exports["ctrl-u"];
-
-});
-
-define('ace/keyboard/vim/maps/operators', ['require', 'exports', 'module' , 'ace/keyboard/vim/maps/util', 'ace/keyboard/vim/registers'], function(require, exports, module) {
-
-"never use strict";
-
-var util = require("./util");
-var registers = require("../registers");
-
-module.exports = {
- "d": {
- selFn: function(editor, range, count, param) {
- registers._default.text = editor.getCopyText();
- registers._default.isLine = util.onVisualLineMode;
- if(util.onVisualLineMode)
- editor.removeLines();
- else
- editor.session.remove(range);
- util.normalMode(editor);
- },
- fn: function(editor, range, count, param) {
- count = count || 1;
- switch (param) {
- case "d":
- registers._default.text = "";
- registers._default.isLine = true;
- for (var i = 0; i < count; i++) {
- editor.selection.selectLine();
- registers._default.text += editor.getCopyText();
- var selRange = editor.getSelectionRange();
- if (!selRange.isMultiLine()) {
- lastLineReached = true
- var row = selRange.start.row - 1;
- var col = editor.session.getLine(row).length
- selRange.setStart(row, col);
- editor.session.remove(selRange);
- editor.selection.clearSelection();
- break;
- }
- editor.session.remove(selRange);
- editor.selection.clearSelection();
- }
- registers._default.text = registers._default.text.replace(/\n$/, "");
- break;
- default:
- if (range) {
- editor.selection.setSelectionRange(range);
- registers._default.text = editor.getCopyText();
- registers._default.isLine = false;
- editor.session.remove(range);
- editor.selection.clearSelection();
- }
- }
- }
- },
- "c": {
- selFn: function(editor, range, count, param) {
- editor.session.remove(range);
- util.insertMode(editor);
- },
- fn: function(editor, range, count, param) {
- count = count || 1;
- switch (param) {
- case "c":
- for (var i = 0; i < count; i++) {
- editor.removeLines();
- util.insertMode(editor);
- }
-
- break;
- default:
- if (range) {
- editor.session.remove(range);
- util.insertMode(editor);
- }
- }
- }
- },
- "y": {
- selFn: function(editor, range, count, param) {
- registers._default.text = editor.getCopyText();
- registers._default.isLine = util.onVisualLineMode;
- editor.selection.clearSelection();
- util.normalMode(editor);
- },
- fn: function(editor, range, count, param) {
- count = count || 1;
- switch (param) {
- case "y":
- var pos = editor.getCursorPosition();
- editor.selection.selectLine();
- for (var i = 0; i < count - 1; i++) {
- editor.selection.moveCursorDown();
- }
- registers._default.text = editor.getCopyText().replace(/\n$/, "");
- editor.selection.clearSelection();
- registers._default.isLine = true;
- editor.moveCursorToPosition(pos);
- break;
- default:
- if (range) {
- var pos = editor.getCursorPosition();
- editor.selection.setSelectionRange(range);
- registers._default.text = editor.getCopyText();
- registers._default.isLine = false;
- editor.selection.clearSelection();
- editor.moveCursorTo(pos.row, pos.column);
- }
- }
- }
- },
- ">": {
- selFn: function(editor, range, count, param) {
- count = count || 1;
- for (var i = 0; i < count; i++) {
- editor.indent();
- }
- util.normalMode(editor);
- },
- fn: function(editor, range, count, param) {
- count = parseInt(count || 1, 10);
- switch (param) {
- case ">":
- var pos = editor.getCursorPosition();
- editor.selection.selectLine();
- for (var i = 0; i < count - 1; i++) {
- editor.selection.moveCursorDown();
- }
- editor.indent();
- editor.selection.clearSelection();
- editor.moveCursorToPosition(pos);
- editor.navigateLineEnd();
- editor.navigateLineStart();
- break;
- }
- }
- },
- "<": {
- selFn: function(editor, range, count, param) {
- count = count || 1;
- for (var i = 0; i < count; i++) {
- editor.blockOutdent();
- }
- util.normalMode(editor);
- },
- fn: function(editor, range, count, param) {
- count = count || 1;
- switch (param) {
- case "<":
- var pos = editor.getCursorPosition();
- editor.selection.selectLine();
- for (var i = 0; i < count - 1; i++) {
- editor.selection.moveCursorDown();
- }
- editor.blockOutdent();
- editor.selection.clearSelection();
- editor.moveCursorToPosition(pos);
- editor.navigateLineEnd();
- editor.navigateLineStart();
- break;
- }
- }
- }
-};
-});
-
-"use strict"
-
-define('ace/keyboard/vim/maps/aliases', ['require', 'exports', 'module' ], function(require, exports, module) {
-module.exports = {
- "x": {
- operator: {
- ch: "d",
- count: 1
- },
- motion: {
- ch: "l",
- count: 1
- }
- },
- "X": {
- operator: {
- ch: "d",
- count: 1
- },
- motion: {
- ch: "h",
- count: 1
- }
- },
- "D": {
- operator: {
- ch: "d",
- count: 1
- },
- motion: {
- ch: "$",
- count: 1
- }
- },
- "C": {
- operator: {
- ch: "c",
- count: 1
- },
- motion: {
- ch: "$",
- count: 1
- }
- },
- "s": {
- operator: {
- ch: "c",
- count: 1
- },
- motion: {
- ch: "l",
- count: 1
- }
- },
- "S": {
- operator: {
- ch: "c",
- count: 1
- },
- param: "c"
- }
-};
-});
-
diff --git a/public/libs/ace/mode-css.js b/public/libs/ace/mode-css.js
deleted file mode 100644
index 017d1c1..0000000
--- a/public/libs/ace/mode-css.js
+++ /dev/null
@@ -1,751 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Distributed under the BSD license:
- *
- * Copyright (c) 2010, Ajax.org B.V.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of Ajax.org B.V. nor the
- * names of its contributors may be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * ***** END LICENSE BLOCK ***** */
-
-define('ace/mode/css', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/css_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/worker/worker_client', 'ace/mode/behaviour/css', 'ace/mode/folding/cstyle'], function(require, exports, module) {
-
-
-var oop = require("../lib/oop");
-var TextMode = require("./text").Mode;
-var Tokenizer = require("../tokenizer").Tokenizer;
-var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
-var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
-var WorkerClient = require("../worker/worker_client").WorkerClient;
-var CssBehaviour = require("./behaviour/css").CssBehaviour;
-var CStyleFoldMode = require("./folding/cstyle").FoldMode;
-
-var Mode = function() {
- this.$tokenizer = new Tokenizer(new CssHighlightRules().getRules(), "i");
- this.$outdent = new MatchingBraceOutdent();
- this.$behaviour = new CssBehaviour();
- this.foldingRules = new CStyleFoldMode();
-};
-oop.inherits(Mode, TextMode);
-
-(function() {
-
- this.foldingRules = "cStyle";
-
- this.getNextLineIndent = function(state, line, tab) {
- var indent = this.$getIndent(line);
- var tokens = this.$tokenizer.getLineTokens(line, state).tokens;
- if (tokens.length && tokens[tokens.length-1].type == "comment") {
- return indent;
- }
-
- var match = line.match(/^.*\{\s*$/);
- if (match) {
- indent += tab;
- }
-
- return indent;
- };
-
- this.checkOutdent = function(state, line, input) {
- return this.$outdent.checkOutdent(line, input);
- };
-
- this.autoOutdent = function(state, doc, row) {
- this.$outdent.autoOutdent(doc, row);
- };
-
- this.createWorker = function(session) {
- var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker");
- worker.attachToDocument(session.getDocument());
-
- worker.on("csslint", function(e) {
- session.setAnnotations(e.data);
- });
-
- worker.on("terminate", function() {
- session.clearAnnotations();
- });
-
- return worker;
- };
-
-}).call(Mode.prototype);
-
-exports.Mode = Mode;
-
-});
-
-define('ace/mode/css_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
-
-
-var oop = require("../lib/oop");
-var lang = require("../lib/lang");
-var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
-var supportType = exports.supportType = "animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|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|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|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|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index";
-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 supportConstantColor = exports.supportConstantColor = "aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow";
-var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|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 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 CssHighlightRules = function() {
-
- var keywordMapper = this.createKeywordMapper({
- "support.function": supportFunction,
- "support.constant": supportConstant,
- "support.type": supportType,
- "support.constant.color": supportConstantColor,
- "support.constant.fonts": supportConstantFonts
- }, "text", true);
-
- var base_ruleset = [
- {
- token : "comment", // multi line comment
- regex : "\\/\\*",
- next : "ruleset_comment"
- }, {
- token : "string", // single line
- regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
- }, {
- token : "string", // single line
- regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
- }, {
- 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|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
- }, {
- token : keywordMapper,
- regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
- }
- ];
-
- var ruleset = lang.copyArray(base_ruleset);
- ruleset.unshift({
- token : "paren.rparen",
- regex : "\\}",
- next: "start"
- });
-
- var media_ruleset = lang.copyArray( base_ruleset );
- media_ruleset.unshift({
- token : "paren.rparen",
- regex : "\\}",
- next: "media"
- });
-
- var base_comment = [{
- token : "comment", // comment spanning whole line
- regex : ".+"
- }];
-
- var comment = lang.copyArray(base_comment);
- comment.unshift({
- token : "comment", // closing comment
- regex : ".*?\\*\\/",
- next : "start"
- });
-
- var media_comment = lang.copyArray(base_comment);
- media_comment.unshift({
- token : "comment", // closing comment
- regex : ".*?\\*\\/",
- next : "media"
- });
-
- var ruleset_comment = lang.copyArray(base_comment);
- ruleset_comment.unshift({
- token : "comment", // closing comment
- regex : ".*?\\*\\/",
- next : "ruleset"
- });
-
- this.$rules = {
- "start" : [{
- token : "comment", // multi line comment
- regex : "\\/\\*",
- next : "comment"
- }, {
- token: "paren.lparen",
- regex: "\\{",
- next: "ruleset"
- }, {
- token: "string",
- regex: "@.*?{",
- next: "media"
- },{
- token: "keyword",
- regex: "#[a-z0-9-_]+"
- },{
- token: "variable",
- regex: "\\.[a-z0-9-_]+"
- },{
- token: "string",
- regex: ":[a-z0-9-_]+"
- },{
- token: "constant",
- regex: "[a-z0-9-_]+"
- }],
-
- "media" : [ {
- token : "comment", // multi line comment
- regex : "\\/\\*",
- next : "media_comment"
- }, {
- token: "paren.lparen",
- regex: "\\{",
- next: "media_ruleset"
- },{
- token: "string",
- regex: "\\}",
- next: "start"
- },{
- token: "keyword",
- regex: "#[a-z0-9-_]+"
- },{
- token: "variable",
- regex: "\\.[a-z0-9-_]+"
- },{
- token: "string",
- regex: ":[a-z0-9-_]+"
- },{
- token: "constant",
- regex: "[a-z0-9-_]+"
- }],
-
- "comment" : comment,
-
- "ruleset" : ruleset,
- "ruleset_comment" : ruleset_comment,
-
- "media_ruleset" : media_ruleset,
- "media_comment" : media_comment
- };
-};
-
-oop.inherits(CssHighlightRules, TextHighlightRules);
-
-exports.CssHighlightRules = CssHighlightRules;
-
-});
-
-define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
-
-
-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) {
- var match = line.match(/^(\s+)/);
- if (match) {
- return match[1];
- }
-
- return "";
- };
-
-}).call(MatchingBraceOutdent.prototype);
-
-exports.MatchingBraceOutdent = MatchingBraceOutdent;
-});
-
-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) {
-
-
-var oop = require("../../lib/oop");
-var Behaviour = require("../behaviour").Behaviour;
-var CstyleBehaviour = require("./cstyle").CstyleBehaviour;
-var TokenIterator = require("../../token_iterator").TokenIterator;
-
-var CssBehaviour = function () {
-
- this.inherit(CstyleBehaviour);
-
- this.add("colon", "insertion", function (state, action, editor, session, text) {
- if (text === ':') {
- var cursor = editor.getCursorPosition();
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- var token = iterator.getCurrentToken();
- if (token && token.value.match(/\s+/)) {
- token = iterator.stepBackward();
- }
- if (token && token.type === 'support.type') {
- var line = session.doc.getLine(cursor.row);
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- if (rightChar === ':') {
- return {
- text: '',
- selection: [1, 1]
- }
- }
- if (!line.substring(cursor.column).match(/^\s*;/)) {
- return {
- text: ':;',
- selection: [1, 1]
- }
- }
- }
- }
- });
-
- this.add("colon", "deletion", function (state, action, editor, session, range) {
- var selected = session.doc.getTextRange(range);
- if (!range.isMultiLine() && selected === ':') {
- var line = session.doc.getLine(range.start.row);
- var rightChar = line.substring(range.end.column, range.end.column + 1);
- if (rightChar === ';') {
- range.end.column ++;
- return range;
- }
- }
- });
-
- this.add("semicolon", "insertion", function (state, action, editor, session, text) {
- if (text === ';') {
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- if (rightChar === ';') {
- return {
- text: '',
- selection: [1, 1]
- }
- }
- }
- });
-
-}
-oop.inherits(CssBehaviour, CstyleBehaviour);
-
-exports.CssBehaviour = CssBehaviour;
-});
-
-define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) {
-
-
-var oop = require("../../lib/oop");
-var Behaviour = require("../behaviour").Behaviour;
-var TokenIterator = require("../../token_iterator").TokenIterator;
-var lang = require("../../lib/lang");
-
-var SAFE_INSERT_IN_TOKENS =
- ["text", "paren.rparen", "punctuation.operator"];
-var SAFE_INSERT_BEFORE_TOKENS =
- ["text", "paren.rparen", "punctuation.operator", "comment"];
-
-
-var autoInsertedBrackets = 0;
-var autoInsertedRow = -1;
-var autoInsertedLineEnd = "";
-var maybeInsertedBrackets = 0;
-var maybeInsertedRow = -1;
-var maybeInsertedLineStart = "";
-var maybeInsertedLineEnd = "";
-
-var CstyleBehaviour = function () {
-
- CstyleBehaviour.isSaneInsertion = function(editor, session) {
- var cursor = editor.getCursorPosition();
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) {
- var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1);
- if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS))
- return false;
- }
- iterator.stepForward();
- return iterator.getCurrentTokenRow() !== cursor.row ||
- this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS);
- };
-
- CstyleBehaviour.$matchTokenType = function(token, types) {
- return types.indexOf(token.type || token) > -1;
- };
-
- CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) {
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- if (!this.isAutoInsertedClosing(cursor, line, autoInsertedLineEnd[0]))
- autoInsertedBrackets = 0;
- autoInsertedRow = cursor.row;
- autoInsertedLineEnd = bracket + line.substr(cursor.column);
- autoInsertedBrackets++;
- };
-
- CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) {
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- if (!this.isMaybeInsertedClosing(cursor, line))
- maybeInsertedBrackets = 0;
- maybeInsertedRow = cursor.row;
- maybeInsertedLineStart = line.substr(0, cursor.column) + bracket;
- maybeInsertedLineEnd = line.substr(cursor.column);
- maybeInsertedBrackets++;
- };
-
- CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) {
- return autoInsertedBrackets > 0 &&
- cursor.row === autoInsertedRow &&
- bracket === autoInsertedLineEnd[0] &&
- line.substr(cursor.column) === autoInsertedLineEnd;
- };
-
- CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) {
- return maybeInsertedBrackets > 0 &&
- cursor.row === maybeInsertedRow &&
- line.substr(cursor.column) === maybeInsertedLineEnd &&
- line.substr(0, cursor.column) == maybeInsertedLineStart;
- };
-
- CstyleBehaviour.popAutoInsertedClosing = function() {
- autoInsertedLineEnd = autoInsertedLineEnd.substr(1);
- autoInsertedBrackets--;
- };
-
- CstyleBehaviour.clearMaybeInsertedClosing = function() {
- maybeInsertedBrackets = 0;
- maybeInsertedRow = -1;
- };
-
- this.add("braces", "insertion", function (state, action, editor, session, text) {
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- if (text == '{') {
- var selection = editor.getSelectionRange();
- var selected = session.doc.getTextRange(selection);
- if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) {
- return {
- text: '{' + selected + '}',
- selection: false
- };
- } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
- if (/[\]\}\)]/.test(line[cursor.column])) {
- CstyleBehaviour.recordAutoInsert(editor, session, "}");
- return {
- text: '{}',
- selection: [1, 1]
- };
- } else {
- CstyleBehaviour.recordMaybeInsert(editor, session, "{");
- return {
- text: '{',
- selection: [1, 1]
- };
- }
- }
- } else if (text == '}') {
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- if (rightChar == '}') {
- var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row});
- if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
- CstyleBehaviour.popAutoInsertedClosing();
- return {
- text: '',
- selection: [1, 1]
- };
- }
- }
- } else if (text == "\n" || text == "\r\n") {
- var closing = "";
- if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) {
- closing = lang.stringRepeat("}", maybeInsertedBrackets);
- CstyleBehaviour.clearMaybeInsertedClosing();
- }
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- if (rightChar == '}' || closing !== "") {
- var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column}, '}');
- if (!openBracePos)
- return null;
-
- var indent = this.getNextLineIndent(state, line.substring(0, cursor.column), session.getTabString());
- var next_indent = this.$getIndent(line);
-
- return {
- text: '\n' + indent + '\n' + next_indent + closing,
- selection: [1, indent.length, 1, indent.length]
- };
- }
- }
- });
-
- this.add("braces", "deletion", function (state, action, editor, session, range) {
- var selected = session.doc.getTextRange(range);
- if (!range.isMultiLine() && selected == '{') {
- var line = session.doc.getLine(range.start.row);
- var rightChar = line.substring(range.end.column, range.end.column + 1);
- if (rightChar == '}') {
- range.end.column++;
- return range;
- } else {
- maybeInsertedBrackets--;
- }
- }
- });
-
- this.add("parens", "insertion", function (state, action, editor, session, text) {
- if (text == '(') {
- var selection = editor.getSelectionRange();
- var selected = session.doc.getTextRange(selection);
- if (selected !== "" && editor.getWrapBehavioursEnabled()) {
- return {
- text: '(' + selected + ')',
- selection: false
- };
- } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
- CstyleBehaviour.recordAutoInsert(editor, session, ")");
- return {
- text: '()',
- selection: [1, 1]
- };
- }
- } else if (text == ')') {
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- if (rightChar == ')') {
- var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row});
- if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
- CstyleBehaviour.popAutoInsertedClosing();
- return {
- text: '',
- selection: [1, 1]
- };
- }
- }
- }
- });
-
- this.add("parens", "deletion", function (state, action, editor, session, range) {
- var selected = session.doc.getTextRange(range);
- if (!range.isMultiLine() && selected == '(') {
- var line = session.doc.getLine(range.start.row);
- var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
- if (rightChar == ')') {
- range.end.column++;
- return range;
- }
- }
- });
-
- this.add("brackets", "insertion", function (state, action, editor, session, text) {
- if (text == '[') {
- var selection = editor.getSelectionRange();
- var selected = session.doc.getTextRange(selection);
- if (selected !== "" && editor.getWrapBehavioursEnabled()) {
- return {
- text: '[' + selected + ']',
- selection: false
- };
- } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
- CstyleBehaviour.recordAutoInsert(editor, session, "]");
- return {
- text: '[]',
- selection: [1, 1]
- };
- }
- } else if (text == ']') {
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- if (rightChar == ']') {
- var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row});
- if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
- CstyleBehaviour.popAutoInsertedClosing();
- return {
- text: '',
- selection: [1, 1]
- };
- }
- }
- }
- });
-
- this.add("brackets", "deletion", function (state, action, editor, session, range) {
- var selected = session.doc.getTextRange(range);
- if (!range.isMultiLine() && selected == '[') {
- var line = session.doc.getLine(range.start.row);
- var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
- if (rightChar == ']') {
- range.end.column++;
- return range;
- }
- }
- });
-
- this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
- if (text == '"' || text == "'") {
- var quote = text;
- var selection = editor.getSelectionRange();
- var selected = session.doc.getTextRange(selection);
- if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
- return {
- text: quote + selected + quote,
- selection: false
- };
- } else {
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- var leftChar = line.substring(cursor.column-1, cursor.column);
- if (leftChar == '\\') {
- return null;
- }
- var tokens = session.getTokens(selection.start.row);
- var col = 0, token;
- var quotepos = -1; // Track whether we're inside an open quote.
-
- for (var x = 0; x < tokens.length; x++) {
- token = tokens[x];
- if (token.type == "string") {
- quotepos = -1;
- } else if (quotepos < 0) {
- quotepos = token.value.indexOf(quote);
- }
- if ((token.value.length + col) > selection.start.column) {
- break;
- }
- col += tokens[x].value.length;
- }
- if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) {
- if (!CstyleBehaviour.isSaneInsertion(editor, session))
- return;
- return {
- text: quote + quote,
- selection: [1,1]
- };
- } else if (token && token.type === "string") {
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- if (rightChar == quote) {
- return {
- text: '',
- selection: [1, 1]
- };
- }
- }
- }
- }
- });
-
- this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
- var selected = session.doc.getTextRange(range);
- if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
- var line = session.doc.getLine(range.start.row);
- var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
- if (rightChar == selected) {
- range.end.column++;
- return range;
- }
- }
- });
-
-};
-
-oop.inherits(CstyleBehaviour, Behaviour);
-
-exports.CstyleBehaviour = CstyleBehaviour;
-});
-
-define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
-
-
-var oop = require("../../lib/oop");
-var Range = require("../../range").Range;
-var BaseFoldMode = require("./fold_mode").FoldMode;
-
-var FoldMode = exports.FoldMode = function() {};
-oop.inherits(FoldMode, BaseFoldMode);
-
-(function() {
-
- this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;
- this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
-
- this.getFoldWidgetRange = function(session, foldStyle, row) {
- var line = session.getLine(row);
- var match = line.match(this.foldingStartMarker);
- if (match) {
- var i = match.index;
-
- if (match[1])
- return this.openingBracketBlock(session, match[1], row, i);
-
- return session.getCommentFoldRange(row, i + match[0].length, 1);
- }
-
- if (foldStyle !== "markbeginend")
- 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);
- }
- };
-
-}).call(FoldMode.prototype);
-
-});
diff --git a/public/libs/ace/mode-html.js b/public/libs/ace/mode-html.js
deleted file mode 100644
index 654593e..0000000
--- a/public/libs/ace/mode-html.js
+++ /dev/null
@@ -1,1886 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Distributed under the BSD license:
- *
- * Copyright (c) 2010, Ajax.org B.V.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of Ajax.org B.V. nor the
- * names of its contributors may be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * ***** END LICENSE BLOCK ***** */
-
-define('ace/mode/html', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/mode/javascript', 'ace/mode/css', 'ace/tokenizer', 'ace/mode/html_highlight_rules', 'ace/mode/behaviour/html', 'ace/mode/folding/html'], function(require, exports, module) {
-
-
-var oop = require("../lib/oop");
-var TextMode = require("./text").Mode;
-var JavaScriptMode = require("./javascript").Mode;
-var CssMode = require("./css").Mode;
-var Tokenizer = require("../tokenizer").Tokenizer;
-var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
-var HtmlBehaviour = require("./behaviour/html").HtmlBehaviour;
-var HtmlFoldMode = require("./folding/html").FoldMode;
-
-var Mode = function() {
- var highlighter = new HtmlHighlightRules();
- this.$tokenizer = new Tokenizer(highlighter.getRules());
- this.$behaviour = new HtmlBehaviour();
-
- this.$embeds = highlighter.getEmbeds();
- this.createModeDelegates({
- "js-": JavaScriptMode,
- "css-": CssMode
- });
-
- this.foldingRules = new HtmlFoldMode();
-};
-oop.inherits(Mode, TextMode);
-
-(function() {
-
-
- this.toggleCommentLines = function(state, doc, startRow, endRow) {
- return 0;
- };
-
- this.getNextLineIndent = function(state, line, tab) {
- return this.$getIndent(line);
- };
-
- this.checkOutdent = function(state, line, input) {
- return false;
- };
-
-}).call(Mode.prototype);
-
-exports.Mode = Mode;
-});
-
-define('ace/mode/javascript', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/javascript_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/worker/worker_client', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) {
-
-
-var oop = require("../lib/oop");
-var TextMode = require("./text").Mode;
-var Tokenizer = require("../tokenizer").Tokenizer;
-var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
-var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
-var Range = require("../range").Range;
-var WorkerClient = require("../worker/worker_client").WorkerClient;
-var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
-var CStyleFoldMode = require("./folding/cstyle").FoldMode;
-
-var Mode = function() {
- this.$tokenizer = new Tokenizer(new JavaScriptHighlightRules().getRules());
- this.$outdent = new MatchingBraceOutdent();
- this.$behaviour = new CstyleBehaviour();
- this.foldingRules = new CStyleFoldMode();
-};
-oop.inherits(Mode, TextMode);
-
-(function() {
-
-
- this.toggleCommentLines = function(state, doc, startRow, endRow) {
- var outdent = true;
- var re = /^(\s*)\/\//;
-
- for (var i=startRow; i<= endRow; i++) {
- if (!re.test(doc.getLine(i))) {
- outdent = false;
- break;
- }
- }
-
- if (outdent) {
- var deleteRange = new Range(0, 0, 0, 0);
- for (var i=startRow; i<= endRow; i++)
- {
- var line = doc.getLine(i);
- var m = line.match(re);
- deleteRange.start.row = i;
- deleteRange.end.row = i;
- deleteRange.end.column = m[0].length;
- doc.replace(deleteRange, m[1]);
- }
- }
- else {
- doc.indentRows(startRow, endRow, "//");
- }
- };
-
- this.getNextLineIndent = function(state, line, tab) {
- var indent = this.$getIndent(line);
-
- var tokenizedLine = this.$tokenizer.getLineTokens(line, state);
- var tokens = tokenizedLine.tokens;
- var endState = tokenizedLine.state;
-
- if (tokens.length && tokens[tokens.length-1].type == "comment") {
- return indent;
- }
-
- if (state == "start" || state == "regex_allowed") {
- var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/);
- if (match) {
- indent += tab;
- }
- } else if (state == "doc-start") {
- if (endState == "start" || state == "regex_allowed") {
- return "";
- }
- var match = line.match(/^\s*(\/?)\*/);
- if (match) {
- if (match[1]) {
- indent += " ";
- }
- indent += "* ";
- }
- }
-
- return indent;
- };
-
- this.checkOutdent = function(state, line, input) {
- return this.$outdent.checkOutdent(line, input);
- };
-
- this.autoOutdent = function(state, doc, row) {
- this.$outdent.autoOutdent(doc, row);
- };
-
- this.createWorker = function(session) {
- var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker");
- worker.attachToDocument(session.getDocument());
-
- worker.on("jslint", function(results) {
- session.setAnnotations(results.data);
- });
-
- worker.on("terminate", function() {
- session.clearAnnotations();
- });
-
- return worker;
- };
-
-}).call(Mode.prototype);
-
-exports.Mode = Mode;
-});
-
-define('ace/mode/javascript_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 DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
-var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
-
-var JavaScriptHighlightRules = function() {
- var keywordMapper = this.createKeywordMapper({
- "variable.language":
- "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors
- "Namespace|QName|XML|XMLList|" + // E4X
- "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
- "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" +
- "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors
- "SyntaxError|TypeError|URIError|" +
- "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions
- "isNaN|parseFloat|parseInt|" +
- "JSON|Math|" + // Other
- "this|arguments|prototype|window|document" , // Pseudo
- "keyword":
- "const|yield|import|get|set|" +
- "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
- "if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
- "__parent__|__count__|escape|unescape|with|__proto__|" +
- "class|enum|extends|super|export|implements|private|public|interface|package|protected|static",
- "storage.type":
- "const|let|var|function",
- "constant.language":
- "null|Infinity|NaN|undefined",
- "support.function":
- "alert",
- "constant.language.boolean": "true|false"
- }, "identifier");
- var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
- var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b";
-
- var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
- "u[0-9a-fA-F]{4}|" + // unicode
- "[0-2][0-7]{0,2}|" + // oct
- "3[0-6][0-7]?|" + // oct
- "37[0-7]?|" + // oct
- "[4-7][0-7]?|" + //oct
- ".)";
-
- this.$rules = {
- "start" : [
- {
- token : "comment",
- regex : /\/\/.*$/
- },
- DocCommentHighlightRules.getStartRule("doc-start"),
- {
- token : "comment", // multi line comment
- regex : /\/\*/,
- next : "comment"
- }, {
- token : "string",
- regex : "'(?=.)",
- next : "qstring"
- }, {
- token : "string",
- regex : '"(?=.)',
- next : "qqstring"
- }, {
- token : "constant.numeric", // hex
- regex : /0[xX][0-9a-fA-F]+\b/
- }, {
- token : "constant.numeric", // float
- regex : /[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/
- }, {
- token : [
- "storage.type", "punctuation.operator", "support.function",
- "punctuation.operator", "entity.name.function", "text","keyword.operator"
- ],
- regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)",
- next: "function_arguments"
- }, {
- token : [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text", "storage.type", "text", "paren.lparen"
- ],
- regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token : [
- "entity.name.function", "text", "keyword.operator", "text", "storage.type",
- "text", "paren.lparen"
- ],
- regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token : [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
- ],
- regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token : [
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
- ],
- regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token : [
- "entity.name.function", "text", "punctuation.operator",
- "text", "storage.type", "text", "paren.lparen"
- ],
- regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token : [
- "text", "text", "storage.type", "text", "paren.lparen"
- ],
- regex : "(:)(\\s*)(function)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token : "keyword",
- regex : "(?:" + kwBeforeRe + ")\\b",
- next : "regex_allowed"
- }, {
- token : ["punctuation.operator", "support.function"],
- regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:opzzzz|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
- }, {
- token : ["punctuation.operator", "support.function.dom"],
- regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
- }, {
- token : ["punctuation.operator", "support.constant"],
- regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
- }, {
- token : ["storage.type", "punctuation.operator", "support.function.firebug"],
- regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/
- }, {
- token : keywordMapper,
- regex : identifierRe
- }, {
- token : "keyword.operator",
- regex : /--|\+\+|[!$%&*+\-~]|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=/,
- next : "regex_allowed"
- }, {
- token : "punctuation.operator",
- regex : /\?|\:|\,|\;|\./,
- next : "regex_allowed"
- }, {
- token : "paren.lparen",
- regex : /[\[({]/,
- next : "regex_allowed"
- }, {
- token : "paren.rparen",
- regex : /[\])}]/
- }, {
- token : "keyword.operator",
- regex : /\/=?/,
- next : "regex_allowed"
- }, {
- token: "comment",
- regex: /^#!.*$/
- }
- ],
- "regex_allowed": [
- DocCommentHighlightRules.getStartRule("doc-start"),
- {
- token : "comment", // multi line comment
- regex : "\\/\\*",
- next : "comment_regex_allowed"
- }, {
- token : "comment",
- regex : "\\/\\/.*$"
- }, {
- token: "string.regexp",
- regex: "\\/",
- next: "regex",
- }, {
- token : "text",
- regex : "\\s+"
- }, {
- token: "empty",
- regex: "",
- next: "start"
- }
- ],
- "regex": [
- {
- token: "regexp.keyword.operator",
- regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
- }, {
- token: "string.regexp",
- regex: "/\\w*",
- next: "start",
- }, {
- token : "invalid",
- regex: /\{\d+,?(?:\d+)?}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/
- }, {
- token : "constant.language.escape",
- regex: /\(\?[:=!]|\)|{\d+,?(?:\d+)?}|{,\d+}|[+*]\?|[()$^+*?]/
- }, {
- token : "constant.language.delimiter",
- regex: /\|/
- }, {
- token: "constant.language.escape",
- regex: /\[\^?/,
- next: "regex_character_class",
- }, {
- token: "empty",
- regex: "$",
- next: "start"
- }, {
- defaultToken: "string.regexp"
- }
- ],
- "regex_character_class": [
- {
- token: "regexp.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: "-"
- }, {
- token: "empty",
- regex: "$",
- next: "start"
- }, {
- defaultToken: "string.regexp.charachterclass"
- }
- ],
- "function_arguments": [
- {
- token: "variable.parameter",
- regex: identifierRe
- }, {
- token: "punctuation.operator",
- regex: "[, ]+",
- }, {
- token: "punctuation.operator",
- regex: "$",
- }, {
- token: "empty",
- regex: "",
- next: "start"
- }
- ],
- "comment_regex_allowed" : [
- {token : "comment", regex : "\\*\\/", next : "regex_allowed"},
- {defaultToken : "comment"}
- ],
- "comment" : [
- {token : "comment", regex : "\\*\\/", next : "start"},
- {defaultToken : "comment"}
- ],
- "qqstring" : [
- {
- token : "constant.language.escape",
- regex : escapedRe
- }, {
- token : "string",
- regex : "\\\\$",
- next : "qqstring",
- }, {
- token : "string",
- regex : '"|$',
- next : "start",
- }, {
- defaultToken: "string"
- }
- ],
- "qstring" : [
- {
- token : "constant.language.escape",
- regex : escapedRe
- }, {
- token : "string",
- regex : "\\\\$",
- next : "qstring",
- }, {
- token : "string",
- regex : "'|$",
- next : "start",
- }, {
- defaultToken: "string"
- }
- ]
- };
-
- this.embedRules(DocCommentHighlightRules, "doc-",
- [ DocCommentHighlightRules.getEndRule("start") ]);
-};
-
-oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
-
-exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
-});
-
-define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
-
-
-var oop = require("../lib/oop");
-var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
-
-var DocCommentHighlightRules = function() {
-
- this.$rules = {
- "start" : [ {
- token : "comment.doc.tag",
- regex : "@[\\w\\d_]+" // TODO: fix email addresses
- }, {
- token : "comment.doc.tag",
- regex : "\\bTODO\\b"
- }, {
- defaultToken : "comment.doc"
- }]
- };
-};
-
-oop.inherits(DocCommentHighlightRules, TextHighlightRules);
-
-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/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
-
-
-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) {
- var match = line.match(/^(\s+)/);
- if (match) {
- return match[1];
- }
-
- return "";
- };
-
-}).call(MatchingBraceOutdent.prototype);
-
-exports.MatchingBraceOutdent = MatchingBraceOutdent;
-});
-
-define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) {
-
-
-var oop = require("../../lib/oop");
-var Behaviour = require("../behaviour").Behaviour;
-var TokenIterator = require("../../token_iterator").TokenIterator;
-var lang = require("../../lib/lang");
-
-var SAFE_INSERT_IN_TOKENS =
- ["text", "paren.rparen", "punctuation.operator"];
-var SAFE_INSERT_BEFORE_TOKENS =
- ["text", "paren.rparen", "punctuation.operator", "comment"];
-
-
-var autoInsertedBrackets = 0;
-var autoInsertedRow = -1;
-var autoInsertedLineEnd = "";
-var maybeInsertedBrackets = 0;
-var maybeInsertedRow = -1;
-var maybeInsertedLineStart = "";
-var maybeInsertedLineEnd = "";
-
-var CstyleBehaviour = function () {
-
- CstyleBehaviour.isSaneInsertion = function(editor, session) {
- var cursor = editor.getCursorPosition();
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) {
- var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1);
- if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS))
- return false;
- }
- iterator.stepForward();
- return iterator.getCurrentTokenRow() !== cursor.row ||
- this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS);
- };
-
- CstyleBehaviour.$matchTokenType = function(token, types) {
- return types.indexOf(token.type || token) > -1;
- };
-
- CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) {
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- if (!this.isAutoInsertedClosing(cursor, line, autoInsertedLineEnd[0]))
- autoInsertedBrackets = 0;
- autoInsertedRow = cursor.row;
- autoInsertedLineEnd = bracket + line.substr(cursor.column);
- autoInsertedBrackets++;
- };
-
- CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) {
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- if (!this.isMaybeInsertedClosing(cursor, line))
- maybeInsertedBrackets = 0;
- maybeInsertedRow = cursor.row;
- maybeInsertedLineStart = line.substr(0, cursor.column) + bracket;
- maybeInsertedLineEnd = line.substr(cursor.column);
- maybeInsertedBrackets++;
- };
-
- CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) {
- return autoInsertedBrackets > 0 &&
- cursor.row === autoInsertedRow &&
- bracket === autoInsertedLineEnd[0] &&
- line.substr(cursor.column) === autoInsertedLineEnd;
- };
-
- CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) {
- return maybeInsertedBrackets > 0 &&
- cursor.row === maybeInsertedRow &&
- line.substr(cursor.column) === maybeInsertedLineEnd &&
- line.substr(0, cursor.column) == maybeInsertedLineStart;
- };
-
- CstyleBehaviour.popAutoInsertedClosing = function() {
- autoInsertedLineEnd = autoInsertedLineEnd.substr(1);
- autoInsertedBrackets--;
- };
-
- CstyleBehaviour.clearMaybeInsertedClosing = function() {
- maybeInsertedBrackets = 0;
- maybeInsertedRow = -1;
- };
-
- this.add("braces", "insertion", function (state, action, editor, session, text) {
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- if (text == '{') {
- var selection = editor.getSelectionRange();
- var selected = session.doc.getTextRange(selection);
- if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) {
- return {
- text: '{' + selected + '}',
- selection: false
- };
- } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
- if (/[\]\}\)]/.test(line[cursor.column])) {
- CstyleBehaviour.recordAutoInsert(editor, session, "}");
- return {
- text: '{}',
- selection: [1, 1]
- };
- } else {
- CstyleBehaviour.recordMaybeInsert(editor, session, "{");
- return {
- text: '{',
- selection: [1, 1]
- };
- }
- }
- } else if (text == '}') {
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- if (rightChar == '}') {
- var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row});
- if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
- CstyleBehaviour.popAutoInsertedClosing();
- return {
- text: '',
- selection: [1, 1]
- };
- }
- }
- } else if (text == "\n" || text == "\r\n") {
- var closing = "";
- if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) {
- closing = lang.stringRepeat("}", maybeInsertedBrackets);
- CstyleBehaviour.clearMaybeInsertedClosing();
- }
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- if (rightChar == '}' || closing !== "") {
- var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column}, '}');
- if (!openBracePos)
- return null;
-
- var indent = this.getNextLineIndent(state, line.substring(0, cursor.column), session.getTabString());
- var next_indent = this.$getIndent(line);
-
- return {
- text: '\n' + indent + '\n' + next_indent + closing,
- selection: [1, indent.length, 1, indent.length]
- };
- }
- }
- });
-
- this.add("braces", "deletion", function (state, action, editor, session, range) {
- var selected = session.doc.getTextRange(range);
- if (!range.isMultiLine() && selected == '{') {
- var line = session.doc.getLine(range.start.row);
- var rightChar = line.substring(range.end.column, range.end.column + 1);
- if (rightChar == '}') {
- range.end.column++;
- return range;
- } else {
- maybeInsertedBrackets--;
- }
- }
- });
-
- this.add("parens", "insertion", function (state, action, editor, session, text) {
- if (text == '(') {
- var selection = editor.getSelectionRange();
- var selected = session.doc.getTextRange(selection);
- if (selected !== "" && editor.getWrapBehavioursEnabled()) {
- return {
- text: '(' + selected + ')',
- selection: false
- };
- } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
- CstyleBehaviour.recordAutoInsert(editor, session, ")");
- return {
- text: '()',
- selection: [1, 1]
- };
- }
- } else if (text == ')') {
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- if (rightChar == ')') {
- var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row});
- if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
- CstyleBehaviour.popAutoInsertedClosing();
- return {
- text: '',
- selection: [1, 1]
- };
- }
- }
- }
- });
-
- this.add("parens", "deletion", function (state, action, editor, session, range) {
- var selected = session.doc.getTextRange(range);
- if (!range.isMultiLine() && selected == '(') {
- var line = session.doc.getLine(range.start.row);
- var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
- if (rightChar == ')') {
- range.end.column++;
- return range;
- }
- }
- });
-
- this.add("brackets", "insertion", function (state, action, editor, session, text) {
- if (text == '[') {
- var selection = editor.getSelectionRange();
- var selected = session.doc.getTextRange(selection);
- if (selected !== "" && editor.getWrapBehavioursEnabled()) {
- return {
- text: '[' + selected + ']',
- selection: false
- };
- } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
- CstyleBehaviour.recordAutoInsert(editor, session, "]");
- return {
- text: '[]',
- selection: [1, 1]
- };
- }
- } else if (text == ']') {
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- if (rightChar == ']') {
- var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row});
- if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
- CstyleBehaviour.popAutoInsertedClosing();
- return {
- text: '',
- selection: [1, 1]
- };
- }
- }
- }
- });
-
- this.add("brackets", "deletion", function (state, action, editor, session, range) {
- var selected = session.doc.getTextRange(range);
- if (!range.isMultiLine() && selected == '[') {
- var line = session.doc.getLine(range.start.row);
- var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
- if (rightChar == ']') {
- range.end.column++;
- return range;
- }
- }
- });
-
- this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
- if (text == '"' || text == "'") {
- var quote = text;
- var selection = editor.getSelectionRange();
- var selected = session.doc.getTextRange(selection);
- if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
- return {
- text: quote + selected + quote,
- selection: false
- };
- } else {
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- var leftChar = line.substring(cursor.column-1, cursor.column);
- if (leftChar == '\\') {
- return null;
- }
- var tokens = session.getTokens(selection.start.row);
- var col = 0, token;
- var quotepos = -1; // Track whether we're inside an open quote.
-
- for (var x = 0; x < tokens.length; x++) {
- token = tokens[x];
- if (token.type == "string") {
- quotepos = -1;
- } else if (quotepos < 0) {
- quotepos = token.value.indexOf(quote);
- }
- if ((token.value.length + col) > selection.start.column) {
- break;
- }
- col += tokens[x].value.length;
- }
- if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) {
- if (!CstyleBehaviour.isSaneInsertion(editor, session))
- return;
- return {
- text: quote + quote,
- selection: [1,1]
- };
- } else if (token && token.type === "string") {
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- if (rightChar == quote) {
- return {
- text: '',
- selection: [1, 1]
- };
- }
- }
- }
- }
- });
-
- this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
- var selected = session.doc.getTextRange(range);
- if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
- var line = session.doc.getLine(range.start.row);
- var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
- if (rightChar == selected) {
- range.end.column++;
- return range;
- }
- }
- });
-
-};
-
-oop.inherits(CstyleBehaviour, Behaviour);
-
-exports.CstyleBehaviour = CstyleBehaviour;
-});
-
-define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
-
-
-var oop = require("../../lib/oop");
-var Range = require("../../range").Range;
-var BaseFoldMode = require("./fold_mode").FoldMode;
-
-var FoldMode = exports.FoldMode = function() {};
-oop.inherits(FoldMode, BaseFoldMode);
-
-(function() {
-
- this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;
- this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
-
- this.getFoldWidgetRange = function(session, foldStyle, row) {
- var line = session.getLine(row);
- var match = line.match(this.foldingStartMarker);
- if (match) {
- var i = match.index;
-
- if (match[1])
- return this.openingBracketBlock(session, match[1], row, i);
-
- return session.getCommentFoldRange(row, i + match[0].length, 1);
- }
-
- if (foldStyle !== "markbeginend")
- 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);
- }
- };
-
-}).call(FoldMode.prototype);
-
-});
-
-define('ace/mode/css', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/css_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/worker/worker_client', 'ace/mode/behaviour/css', 'ace/mode/folding/cstyle'], function(require, exports, module) {
-
-
-var oop = require("../lib/oop");
-var TextMode = require("./text").Mode;
-var Tokenizer = require("../tokenizer").Tokenizer;
-var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
-var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
-var WorkerClient = require("../worker/worker_client").WorkerClient;
-var CssBehaviour = require("./behaviour/css").CssBehaviour;
-var CStyleFoldMode = require("./folding/cstyle").FoldMode;
-
-var Mode = function() {
- this.$tokenizer = new Tokenizer(new CssHighlightRules().getRules(), "i");
- this.$outdent = new MatchingBraceOutdent();
- this.$behaviour = new CssBehaviour();
- this.foldingRules = new CStyleFoldMode();
-};
-oop.inherits(Mode, TextMode);
-
-(function() {
-
- this.foldingRules = "cStyle";
-
- this.getNextLineIndent = function(state, line, tab) {
- var indent = this.$getIndent(line);
- var tokens = this.$tokenizer.getLineTokens(line, state).tokens;
- if (tokens.length && tokens[tokens.length-1].type == "comment") {
- return indent;
- }
-
- var match = line.match(/^.*\{\s*$/);
- if (match) {
- indent += tab;
- }
-
- return indent;
- };
-
- this.checkOutdent = function(state, line, input) {
- return this.$outdent.checkOutdent(line, input);
- };
-
- this.autoOutdent = function(state, doc, row) {
- this.$outdent.autoOutdent(doc, row);
- };
-
- this.createWorker = function(session) {
- var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker");
- worker.attachToDocument(session.getDocument());
-
- worker.on("csslint", function(e) {
- session.setAnnotations(e.data);
- });
-
- worker.on("terminate", function() {
- session.clearAnnotations();
- });
-
- return worker;
- };
-
-}).call(Mode.prototype);
-
-exports.Mode = Mode;
-
-});
-
-define('ace/mode/css_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
-
-
-var oop = require("../lib/oop");
-var lang = require("../lib/lang");
-var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
-var supportType = exports.supportType = "animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|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|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|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|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index";
-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 supportConstantColor = exports.supportConstantColor = "aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow";
-var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|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 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 CssHighlightRules = function() {
-
- var keywordMapper = this.createKeywordMapper({
- "support.function": supportFunction,
- "support.constant": supportConstant,
- "support.type": supportType,
- "support.constant.color": supportConstantColor,
- "support.constant.fonts": supportConstantFonts
- }, "text", true);
-
- var base_ruleset = [
- {
- token : "comment", // multi line comment
- regex : "\\/\\*",
- next : "ruleset_comment"
- }, {
- token : "string", // single line
- regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
- }, {
- token : "string", // single line
- regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
- }, {
- 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|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
- }, {
- token : keywordMapper,
- regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
- }
- ];
-
- var ruleset = lang.copyArray(base_ruleset);
- ruleset.unshift({
- token : "paren.rparen",
- regex : "\\}",
- next: "start"
- });
-
- var media_ruleset = lang.copyArray( base_ruleset );
- media_ruleset.unshift({
- token : "paren.rparen",
- regex : "\\}",
- next: "media"
- });
-
- var base_comment = [{
- token : "comment", // comment spanning whole line
- regex : ".+"
- }];
-
- var comment = lang.copyArray(base_comment);
- comment.unshift({
- token : "comment", // closing comment
- regex : ".*?\\*\\/",
- next : "start"
- });
-
- var media_comment = lang.copyArray(base_comment);
- media_comment.unshift({
- token : "comment", // closing comment
- regex : ".*?\\*\\/",
- next : "media"
- });
-
- var ruleset_comment = lang.copyArray(base_comment);
- ruleset_comment.unshift({
- token : "comment", // closing comment
- regex : ".*?\\*\\/",
- next : "ruleset"
- });
-
- this.$rules = {
- "start" : [{
- token : "comment", // multi line comment
- regex : "\\/\\*",
- next : "comment"
- }, {
- token: "paren.lparen",
- regex: "\\{",
- next: "ruleset"
- }, {
- token: "string",
- regex: "@.*?{",
- next: "media"
- },{
- token: "keyword",
- regex: "#[a-z0-9-_]+"
- },{
- token: "variable",
- regex: "\\.[a-z0-9-_]+"
- },{
- token: "string",
- regex: ":[a-z0-9-_]+"
- },{
- token: "constant",
- regex: "[a-z0-9-_]+"
- }],
-
- "media" : [ {
- token : "comment", // multi line comment
- regex : "\\/\\*",
- next : "media_comment"
- }, {
- token: "paren.lparen",
- regex: "\\{",
- next: "media_ruleset"
- },{
- token: "string",
- regex: "\\}",
- next: "start"
- },{
- token: "keyword",
- regex: "#[a-z0-9-_]+"
- },{
- token: "variable",
- regex: "\\.[a-z0-9-_]+"
- },{
- token: "string",
- regex: ":[a-z0-9-_]+"
- },{
- token: "constant",
- regex: "[a-z0-9-_]+"
- }],
-
- "comment" : comment,
-
- "ruleset" : ruleset,
- "ruleset_comment" : ruleset_comment,
-
- "media_ruleset" : media_ruleset,
- "media_comment" : media_comment
- };
-};
-
-oop.inherits(CssHighlightRules, TextHighlightRules);
-
-exports.CssHighlightRules = CssHighlightRules;
-
-});
-
-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) {
-
-
-var oop = require("../../lib/oop");
-var Behaviour = require("../behaviour").Behaviour;
-var CstyleBehaviour = require("./cstyle").CstyleBehaviour;
-var TokenIterator = require("../../token_iterator").TokenIterator;
-
-var CssBehaviour = function () {
-
- this.inherit(CstyleBehaviour);
-
- this.add("colon", "insertion", function (state, action, editor, session, text) {
- if (text === ':') {
- var cursor = editor.getCursorPosition();
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- var token = iterator.getCurrentToken();
- if (token && token.value.match(/\s+/)) {
- token = iterator.stepBackward();
- }
- if (token && token.type === 'support.type') {
- var line = session.doc.getLine(cursor.row);
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- if (rightChar === ':') {
- return {
- text: '',
- selection: [1, 1]
- }
- }
- if (!line.substring(cursor.column).match(/^\s*;/)) {
- return {
- text: ':;',
- selection: [1, 1]
- }
- }
- }
- }
- });
-
- this.add("colon", "deletion", function (state, action, editor, session, range) {
- var selected = session.doc.getTextRange(range);
- if (!range.isMultiLine() && selected === ':') {
- var line = session.doc.getLine(range.start.row);
- var rightChar = line.substring(range.end.column, range.end.column + 1);
- if (rightChar === ';') {
- range.end.column ++;
- return range;
- }
- }
- });
-
- this.add("semicolon", "insertion", function (state, action, editor, session, text) {
- if (text === ';') {
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- if (rightChar === ';') {
- return {
- text: '',
- selection: [1, 1]
- }
- }
- }
- });
-
-}
-oop.inherits(CssBehaviour, CstyleBehaviour);
-
-exports.CssBehaviour = CssBehaviour;
-});
-
-define('ace/mode/html_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/css_highlight_rules', 'ace/mode/javascript_highlight_rules', 'ace/mode/xml_util', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
-
-
-var oop = require("../lib/oop");
-var lang = require("../lib/lang");
-var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
-var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
-var xmlUtil = require("./xml_util");
-var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
-
-var tagMap = lang.createMap({
- a : 'anchor',
- button : 'form',
- form : 'form',
- img : 'image',
- input : 'form',
- label : 'form',
- script : 'script',
- select : 'form',
- textarea : 'form',
- style : 'style',
- table : 'table',
- tbody : 'table',
- td : 'table',
- tfoot : 'table',
- th : 'table',
- tr : 'table'
-});
-
-var HtmlHighlightRules = function() {
- this.$rules = {
- start : [{
- token : "text",
- regex : "<\\!\\[CDATA\\[",
- next : "cdata"
- }, {
- token : "xml-pe",
- regex : "<\\?.*?\\?>"
- }, {
- token : "comment",
- regex : "<\\!--",
- next : "comment"
- }, {
- token : "xml-pe",
- regex : "<\\!.*?>"
- }, {
- token : "meta.tag",
- regex : "<(?=script\\b)",
- next : "script"
- }, {
- token : "meta.tag",
- regex : "<(?=style\\b)",
- next : "style"
- }, {
- token : "meta.tag", // opening tag
- regex : "<\\/?",
- next : "tag"
- }, {
- token : "text",
- regex : "\\s+"
- }, {
- token : "constant.character.entity",
- regex : "(?:[0-9]+;)|(?:[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
- }],
-
- cdata : [ {
- token : "text",
- regex : "\\]\\]>",
- next : "start"
- } ],
-
- comment : [ {
- token : "comment",
- regex : ".*?-->",
- next : "start"
- }, {
- defaultToken : "comment"
- } ]
- };
-
- xmlUtil.tag(this.$rules, "tag", "start", tagMap);
- xmlUtil.tag(this.$rules, "style", "css-start", tagMap);
- xmlUtil.tag(this.$rules, "script", "js-start", tagMap);
-
- this.embedRules(JavaScriptHighlightRules, "js-", [{
- token: "comment",
- regex: "\\/\\/.*(?=<\\/script>)",
- next: "tag"
- }, {
- token: "meta.tag",
- regex: "<\\/(?=script)",
- next: "tag"
- }]);
-
- this.embedRules(CssHighlightRules, "css-", [{
- token: "meta.tag",
- regex: "<\\/(?=style)",
- next: "tag"
- }]);
-};
-
-oop.inherits(HtmlHighlightRules, TextHighlightRules);
-
-exports.HtmlHighlightRules = HtmlHighlightRules;
-});
-
-define('ace/mode/xml_util', ['require', 'exports', 'module' ], function(require, exports, module) {
-
-
-function string(state) {
- return [{
- token : "string",
- regex : '"',
- next : state + "_qqstring"
- }, {
- token : "string",
- regex : "'",
- next : state + "_qstring"
- }];
-}
-
-function multiLineString(quote, state) {
- return [
- {token : "string", regex : quote, next : state},
- {
- token : "constant.language.escape",
- regex : "(?:[0-9]+;)|(?:[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
- },
- {defaultToken : "string"}
- ];
-}
-
-exports.tag = function(states, name, nextState, tagMap) {
- states[name] = [{
- token : "text",
- regex : "\\s+"
- }, {
-
- token : !tagMap ? "meta.tag.tag-name" : function(value) {
- if (tagMap[value])
- return "meta.tag.tag-name." + tagMap[value];
- else
- return "meta.tag.tag-name";
- },
- regex : "[-_a-zA-Z0-9:]+",
- next : name + "_embed_attribute_list"
- }, {
- token: "empty",
- regex: "",
- next : name + "_embed_attribute_list"
- }];
-
- states[name + "_qstring"] = multiLineString("'", name + "_embed_attribute_list");
- states[name + "_qqstring"] = multiLineString("\"", name + "_embed_attribute_list");
-
- states[name + "_embed_attribute_list"] = [{
- token : "meta.tag.r",
- regex : "/?>",
- next : nextState
- }, {
- token : "keyword.operator",
- regex : "="
- }, {
- token : "entity.other.attribute-name",
- regex : "[-_a-zA-Z0-9:]+"
- }, {
- token : "constant.numeric", // float
- regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
- }, {
- token : "text",
- regex : "\\s+"
- }].concat(string(name));
-};
-
-});
-
-define('ace/mode/behaviour/html', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour/xml', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) {
-
-
-var oop = require("../../lib/oop");
-var XmlBehaviour = require("../behaviour/xml").XmlBehaviour;
-var CstyleBehaviour = require("./cstyle").CstyleBehaviour;
-var TokenIterator = require("../../token_iterator").TokenIterator;
-var voidElements = ['area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr'];
-
-function hasType(token, type) {
- var hasType = true;
- var typeList = token.type.split('.');
- var needleList = type.split('.');
- needleList.forEach(function(needle){
- if (typeList.indexOf(needle) == -1) {
- hasType = false;
- return false;
- }
- });
- return hasType;
-}
-
-var HtmlBehaviour = function () {
-
- this.inherit(XmlBehaviour); // Get xml behaviour
-
- this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
- if (text == '>') {
- var position = editor.getCursorPosition();
- var iterator = new TokenIterator(session, position.row, position.column);
- var token = iterator.getCurrentToken();
- var atCursor = false;
- if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){
- do {
- token = iterator.stepBackward();
- } while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text')));
- } else {
- atCursor = true;
- }
- if (!token || !hasType(token, 'meta.tag-name') || iterator.stepBackward().value.match('/')) {
- return
- }
- var element = token.value;
- if (atCursor){
- var element = element.substring(0, position.column - token.start);
- }
- if (voidElements.indexOf(element) !== -1){
- return;
- }
- return {
- text: '>' + '' + element + '>',
- selection: [1, 1]
- }
- }
- });
-}
-oop.inherits(HtmlBehaviour, XmlBehaviour);
-
-exports.HtmlBehaviour = HtmlBehaviour;
-});
-
-define('ace/mode/behaviour/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) {
-
-
-var oop = require("../../lib/oop");
-var Behaviour = require("../behaviour").Behaviour;
-var CstyleBehaviour = require("./cstyle").CstyleBehaviour;
-var TokenIterator = require("../../token_iterator").TokenIterator;
-
-function hasType(token, type) {
- var hasType = true;
- var typeList = token.type.split('.');
- var needleList = type.split('.');
- needleList.forEach(function(needle){
- if (typeList.indexOf(needle) == -1) {
- hasType = false;
- return false;
- }
- });
- return hasType;
-}
-
-var XmlBehaviour = function () {
-
- this.inherit(CstyleBehaviour, ["string_dquotes"]); // Get string behaviour
-
- this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
- if (text == '>') {
- var position = editor.getCursorPosition();
- var iterator = new TokenIterator(session, position.row, position.column);
- var token = iterator.getCurrentToken();
- var atCursor = false;
- if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){
- do {
- token = iterator.stepBackward();
- } while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text')));
- } else {
- atCursor = true;
- }
- if (!token || !hasType(token, 'meta.tag-name') || iterator.stepBackward().value.match('/')) {
- return
- }
- var tag = token.value;
- if (atCursor){
- var tag = tag.substring(0, position.column - token.start);
- }
-
- return {
- text: '>' + '' + tag + '>',
- selection: [1, 1]
- }
- }
- });
-
- this.add('autoindent', 'insertion', function (state, action, editor, session, text) {
- if (text == "\n") {
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- var rightChars = line.substring(cursor.column, cursor.column + 2);
- if (rightChars == '') {
- var indent = this.$getIndent(session.doc.getLine(cursor.row)) + session.getTabString();
- var next_indent = this.$getIndent(session.doc.getLine(cursor.row));
-
- return {
- text: '\n' + indent + '\n' + next_indent,
- selection: [1, indent.length, 1, indent.length]
- }
- }
- }
- });
-
-}
-oop.inherits(XmlBehaviour, Behaviour);
-
-exports.XmlBehaviour = XmlBehaviour;
-});
-
-define('ace/mode/folding/html', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/mixed', 'ace/mode/folding/xml', 'ace/mode/folding/cstyle'], function(require, exports, module) {
-
-
-var oop = require("../../lib/oop");
-var MixedFoldMode = require("./mixed").FoldMode;
-var XmlFoldMode = require("./xml").FoldMode;
-var CStyleFoldMode = require("./cstyle").FoldMode;
-
-var FoldMode = exports.FoldMode = function() {
- MixedFoldMode.call(this, new XmlFoldMode({
- "area": 1,
- "base": 1,
- "br": 1,
- "col": 1,
- "command": 1,
- "embed": 1,
- "hr": 1,
- "img": 1,
- "input": 1,
- "keygen": 1,
- "link": 1,
- "meta": 1,
- "param": 1,
- "source": 1,
- "track": 1,
- "wbr": 1,
- "li": 1,
- "dt": 1,
- "dd": 1,
- "p": 1,
- "rt": 1,
- "rp": 1,
- "optgroup": 1,
- "option": 1,
- "colgroup": 1,
- "td": 1,
- "th": 1
- }), {
- "js-": new CStyleFoldMode(),
- "css-": new CStyleFoldMode()
- });
-};
-
-oop.inherits(FoldMode, MixedFoldMode);
-
-});
-
-define('ace/mode/folding/mixed', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
-
-
-var oop = require("../../lib/oop");
-var BaseFoldMode = require("./fold_mode").FoldMode;
-
-var FoldMode = exports.FoldMode = function(defaultMode, subModes) {
- this.defaultMode = defaultMode;
- this.subModes = subModes;
-};
-oop.inherits(FoldMode, BaseFoldMode);
-
-(function() {
-
-
- this.$getMode = function(state) {
- for (var key in this.subModes) {
- if (state.indexOf(key) === 0)
- return this.subModes[key];
- }
- return null;
- };
-
- this.$tryMode = function(state, session, foldStyle, row) {
- var mode = this.$getMode(state);
- return (mode ? mode.getFoldWidget(session, foldStyle, row) : "");
- };
-
- this.getFoldWidget = function(session, foldStyle, row) {
- return (
- this.$tryMode(session.getState(row-1), session, foldStyle, row) ||
- this.$tryMode(session.getState(row), session, foldStyle, row) ||
- this.defaultMode.getFoldWidget(session, foldStyle, row)
- );
- };
-
- this.getFoldWidgetRange = function(session, foldStyle, row) {
- var mode = this.$getMode(session.getState(row-1));
-
- if (!mode || !mode.getFoldWidget(session, foldStyle, row))
- mode = this.$getMode(session.getState(row));
-
- if (!mode || !mode.getFoldWidget(session, foldStyle, row))
- mode = this.defaultMode;
-
- return mode.getFoldWidgetRange(session, foldStyle, row);
- };
-
-}).call(FoldMode.prototype);
-
-});
-
-define('ace/mode/folding/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/range', 'ace/mode/folding/fold_mode', 'ace/token_iterator'], function(require, exports, module) {
-
-
-var oop = require("../../lib/oop");
-var lang = require("../../lib/lang");
-var Range = require("../../range").Range;
-var BaseFoldMode = require("./fold_mode").FoldMode;
-var TokenIterator = require("../../token_iterator").TokenIterator;
-
-var FoldMode = exports.FoldMode = function(voidElements) {
- BaseFoldMode.call(this);
- this.voidElements = voidElements || {};
-};
-oop.inherits(FoldMode, BaseFoldMode);
-
-(function() {
-
- this.getFoldWidget = function(session, foldStyle, row) {
- var tag = this._getFirstTagInLine(session, row);
-
- if (tag.closing)
- return foldStyle == "markbeginend" ? "end" : "";
-
- if (!tag.tagName || this.voidElements[tag.tagName.toLowerCase()])
- return "";
-
- if (tag.selfClosing)
- return "";
-
- if (tag.value.indexOf("/" + tag.tagName) !== -1)
- return "";
-
- return "start";
- };
-
- this._getFirstTagInLine = function(session, row) {
- var tokens = session.getTokens(row);
- var value = "";
- for (var i = 0; i < tokens.length; i++) {
- var token = tokens[i];
- if (token.type.indexOf("meta.tag") === 0)
- value += token.value;
- else
- value += lang.stringRepeat(" ", token.value.length);
- }
-
- return this._parseTag(value);
- };
-
- this.tagRe = /^(\s*)((\/?)([-_a-zA-Z0-9:!]*)\s*(\/?)>?)/;
- this._parseTag = function(tag) {
-
- var match = this.tagRe.exec(tag);
- var column = this.tagRe.lastIndex || 0;
- this.tagRe.lastIndex = 0;
-
- return {
- value: tag,
- match: match ? match[2] : "",
- closing: match ? !!match[3] : false,
- selfClosing: match ? !!match[5] || match[2] == "/>" : false,
- tagName: match ? match[4] : "",
- column: match[1] ? column + match[1].length : column
- };
- };
- this._readTagForward = function(iterator) {
- var token = iterator.getCurrentToken();
- if (!token)
- return null;
-
- var value = "";
- var start;
-
- do {
- if (token.type.indexOf("meta.tag") === 0) {
- if (!start) {
- var start = {
- row: iterator.getCurrentTokenRow(),
- column: iterator.getCurrentTokenColumn()
- };
- }
- value += token.value;
- if (value.indexOf(">") !== -1) {
- var tag = this._parseTag(value);
- tag.start = start;
- tag.end = {
- row: iterator.getCurrentTokenRow(),
- column: iterator.getCurrentTokenColumn() + token.value.length
- };
- iterator.stepForward();
- return tag;
- }
- }
- } while(token = iterator.stepForward());
-
- return null;
- };
-
- this._readTagBackward = function(iterator) {
- var token = iterator.getCurrentToken();
- if (!token)
- return null;
-
- var value = "";
- var end;
-
- do {
- if (token.type.indexOf("meta.tag") === 0) {
- if (!end) {
- end = {
- row: iterator.getCurrentTokenRow(),
- column: iterator.getCurrentTokenColumn() + token.value.length
- };
- }
- value = token.value + value;
- if (value.indexOf("<") !== -1) {
- var tag = this._parseTag(value);
- tag.end = end;
- tag.start = {
- row: iterator.getCurrentTokenRow(),
- column: iterator.getCurrentTokenColumn()
- };
- iterator.stepBackward();
- return tag;
- }
- }
- } while(token = iterator.stepBackward());
-
- return null;
- };
-
- this._pop = function(stack, tag) {
- while (stack.length) {
-
- var top = stack[stack.length-1];
- if (!tag || top.tagName == tag.tagName) {
- return stack.pop();
- }
- else if (this.voidElements[tag.tagName]) {
- return;
- }
- else if (this.voidElements[top.tagName]) {
- stack.pop();
- continue;
- } else {
- return null;
- }
- }
- };
-
- this.getFoldWidgetRange = function(session, foldStyle, row) {
- var firstTag = this._getFirstTagInLine(session, row);
-
- if (!firstTag.match)
- return null;
-
- var isBackward = firstTag.closing || firstTag.selfClosing;
- var stack = [];
- var tag;
-
- if (!isBackward) {
- var iterator = new TokenIterator(session, row, firstTag.column);
- var start = {
- row: row,
- column: firstTag.column + firstTag.tagName.length + 2
- };
- while (tag = this._readTagForward(iterator)) {
- if (tag.selfClosing) {
- if (!stack.length) {
- tag.start.column += tag.tagName.length + 2;
- tag.end.column -= 2;
- return Range.fromPoints(tag.start, tag.end);
- } else
- continue;
- }
-
- if (tag.closing) {
- this._pop(stack, tag);
- if (stack.length == 0)
- return Range.fromPoints(start, tag.start);
- }
- else {
- stack.push(tag)
- }
- }
- }
- else {
- var iterator = new TokenIterator(session, row, firstTag.column + firstTag.match.length);
- var end = {
- row: row,
- column: firstTag.column
- };
-
- while (tag = this._readTagBackward(iterator)) {
- if (tag.selfClosing) {
- if (!stack.length) {
- tag.start.column += tag.tagName.length + 2;
- tag.end.column -= 2;
- return Range.fromPoints(tag.start, tag.end);
- } else
- continue;
- }
-
- if (!tag.closing) {
- this._pop(stack, tag);
- if (stack.length == 0) {
- tag.start.column += tag.tagName.length + 2;
- return Range.fromPoints(tag.start, end);
- }
- }
- else {
- stack.push(tag)
- }
- }
- }
-
- };
-
-}).call(FoldMode.prototype);
-
-});
diff --git a/public/libs/ace/mode-java.js b/public/libs/ace/mode-java.js
deleted file mode 100644
index b23cc99..0000000
--- a/public/libs/ace/mode-java.js
+++ /dev/null
@@ -1,1016 +0,0 @@
-define('ace/mode/java', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/javascript', 'ace/tokenizer', 'ace/mode/java_highlight_rules'], function(require, exports, module) {
-
-
-var oop = require("../lib/oop");
-var JavaScriptMode = require("./javascript").Mode;
-var Tokenizer = require("../tokenizer").Tokenizer;
-var JavaHighlightRules = require("./java_highlight_rules").JavaHighlightRules;
-
-var Mode = function() {
- JavaScriptMode.call(this);
-
- this.$tokenizer = new Tokenizer(new JavaHighlightRules().getRules());
-};
-oop.inherits(Mode, JavaScriptMode);
-
-(function() {
-
- this.createWorker = function(session) {
- return null;
- };
-
-}).call(Mode.prototype);
-
-exports.Mode = Mode;
-});
-
-define('ace/mode/javascript', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/javascript_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/worker/worker_client', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) {
-
-
-var oop = require("../lib/oop");
-var TextMode = require("./text").Mode;
-var Tokenizer = require("../tokenizer").Tokenizer;
-var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
-var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
-var Range = require("../range").Range;
-var WorkerClient = require("../worker/worker_client").WorkerClient;
-var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
-var CStyleFoldMode = require("./folding/cstyle").FoldMode;
-
-var Mode = function() {
- this.$tokenizer = new Tokenizer(new JavaScriptHighlightRules().getRules());
- this.$outdent = new MatchingBraceOutdent();
- this.$behaviour = new CstyleBehaviour();
- this.foldingRules = new CStyleFoldMode();
-};
-oop.inherits(Mode, TextMode);
-
-(function() {
-
-
- this.toggleCommentLines = function(state, doc, startRow, endRow) {
- var outdent = true;
- var re = /^(\s*)\/\//;
-
- for (var i=startRow; i<= endRow; i++) {
- if (!re.test(doc.getLine(i))) {
- outdent = false;
- break;
- }
- }
-
- if (outdent) {
- var deleteRange = new Range(0, 0, 0, 0);
- for (var i=startRow; i<= endRow; i++)
- {
- var line = doc.getLine(i);
- var m = line.match(re);
- deleteRange.start.row = i;
- deleteRange.end.row = i;
- deleteRange.end.column = m[0].length;
- doc.replace(deleteRange, m[1]);
- }
- }
- else {
- doc.indentRows(startRow, endRow, "//");
- }
- };
-
- this.getNextLineIndent = function(state, line, tab) {
- var indent = this.$getIndent(line);
-
- var tokenizedLine = this.$tokenizer.getLineTokens(line, state);
- var tokens = tokenizedLine.tokens;
- var endState = tokenizedLine.state;
-
- if (tokens.length && tokens[tokens.length-1].type == "comment") {
- return indent;
- }
-
- if (state == "start" || state == "regex_allowed") {
- var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/);
- if (match) {
- indent += tab;
- }
- } else if (state == "doc-start") {
- if (endState == "start" || state == "regex_allowed") {
- return "";
- }
- var match = line.match(/^\s*(\/?)\*/);
- if (match) {
- if (match[1]) {
- indent += " ";
- }
- indent += "* ";
- }
- }
-
- return indent;
- };
-
- this.checkOutdent = function(state, line, input) {
- return this.$outdent.checkOutdent(line, input);
- };
-
- this.autoOutdent = function(state, doc, row) {
- this.$outdent.autoOutdent(doc, row);
- };
-
- this.createWorker = function(session) {
- var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker");
- worker.attachToDocument(session.getDocument());
-
- worker.on("jslint", function(results) {
- session.setAnnotations(results.data);
- });
-
- worker.on("terminate", function() {
- session.clearAnnotations();
- });
-
- return worker;
- };
-
-}).call(Mode.prototype);
-
-exports.Mode = Mode;
-});
-
-define('ace/mode/javascript_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 DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
-var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
-
-var JavaScriptHighlightRules = function() {
- var keywordMapper = this.createKeywordMapper({
- "variable.language":
- "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors
- "Namespace|QName|XML|XMLList|" + // E4X
- "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
- "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" +
- "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors
- "SyntaxError|TypeError|URIError|" +
- "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions
- "isNaN|parseFloat|parseInt|" +
- "JSON|Math|" + // Other
- "this|arguments|prototype|window|document" , // Pseudo
- "keyword":
- "const|yield|import|get|set|" +
- "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
- "if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
- "__parent__|__count__|escape|unescape|with|__proto__|" +
- "class|enum|extends|super|export|implements|private|public|interface|package|protected|static",
- "storage.type":
- "const|let|var|function",
- "constant.language":
- "null|Infinity|NaN|undefined",
- "support.function":
- "alert",
- "constant.language.boolean": "true|false"
- }, "identifier");
- var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
- var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b";
-
- var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
- "u[0-9a-fA-F]{4}|" + // unicode
- "[0-2][0-7]{0,2}|" + // oct
- "3[0-6][0-7]?|" + // oct
- "37[0-7]?|" + // oct
- "[4-7][0-7]?|" + //oct
- ".)";
-
- this.$rules = {
- "start" : [
- {
- token : "comment",
- regex : /\/\/.*$/
- },
- DocCommentHighlightRules.getStartRule("doc-start"),
- {
- token : "comment", // multi line comment
- regex : /\/\*/,
- next : "comment"
- }, {
- token : "string",
- regex : "'(?=.)",
- next : "qstring"
- }, {
- token : "string",
- regex : '"(?=.)',
- next : "qqstring"
- }, {
- token : "constant.numeric", // hex
- regex : /0[xX][0-9a-fA-F]+\b/
- }, {
- token : "constant.numeric", // float
- regex : /[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/
- }, {
- token : [
- "storage.type", "punctuation.operator", "support.function",
- "punctuation.operator", "entity.name.function", "text","keyword.operator"
- ],
- regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)",
- next: "function_arguments"
- }, {
- token : [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text", "storage.type", "text", "paren.lparen"
- ],
- regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token : [
- "entity.name.function", "text", "keyword.operator", "text", "storage.type",
- "text", "paren.lparen"
- ],
- regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token : [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
- ],
- regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token : [
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
- ],
- regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token : [
- "entity.name.function", "text", "punctuation.operator",
- "text", "storage.type", "text", "paren.lparen"
- ],
- regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token : [
- "text", "text", "storage.type", "text", "paren.lparen"
- ],
- regex : "(:)(\\s*)(function)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token : "keyword",
- regex : "(?:" + kwBeforeRe + ")\\b",
- next : "regex_allowed"
- }, {
- token : ["punctuation.operator", "support.function"],
- regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:opzzzz|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
- }, {
- token : ["punctuation.operator", "support.function.dom"],
- regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
- }, {
- token : ["punctuation.operator", "support.constant"],
- regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
- }, {
- token : ["storage.type", "punctuation.operator", "support.function.firebug"],
- regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/
- }, {
- token : keywordMapper,
- regex : identifierRe
- }, {
- token : "keyword.operator",
- regex : /--|\+\+|[!$%&*+\-~]|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=/,
- next : "regex_allowed"
- }, {
- token : "punctuation.operator",
- regex : /\?|\:|\,|\;|\./,
- next : "regex_allowed"
- }, {
- token : "paren.lparen",
- regex : /[\[({]/,
- next : "regex_allowed"
- }, {
- token : "paren.rparen",
- regex : /[\])}]/
- }, {
- token : "keyword.operator",
- regex : /\/=?/,
- next : "regex_allowed"
- }, {
- token: "comment",
- regex: /^#!.*$/
- }
- ],
- "regex_allowed": [
- DocCommentHighlightRules.getStartRule("doc-start"),
- {
- token : "comment", // multi line comment
- regex : "\\/\\*",
- next : "comment_regex_allowed"
- }, {
- token : "comment",
- regex : "\\/\\/.*$"
- }, {
- token: "string.regexp",
- regex: "\\/",
- next: "regex",
- }, {
- token : "text",
- regex : "\\s+"
- }, {
- token: "empty",
- regex: "",
- next: "start"
- }
- ],
- "regex": [
- {
- token: "regexp.keyword.operator",
- regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
- }, {
- token: "string.regexp",
- regex: "/\\w*",
- next: "start",
- }, {
- token : "invalid",
- regex: /\{\d+,?(?:\d+)?}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/
- }, {
- token : "constant.language.escape",
- regex: /\(\?[:=!]|\)|{\d+,?(?:\d+)?}|{,\d+}|[+*]\?|[()$^+*?]/
- }, {
- token : "constant.language.delimiter",
- regex: /\|/
- }, {
- token: "constant.language.escape",
- regex: /\[\^?/,
- next: "regex_character_class",
- }, {
- token: "empty",
- regex: "$",
- next: "start"
- }, {
- defaultToken: "string.regexp"
- }
- ],
- "regex_character_class": [
- {
- token: "regexp.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: "-"
- }, {
- token: "empty",
- regex: "$",
- next: "start"
- }, {
- defaultToken: "string.regexp.charachterclass"
- }
- ],
- "function_arguments": [
- {
- token: "variable.parameter",
- regex: identifierRe
- }, {
- token: "punctuation.operator",
- regex: "[, ]+",
- }, {
- token: "punctuation.operator",
- regex: "$",
- }, {
- token: "empty",
- regex: "",
- next: "start"
- }
- ],
- "comment_regex_allowed" : [
- {token : "comment", regex : "\\*\\/", next : "regex_allowed"},
- {defaultToken : "comment"}
- ],
- "comment" : [
- {token : "comment", regex : "\\*\\/", next : "start"},
- {defaultToken : "comment"}
- ],
- "qqstring" : [
- {
- token : "constant.language.escape",
- regex : escapedRe
- }, {
- token : "string",
- regex : "\\\\$",
- next : "qqstring",
- }, {
- token : "string",
- regex : '"|$',
- next : "start",
- }, {
- defaultToken: "string"
- }
- ],
- "qstring" : [
- {
- token : "constant.language.escape",
- regex : escapedRe
- }, {
- token : "string",
- regex : "\\\\$",
- next : "qstring",
- }, {
- token : "string",
- regex : "'|$",
- next : "start",
- }, {
- defaultToken: "string"
- }
- ]
- };
-
- this.embedRules(DocCommentHighlightRules, "doc-",
- [ DocCommentHighlightRules.getEndRule("start") ]);
-};
-
-oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
-
-exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
-});
-
-define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
-
-
-var oop = require("../lib/oop");
-var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
-
-var DocCommentHighlightRules = function() {
-
- this.$rules = {
- "start" : [ {
- token : "comment.doc.tag",
- regex : "@[\\w\\d_]+" // TODO: fix email addresses
- }, {
- token : "comment.doc.tag",
- regex : "\\bTODO\\b"
- }, {
- defaultToken : "comment.doc"
- }]
- };
-};
-
-oop.inherits(DocCommentHighlightRules, TextHighlightRules);
-
-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/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
-
-
-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) {
- var match = line.match(/^(\s+)/);
- if (match) {
- return match[1];
- }
-
- return "";
- };
-
-}).call(MatchingBraceOutdent.prototype);
-
-exports.MatchingBraceOutdent = MatchingBraceOutdent;
-});
-
-define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) {
-
-
-var oop = require("../../lib/oop");
-var Behaviour = require("../behaviour").Behaviour;
-var TokenIterator = require("../../token_iterator").TokenIterator;
-var lang = require("../../lib/lang");
-
-var SAFE_INSERT_IN_TOKENS =
- ["text", "paren.rparen", "punctuation.operator"];
-var SAFE_INSERT_BEFORE_TOKENS =
- ["text", "paren.rparen", "punctuation.operator", "comment"];
-
-
-var autoInsertedBrackets = 0;
-var autoInsertedRow = -1;
-var autoInsertedLineEnd = "";
-var maybeInsertedBrackets = 0;
-var maybeInsertedRow = -1;
-var maybeInsertedLineStart = "";
-var maybeInsertedLineEnd = "";
-
-var CstyleBehaviour = function () {
-
- CstyleBehaviour.isSaneInsertion = function(editor, session) {
- var cursor = editor.getCursorPosition();
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) {
- var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1);
- if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS))
- return false;
- }
- iterator.stepForward();
- return iterator.getCurrentTokenRow() !== cursor.row ||
- this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS);
- };
-
- CstyleBehaviour.$matchTokenType = function(token, types) {
- return types.indexOf(token.type || token) > -1;
- };
-
- CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) {
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- if (!this.isAutoInsertedClosing(cursor, line, autoInsertedLineEnd[0]))
- autoInsertedBrackets = 0;
- autoInsertedRow = cursor.row;
- autoInsertedLineEnd = bracket + line.substr(cursor.column);
- autoInsertedBrackets++;
- };
-
- CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) {
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- if (!this.isMaybeInsertedClosing(cursor, line))
- maybeInsertedBrackets = 0;
- maybeInsertedRow = cursor.row;
- maybeInsertedLineStart = line.substr(0, cursor.column) + bracket;
- maybeInsertedLineEnd = line.substr(cursor.column);
- maybeInsertedBrackets++;
- };
-
- CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) {
- return autoInsertedBrackets > 0 &&
- cursor.row === autoInsertedRow &&
- bracket === autoInsertedLineEnd[0] &&
- line.substr(cursor.column) === autoInsertedLineEnd;
- };
-
- CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) {
- return maybeInsertedBrackets > 0 &&
- cursor.row === maybeInsertedRow &&
- line.substr(cursor.column) === maybeInsertedLineEnd &&
- line.substr(0, cursor.column) == maybeInsertedLineStart;
- };
-
- CstyleBehaviour.popAutoInsertedClosing = function() {
- autoInsertedLineEnd = autoInsertedLineEnd.substr(1);
- autoInsertedBrackets--;
- };
-
- CstyleBehaviour.clearMaybeInsertedClosing = function() {
- maybeInsertedBrackets = 0;
- maybeInsertedRow = -1;
- };
-
- this.add("braces", "insertion", function (state, action, editor, session, text) {
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- if (text == '{') {
- var selection = editor.getSelectionRange();
- var selected = session.doc.getTextRange(selection);
- if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) {
- return {
- text: '{' + selected + '}',
- selection: false
- };
- } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
- if (/[\]\}\)]/.test(line[cursor.column])) {
- CstyleBehaviour.recordAutoInsert(editor, session, "}");
- return {
- text: '{}',
- selection: [1, 1]
- };
- } else {
- CstyleBehaviour.recordMaybeInsert(editor, session, "{");
- return {
- text: '{',
- selection: [1, 1]
- };
- }
- }
- } else if (text == '}') {
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- if (rightChar == '}') {
- var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row});
- if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
- CstyleBehaviour.popAutoInsertedClosing();
- return {
- text: '',
- selection: [1, 1]
- };
- }
- }
- } else if (text == "\n" || text == "\r\n") {
- var closing = "";
- if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) {
- closing = lang.stringRepeat("}", maybeInsertedBrackets);
- CstyleBehaviour.clearMaybeInsertedClosing();
- }
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- if (rightChar == '}' || closing !== "") {
- var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column}, '}');
- if (!openBracePos)
- return null;
-
- var indent = this.getNextLineIndent(state, line.substring(0, cursor.column), session.getTabString());
- var next_indent = this.$getIndent(line);
-
- return {
- text: '\n' + indent + '\n' + next_indent + closing,
- selection: [1, indent.length, 1, indent.length]
- };
- }
- }
- });
-
- this.add("braces", "deletion", function (state, action, editor, session, range) {
- var selected = session.doc.getTextRange(range);
- if (!range.isMultiLine() && selected == '{') {
- var line = session.doc.getLine(range.start.row);
- var rightChar = line.substring(range.end.column, range.end.column + 1);
- if (rightChar == '}') {
- range.end.column++;
- return range;
- } else {
- maybeInsertedBrackets--;
- }
- }
- });
-
- this.add("parens", "insertion", function (state, action, editor, session, text) {
- if (text == '(') {
- var selection = editor.getSelectionRange();
- var selected = session.doc.getTextRange(selection);
- if (selected !== "" && editor.getWrapBehavioursEnabled()) {
- return {
- text: '(' + selected + ')',
- selection: false
- };
- } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
- CstyleBehaviour.recordAutoInsert(editor, session, ")");
- return {
- text: '()',
- selection: [1, 1]
- };
- }
- } else if (text == ')') {
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- if (rightChar == ')') {
- var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row});
- if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
- CstyleBehaviour.popAutoInsertedClosing();
- return {
- text: '',
- selection: [1, 1]
- };
- }
- }
- }
- });
-
- this.add("parens", "deletion", function (state, action, editor, session, range) {
- var selected = session.doc.getTextRange(range);
- if (!range.isMultiLine() && selected == '(') {
- var line = session.doc.getLine(range.start.row);
- var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
- if (rightChar == ')') {
- range.end.column++;
- return range;
- }
- }
- });
-
- this.add("brackets", "insertion", function (state, action, editor, session, text) {
- if (text == '[') {
- var selection = editor.getSelectionRange();
- var selected = session.doc.getTextRange(selection);
- if (selected !== "" && editor.getWrapBehavioursEnabled()) {
- return {
- text: '[' + selected + ']',
- selection: false
- };
- } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
- CstyleBehaviour.recordAutoInsert(editor, session, "]");
- return {
- text: '[]',
- selection: [1, 1]
- };
- }
- } else if (text == ']') {
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- if (rightChar == ']') {
- var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row});
- if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
- CstyleBehaviour.popAutoInsertedClosing();
- return {
- text: '',
- selection: [1, 1]
- };
- }
- }
- }
- });
-
- this.add("brackets", "deletion", function (state, action, editor, session, range) {
- var selected = session.doc.getTextRange(range);
- if (!range.isMultiLine() && selected == '[') {
- var line = session.doc.getLine(range.start.row);
- var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
- if (rightChar == ']') {
- range.end.column++;
- return range;
- }
- }
- });
-
- this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
- if (text == '"' || text == "'") {
- var quote = text;
- var selection = editor.getSelectionRange();
- var selected = session.doc.getTextRange(selection);
- if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
- return {
- text: quote + selected + quote,
- selection: false
- };
- } else {
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- var leftChar = line.substring(cursor.column-1, cursor.column);
- if (leftChar == '\\') {
- return null;
- }
- var tokens = session.getTokens(selection.start.row);
- var col = 0, token;
- var quotepos = -1; // Track whether we're inside an open quote.
-
- for (var x = 0; x < tokens.length; x++) {
- token = tokens[x];
- if (token.type == "string") {
- quotepos = -1;
- } else if (quotepos < 0) {
- quotepos = token.value.indexOf(quote);
- }
- if ((token.value.length + col) > selection.start.column) {
- break;
- }
- col += tokens[x].value.length;
- }
- if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) {
- if (!CstyleBehaviour.isSaneInsertion(editor, session))
- return;
- return {
- text: quote + quote,
- selection: [1,1]
- };
- } else if (token && token.type === "string") {
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- if (rightChar == quote) {
- return {
- text: '',
- selection: [1, 1]
- };
- }
- }
- }
- }
- });
-
- this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
- var selected = session.doc.getTextRange(range);
- if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
- var line = session.doc.getLine(range.start.row);
- var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
- if (rightChar == selected) {
- range.end.column++;
- return range;
- }
- }
- });
-
-};
-
-oop.inherits(CstyleBehaviour, Behaviour);
-
-exports.CstyleBehaviour = CstyleBehaviour;
-});
-
-define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
-
-
-var oop = require("../../lib/oop");
-var Range = require("../../range").Range;
-var BaseFoldMode = require("./fold_mode").FoldMode;
-
-var FoldMode = exports.FoldMode = function() {};
-oop.inherits(FoldMode, BaseFoldMode);
-
-(function() {
-
- this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;
- this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
-
- this.getFoldWidgetRange = function(session, foldStyle, row) {
- var line = session.getLine(row);
- var match = line.match(this.foldingStartMarker);
- if (match) {
- var i = match.index;
-
- if (match[1])
- return this.openingBracketBlock(session, match[1], row, i);
-
- return session.getCommentFoldRange(row, i + match[0].length, 1);
- }
-
- if (foldStyle !== "markbeginend")
- 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);
- }
- };
-
-}).call(FoldMode.prototype);
-
-});
-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) {
-
-
-var oop = require("../lib/oop");
-var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
-var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
-
-var JavaHighlightRules = function() {
- var keywords = (
- "abstract|continue|for|new|switch|" +
- "assert|default|goto|package|synchronized|" +
- "boolean|do|if|private|this|" +
- "break|double|implements|protected|throw|" +
- "byte|else|import|public|throws|" +
- "case|enum|instanceof|return|transient|" +
- "catch|extends|int|short|try|" +
- "char|final|interface|static|void|" +
- "class|finally|long|strictfp|volatile|" +
- "const|float|native|super|while"
- );
-
- var buildinConstants = ("null|Infinity|NaN|undefined");
-
-
- var langClasses = (
- "AbstractMethodError|AssertionError|ClassCircularityError|"+
- "ClassFormatError|Deprecated|EnumConstantNotPresentException|"+
- "ExceptionInInitializerError|IllegalAccessError|"+
- "IllegalThreadStateException|InstantiationError|InternalError|"+
- "NegativeArraySizeException|NoSuchFieldError|Override|Process|"+
- "ProcessBuilder|SecurityManager|StringIndexOutOfBoundsException|"+
- "SuppressWarnings|TypeNotPresentException|UnknownError|"+
- "UnsatisfiedLinkError|UnsupportedClassVersionError|VerifyError|"+
- "InstantiationException|IndexOutOfBoundsException|"+
- "ArrayIndexOutOfBoundsException|CloneNotSupportedException|"+
- "NoSuchFieldException|IllegalArgumentException|NumberFormatException|"+
- "SecurityException|Void|InheritableThreadLocal|IllegalStateException|"+
- "InterruptedException|NoSuchMethodException|IllegalAccessException|"+
- "UnsupportedOperationException|Enum|StrictMath|Package|Compiler|"+
- "Readable|Runtime|StringBuilder|Math|IncompatibleClassChangeError|"+
- "NoSuchMethodError|ThreadLocal|RuntimePermission|ArithmeticException|"+
- "NullPointerException|Long|Integer|Short|Byte|Double|Number|Float|"+
- "Character|Boolean|StackTraceElement|Appendable|StringBuffer|"+
- "Iterable|ThreadGroup|Runnable|Thread|IllegalMonitorStateException|"+
- "StackOverflowError|OutOfMemoryError|VirtualMachineError|"+
- "ArrayStoreException|ClassCastException|LinkageError|"+
- "NoClassDefFoundError|ClassNotFoundException|RuntimeException|"+
- "Exception|ThreadDeath|Error|Throwable|System|ClassLoader|"+
- "Cloneable|Class|CharSequence|Comparable|String|Object"
- );
-
- var keywordMapper = this.createKeywordMapper({
- "variable.language": "this",
- "keyword": keywords,
- "constant.language": buildinConstants,
- "support.function": langClasses
- }, "identifier");
-
- this.$rules = {
- "start" : [
- {
- token : "comment",
- regex : "\\/\\/.*$"
- },
- DocCommentHighlightRules.getStartRule("doc-start"),
- {
- token : "comment", // multi line comment
- regex : "\\/\\*",
- next : "comment"
- }, {
- token : "string.regexp",
- regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"
- }, {
- token : "string", // single line
- regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
- }, {
- token : "string", // single line
- regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
- }, {
- token : "constant.numeric", // hex
- regex : "0[xX][0-9a-fA-F]+\\b"
- }, {
- token : "constant.numeric", // float
- regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\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" : [
- {
- token : "comment", // closing comment
- regex : ".*?\\*\\/",
- next : "start"
- }, {
- token : "comment", // comment spanning whole line
- regex : ".+"
- }
- ]
- };
-
- this.embedRules(DocCommentHighlightRules, "doc-",
- [ DocCommentHighlightRules.getEndRule("start") ]);
-};
-
-oop.inherits(JavaHighlightRules, TextHighlightRules);
-
-exports.JavaHighlightRules = JavaHighlightRules;
-});
diff --git a/public/libs/ace/mode-javascript.js b/public/libs/ace/mode-javascript.js
deleted file mode 100644
index b8d2290..0000000
--- a/public/libs/ace/mode-javascript.js
+++ /dev/null
@@ -1,896 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Distributed under the BSD license:
- *
- * Copyright (c) 2010, Ajax.org B.V.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of Ajax.org B.V. nor the
- * names of its contributors may be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * ***** END LICENSE BLOCK ***** */
-
-define('ace/mode/javascript', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/javascript_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/worker/worker_client', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) {
-
-
-var oop = require("../lib/oop");
-var TextMode = require("./text").Mode;
-var Tokenizer = require("../tokenizer").Tokenizer;
-var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
-var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
-var Range = require("../range").Range;
-var WorkerClient = require("../worker/worker_client").WorkerClient;
-var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
-var CStyleFoldMode = require("./folding/cstyle").FoldMode;
-
-var Mode = function() {
- this.$tokenizer = new Tokenizer(new JavaScriptHighlightRules().getRules());
- this.$outdent = new MatchingBraceOutdent();
- this.$behaviour = new CstyleBehaviour();
- this.foldingRules = new CStyleFoldMode();
-};
-oop.inherits(Mode, TextMode);
-
-(function() {
-
-
- this.toggleCommentLines = function(state, doc, startRow, endRow) {
- var outdent = true;
- var re = /^(\s*)\/\//;
-
- for (var i=startRow; i<= endRow; i++) {
- if (!re.test(doc.getLine(i))) {
- outdent = false;
- break;
- }
- }
-
- if (outdent) {
- var deleteRange = new Range(0, 0, 0, 0);
- for (var i=startRow; i<= endRow; i++)
- {
- var line = doc.getLine(i);
- var m = line.match(re);
- deleteRange.start.row = i;
- deleteRange.end.row = i;
- deleteRange.end.column = m[0].length;
- doc.replace(deleteRange, m[1]);
- }
- }
- else {
- doc.indentRows(startRow, endRow, "//");
- }
- };
-
- this.getNextLineIndent = function(state, line, tab) {
- var indent = this.$getIndent(line);
-
- var tokenizedLine = this.$tokenizer.getLineTokens(line, state);
- var tokens = tokenizedLine.tokens;
- var endState = tokenizedLine.state;
-
- if (tokens.length && tokens[tokens.length-1].type == "comment") {
- return indent;
- }
-
- if (state == "start" || state == "regex_allowed") {
- var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/);
- if (match) {
- indent += tab;
- }
- } else if (state == "doc-start") {
- if (endState == "start" || state == "regex_allowed") {
- return "";
- }
- var match = line.match(/^\s*(\/?)\*/);
- if (match) {
- if (match[1]) {
- indent += " ";
- }
- indent += "* ";
- }
- }
-
- return indent;
- };
-
- this.checkOutdent = function(state, line, input) {
- return this.$outdent.checkOutdent(line, input);
- };
-
- this.autoOutdent = function(state, doc, row) {
- this.$outdent.autoOutdent(doc, row);
- };
-
- this.createWorker = function(session) {
- var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker");
- worker.attachToDocument(session.getDocument());
-
- worker.on("jslint", function(results) {
- session.setAnnotations(results.data);
- });
-
- worker.on("terminate", function() {
- session.clearAnnotations();
- });
-
- return worker;
- };
-
-}).call(Mode.prototype);
-
-exports.Mode = Mode;
-});
-
-define('ace/mode/javascript_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 DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
-var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
-
-var JavaScriptHighlightRules = function() {
- var keywordMapper = this.createKeywordMapper({
- "variable.language":
- "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors
- "Namespace|QName|XML|XMLList|" + // E4X
- "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
- "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" +
- "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors
- "SyntaxError|TypeError|URIError|" +
- "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions
- "isNaN|parseFloat|parseInt|" +
- "JSON|Math|" + // Other
- "this|arguments|prototype|window|document" , // Pseudo
- "keyword":
- "const|yield|import|get|set|" +
- "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
- "if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
- "__parent__|__count__|escape|unescape|with|__proto__|" +
- "class|enum|extends|super|export|implements|private|public|interface|package|protected|static",
- "storage.type":
- "const|let|var|function",
- "constant.language":
- "null|Infinity|NaN|undefined",
- "support.function":
- "alert",
- "constant.language.boolean": "true|false"
- }, "identifier");
- var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
- var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b";
-
- var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
- "u[0-9a-fA-F]{4}|" + // unicode
- "[0-2][0-7]{0,2}|" + // oct
- "3[0-6][0-7]?|" + // oct
- "37[0-7]?|" + // oct
- "[4-7][0-7]?|" + //oct
- ".)";
-
- this.$rules = {
- "start" : [
- {
- token : "comment",
- regex : /\/\/.*$/
- },
- DocCommentHighlightRules.getStartRule("doc-start"),
- {
- token : "comment", // multi line comment
- regex : /\/\*/,
- next : "comment"
- }, {
- token : "string",
- regex : "'(?=.)",
- next : "qstring"
- }, {
- token : "string",
- regex : '"(?=.)',
- next : "qqstring"
- }, {
- token : "constant.numeric", // hex
- regex : /0[xX][0-9a-fA-F]+\b/
- }, {
- token : "constant.numeric", // float
- regex : /[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/
- }, {
- token : [
- "storage.type", "punctuation.operator", "support.function",
- "punctuation.operator", "entity.name.function", "text","keyword.operator"
- ],
- regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)",
- next: "function_arguments"
- }, {
- token : [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text", "storage.type", "text", "paren.lparen"
- ],
- regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token : [
- "entity.name.function", "text", "keyword.operator", "text", "storage.type",
- "text", "paren.lparen"
- ],
- regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token : [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
- ],
- regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token : [
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
- ],
- regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token : [
- "entity.name.function", "text", "punctuation.operator",
- "text", "storage.type", "text", "paren.lparen"
- ],
- regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token : [
- "text", "text", "storage.type", "text", "paren.lparen"
- ],
- regex : "(:)(\\s*)(function)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token : "keyword",
- regex : "(?:" + kwBeforeRe + ")\\b",
- next : "regex_allowed"
- }, {
- token : ["punctuation.operator", "support.function"],
- regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:opzzzz|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
- }, {
- token : ["punctuation.operator", "support.function.dom"],
- regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
- }, {
- token : ["punctuation.operator", "support.constant"],
- regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
- }, {
- token : ["storage.type", "punctuation.operator", "support.function.firebug"],
- regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/
- }, {
- token : keywordMapper,
- regex : identifierRe
- }, {
- token : "keyword.operator",
- regex : /--|\+\+|[!$%&*+\-~]|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=/,
- next : "regex_allowed"
- }, {
- token : "punctuation.operator",
- regex : /\?|\:|\,|\;|\./,
- next : "regex_allowed"
- }, {
- token : "paren.lparen",
- regex : /[\[({]/,
- next : "regex_allowed"
- }, {
- token : "paren.rparen",
- regex : /[\])}]/
- }, {
- token : "keyword.operator",
- regex : /\/=?/,
- next : "regex_allowed"
- }, {
- token: "comment",
- regex: /^#!.*$/
- }
- ],
- "regex_allowed": [
- DocCommentHighlightRules.getStartRule("doc-start"),
- {
- token : "comment", // multi line comment
- regex : "\\/\\*",
- next : "comment_regex_allowed"
- }, {
- token : "comment",
- regex : "\\/\\/.*$"
- }, {
- token: "string.regexp",
- regex: "\\/",
- next: "regex",
- }, {
- token : "text",
- regex : "\\s+"
- }, {
- token: "empty",
- regex: "",
- next: "start"
- }
- ],
- "regex": [
- {
- token: "regexp.keyword.operator",
- regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
- }, {
- token: "string.regexp",
- regex: "/\\w*",
- next: "start",
- }, {
- token : "invalid",
- regex: /\{\d+,?(?:\d+)?}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/
- }, {
- token : "constant.language.escape",
- regex: /\(\?[:=!]|\)|{\d+,?(?:\d+)?}|{,\d+}|[+*]\?|[()$^+*?]/
- }, {
- token : "constant.language.delimiter",
- regex: /\|/
- }, {
- token: "constant.language.escape",
- regex: /\[\^?/,
- next: "regex_character_class",
- }, {
- token: "empty",
- regex: "$",
- next: "start"
- }, {
- defaultToken: "string.regexp"
- }
- ],
- "regex_character_class": [
- {
- token: "regexp.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: "-"
- }, {
- token: "empty",
- regex: "$",
- next: "start"
- }, {
- defaultToken: "string.regexp.charachterclass"
- }
- ],
- "function_arguments": [
- {
- token: "variable.parameter",
- regex: identifierRe
- }, {
- token: "punctuation.operator",
- regex: "[, ]+",
- }, {
- token: "punctuation.operator",
- regex: "$",
- }, {
- token: "empty",
- regex: "",
- next: "start"
- }
- ],
- "comment_regex_allowed" : [
- {token : "comment", regex : "\\*\\/", next : "regex_allowed"},
- {defaultToken : "comment"}
- ],
- "comment" : [
- {token : "comment", regex : "\\*\\/", next : "start"},
- {defaultToken : "comment"}
- ],
- "qqstring" : [
- {
- token : "constant.language.escape",
- regex : escapedRe
- }, {
- token : "string",
- regex : "\\\\$",
- next : "qqstring",
- }, {
- token : "string",
- regex : '"|$',
- next : "start",
- }, {
- defaultToken: "string"
- }
- ],
- "qstring" : [
- {
- token : "constant.language.escape",
- regex : escapedRe
- }, {
- token : "string",
- regex : "\\\\$",
- next : "qstring",
- }, {
- token : "string",
- regex : "'|$",
- next : "start",
- }, {
- defaultToken: "string"
- }
- ]
- };
-
- this.embedRules(DocCommentHighlightRules, "doc-",
- [ DocCommentHighlightRules.getEndRule("start") ]);
-};
-
-oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
-
-exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
-});
-
-define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
-
-
-var oop = require("../lib/oop");
-var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
-
-var DocCommentHighlightRules = function() {
-
- this.$rules = {
- "start" : [ {
- token : "comment.doc.tag",
- regex : "@[\\w\\d_]+" // TODO: fix email addresses
- }, {
- token : "comment.doc.tag",
- regex : "\\bTODO\\b"
- }, {
- defaultToken : "comment.doc"
- }]
- };
-};
-
-oop.inherits(DocCommentHighlightRules, TextHighlightRules);
-
-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/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
-
-
-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) {
- var match = line.match(/^(\s+)/);
- if (match) {
- return match[1];
- }
-
- return "";
- };
-
-}).call(MatchingBraceOutdent.prototype);
-
-exports.MatchingBraceOutdent = MatchingBraceOutdent;
-});
-
-define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) {
-
-
-var oop = require("../../lib/oop");
-var Behaviour = require("../behaviour").Behaviour;
-var TokenIterator = require("../../token_iterator").TokenIterator;
-var lang = require("../../lib/lang");
-
-var SAFE_INSERT_IN_TOKENS =
- ["text", "paren.rparen", "punctuation.operator"];
-var SAFE_INSERT_BEFORE_TOKENS =
- ["text", "paren.rparen", "punctuation.operator", "comment"];
-
-
-var autoInsertedBrackets = 0;
-var autoInsertedRow = -1;
-var autoInsertedLineEnd = "";
-var maybeInsertedBrackets = 0;
-var maybeInsertedRow = -1;
-var maybeInsertedLineStart = "";
-var maybeInsertedLineEnd = "";
-
-var CstyleBehaviour = function () {
-
- CstyleBehaviour.isSaneInsertion = function(editor, session) {
- var cursor = editor.getCursorPosition();
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) {
- var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1);
- if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS))
- return false;
- }
- iterator.stepForward();
- return iterator.getCurrentTokenRow() !== cursor.row ||
- this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS);
- };
-
- CstyleBehaviour.$matchTokenType = function(token, types) {
- return types.indexOf(token.type || token) > -1;
- };
-
- CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) {
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- if (!this.isAutoInsertedClosing(cursor, line, autoInsertedLineEnd[0]))
- autoInsertedBrackets = 0;
- autoInsertedRow = cursor.row;
- autoInsertedLineEnd = bracket + line.substr(cursor.column);
- autoInsertedBrackets++;
- };
-
- CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) {
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- if (!this.isMaybeInsertedClosing(cursor, line))
- maybeInsertedBrackets = 0;
- maybeInsertedRow = cursor.row;
- maybeInsertedLineStart = line.substr(0, cursor.column) + bracket;
- maybeInsertedLineEnd = line.substr(cursor.column);
- maybeInsertedBrackets++;
- };
-
- CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) {
- return autoInsertedBrackets > 0 &&
- cursor.row === autoInsertedRow &&
- bracket === autoInsertedLineEnd[0] &&
- line.substr(cursor.column) === autoInsertedLineEnd;
- };
-
- CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) {
- return maybeInsertedBrackets > 0 &&
- cursor.row === maybeInsertedRow &&
- line.substr(cursor.column) === maybeInsertedLineEnd &&
- line.substr(0, cursor.column) == maybeInsertedLineStart;
- };
-
- CstyleBehaviour.popAutoInsertedClosing = function() {
- autoInsertedLineEnd = autoInsertedLineEnd.substr(1);
- autoInsertedBrackets--;
- };
-
- CstyleBehaviour.clearMaybeInsertedClosing = function() {
- maybeInsertedBrackets = 0;
- maybeInsertedRow = -1;
- };
-
- this.add("braces", "insertion", function (state, action, editor, session, text) {
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- if (text == '{') {
- var selection = editor.getSelectionRange();
- var selected = session.doc.getTextRange(selection);
- if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) {
- return {
- text: '{' + selected + '}',
- selection: false
- };
- } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
- if (/[\]\}\)]/.test(line[cursor.column])) {
- CstyleBehaviour.recordAutoInsert(editor, session, "}");
- return {
- text: '{}',
- selection: [1, 1]
- };
- } else {
- CstyleBehaviour.recordMaybeInsert(editor, session, "{");
- return {
- text: '{',
- selection: [1, 1]
- };
- }
- }
- } else if (text == '}') {
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- if (rightChar == '}') {
- var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row});
- if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
- CstyleBehaviour.popAutoInsertedClosing();
- return {
- text: '',
- selection: [1, 1]
- };
- }
- }
- } else if (text == "\n" || text == "\r\n") {
- var closing = "";
- if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) {
- closing = lang.stringRepeat("}", maybeInsertedBrackets);
- CstyleBehaviour.clearMaybeInsertedClosing();
- }
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- if (rightChar == '}' || closing !== "") {
- var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column}, '}');
- if (!openBracePos)
- return null;
-
- var indent = this.getNextLineIndent(state, line.substring(0, cursor.column), session.getTabString());
- var next_indent = this.$getIndent(line);
-
- return {
- text: '\n' + indent + '\n' + next_indent + closing,
- selection: [1, indent.length, 1, indent.length]
- };
- }
- }
- });
-
- this.add("braces", "deletion", function (state, action, editor, session, range) {
- var selected = session.doc.getTextRange(range);
- if (!range.isMultiLine() && selected == '{') {
- var line = session.doc.getLine(range.start.row);
- var rightChar = line.substring(range.end.column, range.end.column + 1);
- if (rightChar == '}') {
- range.end.column++;
- return range;
- } else {
- maybeInsertedBrackets--;
- }
- }
- });
-
- this.add("parens", "insertion", function (state, action, editor, session, text) {
- if (text == '(') {
- var selection = editor.getSelectionRange();
- var selected = session.doc.getTextRange(selection);
- if (selected !== "" && editor.getWrapBehavioursEnabled()) {
- return {
- text: '(' + selected + ')',
- selection: false
- };
- } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
- CstyleBehaviour.recordAutoInsert(editor, session, ")");
- return {
- text: '()',
- selection: [1, 1]
- };
- }
- } else if (text == ')') {
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- if (rightChar == ')') {
- var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row});
- if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
- CstyleBehaviour.popAutoInsertedClosing();
- return {
- text: '',
- selection: [1, 1]
- };
- }
- }
- }
- });
-
- this.add("parens", "deletion", function (state, action, editor, session, range) {
- var selected = session.doc.getTextRange(range);
- if (!range.isMultiLine() && selected == '(') {
- var line = session.doc.getLine(range.start.row);
- var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
- if (rightChar == ')') {
- range.end.column++;
- return range;
- }
- }
- });
-
- this.add("brackets", "insertion", function (state, action, editor, session, text) {
- if (text == '[') {
- var selection = editor.getSelectionRange();
- var selected = session.doc.getTextRange(selection);
- if (selected !== "" && editor.getWrapBehavioursEnabled()) {
- return {
- text: '[' + selected + ']',
- selection: false
- };
- } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
- CstyleBehaviour.recordAutoInsert(editor, session, "]");
- return {
- text: '[]',
- selection: [1, 1]
- };
- }
- } else if (text == ']') {
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- if (rightChar == ']') {
- var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row});
- if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
- CstyleBehaviour.popAutoInsertedClosing();
- return {
- text: '',
- selection: [1, 1]
- };
- }
- }
- }
- });
-
- this.add("brackets", "deletion", function (state, action, editor, session, range) {
- var selected = session.doc.getTextRange(range);
- if (!range.isMultiLine() && selected == '[') {
- var line = session.doc.getLine(range.start.row);
- var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
- if (rightChar == ']') {
- range.end.column++;
- return range;
- }
- }
- });
-
- this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
- if (text == '"' || text == "'") {
- var quote = text;
- var selection = editor.getSelectionRange();
- var selected = session.doc.getTextRange(selection);
- if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
- return {
- text: quote + selected + quote,
- selection: false
- };
- } else {
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- var leftChar = line.substring(cursor.column-1, cursor.column);
- if (leftChar == '\\') {
- return null;
- }
- var tokens = session.getTokens(selection.start.row);
- var col = 0, token;
- var quotepos = -1; // Track whether we're inside an open quote.
-
- for (var x = 0; x < tokens.length; x++) {
- token = tokens[x];
- if (token.type == "string") {
- quotepos = -1;
- } else if (quotepos < 0) {
- quotepos = token.value.indexOf(quote);
- }
- if ((token.value.length + col) > selection.start.column) {
- break;
- }
- col += tokens[x].value.length;
- }
- if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) {
- if (!CstyleBehaviour.isSaneInsertion(editor, session))
- return;
- return {
- text: quote + quote,
- selection: [1,1]
- };
- } else if (token && token.type === "string") {
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- if (rightChar == quote) {
- return {
- text: '',
- selection: [1, 1]
- };
- }
- }
- }
- }
- });
-
- this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
- var selected = session.doc.getTextRange(range);
- if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
- var line = session.doc.getLine(range.start.row);
- var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
- if (rightChar == selected) {
- range.end.column++;
- return range;
- }
- }
- });
-
-};
-
-oop.inherits(CstyleBehaviour, Behaviour);
-
-exports.CstyleBehaviour = CstyleBehaviour;
-});
-
-define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
-
-
-var oop = require("../../lib/oop");
-var Range = require("../../range").Range;
-var BaseFoldMode = require("./fold_mode").FoldMode;
-
-var FoldMode = exports.FoldMode = function() {};
-oop.inherits(FoldMode, BaseFoldMode);
-
-(function() {
-
- this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;
- this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
-
- this.getFoldWidgetRange = function(session, foldStyle, row) {
- var line = session.getLine(row);
- var match = line.match(this.foldingStartMarker);
- if (match) {
- var i = match.index;
-
- if (match[1])
- return this.openingBracketBlock(session, match[1], row, i);
-
- return session.getCommentFoldRange(row, i + match[0].length, 1);
- }
-
- if (foldStyle !== "markbeginend")
- 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);
- }
- };
-
-}).call(FoldMode.prototype);
-
-});
diff --git a/public/libs/ace/mode-json.js b/public/libs/ace/mode-json.js
deleted file mode 100644
index 9060382..0000000
--- a/public/libs/ace/mode-json.js
+++ /dev/null
@@ -1,574 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Distributed under the BSD license:
- *
- * Copyright (c) 2010, Ajax.org B.V.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of Ajax.org B.V. nor the
- * names of its contributors may be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * ***** END LICENSE BLOCK ***** */
-
-define('ace/mode/json', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/json_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle', 'ace/worker/worker_client'], function(require, exports, module) {
-
-
-var oop = require("../lib/oop");
-var TextMode = require("./text").Mode;
-var Tokenizer = require("../tokenizer").Tokenizer;
-var HighlightRules = require("./json_highlight_rules").JsonHighlightRules;
-var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
-var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
-var CStyleFoldMode = require("./folding/cstyle").FoldMode;
-var WorkerClient = require("../worker/worker_client").WorkerClient;
-
-var Mode = function() {
- this.$tokenizer = new Tokenizer(new HighlightRules().getRules());
- this.$outdent = new MatchingBraceOutdent();
- this.$behaviour = new CstyleBehaviour();
- this.foldingRules = new CStyleFoldMode();
-};
-oop.inherits(Mode, TextMode);
-
-(function() {
-
- this.getNextLineIndent = function(state, line, tab) {
- var indent = this.$getIndent(line);
-
- if (state == "start") {
- var match = line.match(/^.*[\{\(\[]\s*$/);
- if (match) {
- indent += tab;
- }
- }
-
- return indent;
- };
-
- this.checkOutdent = function(state, line, input) {
- return this.$outdent.checkOutdent(line, input);
- };
-
- this.autoOutdent = function(state, doc, row) {
- this.$outdent.autoOutdent(doc, row);
- };
-
- this.createWorker = function(session) {
- var worker = new WorkerClient(["ace"], "ace/mode/json_worker", "JsonWorker");
- worker.attachToDocument(session.getDocument());
-
- worker.on("error", function(e) {
- session.setAnnotations([e.data]);
- });
-
- worker.on("ok", function() {
- session.clearAnnotations();
- });
-
- return worker;
- };
-
-
-}).call(Mode.prototype);
-
-exports.Mode = Mode;
-});
-
-define('ace/mode/json_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
-
-
-var oop = require("../lib/oop");
-var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
-
-var JsonHighlightRules = function() {
- this.$rules = {
- "start" : [
- {
- token : "variable", // single line
- regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]\\s*(?=:)'
- }, {
- token : "string", // single line
- regex : '"',
- next : "string"
- }, {
- token : "constant.numeric", // hex
- regex : "0[xX][0-9a-fA-F]+\\b"
- }, {
- token : "constant.numeric", // float
- regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
- }, {
- token : "constant.language.boolean",
- regex : "(?:true|false)\\b"
- }, {
- token : "invalid.illegal", // single quoted strings are not allowed
- regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
- }, {
- token : "invalid.illegal", // comments are not allowed
- regex : "\\/\\/.*$"
- }, {
- token : "paren.lparen",
- regex : "[[({]"
- }, {
- token : "paren.rparen",
- regex : "[\\])}]"
- }, {
- token : "text",
- regex : "\\s+"
- }
- ],
- "string" : [
- {
- token : "constant.language.escape",
- regex : /\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\\\/bfnrt])/
- }, {
- token : "string",
- regex : '[^"\\\\]+',
- }, {
- token : "string",
- regex : '"',
- next : "start",
- }, {
- token : "string",
- regex : "",
- next : "start",
- }
- ]
- };
-
-};
-
-oop.inherits(JsonHighlightRules, TextHighlightRules);
-
-exports.JsonHighlightRules = JsonHighlightRules;
-});
-
-define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
-
-
-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) {
- var match = line.match(/^(\s+)/);
- if (match) {
- return match[1];
- }
-
- return "";
- };
-
-}).call(MatchingBraceOutdent.prototype);
-
-exports.MatchingBraceOutdent = MatchingBraceOutdent;
-});
-
-define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) {
-
-
-var oop = require("../../lib/oop");
-var Behaviour = require("../behaviour").Behaviour;
-var TokenIterator = require("../../token_iterator").TokenIterator;
-var lang = require("../../lib/lang");
-
-var SAFE_INSERT_IN_TOKENS =
- ["text", "paren.rparen", "punctuation.operator"];
-var SAFE_INSERT_BEFORE_TOKENS =
- ["text", "paren.rparen", "punctuation.operator", "comment"];
-
-
-var autoInsertedBrackets = 0;
-var autoInsertedRow = -1;
-var autoInsertedLineEnd = "";
-var maybeInsertedBrackets = 0;
-var maybeInsertedRow = -1;
-var maybeInsertedLineStart = "";
-var maybeInsertedLineEnd = "";
-
-var CstyleBehaviour = function () {
-
- CstyleBehaviour.isSaneInsertion = function(editor, session) {
- var cursor = editor.getCursorPosition();
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) {
- var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1);
- if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS))
- return false;
- }
- iterator.stepForward();
- return iterator.getCurrentTokenRow() !== cursor.row ||
- this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS);
- };
-
- CstyleBehaviour.$matchTokenType = function(token, types) {
- return types.indexOf(token.type || token) > -1;
- };
-
- CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) {
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- if (!this.isAutoInsertedClosing(cursor, line, autoInsertedLineEnd[0]))
- autoInsertedBrackets = 0;
- autoInsertedRow = cursor.row;
- autoInsertedLineEnd = bracket + line.substr(cursor.column);
- autoInsertedBrackets++;
- };
-
- CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) {
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- if (!this.isMaybeInsertedClosing(cursor, line))
- maybeInsertedBrackets = 0;
- maybeInsertedRow = cursor.row;
- maybeInsertedLineStart = line.substr(0, cursor.column) + bracket;
- maybeInsertedLineEnd = line.substr(cursor.column);
- maybeInsertedBrackets++;
- };
-
- CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) {
- return autoInsertedBrackets > 0 &&
- cursor.row === autoInsertedRow &&
- bracket === autoInsertedLineEnd[0] &&
- line.substr(cursor.column) === autoInsertedLineEnd;
- };
-
- CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) {
- return maybeInsertedBrackets > 0 &&
- cursor.row === maybeInsertedRow &&
- line.substr(cursor.column) === maybeInsertedLineEnd &&
- line.substr(0, cursor.column) == maybeInsertedLineStart;
- };
-
- CstyleBehaviour.popAutoInsertedClosing = function() {
- autoInsertedLineEnd = autoInsertedLineEnd.substr(1);
- autoInsertedBrackets--;
- };
-
- CstyleBehaviour.clearMaybeInsertedClosing = function() {
- maybeInsertedBrackets = 0;
- maybeInsertedRow = -1;
- };
-
- this.add("braces", "insertion", function (state, action, editor, session, text) {
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- if (text == '{') {
- var selection = editor.getSelectionRange();
- var selected = session.doc.getTextRange(selection);
- if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) {
- return {
- text: '{' + selected + '}',
- selection: false
- };
- } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
- if (/[\]\}\)]/.test(line[cursor.column])) {
- CstyleBehaviour.recordAutoInsert(editor, session, "}");
- return {
- text: '{}',
- selection: [1, 1]
- };
- } else {
- CstyleBehaviour.recordMaybeInsert(editor, session, "{");
- return {
- text: '{',
- selection: [1, 1]
- };
- }
- }
- } else if (text == '}') {
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- if (rightChar == '}') {
- var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row});
- if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
- CstyleBehaviour.popAutoInsertedClosing();
- return {
- text: '',
- selection: [1, 1]
- };
- }
- }
- } else if (text == "\n" || text == "\r\n") {
- var closing = "";
- if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) {
- closing = lang.stringRepeat("}", maybeInsertedBrackets);
- CstyleBehaviour.clearMaybeInsertedClosing();
- }
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- if (rightChar == '}' || closing !== "") {
- var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column}, '}');
- if (!openBracePos)
- return null;
-
- var indent = this.getNextLineIndent(state, line.substring(0, cursor.column), session.getTabString());
- var next_indent = this.$getIndent(line);
-
- return {
- text: '\n' + indent + '\n' + next_indent + closing,
- selection: [1, indent.length, 1, indent.length]
- };
- }
- }
- });
-
- this.add("braces", "deletion", function (state, action, editor, session, range) {
- var selected = session.doc.getTextRange(range);
- if (!range.isMultiLine() && selected == '{') {
- var line = session.doc.getLine(range.start.row);
- var rightChar = line.substring(range.end.column, range.end.column + 1);
- if (rightChar == '}') {
- range.end.column++;
- return range;
- } else {
- maybeInsertedBrackets--;
- }
- }
- });
-
- this.add("parens", "insertion", function (state, action, editor, session, text) {
- if (text == '(') {
- var selection = editor.getSelectionRange();
- var selected = session.doc.getTextRange(selection);
- if (selected !== "" && editor.getWrapBehavioursEnabled()) {
- return {
- text: '(' + selected + ')',
- selection: false
- };
- } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
- CstyleBehaviour.recordAutoInsert(editor, session, ")");
- return {
- text: '()',
- selection: [1, 1]
- };
- }
- } else if (text == ')') {
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- if (rightChar == ')') {
- var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row});
- if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
- CstyleBehaviour.popAutoInsertedClosing();
- return {
- text: '',
- selection: [1, 1]
- };
- }
- }
- }
- });
-
- this.add("parens", "deletion", function (state, action, editor, session, range) {
- var selected = session.doc.getTextRange(range);
- if (!range.isMultiLine() && selected == '(') {
- var line = session.doc.getLine(range.start.row);
- var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
- if (rightChar == ')') {
- range.end.column++;
- return range;
- }
- }
- });
-
- this.add("brackets", "insertion", function (state, action, editor, session, text) {
- if (text == '[') {
- var selection = editor.getSelectionRange();
- var selected = session.doc.getTextRange(selection);
- if (selected !== "" && editor.getWrapBehavioursEnabled()) {
- return {
- text: '[' + selected + ']',
- selection: false
- };
- } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
- CstyleBehaviour.recordAutoInsert(editor, session, "]");
- return {
- text: '[]',
- selection: [1, 1]
- };
- }
- } else if (text == ']') {
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- if (rightChar == ']') {
- var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row});
- if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
- CstyleBehaviour.popAutoInsertedClosing();
- return {
- text: '',
- selection: [1, 1]
- };
- }
- }
- }
- });
-
- this.add("brackets", "deletion", function (state, action, editor, session, range) {
- var selected = session.doc.getTextRange(range);
- if (!range.isMultiLine() && selected == '[') {
- var line = session.doc.getLine(range.start.row);
- var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
- if (rightChar == ']') {
- range.end.column++;
- return range;
- }
- }
- });
-
- this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
- if (text == '"' || text == "'") {
- var quote = text;
- var selection = editor.getSelectionRange();
- var selected = session.doc.getTextRange(selection);
- if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
- return {
- text: quote + selected + quote,
- selection: false
- };
- } else {
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- var leftChar = line.substring(cursor.column-1, cursor.column);
- if (leftChar == '\\') {
- return null;
- }
- var tokens = session.getTokens(selection.start.row);
- var col = 0, token;
- var quotepos = -1; // Track whether we're inside an open quote.
-
- for (var x = 0; x < tokens.length; x++) {
- token = tokens[x];
- if (token.type == "string") {
- quotepos = -1;
- } else if (quotepos < 0) {
- quotepos = token.value.indexOf(quote);
- }
- if ((token.value.length + col) > selection.start.column) {
- break;
- }
- col += tokens[x].value.length;
- }
- if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) {
- if (!CstyleBehaviour.isSaneInsertion(editor, session))
- return;
- return {
- text: quote + quote,
- selection: [1,1]
- };
- } else if (token && token.type === "string") {
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- if (rightChar == quote) {
- return {
- text: '',
- selection: [1, 1]
- };
- }
- }
- }
- }
- });
-
- this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
- var selected = session.doc.getTextRange(range);
- if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
- var line = session.doc.getLine(range.start.row);
- var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
- if (rightChar == selected) {
- range.end.column++;
- return range;
- }
- }
- });
-
-};
-
-oop.inherits(CstyleBehaviour, Behaviour);
-
-exports.CstyleBehaviour = CstyleBehaviour;
-});
-
-define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
-
-
-var oop = require("../../lib/oop");
-var Range = require("../../range").Range;
-var BaseFoldMode = require("./fold_mode").FoldMode;
-
-var FoldMode = exports.FoldMode = function() {};
-oop.inherits(FoldMode, BaseFoldMode);
-
-(function() {
-
- this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;
- this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
-
- this.getFoldWidgetRange = function(session, foldStyle, row) {
- var line = session.getLine(row);
- var match = line.match(this.foldingStartMarker);
- if (match) {
- var i = match.index;
-
- if (match[1])
- return this.openingBracketBlock(session, match[1], row, i);
-
- return session.getCommentFoldRange(row, i + match[0].length, 1);
- }
-
- if (foldStyle !== "markbeginend")
- 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);
- }
- };
-
-}).call(FoldMode.prototype);
-
-});
diff --git a/public/libs/ace/mode-markdown.js b/public/libs/ace/mode-markdown.js
deleted file mode 100644
index 4dec5bb..0000000
--- a/public/libs/ace/mode-markdown.js
+++ /dev/null
@@ -1,2274 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Distributed under the BSD license:
- *
- * Copyright (c) 2010, Ajax.org B.V.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of Ajax.org B.V. nor the
- * names of its contributors may be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * ***** END LICENSE BLOCK ***** */
-
-define('ace/mode/markdown', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/mode/javascript', 'ace/mode/xml', 'ace/mode/html', 'ace/tokenizer', 'ace/mode/markdown_highlight_rules', 'ace/mode/folding/markdown'], function(require, exports, module) {
-
-
-var oop = require("../lib/oop");
-var TextMode = require("./text").Mode;
-var JavaScriptMode = require("./javascript").Mode;
-var XmlMode = require("./xml").Mode;
-var HtmlMode = require("./html").Mode;
-var Tokenizer = require("../tokenizer").Tokenizer;
-var MarkdownHighlightRules = require("./markdown_highlight_rules").MarkdownHighlightRules;
-var MarkdownFoldMode = require("./folding/markdown").FoldMode;
-
-var Mode = function() {
- var highlighter = new MarkdownHighlightRules();
-
- this.$tokenizer = new Tokenizer(highlighter.getRules());
- this.$embeds = highlighter.getEmbeds();
- this.createModeDelegates({
- "js-": JavaScriptMode,
- "xml-": XmlMode,
- "html-": HtmlMode
- });
-
- this.foldingRules = new MarkdownFoldMode();
-};
-oop.inherits(Mode, TextMode);
-
-(function() {
- this.getNextLineIndent = function(state, line, tab) {
- if (state == "listblock") {
- var match = /^(\s*)(?:([-+*])|(\d+)\.)(\s+)/.exec(line);
- if (!match)
- return "";
- var marker = match[2];
- if (!marker)
- marker = parseInt(match[3], 10) + 1 + ".";
- return match[1] + marker + match[4];
- } else {
- return this.$getIndent(line);
- }
- };
-}).call(Mode.prototype);
-
-exports.Mode = Mode;
-});
-
-define('ace/mode/javascript', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/javascript_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/worker/worker_client', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) {
-
-
-var oop = require("../lib/oop");
-var TextMode = require("./text").Mode;
-var Tokenizer = require("../tokenizer").Tokenizer;
-var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
-var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
-var Range = require("../range").Range;
-var WorkerClient = require("../worker/worker_client").WorkerClient;
-var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
-var CStyleFoldMode = require("./folding/cstyle").FoldMode;
-
-var Mode = function() {
- this.$tokenizer = new Tokenizer(new JavaScriptHighlightRules().getRules());
- this.$outdent = new MatchingBraceOutdent();
- this.$behaviour = new CstyleBehaviour();
- this.foldingRules = new CStyleFoldMode();
-};
-oop.inherits(Mode, TextMode);
-
-(function() {
-
-
- this.toggleCommentLines = function(state, doc, startRow, endRow) {
- var outdent = true;
- var re = /^(\s*)\/\//;
-
- for (var i=startRow; i<= endRow; i++) {
- if (!re.test(doc.getLine(i))) {
- outdent = false;
- break;
- }
- }
-
- if (outdent) {
- var deleteRange = new Range(0, 0, 0, 0);
- for (var i=startRow; i<= endRow; i++)
- {
- var line = doc.getLine(i);
- var m = line.match(re);
- deleteRange.start.row = i;
- deleteRange.end.row = i;
- deleteRange.end.column = m[0].length;
- doc.replace(deleteRange, m[1]);
- }
- }
- else {
- doc.indentRows(startRow, endRow, "//");
- }
- };
-
- this.getNextLineIndent = function(state, line, tab) {
- var indent = this.$getIndent(line);
-
- var tokenizedLine = this.$tokenizer.getLineTokens(line, state);
- var tokens = tokenizedLine.tokens;
- var endState = tokenizedLine.state;
-
- if (tokens.length && tokens[tokens.length-1].type == "comment") {
- return indent;
- }
-
- if (state == "start" || state == "regex_allowed") {
- var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/);
- if (match) {
- indent += tab;
- }
- } else if (state == "doc-start") {
- if (endState == "start" || state == "regex_allowed") {
- return "";
- }
- var match = line.match(/^\s*(\/?)\*/);
- if (match) {
- if (match[1]) {
- indent += " ";
- }
- indent += "* ";
- }
- }
-
- return indent;
- };
-
- this.checkOutdent = function(state, line, input) {
- return this.$outdent.checkOutdent(line, input);
- };
-
- this.autoOutdent = function(state, doc, row) {
- this.$outdent.autoOutdent(doc, row);
- };
-
- this.createWorker = function(session) {
- var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker");
- worker.attachToDocument(session.getDocument());
-
- worker.on("jslint", function(results) {
- session.setAnnotations(results.data);
- });
-
- worker.on("terminate", function() {
- session.clearAnnotations();
- });
-
- return worker;
- };
-
-}).call(Mode.prototype);
-
-exports.Mode = Mode;
-});
-
-define('ace/mode/javascript_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 DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
-var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
-
-var JavaScriptHighlightRules = function() {
- var keywordMapper = this.createKeywordMapper({
- "variable.language":
- "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors
- "Namespace|QName|XML|XMLList|" + // E4X
- "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
- "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" +
- "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors
- "SyntaxError|TypeError|URIError|" +
- "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions
- "isNaN|parseFloat|parseInt|" +
- "JSON|Math|" + // Other
- "this|arguments|prototype|window|document" , // Pseudo
- "keyword":
- "const|yield|import|get|set|" +
- "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
- "if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
- "__parent__|__count__|escape|unescape|with|__proto__|" +
- "class|enum|extends|super|export|implements|private|public|interface|package|protected|static",
- "storage.type":
- "const|let|var|function",
- "constant.language":
- "null|Infinity|NaN|undefined",
- "support.function":
- "alert",
- "constant.language.boolean": "true|false"
- }, "identifier");
- var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
- var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b";
-
- var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
- "u[0-9a-fA-F]{4}|" + // unicode
- "[0-2][0-7]{0,2}|" + // oct
- "3[0-6][0-7]?|" + // oct
- "37[0-7]?|" + // oct
- "[4-7][0-7]?|" + //oct
- ".)";
-
- this.$rules = {
- "start" : [
- {
- token : "comment",
- regex : /\/\/.*$/
- },
- DocCommentHighlightRules.getStartRule("doc-start"),
- {
- token : "comment", // multi line comment
- regex : /\/\*/,
- next : "comment"
- }, {
- token : "string",
- regex : "'(?=.)",
- next : "qstring"
- }, {
- token : "string",
- regex : '"(?=.)',
- next : "qqstring"
- }, {
- token : "constant.numeric", // hex
- regex : /0[xX][0-9a-fA-F]+\b/
- }, {
- token : "constant.numeric", // float
- regex : /[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/
- }, {
- token : [
- "storage.type", "punctuation.operator", "support.function",
- "punctuation.operator", "entity.name.function", "text","keyword.operator"
- ],
- regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)",
- next: "function_arguments"
- }, {
- token : [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text", "storage.type", "text", "paren.lparen"
- ],
- regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token : [
- "entity.name.function", "text", "keyword.operator", "text", "storage.type",
- "text", "paren.lparen"
- ],
- regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token : [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
- ],
- regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token : [
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
- ],
- regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token : [
- "entity.name.function", "text", "punctuation.operator",
- "text", "storage.type", "text", "paren.lparen"
- ],
- regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token : [
- "text", "text", "storage.type", "text", "paren.lparen"
- ],
- regex : "(:)(\\s*)(function)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token : "keyword",
- regex : "(?:" + kwBeforeRe + ")\\b",
- next : "regex_allowed"
- }, {
- token : ["punctuation.operator", "support.function"],
- regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:opzzzz|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
- }, {
- token : ["punctuation.operator", "support.function.dom"],
- regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
- }, {
- token : ["punctuation.operator", "support.constant"],
- regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
- }, {
- token : ["storage.type", "punctuation.operator", "support.function.firebug"],
- regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/
- }, {
- token : keywordMapper,
- regex : identifierRe
- }, {
- token : "keyword.operator",
- regex : /--|\+\+|[!$%&*+\-~]|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=/,
- next : "regex_allowed"
- }, {
- token : "punctuation.operator",
- regex : /\?|\:|\,|\;|\./,
- next : "regex_allowed"
- }, {
- token : "paren.lparen",
- regex : /[\[({]/,
- next : "regex_allowed"
- }, {
- token : "paren.rparen",
- regex : /[\])}]/
- }, {
- token : "keyword.operator",
- regex : /\/=?/,
- next : "regex_allowed"
- }, {
- token: "comment",
- regex: /^#!.*$/
- }
- ],
- "regex_allowed": [
- DocCommentHighlightRules.getStartRule("doc-start"),
- {
- token : "comment", // multi line comment
- regex : "\\/\\*",
- next : "comment_regex_allowed"
- }, {
- token : "comment",
- regex : "\\/\\/.*$"
- }, {
- token: "string.regexp",
- regex: "\\/",
- next: "regex",
- }, {
- token : "text",
- regex : "\\s+"
- }, {
- token: "empty",
- regex: "",
- next: "start"
- }
- ],
- "regex": [
- {
- token: "regexp.keyword.operator",
- regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
- }, {
- token: "string.regexp",
- regex: "/\\w*",
- next: "start",
- }, {
- token : "invalid",
- regex: /\{\d+,?(?:\d+)?}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/
- }, {
- token : "constant.language.escape",
- regex: /\(\?[:=!]|\)|{\d+,?(?:\d+)?}|{,\d+}|[+*]\?|[()$^+*?]/
- }, {
- token : "constant.language.delimiter",
- regex: /\|/
- }, {
- token: "constant.language.escape",
- regex: /\[\^?/,
- next: "regex_character_class",
- }, {
- token: "empty",
- regex: "$",
- next: "start"
- }, {
- defaultToken: "string.regexp"
- }
- ],
- "regex_character_class": [
- {
- token: "regexp.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: "-"
- }, {
- token: "empty",
- regex: "$",
- next: "start"
- }, {
- defaultToken: "string.regexp.charachterclass"
- }
- ],
- "function_arguments": [
- {
- token: "variable.parameter",
- regex: identifierRe
- }, {
- token: "punctuation.operator",
- regex: "[, ]+",
- }, {
- token: "punctuation.operator",
- regex: "$",
- }, {
- token: "empty",
- regex: "",
- next: "start"
- }
- ],
- "comment_regex_allowed" : [
- {token : "comment", regex : "\\*\\/", next : "regex_allowed"},
- {defaultToken : "comment"}
- ],
- "comment" : [
- {token : "comment", regex : "\\*\\/", next : "start"},
- {defaultToken : "comment"}
- ],
- "qqstring" : [
- {
- token : "constant.language.escape",
- regex : escapedRe
- }, {
- token : "string",
- regex : "\\\\$",
- next : "qqstring",
- }, {
- token : "string",
- regex : '"|$',
- next : "start",
- }, {
- defaultToken: "string"
- }
- ],
- "qstring" : [
- {
- token : "constant.language.escape",
- regex : escapedRe
- }, {
- token : "string",
- regex : "\\\\$",
- next : "qstring",
- }, {
- token : "string",
- regex : "'|$",
- next : "start",
- }, {
- defaultToken: "string"
- }
- ]
- };
-
- this.embedRules(DocCommentHighlightRules, "doc-",
- [ DocCommentHighlightRules.getEndRule("start") ]);
-};
-
-oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
-
-exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
-});
-
-define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
-
-
-var oop = require("../lib/oop");
-var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
-
-var DocCommentHighlightRules = function() {
-
- this.$rules = {
- "start" : [ {
- token : "comment.doc.tag",
- regex : "@[\\w\\d_]+" // TODO: fix email addresses
- }, {
- token : "comment.doc.tag",
- regex : "\\bTODO\\b"
- }, {
- defaultToken : "comment.doc"
- }]
- };
-};
-
-oop.inherits(DocCommentHighlightRules, TextHighlightRules);
-
-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/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
-
-
-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) {
- var match = line.match(/^(\s+)/);
- if (match) {
- return match[1];
- }
-
- return "";
- };
-
-}).call(MatchingBraceOutdent.prototype);
-
-exports.MatchingBraceOutdent = MatchingBraceOutdent;
-});
-
-define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) {
-
-
-var oop = require("../../lib/oop");
-var Behaviour = require("../behaviour").Behaviour;
-var TokenIterator = require("../../token_iterator").TokenIterator;
-var lang = require("../../lib/lang");
-
-var SAFE_INSERT_IN_TOKENS =
- ["text", "paren.rparen", "punctuation.operator"];
-var SAFE_INSERT_BEFORE_TOKENS =
- ["text", "paren.rparen", "punctuation.operator", "comment"];
-
-
-var autoInsertedBrackets = 0;
-var autoInsertedRow = -1;
-var autoInsertedLineEnd = "";
-var maybeInsertedBrackets = 0;
-var maybeInsertedRow = -1;
-var maybeInsertedLineStart = "";
-var maybeInsertedLineEnd = "";
-
-var CstyleBehaviour = function () {
-
- CstyleBehaviour.isSaneInsertion = function(editor, session) {
- var cursor = editor.getCursorPosition();
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) {
- var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1);
- if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS))
- return false;
- }
- iterator.stepForward();
- return iterator.getCurrentTokenRow() !== cursor.row ||
- this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS);
- };
-
- CstyleBehaviour.$matchTokenType = function(token, types) {
- return types.indexOf(token.type || token) > -1;
- };
-
- CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) {
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- if (!this.isAutoInsertedClosing(cursor, line, autoInsertedLineEnd[0]))
- autoInsertedBrackets = 0;
- autoInsertedRow = cursor.row;
- autoInsertedLineEnd = bracket + line.substr(cursor.column);
- autoInsertedBrackets++;
- };
-
- CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) {
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- if (!this.isMaybeInsertedClosing(cursor, line))
- maybeInsertedBrackets = 0;
- maybeInsertedRow = cursor.row;
- maybeInsertedLineStart = line.substr(0, cursor.column) + bracket;
- maybeInsertedLineEnd = line.substr(cursor.column);
- maybeInsertedBrackets++;
- };
-
- CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) {
- return autoInsertedBrackets > 0 &&
- cursor.row === autoInsertedRow &&
- bracket === autoInsertedLineEnd[0] &&
- line.substr(cursor.column) === autoInsertedLineEnd;
- };
-
- CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) {
- return maybeInsertedBrackets > 0 &&
- cursor.row === maybeInsertedRow &&
- line.substr(cursor.column) === maybeInsertedLineEnd &&
- line.substr(0, cursor.column) == maybeInsertedLineStart;
- };
-
- CstyleBehaviour.popAutoInsertedClosing = function() {
- autoInsertedLineEnd = autoInsertedLineEnd.substr(1);
- autoInsertedBrackets--;
- };
-
- CstyleBehaviour.clearMaybeInsertedClosing = function() {
- maybeInsertedBrackets = 0;
- maybeInsertedRow = -1;
- };
-
- this.add("braces", "insertion", function (state, action, editor, session, text) {
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- if (text == '{') {
- var selection = editor.getSelectionRange();
- var selected = session.doc.getTextRange(selection);
- if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) {
- return {
- text: '{' + selected + '}',
- selection: false
- };
- } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
- if (/[\]\}\)]/.test(line[cursor.column])) {
- CstyleBehaviour.recordAutoInsert(editor, session, "}");
- return {
- text: '{}',
- selection: [1, 1]
- };
- } else {
- CstyleBehaviour.recordMaybeInsert(editor, session, "{");
- return {
- text: '{',
- selection: [1, 1]
- };
- }
- }
- } else if (text == '}') {
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- if (rightChar == '}') {
- var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row});
- if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
- CstyleBehaviour.popAutoInsertedClosing();
- return {
- text: '',
- selection: [1, 1]
- };
- }
- }
- } else if (text == "\n" || text == "\r\n") {
- var closing = "";
- if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) {
- closing = lang.stringRepeat("}", maybeInsertedBrackets);
- CstyleBehaviour.clearMaybeInsertedClosing();
- }
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- if (rightChar == '}' || closing !== "") {
- var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column}, '}');
- if (!openBracePos)
- return null;
-
- var indent = this.getNextLineIndent(state, line.substring(0, cursor.column), session.getTabString());
- var next_indent = this.$getIndent(line);
-
- return {
- text: '\n' + indent + '\n' + next_indent + closing,
- selection: [1, indent.length, 1, indent.length]
- };
- }
- }
- });
-
- this.add("braces", "deletion", function (state, action, editor, session, range) {
- var selected = session.doc.getTextRange(range);
- if (!range.isMultiLine() && selected == '{') {
- var line = session.doc.getLine(range.start.row);
- var rightChar = line.substring(range.end.column, range.end.column + 1);
- if (rightChar == '}') {
- range.end.column++;
- return range;
- } else {
- maybeInsertedBrackets--;
- }
- }
- });
-
- this.add("parens", "insertion", function (state, action, editor, session, text) {
- if (text == '(') {
- var selection = editor.getSelectionRange();
- var selected = session.doc.getTextRange(selection);
- if (selected !== "" && editor.getWrapBehavioursEnabled()) {
- return {
- text: '(' + selected + ')',
- selection: false
- };
- } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
- CstyleBehaviour.recordAutoInsert(editor, session, ")");
- return {
- text: '()',
- selection: [1, 1]
- };
- }
- } else if (text == ')') {
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- if (rightChar == ')') {
- var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row});
- if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
- CstyleBehaviour.popAutoInsertedClosing();
- return {
- text: '',
- selection: [1, 1]
- };
- }
- }
- }
- });
-
- this.add("parens", "deletion", function (state, action, editor, session, range) {
- var selected = session.doc.getTextRange(range);
- if (!range.isMultiLine() && selected == '(') {
- var line = session.doc.getLine(range.start.row);
- var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
- if (rightChar == ')') {
- range.end.column++;
- return range;
- }
- }
- });
-
- this.add("brackets", "insertion", function (state, action, editor, session, text) {
- if (text == '[') {
- var selection = editor.getSelectionRange();
- var selected = session.doc.getTextRange(selection);
- if (selected !== "" && editor.getWrapBehavioursEnabled()) {
- return {
- text: '[' + selected + ']',
- selection: false
- };
- } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
- CstyleBehaviour.recordAutoInsert(editor, session, "]");
- return {
- text: '[]',
- selection: [1, 1]
- };
- }
- } else if (text == ']') {
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- if (rightChar == ']') {
- var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row});
- if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
- CstyleBehaviour.popAutoInsertedClosing();
- return {
- text: '',
- selection: [1, 1]
- };
- }
- }
- }
- });
-
- this.add("brackets", "deletion", function (state, action, editor, session, range) {
- var selected = session.doc.getTextRange(range);
- if (!range.isMultiLine() && selected == '[') {
- var line = session.doc.getLine(range.start.row);
- var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
- if (rightChar == ']') {
- range.end.column++;
- return range;
- }
- }
- });
-
- this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
- if (text == '"' || text == "'") {
- var quote = text;
- var selection = editor.getSelectionRange();
- var selected = session.doc.getTextRange(selection);
- if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
- return {
- text: quote + selected + quote,
- selection: false
- };
- } else {
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- var leftChar = line.substring(cursor.column-1, cursor.column);
- if (leftChar == '\\') {
- return null;
- }
- var tokens = session.getTokens(selection.start.row);
- var col = 0, token;
- var quotepos = -1; // Track whether we're inside an open quote.
-
- for (var x = 0; x < tokens.length; x++) {
- token = tokens[x];
- if (token.type == "string") {
- quotepos = -1;
- } else if (quotepos < 0) {
- quotepos = token.value.indexOf(quote);
- }
- if ((token.value.length + col) > selection.start.column) {
- break;
- }
- col += tokens[x].value.length;
- }
- if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) {
- if (!CstyleBehaviour.isSaneInsertion(editor, session))
- return;
- return {
- text: quote + quote,
- selection: [1,1]
- };
- } else if (token && token.type === "string") {
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- if (rightChar == quote) {
- return {
- text: '',
- selection: [1, 1]
- };
- }
- }
- }
- }
- });
-
- this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
- var selected = session.doc.getTextRange(range);
- if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
- var line = session.doc.getLine(range.start.row);
- var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
- if (rightChar == selected) {
- range.end.column++;
- return range;
- }
- }
- });
-
-};
-
-oop.inherits(CstyleBehaviour, Behaviour);
-
-exports.CstyleBehaviour = CstyleBehaviour;
-});
-
-define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
-
-
-var oop = require("../../lib/oop");
-var Range = require("../../range").Range;
-var BaseFoldMode = require("./fold_mode").FoldMode;
-
-var FoldMode = exports.FoldMode = function() {};
-oop.inherits(FoldMode, BaseFoldMode);
-
-(function() {
-
- this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;
- this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
-
- this.getFoldWidgetRange = function(session, foldStyle, row) {
- var line = session.getLine(row);
- var match = line.match(this.foldingStartMarker);
- if (match) {
- var i = match.index;
-
- if (match[1])
- return this.openingBracketBlock(session, match[1], row, i);
-
- return session.getCommentFoldRange(row, i + match[0].length, 1);
- }
-
- if (foldStyle !== "markbeginend")
- 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);
- }
- };
-
-}).call(FoldMode.prototype);
-
-});
-
-define('ace/mode/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/xml_highlight_rules', 'ace/mode/behaviour/xml', 'ace/mode/folding/xml'], function(require, exports, module) {
-
-
-var oop = require("../lib/oop");
-var TextMode = require("./text").Mode;
-var Tokenizer = require("../tokenizer").Tokenizer;
-var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules;
-var XmlBehaviour = require("./behaviour/xml").XmlBehaviour;
-var XmlFoldMode = require("./folding/xml").FoldMode;
-
-var Mode = function() {
- this.$tokenizer = new Tokenizer(new XmlHighlightRules().getRules());
- this.$behaviour = new XmlBehaviour();
- this.foldingRules = new XmlFoldMode();
-};
-
-oop.inherits(Mode, TextMode);
-
-(function() {
-
- this.getNextLineIndent = function(state, line, tab) {
- return this.$getIndent(line);
- };
-
-}).call(Mode.prototype);
-
-exports.Mode = Mode;
-});
-
-define('ace/mode/xml_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/xml_util', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
-
-
-var oop = require("../lib/oop");
-var xmlUtil = require("./xml_util");
-var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
-
-var XmlHighlightRules = function() {
- this.$rules = {
- start : [
- {token : "text", regex : "<\\!\\[CDATA\\[", next : "cdata"},
- {token : "xml-pe", regex : "<\\?.*?\\?>"},
- {token : "comment", regex : "<\\!--", next : "comment"},
- {token : "xml-pe", regex : "<\\!.*?>"},
- {token : "meta.tag", regex : "<\\/?", next : "tag"},
- {token : "text", regex : "\\s+"},
- {
- token : "constant.character.entity",
- regex : "(?:[0-9]+;)|(?:[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
- }
- ],
-
- cdata : [
- {token : "text", regex : "\\]\\]>", next : "start"},
- {token : "text", regex : "\\s+"},
- {token : "text", regex : "(?:[^\\]]|\\](?!\\]>))+"}
- ],
-
- comment : [
- {token : "comment", regex : ".*?-->", next : "start"},
- {token : "comment", regex : ".+"}
- ]
- };
-
- xmlUtil.tag(this.$rules, "tag", "start");
-};
-
-oop.inherits(XmlHighlightRules, TextHighlightRules);
-
-exports.XmlHighlightRules = XmlHighlightRules;
-});
-
-define('ace/mode/xml_util', ['require', 'exports', 'module' ], function(require, exports, module) {
-
-
-function string(state) {
- return [{
- token : "string",
- regex : '"',
- next : state + "_qqstring"
- }, {
- token : "string",
- regex : "'",
- next : state + "_qstring"
- }];
-}
-
-function multiLineString(quote, state) {
- return [
- {token : "string", regex : quote, next : state},
- {
- token : "constant.language.escape",
- regex : "(?:[0-9]+;)|(?:[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
- },
- {defaultToken : "string"}
- ];
-}
-
-exports.tag = function(states, name, nextState, tagMap) {
- states[name] = [{
- token : "text",
- regex : "\\s+"
- }, {
-
- token : !tagMap ? "meta.tag.tag-name" : function(value) {
- if (tagMap[value])
- return "meta.tag.tag-name." + tagMap[value];
- else
- return "meta.tag.tag-name";
- },
- regex : "[-_a-zA-Z0-9:]+",
- next : name + "_embed_attribute_list"
- }, {
- token: "empty",
- regex: "",
- next : name + "_embed_attribute_list"
- }];
-
- states[name + "_qstring"] = multiLineString("'", name + "_embed_attribute_list");
- states[name + "_qqstring"] = multiLineString("\"", name + "_embed_attribute_list");
-
- states[name + "_embed_attribute_list"] = [{
- token : "meta.tag.r",
- regex : "/?>",
- next : nextState
- }, {
- token : "keyword.operator",
- regex : "="
- }, {
- token : "entity.other.attribute-name",
- regex : "[-_a-zA-Z0-9:]+"
- }, {
- token : "constant.numeric", // float
- regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
- }, {
- token : "text",
- regex : "\\s+"
- }].concat(string(name));
-};
-
-});
-
-define('ace/mode/behaviour/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) {
-
-
-var oop = require("../../lib/oop");
-var Behaviour = require("../behaviour").Behaviour;
-var CstyleBehaviour = require("./cstyle").CstyleBehaviour;
-var TokenIterator = require("../../token_iterator").TokenIterator;
-
-function hasType(token, type) {
- var hasType = true;
- var typeList = token.type.split('.');
- var needleList = type.split('.');
- needleList.forEach(function(needle){
- if (typeList.indexOf(needle) == -1) {
- hasType = false;
- return false;
- }
- });
- return hasType;
-}
-
-var XmlBehaviour = function () {
-
- this.inherit(CstyleBehaviour, ["string_dquotes"]); // Get string behaviour
-
- this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
- if (text == '>') {
- var position = editor.getCursorPosition();
- var iterator = new TokenIterator(session, position.row, position.column);
- var token = iterator.getCurrentToken();
- var atCursor = false;
- if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){
- do {
- token = iterator.stepBackward();
- } while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text')));
- } else {
- atCursor = true;
- }
- if (!token || !hasType(token, 'meta.tag-name') || iterator.stepBackward().value.match('/')) {
- return
- }
- var tag = token.value;
- if (atCursor){
- var tag = tag.substring(0, position.column - token.start);
- }
-
- return {
- text: '>' + '' + tag + '>',
- selection: [1, 1]
- }
- }
- });
-
- this.add('autoindent', 'insertion', function (state, action, editor, session, text) {
- if (text == "\n") {
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- var rightChars = line.substring(cursor.column, cursor.column + 2);
- if (rightChars == '') {
- var indent = this.$getIndent(session.doc.getLine(cursor.row)) + session.getTabString();
- var next_indent = this.$getIndent(session.doc.getLine(cursor.row));
-
- return {
- text: '\n' + indent + '\n' + next_indent,
- selection: [1, indent.length, 1, indent.length]
- }
- }
- }
- });
-
-}
-oop.inherits(XmlBehaviour, Behaviour);
-
-exports.XmlBehaviour = XmlBehaviour;
-});
-
-define('ace/mode/folding/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/range', 'ace/mode/folding/fold_mode', 'ace/token_iterator'], function(require, exports, module) {
-
-
-var oop = require("../../lib/oop");
-var lang = require("../../lib/lang");
-var Range = require("../../range").Range;
-var BaseFoldMode = require("./fold_mode").FoldMode;
-var TokenIterator = require("../../token_iterator").TokenIterator;
-
-var FoldMode = exports.FoldMode = function(voidElements) {
- BaseFoldMode.call(this);
- this.voidElements = voidElements || {};
-};
-oop.inherits(FoldMode, BaseFoldMode);
-
-(function() {
-
- this.getFoldWidget = function(session, foldStyle, row) {
- var tag = this._getFirstTagInLine(session, row);
-
- if (tag.closing)
- return foldStyle == "markbeginend" ? "end" : "";
-
- if (!tag.tagName || this.voidElements[tag.tagName.toLowerCase()])
- return "";
-
- if (tag.selfClosing)
- return "";
-
- if (tag.value.indexOf("/" + tag.tagName) !== -1)
- return "";
-
- return "start";
- };
-
- this._getFirstTagInLine = function(session, row) {
- var tokens = session.getTokens(row);
- var value = "";
- for (var i = 0; i < tokens.length; i++) {
- var token = tokens[i];
- if (token.type.indexOf("meta.tag") === 0)
- value += token.value;
- else
- value += lang.stringRepeat(" ", token.value.length);
- }
-
- return this._parseTag(value);
- };
-
- this.tagRe = /^(\s*)((\/?)([-_a-zA-Z0-9:!]*)\s*(\/?)>?)/;
- this._parseTag = function(tag) {
-
- var match = this.tagRe.exec(tag);
- var column = this.tagRe.lastIndex || 0;
- this.tagRe.lastIndex = 0;
-
- return {
- value: tag,
- match: match ? match[2] : "",
- closing: match ? !!match[3] : false,
- selfClosing: match ? !!match[5] || match[2] == "/>" : false,
- tagName: match ? match[4] : "",
- column: match[1] ? column + match[1].length : column
- };
- };
- this._readTagForward = function(iterator) {
- var token = iterator.getCurrentToken();
- if (!token)
- return null;
-
- var value = "";
- var start;
-
- do {
- if (token.type.indexOf("meta.tag") === 0) {
- if (!start) {
- var start = {
- row: iterator.getCurrentTokenRow(),
- column: iterator.getCurrentTokenColumn()
- };
- }
- value += token.value;
- if (value.indexOf(">") !== -1) {
- var tag = this._parseTag(value);
- tag.start = start;
- tag.end = {
- row: iterator.getCurrentTokenRow(),
- column: iterator.getCurrentTokenColumn() + token.value.length
- };
- iterator.stepForward();
- return tag;
- }
- }
- } while(token = iterator.stepForward());
-
- return null;
- };
-
- this._readTagBackward = function(iterator) {
- var token = iterator.getCurrentToken();
- if (!token)
- return null;
-
- var value = "";
- var end;
-
- do {
- if (token.type.indexOf("meta.tag") === 0) {
- if (!end) {
- end = {
- row: iterator.getCurrentTokenRow(),
- column: iterator.getCurrentTokenColumn() + token.value.length
- };
- }
- value = token.value + value;
- if (value.indexOf("<") !== -1) {
- var tag = this._parseTag(value);
- tag.end = end;
- tag.start = {
- row: iterator.getCurrentTokenRow(),
- column: iterator.getCurrentTokenColumn()
- };
- iterator.stepBackward();
- return tag;
- }
- }
- } while(token = iterator.stepBackward());
-
- return null;
- };
-
- this._pop = function(stack, tag) {
- while (stack.length) {
-
- var top = stack[stack.length-1];
- if (!tag || top.tagName == tag.tagName) {
- return stack.pop();
- }
- else if (this.voidElements[tag.tagName]) {
- return;
- }
- else if (this.voidElements[top.tagName]) {
- stack.pop();
- continue;
- } else {
- return null;
- }
- }
- };
-
- this.getFoldWidgetRange = function(session, foldStyle, row) {
- var firstTag = this._getFirstTagInLine(session, row);
-
- if (!firstTag.match)
- return null;
-
- var isBackward = firstTag.closing || firstTag.selfClosing;
- var stack = [];
- var tag;
-
- if (!isBackward) {
- var iterator = new TokenIterator(session, row, firstTag.column);
- var start = {
- row: row,
- column: firstTag.column + firstTag.tagName.length + 2
- };
- while (tag = this._readTagForward(iterator)) {
- if (tag.selfClosing) {
- if (!stack.length) {
- tag.start.column += tag.tagName.length + 2;
- tag.end.column -= 2;
- return Range.fromPoints(tag.start, tag.end);
- } else
- continue;
- }
-
- if (tag.closing) {
- this._pop(stack, tag);
- if (stack.length == 0)
- return Range.fromPoints(start, tag.start);
- }
- else {
- stack.push(tag)
- }
- }
- }
- else {
- var iterator = new TokenIterator(session, row, firstTag.column + firstTag.match.length);
- var end = {
- row: row,
- column: firstTag.column
- };
-
- while (tag = this._readTagBackward(iterator)) {
- if (tag.selfClosing) {
- if (!stack.length) {
- tag.start.column += tag.tagName.length + 2;
- tag.end.column -= 2;
- return Range.fromPoints(tag.start, tag.end);
- } else
- continue;
- }
-
- if (!tag.closing) {
- this._pop(stack, tag);
- if (stack.length == 0) {
- tag.start.column += tag.tagName.length + 2;
- return Range.fromPoints(tag.start, end);
- }
- }
- else {
- stack.push(tag)
- }
- }
- }
-
- };
-
-}).call(FoldMode.prototype);
-
-});
-
-define('ace/mode/html', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/mode/javascript', 'ace/mode/css', 'ace/tokenizer', 'ace/mode/html_highlight_rules', 'ace/mode/behaviour/html', 'ace/mode/folding/html'], function(require, exports, module) {
-
-
-var oop = require("../lib/oop");
-var TextMode = require("./text").Mode;
-var JavaScriptMode = require("./javascript").Mode;
-var CssMode = require("./css").Mode;
-var Tokenizer = require("../tokenizer").Tokenizer;
-var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
-var HtmlBehaviour = require("./behaviour/html").HtmlBehaviour;
-var HtmlFoldMode = require("./folding/html").FoldMode;
-
-var Mode = function() {
- var highlighter = new HtmlHighlightRules();
- this.$tokenizer = new Tokenizer(highlighter.getRules());
- this.$behaviour = new HtmlBehaviour();
-
- this.$embeds = highlighter.getEmbeds();
- this.createModeDelegates({
- "js-": JavaScriptMode,
- "css-": CssMode
- });
-
- this.foldingRules = new HtmlFoldMode();
-};
-oop.inherits(Mode, TextMode);
-
-(function() {
-
-
- this.toggleCommentLines = function(state, doc, startRow, endRow) {
- return 0;
- };
-
- this.getNextLineIndent = function(state, line, tab) {
- return this.$getIndent(line);
- };
-
- this.checkOutdent = function(state, line, input) {
- return false;
- };
-
-}).call(Mode.prototype);
-
-exports.Mode = Mode;
-});
-
-define('ace/mode/css', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/css_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/worker/worker_client', 'ace/mode/behaviour/css', 'ace/mode/folding/cstyle'], function(require, exports, module) {
-
-
-var oop = require("../lib/oop");
-var TextMode = require("./text").Mode;
-var Tokenizer = require("../tokenizer").Tokenizer;
-var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
-var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
-var WorkerClient = require("../worker/worker_client").WorkerClient;
-var CssBehaviour = require("./behaviour/css").CssBehaviour;
-var CStyleFoldMode = require("./folding/cstyle").FoldMode;
-
-var Mode = function() {
- this.$tokenizer = new Tokenizer(new CssHighlightRules().getRules(), "i");
- this.$outdent = new MatchingBraceOutdent();
- this.$behaviour = new CssBehaviour();
- this.foldingRules = new CStyleFoldMode();
-};
-oop.inherits(Mode, TextMode);
-
-(function() {
-
- this.foldingRules = "cStyle";
-
- this.getNextLineIndent = function(state, line, tab) {
- var indent = this.$getIndent(line);
- var tokens = this.$tokenizer.getLineTokens(line, state).tokens;
- if (tokens.length && tokens[tokens.length-1].type == "comment") {
- return indent;
- }
-
- var match = line.match(/^.*\{\s*$/);
- if (match) {
- indent += tab;
- }
-
- return indent;
- };
-
- this.checkOutdent = function(state, line, input) {
- return this.$outdent.checkOutdent(line, input);
- };
-
- this.autoOutdent = function(state, doc, row) {
- this.$outdent.autoOutdent(doc, row);
- };
-
- this.createWorker = function(session) {
- var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker");
- worker.attachToDocument(session.getDocument());
-
- worker.on("csslint", function(e) {
- session.setAnnotations(e.data);
- });
-
- worker.on("terminate", function() {
- session.clearAnnotations();
- });
-
- return worker;
- };
-
-}).call(Mode.prototype);
-
-exports.Mode = Mode;
-
-});
-
-define('ace/mode/css_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
-
-
-var oop = require("../lib/oop");
-var lang = require("../lib/lang");
-var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
-var supportType = exports.supportType = "animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|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|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|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|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index";
-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 supportConstantColor = exports.supportConstantColor = "aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow";
-var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|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 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 CssHighlightRules = function() {
-
- var keywordMapper = this.createKeywordMapper({
- "support.function": supportFunction,
- "support.constant": supportConstant,
- "support.type": supportType,
- "support.constant.color": supportConstantColor,
- "support.constant.fonts": supportConstantFonts
- }, "text", true);
-
- var base_ruleset = [
- {
- token : "comment", // multi line comment
- regex : "\\/\\*",
- next : "ruleset_comment"
- }, {
- token : "string", // single line
- regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
- }, {
- token : "string", // single line
- regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
- }, {
- 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|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
- }, {
- token : keywordMapper,
- regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
- }
- ];
-
- var ruleset = lang.copyArray(base_ruleset);
- ruleset.unshift({
- token : "paren.rparen",
- regex : "\\}",
- next: "start"
- });
-
- var media_ruleset = lang.copyArray( base_ruleset );
- media_ruleset.unshift({
- token : "paren.rparen",
- regex : "\\}",
- next: "media"
- });
-
- var base_comment = [{
- token : "comment", // comment spanning whole line
- regex : ".+"
- }];
-
- var comment = lang.copyArray(base_comment);
- comment.unshift({
- token : "comment", // closing comment
- regex : ".*?\\*\\/",
- next : "start"
- });
-
- var media_comment = lang.copyArray(base_comment);
- media_comment.unshift({
- token : "comment", // closing comment
- regex : ".*?\\*\\/",
- next : "media"
- });
-
- var ruleset_comment = lang.copyArray(base_comment);
- ruleset_comment.unshift({
- token : "comment", // closing comment
- regex : ".*?\\*\\/",
- next : "ruleset"
- });
-
- this.$rules = {
- "start" : [{
- token : "comment", // multi line comment
- regex : "\\/\\*",
- next : "comment"
- }, {
- token: "paren.lparen",
- regex: "\\{",
- next: "ruleset"
- }, {
- token: "string",
- regex: "@.*?{",
- next: "media"
- },{
- token: "keyword",
- regex: "#[a-z0-9-_]+"
- },{
- token: "variable",
- regex: "\\.[a-z0-9-_]+"
- },{
- token: "string",
- regex: ":[a-z0-9-_]+"
- },{
- token: "constant",
- regex: "[a-z0-9-_]+"
- }],
-
- "media" : [ {
- token : "comment", // multi line comment
- regex : "\\/\\*",
- next : "media_comment"
- }, {
- token: "paren.lparen",
- regex: "\\{",
- next: "media_ruleset"
- },{
- token: "string",
- regex: "\\}",
- next: "start"
- },{
- token: "keyword",
- regex: "#[a-z0-9-_]+"
- },{
- token: "variable",
- regex: "\\.[a-z0-9-_]+"
- },{
- token: "string",
- regex: ":[a-z0-9-_]+"
- },{
- token: "constant",
- regex: "[a-z0-9-_]+"
- }],
-
- "comment" : comment,
-
- "ruleset" : ruleset,
- "ruleset_comment" : ruleset_comment,
-
- "media_ruleset" : media_ruleset,
- "media_comment" : media_comment
- };
-};
-
-oop.inherits(CssHighlightRules, TextHighlightRules);
-
-exports.CssHighlightRules = CssHighlightRules;
-
-});
-
-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) {
-
-
-var oop = require("../../lib/oop");
-var Behaviour = require("../behaviour").Behaviour;
-var CstyleBehaviour = require("./cstyle").CstyleBehaviour;
-var TokenIterator = require("../../token_iterator").TokenIterator;
-
-var CssBehaviour = function () {
-
- this.inherit(CstyleBehaviour);
-
- this.add("colon", "insertion", function (state, action, editor, session, text) {
- if (text === ':') {
- var cursor = editor.getCursorPosition();
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- var token = iterator.getCurrentToken();
- if (token && token.value.match(/\s+/)) {
- token = iterator.stepBackward();
- }
- if (token && token.type === 'support.type') {
- var line = session.doc.getLine(cursor.row);
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- if (rightChar === ':') {
- return {
- text: '',
- selection: [1, 1]
- }
- }
- if (!line.substring(cursor.column).match(/^\s*;/)) {
- return {
- text: ':;',
- selection: [1, 1]
- }
- }
- }
- }
- });
-
- this.add("colon", "deletion", function (state, action, editor, session, range) {
- var selected = session.doc.getTextRange(range);
- if (!range.isMultiLine() && selected === ':') {
- var line = session.doc.getLine(range.start.row);
- var rightChar = line.substring(range.end.column, range.end.column + 1);
- if (rightChar === ';') {
- range.end.column ++;
- return range;
- }
- }
- });
-
- this.add("semicolon", "insertion", function (state, action, editor, session, text) {
- if (text === ';') {
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- if (rightChar === ';') {
- return {
- text: '',
- selection: [1, 1]
- }
- }
- }
- });
-
-}
-oop.inherits(CssBehaviour, CstyleBehaviour);
-
-exports.CssBehaviour = CssBehaviour;
-});
-
-define('ace/mode/html_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/css_highlight_rules', 'ace/mode/javascript_highlight_rules', 'ace/mode/xml_util', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
-
-
-var oop = require("../lib/oop");
-var lang = require("../lib/lang");
-var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
-var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
-var xmlUtil = require("./xml_util");
-var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
-
-var tagMap = lang.createMap({
- a : 'anchor',
- button : 'form',
- form : 'form',
- img : 'image',
- input : 'form',
- label : 'form',
- script : 'script',
- select : 'form',
- textarea : 'form',
- style : 'style',
- table : 'table',
- tbody : 'table',
- td : 'table',
- tfoot : 'table',
- th : 'table',
- tr : 'table'
-});
-
-var HtmlHighlightRules = function() {
- this.$rules = {
- start : [{
- token : "text",
- regex : "<\\!\\[CDATA\\[",
- next : "cdata"
- }, {
- token : "xml-pe",
- regex : "<\\?.*?\\?>"
- }, {
- token : "comment",
- regex : "<\\!--",
- next : "comment"
- }, {
- token : "xml-pe",
- regex : "<\\!.*?>"
- }, {
- token : "meta.tag",
- regex : "<(?=script\\b)",
- next : "script"
- }, {
- token : "meta.tag",
- regex : "<(?=style\\b)",
- next : "style"
- }, {
- token : "meta.tag", // opening tag
- regex : "<\\/?",
- next : "tag"
- }, {
- token : "text",
- regex : "\\s+"
- }, {
- token : "constant.character.entity",
- regex : "(?:[0-9]+;)|(?:[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
- }],
-
- cdata : [ {
- token : "text",
- regex : "\\]\\]>",
- next : "start"
- } ],
-
- comment : [ {
- token : "comment",
- regex : ".*?-->",
- next : "start"
- }, {
- defaultToken : "comment"
- } ]
- };
-
- xmlUtil.tag(this.$rules, "tag", "start", tagMap);
- xmlUtil.tag(this.$rules, "style", "css-start", tagMap);
- xmlUtil.tag(this.$rules, "script", "js-start", tagMap);
-
- this.embedRules(JavaScriptHighlightRules, "js-", [{
- token: "comment",
- regex: "\\/\\/.*(?=<\\/script>)",
- next: "tag"
- }, {
- token: "meta.tag",
- regex: "<\\/(?=script)",
- next: "tag"
- }]);
-
- this.embedRules(CssHighlightRules, "css-", [{
- token: "meta.tag",
- regex: "<\\/(?=style)",
- next: "tag"
- }]);
-};
-
-oop.inherits(HtmlHighlightRules, TextHighlightRules);
-
-exports.HtmlHighlightRules = HtmlHighlightRules;
-});
-
-define('ace/mode/behaviour/html', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour/xml', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) {
-
-
-var oop = require("../../lib/oop");
-var XmlBehaviour = require("../behaviour/xml").XmlBehaviour;
-var CstyleBehaviour = require("./cstyle").CstyleBehaviour;
-var TokenIterator = require("../../token_iterator").TokenIterator;
-var voidElements = ['area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr'];
-
-function hasType(token, type) {
- var hasType = true;
- var typeList = token.type.split('.');
- var needleList = type.split('.');
- needleList.forEach(function(needle){
- if (typeList.indexOf(needle) == -1) {
- hasType = false;
- return false;
- }
- });
- return hasType;
-}
-
-var HtmlBehaviour = function () {
-
- this.inherit(XmlBehaviour); // Get xml behaviour
-
- this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
- if (text == '>') {
- var position = editor.getCursorPosition();
- var iterator = new TokenIterator(session, position.row, position.column);
- var token = iterator.getCurrentToken();
- var atCursor = false;
- if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){
- do {
- token = iterator.stepBackward();
- } while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text')));
- } else {
- atCursor = true;
- }
- if (!token || !hasType(token, 'meta.tag-name') || iterator.stepBackward().value.match('/')) {
- return
- }
- var element = token.value;
- if (atCursor){
- var element = element.substring(0, position.column - token.start);
- }
- if (voidElements.indexOf(element) !== -1){
- return;
- }
- return {
- text: '>' + '' + element + '>',
- selection: [1, 1]
- }
- }
- });
-}
-oop.inherits(HtmlBehaviour, XmlBehaviour);
-
-exports.HtmlBehaviour = HtmlBehaviour;
-});
-
-define('ace/mode/folding/html', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/mixed', 'ace/mode/folding/xml', 'ace/mode/folding/cstyle'], function(require, exports, module) {
-
-
-var oop = require("../../lib/oop");
-var MixedFoldMode = require("./mixed").FoldMode;
-var XmlFoldMode = require("./xml").FoldMode;
-var CStyleFoldMode = require("./cstyle").FoldMode;
-
-var FoldMode = exports.FoldMode = function() {
- MixedFoldMode.call(this, new XmlFoldMode({
- "area": 1,
- "base": 1,
- "br": 1,
- "col": 1,
- "command": 1,
- "embed": 1,
- "hr": 1,
- "img": 1,
- "input": 1,
- "keygen": 1,
- "link": 1,
- "meta": 1,
- "param": 1,
- "source": 1,
- "track": 1,
- "wbr": 1,
- "li": 1,
- "dt": 1,
- "dd": 1,
- "p": 1,
- "rt": 1,
- "rp": 1,
- "optgroup": 1,
- "option": 1,
- "colgroup": 1,
- "td": 1,
- "th": 1
- }), {
- "js-": new CStyleFoldMode(),
- "css-": new CStyleFoldMode()
- });
-};
-
-oop.inherits(FoldMode, MixedFoldMode);
-
-});
-
-define('ace/mode/folding/mixed', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
-
-
-var oop = require("../../lib/oop");
-var BaseFoldMode = require("./fold_mode").FoldMode;
-
-var FoldMode = exports.FoldMode = function(defaultMode, subModes) {
- this.defaultMode = defaultMode;
- this.subModes = subModes;
-};
-oop.inherits(FoldMode, BaseFoldMode);
-
-(function() {
-
-
- this.$getMode = function(state) {
- for (var key in this.subModes) {
- if (state.indexOf(key) === 0)
- return this.subModes[key];
- }
- return null;
- };
-
- this.$tryMode = function(state, session, foldStyle, row) {
- var mode = this.$getMode(state);
- return (mode ? mode.getFoldWidget(session, foldStyle, row) : "");
- };
-
- this.getFoldWidget = function(session, foldStyle, row) {
- return (
- this.$tryMode(session.getState(row-1), session, foldStyle, row) ||
- this.$tryMode(session.getState(row), session, foldStyle, row) ||
- this.defaultMode.getFoldWidget(session, foldStyle, row)
- );
- };
-
- this.getFoldWidgetRange = function(session, foldStyle, row) {
- var mode = this.$getMode(session.getState(row-1));
-
- if (!mode || !mode.getFoldWidget(session, foldStyle, row))
- mode = this.$getMode(session.getState(row));
-
- if (!mode || !mode.getFoldWidget(session, foldStyle, row))
- mode = this.defaultMode;
-
- return mode.getFoldWidgetRange(session, foldStyle, row);
- };
-
-}).call(FoldMode.prototype);
-
-});
-
-define('ace/mode/markdown_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules', 'ace/mode/javascript_highlight_rules', 'ace/mode/xml_highlight_rules', 'ace/mode/html_highlight_rules', 'ace/mode/css_highlight_rules'], function(require, exports, module) {
-
-
-var oop = require("../lib/oop");
-var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
-var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
-var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules;
-var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
-var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
-
-function github_embed(tag, prefix) {
- return { // Github style block
- token : "support.function",
- regex : "^```" + tag + "\\s*$",
- next : prefix + "start"
- };
-}
-
-var MarkdownHighlightRules = function() {
-
- this.$rules = {
- "basic" : [{ // code span `
- token : "support.function",
- regex : "(`+)(.*?[^`])(\\1)"
- }, { // reference
- token : ["text", "constant", "text", "url", "string", "text"],
- regex : "^([ ]{0,3}\\[)([^\\]]+)(\\]:\\s*)([^ ]+)(\\s*(?:[\"][^\"]+[\"])?(\\s*))$"
- }, { // link by reference
- token : ["text", "string", "text", "constant", "text"],
- regex : "(\\[)((?:[[^\\]]*\\]|[^\\[\\]])*)(\\][ ]?(?:\\n[ ]*)?\\[)(.*?)(\\])"
- }, { // link by url
- token : ["text", "string", "text", "markup.underline", "string", "text"],
- regex : "(\\[)"+
- "(\\[[^\\]]*\\]|[^\\[\\]]*)"+
- "(\\]\\([ \\t]*)"+
- "((?:(?:[^\\(]*?\\([^\\)]*?\\)\\S*?)|(?:.*?))>?)"+
- "((?:[ \t]*\"(?:.*?)\"[ \\t]*)?)"+
- "(\\))"
- }, { // strong ** __
- token : "string",
- regex : "([*]{2}|[_]{2}(?=\\S))(.*?\\S[*_]*)(\\1)"
- }, { // emphasis * _
- token : "string",
- regex : "([*]|[_](?=\\S))(.*?\\S[*_]*)(\\1)"
- }, { //
- token : ["text", "url", "text"],
- regex : "(<)("+
- "(?:https?|ftp|dict):[^'\">\\s]+"+
- "|"+
- "(?:mailto:)?[-.\\w]+\\@[-a-z0-9]+(?:\\.[-a-z0-9]+)*\\.[a-z]+"+
- ")(>)"
- }],
- "allowBlock": [
- {token : "support.function", regex : "^ {4}.+", next : "allowBlock"},
- {token : "empty", regex : "", next : "start"}
- ],
-
- "start" : [{
- token : "empty_line",
- regex : '^$',
- next: "allowBlock"
- }, { // h1
- token: "markup.heading.1",
- regex: "^=+(?=\\s*$)"
- }, { // h2
- token: "markup.heading.2",
- regex: "^\\-+(?=\\s*$)"
- }, { // header
- token : function(value) {
- return "markup.heading." + value.search(/[^#]/);
- },
- regex : "^#{1,6}(?:[^ #].*| +.*(?:[^ #].*|[^ ]+.* +#+ *))$"
- },
- github_embed("(?:javascript|js)", "js-"),
- github_embed("xml", "xml-"),
- github_embed("html", "html-"),
- github_embed("css", "css-"),
- { // Github style block
- token : "support.function",
- regex : "^```\\s*[a-zA-Z]*(?:{.*?\\})?\\s*$",
- next : "githubblock"
- }, { // block quote
- token : "string",
- regex : "^>[ ].+$",
- next : "blockquote"
- }, { // HR * - _
- token : "constant",
- regex : "^ {0,2}(?:(?: ?\\* ?){3,}|(?: ?\\- ?){3,}|(?: ?\\_ ?){3,})\\s*$",
- next: "allowBlock"
- }, { // list
- token : "markup.list",
- regex : "^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+",
- next : "listblock-start"
- }, {
- include : "basic"
- }],
-
- "listblock-start" : [{
- token : "support.variable",
- regex : /(?:\[[ x]\])?/,
- next : "listblock"
- }],
-
- "listblock" : [ { // Lists only escape on completely blank lines.
- token : "empty_line",
- regex : "^$",
- next : "start"
- }, {
- include : "basic", noEscape: true
- }, { // list
- token : "markup.list",
- regex : "^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+",
- next : "listblock-start"
- }, {
- defaultToken : "markup.list"
- } ],
-
- "blockquote" : [ { // BLockquotes only escape on blank lines.
- token : "empty_line",
- regex : "^\\s*$",
- next : "start"
- }, {
- token : "string",
- regex : ".+"
- } ],
-
- "githubblock" : [ {
- token : "support.function",
- regex : "^```",
- next : "start"
- }, {
- token : "support.function",
- regex : ".+"
- } ]
- };
-
- this.embedRules(JavaScriptHighlightRules, "js-", [{
- token : "support.function",
- regex : "^```",
- next : "start"
- }]);
-
- this.embedRules(HtmlHighlightRules, "html-", [{
- token : "support.function",
- regex : "^```",
- next : "start"
- }]);
-
- this.embedRules(CssHighlightRules, "css-", [{
- token : "support.function",
- regex : "^```",
- next : "start"
- }]);
-
- this.embedRules(XmlHighlightRules, "xml-", [{
- token : "support.function",
- regex : "^```",
- next : "start"
- }]);
-
- var html = new HtmlHighlightRules().getRules();
- for (var i in html) {
- if (this.$rules[i])
- this.$rules[i] = this.$rules[i].concat(html[i]);
- else
- this.$rules[i] = html[i];
- }
-
- this.normalizeRules();
-};
-oop.inherits(MarkdownHighlightRules, TextHighlightRules);
-
-exports.MarkdownHighlightRules = MarkdownHighlightRules;
-});
-
-define('ace/mode/folding/markdown', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode', 'ace/range'], function(require, exports, module) {
-
-
-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.foldingStartMarker = /^(?:[=-]+\s*$|#{1,6} |`{3})/;
-
- this.getFoldWidget = function(session, foldStyle, row) {
- var line = session.getLine(row);
- if (!this.foldingStartMarker.test(line))
- return "";
-
- if (line[0] == "`") {
- if (session.bgTokenizer.getState(row) == "start")
- return "end";
- return "start";
- }
-
- return "start";
- };
-
- this.getFoldWidgetRange = function(session, foldStyle, row) {
- var line = session.getLine(row);
- var startColumn = line.length;
- var maxRow = session.getLength();
- var startRow = row;
- var endRow = row;
- if (!line.match(this.foldingStartMarker))
- return;
-
- if (line[0] == "`") {
- if (session.bgTokenizer.getState(row) !== "start") {
- while (++row < maxRow) {
- line = session.getLine(row);
- if (line[0] == "`" & line.substring(0, 3) == "```")
- break;
- }
- return new Range(startRow, startColumn, row, 0);
- } else {
- while (row -- > 0) {
- line = session.getLine(row);
- if (line[0] == "`" & line.substring(0, 3) == "```")
- break;
- }
- return new Range(row, line.length, startRow, 0);
- }
- }
-
- var token;
- function isHeading(row) {
- token = session.getTokens(row)[0];
- return token && token.type.lastIndexOf(heading, 0) === 0;
- }
-
- var heading = "markup.heading";
- function getLevel() {
- var ch = token.value[0];
- if (ch == "=") return 6;
- if (ch == "-") return 5;
- return 7 - token.value.search(/[^#]/);
- }
-
- if (isHeading(row)) {
- var startHeadingLevel = getLevel();
- while (++row < maxRow) {
- if (!isHeading(row))
- continue;
- var level = getLevel();
- if (level >= startHeadingLevel)
- break;
- }
-
- endRow = row - (!token || ["=", "-"].indexOf(token.value[0]) == -1 ? 1 : 2);
-
- 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);
- }
- }
- };
-
-}).call(FoldMode.prototype);
-
-});
diff --git a/public/libs/ace/mode-objectivec.js b/public/libs/ace/mode-objectivec.js
deleted file mode 100644
index c8a3469..0000000
--- a/public/libs/ace/mode-objectivec.js
+++ /dev/null
@@ -1,648 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Distributed under the BSD license:
- *
- * Copyright (c) 2012, Ajax.org B.V.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of Ajax.org B.V. nor the
- * names of its contributors may be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- *
- * Contributor(s):
- *
- *
- *
- * ***** END LICENSE BLOCK ***** */
-
-define('ace/mode/objectivec', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/objectivec_highlight_rules', 'ace/mode/folding/cstyle'], function(require, exports, module) {
-
-
-var oop = require("../lib/oop");
-var TextMode = require("./text").Mode;
-var Tokenizer = require("../tokenizer").Tokenizer;
-var ObjectiveCHighlightRules = require("./objectivec_highlight_rules").ObjectiveCHighlightRules;
-var CStyleFoldMode = require("./folding/cstyle").FoldMode;
-
-var Mode = function() {
- var highlighter = new ObjectiveCHighlightRules();
- this.foldingRules = new CStyleFoldMode();
-
- this.$tokenizer = new Tokenizer(highlighter.getRules());
-};
-oop.inherits(Mode, TextMode);
-
-(function() {
-}).call(Mode.prototype);
-
-exports.Mode = Mode;
-});define('ace/mode/objectivec_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/c_cpp_highlight_rules'], function(require, exports, module) {
-
-
-var oop = require("../lib/oop");
-var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
-var C_Highlight_File = require("./c_cpp_highlight_rules");
-var CHighlightRules = C_Highlight_File.c_cppHighlightRules;
-
-var ObjectiveCHighlightRules = function() {
-
- var escapedConstRe = "\\\\(?:[abefnrtv'\"?\\\\]|" +
- "[0-3]\\d{1,2}|" +
- "[4-7]\\d?|" +
- "222|" +
- "x[a-zA-Z0-9]+)";
-
- var specialVariables = [{
- regex: "\\b_cmd\\b",
- token: "variable.other.selector.objc"
- }, {
- regex: "\\b(?:self|super)\\b",
- token: "variable.language.objc"
- }
- ];
-
- var cObj = new CHighlightRules();
- var cRules = cObj.getRules();
-
- this.$rules = {
- "start": [
- {
- token : "comment",
- regex : "\\/\\/.*$"
- },
- DocCommentHighlightRules.getStartRule("doc-start"),
- {
- token : "comment", // multi line comment
- regex : "\\/\\*",
- next : "comment"
- },
- {
- token: [ "storage.type.objc", "punctuation.definition.storage.type.objc",
- "entity.name.type.objc", "text", "entity.other.inherited-class.objc"
- ],
- regex: "(@)(interface|protocol)(?!.+;)(\\s+[A-Za-z_][A-Za-z0-9_]*)(\\s*:\\s*)([A-Za-z]+)"
- },
- {
- token: [ "storage.type.objc" ],
- regex: "(@end)"
- },
- {
- token: [ "storage.type.objc", "entity.name.type.objc",
- "entity.other.inherited-class.objc"
- ],
- regex: "(@implementation)(\\s+[A-Za-z_][A-Za-z0-9_]*)(\\s*?::\\s*(?:[A-Za-z][A-Za-z0-9]*))?"
- },
- {
- token: "string.begin.objc",
- regex: '@"',
- next: "constant_NSString"
- },
- {
- token: "storage.type.objc",
- regex: "\\bid\\s*<",
- next: "protocol_list"
- },
- {
- token: "keyword.control.macro.objc",
- regex: "\\bNS_DURING|NS_HANDLER|NS_ENDHANDLER\\b"
- },
- {
- token: ["punctuation.definition.keyword.objc", "keyword.control.exception.objc"],
- regex: "(@)(try|catch|finally|throw)\\b"
- },
- {
- token: ["punctuation.definition.keyword.objc", "keyword.other.objc"],
- regex: "(@)(defs|encode)\\b"
- },
- {
- token: ["storage.type.id.objc", "text"],
- regex: "(\\bid\\b)(\\s|\\n)?"
- },
- {
- token: "storage.type.objc",
- regex: "\\bIBOutlet|IBAction|BOOL|SEL|id|unichar|IMP|Class\\b"
- },
- {
- token: [ "punctuation.definition.storage.type.objc", "storage.type.objc"],
- regex: "(@)(class|protocol)\\b"
- },
- {
- token: [ "punctuation.definition.storage.type.objc", "punctuation"],
- regex: "(@selector)(\\s*\\()",
- next: "selectors"
- },
- {
- token: [ "punctuation.definition.storage.modifier.objc", "storage.modifier.objc"],
- regex: "(@)(synchronized|public|private|protected|package)\\b"
- },
- {
- token: "constant.language.objc",
- regex: "\\bYES|NO|Nil|nil\\b"
- },
- {
- token: "support.variable.foundation",
- regex: "\\bNSApp\\b"
- },
- {
- token: [ "support.function.cocoa.leopard"],
- regex: "(?:\\b)(NS(?:Rect(?:ToCGRect|FromCGRect)|MakeCollectable|S(?:tringFromProtocol|ize(?:ToCGSize|FromCGSize))|Draw(?:NinePartImage|ThreePartImage)|P(?:oint(?:ToCGPoint|FromCGPoint)|rotocolFromString)|EventMaskFromType|Value))(?:\\b)"
- },
- {
- token: ["support.function.cocoa"],
- regex: "(?:\\b)(NS(?:R(?:ound(?:DownToMultipleOfPageSize|UpToMultipleOfPageSize)|un(?:CriticalAlertPanel(?:RelativeToWindow)?|InformationalAlertPanel(?:RelativeToWindow)?|AlertPanel(?:RelativeToWindow)?)|e(?:set(?:MapTable|HashTable)|c(?:ycleZone|t(?:Clip(?:List)?|F(?:ill(?:UsingOperation|List(?:UsingOperation|With(?:Grays|Colors(?:UsingOperation)?))?)?|romString))|ordAllocationEvent)|turnAddress|leaseAlertPanel|a(?:dPixel|l(?:MemoryAvailable|locateCollectable))|gisterServicesProvider)|angeFromString)|Get(?:SizeAndAlignment|CriticalAlertPanel|InformationalAlertPanel|UncaughtExceptionHandler|FileType(?:s)?|WindowServerMemory|AlertPanel)|M(?:i(?:n(?:X|Y)|d(?:X|Y))|ouseInRect|a(?:p(?:Remove|Get|Member|Insert(?:IfAbsent|KnownAbsent)?)|ke(?:R(?:ect|ange)|Size|Point)|x(?:Range|X|Y)))|B(?:itsPer(?:SampleFromDepth|PixelFromDepth)|e(?:stDepth|ep|gin(?:CriticalAlertSheet|InformationalAlertSheet|AlertSheet)))|S(?:ho(?:uldRetainWithZone|w(?:sServicesMenuItem|AnimationEffect))|tringFrom(?:R(?:ect|ange)|MapTable|S(?:ize|elector)|HashTable|Class|Point)|izeFromString|e(?:t(?:ShowsServicesMenuItem|ZoneName|UncaughtExceptionHandler|FocusRingStyle)|lectorFromString|archPathForDirectoriesInDomains)|wap(?:Big(?:ShortToHost|IntToHost|DoubleToHost|FloatToHost|Long(?:ToHost|LongToHost))|Short|Host(?:ShortTo(?:Big|Little)|IntTo(?:Big|Little)|DoubleTo(?:Big|Little)|FloatTo(?:Big|Little)|Long(?:To(?:Big|Little)|LongTo(?:Big|Little)))|Int|Double|Float|L(?:ittle(?:ShortToHost|IntToHost|DoubleToHost|FloatToHost|Long(?:ToHost|LongToHost))|ong(?:Long)?)))|H(?:ighlightRect|o(?:stByteOrder|meDirectory(?:ForUser)?)|eight|ash(?:Remove|Get|Insert(?:IfAbsent|KnownAbsent)?)|FSType(?:CodeFromFileType|OfFile))|N(?:umberOfColorComponents|ext(?:MapEnumeratorPair|HashEnumeratorItem))|C(?:o(?:n(?:tainsRect|vert(?:GlyphsToPackedGlyphs|Swapped(?:DoubleToHost|FloatToHost)|Host(?:DoubleToSwapped|FloatToSwapped)))|unt(?:MapTable|HashTable|Frames|Windows(?:ForContext)?)|py(?:M(?:emoryPages|apTableWithZone)|Bits|HashTableWithZone|Object)|lorSpaceFromDepth|mpare(?:MapTables|HashTables))|lassFromString|reate(?:MapTable(?:WithZone)?|HashTable(?:WithZone)?|Zone|File(?:namePboardType|ContentsPboardType)))|TemporaryDirectory|I(?:s(?:ControllerMarker|EmptyRect|FreedObject)|n(?:setRect|crementExtraRefCount|te(?:r(?:sect(?:sRect|ionR(?:ect|ange))|faceStyleForKey)|gralRect)))|Zone(?:Realloc|Malloc|Name|Calloc|Fr(?:omPointer|ee))|O(?:penStepRootDirectory|ffsetRect)|D(?:i(?:sableScreenUpdates|videRect)|ottedFrameRect|e(?:c(?:imal(?:Round|Multiply|S(?:tring|ubtract)|Normalize|Co(?:py|mpa(?:ct|re))|IsNotANumber|Divide|Power|Add)|rementExtraRefCountWasZero)|faultMallocZone|allocate(?:MemoryPages|Object))|raw(?:Gr(?:oove|ayBezel)|B(?:itmap|utton)|ColorTiledRects|TiledRects|DarkBezel|W(?:hiteBezel|indowBackground)|LightBezel))|U(?:serName|n(?:ionR(?:ect|ange)|registerServicesProvider)|pdateDynamicServices)|Java(?:Bundle(?:Setup|Cleanup)|Setup(?:VirtualMachine)?|Needs(?:ToLoadClasses|VirtualMachine)|ClassesF(?:orBundle|romPath)|ObjectNamedInPath|ProvidesClasses)|P(?:oint(?:InRect|FromString)|erformService|lanarFromDepth|ageSize)|E(?:n(?:d(?:MapTableEnumeration|HashTableEnumeration)|umerate(?:MapTable|HashTable)|ableScreenUpdates)|qual(?:R(?:ects|anges)|Sizes|Points)|raseRect|xtraRefCount)|F(?:ileTypeForHFSTypeCode|ullUserName|r(?:ee(?:MapTable|HashTable)|ame(?:Rect(?:WithWidth(?:UsingOperation)?)?|Address)))|Wi(?:ndowList(?:ForContext)?|dth)|Lo(?:cationInRange|g(?:v|PageSize)?)|A(?:ccessibility(?:R(?:oleDescription(?:ForUIElement)?|aiseBadArgumentException)|Unignored(?:Children(?:ForOnlyChild)?|Descendant|Ancestor)|PostNotification|ActionDescription)|pplication(?:Main|Load)|vailableWindowDepths|ll(?:MapTable(?:Values|Keys)|HashTableObjects|ocate(?:MemoryPages|Collectable|Object)))))(?:\\b)"
- },
- {
- token: ["support.class.cocoa.leopard"],
- regex: "(?:\\b)(NS(?:RuleEditor|G(?:arbageCollector|radient)|MapTable|HashTable|Co(?:ndition|llectionView(?:Item)?)|T(?:oolbarItemGroup|extInputClient|r(?:eeNode|ackingArea))|InvocationOperation|Operation(?:Queue)?|D(?:ictionaryController|ockTile)|P(?:ointer(?:Functions|Array)|athC(?:o(?:ntrol(?:Delegate)?|mponentCell)|ell(?:Delegate)?)|r(?:intPanelAccessorizing|edicateEditor(?:RowTemplate)?))|ViewController|FastEnumeration|Animat(?:ionContext|ablePropertyContainer)))(?:\\b)"
- },
- {
- token: ["support.class.cocoa"],
- regex: "(?:\\b)(NS(?:R(?:u(?:nLoop|ler(?:Marker|View))|e(?:sponder|cursiveLock|lativeSpecifier)|an(?:domSpecifier|geSpecifier))|G(?:etCommand|lyph(?:Generator|Storage|Info)|raphicsContext)|XML(?:Node|D(?:ocument|TD(?:Node)?)|Parser|Element)|M(?:iddleSpecifier|ov(?:ie(?:View)?|eCommand)|utable(?:S(?:tring|et)|C(?:haracterSet|opying)|IndexSet|D(?:ictionary|ata)|URLRequest|ParagraphStyle|A(?:ttributedString|rray))|e(?:ssagePort(?:NameServer)?|nu(?:Item(?:Cell)?|View)?|t(?:hodSignature|adata(?:Item|Query(?:ResultGroup|AttributeValueTuple)?)))|a(?:ch(?:BootstrapServer|Port)|trix))|B(?:itmapImageRep|ox|u(?:ndle|tton(?:Cell)?)|ezierPath|rowser(?:Cell)?)|S(?:hadow|c(?:anner|r(?:ipt(?:SuiteRegistry|C(?:o(?:ercionHandler|mmand(?:Description)?)|lassDescription)|ObjectSpecifier|ExecutionContext|WhoseTest)|oll(?:er|View)|een))|t(?:epper(?:Cell)?|atus(?:Bar|Item)|r(?:ing|eam))|imple(?:HorizontalTypesetter|CString)|o(?:cketPort(?:NameServer)?|und|rtDescriptor)|p(?:e(?:cifierTest|ech(?:Recognizer|Synthesizer)|ll(?:Server|Checker))|litView)|e(?:cureTextField(?:Cell)?|t(?:Command)?|archField(?:Cell)?|rializer|gmentedC(?:ontrol|ell))|lider(?:Cell)?|avePanel)|H(?:ost|TTP(?:Cookie(?:Storage)?|URLResponse)|elpManager)|N(?:ib(?:Con(?:nector|trolConnector)|OutletConnector)?|otification(?:Center|Queue)?|u(?:ll|mber(?:Formatter)?)|etService(?:Browser)?|ameSpecifier)|C(?:ha(?:ngeSpelling|racterSet)|o(?:n(?:stantString|nection|trol(?:ler)?|ditionLock)|d(?:ing|er)|unt(?:Command|edSet)|pying|lor(?:Space|P(?:ick(?:ing(?:Custom|Default)|er)|anel)|Well|List)?|m(?:p(?:oundPredicate|arisonPredicate)|boBox(?:Cell)?))|u(?:stomImageRep|rsor)|IImageRep|ell|l(?:ipView|o(?:seCommand|neCommand)|assDescription)|a(?:ched(?:ImageRep|URLResponse)|lendar(?:Date)?)|reateCommand)|T(?:hread|ypesetter|ime(?:Zone|r)|o(?:olbar(?:Item(?:Validations)?)?|kenField(?:Cell)?)|ext(?:Block|Storage|Container|Tab(?:le(?:Block)?)?|Input|View|Field(?:Cell)?|List|Attachment(?:Cell)?)?|a(?:sk|b(?:le(?:Header(?:Cell|View)|Column|View)|View(?:Item)?))|reeController)|I(?:n(?:dex(?:S(?:pecifier|et)|Path)|put(?:Manager|S(?:tream|erv(?:iceProvider|er(?:MouseTracker)?)))|vocation)|gnoreMisspelledWords|mage(?:Rep|Cell|View)?)|O(?:ut(?:putStream|lineView)|pen(?:GL(?:Context|Pixel(?:Buffer|Format)|View)|Panel)|bj(?:CTypeSerializationCallBack|ect(?:Controller)?))|D(?:i(?:st(?:antObject(?:Request)?|ributed(?:NotificationCenter|Lock))|ctionary|rectoryEnumerator)|ocument(?:Controller)?|e(?:serializer|cimalNumber(?:Behaviors|Handler)?|leteCommand)|at(?:e(?:Components|Picker(?:Cell)?|Formatter)?|a)|ra(?:wer|ggingInfo))|U(?:ser(?:InterfaceValidations|Defaults(?:Controller)?)|RL(?:Re(?:sponse|quest)|Handle(?:Client)?|C(?:onnection|ache|redential(?:Storage)?)|Download(?:Delegate)?|Prot(?:ocol(?:Client)?|ectionSpace)|AuthenticationChallenge(?:Sender)?)?|n(?:iqueIDSpecifier|doManager|archiver))|P(?:ipe|o(?:sitionalSpecifier|pUpButton(?:Cell)?|rt(?:Message|NameServer|Coder)?)|ICTImageRep|ersistentDocument|DFImageRep|a(?:steboard|nel|ragraphStyle|geLayout)|r(?:int(?:Info|er|Operation|Panel)|o(?:cessInfo|tocolChecker|perty(?:Specifier|ListSerialization)|gressIndicator|xy)|edicate))|E(?:numerator|vent|PSImageRep|rror|x(?:ception|istsCommand|pression))|V(?:iew(?:Animation)?|al(?:idated(?:ToobarItem|UserInterfaceItem)|ue(?:Transformer)?))|Keyed(?:Unarchiver|Archiver)|Qui(?:ckDrawView|tCommand)|F(?:ile(?:Manager|Handle|Wrapper)|o(?:nt(?:Manager|Descriptor|Panel)?|rm(?:Cell|atter)))|W(?:hoseSpecifier|indow(?:Controller)?|orkspace)|L(?:o(?:c(?:k(?:ing)?|ale)|gicalTest)|evelIndicator(?:Cell)?|ayoutManager)|A(?:ssertionHandler|nimation|ctionCell|ttributedString|utoreleasePool|TSTypesetter|ppl(?:ication|e(?:Script|Event(?:Manager|Descriptor)))|ffineTransform|lert|r(?:chiver|ray(?:Controller)?))))(?:\\b)",
- },
- {
- token: ["support.type.cocoa.leopard"],
- regex: "(?:\\b)(NS(?:R(?:u(?:nLoop|ler(?:Marker|View))|e(?:sponder|cursiveLock|lativeSpecifier)|an(?:domSpecifier|geSpecifier))|G(?:etCommand|lyph(?:Generator|Storage|Info)|raphicsContext)|XML(?:Node|D(?:ocument|TD(?:Node)?)|Parser|Element)|M(?:iddleSpecifier|ov(?:ie(?:View)?|eCommand)|utable(?:S(?:tring|et)|C(?:haracterSet|opying)|IndexSet|D(?:ictionary|ata)|URLRequest|ParagraphStyle|A(?:ttributedString|rray))|e(?:ssagePort(?:NameServer)?|nu(?:Item(?:Cell)?|View)?|t(?:hodSignature|adata(?:Item|Query(?:ResultGroup|AttributeValueTuple)?)))|a(?:ch(?:BootstrapServer|Port)|trix))|B(?:itmapImageRep|ox|u(?:ndle|tton(?:Cell)?)|ezierPath|rowser(?:Cell)?)|S(?:hadow|c(?:anner|r(?:ipt(?:SuiteRegistry|C(?:o(?:ercionHandler|mmand(?:Description)?)|lassDescription)|ObjectSpecifier|ExecutionContext|WhoseTest)|oll(?:er|View)|een))|t(?:epper(?:Cell)?|atus(?:Bar|Item)|r(?:ing|eam))|imple(?:HorizontalTypesetter|CString)|o(?:cketPort(?:NameServer)?|und|rtDescriptor)|p(?:e(?:cifierTest|ech(?:Recognizer|Synthesizer)|ll(?:Server|Checker))|litView)|e(?:cureTextField(?:Cell)?|t(?:Command)?|archField(?:Cell)?|rializer|gmentedC(?:ontrol|ell))|lider(?:Cell)?|avePanel)|H(?:ost|TTP(?:Cookie(?:Storage)?|URLResponse)|elpManager)|N(?:ib(?:Con(?:nector|trolConnector)|OutletConnector)?|otification(?:Center|Queue)?|u(?:ll|mber(?:Formatter)?)|etService(?:Browser)?|ameSpecifier)|C(?:ha(?:ngeSpelling|racterSet)|o(?:n(?:stantString|nection|trol(?:ler)?|ditionLock)|d(?:ing|er)|unt(?:Command|edSet)|pying|lor(?:Space|P(?:ick(?:ing(?:Custom|Default)|er)|anel)|Well|List)?|m(?:p(?:oundPredicate|arisonPredicate)|boBox(?:Cell)?))|u(?:stomImageRep|rsor)|IImageRep|ell|l(?:ipView|o(?:seCommand|neCommand)|assDescription)|a(?:ched(?:ImageRep|URLResponse)|lendar(?:Date)?)|reateCommand)|T(?:hread|ypesetter|ime(?:Zone|r)|o(?:olbar(?:Item(?:Validations)?)?|kenField(?:Cell)?)|ext(?:Block|Storage|Container|Tab(?:le(?:Block)?)?|Input|View|Field(?:Cell)?|List|Attachment(?:Cell)?)?|a(?:sk|b(?:le(?:Header(?:Cell|View)|Column|View)|View(?:Item)?))|reeController)|I(?:n(?:dex(?:S(?:pecifier|et)|Path)|put(?:Manager|S(?:tream|erv(?:iceProvider|er(?:MouseTracker)?)))|vocation)|gnoreMisspelledWords|mage(?:Rep|Cell|View)?)|O(?:ut(?:putStream|lineView)|pen(?:GL(?:Context|Pixel(?:Buffer|Format)|View)|Panel)|bj(?:CTypeSerializationCallBack|ect(?:Controller)?))|D(?:i(?:st(?:antObject(?:Request)?|ributed(?:NotificationCenter|Lock))|ctionary|rectoryEnumerator)|ocument(?:Controller)?|e(?:serializer|cimalNumber(?:Behaviors|Handler)?|leteCommand)|at(?:e(?:Components|Picker(?:Cell)?|Formatter)?|a)|ra(?:wer|ggingInfo))|U(?:ser(?:InterfaceValidations|Defaults(?:Controller)?)|RL(?:Re(?:sponse|quest)|Handle(?:Client)?|C(?:onnection|ache|redential(?:Storage)?)|Download(?:Delegate)?|Prot(?:ocol(?:Client)?|ectionSpace)|AuthenticationChallenge(?:Sender)?)?|n(?:iqueIDSpecifier|doManager|archiver))|P(?:ipe|o(?:sitionalSpecifier|pUpButton(?:Cell)?|rt(?:Message|NameServer|Coder)?)|ICTImageRep|ersistentDocument|DFImageRep|a(?:steboard|nel|ragraphStyle|geLayout)|r(?:int(?:Info|er|Operation|Panel)|o(?:cessInfo|tocolChecker|perty(?:Specifier|ListSerialization)|gressIndicator|xy)|edicate))|E(?:numerator|vent|PSImageRep|rror|x(?:ception|istsCommand|pression))|V(?:iew(?:Animation)?|al(?:idated(?:ToobarItem|UserInterfaceItem)|ue(?:Transformer)?))|Keyed(?:Unarchiver|Archiver)|Qui(?:ckDrawView|tCommand)|F(?:ile(?:Manager|Handle|Wrapper)|o(?:nt(?:Manager|Descriptor|Panel)?|rm(?:Cell|atter)))|W(?:hoseSpecifier|indow(?:Controller)?|orkspace)|L(?:o(?:c(?:k(?:ing)?|ale)|gicalTest)|evelIndicator(?:Cell)?|ayoutManager)|A(?:ssertionHandler|nimation|ctionCell|ttributedString|utoreleasePool|TSTypesetter|ppl(?:ication|e(?:Script|Event(?:Manager|Descriptor)))|ffineTransform|lert|r(?:chiver|ray(?:Controller)?))))(?:\\b)"
- },
- {
- token: ["support.class.quartz"],
- regex: "(?:\\b)(C(?:I(?:Sampler|Co(?:ntext|lor)|Image(?:Accumulator)?|PlugIn(?:Registration)?|Vector|Kernel|Filter(?:Generator|Shape)?)|A(?:Renderer|MediaTiming(?:Function)?|BasicAnimation|ScrollLayer|Constraint(?:LayoutManager)?|T(?:iledLayer|extLayer|rans(?:ition|action))|OpenGLLayer|PropertyAnimation|KeyframeAnimation|Layer|A(?:nimation(?:Group)?|ction))))(?:\\b)"
- },
- {
- token: ["support.type.quartz"],
- regex: "(?:\\b)(C(?:G(?:Float|Point|Size|Rect)|IFormat|AConstraintAttribute))(?:\\b)"
- },
- {
- token: ["support.type.cocoa"],
- regex: "(?:\\b)(NS(?:R(?:ect(?:Edge)?|ange)|G(?:lyph(?:Relation|LayoutMode)?|radientType)|M(?:odalSession|a(?:trixMode|p(?:Table|Enumerator)))|B(?:itmapImageFileType|orderType|uttonType|ezelStyle|ackingStoreType|rowserColumnResizingType)|S(?:cr(?:oll(?:er(?:Part|Arrow)|ArrowPosition)|eenAuxiliaryOpaque)|tringEncoding|ize|ocketNativeHandle|election(?:Granularity|Direction|Affinity)|wapped(?:Double|Float)|aveOperationType)|Ha(?:sh(?:Table|Enumerator)|ndler(?:2)?)|C(?:o(?:ntrol(?:Size|Tint)|mp(?:ositingOperation|arisonResult))|ell(?:State|Type|ImagePosition|Attribute))|T(?:hreadPrivate|ypesetterGlyphInfo|i(?:ckMarkPosition|tlePosition|meInterval)|o(?:ol(?:TipTag|bar(?:SizeMode|DisplayMode))|kenStyle)|IFFCompression|ext(?:TabType|Alignment)|ab(?:State|leViewDropOperation|ViewType)|rackingRectTag)|ImageInterpolation|Zone|OpenGL(?:ContextAuxiliary|PixelFormatAuxiliary)|D(?:ocumentChangeType|atePickerElementFlags|ra(?:werState|gOperation))|UsableScrollerParts|P(?:oint|r(?:intingPageOrder|ogressIndicator(?:Style|Th(?:ickness|readInfo))))|EventType|KeyValueObservingOptions|Fo(?:nt(?:SymbolicTraits|TraitMask|Action)|cusRingType)|W(?:indow(?:OrderingMode|Depth)|orkspace(?:IconCreationOptions|LaunchOptions)|ritingDirection)|L(?:ineBreakMode|ayout(?:Status|Direction))|A(?:nimation(?:Progress|Effect)|ppl(?:ication(?:TerminateReply|DelegateReply|PrintReply)|eEventManagerSuspensionID)|ffineTransformStruct|lertStyle)))(?:\\b)"
- },
- {
- token: ["support.constant.cocoa"],
- regex: "(?:\\b)(NS(?:NotFound|Ordered(?:Ascending|Descending|Same)))(?:\\b)"
- },
- {
- token: ["support.constant.notification.cocoa.leopard"],
- regex: "(?:\\b)(NS(?:MenuDidBeginTracking|ViewDidUpdateTrackingAreas)?Notification)(?:\\b)"
- },
- {
- token: ["support.constant.notification.cocoa"],
- regex: "(?:\\b)(NS(?:Menu(?:Did(?:RemoveItem|SendAction|ChangeItem|EndTracking|AddItem)|WillSendAction)|S(?:ystemColorsDidChange|plitView(?:DidResizeSubviews|WillResizeSubviews))|C(?:o(?:nt(?:extHelpModeDid(?:Deactivate|Activate)|rolT(?:intDidChange|extDid(?:BeginEditing|Change|EndEditing)))|lor(?:PanelColorDidChange|ListDidChange)|mboBox(?:Selection(?:IsChanging|DidChange)|Will(?:Dismiss|PopUp)))|lassDescriptionNeededForClass)|T(?:oolbar(?:DidRemoveItem|WillAddItem)|ext(?:Storage(?:DidProcessEditing|WillProcessEditing)|Did(?:BeginEditing|Change|EndEditing)|View(?:DidChange(?:Selection|TypingAttributes)|WillChangeNotifyingTextView))|ableView(?:Selection(?:IsChanging|DidChange)|ColumnDid(?:Resize|Move)))|ImageRepRegistryDidChange|OutlineView(?:Selection(?:IsChanging|DidChange)|ColumnDid(?:Resize|Move)|Item(?:Did(?:Collapse|Expand)|Will(?:Collapse|Expand)))|Drawer(?:Did(?:Close|Open)|Will(?:Close|Open))|PopUpButton(?:CellWillPopUp|WillPopUp)|View(?:GlobalFrameDidChange|BoundsDidChange|F(?:ocusDidChange|rameDidChange))|FontSetChanged|W(?:indow(?:Did(?:Resi(?:ze|gn(?:Main|Key))|M(?:iniaturize|ove)|Become(?:Main|Key)|ChangeScreen(?:|Profile)|Deminiaturize|Update|E(?:ndSheet|xpose))|Will(?:M(?:iniaturize|ove)|BeginSheet|Close))|orkspace(?:SessionDid(?:ResignActive|BecomeActive)|Did(?:Mount|TerminateApplication|Unmount|PerformFileOperation|Wake|LaunchApplication)|Will(?:Sleep|Unmount|PowerOff|LaunchApplication)))|A(?:ntialiasThresholdChanged|ppl(?:ication(?:Did(?:ResignActive|BecomeActive|Hide|ChangeScreenParameters|U(?:nhide|pdate)|FinishLaunching)|Will(?:ResignActive|BecomeActive|Hide|Terminate|U(?:nhide|pdate)|FinishLaunching))|eEventManagerWillProcessFirstEvent)))Notification)(?:\\b)"
- },
- {
- token: ["support.constant.cocoa.leopard"],
- regex: "(?:\\b)(NS(?:RuleEditor(?:RowType(?:Simple|Compound)|NestingMode(?:Si(?:ngle|mple)|Compound|List))|GradientDraws(?:BeforeStartingLocation|AfterEndingLocation)|M(?:inusSetExpressionType|a(?:chPortDeallocate(?:ReceiveRight|SendRight|None)|pTable(?:StrongMemory|CopyIn|ZeroingWeakMemory|ObjectPointerPersonality)))|B(?:oxCustom|undleExecutableArchitecture(?:X86|I386|PPC(?:64)?)|etweenPredicateOperatorType|ackgroundStyle(?:Raised|Dark|L(?:ight|owered)))|S(?:tring(?:DrawingTruncatesLastVisibleLine|EncodingConversion(?:ExternalRepresentation|AllowLossy))|ubqueryExpressionType|p(?:e(?:ech(?:SentenceBoundary|ImmediateBoundary|WordBoundary)|llingState(?:GrammarFlag|SpellingFlag))|litViewDividerStyleThi(?:n|ck))|e(?:rvice(?:RequestTimedOutError|M(?:iscellaneousError|alformedServiceDictionaryError)|InvalidPasteboardDataError|ErrorM(?:inimum|aximum)|Application(?:NotFoundError|LaunchFailedError))|gmentStyle(?:Round(?:Rect|ed)|SmallSquare|Capsule|Textured(?:Rounded|Square)|Automatic)))|H(?:UDWindowMask|ashTable(?:StrongMemory|CopyIn|ZeroingWeakMemory|ObjectPointerPersonality))|N(?:oModeColorPanel|etServiceNoAutoRename)|C(?:hangeRedone|o(?:ntainsPredicateOperatorType|l(?:orRenderingIntent(?:RelativeColorimetric|Saturation|Default|Perceptual|AbsoluteColorimetric)|lectorDisabledOption))|ellHit(?:None|ContentArea|TrackableArea|EditableTextArea))|T(?:imeZoneNameStyle(?:S(?:hort(?:Standard|DaylightSaving)|tandard)|DaylightSaving)|extFieldDatePickerStyle|ableViewSelectionHighlightStyle(?:Regular|SourceList)|racking(?:Mouse(?:Moved|EnteredAndExited)|CursorUpdate|InVisibleRect|EnabledDuringMouseDrag|A(?:ssumeInside|ctive(?:In(?:KeyWindow|ActiveApp)|WhenFirstResponder|Always))))|I(?:n(?:tersectSetExpressionType|dexedColorSpaceModel)|mageScale(?:None|Proportionally(?:Down|UpOrDown)|AxesIndependently))|Ope(?:nGLPFAAllowOfflineRenderers|rationQueue(?:DefaultMaxConcurrentOperationCount|Priority(?:High|Normal|Very(?:High|Low)|Low)))|D(?:iacriticInsensitiveSearch|ownloadsDirectory)|U(?:nionSetExpressionType|TF(?:16(?:BigEndianStringEncoding|StringEncoding|LittleEndianStringEncoding)|32(?:BigEndianStringEncoding|StringEncoding|LittleEndianStringEncoding)))|P(?:ointerFunctions(?:Ma(?:chVirtualMemory|llocMemory)|Str(?:ongMemory|uctPersonality)|C(?:StringPersonality|opyIn)|IntegerPersonality|ZeroingWeakMemory|O(?:paque(?:Memory|Personality)|bjectP(?:ointerPersonality|ersonality)))|at(?:hStyle(?:Standard|NavigationBar|PopUp)|ternColorSpaceModel)|rintPanelShows(?:Scaling|Copies|Orientation|P(?:a(?:perSize|ge(?:Range|SetupAccessory))|review)))|Executable(?:RuntimeMismatchError|NotLoadableError|ErrorM(?:inimum|aximum)|L(?:inkError|oadError)|ArchitectureMismatchError)|KeyValueObservingOption(?:Initial|Prior)|F(?:i(?:ndPanelSubstringMatchType(?:StartsWith|Contains|EndsWith|FullWord)|leRead(?:TooLargeError|UnknownStringEncodingError))|orcedOrderingSearch)|Wi(?:ndow(?:BackingLocation(?:MainMemory|Default|VideoMemory)|Sharing(?:Read(?:Only|Write)|None)|CollectionBehavior(?:MoveToActiveSpace|CanJoinAllSpaces|Default))|dthInsensitiveSearch)|AggregateExpressionType))(?:\\b)"
- },
- {
- token: ["support.constant.cocoa"],
- regex: "(?:\\b)(NS(?:R(?:GB(?:ModeColorPanel|ColorSpaceModel)|ight(?:Mouse(?:D(?:own(?:Mask)?|ragged(?:Mask)?)|Up(?:Mask)?)|T(?:ext(?:Movement|Alignment)|ab(?:sBezelBorder|StopType))|ArrowFunctionKey)|ound(?:RectBezelStyle|Bankers|ed(?:BezelStyle|TokenStyle|DisclosureBezelStyle)|Down|Up|Plain|Line(?:CapStyle|JoinStyle))|un(?:StoppedResponse|ContinuesResponse|AbortedResponse)|e(?:s(?:izableWindowMask|et(?:CursorRectsRunLoopOrdering|FunctionKey))|ce(?:ssedBezelStyle|iver(?:sCantHandleCommandScriptError|EvaluationScriptError))|turnTextMovement|doFunctionKey|quiredArgumentsMissingScriptError|l(?:evancyLevelIndicatorStyle|ative(?:Before|After))|gular(?:SquareBezelStyle|ControlSize)|moveTraitFontAction)|a(?:n(?:domSubelement|geDateMode)|tingLevelIndicatorStyle|dio(?:ModeMatrix|Button)))|G(?:IFFileType|lyph(?:Below|Inscribe(?:B(?:elow|ase)|Over(?:strike|Below)|Above)|Layout(?:WithPrevious|A(?:tAPoint|gainstAPoint))|A(?:ttribute(?:BidiLevel|Soft|Inscribe|Elastic)|bove))|r(?:ooveBorder|eaterThan(?:Comparison|OrEqualTo(?:Comparison|PredicateOperatorType)|PredicateOperatorType)|a(?:y(?:ModeColorPanel|ColorSpaceModel)|dient(?:None|Con(?:cave(?:Strong|Weak)|vex(?:Strong|Weak)))|phiteControlTint)))|XML(?:N(?:o(?:tationDeclarationKind|de(?:CompactEmptyElement|IsCDATA|OptionsNone|Use(?:SingleQuotes|DoubleQuotes)|Pre(?:serve(?:NamespaceOrder|C(?:haracterReferences|DATA)|DTD|Prefixes|E(?:ntities|mptyElements)|Quotes|Whitespace|A(?:ttributeOrder|ll))|ttyPrint)|ExpandEmptyElement))|amespaceKind)|CommentKind|TextKind|InvalidKind|D(?:ocument(?:X(?:MLKind|HTMLKind|Include)|HTMLKind|T(?:idy(?:XML|HTML)|extKind)|IncludeContentTypeDeclaration|Validate|Kind)|TDKind)|P(?:arser(?:GTRequiredError|XMLDeclNot(?:StartedError|FinishedError)|Mi(?:splaced(?:XMLDeclarationError|CDATAEndStringError)|xedContentDeclNot(?:StartedError|FinishedError))|S(?:t(?:andaloneValueError|ringNot(?:StartedError|ClosedError))|paceRequiredError|eparatorRequiredError)|N(?:MTOKENRequiredError|o(?:t(?:ationNot(?:StartedError|FinishedError)|WellBalancedError)|DTDError)|amespaceDeclarationError|AMERequiredError)|C(?:haracterRef(?:In(?:DTDError|PrologError|EpilogError)|AtEOFError)|o(?:nditionalSectionNot(?:StartedError|FinishedError)|mment(?:NotFinishedError|ContainsDoubleHyphenError))|DATANotFinishedError)|TagNameMismatchError|In(?:ternalError|valid(?:HexCharacterRefError|C(?:haracter(?:RefError|InEntityError|Error)|onditionalSectionError)|DecimalCharacterRefError|URIError|Encoding(?:NameError|Error)))|OutOfMemoryError|D(?:ocumentStartError|elegateAbortedParseError|OCTYPEDeclNotFinishedError)|U(?:RI(?:RequiredError|FragmentError)|n(?:declaredEntityError|parsedEntityError|knownEncodingError|finishedTagError))|P(?:CDATARequiredError|ublicIdentifierRequiredError|arsedEntityRef(?:MissingSemiError|NoNameError|In(?:Internal(?:SubsetError|Error)|PrologError|EpilogError)|AtEOFError)|r(?:ocessingInstructionNot(?:StartedError|FinishedError)|ematureDocumentEndError))|E(?:n(?:codingNotSupportedError|tity(?:Ref(?:In(?:DTDError|PrologError|EpilogError)|erence(?:MissingSemiError|WithoutNameError)|LoopError|AtEOFError)|BoundaryError|Not(?:StartedError|FinishedError)|Is(?:ParameterError|ExternalError)|ValueRequiredError))|qualExpectedError|lementContentDeclNot(?:StartedError|FinishedError)|xt(?:ernalS(?:tandaloneEntityError|ubsetNotFinishedError)|raContentError)|mptyDocumentError)|L(?:iteralNot(?:StartedError|FinishedError)|T(?:RequiredError|SlashRequiredError)|essThanSymbolInAttributeError)|Attribute(?:RedefinedError|HasNoValueError|Not(?:StartedError|FinishedError)|ListNot(?:StartedError|FinishedError)))|rocessingInstructionKind)|E(?:ntity(?:GeneralKind|DeclarationKind|UnparsedKind|P(?:ar(?:sedKind|ameterKind)|redefined))|lement(?:Declaration(?:MixedKind|UndefinedKind|E(?:lementKind|mptyKind)|Kind|AnyKind)|Kind))|Attribute(?:N(?:MToken(?:sKind|Kind)|otationKind)|CDATAKind|ID(?:Ref(?:sKind|Kind)|Kind)|DeclarationKind|En(?:tit(?:yKind|iesKind)|umerationKind)|Kind))|M(?:i(?:n(?:XEdge|iaturizableWindowMask|YEdge|uteCalendarUnit)|terLineJoinStyle|ddleSubelement|xedState)|o(?:nthCalendarUnit|deSwitchFunctionKey|use(?:Moved(?:Mask)?|E(?:ntered(?:Mask)?|ventSubtype|xited(?:Mask)?))|veToBezierPathElement|mentary(?:ChangeButton|Push(?:Button|InButton)|Light(?:Button)?))|enuFunctionKey|a(?:c(?:intoshInterfaceStyle|OSRomanStringEncoding)|tchesPredicateOperatorType|ppedRead|x(?:XEdge|YEdge))|ACHOperatingSystem)|B(?:MPFileType|o(?:ttomTabsBezelBorder|ldFontMask|rderlessWindowMask|x(?:Se(?:condary|parator)|OldStyle|Primary))|uttLineCapStyle|e(?:zelBorder|velLineJoinStyle|low(?:Bottom|Top)|gin(?:sWith(?:Comparison|PredicateOperatorType)|FunctionKey))|lueControlTint|ack(?:spaceCharacter|tabTextMovement|ingStore(?:Retained|Buffered|Nonretained)|TabCharacter|wardsSearch|groundTab)|r(?:owser(?:NoColumnResizing|UserColumnResizing|AutoColumnResizing)|eakFunctionKey))|S(?:h(?:ift(?:JISStringEncoding|KeyMask)|ow(?:ControlGlyphs|InvisibleGlyphs)|adowlessSquareBezelStyle)|y(?:s(?:ReqFunctionKey|tem(?:D(?:omainMask|efined(?:Mask)?)|FunctionKey))|mbolStringEncoding)|c(?:a(?:nnedOption|le(?:None|ToFit|Proportionally))|r(?:oll(?:er(?:NoPart|Increment(?:Page|Line|Arrow)|Decrement(?:Page|Line|Arrow)|Knob(?:Slot)?|Arrows(?:M(?:inEnd|axEnd)|None|DefaultSetting))|Wheel(?:Mask)?|LockFunctionKey)|eenChangedEventType))|t(?:opFunctionKey|r(?:ingDrawing(?:OneShot|DisableScreenFontSubstitution|Uses(?:DeviceMetrics|FontLeading|LineFragmentOrigin))|eam(?:Status(?:Reading|NotOpen|Closed|Open(?:ing)?|Error|Writing|AtEnd)|Event(?:Has(?:BytesAvailable|SpaceAvailable)|None|OpenCompleted|E(?:ndEncountered|rrorOccurred)))))|i(?:ngle(?:DateMode|UnderlineStyle)|ze(?:DownFontAction|UpFontAction))|olarisOperatingSystem|unOSOperatingSystem|pecialPageOrder|e(?:condCalendarUnit|lect(?:By(?:Character|Paragraph|Word)|i(?:ng(?:Next|Previous)|onAffinity(?:Downstream|Upstream))|edTab|FunctionKey)|gmentSwitchTracking(?:Momentary|Select(?:One|Any)))|quareLineCapStyle|witchButton|ave(?:ToOperation|Op(?:tions(?:Yes|No|Ask)|eration)|AsOperation)|mall(?:SquareBezelStyle|C(?:ontrolSize|apsFontMask)|IconButtonBezelStyle))|H(?:ighlightModeMatrix|SBModeColorPanel|o(?:ur(?:Minute(?:SecondDatePickerElementFlag|DatePickerElementFlag)|CalendarUnit)|rizontalRuler|meFunctionKey)|TTPCookieAcceptPolicy(?:Never|OnlyFromMainDocumentDomain|Always)|e(?:lp(?:ButtonBezelStyle|KeyMask|FunctionKey)|avierFontAction)|PUXOperatingSystem)|Year(?:MonthDa(?:yDatePickerElementFlag|tePickerElementFlag)|CalendarUnit)|N(?:o(?:n(?:StandardCharacterSetFontMask|ZeroWindingRule|activatingPanelMask|LossyASCIIStringEncoding)|Border|t(?:ification(?:SuspensionBehavior(?:Hold|Coalesce|D(?:eliverImmediately|rop))|NoCoalescing|CoalescingOn(?:Sender|Name)|DeliverImmediately|PostToAllSessions)|PredicateType|EqualToPredicateOperatorType)|S(?:cr(?:iptError|ollerParts)|ubelement|pecifierError)|CellMask|T(?:itle|opLevelContainersSpecifierError|abs(?:BezelBorder|NoBorder|LineBorder))|I(?:nterfaceStyle|mage)|UnderlineStyle|FontChangeAction)|u(?:ll(?:Glyph|CellType)|m(?:eric(?:Search|PadKeyMask)|berFormatter(?:Round(?:Half(?:Down|Up|Even)|Ceiling|Down|Up|Floor)|Behavior(?:10|Default)|S(?:cientificStyle|pellOutStyle)|NoStyle|CurrencyStyle|DecimalStyle|P(?:ercentStyle|ad(?:Before(?:Suffix|Prefix)|After(?:Suffix|Prefix))))))|e(?:t(?:Services(?:BadArgumentError|NotFoundError|C(?:ollisionError|ancelledError)|TimeoutError|InvalidError|UnknownError|ActivityInProgress)|workDomainMask)|wlineCharacter|xt(?:StepInterfaceStyle|FunctionKey))|EXTSTEPStringEncoding|a(?:t(?:iveShortGlyphPacking|uralTextAlignment)|rrowFontMask))|C(?:hange(?:ReadOtherContents|GrayCell(?:Mask)?|BackgroundCell(?:Mask)?|Cleared|Done|Undone|Autosaved)|MYK(?:ModeColorPanel|ColorSpaceModel)|ircular(?:BezelStyle|Slider)|o(?:n(?:stantValueExpressionType|t(?:inuousCapacityLevelIndicatorStyle|entsCellMask|ain(?:sComparison|erSpecifierError)|rol(?:Glyph|KeyMask))|densedFontMask)|lor(?:Panel(?:RGBModeMask|GrayModeMask|HSBModeMask|C(?:MYKModeMask|olorListModeMask|ustomPaletteModeMask|rayonModeMask)|WheelModeMask|AllModesMask)|ListModeColorPanel)|reServiceDirectory|m(?:p(?:osite(?:XOR|Source(?:In|O(?:ut|ver)|Atop)|Highlight|C(?:opy|lear)|Destination(?:In|O(?:ut|ver)|Atop)|Plus(?:Darker|Lighter))|ressedFontMask)|mandKeyMask))|u(?:stom(?:SelectorPredicateOperatorType|PaletteModeColorPanel)|r(?:sor(?:Update(?:Mask)?|PointingDevice)|veToBezierPathElement))|e(?:nterT(?:extAlignment|abStopType)|ll(?:State|H(?:ighlighted|as(?:Image(?:Horizontal|OnLeftOrBottom)|OverlappingImage))|ChangesContents|Is(?:Bordered|InsetButton)|Disabled|Editable|LightsBy(?:Gray|Background|Contents)|AllowsMixedState))|l(?:ipPagination|o(?:s(?:ePathBezierPathElement|ableWindowMask)|ckAndCalendarDatePickerStyle)|ear(?:ControlTint|DisplayFunctionKey|LineFunctionKey))|a(?:seInsensitive(?:Search|PredicateOption)|n(?:notCreateScriptCommandError|cel(?:Button|TextMovement))|chesDirectory|lculation(?:NoError|Overflow|DivideByZero|Underflow|LossOfPrecision)|rriageReturnCharacter)|r(?:itical(?:Request|AlertStyle)|ayonModeColorPanel))|T(?:hick(?:SquareBezelStyle|erSquareBezelStyle)|ypesetter(?:Behavior|HorizontalTabAction|ContainerBreakAction|ZeroAdvancementAction|OriginalBehavior|ParagraphBreakAction|WhitespaceAction|L(?:ineBreakAction|atestBehavior))|i(?:ckMark(?:Right|Below|Left|Above)|tledWindowMask|meZoneDatePickerElementFlag)|o(?:olbarItemVisibilityPriority(?:Standard|High|User|Low)|pTabsBezelBorder|ggleButton)|IFF(?:Compression(?:N(?:one|EXT)|CCITTFAX(?:3|4)|OldJPEG|JPEG|PackBits|LZW)|FileType)|e(?:rminate(?:Now|Cancel|Later)|xt(?:Read(?:InapplicableDocumentTypeError|WriteErrorM(?:inimum|aximum))|Block(?:M(?:i(?:nimum(?:Height|Width)|ddleAlignment)|a(?:rgin|ximum(?:Height|Width)))|B(?:o(?:ttomAlignment|rder)|aselineAlignment)|Height|TopAlignment|P(?:ercentageValueType|adding)|Width|AbsoluteValueType)|StorageEdited(?:Characters|Attributes)|CellType|ured(?:RoundedBezelStyle|BackgroundWindowMask|SquareBezelStyle)|Table(?:FixedLayoutAlgorithm|AutomaticLayoutAlgorithm)|Field(?:RoundedBezel|SquareBezel|AndStepperDatePickerStyle)|WriteInapplicableDocumentTypeError|ListPrependEnclosingMarker))|woByteGlyphPacking|ab(?:Character|TextMovement|le(?:tP(?:oint(?:Mask|EventSubtype)?|roximity(?:Mask|EventSubtype)?)|Column(?:NoResizing|UserResizingMask|AutoresizingMask)|View(?:ReverseSequentialColumnAutoresizingStyle|GridNone|S(?:olid(?:HorizontalGridLineMask|VerticalGridLineMask)|equentialColumnAutoresizingStyle)|NoColumnAutoresizing|UniformColumnAutoresizingStyle|FirstColumnOnlyAutoresizingStyle|LastColumnOnlyAutoresizingStyle)))|rackModeMatrix)|I(?:n(?:sert(?:CharFunctionKey|FunctionKey|LineFunctionKey)|t(?:Type|ernalS(?:criptError|pecifierError))|dexSubelement|validIndexSpecifierError|formational(?:Request|AlertStyle)|PredicateOperatorType)|talicFontMask|SO(?:2022JPStringEncoding|Latin(?:1StringEncoding|2StringEncoding))|dentityMappingCharacterCollection|llegalTextMovement|mage(?:R(?:ight|ep(?:MatchesDevice|LoadStatus(?:ReadingHeader|Completed|InvalidData|Un(?:expectedEOF|knownType)|WillNeedAllData)))|Below|C(?:ellType|ache(?:BySize|Never|Default|Always))|Interpolation(?:High|None|Default|Low)|O(?:nly|verlaps)|Frame(?:Gr(?:oove|ayBezel)|Button|None|Photo)|L(?:oadStatus(?:ReadError|C(?:ompleted|ancelled)|InvalidData|UnexpectedEOF)|eft)|A(?:lign(?:Right|Bottom(?:Right|Left)?|Center|Top(?:Right|Left)?|Left)|bove)))|O(?:n(?:State|eByteGlyphPacking|OffButton|lyScrollerArrows)|ther(?:Mouse(?:D(?:own(?:Mask)?|ragged(?:Mask)?)|Up(?:Mask)?)|TextMovement)|SF1OperatingSystem|pe(?:n(?:GL(?:GO(?:Re(?:setLibrary|tainRenderers)|ClearFormatCache|FormatCacheSize)|PFA(?:R(?:obust|endererID)|M(?:inimumPolicy|ulti(?:sample|Screen)|PSafe|aximumPolicy)|BackingStore|S(?:creenMask|te(?:ncilSize|reo)|ingleRenderer|upersample|ample(?:s|Buffers|Alpha))|NoRecovery|C(?:o(?:lor(?:Size|Float)|mpliant)|losestPolicy)|OffScreen|D(?:oubleBuffer|epthSize)|PixelBuffer|VirtualScreenCount|FullScreen|Window|A(?:cc(?:umSize|elerated)|ux(?:Buffers|DepthStencil)|l(?:phaSize|lRenderers))))|StepUnicodeReservedBase)|rationNotSupportedForKeyS(?:criptError|pecifierError))|ffState|KButton|rPredicateType|bjC(?:B(?:itfield|oolType)|S(?:hortType|tr(?:ingType|uctType)|electorType)|NoType|CharType|ObjectType|DoubleType|UnionType|PointerType|VoidType|FloatType|Long(?:Type|longType)|ArrayType))|D(?:i(?:s(?:c(?:losureBezelStyle|reteCapacityLevelIndicatorStyle)|playWindowRunLoopOrdering)|acriticInsensitivePredicateOption|rect(?:Selection|PredicateModifier))|o(?:c(?:ModalWindowMask|ument(?:Directory|ationDirectory))|ubleType|wn(?:TextMovement|ArrowFunctionKey))|e(?:s(?:cendingPageOrder|ktopDirectory)|cimalTabStopType|v(?:ice(?:NColorSpaceModel|IndependentModifierFlagsMask)|eloper(?:Directory|ApplicationDirectory))|fault(?:ControlTint|TokenStyle)|lete(?:Char(?:acter|FunctionKey)|FunctionKey|LineFunctionKey)|moApplicationDirectory)|a(?:yCalendarUnit|teFormatter(?:MediumStyle|Behavior(?:10|Default)|ShortStyle|NoStyle|FullStyle|LongStyle))|ra(?:wer(?:Clos(?:ingState|edState)|Open(?:ingState|State))|gOperation(?:Generic|Move|None|Copy|Delete|Private|Every|Link|All)))|U(?:ser(?:CancelledError|D(?:irectory|omainMask)|FunctionKey)|RL(?:Handle(?:NotLoaded|Load(?:Succeeded|InProgress|Failed))|CredentialPersistence(?:None|Permanent|ForSession))|n(?:scaledWindowMask|cachedRead|i(?:codeStringEncoding|talicFontMask|fiedTitleAndToolbarWindowMask)|d(?:o(?:CloseGroupingRunLoopOrdering|FunctionKey)|e(?:finedDateComponent|rline(?:Style(?:Single|None|Thick|Double)|Pattern(?:Solid|D(?:ot|ash(?:Dot(?:Dot)?)?)))))|known(?:ColorSpaceModel|P(?:ointingDevice|ageOrder)|KeyS(?:criptError|pecifierError))|boldFontMask)|tilityWindowMask|TF8StringEncoding|p(?:dateWindowsRunLoopOrdering|TextMovement|ArrowFunctionKey))|J(?:ustifiedTextAlignment|PEG(?:2000FileType|FileType)|apaneseEUC(?:GlyphPacking|StringEncoding))|P(?:o(?:s(?:t(?:Now|erFontMask|WhenIdle|ASAP)|iti(?:on(?:Replace|Be(?:fore|ginning)|End|After)|ve(?:IntType|DoubleType|FloatType)))|pUp(?:NoArrow|ArrowAt(?:Bottom|Center))|werOffEventType|rtraitOrientation)|NGFileType|ush(?:InCell(?:Mask)?|OnPushOffButton)|e(?:n(?:TipMask|UpperSideMask|PointingDevice|LowerSideMask)|riodic(?:Mask)?)|P(?:S(?:caleField|tatus(?:Title|Field)|aveButton)|N(?:ote(?:Title|Field)|ame(?:Title|Field))|CopiesField|TitleField|ImageButton|OptionsButton|P(?:a(?:perFeedButton|ge(?:Range(?:To|From)|ChoiceMatrix))|reviewButton)|LayoutButton)|lainTextTokenStyle|a(?:useFunctionKey|ragraphSeparatorCharacter|ge(?:DownFunctionKey|UpFunctionKey))|r(?:int(?:ing(?:ReplyLater|Success|Cancelled|Failure)|ScreenFunctionKey|erTable(?:NotFound|OK|Error)|FunctionKey)|o(?:p(?:ertyList(?:XMLFormat|MutableContainers(?:AndLeaves)?|BinaryFormat|Immutable|OpenStepFormat)|rietaryStringEncoding)|gressIndicator(?:BarStyle|SpinningStyle|Preferred(?:SmallThickness|Thickness|LargeThickness|AquaThickness)))|e(?:ssedTab|vFunctionKey))|L(?:HeightForm|CancelButton|TitleField|ImageButton|O(?:KButton|rientationMatrix)|UnitsButton|PaperNameButton|WidthForm))|E(?:n(?:terCharacter|d(?:sWith(?:Comparison|PredicateOperatorType)|FunctionKey))|v(?:e(?:nOddWindingRule|rySubelement)|aluatedObjectExpressionType)|qualTo(?:Comparison|PredicateOperatorType)|ra(?:serPointingDevice|CalendarUnit|DatePickerElementFlag)|x(?:clude(?:10|QuickDrawElementsIconCreationOption)|pandedFontMask|ecuteFunctionKey))|V(?:i(?:ew(?:M(?:in(?:XMargin|YMargin)|ax(?:XMargin|YMargin))|HeightSizable|NotSizable|WidthSizable)|aPanelFontAction)|erticalRuler|a(?:lidationErrorM(?:inimum|aximum)|riableExpressionType))|Key(?:SpecifierEvaluationScriptError|Down(?:Mask)?|Up(?:Mask)?|PathExpressionType|Value(?:MinusSetMutation|SetSetMutation|Change(?:Re(?:placement|moval)|Setting|Insertion)|IntersectSetMutation|ObservingOption(?:New|Old)|UnionSetMutation|ValidationError))|QTMovie(?:NormalPlayback|Looping(?:BackAndForthPlayback|Playback))|F(?:1(?:1FunctionKey|7FunctionKey|2FunctionKey|8FunctionKey|3FunctionKey|9FunctionKey|4FunctionKey|5FunctionKey|FunctionKey|0FunctionKey|6FunctionKey)|7FunctionKey|i(?:nd(?:PanelAction(?:Replace(?:A(?:ndFind|ll(?:InSelection)?))?|S(?:howFindPanel|e(?:tFindString|lectAll(?:InSelection)?))|Next|Previous)|FunctionKey)|tPagination|le(?:Read(?:No(?:SuchFileError|PermissionError)|CorruptFileError|In(?:validFileNameError|applicableStringEncodingError)|Un(?:supportedSchemeError|knownError))|HandlingPanel(?:CancelButton|OKButton)|NoSuchFileError|ErrorM(?:inimum|aximum)|Write(?:NoPermissionError|In(?:validFileNameError|applicableStringEncodingError)|OutOfSpaceError|Un(?:supportedSchemeError|knownError))|LockingError)|xedPitchFontMask)|2(?:1FunctionKey|7FunctionKey|2FunctionKey|8FunctionKey|3FunctionKey|9FunctionKey|4FunctionKey|5FunctionKey|FunctionKey|0FunctionKey|6FunctionKey)|o(?:nt(?:Mo(?:noSpaceTrait|dernSerifsClass)|BoldTrait|S(?:ymbolicClass|criptsClass|labSerifsClass|ansSerifClass)|C(?:o(?:ndensedTrait|llectionApplicationOnlyMask)|larendonSerifsClass)|TransitionalSerifsClass|I(?:ntegerAdvancementsRenderingMode|talicTrait)|O(?:ldStyleSerifsClass|rnamentalsClass)|DefaultRenderingMode|U(?:nknownClass|IOptimizedTrait)|Panel(?:S(?:hadowEffectModeMask|t(?:andardModesMask|rikethroughEffectModeMask)|izeModeMask)|CollectionModeMask|TextColorEffectModeMask|DocumentColorEffectModeMask|UnderlineEffectModeMask|FaceModeMask|All(?:ModesMask|EffectsModeMask))|ExpandedTrait|VerticalTrait|F(?:amilyClassMask|reeformSerifsClass)|Antialiased(?:RenderingMode|IntegerAdvancementsRenderingMode))|cusRing(?:Below|Type(?:None|Default|Exterior)|Only|Above)|urByteGlyphPacking|rm(?:attingError(?:M(?:inimum|aximum))?|FeedCharacter))|8FunctionKey|unction(?:ExpressionType|KeyMask)|3(?:1FunctionKey|2FunctionKey|3FunctionKey|4FunctionKey|5FunctionKey|FunctionKey|0FunctionKey)|9FunctionKey|4FunctionKey|P(?:RevertButton|S(?:ize(?:Title|Field)|etButton)|CurrentField|Preview(?:Button|Field))|l(?:oat(?:ingPointSamplesBitmapFormat|Type)|agsChanged(?:Mask)?)|axButton|5FunctionKey|6FunctionKey)|W(?:heelModeColorPanel|indow(?:s(?:NTOperatingSystem|CP125(?:1StringEncoding|2StringEncoding|3StringEncoding|4StringEncoding|0StringEncoding)|95(?:InterfaceStyle|OperatingSystem))|M(?:iniaturizeButton|ovedEventType)|Below|CloseButton|ToolbarButton|ZoomButton|Out|DocumentIconButton|ExposedEventType|Above)|orkspaceLaunch(?:NewInstance|InhibitingBackgroundOnly|Default|PreferringClassic|WithoutA(?:ctivation|ddingToRecents)|A(?:sync|nd(?:Hide(?:Others)?|Print)|llowingClassicStartup))|eek(?:day(?:CalendarUnit|OrdinalCalendarUnit)|CalendarUnit)|a(?:ntsBidiLevels|rningAlertStyle)|r(?:itingDirection(?:RightToLeft|Natural|LeftToRight)|apCalendarComponents))|L(?:i(?:stModeMatrix|ne(?:Moves(?:Right|Down|Up|Left)|B(?:order|reakBy(?:C(?:harWrapping|lipping)|Truncating(?:Middle|Head|Tail)|WordWrapping))|S(?:eparatorCharacter|weep(?:Right|Down|Up|Left))|ToBezierPathElement|DoesntMove|arSlider)|teralSearch|kePredicateOperatorType|ghterFontAction|braryDirectory)|ocalDomainMask|e(?:ssThan(?:Comparison|OrEqualTo(?:Comparison|PredicateOperatorType)|PredicateOperatorType)|ft(?:Mouse(?:D(?:own(?:Mask)?|ragged(?:Mask)?)|Up(?:Mask)?)|T(?:ext(?:Movement|Alignment)|ab(?:sBezelBorder|StopType))|ArrowFunctionKey))|a(?:yout(?:RightToLeft|NotDone|CantFit|OutOfGlyphs|Done|LeftToRight)|ndscapeOrientation)|ABColorSpaceModel)|A(?:sc(?:iiWithDoubleByteEUCGlyphPacking|endingPageOrder)|n(?:y(?:Type|PredicateModifier|EventMask)|choredSearch|imation(?:Blocking|Nonblocking(?:Threaded)?|E(?:ffect(?:DisappearingItemDefault|Poof)|ase(?:In(?:Out)?|Out))|Linear)|dPredicateType)|t(?:Bottom|tachmentCharacter|omicWrite|Top)|SCIIStringEncoding|d(?:obe(?:GB1CharacterCollection|CNS1CharacterCollection|Japan(?:1CharacterCollection|2CharacterCollection)|Korea1CharacterCollection)|dTraitFontAction|minApplicationDirectory)|uto(?:saveOperation|Pagination)|pp(?:lication(?:SupportDirectory|D(?:irectory|e(?:fined(?:Mask)?|legateReply(?:Success|Cancel|Failure)|activatedEventType))|ActivatedEventType)|KitDefined(?:Mask)?)|l(?:ternateKeyMask|pha(?:ShiftKeyMask|NonpremultipliedBitmapFormat|FirstBitmapFormat)|ert(?:SecondButtonReturn|ThirdButtonReturn|OtherReturn|DefaultReturn|ErrorReturn|FirstButtonReturn|AlternateReturn)|l(?:ScrollerParts|DomainsMask|PredicateModifier|LibrariesDirectory|ApplicationsDirectory))|rgument(?:sWrongScriptError|EvaluationScriptError)|bove(?:Bottom|Top)|WTEventType)))(?:\\b)"
- },
- {
- token: "support.function.C99.c",
- regex: C_Highlight_File.cFunctions
- },
- {
- token : cObj.getKeywords(),
- regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
- },
- {
- token: "punctuation.section.scope.begin.objc",
- regex: "\\[",
- next: "bracketed_content"
- },
- {
- token: "meta.function.objc",
- regex: "^(?:-|\\+)\\s*"
- }
- ],
- "constant_NSString": [
- {
- token: "constant.character.escape.objc",
- regex: escapedConstRe
- },
- {
- token: "invalid.illegal.unknown-escape.objc",
- regex: "\\\\."
- },
- {
- token: "string",
- regex: '[^"\\\\]+'
- },
- {
- token: "punctuation.definition.string.end",
- regex: "\"",
- next: "start"
- }
- ],
- "protocol_list": [
- {
- token: "punctuation.section.scope.end.objc",
- regex: ">",
- next: "start"
- },
- {
- token: "support.other.protocol.objc",
- regex: "\bNS(?:GlyphStorage|M(?:utableCopying|enuItem)|C(?:hangeSpelling|o(?:ding|pying|lorPicking(?:Custom|Default)))|T(?:oolbarItemValidations|ext(?:Input|AttachmentCell))|I(?:nputServ(?:iceProvider|erMouseTracker)|gnoreMisspelledWords)|Obj(?:CTypeSerializationCallBack|ect)|D(?:ecimalNumberBehaviors|raggingInfo)|U(?:serInterfaceValidations|RL(?:HandleClient|DownloadDelegate|ProtocolClient|AuthenticationChallengeSender))|Validated(?:ToobarItem|UserInterfaceItem)|Locking)\b"
- }
- ],
- "selectors": [
- {
- token: "support.function.any-method.name-of-parameter.objc",
- regex: "\\b(?:[a-zA-Z_:][\\w]*)+"
- },
- {
- token: "punctuation",
- regex: "\\)",
- next: "start"
- }
- ],
- "bracketed_content": [
- {
- token: "punctuation.section.scope.end.objc",
- regex: "\]",
- next: "start"
- },
- {
- token: ["support.function.any-method.objc"],
- regex: "(?:predicateWithFormat:| NSPredicate predicateWithFormat:)",
- next: "start"
- },
- {
- token: "support.function.any-method.objc",
- regex: "\\w+(?::|(?=\]))",
- next: "start"
- }
- ],
- "bracketed_strings": [
- {
- token: "punctuation.section.scope.end.objc",
- regex: "\]",
- next: "start"
- },
- {
- token: "keyword.operator.logical.predicate.cocoa",
- regex: "\\b(?:AND|OR|NOT|IN)\\b"
- },
- {
- token: ["invalid.illegal.unknown-method.objc", "punctuation.separator.arguments.objc"],
- regex: "\\b(\w+)(:)"
- },
- {
- regex: "\\b(?:ALL|ANY|SOME|NONE)\\b",
- token: "constant.language.predicate.cocoa"
- },
- {
- regex: "\\b(?:NULL|NIL|SELF|TRUE|YES|FALSE|NO|FIRST|LAST|SIZE)\\b",
- token: "constant.language.predicate.cocoa"
- },
- {
- regex: "\\b(?:MATCHES|CONTAINS|BEGINSWITH|ENDSWITH|BETWEEN)\\b",
- token: "keyword.operator.comparison.predicate.cocoa"
- },
- {
- regex: "\\bC(?:ASEINSENSITIVE|I)\\b",
- token: "keyword.other.modifier.predicate.cocoa"
- },
- {
- regex: "\\b(?:ANYKEY|SUBQUERY|CAST|TRUEPREDICATE|FALSEPREDICATE)\\b",
- token: "keyword.other.predicate.cocoa"
- },
- {
- regex: escapedConstRe,
- token: "constant.character.escape.objc"
- },
- {
- regex: "\\\\.",
- token: "invalid.illegal.unknown-escape.objc"
- },
- {
- token: "string",
- regex: '[^"\\\\]'
- },
- {
- token: "punctuation.definition.string.end.objc",
- regex: "\"",
- next: "predicates"
- }
- ],
- "comment" : [
- {
- token : "comment", // closing comment
- regex : ".*?\\*\\/",
- next : "start"
- }, {
- token : "comment", // comment spanning whole line
- regex : ".+"
- }
- ],
- "methods" : [
- {
- token : "meta.function.objc",
- regex : "(?=\\{|#)|;",
- next : "start"
- }
- ]
-}
- for (var r in cRules) {
- if (this.$rules[r]) {
- if (this.$rules[r].push)
- this.$rules[r].push.apply(this.$rules[r], cRules[r]);
- } else {
- this.$rules[r] = cRules[r];
- }
- }
-
- this.$rules.bracketed_content = this.$rules.bracketed_content.concat(
- this.$rules.start, specialVariables
- );
-
- this.embedRules(DocCommentHighlightRules, "doc-",
- [ DocCommentHighlightRules.getEndRule("start") ]);
-};
-
-oop.inherits(ObjectiveCHighlightRules, CHighlightRules);
-
-exports.ObjectiveCHighlightRules = ObjectiveCHighlightRules;
-});
-
-define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
-
-
-var oop = require("../lib/oop");
-var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
-
-var DocCommentHighlightRules = function() {
-
- this.$rules = {
- "start" : [ {
- token : "comment.doc.tag",
- regex : "@[\\w\\d_]+" // TODO: fix email addresses
- }, {
- token : "comment.doc.tag",
- regex : "\\bTODO\\b"
- }, {
- defaultToken : "comment.doc"
- }]
- };
-};
-
-oop.inherits(DocCommentHighlightRules, TextHighlightRules);
-
-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/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) {
-
-
-var oop = require("../lib/oop");
-var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
-var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
-var cFunctions = exports.cFunctions = "\\s*\\bhypot(?: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 c_cppHighlightRules = function() {
-
- var keywordControls = (
- "break|case|continue|default|do|else|for|goto|if|_Pragma|" +
- "return|switch|while|catch|operator|try|throw|using"
- );
-
- 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"
- );
-
- var storageModifiers = (
- "const|extern|register|restrict|static|volatile|inline|private:|" +
- "protected:|public:|friend|explicit|virtual|export|mutable|typename"
- );
-
- 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 builtinConstants = (
- "NULL|true|false|TRUE|FALSE"
- );
-
- var keywordMapper = this.$keywords = this.createKeywordMapper({
- "keyword.control" : keywordControls,
- "storage.type" : storageType,
- "storage.modifier" : storageModifiers,
- "keyword.operator" : keywordOperators,
- "variable.language": "this",
- "constant.language": builtinConstants
- }, "identifier");
-
- var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\d\\$_\u00a1-\uffff]*\\b";
-
- this.$rules = {
- "start" : [
- {
- token : "comment",
- regex : "\\/\\/.*$"
- },
- DocCommentHighlightRules.getStartRule("doc-start"),
- {
- token : "comment", // multi line comment
- regex : "\\/\\*",
- next : "comment"
- }, {
- token : "string", // single line
- regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
- }, {
- token : "string", // multi line string start
- regex : '["].*\\\\$',
- next : "qqstring"
- }, {
- token : "string", // single line
- regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
- }, {
- token : "string", // multi line string start
- regex : "['].*\\\\$",
- next : "qstring"
- }, {
- token : "constant.numeric", // hex
- regex : "0[xX][0-9a-fA-F]+\\b"
- }, {
- token : "constant.numeric", // float
- regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
- }, {
- token : "keyword", // pre-compiler directives
- regex : "(?:#include|#import|#pragma|#line|#define|#undef|#if|#ifdef|#else|#elif|#ifndef)\\b",
- next : "directive"
- }, {
- token : "keyword", // special case pre-compiler directive
- regex : "(?:#endif)\\b"
- }, {
- token : "support.function.C99.c",
- regex : cFunctions
- }, {
- token : keywordMapper,
- regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
- }, {
- token : "keyword.operator",
- regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|==|=|!=|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|new|delete|typeof|void)"
- }, {
- token : "punctuation.operator",
- regex : "\\?|\\:|\\,|\\;|\\."
- }, {
- token : "paren.lparen",
- regex : "[[({]"
- }, {
- token : "paren.rparen",
- regex : "[\\])}]"
- }, {
- token : "text",
- regex : "\\s+"
- }
- ],
- "comment" : [
- {
- token : "comment", // closing comment
- regex : ".*?\\*\\/",
- next : "start"
- }, {
- token : "comment", // comment spanning whole line
- regex : ".+"
- }
- ],
- "qqstring" : [
- {
- token : "string",
- regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"',
- next : "start"
- }, {
- token : "string",
- regex : '.+'
- }
- ],
- "qstring" : [
- {
- token : "string",
- regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'",
- next : "start"
- }, {
- token : "string",
- regex : '.+'
- }
- ],
- "directive" : [
- {
- token : "constant.other.multiline",
- regex : /\\/
- },
- {
- token : "constant.other",
- regex : "\\s*<.+?>",
- next : "start"
- },
- {
- token : "constant.other", // single line
- regex : '\\s*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]',
- next : "start"
- },
- {
- token : "constant.other", // single line
- regex : "\\s*['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']",
- next : "start"
- },
- {
- token : "constant.other.multiline",
- regex : /.*\\/
- },
- {
- token : "constant.other",
- regex : /[^\\\/]+/,
- next : "start"
- }
- ]
- };
-
- this.embedRules(DocCommentHighlightRules, "doc-",
- [ DocCommentHighlightRules.getEndRule("start") ]);
-};
-
-oop.inherits(c_cppHighlightRules, TextHighlightRules);
-
-exports.c_cppHighlightRules = c_cppHighlightRules;
-});
-
-define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
-
-
-var oop = require("../../lib/oop");
-var Range = require("../../range").Range;
-var BaseFoldMode = require("./fold_mode").FoldMode;
-
-var FoldMode = exports.FoldMode = function() {};
-oop.inherits(FoldMode, BaseFoldMode);
-
-(function() {
-
- this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;
- this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
-
- this.getFoldWidgetRange = function(session, foldStyle, row) {
- var line = session.getLine(row);
- var match = line.match(this.foldingStartMarker);
- if (match) {
- var i = match.index;
-
- if (match[1])
- return this.openingBracketBlock(session, match[1], row, i);
-
- return session.getCommentFoldRange(row, i + match[0].length, 1);
- }
-
- if (foldStyle !== "markbeginend")
- 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);
- }
- };
-
-}).call(FoldMode.prototype);
-
-});
diff --git a/public/libs/ace/mode-sql.js b/public/libs/ace/mode-sql.js
deleted file mode 100644
index b62ca43..0000000
--- a/public/libs/ace/mode-sql.js
+++ /dev/null
@@ -1,145 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Distributed under the BSD license:
- *
- * Copyright (c) 2010, Ajax.org B.V.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of Ajax.org B.V. nor the
- * names of its contributors may be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * ***** END LICENSE BLOCK ***** */
-
-define('ace/mode/sql', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/sql_highlight_rules', 'ace/range'], function(require, exports, module) {
-
-
-var oop = require("../lib/oop");
-var TextMode = require("./text").Mode;
-var Tokenizer = require("../tokenizer").Tokenizer;
-var SqlHighlightRules = require("./sql_highlight_rules").SqlHighlightRules;
-var Range = require("../range").Range;
-
-var Mode = function() {
- this.$tokenizer = new Tokenizer(new SqlHighlightRules().getRules());
-};
-oop.inherits(Mode, TextMode);
-
-(function() {
-
- this.toggleCommentLines = function(state, doc, startRow, endRow) {
- var outdent = true;
- var outentedRows = [];
- var re = /^(\s*)--/;
-
- for (var i=startRow; i<= endRow; i++) {
- if (!re.test(doc.getLine(i))) {
- outdent = false;
- break;
- }
- }
-
- if (outdent) {
- var deleteRange = new Range(0, 0, 0, 0);
- for (var i=startRow; i<= endRow; i++)
- {
- var line = doc.getLine(i);
- var m = line.match(re);
- deleteRange.start.row = i;
- deleteRange.end.row = i;
- deleteRange.end.column = m[0].length;
- doc.replace(deleteRange, m[1]);
- }
- }
- else {
- doc.indentRows(startRow, endRow, "--");
- }
- };
-
-}).call(Mode.prototype);
-
-exports.Mode = Mode;
-
-});
-
-define('ace/mode/sql_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
-
-
-var oop = require("../lib/oop");
-var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
-
-var SqlHighlightRules = function() {
-
- var keywords = (
- "select|insert|update|delete|from|where|and|or|group|by|order|limit|offset|having|as|case|" +
- "when|else|end|type|left|right|join|on|outer|desc|asc"
- );
-
- var builtinConstants = (
- "true|false|null"
- );
-
- var builtinFunctions = (
- "count|min|max|avg|sum|rank|now|coalesce"
- );
-
- 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+"
- } ]
- };
-};
-
-oop.inherits(SqlHighlightRules, TextHighlightRules);
-
-exports.SqlHighlightRules = SqlHighlightRules;
-});
-
diff --git a/public/libs/ace/mode-text.js b/public/libs/ace/mode-text.js
deleted file mode 100644
index e69de29..0000000
diff --git a/public/libs/ace/mode-yaml.js b/public/libs/ace/mode-yaml.js
deleted file mode 100644
index 65c71db..0000000
--- a/public/libs/ace/mode-yaml.js
+++ /dev/null
@@ -1,292 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Distributed under the BSD license:
- *
- * Copyright (c) 2010, Ajax.org B.V.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of Ajax.org B.V. nor the
- * names of its contributors may be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * ***** END LICENSE BLOCK ***** */
-
-define('ace/mode/yaml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/yaml_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/mode/folding/coffee'], function(require, exports, module) {
-
-
-var oop = require("../lib/oop");
-var TextMode = require("./text").Mode;
-var Tokenizer = require("../tokenizer").Tokenizer;
-var YamlHighlightRules = require("./yaml_highlight_rules").YamlHighlightRules;
-var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
-var FoldMode = require("./folding/coffee").FoldMode;
-
-var Mode = function() {
- this.$tokenizer = new Tokenizer(new YamlHighlightRules().getRules());
- this.$outdent = new MatchingBraceOutdent();
- this.foldingRules = new FoldMode();
-};
-oop.inherits(Mode, TextMode);
-
-(function() {
-
- this.getNextLineIndent = function(state, line, tab) {
- var indent = this.$getIndent(line);
-
- if (state == "start") {
- var match = line.match(/^.*[\{\(\[]\s*$/);
- if (match) {
- indent += tab;
- }
- }
-
- return indent;
- };
-
- this.checkOutdent = function(state, line, input) {
- return this.$outdent.checkOutdent(line, input);
- };
-
- this.autoOutdent = function(state, doc, row) {
- this.$outdent.autoOutdent(doc, row);
- };
-
-
-}).call(Mode.prototype);
-
-exports.Mode = Mode;
-
-});
-
-define('ace/mode/yaml_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
-
-
-var oop = require("../lib/oop");
-var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
-
-var YamlHighlightRules = function() {
- this.$rules = {
- "start" : [
- {
- token : "comment",
- regex : "#.*$"
- }, {
- token : "list.markup",
- regex : /^(?:-{3}|\.{3})\s*(?=#|$)/
- }, {
- token : "list.markup",
- regex : /^\s*[\-?](?:$|\s)/
- }, {
- token: "constant",
- regex: "!![\\w//]+"
- }, {
- token: "constant.language",
- regex: "[&\\*][a-zA-Z0-9-_]+"
- }, {
- token: ["meta.tag", "keyword"],
- regex: /^(\s*\w.*?)(\:(?:\s+|$))/
- },{
- token: ["meta.tag", "keyword"],
- regex: /(\w+?)(\s*\:(?:\s+|$))/
- }, {
- token : "keyword.operator",
- regex : "<<\\w*:\\w*"
- }, {
- token : "keyword.operator",
- regex : "-\\s*(?=[{])"
- }, {
- token : "string", // single line
- regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
- }, {
- token : "string", // multi line string start
- regex : '[\\|>]\\w*',
- next : "qqstring"
- }, {
- token : "string", // single quoted string
- regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
- }, {
- token : "constant.numeric", // float
- regex : /[+\-]?[\d_]+(?:(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?\b/
- }, {
- token : "constant.numeric", // other number
- regex : /[+\-]?\.inf\b|NaN\b|0x[\dA-Fa-f_]+|0b[10_]+/
- }, {
- token : "constant.language.boolean",
- regex : "(?:true|false|TRUE|FALSE|True|False|yes|no)\\b"
- }, {
- token : "invalid.illegal", // comments are not allowed
- regex : "\\/\\/.*$"
- }, {
- token : "paren.lparen",
- regex : "[[({]"
- }, {
- token : "paren.rparen",
- regex : "[\\])}]"
- }
- ],
- "qqstring" : [
- {
- token : "string",
- regex : '(?=(?:(?:\\\\.)|(?:[^:]))*?:)',
- next : "start"
- }, {
- token : "string",
- regex : '.+'
- }
- ]};
-
-};
-
-oop.inherits(YamlHighlightRules, TextHighlightRules);
-
-exports.YamlHighlightRules = YamlHighlightRules;
-});
-
-define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
-
-
-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) {
- var match = line.match(/^(\s+)/);
- if (match) {
- return match[1];
- }
-
- return "";
- };
-
-}).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) {
-
-
-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.getFoldWidgetRange = function(session, foldStyle, row) {
- var range = this.indentationBlock(session, row);
- if (range)
- return range;
-
- 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.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);
-
-});
diff --git a/public/libs/ace/theme-chrome.js b/public/libs/ace/theme-chrome.js
deleted file mode 100644
index 38b2d5e..0000000
--- a/public/libs/ace/theme-chrome.js
+++ /dev/null
@@ -1,161 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Distributed under the BSD license:
- *
- * Copyright (c) 2010, Ajax.org B.V.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of Ajax.org B.V. nor the
- * names of its contributors may be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * ***** END LICENSE BLOCK ***** */
-
-define('ace/theme/chrome', ['require', 'exports', 'module' , 'ace/lib/dom'], function(require, exports, module) {
-
-exports.isDark = false;
-exports.cssClass = "ace-chrome";
-exports.cssText = ".ace-chrome .ace_gutter {\
-background: #ebebeb;\
-color: #333;\
-overflow : hidden;\
-}\
-.ace-chrome .ace_print-margin {\
-width: 1px;\
-background: #e8e8e8;\
-}\
-.ace-chrome .ace_scroller {\
-background-color: #FFFFFF;\
-}\
-.ace-chrome .ace_cursor {\
-border-left: 2px solid black;\
-}\
-.ace-chrome .ace_overwrite-cursors .ace_cursor {\
-border-left: 0px;\
-border-bottom: 1px solid black;\
-}\
-.ace-chrome .ace_invisible {\
-color: rgb(191, 191, 191);\
-}\
-.ace-chrome .ace_constant.ace_buildin {\
-color: rgb(88, 72, 246);\
-}\
-.ace-chrome .ace_constant.ace_language {\
-color: rgb(88, 92, 246);\
-}\
-.ace-chrome .ace_constant.ace_library {\
-color: rgb(6, 150, 14);\
-}\
-.ace-chrome .ace_invalid {\
-background-color: rgb(153, 0, 0);\
-color: white;\
-}\
-.ace-chrome .ace_fold {\
-}\
-.ace-chrome .ace_support.ace_function {\
-color: rgb(60, 76, 114);\
-}\
-.ace-chrome .ace_support.ace_constant {\
-color: rgb(6, 150, 14);\
-}\
-.ace-chrome .ace_support.ace_type,\
-.ace-chrome .ace_support.ace_class\
-.ace-chrome .ace_support.ace_other {\
-color: rgb(109, 121, 222);\
-}\
-.ace-chrome .ace_variable.ace_parameter {\
-font-style:italic;\
-color:#FD971F;\
-}\
-.ace-chrome .ace_keyword.ace_operator {\
-color: rgb(104, 118, 135);\
-}\
-.ace-chrome .ace_comment {\
-color: #236e24;\
-}\
-.ace-chrome .ace_comment.ace_doc {\
-color: #236e24;\
-}\
-.ace-chrome .ace_comment.ace_doc.ace_tag {\
-color: #236e24;\
-}\
-.ace-chrome .ace_constant.ace_numeric {\
-color: rgb(0, 0, 205);\
-}\
-.ace-chrome .ace_variable {\
-color: rgb(49, 132, 149);\
-}\
-.ace-chrome .ace_xml-pe {\
-color: rgb(104, 104, 91);\
-}\
-.ace-chrome .ace_entity.ace_name.ace_function {\
-color: #0000A2;\
-}\
-.ace-chrome .ace_markup.ace_heading {\
-color: rgb(12, 7, 255);\
-}\
-.ace-chrome .ace_markup.ace_list {\
-color:rgb(185, 6, 144);\
-}\
-.ace-chrome .ace_marker-layer .ace_selection {\
-background: rgb(181, 213, 255);\
-}\
-.ace-chrome .ace_marker-layer .ace_step {\
-background: rgb(252, 255, 0);\
-}\
-.ace-chrome .ace_marker-layer .ace_stack {\
-background: rgb(164, 229, 101);\
-}\
-.ace-chrome .ace_marker-layer .ace_bracket {\
-margin: -1px 0 0 -1px;\
-border: 1px solid rgb(192, 192, 192);\
-}\
-.ace-chrome .ace_marker-layer .ace_active-line {\
-background: rgba(0, 0, 0, 0.07);\
-}\
-.ace-chrome .ace_gutter-active-line {\
-background-color : #dcdcdc;\
-}\
-.ace-chrome .ace_marker-layer .ace_selected-word {\
-background: rgb(250, 250, 255);\
-border: 1px solid rgb(200, 200, 250);\
-}\
-.ace-chrome .ace_storage,\
-.ace-chrome .ace_keyword,\
-.ace-chrome .ace_meta.ace_tag {\
-color: rgb(147, 15, 128);\
-}\
-.ace-chrome .ace_string.ace_regex {\
-color: rgb(255, 0, 0)\
-}\
-.ace-chrome .ace_string {\
-color: #1A1AA6;\
-}\
-.ace-chrome .ace_entity.ace_other.ace_attribute-name {\
-color: #994409;\
-}\
-.ace-chrome .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);
-});
diff --git a/public/libs/ace/theme-clouds.js b/public/libs/ace/theme-clouds.js
deleted file mode 100644
index 737e9ba..0000000
--- a/public/libs/ace/theme-clouds.js
+++ /dev/null
@@ -1,135 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Distributed under the BSD license:
- *
- * Copyright (c) 2010, Ajax.org B.V.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of Ajax.org B.V. nor the
- * names of its contributors may be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * ***** END LICENSE BLOCK ***** */
-
-define('ace/theme/clouds', ['require', 'exports', 'module' , 'ace/lib/dom'], function(require, exports, module) {
-
-exports.isDark = false;
-exports.cssClass = "ace-clouds";
-exports.cssText = ".ace-clouds .ace_gutter {\
-background: #ebebeb;\
-color: #333\
-}\
-.ace-clouds .ace_print-margin {\
-width: 1px;\
-background: #e8e8e8\
-}\
-.ace-clouds .ace_scroller {\
-background-color: #FFFFFF\
-}\
-.ace-clouds .ace_text-layer {\
-color: #000000\
-}\
-.ace-clouds .ace_cursor {\
-border-left: 2px solid #000000\
-}\
-.ace-clouds .ace_overwrite-cursors .ace_cursor {\
-border-left: 0px;\
-border-bottom: 1px solid #000000\
-}\
-.ace-clouds .ace_marker-layer .ace_selection {\
-background: #BDD5FC\
-}\
-.ace-clouds.ace_multiselect .ace_selection.ace_start {\
-box-shadow: 0 0 3px 0px #FFFFFF;\
-border-radius: 2px\
-}\
-.ace-clouds .ace_marker-layer .ace_step {\
-background: rgb(255, 255, 0)\
-}\
-.ace-clouds .ace_marker-layer .ace_bracket {\
-margin: -1px 0 0 -1px;\
-border: 1px solid #BFBFBF\
-}\
-.ace-clouds .ace_marker-layer .ace_active-line {\
-background: #FFFBD1\
-}\
-.ace-clouds .ace_gutter-active-line {\
-background-color : #dcdcdc\
-}\
-.ace-clouds .ace_marker-layer .ace_selected-word {\
-border: 1px solid #BDD5FC\
-}\
-.ace-clouds .ace_invisible {\
-color: #BFBFBF\
-}\
-.ace-clouds .ace_keyword,\
-.ace-clouds .ace_meta,\
-.ace-clouds .ace_support.ace_constant.ace_property-value {\
-color: #AF956F\
-}\
-.ace-clouds .ace_keyword.ace_operator {\
-color: #484848\
-}\
-.ace-clouds .ace_keyword.ace_other.ace_unit {\
-color: #96DC5F\
-}\
-.ace-clouds .ace_constant.ace_language {\
-color: #39946A\
-}\
-.ace-clouds .ace_constant.ace_numeric {\
-color: #46A609\
-}\
-.ace-clouds .ace_constant.ace_character.ace_entity {\
-color: #BF78CC\
-}\
-.ace-clouds .ace_invalid {\
-background-color: #FF002A\
-}\
-.ace-clouds .ace_fold {\
-background-color: #AF956F;\
-border-color: #000000\
-}\
-.ace-clouds .ace_storage,\
-.ace-clouds .ace_support.ace_class,\
-.ace-clouds .ace_support.ace_function,\
-.ace-clouds .ace_support.ace_other,\
-.ace-clouds .ace_support.ace_type {\
-color: #C52727\
-}\
-.ace-clouds .ace_string {\
-color: #5D90CD\
-}\
-.ace-clouds .ace_comment {\
-color: #BCC8BA\
-}\
-.ace-clouds .ace_entity.ace_name.ace_tag,\
-.ace-clouds .ace_entity.ace_other.ace_attribute-name {\
-color: #606060\
-}\
-.ace-clouds .ace_markup.ace_underline {\
-text-decoration: underline\
-}\
-.ace-clouds .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);
-});
diff --git a/public/libs/ace/theme-clouds_midnight.js b/public/libs/ace/theme-clouds_midnight.js
deleted file mode 100644
index beb1ee6..0000000
--- a/public/libs/ace/theme-clouds_midnight.js
+++ /dev/null
@@ -1,136 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Distributed under the BSD license:
- *
- * Copyright (c) 2010, Ajax.org B.V.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of Ajax.org B.V. nor the
- * names of its contributors may be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * ***** END LICENSE BLOCK ***** */
-
-define('ace/theme/clouds_midnight', ['require', 'exports', 'module' , 'ace/lib/dom'], function(require, exports, module) {
-
-exports.isDark = true;
-exports.cssClass = "ace-clouds-midnight";
-exports.cssText = ".ace-clouds-midnight .ace_gutter {\
-background: #232323;\
-color: #929292\
-}\
-.ace-clouds-midnight .ace_print-margin {\
-width: 1px;\
-background: #232323\
-}\
-.ace-clouds-midnight .ace_scroller {\
-background-color: #191919\
-}\
-.ace-clouds-midnight .ace_text-layer {\
-color: #929292\
-}\
-.ace-clouds-midnight .ace_cursor {\
-border-left: 2px solid #7DA5DC\
-}\
-.ace-clouds-midnight .ace_overwrite-cursors .ace_cursor {\
-border-left: 0px;\
-border-bottom: 1px solid #7DA5DC\
-}\
-.ace-clouds-midnight .ace_marker-layer .ace_selection {\
-background: #000000\
-}\
-.ace-clouds-midnight.ace_multiselect .ace_selection.ace_start {\
-box-shadow: 0 0 3px 0px #191919;\
-border-radius: 2px\
-}\
-.ace-clouds-midnight .ace_marker-layer .ace_step {\
-background: rgb(102, 82, 0)\
-}\
-.ace-clouds-midnight .ace_marker-layer .ace_bracket {\
-margin: -1px 0 0 -1px;\
-border: 1px solid #BFBFBF\
-}\
-.ace-clouds-midnight .ace_marker-layer .ace_active-line {\
-background: rgba(215, 215, 215, 0.031)\
-}\
-.ace-clouds-midnight .ace_gutter-active-line {\
-background-color: rgba(215, 215, 215, 0.031)\
-}\
-.ace-clouds-midnight .ace_marker-layer .ace_selected-word {\
-border: 1px solid #000000\
-}\
-.ace-clouds-midnight .ace_invisible {\
-color: #BFBFBF\
-}\
-.ace-clouds-midnight .ace_keyword,\
-.ace-clouds-midnight .ace_meta,\
-.ace-clouds-midnight .ace_support.ace_constant.ace_property-value {\
-color: #927C5D\
-}\
-.ace-clouds-midnight .ace_keyword.ace_operator {\
-color: #4B4B4B\
-}\
-.ace-clouds-midnight .ace_keyword.ace_other.ace_unit {\
-color: #366F1A\
-}\
-.ace-clouds-midnight .ace_constant.ace_language {\
-color: #39946A\
-}\
-.ace-clouds-midnight .ace_constant.ace_numeric {\
-color: #46A609\
-}\
-.ace-clouds-midnight .ace_constant.ace_character.ace_entity {\
-color: #A165AC\
-}\
-.ace-clouds-midnight .ace_invalid {\
-color: #FFFFFF;\
-background-color: #E92E2E\
-}\
-.ace-clouds-midnight .ace_fold {\
-background-color: #927C5D;\
-border-color: #929292\
-}\
-.ace-clouds-midnight .ace_storage,\
-.ace-clouds-midnight .ace_support.ace_class,\
-.ace-clouds-midnight .ace_support.ace_function,\
-.ace-clouds-midnight .ace_support.ace_other,\
-.ace-clouds-midnight .ace_support.ace_type {\
-color: #E92E2E\
-}\
-.ace-clouds-midnight .ace_string {\
-color: #5D90CD\
-}\
-.ace-clouds-midnight .ace_comment {\
-color: #3C403B\
-}\
-.ace-clouds-midnight .ace_entity.ace_name.ace_tag,\
-.ace-clouds-midnight .ace_entity.ace_other.ace_attribute-name {\
-color: #606060\
-}\
-.ace-clouds-midnight .ace_markup.ace_underline {\
-text-decoration: underline\
-}\
-.ace-clouds-midnight .ace_indent-guide {\
-background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWOQlJT8z1BeXv4fAA2KA6+h9Z+2AAAAAElFTkSuQmCC) right repeat-y\
-}";
-
-var dom = require("../lib/dom");
-dom.importCssString(exports.cssText, exports.cssClass);
-});
diff --git a/public/libs/ace/theme-textmate.js b/public/libs/ace/theme-textmate.js
deleted file mode 100644
index f25d0f5..0000000
--- a/public/libs/ace/theme-textmate.js
+++ /dev/null
@@ -1,163 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Distributed under the BSD license:
- *
- * Copyright (c) 2010, Ajax.org B.V.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of Ajax.org B.V. nor the
- * names of its contributors may be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * ***** END LICENSE BLOCK ***** */
-
-define('ace/theme/textmate', ['require', 'exports', 'module' , 'ace/lib/dom'], function(require, exports, module) {
-
-
-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 .ace_scroller {\
-background-color: #FFFFFF;\
-}\
-.ace-tm .ace_cursor {\
-border-left: 2px solid black;\
-}\
-.ace-tm .ace_overwrite-cursors .ace_cursor {\
-border-left: 0px;\
-border-bottom: 1px solid 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_markup.ace_heading {\
-color: rgb(12, 7, 255);\
-}\
-.ace-tm .ace_markup.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;\
-border-radius: 2px;\
-}\
-.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);
-});
diff --git a/public/libs/ace/worker-coffee.js b/public/libs/ace/worker-coffee.js
deleted file mode 100644
index 71aacbb..0000000
--- a/public/libs/ace/worker-coffee.js
+++ /dev/null
@@ -1,7103 +0,0 @@
-"no use strict";
-
-if (typeof window != "undefined" && window.document)
- throw "atempt to load ace worker into main window instead of webWorker";
-
-var console = {
- log: function() {
- var msgs = Array.prototype.slice.call(arguments, 0);
- postMessage({type: "log", data: msgs});
- },
- error: function() {
- var msgs = Array.prototype.slice.call(arguments, 0);
- postMessage({type: "log", data: msgs});
- }
-};
-var window = {
- console: console
-};
-
-var normalizeModule = function(parentId, moduleName) {
- // normalize plugin requires
- if (moduleName.indexOf("!") !== -1) {
- var chunks = moduleName.split("!");
- return normalizeModule(parentId, chunks[0]) + "!" + normalizeModule(parentId, chunks[1]);
- }
- // normalize relative requires
- if (moduleName.charAt(0) == ".") {
- var base = parentId.split("/").slice(0, -1).join("/");
- moduleName = base + "/" + moduleName;
-
- while(moduleName.indexOf(".") !== -1 && previous != moduleName) {
- var previous = moduleName;
- moduleName = moduleName.replace(/\/\.\//, "/").replace(/[^\/]+\/\.\.\//, "");
- }
- }
-
- return moduleName;
-};
-
-var require = function(parentId, id) {
- if (!id.charAt)
- throw new Error("worker.js require() accepts only (parentId, id) as arguments");
-
- id = normalizeModule(parentId, id);
-
- var module = require.modules[id];
- if (module) {
- if (!module.initialized) {
- module.initialized = true;
- module.exports = module.factory().exports;
- }
- return module.exports;
- }
-
- var chunks = id.split("/");
- chunks[0] = require.tlns[chunks[0]] || chunks[0];
- var path = chunks.join("/") + ".js";
-
- require.id = id;
- importScripts(path);
- return require(parentId, id);
-};
-
-require.modules = {};
-require.tlns = {};
-
-var define = function(id, deps, factory) {
- if (arguments.length == 2) {
- factory = deps;
- if (typeof id != "string") {
- deps = id;
- id = require.id;
- }
- } else if (arguments.length == 1) {
- factory = id;
- id = require.id;
- }
-
- if (id.indexOf("text!") === 0)
- return;
-
- var req = function(deps, factory) {
- return require(id, deps, factory);
- };
-
- require.modules[id] = {
- factory: function() {
- var module = {
- exports: {}
- };
- var returnExports = factory(req, module.exports, module);
- if (returnExports)
- module.exports = returnExports;
- return module;
- }
- };
-};
-
-function initBaseUrls(topLevelNamespaces) {
- require.tlns = topLevelNamespaces;
-}
-
-function initSender() {
-
- var EventEmitter = require(null, "ace/lib/event_emitter").EventEmitter;
- var oop = require(null, "ace/lib/oop");
-
- var Sender = function() {};
-
- (function() {
-
- oop.implement(this, EventEmitter);
-
- this.callback = function(data, callbackId) {
- postMessage({
- type: "call",
- id: callbackId,
- data: data
- });
- };
-
- this.emit = function(name, data) {
- postMessage({
- type: "event",
- name: name,
- data: data
- });
- };
-
- }).call(Sender.prototype);
-
- return new Sender();
-}
-
-var main;
-var sender;
-
-onmessage = function(e) {
- var msg = e.data;
- if (msg.command) {
- if (main[msg.command])
- main[msg.command].apply(main, msg.args);
- else
- throw new Error("Unknown command:" + msg.command);
- }
- else if (msg.init) {
- initBaseUrls(msg.tlns);
- require(null, "ace/lib/fixoldbrowsers");
- sender = initSender();
- var clazz = require(null, msg.module)[msg.classname];
- main = new clazz(sender);
- }
- else if (msg.event && sender) {
- sender._emit(msg.event, msg.data);
- }
-};
-// vim:set ts=4 sts=4 sw=4 st:
-
-define('ace/lib/fixoldbrowsers', ['require', 'exports', 'module' , 'ace/lib/regexp', 'ace/lib/es5-shim'], function(require, exports, module) {
-
-
-require("./regexp");
-require("./es5-shim");
-
-});
-
-define('ace/lib/regexp', ['require', 'exports', 'module' ], function(require, exports, module) {
-
- var real = {
- exec: RegExp.prototype.exec,
- test: RegExp.prototype.test,
- match: String.prototype.match,
- replace: String.prototype.replace,
- split: String.prototype.split
- },
- compliantExecNpcg = real.exec.call(/()??/, "")[1] === undefined, // check `exec` handling of nonparticipating capturing groups
- compliantLastIndexIncrement = function () {
- var x = /^/g;
- real.test.call(x, "");
- return !x.lastIndex;
- }();
-
- if (compliantLastIndexIncrement && compliantExecNpcg)
- return;
- RegExp.prototype.exec = function (str) {
- var match = real.exec.apply(this, arguments),
- name, r2;
- if ( typeof(str) == 'string' && match) {
- if (!compliantExecNpcg && match.length > 1 && indexOf(match, "") > -1) {
- r2 = RegExp(this.source, real.replace.call(getNativeFlags(this), "g", ""));
- real.replace.call(str.slice(match.index), r2, function () {
- for (var i = 1; i < arguments.length - 2; i++) {
- if (arguments[i] === undefined)
- match[i] = undefined;
- }
- });
- }
- if (this._xregexp && this._xregexp.captureNames) {
- for (var i = 1; i < match.length; i++) {
- name = this._xregexp.captureNames[i - 1];
- if (name)
- match[name] = match[i];
- }
- }
- if (!compliantLastIndexIncrement && this.global && !match[0].length && (this.lastIndex > match.index))
- this.lastIndex--;
- }
- return match;
- };
- if (!compliantLastIndexIncrement) {
- RegExp.prototype.test = function (str) {
- var match = real.exec.call(this, str);
- if (match && this.global && !match[0].length && (this.lastIndex > match.index))
- this.lastIndex--;
- return !!match;
- };
- }
-
- function getNativeFlags (regex) {
- return (regex.global ? "g" : "") +
- (regex.ignoreCase ? "i" : "") +
- (regex.multiline ? "m" : "") +
- (regex.extended ? "x" : "") + // Proposed for ES4; included in AS3
- (regex.sticky ? "y" : "");
- }
-
- function indexOf (array, item, from) {
- if (Array.prototype.indexOf) // Use the native array method if available
- return array.indexOf(item, from);
- for (var i = from || 0; i < array.length; i++) {
- if (array[i] === item)
- return i;
- }
- return -1;
- }
-
-});
-
-define('ace/lib/es5-shim', ['require', 'exports', 'module' ], function(require, exports, module) {
-
-function Empty() {}
-
-if (!Function.prototype.bind) {
- Function.prototype.bind = function bind(that) { // .length is 1
- var target = this;
- if (typeof target != "function") {
- throw new TypeError("Function.prototype.bind called on incompatible " + target);
- }
- var args = slice.call(arguments, 1); // for normal call
- var bound = function () {
-
- if (this instanceof bound) {
-
- var result = target.apply(
- this,
- args.concat(slice.call(arguments))
- );
- if (Object(result) === result) {
- return result;
- }
- return this;
-
- } else {
- return target.apply(
- that,
- args.concat(slice.call(arguments))
- );
-
- }
-
- };
- if(target.prototype) {
- Empty.prototype = target.prototype;
- bound.prototype = new Empty();
- Empty.prototype = null;
- }
- return bound;
- };
-}
-var call = Function.prototype.call;
-var prototypeOfArray = Array.prototype;
-var prototypeOfObject = Object.prototype;
-var slice = prototypeOfArray.slice;
-var _toString = call.bind(prototypeOfObject.toString);
-var owns = call.bind(prototypeOfObject.hasOwnProperty);
-var defineGetter;
-var defineSetter;
-var lookupGetter;
-var lookupSetter;
-var supportsAccessors;
-if ((supportsAccessors = owns(prototypeOfObject, "__defineGetter__"))) {
- defineGetter = call.bind(prototypeOfObject.__defineGetter__);
- defineSetter = call.bind(prototypeOfObject.__defineSetter__);
- lookupGetter = call.bind(prototypeOfObject.__lookupGetter__);
- lookupSetter = call.bind(prototypeOfObject.__lookupSetter__);
-}
-if ([1,2].splice(0).length != 2) {
- if(function() { // test IE < 9 to splice bug - see issue #138
- function makeArray(l) {
- var a = new Array(l+2);
- a[0] = a[1] = 0;
- return a;
- }
- var array = [], lengthBefore;
-
- array.splice.apply(array, makeArray(20));
- array.splice.apply(array, makeArray(26));
-
- lengthBefore = array.length; //46
- array.splice(5, 0, "XXX"); // add one element
-
- lengthBefore + 1 == array.length
-
- if (lengthBefore + 1 == array.length) {
- return true;// has right splice implementation without bugs
- }
- }()) {//IE 6/7
- var array_splice = Array.prototype.splice;
- Array.prototype.splice = function(start, deleteCount) {
- if (!arguments.length) {
- return [];
- } else {
- return array_splice.apply(this, [
- start === void 0 ? 0 : start,
- deleteCount === void 0 ? (this.length - start) : deleteCount
- ].concat(slice.call(arguments, 2)))
- }
- };
- } else {//IE8
- Array.prototype.splice = function(pos, removeCount){
- var length = this.length;
- if (pos > 0) {
- if (pos > length)
- pos = length;
- } else if (pos == void 0) {
- pos = 0;
- } else if (pos < 0) {
- pos = Math.max(length + pos, 0);
- }
-
- if (!(pos+removeCount < length))
- removeCount = length - pos;
-
- var removed = this.slice(pos, pos+removeCount);
- var insert = slice.call(arguments, 2);
- var add = insert.length;
- if (pos === length) {
- if (add) {
- this.push.apply(this, insert);
- }
- } else {
- var remove = Math.min(removeCount, length - pos);
- var tailOldPos = pos + remove;
- var tailNewPos = tailOldPos + add - remove;
- var tailCount = length - tailOldPos;
- var lengthAfterRemove = length - remove;
-
- if (tailNewPos < tailOldPos) { // case A
- for (var i = 0; i < tailCount; ++i) {
- this[tailNewPos+i] = this[tailOldPos+i];
- }
- } else if (tailNewPos > tailOldPos) { // case B
- for (i = tailCount; i--; ) {
- this[tailNewPos+i] = this[tailOldPos+i];
- }
- } // else, add == remove (nothing to do)
-
- if (add && pos === lengthAfterRemove) {
- this.length = lengthAfterRemove; // truncate array
- this.push.apply(this, insert);
- } else {
- this.length = lengthAfterRemove + add; // reserves space
- for (i = 0; i < add; ++i) {
- this[pos+i] = insert[i];
- }
- }
- }
- return removed;
- };
- }
-}
-if (!Array.isArray) {
- Array.isArray = function isArray(obj) {
- return _toString(obj) == "[object Array]";
- };
-}
-var boxedString = Object("a"),
- splitString = boxedString[0] != "a" || !(0 in boxedString);
-
-if (!Array.prototype.forEach) {
- Array.prototype.forEach = function forEach(fun /*, thisp*/) {
- var object = toObject(this),
- self = splitString && _toString(this) == "[object String]" ?
- this.split("") :
- object,
- thisp = arguments[1],
- i = -1,
- length = self.length >>> 0;
- if (_toString(fun) != "[object Function]") {
- throw new TypeError(); // TODO message
- }
-
- while (++i < length) {
- if (i in self) {
- fun.call(thisp, self[i], i, object);
- }
- }
- };
-}
-if (!Array.prototype.map) {
- Array.prototype.map = function map(fun /*, thisp*/) {
- var object = toObject(this),
- self = splitString && _toString(this) == "[object String]" ?
- this.split("") :
- object,
- length = self.length >>> 0,
- result = Array(length),
- thisp = arguments[1];
- if (_toString(fun) != "[object Function]") {
- throw new TypeError(fun + " is not a function");
- }
-
- for (var i = 0; i < length; i++) {
- if (i in self)
- result[i] = fun.call(thisp, self[i], i, object);
- }
- return result;
- };
-}
-if (!Array.prototype.filter) {
- Array.prototype.filter = function filter(fun /*, thisp */) {
- var object = toObject(this),
- self = splitString && _toString(this) == "[object String]" ?
- this.split("") :
- object,
- length = self.length >>> 0,
- result = [],
- value,
- thisp = arguments[1];
- if (_toString(fun) != "[object Function]") {
- throw new TypeError(fun + " is not a function");
- }
-
- for (var i = 0; i < length; i++) {
- if (i in self) {
- value = self[i];
- if (fun.call(thisp, value, i, object)) {
- result.push(value);
- }
- }
- }
- return result;
- };
-}
-if (!Array.prototype.every) {
- Array.prototype.every = function every(fun /*, thisp */) {
- var object = toObject(this),
- self = splitString && _toString(this) == "[object String]" ?
- this.split("") :
- object,
- length = self.length >>> 0,
- thisp = arguments[1];
- if (_toString(fun) != "[object Function]") {
- throw new TypeError(fun + " is not a function");
- }
-
- for (var i = 0; i < length; i++) {
- if (i in self && !fun.call(thisp, self[i], i, object)) {
- return false;
- }
- }
- return true;
- };
-}
-if (!Array.prototype.some) {
- Array.prototype.some = function some(fun /*, thisp */) {
- var object = toObject(this),
- self = splitString && _toString(this) == "[object String]" ?
- this.split("") :
- object,
- length = self.length >>> 0,
- thisp = arguments[1];
- if (_toString(fun) != "[object Function]") {
- throw new TypeError(fun + " is not a function");
- }
-
- for (var i = 0; i < length; i++) {
- if (i in self && fun.call(thisp, self[i], i, object)) {
- return true;
- }
- }
- return false;
- };
-}
-if (!Array.prototype.reduce) {
- Array.prototype.reduce = function reduce(fun /*, initial*/) {
- var object = toObject(this),
- self = splitString && _toString(this) == "[object String]" ?
- this.split("") :
- object,
- length = self.length >>> 0;
- if (_toString(fun) != "[object Function]") {
- throw new TypeError(fun + " is not a function");
- }
- if (!length && arguments.length == 1) {
- throw new TypeError("reduce of empty array with no initial value");
- }
-
- var i = 0;
- var result;
- if (arguments.length >= 2) {
- result = arguments[1];
- } else {
- do {
- if (i in self) {
- result = self[i++];
- break;
- }
- if (++i >= length) {
- throw new TypeError("reduce of empty array with no initial value");
- }
- } while (true);
- }
-
- for (; i < length; i++) {
- if (i in self) {
- result = fun.call(void 0, result, self[i], i, object);
- }
- }
-
- return result;
- };
-}
-if (!Array.prototype.reduceRight) {
- Array.prototype.reduceRight = function reduceRight(fun /*, initial*/) {
- var object = toObject(this),
- self = splitString && _toString(this) == "[object String]" ?
- this.split("") :
- object,
- length = self.length >>> 0;
- if (_toString(fun) != "[object Function]") {
- throw new TypeError(fun + " is not a function");
- }
- if (!length && arguments.length == 1) {
- throw new TypeError("reduceRight of empty array with no initial value");
- }
-
- var result, i = length - 1;
- if (arguments.length >= 2) {
- result = arguments[1];
- } else {
- do {
- if (i in self) {
- result = self[i--];
- break;
- }
- if (--i < 0) {
- throw new TypeError("reduceRight of empty array with no initial value");
- }
- } while (true);
- }
-
- do {
- if (i in this) {
- result = fun.call(void 0, result, self[i], i, object);
- }
- } while (i--);
-
- return result;
- };
-}
-if (!Array.prototype.indexOf || ([0, 1].indexOf(1, 2) != -1)) {
- Array.prototype.indexOf = function indexOf(sought /*, fromIndex */ ) {
- var self = splitString && _toString(this) == "[object String]" ?
- this.split("") :
- toObject(this),
- length = self.length >>> 0;
-
- if (!length) {
- return -1;
- }
-
- var i = 0;
- if (arguments.length > 1) {
- i = toInteger(arguments[1]);
- }
- i = i >= 0 ? i : Math.max(0, length + i);
- for (; i < length; i++) {
- if (i in self && self[i] === sought) {
- return i;
- }
- }
- return -1;
- };
-}
-if (!Array.prototype.lastIndexOf || ([0, 1].lastIndexOf(0, -3) != -1)) {
- Array.prototype.lastIndexOf = function lastIndexOf(sought /*, fromIndex */) {
- var self = splitString && _toString(this) == "[object String]" ?
- this.split("") :
- toObject(this),
- length = self.length >>> 0;
-
- if (!length) {
- return -1;
- }
- var i = length - 1;
- if (arguments.length > 1) {
- i = Math.min(i, toInteger(arguments[1]));
- }
- i = i >= 0 ? i : length - Math.abs(i);
- for (; i >= 0; i--) {
- if (i in self && sought === self[i]) {
- return i;
- }
- }
- return -1;
- };
-}
-if (!Object.getPrototypeOf) {
- Object.getPrototypeOf = function getPrototypeOf(object) {
- return object.__proto__ || (
- object.constructor ?
- object.constructor.prototype :
- prototypeOfObject
- );
- };
-}
-if (!Object.getOwnPropertyDescriptor) {
- var ERR_NON_OBJECT = "Object.getOwnPropertyDescriptor called on a " +
- "non-object: ";
- Object.getOwnPropertyDescriptor = function getOwnPropertyDescriptor(object, property) {
- if ((typeof object != "object" && typeof object != "function") || object === null)
- throw new TypeError(ERR_NON_OBJECT + object);
- if (!owns(object, property))
- return;
-
- var descriptor, getter, setter;
- descriptor = { enumerable: true, configurable: true };
- if (supportsAccessors) {
- var prototype = object.__proto__;
- object.__proto__ = prototypeOfObject;
-
- var getter = lookupGetter(object, property);
- var setter = lookupSetter(object, property);
- object.__proto__ = prototype;
-
- if (getter || setter) {
- if (getter) descriptor.get = getter;
- if (setter) descriptor.set = setter;
- return descriptor;
- }
- }
- descriptor.value = object[property];
- return descriptor;
- };
-}
-if (!Object.getOwnPropertyNames) {
- Object.getOwnPropertyNames = function getOwnPropertyNames(object) {
- return Object.keys(object);
- };
-}
-if (!Object.create) {
- var createEmpty;
- if (Object.prototype.__proto__ === null) {
- createEmpty = function () {
- return { "__proto__": null };
- };
- } else {
- createEmpty = function () {
- var empty = {};
- for (var i in empty)
- empty[i] = null;
- empty.constructor =
- empty.hasOwnProperty =
- empty.propertyIsEnumerable =
- empty.isPrototypeOf =
- empty.toLocaleString =
- empty.toString =
- empty.valueOf =
- empty.__proto__ = null;
- return empty;
- }
- }
-
- Object.create = function create(prototype, properties) {
- var object;
- if (prototype === null) {
- object = createEmpty();
- } else {
- if (typeof prototype != "object")
- throw new TypeError("typeof prototype["+(typeof prototype)+"] != 'object'");
- var Type = function () {};
- Type.prototype = prototype;
- object = new Type();
- object.__proto__ = prototype;
- }
- if (properties !== void 0)
- Object.defineProperties(object, properties);
- return object;
- };
-}
-
-function doesDefinePropertyWork(object) {
- try {
- Object.defineProperty(object, "sentinel", {});
- return "sentinel" in object;
- } catch (exception) {
- }
-}
-if (Object.defineProperty) {
- var definePropertyWorksOnObject = doesDefinePropertyWork({});
- var definePropertyWorksOnDom = typeof document == "undefined" ||
- doesDefinePropertyWork(document.createElement("div"));
- if (!definePropertyWorksOnObject || !definePropertyWorksOnDom) {
- var definePropertyFallback = Object.defineProperty;
- }
-}
-
-if (!Object.defineProperty || definePropertyFallback) {
- var ERR_NON_OBJECT_DESCRIPTOR = "Property description must be an object: ";
- var ERR_NON_OBJECT_TARGET = "Object.defineProperty called on non-object: "
- var ERR_ACCESSORS_NOT_SUPPORTED = "getters & setters can not be defined " +
- "on this javascript engine";
-
- Object.defineProperty = function defineProperty(object, property, descriptor) {
- if ((typeof object != "object" && typeof object != "function") || object === null)
- throw new TypeError(ERR_NON_OBJECT_TARGET + object);
- if ((typeof descriptor != "object" && typeof descriptor != "function") || descriptor === null)
- throw new TypeError(ERR_NON_OBJECT_DESCRIPTOR + descriptor);
- if (definePropertyFallback) {
- try {
- return definePropertyFallback.call(Object, object, property, descriptor);
- } catch (exception) {
- }
- }
- if (owns(descriptor, "value")) {
-
- if (supportsAccessors && (lookupGetter(object, property) ||
- lookupSetter(object, property)))
- {
- var prototype = object.__proto__;
- object.__proto__ = prototypeOfObject;
- delete object[property];
- object[property] = descriptor.value;
- object.__proto__ = prototype;
- } else {
- object[property] = descriptor.value;
- }
- } else {
- if (!supportsAccessors)
- throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED);
- if (owns(descriptor, "get"))
- defineGetter(object, property, descriptor.get);
- if (owns(descriptor, "set"))
- defineSetter(object, property, descriptor.set);
- }
-
- return object;
- };
-}
-if (!Object.defineProperties) {
- Object.defineProperties = function defineProperties(object, properties) {
- for (var property in properties) {
- if (owns(properties, property))
- Object.defineProperty(object, property, properties[property]);
- }
- return object;
- };
-}
-if (!Object.seal) {
- Object.seal = function seal(object) {
- return object;
- };
-}
-if (!Object.freeze) {
- Object.freeze = function freeze(object) {
- return object;
- };
-}
-try {
- Object.freeze(function () {});
-} catch (exception) {
- Object.freeze = (function freeze(freezeObject) {
- return function freeze(object) {
- if (typeof object == "function") {
- return object;
- } else {
- return freezeObject(object);
- }
- };
- })(Object.freeze);
-}
-if (!Object.preventExtensions) {
- Object.preventExtensions = function preventExtensions(object) {
- return object;
- };
-}
-if (!Object.isSealed) {
- Object.isSealed = function isSealed(object) {
- return false;
- };
-}
-if (!Object.isFrozen) {
- Object.isFrozen = function isFrozen(object) {
- return false;
- };
-}
-if (!Object.isExtensible) {
- Object.isExtensible = function isExtensible(object) {
- if (Object(object) === object) {
- throw new TypeError(); // TODO message
- }
- var name = '';
- while (owns(object, name)) {
- name += '?';
- }
- object[name] = true;
- var returnValue = owns(object, name);
- delete object[name];
- return returnValue;
- };
-}
-if (!Object.keys) {
- var hasDontEnumBug = true,
- dontEnums = [
- "toString",
- "toLocaleString",
- "valueOf",
- "hasOwnProperty",
- "isPrototypeOf",
- "propertyIsEnumerable",
- "constructor"
- ],
- dontEnumsLength = dontEnums.length;
-
- for (var key in {"toString": null}) {
- hasDontEnumBug = false;
- }
-
- Object.keys = function keys(object) {
-
- if (
- (typeof object != "object" && typeof object != "function") ||
- object === null
- ) {
- throw new TypeError("Object.keys called on a non-object");
- }
-
- var keys = [];
- for (var name in object) {
- if (owns(object, name)) {
- keys.push(name);
- }
- }
-
- if (hasDontEnumBug) {
- for (var i = 0, ii = dontEnumsLength; i < ii; i++) {
- var dontEnum = dontEnums[i];
- if (owns(object, dontEnum)) {
- keys.push(dontEnum);
- }
- }
- }
- return keys;
- };
-
-}
-if (!Date.now) {
- Date.now = function now() {
- return new Date().getTime();
- };
-}
-if("0".split(void 0, 0).length) {
- var string_split = String.prototype.split;
- String.prototype.split = function(separator, limit) {
- if(separator === void 0 && limit === 0)return [];
- return string_split.apply(this, arguments);
- }
-}
-if("".substr && "0b".substr(-1) !== "b") {
- var string_substr = String.prototype.substr;
- String.prototype.substr = function(start, length) {
- return string_substr.call(
- this,
- start < 0 ? (start = this.length + start) < 0 ? 0 : start : start,
- length
- );
- }
-}
-var ws = "\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003" +
- "\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028" +
- "\u2029\uFEFF";
-if (!String.prototype.trim || ws.trim()) {
- ws = "[" + ws + "]";
- var trimBeginRegexp = new RegExp("^" + ws + ws + "*"),
- trimEndRegexp = new RegExp(ws + ws + "*$");
- String.prototype.trim = function trim() {
- if (this === undefined || this === null) {
- throw new TypeError("can't convert "+this+" to object");
- }
- return String(this)
- .replace(trimBeginRegexp, "")
- .replace(trimEndRegexp, "");
- };
-}
-
-function toInteger(n) {
- n = +n;
- if (n !== n) { // isNaN
- n = 0;
- } else if (n !== 0 && n !== (1/0) && n !== -(1/0)) {
- n = (n > 0 || -1) * Math.floor(Math.abs(n));
- }
- return n;
-}
-
-function isPrimitive(input) {
- var type = typeof input;
- return (
- input === null ||
- type === "undefined" ||
- type === "boolean" ||
- type === "number" ||
- type === "string"
- );
-}
-
-function toPrimitive(input) {
- var val, valueOf, toString;
- if (isPrimitive(input)) {
- return input;
- }
- valueOf = input.valueOf;
- if (typeof valueOf === "function") {
- val = valueOf.call(input);
- if (isPrimitive(val)) {
- return val;
- }
- }
- toString = input.toString;
- if (typeof toString === "function") {
- val = toString.call(input);
- if (isPrimitive(val)) {
- return val;
- }
- }
- throw new TypeError();
-}
-var toObject = function (o) {
- if (o == null) { // this matches both null and undefined
- throw new TypeError("can't convert "+o+" to object");
- }
- return Object(o);
-};
-
-});
-
-define('ace/lib/event_emitter', ['require', 'exports', 'module' ], function(require, exports, module) {
-
-
-var EventEmitter = {};
-
-EventEmitter._emit =
-EventEmitter._dispatchEvent = function(eventName, e) {
- this._eventRegistry = this._eventRegistry || {};
- this._defaultHandlers = this._defaultHandlers || {};
-
- var listeners = this._eventRegistry[eventName] || [];
- var defaultHandler = this._defaultHandlers[eventName];
- if (!listeners.length && !defaultHandler)
- return;
-
- if (typeof e != "object" || !e)
- e = {};
-
- if (!e.type)
- e.type = eventName;
-
- if (!e.stopPropagation) {
- e.stopPropagation = function() {
- this.propagationStopped = true;
- };
- }
-
- if (!e.preventDefault) {
- e.preventDefault = function() {
- this.defaultPrevented = true;
- };
- }
-
- for (var i=0; i
= length) {
- position.row = Math.max(0, length - 1);
- position.column = this.getLine(length-1).length;
- }
- return position;
- };
- this.insert = function(position, text) {
- if (!text || text.length === 0)
- return position;
-
- position = this.$clipPosition(position);
- if (this.getLength() <= 1)
- this.$detectNewLine(text);
-
- var lines = this.$split(text);
- var firstLine = lines.splice(0, 1)[0];
- var lastLine = lines.length == 0 ? null : lines.splice(lines.length - 1, 1)[0];
-
- position = this.insertInLine(position, firstLine);
- if (lastLine !== null) {
- position = this.insertNewLine(position); // terminate first line
- position = this.insertLines(position.row, lines);
- position = this.insertInLine(position, lastLine || "");
- }
- return position;
- };
- this.insertLines = function(row, lines) {
- if (lines.length == 0)
- return {row: row, column: 0};
- if (lines.length > 0xFFFF) {
- var end = this.insertLines(row, lines.slice(0xFFFF));
- lines = lines.slice(0, 0xFFFF);
- }
-
- var args = [row, 0];
- args.push.apply(args, lines);
- this.$lines.splice.apply(this.$lines, args);
-
- var range = new Range(row, 0, row + lines.length, 0);
- var delta = {
- action: "insertLines",
- range: range,
- lines: lines
- };
- this._emit("change", { data: delta });
- return end || range.end;
- };
- this.insertNewLine = function(position) {
- position = this.$clipPosition(position);
- var line = this.$lines[position.row] || "";
-
- this.$lines[position.row] = line.substring(0, position.column);
- this.$lines.splice(position.row + 1, 0, line.substring(position.column, line.length));
-
- var end = {
- row : position.row + 1,
- column : 0
- };
-
- var delta = {
- action: "insertText",
- range: Range.fromPoints(position, end),
- text: this.getNewLineCharacter()
- };
- this._emit("change", { data: delta });
-
- return end;
- };
- this.insertInLine = function(position, text) {
- if (text.length == 0)
- return position;
-
- var line = this.$lines[position.row] || "";
-
- this.$lines[position.row] = line.substring(0, position.column) + text
- + line.substring(position.column);
-
- var end = {
- row : position.row,
- column : position.column + text.length
- };
-
- var delta = {
- action: "insertText",
- range: Range.fromPoints(position, end),
- text: text
- };
- this._emit("change", { data: delta });
-
- return end;
- };
- this.remove = function(range) {
- range.start = this.$clipPosition(range.start);
- range.end = this.$clipPosition(range.end);
-
- if (range.isEmpty())
- return range.start;
-
- var firstRow = range.start.row;
- var lastRow = range.end.row;
-
- if (range.isMultiLine()) {
- var firstFullRow = range.start.column == 0 ? firstRow : firstRow + 1;
- var lastFullRow = lastRow - 1;
-
- if (range.end.column > 0)
- this.removeInLine(lastRow, 0, range.end.column);
-
- if (lastFullRow >= firstFullRow)
- this.removeLines(firstFullRow, lastFullRow);
-
- if (firstFullRow != firstRow) {
- this.removeInLine(firstRow, range.start.column, this.getLine(firstRow).length);
- this.removeNewLine(range.start.row);
- }
- }
- else {
- this.removeInLine(firstRow, range.start.column, range.end.column);
- }
- return range.start;
- };
- this.removeInLine = function(row, startColumn, endColumn) {
- if (startColumn == endColumn)
- return;
-
- var range = new Range(row, startColumn, row, endColumn);
- var line = this.getLine(row);
- var removed = line.substring(startColumn, endColumn);
- var newLine = line.substring(0, startColumn) + line.substring(endColumn, line.length);
- this.$lines.splice(row, 1, newLine);
-
- var delta = {
- action: "removeText",
- range: range,
- text: removed
- };
- this._emit("change", { data: delta });
- return range.start;
- };
- this.removeLines = function(firstRow, lastRow) {
- var range = new Range(firstRow, 0, lastRow + 1, 0);
- var removed = this.$lines.splice(firstRow, lastRow - firstRow + 1);
-
- var delta = {
- action: "removeLines",
- range: range,
- nl: this.getNewLineCharacter(),
- lines: removed
- };
- this._emit("change", { data: delta });
- return removed;
- };
- this.removeNewLine = function(row) {
- var firstLine = this.getLine(row);
- var secondLine = this.getLine(row+1);
-
- var range = new Range(row, firstLine.length, row+1, 0);
- var line = firstLine + secondLine;
-
- this.$lines.splice(row, 2, line);
-
- var delta = {
- action: "removeText",
- range: range,
- text: this.getNewLineCharacter()
- };
- this._emit("change", { data: delta });
- };
- this.replace = function(range, text) {
- if (text.length == 0 && range.isEmpty())
- return range.start;
- if (text == this.getTextRange(range))
- return range.end;
-
- this.remove(range);
- if (text) {
- var end = this.insert(range.start, text);
- }
- else {
- end = range.start;
- }
-
- return end;
- };
- this.applyDeltas = function(deltas) {
- for (var i=0; i=0; i--) {
- var delta = deltas[i];
-
- var range = Range.fromPoints(delta.range.start, delta.range.end);
-
- if (delta.action == "insertLines")
- this.removeLines(range.start.row, range.end.row - 1);
- else if (delta.action == "insertText")
- this.remove(range);
- else if (delta.action == "removeLines")
- this.insertLines(range.start.row, delta.lines);
- else if (delta.action == "removeText")
- this.insert(range.start, delta.text);
- }
- };
- this.indexToPosition = function(index, startRow) {
- var lines = this.$lines || this.getAllLines();
- var newlineLength = this.getNewLineCharacter().length;
- for (var i = startRow || 0, l = lines.length; i < l; i++) {
- index -= lines[i].length + newlineLength;
- if (index < 0)
- return {row: i, column: index + lines[i].length + newlineLength};
- }
- return {row: l-1, column: lines[l-1].length};
- };
- this.positionToIndex = function(pos, startRow) {
- var lines = this.$lines || this.getAllLines();
- var newlineLength = this.getNewLineCharacter().length;
- var index = 0;
- var row = Math.min(pos.row, lines.length);
- for (var i = startRow || 0; i < row; ++i)
- index += lines[i].length;
-
- return index + newlineLength * i + pos.column;
- };
-
-}).call(Document.prototype);
-
-exports.Document = Document;
-});
-
-define('ace/range', ['require', 'exports', 'module' ], function(require, exports, module) {
-var Range = function(startRow, startColumn, endRow, endColumn) {
- this.start = {
- row: startRow,
- column: startColumn
- };
-
- this.end = {
- row: endRow,
- column: endColumn
- };
-};
-
-(function() {
- this.isEqual = function(range) {
- return this.start.row == range.start.row &&
- this.end.row == range.end.row &&
- this.start.column == range.start.column &&
- this.end.column == range.end.column
- };
- this.toString = function() {
- return ("Range: [" + this.start.row + "/" + this.start.column +
- "] -> [" + this.end.row + "/" + this.end.column + "]");
- };
-
- this.contains = function(row, column) {
- return this.compare(row, column) == 0;
- };
- this.compareRange = function(range) {
- var cmp,
- end = range.end,
- start = range.start;
-
- cmp = this.compare(end.row, end.column);
- if (cmp == 1) {
- cmp = this.compare(start.row, start.column);
- if (cmp == 1) {
- return 2;
- } else if (cmp == 0) {
- return 1;
- } else {
- return 0;
- }
- } else if (cmp == -1) {
- return -2;
- } else {
- cmp = this.compare(start.row, start.column);
- if (cmp == -1) {
- return -1;
- } else if (cmp == 1) {
- return 42;
- } else {
- return 0;
- }
- }
- };
- this.comparePoint = function(p) {
- return this.compare(p.row, p.column);
- };
- this.containsRange = function(range) {
- return this.comparePoint(range.start) == 0 && this.comparePoint(range.end) == 0;
- };
- this.intersects = function(range) {
- var cmp = this.compareRange(range);
- return (cmp == -1 || cmp == 0 || cmp == 1);
- };
- this.isEnd = function(row, column) {
- return this.end.row == row && this.end.column == column;
- };
- this.isStart = function(row, column) {
- return this.start.row == row && this.start.column == column;
- };
- this.setStart = function(row, column) {
- if (typeof row == "object") {
- this.start.column = row.column;
- this.start.row = row.row;
- } else {
- this.start.row = row;
- this.start.column = column;
- }
- };
- this.setEnd = function(row, column) {
- if (typeof row == "object") {
- this.end.column = row.column;
- this.end.row = row.row;
- } else {
- this.end.row = row;
- this.end.column = column;
- }
- };
- this.inside = function(row, column) {
- if (this.compare(row, column) == 0) {
- if (this.isEnd(row, column) || this.isStart(row, column)) {
- return false;
- } else {
- return true;
- }
- }
- return false;
- };
- this.insideStart = function(row, column) {
- if (this.compare(row, column) == 0) {
- if (this.isEnd(row, column)) {
- return false;
- } else {
- return true;
- }
- }
- return false;
- };
- this.insideEnd = function(row, column) {
- if (this.compare(row, column) == 0) {
- if (this.isStart(row, column)) {
- return false;
- } else {
- return true;
- }
- }
- return false;
- };
- this.compare = function(row, column) {
- if (!this.isMultiLine()) {
- if (row === this.start.row) {
- return column < this.start.column ? -1 : (column > this.end.column ? 1 : 0);
- };
- }
-
- if (row < this.start.row)
- return -1;
-
- if (row > this.end.row)
- return 1;
-
- if (this.start.row === row)
- return column >= this.start.column ? 0 : -1;
-
- if (this.end.row === row)
- return column <= this.end.column ? 0 : 1;
-
- return 0;
- };
- this.compareStart = function(row, column) {
- if (this.start.row == row && this.start.column == column) {
- return -1;
- } else {
- return this.compare(row, column);
- }
- };
- this.compareEnd = function(row, column) {
- if (this.end.row == row && this.end.column == column) {
- return 1;
- } else {
- return this.compare(row, column);
- }
- };
- this.compareInside = function(row, column) {
- if (this.end.row == row && this.end.column == column) {
- return 1;
- } else if (this.start.row == row && this.start.column == column) {
- return -1;
- } else {
- return this.compare(row, column);
- }
- };
- this.clipRows = function(firstRow, lastRow) {
- if (this.end.row > lastRow) {
- var end = {
- row: lastRow+1,
- column: 0
- };
- }
-
- if (this.start.row > lastRow) {
- var start = {
- row: lastRow+1,
- column: 0
- };
- }
-
- if (this.start.row < firstRow) {
- var start = {
- row: firstRow,
- column: 0
- };
- }
-
- if (this.end.row < firstRow) {
- var end = {
- row: firstRow,
- column: 0
- };
- }
- return Range.fromPoints(start || this.start, end || this.end);
- };
- this.extend = function(row, column) {
- var cmp = this.compare(row, column);
-
- if (cmp == 0)
- return this;
- else if (cmp == -1)
- var start = {row: row, column: column};
- else
- var end = {row: row, column: column};
-
- return Range.fromPoints(start || this.start, end || this.end);
- };
-
- this.isEmpty = function() {
- return (this.start.row == this.end.row && this.start.column == this.end.column);
- };
- this.isMultiLine = function() {
- return (this.start.row !== this.end.row);
- };
- this.clone = function() {
- return Range.fromPoints(this.start, this.end);
- };
- this.collapseRows = function() {
- if (this.end.column == 0)
- return new Range(this.start.row, 0, Math.max(this.start.row, this.end.row-1), 0)
- else
- return new Range(this.start.row, 0, this.end.row, 0)
- };
- this.toScreenRange = function(session) {
- var screenPosStart =
- session.documentToScreenPosition(this.start);
- var screenPosEnd =
- session.documentToScreenPosition(this.end);
-
- return new Range(
- screenPosStart.row, screenPosStart.column,
- screenPosEnd.row, screenPosEnd.column
- );
- };
-
-}).call(Range.prototype);
-Range.fromPoints = function(start, end) {
- return new Range(start.row, start.column, end.row, end.column);
-};
-
-exports.Range = Range;
-});
-
-define('ace/anchor', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/event_emitter'], function(require, exports, module) {
-
-
-var oop = require("./lib/oop");
-var EventEmitter = require("./lib/event_emitter").EventEmitter;
-
-var Anchor = exports.Anchor = function(doc, row, column) {
- this.document = doc;
-
- if (typeof column == "undefined")
- this.setPosition(row.row, row.column);
- else
- this.setPosition(row, column);
-
- this.$onChange = this.onChange.bind(this);
- doc.on("change", this.$onChange);
-};
-
-(function() {
-
- oop.implement(this, EventEmitter);
-
- this.getPosition = function() {
- return this.$clipPositionToDocument(this.row, this.column);
- };
-
- this.getDocument = function() {
- return this.document;
- };
-
- this.onChange = function(e) {
- var delta = e.data;
- var range = delta.range;
-
- if (range.start.row == range.end.row && range.start.row != this.row)
- return;
-
- if (range.start.row > this.row)
- return;
-
- if (range.start.row == this.row && range.start.column > this.column)
- return;
-
- var row = this.row;
- var column = this.column;
-
- if (delta.action === "insertText") {
- if (range.start.row === row && range.start.column <= column) {
- if (range.start.row === range.end.row) {
- column += range.end.column - range.start.column;
- }
- else {
- column -= range.start.column;
- row += range.end.row - range.start.row;
- }
- }
- else if (range.start.row !== range.end.row && range.start.row < row) {
- row += range.end.row - range.start.row;
- }
- } else if (delta.action === "insertLines") {
- if (range.start.row <= row) {
- row += range.end.row - range.start.row;
- }
- }
- else if (delta.action == "removeText") {
- if (range.start.row == row && range.start.column < column) {
- if (range.end.column >= column)
- column = range.start.column;
- else
- column = Math.max(0, column - (range.end.column - range.start.column));
-
- } else if (range.start.row !== range.end.row && range.start.row < row) {
- if (range.end.row == row) {
- column = Math.max(0, column - range.end.column) + range.start.column;
- }
- row -= (range.end.row - range.start.row);
- }
- else if (range.end.row == row) {
- row -= range.end.row - range.start.row;
- column = Math.max(0, column - range.end.column) + range.start.column;
- }
- } else if (delta.action == "removeLines") {
- if (range.start.row <= row) {
- if (range.end.row <= row)
- row -= range.end.row - range.start.row;
- else {
- row = range.start.row;
- column = 0;
- }
- }
- }
-
- this.setPosition(row, column, true);
- };
-
- this.setPosition = function(row, column, noClip) {
- var pos;
- if (noClip) {
- pos = {
- row: row,
- column: column
- };
- }
- else {
- pos = this.$clipPositionToDocument(row, column);
- }
-
- if (this.row == pos.row && this.column == pos.column)
- return;
-
- var old = {
- row: this.row,
- column: this.column
- };
-
- this.row = pos.row;
- this.column = pos.column;
- this._emit("change", {
- old: old,
- value: pos
- });
- };
-
- this.detach = function() {
- this.document.removeEventListener("change", this.$onChange);
- };
- this.$clipPositionToDocument = function(row, column) {
- var pos = {};
-
- if (row >= this.document.getLength()) {
- pos.row = Math.max(0, this.document.getLength() - 1);
- pos.column = this.document.getLine(pos.row).length;
- }
- else if (row < 0) {
- pos.row = 0;
- pos.column = 0;
- }
- else {
- pos.row = row;
- pos.column = Math.min(this.document.getLine(pos.row).length, Math.max(0, column));
- }
-
- if (column < 0)
- pos.column = 0;
-
- return pos;
- };
-
-}).call(Anchor.prototype);
-
-});
-
-define('ace/lib/lang', ['require', 'exports', 'module' ], function(require, exports, module) {
-
-
-exports.stringReverse = function(string) {
- return string.split("").reverse().join("");
-};
-
-exports.stringRepeat = function (string, count) {
- var result = '';
- while (count > 0) {
- if (count & 1)
- result += string;
-
- if (count >>= 1)
- string += string;
- }
- return result;
-};
-
-var trimBeginRegexp = /^\s\s*/;
-var trimEndRegexp = /\s\s*$/;
-
-exports.stringTrimLeft = function (string) {
- return string.replace(trimBeginRegexp, '');
-};
-
-exports.stringTrimRight = function (string) {
- return string.replace(trimEndRegexp, '');
-};
-
-exports.copyObject = function(obj) {
- var copy = {};
- for (var key in obj) {
- copy[key] = obj[key];
- }
- return copy;
-};
-
-exports.copyArray = function(array){
- var copy = [];
- for (var i=0, l=array.length; i= 0 || __indexOf.call(COFFEE_KEYWORDS, id) >= 0)) {
- tag = id.toUpperCase();
- if (tag === 'WHEN' && (_ref3 = this.tag(), __indexOf.call(LINE_BREAK, _ref3) >= 0)) {
- tag = 'LEADING_WHEN';
- } else if (tag === 'FOR') {
- this.seenFor = true;
- } else if (tag === 'UNLESS') {
- tag = 'IF';
- } else if (__indexOf.call(UNARY, tag) >= 0) {
- tag = 'UNARY';
- } else if (__indexOf.call(RELATION, tag) >= 0) {
- if (tag !== 'INSTANCEOF' && this.seenFor) {
- tag = 'FOR' + tag;
- this.seenFor = false;
- } else {
- tag = 'RELATION';
- if (this.value() === '!') {
- this.tokens.pop();
- id = '!' + id;
- }
- }
- }
- }
- if (__indexOf.call(JS_FORBIDDEN, id) >= 0) {
- if (forcedIdentifier) {
- tag = 'IDENTIFIER';
- id = new String(id);
- id.reserved = true;
- } else if (__indexOf.call(RESERVED, id) >= 0) {
- this.error("reserved word \"" + id + "\"");
- }
- }
- if (!forcedIdentifier) {
- if (__indexOf.call(COFFEE_ALIASES, id) >= 0) {
- id = COFFEE_ALIAS_MAP[id];
- }
- tag = (function() {
- switch (id) {
- case '!':
- return 'UNARY';
- case '==':
- case '!=':
- return 'COMPARE';
- case '&&':
- case '||':
- return 'LOGIC';
- case 'true':
- case 'false':
- return 'BOOL';
- case 'break':
- case 'continue':
- return 'STATEMENT';
- default:
- return tag;
- }
- })();
- }
- this.token(tag, id);
- if (colon) {
- this.token(':', ':');
- }
- return input.length;
- };
-
- Lexer.prototype.numberToken = function() {
- var binaryLiteral, lexedLength, match, number, octalLiteral;
- if (!(match = NUMBER.exec(this.chunk))) {
- return 0;
- }
- number = match[0];
- if (/^0[BOX]/.test(number)) {
- this.error("radix prefix '" + number + "' must be lowercase");
- } else if (/E/.test(number) && !/^0x/.test(number)) {
- this.error("exponential notation '" + number + "' must be indicated with a lowercase 'e'");
- } else if (/^0\d*[89]/.test(number)) {
- this.error("decimal literal '" + number + "' must not be prefixed with '0'");
- } else if (/^0\d+/.test(number)) {
- this.error("octal literal '" + number + "' must be prefixed with '0o'");
- }
- lexedLength = number.length;
- if (octalLiteral = /^0o([0-7]+)/.exec(number)) {
- number = '0x' + (parseInt(octalLiteral[1], 8)).toString(16);
- }
- if (binaryLiteral = /^0b([01]+)/.exec(number)) {
- number = '0x' + (parseInt(binaryLiteral[1], 2)).toString(16);
- }
- this.token('NUMBER', number);
- return lexedLength;
- };
-
- Lexer.prototype.stringToken = function() {
- var match, octalEsc, string;
- switch (this.chunk.charAt(0)) {
- case "'":
- if (!(match = SIMPLESTR.exec(this.chunk))) {
- return 0;
- }
- this.token('STRING', (string = match[0]).replace(MULTILINER, '\\\n'));
- break;
- case '"':
- if (!(string = this.balancedString(this.chunk, '"'))) {
- return 0;
- }
- if (0 < string.indexOf('#{', 1)) {
- this.interpolateString(string.slice(1, -1));
- } else {
- this.token('STRING', this.escapeLines(string));
- }
- break;
- default:
- return 0;
- }
- if (octalEsc = /^(?:\\.|[^\\])*\\(?:0[0-7]|[1-7])/.test(string)) {
- this.error("octal escape sequences " + string + " are not allowed");
- }
- this.line += count(string, '\n');
- return string.length;
- };
-
- Lexer.prototype.heredocToken = function() {
- var doc, heredoc, match, quote;
- if (!(match = HEREDOC.exec(this.chunk))) {
- return 0;
- }
- heredoc = match[0];
- quote = heredoc.charAt(0);
- doc = this.sanitizeHeredoc(match[2], {
- quote: quote,
- indent: null
- });
- if (quote === '"' && 0 <= doc.indexOf('#{')) {
- this.interpolateString(doc, {
- heredoc: true
- });
- } else {
- this.token('STRING', this.makeString(doc, quote, true));
- }
- this.line += count(heredoc, '\n');
- return heredoc.length;
- };
-
- Lexer.prototype.commentToken = function() {
- var comment, here, match;
- if (!(match = this.chunk.match(COMMENT))) {
- return 0;
- }
- comment = match[0], here = match[1];
- if (here) {
- this.token('HERECOMMENT', this.sanitizeHeredoc(here, {
- herecomment: true,
- indent: Array(this.indent + 1).join(' ')
- }));
- }
- this.line += count(comment, '\n');
- return comment.length;
- };
-
- Lexer.prototype.jsToken = function() {
- var match, script;
- if (!(this.chunk.charAt(0) === '`' && (match = JSTOKEN.exec(this.chunk)))) {
- return 0;
- }
- this.token('JS', (script = match[0]).slice(1, -1));
- this.line += count(script, '\n');
- return script.length;
- };
-
- Lexer.prototype.regexToken = function() {
- var flags, length, match, prev, regex, _ref2, _ref3;
- if (this.chunk.charAt(0) !== '/') {
- return 0;
- }
- if (match = HEREGEX.exec(this.chunk)) {
- length = this.heregexToken(match);
- this.line += count(match[0], '\n');
- return length;
- }
- prev = last(this.tokens);
- if (prev && (_ref2 = prev[0], __indexOf.call((prev.spaced ? NOT_REGEX : NOT_SPACED_REGEX), _ref2) >= 0)) {
- return 0;
- }
- if (!(match = REGEX.exec(this.chunk))) {
- return 0;
- }
- _ref3 = match, match = _ref3[0], regex = _ref3[1], flags = _ref3[2];
- if (regex.slice(0, 2) === '/*') {
- this.error('regular expressions cannot begin with `*`');
- }
- if (regex === '//') {
- regex = '/(?:)/';
- }
- this.token('REGEX', "" + regex + flags);
- return match.length;
- };
-
- Lexer.prototype.heregexToken = function(match) {
- var body, flags, heregex, re, tag, tokens, value, _i, _len, _ref2, _ref3, _ref4, _ref5;
- heregex = match[0], body = match[1], flags = match[2];
- if (0 > body.indexOf('#{')) {
- re = body.replace(HEREGEX_OMIT, '').replace(/\//g, '\\/');
- if (re.match(/^\*/)) {
- this.error('regular expressions cannot begin with `*`');
- }
- this.token('REGEX', "/" + (re || '(?:)') + "/" + flags);
- return heregex.length;
- }
- this.token('IDENTIFIER', 'RegExp');
- this.tokens.push(['CALL_START', '(']);
- tokens = [];
- _ref2 = this.interpolateString(body, {
- regex: true
- });
- for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
- _ref3 = _ref2[_i], tag = _ref3[0], value = _ref3[1];
- if (tag === 'TOKENS') {
- tokens.push.apply(tokens, value);
- } else {
- if (!(value = value.replace(HEREGEX_OMIT, ''))) {
- continue;
- }
- value = value.replace(/\\/g, '\\\\');
- tokens.push(['STRING', this.makeString(value, '"', true)]);
- }
- tokens.push(['+', '+']);
- }
- tokens.pop();
- if (((_ref4 = tokens[0]) != null ? _ref4[0] : void 0) !== 'STRING') {
- this.tokens.push(['STRING', '""'], ['+', '+']);
- }
- (_ref5 = this.tokens).push.apply(_ref5, tokens);
- if (flags) {
- this.tokens.push([',', ','], ['STRING', '"' + flags + '"']);
- }
- this.token(')', ')');
- return heregex.length;
- };
-
- Lexer.prototype.lineToken = function() {
- var diff, indent, match, noNewlines, size;
- if (!(match = MULTI_DENT.exec(this.chunk))) {
- return 0;
- }
- indent = match[0];
- this.line += count(indent, '\n');
- this.seenFor = false;
- size = indent.length - 1 - indent.lastIndexOf('\n');
- noNewlines = this.unfinished();
- if (size - this.indebt === this.indent) {
- if (noNewlines) {
- this.suppressNewlines();
- } else {
- this.newlineToken();
- }
- return indent.length;
- }
- if (size > this.indent) {
- if (noNewlines) {
- this.indebt = size - this.indent;
- this.suppressNewlines();
- return indent.length;
- }
- diff = size - this.indent + this.outdebt;
- this.token('INDENT', diff);
- this.indents.push(diff);
- this.ends.push('OUTDENT');
- this.outdebt = this.indebt = 0;
- } else {
- this.indebt = 0;
- this.outdentToken(this.indent - size, noNewlines);
- }
- this.indent = size;
- return indent.length;
- };
-
- Lexer.prototype.outdentToken = function(moveOut, noNewlines) {
- var dent, len;
- while (moveOut > 0) {
- len = this.indents.length - 1;
- if (this.indents[len] === void 0) {
- moveOut = 0;
- } else if (this.indents[len] === this.outdebt) {
- moveOut -= this.outdebt;
- this.outdebt = 0;
- } else if (this.indents[len] < this.outdebt) {
- this.outdebt -= this.indents[len];
- moveOut -= this.indents[len];
- } else {
- dent = this.indents.pop() - this.outdebt;
- moveOut -= dent;
- this.outdebt = 0;
- this.pair('OUTDENT');
- this.token('OUTDENT', dent);
- }
- }
- if (dent) {
- this.outdebt -= moveOut;
- }
- while (this.value() === ';') {
- this.tokens.pop();
- }
- if (!(this.tag() === 'TERMINATOR' || noNewlines)) {
- this.token('TERMINATOR', '\n');
- }
- return this;
- };
-
- Lexer.prototype.whitespaceToken = function() {
- var match, nline, prev;
- if (!((match = WHITESPACE.exec(this.chunk)) || (nline = this.chunk.charAt(0) === '\n'))) {
- return 0;
- }
- prev = last(this.tokens);
- if (prev) {
- prev[match ? 'spaced' : 'newLine'] = true;
- }
- if (match) {
- return match[0].length;
- } else {
- return 0;
- }
- };
-
- Lexer.prototype.newlineToken = function() {
- while (this.value() === ';') {
- this.tokens.pop();
- }
- if (this.tag() !== 'TERMINATOR') {
- this.token('TERMINATOR', '\n');
- }
- return this;
- };
-
- Lexer.prototype.suppressNewlines = function() {
- if (this.value() === '\\') {
- this.tokens.pop();
- }
- return this;
- };
-
- Lexer.prototype.literalToken = function() {
- var match, prev, tag, value, _ref2, _ref3, _ref4, _ref5;
- if (match = OPERATOR.exec(this.chunk)) {
- value = match[0];
- if (CODE.test(value)) {
- this.tagParameters();
- }
- } else {
- value = this.chunk.charAt(0);
- }
- tag = value;
- prev = last(this.tokens);
- if (value === '=' && prev) {
- if (!prev[1].reserved && (_ref2 = prev[1], __indexOf.call(JS_FORBIDDEN, _ref2) >= 0)) {
- this.error("reserved word \"" + (this.value()) + "\" can't be assigned");
- }
- if ((_ref3 = prev[1]) === '||' || _ref3 === '&&') {
- prev[0] = 'COMPOUND_ASSIGN';
- prev[1] += '=';
- return value.length;
- }
- }
- if (value === ';') {
- this.seenFor = false;
- tag = 'TERMINATOR';
- } else if (__indexOf.call(MATH, value) >= 0) {
- tag = 'MATH';
- } else if (__indexOf.call(COMPARE, value) >= 0) {
- tag = 'COMPARE';
- } else if (__indexOf.call(COMPOUND_ASSIGN, value) >= 0) {
- tag = 'COMPOUND_ASSIGN';
- } else if (__indexOf.call(UNARY, value) >= 0) {
- tag = 'UNARY';
- } else if (__indexOf.call(SHIFT, value) >= 0) {
- tag = 'SHIFT';
- } else if (__indexOf.call(LOGIC, value) >= 0 || value === '?' && (prev != null ? prev.spaced : void 0)) {
- tag = 'LOGIC';
- } else if (prev && !prev.spaced) {
- if (value === '(' && (_ref4 = prev[0], __indexOf.call(CALLABLE, _ref4) >= 0)) {
- if (prev[0] === '?') {
- prev[0] = 'FUNC_EXIST';
- }
- tag = 'CALL_START';
- } else if (value === '[' && (_ref5 = prev[0], __indexOf.call(INDEXABLE, _ref5) >= 0)) {
- tag = 'INDEX_START';
- switch (prev[0]) {
- case '?':
- prev[0] = 'INDEX_SOAK';
- }
- }
- }
- switch (value) {
- case '(':
- case '{':
- case '[':
- this.ends.push(INVERSES[value]);
- break;
- case ')':
- case '}':
- case ']':
- this.pair(value);
- }
- this.token(tag, value);
- return value.length;
- };
-
- Lexer.prototype.sanitizeHeredoc = function(doc, options) {
- var attempt, herecomment, indent, match, _ref2;
- indent = options.indent, herecomment = options.herecomment;
- if (herecomment) {
- if (HEREDOC_ILLEGAL.test(doc)) {
- this.error("block comment cannot contain \"*/\", starting");
- }
- if (doc.indexOf('\n') <= 0) {
- return doc;
- }
- } else {
- while (match = HEREDOC_INDENT.exec(doc)) {
- attempt = match[1];
- if (indent === null || (0 < (_ref2 = attempt.length) && _ref2 < indent.length)) {
- indent = attempt;
- }
- }
- }
- if (indent) {
- doc = doc.replace(RegExp("\\n" + indent, "g"), '\n');
- }
- if (!herecomment) {
- doc = doc.replace(/^\n/, '');
- }
- return doc;
- };
-
- Lexer.prototype.tagParameters = function() {
- var i, stack, tok, tokens;
- if (this.tag() !== ')') {
- return this;
- }
- stack = [];
- tokens = this.tokens;
- i = tokens.length;
- tokens[--i][0] = 'PARAM_END';
- while (tok = tokens[--i]) {
- switch (tok[0]) {
- case ')':
- stack.push(tok);
- break;
- case '(':
- case 'CALL_START':
- if (stack.length) {
- stack.pop();
- } else if (tok[0] === '(') {
- tok[0] = 'PARAM_START';
- return this;
- } else {
- return this;
- }
- }
- }
- return this;
- };
-
- Lexer.prototype.closeIndentation = function() {
- return this.outdentToken(this.indent);
- };
-
- Lexer.prototype.balancedString = function(str, end) {
- var continueCount, i, letter, match, prev, stack, _i, _ref2;
- continueCount = 0;
- stack = [end];
- for (i = _i = 1, _ref2 = str.length; 1 <= _ref2 ? _i < _ref2 : _i > _ref2; i = 1 <= _ref2 ? ++_i : --_i) {
- if (continueCount) {
- --continueCount;
- continue;
- }
- switch (letter = str.charAt(i)) {
- case '\\':
- ++continueCount;
- continue;
- case end:
- stack.pop();
- if (!stack.length) {
- return str.slice(0, +i + 1 || 9e9);
- }
- end = stack[stack.length - 1];
- continue;
- }
- if (end === '}' && (letter === '"' || letter === "'")) {
- stack.push(end = letter);
- } else if (end === '}' && letter === '/' && (match = HEREGEX.exec(str.slice(i)) || REGEX.exec(str.slice(i)))) {
- continueCount += match[0].length - 1;
- } else if (end === '}' && letter === '{') {
- stack.push(end = '}');
- } else if (end === '"' && prev === '#' && letter === '{') {
- stack.push(end = '}');
- }
- prev = letter;
- }
- return this.error("missing " + (stack.pop()) + ", starting");
- };
-
- Lexer.prototype.interpolateString = function(str, options) {
- var expr, heredoc, i, inner, interpolated, len, letter, nested, pi, regex, tag, tokens, value, _i, _len, _ref2, _ref3, _ref4;
- if (options == null) {
- options = {};
- }
- heredoc = options.heredoc, regex = options.regex;
- tokens = [];
- pi = 0;
- i = -1;
- while (letter = str.charAt(i += 1)) {
- if (letter === '\\') {
- i += 1;
- continue;
- }
- if (!(letter === '#' && str.charAt(i + 1) === '{' && (expr = this.balancedString(str.slice(i + 1), '}')))) {
- continue;
- }
- if (pi < i) {
- tokens.push(['NEOSTRING', str.slice(pi, i)]);
- }
- inner = expr.slice(1, -1);
- if (inner.length) {
- nested = new Lexer().tokenize(inner, {
- line: this.line,
- rewrite: false
- });
- nested.pop();
- if (((_ref2 = nested[0]) != null ? _ref2[0] : void 0) === 'TERMINATOR') {
- nested.shift();
- }
- if (len = nested.length) {
- if (len > 1) {
- nested.unshift(['(', '(', this.line]);
- nested.push([')', ')', this.line]);
- }
- tokens.push(['TOKENS', nested]);
- }
- }
- i += expr.length;
- pi = i + 1;
- }
- if ((i > pi && pi < str.length)) {
- tokens.push(['NEOSTRING', str.slice(pi)]);
- }
- if (regex) {
- return tokens;
- }
- if (!tokens.length) {
- return this.token('STRING', '""');
- }
- if (tokens[0][0] !== 'NEOSTRING') {
- tokens.unshift(['', '']);
- }
- if (interpolated = tokens.length > 1) {
- this.token('(', '(');
- }
- for (i = _i = 0, _len = tokens.length; _i < _len; i = ++_i) {
- _ref3 = tokens[i], tag = _ref3[0], value = _ref3[1];
- if (i) {
- this.token('+', '+');
- }
- if (tag === 'TOKENS') {
- (_ref4 = this.tokens).push.apply(_ref4, value);
- } else {
- this.token('STRING', this.makeString(value, '"', heredoc));
- }
- }
- if (interpolated) {
- this.token(')', ')');
- }
- return tokens;
- };
-
- Lexer.prototype.pair = function(tag) {
- var size, wanted;
- if (tag !== (wanted = last(this.ends))) {
- if ('OUTDENT' !== wanted) {
- this.error("unmatched " + tag);
- }
- this.indent -= size = last(this.indents);
- this.outdentToken(size, true);
- return this.pair(tag);
- }
- return this.ends.pop();
- };
-
- Lexer.prototype.token = function(tag, value) {
- return this.tokens.push([tag, value, this.line]);
- };
-
- Lexer.prototype.tag = function(index, tag) {
- var tok;
- return (tok = last(this.tokens, index)) && (tag ? tok[0] = tag : tok[0]);
- };
-
- Lexer.prototype.value = function(index, val) {
- var tok;
- return (tok = last(this.tokens, index)) && (val ? tok[1] = val : tok[1]);
- };
-
- Lexer.prototype.unfinished = function() {
- var _ref2;
- return LINE_CONTINUER.test(this.chunk) || ((_ref2 = this.tag()) === '\\' || _ref2 === '.' || _ref2 === '?.' || _ref2 === 'UNARY' || _ref2 === 'MATH' || _ref2 === '+' || _ref2 === '-' || _ref2 === 'SHIFT' || _ref2 === 'RELATION' || _ref2 === 'COMPARE' || _ref2 === 'LOGIC' || _ref2 === 'THROW' || _ref2 === 'EXTENDS');
- };
-
- Lexer.prototype.escapeLines = function(str, heredoc) {
- return str.replace(MULTILINER, heredoc ? '\\n' : '');
- };
-
- Lexer.prototype.makeString = function(body, quote, heredoc) {
- if (!body) {
- return quote + quote;
- }
- body = body.replace(/\\([\s\S])/g, function(match, contents) {
- if (contents === '\n' || contents === quote) {
- return contents;
- } else {
- return match;
- }
- });
- body = body.replace(RegExp("" + quote, "g"), '\\$&');
- return quote + this.escapeLines(body, heredoc) + quote;
- };
-
- Lexer.prototype.error = function(message) {
- throw SyntaxError("" + message + " on line " + (this.line + 1));
- };
-
- return Lexer;
-
- })();
-
- JS_KEYWORDS = ['true', 'false', 'null', 'this', 'new', 'delete', 'typeof', 'in', 'instanceof', 'return', 'throw', 'break', 'continue', 'debugger', 'if', 'else', 'switch', 'for', 'while', 'do', 'try', 'catch', 'finally', 'class', 'extends', 'super'];
-
- COFFEE_KEYWORDS = ['undefined', 'then', 'unless', 'until', 'loop', 'of', 'by', 'when'];
-
- COFFEE_ALIAS_MAP = {
- and: '&&',
- or: '||',
- is: '==',
- isnt: '!=',
- not: '!',
- yes: 'true',
- no: 'false',
- on: 'true',
- off: 'false'
- };
-
- COFFEE_ALIASES = (function() {
- var _results;
- _results = [];
- for (key in COFFEE_ALIAS_MAP) {
- _results.push(key);
- }
- return _results;
- })();
-
- COFFEE_KEYWORDS = COFFEE_KEYWORDS.concat(COFFEE_ALIASES);
-
- RESERVED = ['case', 'default', 'function', 'var', 'void', 'with', 'const', 'let', 'enum', 'export', 'import', 'native', '__hasProp', '__extends', '__slice', '__bind', '__indexOf', 'implements', 'interface', 'package', 'private', 'protected', 'public', 'static', 'yield'];
-
- STRICT_PROSCRIBED = ['arguments', 'eval'];
-
- JS_FORBIDDEN = JS_KEYWORDS.concat(RESERVED).concat(STRICT_PROSCRIBED);
-
- exports.RESERVED = RESERVED.concat(JS_KEYWORDS).concat(COFFEE_KEYWORDS).concat(STRICT_PROSCRIBED);
-
- exports.STRICT_PROSCRIBED = STRICT_PROSCRIBED;
-
- IDENTIFIER = /^([$A-Za-z_\x7f-\uffff][$\w\x7f-\uffff]*)([^\n\S]*:(?!:))?/;
-
- NUMBER = /^0b[01]+|^0o[0-7]+|^0x[\da-f]+|^\d*\.?\d+(?:e[+-]?\d+)?/i;
-
- HEREDOC = /^("""|''')([\s\S]*?)(?:\n[^\n\S]*)?\1/;
-
- OPERATOR = /^(?:[-=]>|[-+*\/%<>&|^!?=]=|>>>=?|([-+:])\1|([&|<>])\2=?|\?\.|\.{2,3})/;
-
- WHITESPACE = /^[^\n\S]+/;
-
- COMMENT = /^###([^#][\s\S]*?)(?:###[^\n\S]*|(?:###)?$)|^(?:\s*#(?!##[^#]).*)+/;
-
- CODE = /^[-=]>/;
-
- MULTI_DENT = /^(?:\n[^\n\S]*)+/;
-
- SIMPLESTR = /^'[^\\']*(?:\\.[^\\']*)*'/;
-
- JSTOKEN = /^`[^\\`]*(?:\\.[^\\`]*)*`/;
-
- REGEX = /^(\/(?![\s=])[^[\/\n\\]*(?:(?:\\[\s\S]|\[[^\]\n\\]*(?:\\[\s\S][^\]\n\\]*)*])[^[\/\n\\]*)*\/)([imgy]{0,4})(?!\w)/;
-
- HEREGEX = /^\/{3}([\s\S]+?)\/{3}([imgy]{0,4})(?!\w)/;
-
- HEREGEX_OMIT = /\s+(?:#.*)?/g;
-
- MULTILINER = /\n/g;
-
- HEREDOC_INDENT = /\n+([^\n\S]*)/g;
-
- HEREDOC_ILLEGAL = /\*\//;
-
- LINE_CONTINUER = /^\s*(?:,|\??\.(?![.\d])|::)/;
-
- TRAILING_SPACES = /\s+$/;
-
- COMPOUND_ASSIGN = ['-=', '+=', '/=', '*=', '%=', '||=', '&&=', '?=', '<<=', '>>=', '>>>=', '&=', '^=', '|='];
-
- UNARY = ['!', '~', 'NEW', 'TYPEOF', 'DELETE', 'DO'];
-
- LOGIC = ['&&', '||', '&', '|', '^'];
-
- SHIFT = ['<<', '>>', '>>>'];
-
- COMPARE = ['==', '!=', '<', '>', '<=', '>='];
-
- MATH = ['*', '/', '%'];
-
- RELATION = ['IN', 'OF', 'INSTANCEOF'];
-
- BOOL = ['TRUE', 'FALSE'];
-
- NOT_REGEX = ['NUMBER', 'REGEX', 'BOOL', 'NULL', 'UNDEFINED', '++', '--', ']'];
-
- NOT_SPACED_REGEX = NOT_REGEX.concat(')', '}', 'THIS', 'IDENTIFIER', 'STRING');
-
- CALLABLE = ['IDENTIFIER', 'STRING', 'REGEX', ')', ']', '}', '?', '::', '@', 'THIS', 'SUPER'];
-
- INDEXABLE = CALLABLE.concat('NUMBER', 'BOOL', 'NULL', 'UNDEFINED');
-
- LINE_BREAK = ['INDENT', 'OUTDENT', 'TERMINATOR'];
-
-
-});
-
-define('ace/mode/coffee/rewriter', ['require', 'exports', 'module' ], function(require, exports, module) {
-
- var BALANCED_PAIRS, EXPRESSION_CLOSE, EXPRESSION_END, EXPRESSION_START, IMPLICIT_BLOCK, IMPLICIT_CALL, IMPLICIT_END, IMPLICIT_FUNC, IMPLICIT_UNSPACED_CALL, INVERSES, LINEBREAKS, SINGLE_CLOSERS, SINGLE_LINERS, left, rite, _i, _len, _ref,
- __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; },
- __slice = [].slice;
-
- exports.Rewriter = (function() {
-
- function Rewriter() {}
-
- Rewriter.prototype.rewrite = function(tokens) {
- this.tokens = tokens;
- this.removeLeadingNewlines();
- this.removeMidExpressionNewlines();
- this.closeOpenCalls();
- this.closeOpenIndexes();
- this.addImplicitIndentation();
- this.tagPostfixConditionals();
- this.addImplicitBraces();
- this.addImplicitParentheses();
- return this.tokens;
- };
-
- Rewriter.prototype.scanTokens = function(block) {
- var i, token, tokens;
- tokens = this.tokens;
- i = 0;
- while (token = tokens[i]) {
- i += block.call(this, token, i, tokens);
- }
- return true;
- };
-
- Rewriter.prototype.detectEnd = function(i, condition, action) {
- var levels, token, tokens, _ref, _ref1;
- tokens = this.tokens;
- levels = 0;
- while (token = tokens[i]) {
- if (levels === 0 && condition.call(this, token, i)) {
- return action.call(this, token, i);
- }
- if (!token || levels < 0) {
- return action.call(this, token, i - 1);
- }
- if (_ref = token[0], __indexOf.call(EXPRESSION_START, _ref) >= 0) {
- levels += 1;
- } else if (_ref1 = token[0], __indexOf.call(EXPRESSION_END, _ref1) >= 0) {
- levels -= 1;
- }
- i += 1;
- }
- return i - 1;
- };
-
- Rewriter.prototype.removeLeadingNewlines = function() {
- var i, tag, _i, _len, _ref;
- _ref = this.tokens;
- for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) {
- tag = _ref[i][0];
- if (tag !== 'TERMINATOR') {
- break;
- }
- }
- if (i) {
- return this.tokens.splice(0, i);
- }
- };
-
- Rewriter.prototype.removeMidExpressionNewlines = function() {
- return this.scanTokens(function(token, i, tokens) {
- var _ref;
- if (!(token[0] === 'TERMINATOR' && (_ref = this.tag(i + 1), __indexOf.call(EXPRESSION_CLOSE, _ref) >= 0))) {
- return 1;
- }
- tokens.splice(i, 1);
- return 0;
- });
- };
-
- Rewriter.prototype.closeOpenCalls = function() {
- var action, condition;
- condition = function(token, i) {
- var _ref;
- return ((_ref = token[0]) === ')' || _ref === 'CALL_END') || token[0] === 'OUTDENT' && this.tag(i - 1) === ')';
- };
- action = function(token, i) {
- return this.tokens[token[0] === 'OUTDENT' ? i - 1 : i][0] = 'CALL_END';
- };
- return this.scanTokens(function(token, i) {
- if (token[0] === 'CALL_START') {
- this.detectEnd(i + 1, condition, action);
- }
- return 1;
- });
- };
-
- Rewriter.prototype.closeOpenIndexes = function() {
- var action, condition;
- condition = function(token, i) {
- var _ref;
- return (_ref = token[0]) === ']' || _ref === 'INDEX_END';
- };
- action = function(token, i) {
- return token[0] = 'INDEX_END';
- };
- return this.scanTokens(function(token, i) {
- if (token[0] === 'INDEX_START') {
- this.detectEnd(i + 1, condition, action);
- }
- return 1;
- });
- };
-
- Rewriter.prototype.addImplicitBraces = function() {
- var action, condition, sameLine, stack, start, startIndent, startIndex, startsLine;
- stack = [];
- start = null;
- startsLine = null;
- sameLine = true;
- startIndent = 0;
- startIndex = 0;
- condition = function(token, i) {
- var one, tag, three, two, _ref, _ref1;
- _ref = this.tokens.slice(i + 1, +(i + 3) + 1 || 9e9), one = _ref[0], two = _ref[1], three = _ref[2];
- if ('HERECOMMENT' === (one != null ? one[0] : void 0)) {
- return false;
- }
- tag = token[0];
- if (__indexOf.call(LINEBREAKS, tag) >= 0) {
- sameLine = false;
- }
- return (((tag === 'TERMINATOR' || tag === 'OUTDENT') || (__indexOf.call(IMPLICIT_END, tag) >= 0 && sameLine && !(i - startIndex === 1))) && ((!startsLine && this.tag(i - 1) !== ',') || !((two != null ? two[0] : void 0) === ':' || (one != null ? one[0] : void 0) === '@' && (three != null ? three[0] : void 0) === ':'))) || (tag === ',' && one && ((_ref1 = one[0]) !== 'IDENTIFIER' && _ref1 !== 'NUMBER' && _ref1 !== 'STRING' && _ref1 !== '@' && _ref1 !== 'TERMINATOR' && _ref1 !== 'OUTDENT'));
- };
- action = function(token, i) {
- var tok;
- tok = this.generate('}', '}', token[2]);
- return this.tokens.splice(i, 0, tok);
- };
- return this.scanTokens(function(token, i, tokens) {
- var ago, idx, prevTag, tag, tok, value, _ref, _ref1;
- if (_ref = (tag = token[0]), __indexOf.call(EXPRESSION_START, _ref) >= 0) {
- stack.push([(tag === 'INDENT' && this.tag(i - 1) === '{' ? '{' : tag), i]);
- return 1;
- }
- if (__indexOf.call(EXPRESSION_END, tag) >= 0) {
- start = stack.pop();
- return 1;
- }
- if (!(tag === ':' && ((ago = this.tag(i - 2)) === ':' || ((_ref1 = stack[stack.length - 1]) != null ? _ref1[0] : void 0) !== '{'))) {
- return 1;
- }
- sameLine = true;
- startIndex = i + 1;
- stack.push(['{']);
- idx = ago === '@' ? i - 2 : i - 1;
- while (this.tag(idx - 2) === 'HERECOMMENT') {
- idx -= 2;
- }
- prevTag = this.tag(idx - 1);
- startsLine = !prevTag || (__indexOf.call(LINEBREAKS, prevTag) >= 0);
- value = new String('{');
- value.generated = true;
- tok = this.generate('{', value, token[2]);
- tokens.splice(idx, 0, tok);
- this.detectEnd(i + 2, condition, action);
- return 2;
- });
- };
-
- Rewriter.prototype.addImplicitParentheses = function() {
- var action, condition, noCall, seenControl, seenSingle;
- noCall = seenSingle = seenControl = false;
- condition = function(token, i) {
- var post, tag, _ref, _ref1;
- tag = token[0];
- if (!seenSingle && token.fromThen) {
- return true;
- }
- if (tag === 'IF' || tag === 'ELSE' || tag === 'CATCH' || tag === '->' || tag === '=>' || tag === 'CLASS') {
- seenSingle = true;
- }
- if (tag === 'IF' || tag === 'ELSE' || tag === 'SWITCH' || tag === 'TRY' || tag === '=') {
- seenControl = true;
- }
- if ((tag === '.' || tag === '?.' || tag === '::') && this.tag(i - 1) === 'OUTDENT') {
- return true;
- }
- return !token.generated && this.tag(i - 1) !== ',' && (__indexOf.call(IMPLICIT_END, tag) >= 0 || (tag === 'INDENT' && !seenControl)) && (tag !== 'INDENT' || (((_ref = this.tag(i - 2)) !== 'CLASS' && _ref !== 'EXTENDS') && (_ref1 = this.tag(i - 1), __indexOf.call(IMPLICIT_BLOCK, _ref1) < 0) && !((post = this.tokens[i + 1]) && post.generated && post[0] === '{')));
- };
- action = function(token, i) {
- return this.tokens.splice(i, 0, this.generate('CALL_END', ')', token[2]));
- };
- return this.scanTokens(function(token, i, tokens) {
- var callObject, current, next, prev, tag, _ref, _ref1, _ref2;
- tag = token[0];
- if (tag === 'CLASS' || tag === 'IF' || tag === 'FOR' || tag === 'WHILE') {
- noCall = true;
- }
- _ref = tokens.slice(i - 1, +(i + 1) + 1 || 9e9), prev = _ref[0], current = _ref[1], next = _ref[2];
- callObject = !noCall && tag === 'INDENT' && next && next.generated && next[0] === '{' && prev && (_ref1 = prev[0], __indexOf.call(IMPLICIT_FUNC, _ref1) >= 0);
- seenSingle = false;
- seenControl = false;
- if (__indexOf.call(LINEBREAKS, tag) >= 0) {
- noCall = false;
- }
- if (prev && !prev.spaced && tag === '?') {
- token.call = true;
- }
- if (token.fromThen) {
- return 1;
- }
- if (!(callObject || (prev != null ? prev.spaced : void 0) && (prev.call || (_ref2 = prev[0], __indexOf.call(IMPLICIT_FUNC, _ref2) >= 0)) && (__indexOf.call(IMPLICIT_CALL, tag) >= 0 || !(token.spaced || token.newLine) && __indexOf.call(IMPLICIT_UNSPACED_CALL, tag) >= 0))) {
- return 1;
- }
- tokens.splice(i, 0, this.generate('CALL_START', '(', token[2]));
- this.detectEnd(i + 1, condition, action);
- if (prev[0] === '?') {
- prev[0] = 'FUNC_EXIST';
- }
- return 2;
- });
- };
-
- Rewriter.prototype.addImplicitIndentation = function() {
- var action, condition, indent, outdent, starter;
- starter = indent = outdent = null;
- condition = function(token, i) {
- var _ref;
- return token[1] !== ';' && (_ref = token[0], __indexOf.call(SINGLE_CLOSERS, _ref) >= 0) && !(token[0] === 'ELSE' && (starter !== 'IF' && starter !== 'THEN'));
- };
- action = function(token, i) {
- return this.tokens.splice((this.tag(i - 1) === ',' ? i - 1 : i), 0, outdent);
- };
- return this.scanTokens(function(token, i, tokens) {
- var tag, _ref, _ref1;
- tag = token[0];
- if (tag === 'TERMINATOR' && this.tag(i + 1) === 'THEN') {
- tokens.splice(i, 1);
- return 0;
- }
- if (tag === 'ELSE' && this.tag(i - 1) !== 'OUTDENT') {
- tokens.splice.apply(tokens, [i, 0].concat(__slice.call(this.indentation(token))));
- return 2;
- }
- if (tag === 'CATCH' && ((_ref = this.tag(i + 2)) === 'OUTDENT' || _ref === 'TERMINATOR' || _ref === 'FINALLY')) {
- tokens.splice.apply(tokens, [i + 2, 0].concat(__slice.call(this.indentation(token))));
- return 4;
- }
- if (__indexOf.call(SINGLE_LINERS, tag) >= 0 && this.tag(i + 1) !== 'INDENT' && !(tag === 'ELSE' && this.tag(i + 1) === 'IF')) {
- starter = tag;
- _ref1 = this.indentation(token, true), indent = _ref1[0], outdent = _ref1[1];
- if (starter === 'THEN') {
- indent.fromThen = true;
- }
- tokens.splice(i + 1, 0, indent);
- this.detectEnd(i + 2, condition, action);
- if (tag === 'THEN') {
- tokens.splice(i, 1);
- }
- return 1;
- }
- return 1;
- });
- };
-
- Rewriter.prototype.tagPostfixConditionals = function() {
- var action, condition, original;
- original = null;
- condition = function(token, i) {
- var _ref;
- return (_ref = token[0]) === 'TERMINATOR' || _ref === 'INDENT';
- };
- action = function(token, i) {
- if (token[0] !== 'INDENT' || (token.generated && !token.fromThen)) {
- return original[0] = 'POST_' + original[0];
- }
- };
- return this.scanTokens(function(token, i) {
- if (token[0] !== 'IF') {
- return 1;
- }
- original = token;
- this.detectEnd(i + 1, condition, action);
- return 1;
- });
- };
-
- Rewriter.prototype.indentation = function(token, implicit) {
- var indent, outdent;
- if (implicit == null) {
- implicit = false;
- }
- indent = ['INDENT', 2, token[2]];
- outdent = ['OUTDENT', 2, token[2]];
- if (implicit) {
- indent.generated = outdent.generated = true;
- }
- return [indent, outdent];
- };
-
- Rewriter.prototype.generate = function(tag, value, line) {
- var tok;
- tok = [tag, value, line];
- tok.generated = true;
- return tok;
- };
-
- Rewriter.prototype.tag = function(i) {
- var _ref;
- return (_ref = this.tokens[i]) != null ? _ref[0] : void 0;
- };
-
- return Rewriter;
-
- })();
-
- BALANCED_PAIRS = [['(', ')'], ['[', ']'], ['{', '}'], ['INDENT', 'OUTDENT'], ['CALL_START', 'CALL_END'], ['PARAM_START', 'PARAM_END'], ['INDEX_START', 'INDEX_END']];
-
- exports.INVERSES = INVERSES = {};
-
- EXPRESSION_START = [];
-
- EXPRESSION_END = [];
-
- for (_i = 0, _len = BALANCED_PAIRS.length; _i < _len; _i++) {
- _ref = BALANCED_PAIRS[_i], left = _ref[0], rite = _ref[1];
- EXPRESSION_START.push(INVERSES[rite] = left);
- EXPRESSION_END.push(INVERSES[left] = rite);
- }
-
- EXPRESSION_CLOSE = ['CATCH', 'WHEN', 'ELSE', 'FINALLY'].concat(EXPRESSION_END);
-
- IMPLICIT_FUNC = ['IDENTIFIER', 'SUPER', ')', 'CALL_END', ']', 'INDEX_END', '@', 'THIS'];
-
- IMPLICIT_CALL = ['IDENTIFIER', 'NUMBER', 'STRING', 'JS', 'REGEX', 'NEW', 'PARAM_START', 'CLASS', 'IF', 'TRY', 'SWITCH', 'THIS', 'BOOL', 'NULL', 'UNDEFINED', 'UNARY', 'SUPER', '@', '->', '=>', '[', '(', '{', '--', '++'];
-
- IMPLICIT_UNSPACED_CALL = ['+', '-'];
-
- IMPLICIT_BLOCK = ['->', '=>', '{', '[', ','];
-
- IMPLICIT_END = ['POST_IF', 'FOR', 'WHILE', 'UNTIL', 'WHEN', 'BY', 'LOOP', 'TERMINATOR'];
-
- SINGLE_LINERS = ['ELSE', '->', '=>', 'TRY', 'FINALLY', 'THEN'];
-
- SINGLE_CLOSERS = ['TERMINATOR', 'CATCH', 'FINALLY', 'ELSE', 'OUTDENT', 'LEADING_WHEN'];
-
- LINEBREAKS = ['TERMINATOR', 'INDENT', 'OUTDENT'];
-
-
-});
-
-define('ace/mode/coffee/helpers', ['require', 'exports', 'module' ], function(require, exports, module) {
-
- var extend, flatten, _ref;
-
- exports.starts = function(string, literal, start) {
- return literal === string.substr(start, literal.length);
- };
-
- exports.ends = function(string, literal, back) {
- var len;
- len = literal.length;
- return literal === string.substr(string.length - len - (back || 0), len);
- };
-
- exports.compact = function(array) {
- var item, _i, _len, _results;
- _results = [];
- for (_i = 0, _len = array.length; _i < _len; _i++) {
- item = array[_i];
- if (item) {
- _results.push(item);
- }
- }
- return _results;
- };
-
- exports.count = function(string, substr) {
- var num, pos;
- num = pos = 0;
- if (!substr.length) {
- return 1 / 0;
- }
- while (pos = 1 + string.indexOf(substr, pos)) {
- num++;
- }
- return num;
- };
-
- exports.merge = function(options, overrides) {
- return extend(extend({}, options), overrides);
- };
-
- extend = exports.extend = function(object, properties) {
- var key, val;
- for (key in properties) {
- val = properties[key];
- object[key] = val;
- }
- return object;
- };
-
- exports.flatten = flatten = function(array) {
- var element, flattened, _i, _len;
- flattened = [];
- for (_i = 0, _len = array.length; _i < _len; _i++) {
- element = array[_i];
- if (element instanceof Array) {
- flattened = flattened.concat(flatten(element));
- } else {
- flattened.push(element);
- }
- }
- return flattened;
- };
-
- exports.del = function(obj, key) {
- var val;
- val = obj[key];
- delete obj[key];
- return val;
- };
-
- exports.last = function(array, back) {
- return array[array.length - (back || 0) - 1];
- };
-
- exports.some = (_ref = Array.prototype.some) != null ? _ref : function(fn) {
- var e, _i, _len;
- for (_i = 0, _len = this.length; _i < _len; _i++) {
- e = this[_i];
- if (fn(e)) {
- return true;
- }
- }
- return false;
- };
-
-
-});
-
-define('ace/mode/coffee/parser', ['require', 'exports', 'module' ], function(require, exports, module) {
-
-var parser = {trace: function trace() { },
-yy: {},
-symbols_: {"error":2,"Root":3,"Body":4,"Block":5,"TERMINATOR":6,"Line":7,"Expression":8,"Statement":9,"Return":10,"Comment":11,"STATEMENT":12,"Value":13,"Invocation":14,"Code":15,"Operation":16,"Assign":17,"If":18,"Try":19,"While":20,"For":21,"Switch":22,"Class":23,"Throw":24,"INDENT":25,"OUTDENT":26,"Identifier":27,"IDENTIFIER":28,"AlphaNumeric":29,"NUMBER":30,"STRING":31,"Literal":32,"JS":33,"REGEX":34,"DEBUGGER":35,"UNDEFINED":36,"NULL":37,"BOOL":38,"Assignable":39,"=":40,"AssignObj":41,"ObjAssignable":42,":":43,"ThisProperty":44,"RETURN":45,"HERECOMMENT":46,"PARAM_START":47,"ParamList":48,"PARAM_END":49,"FuncGlyph":50,"->":51,"=>":52,"OptComma":53,",":54,"Param":55,"ParamVar":56,"...":57,"Array":58,"Object":59,"Splat":60,"SimpleAssignable":61,"Accessor":62,"Parenthetical":63,"Range":64,"This":65,".":66,"?.":67,"::":68,"Index":69,"INDEX_START":70,"IndexValue":71,"INDEX_END":72,"INDEX_SOAK":73,"Slice":74,"{":75,"AssignList":76,"}":77,"CLASS":78,"EXTENDS":79,"OptFuncExist":80,"Arguments":81,"SUPER":82,"FUNC_EXIST":83,"CALL_START":84,"CALL_END":85,"ArgList":86,"THIS":87,"@":88,"[":89,"]":90,"RangeDots":91,"..":92,"Arg":93,"SimpleArgs":94,"TRY":95,"Catch":96,"FINALLY":97,"CATCH":98,"THROW":99,"(":100,")":101,"WhileSource":102,"WHILE":103,"WHEN":104,"UNTIL":105,"Loop":106,"LOOP":107,"ForBody":108,"FOR":109,"ForStart":110,"ForSource":111,"ForVariables":112,"OWN":113,"ForValue":114,"FORIN":115,"FOROF":116,"BY":117,"SWITCH":118,"Whens":119,"ELSE":120,"When":121,"LEADING_WHEN":122,"IfBlock":123,"IF":124,"POST_IF":125,"UNARY":126,"-":127,"+":128,"--":129,"++":130,"?":131,"MATH":132,"SHIFT":133,"COMPARE":134,"LOGIC":135,"RELATION":136,"COMPOUND_ASSIGN":137,"$accept":0,"$end":1},
-terminals_: {2:"error",6:"TERMINATOR",12:"STATEMENT",25:"INDENT",26:"OUTDENT",28:"IDENTIFIER",30:"NUMBER",31:"STRING",33:"JS",34:"REGEX",35:"DEBUGGER",36:"UNDEFINED",37:"NULL",38:"BOOL",40:"=",43:":",45:"RETURN",46:"HERECOMMENT",47:"PARAM_START",49:"PARAM_END",51:"->",52:"=>",54:",",57:"...",66:".",67:"?.",68:"::",70:"INDEX_START",72:"INDEX_END",73:"INDEX_SOAK",75:"{",77:"}",78:"CLASS",79:"EXTENDS",82:"SUPER",83:"FUNC_EXIST",84:"CALL_START",85:"CALL_END",87:"THIS",88:"@",89:"[",90:"]",92:"..",95:"TRY",97:"FINALLY",98:"CATCH",99:"THROW",100:"(",101:")",103:"WHILE",104:"WHEN",105:"UNTIL",107:"LOOP",109:"FOR",113:"OWN",115:"FORIN",116:"FOROF",117:"BY",118:"SWITCH",120:"ELSE",122:"LEADING_WHEN",124:"IF",125:"POST_IF",126:"UNARY",127:"-",128:"+",129:"--",130:"++",131:"?",132:"MATH",133:"SHIFT",134:"COMPARE",135:"LOGIC",136:"RELATION",137:"COMPOUND_ASSIGN"},
-productions_: [0,[3,0],[3,1],[3,2],[4,1],[4,3],[4,2],[7,1],[7,1],[9,1],[9,1],[9,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[5,2],[5,3],[27,1],[29,1],[29,1],[32,1],[32,1],[32,1],[32,1],[32,1],[32,1],[32,1],[17,3],[17,4],[17,5],[41,1],[41,3],[41,5],[41,1],[42,1],[42,1],[42,1],[10,2],[10,1],[11,1],[15,5],[15,2],[50,1],[50,1],[53,0],[53,1],[48,0],[48,1],[48,3],[48,4],[48,6],[55,1],[55,2],[55,3],[56,1],[56,1],[56,1],[56,1],[60,2],[61,1],[61,2],[61,2],[61,1],[39,1],[39,1],[39,1],[13,1],[13,1],[13,1],[13,1],[13,1],[62,2],[62,2],[62,2],[62,1],[62,1],[69,3],[69,2],[71,1],[71,1],[59,4],[76,0],[76,1],[76,3],[76,4],[76,6],[23,1],[23,2],[23,3],[23,4],[23,2],[23,3],[23,4],[23,5],[14,3],[14,3],[14,1],[14,2],[80,0],[80,1],[81,2],[81,4],[65,1],[65,1],[44,2],[58,2],[58,4],[91,1],[91,1],[64,5],[74,3],[74,2],[74,2],[74,1],[86,1],[86,3],[86,4],[86,4],[86,6],[93,1],[93,1],[94,1],[94,3],[19,2],[19,3],[19,4],[19,5],[96,3],[24,2],[63,3],[63,5],[102,2],[102,4],[102,2],[102,4],[20,2],[20,2],[20,2],[20,1],[106,2],[106,2],[21,2],[21,2],[21,2],[108,2],[108,2],[110,2],[110,3],[114,1],[114,1],[114,1],[114,1],[112,1],[112,3],[111,2],[111,2],[111,4],[111,4],[111,4],[111,6],[111,6],[22,5],[22,7],[22,4],[22,6],[119,1],[119,2],[121,3],[121,4],[123,3],[123,5],[18,1],[18,3],[18,3],[18,3],[16,2],[16,2],[16,2],[16,2],[16,2],[16,2],[16,2],[16,2],[16,3],[16,3],[16,3],[16,3],[16,3],[16,3],[16,3],[16,3],[16,5],[16,3]],
-performAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) {
-
-var $0 = $$.length - 1;
-switch (yystate) {
-case 1:return this.$ = new yy.Block;
-break;
-case 2:return this.$ = $$[$0];
-break;
-case 3:return this.$ = $$[$0-1];
-break;
-case 4:this.$ = yy.Block.wrap([$$[$0]]);
-break;
-case 5:this.$ = $$[$0-2].push($$[$0]);
-break;
-case 6:this.$ = $$[$0-1];
-break;
-case 7:this.$ = $$[$0];
-break;
-case 8:this.$ = $$[$0];
-break;
-case 9:this.$ = $$[$0];
-break;
-case 10:this.$ = $$[$0];
-break;
-case 11:this.$ = new yy.Literal($$[$0]);
-break;
-case 12:this.$ = $$[$0];
-break;
-case 13:this.$ = $$[$0];
-break;
-case 14:this.$ = $$[$0];
-break;
-case 15:this.$ = $$[$0];
-break;
-case 16:this.$ = $$[$0];
-break;
-case 17:this.$ = $$[$0];
-break;
-case 18:this.$ = $$[$0];
-break;
-case 19:this.$ = $$[$0];
-break;
-case 20:this.$ = $$[$0];
-break;
-case 21:this.$ = $$[$0];
-break;
-case 22:this.$ = $$[$0];
-break;
-case 23:this.$ = $$[$0];
-break;
-case 24:this.$ = new yy.Block;
-break;
-case 25:this.$ = $$[$0-1];
-break;
-case 26:this.$ = new yy.Literal($$[$0]);
-break;
-case 27:this.$ = new yy.Literal($$[$0]);
-break;
-case 28:this.$ = new yy.Literal($$[$0]);
-break;
-case 29:this.$ = $$[$0];
-break;
-case 30:this.$ = new yy.Literal($$[$0]);
-break;
-case 31:this.$ = new yy.Literal($$[$0]);
-break;
-case 32:this.$ = new yy.Literal($$[$0]);
-break;
-case 33:this.$ = new yy.Undefined;
-break;
-case 34:this.$ = new yy.Null;
-break;
-case 35:this.$ = new yy.Bool($$[$0]);
-break;
-case 36:this.$ = new yy.Assign($$[$0-2], $$[$0]);
-break;
-case 37:this.$ = new yy.Assign($$[$0-3], $$[$0]);
-break;
-case 38:this.$ = new yy.Assign($$[$0-4], $$[$0-1]);
-break;
-case 39:this.$ = new yy.Value($$[$0]);
-break;
-case 40:this.$ = new yy.Assign(new yy.Value($$[$0-2]), $$[$0], 'object');
-break;
-case 41:this.$ = new yy.Assign(new yy.Value($$[$0-4]), $$[$0-1], 'object');
-break;
-case 42:this.$ = $$[$0];
-break;
-case 43:this.$ = $$[$0];
-break;
-case 44:this.$ = $$[$0];
-break;
-case 45:this.$ = $$[$0];
-break;
-case 46:this.$ = new yy.Return($$[$0]);
-break;
-case 47:this.$ = new yy.Return;
-break;
-case 48:this.$ = new yy.Comment($$[$0]);
-break;
-case 49:this.$ = new yy.Code($$[$0-3], $$[$0], $$[$0-1]);
-break;
-case 50:this.$ = new yy.Code([], $$[$0], $$[$0-1]);
-break;
-case 51:this.$ = 'func';
-break;
-case 52:this.$ = 'boundfunc';
-break;
-case 53:this.$ = $$[$0];
-break;
-case 54:this.$ = $$[$0];
-break;
-case 55:this.$ = [];
-break;
-case 56:this.$ = [$$[$0]];
-break;
-case 57:this.$ = $$[$0-2].concat($$[$0]);
-break;
-case 58:this.$ = $$[$0-3].concat($$[$0]);
-break;
-case 59:this.$ = $$[$0-5].concat($$[$0-2]);
-break;
-case 60:this.$ = new yy.Param($$[$0]);
-break;
-case 61:this.$ = new yy.Param($$[$0-1], null, true);
-break;
-case 62:this.$ = new yy.Param($$[$0-2], $$[$0]);
-break;
-case 63:this.$ = $$[$0];
-break;
-case 64:this.$ = $$[$0];
-break;
-case 65:this.$ = $$[$0];
-break;
-case 66:this.$ = $$[$0];
-break;
-case 67:this.$ = new yy.Splat($$[$0-1]);
-break;
-case 68:this.$ = new yy.Value($$[$0]);
-break;
-case 69:this.$ = $$[$0-1].add($$[$0]);
-break;
-case 70:this.$ = new yy.Value($$[$0-1], [].concat($$[$0]));
-break;
-case 71:this.$ = $$[$0];
-break;
-case 72:this.$ = $$[$0];
-break;
-case 73:this.$ = new yy.Value($$[$0]);
-break;
-case 74:this.$ = new yy.Value($$[$0]);
-break;
-case 75:this.$ = $$[$0];
-break;
-case 76:this.$ = new yy.Value($$[$0]);
-break;
-case 77:this.$ = new yy.Value($$[$0]);
-break;
-case 78:this.$ = new yy.Value($$[$0]);
-break;
-case 79:this.$ = $$[$0];
-break;
-case 80:this.$ = new yy.Access($$[$0]);
-break;
-case 81:this.$ = new yy.Access($$[$0], 'soak');
-break;
-case 82:this.$ = [new yy.Access(new yy.Literal('prototype')), new yy.Access($$[$0])];
-break;
-case 83:this.$ = new yy.Access(new yy.Literal('prototype'));
-break;
-case 84:this.$ = $$[$0];
-break;
-case 85:this.$ = $$[$0-1];
-break;
-case 86:this.$ = yy.extend($$[$0], {
- soak: true
- });
-break;
-case 87:this.$ = new yy.Index($$[$0]);
-break;
-case 88:this.$ = new yy.Slice($$[$0]);
-break;
-case 89:this.$ = new yy.Obj($$[$0-2], $$[$0-3].generated);
-break;
-case 90:this.$ = [];
-break;
-case 91:this.$ = [$$[$0]];
-break;
-case 92:this.$ = $$[$0-2].concat($$[$0]);
-break;
-case 93:this.$ = $$[$0-3].concat($$[$0]);
-break;
-case 94:this.$ = $$[$0-5].concat($$[$0-2]);
-break;
-case 95:this.$ = new yy.Class;
-break;
-case 96:this.$ = new yy.Class(null, null, $$[$0]);
-break;
-case 97:this.$ = new yy.Class(null, $$[$0]);
-break;
-case 98:this.$ = new yy.Class(null, $$[$0-1], $$[$0]);
-break;
-case 99:this.$ = new yy.Class($$[$0]);
-break;
-case 100:this.$ = new yy.Class($$[$0-1], null, $$[$0]);
-break;
-case 101:this.$ = new yy.Class($$[$0-2], $$[$0]);
-break;
-case 102:this.$ = new yy.Class($$[$0-3], $$[$0-1], $$[$0]);
-break;
-case 103:this.$ = new yy.Call($$[$0-2], $$[$0], $$[$0-1]);
-break;
-case 104:this.$ = new yy.Call($$[$0-2], $$[$0], $$[$0-1]);
-break;
-case 105:this.$ = new yy.Call('super', [new yy.Splat(new yy.Literal('arguments'))]);
-break;
-case 106:this.$ = new yy.Call('super', $$[$0]);
-break;
-case 107:this.$ = false;
-break;
-case 108:this.$ = true;
-break;
-case 109:this.$ = [];
-break;
-case 110:this.$ = $$[$0-2];
-break;
-case 111:this.$ = new yy.Value(new yy.Literal('this'));
-break;
-case 112:this.$ = new yy.Value(new yy.Literal('this'));
-break;
-case 113:this.$ = new yy.Value(new yy.Literal('this'), [new yy.Access($$[$0])], 'this');
-break;
-case 114:this.$ = new yy.Arr([]);
-break;
-case 115:this.$ = new yy.Arr($$[$0-2]);
-break;
-case 116:this.$ = 'inclusive';
-break;
-case 117:this.$ = 'exclusive';
-break;
-case 118:this.$ = new yy.Range($$[$0-3], $$[$0-1], $$[$0-2]);
-break;
-case 119:this.$ = new yy.Range($$[$0-2], $$[$0], $$[$0-1]);
-break;
-case 120:this.$ = new yy.Range($$[$0-1], null, $$[$0]);
-break;
-case 121:this.$ = new yy.Range(null, $$[$0], $$[$0-1]);
-break;
-case 122:this.$ = new yy.Range(null, null, $$[$0]);
-break;
-case 123:this.$ = [$$[$0]];
-break;
-case 124:this.$ = $$[$0-2].concat($$[$0]);
-break;
-case 125:this.$ = $$[$0-3].concat($$[$0]);
-break;
-case 126:this.$ = $$[$0-2];
-break;
-case 127:this.$ = $$[$0-5].concat($$[$0-2]);
-break;
-case 128:this.$ = $$[$0];
-break;
-case 129:this.$ = $$[$0];
-break;
-case 130:this.$ = $$[$0];
-break;
-case 131:this.$ = [].concat($$[$0-2], $$[$0]);
-break;
-case 132:this.$ = new yy.Try($$[$0]);
-break;
-case 133:this.$ = new yy.Try($$[$0-1], $$[$0][0], $$[$0][1]);
-break;
-case 134:this.$ = new yy.Try($$[$0-2], null, null, $$[$0]);
-break;
-case 135:this.$ = new yy.Try($$[$0-3], $$[$0-2][0], $$[$0-2][1], $$[$0]);
-break;
-case 136:this.$ = [$$[$0-1], $$[$0]];
-break;
-case 137:this.$ = new yy.Throw($$[$0]);
-break;
-case 138:this.$ = new yy.Parens($$[$0-1]);
-break;
-case 139:this.$ = new yy.Parens($$[$0-2]);
-break;
-case 140:this.$ = new yy.While($$[$0]);
-break;
-case 141:this.$ = new yy.While($$[$0-2], {
- guard: $$[$0]
- });
-break;
-case 142:this.$ = new yy.While($$[$0], {
- invert: true
- });
-break;
-case 143:this.$ = new yy.While($$[$0-2], {
- invert: true,
- guard: $$[$0]
- });
-break;
-case 144:this.$ = $$[$0-1].addBody($$[$0]);
-break;
-case 145:this.$ = $$[$0].addBody(yy.Block.wrap([$$[$0-1]]));
-break;
-case 146:this.$ = $$[$0].addBody(yy.Block.wrap([$$[$0-1]]));
-break;
-case 147:this.$ = $$[$0];
-break;
-case 148:this.$ = new yy.While(new yy.Literal('true')).addBody($$[$0]);
-break;
-case 149:this.$ = new yy.While(new yy.Literal('true')).addBody(yy.Block.wrap([$$[$0]]));
-break;
-case 150:this.$ = new yy.For($$[$0-1], $$[$0]);
-break;
-case 151:this.$ = new yy.For($$[$0-1], $$[$0]);
-break;
-case 152:this.$ = new yy.For($$[$0], $$[$0-1]);
-break;
-case 153:this.$ = {
- source: new yy.Value($$[$0])
- };
-break;
-case 154:this.$ = (function () {
- $$[$0].own = $$[$0-1].own;
- $$[$0].name = $$[$0-1][0];
- $$[$0].index = $$[$0-1][1];
- return $$[$0];
- }());
-break;
-case 155:this.$ = $$[$0];
-break;
-case 156:this.$ = (function () {
- $$[$0].own = true;
- return $$[$0];
- }());
-break;
-case 157:this.$ = $$[$0];
-break;
-case 158:this.$ = $$[$0];
-break;
-case 159:this.$ = new yy.Value($$[$0]);
-break;
-case 160:this.$ = new yy.Value($$[$0]);
-break;
-case 161:this.$ = [$$[$0]];
-break;
-case 162:this.$ = [$$[$0-2], $$[$0]];
-break;
-case 163:this.$ = {
- source: $$[$0]
- };
-break;
-case 164:this.$ = {
- source: $$[$0],
- object: true
- };
-break;
-case 165:this.$ = {
- source: $$[$0-2],
- guard: $$[$0]
- };
-break;
-case 166:this.$ = {
- source: $$[$0-2],
- guard: $$[$0],
- object: true
- };
-break;
-case 167:this.$ = {
- source: $$[$0-2],
- step: $$[$0]
- };
-break;
-case 168:this.$ = {
- source: $$[$0-4],
- guard: $$[$0-2],
- step: $$[$0]
- };
-break;
-case 169:this.$ = {
- source: $$[$0-4],
- step: $$[$0-2],
- guard: $$[$0]
- };
-break;
-case 170:this.$ = new yy.Switch($$[$0-3], $$[$0-1]);
-break;
-case 171:this.$ = new yy.Switch($$[$0-5], $$[$0-3], $$[$0-1]);
-break;
-case 172:this.$ = new yy.Switch(null, $$[$0-1]);
-break;
-case 173:this.$ = new yy.Switch(null, $$[$0-3], $$[$0-1]);
-break;
-case 174:this.$ = $$[$0];
-break;
-case 175:this.$ = $$[$0-1].concat($$[$0]);
-break;
-case 176:this.$ = [[$$[$0-1], $$[$0]]];
-break;
-case 177:this.$ = [[$$[$0-2], $$[$0-1]]];
-break;
-case 178:this.$ = new yy.If($$[$0-1], $$[$0], {
- type: $$[$0-2]
- });
-break;
-case 179:this.$ = $$[$0-4].addElse(new yy.If($$[$0-1], $$[$0], {
- type: $$[$0-2]
- }));
-break;
-case 180:this.$ = $$[$0];
-break;
-case 181:this.$ = $$[$0-2].addElse($$[$0]);
-break;
-case 182:this.$ = new yy.If($$[$0], yy.Block.wrap([$$[$0-2]]), {
- type: $$[$0-1],
- statement: true
- });
-break;
-case 183:this.$ = new yy.If($$[$0], yy.Block.wrap([$$[$0-2]]), {
- type: $$[$0-1],
- statement: true
- });
-break;
-case 184:this.$ = new yy.Op($$[$0-1], $$[$0]);
-break;
-case 185:this.$ = new yy.Op('-', $$[$0]);
-break;
-case 186:this.$ = new yy.Op('+', $$[$0]);
-break;
-case 187:this.$ = new yy.Op('--', $$[$0]);
-break;
-case 188:this.$ = new yy.Op('++', $$[$0]);
-break;
-case 189:this.$ = new yy.Op('--', $$[$0-1], null, true);
-break;
-case 190:this.$ = new yy.Op('++', $$[$0-1], null, true);
-break;
-case 191:this.$ = new yy.Existence($$[$0-1]);
-break;
-case 192:this.$ = new yy.Op('+', $$[$0-2], $$[$0]);
-break;
-case 193:this.$ = new yy.Op('-', $$[$0-2], $$[$0]);
-break;
-case 194:this.$ = new yy.Op($$[$0-1], $$[$0-2], $$[$0]);
-break;
-case 195:this.$ = new yy.Op($$[$0-1], $$[$0-2], $$[$0]);
-break;
-case 196:this.$ = new yy.Op($$[$0-1], $$[$0-2], $$[$0]);
-break;
-case 197:this.$ = new yy.Op($$[$0-1], $$[$0-2], $$[$0]);
-break;
-case 198:this.$ = (function () {
- if ($$[$0-1].charAt(0) === '!') {
- return new yy.Op($$[$0-1].slice(1), $$[$0-2], $$[$0]).invert();
- } else {
- return new yy.Op($$[$0-1], $$[$0-2], $$[$0]);
- }
- }());
-break;
-case 199:this.$ = new yy.Assign($$[$0-2], $$[$0], $$[$0-1]);
-break;
-case 200:this.$ = new yy.Assign($$[$0-4], $$[$0-1], $$[$0-3]);
-break;
-case 201:this.$ = new yy.Extends($$[$0-2], $$[$0]);
-break;
-}
-},
-table: [{1:[2,1],3:1,4:2,5:3,7:4,8:6,9:7,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,5],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[3]},{1:[2,2],6:[1,74]},{6:[1,75]},{1:[2,4],6:[2,4],26:[2,4],101:[2,4]},{4:77,7:4,8:6,9:7,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,26:[1,76],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,7],6:[2,7],26:[2,7],101:[2,7],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,8],6:[2,8],26:[2,8],101:[2,8],102:90,103:[1,65],105:[1,66],108:91,109:[1,68],110:69,125:[1,89]},{1:[2,12],6:[2,12],25:[2,12],26:[2,12],49:[2,12],54:[2,12],57:[2,12],62:93,66:[1,95],67:[1,96],68:[1,97],69:98,70:[1,99],72:[2,12],73:[1,100],77:[2,12],80:92,83:[1,94],84:[2,107],85:[2,12],90:[2,12],92:[2,12],101:[2,12],103:[2,12],104:[2,12],105:[2,12],109:[2,12],117:[2,12],125:[2,12],127:[2,12],128:[2,12],131:[2,12],132:[2,12],133:[2,12],134:[2,12],135:[2,12],136:[2,12]},{1:[2,13],6:[2,13],25:[2,13],26:[2,13],49:[2,13],54:[2,13],57:[2,13],62:102,66:[1,95],67:[1,96],68:[1,97],69:98,70:[1,99],72:[2,13],73:[1,100],77:[2,13],80:101,83:[1,94],84:[2,107],85:[2,13],90:[2,13],92:[2,13],101:[2,13],103:[2,13],104:[2,13],105:[2,13],109:[2,13],117:[2,13],125:[2,13],127:[2,13],128:[2,13],131:[2,13],132:[2,13],133:[2,13],134:[2,13],135:[2,13],136:[2,13]},{1:[2,14],6:[2,14],25:[2,14],26:[2,14],49:[2,14],54:[2,14],57:[2,14],72:[2,14],77:[2,14],85:[2,14],90:[2,14],92:[2,14],101:[2,14],103:[2,14],104:[2,14],105:[2,14],109:[2,14],117:[2,14],125:[2,14],127:[2,14],128:[2,14],131:[2,14],132:[2,14],133:[2,14],134:[2,14],135:[2,14],136:[2,14]},{1:[2,15],6:[2,15],25:[2,15],26:[2,15],49:[2,15],54:[2,15],57:[2,15],72:[2,15],77:[2,15],85:[2,15],90:[2,15],92:[2,15],101:[2,15],103:[2,15],104:[2,15],105:[2,15],109:[2,15],117:[2,15],125:[2,15],127:[2,15],128:[2,15],131:[2,15],132:[2,15],133:[2,15],134:[2,15],135:[2,15],136:[2,15]},{1:[2,16],6:[2,16],25:[2,16],26:[2,16],49:[2,16],54:[2,16],57:[2,16],72:[2,16],77:[2,16],85:[2,16],90:[2,16],92:[2,16],101:[2,16],103:[2,16],104:[2,16],105:[2,16],109:[2,16],117:[2,16],125:[2,16],127:[2,16],128:[2,16],131:[2,16],132:[2,16],133:[2,16],134:[2,16],135:[2,16],136:[2,16]},{1:[2,17],6:[2,17],25:[2,17],26:[2,17],49:[2,17],54:[2,17],57:[2,17],72:[2,17],77:[2,17],85:[2,17],90:[2,17],92:[2,17],101:[2,17],103:[2,17],104:[2,17],105:[2,17],109:[2,17],117:[2,17],125:[2,17],127:[2,17],128:[2,17],131:[2,17],132:[2,17],133:[2,17],134:[2,17],135:[2,17],136:[2,17]},{1:[2,18],6:[2,18],25:[2,18],26:[2,18],49:[2,18],54:[2,18],57:[2,18],72:[2,18],77:[2,18],85:[2,18],90:[2,18],92:[2,18],101:[2,18],103:[2,18],104:[2,18],105:[2,18],109:[2,18],117:[2,18],125:[2,18],127:[2,18],128:[2,18],131:[2,18],132:[2,18],133:[2,18],134:[2,18],135:[2,18],136:[2,18]},{1:[2,19],6:[2,19],25:[2,19],26:[2,19],49:[2,19],54:[2,19],57:[2,19],72:[2,19],77:[2,19],85:[2,19],90:[2,19],92:[2,19],101:[2,19],103:[2,19],104:[2,19],105:[2,19],109:[2,19],117:[2,19],125:[2,19],127:[2,19],128:[2,19],131:[2,19],132:[2,19],133:[2,19],134:[2,19],135:[2,19],136:[2,19]},{1:[2,20],6:[2,20],25:[2,20],26:[2,20],49:[2,20],54:[2,20],57:[2,20],72:[2,20],77:[2,20],85:[2,20],90:[2,20],92:[2,20],101:[2,20],103:[2,20],104:[2,20],105:[2,20],109:[2,20],117:[2,20],125:[2,20],127:[2,20],128:[2,20],131:[2,20],132:[2,20],133:[2,20],134:[2,20],135:[2,20],136:[2,20]},{1:[2,21],6:[2,21],25:[2,21],26:[2,21],49:[2,21],54:[2,21],57:[2,21],72:[2,21],77:[2,21],85:[2,21],90:[2,21],92:[2,21],101:[2,21],103:[2,21],104:[2,21],105:[2,21],109:[2,21],117:[2,21],125:[2,21],127:[2,21],128:[2,21],131:[2,21],132:[2,21],133:[2,21],134:[2,21],135:[2,21],136:[2,21]},{1:[2,22],6:[2,22],25:[2,22],26:[2,22],49:[2,22],54:[2,22],57:[2,22],72:[2,22],77:[2,22],85:[2,22],90:[2,22],92:[2,22],101:[2,22],103:[2,22],104:[2,22],105:[2,22],109:[2,22],117:[2,22],125:[2,22],127:[2,22],128:[2,22],131:[2,22],132:[2,22],133:[2,22],134:[2,22],135:[2,22],136:[2,22]},{1:[2,23],6:[2,23],25:[2,23],26:[2,23],49:[2,23],54:[2,23],57:[2,23],72:[2,23],77:[2,23],85:[2,23],90:[2,23],92:[2,23],101:[2,23],103:[2,23],104:[2,23],105:[2,23],109:[2,23],117:[2,23],125:[2,23],127:[2,23],128:[2,23],131:[2,23],132:[2,23],133:[2,23],134:[2,23],135:[2,23],136:[2,23]},{1:[2,9],6:[2,9],26:[2,9],101:[2,9],103:[2,9],105:[2,9],109:[2,9],125:[2,9]},{1:[2,10],6:[2,10],26:[2,10],101:[2,10],103:[2,10],105:[2,10],109:[2,10],125:[2,10]},{1:[2,11],6:[2,11],26:[2,11],101:[2,11],103:[2,11],105:[2,11],109:[2,11],125:[2,11]},{1:[2,75],6:[2,75],25:[2,75],26:[2,75],40:[1,103],49:[2,75],54:[2,75],57:[2,75],66:[2,75],67:[2,75],68:[2,75],70:[2,75],72:[2,75],73:[2,75],77:[2,75],83:[2,75],84:[2,75],85:[2,75],90:[2,75],92:[2,75],101:[2,75],103:[2,75],104:[2,75],105:[2,75],109:[2,75],117:[2,75],125:[2,75],127:[2,75],128:[2,75],131:[2,75],132:[2,75],133:[2,75],134:[2,75],135:[2,75],136:[2,75]},{1:[2,76],6:[2,76],25:[2,76],26:[2,76],49:[2,76],54:[2,76],57:[2,76],66:[2,76],67:[2,76],68:[2,76],70:[2,76],72:[2,76],73:[2,76],77:[2,76],83:[2,76],84:[2,76],85:[2,76],90:[2,76],92:[2,76],101:[2,76],103:[2,76],104:[2,76],105:[2,76],109:[2,76],117:[2,76],125:[2,76],127:[2,76],128:[2,76],131:[2,76],132:[2,76],133:[2,76],134:[2,76],135:[2,76],136:[2,76]},{1:[2,77],6:[2,77],25:[2,77],26:[2,77],49:[2,77],54:[2,77],57:[2,77],66:[2,77],67:[2,77],68:[2,77],70:[2,77],72:[2,77],73:[2,77],77:[2,77],83:[2,77],84:[2,77],85:[2,77],90:[2,77],92:[2,77],101:[2,77],103:[2,77],104:[2,77],105:[2,77],109:[2,77],117:[2,77],125:[2,77],127:[2,77],128:[2,77],131:[2,77],132:[2,77],133:[2,77],134:[2,77],135:[2,77],136:[2,77]},{1:[2,78],6:[2,78],25:[2,78],26:[2,78],49:[2,78],54:[2,78],57:[2,78],66:[2,78],67:[2,78],68:[2,78],70:[2,78],72:[2,78],73:[2,78],77:[2,78],83:[2,78],84:[2,78],85:[2,78],90:[2,78],92:[2,78],101:[2,78],103:[2,78],104:[2,78],105:[2,78],109:[2,78],117:[2,78],125:[2,78],127:[2,78],128:[2,78],131:[2,78],132:[2,78],133:[2,78],134:[2,78],135:[2,78],136:[2,78]},{1:[2,79],6:[2,79],25:[2,79],26:[2,79],49:[2,79],54:[2,79],57:[2,79],66:[2,79],67:[2,79],68:[2,79],70:[2,79],72:[2,79],73:[2,79],77:[2,79],83:[2,79],84:[2,79],85:[2,79],90:[2,79],92:[2,79],101:[2,79],103:[2,79],104:[2,79],105:[2,79],109:[2,79],117:[2,79],125:[2,79],127:[2,79],128:[2,79],131:[2,79],132:[2,79],133:[2,79],134:[2,79],135:[2,79],136:[2,79]},{1:[2,105],6:[2,105],25:[2,105],26:[2,105],49:[2,105],54:[2,105],57:[2,105],66:[2,105],67:[2,105],68:[2,105],70:[2,105],72:[2,105],73:[2,105],77:[2,105],81:104,83:[2,105],84:[1,105],85:[2,105],90:[2,105],92:[2,105],101:[2,105],103:[2,105],104:[2,105],105:[2,105],109:[2,105],117:[2,105],125:[2,105],127:[2,105],128:[2,105],131:[2,105],132:[2,105],133:[2,105],134:[2,105],135:[2,105],136:[2,105]},{6:[2,55],25:[2,55],27:109,28:[1,73],44:110,48:106,49:[2,55],54:[2,55],55:107,56:108,58:111,59:112,75:[1,70],88:[1,113],89:[1,114]},{5:115,25:[1,5]},{8:116,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:118,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:119,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{13:121,14:122,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:123,44:63,58:47,59:48,61:120,63:25,64:26,65:27,75:[1,70],82:[1,28],87:[1,58],88:[1,59],89:[1,57],100:[1,56]},{13:121,14:122,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:123,44:63,58:47,59:48,61:124,63:25,64:26,65:27,75:[1,70],82:[1,28],87:[1,58],88:[1,59],89:[1,57],100:[1,56]},{1:[2,72],6:[2,72],25:[2,72],26:[2,72],40:[2,72],49:[2,72],54:[2,72],57:[2,72],66:[2,72],67:[2,72],68:[2,72],70:[2,72],72:[2,72],73:[2,72],77:[2,72],79:[1,128],83:[2,72],84:[2,72],85:[2,72],90:[2,72],92:[2,72],101:[2,72],103:[2,72],104:[2,72],105:[2,72],109:[2,72],117:[2,72],125:[2,72],127:[2,72],128:[2,72],129:[1,125],130:[1,126],131:[2,72],132:[2,72],133:[2,72],134:[2,72],135:[2,72],136:[2,72],137:[1,127]},{1:[2,180],6:[2,180],25:[2,180],26:[2,180],49:[2,180],54:[2,180],57:[2,180],72:[2,180],77:[2,180],85:[2,180],90:[2,180],92:[2,180],101:[2,180],103:[2,180],104:[2,180],105:[2,180],109:[2,180],117:[2,180],120:[1,129],125:[2,180],127:[2,180],128:[2,180],131:[2,180],132:[2,180],133:[2,180],134:[2,180],135:[2,180],136:[2,180]},{5:130,25:[1,5]},{5:131,25:[1,5]},{1:[2,147],6:[2,147],25:[2,147],26:[2,147],49:[2,147],54:[2,147],57:[2,147],72:[2,147],77:[2,147],85:[2,147],90:[2,147],92:[2,147],101:[2,147],103:[2,147],104:[2,147],105:[2,147],109:[2,147],117:[2,147],125:[2,147],127:[2,147],128:[2,147],131:[2,147],132:[2,147],133:[2,147],134:[2,147],135:[2,147],136:[2,147]},{5:132,25:[1,5]},{8:133,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,134],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,95],5:135,6:[2,95],13:121,14:122,25:[1,5],26:[2,95],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:123,44:63,49:[2,95],54:[2,95],57:[2,95],58:47,59:48,61:137,63:25,64:26,65:27,72:[2,95],75:[1,70],77:[2,95],79:[1,136],82:[1,28],85:[2,95],87:[1,58],88:[1,59],89:[1,57],90:[2,95],92:[2,95],100:[1,56],101:[2,95],103:[2,95],104:[2,95],105:[2,95],109:[2,95],117:[2,95],125:[2,95],127:[2,95],128:[2,95],131:[2,95],132:[2,95],133:[2,95],134:[2,95],135:[2,95],136:[2,95]},{8:138,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,47],6:[2,47],8:139,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,26:[2,47],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],101:[2,47],102:39,103:[2,47],105:[2,47],106:40,107:[1,67],108:41,109:[2,47],110:69,118:[1,42],123:37,124:[1,64],125:[2,47],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,48],6:[2,48],25:[2,48],26:[2,48],54:[2,48],77:[2,48],101:[2,48],103:[2,48],105:[2,48],109:[2,48],125:[2,48]},{1:[2,73],6:[2,73],25:[2,73],26:[2,73],40:[2,73],49:[2,73],54:[2,73],57:[2,73],66:[2,73],67:[2,73],68:[2,73],70:[2,73],72:[2,73],73:[2,73],77:[2,73],83:[2,73],84:[2,73],85:[2,73],90:[2,73],92:[2,73],101:[2,73],103:[2,73],104:[2,73],105:[2,73],109:[2,73],117:[2,73],125:[2,73],127:[2,73],128:[2,73],131:[2,73],132:[2,73],133:[2,73],134:[2,73],135:[2,73],136:[2,73]},{1:[2,74],6:[2,74],25:[2,74],26:[2,74],40:[2,74],49:[2,74],54:[2,74],57:[2,74],66:[2,74],67:[2,74],68:[2,74],70:[2,74],72:[2,74],73:[2,74],77:[2,74],83:[2,74],84:[2,74],85:[2,74],90:[2,74],92:[2,74],101:[2,74],103:[2,74],104:[2,74],105:[2,74],109:[2,74],117:[2,74],125:[2,74],127:[2,74],128:[2,74],131:[2,74],132:[2,74],133:[2,74],134:[2,74],135:[2,74],136:[2,74]},{1:[2,29],6:[2,29],25:[2,29],26:[2,29],49:[2,29],54:[2,29],57:[2,29],66:[2,29],67:[2,29],68:[2,29],70:[2,29],72:[2,29],73:[2,29],77:[2,29],83:[2,29],84:[2,29],85:[2,29],90:[2,29],92:[2,29],101:[2,29],103:[2,29],104:[2,29],105:[2,29],109:[2,29],117:[2,29],125:[2,29],127:[2,29],128:[2,29],131:[2,29],132:[2,29],133:[2,29],134:[2,29],135:[2,29],136:[2,29]},{1:[2,30],6:[2,30],25:[2,30],26:[2,30],49:[2,30],54:[2,30],57:[2,30],66:[2,30],67:[2,30],68:[2,30],70:[2,30],72:[2,30],73:[2,30],77:[2,30],83:[2,30],84:[2,30],85:[2,30],90:[2,30],92:[2,30],101:[2,30],103:[2,30],104:[2,30],105:[2,30],109:[2,30],117:[2,30],125:[2,30],127:[2,30],128:[2,30],131:[2,30],132:[2,30],133:[2,30],134:[2,30],135:[2,30],136:[2,30]},{1:[2,31],6:[2,31],25:[2,31],26:[2,31],49:[2,31],54:[2,31],57:[2,31],66:[2,31],67:[2,31],68:[2,31],70:[2,31],72:[2,31],73:[2,31],77:[2,31],83:[2,31],84:[2,31],85:[2,31],90:[2,31],92:[2,31],101:[2,31],103:[2,31],104:[2,31],105:[2,31],109:[2,31],117:[2,31],125:[2,31],127:[2,31],128:[2,31],131:[2,31],132:[2,31],133:[2,31],134:[2,31],135:[2,31],136:[2,31]},{1:[2,32],6:[2,32],25:[2,32],26:[2,32],49:[2,32],54:[2,32],57:[2,32],66:[2,32],67:[2,32],68:[2,32],70:[2,32],72:[2,32],73:[2,32],77:[2,32],83:[2,32],84:[2,32],85:[2,32],90:[2,32],92:[2,32],101:[2,32],103:[2,32],104:[2,32],105:[2,32],109:[2,32],117:[2,32],125:[2,32],127:[2,32],128:[2,32],131:[2,32],132:[2,32],133:[2,32],134:[2,32],135:[2,32],136:[2,32]},{1:[2,33],6:[2,33],25:[2,33],26:[2,33],49:[2,33],54:[2,33],57:[2,33],66:[2,33],67:[2,33],68:[2,33],70:[2,33],72:[2,33],73:[2,33],77:[2,33],83:[2,33],84:[2,33],85:[2,33],90:[2,33],92:[2,33],101:[2,33],103:[2,33],104:[2,33],105:[2,33],109:[2,33],117:[2,33],125:[2,33],127:[2,33],128:[2,33],131:[2,33],132:[2,33],133:[2,33],134:[2,33],135:[2,33],136:[2,33]},{1:[2,34],6:[2,34],25:[2,34],26:[2,34],49:[2,34],54:[2,34],57:[2,34],66:[2,34],67:[2,34],68:[2,34],70:[2,34],72:[2,34],73:[2,34],77:[2,34],83:[2,34],84:[2,34],85:[2,34],90:[2,34],92:[2,34],101:[2,34],103:[2,34],104:[2,34],105:[2,34],109:[2,34],117:[2,34],125:[2,34],127:[2,34],128:[2,34],131:[2,34],132:[2,34],133:[2,34],134:[2,34],135:[2,34],136:[2,34]},{1:[2,35],6:[2,35],25:[2,35],26:[2,35],49:[2,35],54:[2,35],57:[2,35],66:[2,35],67:[2,35],68:[2,35],70:[2,35],72:[2,35],73:[2,35],77:[2,35],83:[2,35],84:[2,35],85:[2,35],90:[2,35],92:[2,35],101:[2,35],103:[2,35],104:[2,35],105:[2,35],109:[2,35],117:[2,35],125:[2,35],127:[2,35],128:[2,35],131:[2,35],132:[2,35],133:[2,35],134:[2,35],135:[2,35],136:[2,35]},{4:140,7:4,8:6,9:7,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,141],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:142,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,146],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,60:147,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],86:144,87:[1,58],88:[1,59],89:[1,57],90:[1,143],93:145,95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,111],6:[2,111],25:[2,111],26:[2,111],49:[2,111],54:[2,111],57:[2,111],66:[2,111],67:[2,111],68:[2,111],70:[2,111],72:[2,111],73:[2,111],77:[2,111],83:[2,111],84:[2,111],85:[2,111],90:[2,111],92:[2,111],101:[2,111],103:[2,111],104:[2,111],105:[2,111],109:[2,111],117:[2,111],125:[2,111],127:[2,111],128:[2,111],131:[2,111],132:[2,111],133:[2,111],134:[2,111],135:[2,111],136:[2,111]},{1:[2,112],6:[2,112],25:[2,112],26:[2,112],27:148,28:[1,73],49:[2,112],54:[2,112],57:[2,112],66:[2,112],67:[2,112],68:[2,112],70:[2,112],72:[2,112],73:[2,112],77:[2,112],83:[2,112],84:[2,112],85:[2,112],90:[2,112],92:[2,112],101:[2,112],103:[2,112],104:[2,112],105:[2,112],109:[2,112],117:[2,112],125:[2,112],127:[2,112],128:[2,112],131:[2,112],132:[2,112],133:[2,112],134:[2,112],135:[2,112],136:[2,112]},{25:[2,51]},{25:[2,52]},{1:[2,68],6:[2,68],25:[2,68],26:[2,68],40:[2,68],49:[2,68],54:[2,68],57:[2,68],66:[2,68],67:[2,68],68:[2,68],70:[2,68],72:[2,68],73:[2,68],77:[2,68],79:[2,68],83:[2,68],84:[2,68],85:[2,68],90:[2,68],92:[2,68],101:[2,68],103:[2,68],104:[2,68],105:[2,68],109:[2,68],117:[2,68],125:[2,68],127:[2,68],128:[2,68],129:[2,68],130:[2,68],131:[2,68],132:[2,68],133:[2,68],134:[2,68],135:[2,68],136:[2,68],137:[2,68]},{1:[2,71],6:[2,71],25:[2,71],26:[2,71],40:[2,71],49:[2,71],54:[2,71],57:[2,71],66:[2,71],67:[2,71],68:[2,71],70:[2,71],72:[2,71],73:[2,71],77:[2,71],79:[2,71],83:[2,71],84:[2,71],85:[2,71],90:[2,71],92:[2,71],101:[2,71],103:[2,71],104:[2,71],105:[2,71],109:[2,71],117:[2,71],125:[2,71],127:[2,71],128:[2,71],129:[2,71],130:[2,71],131:[2,71],132:[2,71],133:[2,71],134:[2,71],135:[2,71],136:[2,71],137:[2,71]},{8:149,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:150,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:151,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{5:152,8:153,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,5],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{27:158,28:[1,73],44:159,58:160,59:161,64:154,75:[1,70],88:[1,113],89:[1,57],112:155,113:[1,156],114:157},{111:162,115:[1,163],116:[1,164]},{6:[2,90],11:168,25:[2,90],27:169,28:[1,73],29:170,30:[1,71],31:[1,72],41:166,42:167,44:171,46:[1,46],54:[2,90],76:165,77:[2,90],88:[1,113]},{1:[2,27],6:[2,27],25:[2,27],26:[2,27],43:[2,27],49:[2,27],54:[2,27],57:[2,27],66:[2,27],67:[2,27],68:[2,27],70:[2,27],72:[2,27],73:[2,27],77:[2,27],83:[2,27],84:[2,27],85:[2,27],90:[2,27],92:[2,27],101:[2,27],103:[2,27],104:[2,27],105:[2,27],109:[2,27],117:[2,27],125:[2,27],127:[2,27],128:[2,27],131:[2,27],132:[2,27],133:[2,27],134:[2,27],135:[2,27],136:[2,27]},{1:[2,28],6:[2,28],25:[2,28],26:[2,28],43:[2,28],49:[2,28],54:[2,28],57:[2,28],66:[2,28],67:[2,28],68:[2,28],70:[2,28],72:[2,28],73:[2,28],77:[2,28],83:[2,28],84:[2,28],85:[2,28],90:[2,28],92:[2,28],101:[2,28],103:[2,28],104:[2,28],105:[2,28],109:[2,28],117:[2,28],125:[2,28],127:[2,28],128:[2,28],131:[2,28],132:[2,28],133:[2,28],134:[2,28],135:[2,28],136:[2,28]},{1:[2,26],6:[2,26],25:[2,26],26:[2,26],40:[2,26],43:[2,26],49:[2,26],54:[2,26],57:[2,26],66:[2,26],67:[2,26],68:[2,26],70:[2,26],72:[2,26],73:[2,26],77:[2,26],79:[2,26],83:[2,26],84:[2,26],85:[2,26],90:[2,26],92:[2,26],101:[2,26],103:[2,26],104:[2,26],105:[2,26],109:[2,26],115:[2,26],116:[2,26],117:[2,26],125:[2,26],127:[2,26],128:[2,26],129:[2,26],130:[2,26],131:[2,26],132:[2,26],133:[2,26],134:[2,26],135:[2,26],136:[2,26],137:[2,26]},{1:[2,6],6:[2,6],7:172,8:6,9:7,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,26:[2,6],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],101:[2,6],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,3]},{1:[2,24],6:[2,24],25:[2,24],26:[2,24],49:[2,24],54:[2,24],57:[2,24],72:[2,24],77:[2,24],85:[2,24],90:[2,24],92:[2,24],97:[2,24],98:[2,24],101:[2,24],103:[2,24],104:[2,24],105:[2,24],109:[2,24],117:[2,24],120:[2,24],122:[2,24],125:[2,24],127:[2,24],128:[2,24],131:[2,24],132:[2,24],133:[2,24],134:[2,24],135:[2,24],136:[2,24]},{6:[1,74],26:[1,173]},{1:[2,191],6:[2,191],25:[2,191],26:[2,191],49:[2,191],54:[2,191],57:[2,191],72:[2,191],77:[2,191],85:[2,191],90:[2,191],92:[2,191],101:[2,191],103:[2,191],104:[2,191],105:[2,191],109:[2,191],117:[2,191],125:[2,191],127:[2,191],128:[2,191],131:[2,191],132:[2,191],133:[2,191],134:[2,191],135:[2,191],136:[2,191]},{8:174,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:175,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:176,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:177,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:178,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:179,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:180,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:181,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,146],6:[2,146],25:[2,146],26:[2,146],49:[2,146],54:[2,146],57:[2,146],72:[2,146],77:[2,146],85:[2,146],90:[2,146],92:[2,146],101:[2,146],103:[2,146],104:[2,146],105:[2,146],109:[2,146],117:[2,146],125:[2,146],127:[2,146],128:[2,146],131:[2,146],132:[2,146],133:[2,146],134:[2,146],135:[2,146],136:[2,146]},{1:[2,151],6:[2,151],25:[2,151],26:[2,151],49:[2,151],54:[2,151],57:[2,151],72:[2,151],77:[2,151],85:[2,151],90:[2,151],92:[2,151],101:[2,151],103:[2,151],104:[2,151],105:[2,151],109:[2,151],117:[2,151],125:[2,151],127:[2,151],128:[2,151],131:[2,151],132:[2,151],133:[2,151],134:[2,151],135:[2,151],136:[2,151]},{8:182,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,145],6:[2,145],25:[2,145],26:[2,145],49:[2,145],54:[2,145],57:[2,145],72:[2,145],77:[2,145],85:[2,145],90:[2,145],92:[2,145],101:[2,145],103:[2,145],104:[2,145],105:[2,145],109:[2,145],117:[2,145],125:[2,145],127:[2,145],128:[2,145],131:[2,145],132:[2,145],133:[2,145],134:[2,145],135:[2,145],136:[2,145]},{1:[2,150],6:[2,150],25:[2,150],26:[2,150],49:[2,150],54:[2,150],57:[2,150],72:[2,150],77:[2,150],85:[2,150],90:[2,150],92:[2,150],101:[2,150],103:[2,150],104:[2,150],105:[2,150],109:[2,150],117:[2,150],125:[2,150],127:[2,150],128:[2,150],131:[2,150],132:[2,150],133:[2,150],134:[2,150],135:[2,150],136:[2,150]},{81:183,84:[1,105]},{1:[2,69],6:[2,69],25:[2,69],26:[2,69],40:[2,69],49:[2,69],54:[2,69],57:[2,69],66:[2,69],67:[2,69],68:[2,69],70:[2,69],72:[2,69],73:[2,69],77:[2,69],79:[2,69],83:[2,69],84:[2,69],85:[2,69],90:[2,69],92:[2,69],101:[2,69],103:[2,69],104:[2,69],105:[2,69],109:[2,69],117:[2,69],125:[2,69],127:[2,69],128:[2,69],129:[2,69],130:[2,69],131:[2,69],132:[2,69],133:[2,69],134:[2,69],135:[2,69],136:[2,69],137:[2,69]},{84:[2,108]},{27:184,28:[1,73]},{27:185,28:[1,73]},{1:[2,83],6:[2,83],25:[2,83],26:[2,83],27:186,28:[1,73],40:[2,83],49:[2,83],54:[2,83],57:[2,83],66:[2,83],67:[2,83],68:[2,83],70:[2,83],72:[2,83],73:[2,83],77:[2,83],79:[2,83],83:[2,83],84:[2,83],85:[2,83],90:[2,83],92:[2,83],101:[2,83],103:[2,83],104:[2,83],105:[2,83],109:[2,83],117:[2,83],125:[2,83],127:[2,83],128:[2,83],129:[2,83],130:[2,83],131:[2,83],132:[2,83],133:[2,83],134:[2,83],135:[2,83],136:[2,83],137:[2,83]},{1:[2,84],6:[2,84],25:[2,84],26:[2,84],40:[2,84],49:[2,84],54:[2,84],57:[2,84],66:[2,84],67:[2,84],68:[2,84],70:[2,84],72:[2,84],73:[2,84],77:[2,84],79:[2,84],83:[2,84],84:[2,84],85:[2,84],90:[2,84],92:[2,84],101:[2,84],103:[2,84],104:[2,84],105:[2,84],109:[2,84],117:[2,84],125:[2,84],127:[2,84],128:[2,84],129:[2,84],130:[2,84],131:[2,84],132:[2,84],133:[2,84],134:[2,84],135:[2,84],136:[2,84],137:[2,84]},{8:188,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],57:[1,192],58:47,59:48,61:36,63:25,64:26,65:27,71:187,74:189,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],91:190,92:[1,191],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{69:193,70:[1,99],73:[1,100]},{81:194,84:[1,105]},{1:[2,70],6:[2,70],25:[2,70],26:[2,70],40:[2,70],49:[2,70],54:[2,70],57:[2,70],66:[2,70],67:[2,70],68:[2,70],70:[2,70],72:[2,70],73:[2,70],77:[2,70],79:[2,70],83:[2,70],84:[2,70],85:[2,70],90:[2,70],92:[2,70],101:[2,70],103:[2,70],104:[2,70],105:[2,70],109:[2,70],117:[2,70],125:[2,70],127:[2,70],128:[2,70],129:[2,70],130:[2,70],131:[2,70],132:[2,70],133:[2,70],134:[2,70],135:[2,70],136:[2,70],137:[2,70]},{6:[1,196],8:195,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,197],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,106],6:[2,106],25:[2,106],26:[2,106],49:[2,106],54:[2,106],57:[2,106],66:[2,106],67:[2,106],68:[2,106],70:[2,106],72:[2,106],73:[2,106],77:[2,106],83:[2,106],84:[2,106],85:[2,106],90:[2,106],92:[2,106],101:[2,106],103:[2,106],104:[2,106],105:[2,106],109:[2,106],117:[2,106],125:[2,106],127:[2,106],128:[2,106],131:[2,106],132:[2,106],133:[2,106],134:[2,106],135:[2,106],136:[2,106]},{8:200,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,146],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,60:147,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],85:[1,198],86:199,87:[1,58],88:[1,59],89:[1,57],93:145,95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{6:[2,53],25:[2,53],49:[1,201],53:203,54:[1,202]},{6:[2,56],25:[2,56],26:[2,56],49:[2,56],54:[2,56]},{6:[2,60],25:[2,60],26:[2,60],40:[1,205],49:[2,60],54:[2,60],57:[1,204]},{6:[2,63],25:[2,63],26:[2,63],40:[2,63],49:[2,63],54:[2,63],57:[2,63]},{6:[2,64],25:[2,64],26:[2,64],40:[2,64],49:[2,64],54:[2,64],57:[2,64]},{6:[2,65],25:[2,65],26:[2,65],40:[2,65],49:[2,65],54:[2,65],57:[2,65]},{6:[2,66],25:[2,66],26:[2,66],40:[2,66],49:[2,66],54:[2,66],57:[2,66]},{27:148,28:[1,73]},{8:200,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,146],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,60:147,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],86:144,87:[1,58],88:[1,59],89:[1,57],90:[1,143],93:145,95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,50],6:[2,50],25:[2,50],26:[2,50],49:[2,50],54:[2,50],57:[2,50],72:[2,50],77:[2,50],85:[2,50],90:[2,50],92:[2,50],101:[2,50],103:[2,50],104:[2,50],105:[2,50],109:[2,50],117:[2,50],125:[2,50],127:[2,50],128:[2,50],131:[2,50],132:[2,50],133:[2,50],134:[2,50],135:[2,50],136:[2,50]},{1:[2,184],6:[2,184],25:[2,184],26:[2,184],49:[2,184],54:[2,184],57:[2,184],72:[2,184],77:[2,184],85:[2,184],90:[2,184],92:[2,184],101:[2,184],102:87,103:[2,184],104:[2,184],105:[2,184],108:88,109:[2,184],110:69,117:[2,184],125:[2,184],127:[2,184],128:[2,184],131:[1,78],132:[2,184],133:[2,184],134:[2,184],135:[2,184],136:[2,184]},{102:90,103:[1,65],105:[1,66],108:91,109:[1,68],110:69,125:[1,89]},{1:[2,185],6:[2,185],25:[2,185],26:[2,185],49:[2,185],54:[2,185],57:[2,185],72:[2,185],77:[2,185],85:[2,185],90:[2,185],92:[2,185],101:[2,185],102:87,103:[2,185],104:[2,185],105:[2,185],108:88,109:[2,185],110:69,117:[2,185],125:[2,185],127:[2,185],128:[2,185],131:[1,78],132:[2,185],133:[2,185],134:[2,185],135:[2,185],136:[2,185]},{1:[2,186],6:[2,186],25:[2,186],26:[2,186],49:[2,186],54:[2,186],57:[2,186],72:[2,186],77:[2,186],85:[2,186],90:[2,186],92:[2,186],101:[2,186],102:87,103:[2,186],104:[2,186],105:[2,186],108:88,109:[2,186],110:69,117:[2,186],125:[2,186],127:[2,186],128:[2,186],131:[1,78],132:[2,186],133:[2,186],134:[2,186],135:[2,186],136:[2,186]},{1:[2,187],6:[2,187],25:[2,187],26:[2,187],49:[2,187],54:[2,187],57:[2,187],66:[2,72],67:[2,72],68:[2,72],70:[2,72],72:[2,187],73:[2,72],77:[2,187],83:[2,72],84:[2,72],85:[2,187],90:[2,187],92:[2,187],101:[2,187],103:[2,187],104:[2,187],105:[2,187],109:[2,187],117:[2,187],125:[2,187],127:[2,187],128:[2,187],131:[2,187],132:[2,187],133:[2,187],134:[2,187],135:[2,187],136:[2,187]},{62:93,66:[1,95],67:[1,96],68:[1,97],69:98,70:[1,99],73:[1,100],80:92,83:[1,94],84:[2,107]},{62:102,66:[1,95],67:[1,96],68:[1,97],69:98,70:[1,99],73:[1,100],80:101,83:[1,94],84:[2,107]},{66:[2,75],67:[2,75],68:[2,75],70:[2,75],73:[2,75],83:[2,75],84:[2,75]},{1:[2,188],6:[2,188],25:[2,188],26:[2,188],49:[2,188],54:[2,188],57:[2,188],66:[2,72],67:[2,72],68:[2,72],70:[2,72],72:[2,188],73:[2,72],77:[2,188],83:[2,72],84:[2,72],85:[2,188],90:[2,188],92:[2,188],101:[2,188],103:[2,188],104:[2,188],105:[2,188],109:[2,188],117:[2,188],125:[2,188],127:[2,188],128:[2,188],131:[2,188],132:[2,188],133:[2,188],134:[2,188],135:[2,188],136:[2,188]},{1:[2,189],6:[2,189],25:[2,189],26:[2,189],49:[2,189],54:[2,189],57:[2,189],72:[2,189],77:[2,189],85:[2,189],90:[2,189],92:[2,189],101:[2,189],103:[2,189],104:[2,189],105:[2,189],109:[2,189],117:[2,189],125:[2,189],127:[2,189],128:[2,189],131:[2,189],132:[2,189],133:[2,189],134:[2,189],135:[2,189],136:[2,189]},{1:[2,190],6:[2,190],25:[2,190],26:[2,190],49:[2,190],54:[2,190],57:[2,190],72:[2,190],77:[2,190],85:[2,190],90:[2,190],92:[2,190],101:[2,190],103:[2,190],104:[2,190],105:[2,190],109:[2,190],117:[2,190],125:[2,190],127:[2,190],128:[2,190],131:[2,190],132:[2,190],133:[2,190],134:[2,190],135:[2,190],136:[2,190]},{8:206,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,207],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:208,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{5:209,25:[1,5],124:[1,210]},{1:[2,132],6:[2,132],25:[2,132],26:[2,132],49:[2,132],54:[2,132],57:[2,132],72:[2,132],77:[2,132],85:[2,132],90:[2,132],92:[2,132],96:211,97:[1,212],98:[1,213],101:[2,132],103:[2,132],104:[2,132],105:[2,132],109:[2,132],117:[2,132],125:[2,132],127:[2,132],128:[2,132],131:[2,132],132:[2,132],133:[2,132],134:[2,132],135:[2,132],136:[2,132]},{1:[2,144],6:[2,144],25:[2,144],26:[2,144],49:[2,144],54:[2,144],57:[2,144],72:[2,144],77:[2,144],85:[2,144],90:[2,144],92:[2,144],101:[2,144],103:[2,144],104:[2,144],105:[2,144],109:[2,144],117:[2,144],125:[2,144],127:[2,144],128:[2,144],131:[2,144],132:[2,144],133:[2,144],134:[2,144],135:[2,144],136:[2,144]},{1:[2,152],6:[2,152],25:[2,152],26:[2,152],49:[2,152],54:[2,152],57:[2,152],72:[2,152],77:[2,152],85:[2,152],90:[2,152],92:[2,152],101:[2,152],103:[2,152],104:[2,152],105:[2,152],109:[2,152],117:[2,152],125:[2,152],127:[2,152],128:[2,152],131:[2,152],132:[2,152],133:[2,152],134:[2,152],135:[2,152],136:[2,152]},{25:[1,214],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{119:215,121:216,122:[1,217]},{1:[2,96],6:[2,96],25:[2,96],26:[2,96],49:[2,96],54:[2,96],57:[2,96],72:[2,96],77:[2,96],85:[2,96],90:[2,96],92:[2,96],101:[2,96],103:[2,96],104:[2,96],105:[2,96],109:[2,96],117:[2,96],125:[2,96],127:[2,96],128:[2,96],131:[2,96],132:[2,96],133:[2,96],134:[2,96],135:[2,96],136:[2,96]},{8:218,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,99],5:219,6:[2,99],25:[1,5],26:[2,99],49:[2,99],54:[2,99],57:[2,99],66:[2,72],67:[2,72],68:[2,72],70:[2,72],72:[2,99],73:[2,72],77:[2,99],79:[1,220],83:[2,72],84:[2,72],85:[2,99],90:[2,99],92:[2,99],101:[2,99],103:[2,99],104:[2,99],105:[2,99],109:[2,99],117:[2,99],125:[2,99],127:[2,99],128:[2,99],131:[2,99],132:[2,99],133:[2,99],134:[2,99],135:[2,99],136:[2,99]},{1:[2,137],6:[2,137],25:[2,137],26:[2,137],49:[2,137],54:[2,137],57:[2,137],72:[2,137],77:[2,137],85:[2,137],90:[2,137],92:[2,137],101:[2,137],102:87,103:[2,137],104:[2,137],105:[2,137],108:88,109:[2,137],110:69,117:[2,137],125:[2,137],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,46],6:[2,46],26:[2,46],101:[2,46],102:87,103:[2,46],105:[2,46],108:88,109:[2,46],110:69,125:[2,46],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{6:[1,74],101:[1,221]},{4:222,7:4,8:6,9:7,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{6:[2,128],25:[2,128],54:[2,128],57:[1,224],90:[2,128],91:223,92:[1,191],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,114],6:[2,114],25:[2,114],26:[2,114],40:[2,114],49:[2,114],54:[2,114],57:[2,114],66:[2,114],67:[2,114],68:[2,114],70:[2,114],72:[2,114],73:[2,114],77:[2,114],83:[2,114],84:[2,114],85:[2,114],90:[2,114],92:[2,114],101:[2,114],103:[2,114],104:[2,114],105:[2,114],109:[2,114],115:[2,114],116:[2,114],117:[2,114],125:[2,114],127:[2,114],128:[2,114],131:[2,114],132:[2,114],133:[2,114],134:[2,114],135:[2,114],136:[2,114]},{6:[2,53],25:[2,53],53:225,54:[1,226],90:[2,53]},{6:[2,123],25:[2,123],26:[2,123],54:[2,123],85:[2,123],90:[2,123]},{8:200,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,146],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,60:147,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],86:227,87:[1,58],88:[1,59],89:[1,57],93:145,95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{6:[2,129],25:[2,129],26:[2,129],54:[2,129],85:[2,129],90:[2,129]},{1:[2,113],6:[2,113],25:[2,113],26:[2,113],40:[2,113],43:[2,113],49:[2,113],54:[2,113],57:[2,113],66:[2,113],67:[2,113],68:[2,113],70:[2,113],72:[2,113],73:[2,113],77:[2,113],79:[2,113],83:[2,113],84:[2,113],85:[2,113],90:[2,113],92:[2,113],101:[2,113],103:[2,113],104:[2,113],105:[2,113],109:[2,113],115:[2,113],116:[2,113],117:[2,113],125:[2,113],127:[2,113],128:[2,113],129:[2,113],130:[2,113],131:[2,113],132:[2,113],133:[2,113],134:[2,113],135:[2,113],136:[2,113],137:[2,113]},{5:228,25:[1,5],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,140],6:[2,140],25:[2,140],26:[2,140],49:[2,140],54:[2,140],57:[2,140],72:[2,140],77:[2,140],85:[2,140],90:[2,140],92:[2,140],101:[2,140],102:87,103:[1,65],104:[1,229],105:[1,66],108:88,109:[1,68],110:69,117:[2,140],125:[2,140],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,142],6:[2,142],25:[2,142],26:[2,142],49:[2,142],54:[2,142],57:[2,142],72:[2,142],77:[2,142],85:[2,142],90:[2,142],92:[2,142],101:[2,142],102:87,103:[1,65],104:[1,230],105:[1,66],108:88,109:[1,68],110:69,117:[2,142],125:[2,142],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,148],6:[2,148],25:[2,148],26:[2,148],49:[2,148],54:[2,148],57:[2,148],72:[2,148],77:[2,148],85:[2,148],90:[2,148],92:[2,148],101:[2,148],103:[2,148],104:[2,148],105:[2,148],109:[2,148],117:[2,148],125:[2,148],127:[2,148],128:[2,148],131:[2,148],132:[2,148],133:[2,148],134:[2,148],135:[2,148],136:[2,148]},{1:[2,149],6:[2,149],25:[2,149],26:[2,149],49:[2,149],54:[2,149],57:[2,149],72:[2,149],77:[2,149],85:[2,149],90:[2,149],92:[2,149],101:[2,149],102:87,103:[1,65],104:[2,149],105:[1,66],108:88,109:[1,68],110:69,117:[2,149],125:[2,149],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,153],6:[2,153],25:[2,153],26:[2,153],49:[2,153],54:[2,153],57:[2,153],72:[2,153],77:[2,153],85:[2,153],90:[2,153],92:[2,153],101:[2,153],103:[2,153],104:[2,153],105:[2,153],109:[2,153],117:[2,153],125:[2,153],127:[2,153],128:[2,153],131:[2,153],132:[2,153],133:[2,153],134:[2,153],135:[2,153],136:[2,153]},{115:[2,155],116:[2,155]},{27:158,28:[1,73],44:159,58:160,59:161,75:[1,70],88:[1,113],89:[1,114],112:231,114:157},{54:[1,232],115:[2,161],116:[2,161]},{54:[2,157],115:[2,157],116:[2,157]},{54:[2,158],115:[2,158],116:[2,158]},{54:[2,159],115:[2,159],116:[2,159]},{54:[2,160],115:[2,160],116:[2,160]},{1:[2,154],6:[2,154],25:[2,154],26:[2,154],49:[2,154],54:[2,154],57:[2,154],72:[2,154],77:[2,154],85:[2,154],90:[2,154],92:[2,154],101:[2,154],103:[2,154],104:[2,154],105:[2,154],109:[2,154],117:[2,154],125:[2,154],127:[2,154],128:[2,154],131:[2,154],132:[2,154],133:[2,154],134:[2,154],135:[2,154],136:[2,154]},{8:233,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:234,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{6:[2,53],25:[2,53],53:235,54:[1,236],77:[2,53]},{6:[2,91],25:[2,91],26:[2,91],54:[2,91],77:[2,91]},{6:[2,39],25:[2,39],26:[2,39],43:[1,237],54:[2,39],77:[2,39]},{6:[2,42],25:[2,42],26:[2,42],54:[2,42],77:[2,42]},{6:[2,43],25:[2,43],26:[2,43],43:[2,43],54:[2,43],77:[2,43]},{6:[2,44],25:[2,44],26:[2,44],43:[2,44],54:[2,44],77:[2,44]},{6:[2,45],25:[2,45],26:[2,45],43:[2,45],54:[2,45],77:[2,45]},{1:[2,5],6:[2,5],26:[2,5],101:[2,5]},{1:[2,25],6:[2,25],25:[2,25],26:[2,25],49:[2,25],54:[2,25],57:[2,25],72:[2,25],77:[2,25],85:[2,25],90:[2,25],92:[2,25],97:[2,25],98:[2,25],101:[2,25],103:[2,25],104:[2,25],105:[2,25],109:[2,25],117:[2,25],120:[2,25],122:[2,25],125:[2,25],127:[2,25],128:[2,25],131:[2,25],132:[2,25],133:[2,25],134:[2,25],135:[2,25],136:[2,25]},{1:[2,192],6:[2,192],25:[2,192],26:[2,192],49:[2,192],54:[2,192],57:[2,192],72:[2,192],77:[2,192],85:[2,192],90:[2,192],92:[2,192],101:[2,192],102:87,103:[2,192],104:[2,192],105:[2,192],108:88,109:[2,192],110:69,117:[2,192],125:[2,192],127:[2,192],128:[2,192],131:[1,78],132:[1,81],133:[2,192],134:[2,192],135:[2,192],136:[2,192]},{1:[2,193],6:[2,193],25:[2,193],26:[2,193],49:[2,193],54:[2,193],57:[2,193],72:[2,193],77:[2,193],85:[2,193],90:[2,193],92:[2,193],101:[2,193],102:87,103:[2,193],104:[2,193],105:[2,193],108:88,109:[2,193],110:69,117:[2,193],125:[2,193],127:[2,193],128:[2,193],131:[1,78],132:[1,81],133:[2,193],134:[2,193],135:[2,193],136:[2,193]},{1:[2,194],6:[2,194],25:[2,194],26:[2,194],49:[2,194],54:[2,194],57:[2,194],72:[2,194],77:[2,194],85:[2,194],90:[2,194],92:[2,194],101:[2,194],102:87,103:[2,194],104:[2,194],105:[2,194],108:88,109:[2,194],110:69,117:[2,194],125:[2,194],127:[2,194],128:[2,194],131:[1,78],132:[2,194],133:[2,194],134:[2,194],135:[2,194],136:[2,194]},{1:[2,195],6:[2,195],25:[2,195],26:[2,195],49:[2,195],54:[2,195],57:[2,195],72:[2,195],77:[2,195],85:[2,195],90:[2,195],92:[2,195],101:[2,195],102:87,103:[2,195],104:[2,195],105:[2,195],108:88,109:[2,195],110:69,117:[2,195],125:[2,195],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[2,195],134:[2,195],135:[2,195],136:[2,195]},{1:[2,196],6:[2,196],25:[2,196],26:[2,196],49:[2,196],54:[2,196],57:[2,196],72:[2,196],77:[2,196],85:[2,196],90:[2,196],92:[2,196],101:[2,196],102:87,103:[2,196],104:[2,196],105:[2,196],108:88,109:[2,196],110:69,117:[2,196],125:[2,196],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[2,196],135:[2,196],136:[1,85]},{1:[2,197],6:[2,197],25:[2,197],26:[2,197],49:[2,197],54:[2,197],57:[2,197],72:[2,197],77:[2,197],85:[2,197],90:[2,197],92:[2,197],101:[2,197],102:87,103:[2,197],104:[2,197],105:[2,197],108:88,109:[2,197],110:69,117:[2,197],125:[2,197],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[2,197],136:[1,85]},{1:[2,198],6:[2,198],25:[2,198],26:[2,198],49:[2,198],54:[2,198],57:[2,198],72:[2,198],77:[2,198],85:[2,198],90:[2,198],92:[2,198],101:[2,198],102:87,103:[2,198],104:[2,198],105:[2,198],108:88,109:[2,198],110:69,117:[2,198],125:[2,198],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[2,198],135:[2,198],136:[2,198]},{1:[2,183],6:[2,183],25:[2,183],26:[2,183],49:[2,183],54:[2,183],57:[2,183],72:[2,183],77:[2,183],85:[2,183],90:[2,183],92:[2,183],101:[2,183],102:87,103:[1,65],104:[2,183],105:[1,66],108:88,109:[1,68],110:69,117:[2,183],125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,182],6:[2,182],25:[2,182],26:[2,182],49:[2,182],54:[2,182],57:[2,182],72:[2,182],77:[2,182],85:[2,182],90:[2,182],92:[2,182],101:[2,182],102:87,103:[1,65],104:[2,182],105:[1,66],108:88,109:[1,68],110:69,117:[2,182],125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,103],6:[2,103],25:[2,103],26:[2,103],49:[2,103],54:[2,103],57:[2,103],66:[2,103],67:[2,103],68:[2,103],70:[2,103],72:[2,103],73:[2,103],77:[2,103],83:[2,103],84:[2,103],85:[2,103],90:[2,103],92:[2,103],101:[2,103],103:[2,103],104:[2,103],105:[2,103],109:[2,103],117:[2,103],125:[2,103],127:[2,103],128:[2,103],131:[2,103],132:[2,103],133:[2,103],134:[2,103],135:[2,103],136:[2,103]},{1:[2,80],6:[2,80],25:[2,80],26:[2,80],40:[2,80],49:[2,80],54:[2,80],57:[2,80],66:[2,80],67:[2,80],68:[2,80],70:[2,80],72:[2,80],73:[2,80],77:[2,80],79:[2,80],83:[2,80],84:[2,80],85:[2,80],90:[2,80],92:[2,80],101:[2,80],103:[2,80],104:[2,80],105:[2,80],109:[2,80],117:[2,80],125:[2,80],127:[2,80],128:[2,80],129:[2,80],130:[2,80],131:[2,80],132:[2,80],133:[2,80],134:[2,80],135:[2,80],136:[2,80],137:[2,80]},{1:[2,81],6:[2,81],25:[2,81],26:[2,81],40:[2,81],49:[2,81],54:[2,81],57:[2,81],66:[2,81],67:[2,81],68:[2,81],70:[2,81],72:[2,81],73:[2,81],77:[2,81],79:[2,81],83:[2,81],84:[2,81],85:[2,81],90:[2,81],92:[2,81],101:[2,81],103:[2,81],104:[2,81],105:[2,81],109:[2,81],117:[2,81],125:[2,81],127:[2,81],128:[2,81],129:[2,81],130:[2,81],131:[2,81],132:[2,81],133:[2,81],134:[2,81],135:[2,81],136:[2,81],137:[2,81]},{1:[2,82],6:[2,82],25:[2,82],26:[2,82],40:[2,82],49:[2,82],54:[2,82],57:[2,82],66:[2,82],67:[2,82],68:[2,82],70:[2,82],72:[2,82],73:[2,82],77:[2,82],79:[2,82],83:[2,82],84:[2,82],85:[2,82],90:[2,82],92:[2,82],101:[2,82],103:[2,82],104:[2,82],105:[2,82],109:[2,82],117:[2,82],125:[2,82],127:[2,82],128:[2,82],129:[2,82],130:[2,82],131:[2,82],132:[2,82],133:[2,82],134:[2,82],135:[2,82],136:[2,82],137:[2,82]},{72:[1,238]},{57:[1,192],72:[2,87],91:239,92:[1,191],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{72:[2,88]},{8:240,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,72:[2,122],75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{12:[2,116],28:[2,116],30:[2,116],31:[2,116],33:[2,116],34:[2,116],35:[2,116],36:[2,116],37:[2,116],38:[2,116],45:[2,116],46:[2,116],47:[2,116],51:[2,116],52:[2,116],72:[2,116],75:[2,116],78:[2,116],82:[2,116],87:[2,116],88:[2,116],89:[2,116],95:[2,116],99:[2,116],100:[2,116],103:[2,116],105:[2,116],107:[2,116],109:[2,116],118:[2,116],124:[2,116],126:[2,116],127:[2,116],128:[2,116],129:[2,116],130:[2,116]},{12:[2,117],28:[2,117],30:[2,117],31:[2,117],33:[2,117],34:[2,117],35:[2,117],36:[2,117],37:[2,117],38:[2,117],45:[2,117],46:[2,117],47:[2,117],51:[2,117],52:[2,117],72:[2,117],75:[2,117],78:[2,117],82:[2,117],87:[2,117],88:[2,117],89:[2,117],95:[2,117],99:[2,117],100:[2,117],103:[2,117],105:[2,117],107:[2,117],109:[2,117],118:[2,117],124:[2,117],126:[2,117],127:[2,117],128:[2,117],129:[2,117],130:[2,117]},{1:[2,86],6:[2,86],25:[2,86],26:[2,86],40:[2,86],49:[2,86],54:[2,86],57:[2,86],66:[2,86],67:[2,86],68:[2,86],70:[2,86],72:[2,86],73:[2,86],77:[2,86],79:[2,86],83:[2,86],84:[2,86],85:[2,86],90:[2,86],92:[2,86],101:[2,86],103:[2,86],104:[2,86],105:[2,86],109:[2,86],117:[2,86],125:[2,86],127:[2,86],128:[2,86],129:[2,86],130:[2,86],131:[2,86],132:[2,86],133:[2,86],134:[2,86],135:[2,86],136:[2,86],137:[2,86]},{1:[2,104],6:[2,104],25:[2,104],26:[2,104],49:[2,104],54:[2,104],57:[2,104],66:[2,104],67:[2,104],68:[2,104],70:[2,104],72:[2,104],73:[2,104],77:[2,104],83:[2,104],84:[2,104],85:[2,104],90:[2,104],92:[2,104],101:[2,104],103:[2,104],104:[2,104],105:[2,104],109:[2,104],117:[2,104],125:[2,104],127:[2,104],128:[2,104],131:[2,104],132:[2,104],133:[2,104],134:[2,104],135:[2,104],136:[2,104]},{1:[2,36],6:[2,36],25:[2,36],26:[2,36],49:[2,36],54:[2,36],57:[2,36],72:[2,36],77:[2,36],85:[2,36],90:[2,36],92:[2,36],101:[2,36],102:87,103:[2,36],104:[2,36],105:[2,36],108:88,109:[2,36],110:69,117:[2,36],125:[2,36],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{8:241,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:242,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,109],6:[2,109],25:[2,109],26:[2,109],49:[2,109],54:[2,109],57:[2,109],66:[2,109],67:[2,109],68:[2,109],70:[2,109],72:[2,109],73:[2,109],77:[2,109],83:[2,109],84:[2,109],85:[2,109],90:[2,109],92:[2,109],101:[2,109],103:[2,109],104:[2,109],105:[2,109],109:[2,109],117:[2,109],125:[2,109],127:[2,109],128:[2,109],131:[2,109],132:[2,109],133:[2,109],134:[2,109],135:[2,109],136:[2,109]},{6:[2,53],25:[2,53],53:243,54:[1,226],85:[2,53]},{6:[2,128],25:[2,128],26:[2,128],54:[2,128],57:[1,244],85:[2,128],90:[2,128],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{50:245,51:[1,60],52:[1,61]},{6:[2,54],25:[2,54],26:[2,54],27:109,28:[1,73],44:110,55:246,56:108,58:111,59:112,75:[1,70],88:[1,113],89:[1,114]},{6:[1,247],25:[1,248]},{6:[2,61],25:[2,61],26:[2,61],49:[2,61],54:[2,61]},{8:249,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,199],6:[2,199],25:[2,199],26:[2,199],49:[2,199],54:[2,199],57:[2,199],72:[2,199],77:[2,199],85:[2,199],90:[2,199],92:[2,199],101:[2,199],102:87,103:[2,199],104:[2,199],105:[2,199],108:88,109:[2,199],110:69,117:[2,199],125:[2,199],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{8:250,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,201],6:[2,201],25:[2,201],26:[2,201],49:[2,201],54:[2,201],57:[2,201],72:[2,201],77:[2,201],85:[2,201],90:[2,201],92:[2,201],101:[2,201],102:87,103:[2,201],104:[2,201],105:[2,201],108:88,109:[2,201],110:69,117:[2,201],125:[2,201],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,181],6:[2,181],25:[2,181],26:[2,181],49:[2,181],54:[2,181],57:[2,181],72:[2,181],77:[2,181],85:[2,181],90:[2,181],92:[2,181],101:[2,181],103:[2,181],104:[2,181],105:[2,181],109:[2,181],117:[2,181],125:[2,181],127:[2,181],128:[2,181],131:[2,181],132:[2,181],133:[2,181],134:[2,181],135:[2,181],136:[2,181]},{8:251,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,133],6:[2,133],25:[2,133],26:[2,133],49:[2,133],54:[2,133],57:[2,133],72:[2,133],77:[2,133],85:[2,133],90:[2,133],92:[2,133],97:[1,252],101:[2,133],103:[2,133],104:[2,133],105:[2,133],109:[2,133],117:[2,133],125:[2,133],127:[2,133],128:[2,133],131:[2,133],132:[2,133],133:[2,133],134:[2,133],135:[2,133],136:[2,133]},{5:253,25:[1,5]},{27:254,28:[1,73]},{119:255,121:216,122:[1,217]},{26:[1,256],120:[1,257],121:258,122:[1,217]},{26:[2,174],120:[2,174],122:[2,174]},{8:260,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],94:259,95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,97],5:261,6:[2,97],25:[1,5],26:[2,97],49:[2,97],54:[2,97],57:[2,97],72:[2,97],77:[2,97],85:[2,97],90:[2,97],92:[2,97],101:[2,97],102:87,103:[1,65],104:[2,97],105:[1,66],108:88,109:[1,68],110:69,117:[2,97],125:[2,97],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,100],6:[2,100],25:[2,100],26:[2,100],49:[2,100],54:[2,100],57:[2,100],72:[2,100],77:[2,100],85:[2,100],90:[2,100],92:[2,100],101:[2,100],103:[2,100],104:[2,100],105:[2,100],109:[2,100],117:[2,100],125:[2,100],127:[2,100],128:[2,100],131:[2,100],132:[2,100],133:[2,100],134:[2,100],135:[2,100],136:[2,100]},{8:262,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,138],6:[2,138],25:[2,138],26:[2,138],49:[2,138],54:[2,138],57:[2,138],66:[2,138],67:[2,138],68:[2,138],70:[2,138],72:[2,138],73:[2,138],77:[2,138],83:[2,138],84:[2,138],85:[2,138],90:[2,138],92:[2,138],101:[2,138],103:[2,138],104:[2,138],105:[2,138],109:[2,138],117:[2,138],125:[2,138],127:[2,138],128:[2,138],131:[2,138],132:[2,138],133:[2,138],134:[2,138],135:[2,138],136:[2,138]},{6:[1,74],26:[1,263]},{8:264,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{6:[2,67],12:[2,117],25:[2,67],28:[2,117],30:[2,117],31:[2,117],33:[2,117],34:[2,117],35:[2,117],36:[2,117],37:[2,117],38:[2,117],45:[2,117],46:[2,117],47:[2,117],51:[2,117],52:[2,117],54:[2,67],75:[2,117],78:[2,117],82:[2,117],87:[2,117],88:[2,117],89:[2,117],90:[2,67],95:[2,117],99:[2,117],100:[2,117],103:[2,117],105:[2,117],107:[2,117],109:[2,117],118:[2,117],124:[2,117],126:[2,117],127:[2,117],128:[2,117],129:[2,117],130:[2,117]},{6:[1,266],25:[1,267],90:[1,265]},{6:[2,54],8:200,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[2,54],26:[2,54],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,60:147,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],85:[2,54],87:[1,58],88:[1,59],89:[1,57],90:[2,54],93:268,95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{6:[2,53],25:[2,53],26:[2,53],53:269,54:[1,226]},{1:[2,178],6:[2,178],25:[2,178],26:[2,178],49:[2,178],54:[2,178],57:[2,178],72:[2,178],77:[2,178],85:[2,178],90:[2,178],92:[2,178],101:[2,178],103:[2,178],104:[2,178],105:[2,178],109:[2,178],117:[2,178],120:[2,178],125:[2,178],127:[2,178],128:[2,178],131:[2,178],132:[2,178],133:[2,178],134:[2,178],135:[2,178],136:[2,178]},{8:270,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:271,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{115:[2,156],116:[2,156]},{27:158,28:[1,73],44:159,58:160,59:161,75:[1,70],88:[1,113],89:[1,114],114:272},{1:[2,163],6:[2,163],25:[2,163],26:[2,163],49:[2,163],54:[2,163],57:[2,163],72:[2,163],77:[2,163],85:[2,163],90:[2,163],92:[2,163],101:[2,163],102:87,103:[2,163],104:[1,273],105:[2,163],108:88,109:[2,163],110:69,117:[1,274],125:[2,163],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,164],6:[2,164],25:[2,164],26:[2,164],49:[2,164],54:[2,164],57:[2,164],72:[2,164],77:[2,164],85:[2,164],90:[2,164],92:[2,164],101:[2,164],102:87,103:[2,164],104:[1,275],105:[2,164],108:88,109:[2,164],110:69,117:[2,164],125:[2,164],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{6:[1,277],25:[1,278],77:[1,276]},{6:[2,54],11:168,25:[2,54],26:[2,54],27:169,28:[1,73],29:170,30:[1,71],31:[1,72],41:279,42:167,44:171,46:[1,46],77:[2,54],88:[1,113]},{8:280,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,281],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,85],6:[2,85],25:[2,85],26:[2,85],40:[2,85],49:[2,85],54:[2,85],57:[2,85],66:[2,85],67:[2,85],68:[2,85],70:[2,85],72:[2,85],73:[2,85],77:[2,85],79:[2,85],83:[2,85],84:[2,85],85:[2,85],90:[2,85],92:[2,85],101:[2,85],103:[2,85],104:[2,85],105:[2,85],109:[2,85],117:[2,85],125:[2,85],127:[2,85],128:[2,85],129:[2,85],130:[2,85],131:[2,85],132:[2,85],133:[2,85],134:[2,85],135:[2,85],136:[2,85],137:[2,85]},{8:282,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,72:[2,120],75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{72:[2,121],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,37],6:[2,37],25:[2,37],26:[2,37],49:[2,37],54:[2,37],57:[2,37],72:[2,37],77:[2,37],85:[2,37],90:[2,37],92:[2,37],101:[2,37],102:87,103:[2,37],104:[2,37],105:[2,37],108:88,109:[2,37],110:69,117:[2,37],125:[2,37],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{26:[1,283],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{6:[1,266],25:[1,267],85:[1,284]},{6:[2,67],25:[2,67],26:[2,67],54:[2,67],85:[2,67],90:[2,67]},{5:285,25:[1,5]},{6:[2,57],25:[2,57],26:[2,57],49:[2,57],54:[2,57]},{27:109,28:[1,73],44:110,55:286,56:108,58:111,59:112,75:[1,70],88:[1,113],89:[1,114]},{6:[2,55],25:[2,55],26:[2,55],27:109,28:[1,73],44:110,48:287,54:[2,55],55:107,56:108,58:111,59:112,75:[1,70],88:[1,113],89:[1,114]},{6:[2,62],25:[2,62],26:[2,62],49:[2,62],54:[2,62],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{26:[1,288],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{5:289,25:[1,5],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{5:290,25:[1,5]},{1:[2,134],6:[2,134],25:[2,134],26:[2,134],49:[2,134],54:[2,134],57:[2,134],72:[2,134],77:[2,134],85:[2,134],90:[2,134],92:[2,134],101:[2,134],103:[2,134],104:[2,134],105:[2,134],109:[2,134],117:[2,134],125:[2,134],127:[2,134],128:[2,134],131:[2,134],132:[2,134],133:[2,134],134:[2,134],135:[2,134],136:[2,134]},{5:291,25:[1,5]},{26:[1,292],120:[1,293],121:258,122:[1,217]},{1:[2,172],6:[2,172],25:[2,172],26:[2,172],49:[2,172],54:[2,172],57:[2,172],72:[2,172],77:[2,172],85:[2,172],90:[2,172],92:[2,172],101:[2,172],103:[2,172],104:[2,172],105:[2,172],109:[2,172],117:[2,172],125:[2,172],127:[2,172],128:[2,172],131:[2,172],132:[2,172],133:[2,172],134:[2,172],135:[2,172],136:[2,172]},{5:294,25:[1,5]},{26:[2,175],120:[2,175],122:[2,175]},{5:295,25:[1,5],54:[1,296]},{25:[2,130],54:[2,130],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,98],6:[2,98],25:[2,98],26:[2,98],49:[2,98],54:[2,98],57:[2,98],72:[2,98],77:[2,98],85:[2,98],90:[2,98],92:[2,98],101:[2,98],103:[2,98],104:[2,98],105:[2,98],109:[2,98],117:[2,98],125:[2,98],127:[2,98],128:[2,98],131:[2,98],132:[2,98],133:[2,98],134:[2,98],135:[2,98],136:[2,98]},{1:[2,101],5:297,6:[2,101],25:[1,5],26:[2,101],49:[2,101],54:[2,101],57:[2,101],72:[2,101],77:[2,101],85:[2,101],90:[2,101],92:[2,101],101:[2,101],102:87,103:[1,65],104:[2,101],105:[1,66],108:88,109:[1,68],110:69,117:[2,101],125:[2,101],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{101:[1,298]},{90:[1,299],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,115],6:[2,115],25:[2,115],26:[2,115],40:[2,115],49:[2,115],54:[2,115],57:[2,115],66:[2,115],67:[2,115],68:[2,115],70:[2,115],72:[2,115],73:[2,115],77:[2,115],83:[2,115],84:[2,115],85:[2,115],90:[2,115],92:[2,115],101:[2,115],103:[2,115],104:[2,115],105:[2,115],109:[2,115],115:[2,115],116:[2,115],117:[2,115],125:[2,115],127:[2,115],128:[2,115],131:[2,115],132:[2,115],133:[2,115],134:[2,115],135:[2,115],136:[2,115]},{8:200,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,60:147,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],93:300,95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:200,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,146],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,60:147,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],86:301,87:[1,58],88:[1,59],89:[1,57],93:145,95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{6:[2,124],25:[2,124],26:[2,124],54:[2,124],85:[2,124],90:[2,124]},{6:[1,266],25:[1,267],26:[1,302]},{1:[2,141],6:[2,141],25:[2,141],26:[2,141],49:[2,141],54:[2,141],57:[2,141],72:[2,141],77:[2,141],85:[2,141],90:[2,141],92:[2,141],101:[2,141],102:87,103:[1,65],104:[2,141],105:[1,66],108:88,109:[1,68],110:69,117:[2,141],125:[2,141],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,143],6:[2,143],25:[2,143],26:[2,143],49:[2,143],54:[2,143],57:[2,143],72:[2,143],77:[2,143],85:[2,143],90:[2,143],92:[2,143],101:[2,143],102:87,103:[1,65],104:[2,143],105:[1,66],108:88,109:[1,68],110:69,117:[2,143],125:[2,143],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{115:[2,162],116:[2,162]},{8:303,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:304,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:305,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,89],6:[2,89],25:[2,89],26:[2,89],40:[2,89],49:[2,89],54:[2,89],57:[2,89],66:[2,89],67:[2,89],68:[2,89],70:[2,89],72:[2,89],73:[2,89],77:[2,89],83:[2,89],84:[2,89],85:[2,89],90:[2,89],92:[2,89],101:[2,89],103:[2,89],104:[2,89],105:[2,89],109:[2,89],115:[2,89],116:[2,89],117:[2,89],125:[2,89],127:[2,89],128:[2,89],131:[2,89],132:[2,89],133:[2,89],134:[2,89],135:[2,89],136:[2,89]},{11:168,27:169,28:[1,73],29:170,30:[1,71],31:[1,72],41:306,42:167,44:171,46:[1,46],88:[1,113]},{6:[2,90],11:168,25:[2,90],26:[2,90],27:169,28:[1,73],29:170,30:[1,71],31:[1,72],41:166,42:167,44:171,46:[1,46],54:[2,90],76:307,88:[1,113]},{6:[2,92],25:[2,92],26:[2,92],54:[2,92],77:[2,92]},{6:[2,40],25:[2,40],26:[2,40],54:[2,40],77:[2,40],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{8:308,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{72:[2,119],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,38],6:[2,38],25:[2,38],26:[2,38],49:[2,38],54:[2,38],57:[2,38],72:[2,38],77:[2,38],85:[2,38],90:[2,38],92:[2,38],101:[2,38],103:[2,38],104:[2,38],105:[2,38],109:[2,38],117:[2,38],125:[2,38],127:[2,38],128:[2,38],131:[2,38],132:[2,38],133:[2,38],134:[2,38],135:[2,38],136:[2,38]},{1:[2,110],6:[2,110],25:[2,110],26:[2,110],49:[2,110],54:[2,110],57:[2,110],66:[2,110],67:[2,110],68:[2,110],70:[2,110],72:[2,110],73:[2,110],77:[2,110],83:[2,110],84:[2,110],85:[2,110],90:[2,110],92:[2,110],101:[2,110],103:[2,110],104:[2,110],105:[2,110],109:[2,110],117:[2,110],125:[2,110],127:[2,110],128:[2,110],131:[2,110],132:[2,110],133:[2,110],134:[2,110],135:[2,110],136:[2,110]},{1:[2,49],6:[2,49],25:[2,49],26:[2,49],49:[2,49],54:[2,49],57:[2,49],72:[2,49],77:[2,49],85:[2,49],90:[2,49],92:[2,49],101:[2,49],103:[2,49],104:[2,49],105:[2,49],109:[2,49],117:[2,49],125:[2,49],127:[2,49],128:[2,49],131:[2,49],132:[2,49],133:[2,49],134:[2,49],135:[2,49],136:[2,49]},{6:[2,58],25:[2,58],26:[2,58],49:[2,58],54:[2,58]},{6:[2,53],25:[2,53],26:[2,53],53:309,54:[1,202]},{1:[2,200],6:[2,200],25:[2,200],26:[2,200],49:[2,200],54:[2,200],57:[2,200],72:[2,200],77:[2,200],85:[2,200],90:[2,200],92:[2,200],101:[2,200],103:[2,200],104:[2,200],105:[2,200],109:[2,200],117:[2,200],125:[2,200],127:[2,200],128:[2,200],131:[2,200],132:[2,200],133:[2,200],134:[2,200],135:[2,200],136:[2,200]},{1:[2,179],6:[2,179],25:[2,179],26:[2,179],49:[2,179],54:[2,179],57:[2,179],72:[2,179],77:[2,179],85:[2,179],90:[2,179],92:[2,179],101:[2,179],103:[2,179],104:[2,179],105:[2,179],109:[2,179],117:[2,179],120:[2,179],125:[2,179],127:[2,179],128:[2,179],131:[2,179],132:[2,179],133:[2,179],134:[2,179],135:[2,179],136:[2,179]},{1:[2,135],6:[2,135],25:[2,135],26:[2,135],49:[2,135],54:[2,135],57:[2,135],72:[2,135],77:[2,135],85:[2,135],90:[2,135],92:[2,135],101:[2,135],103:[2,135],104:[2,135],105:[2,135],109:[2,135],117:[2,135],125:[2,135],127:[2,135],128:[2,135],131:[2,135],132:[2,135],133:[2,135],134:[2,135],135:[2,135],136:[2,135]},{1:[2,136],6:[2,136],25:[2,136],26:[2,136],49:[2,136],54:[2,136],57:[2,136],72:[2,136],77:[2,136],85:[2,136],90:[2,136],92:[2,136],97:[2,136],101:[2,136],103:[2,136],104:[2,136],105:[2,136],109:[2,136],117:[2,136],125:[2,136],127:[2,136],128:[2,136],131:[2,136],132:[2,136],133:[2,136],134:[2,136],135:[2,136],136:[2,136]},{1:[2,170],6:[2,170],25:[2,170],26:[2,170],49:[2,170],54:[2,170],57:[2,170],72:[2,170],77:[2,170],85:[2,170],90:[2,170],92:[2,170],101:[2,170],103:[2,170],104:[2,170],105:[2,170],109:[2,170],117:[2,170],125:[2,170],127:[2,170],128:[2,170],131:[2,170],132:[2,170],133:[2,170],134:[2,170],135:[2,170],136:[2,170]},{5:310,25:[1,5]},{26:[1,311]},{6:[1,312],26:[2,176],120:[2,176],122:[2,176]},{8:313,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,102],6:[2,102],25:[2,102],26:[2,102],49:[2,102],54:[2,102],57:[2,102],72:[2,102],77:[2,102],85:[2,102],90:[2,102],92:[2,102],101:[2,102],103:[2,102],104:[2,102],105:[2,102],109:[2,102],117:[2,102],125:[2,102],127:[2,102],128:[2,102],131:[2,102],132:[2,102],133:[2,102],134:[2,102],135:[2,102],136:[2,102]},{1:[2,139],6:[2,139],25:[2,139],26:[2,139],49:[2,139],54:[2,139],57:[2,139],66:[2,139],67:[2,139],68:[2,139],70:[2,139],72:[2,139],73:[2,139],77:[2,139],83:[2,139],84:[2,139],85:[2,139],90:[2,139],92:[2,139],101:[2,139],103:[2,139],104:[2,139],105:[2,139],109:[2,139],117:[2,139],125:[2,139],127:[2,139],128:[2,139],131:[2,139],132:[2,139],133:[2,139],134:[2,139],135:[2,139],136:[2,139]},{1:[2,118],6:[2,118],25:[2,118],26:[2,118],49:[2,118],54:[2,118],57:[2,118],66:[2,118],67:[2,118],68:[2,118],70:[2,118],72:[2,118],73:[2,118],77:[2,118],83:[2,118],84:[2,118],85:[2,118],90:[2,118],92:[2,118],101:[2,118],103:[2,118],104:[2,118],105:[2,118],109:[2,118],117:[2,118],125:[2,118],127:[2,118],128:[2,118],131:[2,118],132:[2,118],133:[2,118],134:[2,118],135:[2,118],136:[2,118]},{6:[2,125],25:[2,125],26:[2,125],54:[2,125],85:[2,125],90:[2,125]},{6:[2,53],25:[2,53],26:[2,53],53:314,54:[1,226]},{6:[2,126],25:[2,126],26:[2,126],54:[2,126],85:[2,126],90:[2,126]},{1:[2,165],6:[2,165],25:[2,165],26:[2,165],49:[2,165],54:[2,165],57:[2,165],72:[2,165],77:[2,165],85:[2,165],90:[2,165],92:[2,165],101:[2,165],102:87,103:[2,165],104:[2,165],105:[2,165],108:88,109:[2,165],110:69,117:[1,315],125:[2,165],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,167],6:[2,167],25:[2,167],26:[2,167],49:[2,167],54:[2,167],57:[2,167],72:[2,167],77:[2,167],85:[2,167],90:[2,167],92:[2,167],101:[2,167],102:87,103:[2,167],104:[1,316],105:[2,167],108:88,109:[2,167],110:69,117:[2,167],125:[2,167],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,166],6:[2,166],25:[2,166],26:[2,166],49:[2,166],54:[2,166],57:[2,166],72:[2,166],77:[2,166],85:[2,166],90:[2,166],92:[2,166],101:[2,166],102:87,103:[2,166],104:[2,166],105:[2,166],108:88,109:[2,166],110:69,117:[2,166],125:[2,166],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{6:[2,93],25:[2,93],26:[2,93],54:[2,93],77:[2,93]},{6:[2,53],25:[2,53],26:[2,53],53:317,54:[1,236]},{26:[1,318],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{6:[1,247],25:[1,248],26:[1,319]},{26:[1,320]},{1:[2,173],6:[2,173],25:[2,173],26:[2,173],49:[2,173],54:[2,173],57:[2,173],72:[2,173],77:[2,173],85:[2,173],90:[2,173],92:[2,173],101:[2,173],103:[2,173],104:[2,173],105:[2,173],109:[2,173],117:[2,173],125:[2,173],127:[2,173],128:[2,173],131:[2,173],132:[2,173],133:[2,173],134:[2,173],135:[2,173],136:[2,173]},{26:[2,177],120:[2,177],122:[2,177]},{25:[2,131],54:[2,131],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{6:[1,266],25:[1,267],26:[1,321]},{8:322,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:323,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{6:[1,277],25:[1,278],26:[1,324]},{6:[2,41],25:[2,41],26:[2,41],54:[2,41],77:[2,41]},{6:[2,59],25:[2,59],26:[2,59],49:[2,59],54:[2,59]},{1:[2,171],6:[2,171],25:[2,171],26:[2,171],49:[2,171],54:[2,171],57:[2,171],72:[2,171],77:[2,171],85:[2,171],90:[2,171],92:[2,171],101:[2,171],103:[2,171],104:[2,171],105:[2,171],109:[2,171],117:[2,171],125:[2,171],127:[2,171],128:[2,171],131:[2,171],132:[2,171],133:[2,171],134:[2,171],135:[2,171],136:[2,171]},{6:[2,127],25:[2,127],26:[2,127],54:[2,127],85:[2,127],90:[2,127]},{1:[2,168],6:[2,168],25:[2,168],26:[2,168],49:[2,168],54:[2,168],57:[2,168],72:[2,168],77:[2,168],85:[2,168],90:[2,168],92:[2,168],101:[2,168],102:87,103:[2,168],104:[2,168],105:[2,168],108:88,109:[2,168],110:69,117:[2,168],125:[2,168],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,169],6:[2,169],25:[2,169],26:[2,169],49:[2,169],54:[2,169],57:[2,169],72:[2,169],77:[2,169],85:[2,169],90:[2,169],92:[2,169],101:[2,169],102:87,103:[2,169],104:[2,169],105:[2,169],108:88,109:[2,169],110:69,117:[2,169],125:[2,169],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{6:[2,94],25:[2,94],26:[2,94],54:[2,94],77:[2,94]}],
-defaultActions: {60:[2,51],61:[2,52],75:[2,3],94:[2,108],189:[2,88]},
-parseError: function parseError(str, hash) {
- throw new Error(str);
-},
-parse: function parse(input) {
- var self = this,
- stack = [0],
- vstack = [null], // semantic value stack
- lstack = [], // location stack
- table = this.table,
- yytext = '',
- yylineno = 0,
- yyleng = 0,
- recovering = 0,
- TERROR = 2,
- EOF = 1;
-
- this.lexer.setInput(input);
- this.lexer.yy = this.yy;
- this.yy.lexer = this.lexer;
- if (typeof this.lexer.yylloc == 'undefined')
- this.lexer.yylloc = {};
- var yyloc = this.lexer.yylloc;
- lstack.push(yyloc);
-
- if (typeof this.yy.parseError === 'function')
- this.parseError = this.yy.parseError;
-
- function popStack (n) {
- stack.length = stack.length - 2*n;
- vstack.length = vstack.length - n;
- lstack.length = lstack.length - n;
- }
-
- function lex() {
- var token;
- token = self.lexer.lex() || 1; // $end = 1
- if (typeof token !== 'number') {
- token = self.symbols_[token] || token;
- }
- return token;
- }
-
- var symbol, preErrorSymbol, state, action, a, r, yyval={},p,len,newState, expected;
- while (true) {
- state = stack[stack.length-1];
- if (this.defaultActions[state]) {
- action = this.defaultActions[state];
- } else {
- if (symbol == null)
- symbol = lex();
- action = table[state] && table[state][symbol];
- }
- _handle_error:
- if (typeof action === 'undefined' || !action.length || !action[0]) {
-
- if (!recovering) {
- expected = [];
- for (p in table[state]) if (this.terminals_[p] && p > 2) {
- expected.push("'"+this.terminals_[p]+"'");
- }
- var errStr = '';
- if (this.lexer.showPosition) {
- errStr = 'Parse error on line '+(yylineno+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+expected.join(', ') + ", got '" + this.terminals_[symbol]+ "'";
- } else {
- errStr = 'Parse error on line '+(yylineno+1)+": Unexpected " +
- (symbol == 1 /*EOF*/ ? "end of input" :
- ("'"+(this.terminals_[symbol] || symbol)+"'"));
- }
- this.parseError(errStr,
- {text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected});
- }
- if (recovering == 3) {
- if (symbol == EOF) {
- throw new Error(errStr || 'Parsing halted.');
- }
- yyleng = this.lexer.yyleng;
- yytext = this.lexer.yytext;
- yylineno = this.lexer.yylineno;
- yyloc = this.lexer.yylloc;
- symbol = lex();
- }
- while (1) {
- if ((TERROR.toString()) in table[state]) {
- break;
- }
- if (state == 0) {
- throw new Error(errStr || 'Parsing halted.');
- }
- popStack(1);
- state = stack[stack.length-1];
- }
-
- preErrorSymbol = symbol; // save the lookahead token
- symbol = TERROR; // insert generic error symbol as new lookahead
- state = stack[stack.length-1];
- action = table[state] && table[state][TERROR];
- recovering = 3; // allow 3 real symbols to be shifted before reporting a new error
- }
- if (action[0] instanceof Array && action.length > 1) {
- throw new Error('Parse Error: multiple actions possible at state: '+state+', token: '+symbol);
- }
-
- switch (action[0]) {
-
- case 1: // shift
-
- stack.push(symbol);
- vstack.push(this.lexer.yytext);
- lstack.push(this.lexer.yylloc);
- stack.push(action[1]); // push state
- symbol = null;
- if (!preErrorSymbol) { // normal execution/no error
- yyleng = this.lexer.yyleng;
- yytext = this.lexer.yytext;
- yylineno = this.lexer.yylineno;
- yyloc = this.lexer.yylloc;
- if (recovering > 0)
- recovering--;
- } else { // error just occurred, resume old lookahead f/ before error
- symbol = preErrorSymbol;
- preErrorSymbol = null;
- }
- break;
-
- case 2: // reduce
-
- len = this.productions_[action[1]][1];
- yyval.$ = vstack[vstack.length-len]; // default to $$ = $1
- yyval._$ = {
- first_line: lstack[lstack.length-(len||1)].first_line,
- last_line: lstack[lstack.length-1].last_line,
- first_column: lstack[lstack.length-(len||1)].first_column,
- last_column: lstack[lstack.length-1].last_column
- };
- r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack);
-
- if (typeof r !== 'undefined') {
- return r;
- }
- if (len) {
- stack = stack.slice(0,-1*len*2);
- vstack = vstack.slice(0, -1*len);
- lstack = lstack.slice(0, -1*len);
- }
-
- stack.push(this.productions_[action[1]][0]); // push nonterminal (reduce)
- vstack.push(yyval.$);
- lstack.push(yyval._$);
- newState = table[stack[stack.length-2]][stack[stack.length-1]];
- stack.push(newState);
- break;
-
- case 3: // accept
- return true;
- }
-
- }
-
- return true;
-}};
-undefined
-
-module.exports = parser;
-
-
-});
-
-define('ace/mode/coffee/nodes', ['require', 'exports', 'module' , 'ace/mode/coffee/scope', 'ace/mode/coffee/lexer', 'ace/mode/coffee/helpers'], function(require, exports, module) {
-
- var Access, Arr, Assign, Base, Block, Call, Class, Closure, Code, Comment, Existence, Extends, For, IDENTIFIER, IDENTIFIER_STR, IS_STRING, If, In, Index, LEVEL_ACCESS, LEVEL_COND, LEVEL_LIST, LEVEL_OP, LEVEL_PAREN, LEVEL_TOP, Literal, METHOD_DEF, NEGATE, NO, Obj, Op, Param, Parens, RESERVED, Range, Return, SIMPLENUM, STRICT_PROSCRIBED, Scope, Slice, Splat, Switch, TAB, THIS, Throw, Try, UTILITIES, Value, While, YES, compact, del, ends, extend, flatten, last, merge, multident, some, starts, unfoldSoak, utility, _ref, _ref1,
- __hasProp = {}.hasOwnProperty,
- __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
- __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
-
- Scope = require('./scope').Scope;
-
- _ref = require('./lexer'), RESERVED = _ref.RESERVED, STRICT_PROSCRIBED = _ref.STRICT_PROSCRIBED;
-
- _ref1 = require('./helpers'), compact = _ref1.compact, flatten = _ref1.flatten, extend = _ref1.extend, merge = _ref1.merge, del = _ref1.del, starts = _ref1.starts, ends = _ref1.ends, last = _ref1.last, some = _ref1.some;
-
- exports.extend = extend;
-
- YES = function() {
- return true;
- };
-
- NO = function() {
- return false;
- };
-
- THIS = function() {
- return this;
- };
-
- NEGATE = function() {
- this.negated = !this.negated;
- return this;
- };
-
- exports.Base = Base = (function() {
-
- function Base() {}
-
- Base.prototype.compile = function(o, lvl) {
- var node;
- o = extend({}, o);
- if (lvl) {
- o.level = lvl;
- }
- node = this.unfoldSoak(o) || this;
- node.tab = o.indent;
- if (o.level === LEVEL_TOP || !node.isStatement(o)) {
- return node.compileNode(o);
- } else {
- return node.compileClosure(o);
- }
- };
-
- Base.prototype.compileClosure = function(o) {
- if (this.jumps()) {
- throw SyntaxError('cannot use a pure statement in an expression.');
- }
- o.sharedScope = true;
- return Closure.wrap(this).compileNode(o);
- };
-
- Base.prototype.cache = function(o, level, reused) {
- var ref, sub;
- if (!this.isComplex()) {
- ref = level ? this.compile(o, level) : this;
- return [ref, ref];
- } else {
- ref = new Literal(reused || o.scope.freeVariable('ref'));
- sub = new Assign(ref, this);
- if (level) {
- return [sub.compile(o, level), ref.value];
- } else {
- return [sub, ref];
- }
- }
- };
-
- Base.prototype.compileLoopReference = function(o, name) {
- var src, tmp;
- src = tmp = this.compile(o, LEVEL_LIST);
- if (!((-Infinity < +src && +src < Infinity) || IDENTIFIER.test(src) && o.scope.check(src, true))) {
- src = "" + (tmp = o.scope.freeVariable(name)) + " = " + src;
- }
- return [src, tmp];
- };
-
- Base.prototype.makeReturn = function(res) {
- var me;
- me = this.unwrapAll();
- if (res) {
- return new Call(new Literal("" + res + ".push"), [me]);
- } else {
- return new Return(me);
- }
- };
-
- Base.prototype.contains = function(pred) {
- var contains;
- contains = false;
- this.traverseChildren(false, function(node) {
- if (pred(node)) {
- contains = true;
- return false;
- }
- });
- return contains;
- };
-
- Base.prototype.containsType = function(type) {
- return this instanceof type || this.contains(function(node) {
- return node instanceof type;
- });
- };
-
- Base.prototype.lastNonComment = function(list) {
- var i;
- i = list.length;
- while (i--) {
- if (!(list[i] instanceof Comment)) {
- return list[i];
- }
- }
- return null;
- };
-
- Base.prototype.toString = function(idt, name) {
- var tree;
- if (idt == null) {
- idt = '';
- }
- if (name == null) {
- name = this.constructor.name;
- }
- tree = '\n' + idt + name;
- if (this.soak) {
- tree += '?';
- }
- this.eachChild(function(node) {
- return tree += node.toString(idt + TAB);
- });
- return tree;
- };
-
- Base.prototype.eachChild = function(func) {
- var attr, child, _i, _j, _len, _len1, _ref2, _ref3;
- if (!this.children) {
- return this;
- }
- _ref2 = this.children;
- for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
- attr = _ref2[_i];
- if (this[attr]) {
- _ref3 = flatten([this[attr]]);
- for (_j = 0, _len1 = _ref3.length; _j < _len1; _j++) {
- child = _ref3[_j];
- if (func(child) === false) {
- return this;
- }
- }
- }
- }
- return this;
- };
-
- Base.prototype.traverseChildren = function(crossScope, func) {
- return this.eachChild(function(child) {
- if (func(child) === false) {
- return false;
- }
- return child.traverseChildren(crossScope, func);
- });
- };
-
- Base.prototype.invert = function() {
- return new Op('!', this);
- };
-
- Base.prototype.unwrapAll = function() {
- var node;
- node = this;
- while (node !== (node = node.unwrap())) {
- continue;
- }
- return node;
- };
-
- Base.prototype.children = [];
-
- Base.prototype.isStatement = NO;
-
- Base.prototype.jumps = NO;
-
- Base.prototype.isComplex = YES;
-
- Base.prototype.isChainable = NO;
-
- Base.prototype.isAssignable = NO;
-
- Base.prototype.unwrap = THIS;
-
- Base.prototype.unfoldSoak = NO;
-
- Base.prototype.assigns = NO;
-
- return Base;
-
- })();
-
- exports.Block = Block = (function(_super) {
-
- __extends(Block, _super);
-
- function Block(nodes) {
- this.expressions = compact(flatten(nodes || []));
- }
-
- Block.prototype.children = ['expressions'];
-
- Block.prototype.push = function(node) {
- this.expressions.push(node);
- return this;
- };
-
- Block.prototype.pop = function() {
- return this.expressions.pop();
- };
-
- Block.prototype.unshift = function(node) {
- this.expressions.unshift(node);
- return this;
- };
-
- Block.prototype.unwrap = function() {
- if (this.expressions.length === 1) {
- return this.expressions[0];
- } else {
- return this;
- }
- };
-
- Block.prototype.isEmpty = function() {
- return !this.expressions.length;
- };
-
- Block.prototype.isStatement = function(o) {
- var exp, _i, _len, _ref2;
- _ref2 = this.expressions;
- for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
- exp = _ref2[_i];
- if (exp.isStatement(o)) {
- return true;
- }
- }
- return false;
- };
-
- Block.prototype.jumps = function(o) {
- var exp, _i, _len, _ref2;
- _ref2 = this.expressions;
- for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
- exp = _ref2[_i];
- if (exp.jumps(o)) {
- return exp;
- }
- }
- };
-
- Block.prototype.makeReturn = function(res) {
- var expr, len;
- len = this.expressions.length;
- while (len--) {
- expr = this.expressions[len];
- if (!(expr instanceof Comment)) {
- this.expressions[len] = expr.makeReturn(res);
- if (expr instanceof Return && !expr.expression) {
- this.expressions.splice(len, 1);
- }
- break;
- }
- }
- return this;
- };
-
- Block.prototype.compile = function(o, level) {
- if (o == null) {
- o = {};
- }
- if (o.scope) {
- return Block.__super__.compile.call(this, o, level);
- } else {
- return this.compileRoot(o);
- }
- };
-
- Block.prototype.compileNode = function(o) {
- var code, codes, node, top, _i, _len, _ref2;
- this.tab = o.indent;
- top = o.level === LEVEL_TOP;
- codes = [];
- _ref2 = this.expressions;
- for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
- node = _ref2[_i];
- node = node.unwrapAll();
- node = node.unfoldSoak(o) || node;
- if (node instanceof Block) {
- codes.push(node.compileNode(o));
- } else if (top) {
- node.front = true;
- code = node.compile(o);
- if (!node.isStatement(o)) {
- code = "" + this.tab + code + ";";
- if (node instanceof Literal) {
- code = "" + code + "\n";
- }
- }
- codes.push(code);
- } else {
- codes.push(node.compile(o, LEVEL_LIST));
- }
- }
- if (top) {
- if (this.spaced) {
- return "\n" + (codes.join('\n\n')) + "\n";
- } else {
- return codes.join('\n');
- }
- }
- code = codes.join(', ') || 'void 0';
- if (codes.length > 1 && o.level >= LEVEL_LIST) {
- return "(" + code + ")";
- } else {
- return code;
- }
- };
-
- Block.prototype.compileRoot = function(o) {
- var code, exp, i, prelude, preludeExps, rest;
- o.indent = o.bare ? '' : TAB;
- o.scope = new Scope(null, this, null);
- o.level = LEVEL_TOP;
- this.spaced = true;
- prelude = "";
- if (!o.bare) {
- preludeExps = (function() {
- var _i, _len, _ref2, _results;
- _ref2 = this.expressions;
- _results = [];
- for (i = _i = 0, _len = _ref2.length; _i < _len; i = ++_i) {
- exp = _ref2[i];
- if (!(exp.unwrap() instanceof Comment)) {
- break;
- }
- _results.push(exp);
- }
- return _results;
- }).call(this);
- rest = this.expressions.slice(preludeExps.length);
- this.expressions = preludeExps;
- if (preludeExps.length) {
- prelude = "" + (this.compileNode(merge(o, {
- indent: ''
- }))) + "\n";
- }
- this.expressions = rest;
- }
- code = this.compileWithDeclarations(o);
- if (o.bare) {
- return code;
- }
- return "" + prelude + "(function() {\n" + code + "\n}).call(this);\n";
- };
-
- Block.prototype.compileWithDeclarations = function(o) {
- var assigns, code, declars, exp, i, post, rest, scope, spaced, _i, _len, _ref2, _ref3, _ref4;
- code = post = '';
- _ref2 = this.expressions;
- for (i = _i = 0, _len = _ref2.length; _i < _len; i = ++_i) {
- exp = _ref2[i];
- exp = exp.unwrap();
- if (!(exp instanceof Comment || exp instanceof Literal)) {
- break;
- }
- }
- o = merge(o, {
- level: LEVEL_TOP
- });
- if (i) {
- rest = this.expressions.splice(i, 9e9);
- _ref3 = [this.spaced, false], spaced = _ref3[0], this.spaced = _ref3[1];
- _ref4 = [this.compileNode(o), spaced], code = _ref4[0], this.spaced = _ref4[1];
- this.expressions = rest;
- }
- post = this.compileNode(o);
- scope = o.scope;
- if (scope.expressions === this) {
- declars = o.scope.hasDeclarations();
- assigns = scope.hasAssignments;
- if (declars || assigns) {
- if (i) {
- code += '\n';
- }
- code += "" + this.tab + "var ";
- if (declars) {
- code += scope.declaredVariables().join(', ');
- }
- if (assigns) {
- if (declars) {
- code += ",\n" + (this.tab + TAB);
- }
- code += scope.assignedVariables().join(",\n" + (this.tab + TAB));
- }
- code += ';\n';
- }
- }
- return code + post;
- };
-
- Block.wrap = function(nodes) {
- if (nodes.length === 1 && nodes[0] instanceof Block) {
- return nodes[0];
- }
- return new Block(nodes);
- };
-
- return Block;
-
- })(Base);
-
- exports.Literal = Literal = (function(_super) {
-
- __extends(Literal, _super);
-
- function Literal(value) {
- this.value = value;
- }
-
- Literal.prototype.makeReturn = function() {
- if (this.isStatement()) {
- return this;
- } else {
- return Literal.__super__.makeReturn.apply(this, arguments);
- }
- };
-
- Literal.prototype.isAssignable = function() {
- return IDENTIFIER.test(this.value);
- };
-
- Literal.prototype.isStatement = function() {
- var _ref2;
- return (_ref2 = this.value) === 'break' || _ref2 === 'continue' || _ref2 === 'debugger';
- };
-
- Literal.prototype.isComplex = NO;
-
- Literal.prototype.assigns = function(name) {
- return name === this.value;
- };
-
- Literal.prototype.jumps = function(o) {
- if (this.value === 'break' && !((o != null ? o.loop : void 0) || (o != null ? o.block : void 0))) {
- return this;
- }
- if (this.value === 'continue' && !(o != null ? o.loop : void 0)) {
- return this;
- }
- };
-
- Literal.prototype.compileNode = function(o) {
- var code, _ref2;
- code = this.value === 'this' ? ((_ref2 = o.scope.method) != null ? _ref2.bound : void 0) ? o.scope.method.context : this.value : this.value.reserved ? "\"" + this.value + "\"" : this.value;
- if (this.isStatement()) {
- return "" + this.tab + code + ";";
- } else {
- return code;
- }
- };
-
- Literal.prototype.toString = function() {
- return ' "' + this.value + '"';
- };
-
- return Literal;
-
- })(Base);
-
- exports.Undefined = (function(_super) {
-
- __extends(Undefined, _super);
-
- function Undefined() {
- return Undefined.__super__.constructor.apply(this, arguments);
- }
-
- Undefined.prototype.isAssignable = NO;
-
- Undefined.prototype.isComplex = NO;
-
- Undefined.prototype.compileNode = function(o) {
- if (o.level >= LEVEL_ACCESS) {
- return '(void 0)';
- } else {
- return 'void 0';
- }
- };
-
- return Undefined;
-
- })(Base);
-
- exports.Null = (function(_super) {
-
- __extends(Null, _super);
-
- function Null() {
- return Null.__super__.constructor.apply(this, arguments);
- }
-
- Null.prototype.isAssignable = NO;
-
- Null.prototype.isComplex = NO;
-
- Null.prototype.compileNode = function() {
- return "null";
- };
-
- return Null;
-
- })(Base);
-
- exports.Bool = (function(_super) {
-
- __extends(Bool, _super);
-
- Bool.prototype.isAssignable = NO;
-
- Bool.prototype.isComplex = NO;
-
- Bool.prototype.compileNode = function() {
- return this.val;
- };
-
- function Bool(val) {
- this.val = val;
- }
-
- return Bool;
-
- })(Base);
-
- exports.Return = Return = (function(_super) {
-
- __extends(Return, _super);
-
- function Return(expr) {
- if (expr && !expr.unwrap().isUndefined) {
- this.expression = expr;
- }
- }
-
- Return.prototype.children = ['expression'];
-
- Return.prototype.isStatement = YES;
-
- Return.prototype.makeReturn = THIS;
-
- Return.prototype.jumps = THIS;
-
- Return.prototype.compile = function(o, level) {
- var expr, _ref2;
- expr = (_ref2 = this.expression) != null ? _ref2.makeReturn() : void 0;
- if (expr && !(expr instanceof Return)) {
- return expr.compile(o, level);
- } else {
- return Return.__super__.compile.call(this, o, level);
- }
- };
-
- Return.prototype.compileNode = function(o) {
- return this.tab + ("return" + [this.expression ? " " + (this.expression.compile(o, LEVEL_PAREN)) : void 0] + ";");
- };
-
- return Return;
-
- })(Base);
-
- exports.Value = Value = (function(_super) {
-
- __extends(Value, _super);
-
- function Value(base, props, tag) {
- if (!props && base instanceof Value) {
- return base;
- }
- this.base = base;
- this.properties = props || [];
- if (tag) {
- this[tag] = true;
- }
- return this;
- }
-
- Value.prototype.children = ['base', 'properties'];
-
- Value.prototype.add = function(props) {
- this.properties = this.properties.concat(props);
- return this;
- };
-
- Value.prototype.hasProperties = function() {
- return !!this.properties.length;
- };
-
- Value.prototype.isArray = function() {
- return !this.properties.length && this.base instanceof Arr;
- };
-
- Value.prototype.isComplex = function() {
- return this.hasProperties() || this.base.isComplex();
- };
-
- Value.prototype.isAssignable = function() {
- return this.hasProperties() || this.base.isAssignable();
- };
-
- Value.prototype.isSimpleNumber = function() {
- return this.base instanceof Literal && SIMPLENUM.test(this.base.value);
- };
-
- Value.prototype.isString = function() {
- return this.base instanceof Literal && IS_STRING.test(this.base.value);
- };
-
- Value.prototype.isAtomic = function() {
- var node, _i, _len, _ref2;
- _ref2 = this.properties.concat(this.base);
- for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
- node = _ref2[_i];
- if (node.soak || node instanceof Call) {
- return false;
- }
- }
- return true;
- };
-
- Value.prototype.isStatement = function(o) {
- return !this.properties.length && this.base.isStatement(o);
- };
-
- Value.prototype.assigns = function(name) {
- return !this.properties.length && this.base.assigns(name);
- };
-
- Value.prototype.jumps = function(o) {
- return !this.properties.length && this.base.jumps(o);
- };
-
- Value.prototype.isObject = function(onlyGenerated) {
- if (this.properties.length) {
- return false;
- }
- return (this.base instanceof Obj) && (!onlyGenerated || this.base.generated);
- };
-
- Value.prototype.isSplice = function() {
- return last(this.properties) instanceof Slice;
- };
-
- Value.prototype.unwrap = function() {
- if (this.properties.length) {
- return this;
- } else {
- return this.base;
- }
- };
-
- Value.prototype.cacheReference = function(o) {
- var base, bref, name, nref;
- name = last(this.properties);
- if (this.properties.length < 2 && !this.base.isComplex() && !(name != null ? name.isComplex() : void 0)) {
- return [this, this];
- }
- base = new Value(this.base, this.properties.slice(0, -1));
- if (base.isComplex()) {
- bref = new Literal(o.scope.freeVariable('base'));
- base = new Value(new Parens(new Assign(bref, base)));
- }
- if (!name) {
- return [base, bref];
- }
- if (name.isComplex()) {
- nref = new Literal(o.scope.freeVariable('name'));
- name = new Index(new Assign(nref, name.index));
- nref = new Index(nref);
- }
- return [base.add(name), new Value(bref || base.base, [nref || name])];
- };
-
- Value.prototype.compileNode = function(o) {
- var code, prop, props, _i, _len;
- this.base.front = this.front;
- props = this.properties;
- code = this.base.compile(o, props.length ? LEVEL_ACCESS : null);
- if ((this.base instanceof Parens || props.length) && SIMPLENUM.test(code)) {
- code = "" + code + ".";
- }
- for (_i = 0, _len = props.length; _i < _len; _i++) {
- prop = props[_i];
- code += prop.compile(o);
- }
- return code;
- };
-
- Value.prototype.unfoldSoak = function(o) {
- var result,
- _this = this;
- if (this.unfoldedSoak != null) {
- return this.unfoldedSoak;
- }
- result = (function() {
- var fst, i, ifn, prop, ref, snd, _i, _len, _ref2;
- if (ifn = _this.base.unfoldSoak(o)) {
- Array.prototype.push.apply(ifn.body.properties, _this.properties);
- return ifn;
- }
- _ref2 = _this.properties;
- for (i = _i = 0, _len = _ref2.length; _i < _len; i = ++_i) {
- prop = _ref2[i];
- if (!prop.soak) {
- continue;
- }
- prop.soak = false;
- fst = new Value(_this.base, _this.properties.slice(0, i));
- snd = new Value(_this.base, _this.properties.slice(i));
- if (fst.isComplex()) {
- ref = new Literal(o.scope.freeVariable('ref'));
- fst = new Parens(new Assign(ref, fst));
- snd.base = ref;
- }
- return new If(new Existence(fst), snd, {
- soak: true
- });
- }
- return null;
- })();
- return this.unfoldedSoak = result || false;
- };
-
- return Value;
-
- })(Base);
-
- exports.Comment = Comment = (function(_super) {
-
- __extends(Comment, _super);
-
- function Comment(comment) {
- this.comment = comment;
- }
-
- Comment.prototype.isStatement = YES;
-
- Comment.prototype.makeReturn = THIS;
-
- Comment.prototype.compileNode = function(o, level) {
- var code;
- code = '/*' + multident(this.comment, this.tab) + ("\n" + this.tab + "*/\n");
- if ((level || o.level) === LEVEL_TOP) {
- code = o.indent + code;
- }
- return code;
- };
-
- return Comment;
-
- })(Base);
-
- exports.Call = Call = (function(_super) {
-
- __extends(Call, _super);
-
- function Call(variable, args, soak) {
- this.args = args != null ? args : [];
- this.soak = soak;
- this.isNew = false;
- this.isSuper = variable === 'super';
- this.variable = this.isSuper ? null : variable;
- }
-
- Call.prototype.children = ['variable', 'args'];
-
- Call.prototype.newInstance = function() {
- var base, _ref2;
- base = ((_ref2 = this.variable) != null ? _ref2.base : void 0) || this.variable;
- if (base instanceof Call && !base.isNew) {
- base.newInstance();
- } else {
- this.isNew = true;
- }
- return this;
- };
-
- Call.prototype.superReference = function(o) {
- var accesses, method, name;
- method = o.scope.namedMethod();
- if (!method) {
- throw SyntaxError('cannot call super outside of a function.');
- }
- name = method.name;
- if (name == null) {
- throw SyntaxError('cannot call super on an anonymous function.');
- }
- if (method.klass) {
- accesses = [new Access(new Literal('__super__'))];
- if (method["static"]) {
- accesses.push(new Access(new Literal('constructor')));
- }
- accesses.push(new Access(new Literal(name)));
- return (new Value(new Literal(method.klass), accesses)).compile(o);
- } else {
- return "" + name + ".__super__.constructor";
- }
- };
-
- Call.prototype.superThis = function(o) {
- var method;
- method = o.scope.method;
- return (method && !method.klass && method.context) || "this";
- };
-
- Call.prototype.unfoldSoak = function(o) {
- var call, ifn, left, list, rite, _i, _len, _ref2, _ref3;
- if (this.soak) {
- if (this.variable) {
- if (ifn = unfoldSoak(o, this, 'variable')) {
- return ifn;
- }
- _ref2 = new Value(this.variable).cacheReference(o), left = _ref2[0], rite = _ref2[1];
- } else {
- left = new Literal(this.superReference(o));
- rite = new Value(left);
- }
- rite = new Call(rite, this.args);
- rite.isNew = this.isNew;
- left = new Literal("typeof " + (left.compile(o)) + " === \"function\"");
- return new If(left, new Value(rite), {
- soak: true
- });
- }
- call = this;
- list = [];
- while (true) {
- if (call.variable instanceof Call) {
- list.push(call);
- call = call.variable;
- continue;
- }
- if (!(call.variable instanceof Value)) {
- break;
- }
- list.push(call);
- if (!((call = call.variable.base) instanceof Call)) {
- break;
- }
- }
- _ref3 = list.reverse();
- for (_i = 0, _len = _ref3.length; _i < _len; _i++) {
- call = _ref3[_i];
- if (ifn) {
- if (call.variable instanceof Call) {
- call.variable = ifn;
- } else {
- call.variable.base = ifn;
- }
- }
- ifn = unfoldSoak(o, call, 'variable');
- }
- return ifn;
- };
-
- Call.prototype.filterImplicitObjects = function(list) {
- var node, nodes, obj, prop, properties, _i, _j, _len, _len1, _ref2;
- nodes = [];
- for (_i = 0, _len = list.length; _i < _len; _i++) {
- node = list[_i];
- if (!((typeof node.isObject === "function" ? node.isObject() : void 0) && node.base.generated)) {
- nodes.push(node);
- continue;
- }
- obj = null;
- _ref2 = node.base.properties;
- for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {
- prop = _ref2[_j];
- if (prop instanceof Assign || prop instanceof Comment) {
- if (!obj) {
- nodes.push(obj = new Obj(properties = [], true));
- }
- properties.push(prop);
- } else {
- nodes.push(prop);
- obj = null;
- }
- }
- }
- return nodes;
- };
-
- Call.prototype.compileNode = function(o) {
- var arg, args, code, _ref2;
- if ((_ref2 = this.variable) != null) {
- _ref2.front = this.front;
- }
- if (code = Splat.compileSplattedArray(o, this.args, true)) {
- return this.compileSplat(o, code);
- }
- args = this.filterImplicitObjects(this.args);
- args = ((function() {
- var _i, _len, _results;
- _results = [];
- for (_i = 0, _len = args.length; _i < _len; _i++) {
- arg = args[_i];
- _results.push(arg.compile(o, LEVEL_LIST));
- }
- return _results;
- })()).join(', ');
- if (this.isSuper) {
- return this.superReference(o) + (".call(" + (this.superThis(o)) + (args && ', ' + args) + ")");
- } else {
- return (this.isNew ? 'new ' : '') + this.variable.compile(o, LEVEL_ACCESS) + ("(" + args + ")");
- }
- };
-
- Call.prototype.compileSuper = function(args, o) {
- return "" + (this.superReference(o)) + ".call(" + (this.superThis(o)) + (args.length ? ', ' : '') + args + ")";
- };
-
- Call.prototype.compileSplat = function(o, splatArgs) {
- var base, fun, idt, name, ref;
- if (this.isSuper) {
- return "" + (this.superReference(o)) + ".apply(" + (this.superThis(o)) + ", " + splatArgs + ")";
- }
- if (this.isNew) {
- idt = this.tab + TAB;
- return "(function(func, args, ctor) {\n" + idt + "ctor.prototype = func.prototype;\n" + idt + "var child = new ctor, result = func.apply(child, args), t = typeof result;\n" + idt + "return t == \"object\" || t == \"function\" ? result || child : child;\n" + this.tab + "})(" + (this.variable.compile(o, LEVEL_LIST)) + ", " + splatArgs + ", function(){})";
- }
- base = new Value(this.variable);
- if ((name = base.properties.pop()) && base.isComplex()) {
- ref = o.scope.freeVariable('ref');
- fun = "(" + ref + " = " + (base.compile(o, LEVEL_LIST)) + ")" + (name.compile(o));
- } else {
- fun = base.compile(o, LEVEL_ACCESS);
- if (SIMPLENUM.test(fun)) {
- fun = "(" + fun + ")";
- }
- if (name) {
- ref = fun;
- fun += name.compile(o);
- } else {
- ref = 'null';
- }
- }
- return "" + fun + ".apply(" + ref + ", " + splatArgs + ")";
- };
-
- return Call;
-
- })(Base);
-
- exports.Extends = Extends = (function(_super) {
-
- __extends(Extends, _super);
-
- function Extends(child, parent) {
- this.child = child;
- this.parent = parent;
- }
-
- Extends.prototype.children = ['child', 'parent'];
-
- Extends.prototype.compile = function(o) {
- return new Call(new Value(new Literal(utility('extends'))), [this.child, this.parent]).compile(o);
- };
-
- return Extends;
-
- })(Base);
-
- exports.Access = Access = (function(_super) {
-
- __extends(Access, _super);
-
- function Access(name, tag) {
- this.name = name;
- this.name.asKey = true;
- this.soak = tag === 'soak';
- }
-
- Access.prototype.children = ['name'];
-
- Access.prototype.compile = function(o) {
- var name;
- name = this.name.compile(o);
- if (IDENTIFIER.test(name)) {
- return "." + name;
- } else {
- return "[" + name + "]";
- }
- };
-
- Access.prototype.isComplex = NO;
-
- return Access;
-
- })(Base);
-
- exports.Index = Index = (function(_super) {
-
- __extends(Index, _super);
-
- function Index(index) {
- this.index = index;
- }
-
- Index.prototype.children = ['index'];
-
- Index.prototype.compile = function(o) {
- return "[" + (this.index.compile(o, LEVEL_PAREN)) + "]";
- };
-
- Index.prototype.isComplex = function() {
- return this.index.isComplex();
- };
-
- return Index;
-
- })(Base);
-
- exports.Range = Range = (function(_super) {
-
- __extends(Range, _super);
-
- Range.prototype.children = ['from', 'to'];
-
- function Range(from, to, tag) {
- this.from = from;
- this.to = to;
- this.exclusive = tag === 'exclusive';
- this.equals = this.exclusive ? '' : '=';
- }
-
- Range.prototype.compileVariables = function(o) {
- var step, _ref2, _ref3, _ref4, _ref5;
- o = merge(o, {
- top: true
- });
- _ref2 = this.from.cache(o, LEVEL_LIST), this.fromC = _ref2[0], this.fromVar = _ref2[1];
- _ref3 = this.to.cache(o, LEVEL_LIST), this.toC = _ref3[0], this.toVar = _ref3[1];
- if (step = del(o, 'step')) {
- _ref4 = step.cache(o, LEVEL_LIST), this.step = _ref4[0], this.stepVar = _ref4[1];
- }
- _ref5 = [this.fromVar.match(SIMPLENUM), this.toVar.match(SIMPLENUM)], this.fromNum = _ref5[0], this.toNum = _ref5[1];
- if (this.stepVar) {
- return this.stepNum = this.stepVar.match(SIMPLENUM);
- }
- };
-
- Range.prototype.compileNode = function(o) {
- var cond, condPart, from, gt, idx, idxName, known, lt, namedIndex, stepPart, to, varPart, _ref2, _ref3;
- if (!this.fromVar) {
- this.compileVariables(o);
- }
- if (!o.index) {
- return this.compileArray(o);
- }
- known = this.fromNum && this.toNum;
- idx = del(o, 'index');
- idxName = del(o, 'name');
- namedIndex = idxName && idxName !== idx;
- varPart = "" + idx + " = " + this.fromC;
- if (this.toC !== this.toVar) {
- varPart += ", " + this.toC;
- }
- if (this.step !== this.stepVar) {
- varPart += ", " + this.step;
- }
- _ref2 = ["" + idx + " <" + this.equals, "" + idx + " >" + this.equals], lt = _ref2[0], gt = _ref2[1];
- condPart = this.stepNum ? +this.stepNum > 0 ? "" + lt + " " + this.toVar : "" + gt + " " + this.toVar : known ? ((_ref3 = [+this.fromNum, +this.toNum], from = _ref3[0], to = _ref3[1], _ref3), from <= to ? "" + lt + " " + to : "" + gt + " " + to) : (cond = "" + this.fromVar + " <= " + this.toVar, "" + cond + " ? " + lt + " " + this.toVar + " : " + gt + " " + this.toVar);
- stepPart = this.stepVar ? "" + idx + " += " + this.stepVar : known ? namedIndex ? from <= to ? "++" + idx : "--" + idx : from <= to ? "" + idx + "++" : "" + idx + "--" : namedIndex ? "" + cond + " ? ++" + idx + " : --" + idx : "" + cond + " ? " + idx + "++ : " + idx + "--";
- if (namedIndex) {
- varPart = "" + idxName + " = " + varPart;
- }
- if (namedIndex) {
- stepPart = "" + idxName + " = " + stepPart;
- }
- return "" + varPart + "; " + condPart + "; " + stepPart;
- };
-
- Range.prototype.compileArray = function(o) {
- var args, body, cond, hasArgs, i, idt, post, pre, range, result, vars, _i, _ref2, _ref3, _results;
- if (this.fromNum && this.toNum && Math.abs(this.fromNum - this.toNum) <= 20) {
- range = (function() {
- _results = [];
- for (var _i = _ref2 = +this.fromNum, _ref3 = +this.toNum; _ref2 <= _ref3 ? _i <= _ref3 : _i >= _ref3; _ref2 <= _ref3 ? _i++ : _i--){ _results.push(_i); }
- return _results;
- }).apply(this);
- if (this.exclusive) {
- range.pop();
- }
- return "[" + (range.join(', ')) + "]";
- }
- idt = this.tab + TAB;
- i = o.scope.freeVariable('i');
- result = o.scope.freeVariable('results');
- pre = "\n" + idt + result + " = [];";
- if (this.fromNum && this.toNum) {
- o.index = i;
- body = this.compileNode(o);
- } else {
- vars = ("" + i + " = " + this.fromC) + (this.toC !== this.toVar ? ", " + this.toC : '');
- cond = "" + this.fromVar + " <= " + this.toVar;
- body = "var " + vars + "; " + cond + " ? " + i + " <" + this.equals + " " + this.toVar + " : " + i + " >" + this.equals + " " + this.toVar + "; " + cond + " ? " + i + "++ : " + i + "--";
- }
- post = "{ " + result + ".push(" + i + "); }\n" + idt + "return " + result + ";\n" + o.indent;
- hasArgs = function(node) {
- return node != null ? node.contains(function(n) {
- return n instanceof Literal && n.value === 'arguments' && !n.asKey;
- }) : void 0;
- };
- if (hasArgs(this.from) || hasArgs(this.to)) {
- args = ', arguments';
- }
- return "(function() {" + pre + "\n" + idt + "for (" + body + ")" + post + "}).apply(this" + (args != null ? args : '') + ")";
- };
-
- return Range;
-
- })(Base);
-
- exports.Slice = Slice = (function(_super) {
-
- __extends(Slice, _super);
-
- Slice.prototype.children = ['range'];
-
- function Slice(range) {
- this.range = range;
- Slice.__super__.constructor.call(this);
- }
-
- Slice.prototype.compileNode = function(o) {
- var compiled, from, fromStr, to, toStr, _ref2;
- _ref2 = this.range, to = _ref2.to, from = _ref2.from;
- fromStr = from && from.compile(o, LEVEL_PAREN) || '0';
- compiled = to && to.compile(o, LEVEL_PAREN);
- if (to && !(!this.range.exclusive && +compiled === -1)) {
- toStr = ', ' + (this.range.exclusive ? compiled : SIMPLENUM.test(compiled) ? "" + (+compiled + 1) : (compiled = to.compile(o, LEVEL_ACCESS), "+" + compiled + " + 1 || 9e9"));
- }
- return ".slice(" + fromStr + (toStr || '') + ")";
- };
-
- return Slice;
-
- })(Base);
-
- exports.Obj = Obj = (function(_super) {
-
- __extends(Obj, _super);
-
- function Obj(props, generated) {
- this.generated = generated != null ? generated : false;
- this.objects = this.properties = props || [];
- }
-
- Obj.prototype.children = ['properties'];
-
- Obj.prototype.compileNode = function(o) {
- var i, idt, indent, join, lastNoncom, node, obj, prop, props, _i, _len;
- props = this.properties;
- if (!props.length) {
- return (this.front ? '({})' : '{}');
- }
- if (this.generated) {
- for (_i = 0, _len = props.length; _i < _len; _i++) {
- node = props[_i];
- if (node instanceof Value) {
- throw new Error('cannot have an implicit value in an implicit object');
- }
- }
- }
- idt = o.indent += TAB;
- lastNoncom = this.lastNonComment(this.properties);
- props = (function() {
- var _j, _len1, _results;
- _results = [];
- for (i = _j = 0, _len1 = props.length; _j < _len1; i = ++_j) {
- prop = props[i];
- join = i === props.length - 1 ? '' : prop === lastNoncom || prop instanceof Comment ? '\n' : ',\n';
- indent = prop instanceof Comment ? '' : idt;
- if (prop instanceof Value && prop["this"]) {
- prop = new Assign(prop.properties[0].name, prop, 'object');
- }
- if (!(prop instanceof Comment)) {
- if (!(prop instanceof Assign)) {
- prop = new Assign(prop, prop, 'object');
- }
- (prop.variable.base || prop.variable).asKey = true;
- }
- _results.push(indent + prop.compile(o, LEVEL_TOP) + join);
- }
- return _results;
- })();
- props = props.join('');
- obj = "{" + (props && '\n' + props + '\n' + this.tab) + "}";
- if (this.front) {
- return "(" + obj + ")";
- } else {
- return obj;
- }
- };
-
- Obj.prototype.assigns = function(name) {
- var prop, _i, _len, _ref2;
- _ref2 = this.properties;
- for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
- prop = _ref2[_i];
- if (prop.assigns(name)) {
- return true;
- }
- }
- return false;
- };
-
- return Obj;
-
- })(Base);
-
- exports.Arr = Arr = (function(_super) {
-
- __extends(Arr, _super);
-
- function Arr(objs) {
- this.objects = objs || [];
- }
-
- Arr.prototype.children = ['objects'];
-
- Arr.prototype.filterImplicitObjects = Call.prototype.filterImplicitObjects;
-
- Arr.prototype.compileNode = function(o) {
- var code, obj, objs;
- if (!this.objects.length) {
- return '[]';
- }
- o.indent += TAB;
- objs = this.filterImplicitObjects(this.objects);
- if (code = Splat.compileSplattedArray(o, objs)) {
- return code;
- }
- code = ((function() {
- var _i, _len, _results;
- _results = [];
- for (_i = 0, _len = objs.length; _i < _len; _i++) {
- obj = objs[_i];
- _results.push(obj.compile(o, LEVEL_LIST));
- }
- return _results;
- })()).join(', ');
- if (code.indexOf('\n') >= 0) {
- return "[\n" + o.indent + code + "\n" + this.tab + "]";
- } else {
- return "[" + code + "]";
- }
- };
-
- Arr.prototype.assigns = function(name) {
- var obj, _i, _len, _ref2;
- _ref2 = this.objects;
- for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
- obj = _ref2[_i];
- if (obj.assigns(name)) {
- return true;
- }
- }
- return false;
- };
-
- return Arr;
-
- })(Base);
-
- exports.Class = Class = (function(_super) {
-
- __extends(Class, _super);
-
- function Class(variable, parent, body) {
- this.variable = variable;
- this.parent = parent;
- this.body = body != null ? body : new Block;
- this.boundFuncs = [];
- this.body.classBody = true;
- }
-
- Class.prototype.children = ['variable', 'parent', 'body'];
-
- Class.prototype.determineName = function() {
- var decl, tail;
- if (!this.variable) {
- return null;
- }
- decl = (tail = last(this.variable.properties)) ? tail instanceof Access && tail.name.value : this.variable.base.value;
- if (__indexOf.call(STRICT_PROSCRIBED, decl) >= 0) {
- throw SyntaxError("variable name may not be " + decl);
- }
- return decl && (decl = IDENTIFIER.test(decl) && decl);
- };
-
- Class.prototype.setContext = function(name) {
- return this.body.traverseChildren(false, function(node) {
- if (node.classBody) {
- return false;
- }
- if (node instanceof Literal && node.value === 'this') {
- return node.value = name;
- } else if (node instanceof Code) {
- node.klass = name;
- if (node.bound) {
- return node.context = name;
- }
- }
- });
- };
-
- Class.prototype.addBoundFunctions = function(o) {
- var bvar, lhs, _i, _len, _ref2, _results;
- if (this.boundFuncs.length) {
- _ref2 = this.boundFuncs;
- _results = [];
- for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
- bvar = _ref2[_i];
- lhs = (new Value(new Literal("this"), [new Access(bvar)])).compile(o);
- _results.push(this.ctor.body.unshift(new Literal("" + lhs + " = " + (utility('bind')) + "(" + lhs + ", this)")));
- }
- return _results;
- }
- };
-
- Class.prototype.addProperties = function(node, name, o) {
- var assign, base, exprs, func, props;
- props = node.base.properties.slice(0);
- exprs = (function() {
- var _results;
- _results = [];
- while (assign = props.shift()) {
- if (assign instanceof Assign) {
- base = assign.variable.base;
- delete assign.context;
- func = assign.value;
- if (base.value === 'constructor') {
- if (this.ctor) {
- throw new Error('cannot define more than one constructor in a class');
- }
- if (func.bound) {
- throw new Error('cannot define a constructor as a bound function');
- }
- if (func instanceof Code) {
- assign = this.ctor = func;
- } else {
- this.externalCtor = o.scope.freeVariable('class');
- assign = new Assign(new Literal(this.externalCtor), func);
- }
- } else {
- if (assign.variable["this"]) {
- func["static"] = true;
- if (func.bound) {
- func.context = name;
- }
- } else {
- assign.variable = new Value(new Literal(name), [new Access(new Literal('prototype')), new Access(base)]);
- if (func instanceof Code && func.bound) {
- this.boundFuncs.push(base);
- func.bound = false;
- }
- }
- }
- }
- _results.push(assign);
- }
- return _results;
- }).call(this);
- return compact(exprs);
- };
-
- Class.prototype.walkBody = function(name, o) {
- var _this = this;
- return this.traverseChildren(false, function(child) {
- var exps, i, node, _i, _len, _ref2;
- if (child instanceof Class) {
- return false;
- }
- if (child instanceof Block) {
- _ref2 = exps = child.expressions;
- for (i = _i = 0, _len = _ref2.length; _i < _len; i = ++_i) {
- node = _ref2[i];
- if (node instanceof Value && node.isObject(true)) {
- exps[i] = _this.addProperties(node, name, o);
- }
- }
- return child.expressions = exps = flatten(exps);
- }
- });
- };
-
- Class.prototype.hoistDirectivePrologue = function() {
- var expressions, index, node;
- index = 0;
- expressions = this.body.expressions;
- while ((node = expressions[index]) && node instanceof Comment || node instanceof Value && node.isString()) {
- ++index;
- }
- return this.directives = expressions.splice(0, index);
- };
-
- Class.prototype.ensureConstructor = function(name) {
- if (!this.ctor) {
- this.ctor = new Code;
- if (this.parent) {
- this.ctor.body.push(new Literal("" + name + ".__super__.constructor.apply(this, arguments)"));
- }
- if (this.externalCtor) {
- this.ctor.body.push(new Literal("" + this.externalCtor + ".apply(this, arguments)"));
- }
- this.ctor.body.makeReturn();
- this.body.expressions.unshift(this.ctor);
- }
- this.ctor.ctor = this.ctor.name = name;
- this.ctor.klass = null;
- return this.ctor.noReturn = true;
- };
-
- Class.prototype.compileNode = function(o) {
- var call, decl, klass, lname, name, params, _ref2;
- decl = this.determineName();
- name = decl || '_Class';
- if (name.reserved) {
- name = "_" + name;
- }
- lname = new Literal(name);
- this.hoistDirectivePrologue();
- this.setContext(name);
- this.walkBody(name, o);
- this.ensureConstructor(name);
- this.body.spaced = true;
- if (!(this.ctor instanceof Code)) {
- this.body.expressions.unshift(this.ctor);
- }
- this.body.expressions.push(lname);
- (_ref2 = this.body.expressions).unshift.apply(_ref2, this.directives);
- this.addBoundFunctions(o);
- call = Closure.wrap(this.body);
- if (this.parent) {
- this.superClass = new Literal(o.scope.freeVariable('super', false));
- this.body.expressions.unshift(new Extends(lname, this.superClass));
- call.args.push(this.parent);
- params = call.variable.params || call.variable.base.params;
- params.push(new Param(this.superClass));
- }
- klass = new Parens(call, true);
- if (this.variable) {
- klass = new Assign(this.variable, klass);
- }
- return klass.compile(o);
- };
-
- return Class;
-
- })(Base);
-
- exports.Assign = Assign = (function(_super) {
-
- __extends(Assign, _super);
-
- function Assign(variable, value, context, options) {
- var forbidden, name, _ref2;
- this.variable = variable;
- this.value = value;
- this.context = context;
- this.param = options && options.param;
- this.subpattern = options && options.subpattern;
- forbidden = (_ref2 = (name = this.variable.unwrapAll().value), __indexOf.call(STRICT_PROSCRIBED, _ref2) >= 0);
- if (forbidden && this.context !== 'object') {
- throw SyntaxError("variable name may not be \"" + name + "\"");
- }
- }
-
- Assign.prototype.children = ['variable', 'value'];
-
- Assign.prototype.isStatement = function(o) {
- return (o != null ? o.level : void 0) === LEVEL_TOP && (this.context != null) && __indexOf.call(this.context, "?") >= 0;
- };
-
- Assign.prototype.assigns = function(name) {
- return this[this.context === 'object' ? 'value' : 'variable'].assigns(name);
- };
-
- Assign.prototype.unfoldSoak = function(o) {
- return unfoldSoak(o, this, 'variable');
- };
-
- Assign.prototype.compileNode = function(o) {
- var isValue, match, name, val, varBase, _ref2, _ref3, _ref4, _ref5;
- if (isValue = this.variable instanceof Value) {
- if (this.variable.isArray() || this.variable.isObject()) {
- return this.compilePatternMatch(o);
- }
- if (this.variable.isSplice()) {
- return this.compileSplice(o);
- }
- if ((_ref2 = this.context) === '||=' || _ref2 === '&&=' || _ref2 === '?=') {
- return this.compileConditional(o);
- }
- }
- name = this.variable.compile(o, LEVEL_LIST);
- if (!this.context) {
- if (!(varBase = this.variable.unwrapAll()).isAssignable()) {
- throw SyntaxError("\"" + (this.variable.compile(o)) + "\" cannot be assigned.");
- }
- if (!(typeof varBase.hasProperties === "function" ? varBase.hasProperties() : void 0)) {
- if (this.param) {
- o.scope.add(name, 'var');
- } else {
- o.scope.find(name);
- }
- }
- }
- if (this.value instanceof Code && (match = METHOD_DEF.exec(name))) {
- if (match[1]) {
- this.value.klass = match[1];
- }
- this.value.name = (_ref3 = (_ref4 = (_ref5 = match[2]) != null ? _ref5 : match[3]) != null ? _ref4 : match[4]) != null ? _ref3 : match[5];
- }
- val = this.value.compile(o, LEVEL_LIST);
- if (this.context === 'object') {
- return "" + name + ": " + val;
- }
- val = name + (" " + (this.context || '=') + " ") + val;
- if (o.level <= LEVEL_LIST) {
- return val;
- } else {
- return "(" + val + ")";
- }
- };
-
- Assign.prototype.compilePatternMatch = function(o) {
- var acc, assigns, code, i, idx, isObject, ivar, name, obj, objects, olen, ref, rest, splat, top, val, value, vvar, _i, _len, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8;
- top = o.level === LEVEL_TOP;
- value = this.value;
- objects = this.variable.base.objects;
- if (!(olen = objects.length)) {
- code = value.compile(o);
- if (o.level >= LEVEL_OP) {
- return "(" + code + ")";
- } else {
- return code;
- }
- }
- isObject = this.variable.isObject();
- if (top && olen === 1 && !((obj = objects[0]) instanceof Splat)) {
- if (obj instanceof Assign) {
- _ref2 = obj, (_ref3 = _ref2.variable, idx = _ref3.base), obj = _ref2.value;
- } else {
- if (obj.base instanceof Parens) {
- _ref4 = new Value(obj.unwrapAll()).cacheReference(o), obj = _ref4[0], idx = _ref4[1];
- } else {
- idx = isObject ? obj["this"] ? obj.properties[0].name : obj : new Literal(0);
- }
- }
- acc = IDENTIFIER.test(idx.unwrap().value || 0);
- value = new Value(value);
- value.properties.push(new (acc ? Access : Index)(idx));
- if (_ref5 = obj.unwrap().value, __indexOf.call(RESERVED, _ref5) >= 0) {
- throw new SyntaxError("assignment to a reserved word: " + (obj.compile(o)) + " = " + (value.compile(o)));
- }
- return new Assign(obj, value, null, {
- param: this.param
- }).compile(o, LEVEL_TOP);
- }
- vvar = value.compile(o, LEVEL_LIST);
- assigns = [];
- splat = false;
- if (!IDENTIFIER.test(vvar) || this.variable.assigns(vvar)) {
- assigns.push("" + (ref = o.scope.freeVariable('ref')) + " = " + vvar);
- vvar = ref;
- }
- for (i = _i = 0, _len = objects.length; _i < _len; i = ++_i) {
- obj = objects[i];
- idx = i;
- if (isObject) {
- if (obj instanceof Assign) {
- _ref6 = obj, (_ref7 = _ref6.variable, idx = _ref7.base), obj = _ref6.value;
- } else {
- if (obj.base instanceof Parens) {
- _ref8 = new Value(obj.unwrapAll()).cacheReference(o), obj = _ref8[0], idx = _ref8[1];
- } else {
- idx = obj["this"] ? obj.properties[0].name : obj;
- }
- }
- }
- if (!splat && obj instanceof Splat) {
- name = obj.name.unwrap().value;
- obj = obj.unwrap();
- val = "" + olen + " <= " + vvar + ".length ? " + (utility('slice')) + ".call(" + vvar + ", " + i;
- if (rest = olen - i - 1) {
- ivar = o.scope.freeVariable('i');
- val += ", " + ivar + " = " + vvar + ".length - " + rest + ") : (" + ivar + " = " + i + ", [])";
- } else {
- val += ") : []";
- }
- val = new Literal(val);
- splat = "" + ivar + "++";
- } else {
- name = obj.unwrap().value;
- if (obj instanceof Splat) {
- obj = obj.name.compile(o);
- throw new SyntaxError("multiple splats are disallowed in an assignment: " + obj + "...");
- }
- if (typeof idx === 'number') {
- idx = new Literal(splat || idx);
- acc = false;
- } else {
- acc = isObject && IDENTIFIER.test(idx.unwrap().value || 0);
- }
- val = new Value(new Literal(vvar), [new (acc ? Access : Index)(idx)]);
- }
- if ((name != null) && __indexOf.call(RESERVED, name) >= 0) {
- throw new SyntaxError("assignment to a reserved word: " + (obj.compile(o)) + " = " + (val.compile(o)));
- }
- assigns.push(new Assign(obj, val, null, {
- param: this.param,
- subpattern: true
- }).compile(o, LEVEL_LIST));
- }
- if (!(top || this.subpattern)) {
- assigns.push(vvar);
- }
- code = assigns.join(', ');
- if (o.level < LEVEL_LIST) {
- return code;
- } else {
- return "(" + code + ")";
- }
- };
-
- Assign.prototype.compileConditional = function(o) {
- var left, right, _ref2;
- _ref2 = this.variable.cacheReference(o), left = _ref2[0], right = _ref2[1];
- if (!left.properties.length && left.base instanceof Literal && left.base.value !== "this" && !o.scope.check(left.base.value)) {
- throw new Error("the variable \"" + left.base.value + "\" can't be assigned with " + this.context + " because it has not been defined.");
- }
- if (__indexOf.call(this.context, "?") >= 0) {
- o.isExistentialEquals = true;
- }
- return new Op(this.context.slice(0, -1), left, new Assign(right, this.value, '=')).compile(o);
- };
-
- Assign.prototype.compileSplice = function(o) {
- var code, exclusive, from, fromDecl, fromRef, name, to, valDef, valRef, _ref2, _ref3, _ref4;
- _ref2 = this.variable.properties.pop().range, from = _ref2.from, to = _ref2.to, exclusive = _ref2.exclusive;
- name = this.variable.compile(o);
- _ref3 = (from != null ? from.cache(o, LEVEL_OP) : void 0) || ['0', '0'], fromDecl = _ref3[0], fromRef = _ref3[1];
- if (to) {
- if ((from != null ? from.isSimpleNumber() : void 0) && to.isSimpleNumber()) {
- to = +to.compile(o) - +fromRef;
- if (!exclusive) {
- to += 1;
- }
- } else {
- to = to.compile(o, LEVEL_ACCESS) + ' - ' + fromRef;
- if (!exclusive) {
- to += ' + 1';
- }
- }
- } else {
- to = "9e9";
- }
- _ref4 = this.value.cache(o, LEVEL_LIST), valDef = _ref4[0], valRef = _ref4[1];
- code = "[].splice.apply(" + name + ", [" + fromDecl + ", " + to + "].concat(" + valDef + ")), " + valRef;
- if (o.level > LEVEL_TOP) {
- return "(" + code + ")";
- } else {
- return code;
- }
- };
-
- return Assign;
-
- })(Base);
-
- exports.Code = Code = (function(_super) {
-
- __extends(Code, _super);
-
- function Code(params, body, tag) {
- this.params = params || [];
- this.body = body || new Block;
- this.bound = tag === 'boundfunc';
- if (this.bound) {
- this.context = '_this';
- }
- }
-
- Code.prototype.children = ['params', 'body'];
-
- Code.prototype.isStatement = function() {
- return !!this.ctor;
- };
-
- Code.prototype.jumps = NO;
-
- Code.prototype.compileNode = function(o) {
- var code, exprs, i, idt, lit, name, p, param, params, ref, splats, uniqs, val, wasEmpty, _i, _j, _k, _l, _len, _len1, _len2, _len3, _len4, _len5, _m, _n, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8;
- o.scope = new Scope(o.scope, this.body, this);
- o.scope.shared = del(o, 'sharedScope');
- o.indent += TAB;
- delete o.bare;
- delete o.isExistentialEquals;
- params = [];
- exprs = [];
- _ref2 = this.paramNames();
- for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
- name = _ref2[_i];
- if (!o.scope.check(name)) {
- o.scope.parameter(name);
- }
- }
- _ref3 = this.params;
- for (_j = 0, _len1 = _ref3.length; _j < _len1; _j++) {
- param = _ref3[_j];
- if (!param.splat) {
- continue;
- }
- _ref4 = this.params;
- for (_k = 0, _len2 = _ref4.length; _k < _len2; _k++) {
- p = _ref4[_k].name;
- if (p["this"]) {
- p = p.properties[0].name;
- }
- if (p.value) {
- o.scope.add(p.value, 'var', true);
- }
- }
- splats = new Assign(new Value(new Arr((function() {
- var _l, _len3, _ref5, _results;
- _ref5 = this.params;
- _results = [];
- for (_l = 0, _len3 = _ref5.length; _l < _len3; _l++) {
- p = _ref5[_l];
- _results.push(p.asReference(o));
- }
- return _results;
- }).call(this))), new Value(new Literal('arguments')));
- break;
- }
- _ref5 = this.params;
- for (_l = 0, _len3 = _ref5.length; _l < _len3; _l++) {
- param = _ref5[_l];
- if (param.isComplex()) {
- val = ref = param.asReference(o);
- if (param.value) {
- val = new Op('?', ref, param.value);
- }
- exprs.push(new Assign(new Value(param.name), val, '=', {
- param: true
- }));
- } else {
- ref = param;
- if (param.value) {
- lit = new Literal(ref.name.value + ' == null');
- val = new Assign(new Value(param.name), param.value, '=');
- exprs.push(new If(lit, val));
- }
- }
- if (!splats) {
- params.push(ref);
- }
- }
- wasEmpty = this.body.isEmpty();
- if (splats) {
- exprs.unshift(splats);
- }
- if (exprs.length) {
- (_ref6 = this.body.expressions).unshift.apply(_ref6, exprs);
- }
- for (i = _m = 0, _len4 = params.length; _m < _len4; i = ++_m) {
- p = params[i];
- o.scope.parameter(params[i] = p.compile(o));
- }
- uniqs = [];
- _ref7 = this.paramNames();
- for (_n = 0, _len5 = _ref7.length; _n < _len5; _n++) {
- name = _ref7[_n];
- if (__indexOf.call(uniqs, name) >= 0) {
- throw SyntaxError("multiple parameters named '" + name + "'");
- }
- uniqs.push(name);
- }
- if (!(wasEmpty || this.noReturn)) {
- this.body.makeReturn();
- }
- if (this.bound) {
- if ((_ref8 = o.scope.parent.method) != null ? _ref8.bound : void 0) {
- this.bound = this.context = o.scope.parent.method.context;
- } else if (!this["static"]) {
- o.scope.parent.assign('_this', 'this');
- }
- }
- idt = o.indent;
- code = 'function';
- if (this.ctor) {
- code += ' ' + this.name;
- }
- code += '(' + params.join(', ') + ') {';
- if (!this.body.isEmpty()) {
- code += "\n" + (this.body.compileWithDeclarations(o)) + "\n" + this.tab;
- }
- code += '}';
- if (this.ctor) {
- return this.tab + code;
- }
- if (this.front || (o.level >= LEVEL_ACCESS)) {
- return "(" + code + ")";
- } else {
- return code;
- }
- };
-
- Code.prototype.paramNames = function() {
- var names, param, _i, _len, _ref2;
- names = [];
- _ref2 = this.params;
- for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
- param = _ref2[_i];
- names.push.apply(names, param.names());
- }
- return names;
- };
-
- Code.prototype.traverseChildren = function(crossScope, func) {
- if (crossScope) {
- return Code.__super__.traverseChildren.call(this, crossScope, func);
- }
- };
-
- return Code;
-
- })(Base);
-
- exports.Param = Param = (function(_super) {
-
- __extends(Param, _super);
-
- function Param(name, value, splat) {
- var _ref2;
- this.name = name;
- this.value = value;
- this.splat = splat;
- if (_ref2 = (name = this.name.unwrapAll().value), __indexOf.call(STRICT_PROSCRIBED, _ref2) >= 0) {
- throw SyntaxError("parameter name \"" + name + "\" is not allowed");
- }
- }
-
- Param.prototype.children = ['name', 'value'];
-
- Param.prototype.compile = function(o) {
- return this.name.compile(o, LEVEL_LIST);
- };
-
- Param.prototype.asReference = function(o) {
- var node;
- if (this.reference) {
- return this.reference;
- }
- node = this.name;
- if (node["this"]) {
- node = node.properties[0].name;
- if (node.value.reserved) {
- node = new Literal(o.scope.freeVariable(node.value));
- }
- } else if (node.isComplex()) {
- node = new Literal(o.scope.freeVariable('arg'));
- }
- node = new Value(node);
- if (this.splat) {
- node = new Splat(node);
- }
- return this.reference = node;
- };
-
- Param.prototype.isComplex = function() {
- return this.name.isComplex();
- };
-
- Param.prototype.names = function(name) {
- var atParam, names, obj, _i, _len, _ref2;
- if (name == null) {
- name = this.name;
- }
- atParam = function(obj) {
- var value;
- value = obj.properties[0].name.value;
- if (value.reserved) {
- return [];
- } else {
- return [value];
- }
- };
- if (name instanceof Literal) {
- return [name.value];
- }
- if (name instanceof Value) {
- return atParam(name);
- }
- names = [];
- _ref2 = name.objects;
- for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
- obj = _ref2[_i];
- if (obj instanceof Assign) {
- names.push(obj.value.unwrap().value);
- } else if (obj instanceof Splat) {
- names.push(obj.name.unwrap().value);
- } else if (obj instanceof Value) {
- if (obj.isArray() || obj.isObject()) {
- names.push.apply(names, this.names(obj.base));
- } else if (obj["this"]) {
- names.push.apply(names, atParam(obj));
- } else {
- names.push(obj.base.value);
- }
- } else {
- throw SyntaxError("illegal parameter " + (obj.compile()));
- }
- }
- return names;
- };
-
- return Param;
-
- })(Base);
-
- exports.Splat = Splat = (function(_super) {
-
- __extends(Splat, _super);
-
- Splat.prototype.children = ['name'];
-
- Splat.prototype.isAssignable = YES;
-
- function Splat(name) {
- this.name = name.compile ? name : new Literal(name);
- }
-
- Splat.prototype.assigns = function(name) {
- return this.name.assigns(name);
- };
-
- Splat.prototype.compile = function(o) {
- if (this.index != null) {
- return this.compileParam(o);
- } else {
- return this.name.compile(o);
- }
- };
-
- Splat.prototype.unwrap = function() {
- return this.name;
- };
-
- Splat.compileSplattedArray = function(o, list, apply) {
- var args, base, code, i, index, node, _i, _len;
- index = -1;
- while ((node = list[++index]) && !(node instanceof Splat)) {
- continue;
- }
- if (index >= list.length) {
- return '';
- }
- if (list.length === 1) {
- code = list[0].compile(o, LEVEL_LIST);
- if (apply) {
- return code;
- }
- return "" + (utility('slice')) + ".call(" + code + ")";
- }
- args = list.slice(index);
- for (i = _i = 0, _len = args.length; _i < _len; i = ++_i) {
- node = args[i];
- code = node.compile(o, LEVEL_LIST);
- args[i] = node instanceof Splat ? "" + (utility('slice')) + ".call(" + code + ")" : "[" + code + "]";
- }
- if (index === 0) {
- return args[0] + (".concat(" + (args.slice(1).join(', ')) + ")");
- }
- base = (function() {
- var _j, _len1, _ref2, _results;
- _ref2 = list.slice(0, index);
- _results = [];
- for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {
- node = _ref2[_j];
- _results.push(node.compile(o, LEVEL_LIST));
- }
- return _results;
- })();
- return "[" + (base.join(', ')) + "].concat(" + (args.join(', ')) + ")";
- };
-
- return Splat;
-
- })(Base);
-
- exports.While = While = (function(_super) {
-
- __extends(While, _super);
-
- function While(condition, options) {
- this.condition = (options != null ? options.invert : void 0) ? condition.invert() : condition;
- this.guard = options != null ? options.guard : void 0;
- }
-
- While.prototype.children = ['condition', 'guard', 'body'];
-
- While.prototype.isStatement = YES;
-
- While.prototype.makeReturn = function(res) {
- if (res) {
- return While.__super__.makeReturn.apply(this, arguments);
- } else {
- this.returns = !this.jumps({
- loop: true
- });
- return this;
- }
- };
-
- While.prototype.addBody = function(body) {
- this.body = body;
- return this;
- };
-
- While.prototype.jumps = function() {
- var expressions, node, _i, _len;
- expressions = this.body.expressions;
- if (!expressions.length) {
- return false;
- }
- for (_i = 0, _len = expressions.length; _i < _len; _i++) {
- node = expressions[_i];
- if (node.jumps({
- loop: true
- })) {
- return node;
- }
- }
- return false;
- };
-
- While.prototype.compileNode = function(o) {
- var body, code, rvar, set;
- o.indent += TAB;
- set = '';
- body = this.body;
- if (body.isEmpty()) {
- body = '';
- } else {
- if (this.returns) {
- body.makeReturn(rvar = o.scope.freeVariable('results'));
- set = "" + this.tab + rvar + " = [];\n";
- }
- if (this.guard) {
- if (body.expressions.length > 1) {
- body.expressions.unshift(new If((new Parens(this.guard)).invert(), new Literal("continue")));
- } else {
- if (this.guard) {
- body = Block.wrap([new If(this.guard, body)]);
- }
- }
- }
- body = "\n" + (body.compile(o, LEVEL_TOP)) + "\n" + this.tab;
- }
- code = set + this.tab + ("while (" + (this.condition.compile(o, LEVEL_PAREN)) + ") {" + body + "}");
- if (this.returns) {
- code += "\n" + this.tab + "return " + rvar + ";";
- }
- return code;
- };
-
- return While;
-
- })(Base);
-
- exports.Op = Op = (function(_super) {
- var CONVERSIONS, INVERSIONS;
-
- __extends(Op, _super);
-
- function Op(op, first, second, flip) {
- if (op === 'in') {
- return new In(first, second);
- }
- if (op === 'do') {
- return this.generateDo(first);
- }
- if (op === 'new') {
- if (first instanceof Call && !first["do"] && !first.isNew) {
- return first.newInstance();
- }
- if (first instanceof Code && first.bound || first["do"]) {
- first = new Parens(first);
- }
- }
- this.operator = CONVERSIONS[op] || op;
- this.first = first;
- this.second = second;
- this.flip = !!flip;
- return this;
- }
-
- CONVERSIONS = {
- '==': '===',
- '!=': '!==',
- 'of': 'in'
- };
-
- INVERSIONS = {
- '!==': '===',
- '===': '!=='
- };
-
- Op.prototype.children = ['first', 'second'];
-
- Op.prototype.isSimpleNumber = NO;
-
- Op.prototype.isUnary = function() {
- return !this.second;
- };
-
- Op.prototype.isComplex = function() {
- var _ref2;
- return !(this.isUnary() && ((_ref2 = this.operator) === '+' || _ref2 === '-')) || this.first.isComplex();
- };
-
- Op.prototype.isChainable = function() {
- var _ref2;
- return (_ref2 = this.operator) === '<' || _ref2 === '>' || _ref2 === '>=' || _ref2 === '<=' || _ref2 === '===' || _ref2 === '!==';
- };
-
- Op.prototype.invert = function() {
- var allInvertable, curr, fst, op, _ref2;
- if (this.isChainable() && this.first.isChainable()) {
- allInvertable = true;
- curr = this;
- while (curr && curr.operator) {
- allInvertable && (allInvertable = curr.operator in INVERSIONS);
- curr = curr.first;
- }
- if (!allInvertable) {
- return new Parens(this).invert();
- }
- curr = this;
- while (curr && curr.operator) {
- curr.invert = !curr.invert;
- curr.operator = INVERSIONS[curr.operator];
- curr = curr.first;
- }
- return this;
- } else if (op = INVERSIONS[this.operator]) {
- this.operator = op;
- if (this.first.unwrap() instanceof Op) {
- this.first.invert();
- }
- return this;
- } else if (this.second) {
- return new Parens(this).invert();
- } else if (this.operator === '!' && (fst = this.first.unwrap()) instanceof Op && ((_ref2 = fst.operator) === '!' || _ref2 === 'in' || _ref2 === 'instanceof')) {
- return fst;
- } else {
- return new Op('!', this);
- }
- };
-
- Op.prototype.unfoldSoak = function(o) {
- var _ref2;
- return ((_ref2 = this.operator) === '++' || _ref2 === '--' || _ref2 === 'delete') && unfoldSoak(o, this, 'first');
- };
-
- Op.prototype.generateDo = function(exp) {
- var call, func, param, passedParams, ref, _i, _len, _ref2;
- passedParams = [];
- func = exp instanceof Assign && (ref = exp.value.unwrap()) instanceof Code ? ref : exp;
- _ref2 = func.params || [];
- for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
- param = _ref2[_i];
- if (param.value) {
- passedParams.push(param.value);
- delete param.value;
- } else {
- passedParams.push(param);
- }
- }
- call = new Call(exp, passedParams);
- call["do"] = true;
- return call;
- };
-
- Op.prototype.compileNode = function(o) {
- var code, isChain, _ref2, _ref3;
- isChain = this.isChainable() && this.first.isChainable();
- if (!isChain) {
- this.first.front = this.front;
- }
- if (this.operator === 'delete' && o.scope.check(this.first.unwrapAll().value)) {
- throw SyntaxError('delete operand may not be argument or var');
- }
- if (((_ref2 = this.operator) === '--' || _ref2 === '++') && (_ref3 = this.first.unwrapAll().value, __indexOf.call(STRICT_PROSCRIBED, _ref3) >= 0)) {
- throw SyntaxError('prefix increment/decrement may not have eval or arguments operand');
- }
- if (this.isUnary()) {
- return this.compileUnary(o);
- }
- if (isChain) {
- return this.compileChain(o);
- }
- if (this.operator === '?') {
- return this.compileExistence(o);
- }
- code = this.first.compile(o, LEVEL_OP) + ' ' + this.operator + ' ' + this.second.compile(o, LEVEL_OP);
- if (o.level <= LEVEL_OP) {
- return code;
- } else {
- return "(" + code + ")";
- }
- };
-
- Op.prototype.compileChain = function(o) {
- var code, fst, shared, _ref2;
- _ref2 = this.first.second.cache(o), this.first.second = _ref2[0], shared = _ref2[1];
- fst = this.first.compile(o, LEVEL_OP);
- code = "" + fst + " " + (this.invert ? '&&' : '||') + " " + (shared.compile(o)) + " " + this.operator + " " + (this.second.compile(o, LEVEL_OP));
- return "(" + code + ")";
- };
-
- Op.prototype.compileExistence = function(o) {
- var fst, ref;
- if (this.first.isComplex()) {
- ref = new Literal(o.scope.freeVariable('ref'));
- fst = new Parens(new Assign(ref, this.first));
- } else {
- fst = this.first;
- ref = fst;
- }
- return new If(new Existence(fst), ref, {
- type: 'if'
- }).addElse(this.second).compile(o);
- };
-
- Op.prototype.compileUnary = function(o) {
- var op, parts, plusMinus;
- if (o.level >= LEVEL_ACCESS) {
- return (new Parens(this)).compile(o);
- }
- parts = [op = this.operator];
- plusMinus = op === '+' || op === '-';
- if ((op === 'new' || op === 'typeof' || op === 'delete') || plusMinus && this.first instanceof Op && this.first.operator === op) {
- parts.push(' ');
- }
- if ((plusMinus && this.first instanceof Op) || (op === 'new' && this.first.isStatement(o))) {
- this.first = new Parens(this.first);
- }
- parts.push(this.first.compile(o, LEVEL_OP));
- if (this.flip) {
- parts.reverse();
- }
- return parts.join('');
- };
-
- Op.prototype.toString = function(idt) {
- return Op.__super__.toString.call(this, idt, this.constructor.name + ' ' + this.operator);
- };
-
- return Op;
-
- })(Base);
-
- exports.In = In = (function(_super) {
-
- __extends(In, _super);
-
- function In(object, array) {
- this.object = object;
- this.array = array;
- }
-
- In.prototype.children = ['object', 'array'];
-
- In.prototype.invert = NEGATE;
-
- In.prototype.compileNode = function(o) {
- var hasSplat, obj, _i, _len, _ref2;
- if (this.array instanceof Value && this.array.isArray()) {
- _ref2 = this.array.base.objects;
- for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
- obj = _ref2[_i];
- if (!(obj instanceof Splat)) {
- continue;
- }
- hasSplat = true;
- break;
- }
- if (!hasSplat) {
- return this.compileOrTest(o);
- }
- }
- return this.compileLoopTest(o);
- };
-
- In.prototype.compileOrTest = function(o) {
- var cmp, cnj, i, item, ref, sub, tests, _ref2, _ref3;
- if (this.array.base.objects.length === 0) {
- return "" + (!!this.negated);
- }
- _ref2 = this.object.cache(o, LEVEL_OP), sub = _ref2[0], ref = _ref2[1];
- _ref3 = this.negated ? [' !== ', ' && '] : [' === ', ' || '], cmp = _ref3[0], cnj = _ref3[1];
- tests = (function() {
- var _i, _len, _ref4, _results;
- _ref4 = this.array.base.objects;
- _results = [];
- for (i = _i = 0, _len = _ref4.length; _i < _len; i = ++_i) {
- item = _ref4[i];
- _results.push((i ? ref : sub) + cmp + item.compile(o, LEVEL_ACCESS));
- }
- return _results;
- }).call(this);
- tests = tests.join(cnj);
- if (o.level < LEVEL_OP) {
- return tests;
- } else {
- return "(" + tests + ")";
- }
- };
-
- In.prototype.compileLoopTest = function(o) {
- var code, ref, sub, _ref2;
- _ref2 = this.object.cache(o, LEVEL_LIST), sub = _ref2[0], ref = _ref2[1];
- code = utility('indexOf') + (".call(" + (this.array.compile(o, LEVEL_LIST)) + ", " + ref + ") ") + (this.negated ? '< 0' : '>= 0');
- if (sub === ref) {
- return code;
- }
- code = sub + ', ' + code;
- if (o.level < LEVEL_LIST) {
- return code;
- } else {
- return "(" + code + ")";
- }
- };
-
- In.prototype.toString = function(idt) {
- return In.__super__.toString.call(this, idt, this.constructor.name + (this.negated ? '!' : ''));
- };
-
- return In;
-
- })(Base);
-
- exports.Try = Try = (function(_super) {
-
- __extends(Try, _super);
-
- function Try(attempt, error, recovery, ensure) {
- this.attempt = attempt;
- this.error = error;
- this.recovery = recovery;
- this.ensure = ensure;
- }
-
- Try.prototype.children = ['attempt', 'recovery', 'ensure'];
-
- Try.prototype.isStatement = YES;
-
- Try.prototype.jumps = function(o) {
- var _ref2;
- return this.attempt.jumps(o) || ((_ref2 = this.recovery) != null ? _ref2.jumps(o) : void 0);
- };
-
- Try.prototype.makeReturn = function(res) {
- if (this.attempt) {
- this.attempt = this.attempt.makeReturn(res);
- }
- if (this.recovery) {
- this.recovery = this.recovery.makeReturn(res);
- }
- return this;
- };
-
- Try.prototype.compileNode = function(o) {
- var catchPart, ensurePart, errorPart, tryPart;
- o.indent += TAB;
- errorPart = this.error ? " (" + (this.error.compile(o)) + ") " : ' ';
- tryPart = this.attempt.compile(o, LEVEL_TOP);
- catchPart = (function() {
- var _ref2;
- if (this.recovery) {
- if (_ref2 = this.error.value, __indexOf.call(STRICT_PROSCRIBED, _ref2) >= 0) {
- throw SyntaxError("catch variable may not be \"" + this.error.value + "\"");
- }
- if (!o.scope.check(this.error.value)) {
- o.scope.add(this.error.value, 'param');
- }
- return " catch" + errorPart + "{\n" + (this.recovery.compile(o, LEVEL_TOP)) + "\n" + this.tab + "}";
- } else if (!(this.ensure || this.recovery)) {
- return ' catch (_error) {}';
- }
- }).call(this);
- ensurePart = this.ensure ? " finally {\n" + (this.ensure.compile(o, LEVEL_TOP)) + "\n" + this.tab + "}" : '';
- return "" + this.tab + "try {\n" + tryPart + "\n" + this.tab + "}" + (catchPart || '') + ensurePart;
- };
-
- return Try;
-
- })(Base);
-
- exports.Throw = Throw = (function(_super) {
-
- __extends(Throw, _super);
-
- function Throw(expression) {
- this.expression = expression;
- }
-
- Throw.prototype.children = ['expression'];
-
- Throw.prototype.isStatement = YES;
-
- Throw.prototype.jumps = NO;
-
- Throw.prototype.makeReturn = THIS;
-
- Throw.prototype.compileNode = function(o) {
- return this.tab + ("throw " + (this.expression.compile(o)) + ";");
- };
-
- return Throw;
-
- })(Base);
-
- exports.Existence = Existence = (function(_super) {
-
- __extends(Existence, _super);
-
- function Existence(expression) {
- this.expression = expression;
- }
-
- Existence.prototype.children = ['expression'];
-
- Existence.prototype.invert = NEGATE;
-
- Existence.prototype.compileNode = function(o) {
- var cmp, cnj, code, _ref2;
- this.expression.front = this.front;
- code = this.expression.compile(o, LEVEL_OP);
- if (IDENTIFIER.test(code) && !o.scope.check(code)) {
- _ref2 = this.negated ? ['===', '||'] : ['!==', '&&'], cmp = _ref2[0], cnj = _ref2[1];
- code = "typeof " + code + " " + cmp + " \"undefined\" " + cnj + " " + code + " " + cmp + " null";
- } else {
- code = "" + code + " " + (this.negated ? '==' : '!=') + " null";
- }
- if (o.level <= LEVEL_COND) {
- return code;
- } else {
- return "(" + code + ")";
- }
- };
-
- return Existence;
-
- })(Base);
-
- exports.Parens = Parens = (function(_super) {
-
- __extends(Parens, _super);
-
- function Parens(body) {
- this.body = body;
- }
-
- Parens.prototype.children = ['body'];
-
- Parens.prototype.unwrap = function() {
- return this.body;
- };
-
- Parens.prototype.isComplex = function() {
- return this.body.isComplex();
- };
-
- Parens.prototype.compileNode = function(o) {
- var bare, code, expr;
- expr = this.body.unwrap();
- if (expr instanceof Value && expr.isAtomic()) {
- expr.front = this.front;
- return expr.compile(o);
- }
- code = expr.compile(o, LEVEL_PAREN);
- bare = o.level < LEVEL_OP && (expr instanceof Op || expr instanceof Call || (expr instanceof For && expr.returns));
- if (bare) {
- return code;
- } else {
- return "(" + code + ")";
- }
- };
-
- return Parens;
-
- })(Base);
-
- exports.For = For = (function(_super) {
-
- __extends(For, _super);
-
- function For(body, source) {
- var _ref2;
- this.source = source.source, this.guard = source.guard, this.step = source.step, this.name = source.name, this.index = source.index;
- this.body = Block.wrap([body]);
- this.own = !!source.own;
- this.object = !!source.object;
- if (this.object) {
- _ref2 = [this.index, this.name], this.name = _ref2[0], this.index = _ref2[1];
- }
- if (this.index instanceof Value) {
- throw SyntaxError('index cannot be a pattern matching expression');
- }
- this.range = this.source instanceof Value && this.source.base instanceof Range && !this.source.properties.length;
- this.pattern = this.name instanceof Value;
- if (this.range && this.index) {
- throw SyntaxError('indexes do not apply to range loops');
- }
- if (this.range && this.pattern) {
- throw SyntaxError('cannot pattern match over range loops');
- }
- this.returns = false;
- }
-
- For.prototype.children = ['body', 'source', 'guard', 'step'];
-
- For.prototype.compileNode = function(o) {
- var body, defPart, forPart, forVarPart, guardPart, idt1, index, ivar, kvar, kvarAssign, lastJumps, lvar, name, namePart, ref, resultPart, returnResult, rvar, scope, source, stepPart, stepvar, svar, varPart, _ref2;
- body = Block.wrap([this.body]);
- lastJumps = (_ref2 = last(body.expressions)) != null ? _ref2.jumps() : void 0;
- if (lastJumps && lastJumps instanceof Return) {
- this.returns = false;
- }
- source = this.range ? this.source.base : this.source;
- scope = o.scope;
- name = this.name && this.name.compile(o, LEVEL_LIST);
- index = this.index && this.index.compile(o, LEVEL_LIST);
- if (name && !this.pattern) {
- scope.find(name);
- }
- if (index) {
- scope.find(index);
- }
- if (this.returns) {
- rvar = scope.freeVariable('results');
- }
- ivar = (this.object && index) || scope.freeVariable('i');
- kvar = (this.range && name) || index || ivar;
- kvarAssign = kvar !== ivar ? "" + kvar + " = " : "";
- if (this.step && !this.range) {
- stepvar = scope.freeVariable("step");
- }
- if (this.pattern) {
- name = ivar;
- }
- varPart = '';
- guardPart = '';
- defPart = '';
- idt1 = this.tab + TAB;
- if (this.range) {
- forPart = source.compile(merge(o, {
- index: ivar,
- name: name,
- step: this.step
- }));
- } else {
- svar = this.source.compile(o, LEVEL_LIST);
- if ((name || this.own) && !IDENTIFIER.test(svar)) {
- defPart = "" + this.tab + (ref = scope.freeVariable('ref')) + " = " + svar + ";\n";
- svar = ref;
- }
- if (name && !this.pattern) {
- namePart = "" + name + " = " + svar + "[" + kvar + "]";
- }
- if (!this.object) {
- lvar = scope.freeVariable('len');
- forVarPart = "" + kvarAssign + ivar + " = 0, " + lvar + " = " + svar + ".length";
- if (this.step) {
- forVarPart += ", " + stepvar + " = " + (this.step.compile(o, LEVEL_OP));
- }
- stepPart = "" + kvarAssign + (this.step ? "" + ivar + " += " + stepvar : (kvar !== ivar ? "++" + ivar : "" + ivar + "++"));
- forPart = "" + forVarPart + "; " + ivar + " < " + lvar + "; " + stepPart;
- }
- }
- if (this.returns) {
- resultPart = "" + this.tab + rvar + " = [];\n";
- returnResult = "\n" + this.tab + "return " + rvar + ";";
- body.makeReturn(rvar);
- }
- if (this.guard) {
- if (body.expressions.length > 1) {
- body.expressions.unshift(new If((new Parens(this.guard)).invert(), new Literal("continue")));
- } else {
- if (this.guard) {
- body = Block.wrap([new If(this.guard, body)]);
- }
- }
- }
- if (this.pattern) {
- body.expressions.unshift(new Assign(this.name, new Literal("" + svar + "[" + kvar + "]")));
- }
- defPart += this.pluckDirectCall(o, body);
- if (namePart) {
- varPart = "\n" + idt1 + namePart + ";";
- }
- if (this.object) {
- forPart = "" + kvar + " in " + svar;
- if (this.own) {
- guardPart = "\n" + idt1 + "if (!" + (utility('hasProp')) + ".call(" + svar + ", " + kvar + ")) continue;";
- }
- }
- body = body.compile(merge(o, {
- indent: idt1
- }), LEVEL_TOP);
- if (body) {
- body = '\n' + body + '\n';
- }
- return "" + defPart + (resultPart || '') + this.tab + "for (" + forPart + ") {" + guardPart + varPart + body + this.tab + "}" + (returnResult || '');
- };
-
- For.prototype.pluckDirectCall = function(o, body) {
- var base, defs, expr, fn, idx, ref, val, _i, _len, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7;
- defs = '';
- _ref2 = body.expressions;
- for (idx = _i = 0, _len = _ref2.length; _i < _len; idx = ++_i) {
- expr = _ref2[idx];
- expr = expr.unwrapAll();
- if (!(expr instanceof Call)) {
- continue;
- }
- val = expr.variable.unwrapAll();
- if (!((val instanceof Code) || (val instanceof Value && ((_ref3 = val.base) != null ? _ref3.unwrapAll() : void 0) instanceof Code && val.properties.length === 1 && ((_ref4 = (_ref5 = val.properties[0].name) != null ? _ref5.value : void 0) === 'call' || _ref4 === 'apply')))) {
- continue;
- }
- fn = ((_ref6 = val.base) != null ? _ref6.unwrapAll() : void 0) || val;
- ref = new Literal(o.scope.freeVariable('fn'));
- base = new Value(ref);
- if (val.base) {
- _ref7 = [base, val], val.base = _ref7[0], base = _ref7[1];
- }
- body.expressions[idx] = new Call(base, expr.args);
- defs += this.tab + new Assign(ref, fn).compile(o, LEVEL_TOP) + ';\n';
- }
- return defs;
- };
-
- return For;
-
- })(While);
-
- exports.Switch = Switch = (function(_super) {
-
- __extends(Switch, _super);
-
- function Switch(subject, cases, otherwise) {
- this.subject = subject;
- this.cases = cases;
- this.otherwise = otherwise;
- }
-
- Switch.prototype.children = ['subject', 'cases', 'otherwise'];
-
- Switch.prototype.isStatement = YES;
-
- Switch.prototype.jumps = function(o) {
- var block, conds, _i, _len, _ref2, _ref3, _ref4;
- if (o == null) {
- o = {
- block: true
- };
- }
- _ref2 = this.cases;
- for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
- _ref3 = _ref2[_i], conds = _ref3[0], block = _ref3[1];
- if (block.jumps(o)) {
- return block;
- }
- }
- return (_ref4 = this.otherwise) != null ? _ref4.jumps(o) : void 0;
- };
-
- Switch.prototype.makeReturn = function(res) {
- var pair, _i, _len, _ref2, _ref3;
- _ref2 = this.cases;
- for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
- pair = _ref2[_i];
- pair[1].makeReturn(res);
- }
- if (res) {
- this.otherwise || (this.otherwise = new Block([new Literal('void 0')]));
- }
- if ((_ref3 = this.otherwise) != null) {
- _ref3.makeReturn(res);
- }
- return this;
- };
-
- Switch.prototype.compileNode = function(o) {
- var block, body, code, cond, conditions, expr, i, idt1, idt2, _i, _j, _len, _len1, _ref2, _ref3, _ref4, _ref5;
- idt1 = o.indent + TAB;
- idt2 = o.indent = idt1 + TAB;
- code = this.tab + ("switch (" + (((_ref2 = this.subject) != null ? _ref2.compile(o, LEVEL_PAREN) : void 0) || false) + ") {\n");
- _ref3 = this.cases;
- for (i = _i = 0, _len = _ref3.length; _i < _len; i = ++_i) {
- _ref4 = _ref3[i], conditions = _ref4[0], block = _ref4[1];
- _ref5 = flatten([conditions]);
- for (_j = 0, _len1 = _ref5.length; _j < _len1; _j++) {
- cond = _ref5[_j];
- if (!this.subject) {
- cond = cond.invert();
- }
- code += idt1 + ("case " + (cond.compile(o, LEVEL_PAREN)) + ":\n");
- }
- if (body = block.compile(o, LEVEL_TOP)) {
- code += body + '\n';
- }
- if (i === this.cases.length - 1 && !this.otherwise) {
- break;
- }
- expr = this.lastNonComment(block.expressions);
- if (expr instanceof Return || (expr instanceof Literal && expr.jumps() && expr.value !== 'debugger')) {
- continue;
- }
- code += idt2 + 'break;\n';
- }
- if (this.otherwise && this.otherwise.expressions.length) {
- code += idt1 + ("default:\n" + (this.otherwise.compile(o, LEVEL_TOP)) + "\n");
- }
- return code + this.tab + '}';
- };
-
- return Switch;
-
- })(Base);
-
- exports.If = If = (function(_super) {
-
- __extends(If, _super);
-
- function If(condition, body, options) {
- this.body = body;
- if (options == null) {
- options = {};
- }
- this.condition = options.type === 'unless' ? condition.invert() : condition;
- this.elseBody = null;
- this.isChain = false;
- this.soak = options.soak;
- }
-
- If.prototype.children = ['condition', 'body', 'elseBody'];
-
- If.prototype.bodyNode = function() {
- var _ref2;
- return (_ref2 = this.body) != null ? _ref2.unwrap() : void 0;
- };
-
- If.prototype.elseBodyNode = function() {
- var _ref2;
- return (_ref2 = this.elseBody) != null ? _ref2.unwrap() : void 0;
- };
-
- If.prototype.addElse = function(elseBody) {
- if (this.isChain) {
- this.elseBodyNode().addElse(elseBody);
- } else {
- this.isChain = elseBody instanceof If;
- this.elseBody = this.ensureBlock(elseBody);
- }
- return this;
- };
-
- If.prototype.isStatement = function(o) {
- var _ref2;
- return (o != null ? o.level : void 0) === LEVEL_TOP || this.bodyNode().isStatement(o) || ((_ref2 = this.elseBodyNode()) != null ? _ref2.isStatement(o) : void 0);
- };
-
- If.prototype.jumps = function(o) {
- var _ref2;
- return this.body.jumps(o) || ((_ref2 = this.elseBody) != null ? _ref2.jumps(o) : void 0);
- };
-
- If.prototype.compileNode = function(o) {
- if (this.isStatement(o)) {
- return this.compileStatement(o);
- } else {
- return this.compileExpression(o);
- }
- };
-
- If.prototype.makeReturn = function(res) {
- if (res) {
- this.elseBody || (this.elseBody = new Block([new Literal('void 0')]));
- }
- this.body && (this.body = new Block([this.body.makeReturn(res)]));
- this.elseBody && (this.elseBody = new Block([this.elseBody.makeReturn(res)]));
- return this;
- };
-
- If.prototype.ensureBlock = function(node) {
- if (node instanceof Block) {
- return node;
- } else {
- return new Block([node]);
- }
- };
-
- If.prototype.compileStatement = function(o) {
- var body, child, cond, exeq, ifPart;
- child = del(o, 'chainChild');
- exeq = del(o, 'isExistentialEquals');
- if (exeq) {
- return new If(this.condition.invert(), this.elseBodyNode(), {
- type: 'if'
- }).compile(o);
- }
- cond = this.condition.compile(o, LEVEL_PAREN);
- o.indent += TAB;
- body = this.ensureBlock(this.body);
- ifPart = "if (" + cond + ") {\n" + (body.compile(o)) + "\n" + this.tab + "}";
- if (!child) {
- ifPart = this.tab + ifPart;
- }
- if (!this.elseBody) {
- return ifPart;
- }
- return ifPart + ' else ' + (this.isChain ? (o.indent = this.tab, o.chainChild = true, this.elseBody.unwrap().compile(o, LEVEL_TOP)) : "{\n" + (this.elseBody.compile(o, LEVEL_TOP)) + "\n" + this.tab + "}");
- };
-
- If.prototype.compileExpression = function(o) {
- var alt, body, code, cond;
- cond = this.condition.compile(o, LEVEL_COND);
- body = this.bodyNode().compile(o, LEVEL_LIST);
- alt = this.elseBodyNode() ? this.elseBodyNode().compile(o, LEVEL_LIST) : 'void 0';
- code = "" + cond + " ? " + body + " : " + alt;
- if (o.level >= LEVEL_COND) {
- return "(" + code + ")";
- } else {
- return code;
- }
- };
-
- If.prototype.unfoldSoak = function() {
- return this.soak && this;
- };
-
- return If;
-
- })(Base);
-
- Closure = {
- wrap: function(expressions, statement, noReturn) {
- var args, call, func, mentionsArgs, meth;
- if (expressions.jumps()) {
- return expressions;
- }
- func = new Code([], Block.wrap([expressions]));
- args = [];
- if ((mentionsArgs = expressions.contains(this.literalArgs)) || expressions.contains(this.literalThis)) {
- meth = new Literal(mentionsArgs ? 'apply' : 'call');
- args = [new Literal('this')];
- if (mentionsArgs) {
- args.push(new Literal('arguments'));
- }
- func = new Value(func, [new Access(meth)]);
- }
- func.noReturn = noReturn;
- call = new Call(func, args);
- if (statement) {
- return Block.wrap([call]);
- } else {
- return call;
- }
- },
- literalArgs: function(node) {
- return node instanceof Literal && node.value === 'arguments' && !node.asKey;
- },
- literalThis: function(node) {
- return (node instanceof Literal && node.value === 'this' && !node.asKey) || (node instanceof Code && node.bound) || (node instanceof Call && node.isSuper);
- }
- };
-
- unfoldSoak = function(o, parent, name) {
- var ifn;
- if (!(ifn = parent[name].unfoldSoak(o))) {
- return;
- }
- parent[name] = ifn.body;
- ifn.body = new Value(parent);
- return ifn;
- };
-
- UTILITIES = {
- "extends": function() {
- return "function(child, parent) { for (var key in parent) { if (" + (utility('hasProp')) + ".call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }";
- },
- bind: function() {
- return 'function(fn, me){ return function(){ return fn.apply(me, arguments); }; }';
- },
- indexOf: function() {
- return "[].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }";
- },
- hasProp: function() {
- return '{}.hasOwnProperty';
- },
- slice: function() {
- return '[].slice';
- }
- };
-
- LEVEL_TOP = 1;
-
- LEVEL_PAREN = 2;
-
- LEVEL_LIST = 3;
-
- LEVEL_COND = 4;
-
- LEVEL_OP = 5;
-
- LEVEL_ACCESS = 6;
-
- TAB = ' ';
-
- IDENTIFIER_STR = "[$A-Za-z_\\x7f-\\uffff][$\\w\\x7f-\\uffff]*";
-
- IDENTIFIER = RegExp("^" + IDENTIFIER_STR + "$");
-
- SIMPLENUM = /^[+-]?\d+$/;
-
- METHOD_DEF = RegExp("^(?:(" + IDENTIFIER_STR + ")\\.prototype(?:\\.(" + IDENTIFIER_STR + ")|\\[(\"(?:[^\\\\\"\\r\\n]|\\\\.)*\"|'(?:[^\\\\'\\r\\n]|\\\\.)*')\\]|\\[(0x[\\da-fA-F]+|\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\]))|(" + IDENTIFIER_STR + ")$");
-
- IS_STRING = /^['"]/;
-
- utility = function(name) {
- var ref;
- ref = "__" + name;
- Scope.root.assign(ref, UTILITIES[name]());
- return ref;
- };
-
- multident = function(code, tab) {
- code = code.replace(/\n/g, '$&' + tab);
- return code.replace(/\s+$/, '');
- };
-
-
-});
-
-define('ace/mode/coffee/scope', ['require', 'exports', 'module' , 'ace/mode/coffee/helpers'], function(require, exports, module) {
-
- var Scope, extend, last, _ref;
-
- _ref = require('./helpers'), extend = _ref.extend, last = _ref.last;
-
- exports.Scope = Scope = (function() {
-
- Scope.root = null;
-
- function Scope(parent, expressions, method) {
- this.parent = parent;
- this.expressions = expressions;
- this.method = method;
- this.variables = [
- {
- name: 'arguments',
- type: 'arguments'
- }
- ];
- this.positions = {};
- if (!this.parent) {
- Scope.root = this;
- }
- }
-
- Scope.prototype.add = function(name, type, immediate) {
- if (this.shared && !immediate) {
- return this.parent.add(name, type, immediate);
- }
- if (Object.prototype.hasOwnProperty.call(this.positions, name)) {
- return this.variables[this.positions[name]].type = type;
- } else {
- return this.positions[name] = this.variables.push({
- name: name,
- type: type
- }) - 1;
- }
- };
-
- Scope.prototype.namedMethod = function() {
- if (this.method.name || !this.parent) {
- return this.method;
- }
- return this.parent.namedMethod();
- };
-
- Scope.prototype.find = function(name) {
- if (this.check(name)) {
- return true;
- }
- this.add(name, 'var');
- return false;
- };
-
- Scope.prototype.parameter = function(name) {
- if (this.shared && this.parent.check(name, true)) {
- return;
- }
- return this.add(name, 'param');
- };
-
- Scope.prototype.check = function(name) {
- var _ref1;
- return !!(this.type(name) || ((_ref1 = this.parent) != null ? _ref1.check(name) : void 0));
- };
-
- Scope.prototype.temporary = function(name, index) {
- if (name.length > 1) {
- return '_' + name + (index > 1 ? index - 1 : '');
- } else {
- return '_' + (index + parseInt(name, 36)).toString(36).replace(/\d/g, 'a');
- }
- };
-
- Scope.prototype.type = function(name) {
- var v, _i, _len, _ref1;
- _ref1 = this.variables;
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- v = _ref1[_i];
- if (v.name === name) {
- return v.type;
- }
- }
- return null;
- };
-
- Scope.prototype.freeVariable = function(name, reserve) {
- var index, temp;
- if (reserve == null) {
- reserve = true;
- }
- index = 0;
- while (this.check((temp = this.temporary(name, index)))) {
- index++;
- }
- if (reserve) {
- this.add(temp, 'var', true);
- }
- return temp;
- };
-
- Scope.prototype.assign = function(name, value) {
- this.add(name, {
- value: value,
- assigned: true
- }, true);
- return this.hasAssignments = true;
- };
-
- Scope.prototype.hasDeclarations = function() {
- return !!this.declaredVariables().length;
- };
-
- Scope.prototype.declaredVariables = function() {
- var realVars, tempVars, v, _i, _len, _ref1;
- realVars = [];
- tempVars = [];
- _ref1 = this.variables;
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- v = _ref1[_i];
- if (v.type === 'var') {
- (v.name.charAt(0) === '_' ? tempVars : realVars).push(v.name);
- }
- }
- return realVars.sort().concat(tempVars.sort());
- };
-
- Scope.prototype.assignedVariables = function() {
- var v, _i, _len, _ref1, _results;
- _ref1 = this.variables;
- _results = [];
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
- v = _ref1[_i];
- if (v.type.assigned) {
- _results.push("" + v.name + " = " + v.type.value);
- }
- }
- return _results;
- };
-
- return Scope;
-
- })();
-
-
-});
\ No newline at end of file
diff --git a/public/libs/ace/worker-css.js b/public/libs/ace/worker-css.js
deleted file mode 100644
index 536eab6..0000000
--- a/public/libs/ace/worker-css.js
+++ /dev/null
@@ -1,7859 +0,0 @@
-"no use strict";
-
-if (typeof window != "undefined" && window.document)
- throw "atempt to load ace worker into main window instead of webWorker";
-
-var console = {
- log: function() {
- var msgs = Array.prototype.slice.call(arguments, 0);
- postMessage({type: "log", data: msgs});
- },
- error: function() {
- var msgs = Array.prototype.slice.call(arguments, 0);
- postMessage({type: "log", data: msgs});
- }
-};
-var window = {
- console: console
-};
-
-var normalizeModule = function(parentId, moduleName) {
- // normalize plugin requires
- if (moduleName.indexOf("!") !== -1) {
- var chunks = moduleName.split("!");
- return normalizeModule(parentId, chunks[0]) + "!" + normalizeModule(parentId, chunks[1]);
- }
- // normalize relative requires
- if (moduleName.charAt(0) == ".") {
- var base = parentId.split("/").slice(0, -1).join("/");
- moduleName = base + "/" + moduleName;
-
- while(moduleName.indexOf(".") !== -1 && previous != moduleName) {
- var previous = moduleName;
- moduleName = moduleName.replace(/\/\.\//, "/").replace(/[^\/]+\/\.\.\//, "");
- }
- }
-
- return moduleName;
-};
-
-var require = function(parentId, id) {
- if (!id.charAt)
- throw new Error("worker.js require() accepts only (parentId, id) as arguments");
-
- id = normalizeModule(parentId, id);
-
- var module = require.modules[id];
- if (module) {
- if (!module.initialized) {
- module.initialized = true;
- module.exports = module.factory().exports;
- }
- return module.exports;
- }
-
- var chunks = id.split("/");
- chunks[0] = require.tlns[chunks[0]] || chunks[0];
- var path = chunks.join("/") + ".js";
-
- require.id = id;
- importScripts(path);
- return require(parentId, id);
-};
-
-require.modules = {};
-require.tlns = {};
-
-var define = function(id, deps, factory) {
- if (arguments.length == 2) {
- factory = deps;
- if (typeof id != "string") {
- deps = id;
- id = require.id;
- }
- } else if (arguments.length == 1) {
- factory = id;
- id = require.id;
- }
-
- if (id.indexOf("text!") === 0)
- return;
-
- var req = function(deps, factory) {
- return require(id, deps, factory);
- };
-
- require.modules[id] = {
- factory: function() {
- var module = {
- exports: {}
- };
- var returnExports = factory(req, module.exports, module);
- if (returnExports)
- module.exports = returnExports;
- return module;
- }
- };
-};
-
-function initBaseUrls(topLevelNamespaces) {
- require.tlns = topLevelNamespaces;
-}
-
-function initSender() {
-
- var EventEmitter = require(null, "ace/lib/event_emitter").EventEmitter;
- var oop = require(null, "ace/lib/oop");
-
- var Sender = function() {};
-
- (function() {
-
- oop.implement(this, EventEmitter);
-
- this.callback = function(data, callbackId) {
- postMessage({
- type: "call",
- id: callbackId,
- data: data
- });
- };
-
- this.emit = function(name, data) {
- postMessage({
- type: "event",
- name: name,
- data: data
- });
- };
-
- }).call(Sender.prototype);
-
- return new Sender();
-}
-
-var main;
-var sender;
-
-onmessage = function(e) {
- var msg = e.data;
- if (msg.command) {
- if (main[msg.command])
- main[msg.command].apply(main, msg.args);
- else
- throw new Error("Unknown command:" + msg.command);
- }
- else if (msg.init) {
- initBaseUrls(msg.tlns);
- require(null, "ace/lib/fixoldbrowsers");
- sender = initSender();
- var clazz = require(null, msg.module)[msg.classname];
- main = new clazz(sender);
- }
- else if (msg.event && sender) {
- sender._emit(msg.event, msg.data);
- }
-};
-// vim:set ts=4 sts=4 sw=4 st:
-
-define('ace/lib/fixoldbrowsers', ['require', 'exports', 'module' , 'ace/lib/regexp', 'ace/lib/es5-shim'], function(require, exports, module) {
-
-
-require("./regexp");
-require("./es5-shim");
-
-});
-
-define('ace/lib/regexp', ['require', 'exports', 'module' ], function(require, exports, module) {
-
- var real = {
- exec: RegExp.prototype.exec,
- test: RegExp.prototype.test,
- match: String.prototype.match,
- replace: String.prototype.replace,
- split: String.prototype.split
- },
- compliantExecNpcg = real.exec.call(/()??/, "")[1] === undefined, // check `exec` handling of nonparticipating capturing groups
- compliantLastIndexIncrement = function () {
- var x = /^/g;
- real.test.call(x, "");
- return !x.lastIndex;
- }();
-
- if (compliantLastIndexIncrement && compliantExecNpcg)
- return;
- RegExp.prototype.exec = function (str) {
- var match = real.exec.apply(this, arguments),
- name, r2;
- if ( typeof(str) == 'string' && match) {
- if (!compliantExecNpcg && match.length > 1 && indexOf(match, "") > -1) {
- r2 = RegExp(this.source, real.replace.call(getNativeFlags(this), "g", ""));
- real.replace.call(str.slice(match.index), r2, function () {
- for (var i = 1; i < arguments.length - 2; i++) {
- if (arguments[i] === undefined)
- match[i] = undefined;
- }
- });
- }
- if (this._xregexp && this._xregexp.captureNames) {
- for (var i = 1; i < match.length; i++) {
- name = this._xregexp.captureNames[i - 1];
- if (name)
- match[name] = match[i];
- }
- }
- if (!compliantLastIndexIncrement && this.global && !match[0].length && (this.lastIndex > match.index))
- this.lastIndex--;
- }
- return match;
- };
- if (!compliantLastIndexIncrement) {
- RegExp.prototype.test = function (str) {
- var match = real.exec.call(this, str);
- if (match && this.global && !match[0].length && (this.lastIndex > match.index))
- this.lastIndex--;
- return !!match;
- };
- }
-
- function getNativeFlags (regex) {
- return (regex.global ? "g" : "") +
- (regex.ignoreCase ? "i" : "") +
- (regex.multiline ? "m" : "") +
- (regex.extended ? "x" : "") + // Proposed for ES4; included in AS3
- (regex.sticky ? "y" : "");
- }
-
- function indexOf (array, item, from) {
- if (Array.prototype.indexOf) // Use the native array method if available
- return array.indexOf(item, from);
- for (var i = from || 0; i < array.length; i++) {
- if (array[i] === item)
- return i;
- }
- return -1;
- }
-
-});
-
-define('ace/lib/es5-shim', ['require', 'exports', 'module' ], function(require, exports, module) {
-
-function Empty() {}
-
-if (!Function.prototype.bind) {
- Function.prototype.bind = function bind(that) { // .length is 1
- var target = this;
- if (typeof target != "function") {
- throw new TypeError("Function.prototype.bind called on incompatible " + target);
- }
- var args = slice.call(arguments, 1); // for normal call
- var bound = function () {
-
- if (this instanceof bound) {
-
- var result = target.apply(
- this,
- args.concat(slice.call(arguments))
- );
- if (Object(result) === result) {
- return result;
- }
- return this;
-
- } else {
- return target.apply(
- that,
- args.concat(slice.call(arguments))
- );
-
- }
-
- };
- if(target.prototype) {
- Empty.prototype = target.prototype;
- bound.prototype = new Empty();
- Empty.prototype = null;
- }
- return bound;
- };
-}
-var call = Function.prototype.call;
-var prototypeOfArray = Array.prototype;
-var prototypeOfObject = Object.prototype;
-var slice = prototypeOfArray.slice;
-var _toString = call.bind(prototypeOfObject.toString);
-var owns = call.bind(prototypeOfObject.hasOwnProperty);
-var defineGetter;
-var defineSetter;
-var lookupGetter;
-var lookupSetter;
-var supportsAccessors;
-if ((supportsAccessors = owns(prototypeOfObject, "__defineGetter__"))) {
- defineGetter = call.bind(prototypeOfObject.__defineGetter__);
- defineSetter = call.bind(prototypeOfObject.__defineSetter__);
- lookupGetter = call.bind(prototypeOfObject.__lookupGetter__);
- lookupSetter = call.bind(prototypeOfObject.__lookupSetter__);
-}
-if ([1,2].splice(0).length != 2) {
- if(function() { // test IE < 9 to splice bug - see issue #138
- function makeArray(l) {
- var a = new Array(l+2);
- a[0] = a[1] = 0;
- return a;
- }
- var array = [], lengthBefore;
-
- array.splice.apply(array, makeArray(20));
- array.splice.apply(array, makeArray(26));
-
- lengthBefore = array.length; //46
- array.splice(5, 0, "XXX"); // add one element
-
- lengthBefore + 1 == array.length
-
- if (lengthBefore + 1 == array.length) {
- return true;// has right splice implementation without bugs
- }
- }()) {//IE 6/7
- var array_splice = Array.prototype.splice;
- Array.prototype.splice = function(start, deleteCount) {
- if (!arguments.length) {
- return [];
- } else {
- return array_splice.apply(this, [
- start === void 0 ? 0 : start,
- deleteCount === void 0 ? (this.length - start) : deleteCount
- ].concat(slice.call(arguments, 2)))
- }
- };
- } else {//IE8
- Array.prototype.splice = function(pos, removeCount){
- var length = this.length;
- if (pos > 0) {
- if (pos > length)
- pos = length;
- } else if (pos == void 0) {
- pos = 0;
- } else if (pos < 0) {
- pos = Math.max(length + pos, 0);
- }
-
- if (!(pos+removeCount < length))
- removeCount = length - pos;
-
- var removed = this.slice(pos, pos+removeCount);
- var insert = slice.call(arguments, 2);
- var add = insert.length;
- if (pos === length) {
- if (add) {
- this.push.apply(this, insert);
- }
- } else {
- var remove = Math.min(removeCount, length - pos);
- var tailOldPos = pos + remove;
- var tailNewPos = tailOldPos + add - remove;
- var tailCount = length - tailOldPos;
- var lengthAfterRemove = length - remove;
-
- if (tailNewPos < tailOldPos) { // case A
- for (var i = 0; i < tailCount; ++i) {
- this[tailNewPos+i] = this[tailOldPos+i];
- }
- } else if (tailNewPos > tailOldPos) { // case B
- for (i = tailCount; i--; ) {
- this[tailNewPos+i] = this[tailOldPos+i];
- }
- } // else, add == remove (nothing to do)
-
- if (add && pos === lengthAfterRemove) {
- this.length = lengthAfterRemove; // truncate array
- this.push.apply(this, insert);
- } else {
- this.length = lengthAfterRemove + add; // reserves space
- for (i = 0; i < add; ++i) {
- this[pos+i] = insert[i];
- }
- }
- }
- return removed;
- };
- }
-}
-if (!Array.isArray) {
- Array.isArray = function isArray(obj) {
- return _toString(obj) == "[object Array]";
- };
-}
-var boxedString = Object("a"),
- splitString = boxedString[0] != "a" || !(0 in boxedString);
-
-if (!Array.prototype.forEach) {
- Array.prototype.forEach = function forEach(fun /*, thisp*/) {
- var object = toObject(this),
- self = splitString && _toString(this) == "[object String]" ?
- this.split("") :
- object,
- thisp = arguments[1],
- i = -1,
- length = self.length >>> 0;
- if (_toString(fun) != "[object Function]") {
- throw new TypeError(); // TODO message
- }
-
- while (++i < length) {
- if (i in self) {
- fun.call(thisp, self[i], i, object);
- }
- }
- };
-}
-if (!Array.prototype.map) {
- Array.prototype.map = function map(fun /*, thisp*/) {
- var object = toObject(this),
- self = splitString && _toString(this) == "[object String]" ?
- this.split("") :
- object,
- length = self.length >>> 0,
- result = Array(length),
- thisp = arguments[1];
- if (_toString(fun) != "[object Function]") {
- throw new TypeError(fun + " is not a function");
- }
-
- for (var i = 0; i < length; i++) {
- if (i in self)
- result[i] = fun.call(thisp, self[i], i, object);
- }
- return result;
- };
-}
-if (!Array.prototype.filter) {
- Array.prototype.filter = function filter(fun /*, thisp */) {
- var object = toObject(this),
- self = splitString && _toString(this) == "[object String]" ?
- this.split("") :
- object,
- length = self.length >>> 0,
- result = [],
- value,
- thisp = arguments[1];
- if (_toString(fun) != "[object Function]") {
- throw new TypeError(fun + " is not a function");
- }
-
- for (var i = 0; i < length; i++) {
- if (i in self) {
- value = self[i];
- if (fun.call(thisp, value, i, object)) {
- result.push(value);
- }
- }
- }
- return result;
- };
-}
-if (!Array.prototype.every) {
- Array.prototype.every = function every(fun /*, thisp */) {
- var object = toObject(this),
- self = splitString && _toString(this) == "[object String]" ?
- this.split("") :
- object,
- length = self.length >>> 0,
- thisp = arguments[1];
- if (_toString(fun) != "[object Function]") {
- throw new TypeError(fun + " is not a function");
- }
-
- for (var i = 0; i < length; i++) {
- if (i in self && !fun.call(thisp, self[i], i, object)) {
- return false;
- }
- }
- return true;
- };
-}
-if (!Array.prototype.some) {
- Array.prototype.some = function some(fun /*, thisp */) {
- var object = toObject(this),
- self = splitString && _toString(this) == "[object String]" ?
- this.split("") :
- object,
- length = self.length >>> 0,
- thisp = arguments[1];
- if (_toString(fun) != "[object Function]") {
- throw new TypeError(fun + " is not a function");
- }
-
- for (var i = 0; i < length; i++) {
- if (i in self && fun.call(thisp, self[i], i, object)) {
- return true;
- }
- }
- return false;
- };
-}
-if (!Array.prototype.reduce) {
- Array.prototype.reduce = function reduce(fun /*, initial*/) {
- var object = toObject(this),
- self = splitString && _toString(this) == "[object String]" ?
- this.split("") :
- object,
- length = self.length >>> 0;
- if (_toString(fun) != "[object Function]") {
- throw new TypeError(fun + " is not a function");
- }
- if (!length && arguments.length == 1) {
- throw new TypeError("reduce of empty array with no initial value");
- }
-
- var i = 0;
- var result;
- if (arguments.length >= 2) {
- result = arguments[1];
- } else {
- do {
- if (i in self) {
- result = self[i++];
- break;
- }
- if (++i >= length) {
- throw new TypeError("reduce of empty array with no initial value");
- }
- } while (true);
- }
-
- for (; i < length; i++) {
- if (i in self) {
- result = fun.call(void 0, result, self[i], i, object);
- }
- }
-
- return result;
- };
-}
-if (!Array.prototype.reduceRight) {
- Array.prototype.reduceRight = function reduceRight(fun /*, initial*/) {
- var object = toObject(this),
- self = splitString && _toString(this) == "[object String]" ?
- this.split("") :
- object,
- length = self.length >>> 0;
- if (_toString(fun) != "[object Function]") {
- throw new TypeError(fun + " is not a function");
- }
- if (!length && arguments.length == 1) {
- throw new TypeError("reduceRight of empty array with no initial value");
- }
-
- var result, i = length - 1;
- if (arguments.length >= 2) {
- result = arguments[1];
- } else {
- do {
- if (i in self) {
- result = self[i--];
- break;
- }
- if (--i < 0) {
- throw new TypeError("reduceRight of empty array with no initial value");
- }
- } while (true);
- }
-
- do {
- if (i in this) {
- result = fun.call(void 0, result, self[i], i, object);
- }
- } while (i--);
-
- return result;
- };
-}
-if (!Array.prototype.indexOf || ([0, 1].indexOf(1, 2) != -1)) {
- Array.prototype.indexOf = function indexOf(sought /*, fromIndex */ ) {
- var self = splitString && _toString(this) == "[object String]" ?
- this.split("") :
- toObject(this),
- length = self.length >>> 0;
-
- if (!length) {
- return -1;
- }
-
- var i = 0;
- if (arguments.length > 1) {
- i = toInteger(arguments[1]);
- }
- i = i >= 0 ? i : Math.max(0, length + i);
- for (; i < length; i++) {
- if (i in self && self[i] === sought) {
- return i;
- }
- }
- return -1;
- };
-}
-if (!Array.prototype.lastIndexOf || ([0, 1].lastIndexOf(0, -3) != -1)) {
- Array.prototype.lastIndexOf = function lastIndexOf(sought /*, fromIndex */) {
- var self = splitString && _toString(this) == "[object String]" ?
- this.split("") :
- toObject(this),
- length = self.length >>> 0;
-
- if (!length) {
- return -1;
- }
- var i = length - 1;
- if (arguments.length > 1) {
- i = Math.min(i, toInteger(arguments[1]));
- }
- i = i >= 0 ? i : length - Math.abs(i);
- for (; i >= 0; i--) {
- if (i in self && sought === self[i]) {
- return i;
- }
- }
- return -1;
- };
-}
-if (!Object.getPrototypeOf) {
- Object.getPrototypeOf = function getPrototypeOf(object) {
- return object.__proto__ || (
- object.constructor ?
- object.constructor.prototype :
- prototypeOfObject
- );
- };
-}
-if (!Object.getOwnPropertyDescriptor) {
- var ERR_NON_OBJECT = "Object.getOwnPropertyDescriptor called on a " +
- "non-object: ";
- Object.getOwnPropertyDescriptor = function getOwnPropertyDescriptor(object, property) {
- if ((typeof object != "object" && typeof object != "function") || object === null)
- throw new TypeError(ERR_NON_OBJECT + object);
- if (!owns(object, property))
- return;
-
- var descriptor, getter, setter;
- descriptor = { enumerable: true, configurable: true };
- if (supportsAccessors) {
- var prototype = object.__proto__;
- object.__proto__ = prototypeOfObject;
-
- var getter = lookupGetter(object, property);
- var setter = lookupSetter(object, property);
- object.__proto__ = prototype;
-
- if (getter || setter) {
- if (getter) descriptor.get = getter;
- if (setter) descriptor.set = setter;
- return descriptor;
- }
- }
- descriptor.value = object[property];
- return descriptor;
- };
-}
-if (!Object.getOwnPropertyNames) {
- Object.getOwnPropertyNames = function getOwnPropertyNames(object) {
- return Object.keys(object);
- };
-}
-if (!Object.create) {
- var createEmpty;
- if (Object.prototype.__proto__ === null) {
- createEmpty = function () {
- return { "__proto__": null };
- };
- } else {
- createEmpty = function () {
- var empty = {};
- for (var i in empty)
- empty[i] = null;
- empty.constructor =
- empty.hasOwnProperty =
- empty.propertyIsEnumerable =
- empty.isPrototypeOf =
- empty.toLocaleString =
- empty.toString =
- empty.valueOf =
- empty.__proto__ = null;
- return empty;
- }
- }
-
- Object.create = function create(prototype, properties) {
- var object;
- if (prototype === null) {
- object = createEmpty();
- } else {
- if (typeof prototype != "object")
- throw new TypeError("typeof prototype["+(typeof prototype)+"] != 'object'");
- var Type = function () {};
- Type.prototype = prototype;
- object = new Type();
- object.__proto__ = prototype;
- }
- if (properties !== void 0)
- Object.defineProperties(object, properties);
- return object;
- };
-}
-
-function doesDefinePropertyWork(object) {
- try {
- Object.defineProperty(object, "sentinel", {});
- return "sentinel" in object;
- } catch (exception) {
- }
-}
-if (Object.defineProperty) {
- var definePropertyWorksOnObject = doesDefinePropertyWork({});
- var definePropertyWorksOnDom = typeof document == "undefined" ||
- doesDefinePropertyWork(document.createElement("div"));
- if (!definePropertyWorksOnObject || !definePropertyWorksOnDom) {
- var definePropertyFallback = Object.defineProperty;
- }
-}
-
-if (!Object.defineProperty || definePropertyFallback) {
- var ERR_NON_OBJECT_DESCRIPTOR = "Property description must be an object: ";
- var ERR_NON_OBJECT_TARGET = "Object.defineProperty called on non-object: "
- var ERR_ACCESSORS_NOT_SUPPORTED = "getters & setters can not be defined " +
- "on this javascript engine";
-
- Object.defineProperty = function defineProperty(object, property, descriptor) {
- if ((typeof object != "object" && typeof object != "function") || object === null)
- throw new TypeError(ERR_NON_OBJECT_TARGET + object);
- if ((typeof descriptor != "object" && typeof descriptor != "function") || descriptor === null)
- throw new TypeError(ERR_NON_OBJECT_DESCRIPTOR + descriptor);
- if (definePropertyFallback) {
- try {
- return definePropertyFallback.call(Object, object, property, descriptor);
- } catch (exception) {
- }
- }
- if (owns(descriptor, "value")) {
-
- if (supportsAccessors && (lookupGetter(object, property) ||
- lookupSetter(object, property)))
- {
- var prototype = object.__proto__;
- object.__proto__ = prototypeOfObject;
- delete object[property];
- object[property] = descriptor.value;
- object.__proto__ = prototype;
- } else {
- object[property] = descriptor.value;
- }
- } else {
- if (!supportsAccessors)
- throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED);
- if (owns(descriptor, "get"))
- defineGetter(object, property, descriptor.get);
- if (owns(descriptor, "set"))
- defineSetter(object, property, descriptor.set);
- }
-
- return object;
- };
-}
-if (!Object.defineProperties) {
- Object.defineProperties = function defineProperties(object, properties) {
- for (var property in properties) {
- if (owns(properties, property))
- Object.defineProperty(object, property, properties[property]);
- }
- return object;
- };
-}
-if (!Object.seal) {
- Object.seal = function seal(object) {
- return object;
- };
-}
-if (!Object.freeze) {
- Object.freeze = function freeze(object) {
- return object;
- };
-}
-try {
- Object.freeze(function () {});
-} catch (exception) {
- Object.freeze = (function freeze(freezeObject) {
- return function freeze(object) {
- if (typeof object == "function") {
- return object;
- } else {
- return freezeObject(object);
- }
- };
- })(Object.freeze);
-}
-if (!Object.preventExtensions) {
- Object.preventExtensions = function preventExtensions(object) {
- return object;
- };
-}
-if (!Object.isSealed) {
- Object.isSealed = function isSealed(object) {
- return false;
- };
-}
-if (!Object.isFrozen) {
- Object.isFrozen = function isFrozen(object) {
- return false;
- };
-}
-if (!Object.isExtensible) {
- Object.isExtensible = function isExtensible(object) {
- if (Object(object) === object) {
- throw new TypeError(); // TODO message
- }
- var name = '';
- while (owns(object, name)) {
- name += '?';
- }
- object[name] = true;
- var returnValue = owns(object, name);
- delete object[name];
- return returnValue;
- };
-}
-if (!Object.keys) {
- var hasDontEnumBug = true,
- dontEnums = [
- "toString",
- "toLocaleString",
- "valueOf",
- "hasOwnProperty",
- "isPrototypeOf",
- "propertyIsEnumerable",
- "constructor"
- ],
- dontEnumsLength = dontEnums.length;
-
- for (var key in {"toString": null}) {
- hasDontEnumBug = false;
- }
-
- Object.keys = function keys(object) {
-
- if (
- (typeof object != "object" && typeof object != "function") ||
- object === null
- ) {
- throw new TypeError("Object.keys called on a non-object");
- }
-
- var keys = [];
- for (var name in object) {
- if (owns(object, name)) {
- keys.push(name);
- }
- }
-
- if (hasDontEnumBug) {
- for (var i = 0, ii = dontEnumsLength; i < ii; i++) {
- var dontEnum = dontEnums[i];
- if (owns(object, dontEnum)) {
- keys.push(dontEnum);
- }
- }
- }
- return keys;
- };
-
-}
-if (!Date.now) {
- Date.now = function now() {
- return new Date().getTime();
- };
-}
-if("0".split(void 0, 0).length) {
- var string_split = String.prototype.split;
- String.prototype.split = function(separator, limit) {
- if(separator === void 0 && limit === 0)return [];
- return string_split.apply(this, arguments);
- }
-}
-if("".substr && "0b".substr(-1) !== "b") {
- var string_substr = String.prototype.substr;
- String.prototype.substr = function(start, length) {
- return string_substr.call(
- this,
- start < 0 ? (start = this.length + start) < 0 ? 0 : start : start,
- length
- );
- }
-}
-var ws = "\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003" +
- "\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028" +
- "\u2029\uFEFF";
-if (!String.prototype.trim || ws.trim()) {
- ws = "[" + ws + "]";
- var trimBeginRegexp = new RegExp("^" + ws + ws + "*"),
- trimEndRegexp = new RegExp(ws + ws + "*$");
- String.prototype.trim = function trim() {
- if (this === undefined || this === null) {
- throw new TypeError("can't convert "+this+" to object");
- }
- return String(this)
- .replace(trimBeginRegexp, "")
- .replace(trimEndRegexp, "");
- };
-}
-
-function toInteger(n) {
- n = +n;
- if (n !== n) { // isNaN
- n = 0;
- } else if (n !== 0 && n !== (1/0) && n !== -(1/0)) {
- n = (n > 0 || -1) * Math.floor(Math.abs(n));
- }
- return n;
-}
-
-function isPrimitive(input) {
- var type = typeof input;
- return (
- input === null ||
- type === "undefined" ||
- type === "boolean" ||
- type === "number" ||
- type === "string"
- );
-}
-
-function toPrimitive(input) {
- var val, valueOf, toString;
- if (isPrimitive(input)) {
- return input;
- }
- valueOf = input.valueOf;
- if (typeof valueOf === "function") {
- val = valueOf.call(input);
- if (isPrimitive(val)) {
- return val;
- }
- }
- toString = input.toString;
- if (typeof toString === "function") {
- val = toString.call(input);
- if (isPrimitive(val)) {
- return val;
- }
- }
- throw new TypeError();
-}
-var toObject = function (o) {
- if (o == null) { // this matches both null and undefined
- throw new TypeError("can't convert "+o+" to object");
- }
- return Object(o);
-};
-
-});
-
-define('ace/lib/event_emitter', ['require', 'exports', 'module' ], function(require, exports, module) {
-
-
-var EventEmitter = {};
-
-EventEmitter._emit =
-EventEmitter._dispatchEvent = function(eventName, e) {
- this._eventRegistry = this._eventRegistry || {};
- this._defaultHandlers = this._defaultHandlers || {};
-
- var listeners = this._eventRegistry[eventName] || [];
- var defaultHandler = this._defaultHandlers[eventName];
- if (!listeners.length && !defaultHandler)
- return;
-
- if (typeof e != "object" || !e)
- e = {};
-
- if (!e.type)
- e.type = eventName;
-
- if (!e.stopPropagation) {
- e.stopPropagation = function() {
- this.propagationStopped = true;
- };
- }
-
- if (!e.preventDefault) {
- e.preventDefault = function() {
- this.defaultPrevented = true;
- };
- }
-
- for (var i=0; i 0) {
- if (count & 1)
- result += string;
-
- if (count >>= 1)
- string += string;
- }
- return result;
-};
-
-var trimBeginRegexp = /^\s\s*/;
-var trimEndRegexp = /\s\s*$/;
-
-exports.stringTrimLeft = function (string) {
- return string.replace(trimBeginRegexp, '');
-};
-
-exports.stringTrimRight = function (string) {
- return string.replace(trimEndRegexp, '');
-};
-
-exports.copyObject = function(obj) {
- var copy = {};
- for (var key in obj) {
- copy[key] = obj[key];
- }
- return copy;
-};
-
-exports.copyArray = function(array){
- var copy = [];
- for (var i=0, l=array.length; i= length) {
- position.row = Math.max(0, length - 1);
- position.column = this.getLine(length-1).length;
- }
- return position;
- };
- this.insert = function(position, text) {
- if (!text || text.length === 0)
- return position;
-
- position = this.$clipPosition(position);
- if (this.getLength() <= 1)
- this.$detectNewLine(text);
-
- var lines = this.$split(text);
- var firstLine = lines.splice(0, 1)[0];
- var lastLine = lines.length == 0 ? null : lines.splice(lines.length - 1, 1)[0];
-
- position = this.insertInLine(position, firstLine);
- if (lastLine !== null) {
- position = this.insertNewLine(position); // terminate first line
- position = this.insertLines(position.row, lines);
- position = this.insertInLine(position, lastLine || "");
- }
- return position;
- };
- this.insertLines = function(row, lines) {
- if (lines.length == 0)
- return {row: row, column: 0};
- if (lines.length > 0xFFFF) {
- var end = this.insertLines(row, lines.slice(0xFFFF));
- lines = lines.slice(0, 0xFFFF);
- }
-
- var args = [row, 0];
- args.push.apply(args, lines);
- this.$lines.splice.apply(this.$lines, args);
-
- var range = new Range(row, 0, row + lines.length, 0);
- var delta = {
- action: "insertLines",
- range: range,
- lines: lines
- };
- this._emit("change", { data: delta });
- return end || range.end;
- };
- this.insertNewLine = function(position) {
- position = this.$clipPosition(position);
- var line = this.$lines[position.row] || "";
-
- this.$lines[position.row] = line.substring(0, position.column);
- this.$lines.splice(position.row + 1, 0, line.substring(position.column, line.length));
-
- var end = {
- row : position.row + 1,
- column : 0
- };
-
- var delta = {
- action: "insertText",
- range: Range.fromPoints(position, end),
- text: this.getNewLineCharacter()
- };
- this._emit("change", { data: delta });
-
- return end;
- };
- this.insertInLine = function(position, text) {
- if (text.length == 0)
- return position;
-
- var line = this.$lines[position.row] || "";
-
- this.$lines[position.row] = line.substring(0, position.column) + text
- + line.substring(position.column);
-
- var end = {
- row : position.row,
- column : position.column + text.length
- };
-
- var delta = {
- action: "insertText",
- range: Range.fromPoints(position, end),
- text: text
- };
- this._emit("change", { data: delta });
-
- return end;
- };
- this.remove = function(range) {
- range.start = this.$clipPosition(range.start);
- range.end = this.$clipPosition(range.end);
-
- if (range.isEmpty())
- return range.start;
-
- var firstRow = range.start.row;
- var lastRow = range.end.row;
-
- if (range.isMultiLine()) {
- var firstFullRow = range.start.column == 0 ? firstRow : firstRow + 1;
- var lastFullRow = lastRow - 1;
-
- if (range.end.column > 0)
- this.removeInLine(lastRow, 0, range.end.column);
-
- if (lastFullRow >= firstFullRow)
- this.removeLines(firstFullRow, lastFullRow);
-
- if (firstFullRow != firstRow) {
- this.removeInLine(firstRow, range.start.column, this.getLine(firstRow).length);
- this.removeNewLine(range.start.row);
- }
- }
- else {
- this.removeInLine(firstRow, range.start.column, range.end.column);
- }
- return range.start;
- };
- this.removeInLine = function(row, startColumn, endColumn) {
- if (startColumn == endColumn)
- return;
-
- var range = new Range(row, startColumn, row, endColumn);
- var line = this.getLine(row);
- var removed = line.substring(startColumn, endColumn);
- var newLine = line.substring(0, startColumn) + line.substring(endColumn, line.length);
- this.$lines.splice(row, 1, newLine);
-
- var delta = {
- action: "removeText",
- range: range,
- text: removed
- };
- this._emit("change", { data: delta });
- return range.start;
- };
- this.removeLines = function(firstRow, lastRow) {
- var range = new Range(firstRow, 0, lastRow + 1, 0);
- var removed = this.$lines.splice(firstRow, lastRow - firstRow + 1);
-
- var delta = {
- action: "removeLines",
- range: range,
- nl: this.getNewLineCharacter(),
- lines: removed
- };
- this._emit("change", { data: delta });
- return removed;
- };
- this.removeNewLine = function(row) {
- var firstLine = this.getLine(row);
- var secondLine = this.getLine(row+1);
-
- var range = new Range(row, firstLine.length, row+1, 0);
- var line = firstLine + secondLine;
-
- this.$lines.splice(row, 2, line);
-
- var delta = {
- action: "removeText",
- range: range,
- text: this.getNewLineCharacter()
- };
- this._emit("change", { data: delta });
- };
- this.replace = function(range, text) {
- if (text.length == 0 && range.isEmpty())
- return range.start;
- if (text == this.getTextRange(range))
- return range.end;
-
- this.remove(range);
- if (text) {
- var end = this.insert(range.start, text);
- }
- else {
- end = range.start;
- }
-
- return end;
- };
- this.applyDeltas = function(deltas) {
- for (var i=0; i=0; i--) {
- var delta = deltas[i];
-
- var range = Range.fromPoints(delta.range.start, delta.range.end);
-
- if (delta.action == "insertLines")
- this.removeLines(range.start.row, range.end.row - 1);
- else if (delta.action == "insertText")
- this.remove(range);
- else if (delta.action == "removeLines")
- this.insertLines(range.start.row, delta.lines);
- else if (delta.action == "removeText")
- this.insert(range.start, delta.text);
- }
- };
- this.indexToPosition = function(index, startRow) {
- var lines = this.$lines || this.getAllLines();
- var newlineLength = this.getNewLineCharacter().length;
- for (var i = startRow || 0, l = lines.length; i < l; i++) {
- index -= lines[i].length + newlineLength;
- if (index < 0)
- return {row: i, column: index + lines[i].length + newlineLength};
- }
- return {row: l-1, column: lines[l-1].length};
- };
- this.positionToIndex = function(pos, startRow) {
- var lines = this.$lines || this.getAllLines();
- var newlineLength = this.getNewLineCharacter().length;
- var index = 0;
- var row = Math.min(pos.row, lines.length);
- for (var i = startRow || 0; i < row; ++i)
- index += lines[i].length;
-
- return index + newlineLength * i + pos.column;
- };
-
-}).call(Document.prototype);
-
-exports.Document = Document;
-});
-
-define('ace/range', ['require', 'exports', 'module' ], function(require, exports, module) {
-var Range = function(startRow, startColumn, endRow, endColumn) {
- this.start = {
- row: startRow,
- column: startColumn
- };
-
- this.end = {
- row: endRow,
- column: endColumn
- };
-};
-
-(function() {
- this.isEqual = function(range) {
- return this.start.row == range.start.row &&
- this.end.row == range.end.row &&
- this.start.column == range.start.column &&
- this.end.column == range.end.column
- };
- this.toString = function() {
- return ("Range: [" + this.start.row + "/" + this.start.column +
- "] -> [" + this.end.row + "/" + this.end.column + "]");
- };
-
- this.contains = function(row, column) {
- return this.compare(row, column) == 0;
- };
- this.compareRange = function(range) {
- var cmp,
- end = range.end,
- start = range.start;
-
- cmp = this.compare(end.row, end.column);
- if (cmp == 1) {
- cmp = this.compare(start.row, start.column);
- if (cmp == 1) {
- return 2;
- } else if (cmp == 0) {
- return 1;
- } else {
- return 0;
- }
- } else if (cmp == -1) {
- return -2;
- } else {
- cmp = this.compare(start.row, start.column);
- if (cmp == -1) {
- return -1;
- } else if (cmp == 1) {
- return 42;
- } else {
- return 0;
- }
- }
- };
- this.comparePoint = function(p) {
- return this.compare(p.row, p.column);
- };
- this.containsRange = function(range) {
- return this.comparePoint(range.start) == 0 && this.comparePoint(range.end) == 0;
- };
- this.intersects = function(range) {
- var cmp = this.compareRange(range);
- return (cmp == -1 || cmp == 0 || cmp == 1);
- };
- this.isEnd = function(row, column) {
- return this.end.row == row && this.end.column == column;
- };
- this.isStart = function(row, column) {
- return this.start.row == row && this.start.column == column;
- };
- this.setStart = function(row, column) {
- if (typeof row == "object") {
- this.start.column = row.column;
- this.start.row = row.row;
- } else {
- this.start.row = row;
- this.start.column = column;
- }
- };
- this.setEnd = function(row, column) {
- if (typeof row == "object") {
- this.end.column = row.column;
- this.end.row = row.row;
- } else {
- this.end.row = row;
- this.end.column = column;
- }
- };
- this.inside = function(row, column) {
- if (this.compare(row, column) == 0) {
- if (this.isEnd(row, column) || this.isStart(row, column)) {
- return false;
- } else {
- return true;
- }
- }
- return false;
- };
- this.insideStart = function(row, column) {
- if (this.compare(row, column) == 0) {
- if (this.isEnd(row, column)) {
- return false;
- } else {
- return true;
- }
- }
- return false;
- };
- this.insideEnd = function(row, column) {
- if (this.compare(row, column) == 0) {
- if (this.isStart(row, column)) {
- return false;
- } else {
- return true;
- }
- }
- return false;
- };
- this.compare = function(row, column) {
- if (!this.isMultiLine()) {
- if (row === this.start.row) {
- return column < this.start.column ? -1 : (column > this.end.column ? 1 : 0);
- };
- }
-
- if (row < this.start.row)
- return -1;
-
- if (row > this.end.row)
- return 1;
-
- if (this.start.row === row)
- return column >= this.start.column ? 0 : -1;
-
- if (this.end.row === row)
- return column <= this.end.column ? 0 : 1;
-
- return 0;
- };
- this.compareStart = function(row, column) {
- if (this.start.row == row && this.start.column == column) {
- return -1;
- } else {
- return this.compare(row, column);
- }
- };
- this.compareEnd = function(row, column) {
- if (this.end.row == row && this.end.column == column) {
- return 1;
- } else {
- return this.compare(row, column);
- }
- };
- this.compareInside = function(row, column) {
- if (this.end.row == row && this.end.column == column) {
- return 1;
- } else if (this.start.row == row && this.start.column == column) {
- return -1;
- } else {
- return this.compare(row, column);
- }
- };
- this.clipRows = function(firstRow, lastRow) {
- if (this.end.row > lastRow) {
- var end = {
- row: lastRow+1,
- column: 0
- };
- }
-
- if (this.start.row > lastRow) {
- var start = {
- row: lastRow+1,
- column: 0
- };
- }
-
- if (this.start.row < firstRow) {
- var start = {
- row: firstRow,
- column: 0
- };
- }
-
- if (this.end.row < firstRow) {
- var end = {
- row: firstRow,
- column: 0
- };
- }
- return Range.fromPoints(start || this.start, end || this.end);
- };
- this.extend = function(row, column) {
- var cmp = this.compare(row, column);
-
- if (cmp == 0)
- return this;
- else if (cmp == -1)
- var start = {row: row, column: column};
- else
- var end = {row: row, column: column};
-
- return Range.fromPoints(start || this.start, end || this.end);
- };
-
- this.isEmpty = function() {
- return (this.start.row == this.end.row && this.start.column == this.end.column);
- };
- this.isMultiLine = function() {
- return (this.start.row !== this.end.row);
- };
- this.clone = function() {
- return Range.fromPoints(this.start, this.end);
- };
- this.collapseRows = function() {
- if (this.end.column == 0)
- return new Range(this.start.row, 0, Math.max(this.start.row, this.end.row-1), 0)
- else
- return new Range(this.start.row, 0, this.end.row, 0)
- };
- this.toScreenRange = function(session) {
- var screenPosStart =
- session.documentToScreenPosition(this.start);
- var screenPosEnd =
- session.documentToScreenPosition(this.end);
-
- return new Range(
- screenPosStart.row, screenPosStart.column,
- screenPosEnd.row, screenPosEnd.column
- );
- };
-
-}).call(Range.prototype);
-Range.fromPoints = function(start, end) {
- return new Range(start.row, start.column, end.row, end.column);
-};
-
-exports.Range = Range;
-});
-
-define('ace/anchor', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/event_emitter'], function(require, exports, module) {
-
-
-var oop = require("./lib/oop");
-var EventEmitter = require("./lib/event_emitter").EventEmitter;
-
-var Anchor = exports.Anchor = function(doc, row, column) {
- this.document = doc;
-
- if (typeof column == "undefined")
- this.setPosition(row.row, row.column);
- else
- this.setPosition(row, column);
-
- this.$onChange = this.onChange.bind(this);
- doc.on("change", this.$onChange);
-};
-
-(function() {
-
- oop.implement(this, EventEmitter);
-
- this.getPosition = function() {
- return this.$clipPositionToDocument(this.row, this.column);
- };
-
- this.getDocument = function() {
- return this.document;
- };
-
- this.onChange = function(e) {
- var delta = e.data;
- var range = delta.range;
-
- if (range.start.row == range.end.row && range.start.row != this.row)
- return;
-
- if (range.start.row > this.row)
- return;
-
- if (range.start.row == this.row && range.start.column > this.column)
- return;
-
- var row = this.row;
- var column = this.column;
-
- if (delta.action === "insertText") {
- if (range.start.row === row && range.start.column <= column) {
- if (range.start.row === range.end.row) {
- column += range.end.column - range.start.column;
- }
- else {
- column -= range.start.column;
- row += range.end.row - range.start.row;
- }
- }
- else if (range.start.row !== range.end.row && range.start.row < row) {
- row += range.end.row - range.start.row;
- }
- } else if (delta.action === "insertLines") {
- if (range.start.row <= row) {
- row += range.end.row - range.start.row;
- }
- }
- else if (delta.action == "removeText") {
- if (range.start.row == row && range.start.column < column) {
- if (range.end.column >= column)
- column = range.start.column;
- else
- column = Math.max(0, column - (range.end.column - range.start.column));
-
- } else if (range.start.row !== range.end.row && range.start.row < row) {
- if (range.end.row == row) {
- column = Math.max(0, column - range.end.column) + range.start.column;
- }
- row -= (range.end.row - range.start.row);
- }
- else if (range.end.row == row) {
- row -= range.end.row - range.start.row;
- column = Math.max(0, column - range.end.column) + range.start.column;
- }
- } else if (delta.action == "removeLines") {
- if (range.start.row <= row) {
- if (range.end.row <= row)
- row -= range.end.row - range.start.row;
- else {
- row = range.start.row;
- column = 0;
- }
- }
- }
-
- this.setPosition(row, column, true);
- };
-
- this.setPosition = function(row, column, noClip) {
- var pos;
- if (noClip) {
- pos = {
- row: row,
- column: column
- };
- }
- else {
- pos = this.$clipPositionToDocument(row, column);
- }
-
- if (this.row == pos.row && this.column == pos.column)
- return;
-
- var old = {
- row: this.row,
- column: this.column
- };
-
- this.row = pos.row;
- this.column = pos.column;
- this._emit("change", {
- old: old,
- value: pos
- });
- };
-
- this.detach = function() {
- this.document.removeEventListener("change", this.$onChange);
- };
- this.$clipPositionToDocument = function(row, column) {
- var pos = {};
-
- if (row >= this.document.getLength()) {
- pos.row = Math.max(0, this.document.getLength() - 1);
- pos.column = this.document.getLine(pos.row).length;
- }
- else if (row < 0) {
- pos.row = 0;
- pos.column = 0;
- }
- else {
- pos.row = row;
- pos.column = Math.min(this.document.getLine(pos.row).length, Math.max(0, column));
- }
-
- if (column < 0)
- pos.column = 0;
-
- return pos;
- };
-
-}).call(Anchor.prototype);
-
-});
-define('ace/mode/css/csslint', ['require', 'exports', 'module' ], function(require, exports, module) {
-var parserlib = {};
-(function(){
-function EventTarget(){
- this._listeners = {};
-}
-
-EventTarget.prototype = {
- constructor: EventTarget,
- addListener: function(type, listener){
- if (!this._listeners[type]){
- this._listeners[type] = [];
- }
-
- this._listeners[type].push(listener);
- },
- fire: function(event){
- if (typeof event == "string"){
- event = { type: event };
- }
- if (typeof event.target != "undefined"){
- event.target = this;
- }
-
- if (typeof event.type == "undefined"){
- throw new Error("Event object missing 'type' property.");
- }
-
- if (this._listeners[event.type]){
- var listeners = this._listeners[event.type].concat();
- for (var i=0, len=listeners.length; i < len; i++){
- listeners[i].call(this, event);
- }
- }
- },
- removeListener: function(type, listener){
- if (this._listeners[type]){
- var listeners = this._listeners[type];
- for (var i=0, len=listeners.length; i < len; i++){
- if (listeners[i] === listener){
- listeners.splice(i, 1);
- break;
- }
- }
-
-
- }
- }
-};
-function StringReader(text){
- this._input = text.replace(/\n\r?/g, "\n");
- this._line = 1;
- this._col = 1;
- this._cursor = 0;
-}
-
-StringReader.prototype = {
- constructor: StringReader,
- getCol: function(){
- return this._col;
- },
- getLine: function(){
- return this._line ;
- },
- eof: function(){
- return (this._cursor == this._input.length);
- },
- peek: function(count){
- var c = null;
- count = (typeof count == "undefined" ? 1 : count);
- if (this._cursor < this._input.length){
- c = this._input.charAt(this._cursor + count - 1);
- }
-
- return c;
- },
- read: function(){
- var c = null;
- if (this._cursor < this._input.length){
- if (this._input.charAt(this._cursor) == "\n"){
- this._line++;
- this._col=1;
- } else {
- this._col++;
- }
- c = this._input.charAt(this._cursor++);
- }
-
- return c;
- },
- mark: function(){
- this._bookmark = {
- cursor: this._cursor,
- line: this._line,
- col: this._col
- };
- },
-
- reset: function(){
- if (this._bookmark){
- this._cursor = this._bookmark.cursor;
- this._line = this._bookmark.line;
- this._col = this._bookmark.col;
- delete this._bookmark;
- }
- },
- readTo: function(pattern){
-
- var buffer = "",
- c;
- while (buffer.length < pattern.length || buffer.lastIndexOf(pattern) != buffer.length - pattern.length){
- c = this.read();
- if (c){
- buffer += c;
- } else {
- throw new Error("Expected \"" + pattern + "\" at line " + this._line + ", col " + this._col + ".");
- }
- }
-
- return buffer;
-
- },
- readWhile: function(filter){
-
- var buffer = "",
- c = this.read();
-
- while(c !== null && filter(c)){
- buffer += c;
- c = this.read();
- }
-
- return buffer;
-
- },
- readMatch: function(matcher){
-
- var source = this._input.substring(this._cursor),
- value = null;
- if (typeof matcher == "string"){
- if (source.indexOf(matcher) === 0){
- value = this.readCount(matcher.length);
- }
- } else if (matcher instanceof RegExp){
- if (matcher.test(source)){
- value = this.readCount(RegExp.lastMatch.length);
- }
- }
-
- return value;
- },
- readCount: function(count){
- var buffer = "";
-
- while(count--){
- buffer += this.read();
- }
-
- return buffer;
- }
-
-};
-function SyntaxError(message, line, col){
- this.col = col;
- this.line = line;
- this.message = message;
-
-}
-SyntaxError.prototype = new Error();
-function SyntaxUnit(text, line, col, type){
- this.col = col;
- this.line = line;
- this.text = text;
- this.type = type;
-}
-SyntaxUnit.fromToken = function(token){
- return new SyntaxUnit(token.value, token.startLine, token.startCol);
-};
-
-SyntaxUnit.prototype = {
- constructor: SyntaxUnit,
- valueOf: function(){
- return this.toString();
- },
- toString: function(){
- return this.text;
- }
-
-};
-function TokenStreamBase(input, tokenData){
- this._reader = input ? new StringReader(input.toString()) : null;
- this._token = null;
- this._tokenData = tokenData;
- this._lt = [];
- this._ltIndex = 0;
-
- this._ltIndexCache = [];
-}
-TokenStreamBase.createTokenData = function(tokens){
-
- var nameMap = [],
- typeMap = {},
- tokenData = tokens.concat([]),
- i = 0,
- len = tokenData.length+1;
-
- tokenData.UNKNOWN = -1;
- tokenData.unshift({name:"EOF"});
-
- for (; i < len; i++){
- nameMap.push(tokenData[i].name);
- tokenData[tokenData[i].name] = i;
- if (tokenData[i].text){
- typeMap[tokenData[i].text] = i;
- }
- }
-
- tokenData.name = function(tt){
- return nameMap[tt];
- };
-
- tokenData.type = function(c){
- return typeMap[c];
- };
-
- return tokenData;
-};
-
-TokenStreamBase.prototype = {
- constructor: TokenStreamBase,
- match: function(tokenTypes, channel){
- if (!(tokenTypes instanceof Array)){
- tokenTypes = [tokenTypes];
- }
-
- var tt = this.get(channel),
- i = 0,
- len = tokenTypes.length;
-
- while(i < len){
- if (tt == tokenTypes[i++]){
- return true;
- }
- }
- this.unget();
- return false;
- },
- mustMatch: function(tokenTypes, channel){
-
- var token;
- if (!(tokenTypes instanceof Array)){
- tokenTypes = [tokenTypes];
- }
-
- if (!this.match.apply(this, arguments)){
- token = this.LT(1);
- throw new SyntaxError("Expected " + this._tokenData[tokenTypes[0]].name +
- " at line " + token.startLine + ", col " + token.startCol + ".", token.startLine, token.startCol);
- }
- },
- advance: function(tokenTypes, channel){
-
- while(this.LA(0) !== 0 && !this.match(tokenTypes, channel)){
- this.get();
- }
-
- return this.LA(0);
- },
- get: function(channel){
-
- var tokenInfo = this._tokenData,
- reader = this._reader,
- value,
- i =0,
- len = tokenInfo.length,
- found = false,
- token,
- info;
- if (this._lt.length && this._ltIndex >= 0 && this._ltIndex < this._lt.length){
-
- i++;
- this._token = this._lt[this._ltIndex++];
- info = tokenInfo[this._token.type];
- while((info.channel !== undefined && channel !== info.channel) &&
- this._ltIndex < this._lt.length){
- this._token = this._lt[this._ltIndex++];
- info = tokenInfo[this._token.type];
- i++;
- }
- if ((info.channel === undefined || channel === info.channel) &&
- this._ltIndex <= this._lt.length){
- this._ltIndexCache.push(i);
- return this._token.type;
- }
- }
- token = this._getToken();
- if (token.type > -1 && !tokenInfo[token.type].hide){
- token.channel = tokenInfo[token.type].channel;
- this._token = token;
- this._lt.push(token);
- this._ltIndexCache.push(this._lt.length - this._ltIndex + i);
- if (this._lt.length > 5){
- this._lt.shift();
- }
- if (this._ltIndexCache.length > 5){
- this._ltIndexCache.shift();
- }
- this._ltIndex = this._lt.length;
- }
- info = tokenInfo[token.type];
- if (info &&
- (info.hide ||
- (info.channel !== undefined && channel !== info.channel))){
- return this.get(channel);
- } else {
- return token.type;
- }
- },
- LA: function(index){
- var total = index,
- tt;
- if (index > 0){
- if (index > 5){
- throw new Error("Too much lookahead.");
- }
- while(total){
- tt = this.get();
- total--;
- }
- while(total < index){
- this.unget();
- total++;
- }
- } else if (index < 0){
-
- if(this._lt[this._ltIndex+index]){
- tt = this._lt[this._ltIndex+index].type;
- } else {
- throw new Error("Too much lookbehind.");
- }
-
- } else {
- tt = this._token.type;
- }
-
- return tt;
-
- },
- LT: function(index){
- this.LA(index);
- return this._lt[this._ltIndex+index-1];
- },
- peek: function(){
- return this.LA(1);
- },
- token: function(){
- return this._token;
- },
- tokenName: function(tokenType){
- if (tokenType < 0 || tokenType > this._tokenData.length){
- return "UNKNOWN_TOKEN";
- } else {
- return this._tokenData[tokenType].name;
- }
- },
- tokenType: function(tokenName){
- return this._tokenData[tokenName] || -1;
- },
- unget: function(){
- if (this._ltIndexCache.length){
- this._ltIndex -= this._ltIndexCache.pop();//--;
- this._token = this._lt[this._ltIndex - 1];
- } else {
- throw new Error("Too much lookahead.");
- }
- }
-
-};
-
-
-
-
-parserlib.util = {
-StringReader: StringReader,
-SyntaxError : SyntaxError,
-SyntaxUnit : SyntaxUnit,
-EventTarget : EventTarget,
-TokenStreamBase : TokenStreamBase
-};
-})();
-(function(){
-var EventTarget = parserlib.util.EventTarget,
-TokenStreamBase = parserlib.util.TokenStreamBase,
-StringReader = parserlib.util.StringReader,
-SyntaxError = parserlib.util.SyntaxError,
-SyntaxUnit = parserlib.util.SyntaxUnit;
-
-
-var Colors = {
- aliceblue :"#f0f8ff",
- antiquewhite :"#faebd7",
- aqua :"#00ffff",
- aquamarine :"#7fffd4",
- azure :"#f0ffff",
- beige :"#f5f5dc",
- bisque :"#ffe4c4",
- black :"#000000",
- blanchedalmond :"#ffebcd",
- blue :"#0000ff",
- blueviolet :"#8a2be2",
- brown :"#a52a2a",
- burlywood :"#deb887",
- cadetblue :"#5f9ea0",
- chartreuse :"#7fff00",
- chocolate :"#d2691e",
- coral :"#ff7f50",
- cornflowerblue :"#6495ed",
- cornsilk :"#fff8dc",
- crimson :"#dc143c",
- cyan :"#00ffff",
- darkblue :"#00008b",
- darkcyan :"#008b8b",
- darkgoldenrod :"#b8860b",
- darkgray :"#a9a9a9",
- darkgreen :"#006400",
- darkkhaki :"#bdb76b",
- darkmagenta :"#8b008b",
- darkolivegreen :"#556b2f",
- darkorange :"#ff8c00",
- darkorchid :"#9932cc",
- darkred :"#8b0000",
- darksalmon :"#e9967a",
- darkseagreen :"#8fbc8f",
- darkslateblue :"#483d8b",
- darkslategray :"#2f4f4f",
- darkturquoise :"#00ced1",
- darkviolet :"#9400d3",
- deeppink :"#ff1493",
- deepskyblue :"#00bfff",
- dimgray :"#696969",
- dodgerblue :"#1e90ff",
- firebrick :"#b22222",
- floralwhite :"#fffaf0",
- forestgreen :"#228b22",
- fuchsia :"#ff00ff",
- gainsboro :"#dcdcdc",
- ghostwhite :"#f8f8ff",
- gold :"#ffd700",
- goldenrod :"#daa520",
- gray :"#808080",
- green :"#008000",
- greenyellow :"#adff2f",
- honeydew :"#f0fff0",
- hotpink :"#ff69b4",
- indianred :"#cd5c5c",
- indigo :"#4b0082",
- ivory :"#fffff0",
- khaki :"#f0e68c",
- lavender :"#e6e6fa",
- lavenderblush :"#fff0f5",
- lawngreen :"#7cfc00",
- lemonchiffon :"#fffacd",
- lightblue :"#add8e6",
- lightcoral :"#f08080",
- lightcyan :"#e0ffff",
- lightgoldenrodyellow :"#fafad2",
- lightgray :"#d3d3d3",
- lightgreen :"#90ee90",
- lightpink :"#ffb6c1",
- lightsalmon :"#ffa07a",
- lightseagreen :"#20b2aa",
- lightskyblue :"#87cefa",
- lightslategray :"#778899",
- lightsteelblue :"#b0c4de",
- lightyellow :"#ffffe0",
- lime :"#00ff00",
- limegreen :"#32cd32",
- linen :"#faf0e6",
- magenta :"#ff00ff",
- maroon :"#800000",
- mediumaquamarine:"#66cdaa",
- mediumblue :"#0000cd",
- mediumorchid :"#ba55d3",
- mediumpurple :"#9370d8",
- mediumseagreen :"#3cb371",
- mediumslateblue :"#7b68ee",
- mediumspringgreen :"#00fa9a",
- mediumturquoise :"#48d1cc",
- mediumvioletred :"#c71585",
- midnightblue :"#191970",
- mintcream :"#f5fffa",
- mistyrose :"#ffe4e1",
- moccasin :"#ffe4b5",
- navajowhite :"#ffdead",
- navy :"#000080",
- oldlace :"#fdf5e6",
- olive :"#808000",
- olivedrab :"#6b8e23",
- orange :"#ffa500",
- orangered :"#ff4500",
- orchid :"#da70d6",
- palegoldenrod :"#eee8aa",
- palegreen :"#98fb98",
- paleturquoise :"#afeeee",
- palevioletred :"#d87093",
- papayawhip :"#ffefd5",
- peachpuff :"#ffdab9",
- peru :"#cd853f",
- pink :"#ffc0cb",
- plum :"#dda0dd",
- powderblue :"#b0e0e6",
- purple :"#800080",
- red :"#ff0000",
- rosybrown :"#bc8f8f",
- royalblue :"#4169e1",
- saddlebrown :"#8b4513",
- salmon :"#fa8072",
- sandybrown :"#f4a460",
- seagreen :"#2e8b57",
- seashell :"#fff5ee",
- sienna :"#a0522d",
- silver :"#c0c0c0",
- skyblue :"#87ceeb",
- slateblue :"#6a5acd",
- slategray :"#708090",
- snow :"#fffafa",
- springgreen :"#00ff7f",
- steelblue :"#4682b4",
- tan :"#d2b48c",
- teal :"#008080",
- thistle :"#d8bfd8",
- tomato :"#ff6347",
- turquoise :"#40e0d0",
- violet :"#ee82ee",
- wheat :"#f5deb3",
- white :"#ffffff",
- whitesmoke :"#f5f5f5",
- yellow :"#ffff00",
- yellowgreen :"#9acd32"
-};
-function Combinator(text, line, col){
-
- SyntaxUnit.call(this, text, line, col, Parser.COMBINATOR_TYPE);
- this.type = "unknown";
- if (/^\s+$/.test(text)){
- this.type = "descendant";
- } else if (text == ">"){
- this.type = "child";
- } else if (text == "+"){
- this.type = "adjacent-sibling";
- } else if (text == "~"){
- this.type = "sibling";
- }
-
-}
-
-Combinator.prototype = new SyntaxUnit();
-Combinator.prototype.constructor = Combinator;
-function MediaFeature(name, value){
-
- SyntaxUnit.call(this, "(" + name + (value !== null ? ":" + value : "") + ")", name.startLine, name.startCol, Parser.MEDIA_FEATURE_TYPE);
- this.name = name;
- this.value = value;
-}
-
-MediaFeature.prototype = new SyntaxUnit();
-MediaFeature.prototype.constructor = MediaFeature;
-function MediaQuery(modifier, mediaType, features, line, col){
-
- SyntaxUnit.call(this, (modifier ? modifier + " ": "") + (mediaType ? mediaType + " " : "") + features.join(" and "), line, col, Parser.MEDIA_QUERY_TYPE);
- this.modifier = modifier;
- this.mediaType = mediaType;
- this.features = features;
-
-}
-
-MediaQuery.prototype = new SyntaxUnit();
-MediaQuery.prototype.constructor = MediaQuery;
-function Parser(options){
- EventTarget.call(this);
-
-
- this.options = options || {};
-
- this._tokenStream = null;
-}
-Parser.DEFAULT_TYPE = 0;
-Parser.COMBINATOR_TYPE = 1;
-Parser.MEDIA_FEATURE_TYPE = 2;
-Parser.MEDIA_QUERY_TYPE = 3;
-Parser.PROPERTY_NAME_TYPE = 4;
-Parser.PROPERTY_VALUE_TYPE = 5;
-Parser.PROPERTY_VALUE_PART_TYPE = 6;
-Parser.SELECTOR_TYPE = 7;
-Parser.SELECTOR_PART_TYPE = 8;
-Parser.SELECTOR_SUB_PART_TYPE = 9;
-
-Parser.prototype = function(){
-
- var proto = new EventTarget(), //new prototype
- prop,
- additions = {
- constructor: Parser,
- DEFAULT_TYPE : 0,
- COMBINATOR_TYPE : 1,
- MEDIA_FEATURE_TYPE : 2,
- MEDIA_QUERY_TYPE : 3,
- PROPERTY_NAME_TYPE : 4,
- PROPERTY_VALUE_TYPE : 5,
- PROPERTY_VALUE_PART_TYPE : 6,
- SELECTOR_TYPE : 7,
- SELECTOR_PART_TYPE : 8,
- SELECTOR_SUB_PART_TYPE : 9,
-
- _stylesheet: function(){
-
- var tokenStream = this._tokenStream,
- charset = null,
- count,
- token,
- tt;
-
- this.fire("startstylesheet");
- this._charset();
-
- this._skipCruft();
- while (tokenStream.peek() == Tokens.IMPORT_SYM){
- this._import();
- this._skipCruft();
- }
- while (tokenStream.peek() == Tokens.NAMESPACE_SYM){
- this._namespace();
- this._skipCruft();
- }
- tt = tokenStream.peek();
- while(tt > Tokens.EOF){
-
- try {
-
- switch(tt){
- case Tokens.MEDIA_SYM:
- this._media();
- this._skipCruft();
- break;
- case Tokens.PAGE_SYM:
- this._page();
- this._skipCruft();
- break;
- case Tokens.FONT_FACE_SYM:
- this._font_face();
- this._skipCruft();
- break;
- case Tokens.KEYFRAMES_SYM:
- this._keyframes();
- this._skipCruft();
- break;
- case Tokens.UNKNOWN_SYM: //unknown @ rule
- tokenStream.get();
- if (!this.options.strict){
- this.fire({
- type: "error",
- error: null,
- message: "Unknown @ rule: " + tokenStream.LT(0).value + ".",
- line: tokenStream.LT(0).startLine,
- col: tokenStream.LT(0).startCol
- });
- count=0;
- while (tokenStream.advance([Tokens.LBRACE, Tokens.RBRACE]) == Tokens.LBRACE){
- count++; //keep track of nesting depth
- }
-
- while(count){
- tokenStream.advance([Tokens.RBRACE]);
- count--;
- }
-
- } else {
- throw new SyntaxError("Unknown @ rule.", tokenStream.LT(0).startLine, tokenStream.LT(0).startCol);
- }
- break;
- case Tokens.S:
- this._readWhitespace();
- break;
- default:
- if(!this._ruleset()){
- switch(tt){
- case Tokens.CHARSET_SYM:
- token = tokenStream.LT(1);
- this._charset(false);
- throw new SyntaxError("@charset not allowed here.", token.startLine, token.startCol);
- case Tokens.IMPORT_SYM:
- token = tokenStream.LT(1);
- this._import(false);
- throw new SyntaxError("@import not allowed here.", token.startLine, token.startCol);
- case Tokens.NAMESPACE_SYM:
- token = tokenStream.LT(1);
- this._namespace(false);
- throw new SyntaxError("@namespace not allowed here.", token.startLine, token.startCol);
- default:
- tokenStream.get(); //get the last token
- this._unexpectedToken(tokenStream.token());
- }
-
- }
- }
- } catch(ex) {
- if (ex instanceof SyntaxError && !this.options.strict){
- this.fire({
- type: "error",
- error: ex,
- message: ex.message,
- line: ex.line,
- col: ex.col
- });
- } else {
- throw ex;
- }
- }
-
- tt = tokenStream.peek();
- }
-
- if (tt != Tokens.EOF){
- this._unexpectedToken(tokenStream.token());
- }
-
- this.fire("endstylesheet");
- },
-
- _charset: function(emit){
- var tokenStream = this._tokenStream,
- charset,
- token,
- line,
- col;
-
- if (tokenStream.match(Tokens.CHARSET_SYM)){
- line = tokenStream.token().startLine;
- col = tokenStream.token().startCol;
-
- this._readWhitespace();
- tokenStream.mustMatch(Tokens.STRING);
-
- token = tokenStream.token();
- charset = token.value;
-
- this._readWhitespace();
- tokenStream.mustMatch(Tokens.SEMICOLON);
-
- if (emit !== false){
- this.fire({
- type: "charset",
- charset:charset,
- line: line,
- col: col
- });
- }
- }
- },
-
- _import: function(emit){
-
- var tokenStream = this._tokenStream,
- tt,
- uri,
- importToken,
- mediaList = [];
- tokenStream.mustMatch(Tokens.IMPORT_SYM);
- importToken = tokenStream.token();
- this._readWhitespace();
-
- tokenStream.mustMatch([Tokens.STRING, Tokens.URI]);
- uri = tokenStream.token().value.replace(/(?:url\()?["']([^"']+)["']\)?/, "$1");
-
- this._readWhitespace();
-
- mediaList = this._media_query_list();
- tokenStream.mustMatch(Tokens.SEMICOLON);
- this._readWhitespace();
-
- if (emit !== false){
- this.fire({
- type: "import",
- uri: uri,
- media: mediaList,
- line: importToken.startLine,
- col: importToken.startCol
- });
- }
-
- },
-
- _namespace: function(emit){
-
- var tokenStream = this._tokenStream,
- line,
- col,
- prefix,
- uri;
- tokenStream.mustMatch(Tokens.NAMESPACE_SYM);
- line = tokenStream.token().startLine;
- col = tokenStream.token().startCol;
- this._readWhitespace();
- if (tokenStream.match(Tokens.IDENT)){
- prefix = tokenStream.token().value;
- this._readWhitespace();
- }
-
- tokenStream.mustMatch([Tokens.STRING, Tokens.URI]);
- uri = tokenStream.token().value.replace(/(?:url\()?["']([^"']+)["']\)?/, "$1");
-
- this._readWhitespace();
- tokenStream.mustMatch(Tokens.SEMICOLON);
- this._readWhitespace();
-
- if (emit !== false){
- this.fire({
- type: "namespace",
- prefix: prefix,
- uri: uri,
- line: line,
- col: col
- });
- }
-
- },
-
- _media: function(){
- var tokenStream = this._tokenStream,
- line,
- col,
- mediaList;// = [];
- tokenStream.mustMatch(Tokens.MEDIA_SYM);
- line = tokenStream.token().startLine;
- col = tokenStream.token().startCol;
-
- this._readWhitespace();
-
- mediaList = this._media_query_list();
-
- tokenStream.mustMatch(Tokens.LBRACE);
- this._readWhitespace();
-
- this.fire({
- type: "startmedia",
- media: mediaList,
- line: line,
- col: col
- });
-
- while(true) {
- if (tokenStream.peek() == Tokens.PAGE_SYM){
- this._page();
- } else if (!this._ruleset()){
- break;
- }
- }
-
- tokenStream.mustMatch(Tokens.RBRACE);
- this._readWhitespace();
-
- this.fire({
- type: "endmedia",
- media: mediaList,
- line: line,
- col: col
- });
- },
- _media_query_list: function(){
- var tokenStream = this._tokenStream,
- mediaList = [];
-
-
- this._readWhitespace();
-
- if (tokenStream.peek() == Tokens.IDENT || tokenStream.peek() == Tokens.LPAREN){
- mediaList.push(this._media_query());
- }
-
- while(tokenStream.match(Tokens.COMMA)){
- this._readWhitespace();
- mediaList.push(this._media_query());
- }
-
- return mediaList;
- },
- _media_query: function(){
- var tokenStream = this._tokenStream,
- type = null,
- ident = null,
- token = null,
- expressions = [];
-
- if (tokenStream.match(Tokens.IDENT)){
- ident = tokenStream.token().value.toLowerCase();
- if (ident != "only" && ident != "not"){
- tokenStream.unget();
- ident = null;
- } else {
- token = tokenStream.token();
- }
- }
-
- this._readWhitespace();
-
- if (tokenStream.peek() == Tokens.IDENT){
- type = this._media_type();
- if (token === null){
- token = tokenStream.token();
- }
- } else if (tokenStream.peek() == Tokens.LPAREN){
- if (token === null){
- token = tokenStream.LT(1);
- }
- expressions.push(this._media_expression());
- }
-
- if (type === null && expressions.length === 0){
- return null;
- } else {
- this._readWhitespace();
- while (tokenStream.match(Tokens.IDENT)){
- if (tokenStream.token().value.toLowerCase() != "and"){
- this._unexpectedToken(tokenStream.token());
- }
-
- this._readWhitespace();
- expressions.push(this._media_expression());
- }
- }
-
- return new MediaQuery(ident, type, expressions, token.startLine, token.startCol);
- },
- _media_type: function(){
- return this._media_feature();
- },
- _media_expression: function(){
- var tokenStream = this._tokenStream,
- feature = null,
- token,
- expression = null;
-
- tokenStream.mustMatch(Tokens.LPAREN);
-
- feature = this._media_feature();
- this._readWhitespace();
-
- if (tokenStream.match(Tokens.COLON)){
- this._readWhitespace();
- token = tokenStream.LT(1);
- expression = this._expression();
- }
-
- tokenStream.mustMatch(Tokens.RPAREN);
- this._readWhitespace();
-
- return new MediaFeature(feature, (expression ? new SyntaxUnit(expression, token.startLine, token.startCol) : null));
- },
- _media_feature: function(){
- var tokenStream = this._tokenStream;
-
- tokenStream.mustMatch(Tokens.IDENT);
-
- return SyntaxUnit.fromToken(tokenStream.token());
- },
- _page: function(){
- var tokenStream = this._tokenStream,
- line,
- col,
- identifier = null,
- pseudoPage = null;
- tokenStream.mustMatch(Tokens.PAGE_SYM);
- line = tokenStream.token().startLine;
- col = tokenStream.token().startCol;
-
- this._readWhitespace();
-
- if (tokenStream.match(Tokens.IDENT)){
- identifier = tokenStream.token().value;
- if (identifier.toLowerCase() === "auto"){
- this._unexpectedToken(tokenStream.token());
- }
- }
- if (tokenStream.peek() == Tokens.COLON){
- pseudoPage = this._pseudo_page();
- }
-
- this._readWhitespace();
-
- this.fire({
- type: "startpage",
- id: identifier,
- pseudo: pseudoPage,
- line: line,
- col: col
- });
-
- this._readDeclarations(true, true);
-
- this.fire({
- type: "endpage",
- id: identifier,
- pseudo: pseudoPage,
- line: line,
- col: col
- });
-
- },
- _margin: function(){
- var tokenStream = this._tokenStream,
- line,
- col,
- marginSym = this._margin_sym();
-
- if (marginSym){
- line = tokenStream.token().startLine;
- col = tokenStream.token().startCol;
-
- this.fire({
- type: "startpagemargin",
- margin: marginSym,
- line: line,
- col: col
- });
-
- this._readDeclarations(true);
-
- this.fire({
- type: "endpagemargin",
- margin: marginSym,
- line: line,
- col: col
- });
- return true;
- } else {
- return false;
- }
- },
- _margin_sym: function(){
-
- var tokenStream = this._tokenStream;
-
- if(tokenStream.match([Tokens.TOPLEFTCORNER_SYM, Tokens.TOPLEFT_SYM,
- Tokens.TOPCENTER_SYM, Tokens.TOPRIGHT_SYM, Tokens.TOPRIGHTCORNER_SYM,
- Tokens.BOTTOMLEFTCORNER_SYM, Tokens.BOTTOMLEFT_SYM,
- Tokens.BOTTOMCENTER_SYM, Tokens.BOTTOMRIGHT_SYM,
- Tokens.BOTTOMRIGHTCORNER_SYM, Tokens.LEFTTOP_SYM,
- Tokens.LEFTMIDDLE_SYM, Tokens.LEFTBOTTOM_SYM, Tokens.RIGHTTOP_SYM,
- Tokens.RIGHTMIDDLE_SYM, Tokens.RIGHTBOTTOM_SYM]))
- {
- return SyntaxUnit.fromToken(tokenStream.token());
- } else {
- return null;
- }
-
- },
-
- _pseudo_page: function(){
-
- var tokenStream = this._tokenStream;
-
- tokenStream.mustMatch(Tokens.COLON);
- tokenStream.mustMatch(Tokens.IDENT);
-
- return tokenStream.token().value;
- },
-
- _font_face: function(){
- var tokenStream = this._tokenStream,
- line,
- col;
- tokenStream.mustMatch(Tokens.FONT_FACE_SYM);
- line = tokenStream.token().startLine;
- col = tokenStream.token().startCol;
-
- this._readWhitespace();
-
- this.fire({
- type: "startfontface",
- line: line,
- col: col
- });
-
- this._readDeclarations(true);
-
- this.fire({
- type: "endfontface",
- line: line,
- col: col
- });
- },
-
- _operator: function(){
-
- var tokenStream = this._tokenStream,
- token = null;
-
- if (tokenStream.match([Tokens.SLASH, Tokens.COMMA])){
- token = tokenStream.token();
- this._readWhitespace();
- }
- return token ? PropertyValuePart.fromToken(token) : null;
-
- },
-
- _combinator: function(){
-
- var tokenStream = this._tokenStream,
- value = null,
- token;
-
- if(tokenStream.match([Tokens.PLUS, Tokens.GREATER, Tokens.TILDE])){
- token = tokenStream.token();
- value = new Combinator(token.value, token.startLine, token.startCol);
- this._readWhitespace();
- }
-
- return value;
- },
-
- _unary_operator: function(){
-
- var tokenStream = this._tokenStream;
-
- if (tokenStream.match([Tokens.MINUS, Tokens.PLUS])){
- return tokenStream.token().value;
- } else {
- return null;
- }
- },
-
- _property: function(){
-
- var tokenStream = this._tokenStream,
- value = null,
- hack = null,
- tokenValue,
- token,
- line,
- col;
- if (tokenStream.peek() == Tokens.STAR && this.options.starHack){
- tokenStream.get();
- token = tokenStream.token();
- hack = token.value;
- line = token.startLine;
- col = token.startCol;
- }
-
- if(tokenStream.match(Tokens.IDENT)){
- token = tokenStream.token();
- tokenValue = token.value;
- if (tokenValue.charAt(0) == "_" && this.options.underscoreHack){
- hack = "_";
- tokenValue = tokenValue.substring(1);
- }
-
- value = new PropertyName(tokenValue, hack, (line||token.startLine), (col||token.startCol));
- this._readWhitespace();
- }
-
- return value;
- },
- _ruleset: function(){
-
- var tokenStream = this._tokenStream,
- tt,
- selectors;
- try {
- selectors = this._selectors_group();
- } catch (ex){
- if (ex instanceof SyntaxError && !this.options.strict){
- this.fire({
- type: "error",
- error: ex,
- message: ex.message,
- line: ex.line,
- col: ex.col
- });
- tt = tokenStream.advance([Tokens.RBRACE]);
- if (tt == Tokens.RBRACE){
- } else {
- throw ex;
- }
-
- } else {
- throw ex;
- }
- return true;
- }
- if (selectors){
-
- this.fire({
- type: "startrule",
- selectors: selectors,
- line: selectors[0].line,
- col: selectors[0].col
- });
-
- this._readDeclarations(true);
-
- this.fire({
- type: "endrule",
- selectors: selectors,
- line: selectors[0].line,
- col: selectors[0].col
- });
-
- }
-
- return selectors;
-
- },
- _selectors_group: function(){
- var tokenStream = this._tokenStream,
- selectors = [],
- selector;
-
- selector = this._selector();
- if (selector !== null){
-
- selectors.push(selector);
- while(tokenStream.match(Tokens.COMMA)){
- this._readWhitespace();
- selector = this._selector();
- if (selector !== null){
- selectors.push(selector);
- } else {
- this._unexpectedToken(tokenStream.LT(1));
- }
- }
- }
-
- return selectors.length ? selectors : null;
- },
- _selector: function(){
-
- var tokenStream = this._tokenStream,
- selector = [],
- nextSelector = null,
- combinator = null,
- ws = null;
- nextSelector = this._simple_selector_sequence();
- if (nextSelector === null){
- return null;
- }
-
- selector.push(nextSelector);
-
- do {
- combinator = this._combinator();
-
- if (combinator !== null){
- selector.push(combinator);
- nextSelector = this._simple_selector_sequence();
- if (nextSelector === null){
- this._unexpectedToken(tokenStream.LT(1));
- } else {
- selector.push(nextSelector);
- }
- } else {
- if (this._readWhitespace()){
- ws = new Combinator(tokenStream.token().value, tokenStream.token().startLine, tokenStream.token().startCol);
- combinator = this._combinator();
- nextSelector = this._simple_selector_sequence();
- if (nextSelector === null){
- if (combinator !== null){
- this._unexpectedToken(tokenStream.LT(1));
- }
- } else {
-
- if (combinator !== null){
- selector.push(combinator);
- } else {
- selector.push(ws);
- }
-
- selector.push(nextSelector);
- }
- } else {
- break;
- }
-
- }
- } while(true);
-
- return new Selector(selector, selector[0].line, selector[0].col);
- },
- _simple_selector_sequence: function(){
-
- var tokenStream = this._tokenStream,
- elementName = null,
- modifiers = [],
- selectorText= "",
- components = [
- function(){
- return tokenStream.match(Tokens.HASH) ?
- new SelectorSubPart(tokenStream.token().value, "id", tokenStream.token().startLine, tokenStream.token().startCol) :
- null;
- },
- this._class,
- this._attrib,
- this._pseudo,
- this._negation
- ],
- i = 0,
- len = components.length,
- component = null,
- found = false,
- line,
- col;
- line = tokenStream.LT(1).startLine;
- col = tokenStream.LT(1).startCol;
-
- elementName = this._type_selector();
- if (!elementName){
- elementName = this._universal();
- }
-
- if (elementName !== null){
- selectorText += elementName;
- }
-
- while(true){
- if (tokenStream.peek() === Tokens.S){
- break;
- }
- while(i < len && component === null){
- component = components[i++].call(this);
- }
-
- if (component === null){
- if (selectorText === ""){
- return null;
- } else {
- break;
- }
- } else {
- i = 0;
- modifiers.push(component);
- selectorText += component.toString();
- component = null;
- }
- }
-
-
- return selectorText !== "" ?
- new SelectorPart(elementName, modifiers, selectorText, line, col) :
- null;
- },
- _type_selector: function(){
-
- var tokenStream = this._tokenStream,
- ns = this._namespace_prefix(),
- elementName = this._element_name();
-
- if (!elementName){
- if (ns){
- tokenStream.unget();
- if (ns.length > 1){
- tokenStream.unget();
- }
- }
-
- return null;
- } else {
- if (ns){
- elementName.text = ns + elementName.text;
- elementName.col -= ns.length;
- }
- return elementName;
- }
- },
- _class: function(){
-
- var tokenStream = this._tokenStream,
- token;
-
- if (tokenStream.match(Tokens.DOT)){
- tokenStream.mustMatch(Tokens.IDENT);
- token = tokenStream.token();
- return new SelectorSubPart("." + token.value, "class", token.startLine, token.startCol - 1);
- } else {
- return null;
- }
-
- },
- _element_name: function(){
-
- var tokenStream = this._tokenStream,
- token;
-
- if (tokenStream.match(Tokens.IDENT)){
- token = tokenStream.token();
- return new SelectorSubPart(token.value, "elementName", token.startLine, token.startCol);
-
- } else {
- return null;
- }
- },
- _namespace_prefix: function(){
- var tokenStream = this._tokenStream,
- value = "";
- if (tokenStream.LA(1) === Tokens.PIPE || tokenStream.LA(2) === Tokens.PIPE){
-
- if(tokenStream.match([Tokens.IDENT, Tokens.STAR])){
- value += tokenStream.token().value;
- }
-
- tokenStream.mustMatch(Tokens.PIPE);
- value += "|";
-
- }
-
- return value.length ? value : null;
- },
- _universal: function(){
- var tokenStream = this._tokenStream,
- value = "",
- ns;
-
- ns = this._namespace_prefix();
- if(ns){
- value += ns;
- }
-
- if(tokenStream.match(Tokens.STAR)){
- value += "*";
- }
-
- return value.length ? value : null;
-
- },
- _attrib: function(){
-
- var tokenStream = this._tokenStream,
- value = null,
- ns,
- token;
-
- if (tokenStream.match(Tokens.LBRACKET)){
- token = tokenStream.token();
- value = token.value;
- value += this._readWhitespace();
-
- ns = this._namespace_prefix();
-
- if (ns){
- value += ns;
- }
-
- tokenStream.mustMatch(Tokens.IDENT);
- value += tokenStream.token().value;
- value += this._readWhitespace();
-
- if(tokenStream.match([Tokens.PREFIXMATCH, Tokens.SUFFIXMATCH, Tokens.SUBSTRINGMATCH,
- Tokens.EQUALS, Tokens.INCLUDES, Tokens.DASHMATCH])){
-
- value += tokenStream.token().value;
- value += this._readWhitespace();
-
- tokenStream.mustMatch([Tokens.IDENT, Tokens.STRING]);
- value += tokenStream.token().value;
- value += this._readWhitespace();
- }
-
- tokenStream.mustMatch(Tokens.RBRACKET);
-
- return new SelectorSubPart(value + "]", "attribute", token.startLine, token.startCol);
- } else {
- return null;
- }
- },
- _pseudo: function(){
-
- var tokenStream = this._tokenStream,
- pseudo = null,
- colons = ":",
- line,
- col;
-
- if (tokenStream.match(Tokens.COLON)){
-
- if (tokenStream.match(Tokens.COLON)){
- colons += ":";
- }
-
- if (tokenStream.match(Tokens.IDENT)){
- pseudo = tokenStream.token().value;
- line = tokenStream.token().startLine;
- col = tokenStream.token().startCol - colons.length;
- } else if (tokenStream.peek() == Tokens.FUNCTION){
- line = tokenStream.LT(1).startLine;
- col = tokenStream.LT(1).startCol - colons.length;
- pseudo = this._functional_pseudo();
- }
-
- if (pseudo){
- pseudo = new SelectorSubPart(colons + pseudo, "pseudo", line, col);
- }
- }
-
- return pseudo;
- },
- _functional_pseudo: function(){
-
- var tokenStream = this._tokenStream,
- value = null;
-
- if(tokenStream.match(Tokens.FUNCTION)){
- value = tokenStream.token().value;
- value += this._readWhitespace();
- value += this._expression();
- tokenStream.mustMatch(Tokens.RPAREN);
- value += ")";
- }
-
- return value;
- },
- _expression: function(){
-
- var tokenStream = this._tokenStream,
- value = "";
-
- while(tokenStream.match([Tokens.PLUS, Tokens.MINUS, Tokens.DIMENSION,
- Tokens.NUMBER, Tokens.STRING, Tokens.IDENT, Tokens.LENGTH,
- Tokens.FREQ, Tokens.ANGLE, Tokens.TIME,
- Tokens.RESOLUTION])){
-
- value += tokenStream.token().value;
- value += this._readWhitespace();
- }
-
- return value.length ? value : null;
-
- },
- _negation: function(){
-
- var tokenStream = this._tokenStream,
- line,
- col,
- value = "",
- arg,
- subpart = null;
-
- if (tokenStream.match(Tokens.NOT)){
- value = tokenStream.token().value;
- line = tokenStream.token().startLine;
- col = tokenStream.token().startCol;
- value += this._readWhitespace();
- arg = this._negation_arg();
- value += arg;
- value += this._readWhitespace();
- tokenStream.match(Tokens.RPAREN);
- value += tokenStream.token().value;
-
- subpart = new SelectorSubPart(value, "not", line, col);
- subpart.args.push(arg);
- }
-
- return subpart;
- },
- _negation_arg: function(){
-
- var tokenStream = this._tokenStream,
- args = [
- this._type_selector,
- this._universal,
- function(){
- return tokenStream.match(Tokens.HASH) ?
- new SelectorSubPart(tokenStream.token().value, "id", tokenStream.token().startLine, tokenStream.token().startCol) :
- null;
- },
- this._class,
- this._attrib,
- this._pseudo
- ],
- arg = null,
- i = 0,
- len = args.length,
- elementName,
- line,
- col,
- part;
-
- line = tokenStream.LT(1).startLine;
- col = tokenStream.LT(1).startCol;
-
- while(i < len && arg === null){
-
- arg = args[i].call(this);
- i++;
- }
- if (arg === null){
- this._unexpectedToken(tokenStream.LT(1));
- }
- if (arg.type == "elementName"){
- part = new SelectorPart(arg, [], arg.toString(), line, col);
- } else {
- part = new SelectorPart(null, [arg], arg.toString(), line, col);
- }
-
- return part;
- },
-
- _declaration: function(){
-
- var tokenStream = this._tokenStream,
- property = null,
- expr = null,
- prio = null,
- error = null,
- invalid = null,
- propertyName= "";
-
- property = this._property();
- if (property !== null){
-
- tokenStream.mustMatch(Tokens.COLON);
- this._readWhitespace();
-
- expr = this._expr();
- if (!expr || expr.length === 0){
- this._unexpectedToken(tokenStream.LT(1));
- }
-
- prio = this._prio();
- propertyName = property.toString();
- if (this.options.starHack && property.hack == "*" ||
- this.options.underscoreHack && property.hack == "_") {
-
- propertyName = property.text;
- }
-
- try {
- this._validateProperty(propertyName, expr);
- } catch (ex) {
- invalid = ex;
- }
-
- this.fire({
- type: "property",
- property: property,
- value: expr,
- important: prio,
- line: property.line,
- col: property.col,
- invalid: invalid
- });
-
- return true;
- } else {
- return false;
- }
- },
-
- _prio: function(){
-
- var tokenStream = this._tokenStream,
- result = tokenStream.match(Tokens.IMPORTANT_SYM);
-
- this._readWhitespace();
- return result;
- },
-
- _expr: function(){
-
- var tokenStream = this._tokenStream,
- values = [],
- value = null,
- operator = null;
-
- value = this._term();
- if (value !== null){
-
- values.push(value);
-
- do {
- operator = this._operator();
- if (operator){
- values.push(operator);
- } /*else {
- values.push(new PropertyValue(valueParts, valueParts[0].line, valueParts[0].col));
- valueParts = [];
- }*/
-
- value = this._term();
-
- if (value === null){
- break;
- } else {
- values.push(value);
- }
- } while(true);
- }
-
- return values.length > 0 ? new PropertyValue(values, values[0].line, values[0].col) : null;
- },
-
- _term: function(){
-
- var tokenStream = this._tokenStream,
- unary = null,
- value = null,
- token,
- line,
- col;
- unary = this._unary_operator();
- if (unary !== null){
- line = tokenStream.token().startLine;
- col = tokenStream.token().startCol;
- }
- if (tokenStream.peek() == Tokens.IE_FUNCTION && this.options.ieFilters){
-
- value = this._ie_function();
- if (unary === null){
- line = tokenStream.token().startLine;
- col = tokenStream.token().startCol;
- }
- } else if (tokenStream.match([Tokens.NUMBER, Tokens.PERCENTAGE, Tokens.LENGTH,
- Tokens.ANGLE, Tokens.TIME,
- Tokens.FREQ, Tokens.STRING, Tokens.IDENT, Tokens.URI, Tokens.UNICODE_RANGE])){
-
- value = tokenStream.token().value;
- if (unary === null){
- line = tokenStream.token().startLine;
- col = tokenStream.token().startCol;
- }
- this._readWhitespace();
- } else {
- token = this._hexcolor();
- if (token === null){
- if (unary === null){
- line = tokenStream.LT(1).startLine;
- col = tokenStream.LT(1).startCol;
- }
- if (value === null){
- if (tokenStream.LA(3) == Tokens.EQUALS && this.options.ieFilters){
- value = this._ie_function();
- } else {
- value = this._function();
- }
- }
-
- } else {
- value = token.value;
- if (unary === null){
- line = token.startLine;
- col = token.startCol;
- }
- }
-
- }
-
- return value !== null ?
- new PropertyValuePart(unary !== null ? unary + value : value, line, col) :
- null;
-
- },
-
- _function: function(){
-
- var tokenStream = this._tokenStream,
- functionText = null,
- expr = null,
- lt;
-
- if (tokenStream.match(Tokens.FUNCTION)){
- functionText = tokenStream.token().value;
- this._readWhitespace();
- expr = this._expr();
- functionText += expr;
- if (this.options.ieFilters && tokenStream.peek() == Tokens.EQUALS){
- do {
-
- if (this._readWhitespace()){
- functionText += tokenStream.token().value;
- }
- if (tokenStream.LA(0) == Tokens.COMMA){
- functionText += tokenStream.token().value;
- }
-
- tokenStream.match(Tokens.IDENT);
- functionText += tokenStream.token().value;
-
- tokenStream.match(Tokens.EQUALS);
- functionText += tokenStream.token().value;
- lt = tokenStream.peek();
- while(lt != Tokens.COMMA && lt != Tokens.S && lt != Tokens.RPAREN){
- tokenStream.get();
- functionText += tokenStream.token().value;
- lt = tokenStream.peek();
- }
- } while(tokenStream.match([Tokens.COMMA, Tokens.S]));
- }
-
- tokenStream.match(Tokens.RPAREN);
- functionText += ")";
- this._readWhitespace();
- }
-
- return functionText;
- },
-
- _ie_function: function(){
-
- var tokenStream = this._tokenStream,
- functionText = null,
- expr = null,
- lt;
- if (tokenStream.match([Tokens.IE_FUNCTION, Tokens.FUNCTION])){
- functionText = tokenStream.token().value;
-
- do {
-
- if (this._readWhitespace()){
- functionText += tokenStream.token().value;
- }
- if (tokenStream.LA(0) == Tokens.COMMA){
- functionText += tokenStream.token().value;
- }
-
- tokenStream.match(Tokens.IDENT);
- functionText += tokenStream.token().value;
-
- tokenStream.match(Tokens.EQUALS);
- functionText += tokenStream.token().value;
- lt = tokenStream.peek();
- while(lt != Tokens.COMMA && lt != Tokens.S && lt != Tokens.RPAREN){
- tokenStream.get();
- functionText += tokenStream.token().value;
- lt = tokenStream.peek();
- }
- } while(tokenStream.match([Tokens.COMMA, Tokens.S]));
-
- tokenStream.match(Tokens.RPAREN);
- functionText += ")";
- this._readWhitespace();
- }
-
- return functionText;
- },
-
- _hexcolor: function(){
-
- var tokenStream = this._tokenStream,
- token = null,
- color;
-
- if(tokenStream.match(Tokens.HASH)){
-
- token = tokenStream.token();
- color = token.value;
- if (!/#[a-f0-9]{3,6}/i.test(color)){
- throw new SyntaxError("Expected a hex color but found '" + color + "' at line " + token.startLine + ", col " + token.startCol + ".", token.startLine, token.startCol);
- }
- this._readWhitespace();
- }
-
- return token;
- },
-
- _keyframes: function(){
- var tokenStream = this._tokenStream,
- token,
- tt,
- name,
- prefix = "";
-
- tokenStream.mustMatch(Tokens.KEYFRAMES_SYM);
- token = tokenStream.token();
- if (/^@\-([^\-]+)\-/.test(token.value)) {
- prefix = RegExp.$1;
- }
-
- this._readWhitespace();
- name = this._keyframe_name();
-
- this._readWhitespace();
- tokenStream.mustMatch(Tokens.LBRACE);
-
- this.fire({
- type: "startkeyframes",
- name: name,
- prefix: prefix,
- line: token.startLine,
- col: token.startCol
- });
-
- this._readWhitespace();
- tt = tokenStream.peek();
- while(tt == Tokens.IDENT || tt == Tokens.PERCENTAGE) {
- this._keyframe_rule();
- this._readWhitespace();
- tt = tokenStream.peek();
- }
-
- this.fire({
- type: "endkeyframes",
- name: name,
- prefix: prefix,
- line: token.startLine,
- col: token.startCol
- });
-
- this._readWhitespace();
- tokenStream.mustMatch(Tokens.RBRACE);
-
- },
-
- _keyframe_name: function(){
- var tokenStream = this._tokenStream,
- token;
-
- tokenStream.mustMatch([Tokens.IDENT, Tokens.STRING]);
- return SyntaxUnit.fromToken(tokenStream.token());
- },
-
- _keyframe_rule: function(){
- var tokenStream = this._tokenStream,
- token,
- keyList = this._key_list();
-
- this.fire({
- type: "startkeyframerule",
- keys: keyList,
- line: keyList[0].line,
- col: keyList[0].col
- });
-
- this._readDeclarations(true);
-
- this.fire({
- type: "endkeyframerule",
- keys: keyList,
- line: keyList[0].line,
- col: keyList[0].col
- });
-
- },
-
- _key_list: function(){
- var tokenStream = this._tokenStream,
- token,
- key,
- keyList = [];
- keyList.push(this._key());
-
- this._readWhitespace();
-
- while(tokenStream.match(Tokens.COMMA)){
- this._readWhitespace();
- keyList.push(this._key());
- this._readWhitespace();
- }
-
- return keyList;
- },
-
- _key: function(){
-
- var tokenStream = this._tokenStream,
- token;
-
- if (tokenStream.match(Tokens.PERCENTAGE)){
- return SyntaxUnit.fromToken(tokenStream.token());
- } else if (tokenStream.match(Tokens.IDENT)){
- token = tokenStream.token();
-
- if (/from|to/i.test(token.value)){
- return SyntaxUnit.fromToken(token);
- }
-
- tokenStream.unget();
- }
- this._unexpectedToken(tokenStream.LT(1));
- },
- _skipCruft: function(){
- while(this._tokenStream.match([Tokens.S, Tokens.CDO, Tokens.CDC])){
- }
- },
- _readDeclarations: function(checkStart, readMargins){
- var tokenStream = this._tokenStream,
- tt;
-
-
- this._readWhitespace();
-
- if (checkStart){
- tokenStream.mustMatch(Tokens.LBRACE);
- }
-
- this._readWhitespace();
-
- try {
-
- while(true){
-
- if (tokenStream.match(Tokens.SEMICOLON) || (readMargins && this._margin())){
- } else if (this._declaration()){
- if (!tokenStream.match(Tokens.SEMICOLON)){
- break;
- }
- } else {
- break;
- }
- this._readWhitespace();
- }
-
- tokenStream.mustMatch(Tokens.RBRACE);
- this._readWhitespace();
-
- } catch (ex) {
- if (ex instanceof SyntaxError && !this.options.strict){
- this.fire({
- type: "error",
- error: ex,
- message: ex.message,
- line: ex.line,
- col: ex.col
- });
- tt = tokenStream.advance([Tokens.SEMICOLON, Tokens.RBRACE]);
- if (tt == Tokens.SEMICOLON){
- this._readDeclarations(false, readMargins);
- } else if (tt != Tokens.RBRACE){
- throw ex;
- }
-
- } else {
- throw ex;
- }
- }
-
- },
- _readWhitespace: function(){
-
- var tokenStream = this._tokenStream,
- ws = "";
-
- while(tokenStream.match(Tokens.S)){
- ws += tokenStream.token().value;
- }
-
- return ws;
- },
- _unexpectedToken: function(token){
- throw new SyntaxError("Unexpected token '" + token.value + "' at line " + token.startLine + ", col " + token.startCol + ".", token.startLine, token.startCol);
- },
- _verifyEnd: function(){
- if (this._tokenStream.LA(1) != Tokens.EOF){
- this._unexpectedToken(this._tokenStream.LT(1));
- }
- },
- _validateProperty: function(property, value){
- Validation.validate(property, value);
- },
-
- parse: function(input){
- this._tokenStream = new TokenStream(input, Tokens);
- this._stylesheet();
- },
-
- parseStyleSheet: function(input){
- return this.parse(input);
- },
-
- parseMediaQuery: function(input){
- this._tokenStream = new TokenStream(input, Tokens);
- var result = this._media_query();
- this._verifyEnd();
- return result;
- },
- parsePropertyValue: function(input){
-
- this._tokenStream = new TokenStream(input, Tokens);
- this._readWhitespace();
-
- var result = this._expr();
- this._readWhitespace();
- this._verifyEnd();
- return result;
- },
- parseRule: function(input){
- this._tokenStream = new TokenStream(input, Tokens);
- this._readWhitespace();
-
- var result = this._ruleset();
- this._readWhitespace();
- this._verifyEnd();
- return result;
- },
- parseSelector: function(input){
-
- this._tokenStream = new TokenStream(input, Tokens);
- this._readWhitespace();
-
- var result = this._selector();
- this._readWhitespace();
- this._verifyEnd();
- return result;
- },
- parseStyleAttribute: function(input){
- input += "}"; // for error recovery in _readDeclarations()
- this._tokenStream = new TokenStream(input, Tokens);
- this._readDeclarations();
- }
- };
- for (prop in additions){
- if (additions.hasOwnProperty(prop)){
- proto[prop] = additions[prop];
- }
- }
-
- return proto;
-}();
-var Properties = {
- "alignment-adjust" : "auto | baseline | before-edge | text-before-edge | middle | central | after-edge | text-after-edge | ideographic | alphabetic | hanging | mathematical | | ",
- "alignment-baseline" : "baseline | use-script | before-edge | text-before-edge | after-edge | text-after-edge | central | middle | ideographic | alphabetic | hanging | mathematical",
- "animation" : 1,
- "animation-delay" : { multi: "