summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/assets/javascripts/application.js1
-rw-r--r--app/assets/stylesheets/main.scss6
-rw-r--r--app/assets/stylesheets/sections/editor.scss14
-rw-r--r--app/views/tree/edit.html.haml15
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/ace.js15881
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/keybinding-emacs.js374
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/keybinding-vim.js1679
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/mode-c9search.js268
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/mode-c_cpp.js759
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/mode-clojure.js347
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/mode-coffee.js513
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/mode-coldfusion.js1852
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/mode-csharp.js619
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/mode-css.js457
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/mode-diff.js244
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/mode-glsl.js834
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/mode-golang.js674
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/mode-groovy.js1160
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/mode-haxe.js624
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/mode-html.js1950
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/mode-jade.js2038
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/mode-java.js1120
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/mode-javascript.js990
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/mode-json.js581
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/mode-jsp.js1664
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/mode-jsx.js646
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/mode-latex.js95
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/mode-less.js504
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/mode-liquid.js1003
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/mode-lua.js524
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/mode-luahtml.js2415
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/mode-luapage.js2480
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/mode-markdown.js2252
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/mode-ocaml.js452
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/mode-perl.js419
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/mode-pgsql.js963
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/mode-php.js2359
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/mode-powershell.js608
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/mode-python.js383
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/mode-ruby.js302
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/mode-scad.js712
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/mode-scala.js1151
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/mode-scss.js530
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/mode-sh.js238
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/mode-sql.js145
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/mode-svg.js1602
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/mode-tcl.js444
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/mode-text.js0
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/mode-textile.js175
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/mode-xml.js822
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/mode-xquery.js591
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/mode-yaml.js371
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/theme-ambiance.js269
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/theme-chrome.js205
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/theme-clouds.js170
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/theme-clouds_midnight.js171
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/theme-cobalt.js182
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/theme-crimson_editor.js197
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/theme-dawn.js183
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/theme-dreamweaver.js224
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/theme-eclipse.js154
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/theme-github.js175
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/theme-idle_fingers.js171
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/theme-kr_theme.js177
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/theme-merbivore.js168
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/theme-merbivore_soft.js169
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/theme-mono_industrial.js180
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/theme-monokai.js174
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/theme-pastel_on_dark.js187
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/theme-solarized_dark.js159
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/theme-solarized_light.js164
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/theme-textmate.js207
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/theme-tomorrow.js182
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/theme-tomorrow_night.js182
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/theme-tomorrow_night_blue.js179
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/theme-tomorrow_night_bright.js182
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/theme-tomorrow_night_eighties.js178
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/theme-twilight.js184
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/theme-vibrant_ink.js164
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/theme-xcode.js156
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/worker-coffee.js7213
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/worker-css.js10940
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/worker-javascript.js10319
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/worker-json.js2946
-rw-r--r--vendor/assets/javascripts/ace-src-noconflict/worker-xquery.js69021
85 files changed, 162379 insertions, 3 deletions
diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js
index d582a1a1727..21554ba396d 100644
--- a/app/assets/javascripts/application.js
+++ b/app/assets/javascripts/application.js
@@ -18,4 +18,5 @@
//= require chosen-jquery
//= require raphael
//= require branch-graph
+//= require ace-src-noconflict/ace.js
//= require_tree .
diff --git a/app/assets/stylesheets/main.scss b/app/assets/stylesheets/main.scss
index bff24493820..f8cf8e449b4 100644
--- a/app/assets/stylesheets/main.scss
+++ b/app/assets/stylesheets/main.scss
@@ -182,3 +182,9 @@ $hover: #D9EDF7;
*
*/
@import "highlight/dark.scss";
+
+/**
+ * File Editor styles
+ *
+ */
+@import "sections/editor.scss";
diff --git a/app/assets/stylesheets/sections/editor.scss b/app/assets/stylesheets/sections/editor.scss
new file mode 100644
index 00000000000..f8e0fcac8c7
--- /dev/null
+++ b/app/assets/stylesheets/sections/editor.scss
@@ -0,0 +1,14 @@
+.file-editor {
+
+ #editor{
+ height: 500px;
+ width: 90%;
+ position: relative;
+ margin-bottom: 20px;
+ }
+ textarea{
+ display: block;
+ width: 40%;
+ margin: 10px 0 10px 0;
+ }
+}
diff --git a/app/views/tree/edit.html.haml b/app/views/tree/edit.html.haml
index d4571f7663c..f9a1e6dcc76 100644
--- a/app/views/tree/edit.html.haml
+++ b/app/views/tree/edit.html.haml
@@ -1,10 +1,19 @@
-.file_holder
- Edit file:
+.file-editor
+ .file_name
+ File:
%span.file_name
= @tree.path.force_encoding('utf-8')
%br
= form_tag(project_tree_path(@project, @id), :method => :put) do
- %textarea
+ #editor
= @tree.data
= hidden_field_tag 'last_commit', @last_commit
+ = hidden_field_tag 'content'
+
+ = text_area_tag 'text_commit'
= submit_tag "Save"
+
+:javascript
+ var editor = ace.edit("editor");
+ editor.setTheme("ace/theme/twilight");
+ editor.getSession().setMode("ace/mode/javascript");
diff --git a/vendor/assets/javascripts/ace-src-noconflict/ace.js b/vendor/assets/javascripts/ace-src-noconflict/ace.js
new file mode 100644
index 00000000000..11b4bbb8da3
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/ace.js
@@ -0,0 +1,15881 @@
+/* ***** 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 a module along with a payload
+ * @param module a name for the payload
+ * @param payload a function to call with (require, exports, module) params
+ */
+
+(function() {
+
+var ACE_NAMESPACE = "ace";
+
+var global = (function() {
+ return this;
+})();
+
+// take care of the case when requirejs is used and we just need to patch it a little bit
+if (!ACE_NAMESPACE && typeof requirejs !== "undefined") {
+
+ var define = global.define;
+ global.define = function(id, deps, callback) {
+ if (typeof callback !== "function")
+ return define.apply(this, arguments);
+
+ return ace.define(id, deps, function(require, exports, module) {
+ if (deps[2] == "module")
+ module.packaged = true;
+ return callback.apply(this, arguments);
+ });
+ };
+ global.define.packaged = true;
+
+ return;
+}
+
+
+var _define = function(module, deps, payload) {
+ if (typeof module !== 'string') {
+ if (_define.original)
+ _define.original.apply(window, arguments);
+ else {
+ console.error('dropping module because define wasn\'t a string.');
+ console.trace();
+ }
+ return;
+ }
+
+ if (arguments.length == 2)
+ payload = deps;
+
+ if (!_define.modules)
+ _define.modules = {};
+
+ _define.modules[module] = payload;
+};
+var _require = function(parentId, module, callback) {
+ if (Object.prototype.toString.call(module) === "[object Array]") {
+ var params = [];
+ for (var i = 0, l = module.length; i < l; ++i) {
+ var dep = lookup(parentId, module[i]);
+ if (!dep && _require.original)
+ return _require.original.apply(window, arguments);
+ params.push(dep);
+ }
+ if (callback) {
+ callback.apply(null, params);
+ }
+ }
+ else if (typeof module === 'string') {
+ var payload = lookup(parentId, module);
+ if (!payload && _require.original)
+ return _require.original.apply(window, arguments);
+
+ if (callback) {
+ callback();
+ }
+
+ return payload;
+ }
+ else {
+ if (_require.original)
+ return _require.original.apply(window, arguments);
+ }
+};
+
+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 lookup = function(parentId, moduleName) {
+
+ moduleName = normalizeModule(parentId, moduleName);
+
+ var module = _define.modules[moduleName];
+ if (!module) {
+ return null;
+ }
+
+ if (typeof module === 'function') {
+ var exports = {};
+ var mod = {
+ id: moduleName,
+ uri: '',
+ exports: exports,
+ packaged: true
+ };
+
+ var req = function(module, callback) {
+ return _require(moduleName, module, callback);
+ };
+
+ var returnValue = module(req, exports, mod);
+ exports = returnValue || mod.exports;
+
+ // cache the resulting module object for next time
+ _define.modules[moduleName] = exports;
+ return exports;
+ }
+
+ return module;
+};
+
+function exportAce(ns) {
+ var require = function(module, callback) {
+ return _require("", module, callback);
+ };
+
+ var root = global;
+ if (ns) {
+ if (!global[ns])
+ global[ns] = {};
+ root = global[ns];
+ }
+
+ if (!root.define || !root.define.packaged) {
+ _define.original = root.define;
+ root.define = _define;
+ root.define.packaged = true;
+ }
+
+ if (!root.require || !root.require.packaged) {
+ _require.original = root.require;
+ root.require = require;
+ root.require.packaged = true;
+ }
+}
+
+exportAce(ACE_NAMESPACE);
+
+})();
+
+/**
+ * class Ace
+ *
+ * The main class required to set up an Ace instance in the browser.
+ *
+ *
+ **/
+
+ace.define('ace/ace', ['require', 'exports', 'module' , 'ace/lib/fixoldbrowsers', 'ace/lib/dom', 'ace/lib/event', 'ace/editor', 'ace/edit_session', 'ace/undomanager', 'ace/virtual_renderer', 'ace/multi_select', 'ace/worker/worker_client', 'ace/keyboard/hash_handler', 'ace/keyboard/state_handler', 'ace/placeholder', 'ace/config', 'ace/theme/textmate'], function(require, exports, module) {
+
+
+require("./lib/fixoldbrowsers");
+
+var Dom = require("./lib/dom");
+var Event = require("./lib/event");
+
+var Editor = require("./editor").Editor;
+var EditSession = require("./edit_session").EditSession;
+var UndoManager = require("./undomanager").UndoManager;
+var Renderer = require("./virtual_renderer").VirtualRenderer;
+var MultiSelect = require("./multi_select").MultiSelect;
+
+// The following require()s are for inclusion in the built ace file
+require("./worker/worker_client");
+require("./keyboard/hash_handler");
+require("./keyboard/state_handler");
+require("./placeholder");
+exports.config = require("./config");
+exports.edit = function(el) {
+ if (typeof(el) == "string") {
+ var _id = el;
+ if (!(el = document.getElementById(el))) {
+ console.log("can't match div #" + _id);
+ }
+ }
+
+ if (el.env && el.env.editor instanceof Editor)
+ return el.env.editor;
+
+ var doc = new EditSession(Dom.getInnerText(el));
+ doc.setUndoManager(new UndoManager());
+ el.innerHTML = '';
+
+ var editor = new Editor(new Renderer(el, require("./theme/textmate")));
+ new MultiSelect(editor);
+ editor.setSession(doc);
+
+ var env = {};
+ env.document = doc;
+ env.editor = editor;
+ editor.resize();
+ Event.addListener(window, "resize", function() {
+ editor.resize();
+ });
+ el.env = env;
+ // Store env on editor such that it can be accessed later on from
+ // the returned object.
+ editor.env = env;
+ return editor;
+};
+
+});
+// vim:set ts=4 sts=4 sw=4 st:
+// -- kriskowal Kris Kowal Copyright (C) 2009-2010 MIT License
+// -- tlrobinson Tom Robinson Copyright (C) 2009-2010 MIT License (Narwhal Project)
+// -- dantman Daniel Friesen Copyright(C) 2010 XXX No License Specified
+// -- fschaefer Florian Schäfer Copyright (C) 2010 MIT License
+// -- Irakli Gozalishvili Copyright (C) 2010 MIT License
+
+/*!
+ Copyright (c) 2009, 280 North Inc. http://280north.com/
+ MIT License. http://github.com/280north/narwhal/blob/master/README.md
+*/
+
+ace.define('ace/lib/fixoldbrowsers', ['require', 'exports', 'module' , 'ace/lib/regexp', 'ace/lib/es5-shim'], function(require, exports, module) {
+
+
+require("./regexp");
+require("./es5-shim");
+
+});
+
+ace.define('ace/lib/regexp', ['require', 'exports', 'module' ], function(require, exports, module) {
+
+
+ //---------------------------------
+ // Private variables
+ //---------------------------------
+
+ 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;
+
+ //---------------------------------
+ // Overriden native methods
+ //---------------------------------
+
+ // Adds named capture support (with backreferences returned as `result.name`), and fixes two
+ // cross-browser issues per ES3:
+ // - Captured values for nonparticipating capturing groups should be returned as `undefined`,
+ // rather than the empty string.
+ // - `lastIndex` should not be incremented after zero-length matches.
+ RegExp.prototype.exec = function (str) {
+ var match = real.exec.apply(this, arguments),
+ name, r2;
+ if ( typeof(str) == 'string' && match) {
+ // Fix browsers whose `exec` methods don't consistently return `undefined` for
+ // nonparticipating capturing groups
+ if (!compliantExecNpcg && match.length > 1 && indexOf(match, "") > -1) {
+ r2 = RegExp(this.source, real.replace.call(getNativeFlags(this), "g", ""));
+ // Using `str.slice(match.index)` rather than `match[0]` in case lookahead allowed
+ // matching due to characters outside the match
+ 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;
+ }
+ });
+ }
+ // Attach named capture properties
+ 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];
+ }
+ }
+ // Fix browsers that increment `lastIndex` after zero-length matches
+ if (!compliantLastIndexIncrement && this.global && !match[0].length && (this.lastIndex > match.index))
+ this.lastIndex--;
+ }
+ return match;
+ };
+
+ // Don't override `test` if it won't change anything
+ if (!compliantLastIndexIncrement) {
+ // Fix browser bug in native method
+ RegExp.prototype.test = function (str) {
+ // Use the native `exec` to skip some processing overhead, even though the overriden
+ // `exec` would take care of the `lastIndex` fix
+ var match = real.exec.call(this, str);
+ // Fix browsers that increment `lastIndex` after zero-length matches
+ if (match && this.global && !match[0].length && (this.lastIndex > match.index))
+ this.lastIndex--;
+ return !!match;
+ };
+ }
+
+ //---------------------------------
+ // Private helper functions
+ //---------------------------------
+
+ 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;
+ }
+
+});
+// vim: ts=4 sts=4 sw=4 expandtab
+// -- kriskowal Kris Kowal Copyright (C) 2009-2011 MIT License
+// -- tlrobinson Tom Robinson Copyright (C) 2009-2010 MIT License (Narwhal Project)
+// -- dantman Daniel Friesen Copyright (C) 2010 XXX TODO License or CLA
+// -- fschaefer Florian Schäfer Copyright (C) 2010 MIT License
+// -- Gozala Irakli Gozalishvili Copyright (C) 2010 MIT License
+// -- kitcambridge Kit Cambridge Copyright (C) 2011 MIT License
+// -- kossnocorp Sasha Koss XXX TODO License or CLA
+// -- bryanforbes Bryan Forbes XXX TODO License or CLA
+// -- killdream Quildreen Motta Copyright (C) 2011 MIT Licence
+// -- michaelficarra Michael Ficarra Copyright (C) 2011 3-clause BSD License
+// -- sharkbrainguy Gerard Paapu Copyright (C) 2011 MIT License
+// -- bbqsrc Brendan Molloy (C) 2011 Creative Commons Zero (public domain)
+// -- iwyg XXX TODO License or CLA
+// -- DomenicDenicola Domenic Denicola Copyright (C) 2011 MIT License
+// -- xavierm02 Montillet Xavier XXX TODO License or CLA
+// -- Raynos Raynos XXX TODO License or CLA
+// -- samsonjs Sami Samhuri Copyright (C) 2010 MIT License
+// -- rwldrn Rick Waldron Copyright (C) 2011 MIT License
+// -- lexer Alexey Zakharov XXX TODO License or CLA
+
+/*!
+ Copyright (c) 2009, 280 North Inc. http://280north.com/
+ MIT License. http://github.com/280north/narwhal/blob/master/README.md
+*/
+
+ace.define('ace/lib/es5-shim', ['require', 'exports', 'module' ], function(require, exports, module) {
+
+/*
+ * Brings an environment as close to ECMAScript 5 compliance
+ * as is possible with the facilities of erstwhile engines.
+ *
+ * Annotated ES5: http://es5.github.com/ (specific links below)
+ * ES5 Spec: http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf
+ *
+ * @module
+ */
+
+/*whatsupdoc*/
+
+//
+// Function
+// ========
+//
+
+// ES-5 15.3.4.5
+// http://es5.github.com/#x15.3.4.5
+
+if (!Function.prototype.bind) {
+ Function.prototype.bind = function bind(that) { // .length is 1
+ // 1. Let Target be the this value.
+ var target = this;
+ // 2. If IsCallable(Target) is false, throw a TypeError exception.
+ if (typeof target != "function")
+ throw new TypeError(); // TODO message
+ // 3. Let A be a new (possibly empty) internal list of all of the
+ // argument values provided after thisArg (arg1, arg2 etc), in order.
+ // XXX slicedArgs will stand in for "A" if used
+ var args = slice.call(arguments, 1); // for normal call
+ // 4. Let F be a new native ECMAScript object.
+ // 11. Set the [[Prototype]] internal property of F to the standard
+ // built-in Function prototype object as specified in 15.3.3.1.
+ // 12. Set the [[Call]] internal property of F as described in
+ // 15.3.4.5.1.
+ // 13. Set the [[Construct]] internal property of F as described in
+ // 15.3.4.5.2.
+ // 14. Set the [[HasInstance]] internal property of F as described in
+ // 15.3.4.5.3.
+ var bound = function () {
+
+ if (this instanceof bound) {
+ // 15.3.4.5.2 [[Construct]]
+ // When the [[Construct]] internal method of a function object,
+ // F that was created using the bind function is called with a
+ // list of arguments ExtraArgs, the following steps are taken:
+ // 1. Let target be the value of F's [[TargetFunction]]
+ // internal property.
+ // 2. If target has no [[Construct]] internal method, a
+ // TypeError exception is thrown.
+ // 3. Let boundArgs be the value of F's [[BoundArgs]] internal
+ // property.
+ // 4. Let args be a new list containing the same values as the
+ // list boundArgs in the same order followed by the same
+ // values as the list ExtraArgs in the same order.
+ // 5. Return the result of calling the [[Construct]] internal
+ // method of target providing args as the arguments.
+
+ var F = function(){};
+ F.prototype = target.prototype;
+ var self = new F;
+
+ var result = target.apply(
+ self,
+ args.concat(slice.call(arguments))
+ );
+ if (result !== null && Object(result) === result)
+ return result;
+ return self;
+
+ } else {
+ // 15.3.4.5.1 [[Call]]
+ // When the [[Call]] internal method of a function object, F,
+ // which was created using the bind function is called with a
+ // this value and a list of arguments ExtraArgs, the following
+ // steps are taken:
+ // 1. Let boundArgs be the value of F's [[BoundArgs]] internal
+ // property.
+ // 2. Let boundThis be the value of F's [[BoundThis]] internal
+ // property.
+ // 3. Let target be the value of F's [[TargetFunction]] internal
+ // property.
+ // 4. Let args be a new list containing the same values as the
+ // list boundArgs in the same order followed by the same
+ // values as the list ExtraArgs in the same order.
+ // 5. Return the result of calling the [[Call]] internal method
+ // of target providing boundThis as the this value and
+ // providing args as the arguments.
+
+ // equiv: target.call(this, ...boundArgs, ...args)
+ return target.apply(
+ that,
+ args.concat(slice.call(arguments))
+ );
+
+ }
+
+ };
+ // XXX bound.length is never writable, so don't even try
+ //
+ // 15. If the [[Class]] internal property of Target is "Function", then
+ // a. Let L be the length property of Target minus the length of A.
+ // b. Set the length own property of F to either 0 or L, whichever is
+ // larger.
+ // 16. Else set the length own property of F to 0.
+ // 17. Set the attributes of the length own property of F to the values
+ // specified in 15.3.5.1.
+
+ // TODO
+ // 18. Set the [[Extensible]] internal property of F to true.
+
+ // TODO
+ // 19. Let thrower be the [[ThrowTypeError]] function Object (13.2.3).
+ // 20. Call the [[DefineOwnProperty]] internal method of F with
+ // arguments "caller", PropertyDescriptor {[[Get]]: thrower, [[Set]]:
+ // thrower, [[Enumerable]]: false, [[Configurable]]: false}, and
+ // false.
+ // 21. Call the [[DefineOwnProperty]] internal method of F with
+ // arguments "arguments", PropertyDescriptor {[[Get]]: thrower,
+ // [[Set]]: thrower, [[Enumerable]]: false, [[Configurable]]: false},
+ // and false.
+
+ // TODO
+ // NOTE Function objects created using Function.prototype.bind do not
+ // have a prototype property or the [[Code]], [[FormalParameters]], and
+ // [[Scope]] internal properties.
+ // XXX can't delete prototype in pure-js.
+
+ // 22. Return F.
+ return bound;
+ };
+}
+
+// Shortcut to an often accessed properties, in order to avoid multiple
+// dereference that costs universally.
+// _Please note: Shortcuts are defined after `Function.prototype.bind` as we
+// us it in defining shortcuts.
+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);
+
+// If JS engine supports accessors creating shortcuts.
+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__);
+}
+
+//
+// Array
+// =====
+//
+
+// ES5 15.4.3.2
+// http://es5.github.com/#x15.4.3.2
+// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/isArray
+if (!Array.isArray) {
+ Array.isArray = function isArray(obj) {
+ return toString(obj) == "[object Array]";
+ };
+}
+
+// The IsCallable() check in the Array functions
+// has been replaced with a strict check on the
+// internal class of the object to trap cases where
+// the provided function was actually a regular
+// expression literal, which in V8 and
+// JavaScriptCore is a typeof "function". Only in
+// V8 are regular expression literals permitted as
+// reduce parameters, so it is desirable in the
+// general case for the shim to match the more
+// strict and common behavior of rejecting regular
+// expressions.
+
+// ES5 15.4.4.18
+// http://es5.github.com/#x15.4.4.18
+// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/array/forEach
+if (!Array.prototype.forEach) {
+ Array.prototype.forEach = function forEach(fun /*, thisp*/) {
+ var self = toObject(this),
+ thisp = arguments[1],
+ i = 0,
+ length = self.length >>> 0;
+
+ // If no callback function or if callback is not a callable function
+ if (toString(fun) != "[object Function]") {
+ throw new TypeError(); // TODO message
+ }
+
+ while (i < length) {
+ if (i in self) {
+ // Invoke the callback function with call, passing arguments:
+ // context, property value, property key, thisArg object context
+ fun.call(thisp, self[i], i, self);
+ }
+ i++;
+ }
+ };
+}
+
+// ES5 15.4.4.19
+// http://es5.github.com/#x15.4.4.19
+// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/map
+if (!Array.prototype.map) {
+ Array.prototype.map = function map(fun /*, thisp*/) {
+ var self = toObject(this),
+ length = self.length >>> 0,
+ result = Array(length),
+ thisp = arguments[1];
+
+ // If no callback function or if callback is not a callable function
+ if (toString(fun) != "[object Function]") {
+ throw new TypeError(); // TODO message
+ }
+
+ for (var i = 0; i < length; i++) {
+ if (i in self)
+ result[i] = fun.call(thisp, self[i], i, self);
+ }
+ return result;
+ };
+}
+
+// ES5 15.4.4.20
+// http://es5.github.com/#x15.4.4.20
+// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/filter
+if (!Array.prototype.filter) {
+ Array.prototype.filter = function filter(fun /*, thisp */) {
+ var self = toObject(this),
+ length = self.length >>> 0,
+ result = [],
+ thisp = arguments[1];
+
+ // If no callback function or if callback is not a callable function
+ if (toString(fun) != "[object Function]") {
+ throw new TypeError(); // TODO message
+ }
+
+ for (var i = 0; i < length; i++) {
+ if (i in self && fun.call(thisp, self[i], i, self))
+ result.push(self[i]);
+ }
+ return result;
+ };
+}
+
+// ES5 15.4.4.16
+// http://es5.github.com/#x15.4.4.16
+// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/every
+if (!Array.prototype.every) {
+ Array.prototype.every = function every(fun /*, thisp */) {
+ var self = toObject(this),
+ length = self.length >>> 0,
+ thisp = arguments[1];
+
+ // If no callback function or if callback is not a callable function
+ if (toString(fun) != "[object Function]") {
+ throw new TypeError(); // TODO message
+ }
+
+ for (var i = 0; i < length; i++) {
+ if (i in self && !fun.call(thisp, self[i], i, self))
+ return false;
+ }
+ return true;
+ };
+}
+
+// ES5 15.4.4.17
+// http://es5.github.com/#x15.4.4.17
+// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/some
+if (!Array.prototype.some) {
+ Array.prototype.some = function some(fun /*, thisp */) {
+ var self = toObject(this),
+ length = self.length >>> 0,
+ thisp = arguments[1];
+
+ // If no callback function or if callback is not a callable function
+ if (toString(fun) != "[object Function]") {
+ throw new TypeError(); // TODO message
+ }
+
+ for (var i = 0; i < length; i++) {
+ if (i in self && fun.call(thisp, self[i], i, self))
+ return true;
+ }
+ return false;
+ };
+}
+
+// ES5 15.4.4.21
+// http://es5.github.com/#x15.4.4.21
+// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/reduce
+if (!Array.prototype.reduce) {
+ Array.prototype.reduce = function reduce(fun /*, initial*/) {
+ var self = toObject(this),
+ length = self.length >>> 0;
+
+ // If no callback function or if callback is not a callable function
+ if (toString(fun) != "[object Function]") {
+ throw new TypeError(); // TODO message
+ }
+
+ // no value to return if no initial value and an empty array
+ if (!length && arguments.length == 1)
+ throw new TypeError(); // TODO message
+
+ var i = 0;
+ var result;
+ if (arguments.length >= 2) {
+ result = arguments[1];
+ } else {
+ do {
+ if (i in self) {
+ result = self[i++];
+ break;
+ }
+
+ // if array contains no values, no initial value to return
+ if (++i >= length)
+ throw new TypeError(); // TODO message
+ } while (true);
+ }
+
+ for (; i < length; i++) {
+ if (i in self)
+ result = fun.call(void 0, result, self[i], i, self);
+ }
+
+ return result;
+ };
+}
+
+// ES5 15.4.4.22
+// http://es5.github.com/#x15.4.4.22
+// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/reduceRight
+if (!Array.prototype.reduceRight) {
+ Array.prototype.reduceRight = function reduceRight(fun /*, initial*/) {
+ var self = toObject(this),
+ length = self.length >>> 0;
+
+ // If no callback function or if callback is not a callable function
+ if (toString(fun) != "[object Function]") {
+ throw new TypeError(); // TODO message
+ }
+
+ // no value to return if no initial value, empty array
+ if (!length && arguments.length == 1)
+ throw new TypeError(); // TODO message
+
+ var result, i = length - 1;
+ if (arguments.length >= 2) {
+ result = arguments[1];
+ } else {
+ do {
+ if (i in self) {
+ result = self[i--];
+ break;
+ }
+
+ // if array contains no values, no initial value to return
+ if (--i < 0)
+ throw new TypeError(); // TODO message
+ } while (true);
+ }
+
+ do {
+ if (i in this)
+ result = fun.call(void 0, result, self[i], i, self);
+ } while (i--);
+
+ return result;
+ };
+}
+
+// ES5 15.4.4.14
+// http://es5.github.com/#x15.4.4.14
+// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/indexOf
+if (!Array.prototype.indexOf) {
+ Array.prototype.indexOf = function indexOf(sought /*, fromIndex */ ) {
+ var self = toObject(this),
+ length = self.length >>> 0;
+
+ if (!length)
+ return -1;
+
+ var i = 0;
+ if (arguments.length > 1)
+ i = toInteger(arguments[1]);
+
+ // handle negative indices
+ i = i >= 0 ? i : Math.max(0, length + i);
+ for (; i < length; i++) {
+ if (i in self && self[i] === sought) {
+ return i;
+ }
+ }
+ return -1;
+ };
+}
+
+// ES5 15.4.4.15
+// http://es5.github.com/#x15.4.4.15
+// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/lastIndexOf
+if (!Array.prototype.lastIndexOf) {
+ Array.prototype.lastIndexOf = function lastIndexOf(sought /*, fromIndex */) {
+ var self = 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]));
+ // handle negative indices
+ i = i >= 0 ? i : length - Math.abs(i);
+ for (; i >= 0; i--) {
+ if (i in self && sought === self[i])
+ return i;
+ }
+ return -1;
+ };
+}
+
+//
+// Object
+// ======
+//
+
+// ES5 15.2.3.2
+// http://es5.github.com/#x15.2.3.2
+if (!Object.getPrototypeOf) {
+ // https://github.com/kriskowal/es5-shim/issues#issue/2
+ // http://ejohn.org/blog/objectgetprototypeof/
+ // recommended by fschaefer on github
+ Object.getPrototypeOf = function getPrototypeOf(object) {
+ return object.__proto__ || (
+ object.constructor ?
+ object.constructor.prototype :
+ prototypeOfObject
+ );
+ };
+}
+
+// ES5 15.2.3.3
+// http://es5.github.com/#x15.2.3.3
+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 object does not owns property return undefined immediately.
+ if (!owns(object, property))
+ return;
+
+ var descriptor, getter, setter;
+
+ // If object has a property then it's for sure both `enumerable` and
+ // `configurable`.
+ descriptor = { enumerable: true, configurable: true };
+
+ // If JS engine supports accessor properties then property may be a
+ // getter or setter.
+ if (supportsAccessors) {
+ // Unfortunately `__lookupGetter__` will return a getter even
+ // if object has own non getter property along with a same named
+ // inherited getter. To avoid misbehavior we temporary remove
+ // `__proto__` so that `__lookupGetter__` will return getter only
+ // if it's owned by an object.
+ var prototype = object.__proto__;
+ object.__proto__ = prototypeOfObject;
+
+ var getter = lookupGetter(object, property);
+ var setter = lookupSetter(object, property);
+
+ // Once we have getter and setter we can put values back.
+ object.__proto__ = prototype;
+
+ if (getter || setter) {
+ if (getter) descriptor.get = getter;
+ if (setter) descriptor.set = setter;
+
+ // If it was accessor property we're done and return here
+ // in order to avoid adding `value` to the descriptor.
+ return descriptor;
+ }
+ }
+
+ // If we got this far we know that object has an own property that is
+ // not an accessor so we set it as a value and return descriptor.
+ descriptor.value = object[property];
+ return descriptor;
+ };
+}
+
+// ES5 15.2.3.4
+// http://es5.github.com/#x15.2.3.4
+if (!Object.getOwnPropertyNames) {
+ Object.getOwnPropertyNames = function getOwnPropertyNames(object) {
+ return Object.keys(object);
+ };
+}
+
+// ES5 15.2.3.5
+// http://es5.github.com/#x15.2.3.5
+if (!Object.create) {
+ Object.create = function create(prototype, properties) {
+ var object;
+ if (prototype === null) {
+ object = { "__proto__": null };
+ } else {
+ if (typeof prototype != "object")
+ throw new TypeError("typeof prototype["+(typeof prototype)+"] != 'object'");
+ var Type = function () {};
+ Type.prototype = prototype;
+ object = new Type();
+ // IE has no built-in implementation of `Object.getPrototypeOf`
+ // neither `__proto__`, but this manually setting `__proto__` will
+ // guarantee that `Object.getPrototypeOf` will work as expected with
+ // objects created using `Object.create`
+ object.__proto__ = prototype;
+ }
+ if (properties !== void 0)
+ Object.defineProperties(object, properties);
+ return object;
+ };
+}
+
+// ES5 15.2.3.6
+// http://es5.github.com/#x15.2.3.6
+
+// Patch for WebKit and IE8 standard mode
+// Designed by hax <hax.github.com>
+// related issue: https://github.com/kriskowal/es5-shim/issues#issue/5
+// IE8 Reference:
+// http://msdn.microsoft.com/en-us/library/dd282900.aspx
+// http://msdn.microsoft.com/en-us/library/dd229916.aspx
+// WebKit Bugs:
+// https://bugs.webkit.org/show_bug.cgi?id=36423
+
+function doesDefinePropertyWork(object) {
+ try {
+ Object.defineProperty(object, "sentinel", {});
+ return "sentinel" in object;
+ } catch (exception) {
+ // returns falsy
+ }
+}
+
+// check whether defineProperty works if it's given. Otherwise,
+// shim partially.
+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);
+
+ // make a valiant attempt to use the real defineProperty
+ // for I8's DOM elements.
+ if (definePropertyFallback) {
+ try {
+ return definePropertyFallback.call(Object, object, property, descriptor);
+ } catch (exception) {
+ // try the shim if the real one doesn't work
+ }
+ }
+
+ // If it's a data property.
+ if (owns(descriptor, "value")) {
+ // fail silently if "writable", "enumerable", or "configurable"
+ // are requested but not supported
+ /*
+ // alternate approach:
+ if ( // can't implement these features; allow false but not true
+ !(owns(descriptor, "writable") ? descriptor.writable : true) ||
+ !(owns(descriptor, "enumerable") ? descriptor.enumerable : true) ||
+ !(owns(descriptor, "configurable") ? descriptor.configurable : true)
+ )
+ throw new RangeError(
+ "This implementation of Object.defineProperty does not " +
+ "support configurable, enumerable, or writable."
+ );
+ */
+
+ if (supportsAccessors && (lookupGetter(object, property) ||
+ lookupSetter(object, property)))
+ {
+ // As accessors are supported only on engines implementing
+ // `__proto__` we can safely override `__proto__` while defining
+ // a property to make sure that we don't hit an inherited
+ // accessor.
+ var prototype = object.__proto__;
+ object.__proto__ = prototypeOfObject;
+ // Deleting a property anyway since getter / setter may be
+ // defined on object itself.
+ delete object[property];
+ object[property] = descriptor.value;
+ // Setting original `__proto__` back now.
+ object.__proto__ = prototype;
+ } else {
+ object[property] = descriptor.value;
+ }
+ } else {
+ if (!supportsAccessors)
+ throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED);
+ // If we got that far then getters and setters can be defined !!
+ if (owns(descriptor, "get"))
+ defineGetter(object, property, descriptor.get);
+ if (owns(descriptor, "set"))
+ defineSetter(object, property, descriptor.set);
+ }
+
+ return object;
+ };
+}
+
+// ES5 15.2.3.7
+// http://es5.github.com/#x15.2.3.7
+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;
+ };
+}
+
+// ES5 15.2.3.8
+// http://es5.github.com/#x15.2.3.8
+if (!Object.seal) {
+ Object.seal = function seal(object) {
+ // this is misleading and breaks feature-detection, but
+ // allows "securable" code to "gracefully" degrade to working
+ // but insecure code.
+ return object;
+ };
+}
+
+// ES5 15.2.3.9
+// http://es5.github.com/#x15.2.3.9
+if (!Object.freeze) {
+ Object.freeze = function freeze(object) {
+ // this is misleading and breaks feature-detection, but
+ // allows "securable" code to "gracefully" degrade to working
+ // but insecure code.
+ return object;
+ };
+}
+
+// detect a Rhino bug and patch it
+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);
+}
+
+// ES5 15.2.3.10
+// http://es5.github.com/#x15.2.3.10
+if (!Object.preventExtensions) {
+ Object.preventExtensions = function preventExtensions(object) {
+ // this is misleading and breaks feature-detection, but
+ // allows "securable" code to "gracefully" degrade to working
+ // but insecure code.
+ return object;
+ };
+}
+
+// ES5 15.2.3.11
+// http://es5.github.com/#x15.2.3.11
+if (!Object.isSealed) {
+ Object.isSealed = function isSealed(object) {
+ return false;
+ };
+}
+
+// ES5 15.2.3.12
+// http://es5.github.com/#x15.2.3.12
+if (!Object.isFrozen) {
+ Object.isFrozen = function isFrozen(object) {
+ return false;
+ };
+}
+
+// ES5 15.2.3.13
+// http://es5.github.com/#x15.2.3.13
+if (!Object.isExtensible) {
+ Object.isExtensible = function isExtensible(object) {
+ // 1. If Type(O) is not Object throw a TypeError exception.
+ if (Object(object) === object) {
+ throw new TypeError(); // TODO message
+ }
+ // 2. Return the Boolean value of the [[Extensible]] internal property of O.
+ var name = '';
+ while (owns(object, name)) {
+ name += '?';
+ }
+ object[name] = true;
+ var returnValue = owns(object, name);
+ delete object[name];
+ return returnValue;
+ };
+}
+
+// ES5 15.2.3.14
+// http://es5.github.com/#x15.2.3.14
+if (!Object.keys) {
+ // http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation
+ 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;
+ };
+
+}
+
+//
+// Date
+// ====
+//
+
+// ES5 15.9.5.43
+// http://es5.github.com/#x15.9.5.43
+// This function returns a String value represent the instance in time
+// represented by this Date object. The format of the String is the Date Time
+// string format defined in 15.9.1.15. All fields are present in the String.
+// The time zone is always UTC, denoted by the suffix Z. If the time value of
+// this object is not a finite Number a RangeError exception is thrown.
+if (!Date.prototype.toISOString || (new Date(-62198755200000).toISOString().indexOf('-000001') === -1)) {
+ Date.prototype.toISOString = function toISOString() {
+ var result, length, value, year;
+ if (!isFinite(this))
+ throw new RangeError;
+
+ // the date time string format is specified in 15.9.1.15.
+ result = [this.getUTCMonth() + 1, this.getUTCDate(),
+ this.getUTCHours(), this.getUTCMinutes(), this.getUTCSeconds()];
+ year = this.getUTCFullYear();
+ year = (year < 0 ? '-' : (year > 9999 ? '+' : '')) + ('00000' + Math.abs(year)).slice(0 <= year && year <= 9999 ? -4 : -6);
+
+ length = result.length;
+ while (length--) {
+ value = result[length];
+ // pad months, days, hours, minutes, and seconds to have two digits.
+ if (value < 10)
+ result[length] = "0" + value;
+ }
+ // pad milliseconds to have three digits.
+ return year + "-" + result.slice(0, 2).join("-") + "T" + result.slice(2).join(":") + "." +
+ ("000" + this.getUTCMilliseconds()).slice(-3) + "Z";
+ }
+}
+
+// ES5 15.9.4.4
+// http://es5.github.com/#x15.9.4.4
+if (!Date.now) {
+ Date.now = function now() {
+ return new Date().getTime();
+ };
+}
+
+// ES5 15.9.5.44
+// http://es5.github.com/#x15.9.5.44
+// This function provides a String representation of a Date object for use by
+// JSON.stringify (15.12.3).
+if (!Date.prototype.toJSON) {
+ Date.prototype.toJSON = function toJSON(key) {
+ // When the toJSON method is called with argument key, the following
+ // steps are taken:
+
+ // 1. Let O be the result of calling ToObject, giving it the this
+ // value as its argument.
+ // 2. Let tv be ToPrimitive(O, hint Number).
+ // 3. If tv is a Number and is not finite, return null.
+ // XXX
+ // 4. Let toISO be the result of calling the [[Get]] internal method of
+ // O with argument "toISOString".
+ // 5. If IsCallable(toISO) is false, throw a TypeError exception.
+ if (typeof this.toISOString != "function")
+ throw new TypeError(); // TODO message
+ // 6. Return the result of calling the [[Call]] internal method of
+ // toISO with O as the this value and an empty argument list.
+ return this.toISOString();
+
+ // NOTE 1 The argument is ignored.
+
+ // NOTE 2 The toJSON function is intentionally generic; it does not
+ // require that its this value be a Date object. Therefore, it can be
+ // transferred to other kinds of objects for use as a method. However,
+ // it does require that any such object have a toISOString method. An
+ // object is free to use the argument key to filter its
+ // stringification.
+ };
+}
+
+// ES5 15.9.4.2
+// http://es5.github.com/#x15.9.4.2
+// based on work shared by Daniel Friesen (dantman)
+// http://gist.github.com/303249
+if (Date.parse("+275760-09-13T00:00:00.000Z") !== 8.64e15) {
+ // XXX global assignment won't work in embeddings that use
+ // an alternate object for the context.
+ Date = (function(NativeDate) {
+
+ // Date.length === 7
+ var Date = function Date(Y, M, D, h, m, s, ms) {
+ var length = arguments.length;
+ if (this instanceof NativeDate) {
+ var date = length == 1 && String(Y) === Y ? // isString(Y)
+ // We explicitly pass it through parse:
+ new NativeDate(Date.parse(Y)) :
+ // We have to manually make calls depending on argument
+ // length here
+ length >= 7 ? new NativeDate(Y, M, D, h, m, s, ms) :
+ length >= 6 ? new NativeDate(Y, M, D, h, m, s) :
+ length >= 5 ? new NativeDate(Y, M, D, h, m) :
+ length >= 4 ? new NativeDate(Y, M, D, h) :
+ length >= 3 ? new NativeDate(Y, M, D) :
+ length >= 2 ? new NativeDate(Y, M) :
+ length >= 1 ? new NativeDate(Y) :
+ new NativeDate();
+ // Prevent mixups with unfixed Date object
+ date.constructor = Date;
+ return date;
+ }
+ return NativeDate.apply(this, arguments);
+ };
+
+ // 15.9.1.15 Date Time String Format.
+ var isoDateExpression = new RegExp("^" +
+ "(\\d{4}|[\+\-]\\d{6})" + // four-digit year capture or sign + 6-digit extended year
+ "(?:-(\\d{2})" + // optional month capture
+ "(?:-(\\d{2})" + // optional day capture
+ "(?:" + // capture hours:minutes:seconds.milliseconds
+ "T(\\d{2})" + // hours capture
+ ":(\\d{2})" + // minutes capture
+ "(?:" + // optional :seconds.milliseconds
+ ":(\\d{2})" + // seconds capture
+ "(?:\\.(\\d{3}))?" + // milliseconds capture
+ ")?" +
+ "(?:" + // capture UTC offset component
+ "Z|" + // UTC capture
+ "(?:" + // offset specifier +/-hours:minutes
+ "([-+])" + // sign capture
+ "(\\d{2})" + // hours offset capture
+ ":(\\d{2})" + // minutes offset capture
+ ")" +
+ ")?)?)?)?" +
+ "$");
+
+ // Copy any custom methods a 3rd party library may have added
+ for (var key in NativeDate)
+ Date[key] = NativeDate[key];
+
+ // Copy "native" methods explicitly; they may be non-enumerable
+ Date.now = NativeDate.now;
+ Date.UTC = NativeDate.UTC;
+ Date.prototype = NativeDate.prototype;
+ Date.prototype.constructor = Date;
+
+ // Upgrade Date.parse to handle simplified ISO 8601 strings
+ Date.parse = function parse(string) {
+ var match = isoDateExpression.exec(string);
+ if (match) {
+ match.shift(); // kill match[0], the full match
+ // parse months, days, hours, minutes, seconds, and milliseconds
+ for (var i = 1; i < 7; i++) {
+ // provide default values if necessary
+ match[i] = +(match[i] || (i < 3 ? 1 : 0));
+ // match[1] is the month. Months are 0-11 in JavaScript
+ // `Date` objects, but 1-12 in ISO notation, so we
+ // decrement.
+ if (i == 1)
+ match[i]--;
+ }
+
+ // parse the UTC offset component
+ var minuteOffset = +match.pop(), hourOffset = +match.pop(), sign = match.pop();
+
+ // compute the explicit time zone offset if specified
+ var offset = 0;
+ if (sign) {
+ // detect invalid offsets and return early
+ if (hourOffset > 23 || minuteOffset > 59)
+ return NaN;
+
+ // express the provided time zone offset in minutes. The offset is
+ // negative for time zones west of UTC; positive otherwise.
+ offset = (hourOffset * 60 + minuteOffset) * 6e4 * (sign == "+" ? -1 : 1);
+ }
+
+ // Date.UTC for years between 0 and 99 converts year to 1900 + year
+ // The Gregorian calendar has a 400-year cycle, so
+ // to Date.UTC(year + 400, .... ) - 12622780800000 == Date.UTC(year, ...),
+ // where 12622780800000 - number of milliseconds in Gregorian calendar 400 years
+ var year = +match[0];
+ if (0 <= year && year <= 99) {
+ match[0] = year + 400;
+ return NativeDate.UTC.apply(this, match) + offset - 12622780800000;
+ }
+
+ // compute a new UTC date value, accounting for the optional offset
+ return NativeDate.UTC.apply(this, match) + offset;
+ }
+ return NativeDate.parse.apply(this, arguments);
+ };
+
+ return Date;
+ })(Date);
+}
+
+//
+// String
+// ======
+//
+
+// ES5 15.5.4.20
+// http://es5.github.com/#x15.5.4.20
+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()) {
+ // http://blog.stevenlevithan.com/archives/faster-trim-javascript
+ // http://perfectionkills.com/whitespace-deviations/
+ ws = "[" + ws + "]";
+ var trimBeginRegexp = new RegExp("^" + ws + ws + "*"),
+ trimEndRegexp = new RegExp(ws + ws + "*$");
+ String.prototype.trim = function trim() {
+ return String(this).replace(trimBeginRegexp, "").replace(trimEndRegexp, "");
+ };
+}
+
+//
+// Util
+// ======
+//
+
+// ES5 9.4
+// http://es5.github.com/#x9.4
+// http://jsperf.com/to-integer
+var toInteger = function (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;
+};
+
+var prepareString = "a"[0] != "a",
+ // ES5 9.9
+ // http://es5.github.com/#x9.9
+ toObject = function (o) {
+ if (o == null) { // this matches both null and undefined
+ throw new TypeError(); // TODO message
+ }
+ // If the implementation doesn't support by-index access of
+ // string characters (ex. IE < 7), split the string
+ if (prepareString && typeof o == "string" && o) {
+ return o.split("");
+ }
+ return Object(o);
+ };
+});
+
+ace.define('ace/lib/dom', ['require', 'exports', 'module' ], function(require, exports, module) {
+
+
+var XHTML_NS = "http://www.w3.org/1999/xhtml";
+
+exports.createElement = function(tag, ns) {
+ return document.createElementNS ?
+ document.createElementNS(ns || XHTML_NS, tag) :
+ document.createElement(tag);
+};
+
+exports.setText = function(elem, text) {
+ if (elem.innerText !== undefined) {
+ elem.innerText = text;
+ }
+ if (elem.textContent !== undefined) {
+ elem.textContent = text;
+ }
+};
+
+exports.hasCssClass = function(el, name) {
+ var classes = el.className.split(/\s+/g);
+ return classes.indexOf(name) !== -1;
+};
+exports.addCssClass = function(el, name) {
+ if (!exports.hasCssClass(el, name)) {
+ el.className += " " + name;
+ }
+};
+exports.removeCssClass = function(el, name) {
+ var classes = el.className.split(/\s+/g);
+ while (true) {
+ var index = classes.indexOf(name);
+ if (index == -1) {
+ break;
+ }
+ classes.splice(index, 1);
+ }
+ el.className = classes.join(" ");
+};
+
+exports.toggleCssClass = function(el, name) {
+ var classes = el.className.split(/\s+/g), add = true;
+ while (true) {
+ var index = classes.indexOf(name);
+ if (index == -1) {
+ break;
+ }
+ add = false;
+ classes.splice(index, 1);
+ }
+ if(add)
+ classes.push(name);
+
+ el.className = classes.join(" ");
+ return add;
+};
+exports.setCssClass = function(node, className, include) {
+ if (include) {
+ exports.addCssClass(node, className);
+ } else {
+ exports.removeCssClass(node, className);
+ }
+};
+
+exports.hasCssString = function(id, doc) {
+ var index = 0, sheets;
+ doc = doc || document;
+
+ if (doc.createStyleSheet && (sheets = doc.styleSheets)) {
+ while (index < sheets.length)
+ if (sheets[index++].owningElement.id === id) return true;
+ } else if ((sheets = doc.getElementsByTagName("style"))) {
+ while (index < sheets.length)
+ if (sheets[index++].id === id) return true;
+ }
+
+ return false;
+};
+
+exports.importCssString = function importCssString(cssText, id, doc) {
+ doc = doc || document;
+ // If style is already imported return immediately.
+ if (id && exports.hasCssString(id, doc))
+ return null;
+
+ var style;
+
+ if (doc.createStyleSheet) {
+ style = doc.createStyleSheet();
+ style.cssText = cssText;
+ if (id)
+ style.owningElement.id = id;
+ } else {
+ style = doc.createElementNS
+ ? doc.createElementNS(XHTML_NS, "style")
+ : doc.createElement("style");
+
+ style.appendChild(doc.createTextNode(cssText));
+ if (id)
+ style.id = id;
+
+ var head = doc.getElementsByTagName("head")[0] || doc.documentElement;
+ head.appendChild(style);
+ }
+};
+
+exports.importCssStylsheet = function(uri, doc) {
+ if (doc.createStyleSheet) {
+ doc.createStyleSheet(uri);
+ } else {
+ var link = exports.createElement('link');
+ link.rel = 'stylesheet';
+ link.href = uri;
+
+ var head = doc.getElementsByTagName("head")[0] || doc.documentElement;
+ head.appendChild(link);
+ }
+};
+
+exports.getInnerWidth = function(element) {
+ return (
+ parseInt(exports.computedStyle(element, "paddingLeft"), 10) +
+ parseInt(exports.computedStyle(element, "paddingRight"), 10) +
+ element.clientWidth
+ );
+};
+
+exports.getInnerHeight = function(element) {
+ return (
+ parseInt(exports.computedStyle(element, "paddingTop"), 10) +
+ parseInt(exports.computedStyle(element, "paddingBottom"), 10) +
+ element.clientHeight
+ );
+};
+
+if (window.pageYOffset !== undefined) {
+ exports.getPageScrollTop = function() {
+ return window.pageYOffset;
+ };
+
+ exports.getPageScrollLeft = function() {
+ return window.pageXOffset;
+ };
+}
+else {
+ exports.getPageScrollTop = function() {
+ return document.body.scrollTop;
+ };
+
+ exports.getPageScrollLeft = function() {
+ return document.body.scrollLeft;
+ };
+}
+
+if (window.getComputedStyle)
+ exports.computedStyle = function(element, style) {
+ if (style)
+ return (window.getComputedStyle(element, "") || {})[style] || "";
+ return window.getComputedStyle(element, "") || {};
+ };
+else
+ exports.computedStyle = function(element, style) {
+ if (style)
+ return element.currentStyle[style];
+ return element.currentStyle;
+ };
+
+exports.scrollbarWidth = function(document) {
+
+ var inner = exports.createElement("p");
+ inner.style.width = "100%";
+ inner.style.minWidth = "0px";
+ inner.style.height = "200px";
+
+ var outer = exports.createElement("div");
+ var style = outer.style;
+
+ style.position = "absolute";
+ style.left = "-10000px";
+ style.overflow = "hidden";
+ style.width = "200px";
+ style.minWidth = "0px";
+ style.height = "150px";
+
+ outer.appendChild(inner);
+
+ var body = document.body || document.documentElement;
+ body.appendChild(outer);
+
+ var noScrollbar = inner.offsetWidth;
+
+ style.overflow = "scroll";
+ var withScrollbar = inner.offsetWidth;
+
+ if (noScrollbar == withScrollbar) {
+ withScrollbar = outer.clientWidth;
+ }
+
+ body.removeChild(outer);
+
+ return noScrollbar-withScrollbar;
+};
+exports.setInnerHtml = function(el, innerHtml) {
+ var element = el.cloneNode(false);//document.createElement("div");
+ element.innerHTML = innerHtml;
+ el.parentNode.replaceChild(element, el);
+ return element;
+};
+
+exports.setInnerText = function(el, innerText) {
+ var document = el.ownerDocument;
+ if (document.body && "textContent" in document.body)
+ el.textContent = innerText;
+ else
+ el.innerText = innerText;
+
+};
+
+exports.getInnerText = function(el) {
+ var document = el.ownerDocument;
+ if (document.body && "textContent" in document.body)
+ return el.textContent;
+ else
+ return el.innerText || el.textContent || "";
+};
+
+exports.getParentWindow = function(document) {
+ return document.defaultView || document.parentWindow;
+};
+
+});
+
+ace.define('ace/lib/event', ['require', 'exports', 'module' , 'ace/lib/keys', 'ace/lib/useragent', 'ace/lib/dom'], function(require, exports, module) {
+
+
+var keys = require("./keys");
+var useragent = require("./useragent");
+var dom = require("./dom");
+
+exports.addListener = function(elem, type, callback) {
+ if (elem.addEventListener) {
+ return elem.addEventListener(type, callback, false);
+ }
+ if (elem.attachEvent) {
+ var wrapper = function() {
+ callback(window.event);
+ };
+ callback._wrapper = wrapper;
+ elem.attachEvent("on" + type, wrapper);
+ }
+};
+
+exports.removeListener = function(elem, type, callback) {
+ if (elem.removeEventListener) {
+ return elem.removeEventListener(type, callback, false);
+ }
+ if (elem.detachEvent) {
+ elem.detachEvent("on" + type, callback._wrapper || callback);
+ }
+};
+exports.stopEvent = function(e) {
+ exports.stopPropagation(e);
+ exports.preventDefault(e);
+ return false;
+};
+
+exports.stopPropagation = function(e) {
+ if (e.stopPropagation)
+ e.stopPropagation();
+ else
+ e.cancelBubble = true;
+};
+
+exports.preventDefault = function(e) {
+ if (e.preventDefault)
+ e.preventDefault();
+ else
+ e.returnValue = false;
+};
+exports.getButton = function(e) {
+ if (e.type == "dblclick")
+ return 0;
+ if (e.type == "contextmenu" || (e.ctrlKey && useragent.isMac))
+ return 2;
+
+ // DOM Event
+ if (e.preventDefault) {
+ return e.button;
+ }
+ // old IE
+ else {
+ return {1:0, 2:2, 4:1}[e.button];
+ }
+};
+
+if (document.documentElement.setCapture) {
+ exports.capture = function(el, eventHandler, releaseCaptureHandler) {
+ var called = false;
+ function onReleaseCapture(e) {
+ eventHandler(e);
+
+ if (!called) {
+ called = true;
+ releaseCaptureHandler(e);
+ }
+
+ exports.removeListener(el, "mousemove", eventHandler);
+ exports.removeListener(el, "mouseup", onReleaseCapture);
+ exports.removeListener(el, "losecapture", onReleaseCapture);
+
+ el.releaseCapture();
+ }
+
+ exports.addListener(el, "mousemove", eventHandler);
+ exports.addListener(el, "mouseup", onReleaseCapture);
+ exports.addListener(el, "losecapture", onReleaseCapture);
+ el.setCapture();
+ };
+}
+else {
+ exports.capture = function(el, eventHandler, releaseCaptureHandler) {
+ function onMouseUp(e) {
+ eventHandler && eventHandler(e);
+ releaseCaptureHandler && releaseCaptureHandler(e);
+
+ document.removeEventListener("mousemove", eventHandler, true);
+ document.removeEventListener("mouseup", onMouseUp, true);
+
+ e.stopPropagation();
+ }
+
+ document.addEventListener("mousemove", eventHandler, true);
+ document.addEventListener("mouseup", onMouseUp, true);
+ };
+}
+
+exports.addMouseWheelListener = function(el, callback) {
+ var factor = 8;
+ var listener = function(e) {
+ if (e.wheelDelta !== undefined) {
+ if (e.wheelDeltaX !== undefined) {
+ e.wheelX = -e.wheelDeltaX / factor;
+ e.wheelY = -e.wheelDeltaY / factor;
+ } else {
+ e.wheelX = 0;
+ e.wheelY = -e.wheelDelta / factor;
+ }
+ }
+ else {
+ if (e.axis && e.axis == e.HORIZONTAL_AXIS) {
+ e.wheelX = (e.detail || 0) * 5;
+ e.wheelY = 0;
+ } else {
+ e.wheelX = 0;
+ e.wheelY = (e.detail || 0) * 5;
+ }
+ }
+ callback(e);
+ };
+ exports.addListener(el, "DOMMouseScroll", listener);
+ exports.addListener(el, "mousewheel", listener);
+};
+
+exports.addMultiMouseDownListener = function(el, timeouts, eventHandler, callbackName) {
+ var clicks = 0;
+ var startX, startY, timer;
+ var eventNames = {
+ 2: "dblclick",
+ 3: "tripleclick",
+ 4: "quadclick"
+ };
+
+ exports.addListener(el, "mousedown", function(e) {
+ if (exports.getButton(e) != 0) {
+ clicks = 0;
+ } else {
+ var isNewClick = Math.abs(e.clientX - startX) > 5 || Math.abs(e.clientY - startY) > 5;
+
+ if (!timer || isNewClick)
+ clicks = 0;
+
+ clicks += 1;
+
+ if (timer)
+ clearTimeout(timer)
+ timer = setTimeout(function() {timer = null}, timeouts[clicks - 1] || 600);
+ }
+ if (clicks == 1) {
+ startX = e.clientX;
+ startY = e.clientY;
+ }
+
+ eventHandler[callbackName]("mousedown", e);
+
+ if (clicks > 4)
+ clicks = 0;
+ else if (clicks > 1)
+ return eventHandler[callbackName](eventNames[clicks], e);
+ });
+
+ if (useragent.isOldIE) {
+ exports.addListener(el, "dblclick", function(e) {
+ clicks = 2;
+ if (timer)
+ clearTimeout(timer);
+ timer = setTimeout(function() {timer = null}, timeouts[clicks - 1] || 600);
+ eventHandler[callbackName]("mousedown", e);
+ eventHandler[callbackName](eventNames[clicks], e);
+ });
+ }
+};
+
+function normalizeCommandKeys(callback, e, keyCode) {
+ var hashId = 0;
+ if ((useragent.isOpera && !("KeyboardEvent" in window)) && useragent.isMac) {
+ hashId = 0 | (e.metaKey ? 1 : 0) | (e.altKey ? 2 : 0)
+ | (e.shiftKey ? 4 : 0) | (e.ctrlKey ? 8 : 0);
+ } else {
+ hashId = 0 | (e.ctrlKey ? 1 : 0) | (e.altKey ? 2 : 0)
+ | (e.shiftKey ? 4 : 0) | (e.metaKey ? 8 : 0);
+ }
+
+ if (keyCode in keys.MODIFIER_KEYS) {
+ switch (keys.MODIFIER_KEYS[keyCode]) {
+ case "Alt":
+ hashId = 2;
+ break;
+ case "Shift":
+ hashId = 4;
+ break;
+ case "Ctrl":
+ hashId = 1;
+ break;
+ default:
+ hashId = 8;
+ break;
+ }
+ keyCode = 0;
+ }
+
+ if (hashId & 8 && (keyCode == 91 || keyCode == 93)) {
+ keyCode = 0;
+ }
+
+ // If there is no hashID and the keyCode is not a function key, then
+ // we don't call the callback as we don't handle a command key here
+ // (it's a normal key/character input).
+ if (!hashId && !(keyCode in keys.FUNCTION_KEYS) && !(keyCode in keys.PRINTABLE_KEYS)) {
+ return false;
+ }
+ return callback(e, hashId, keyCode);
+}
+
+exports.addCommandKeyListener = function(el, callback) {
+ var addListener = exports.addListener;
+ if (useragent.isOldGecko || (useragent.isOpera && !("KeyboardEvent" in window))) {
+ // Old versions of Gecko aka. Firefox < 4.0 didn't repeat the keydown
+ // event if the user pressed the key for a longer time. Instead, the
+ // keydown event was fired once and later on only the keypress event.
+ // To emulate the 'right' keydown behavior, the keyCode of the initial
+ // keyDown event is stored and in the following keypress events the
+ // stores keyCode is used to emulate a keyDown event.
+ var lastKeyDownKeyCode = null;
+ addListener(el, "keydown", function(e) {
+ lastKeyDownKeyCode = e.keyCode;
+ });
+ addListener(el, "keypress", function(e) {
+ return normalizeCommandKeys(callback, e, lastKeyDownKeyCode);
+ });
+ } else {
+ var lastDown = null;
+
+ addListener(el, "keydown", function(e) {
+ lastDown = e.keyIdentifier || e.keyCode;
+ return normalizeCommandKeys(callback, e, e.keyCode);
+ });
+ }
+};
+
+if (window.postMessage && !useragent.isOldIE) {
+ var postMessageId = 1;
+ exports.nextTick = function(callback, win) {
+ win = win || window;
+ var messageName = "zero-timeout-message-" + postMessageId;
+ exports.addListener(win, "message", function listener(e) {
+ if (e.data == messageName) {
+ exports.stopPropagation(e);
+ exports.removeListener(win, "message", listener);
+ callback();
+ }
+ });
+ win.postMessage(messageName, "*");
+ };
+}
+else {
+ exports.nextTick = function(callback, win) {
+ win = win || window;
+ window.setTimeout(callback, 0);
+ };
+}
+
+});
+
+// Most of the following code is taken from SproutCore with a few changes.
+
+ace.define('ace/lib/keys', ['require', 'exports', 'module' , 'ace/lib/oop'], function(require, exports, module) {
+
+
+var oop = require("./oop");
+var Keys = (function() {
+ var ret = {
+ MODIFIER_KEYS: {
+ 16: 'Shift', 17: 'Ctrl', 18: 'Alt', 224: 'Meta'
+ },
+
+ KEY_MODS: {
+ "ctrl": 1, "alt": 2, "option" : 2,
+ "shift": 4, "meta": 8, "command": 8
+ },
+
+ FUNCTION_KEYS : {
+ 8 : "Backspace",
+ 9 : "Tab",
+ 13 : "Return",
+ 19 : "Pause",
+ 27 : "Esc",
+ 32 : "Space",
+ 33 : "PageUp",
+ 34 : "PageDown",
+ 35 : "End",
+ 36 : "Home",
+ 37 : "Left",
+ 38 : "Up",
+ 39 : "Right",
+ 40 : "Down",
+ 44 : "Print",
+ 45 : "Insert",
+ 46 : "Delete",
+ 96 : "Numpad0",
+ 97 : "Numpad1",
+ 98 : "Numpad2",
+ 99 : "Numpad3",
+ 100: "Numpad4",
+ 101: "Numpad5",
+ 102: "Numpad6",
+ 103: "Numpad7",
+ 104: "Numpad8",
+ 105: "Numpad9",
+ 112: "F1",
+ 113: "F2",
+ 114: "F3",
+ 115: "F4",
+ 116: "F5",
+ 117: "F6",
+ 118: "F7",
+ 119: "F8",
+ 120: "F9",
+ 121: "F10",
+ 122: "F11",
+ 123: "F12",
+ 144: "Numlock",
+ 145: "Scrolllock"
+ },
+
+ PRINTABLE_KEYS: {
+ 32: ' ', 48: '0', 49: '1', 50: '2', 51: '3', 52: '4', 53: '5',
+ 54: '6', 55: '7', 56: '8', 57: '9', 59: ';', 61: '=', 65: 'a',
+ 66: 'b', 67: 'c', 68: 'd', 69: 'e', 70: 'f', 71: 'g', 72: 'h',
+ 73: 'i', 74: 'j', 75: 'k', 76: 'l', 77: 'm', 78: 'n', 79: 'o',
+ 80: 'p', 81: 'q', 82: 'r', 83: 's', 84: 't', 85: 'u', 86: 'v',
+ 87: 'w', 88: 'x', 89: 'y', 90: 'z', 107: '+', 109: '-', 110: '.',
+ 188: ',', 190: '.', 191: '/', 192: '`', 219: '[', 220: '\\',
+ 221: ']', 222: '\''
+ }
+ };
+
+ // A reverse map of FUNCTION_KEYS
+ for (var i in ret.FUNCTION_KEYS) {
+ var name = ret.FUNCTION_KEYS[i].toLowerCase();
+ ret[name] = parseInt(i, 10);
+ }
+
+ // Add the MODIFIER_KEYS, FUNCTION_KEYS and PRINTABLE_KEYS to the KEY
+ // variables as well.
+ oop.mixin(ret, ret.MODIFIER_KEYS);
+ oop.mixin(ret, ret.PRINTABLE_KEYS);
+ oop.mixin(ret, ret.FUNCTION_KEYS);
+
+ // aliases
+ ret.enter = ret["return"];
+ ret.escape = ret.esc;
+ ret.del = ret["delete"];
+
+ // workaround for firefox bug
+ ret[173] = '-';
+
+ return ret;
+})();
+oop.mixin(exports, Keys);
+
+exports.keyCodeToString = function(keyCode) {
+ return (Keys[keyCode] || String.fromCharCode(keyCode)).toLowerCase();
+}
+
+});
+
+ace.define('ace/lib/oop', ['require', 'exports', 'module' ], function(require, exports, module) {
+
+
+exports.inherits = (function() {
+ var tempCtor = function() {};
+ return function(ctor, superCtor) {
+ tempCtor.prototype = superCtor.prototype;
+ ctor.super_ = superCtor.prototype;
+ ctor.prototype = new tempCtor();
+ ctor.prototype.constructor = ctor;
+ };
+}());
+
+exports.mixin = function(obj, mixin) {
+ for (var key in mixin) {
+ obj[key] = mixin[key];
+ }
+};
+
+exports.implement = function(proto, mixin) {
+ exports.mixin(proto, mixin);
+};
+
+});
+
+ace.define('ace/lib/useragent', ['require', 'exports', 'module' ], function(require, exports, module) {
+
+
+var os = (navigator.platform.match(/mac|win|linux/i) || ["other"])[0].toLowerCase();
+var ua = navigator.userAgent;
+
+// Is the user using a browser that identifies itself as Windows
+exports.isWin = (os == "win");
+
+// Is the user using a browser that identifies itself as Mac OS
+exports.isMac = (os == "mac");
+
+// Is the user using a browser that identifies itself as Linux
+exports.isLinux = (os == "linux");
+
+exports.isIE =
+ navigator.appName == "Microsoft Internet Explorer"
+ && parseFloat(navigator.userAgent.match(/MSIE ([0-9]+[\.0-9]+)/)[1]);
+
+exports.isOldIE = exports.isIE && exports.isIE < 9;
+
+// Is this Firefox or related?
+exports.isGecko = exports.isMozilla = window.controllers && window.navigator.product === "Gecko";
+
+// oldGecko == rev < 2.0
+exports.isOldGecko = exports.isGecko && parseInt((navigator.userAgent.match(/rv\:(\d+)/)||[])[1], 10) < 4;
+
+// Is this Opera
+exports.isOpera = window.opera && Object.prototype.toString.call(window.opera) == "[object Opera]";
+
+// Is the user using a browser that identifies itself as WebKit
+exports.isWebKit = parseFloat(ua.split("WebKit/")[1]) || undefined;
+
+exports.isChrome = parseFloat(ua.split(" Chrome/")[1]) || undefined;
+
+exports.isAIR = ua.indexOf("AdobeAIR") >= 0;
+
+exports.isIPad = ua.indexOf("iPad") >= 0;
+
+exports.isTouchPad = ua.indexOf("TouchPad") >= 0;
+exports.OS = {
+ LINUX: "LINUX",
+ MAC: "MAC",
+ WINDOWS: "WINDOWS"
+};
+exports.getOS = function() {
+ if (exports.isMac) {
+ return exports.OS.MAC;
+ } else if (exports.isLinux) {
+ return exports.OS.LINUX;
+ } else {
+ return exports.OS.WINDOWS;
+ }
+};
+
+});
+
+ace.define('ace/editor', ['require', 'exports', 'module' , 'ace/lib/fixoldbrowsers', 'ace/lib/oop', 'ace/lib/lang', 'ace/lib/useragent', 'ace/keyboard/textinput', 'ace/mouse/mouse_handler', 'ace/mouse/fold_handler', 'ace/keyboard/keybinding', 'ace/edit_session', 'ace/search', 'ace/range', 'ace/lib/event_emitter', 'ace/commands/command_manager', 'ace/commands/default_commands'], function(require, exports, module) {
+
+
+require("./lib/fixoldbrowsers");
+
+var oop = require("./lib/oop");
+var lang = require("./lib/lang");
+var useragent = require("./lib/useragent");
+var TextInput = require("./keyboard/textinput").TextInput;
+var MouseHandler = require("./mouse/mouse_handler").MouseHandler;
+var FoldHandler = require("./mouse/fold_handler").FoldHandler;
+var KeyBinding = require("./keyboard/keybinding").KeyBinding;
+var EditSession = require("./edit_session").EditSession;
+var Search = require("./search").Search;
+var Range = require("./range").Range;
+var EventEmitter = require("./lib/event_emitter").EventEmitter;
+var CommandManager = require("./commands/command_manager").CommandManager;
+var defaultCommands = require("./commands/default_commands").commands;
+
+/**
+ * new Editor(renderer, session)
+ * - renderer (VirtualRenderer): Associated `VirtualRenderer` that draws everything
+ * - session (EditSession): The `EditSession` to refer to
+ *
+ * Creates a new `Editor` object.
+ *
+ **/
+var Editor = function(renderer, session) {
+ var container = renderer.getContainerElement();
+ this.container = container;
+ this.renderer = renderer;
+
+ this.commands = new CommandManager(useragent.isMac ? "mac" : "win", defaultCommands);
+ this.textInput = new TextInput(renderer.getTextAreaContainer(), this);
+ this.renderer.textarea = this.textInput.getElement();
+ this.keyBinding = new KeyBinding(this);
+
+ // TODO detect touch event support
+ this.$mouseHandler = new MouseHandler(this);
+ new FoldHandler(this);
+
+ this.$blockScrolling = 0;
+ this.$search = new Search().set({
+ wrap: true
+ });
+
+ this.setSession(session || new EditSession(""));
+};
+
+(function(){
+
+ oop.implement(this, EventEmitter);
+ this.setKeyboardHandler = function(keyboardHandler) {
+ this.keyBinding.setKeyboardHandler(keyboardHandler);
+ };
+ this.getKeyboardHandler = function() {
+ return this.keyBinding.getKeyboardHandler();
+ };
+ /**
+ * Editor@changeSession(e)
+ * - e (Object): An object with two properties, `oldSession` and `session`, that represent the old and new [[EditSession]]s.
+ *
+ * Emitted whenever the [[EditSession]] changes.
+ **/
+ this.setSession = function(session) {
+ if (this.session == session)
+ return;
+
+ if (this.session) {
+ var oldSession = this.session;
+ this.session.removeEventListener("change", this.$onDocumentChange);
+ this.session.removeEventListener("changeMode", this.$onChangeMode);
+ this.session.removeEventListener("tokenizerUpdate", this.$onTokenizerUpdate);
+ this.session.removeEventListener("changeTabSize", this.$onChangeTabSize);
+ this.session.removeEventListener("changeWrapLimit", this.$onChangeWrapLimit);
+ this.session.removeEventListener("changeWrapMode", this.$onChangeWrapMode);
+ this.session.removeEventListener("onChangeFold", this.$onChangeFold);
+ this.session.removeEventListener("changeFrontMarker", this.$onChangeFrontMarker);
+ this.session.removeEventListener("changeBackMarker", this.$onChangeBackMarker);
+ this.session.removeEventListener("changeBreakpoint", this.$onChangeBreakpoint);
+ this.session.removeEventListener("changeAnnotation", this.$onChangeAnnotation);
+ this.session.removeEventListener("changeOverwrite", this.$onCursorChange);
+ this.session.removeEventListener("changeScrollTop", this.$onScrollTopChange);
+ this.session.removeEventListener("changeLeftTop", this.$onScrollLeftChange);
+
+ var selection = this.session.getSelection();
+ selection.removeEventListener("changeCursor", this.$onCursorChange);
+ selection.removeEventListener("changeSelection", this.$onSelectionChange);
+ }
+
+ this.session = session;
+
+ this.$onDocumentChange = this.onDocumentChange.bind(this);
+ session.addEventListener("change", this.$onDocumentChange);
+ this.renderer.setSession(session);
+
+ this.$onChangeMode = this.onChangeMode.bind(this);
+ session.addEventListener("changeMode", this.$onChangeMode);
+
+ this.$onTokenizerUpdate = this.onTokenizerUpdate.bind(this);
+ session.addEventListener("tokenizerUpdate", this.$onTokenizerUpdate);
+
+ this.$onChangeTabSize = this.renderer.onChangeTabSize.bind(this.renderer);
+ session.addEventListener("changeTabSize", this.$onChangeTabSize);
+
+ this.$onChangeWrapLimit = this.onChangeWrapLimit.bind(this);
+ session.addEventListener("changeWrapLimit", this.$onChangeWrapLimit);
+
+ this.$onChangeWrapMode = this.onChangeWrapMode.bind(this);
+ session.addEventListener("changeWrapMode", this.$onChangeWrapMode);
+
+ this.$onChangeFold = this.onChangeFold.bind(this);
+ session.addEventListener("changeFold", this.$onChangeFold);
+
+ this.$onChangeFrontMarker = this.onChangeFrontMarker.bind(this);
+ this.session.addEventListener("changeFrontMarker", this.$onChangeFrontMarker);
+
+ this.$onChangeBackMarker = this.onChangeBackMarker.bind(this);
+ this.session.addEventListener("changeBackMarker", this.$onChangeBackMarker);
+
+ this.$onChangeBreakpoint = this.onChangeBreakpoint.bind(this);
+ this.session.addEventListener("changeBreakpoint", this.$onChangeBreakpoint);
+
+ this.$onChangeAnnotation = this.onChangeAnnotation.bind(this);
+ this.session.addEventListener("changeAnnotation", this.$onChangeAnnotation);
+
+ this.$onCursorChange = this.onCursorChange.bind(this);
+ this.session.addEventListener("changeOverwrite", this.$onCursorChange);
+
+ this.$onScrollTopChange = this.onScrollTopChange.bind(this);
+ this.session.addEventListener("changeScrollTop", this.$onScrollTopChange);
+
+ this.$onScrollLeftChange = this.onScrollLeftChange.bind(this);
+ this.session.addEventListener("changeScrollLeft", this.$onScrollLeftChange);
+
+ this.selection = session.getSelection();
+ this.selection.addEventListener("changeCursor", this.$onCursorChange);
+
+ this.$onSelectionChange = this.onSelectionChange.bind(this);
+ this.selection.addEventListener("changeSelection", this.$onSelectionChange);
+
+ this.onChangeMode();
+
+ this.$blockScrolling += 1;
+ this.onCursorChange();
+ this.$blockScrolling -= 1;
+
+ this.onScrollTopChange();
+ this.onScrollLeftChange();
+ this.onSelectionChange();
+ this.onChangeFrontMarker();
+ this.onChangeBackMarker();
+ this.onChangeBreakpoint();
+ this.onChangeAnnotation();
+ this.session.getUseWrapMode() && this.renderer.adjustWrapLimit();
+ this.renderer.updateFull();
+
+ this._emit("changeSession", {
+ session: session,
+ oldSession: oldSession
+ });
+ };
+ this.getSession = function() {
+ return this.session;
+ };
+ this.setValue = function(val, cursorPos) {
+ this.session.doc.setValue(val);
+
+ if (!cursorPos)
+ this.selectAll();
+ else if (cursorPos == 1)
+ this.navigateFileEnd();
+ else if (cursorPos == -1)
+ this.navigateFileStart();
+
+ return val;
+ };
+ this.getValue = function() {
+ return this.session.getValue();
+ };
+ this.getSelection = function() {
+ return this.selection;
+ };
+ this.resize = function(force) {
+ this.renderer.onResize(force);
+ };
+ this.setTheme = function(theme) {
+ this.renderer.setTheme(theme);
+ };
+ this.getTheme = function() {
+ return this.renderer.getTheme();
+ };
+ this.setStyle = function(style) {
+ this.renderer.setStyle(style);
+ };
+ this.unsetStyle = function(style) {
+ this.renderer.unsetStyle(style);
+ };
+ this.setFontSize = function(size) {
+ this.container.style.fontSize = size;
+ this.renderer.updateFontSize();
+ };
+ this.$highlightBrackets = function() {
+ if (this.session.$bracketHighlight) {
+ this.session.removeMarker(this.session.$bracketHighlight);
+ this.session.$bracketHighlight = null;
+ }
+
+ if (this.$highlightPending) {
+ return;
+ }
+
+ // perform highlight async to not block the browser during navigation
+ var self = this;
+ this.$highlightPending = true;
+ setTimeout(function() {
+ self.$highlightPending = false;
+
+ var pos = self.session.findMatchingBracket(self.getCursorPosition());
+ if (pos) {
+ var range = new Range(pos.row, pos.column, pos.row, pos.column+1);
+ self.session.$bracketHighlight = self.session.addMarker(range, "ace_bracket", "text");
+ }
+ }, 10);
+ };
+ this.focus = function() {
+ // Safari needs the timeout
+ // iOS and Firefox need it called immediately
+ // to be on the save side we do both
+ var _self = this;
+ setTimeout(function() {
+ _self.textInput.focus();
+ });
+ this.textInput.focus();
+ };
+ this.isFocused = function() {
+ return this.textInput.isFocused();
+ };
+ this.blur = function() {
+ this.textInput.blur();
+ };
+ this.onFocus = function() {
+ if (this.$isFocused)
+ return;
+ this.$isFocused = true;
+ this.renderer.showCursor();
+ this.renderer.visualizeFocus();
+ this._emit("focus");
+ };
+ this.onBlur = function() {
+ if (!this.$isFocused)
+ return;
+ this.$isFocused = false;
+ this.renderer.hideCursor();
+ this.renderer.visualizeBlur();
+ this._emit("blur");
+ };
+
+ this.$cursorChange = function() {
+ this.renderer.updateCursor();
+ };
+ this.onDocumentChange = function(e) {
+ var delta = e.data;
+ var range = delta.range;
+ var lastRow;
+
+ if (range.start.row == range.end.row && delta.action != "insertLines" && delta.action != "removeLines")
+ lastRow = range.end.row;
+ else
+ lastRow = Infinity;
+ this.renderer.updateLines(range.start.row, lastRow);
+
+ this._emit("change", e);
+
+ // update cursor because tab characters can influence the cursor position
+ this.$cursorChange();
+ };
+
+ this.onTokenizerUpdate = function(e) {
+ var rows = e.data;
+ this.renderer.updateLines(rows.first, rows.last);
+ };
+
+
+ this.onScrollTopChange = function() {
+ this.renderer.scrollToY(this.session.getScrollTop());
+ };
+
+ this.onScrollLeftChange = function() {
+ this.renderer.scrollToX(this.session.getScrollLeft());
+ };
+ this.onCursorChange = function() {
+ this.$cursorChange();
+
+ if (!this.$blockScrolling) {
+ this.renderer.scrollCursorIntoView();
+ }
+
+ this.$highlightBrackets();
+ this.$updateHighlightActiveLine();
+ this._emit("changeSelection");
+ };
+ this.$updateHighlightActiveLine = function() {
+ var session = this.getSession();
+
+ if (session.$highlightLineMarker)
+ session.removeMarker(session.$highlightLineMarker);
+
+ session.$highlightLineMarker = null;
+
+ if (this.$highlightActiveLine) {
+ var cursor = this.getCursorPosition();
+ var foldLine = this.session.getFoldLine(cursor.row);
+
+ if ((this.getSelectionStyle() != "line" || !this.selection.isMultiLine())) {
+ var range;
+ if (foldLine) {
+ range = new Range(foldLine.start.row, 0, foldLine.end.row + 1, 0);
+ } else {
+ range = new Range(cursor.row, 0, cursor.row+1, 0);
+ }
+ session.$highlightLineMarker = session.addMarker(range, "ace_active_line", "background");
+ }
+ }
+ };
+
+
+ this.onSelectionChange = function(e) {
+ var session = this.session;
+
+ if (session.$selectionMarker) {
+ session.removeMarker(session.$selectionMarker);
+ }
+ session.$selectionMarker = null;
+
+ if (!this.selection.isEmpty()) {
+ var range = this.selection.getRange();
+ var style = this.getSelectionStyle();
+ session.$selectionMarker = session.addMarker(range, "ace_selection", style);
+ } else {
+ this.$updateHighlightActiveLine();
+ }
+
+ var re = this.$highlightSelectedWord && this.$getSelectionHighLightRegexp()
+ this.session.highlight(re);
+
+ this._emit("changeSelection");
+ };
+
+ this.$getSelectionHighLightRegexp = function() {
+ var session = this.session;
+
+ var selection = this.getSelectionRange();
+ if (selection.isEmpty() || selection.isMultiLine())
+ return;
+
+ var startOuter = selection.start.column - 1;
+ var endOuter = selection.end.column + 1;
+ var line = session.getLine(selection.start.row);
+ var lineCols = line.length;
+ var needle = line.substring(Math.max(startOuter, 0),
+ Math.min(endOuter, lineCols));
+
+ // Make sure the outer characters are not part of the word.
+ if ((startOuter >= 0 && /^[\w\d]/.test(needle)) ||
+ (endOuter <= lineCols && /[\w\d]$/.test(needle)))
+ return;
+
+ needle = line.substring(selection.start.column, selection.end.column);
+ if (!/^[\w\d]+$/.test(needle))
+ return;
+
+ var re = this.$search.$assembleRegExp({
+ wholeWord: true,
+ caseSensitive: true,
+ needle: needle
+ });
+
+ return re;
+ };
+
+
+ this.onChangeFrontMarker = function() {
+ this.renderer.updateFrontMarkers();
+ };
+
+ this.onChangeBackMarker = function() {
+ this.renderer.updateBackMarkers();
+ };
+
+
+ this.onChangeBreakpoint = function() {
+ this.renderer.updateBreakpoints();
+ };
+
+ this.onChangeAnnotation = function() {
+ this.renderer.setAnnotations(this.session.getAnnotations());
+ };
+
+
+ this.onChangeMode = function() {
+ this.renderer.updateText();
+ };
+
+
+ this.onChangeWrapLimit = function() {
+ this.renderer.updateFull();
+ };
+
+ this.onChangeWrapMode = function() {
+ this.renderer.onResize(true);
+ };
+
+
+ this.onChangeFold = function() {
+ // Update the active line marker as due to folding changes the current
+ // line range on the screen might have changed.
+ this.$updateHighlightActiveLine();
+ // TODO: This might be too much updating. Okay for now.
+ this.renderer.updateFull();
+ };
+ /**
+ * Editor@copy(text)
+ * - text (String): The copied text
+ *
+ * Emitted when text is copied.
+ **/
+ this.getCopyText = function() {
+ var text = "";
+ if (!this.selection.isEmpty())
+ text = this.session.getTextRange(this.getSelectionRange());
+
+ this._emit("copy", text);
+ return text;
+ };
+ this.onCopy = function() {
+ this.commands.exec("copy", this);
+ };
+ this.onCut = function() {
+ this.commands.exec("cut", this);
+ };
+ /**
+ * Editor@paste(text)
+ * - text (String): The pasted text
+ *
+ * Emitted when text is pasted.
+ **/
+ this.onPaste = function(text) {
+ // todo this should change when paste becomes a command
+ if (this.$readOnly)
+ return;
+ this._emit("paste", text);
+ this.insert(text);
+ };
+ this.insert = function(text) {
+ var session = this.session;
+ var mode = session.getMode();
+
+ var cursor = this.getCursorPosition();
+
+ if (this.getBehavioursEnabled()) {
+ // Get a transform if the current mode wants one.
+ var transform = mode.transformAction(session.getState(cursor.row), 'insertion', this, session, text);
+ if (transform)
+ text = transform.text;
+ }
+
+ text = text.replace("\t", this.session.getTabString());
+
+ // remove selected text
+ if (!this.selection.isEmpty()) {
+ cursor = this.session.remove(this.getSelectionRange());
+ this.clearSelection();
+ }
+ else if (this.session.getOverwrite()) {
+ var range = new Range.fromPoints(cursor, cursor);
+ range.end.column += text.length;
+ this.session.remove(range);
+ }
+
+ this.clearSelection();
+
+ var start = cursor.column;
+ var lineState = session.getState(cursor.row);
+ var shouldOutdent = mode.checkOutdent(lineState, session.getLine(cursor.row), text);
+ var line = session.getLine(cursor.row);
+ var lineIndent = mode.getNextLineIndent(lineState, line.slice(0, cursor.column), session.getTabString());
+ var end = session.insert(cursor, text);
+
+ if (transform && transform.selection) {
+ if (transform.selection.length == 2) { // Transform relative to the current column
+ this.selection.setSelectionRange(
+ new Range(cursor.row, start + transform.selection[0],
+ cursor.row, start + transform.selection[1]));
+ } else { // Transform relative to the current row.
+ this.selection.setSelectionRange(
+ new Range(cursor.row + transform.selection[0],
+ transform.selection[1],
+ cursor.row + transform.selection[2],
+ transform.selection[3]));
+ }
+ }
+
+ var lineState = session.getState(cursor.row);
+
+ // TODO disabled multiline auto indent
+ // possibly doing the indent before inserting the text
+ // if (cursor.row !== end.row) {
+ if (session.getDocument().isNewLine(text)) {
+ this.moveCursorTo(cursor.row+1, 0);
+
+ var size = session.getTabSize();
+ var minIndent = Number.MAX_VALUE;
+
+ for (var row = cursor.row + 1; row <= end.row; ++row) {
+ var indent = 0;
+
+ line = session.getLine(row);
+ for (var i = 0; i < line.length; ++i)
+ if (line.charAt(i) == '\t')
+ indent += size;
+ else if (line.charAt(i) == ' ')
+ indent += 1;
+ else
+ break;
+ if (/[^\s]/.test(line))
+ minIndent = Math.min(indent, minIndent);
+ }
+
+ for (var row = cursor.row + 1; row <= end.row; ++row) {
+ var outdent = minIndent;
+
+ line = session.getLine(row);
+ for (var i = 0; i < line.length && outdent > 0; ++i)
+ if (line.charAt(i) == '\t')
+ outdent -= size;
+ else if (line.charAt(i) == ' ')
+ outdent -= 1;
+ session.remove(new Range(row, 0, row, i));
+ }
+ session.indentRows(cursor.row + 1, end.row, lineIndent);
+ }
+ if (shouldOutdent)
+ mode.autoOutdent(lineState, session, cursor.row);
+ };
+
+ this.onTextInput = function(text) {
+ this.keyBinding.onTextInput(text);
+ };
+
+ this.onCommandKey = function(e, hashId, keyCode) {
+ this.keyBinding.onCommandKey(e, hashId, keyCode);
+ };
+ this.setOverwrite = function(overwrite) {
+ this.session.setOverwrite(overwrite);
+ };
+ this.getOverwrite = function() {
+ return this.session.getOverwrite();
+ };
+ this.toggleOverwrite = function() {
+ this.session.toggleOverwrite();
+ };
+ this.setScrollSpeed = function(speed) {
+ this.$mouseHandler.setScrollSpeed(speed);
+ };
+ this.getScrollSpeed = function() {
+ return this.$mouseHandler.getScrollSpeed();
+ };
+ this.setDragDelay = function(dragDelay) {
+ this.$mouseHandler.setDragDelay(dragDelay);
+ };
+ this.getDragDelay = function() {
+ return this.$mouseHandler.getDragDelay();
+ };
+
+ this.$selectionStyle = "line";
+ /**
+ * Editor@changeSelectionStyle(data)
+ * - data (Object): Contains one property, `data`, which indicates the new selection style
+ *
+ * Emitted when the selection style changes, via [[Editor.setSelectionStyle]].
+ *
+ **/
+ this.setSelectionStyle = function(style) {
+ if (this.$selectionStyle == style) return;
+
+ this.$selectionStyle = style;
+ this.onSelectionChange();
+ this._emit("changeSelectionStyle", {data: style});
+ };
+ this.getSelectionStyle = function() {
+ return this.$selectionStyle;
+ };
+
+ this.$highlightActiveLine = true;
+ this.setHighlightActiveLine = function(shouldHighlight) {
+ if (this.$highlightActiveLine == shouldHighlight)
+ return;
+
+ this.$highlightActiveLine = shouldHighlight;
+ this.$updateHighlightActiveLine();
+ };
+ this.getHighlightActiveLine = function() {
+ return this.$highlightActiveLine;
+ };
+
+ this.$highlightGutterLine = true;
+ this.setHighlightGutterLine = function(shouldHighlight) {
+ if (this.$highlightGutterLine == shouldHighlight)
+ return;
+
+ this.renderer.setHighlightGutterLine(shouldHighlight);
+ this.$highlightGutterLine = shouldHighlight;
+ };
+
+ this.getHighlightGutterLine = function() {
+ return this.$highlightGutterLine;
+ };
+
+ this.$highlightSelectedWord = true;
+ this.setHighlightSelectedWord = function(shouldHighlight) {
+ if (this.$highlightSelectedWord == shouldHighlight)
+ return;
+
+ this.$highlightSelectedWord = shouldHighlight;
+ this.$onSelectionChange();
+ };
+ this.getHighlightSelectedWord = function() {
+ return this.$highlightSelectedWord;
+ };
+
+ this.setAnimatedScroll = function(shouldAnimate){
+ this.renderer.setAnimatedScroll(shouldAnimate);
+ };
+
+ this.getAnimatedScroll = function(){
+ return this.renderer.getAnimatedScroll();
+ };
+ this.setShowInvisibles = function(showInvisibles) {
+ this.renderer.setShowInvisibles(showInvisibles);
+ };
+ this.getShowInvisibles = function() {
+ return this.renderer.getShowInvisibles();
+ };
+
+ this.setDisplayIndentGuides = function(display) {
+ this.renderer.setDisplayIndentGuides(display);
+ };
+
+ this.getDisplayIndentGuides = function() {
+ return this.renderer.getDisplayIndentGuides();
+ };
+ this.setShowPrintMargin = function(showPrintMargin) {
+ this.renderer.setShowPrintMargin(showPrintMargin);
+ };
+ this.getShowPrintMargin = function() {
+ return this.renderer.getShowPrintMargin();
+ };
+ this.setPrintMarginColumn = function(showPrintMargin) {
+ this.renderer.setPrintMarginColumn(showPrintMargin);
+ };
+ this.getPrintMarginColumn = function() {
+ return this.renderer.getPrintMarginColumn();
+ };
+
+ this.$readOnly = false;
+ this.setReadOnly = function(readOnly) {
+ this.$readOnly = readOnly;
+ };
+ this.getReadOnly = function() {
+ return this.$readOnly;
+ };
+
+ this.$modeBehaviours = true;
+ this.setBehavioursEnabled = function (enabled) {
+ this.$modeBehaviours = enabled;
+ };
+ this.getBehavioursEnabled = function () {
+ return this.$modeBehaviours;
+ };
+ this.setShowFoldWidgets = function(show) {
+ var gutter = this.renderer.$gutterLayer;
+ if (gutter.getShowFoldWidgets() == show)
+ return;
+
+ this.renderer.$gutterLayer.setShowFoldWidgets(show);
+ this.$showFoldWidgets = show;
+ this.renderer.updateFull();
+ };
+ this.getShowFoldWidgets = function() {
+ return this.renderer.$gutterLayer.getShowFoldWidgets();
+ };
+
+ this.setFadeFoldWidgets = function(show) {
+ this.renderer.setFadeFoldWidgets(show);
+ };
+
+ this.getFadeFoldWidgets = function() {
+ return this.renderer.getFadeFoldWidgets();
+ };
+ this.remove = function(dir) {
+ if (this.selection.isEmpty()){
+ if (dir == "left")
+ this.selection.selectLeft();
+ else
+ this.selection.selectRight();
+ }
+
+ var range = this.getSelectionRange();
+ if (this.getBehavioursEnabled()) {
+ var session = this.session;
+ var state = session.getState(range.start.row);
+ var new_range = session.getMode().transformAction(state, 'deletion', this, session, range);
+ if (new_range)
+ range = new_range;
+ }
+
+ this.session.remove(range);
+ this.clearSelection();
+ };
+ this.removeWordRight = function() {
+ if (this.selection.isEmpty())
+ this.selection.selectWordRight();
+
+ this.session.remove(this.getSelectionRange());
+ this.clearSelection();
+ };
+ this.removeWordLeft = function() {
+ if (this.selection.isEmpty())
+ this.selection.selectWordLeft();
+
+ this.session.remove(this.getSelectionRange());
+ this.clearSelection();
+ };
+ this.removeToLineStart = function() {
+ if (this.selection.isEmpty())
+ this.selection.selectLineStart();
+
+ this.session.remove(this.getSelectionRange());
+ this.clearSelection();
+ };
+ this.removeToLineEnd = function() {
+ if (this.selection.isEmpty())
+ this.selection.selectLineEnd();
+
+ var range = this.getSelectionRange();
+ if (range.start.column == range.end.column && range.start.row == range.end.row) {
+ range.end.column = 0;
+ range.end.row++;
+ }
+
+ this.session.remove(range);
+ this.clearSelection();
+ };
+ this.splitLine = function() {
+ if (!this.selection.isEmpty()) {
+ this.session.remove(this.getSelectionRange());
+ this.clearSelection();
+ }
+
+ var cursor = this.getCursorPosition();
+ this.insert("\n");
+ this.moveCursorToPosition(cursor);
+ };
+ this.transposeLetters = function() {
+ if (!this.selection.isEmpty()) {
+ return;
+ }
+
+ var cursor = this.getCursorPosition();
+ var column = cursor.column;
+ if (column === 0)
+ return;
+
+ var line = this.session.getLine(cursor.row);
+ var swap, range;
+ if (column < line.length) {
+ swap = line.charAt(column) + line.charAt(column-1);
+ range = new Range(cursor.row, column-1, cursor.row, column+1);
+ }
+ else {
+ swap = line.charAt(column-1) + line.charAt(column-2);
+ range = new Range(cursor.row, column-2, cursor.row, column);
+ }
+ this.session.replace(range, swap);
+ };
+ this.toLowerCase = function() {
+ var originalRange = this.getSelectionRange();
+ if (this.selection.isEmpty()) {
+ this.selection.selectWord();
+ }
+
+ var range = this.getSelectionRange();
+ var text = this.session.getTextRange(range);
+ this.session.replace(range, text.toLowerCase());
+ this.selection.setSelectionRange(originalRange);
+ };
+ this.toUpperCase = function() {
+ var originalRange = this.getSelectionRange();
+ if (this.selection.isEmpty()) {
+ this.selection.selectWord();
+ }
+
+ var range = this.getSelectionRange();
+ var text = this.session.getTextRange(range);
+ this.session.replace(range, text.toUpperCase());
+ this.selection.setSelectionRange(originalRange);
+ };
+ this.indent = function() {
+ var session = this.session;
+ var range = this.getSelectionRange();
+
+ if (range.start.row < range.end.row || range.start.column < range.end.column) {
+ var rows = this.$getSelectedRows();
+ session.indentRows(rows.first, rows.last, "\t");
+ } else {
+ var indentString;
+
+ if (this.session.getUseSoftTabs()) {
+ var size = session.getTabSize(),
+ position = this.getCursorPosition(),
+ column = session.documentToScreenColumn(position.row, position.column),
+ count = (size - column % size);
+
+ indentString = lang.stringRepeat(" ", count);
+ } else
+ indentString = "\t";
+ return this.insert(indentString);
+ }
+ };
+ this.blockOutdent = function() {
+ var selection = this.session.getSelection();
+ this.session.outdentRows(selection.getRange());
+ };
+ this.toggleCommentLines = function() {
+ var state = this.session.getState(this.getCursorPosition().row);
+ var rows = this.$getSelectedRows();
+ this.session.getMode().toggleCommentLines(state, this.session, rows.first, rows.last);
+ };
+ this.removeLines = function() {
+ var rows = this.$getSelectedRows();
+ var range;
+ if (rows.first === 0 || rows.last+1 < this.session.getLength())
+ range = new Range(rows.first, 0, rows.last+1, 0);
+ else
+ range = new Range(
+ rows.first-1, this.session.getLine(rows.first-1).length,
+ rows.last, this.session.getLine(rows.last).length
+ );
+ this.session.remove(range);
+ this.clearSelection();
+ };
+
+ this.duplicateSelection = function() {
+ var sel = this.selection;
+ var doc = this.session;
+ var range = sel.getRange();
+ if (range.isEmpty()) {
+ var row = range.start.row;
+ doc.duplicateLines(row, row);
+ } else {
+ var reverse = sel.isBackwards()
+ var point = sel.isBackwards() ? range.start : range.end;
+ var endPoint = doc.insert(point, doc.getTextRange(range), false);
+ range.start = point;
+ range.end = endPoint;
+
+ sel.setSelectionRange(range, reverse)
+ }
+ };
+ this.moveLinesDown = function() {
+ this.$moveLines(function(firstRow, lastRow) {
+ return this.session.moveLinesDown(firstRow, lastRow);
+ });
+ };
+ this.moveLinesUp = function() {
+ this.$moveLines(function(firstRow, lastRow) {
+ return this.session.moveLinesUp(firstRow, lastRow);
+ });
+ };
+ this.moveText = function(range, toPosition) {
+ if (this.$readOnly)
+ return null;
+
+ return this.session.moveText(range, toPosition);
+ };
+ this.copyLinesUp = function() {
+ this.$moveLines(function(firstRow, lastRow) {
+ this.session.duplicateLines(firstRow, lastRow);
+ return 0;
+ });
+ };
+ this.copyLinesDown = function() {
+ this.$moveLines(function(firstRow, lastRow) {
+ return this.session.duplicateLines(firstRow, lastRow);
+ });
+ };
+ this.$moveLines = function(mover) {
+ var rows = this.$getSelectedRows();
+ var selection = this.selection;
+ if (!selection.isMultiLine()) {
+ var range = selection.getRange();
+ var reverse = selection.isBackwards();
+ }
+
+ var linesMoved = mover.call(this, rows.first, rows.last);
+
+ if (range) {
+ range.start.row += linesMoved;
+ range.end.row += linesMoved;
+ selection.setSelectionRange(range, reverse);
+ }
+ else {
+ selection.setSelectionAnchor(rows.last+linesMoved+1, 0);
+ selection.$moveSelection(function() {
+ selection.moveCursorTo(rows.first+linesMoved, 0);
+ });
+ }
+ };
+ this.$getSelectedRows = function() {
+ var range = this.getSelectionRange().collapseRows();
+
+ return {
+ first: range.start.row,
+ last: range.end.row
+ };
+ };
+
+ this.onCompositionStart = function(text) {
+ this.renderer.showComposition(this.getCursorPosition());
+ };
+
+ this.onCompositionUpdate = function(text) {
+ this.renderer.setCompositionText(text);
+ };
+
+ this.onCompositionEnd = function() {
+ this.renderer.hideComposition();
+ };
+ this.getFirstVisibleRow = function() {
+ return this.renderer.getFirstVisibleRow();
+ };
+ this.getLastVisibleRow = function() {
+ return this.renderer.getLastVisibleRow();
+ };
+ this.isRowVisible = function(row) {
+ return (row >= this.getFirstVisibleRow() && row <= this.getLastVisibleRow());
+ };
+ this.isRowFullyVisible = function(row) {
+ return (row >= this.renderer.getFirstFullyVisibleRow() && row <= this.renderer.getLastFullyVisibleRow());
+ };
+ this.$getVisibleRowCount = function() {
+ return this.renderer.getScrollBottomRow() - this.renderer.getScrollTopRow() + 1;
+ };
+
+ this.$moveByPage = function(dir, select) {
+ var renderer = this.renderer;
+ var config = this.renderer.layerConfig;
+ var rows = dir * Math.floor(config.height / config.lineHeight);
+
+ this.$blockScrolling++;
+ if (select == true) {
+ this.selection.$moveSelection(function(){
+ this.moveCursorBy(rows, 0);
+ });
+ } else if (select == false) {
+ this.selection.moveCursorBy(rows, 0);
+ this.selection.clearSelection();
+ }
+ this.$blockScrolling--;
+
+ var scrollTop = renderer.scrollTop;
+
+ renderer.scrollBy(0, rows * config.lineHeight);
+ if (select != null)
+ renderer.scrollCursorIntoView(null, 0.5);
+
+ renderer.animateScrolling(scrollTop);
+ };
+ this.selectPageDown = function() {
+ this.$moveByPage(1, true);
+ };
+ this.selectPageUp = function() {
+ this.$moveByPage(-1, true);
+ };
+ this.gotoPageDown = function() {
+ this.$moveByPage(1, false);
+ };
+ this.gotoPageUp = function() {
+ this.$moveByPage(-1, false);
+ };
+ this.scrollPageDown = function() {
+ this.$moveByPage(1);
+ };
+ this.scrollPageUp = function() {
+ this.$moveByPage(-1);
+ };
+ this.scrollToRow = function(row) {
+ this.renderer.scrollToRow(row);
+ };
+ this.scrollToLine = function(line, center, animate, callback) {
+ this.renderer.scrollToLine(line, center, animate, callback);
+ };
+ this.centerSelection = function() {
+ var range = this.getSelectionRange();
+ var pos = {
+ row: Math.floor(range.start.row + (range.end.row - range.start.row) / 2),
+ column: Math.floor(range.start.column + (range.end.column - range.start.column) / 2)
+ }
+ this.renderer.alignCursor(pos, 0.5);
+ };
+ this.getCursorPosition = function() {
+ return this.selection.getCursor();
+ };
+ this.getCursorPositionScreen = function() {
+ return this.session.documentToScreenPosition(this.getCursorPosition());
+ };
+ this.getSelectionRange = function() {
+ return this.selection.getRange();
+ };
+ this.selectAll = function() {
+ this.$blockScrolling += 1;
+ this.selection.selectAll();
+ this.$blockScrolling -= 1;
+ };
+ this.clearSelection = function() {
+ this.selection.clearSelection();
+ };
+ this.moveCursorTo = function(row, column) {
+ this.selection.moveCursorTo(row, column);
+ };
+ this.moveCursorToPosition = function(pos) {
+ this.selection.moveCursorToPosition(pos);
+ };
+ this.jumpToMatching = function(select) {
+ var cursor = this.getCursorPosition();
+
+ var range = this.session.getBracketRange(cursor);
+ if (!range) {
+ range = this.find({
+ needle: /[{}()\[\]]/g,
+ preventScroll:true,
+ start: {row: cursor.row, column: cursor.column - 1}
+ });
+ if (!range)
+ return;
+ var pos = range.start;
+ if (pos.row == cursor.row && Math.abs(pos.column - cursor.column) < 2)
+ range = this.session.getBracketRange(pos);
+ }
+
+ pos = range && range.cursor || pos;
+ if (pos) {
+ if (select) {
+ if (range && range.isEqual(this.getSelectionRange()))
+ this.clearSelection();
+ else
+ this.selection.selectTo(pos.row, pos.column);
+ } else {
+ this.clearSelection();
+ this.moveCursorTo(pos.row, pos.column);
+ }
+ }
+ };
+ this.gotoLine = function(lineNumber, column, animate) {
+ this.selection.clearSelection();
+ this.session.unfold({row: lineNumber - 1, column: column || 0});
+
+ this.$blockScrolling += 1;
+ this.moveCursorTo(lineNumber - 1, column || 0);
+ this.$blockScrolling -= 1;
+
+ if (!this.isRowFullyVisible(lineNumber - 1))
+ this.scrollToLine(lineNumber - 1, true, animate);
+ };
+ this.navigateTo = function(row, column) {
+ this.clearSelection();
+ this.moveCursorTo(row, column);
+ };
+ this.navigateUp = function(times) {
+ this.selection.clearSelection();
+ times = times || 1;
+ this.selection.moveCursorBy(-times, 0);
+ };
+ this.navigateDown = function(times) {
+ this.selection.clearSelection();
+ times = times || 1;
+ this.selection.moveCursorBy(times, 0);
+ };
+ this.navigateLeft = function(times) {
+ if (!this.selection.isEmpty()) {
+ var selectionStart = this.getSelectionRange().start;
+ this.moveCursorToPosition(selectionStart);
+ }
+ else {
+ times = times || 1;
+ while (times--) {
+ this.selection.moveCursorLeft();
+ }
+ }
+ this.clearSelection();
+ };
+ this.navigateRight = function(times) {
+ if (!this.selection.isEmpty()) {
+ var selectionEnd = this.getSelectionRange().end;
+ this.moveCursorToPosition(selectionEnd);
+ }
+ else {
+ times = times || 1;
+ while (times--) {
+ this.selection.moveCursorRight();
+ }
+ }
+ this.clearSelection();
+ };
+ this.navigateLineStart = function() {
+ this.selection.moveCursorLineStart();
+ this.clearSelection();
+ };
+ this.navigateLineEnd = function() {
+ this.selection.moveCursorLineEnd();
+ this.clearSelection();
+ };
+ this.navigateFileEnd = function() {
+ var scrollTop = this.renderer.scrollTop;
+ this.selection.moveCursorFileEnd();
+ this.clearSelection();
+ this.renderer.animateScrolling(scrollTop);
+ };
+ this.navigateFileStart = function() {
+ var scrollTop = this.renderer.scrollTop;
+ this.selection.moveCursorFileStart();
+ this.clearSelection();
+ this.renderer.animateScrolling(scrollTop);
+ };
+ this.navigateWordRight = function() {
+ this.selection.moveCursorWordRight();
+ this.clearSelection();
+ };
+ this.navigateWordLeft = function() {
+ this.selection.moveCursorWordLeft();
+ this.clearSelection();
+ };
+ this.replace = function(replacement, options) {
+ if (options)
+ this.$search.set(options);
+
+ var range = this.$search.find(this.session);
+ var replaced = 0;
+ if (!range)
+ return replaced;
+
+ if (this.$tryReplace(range, replacement)) {
+ replaced = 1;
+ }
+ if (range !== null) {
+ this.selection.setSelectionRange(range);
+ this.renderer.scrollSelectionIntoView(range.start, range.end);
+ }
+
+ return replaced;
+ };
+ this.replaceAll = function(replacement, options) {
+ if (options) {
+ this.$search.set(options);
+ }
+
+ var ranges = this.$search.findAll(this.session);
+ var replaced = 0;
+ if (!ranges.length)
+ return replaced;
+
+ this.$blockScrolling += 1;
+
+ var selection = this.getSelectionRange();
+ this.clearSelection();
+ this.selection.moveCursorTo(0, 0);
+
+ for (var i = ranges.length - 1; i >= 0; --i) {
+ if(this.$tryReplace(ranges[i], replacement)) {
+ replaced++;
+ }
+ }
+
+ this.selection.setSelectionRange(selection);
+ this.$blockScrolling -= 1;
+
+ return replaced;
+ };
+
+ this.$tryReplace = function(range, replacement) {
+ var input = this.session.getTextRange(range);
+ replacement = this.$search.replace(input, replacement);
+ if (replacement !== null) {
+ range.end = this.session.replace(range, replacement);
+ return range;
+ } else {
+ return null;
+ }
+ };
+ this.getLastSearchOptions = function() {
+ return this.$search.getOptions();
+ };
+ this.find = function(needle, options, animate) {
+ if (!options)
+ options = {};
+
+ if (typeof needle == "string" || needle instanceof RegExp)
+ options.needle = needle;
+ else if (typeof needle == "object")
+ oop.mixin(options, needle);
+
+ var range = this.selection.getRange();
+ if (options.needle == null) {
+ needle = this.session.getTextRange(range)
+ || this.$search.$options.needle;
+ if (!needle) {
+ range = this.session.getWordRange(range.start.row, range.start.column);
+ needle = this.session.getTextRange(range);
+ }
+ this.$search.set({needle: needle});
+ }
+
+ this.$search.set(options);
+ if (!options.start)
+ this.$search.set({start: range});
+
+ var newRange = this.$search.find(this.session);
+ if (options.preventScroll)
+ return newRange;
+ if (newRange) {
+ this.revealRange(newRange, animate);
+ return newRange;
+ }
+ // clear selection if nothing is found
+ if (options.backwards)
+ range.start = range.end;
+ else
+ range.end = range.start;
+ this.selection.setRange(range);
+ };
+ this.findNext = function(options, animate) {
+ this.find({skipCurrent: true, backwards: false}, options, animate);
+ };
+ this.findPrevious = function(options, animate) {
+ this.find(options, {skipCurrent: true, backwards: true}, animate);
+ };
+
+ this.revealRange = function(range, animate) {
+ this.$blockScrolling += 1;
+ this.session.unfold(range);
+ this.selection.setSelectionRange(range);
+ this.$blockScrolling -= 1;
+
+ var scrollTop = this.renderer.scrollTop;
+ this.renderer.scrollSelectionIntoView(range.start, range.end, 0.5);
+ if (animate != false)
+ this.renderer.animateScrolling(scrollTop);
+ };
+ this.undo = function() {
+ this.$blockScrolling++;
+ this.session.getUndoManager().undo();
+ this.$blockScrolling--;
+ this.renderer.scrollCursorIntoView(null, 0.5);
+ };
+ this.redo = function() {
+ this.$blockScrolling++;
+ this.session.getUndoManager().redo();
+ this.$blockScrolling--;
+ this.renderer.scrollCursorIntoView(null, 0.5);
+ };
+ this.destroy = function() {
+ this.renderer.destroy();
+ };
+
+}).call(Editor.prototype);
+
+
+exports.Editor = Editor;
+});
+
+ace.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) {
+ return new Array(count + 1).join(string);
+};
+
+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<l; i++) {
+ if (array[i] && typeof array[i] == "object")
+ copy[i] = this.copyObject( array[i] );
+ else
+ copy[i] = array[i];
+ }
+ return copy;
+};
+
+exports.deepCopy = function (obj) {
+ if (typeof obj != "object") {
+ return obj;
+ }
+
+ var copy = obj.constructor();
+ for (var key in obj) {
+ if (typeof obj[key] == "object") {
+ copy[key] = this.deepCopy(obj[key]);
+ } else {
+ copy[key] = obj[key];
+ }
+ }
+ return copy;
+};
+
+exports.arrayToMap = function(arr) {
+ var map = {};
+ for (var i=0; i<arr.length; i++) {
+ map[arr[i]] = 1;
+ }
+ return map;
+
+};
+
+exports.createMap = function(props) {
+ var map = Object.create(null);
+ for (var i in props) {
+ map[i] = props[i];
+ }
+ return map;
+};
+exports.arrayRemove = function(array, value) {
+ for (var i = 0; i <= array.length; i++) {
+ if (value === array[i]) {
+ array.splice(i, 1);
+ }
+ }
+};
+
+exports.escapeRegExp = function(str) {
+ return str.replace(/([.*+?^${}()|[\]\/\\])/g, '\\$1');
+};
+
+exports.getMatchOffsets = function(string, regExp) {
+ var matches = [];
+
+ string.replace(regExp, function(str) {
+ matches.push({
+ offset: arguments[arguments.length-2],
+ length: str.length
+ });
+ });
+
+ return matches;
+};
+
+
+exports.deferredCall = function(fcn) {
+
+ var timer = null;
+ var callback = function() {
+ timer = null;
+ fcn();
+ };
+
+ var deferred = function(timeout) {
+ deferred.cancel();
+ timer = setTimeout(callback, timeout || 0);
+ return deferred;
+ };
+
+ deferred.schedule = deferred;
+
+ deferred.call = function() {
+ this.cancel();
+ fcn();
+ return deferred;
+ };
+
+ deferred.cancel = function() {
+ clearTimeout(timer);
+ timer = null;
+ return deferred;
+ };
+
+ return deferred;
+};
+
+});
+
+ace.define('ace/keyboard/textinput', ['require', 'exports', 'module' , 'ace/lib/event', 'ace/lib/useragent', 'ace/lib/dom'], function(require, exports, module) {
+
+
+var event = require("../lib/event");
+var useragent = require("../lib/useragent");
+var dom = require("../lib/dom");
+
+var TextInput = function(parentNode, host) {
+ var text = dom.createElement("textarea");
+ if (useragent.isTouchPad)
+ text.setAttribute("x-palm-disable-auto-cap", true);
+
+ text.setAttribute("wrap", "off");
+
+ text.style.top = "-2em";
+ parentNode.insertBefore(text, parentNode.firstChild);
+
+ var PLACEHOLDER = useragent.isIE ? "\x01" : "\x00";
+ reset(true);
+ if (isFocused())
+ host.onFocus();
+
+ var inCompostion = false;
+ var copied = false;
+ var pasted = false;
+ var tempStyle = '';
+
+ function reset(full) {
+ try {
+ if (full) {
+ text.value = PLACEHOLDER;
+ text.selectionStart = 0;
+ text.selectionEnd = 1;
+ } else
+ text.select();
+ } catch (e) {}
+ }
+
+ function sendText(valueToSend) {
+ if (!copied) {
+ var value = valueToSend || text.value;
+ if (value) {
+ if (value.length > 1) {
+ if (value.charAt(0) == PLACEHOLDER)
+ value = value.substr(1);
+ else if (value.charAt(value.length - 1) == PLACEHOLDER)
+ value = value.slice(0, -1);
+ }
+
+ if (value && value != PLACEHOLDER) {
+ if (pasted)
+ host.onPaste(value);
+ else
+ host.onTextInput(value);
+ }
+ }
+ }
+
+ copied = false;
+ pasted = false;
+
+ // Safari doesn't fire copy events if no text is selected
+ reset(true);
+ }
+
+ var onTextInput = function(e) {
+ if (!inCompostion)
+ sendText(e.data);
+ setTimeout(function () {
+ if (!inCompostion)
+ reset(true);
+ }, 0);
+ };
+
+ var onPropertyChange = function(e) {
+ setTimeout(function() {
+ if (!inCompostion)
+ if(text.value != "") {
+ sendText();
+ }
+ }, 0);
+ };
+
+ var onCompositionStart = function(e) {
+ inCompostion = true;
+ host.onCompositionStart();
+ setTimeout(onCompositionUpdate, 0);
+ };
+
+ var onCompositionUpdate = function() {
+ if (!inCompostion) return;
+ host.onCompositionUpdate(text.value);
+ };
+
+ var onCompositionEnd = function(e) {
+ inCompostion = false;
+ host.onCompositionEnd();
+ };
+
+ var onCopy = function(e) {
+ copied = true;
+ var copyText = host.getCopyText();
+ if(copyText)
+ text.value = copyText;
+ else
+ e.preventDefault();
+ reset();
+ setTimeout(function () {
+ sendText();
+ }, 0);
+ };
+
+ var onCut = function(e) {
+ copied = true;
+ var copyText = host.getCopyText();
+ if(copyText) {
+ text.value = copyText;
+ host.onCut();
+ } else
+ e.preventDefault();
+ reset();
+ setTimeout(function () {
+ sendText();
+ }, 0);
+ };
+
+ event.addCommandKeyListener(text, host.onCommandKey.bind(host));
+ event.addListener(text, "input", onTextInput);
+
+ if (useragent.isOldIE) {
+ var keytable = { 13:1, 27:1 };
+ event.addListener(text, "keyup", function (e) {
+ if (inCompostion && (!text.value || keytable[e.keyCode]))
+ setTimeout(onCompositionEnd, 0);
+ if ((text.value.charCodeAt(0)|0) < 129) {
+ return;
+ }
+ inCompostion ? onCompositionUpdate() : onCompositionStart();
+ });
+
+ event.addListener(text, "propertychange", function() {
+ if (text.value != PLACEHOLDER)
+ setTimeout(sendText, 0);
+ });
+ }
+
+ event.addListener(text, "paste", function(e) {
+ // Mark that the next input text comes from past.
+ pasted = true;
+ // Some browsers support the event.clipboardData API. Use this to get
+ // the pasted content which increases speed if pasting a lot of lines.
+ if (e.clipboardData && e.clipboardData.getData) {
+ sendText(e.clipboardData.getData("text/plain"));
+ e.preventDefault();
+ }
+ else {
+ // If a browser doesn't support any of the things above, use the regular
+ // method to detect the pasted input.
+ onPropertyChange();
+ }
+ });
+
+ if ("onbeforecopy" in text && typeof clipboardData !== "undefined") {
+ event.addListener(text, "beforecopy", function(e) {
+ if (tempStyle)
+ return; // without this text is copied when contextmenu is shown
+ var copyText = host.getCopyText();
+ if (copyText)
+ clipboardData.setData("Text", copyText);
+ else
+ e.preventDefault();
+ });
+ event.addListener(parentNode, "keydown", function(e) {
+ if (e.ctrlKey && e.keyCode == 88) {
+ var copyText = host.getCopyText();
+ if (copyText) {
+ clipboardData.setData("Text", copyText);
+ host.onCut();
+ }
+ event.preventDefault(e);
+ }
+ });
+ event.addListener(text, "cut", onCut); // for ie9 context menu
+ }
+ else if (useragent.isOpera && !("KeyboardEvent" in window)) {
+ event.addListener(parentNode, "keydown", function(e) {
+ if ((useragent.isMac && !e.metaKey) || !e.ctrlKey)
+ return;
+
+ if ((e.keyCode == 88 || e.keyCode == 67)) {
+ var copyText = host.getCopyText();
+ if (copyText) {
+ text.value = copyText;
+ text.select();
+ if (e.keyCode == 88)
+ host.onCut();
+ }
+ }
+ });
+ }
+ else {
+ event.addListener(text, "copy", onCopy);
+ event.addListener(text, "cut", onCut);
+ }
+
+ event.addListener(text, "compositionstart", onCompositionStart);
+ if (useragent.isGecko) {
+ event.addListener(text, "text", onCompositionUpdate);
+ }
+ if (useragent.isWebKit) {
+ event.addListener(text, "keyup", onCompositionUpdate);
+ }
+ event.addListener(text, "compositionend", onCompositionEnd);
+
+ event.addListener(text, "blur", function() {
+ host.onBlur();
+ });
+
+ event.addListener(text, "focus", function() {
+ host.onFocus();
+ reset();
+ });
+
+ this.focus = function() {
+ reset();
+ text.focus();
+ };
+
+ this.blur = function() {
+ text.blur();
+ };
+
+ function isFocused() {
+ return document.activeElement === text;
+ }
+ this.isFocused = isFocused;
+
+ this.getElement = function() {
+ return text;
+ };
+
+ this.onContextMenu = function(e) {
+ if (!tempStyle)
+ tempStyle = text.style.cssText;
+
+ text.style.cssText =
+ "position:fixed; z-index:100000;" +
+ (useragent.isIE ? "background:rgba(0, 0, 0, 0.03); opacity:0.1;" : "") + //"background:rgba(250, 0, 0, 0.3); opacity:1;" +
+ "left:" + (e.clientX - 2) + "px; top:" + (e.clientY - 2) + "px;";
+
+ if (host.selection.isEmpty())
+ text.value = "";
+ else
+ reset(true);
+
+ if (e.type != "mousedown")
+ return;
+
+ if (host.renderer.$keepTextAreaAtCursor)
+ host.renderer.$keepTextAreaAtCursor = null;
+
+ // on windows context menu is opened after mouseup
+ if (useragent.isWin && (useragent.isGecko || useragent.isIE))
+ event.capture(host.container, function(e) {
+ text.style.left = e.clientX - 2 + "px";
+ text.style.top = e.clientY - 2 + "px";
+ }, onContextMenuClose);
+ };
+
+ function onContextMenuClose() {
+ setTimeout(function () {
+ if (tempStyle) {
+ text.style.cssText = tempStyle;
+ tempStyle = '';
+ }
+ sendText();
+ if (host.renderer.$keepTextAreaAtCursor == null) {
+ host.renderer.$keepTextAreaAtCursor = true;
+ host.renderer.$moveTextAreaToCursor();
+ }
+ }, 0);
+ };
+ this.onContextMenuClose = onContextMenuClose;
+
+ // firefox fires contextmenu event after opening it
+ if (!useragent.isGecko)
+ event.addListener(text, "contextmenu", function(e) {
+ host.textInput.onContextMenu(e);
+ onContextMenuClose()
+ });
+};
+
+exports.TextInput = TextInput;
+});
+
+ace.define('ace/mouse/mouse_handler', ['require', 'exports', 'module' , 'ace/lib/event', 'ace/lib/useragent', 'ace/mouse/default_handlers', 'ace/mouse/default_gutter_handler', 'ace/mouse/mouse_event', 'ace/mouse/dragdrop'], function(require, exports, module) {
+
+
+var event = require("../lib/event");
+var useragent = require("../lib/useragent");
+var DefaultHandlers = require("./default_handlers").DefaultHandlers;
+var DefaultGutterHandler = require("./default_gutter_handler").GutterHandler;
+var MouseEvent = require("./mouse_event").MouseEvent;
+var DragdropHandler = require("./dragdrop").DragdropHandler;
+
+var MouseHandler = function(editor) {
+ this.editor = editor;
+
+ new DefaultHandlers(this);
+ new DefaultGutterHandler(this);
+ new DragdropHandler(this);
+
+ event.addListener(editor.container, "mousedown", function(e) {
+ editor.focus();
+ return event.preventDefault(e);
+ });
+
+ var mouseTarget = editor.renderer.getMouseEventTarget();
+ event.addListener(mouseTarget, "click", this.onMouseEvent.bind(this, "click"));
+ event.addListener(mouseTarget, "mousemove", this.onMouseMove.bind(this, "mousemove"));
+ event.addMultiMouseDownListener(mouseTarget, [300, 300, 250], this, "onMouseEvent");
+ event.addMouseWheelListener(editor.container, this.onMouseWheel.bind(this, "mousewheel"));
+
+ var gutterEl = editor.renderer.$gutter;
+ event.addListener(gutterEl, "mousedown", this.onMouseEvent.bind(this, "guttermousedown"));
+ event.addListener(gutterEl, "click", this.onMouseEvent.bind(this, "gutterclick"));
+ event.addListener(gutterEl, "dblclick", this.onMouseEvent.bind(this, "gutterdblclick"));
+ event.addListener(gutterEl, "mousemove", this.onMouseEvent.bind(this, "guttermousemove"));
+};
+
+(function() {
+
+ this.$scrollSpeed = 1;
+ this.setScrollSpeed = function(speed) {
+ this.$scrollSpeed = speed;
+ };
+
+ this.getScrollSpeed = function() {
+ return this.$scrollSpeed;
+ };
+
+ this.onMouseEvent = function(name, e) {
+ this.editor._emit(name, new MouseEvent(e, this.editor));
+ };
+
+ this.$dragDelay = 250;
+ this.setDragDelay = function(dragDelay) {
+ this.$dragDelay = dragDelay;
+ };
+
+ this.getDragDelay = function() {
+ return this.$dragDelay;
+ };
+
+ this.onMouseMove = function(name, e) {
+ // optimization, because mousemove doesn't have a default handler.
+ var listeners = this.editor._eventRegistry && this.editor._eventRegistry.mousemove;
+ if (!listeners || !listeners.length)
+ return;
+
+ this.editor._emit(name, new MouseEvent(e, this.editor));
+ };
+
+ this.onMouseWheel = function(name, e) {
+ var mouseEvent = new MouseEvent(e, this.editor);
+ mouseEvent.speed = this.$scrollSpeed * 2;
+ mouseEvent.wheelX = e.wheelX;
+ mouseEvent.wheelY = e.wheelY;
+
+ this.editor._emit(name, mouseEvent);
+ };
+
+ this.setState = function(state) {
+ this.state = state;
+ };
+
+ this.captureMouse = function(ev, state) {
+ if (state)
+ this.setState(state);
+
+ this.x = ev.x;
+ this.y = ev.y;
+
+ // do not move textarea during selection
+ var renderer = this.editor.renderer;
+ if (renderer.$keepTextAreaAtCursor)
+ renderer.$keepTextAreaAtCursor = null;
+
+ var self = this;
+ var onMouseMove = function(e) {
+ self.x = e.clientX;
+ self.y = e.clientY;
+ };
+
+ var onCaptureEnd = function(e) {
+ clearInterval(timerId);
+ self[self.state + "End"] && self[self.state + "End"](e);
+ self.$clickSelection = null;
+ if (renderer.$keepTextAreaAtCursor == null) {
+ renderer.$keepTextAreaAtCursor = true;
+ renderer.$moveTextAreaToCursor();
+ }
+ };
+
+ var onCaptureInterval = function() {
+ self[self.state] && self[self.state]();
+ }
+
+ if (useragent.isOldIE && ev.domEvent.type == "dblclick") {
+ setTimeout(function() {
+ onCaptureInterval();
+ onCaptureEnd(ev.domEvent);
+ });
+ return;
+ }
+
+ event.capture(this.editor.container, onMouseMove, onCaptureEnd);
+ var timerId = setInterval(onCaptureInterval, 20);
+ };
+}).call(MouseHandler.prototype);
+
+exports.MouseHandler = MouseHandler;
+});
+
+ace.define('ace/mouse/default_handlers', ['require', 'exports', 'module' , 'ace/lib/dom', 'ace/lib/useragent'], function(require, exports, module) {
+
+
+var dom = require("../lib/dom");
+var useragent = require("../lib/useragent");
+
+var DRAG_OFFSET = 5; // pixels
+
+function DefaultHandlers(mouseHandler) {
+ mouseHandler.$clickSelection = null;
+
+ var editor = mouseHandler.editor;
+ editor.setDefaultHandler("mousedown", this.onMouseDown.bind(mouseHandler));
+ editor.setDefaultHandler("dblclick", this.onDoubleClick.bind(mouseHandler));
+ editor.setDefaultHandler("tripleclick", this.onTripleClick.bind(mouseHandler));
+ editor.setDefaultHandler("quadclick", this.onQuadClick.bind(mouseHandler));
+ editor.setDefaultHandler("mousewheel", this.onMouseWheel.bind(mouseHandler));
+
+ var exports = ["select", "startSelect", "drag", "dragEnd", "dragWait",
+ "dragWaitEnd", "startDrag", "focusWait"];
+
+ exports.forEach(function(x) {
+ mouseHandler[x] = this[x];
+ }, this);
+
+ mouseHandler.selectByLines = this.extendSelectionBy.bind(mouseHandler, "getLineRange");
+ mouseHandler.selectByWords = this.extendSelectionBy.bind(mouseHandler, "getWordRange");
+
+ mouseHandler.$focusWaitTimout = 250;
+}
+
+(function() {
+
+ this.onMouseDown = function(ev) {
+ var inSelection = ev.inSelection();
+ var pos = ev.getDocumentPosition();
+ this.mousedownEvent = ev;
+ var editor = this.editor;
+
+ var button = ev.getButton();
+ if (button !== 0) {
+ var selectionRange = editor.getSelectionRange();
+ var selectionEmpty = selectionRange.isEmpty();
+
+ if (selectionEmpty) {
+ editor.moveCursorToPosition(pos);
+ editor.selection.clearSelection();
+ }
+
+ // 2: contextmenu, 1: linux paste
+ editor.textInput.onContextMenu(ev.domEvent);
+ return; // stopping event here breaks contextmenu on ff mac
+ }
+
+ // if this click caused the editor to be focused should not clear the
+ // selection
+ if (inSelection && !editor.isFocused()) {
+ editor.focus();
+ if (this.$focusWaitTimout && !this.$clickSelection) {
+ this.setState("focusWait");
+ this.captureMouse(ev);
+ return ev.preventDefault();
+ }
+ }
+
+ if (!inSelection || this.$clickSelection || ev.getShiftKey()) {
+ // Directly pick STATE_SELECT, since the user is not clicking inside
+ // a selection.
+ this.startSelect(pos);
+ } else if (inSelection) {
+ this.mousedownEvent.time = (new Date()).getTime();
+ this.setState("dragWait");
+ }
+
+ this.captureMouse(ev);
+ return ev.preventDefault();
+ };
+
+ this.startSelect = function(pos) {
+ pos = pos || this.editor.renderer.screenToTextCoordinates(this.x, this.y);
+ if (this.mousedownEvent.getShiftKey()) {
+ this.editor.selection.selectToPosition(pos);
+ }
+ else if (!this.$clickSelection) {
+ this.editor.moveCursorToPosition(pos);
+ this.editor.selection.clearSelection();
+ }
+ this.setState("select");
+ };
+
+ this.select = function() {
+ var anchor, editor = this.editor;
+ var cursor = editor.renderer.screenToTextCoordinates(this.x, this.y);
+
+ if (this.$clickSelection) {
+ var cmp = this.$clickSelection.comparePoint(cursor);
+
+ if (cmp == -1) {
+ anchor = this.$clickSelection.end;
+ } else if (cmp == 1) {
+ anchor = this.$clickSelection.start;
+ } else {
+ var orientedRange = calcRangeOrientation(this.$clickSelection, cursor);
+ cursor = orientedRange.cursor;
+ anchor = orientedRange.anchor;
+ }
+ editor.selection.setSelectionAnchor(anchor.row, anchor.column);
+ }
+ editor.selection.selectToPosition(cursor);
+
+ editor.renderer.scrollCursorIntoView();
+ };
+
+ this.extendSelectionBy = function(unitName) {
+ var anchor, editor = this.editor;
+ var cursor = editor.renderer.screenToTextCoordinates(this.x, this.y);
+ var range = editor.selection[unitName](cursor.row, cursor.column);
+
+ if (this.$clickSelection) {
+ var cmpStart = this.$clickSelection.comparePoint(range.start);
+ var cmpEnd = this.$clickSelection.comparePoint(range.end);
+
+ if (cmpStart == -1 && cmpEnd <= 0) {
+ anchor = this.$clickSelection.end;
+ if (range.end.row != cursor.row || range.end.column != cursor.column)
+ cursor = range.start;
+ } else if (cmpEnd == 1 && cmpStart >= 0) {
+ anchor = this.$clickSelection.start;
+ if (range.start.row != cursor.row || range.start.column != cursor.column)
+ cursor = range.end;
+ } else if (cmpStart == -1 && cmpEnd == 1) {
+ cursor = range.end;
+ anchor = range.start;
+ } else {
+ var orientedRange = calcRangeOrientation(this.$clickSelection, cursor);
+ cursor = orientedRange.cursor;
+ anchor = orientedRange.anchor;
+ }
+ editor.selection.setSelectionAnchor(anchor.row, anchor.column);
+ }
+ editor.selection.selectToPosition(cursor);
+
+ editor.renderer.scrollCursorIntoView();
+ };
+
+ this.startDrag = function() {
+ var editor = this.editor;
+ this.setState("drag");
+ this.dragRange = editor.getSelectionRange();
+ var style = editor.getSelectionStyle();
+ this.dragSelectionMarker = editor.session.addMarker(this.dragRange, "ace_selection", style);
+ editor.clearSelection();
+ dom.addCssClass(editor.container, "ace_dragging");
+ if (!this.$dragKeybinding) {
+ this.$dragKeybinding = {
+ handleKeyboard: function(data, hashId, keyString, keyCode) {
+ if (keyString == "esc")
+ return {command: this.command};
+ },
+ command: {
+ exec: function(editor) {
+ var self = editor.$mouseHandler;
+ self.dragCursor = null;
+ self.dragEnd();
+ self.startSelect();
+ }
+ }
+ }
+ }
+
+ editor.keyBinding.addKeyboardHandler(this.$dragKeybinding);
+ };
+
+ this.focusWait = function() {
+ var distance = calcDistance(this.mousedownEvent.x, this.mousedownEvent.y, this.x, this.y);
+ var time = (new Date()).getTime();
+
+ if (distance > DRAG_OFFSET ||time - this.mousedownEvent.time > this.$focusWaitTimout)
+ this.startSelect();
+ };
+
+ this.dragWait = function(e) {
+ var distance = calcDistance(this.mousedownEvent.x, this.mousedownEvent.y, this.x, this.y);
+ var time = (new Date()).getTime();
+ var editor = this.editor;
+
+ if (distance > DRAG_OFFSET) {
+ this.startSelect(this.mousedownEvent.getDocumentPosition());
+ } else if (time - this.mousedownEvent.time > editor.getDragDelay()) {
+ this.startDrag();
+ }
+ };
+
+ this.dragWaitEnd = function(e) {
+ this.mousedownEvent.domEvent = e;
+ this.startSelect();
+ };
+
+ this.drag = function() {
+ var editor = this.editor;
+ this.dragCursor = editor.renderer.screenToTextCoordinates(this.x, this.y);
+ editor.moveCursorToPosition(this.dragCursor);
+ editor.renderer.scrollCursorIntoView();
+ };
+
+ this.dragEnd = function(e) {
+ var editor = this.editor;
+ var dragCursor = this.dragCursor;
+ var dragRange = this.dragRange;
+ dom.removeCssClass(editor.container, "ace_dragging");
+ editor.session.removeMarker(this.dragSelectionMarker);
+ editor.keyBinding.removeKeyboardHandler(this.$dragKeybinding);
+
+ if (!dragCursor)
+ return;
+
+ editor.clearSelection();
+ if (e && (e.ctrlKey || e.altKey)) {
+ var session = editor.session;
+ var newRange = dragRange;
+ newRange.end = session.insert(dragCursor, session.getTextRange(dragRange));
+ newRange.start = dragCursor;
+ } else if (dragRange.contains(dragCursor.row, dragCursor.column)) {
+ return;
+ } else {
+ var newRange = editor.moveText(dragRange, dragCursor);
+ }
+
+ if (!newRange)
+ return;
+
+ editor.selection.setSelectionRange(newRange);
+ };
+
+ this.onDoubleClick = function(ev) {
+ var pos = ev.getDocumentPosition();
+ var editor = this.editor;
+ var session = editor.session;
+
+ var range = session.getBracketRange(pos);
+ if (range) {
+ if (range.isEmpty()) {
+ range.start.column--;
+ range.end.column++;
+ }
+ this.$clickSelection = range;
+ this.setState("select");
+ return;
+ }
+
+ this.$clickSelection = editor.selection.getWordRange(pos.row, pos.column);
+ this.setState("selectByWords");
+ };
+
+ this.onTripleClick = function(ev) {
+ var pos = ev.getDocumentPosition();
+ var editor = this.editor;
+
+ this.setState("selectByLines");
+ this.$clickSelection = editor.selection.getLineRange(pos.row);
+ };
+
+ this.onQuadClick = function(ev) {
+ var editor = this.editor;
+
+ editor.selectAll();
+ this.$clickSelection = editor.getSelectionRange();
+ this.setState("null");
+ };
+
+ this.onMouseWheel = function(ev) {
+ if (ev.getShiftKey() || ev.getAccelKey()){
+ return;
+ }
+ var editor = this.editor;
+ var isScrolable = editor.renderer.isScrollableBy(ev.wheelX * ev.speed, ev.wheelY * ev.speed);
+ if (isScrolable) {
+ this.$passScrollEvent = false;
+ } else {
+ if (this.$passScrollEvent)
+ return;
+
+ if (!this.$scrollStopTimeout) {
+ var self = this;
+ this.$scrollStopTimeout = setTimeout(function() {
+ self.$passScrollEvent = true;
+ self.$scrollStopTimeout = null;
+ }, 200);
+ }
+ }
+
+ editor.renderer.scrollBy(ev.wheelX * ev.speed, ev.wheelY * ev.speed);
+ return ev.preventDefault();
+ };
+
+}).call(DefaultHandlers.prototype);
+
+exports.DefaultHandlers = DefaultHandlers;
+
+function calcDistance(ax, ay, bx, by) {
+ return Math.sqrt(Math.pow(bx - ax, 2) + Math.pow(by - ay, 2));
+}
+
+function calcRangeOrientation(range, cursor) {
+ if (range.start.row == range.end.row)
+ var cmp = 2 * cursor.column - range.start.column - range.end.column;
+ else
+ var cmp = 2 * cursor.row - range.start.row - range.end.row;
+
+ if (cmp < 0)
+ return {cursor: range.start, anchor: range.end};
+ else
+ return {cursor: range.end, anchor: range.start};
+}
+
+});
+
+ace.define('ace/mouse/default_gutter_handler', ['require', 'exports', 'module' , 'ace/lib/dom', 'ace/lib/event'], function(require, exports, module) {
+
+var dom = require("../lib/dom");
+var event = require("../lib/event");
+
+function GutterHandler(mouseHandler) {
+ var editor = mouseHandler.editor;
+ var gutter = editor.renderer.$gutterLayer;
+
+ mouseHandler.editor.setDefaultHandler("guttermousedown", function(e) {
+ if (!editor.isFocused())
+ return;
+ var gutterRegion = gutter.getRegion(e);
+
+ if (gutterRegion)
+ return;
+
+ var row = e.getDocumentPosition().row;
+ var selection = editor.session.selection;
+
+ if (e.getShiftKey())
+ selection.selectTo(row, 0);
+ else
+ mouseHandler.$clickSelection = editor.selection.getLineRange(row);
+
+ mouseHandler.captureMouse(e, "selectByLines");
+ return e.preventDefault();
+ });
+
+
+ var tooltipTimeout, mouseEvent, tooltip, tooltipAnnotation;
+ function createTooltip() {
+ tooltip = dom.createElement("div");
+ tooltip.className = "ace_gutter_tooltip";
+ tooltip.style.maxWidth = "500px";
+ tooltip.style.display = "none";
+ editor.container.appendChild(tooltip);
+ }
+
+ function showTooltip() {
+ if (!tooltip) {
+ createTooltip();
+ }
+ var row = mouseEvent.getDocumentPosition().row;
+ var annotation = gutter.$annotations[row];
+ if (!annotation)
+ return hideTooltip();
+
+ var maxRow = editor.session.getLength();
+ if (row == maxRow) {
+ var screenRow = editor.renderer.pixelToScreenCoordinates(0, mouseEvent.y).row;
+ var pos = mouseEvent.$pos;
+ if (screenRow > editor.session.documentToScreenRow(pos.row, pos.column))
+ return hideTooltip();
+ }
+
+ if (tooltipAnnotation == annotation)
+ return;
+ tooltipAnnotation = annotation.text.join("\n");
+
+ tooltip.style.display = "block";
+ tooltip.innerHTML = tooltipAnnotation;
+ editor.on("mousewheel", hideTooltip);
+
+ moveTooltip(mouseEvent);
+ }
+
+ function hideTooltip() {
+ if (tooltipTimeout)
+ tooltipTimeout = clearTimeout(tooltipTimeout);
+ if (tooltipAnnotation) {
+ tooltip.style.display = "none";
+ tooltipAnnotation = null;
+ editor.removeEventListener("mousewheel", hideTooltip);
+ }
+ }
+
+ function moveTooltip(e) {
+ var rect = editor.renderer.$gutter.getBoundingClientRect();
+ tooltip.style.left = e.x - rect.left + 15 + "px";
+ if (e.y + 3 * editor.renderer.lineHeight + 15 < rect.bottom) {
+ tooltip.style.bottom = "";
+ tooltip.style.top = e.y - rect.top + 15 + "px";
+ } else {
+ tooltip.style.top = "";
+ tooltip.style.bottom = rect.bottom - e.y + 5 + "px";
+ }
+ }
+
+ mouseHandler.editor.setDefaultHandler("guttermousemove", function(e) {
+ var target = e.domEvent.target || e.domEvent.srcElement;
+ if (dom.hasCssClass(target, "ace_fold-widget"))
+ return hideTooltip();
+
+ if (tooltipAnnotation)
+ moveTooltip(e);
+
+ mouseEvent = e;
+ if (tooltipTimeout)
+ return;
+ tooltipTimeout = setTimeout(function() {
+ tooltipTimeout = null;
+ if (mouseEvent)
+ showTooltip();
+ else
+ hideTooltip();
+ }, 50);
+ });
+
+ event.addListener(editor.renderer.$gutter, "mouseout", function(e) {
+ mouseEvent = null;
+ if (!tooltipAnnotation || tooltipTimeout)
+ return;
+
+ tooltipTimeout = setTimeout(function() {
+ tooltipTimeout = null;
+ hideTooltip();
+ }, 50);
+ });
+
+}
+
+exports.GutterHandler = GutterHandler;
+
+});
+
+ace.define('ace/mouse/mouse_event', ['require', 'exports', 'module' , 'ace/lib/event', 'ace/lib/useragent'], function(require, exports, module) {
+
+
+var event = require("../lib/event");
+var useragent = require("../lib/useragent");
+var MouseEvent = exports.MouseEvent = function(domEvent, editor) {
+ this.domEvent = domEvent;
+ this.editor = editor;
+
+ this.x = this.clientX = domEvent.clientX;
+ this.y = this.clientY = domEvent.clientY;
+
+ this.$pos = null;
+ this.$inSelection = null;
+
+ this.propagationStopped = false;
+ this.defaultPrevented = false;
+};
+
+(function() {
+
+ this.stopPropagation = function() {
+ event.stopPropagation(this.domEvent);
+ this.propagationStopped = true;
+ };
+
+ this.preventDefault = function() {
+ event.preventDefault(this.domEvent);
+ this.defaultPrevented = true;
+ };
+
+ this.stop = function() {
+ this.stopPropagation();
+ this.preventDefault();
+ };
+ this.getDocumentPosition = function() {
+ if (this.$pos)
+ return this.$pos;
+
+ this.$pos = this.editor.renderer.screenToTextCoordinates(this.clientX, this.clientY);
+ return this.$pos;
+ };
+ this.inSelection = function() {
+ if (this.$inSelection !== null)
+ return this.$inSelection;
+
+ var editor = this.editor;
+
+ if (editor.getReadOnly()) {
+ this.$inSelection = false;
+ }
+ else {
+ var selectionRange = editor.getSelectionRange();
+ if (selectionRange.isEmpty())
+ this.$inSelection = false;
+ else {
+ var pos = this.getDocumentPosition();
+ this.$inSelection = selectionRange.contains(pos.row, pos.column);
+ }
+ }
+ return this.$inSelection;
+ };
+ this.getButton = function() {
+ return event.getButton(this.domEvent);
+ };
+ this.getShiftKey = function() {
+ return this.domEvent.shiftKey;
+ };
+
+ this.getAccelKey = useragent.isMac
+ ? function() { return this.domEvent.metaKey; }
+ : function() { return this.domEvent.ctrlKey; };
+
+}).call(MouseEvent.prototype);
+
+});
+
+ace.define('ace/mouse/dragdrop', ['require', 'exports', 'module' , 'ace/lib/event'], function(require, exports, module) {
+
+
+var event = require("../lib/event");
+
+var DragdropHandler = function(mouseHandler) {
+ var editor = mouseHandler.editor;
+ var dragSelectionMarker, x, y;
+ var timerId, range, isBackwards;
+ var dragCursor, counter = 0;
+
+ var mouseTarget = editor.container;
+ event.addListener(mouseTarget, "dragenter", function(e) {
+ counter++;
+ if (!dragSelectionMarker) {
+ range = editor.getSelectionRange();
+ isBackwards = editor.selection.isBackwards();
+ var style = editor.getSelectionStyle();
+ dragSelectionMarker = editor.session.addMarker(range, "ace_selection", style);
+ editor.clearSelection();
+ clearInterval(timerId);
+ timerId = setInterval(onDragInterval, 20);
+ }
+ return event.preventDefault(e);
+ });
+
+ event.addListener(mouseTarget, "dragover", function(e) {
+ x = e.clientX;
+ y = e.clientY;
+ return event.preventDefault(e);
+ });
+
+ var onDragInterval = function() {
+ dragCursor = editor.renderer.screenToTextCoordinates(x, y);
+ editor.moveCursorToPosition(dragCursor);
+ editor.renderer.scrollCursorIntoView();
+ };
+
+ event.addListener(mouseTarget, "dragleave", function(e) {
+ counter--;
+ if (counter > 0)
+ return;
+ console.log(e.type, counter,e.target);
+ clearInterval(timerId);
+ editor.session.removeMarker(dragSelectionMarker);
+ dragSelectionMarker = null;
+ editor.selection.setSelectionRange(range, isBackwards);
+ return event.preventDefault(e);
+ });
+
+ event.addListener(mouseTarget, "drop", function(e) {
+ console.log(e.type, counter,e.target);
+ counter = 0;
+ clearInterval(timerId);
+ editor.session.removeMarker(dragSelectionMarker);
+ dragSelectionMarker = null;
+
+ range.end = editor.session.insert(dragCursor, e.dataTransfer.getData('Text'));
+ range.start = dragCursor;
+ editor.focus();
+ editor.selection.setSelectionRange(range);
+ return event.preventDefault(e);
+ });
+
+};
+
+exports.DragdropHandler = DragdropHandler;
+});
+
+ace.define('ace/mouse/fold_handler', ['require', 'exports', 'module' ], function(require, exports, module) {
+
+
+function FoldHandler(editor) {
+
+ editor.on("click", function(e) {
+ var position = e.getDocumentPosition();
+ var session = editor.session;
+
+ // If the user clicked on a fold, then expand it.
+ var fold = session.getFoldAt(position.row, position.column, 1);
+ if (fold) {
+ if (e.getAccelKey())
+ session.removeFold(fold);
+ else
+ session.expandFold(fold);
+
+ e.stop();
+ }
+ });
+
+ editor.on("gutterclick", function(e) {
+ var gutterRegion = editor.renderer.$gutterLayer.getRegion(e);
+
+ if (gutterRegion == "foldWidgets") {
+ var row = e.getDocumentPosition().row;
+ var session = editor.session;
+ if (session.foldWidgets && session.foldWidgets[row])
+ editor.session.onFoldWidgetClick(row, e);
+ e.stop();
+ }
+ });
+}
+
+exports.FoldHandler = FoldHandler;
+
+});
+
+ace.define('ace/keyboard/keybinding', ['require', 'exports', 'module' , 'ace/lib/keys', 'ace/lib/event'], function(require, exports, module) {
+
+
+var keyUtil = require("../lib/keys");
+var event = require("../lib/event");
+
+var KeyBinding = function(editor) {
+ this.$editor = editor;
+ this.$data = { };
+ this.$handlers = [];
+ this.setDefaultHandler(editor.commands);
+};
+
+(function() {
+ this.setDefaultHandler = function(kb) {
+ this.removeKeyboardHandler(this.$defaultHandler);
+ this.$defaultHandler = kb;
+ this.addKeyboardHandler(kb, 0);
+ this.$data = {editor: this.$editor};
+ };
+
+ this.setKeyboardHandler = function(kb) {
+ if (this.$handlers[this.$handlers.length - 1] == kb)
+ return;
+
+ while (this.$handlers[1])
+ this.removeKeyboardHandler(this.$handlers[1]);
+
+ this.addKeyboardHandler(kb, 1);
+ };
+
+ this.addKeyboardHandler = function(kb, pos) {
+ if (!kb)
+ return;
+ var i = this.$handlers.indexOf(kb);
+ if (i != -1)
+ this.$handlers.splice(i, 1);
+
+ if (pos == undefined)
+ this.$handlers.push(kb);
+ else
+ this.$handlers.splice(pos, 0, kb);
+
+ if (i == -1 && kb.attach)
+ kb.attach(this.$editor);
+ };
+
+ this.removeKeyboardHandler = function(kb) {
+ var i = this.$handlers.indexOf(kb);
+ if (i == -1)
+ return false;
+ this.$handlers.splice(i, 1);
+ kb.detach && kb.detach(this.$editor);
+ return true;
+ };
+
+ this.getKeyboardHandler = function() {
+ return this.$handlers[this.$handlers.length - 1];
+ };
+
+ this.$callKeyboardHandlers = function (hashId, keyString, keyCode, e) {
+ var toExecute;
+ for (var i = this.$handlers.length; i--;) {
+ toExecute = this.$handlers[i].handleKeyboard(
+ this.$data, hashId, keyString, keyCode, e
+ );
+ if (toExecute && toExecute.command)
+ break;
+ }
+
+ if (!toExecute || !toExecute.command)
+ return false;
+
+ var success = false;
+ var commands = this.$editor.commands;
+
+ // allow keyboardHandler to consume keys
+ if (toExecute.command != "null")
+ success = commands.exec(toExecute.command, this.$editor, toExecute.args, e);
+ else
+ success = toExecute.passEvent != true;
+
+ // do not stop input events to not break repeating
+ if (success && e && hashId != -1)
+ event.stopEvent(e);
+
+ return success;
+ };
+
+ this.onCommandKey = function(e, hashId, keyCode) {
+ var keyString = keyUtil.keyCodeToString(keyCode);
+ this.$callKeyboardHandlers(hashId, keyString, keyCode, e);
+ };
+
+ this.onTextInput = function(text) {
+ var success = this.$callKeyboardHandlers(-1, text);
+ if (!success)
+ this.$editor.commands.exec("insertstring", this.$editor, text);
+ };
+
+}).call(KeyBinding.prototype);
+
+exports.KeyBinding = KeyBinding;
+});
+
+ace.define('ace/edit_session', ['require', 'exports', 'module' , 'ace/config', 'ace/lib/oop', 'ace/lib/lang', 'ace/lib/net', 'ace/lib/event_emitter', 'ace/selection', 'ace/mode/text', 'ace/range', 'ace/document', 'ace/background_tokenizer', 'ace/search_highlight', 'ace/edit_session/folding', 'ace/edit_session/bracket_match'], function(require, exports, module) {
+
+
+var config = require("./config");
+var oop = require("./lib/oop");
+var lang = require("./lib/lang");
+var net = require("./lib/net");
+var EventEmitter = require("./lib/event_emitter").EventEmitter;
+var Selection = require("./selection").Selection;
+var TextMode = require("./mode/text").Mode;
+var Range = require("./range").Range;
+var Document = require("./document").Document;
+var BackgroundTokenizer = require("./background_tokenizer").BackgroundTokenizer;
+var SearchHighlight = require("./search_highlight").SearchHighlight;
+
+// events
+/**
+ * EditSession@change(e)
+ * - e (Object): An object containing a `delta` of information about the change.
+ *
+ * Emitted when the document changes.
+ **/
+/**
+ * EditSession@changeTabSize()
+ *
+ * Emitted when the tab size changes, via [[EditSession.setTabSize]].
+ **/
+/**
+ * EditSession@changeOverwrite()
+ *
+ * Emitted when the ability to overwrite text changes, via [[EditSession.setOverwrite]].
+ **/
+/**
+ * EditSession@changeBreakpoint()
+ *
+ * Emitted when the gutter changes, either by setting or removing breakpoints, or when the gutter decorations change.
+ **/
+/**
+ * EditSession@changeFrontMarker()
+ *
+ * Emitted when a front marker changes.
+ **/
+/**
+ * EditSession@changeBackMarker()
+ *
+ * Emitted when a back marker changes.
+ **/
+/**
+ * EditSession@changeAnnotation()
+ *
+ * Emitted when an annotation changes, like through [[EditSession.setAnnotations]].
+ **/
+/**
+ * EditSession@tokenizerUpdate(e)
+ * - e (Object): An object containing one property, `"data"`, that contains information about the changing rows
+ *
+ * Emitted when a background tokenizer asynchronously processes new rows.
+ *
+ **/
+/** hide
+ * EditSession@loadMode(e)
+ *
+ *
+ *
+ **/
+/**
+ * EditSession@changeMode()
+ *
+ * Emitted when the current mode changes.
+ *
+ **/
+/**
+ * EditSession@changeWrapMode()
+ *
+ * Emitted when the wrap mode changes.
+ *
+ **/
+/**
+ * EditSession@changeWrapLimit()
+ *
+ * Emitted when the wrapping limit changes.
+ *
+ **/
+/**
+ * EditSession@changeFold(e)
+ *
+ * Emitted when a code fold is added or removed.
+ *
+ **/
+ /**
+ * EditSession@changeScrollTop(scrollTop)
+ * - scrollTop (Number): The new scroll top value
+ *
+ * Emitted when the scroll top changes.
+ **/
+/**
+ * EditSession@changeScrollLeft(scrollLeft)
+ * - scrollLeft (Number): The new scroll left value
+ *
+ * Emitted when the scroll left changes.
+ **/
+
+
+/**
+ * new EditSession(text, mode)
+ * - text (Document | String): If `text` is a `Document`, it associates the `EditSession` with it. Otherwise, a new `Document` is created, with the initial text
+ * - mode (TextMode): The inital language mode to use for the document
+ *
+ * Sets up a new `EditSession` and associates it with the given `Document` and `TextMode`.
+ *
+ **/
+
+var EditSession = function(text, mode) {
+ this.$modified = true;
+ this.$breakpoints = [];
+ this.$decorations = [];
+ this.$frontMarkers = {};
+ this.$backMarkers = {};
+ this.$markerId = 1;
+ this.$resetRowCache(0);
+ this.$wrapData = [];
+ this.$foldData = [];
+ this.$rowLengthCache = [];
+ this.$undoSelect = true;
+ this.$foldData.toString = function() {
+ var str = "";
+ this.forEach(function(foldLine) {
+ str += "\n" + foldLine.toString();
+ });
+ return str;
+ }
+
+ if (typeof text == "object" && text.getLine) {
+ this.setDocument(text);
+ } else {
+ this.setDocument(new Document(text));
+ }
+
+ this.selection = new Selection(this);
+ this.setMode(mode);
+};
+
+
+(function() {
+
+ oop.implement(this, EventEmitter);
+ this.setDocument = function(doc) {
+ if (this.doc)
+ throw new Error("Document is already set");
+
+ this.doc = doc;
+ doc.on("change", this.onChange.bind(this));
+ this.on("changeFold", this.onChangeFold.bind(this));
+
+ if (this.bgTokenizer) {
+ this.bgTokenizer.setDocument(this.getDocument());
+ this.bgTokenizer.start(0);
+ }
+ };
+ this.getDocument = function() {
+ return this.doc;
+ };
+ this.$resetRowCache = function(docRow) {
+ if (!docRow) {
+ this.$docRowCache = [];
+ this.$screenRowCache = [];
+ return;
+ }
+
+ var i = this.$getRowCacheIndex(this.$docRowCache, docRow) + 1;
+ var l = this.$docRowCache.length;
+ this.$docRowCache.splice(i, l);
+ this.$screenRowCache.splice(i, l);
+
+ };
+
+ this.$getRowCacheIndex = function(cacheArray, val) {
+ var low = 0;
+ var hi = cacheArray.length - 1;
+
+ while (low <= hi) {
+ var mid = (low + hi) >> 1;
+ var c = cacheArray[mid];
+
+ if (val > c)
+ low = mid + 1;
+ else if (val < c)
+ hi = mid - 1;
+ else
+ return mid;
+ }
+
+ return low && low -1;
+ };
+
+ this.onChangeFold = function(e) {
+ var fold = e.data;
+ this.$resetRowCache(fold.start.row);
+ };
+
+ this.onChange = function(e) {
+ var delta = e.data;
+ this.$modified = true;
+
+ this.$resetRowCache(delta.range.start.row);
+
+ var removedFolds = this.$updateInternalDataOnChange(e);
+ if (!this.$fromUndo && this.$undoManager && !delta.ignore) {
+ this.$deltasDoc.push(delta);
+ if (removedFolds && removedFolds.length != 0) {
+ this.$deltasFold.push({
+ action: "removeFolds",
+ folds: removedFolds
+ });
+ }
+
+ this.$informUndoManager.schedule();
+ }
+
+ this.bgTokenizer.$updateOnChange(delta);
+ this._emit("change", e);
+ };
+ this.setValue = function(text) {
+ this.doc.setValue(text);
+ this.selection.moveCursorTo(0, 0);
+ this.selection.clearSelection();
+
+ this.$resetRowCache(0);
+ this.$deltas = [];
+ this.$deltasDoc = [];
+ this.$deltasFold = [];
+ this.getUndoManager().reset();
+ };
+ /** alias of: EditSession.getValue
+ * EditSession.toString() -> String
+ *
+ * Returns the current [[Document `Document`]] as a string.
+ *
+ **/
+ this.getValue =
+ this.toString = function() {
+ return this.doc.getValue();
+ };
+ this.getSelection = function() {
+ return this.selection;
+ };
+ this.getState = function(row) {
+ return this.bgTokenizer.getState(row);
+ };
+ this.getTokens = function(row) {
+ return this.bgTokenizer.getTokens(row);
+ };
+ this.getTokenAt = function(row, column) {
+ var tokens = this.bgTokenizer.getTokens(row);
+ var token, c = 0;
+ if (column == null) {
+ i = tokens.length - 1;
+ c = this.getLine(row).length;
+ } else {
+ for (var i = 0; i < tokens.length; i++) {
+ c += tokens[i].value.length;
+ if (c >= column)
+ break;
+ }
+ }
+ token = tokens[i];
+ if (!token)
+ return null;
+ token.index = i;
+ token.start = c - token.value.length;
+ return token;
+ };
+
+ this.highlight = function(re) {
+ if (!this.$searchHighlight) {
+ var highlight = new SearchHighlight(null, "ace_selected_word", "text");
+ this.$searchHighlight = this.addDynamicMarker(highlight);
+ }
+ this.$searchHighlight.setRegexp(re);
+ }
+ /**
+ * EditSession.setUndoManager(undoManager)
+ * - undoManager (UndoManager): The new undo manager
+ *
+ * Sets the undo manager.
+ **/
+ this.setUndoManager = function(undoManager) {
+ this.$undoManager = undoManager;
+ this.$deltas = [];
+ this.$deltasDoc = [];
+ this.$deltasFold = [];
+
+ if (this.$informUndoManager)
+ this.$informUndoManager.cancel();
+
+ if (undoManager) {
+ var self = this;
+ this.$syncInformUndoManager = function() {
+ self.$informUndoManager.cancel();
+
+ if (self.$deltasFold.length) {
+ self.$deltas.push({
+ group: "fold",
+ deltas: self.$deltasFold
+ });
+ self.$deltasFold = [];
+ }
+
+ if (self.$deltasDoc.length) {
+ self.$deltas.push({
+ group: "doc",
+ deltas: self.$deltasDoc
+ });
+ self.$deltasDoc = [];
+ }
+
+ if (self.$deltas.length > 0) {
+ undoManager.execute({
+ action: "aceupdate",
+ args: [self.$deltas, self]
+ });
+ }
+
+ self.$deltas = [];
+ }
+ this.$informUndoManager =
+ lang.deferredCall(this.$syncInformUndoManager);
+ }
+ };
+
+ this.$defaultUndoManager = {
+ undo: function() {},
+ redo: function() {},
+ reset: function() {}
+ };
+ this.getUndoManager = function() {
+ return this.$undoManager || this.$defaultUndoManager;
+ },
+
+ /**
+ * EditSession.getTabString() -> String
+ *
+ * Returns the current value for tabs. If the user is using soft tabs, this will be a series of spaces (defined by [[EditSession.getTabSize `getTabSize()`]]); otherwise it's simply `'\t'`.
+ **/
+ this.getTabString = function() {
+ if (this.getUseSoftTabs()) {
+ return lang.stringRepeat(" ", this.getTabSize());
+ } else {
+ return "\t";
+ }
+ };
+
+ this.$useSoftTabs = true;
+ this.setUseSoftTabs = function(useSoftTabs) {
+ if (this.$useSoftTabs === useSoftTabs) return;
+
+ this.$useSoftTabs = useSoftTabs;
+ };
+ this.getUseSoftTabs = function() {
+ return this.$useSoftTabs;
+ };
+
+ this.$tabSize = 4;
+ this.setTabSize = function(tabSize) {
+ if (isNaN(tabSize) || this.$tabSize === tabSize) return;
+
+ this.$modified = true;
+ this.$rowLengthCache = [];
+ this.$tabSize = tabSize;
+ this._emit("changeTabSize");
+ };
+ this.getTabSize = function() {
+ return this.$tabSize;
+ };
+ this.isTabStop = function(position) {
+ return this.$useSoftTabs && (position.column % this.$tabSize == 0);
+ };
+
+ this.$overwrite = false;
+ this.setOverwrite = function(overwrite) {
+ if (this.$overwrite == overwrite) return;
+
+ this.$overwrite = overwrite;
+ this._emit("changeOverwrite");
+ };
+ this.getOverwrite = function() {
+ return this.$overwrite;
+ };
+ this.toggleOverwrite = function() {
+ this.setOverwrite(!this.$overwrite);
+ };
+ this.addGutterDecoration = function(row, className) {
+ if (!this.$decorations[row])
+ this.$decorations[row] = "";
+ this.$decorations[row] += " " + className;
+ this._emit("changeBreakpoint", {});
+ };
+ this.removeGutterDecoration = function(row, className) {
+ this.$decorations[row] = (this.$decorations[row] || "").replace(" " + className, "");
+ this._emit("changeBreakpoint", {});
+ };
+ this.getBreakpoints = function() {
+ return this.$breakpoints;
+ };
+ this.setBreakpoints = function(rows) {
+ this.$breakpoints = [];
+ for (var i=0; i<rows.length; i++) {
+ this.$breakpoints[rows[i]] = "ace_breakpoint";
+ }
+ this._emit("changeBreakpoint", {});
+ };
+ this.clearBreakpoints = function() {
+ this.$breakpoints = [];
+ this._emit("changeBreakpoint", {});
+ };
+ this.setBreakpoint = function(row, className) {
+ if (className === undefined)
+ className = "ace_breakpoint";
+ if (className)
+ this.$breakpoints[row] = className;
+ else
+ delete this.$breakpoints[row];
+ this._emit("changeBreakpoint", {});
+ };
+ this.clearBreakpoint = function(row) {
+ delete this.$breakpoints[row];
+ this._emit("changeBreakpoint", {});
+ };
+ this.addMarker = function(range, clazz, type, inFront) {
+ var id = this.$markerId++;
+
+ var marker = {
+ range : range,
+ type : type || "line",
+ renderer: typeof type == "function" ? type : null,
+ clazz : clazz,
+ inFront: !!inFront,
+ id: id
+ }
+
+ if (inFront) {
+ this.$frontMarkers[id] = marker;
+ this._emit("changeFrontMarker")
+ } else {
+ this.$backMarkers[id] = marker;
+ this._emit("changeBackMarker")
+ }
+
+ return id;
+ };
+ this.addDynamicMarker = function(marker, inFront) {
+ if (!marker.update)
+ return;
+ var id = this.$markerId++;
+ marker.id = id;
+ marker.inFront = !!inFront;
+
+ if (inFront) {
+ this.$frontMarkers[id] = marker;
+ this._emit("changeFrontMarker")
+ } else {
+ this.$backMarkers[id] = marker;
+ this._emit("changeBackMarker")
+ }
+
+ return marker;
+ };
+ this.removeMarker = function(markerId) {
+ var marker = this.$frontMarkers[markerId] || this.$backMarkers[markerId];
+ if (!marker)
+ return;
+
+ var markers = marker.inFront ? this.$frontMarkers : this.$backMarkers;
+ if (marker) {
+ delete (markers[markerId]);
+ this._emit(marker.inFront ? "changeFrontMarker" : "changeBackMarker");
+ }
+ };
+ this.getMarkers = function(inFront) {
+ return inFront ? this.$frontMarkers : this.$backMarkers;
+ };
+ /**
+ * EditSession.setAnnotations(annotations)
+ * - annotations (Array): A list of annotations
+ *
+ * Sets annotations for the `EditSession`. This functions emits the `'changeAnnotation'` event.
+ **/
+ this.setAnnotations = function(annotations) {
+ this.$annotations = {};
+ for (var i=0; i<annotations.length; i++) {
+ var annotation = annotations[i];
+ var row = annotation.row;
+ if (this.$annotations[row])
+ this.$annotations[row].push(annotation);
+ else
+ this.$annotations[row] = [annotation];
+ }
+ this._emit("changeAnnotation", {});
+ };
+ this.getAnnotations = function() {
+ return this.$annotations || {};
+ };
+ this.clearAnnotations = function() {
+ this.$annotations = {};
+ this._emit("changeAnnotation", {});
+ };
+ this.$detectNewLine = function(text) {
+ var match = text.match(/^.*?(\r?\n)/m);
+ if (match) {
+ this.$autoNewLine = match[1];
+ } else {
+ this.$autoNewLine = "\n";
+ }
+ };
+ this.getWordRange = function(row, column) {
+ var line = this.getLine(row);
+
+ var inToken = false;
+ if (column > 0)
+ inToken = !!line.charAt(column - 1).match(this.tokenRe);
+
+ if (!inToken)
+ inToken = !!line.charAt(column).match(this.tokenRe);
+
+ if (inToken)
+ var re = this.tokenRe;
+ else if (/^\s+$/.test(line.slice(column-1, column+1)))
+ var re = /\s/;
+ else
+ var re = this.nonTokenRe;
+
+ var start = column;
+ if (start > 0) {
+ do {
+ start--;
+ }
+ while (start >= 0 && line.charAt(start).match(re));
+ start++;
+ }
+
+ var end = column;
+ while (end < line.length && line.charAt(end).match(re)) {
+ end++;
+ }
+
+ return new Range(row, start, row, end);
+ };
+ this.getAWordRange = function(row, column) {
+ var wordRange = this.getWordRange(row, column);
+ var line = this.getLine(wordRange.end.row);
+
+ while (line.charAt(wordRange.end.column).match(/[ \t]/)) {
+ wordRange.end.column += 1;
+ }
+ return wordRange;
+ };
+ this.setNewLineMode = function(newLineMode) {
+ this.doc.setNewLineMode(newLineMode);
+ };
+ this.getNewLineMode = function() {
+ return this.doc.getNewLineMode();
+ };
+
+ this.$useWorker = true;
+ this.setUseWorker = function(useWorker) {
+ if (this.$useWorker == useWorker)
+ return;
+
+ this.$useWorker = useWorker;
+
+ this.$stopWorker();
+ if (useWorker)
+ this.$startWorker();
+ };
+ this.getUseWorker = function() {
+ return this.$useWorker;
+ };
+ this.onReloadTokenizer = function(e) {
+ var rows = e.data;
+ this.bgTokenizer.start(rows.first);
+ this._emit("tokenizerUpdate", e);
+ };
+
+ this.$modes = {};
+ this._loadMode = function(mode, callback) {
+ if (!this.$modes["null"])
+ this.$modes["null"] = this.$modes["ace/mode/text"] = new TextMode();
+
+ if (this.$modes[mode])
+ return callback(this.$modes[mode]);
+
+ var _self = this;
+ var module;
+ try {
+ module = require(mode);
+ } catch (e) {};
+ // sometimes require returns empty object (this bug is present in requirejs 2 as well)
+ if (module && module.Mode)
+ return done(module);
+
+ // set mode to text until loading is finished
+ if (!this.$mode)
+ this.$setModePlaceholder();
+
+ fetch(mode, function() {
+ require([mode], done);
+ });
+
+ function done(module) {
+ if (_self.$modes[mode])
+ return callback(_self.$modes[mode]);
+
+ _self.$modes[mode] = new module.Mode();
+ _self.$modes[mode].$id = mode;
+ _self._emit("loadmode", {
+ name: mode,
+ mode: _self.$modes[mode]
+ });
+ callback(_self.$modes[mode]);
+ }
+
+ function fetch(name, callback) {
+ if (!config.get("packaged"))
+ return callback();
+
+ net.loadScript(config.moduleUrl(name, "mode"), callback);
+ }
+ };
+
+ this.$setModePlaceholder = function() {
+ this.$mode = this.$modes["null"];
+ var tokenizer = this.$mode.getTokenizer();
+
+ if (!this.bgTokenizer) {
+ this.bgTokenizer = new BackgroundTokenizer(tokenizer);
+ var _self = this;
+ this.bgTokenizer.addEventListener("update", function(e) {
+ _self._emit("tokenizerUpdate", e);
+ });
+ } else {
+ this.bgTokenizer.setTokenizer(tokenizer);
+ }
+ this.bgTokenizer.setDocument(this.getDocument());
+
+ this.tokenRe = this.$mode.tokenRe;
+ this.nonTokenRe = this.$mode.nonTokenRe;
+ };
+ this.$mode = null;
+ this.$modeId = null;
+ this.setMode = function(mode) {
+ mode = mode || "null";
+ // load on demand
+ if (typeof mode === "string") {
+ if (this.$modeId == mode)
+ return;
+
+ this.$modeId = mode;
+ var _self = this;
+ this._loadMode(mode, function(module) {
+ if (_self.$modeId !== mode)
+ return;
+
+ _self.setMode(module);
+ });
+ return;
+ }
+
+ if (this.$mode === mode) return;
+ this.$mode = mode;
+ this.$modeId = mode.$id;
+
+ this.$stopWorker();
+
+ if (this.$useWorker)
+ this.$startWorker();
+
+ var tokenizer = mode.getTokenizer();
+
+ if(tokenizer.addEventListener !== undefined) {
+ var onReloadTokenizer = this.onReloadTokenizer.bind(this);
+ tokenizer.addEventListener("update", onReloadTokenizer);
+ }
+
+ if (!this.bgTokenizer) {
+ this.bgTokenizer = new BackgroundTokenizer(tokenizer);
+ var _self = this;
+ this.bgTokenizer.addEventListener("update", function(e) {
+ _self._emit("tokenizerUpdate", e);
+ });
+ } else {
+ this.bgTokenizer.setTokenizer(tokenizer);
+ }
+
+ this.bgTokenizer.setDocument(this.getDocument());
+ this.bgTokenizer.start(0);
+
+ this.tokenRe = mode.tokenRe;
+ this.nonTokenRe = mode.nonTokenRe;
+
+ this.$setFolding(mode.foldingRules);
+
+ this._emit("changeMode");
+ };
+ this.$stopWorker = function() {
+ if (this.$worker)
+ this.$worker.terminate();
+
+ this.$worker = null;
+ };
+ this.$startWorker = function() {
+ if (typeof Worker !== "undefined" && !require.noWorker) {
+ try {
+ this.$worker = this.$mode.createWorker(this);
+ } catch (e) {
+ console.log("Could not load worker");
+ console.log(e);
+ this.$worker = null;
+ }
+ }
+ else
+ this.$worker = null;
+ };
+ this.getMode = function() {
+ return this.$mode;
+ };
+
+ this.$scrollTop = 0;
+ this.setScrollTop = function(scrollTop) {
+ scrollTop = Math.round(Math.max(0, scrollTop));
+ if (this.$scrollTop === scrollTop)
+ return;
+
+ this.$scrollTop = scrollTop;
+ this._emit("changeScrollTop", scrollTop);
+ };
+ this.getScrollTop = function() {
+ return this.$scrollTop;
+ };
+
+ this.$scrollLeft = 0;
+ this.setScrollLeft = function(scrollLeft) {
+ scrollLeft = Math.round(Math.max(0, scrollLeft));
+ if (this.$scrollLeft === scrollLeft)
+ return;
+
+ this.$scrollLeft = scrollLeft;
+ this._emit("changeScrollLeft", scrollLeft);
+ };
+ this.getScrollLeft = function() {
+ return this.$scrollLeft;
+ };
+ this.getScreenWidth = function() {
+ this.$computeWidth();
+ return this.screenWidth;
+ };
+
+ this.$computeWidth = function(force) {
+ if (this.$modified || force) {
+ this.$modified = false;
+
+ if (this.$useWrapMode)
+ return this.screenWidth = this.$wrapLimit;
+
+ var lines = this.doc.getAllLines();
+ var cache = this.$rowLengthCache;
+ var longestScreenLine = 0;
+ var foldIndex = 0;
+ var foldLine = this.$foldData[foldIndex];
+ var foldStart = foldLine ? foldLine.start.row : Infinity;
+ var len = lines.length;
+
+ for (var i = 0; i < len; i++) {
+ if (i > foldStart) {
+ i = foldLine.end.row + 1;
+ if (i >= len)
+ break;
+ foldLine = this.$foldData[foldIndex++];
+ foldStart = foldLine ? foldLine.start.row : Infinity;
+ }
+
+ if (cache[i] == null)
+ cache[i] = this.$getStringScreenWidth(lines[i])[0];
+
+ if (cache[i] > longestScreenLine)
+ longestScreenLine = cache[i];
+ }
+ this.screenWidth = longestScreenLine;
+ }
+ };
+ this.getLine = function(row) {
+ return this.doc.getLine(row);
+ };
+ this.getLines = function(firstRow, lastRow) {
+ return this.doc.getLines(firstRow, lastRow);
+ };
+ this.getLength = function() {
+ return this.doc.getLength();
+ };
+ this.getTextRange = function(range) {
+ return this.doc.getTextRange(range || this.selection.getRange());
+ };
+ this.insert = function(position, text) {
+ return this.doc.insert(position, text);
+ };
+ this.remove = function(range) {
+ return this.doc.remove(range);
+ };
+ this.undoChanges = function(deltas, dontSelect) {
+ if (!deltas.length)
+ return;
+
+ this.$fromUndo = true;
+ var lastUndoRange = null;
+ for (var i = deltas.length - 1; i != -1; i--) {
+ var delta = deltas[i];
+ if (delta.group == "doc") {
+ this.doc.revertDeltas(delta.deltas);
+ lastUndoRange =
+ this.$getUndoSelection(delta.deltas, true, lastUndoRange);
+ } else {
+ delta.deltas.forEach(function(foldDelta) {
+ this.addFolds(foldDelta.folds);
+ }, this);
+ }
+ }
+ this.$fromUndo = false;
+ lastUndoRange &&
+ this.$undoSelect &&
+ !dontSelect &&
+ this.selection.setSelectionRange(lastUndoRange);
+ return lastUndoRange;
+ };
+ this.redoChanges = function(deltas, dontSelect) {
+ if (!deltas.length)
+ return;
+
+ this.$fromUndo = true;
+ var lastUndoRange = null;
+ for (var i = 0; i < deltas.length; i++) {
+ var delta = deltas[i];
+ if (delta.group == "doc") {
+ this.doc.applyDeltas(delta.deltas);
+ lastUndoRange =
+ this.$getUndoSelection(delta.deltas, false, lastUndoRange);
+ }
+ }
+ this.$fromUndo = false;
+ lastUndoRange &&
+ this.$undoSelect &&
+ !dontSelect &&
+ this.selection.setSelectionRange(lastUndoRange);
+ return lastUndoRange;
+ };
+ this.setUndoSelect = function(enable) {
+ this.$undoSelect = enable;
+ };
+ this.$getUndoSelection = function(deltas, isUndo, lastUndoRange) {
+ function isInsert(delta) {
+ var insert =
+ delta.action == "insertText" || delta.action == "insertLines";
+ return isUndo ? !insert : insert;
+ }
+
+ var delta = deltas[0];
+ var range, point;
+ var lastDeltaIsInsert = false;
+ if (isInsert(delta)) {
+ range = delta.range.clone();
+ lastDeltaIsInsert = true;
+ } else {
+ range = Range.fromPoints(delta.range.start, delta.range.start);
+ lastDeltaIsInsert = false;
+ }
+
+ for (var i = 1; i < deltas.length; i++) {
+ delta = deltas[i];
+ if (isInsert(delta)) {
+ point = delta.range.start;
+ if (range.compare(point.row, point.column) == -1) {
+ range.setStart(delta.range.start);
+ }
+ point = delta.range.end;
+ if (range.compare(point.row, point.column) == 1) {
+ range.setEnd(delta.range.end);
+ }
+ lastDeltaIsInsert = true;
+ } else {
+ point = delta.range.start;
+ if (range.compare(point.row, point.column) == -1) {
+ range =
+ Range.fromPoints(delta.range.start, delta.range.start);
+ }
+ lastDeltaIsInsert = false;
+ }
+ }
+
+ // Check if this range and the last undo range has something in common.
+ // If true, merge the ranges.
+ if (lastUndoRange != null) {
+ var cmp = lastUndoRange.compareRange(range);
+ if (cmp == 1) {
+ range.setStart(lastUndoRange.start);
+ } else if (cmp == -1) {
+ range.setEnd(lastUndoRange.end);
+ }
+ }
+
+ return range;
+ },
+
+ /** related to: Document.replace
+ * EditSession.replace(range, text) -> Object
+ * - range (Range): A specified Range to replace
+ * - text (String): The new text to use as a replacement
+ * + (Object): Returns an object containing the final row and column, like this:<br/>
+ * ```{row: endRow, column: 0}```<br/>
+ * If the text and range are empty, this function returns an object containing the current `range.start` value.<br/>
+ * If the text is the exact same as what currently exists, this function returns an object containing the current `range.end` value.
+ *
+ * Replaces a range in the document with the new `text`.
+ *
+ *
+ *
+ **/
+ this.replace = function(range, text) {
+ return this.doc.replace(range, text);
+ };
+ this.moveText = function(fromRange, toPosition) {
+ var text = this.getTextRange(fromRange);
+ this.remove(fromRange);
+
+ var toRow = toPosition.row;
+ var toColumn = toPosition.column;
+
+ // Make sure to update the insert location, when text is removed in
+ // front of the chosen point of insertion.
+ if (!fromRange.isMultiLine() && fromRange.start.row == toRow &&
+ fromRange.end.column < toColumn)
+ toColumn -= text.length;
+
+ if (fromRange.isMultiLine() && fromRange.end.row < toRow) {
+ var lines = this.doc.$split(text);
+ toRow -= lines.length - 1;
+ }
+
+ var endRow = toRow + fromRange.end.row - fromRange.start.row;
+ var endColumn = fromRange.isMultiLine() ?
+ fromRange.end.column :
+ toColumn + fromRange.end.column - fromRange.start.column;
+
+ var toRange = new Range(toRow, toColumn, endRow, endColumn);
+
+ this.insert(toRange.start, text);
+
+ return toRange;
+ };
+ this.indentRows = function(startRow, endRow, indentString) {
+ indentString = indentString.replace(/\t/g, this.getTabString());
+ for (var row=startRow; row<=endRow; row++)
+ this.insert({row: row, column:0}, indentString);
+ };
+ this.outdentRows = function (range) {
+ var rowRange = range.collapseRows();
+ var deleteRange = new Range(0, 0, 0, 0);
+ var size = this.getTabSize();
+
+ for (var i = rowRange.start.row; i <= rowRange.end.row; ++i) {
+ var line = this.getLine(i);
+
+ deleteRange.start.row = i;
+ deleteRange.end.row = i;
+ for (var j = 0; j < size; ++j)
+ if (line.charAt(j) != ' ')
+ break;
+ if (j < size && line.charAt(j) == '\t') {
+ deleteRange.start.column = j;
+ deleteRange.end.column = j + 1;
+ } else {
+ deleteRange.start.column = 0;
+ deleteRange.end.column = j;
+ }
+ this.remove(deleteRange);
+ }
+ };
+ this.moveLinesUp = function(firstRow, lastRow) {
+ if (firstRow <= 0) return 0;
+
+ var removed = this.doc.removeLines(firstRow, lastRow);
+ this.doc.insertLines(firstRow - 1, removed);
+ return -1;
+ };
+ this.moveLinesDown = function(firstRow, lastRow) {
+ if (lastRow >= this.doc.getLength()-1) return 0;
+
+ var removed = this.doc.removeLines(firstRow, lastRow);
+ this.doc.insertLines(firstRow+1, removed);
+ return 1;
+ };
+ this.duplicateLines = function(firstRow, lastRow) {
+ var firstRow = this.$clipRowToDocument(firstRow);
+ var lastRow = this.$clipRowToDocument(lastRow);
+
+ var lines = this.getLines(firstRow, lastRow);
+ this.doc.insertLines(firstRow, lines);
+
+ var addedRows = lastRow - firstRow + 1;
+ return addedRows;
+ };
+
+
+ this.$clipRowToDocument = function(row) {
+ return Math.max(0, Math.min(row, this.doc.getLength()-1));
+ };
+
+ this.$clipColumnToRow = function(row, column) {
+ if (column < 0)
+ return 0;
+ return Math.min(this.doc.getLine(row).length, column);
+ };
+
+
+ this.$clipPositionToDocument = function(row, column) {
+ column = Math.max(0, column);
+
+ if (row < 0) {
+ row = 0;
+ column = 0;
+ } else {
+ var len = this.doc.getLength();
+ if (row >= len) {
+ row = len - 1;
+ column = this.doc.getLine(len-1).length;
+ } else {
+ column = Math.min(this.doc.getLine(row).length, column);
+ }
+ }
+
+ return {
+ row: row,
+ column: column
+ };
+ };
+
+ this.$clipRangeToDocument = function(range) {
+ if (range.start.row < 0) {
+ range.start.row = 0;
+ range.start.column = 0;
+ } else {
+ range.start.column = this.$clipColumnToRow(
+ range.start.row,
+ range.start.column
+ );
+ }
+
+ var len = this.doc.getLength() - 1;
+ if (range.end.row > len) {
+ range.end.row = len;
+ range.end.column = this.doc.getLine(len).length;
+ } else {
+ range.end.column = this.$clipColumnToRow(
+ range.end.row,
+ range.end.column
+ );
+ }
+ return range;
+ };
+
+ // WRAPMODE
+ this.$wrapLimit = 80;
+ this.$useWrapMode = false;
+ this.$wrapLimitRange = {
+ min : null,
+ max : null
+ };
+ this.setUseWrapMode = function(useWrapMode) {
+ if (useWrapMode != this.$useWrapMode) {
+ this.$useWrapMode = useWrapMode;
+ this.$modified = true;
+ this.$resetRowCache(0);
+
+ // If wrapMode is activaed, the wrapData array has to be initialized.
+ if (useWrapMode) {
+ var len = this.getLength();
+ this.$wrapData = [];
+ for (var i = 0; i < len; i++) {
+ this.$wrapData.push([]);
+ }
+ this.$updateWrapData(0, len - 1);
+ }
+
+ this._emit("changeWrapMode");
+ }
+ };
+ this.getUseWrapMode = function() {
+ return this.$useWrapMode;
+ };
+
+ // Allow the wrap limit to move freely between min and max. Either
+ // parameter can be null to allow the wrap limit to be unconstrained
+ // in that direction. Or set both parameters to the same number to pin
+ // the limit to that value.
+ /**
+ * EditSession.setWrapLimitRange(min, max)
+ * - min (Number): The minimum wrap value (the left side wrap)
+ * - max (Number): The maximum wrap value (the right side wrap)
+ *
+ * Sets the boundaries of wrap. Either value can be `null` to have an unconstrained wrap, or, they can be the same number to pin the limit. If the wrap limits for `min` or `max` are different, this method also emits the `'changeWrapMode'` event.
+ **/
+ this.setWrapLimitRange = function(min, max) {
+ if (this.$wrapLimitRange.min !== min || this.$wrapLimitRange.max !== max) {
+ this.$wrapLimitRange.min = min;
+ this.$wrapLimitRange.max = max;
+ this.$modified = true;
+ // This will force a recalculation of the wrap limit
+ this._emit("changeWrapMode");
+ }
+ };
+ this.adjustWrapLimit = function(desiredLimit) {
+ var wrapLimit = this.$constrainWrapLimit(desiredLimit);
+ if (wrapLimit != this.$wrapLimit && wrapLimit > 0) {
+ this.$wrapLimit = wrapLimit;
+ this.$modified = true;
+ if (this.$useWrapMode) {
+ this.$updateWrapData(0, this.getLength() - 1);
+ this.$resetRowCache(0);
+ this._emit("changeWrapLimit");
+ }
+ return true;
+ }
+ return false;
+ };
+ this.$constrainWrapLimit = function(wrapLimit) {
+ var min = this.$wrapLimitRange.min;
+ if (min)
+ wrapLimit = Math.max(min, wrapLimit);
+
+ var max = this.$wrapLimitRange.max;
+ if (max)
+ wrapLimit = Math.min(max, wrapLimit);
+
+ // What would a limit of 0 even mean?
+ return Math.max(1, wrapLimit);
+ };
+ this.getWrapLimit = function() {
+ return this.$wrapLimit;
+ };
+ this.getWrapLimitRange = function() {
+ // Avoid unexpected mutation by returning a copy
+ return {
+ min : this.$wrapLimitRange.min,
+ max : this.$wrapLimitRange.max
+ };
+ };
+ this.$updateInternalDataOnChange = function(e) {
+ var useWrapMode = this.$useWrapMode;
+ var len;
+ var action = e.data.action;
+ var firstRow = e.data.range.start.row;
+ var lastRow = e.data.range.end.row;
+ var start = e.data.range.start;
+ var end = e.data.range.end;
+ var removedFolds = null;
+
+ if (action.indexOf("Lines") != -1) {
+ if (action == "insertLines") {
+ lastRow = firstRow + (e.data.lines.length);
+ } else {
+ lastRow = firstRow;
+ }
+ len = e.data.lines ? e.data.lines.length : lastRow - firstRow;
+ } else {
+ len = lastRow - firstRow;
+ }
+
+ if (len != 0) {
+ if (action.indexOf("remove") != -1) {
+ this[useWrapMode ? "$wrapData" : "$rowLengthCache"].splice(firstRow, len);
+
+ var foldLines = this.$foldData;
+ removedFolds = this.getFoldsInRange(e.data.range);
+ this.removeFolds(removedFolds);
+
+ var foldLine = this.getFoldLine(end.row);
+ var idx = 0;
+ if (foldLine) {
+ foldLine.addRemoveChars(end.row, end.column, start.column - end.column);
+ foldLine.shiftRow(-len);
+
+ var foldLineBefore = this.getFoldLine(firstRow);
+ if (foldLineBefore && foldLineBefore !== foldLine) {
+ foldLineBefore.merge(foldLine);
+ foldLine = foldLineBefore;
+ }
+ idx = foldLines.indexOf(foldLine) + 1;
+ }
+
+ for (idx; idx < foldLines.length; idx++) {
+ var foldLine = foldLines[idx];
+ if (foldLine.start.row >= end.row) {
+ foldLine.shiftRow(-len);
+ }
+ }
+
+ lastRow = firstRow;
+ } else {
+ var args;
+ if (useWrapMode) {
+ args = [firstRow, 0];
+ for (var i = 0; i < len; i++) args.push([]);
+ this.$wrapData.splice.apply(this.$wrapData, args);
+ } else {
+ args = Array(len);
+ args.unshift(firstRow, 0);
+ this.$rowLengthCache.splice.apply(this.$rowLengthCache, args);
+ }
+
+ // If some new line is added inside of a foldLine, then split
+ // the fold line up.
+ var foldLines = this.$foldData;
+ var foldLine = this.getFoldLine(firstRow);
+ var idx = 0;
+ if (foldLine) {
+ var cmp = foldLine.range.compareInside(start.row, start.column)
+ // Inside of the foldLine range. Need to split stuff up.
+ if (cmp == 0) {
+ foldLine = foldLine.split(start.row, start.column);
+ foldLine.shiftRow(len);
+ foldLine.addRemoveChars(
+ lastRow, 0, end.column - start.column);
+ } else
+ // Infront of the foldLine but same row. Need to shift column.
+ if (cmp == -1) {
+ foldLine.addRemoveChars(firstRow, 0, end.column - start.column);
+ foldLine.shiftRow(len);
+ }
+ // Nothing to do if the insert is after the foldLine.
+ idx = foldLines.indexOf(foldLine) + 1;
+ }
+
+ for (idx; idx < foldLines.length; idx++) {
+ var foldLine = foldLines[idx];
+ if (foldLine.start.row >= firstRow) {
+ foldLine.shiftRow(len);
+ }
+ }
+ }
+ } else {
+ // Realign folds. E.g. if you add some new chars before a fold, the
+ // fold should "move" to the right.
+ len = Math.abs(e.data.range.start.column - e.data.range.end.column);
+ if (action.indexOf("remove") != -1) {
+ // Get all the folds in the change range and remove them.
+ removedFolds = this.getFoldsInRange(e.data.range);
+ this.removeFolds(removedFolds);
+
+ len = -len;
+ }
+ var foldLine = this.getFoldLine(firstRow);
+ if (foldLine) {
+ foldLine.addRemoveChars(firstRow, start.column, len);
+ }
+ }
+
+ if (useWrapMode && this.$wrapData.length != this.doc.getLength()) {
+ console.error("doc.getLength() and $wrapData.length have to be the same!");
+ }
+
+ if (useWrapMode)
+ this.$updateWrapData(firstRow, lastRow);
+ else
+ this.$updateRowLengthCache(firstRow, lastRow);
+
+ return removedFolds;
+ };
+
+ this.$updateRowLengthCache = function(firstRow, lastRow, b) {
+ this.$rowLengthCache[firstRow] = null;
+ this.$rowLengthCache[lastRow] = null;
+ };
+ this.$updateWrapData = function(firstRow, lastRow) {
+ var lines = this.doc.getAllLines();
+ var tabSize = this.getTabSize();
+ var wrapData = this.$wrapData;
+ var wrapLimit = this.$wrapLimit;
+ var tokens;
+ var foldLine;
+
+ var row = firstRow;
+ lastRow = Math.min(lastRow, lines.length - 1);
+ while (row <= lastRow) {
+ foldLine = this.getFoldLine(row, foldLine);
+ if (!foldLine) {
+ tokens = this.$getDisplayTokens(lang.stringTrimRight(lines[row]));
+ wrapData[row] = this.$computeWrapSplits(tokens, wrapLimit, tabSize);
+ row ++;
+ } else {
+ tokens = [];
+ foldLine.walk(
+ function(placeholder, row, column, lastColumn) {
+ var walkTokens;
+ if (placeholder) {
+ walkTokens = this.$getDisplayTokens(
+ placeholder, tokens.length);
+ walkTokens[0] = PLACEHOLDER_START;
+ for (var i = 1; i < walkTokens.length; i++) {
+ walkTokens[i] = PLACEHOLDER_BODY;
+ }
+ } else {
+ walkTokens = this.$getDisplayTokens(
+ lines[row].substring(lastColumn, column),
+ tokens.length);
+ }
+ tokens = tokens.concat(walkTokens);
+ }.bind(this),
+ foldLine.end.row,
+ lines[foldLine.end.row].length + 1
+ );
+ // Remove spaces/tabs from the back of the token array.
+ while (tokens.length != 0 && tokens[tokens.length - 1] >= SPACE)
+ tokens.pop();
+
+ wrapData[foldLine.start.row]
+ = this.$computeWrapSplits(tokens, wrapLimit, tabSize);
+ row = foldLine.end.row + 1;
+ }
+ }
+ };
+
+ // "Tokens"
+ var CHAR = 1,
+ CHAR_EXT = 2,
+ PLACEHOLDER_START = 3,
+ PLACEHOLDER_BODY = 4,
+ PUNCTUATION = 9,
+ SPACE = 10,
+ TAB = 11,
+ TAB_SPACE = 12;
+ this.$computeWrapSplits = function(tokens, wrapLimit) {
+ if (tokens.length == 0) {
+ return [];
+ }
+
+ var splits = [];
+ var displayLength = tokens.length;
+ var lastSplit = 0, lastDocSplit = 0;
+
+ function addSplit(screenPos) {
+ var displayed = tokens.slice(lastSplit, screenPos);
+
+ // The document size is the current size - the extra width for tabs
+ // and multipleWidth characters.
+ var len = displayed.length;
+ displayed.join("").
+ // Get all the TAB_SPACEs.
+ replace(/12/g, function() {
+ len -= 1;
+ }).
+ // Get all the CHAR_EXT/multipleWidth characters.
+ replace(/2/g, function() {
+ len -= 1;
+ });
+
+ lastDocSplit += len;
+ splits.push(lastDocSplit);
+ lastSplit = screenPos;
+ }
+
+ while (displayLength - lastSplit > wrapLimit) {
+ // This is, where the split should be.
+ var split = lastSplit + wrapLimit;
+
+ // If there is a space or tab at this split position, then making
+ // a split is simple.
+ if (tokens[split] >= SPACE) {
+ // Include all following spaces + tabs in this split as well.
+ while (tokens[split] >= SPACE) {
+ split ++;
+ }
+ addSplit(split);
+ continue;
+ }
+
+ // === ELSE ===
+ // Check if split is inside of a placeholder. Placeholder are
+ // not splitable. Therefore, seek the beginning of the placeholder
+ // and try to place the split beofre the placeholder's start.
+ if (tokens[split] == PLACEHOLDER_START
+ || tokens[split] == PLACEHOLDER_BODY)
+ {
+ // Seek the start of the placeholder and do the split
+ // before the placeholder. By definition there always
+ // a PLACEHOLDER_START between split and lastSplit.
+ for (split; split != lastSplit - 1; split--) {
+ if (tokens[split] == PLACEHOLDER_START) {
+ // split++; << No incremental here as we want to
+ // have the position before the Placeholder.
+ break;
+ }
+ }
+
+ // If the PLACEHOLDER_START is not the index of the
+ // last split, then we can do the split
+ if (split > lastSplit) {
+ addSplit(split);
+ continue;
+ }
+
+ // If the PLACEHOLDER_START IS the index of the last
+ // split, then we have to place the split after the
+ // placeholder. So, let's seek for the end of the placeholder.
+ split = lastSplit + wrapLimit;
+ for (split; split < tokens.length; split++) {
+ if (tokens[split] != PLACEHOLDER_BODY)
+ {
+ break;
+ }
+ }
+
+ // If spilt == tokens.length, then the placeholder is the last
+ // thing in the line and adding a new split doesn't make sense.
+ if (split == tokens.length) {
+ break; // Breaks the while-loop.
+ }
+
+ // Finally, add the split...
+ addSplit(split);
+ continue;
+ }
+
+ // === ELSE ===
+ // Search for the first non space/tab/placeholder/punctuation token backwards.
+ var minSplit = Math.max(split - 10, lastSplit - 1);
+ while (split > minSplit && tokens[split] < PLACEHOLDER_START) {
+ split --;
+ }
+ while (split > minSplit && tokens[split] == PUNCTUATION) {
+ split --;
+ }
+ // If we found one, then add the split.
+ if (split > minSplit) {
+ addSplit(++split);
+ continue;
+ }
+
+ // === ELSE ===
+ split = lastSplit + wrapLimit;
+ // The split is inside of a CHAR or CHAR_EXT token and no space
+ // around -> force a split.
+ addSplit(split);
+ }
+ return splits;
+ };
+ this.$getDisplayTokens = function(str, offset) {
+ var arr = [];
+ var tabSize;
+ offset = offset || 0;
+
+ for (var i = 0; i < str.length; i++) {
+ var c = str.charCodeAt(i);
+ // Tab
+ if (c == 9) {
+ tabSize = this.getScreenTabSize(arr.length + offset);
+ arr.push(TAB);
+ for (var n = 1; n < tabSize; n++) {
+ arr.push(TAB_SPACE);
+ }
+ }
+ // Space
+ else if (c == 32) {
+ arr.push(SPACE);
+ } else if((c > 39 && c < 48) || (c > 57 && c < 64)) {
+ arr.push(PUNCTUATION);
+ }
+ // full width characters
+ else if (c >= 0x1100 && isFullWidth(c)) {
+ arr.push(CHAR, CHAR_EXT);
+ } else {
+ arr.push(CHAR);
+ }
+ }
+ return arr;
+ };
+ this.$getStringScreenWidth = function(str, maxScreenColumn, screenColumn) {
+ if (maxScreenColumn == 0)
+ return [0, 0];
+ if (maxScreenColumn == null)
+ maxScreenColumn = Infinity;
+ screenColumn = screenColumn || 0;
+
+ var c, column;
+ for (column = 0; column < str.length; column++) {
+ c = str.charCodeAt(column);
+ // tab
+ if (c == 9) {
+ screenColumn += this.getScreenTabSize(screenColumn);
+ }
+ // full width characters
+ else if (c >= 0x1100 && isFullWidth(c)) {
+ screenColumn += 2;
+ } else {
+ screenColumn += 1;
+ }
+ if (screenColumn > maxScreenColumn) {
+ break;
+ }
+ }
+
+ return [screenColumn, column];
+ };
+ this.getRowLength = function(row) {
+ if (!this.$useWrapMode || !this.$wrapData[row]) {
+ return 1;
+ } else {
+ return this.$wrapData[row].length + 1;
+ }
+ };
+ this.getScreenLastRowColumn = function(screenRow) {
+ var pos = this.screenToDocumentPosition(screenRow, Number.MAX_VALUE);
+ return this.documentToScreenColumn(pos.row, pos.column);
+ };
+ this.getDocumentLastRowColumn = function(docRow, docColumn) {
+ var screenRow = this.documentToScreenRow(docRow, docColumn);
+ return this.getScreenLastRowColumn(screenRow);
+ };
+ this.getDocumentLastRowColumnPosition = function(docRow, docColumn) {
+ var screenRow = this.documentToScreenRow(docRow, docColumn);
+ return this.screenToDocumentPosition(screenRow, Number.MAX_VALUE / 10);
+ };
+ this.getRowSplitData = function(row) {
+ if (!this.$useWrapMode) {
+ return undefined;
+ } else {
+ return this.$wrapData[row];
+ }
+ };
+ this.getScreenTabSize = function(screenColumn) {
+ return this.$tabSize - screenColumn % this.$tabSize;
+ };
+ this.screenToDocumentRow = function(screenRow, screenColumn) {
+ return this.screenToDocumentPosition(screenRow, screenColumn).row;
+ };
+ this.screenToDocumentColumn = function(screenRow, screenColumn) {
+ return this.screenToDocumentPosition(screenRow, screenColumn).column;
+ };
+ this.screenToDocumentPosition = function(screenRow, screenColumn) {
+ if (screenRow < 0)
+ return {row: 0, column: 0};
+
+ var line;
+ var docRow = 0;
+ var docColumn = 0;
+ var column;
+ var row = 0;
+ var rowLength = 0;
+
+ var rowCache = this.$screenRowCache;
+ var i = this.$getRowCacheIndex(rowCache, screenRow);
+ if (0 < i && i < rowCache.length) {
+ var row = rowCache[i];
+ var docRow = this.$docRowCache[i];
+ var doCache = screenRow > row || (screenRow == row && i == rowCache.length - 1);
+ } else {
+ var doCache = i != 0 || !rowCache.length;
+ }
+
+ var maxRow = this.getLength() - 1;
+ var foldLine = this.getNextFoldLine(docRow);
+ var foldStart = foldLine ? foldLine.start.row : Infinity;
+
+ while (row <= screenRow) {
+ rowLength = this.getRowLength(docRow);
+ if (row + rowLength - 1 >= screenRow || docRow >= maxRow) {
+ break;
+ } else {
+ row += rowLength;
+ docRow++;
+ if (docRow > foldStart) {
+ docRow = foldLine.end.row+1;
+ foldLine = this.getNextFoldLine(docRow, foldLine);
+ foldStart = foldLine ? foldLine.start.row : Infinity;
+ }
+ }
+ if (doCache) {
+ this.$docRowCache.push(docRow);
+ this.$screenRowCache.push(row);
+ }
+ }
+
+ if (foldLine && foldLine.start.row <= docRow) {
+ line = this.getFoldDisplayLine(foldLine);
+ docRow = foldLine.start.row;
+ } else if (row + rowLength <= screenRow || docRow > maxRow) {
+ // clip at the end of the document
+ return {
+ row: maxRow,
+ column: this.getLine(maxRow).length
+ }
+ } else {
+ line = this.getLine(docRow);
+ foldLine = null;
+ }
+
+ if (this.$useWrapMode) {
+ var splits = this.$wrapData[docRow];
+ if (splits) {
+ column = splits[screenRow - row];
+ if(screenRow > row && splits.length) {
+ docColumn = splits[screenRow - row - 1] || splits[splits.length - 1];
+ line = line.substring(docColumn);
+ }
+ }
+ }
+
+ docColumn += this.$getStringScreenWidth(line, screenColumn)[1];
+
+ // We remove one character at the end so that the docColumn
+ // position returned is not associated to the next row on the screen.
+ if (this.$useWrapMode && docColumn >= column)
+ docColumn = column - 1;
+
+ if (foldLine)
+ return foldLine.idxToPosition(docColumn);
+
+ return {row: docRow, column: docColumn};
+ };
+ this.documentToScreenPosition = function(docRow, docColumn) {
+ // Normalize the passed in arguments.
+ if (typeof docColumn === "undefined")
+ var pos = this.$clipPositionToDocument(docRow.row, docRow.column);
+ else
+ pos = this.$clipPositionToDocument(docRow, docColumn);
+
+ docRow = pos.row;
+ docColumn = pos.column;
+
+ var screenRow = 0;
+ var foldStartRow = null;
+ var fold = null;
+
+ // Clamp the docRow position in case it's inside of a folded block.
+ fold = this.getFoldAt(docRow, docColumn, 1);
+ if (fold) {
+ docRow = fold.start.row;
+ docColumn = fold.start.column;
+ }
+
+ var rowEnd, row = 0;
+
+
+ var rowCache = this.$docRowCache;
+ var i = this.$getRowCacheIndex(rowCache, docRow);
+ if (0 < i && i < rowCache.length) {
+ var row = rowCache[i];
+ var screenRow = this.$screenRowCache[i];
+ var doCache = docRow > row || (docRow == row && i == rowCache.length - 1);
+ } else {
+ var doCache = i != 0 || !rowCache.length;
+ }
+
+ var foldLine = this.getNextFoldLine(row);
+ var foldStart = foldLine ?foldLine.start.row :Infinity;
+
+ while (row < docRow) {
+ if (row >= foldStart) {
+ rowEnd = foldLine.end.row + 1;
+ if (rowEnd > docRow)
+ break;
+ foldLine = this.getNextFoldLine(rowEnd, foldLine);
+ foldStart = foldLine ?foldLine.start.row :Infinity;
+ }
+ else {
+ rowEnd = row + 1;
+ }
+
+ screenRow += this.getRowLength(row);
+ row = rowEnd;
+
+ if (doCache) {
+ this.$docRowCache.push(row);
+ this.$screenRowCache.push(screenRow);
+ }
+ }
+
+ // Calculate the text line that is displayed in docRow on the screen.
+ var textLine = "";
+ // Check if the final row we want to reach is inside of a fold.
+ if (foldLine && row >= foldStart) {
+ textLine = this.getFoldDisplayLine(foldLine, docRow, docColumn);
+ foldStartRow = foldLine.start.row;
+ } else {
+ textLine = this.getLine(docRow).substring(0, docColumn);
+ foldStartRow = docRow;
+ }
+ // Clamp textLine if in wrapMode.
+ if (this.$useWrapMode) {
+ var wrapRow = this.$wrapData[foldStartRow];
+ var screenRowOffset = 0;
+ while (textLine.length >= wrapRow[screenRowOffset]) {
+ screenRow ++;
+ screenRowOffset++;
+ }
+ textLine = textLine.substring(
+ wrapRow[screenRowOffset - 1] || 0, textLine.length
+ );
+ }
+
+ return {
+ row: screenRow,
+ column: this.$getStringScreenWidth(textLine)[0]
+ };
+ };
+ this.documentToScreenColumn = function(row, docColumn) {
+ return this.documentToScreenPosition(row, docColumn).column;
+ };
+ this.documentToScreenRow = function(docRow, docColumn) {
+ return this.documentToScreenPosition(docRow, docColumn).row;
+ };
+ this.getScreenLength = function() {
+ var screenRows = 0;
+ var fold = null;
+ if (!this.$useWrapMode) {
+ screenRows = this.getLength();
+
+ // Remove the folded lines again.
+ var foldData = this.$foldData;
+ for (var i = 0; i < foldData.length; i++) {
+ fold = foldData[i];
+ screenRows -= fold.end.row - fold.start.row;
+ }
+ } else {
+ var lastRow = this.$wrapData.length;
+ var row = 0, i = 0;
+ var fold = this.$foldData[i++];
+ var foldStart = fold ? fold.start.row :Infinity;
+
+ while (row < lastRow) {
+ screenRows += this.$wrapData[row].length + 1;
+ row ++;
+ if (row > foldStart) {
+ row = fold.end.row+1;
+ fold = this.$foldData[i++];
+ foldStart = fold ?fold.start.row :Infinity;
+ }
+ }
+ }
+
+ return screenRows;
+ }
+
+ // For every keystroke this gets called once per char in the whole doc!!
+ // Wouldn't hurt to make it a bit faster for c >= 0x1100
+ function isFullWidth(c) {
+ if (c < 0x1100)
+ return false;
+ return c >= 0x1100 && c <= 0x115F ||
+ c >= 0x11A3 && c <= 0x11A7 ||
+ c >= 0x11FA && c <= 0x11FF ||
+ c >= 0x2329 && c <= 0x232A ||
+ c >= 0x2E80 && c <= 0x2E99 ||
+ c >= 0x2E9B && c <= 0x2EF3 ||
+ c >= 0x2F00 && c <= 0x2FD5 ||
+ c >= 0x2FF0 && c <= 0x2FFB ||
+ c >= 0x3000 && c <= 0x303E ||
+ c >= 0x3041 && c <= 0x3096 ||
+ c >= 0x3099 && c <= 0x30FF ||
+ c >= 0x3105 && c <= 0x312D ||
+ c >= 0x3131 && c <= 0x318E ||
+ c >= 0x3190 && c <= 0x31BA ||
+ c >= 0x31C0 && c <= 0x31E3 ||
+ c >= 0x31F0 && c <= 0x321E ||
+ c >= 0x3220 && c <= 0x3247 ||
+ c >= 0x3250 && c <= 0x32FE ||
+ c >= 0x3300 && c <= 0x4DBF ||
+ c >= 0x4E00 && c <= 0xA48C ||
+ c >= 0xA490 && c <= 0xA4C6 ||
+ c >= 0xA960 && c <= 0xA97C ||
+ c >= 0xAC00 && c <= 0xD7A3 ||
+ c >= 0xD7B0 && c <= 0xD7C6 ||
+ c >= 0xD7CB && c <= 0xD7FB ||
+ c >= 0xF900 && c <= 0xFAFF ||
+ c >= 0xFE10 && c <= 0xFE19 ||
+ c >= 0xFE30 && c <= 0xFE52 ||
+ c >= 0xFE54 && c <= 0xFE66 ||
+ c >= 0xFE68 && c <= 0xFE6B ||
+ c >= 0xFF01 && c <= 0xFF60 ||
+ c >= 0xFFE0 && c <= 0xFFE6;
+ };
+
+}).call(EditSession.prototype);
+
+require("./edit_session/folding").Folding.call(EditSession.prototype);
+require("./edit_session/bracket_match").BracketMatch.call(EditSession.prototype);
+
+exports.EditSession = EditSession;
+});
+
+ace.define('ace/config', ['require', 'exports', 'module' , 'ace/lib/lang'], function(require, exports, module) {
+"no use strict";
+
+var lang = require("./lib/lang");
+
+var global = (function() {
+ return this;
+})();
+
+var options = {
+ packaged: false,
+ workerPath: "",
+ modePath: "",
+ themePath: "",
+ suffix: ".js",
+ $moduleUrls: {}
+};
+
+exports.get = function(key) {
+ if (!options.hasOwnProperty(key))
+ throw new Error("Unknown config key: " + key);
+
+ return options[key];
+};
+
+exports.set = function(key, value) {
+ if (!options.hasOwnProperty(key))
+ throw new Error("Unknown config key: " + key);
+
+ options[key] = value;
+};
+
+exports.all = function() {
+ return lang.copyObject(options);
+};
+
+exports.moduleUrl = function(name, component) {
+ if (options.$moduleUrls[name])
+ return options.$moduleUrls[name];
+
+ var parts = name.split("/");
+ component = component || parts[parts.length - 2] || "";
+ var base = parts[parts.length - 1].replace(component, "").replace(/(^[\-_])|([\-_]$)/, "");
+
+ if (!base && parts.length > 1)
+ base = parts[parts.length - 2];
+ return this.get(component + "Path") + "/" + component + "-" + base + this.get("suffix");
+};
+
+exports.setModuleUrl = function(name, subst) {
+ return options.$moduleUrls[name] = subst;
+};
+
+exports.init = function() {
+ options.packaged = require.packaged || module.packaged || (global.define && define.packaged);
+
+ if (!global.document)
+ return "";
+
+ var scriptOptions = {};
+ var scriptUrl = "";
+
+ var scripts = document.getElementsByTagName("script");
+ for (var i=0; i<scripts.length; i++) {
+ var script = scripts[i];
+
+ var src = script.src || script.getAttribute("src");
+ if (!src) {
+ continue;
+ }
+
+ var attributes = script.attributes;
+ for (var j=0, l=attributes.length; j < l; j++) {
+ var attr = attributes[j];
+ if (attr.name.indexOf("data-ace-") === 0) {
+ scriptOptions[deHyphenate(attr.name.replace(/^data-ace-/, ""))] = attr.value;
+ }
+ }
+
+ var m = src.match(/^(.*)\/ace(\-\w+)?\.js(\?|$)/);
+ if (m)
+ scriptUrl = m[1];
+ }
+
+ if (scriptUrl) {
+ scriptOptions.base = scriptOptions.base || scriptUrl;
+ scriptOptions.packaged = true;
+ }
+
+ scriptOptions.workerPath = scriptOptions.workerPath || scriptOptions.base;
+ scriptOptions.modePath = scriptOptions.modePath || scriptOptions.base;
+ scriptOptions.themePath = scriptOptions.themePath || scriptOptions.base;
+ delete scriptOptions.base;
+
+ for (var key in scriptOptions)
+ if (typeof scriptOptions[key] !== "undefined")
+ exports.set(key, scriptOptions[key]);
+};
+
+function deHyphenate(str) {
+ return str.replace(/-(.)/g, function(m, m1) { return m1.toUpperCase(); });
+}
+
+});
+ace.define('ace/lib/net', ['require', 'exports', 'module' , 'ace/lib/useragent'], function(require, exports, module) {
+
+
+var useragent = require("./useragent");
+
+exports.get = function (url, callback) {
+ var xhr = exports.createXhr();
+ xhr.open('GET', url, true);
+ xhr.onreadystatechange = function (evt) {
+ //Do not explicitly handle errors, those should be
+ //visible via console output in the browser.
+ if (xhr.readyState === 4) {
+ callback(xhr.responseText);
+ }
+ };
+ xhr.send(null);
+};
+
+var progIds = ['Msxml2.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.4.0'];
+
+exports.createXhr = function() {
+ //Would love to dump the ActiveX crap in here. Need IE 6 to die first.
+ var xhr, i, progId;
+ if (typeof XMLHttpRequest !== "undefined") {
+ return new XMLHttpRequest();
+ } else {
+ for (i = 0; i < 3; i++) {
+ progId = progIds[i];
+ try {
+ xhr = new ActiveXObject(progId);
+ } catch (e) {}
+
+ if (xhr) {
+ progIds = [progId]; // so faster next time
+ break;
+ }
+ }
+ }
+
+ if (!xhr) {
+ throw new Error("createXhr(): XMLHttpRequest not available");
+ }
+
+ return xhr;
+};
+
+exports.loadScript = function(path, callback) {
+ var head = document.getElementsByTagName('head')[0];
+ var s = document.createElement('script');
+
+ s.src = path;
+ head.appendChild(s);
+
+ if (useragent.isOldIE)
+ s.onreadystatechange = function () {
+ this.readyState == 'loaded' && callback();
+ };
+ else
+ s.onload = callback;
+};
+
+});
+
+ace.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<listeners.length; i++) {
+ listeners[i](e);
+ if (e.propagationStopped)
+ break;
+ }
+
+ if (defaultHandler && !e.defaultPrevented)
+ return defaultHandler(e);
+};
+
+EventEmitter.setDefaultHandler = function(eventName, callback) {
+ this._defaultHandlers = this._defaultHandlers || {};
+
+ if (this._defaultHandlers[eventName])
+ throw new Error("The default handler for '" + eventName + "' is already set");
+
+ this._defaultHandlers[eventName] = callback;
+};
+
+EventEmitter.on =
+EventEmitter.addEventListener = function(eventName, callback) {
+ this._eventRegistry = this._eventRegistry || {};
+
+ var listeners = this._eventRegistry[eventName];
+ if (!listeners)
+ listeners = this._eventRegistry[eventName] = [];
+
+ if (listeners.indexOf(callback) == -1)
+ listeners.push(callback);
+};
+
+EventEmitter.removeListener =
+EventEmitter.removeEventListener = function(eventName, callback) {
+ this._eventRegistry = this._eventRegistry || {};
+
+ var listeners = this._eventRegistry[eventName];
+ if (!listeners)
+ return;
+
+ var index = listeners.indexOf(callback);
+ if (index !== -1)
+ listeners.splice(index, 1);
+};
+
+EventEmitter.removeAllListeners = function(eventName) {
+ if (this._eventRegistry) this._eventRegistry[eventName] = [];
+};
+
+exports.EventEmitter = EventEmitter;
+
+});
+
+ace.define('ace/selection', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/lib/event_emitter', 'ace/range'], function(require, exports, module) {
+
+
+var oop = require("./lib/oop");
+var lang = require("./lib/lang");
+var EventEmitter = require("./lib/event_emitter").EventEmitter;
+var Range = require("./range").Range;
+
+/**
+ * new Selection(session)
+ * - session (EditSession): The session to use
+ *
+ * Creates a new `Selection` object.
+ *
+**/
+/**
+ * Selection@changeCursor()
+ *
+ * Emitted when the cursor position changes.
+ *
+**/
+/**
+ * Selection@changeSelection()
+ *
+ * Emitted when the cursor selection changes.
+ *
+**/
+var Selection = function(session) {
+ this.session = session;
+ this.doc = session.getDocument();
+
+ this.clearSelection();
+ this.lead = this.selectionLead = this.doc.createAnchor(0, 0);
+ this.anchor = this.selectionAnchor = this.doc.createAnchor(0, 0);
+
+ var self = this;
+ this.lead.on("change", function(e) {
+ self._emit("changeCursor");
+ if (!self.$isEmpty)
+ self._emit("changeSelection");
+ if (!self.$keepDesiredColumnOnChange && e.old.column != e.value.column)
+ self.$desiredColumn = null;
+ });
+
+ this.selectionAnchor.on("change", function() {
+ if (!self.$isEmpty)
+ self._emit("changeSelection");
+ });
+};
+
+(function() {
+
+ oop.implement(this, EventEmitter);
+ this.isEmpty = function() {
+ return (this.$isEmpty || (
+ this.anchor.row == this.lead.row &&
+ this.anchor.column == this.lead.column
+ ));
+ };
+ this.isMultiLine = function() {
+ if (this.isEmpty()) {
+ return false;
+ }
+
+ return this.getRange().isMultiLine();
+ };
+ this.getCursor = function() {
+ return this.lead.getPosition();
+ };
+ this.setSelectionAnchor = function(row, column) {
+ this.anchor.setPosition(row, column);
+
+ if (this.$isEmpty) {
+ this.$isEmpty = false;
+ this._emit("changeSelection");
+ }
+ };
+ this.getSelectionAnchor = function() {
+ if (this.$isEmpty)
+ return this.getSelectionLead()
+ else
+ return this.anchor.getPosition();
+ };
+ this.getSelectionLead = function() {
+ return this.lead.getPosition();
+ };
+ this.shiftSelection = function(columns) {
+ if (this.$isEmpty) {
+ this.moveCursorTo(this.lead.row, this.lead.column + columns);
+ return;
+ };
+
+ var anchor = this.getSelectionAnchor();
+ var lead = this.getSelectionLead();
+
+ var isBackwards = this.isBackwards();
+
+ if (!isBackwards || anchor.column !== 0)
+ this.setSelectionAnchor(anchor.row, anchor.column + columns);
+
+ if (isBackwards || lead.column !== 0) {
+ this.$moveSelection(function() {
+ this.moveCursorTo(lead.row, lead.column + columns);
+ });
+ }
+ };
+ this.isBackwards = function() {
+ var anchor = this.anchor;
+ var lead = this.lead;
+ return (anchor.row > lead.row || (anchor.row == lead.row && anchor.column > lead.column));
+ };
+ this.getRange = function() {
+ var anchor = this.anchor;
+ var lead = this.lead;
+
+ if (this.isEmpty())
+ return Range.fromPoints(lead, lead);
+
+ if (this.isBackwards()) {
+ return Range.fromPoints(lead, anchor);
+ }
+ else {
+ return Range.fromPoints(anchor, lead);
+ }
+ };
+ this.clearSelection = function() {
+ if (!this.$isEmpty) {
+ this.$isEmpty = true;
+ this._emit("changeSelection");
+ }
+ };
+ this.selectAll = function() {
+ var lastRow = this.doc.getLength() - 1;
+ this.setSelectionAnchor(0, 0);
+ this.moveCursorTo(lastRow, this.doc.getLine(lastRow).length);
+ };
+ this.setRange =
+ this.setSelectionRange = function(range, reverse) {
+ if (reverse) {
+ this.setSelectionAnchor(range.end.row, range.end.column);
+ this.selectTo(range.start.row, range.start.column);
+ } else {
+ this.setSelectionAnchor(range.start.row, range.start.column);
+ this.selectTo(range.end.row, range.end.column);
+ }
+ this.$desiredColumn = null;
+ };
+
+ this.$moveSelection = function(mover) {
+ var lead = this.lead;
+ if (this.$isEmpty)
+ this.setSelectionAnchor(lead.row, lead.column);
+
+ mover.call(this);
+ };
+ this.selectTo = function(row, column) {
+ this.$moveSelection(function() {
+ this.moveCursorTo(row, column);
+ });
+ };
+ this.selectToPosition = function(pos) {
+ this.$moveSelection(function() {
+ this.moveCursorToPosition(pos);
+ });
+ };
+ this.selectUp = function() {
+ this.$moveSelection(this.moveCursorUp);
+ };
+ this.selectDown = function() {
+ this.$moveSelection(this.moveCursorDown);
+ };
+ this.selectRight = function() {
+ this.$moveSelection(this.moveCursorRight);
+ };
+ this.selectLeft = function() {
+ this.$moveSelection(this.moveCursorLeft);
+ };
+ this.selectLineStart = function() {
+ this.$moveSelection(this.moveCursorLineStart);
+ };
+ this.selectLineEnd = function() {
+ this.$moveSelection(this.moveCursorLineEnd);
+ };
+ this.selectFileEnd = function() {
+ this.$moveSelection(this.moveCursorFileEnd);
+ };
+ this.selectFileStart = function() {
+ this.$moveSelection(this.moveCursorFileStart);
+ };
+ this.selectWordRight = function() {
+ this.$moveSelection(this.moveCursorWordRight);
+ };
+ this.selectWordLeft = function() {
+ this.$moveSelection(this.moveCursorWordLeft);
+ };
+ this.getWordRange = function(row, column) {
+ if (typeof column == "undefined") {
+ var cursor = row || this.lead;
+ row = cursor.row;
+ column = cursor.column;
+ }
+ return this.session.getWordRange(row, column);
+ };
+
+ this.selectWord = function() {
+ this.setSelectionRange(this.getWordRange());
+ };
+ this.selectAWord = function() {
+ var cursor = this.getCursor();
+ var range = this.session.getAWordRange(cursor.row, cursor.column);
+ this.setSelectionRange(range);
+ };
+
+ this.getLineRange = function(row, excludeLastChar) {
+ var rowStart = typeof row == "number" ? row : this.lead.row;
+ var rowEnd;
+
+ var foldLine = this.session.getFoldLine(rowStart);
+ if (foldLine) {
+ rowStart = foldLine.start.row;
+ rowEnd = foldLine.end.row;
+ } else {
+ rowEnd = rowStart;
+ }
+ if (excludeLastChar)
+ return new Range(rowStart, 0, rowEnd, this.session.getLine(rowEnd).length);
+ else
+ return new Range(rowStart, 0, rowEnd + 1, 0);
+ };
+ this.selectLine = function() {
+ this.setSelectionRange(this.getLineRange());
+ };
+ this.moveCursorUp = function() {
+ this.moveCursorBy(-1, 0);
+ };
+ this.moveCursorDown = function() {
+ this.moveCursorBy(1, 0);
+ };
+ this.moveCursorLeft = function() {
+ var cursor = this.lead.getPosition(),
+ fold;
+
+ if (fold = this.session.getFoldAt(cursor.row, cursor.column, -1)) {
+ this.moveCursorTo(fold.start.row, fold.start.column);
+ } else if (cursor.column == 0) {
+ // cursor is a line (start
+ if (cursor.row > 0) {
+ this.moveCursorTo(cursor.row - 1, this.doc.getLine(cursor.row - 1).length);
+ }
+ }
+ else {
+ var tabSize = this.session.getTabSize();
+ if (this.session.isTabStop(cursor) && this.doc.getLine(cursor.row).slice(cursor.column-tabSize, cursor.column).split(" ").length-1 == tabSize)
+ this.moveCursorBy(0, -tabSize);
+ else
+ this.moveCursorBy(0, -1);
+ }
+ };
+ this.moveCursorRight = function() {
+ var cursor = this.lead.getPosition(),
+ fold;
+ if (fold = this.session.getFoldAt(cursor.row, cursor.column, 1)) {
+ this.moveCursorTo(fold.end.row, fold.end.column);
+ }
+ else if (this.lead.column == this.doc.getLine(this.lead.row).length) {
+ if (this.lead.row < this.doc.getLength() - 1) {
+ this.moveCursorTo(this.lead.row + 1, 0);
+ }
+ }
+ else {
+ var tabSize = this.session.getTabSize();
+ var cursor = this.lead;
+ if (this.session.isTabStop(cursor) && this.doc.getLine(cursor.row).slice(cursor.column, cursor.column+tabSize).split(" ").length-1 == tabSize)
+ this.moveCursorBy(0, tabSize);
+ else
+ this.moveCursorBy(0, 1);
+ }
+ };
+ this.moveCursorLineStart = function() {
+ var row = this.lead.row;
+ var column = this.lead.column;
+ var screenRow = this.session.documentToScreenRow(row, column);
+
+ // Determ the doc-position of the first character at the screen line.
+ var firstColumnPosition = this.session.screenToDocumentPosition(screenRow, 0);
+
+ // Determ the line
+ var beforeCursor = this.session.getDisplayLine(
+ row, null, firstColumnPosition.row,
+ firstColumnPosition.column
+ );
+
+ var leadingSpace = beforeCursor.match(/^\s*/);
+ if (leadingSpace[0].length == column) {
+ this.moveCursorTo(
+ firstColumnPosition.row, firstColumnPosition.column
+ );
+ }
+ else {
+ this.moveCursorTo(
+ firstColumnPosition.row,
+ firstColumnPosition.column + leadingSpace[0].length
+ );
+ }
+ };
+ this.moveCursorLineEnd = function() {
+ var lead = this.lead;
+ var lineEnd = this.session.getDocumentLastRowColumnPosition(lead.row, lead.column);
+ if (this.lead.column == lineEnd.column) {
+ var line = this.session.getLine(lineEnd.row);
+ if (lineEnd.column == line.length) {
+ var textEnd = line.search(/\s+$/);
+ if (textEnd > 0)
+ lineEnd.column = textEnd;
+ }
+ }
+
+ this.moveCursorTo(lineEnd.row, lineEnd.column);
+ };
+ this.moveCursorFileEnd = function() {
+ var row = this.doc.getLength() - 1;
+ var column = this.doc.getLine(row).length;
+ this.moveCursorTo(row, column);
+ };
+ this.moveCursorFileStart = function() {
+ this.moveCursorTo(0, 0);
+ };
+ this.moveCursorLongWordRight = function() {
+ var row = this.lead.row;
+ var column = this.lead.column;
+ var line = this.doc.getLine(row);
+ var rightOfCursor = line.substring(column);
+
+ var match;
+ this.session.nonTokenRe.lastIndex = 0;
+ this.session.tokenRe.lastIndex = 0;
+
+ // skip folds
+ var fold = this.session.getFoldAt(row, column, 1);
+ if (fold) {
+ this.moveCursorTo(fold.end.row, fold.end.column);
+ return;
+ }
+
+ // first skip space
+ if (match = this.session.nonTokenRe.exec(rightOfCursor)) {
+ column += this.session.nonTokenRe.lastIndex;
+ this.session.nonTokenRe.lastIndex = 0;
+ rightOfCursor = line.substring(column);
+ }
+
+ // if at line end proceed with next line
+ if (column >= line.length) {
+ this.moveCursorTo(row, line.length);
+ this.moveCursorRight();
+ if (row < this.doc.getLength() - 1)
+ this.moveCursorWordRight();
+ return;
+ }
+
+ // advance to the end of the next token
+ if (match = this.session.tokenRe.exec(rightOfCursor)) {
+ column += this.session.tokenRe.lastIndex;
+ this.session.tokenRe.lastIndex = 0;
+ }
+
+ this.moveCursorTo(row, column);
+ };
+ this.moveCursorLongWordLeft = function() {
+ var row = this.lead.row;
+ var column = this.lead.column;
+
+ // skip folds
+ var fold;
+ if (fold = this.session.getFoldAt(row, column, -1)) {
+ this.moveCursorTo(fold.start.row, fold.start.column);
+ return;
+ }
+
+ var str = this.session.getFoldStringAt(row, column, -1);
+ if (str == null) {
+ str = this.doc.getLine(row).substring(0, column)
+ }
+
+ var leftOfCursor = lang.stringReverse(str);
+ var match;
+ this.session.nonTokenRe.lastIndex = 0;
+ this.session.tokenRe.lastIndex = 0;
+
+ // skip whitespace
+ if (match = this.session.nonTokenRe.exec(leftOfCursor)) {
+ column -= this.session.nonTokenRe.lastIndex;
+ leftOfCursor = leftOfCursor.slice(this.session.nonTokenRe.lastIndex);
+ this.session.nonTokenRe.lastIndex = 0;
+ }
+
+ // if at begin of the line proceed in line above
+ if (column <= 0) {
+ this.moveCursorTo(row, 0);
+ this.moveCursorLeft();
+ if (row > 0)
+ this.moveCursorWordLeft();
+ return;
+ }
+
+ // move to the begin of the word
+ if (match = this.session.tokenRe.exec(leftOfCursor)) {
+ column -= this.session.tokenRe.lastIndex;
+ this.session.tokenRe.lastIndex = 0;
+ }
+
+ this.moveCursorTo(row, column);
+ };
+
+ this.$shortWordEndIndex = function(rightOfCursor) {
+ var match, index = 0, ch;
+ var whitespaceRe = /\s/;
+ var tokenRe = this.session.tokenRe;
+
+ tokenRe.lastIndex = 0;
+ if (match = this.session.tokenRe.exec(rightOfCursor)) {
+ index = this.session.tokenRe.lastIndex;
+ } else {
+ while ((ch = rightOfCursor[index]) && whitespaceRe.test(ch))
+ index ++;
+
+ if (index <= 1) {
+ tokenRe.lastIndex = 0;
+ while ((ch = rightOfCursor[index]) && !tokenRe.test(ch)) {
+ tokenRe.lastIndex = 0;
+ index ++;
+ if (whitespaceRe.test(ch)) {
+ if (index > 2) {
+ index--
+ break;
+ } else {
+ while ((ch = rightOfCursor[index]) && whitespaceRe.test(ch))
+ index ++;
+ if (index > 2)
+ break
+ }
+ }
+ }
+ }
+ }
+ tokenRe.lastIndex = 0;
+
+ return index;
+ };
+
+ this.moveCursorShortWordRight = function() {
+ var row = this.lead.row;
+ var column = this.lead.column;
+ var line = this.doc.getLine(row);
+ var rightOfCursor = line.substring(column);
+
+ var fold = this.session.getFoldAt(row, column, 1);
+ if (fold)
+ return this.moveCursorTo(fold.end.row, fold.end.column);
+
+ if (column == line.length) {
+ var l = this.doc.getLength();
+ do {
+ row++;
+ rightOfCursor = this.doc.getLine(row)
+ } while (row < l && /^\s*$/.test(rightOfCursor))
+
+ if (!/^\s+/.test(rightOfCursor))
+ rightOfCursor = ""
+ column = 0;
+ }
+
+ var index = this.$shortWordEndIndex(rightOfCursor);
+
+ this.moveCursorTo(row, column + index);
+ };
+
+ this.moveCursorShortWordLeft = function() {
+ var row = this.lead.row;
+ var column = this.lead.column;
+
+ var fold;
+ if (fold = this.session.getFoldAt(row, column, -1))
+ return this.moveCursorTo(fold.start.row, fold.start.column);
+
+ var line = this.session.getLine(row).substring(0, column);
+ if (column == 0) {
+ do {
+ row--;
+ line = this.doc.getLine(row);
+ } while (row > 0 && /^\s*$/.test(line))
+
+ column = line.length;
+ if (!/\s+$/.test(line))
+ line = ""
+ }
+
+ var leftOfCursor = lang.stringReverse(line);
+ var index = this.$shortWordEndIndex(leftOfCursor);
+
+ return this.moveCursorTo(row, column - index);
+ };
+
+ this.moveCursorWordRight = function() {
+ if (this.session.$selectLongWords)
+ this.moveCursorLongWordRight();
+ else
+ this.moveCursorShortWordRight();
+ };
+
+ this.moveCursorWordLeft = function() {
+ if (this.session.$selectLongWords)
+ this.moveCursorLongWordLeft();
+ else
+ this.moveCursorShortWordLeft();
+ };
+ this.moveCursorBy = function(rows, chars) {
+ var screenPos = this.session.documentToScreenPosition(
+ this.lead.row,
+ this.lead.column
+ );
+
+ if (chars === 0) {
+ if (this.$desiredColumn)
+ screenPos.column = this.$desiredColumn;
+ else
+ this.$desiredColumn = screenPos.column;
+ }
+
+ var docPos = this.session.screenToDocumentPosition(screenPos.row + rows, screenPos.column);
+
+ // move the cursor and update the desired column
+ this.moveCursorTo(docPos.row, docPos.column + chars, chars === 0);
+ };
+ this.moveCursorToPosition = function(position) {
+ this.moveCursorTo(position.row, position.column);
+ };
+ this.moveCursorTo = function(row, column, keepDesiredColumn) {
+ // Ensure the row/column is not inside of a fold.
+ var fold = this.session.getFoldAt(row, column, 1);
+ if (fold) {
+ row = fold.start.row;
+ column = fold.start.column;
+ }
+
+ this.$keepDesiredColumnOnChange = true;
+ this.lead.setPosition(row, column);
+ this.$keepDesiredColumnOnChange = false;
+
+ if (!keepDesiredColumn)
+ this.$desiredColumn = null;
+ };
+ this.moveCursorToScreen = function(row, column, keepDesiredColumn) {
+ var pos = this.session.screenToDocumentPosition(row, column);
+ this.moveCursorTo(pos.row, pos.column, keepDesiredColumn);
+ };
+
+ // remove listeners from document
+ this.detach = function() {
+ this.lead.detach();
+ this.anchor.detach();
+ this.session = this.doc = null;
+ }
+
+ this.fromOrientedRange = function(range) {
+ this.setSelectionRange(range, range.cursor == range.start);
+ this.$desiredColumn = range.desiredColumn || this.$desiredColumn;
+ }
+
+ this.toOrientedRange = function(range) {
+ var r = this.getRange();
+ if (range) {
+ range.start.column = r.start.column;
+ range.start.row = r.start.row;
+ range.end.column = r.end.column;
+ range.end.row = r.end.row;
+ } else {
+ range = r;
+ }
+
+ range.cursor = this.isBackwards() ? range.start : range.end;
+ range.desiredColumn = this.$desiredColumn;
+ return range;
+ }
+
+}).call(Selection.prototype);
+
+exports.Selection = Selection;
+});
+
+ace.define('ace/range', ['require', 'exports', 'module' ], function(require, exports, module) {
+
+
+/**
+ * class Range
+ *
+ * This object is used in various places to indicate a region within the editor. To better visualize how this works, imagine a rectangle. Each quadrant of the rectangle is analogus to a range, as ranges contain a starting row and starting column, and an ending row, and ending column.
+ *
+ **/
+
+/**
+ * new Range(startRow, startColumn, endRow, endColumn)
+ * - startRow (Number): The starting row
+ * - startColumn (Number): The starting column
+ * - endRow (Number): The ending row
+ * - endColumn (Number): The ending column
+ *
+ * Creates a new `Range` object with the given starting and ending row and column points.
+ *
+ **/
+var Range = function(startRow, startColumn, endRow, endColumn) {
+ this.start = {
+ row: startRow,
+ column: startColumn
+ };
+
+ this.end = {
+ row: endRow,
+ column: endColumn
+ };
+};
+
+(function() {
+ /**
+ * Range.isEqual(range) -> Boolean
+ * - range (Range): A range to check against
+ *
+ * Returns `true` if and only if the starting row and column, and ending tow and column, are equivalent to those given by `range`.
+ *
+ **/
+ 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;
+ }
+ }
+ }
+
+ /** related to: Range.compare
+ * Range.comparePoint(p) -> Number
+ * - p (Range): A point to compare with
+ * + (Number): This method returns one of the following numbers:<br/>
+ * * `0` if the two points are exactly equal<br/>
+ * * `-1` if `p.row` is less then the calling range<br/>
+ * * `1` if `p.row` is greater than the calling range<br/>
+ * <br/>
+ * If the starting row of the calling range is equal to `p.row`, and:<br/>
+ * * `p.column` is greater than or equal to the calling range's starting column, this returns `0`<br/>
+ * * Otherwise, it returns -1<br/>
+ *<br/>
+ * If the ending row of the calling range is equal to `p.row`, and:<br/>
+ * * `p.column` is less than or equal to the calling range's ending column, this returns `0`<br/>
+ * * Otherwise, it returns 1<br/>
+ *
+ * Checks the row and column points of `p` with the row and column points of the calling range.
+ *
+ *
+ *
+ **/
+ this.comparePoint = function(p) {
+ return this.compare(p.row, p.column);
+ }
+
+ /** related to: Range.comparePoint
+ * Range.containsRange(range) -> Boolean
+ * - range (Range): A range to compare with
+ *
+ * Checks the start and end points of `range` and compares them to the calling range. Returns `true` if the `range` is contained within the caller's range.
+ *
+ **/
+ this.containsRange = function(range) {
+ return this.comparePoint(range.start) == 0 && this.comparePoint(range.end) == 0;
+ }
+
+ /**
+ * Range.intersects(range) -> Boolean
+ * - range (Range): A range to compare with
+ *
+ * Returns `true` if passed in `range` intersects with the one calling this method.
+ *
+ **/
+ this.intersects = function(range) {
+ var cmp = this.compareRange(range);
+ return (cmp == -1 || cmp == 0 || cmp == 1);
+ }
+
+ /**
+ * Range.isEnd(row, column) -> Boolean
+ * - row (Number): A row point to compare with
+ * - column (Number): A column point to compare with
+ *
+ * Returns `true` if the caller's ending row point is the same as `row`, and if the caller's ending column is the same as `column`.
+ *
+ **/
+ this.isEnd = function(row, column) {
+ return this.end.row == row && this.end.column == column;
+ }
+
+ /**
+ * Range.isStart(row, column) -> Boolean
+ * - row (Number): A row point to compare with
+ * - column (Number): A column point to compare with
+ *
+ * Returns `true` if the caller's starting row point is the same as `row`, and if the caller's starting column is the same as `column`.
+ *
+ **/
+ this.isStart = function(row, column) {
+ return this.start.row == row && this.start.column == column;
+ }
+
+ /**
+ * Range.setStart(row, column)
+ * - row (Number): A row point to set
+ * - column (Number): A column point to set
+ *
+ * Sets the starting row and column for the range.
+ *
+ **/
+ 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;
+ }
+ }
+
+ /**
+ * Range.setEnd(row, column)
+ * - row (Number): A row point to set
+ * - column (Number): A column point to set
+ *
+ * Sets the starting row and column for the range.
+ *
+ **/
+ 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;
+ }
+ }
+
+ /** related to: Range.compare
+ * Range.inside(row, column) -> Boolean
+ * - row (Number): A row point to compare with
+ * - column (Number): A column point to compare with
+ *
+ * Returns `true` if the `row` and `column` are within the given range.
+ *
+ **/
+ 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;
+ }
+
+ /** related to: Range.compare
+ * Range.insideStart(row, column) -> Boolean
+ * - row (Number): A row point to compare with
+ * - column (Number): A column point to compare with
+ *
+ * Returns `true` if the `row` and `column` are within the given range's starting points.
+ *
+ **/
+ this.insideStart = function(row, column) {
+ if (this.compare(row, column) == 0) {
+ if (this.isEnd(row, column)) {
+ return false;
+ } else {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /** related to: Range.compare
+ * Range.insideEnd(row, column) -> Boolean
+ * - row (Number): A row point to compare with
+ * - column (Number): A column point to compare with
+ *
+ * Returns `true` if the `row` and `column` are within the given range's ending points.
+ *
+ **/
+ this.insideEnd = function(row, column) {
+ if (this.compare(row, column) == 0) {
+ if (this.isStart(row, column)) {
+ return false;
+ } else {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Range.compare(row, column) -> Number
+ * - row (Number): A row point to compare with
+ * - column (Number): A column point to compare with
+ * + (Number): This method returns one of the following numbers:<br/>
+ * * `0` if the two points are exactly equal <br/>
+ * * `-1` if `p.row` is less then the calling range <br/>
+ * * `1` if `p.row` is greater than the calling range <br/>
+ * <br/>
+ * If the starting row of the calling range is equal to `p.row`, and: <br/>
+ * * `p.column` is greater than or equal to the calling range's starting column, this returns `0`<br/>
+ * * Otherwise, it returns -1<br/>
+ * <br/>
+ * If the ending row of the calling range is equal to `p.row`, and: <br/>
+ * * `p.column` is less than or equal to the calling range's ending column, this returns `0` <br/>
+ * * Otherwise, it returns 1
+ *
+ * Checks the row and column points with the row and column points of the calling range.
+ *
+ *
+ **/
+ 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);
+ }
+ }
+
+ /**
+ * Range.compareEnd(row, column) -> Number
+ * - row (Number): A row point to compare with
+ * - column (Number): A column point to compare with
+ * + (Number): This method returns one of the following numbers:<br/>
+ * * `0` if the two points are exactly equal<br/>
+ * * `-1` if `p.row` is less then the calling range<br/>
+ * * `1` if `p.row` is greater than the calling range, or if `isEnd` is `true.<br/>
+ * <br/>
+ * If the starting row of the calling range is equal to `p.row`, and:<br/>
+ * * `p.column` is greater than or equal to the calling range's starting column, this returns `0`<br/>
+ * * Otherwise, it returns -1<br/>
+ *<br/>
+ * If the ending row of the calling range is equal to `p.row`, and:<br/>
+ * * `p.column` is less than or equal to the calling range's ending column, this returns `0`<br/>
+ * * Otherwise, it returns 1
+ *
+ * Checks the row and column points with the row and column points of the calling range.
+ *
+ *
+ **/
+ this.compareEnd = function(row, column) {
+ if (this.end.row == row && this.end.column == column) {
+ return 1;
+ } else {
+ return this.compare(row, column);
+ }
+ }
+
+ /**
+ * Range.compareInside(row, column) -> Number
+ * - row (Number): A row point to compare with
+ * - column (Number): A column point to compare with
+ * + (Number): This method returns one of the following numbers:<br/>
+ * * `1` if the ending row of the calling range is equal to `row`, and the ending column of the calling range is equal to `column`<br/>
+ * * `-1` if the starting row of the calling range is equal to `row`, and the starting column of the calling range is equal to `column`<br/>
+ * <br/>
+ * Otherwise, it returns the value after calling [[Range.compare `compare()`]].
+ *
+ * Checks the row and column points with the row and column points of the calling range.
+ *
+ *
+ *
+ **/
+ 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);
+ }
+ }
+
+ /**
+ * Range.clipRows(firstRow, lastRow) -> Range
+ * - firstRow (Number): The starting row
+ * - lastRow (Number): The ending row
+ *
+ * Returns the part of the current `Range` that occurs within the boundaries of `firstRow` and `lastRow` as a new `Range` object.
+ *
+ **/
+ 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;
+});
+
+ace.define('ace/mode/text', ['require', 'exports', 'module' , 'ace/tokenizer', 'ace/mode/text_highlight_rules', 'ace/mode/behaviour', 'ace/unicode'], function(require, exports, module) {
+
+
+var Tokenizer = require("../tokenizer").Tokenizer;
+var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+var Behaviour = require("./behaviour").Behaviour;
+var unicode = require("../unicode");
+
+var Mode = function() {
+ this.$tokenizer = new Tokenizer(new TextHighlightRules().getRules());
+ this.$behaviour = new Behaviour();
+};
+
+(function() {
+
+ this.tokenRe = new RegExp("^["
+ + unicode.packages.L
+ + unicode.packages.Mn + unicode.packages.Mc
+ + unicode.packages.Nd
+ + unicode.packages.Pc + "\\$_]+", "g"
+ );
+
+ this.nonTokenRe = new RegExp("^(?:[^"
+ + unicode.packages.L
+ + unicode.packages.Mn + unicode.packages.Mc
+ + unicode.packages.Nd
+ + unicode.packages.Pc + "\\$_]|\s])+", "g"
+ );
+
+ this.getTokenizer = function() {
+ return this.$tokenizer;
+ };
+
+ this.toggleCommentLines = function(state, doc, startRow, endRow) {
+ };
+
+ this.getNextLineIndent = function(state, line, tab) {
+ return "";
+ };
+
+ this.checkOutdent = function(state, line, input) {
+ return false;
+ };
+
+ this.autoOutdent = function(state, doc, row) {
+ };
+
+ this.$getIndent = function(line) {
+ var match = line.match(/^(\s+)/);
+ if (match) {
+ return match[1];
+ }
+
+ return "";
+ };
+
+ this.createWorker = function(session) {
+ return null;
+ };
+
+ this.createModeDelegates = function (mapping) {
+ if (!this.$embeds) {
+ return;
+ }
+ this.$modes = {};
+ for (var i = 0; i < this.$embeds.length; i++) {
+ if (mapping[this.$embeds[i]]) {
+ this.$modes[this.$embeds[i]] = new mapping[this.$embeds[i]]();
+ }
+ }
+
+ var delegations = ['toggleCommentLines', 'getNextLineIndent', 'checkOutdent', 'autoOutdent', 'transformAction'];
+
+ for (var i = 0; i < delegations.length; i++) {
+ (function(scope) {
+ var functionName = delegations[i];
+ var defaultHandler = scope[functionName];
+ scope[delegations[i]] = function() {
+ return this.$delegator(functionName, arguments, defaultHandler);
+ }
+ } (this));
+ }
+ }
+
+ this.$delegator = function(method, args, defaultHandler) {
+ var state = args[0];
+
+ for (var i = 0; i < this.$embeds.length; i++) {
+ if (!this.$modes[this.$embeds[i]]) continue;
+
+ var split = state.split(this.$embeds[i]);
+ if (!split[0] && split[1]) {
+ args[0] = split[1];
+ var mode = this.$modes[this.$embeds[i]];
+ return mode[method].apply(mode, args);
+ }
+ }
+ var ret = defaultHandler.apply(this, args);
+ return defaultHandler ? ret : undefined;
+ };
+
+ this.transformAction = function(state, action, editor, session, param) {
+ if (this.$behaviour) {
+ var behaviours = this.$behaviour.getBehaviours();
+ for (var key in behaviours) {
+ if (behaviours[key][action]) {
+ var ret = behaviours[key][action].apply(this, arguments);
+ if (ret) {
+ return ret;
+ }
+ }
+ }
+ }
+ }
+
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+});
+
+ace.define('ace/tokenizer', ['require', 'exports', 'module' ], function(require, exports, module) {
+
+
+/**
+ * class Tokenizer
+ *
+ * This class takes a set of highlighting rules, and creates a tokenizer out of them. For more information, see [the wiki on extending highlighters](https://github.com/ajaxorg/ace/wiki/Creating-or-Extending-an-Edit-Mode#wiki-extendingTheHighlighter).
+ *
+ **/
+
+/**
+ * new Tokenizer(rules, flag)
+ * - rules (Object): The highlighting rules
+ * - flag (String): Any additional regular expression flags to pass (like "i" for case insensitive)
+ *
+ * Constructs a new tokenizer based on the given rules and flags.
+ *
+ **/
+var Tokenizer = function(rules, flag) {
+ flag = flag ? "g" + flag : "g";
+ this.rules = rules;
+
+ this.regExps = {};
+ this.matchMappings = {};
+ for ( var key in this.rules) {
+ var rule = this.rules[key];
+ var state = rule;
+ var ruleRegExps = [];
+ var matchTotal = 0;
+ var mapping = this.matchMappings[key] = {};
+
+ for ( var i = 0; i < state.length; i++) {
+
+ if (state[i].regex instanceof RegExp)
+ state[i].regex = state[i].regex.toString().slice(1, -1);
+
+ // Count number of matching groups. 2 extra groups from the full match
+ // And the catch-all on the end (used to force a match);
+ var matchcount = new RegExp("(?:(" + state[i].regex + ")|(.))").exec("a").length - 2;
+
+ // Replace any backreferences and offset appropriately.
+ var adjustedregex = state[i].regex.replace(/\\([0-9]+)/g, function (match, digit) {
+ return "\\" + (parseInt(digit, 10) + matchTotal + 1);
+ });
+
+ if (matchcount > 1 && state[i].token.length !== matchcount-1)
+ throw new Error("For " + state[i].regex + " the matching groups and length of the token array don't match (rule #" + i + " of state " + key + ")");
+
+ mapping[matchTotal] = {
+ rule: i,
+ len: matchcount
+ };
+ matchTotal += matchcount;
+
+ ruleRegExps.push(adjustedregex);
+ }
+
+ this.regExps[key] = new RegExp("(?:(" + ruleRegExps.join(")|(") + ")|(.))", flag);
+ }
+};
+
+(function() {
+
+ /**
+ * Tokenizer.getLineTokens() -> Object
+ *
+ * Returns an object containing two properties: `tokens`, which contains all the tokens; and `state`, the current state.
+ **/
+ this.getLineTokens = function(line, startState) {
+ var currentState = startState || "start";
+ var state = this.rules[currentState];
+ var mapping = this.matchMappings[currentState];
+ var re = this.regExps[currentState];
+ re.lastIndex = 0;
+
+ var match, tokens = [];
+
+ var lastIndex = 0;
+
+ var token = {
+ type: null,
+ value: ""
+ };
+
+ while (match = re.exec(line)) {
+ var type = "text";
+ var rule = null;
+ var value = [match[0]];
+
+ for (var i = 0; i < match.length-2; i++) {
+ if (match[i + 1] === undefined)
+ continue;
+
+ rule = state[mapping[i].rule];
+
+ if (mapping[i].len > 1)
+ value = match.slice(i+2, i+1+mapping[i].len);
+
+ // compute token type
+ if (typeof rule.token == "function")
+ type = rule.token.apply(this, value);
+ else
+ type = rule.token;
+
+ if (rule.next) {
+ currentState = rule.next;
+ state = this.rules[currentState];
+ mapping = this.matchMappings[currentState];
+ lastIndex = re.lastIndex;
+
+ re = this.regExps[currentState];
+
+ if (re === undefined) {
+ throw new Error("You indicated a state of " + rule.next + " to go to, but it doesn't exist!");
+ }
+
+ re.lastIndex = lastIndex;
+ }
+ break;
+ }
+
+ if (value[0]) {
+ if (typeof type == "string") {
+ value = [value.join("")];
+ type = [type];
+ }
+ for (var i = 0; i < value.length; i++) {
+ if (!value[i])
+ continue;
+
+ if ((!rule || rule.merge || type[i] === "text") && token.type === type[i]) {
+ token.value += value[i];
+ } else {
+ if (token.type)
+ tokens.push(token);
+
+ token = {
+ type: type[i],
+ value: value[i]
+ };
+ }
+ }
+ }
+
+ if (lastIndex == line.length)
+ break;
+
+ lastIndex = re.lastIndex;
+ }
+
+ if (token.type)
+ tokens.push(token);
+
+ return {
+ tokens : tokens,
+ state : currentState
+ };
+ };
+
+}).call(Tokenizer.prototype);
+
+exports.Tokenizer = Tokenizer;
+});
+
+ace.define('ace/mode/text_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/lang'], function(require, exports, module) {
+
+
+var lang = require("../lib/lang");
+
+var TextHighlightRules = function() {
+
+ // regexp must not have capturing parentheses
+ // regexps are ordered -> the first match is used
+
+ this.$rules = {
+ "start" : [{
+ token : "empty_line",
+ regex : '^$'
+ }, {
+ token : "text",
+ regex : ".+"
+ }]
+ };
+};
+
+(function() {
+
+ this.addRules = function(rules, prefix) {
+ for (var key in rules) {
+ var state = rules[key];
+ for (var i=0; i<state.length; i++) {
+ var rule = state[i];
+ if (rule.next) {
+ rule.next = prefix + rule.next;
+ }
+ }
+ this.$rules[prefix + key] = state;
+ }
+ };
+
+ this.getRules = function() {
+ return this.$rules;
+ };
+
+ this.embedRules = function (HighlightRules, prefix, escapeRules, states) {
+ var embedRules = new HighlightRules().getRules();
+ if (states) {
+ for (var i = 0; i < states.length; i++) {
+ states[i] = prefix + states[i];
+ }
+ } else {
+ states = [];
+ for (var key in embedRules) {
+ states.push(prefix + key);
+ }
+ }
+ this.addRules(embedRules, prefix);
+
+ for (var i = 0; i < states.length; i++) {
+ Array.prototype.unshift.apply(this.$rules[states[i]], lang.deepCopy(escapeRules));
+ }
+
+ if (!this.$embeds) {
+ this.$embeds = [];
+ }
+ this.$embeds.push(prefix);
+ }
+
+ this.getEmbeds = function() {
+ return this.$embeds;
+ }
+
+ this.createKeywordMapper = function(map, defaultToken, ignoreCase, splitChar) {
+ var keywords = Object.create(null);
+ Object.keys(map).forEach(function(className) {
+ var list = map[className].split(splitChar || "|");
+ for (var i = list.length; i--; )
+ keywords[list[i]] = className;
+ });
+ map = null;
+ return ignoreCase
+ ? function(value) {return keywords[value.toLowerCase()] || defaultToken }
+ : function(value) {return keywords[value] || defaultToken };
+ }
+
+}).call(TextHighlightRules.prototype);
+
+exports.TextHighlightRules = TextHighlightRules;
+});
+
+ace.define('ace/mode/behaviour', ['require', 'exports', 'module' ], function(require, exports, module) {
+
+
+var Behaviour = function() {
+ this.$behaviours = {};
+};
+
+(function () {
+
+ this.add = function (name, action, callback) {
+ switch (undefined) {
+ case this.$behaviours:
+ this.$behaviours = {};
+ case this.$behaviours[name]:
+ this.$behaviours[name] = {};
+ }
+ this.$behaviours[name][action] = callback;
+ }
+
+ this.addBehaviours = function (behaviours) {
+ for (var key in behaviours) {
+ for (var action in behaviours[key]) {
+ this.add(key, action, behaviours[key][action]);
+ }
+ }
+ }
+
+ this.remove = function (name) {
+ if (this.$behaviours && this.$behaviours[name]) {
+ delete this.$behaviours[name];
+ }
+ }
+
+ this.inherit = function (mode, filter) {
+ if (typeof mode === "function") {
+ var behaviours = new mode().getBehaviours(filter);
+ } else {
+ var behaviours = mode.getBehaviours(filter);
+ }
+ this.addBehaviours(behaviours);
+ }
+
+ this.getBehaviours = function (filter) {
+ if (!filter) {
+ return this.$behaviours;
+ } else {
+ var ret = {}
+ for (var i = 0; i < filter.length; i++) {
+ if (this.$behaviours[filter[i]]) {
+ ret[filter[i]] = this.$behaviours[filter[i]];
+ }
+ }
+ return ret;
+ }
+ }
+
+}).call(Behaviour.prototype);
+
+exports.Behaviour = Behaviour;
+});
+ace.define('ace/unicode', ['require', 'exports', 'module' ], function(require, exports, module) {
+
+
+/*
+XRegExp Unicode plugin pack: Categories 1.0
+(c) 2010 Steven Levithan
+MIT License
+<http://xregexp.com>
+Uses the Unicode 5.2 character database
+
+This package for the XRegExp Unicode plugin enables the following Unicode categories (aka properties):
+
+L - Letter (the top-level Letter category is included in the Unicode plugin base script)
+ Ll - Lowercase letter
+ Lu - Uppercase letter
+ Lt - Titlecase letter
+ Lm - Modifier letter
+ Lo - Letter without case
+M - Mark
+ Mn - Non-spacing mark
+ Mc - Spacing combining mark
+ Me - Enclosing mark
+N - Number
+ Nd - Decimal digit
+ Nl - Letter number
+ No - Other number
+P - Punctuation
+ Pd - Dash punctuation
+ Ps - Open punctuation
+ Pe - Close punctuation
+ Pi - Initial punctuation
+ Pf - Final punctuation
+ Pc - Connector punctuation
+ Po - Other punctuation
+S - Symbol
+ Sm - Math symbol
+ Sc - Currency symbol
+ Sk - Modifier symbol
+ So - Other symbol
+Z - Separator
+ Zs - Space separator
+ Zl - Line separator
+ Zp - Paragraph separator
+C - Other
+ Cc - Control
+ Cf - Format
+ Co - Private use
+ Cs - Surrogate
+ Cn - Unassigned
+
+Example usage:
+
+ \p{N}
+ \p{Cn}
+*/
+
+
+// will be populated by addUnicodePackage
+exports.packages = {};
+
+addUnicodePackage({
+ L: "0041-005A0061-007A00AA00B500BA00C0-00D600D8-00F600F8-02C102C6-02D102E0-02E402EC02EE0370-037403760377037A-037D03860388-038A038C038E-03A103A3-03F503F7-0481048A-05250531-055605590561-058705D0-05EA05F0-05F20621-064A066E066F0671-06D306D506E506E606EE06EF06FA-06FC06FF07100712-072F074D-07A507B107CA-07EA07F407F507FA0800-0815081A082408280904-0939093D09500958-0961097109720979-097F0985-098C098F09900993-09A809AA-09B009B209B6-09B909BD09CE09DC09DD09DF-09E109F009F10A05-0A0A0A0F0A100A13-0A280A2A-0A300A320A330A350A360A380A390A59-0A5C0A5E0A72-0A740A85-0A8D0A8F-0A910A93-0AA80AAA-0AB00AB20AB30AB5-0AB90ABD0AD00AE00AE10B05-0B0C0B0F0B100B13-0B280B2A-0B300B320B330B35-0B390B3D0B5C0B5D0B5F-0B610B710B830B85-0B8A0B8E-0B900B92-0B950B990B9A0B9C0B9E0B9F0BA30BA40BA8-0BAA0BAE-0BB90BD00C05-0C0C0C0E-0C100C12-0C280C2A-0C330C35-0C390C3D0C580C590C600C610C85-0C8C0C8E-0C900C92-0CA80CAA-0CB30CB5-0CB90CBD0CDE0CE00CE10D05-0D0C0D0E-0D100D12-0D280D2A-0D390D3D0D600D610D7A-0D7F0D85-0D960D9A-0DB10DB3-0DBB0DBD0DC0-0DC60E01-0E300E320E330E40-0E460E810E820E840E870E880E8A0E8D0E94-0E970E99-0E9F0EA1-0EA30EA50EA70EAA0EAB0EAD-0EB00EB20EB30EBD0EC0-0EC40EC60EDC0EDD0F000F40-0F470F49-0F6C0F88-0F8B1000-102A103F1050-1055105A-105D106110651066106E-10701075-1081108E10A0-10C510D0-10FA10FC1100-1248124A-124D1250-12561258125A-125D1260-1288128A-128D1290-12B012B2-12B512B8-12BE12C012C2-12C512C8-12D612D8-13101312-13151318-135A1380-138F13A0-13F41401-166C166F-167F1681-169A16A0-16EA1700-170C170E-17111720-17311740-17511760-176C176E-17701780-17B317D717DC1820-18771880-18A818AA18B0-18F51900-191C1950-196D1970-19741980-19AB19C1-19C71A00-1A161A20-1A541AA71B05-1B331B45-1B4B1B83-1BA01BAE1BAF1C00-1C231C4D-1C4F1C5A-1C7D1CE9-1CEC1CEE-1CF11D00-1DBF1E00-1F151F18-1F1D1F20-1F451F48-1F4D1F50-1F571F591F5B1F5D1F5F-1F7D1F80-1FB41FB6-1FBC1FBE1FC2-1FC41FC6-1FCC1FD0-1FD31FD6-1FDB1FE0-1FEC1FF2-1FF41FF6-1FFC2071207F2090-209421022107210A-211321152119-211D212421262128212A-212D212F-2139213C-213F2145-2149214E218321842C00-2C2E2C30-2C5E2C60-2CE42CEB-2CEE2D00-2D252D30-2D652D6F2D80-2D962DA0-2DA62DA8-2DAE2DB0-2DB62DB8-2DBE2DC0-2DC62DC8-2DCE2DD0-2DD62DD8-2DDE2E2F300530063031-3035303B303C3041-3096309D-309F30A1-30FA30FC-30FF3105-312D3131-318E31A0-31B731F0-31FF3400-4DB54E00-9FCBA000-A48CA4D0-A4FDA500-A60CA610-A61FA62AA62BA640-A65FA662-A66EA67F-A697A6A0-A6E5A717-A71FA722-A788A78BA78CA7FB-A801A803-A805A807-A80AA80C-A822A840-A873A882-A8B3A8F2-A8F7A8FBA90A-A925A930-A946A960-A97CA984-A9B2A9CFAA00-AA28AA40-AA42AA44-AA4BAA60-AA76AA7AAA80-AAAFAAB1AAB5AAB6AAB9-AABDAAC0AAC2AADB-AADDABC0-ABE2AC00-D7A3D7B0-D7C6D7CB-D7FBF900-FA2DFA30-FA6DFA70-FAD9FB00-FB06FB13-FB17FB1DFB1F-FB28FB2A-FB36FB38-FB3CFB3EFB40FB41FB43FB44FB46-FBB1FBD3-FD3DFD50-FD8FFD92-FDC7FDF0-FDFBFE70-FE74FE76-FEFCFF21-FF3AFF41-FF5AFF66-FFBEFFC2-FFC7FFCA-FFCFFFD2-FFD7FFDA-FFDC",
+ Ll: "0061-007A00AA00B500BA00DF-00F600F8-00FF01010103010501070109010B010D010F01110113011501170119011B011D011F01210123012501270129012B012D012F01310133013501370138013A013C013E014001420144014601480149014B014D014F01510153015501570159015B015D015F01610163016501670169016B016D016F0171017301750177017A017C017E-0180018301850188018C018D019201950199-019B019E01A101A301A501A801AA01AB01AD01B001B401B601B901BA01BD-01BF01C601C901CC01CE01D001D201D401D601D801DA01DC01DD01DF01E101E301E501E701E901EB01ED01EF01F001F301F501F901FB01FD01FF02010203020502070209020B020D020F02110213021502170219021B021D021F02210223022502270229022B022D022F02310233-0239023C023F0240024202470249024B024D024F-02930295-02AF037103730377037B-037D039003AC-03CE03D003D103D5-03D703D903DB03DD03DF03E103E303E503E703E903EB03ED03EF-03F303F503F803FB03FC0430-045F04610463046504670469046B046D046F04710473047504770479047B047D047F0481048B048D048F04910493049504970499049B049D049F04A104A304A504A704A904AB04AD04AF04B104B304B504B704B904BB04BD04BF04C204C404C604C804CA04CC04CE04CF04D104D304D504D704D904DB04DD04DF04E104E304E504E704E904EB04ED04EF04F104F304F504F704F904FB04FD04FF05010503050505070509050B050D050F05110513051505170519051B051D051F0521052305250561-05871D00-1D2B1D62-1D771D79-1D9A1E011E031E051E071E091E0B1E0D1E0F1E111E131E151E171E191E1B1E1D1E1F1E211E231E251E271E291E2B1E2D1E2F1E311E331E351E371E391E3B1E3D1E3F1E411E431E451E471E491E4B1E4D1E4F1E511E531E551E571E591E5B1E5D1E5F1E611E631E651E671E691E6B1E6D1E6F1E711E731E751E771E791E7B1E7D1E7F1E811E831E851E871E891E8B1E8D1E8F1E911E931E95-1E9D1E9F1EA11EA31EA51EA71EA91EAB1EAD1EAF1EB11EB31EB51EB71EB91EBB1EBD1EBF1EC11EC31EC51EC71EC91ECB1ECD1ECF1ED11ED31ED51ED71ED91EDB1EDD1EDF1EE11EE31EE51EE71EE91EEB1EED1EEF1EF11EF31EF51EF71EF91EFB1EFD1EFF-1F071F10-1F151F20-1F271F30-1F371F40-1F451F50-1F571F60-1F671F70-1F7D1F80-1F871F90-1F971FA0-1FA71FB0-1FB41FB61FB71FBE1FC2-1FC41FC61FC71FD0-1FD31FD61FD71FE0-1FE71FF2-1FF41FF61FF7210A210E210F2113212F21342139213C213D2146-2149214E21842C30-2C5E2C612C652C662C682C6A2C6C2C712C732C742C76-2C7C2C812C832C852C872C892C8B2C8D2C8F2C912C932C952C972C992C9B2C9D2C9F2CA12CA32CA52CA72CA92CAB2CAD2CAF2CB12CB32CB52CB72CB92CBB2CBD2CBF2CC12CC32CC52CC72CC92CCB2CCD2CCF2CD12CD32CD52CD72CD92CDB2CDD2CDF2CE12CE32CE42CEC2CEE2D00-2D25A641A643A645A647A649A64BA64DA64FA651A653A655A657A659A65BA65DA65FA663A665A667A669A66BA66DA681A683A685A687A689A68BA68DA68FA691A693A695A697A723A725A727A729A72BA72DA72F-A731A733A735A737A739A73BA73DA73FA741A743A745A747A749A74BA74DA74FA751A753A755A757A759A75BA75DA75FA761A763A765A767A769A76BA76DA76FA771-A778A77AA77CA77FA781A783A785A787A78CFB00-FB06FB13-FB17FF41-FF5A",
+ Lu: "0041-005A00C0-00D600D8-00DE01000102010401060108010A010C010E01100112011401160118011A011C011E01200122012401260128012A012C012E01300132013401360139013B013D013F0141014301450147014A014C014E01500152015401560158015A015C015E01600162016401660168016A016C016E017001720174017601780179017B017D018101820184018601870189-018B018E-0191019301940196-0198019C019D019F01A001A201A401A601A701A901AC01AE01AF01B1-01B301B501B701B801BC01C401C701CA01CD01CF01D101D301D501D701D901DB01DE01E001E201E401E601E801EA01EC01EE01F101F401F6-01F801FA01FC01FE02000202020402060208020A020C020E02100212021402160218021A021C021E02200222022402260228022A022C022E02300232023A023B023D023E02410243-02460248024A024C024E03700372037603860388-038A038C038E038F0391-03A103A3-03AB03CF03D2-03D403D803DA03DC03DE03E003E203E403E603E803EA03EC03EE03F403F703F903FA03FD-042F04600462046404660468046A046C046E04700472047404760478047A047C047E0480048A048C048E04900492049404960498049A049C049E04A004A204A404A604A804AA04AC04AE04B004B204B404B604B804BA04BC04BE04C004C104C304C504C704C904CB04CD04D004D204D404D604D804DA04DC04DE04E004E204E404E604E804EA04EC04EE04F004F204F404F604F804FA04FC04FE05000502050405060508050A050C050E05100512051405160518051A051C051E0520052205240531-055610A0-10C51E001E021E041E061E081E0A1E0C1E0E1E101E121E141E161E181E1A1E1C1E1E1E201E221E241E261E281E2A1E2C1E2E1E301E321E341E361E381E3A1E3C1E3E1E401E421E441E461E481E4A1E4C1E4E1E501E521E541E561E581E5A1E5C1E5E1E601E621E641E661E681E6A1E6C1E6E1E701E721E741E761E781E7A1E7C1E7E1E801E821E841E861E881E8A1E8C1E8E1E901E921E941E9E1EA01EA21EA41EA61EA81EAA1EAC1EAE1EB01EB21EB41EB61EB81EBA1EBC1EBE1EC01EC21EC41EC61EC81ECA1ECC1ECE1ED01ED21ED41ED61ED81EDA1EDC1EDE1EE01EE21EE41EE61EE81EEA1EEC1EEE1EF01EF21EF41EF61EF81EFA1EFC1EFE1F08-1F0F1F18-1F1D1F28-1F2F1F38-1F3F1F48-1F4D1F591F5B1F5D1F5F1F68-1F6F1FB8-1FBB1FC8-1FCB1FD8-1FDB1FE8-1FEC1FF8-1FFB21022107210B-210D2110-211221152119-211D212421262128212A-212D2130-2133213E213F214521832C00-2C2E2C602C62-2C642C672C692C6B2C6D-2C702C722C752C7E-2C802C822C842C862C882C8A2C8C2C8E2C902C922C942C962C982C9A2C9C2C9E2CA02CA22CA42CA62CA82CAA2CAC2CAE2CB02CB22CB42CB62CB82CBA2CBC2CBE2CC02CC22CC42CC62CC82CCA2CCC2CCE2CD02CD22CD42CD62CD82CDA2CDC2CDE2CE02CE22CEB2CEDA640A642A644A646A648A64AA64CA64EA650A652A654A656A658A65AA65CA65EA662A664A666A668A66AA66CA680A682A684A686A688A68AA68CA68EA690A692A694A696A722A724A726A728A72AA72CA72EA732A734A736A738A73AA73CA73EA740A742A744A746A748A74AA74CA74EA750A752A754A756A758A75AA75CA75EA760A762A764A766A768A76AA76CA76EA779A77BA77DA77EA780A782A784A786A78BFF21-FF3A",
+ Lt: "01C501C801CB01F21F88-1F8F1F98-1F9F1FA8-1FAF1FBC1FCC1FFC",
+ Lm: "02B0-02C102C6-02D102E0-02E402EC02EE0374037A0559064006E506E607F407F507FA081A0824082809710E460EC610FC17D718431AA71C78-1C7D1D2C-1D611D781D9B-1DBF2071207F2090-20942C7D2D6F2E2F30053031-3035303B309D309E30FC-30FEA015A4F8-A4FDA60CA67FA717-A71FA770A788A9CFAA70AADDFF70FF9EFF9F",
+ Lo: "01BB01C0-01C3029405D0-05EA05F0-05F20621-063F0641-064A066E066F0671-06D306D506EE06EF06FA-06FC06FF07100712-072F074D-07A507B107CA-07EA0800-08150904-0939093D09500958-096109720979-097F0985-098C098F09900993-09A809AA-09B009B209B6-09B909BD09CE09DC09DD09DF-09E109F009F10A05-0A0A0A0F0A100A13-0A280A2A-0A300A320A330A350A360A380A390A59-0A5C0A5E0A72-0A740A85-0A8D0A8F-0A910A93-0AA80AAA-0AB00AB20AB30AB5-0AB90ABD0AD00AE00AE10B05-0B0C0B0F0B100B13-0B280B2A-0B300B320B330B35-0B390B3D0B5C0B5D0B5F-0B610B710B830B85-0B8A0B8E-0B900B92-0B950B990B9A0B9C0B9E0B9F0BA30BA40BA8-0BAA0BAE-0BB90BD00C05-0C0C0C0E-0C100C12-0C280C2A-0C330C35-0C390C3D0C580C590C600C610C85-0C8C0C8E-0C900C92-0CA80CAA-0CB30CB5-0CB90CBD0CDE0CE00CE10D05-0D0C0D0E-0D100D12-0D280D2A-0D390D3D0D600D610D7A-0D7F0D85-0D960D9A-0DB10DB3-0DBB0DBD0DC0-0DC60E01-0E300E320E330E40-0E450E810E820E840E870E880E8A0E8D0E94-0E970E99-0E9F0EA1-0EA30EA50EA70EAA0EAB0EAD-0EB00EB20EB30EBD0EC0-0EC40EDC0EDD0F000F40-0F470F49-0F6C0F88-0F8B1000-102A103F1050-1055105A-105D106110651066106E-10701075-1081108E10D0-10FA1100-1248124A-124D1250-12561258125A-125D1260-1288128A-128D1290-12B012B2-12B512B8-12BE12C012C2-12C512C8-12D612D8-13101312-13151318-135A1380-138F13A0-13F41401-166C166F-167F1681-169A16A0-16EA1700-170C170E-17111720-17311740-17511760-176C176E-17701780-17B317DC1820-18421844-18771880-18A818AA18B0-18F51900-191C1950-196D1970-19741980-19AB19C1-19C71A00-1A161A20-1A541B05-1B331B45-1B4B1B83-1BA01BAE1BAF1C00-1C231C4D-1C4F1C5A-1C771CE9-1CEC1CEE-1CF12135-21382D30-2D652D80-2D962DA0-2DA62DA8-2DAE2DB0-2DB62DB8-2DBE2DC0-2DC62DC8-2DCE2DD0-2DD62DD8-2DDE3006303C3041-3096309F30A1-30FA30FF3105-312D3131-318E31A0-31B731F0-31FF3400-4DB54E00-9FCBA000-A014A016-A48CA4D0-A4F7A500-A60BA610-A61FA62AA62BA66EA6A0-A6E5A7FB-A801A803-A805A807-A80AA80C-A822A840-A873A882-A8B3A8F2-A8F7A8FBA90A-A925A930-A946A960-A97CA984-A9B2AA00-AA28AA40-AA42AA44-AA4BAA60-AA6FAA71-AA76AA7AAA80-AAAFAAB1AAB5AAB6AAB9-AABDAAC0AAC2AADBAADCABC0-ABE2AC00-D7A3D7B0-D7C6D7CB-D7FBF900-FA2DFA30-FA6DFA70-FAD9FB1DFB1F-FB28FB2A-FB36FB38-FB3CFB3EFB40FB41FB43FB44FB46-FBB1FBD3-FD3DFD50-FD8FFD92-FDC7FDF0-FDFBFE70-FE74FE76-FEFCFF66-FF6FFF71-FF9DFFA0-FFBEFFC2-FFC7FFCA-FFCFFFD2-FFD7FFDA-FFDC",
+ M: "0300-036F0483-04890591-05BD05BF05C105C205C405C505C70610-061A064B-065E067006D6-06DC06DE-06E406E706E806EA-06ED07110730-074A07A6-07B007EB-07F30816-0819081B-08230825-08270829-082D0900-0903093C093E-094E0951-0955096209630981-098309BC09BE-09C409C709C809CB-09CD09D709E209E30A01-0A030A3C0A3E-0A420A470A480A4B-0A4D0A510A700A710A750A81-0A830ABC0ABE-0AC50AC7-0AC90ACB-0ACD0AE20AE30B01-0B030B3C0B3E-0B440B470B480B4B-0B4D0B560B570B620B630B820BBE-0BC20BC6-0BC80BCA-0BCD0BD70C01-0C030C3E-0C440C46-0C480C4A-0C4D0C550C560C620C630C820C830CBC0CBE-0CC40CC6-0CC80CCA-0CCD0CD50CD60CE20CE30D020D030D3E-0D440D46-0D480D4A-0D4D0D570D620D630D820D830DCA0DCF-0DD40DD60DD8-0DDF0DF20DF30E310E34-0E3A0E47-0E4E0EB10EB4-0EB90EBB0EBC0EC8-0ECD0F180F190F350F370F390F3E0F3F0F71-0F840F860F870F90-0F970F99-0FBC0FC6102B-103E1056-1059105E-10601062-10641067-106D1071-10741082-108D108F109A-109D135F1712-17141732-1734175217531772177317B6-17D317DD180B-180D18A91920-192B1930-193B19B0-19C019C819C91A17-1A1B1A55-1A5E1A60-1A7C1A7F1B00-1B041B34-1B441B6B-1B731B80-1B821BA1-1BAA1C24-1C371CD0-1CD21CD4-1CE81CED1CF21DC0-1DE61DFD-1DFF20D0-20F02CEF-2CF12DE0-2DFF302A-302F3099309AA66F-A672A67CA67DA6F0A6F1A802A806A80BA823-A827A880A881A8B4-A8C4A8E0-A8F1A926-A92DA947-A953A980-A983A9B3-A9C0AA29-AA36AA43AA4CAA4DAA7BAAB0AAB2-AAB4AAB7AAB8AABEAABFAAC1ABE3-ABEAABECABEDFB1EFE00-FE0FFE20-FE26",
+ Mn: "0300-036F0483-04870591-05BD05BF05C105C205C405C505C70610-061A064B-065E067006D6-06DC06DF-06E406E706E806EA-06ED07110730-074A07A6-07B007EB-07F30816-0819081B-08230825-08270829-082D0900-0902093C0941-0948094D0951-095509620963098109BC09C1-09C409CD09E209E30A010A020A3C0A410A420A470A480A4B-0A4D0A510A700A710A750A810A820ABC0AC1-0AC50AC70AC80ACD0AE20AE30B010B3C0B3F0B41-0B440B4D0B560B620B630B820BC00BCD0C3E-0C400C46-0C480C4A-0C4D0C550C560C620C630CBC0CBF0CC60CCC0CCD0CE20CE30D41-0D440D4D0D620D630DCA0DD2-0DD40DD60E310E34-0E3A0E47-0E4E0EB10EB4-0EB90EBB0EBC0EC8-0ECD0F180F190F350F370F390F71-0F7E0F80-0F840F860F870F90-0F970F99-0FBC0FC6102D-10301032-10371039103A103D103E10581059105E-10601071-1074108210851086108D109D135F1712-17141732-1734175217531772177317B7-17BD17C617C9-17D317DD180B-180D18A91920-19221927192819321939-193B1A171A181A561A58-1A5E1A601A621A65-1A6C1A73-1A7C1A7F1B00-1B031B341B36-1B3A1B3C1B421B6B-1B731B801B811BA2-1BA51BA81BA91C2C-1C331C361C371CD0-1CD21CD4-1CE01CE2-1CE81CED1DC0-1DE61DFD-1DFF20D0-20DC20E120E5-20F02CEF-2CF12DE0-2DFF302A-302F3099309AA66FA67CA67DA6F0A6F1A802A806A80BA825A826A8C4A8E0-A8F1A926-A92DA947-A951A980-A982A9B3A9B6-A9B9A9BCAA29-AA2EAA31AA32AA35AA36AA43AA4CAAB0AAB2-AAB4AAB7AAB8AABEAABFAAC1ABE5ABE8ABEDFB1EFE00-FE0FFE20-FE26",
+ Mc: "0903093E-09400949-094C094E0982098309BE-09C009C709C809CB09CC09D70A030A3E-0A400A830ABE-0AC00AC90ACB0ACC0B020B030B3E0B400B470B480B4B0B4C0B570BBE0BBF0BC10BC20BC6-0BC80BCA-0BCC0BD70C01-0C030C41-0C440C820C830CBE0CC0-0CC40CC70CC80CCA0CCB0CD50CD60D020D030D3E-0D400D46-0D480D4A-0D4C0D570D820D830DCF-0DD10DD8-0DDF0DF20DF30F3E0F3F0F7F102B102C10311038103B103C105610571062-10641067-106D108310841087-108C108F109A-109C17B617BE-17C517C717C81923-19261929-192B193019311933-193819B0-19C019C819C91A19-1A1B1A551A571A611A631A641A6D-1A721B041B351B3B1B3D-1B411B431B441B821BA11BA61BA71BAA1C24-1C2B1C341C351CE11CF2A823A824A827A880A881A8B4-A8C3A952A953A983A9B4A9B5A9BAA9BBA9BD-A9C0AA2FAA30AA33AA34AA4DAA7BABE3ABE4ABE6ABE7ABE9ABEAABEC",
+ Me: "0488048906DE20DD-20E020E2-20E4A670-A672",
+ N: "0030-003900B200B300B900BC-00BE0660-066906F0-06F907C0-07C90966-096F09E6-09EF09F4-09F90A66-0A6F0AE6-0AEF0B66-0B6F0BE6-0BF20C66-0C6F0C78-0C7E0CE6-0CEF0D66-0D750E50-0E590ED0-0ED90F20-0F331040-10491090-10991369-137C16EE-16F017E0-17E917F0-17F91810-18191946-194F19D0-19DA1A80-1A891A90-1A991B50-1B591BB0-1BB91C40-1C491C50-1C5920702074-20792080-20892150-21822185-21892460-249B24EA-24FF2776-27932CFD30073021-30293038-303A3192-31953220-32293251-325F3280-328932B1-32BFA620-A629A6E6-A6EFA830-A835A8D0-A8D9A900-A909A9D0-A9D9AA50-AA59ABF0-ABF9FF10-FF19",
+ Nd: "0030-00390660-066906F0-06F907C0-07C90966-096F09E6-09EF0A66-0A6F0AE6-0AEF0B66-0B6F0BE6-0BEF0C66-0C6F0CE6-0CEF0D66-0D6F0E50-0E590ED0-0ED90F20-0F291040-10491090-109917E0-17E91810-18191946-194F19D0-19DA1A80-1A891A90-1A991B50-1B591BB0-1BB91C40-1C491C50-1C59A620-A629A8D0-A8D9A900-A909A9D0-A9D9AA50-AA59ABF0-ABF9FF10-FF19",
+ Nl: "16EE-16F02160-21822185-218830073021-30293038-303AA6E6-A6EF",
+ No: "00B200B300B900BC-00BE09F4-09F90BF0-0BF20C78-0C7E0D70-0D750F2A-0F331369-137C17F0-17F920702074-20792080-20892150-215F21892460-249B24EA-24FF2776-27932CFD3192-31953220-32293251-325F3280-328932B1-32BFA830-A835",
+ P: "0021-00230025-002A002C-002F003A003B003F0040005B-005D005F007B007D00A100AB00B700BB00BF037E0387055A-055F0589058A05BE05C005C305C605F305F40609060A060C060D061B061E061F066A-066D06D40700-070D07F7-07F90830-083E0964096509700DF40E4F0E5A0E5B0F04-0F120F3A-0F3D0F850FD0-0FD4104A-104F10FB1361-13681400166D166E169B169C16EB-16ED1735173617D4-17D617D8-17DA1800-180A1944194519DE19DF1A1E1A1F1AA0-1AA61AA8-1AAD1B5A-1B601C3B-1C3F1C7E1C7F1CD32010-20272030-20432045-20512053-205E207D207E208D208E2329232A2768-277527C527C627E6-27EF2983-299829D8-29DB29FC29FD2CF9-2CFC2CFE2CFF2E00-2E2E2E302E313001-30033008-30113014-301F3030303D30A030FBA4FEA4FFA60D-A60FA673A67EA6F2-A6F7A874-A877A8CEA8CFA8F8-A8FAA92EA92FA95FA9C1-A9CDA9DEA9DFAA5C-AA5FAADEAADFABEBFD3EFD3FFE10-FE19FE30-FE52FE54-FE61FE63FE68FE6AFE6BFF01-FF03FF05-FF0AFF0C-FF0FFF1AFF1BFF1FFF20FF3B-FF3DFF3FFF5BFF5DFF5F-FF65",
+ Pd: "002D058A05BE140018062010-20152E172E1A301C303030A0FE31FE32FE58FE63FF0D",
+ Ps: "0028005B007B0F3A0F3C169B201A201E2045207D208D23292768276A276C276E27702772277427C527E627E827EA27EC27EE2983298529872989298B298D298F299129932995299729D829DA29FC2E222E242E262E283008300A300C300E3010301430163018301A301DFD3EFE17FE35FE37FE39FE3BFE3DFE3FFE41FE43FE47FE59FE5BFE5DFF08FF3BFF5BFF5FFF62",
+ Pe: "0029005D007D0F3B0F3D169C2046207E208E232A2769276B276D276F27712773277527C627E727E927EB27ED27EF298429862988298A298C298E2990299229942996299829D929DB29FD2E232E252E272E293009300B300D300F3011301530173019301B301E301FFD3FFE18FE36FE38FE3AFE3CFE3EFE40FE42FE44FE48FE5AFE5CFE5EFF09FF3DFF5DFF60FF63",
+ Pi: "00AB2018201B201C201F20392E022E042E092E0C2E1C2E20",
+ Pf: "00BB2019201D203A2E032E052E0A2E0D2E1D2E21",
+ Pc: "005F203F20402054FE33FE34FE4D-FE4FFF3F",
+ Po: "0021-00230025-0027002A002C002E002F003A003B003F0040005C00A100B700BF037E0387055A-055F058905C005C305C605F305F40609060A060C060D061B061E061F066A-066D06D40700-070D07F7-07F90830-083E0964096509700DF40E4F0E5A0E5B0F04-0F120F850FD0-0FD4104A-104F10FB1361-1368166D166E16EB-16ED1735173617D4-17D617D8-17DA1800-18051807-180A1944194519DE19DF1A1E1A1F1AA0-1AA61AA8-1AAD1B5A-1B601C3B-1C3F1C7E1C7F1CD3201620172020-20272030-2038203B-203E2041-20432047-205120532055-205E2CF9-2CFC2CFE2CFF2E002E012E06-2E082E0B2E0E-2E162E182E192E1B2E1E2E1F2E2A-2E2E2E302E313001-3003303D30FBA4FEA4FFA60D-A60FA673A67EA6F2-A6F7A874-A877A8CEA8CFA8F8-A8FAA92EA92FA95FA9C1-A9CDA9DEA9DFAA5C-AA5FAADEAADFABEBFE10-FE16FE19FE30FE45FE46FE49-FE4CFE50-FE52FE54-FE57FE5F-FE61FE68FE6AFE6BFF01-FF03FF05-FF07FF0AFF0CFF0EFF0FFF1AFF1BFF1FFF20FF3CFF61FF64FF65",
+ S: "0024002B003C-003E005E0060007C007E00A2-00A900AC00AE-00B100B400B600B800D700F702C2-02C502D2-02DF02E5-02EB02ED02EF-02FF03750384038503F604820606-0608060B060E060F06E906FD06FE07F609F209F309FA09FB0AF10B700BF3-0BFA0C7F0CF10CF20D790E3F0F01-0F030F13-0F170F1A-0F1F0F340F360F380FBE-0FC50FC7-0FCC0FCE0FCF0FD5-0FD8109E109F13601390-139917DB194019E0-19FF1B61-1B6A1B74-1B7C1FBD1FBF-1FC11FCD-1FCF1FDD-1FDF1FED-1FEF1FFD1FFE20442052207A-207C208A-208C20A0-20B8210021012103-21062108210921142116-2118211E-2123212521272129212E213A213B2140-2144214A-214D214F2190-2328232B-23E82400-24262440-244A249C-24E92500-26CD26CF-26E126E326E8-26FF2701-27042706-2709270C-27272729-274B274D274F-27522756-275E2761-276727942798-27AF27B1-27BE27C0-27C427C7-27CA27CC27D0-27E527F0-29822999-29D729DC-29FB29FE-2B4C2B50-2B592CE5-2CEA2E80-2E992E9B-2EF32F00-2FD52FF0-2FFB300430123013302030363037303E303F309B309C319031913196-319F31C0-31E33200-321E322A-32503260-327F328A-32B032C0-32FE3300-33FF4DC0-4DFFA490-A4C6A700-A716A720A721A789A78AA828-A82BA836-A839AA77-AA79FB29FDFCFDFDFE62FE64-FE66FE69FF04FF0BFF1C-FF1EFF3EFF40FF5CFF5EFFE0-FFE6FFE8-FFEEFFFCFFFD",
+ Sm: "002B003C-003E007C007E00AC00B100D700F703F60606-060820442052207A-207C208A-208C2140-2144214B2190-2194219A219B21A021A321A621AE21CE21CF21D221D421F4-22FF2308-230B23202321237C239B-23B323DC-23E125B725C125F8-25FF266F27C0-27C427C7-27CA27CC27D0-27E527F0-27FF2900-29822999-29D729DC-29FB29FE-2AFF2B30-2B442B47-2B4CFB29FE62FE64-FE66FF0BFF1C-FF1EFF5CFF5EFFE2FFE9-FFEC",
+ Sc: "002400A2-00A5060B09F209F309FB0AF10BF90E3F17DB20A0-20B8A838FDFCFE69FF04FFE0FFE1FFE5FFE6",
+ Sk: "005E006000A800AF00B400B802C2-02C502D2-02DF02E5-02EB02ED02EF-02FF0375038403851FBD1FBF-1FC11FCD-1FCF1FDD-1FDF1FED-1FEF1FFD1FFE309B309CA700-A716A720A721A789A78AFF3EFF40FFE3",
+ So: "00A600A700A900AE00B000B60482060E060F06E906FD06FE07F609FA0B700BF3-0BF80BFA0C7F0CF10CF20D790F01-0F030F13-0F170F1A-0F1F0F340F360F380FBE-0FC50FC7-0FCC0FCE0FCF0FD5-0FD8109E109F13601390-1399194019E0-19FF1B61-1B6A1B74-1B7C210021012103-21062108210921142116-2118211E-2123212521272129212E213A213B214A214C214D214F2195-2199219C-219F21A121A221A421A521A7-21AD21AF-21CD21D021D121D321D5-21F32300-2307230C-231F2322-2328232B-237B237D-239A23B4-23DB23E2-23E82400-24262440-244A249C-24E92500-25B625B8-25C025C2-25F72600-266E2670-26CD26CF-26E126E326E8-26FF2701-27042706-2709270C-27272729-274B274D274F-27522756-275E2761-276727942798-27AF27B1-27BE2800-28FF2B00-2B2F2B452B462B50-2B592CE5-2CEA2E80-2E992E9B-2EF32F00-2FD52FF0-2FFB300430123013302030363037303E303F319031913196-319F31C0-31E33200-321E322A-32503260-327F328A-32B032C0-32FE3300-33FF4DC0-4DFFA490-A4C6A828-A82BA836A837A839AA77-AA79FDFDFFE4FFE8FFEDFFEEFFFCFFFD",
+ Z: "002000A01680180E2000-200A20282029202F205F3000",
+ Zs: "002000A01680180E2000-200A202F205F3000",
+ Zl: "2028",
+ Zp: "2029",
+ C: "0000-001F007F-009F00AD03780379037F-0383038B038D03A20526-05300557055805600588058B-059005C8-05CF05EB-05EF05F5-0605061C061D0620065F06DD070E070F074B074C07B2-07BF07FB-07FF082E082F083F-08FF093A093B094F095609570973-097809800984098D098E0991099209A909B109B3-09B509BA09BB09C509C609C909CA09CF-09D609D8-09DB09DE09E409E509FC-0A000A040A0B-0A0E0A110A120A290A310A340A370A3A0A3B0A3D0A43-0A460A490A4A0A4E-0A500A52-0A580A5D0A5F-0A650A76-0A800A840A8E0A920AA90AB10AB40ABA0ABB0AC60ACA0ACE0ACF0AD1-0ADF0AE40AE50AF00AF2-0B000B040B0D0B0E0B110B120B290B310B340B3A0B3B0B450B460B490B4A0B4E-0B550B58-0B5B0B5E0B640B650B72-0B810B840B8B-0B8D0B910B96-0B980B9B0B9D0BA0-0BA20BA5-0BA70BAB-0BAD0BBA-0BBD0BC3-0BC50BC90BCE0BCF0BD1-0BD60BD8-0BE50BFB-0C000C040C0D0C110C290C340C3A-0C3C0C450C490C4E-0C540C570C5A-0C5F0C640C650C70-0C770C800C810C840C8D0C910CA90CB40CBA0CBB0CC50CC90CCE-0CD40CD7-0CDD0CDF0CE40CE50CF00CF3-0D010D040D0D0D110D290D3A-0D3C0D450D490D4E-0D560D58-0D5F0D640D650D76-0D780D800D810D840D97-0D990DB20DBC0DBE0DBF0DC7-0DC90DCB-0DCE0DD50DD70DE0-0DF10DF5-0E000E3B-0E3E0E5C-0E800E830E850E860E890E8B0E8C0E8E-0E930E980EA00EA40EA60EA80EA90EAC0EBA0EBE0EBF0EC50EC70ECE0ECF0EDA0EDB0EDE-0EFF0F480F6D-0F700F8C-0F8F0F980FBD0FCD0FD9-0FFF10C6-10CF10FD-10FF1249124E124F12571259125E125F1289128E128F12B112B612B712BF12C112C612C712D7131113161317135B-135E137D-137F139A-139F13F5-13FF169D-169F16F1-16FF170D1715-171F1737-173F1754-175F176D17711774-177F17B417B517DE17DF17EA-17EF17FA-17FF180F181A-181F1878-187F18AB-18AF18F6-18FF191D-191F192C-192F193C-193F1941-1943196E196F1975-197F19AC-19AF19CA-19CF19DB-19DD1A1C1A1D1A5F1A7D1A7E1A8A-1A8F1A9A-1A9F1AAE-1AFF1B4C-1B4F1B7D-1B7F1BAB-1BAD1BBA-1BFF1C38-1C3A1C4A-1C4C1C80-1CCF1CF3-1CFF1DE7-1DFC1F161F171F1E1F1F1F461F471F4E1F4F1F581F5A1F5C1F5E1F7E1F7F1FB51FC51FD41FD51FDC1FF01FF11FF51FFF200B-200F202A-202E2060-206F20722073208F2095-209F20B9-20CF20F1-20FF218A-218F23E9-23FF2427-243F244B-245F26CE26E226E4-26E727002705270A270B2728274C274E2753-2755275F27602795-279727B027BF27CB27CD-27CF2B4D-2B4F2B5A-2BFF2C2F2C5F2CF2-2CF82D26-2D2F2D66-2D6E2D70-2D7F2D97-2D9F2DA72DAF2DB72DBF2DC72DCF2DD72DDF2E32-2E7F2E9A2EF4-2EFF2FD6-2FEF2FFC-2FFF3040309730983100-3104312E-3130318F31B8-31BF31E4-31EF321F32FF4DB6-4DBF9FCC-9FFFA48D-A48FA4C7-A4CFA62C-A63FA660A661A674-A67BA698-A69FA6F8-A6FFA78D-A7FAA82C-A82FA83A-A83FA878-A87FA8C5-A8CDA8DA-A8DFA8FC-A8FFA954-A95EA97D-A97FA9CEA9DA-A9DDA9E0-A9FFAA37-AA3FAA4EAA4FAA5AAA5BAA7C-AA7FAAC3-AADAAAE0-ABBFABEEABEFABFA-ABFFD7A4-D7AFD7C7-D7CAD7FC-F8FFFA2EFA2FFA6EFA6FFADA-FAFFFB07-FB12FB18-FB1CFB37FB3DFB3FFB42FB45FBB2-FBD2FD40-FD4FFD90FD91FDC8-FDEFFDFEFDFFFE1A-FE1FFE27-FE2FFE53FE67FE6C-FE6FFE75FEFD-FF00FFBF-FFC1FFC8FFC9FFD0FFD1FFD8FFD9FFDD-FFDFFFE7FFEF-FFFBFFFEFFFF",
+ Cc: "0000-001F007F-009F",
+ Cf: "00AD0600-060306DD070F17B417B5200B-200F202A-202E2060-2064206A-206FFEFFFFF9-FFFB",
+ Co: "E000-F8FF",
+ Cs: "D800-DFFF",
+ Cn: "03780379037F-0383038B038D03A20526-05300557055805600588058B-059005C8-05CF05EB-05EF05F5-05FF06040605061C061D0620065F070E074B074C07B2-07BF07FB-07FF082E082F083F-08FF093A093B094F095609570973-097809800984098D098E0991099209A909B109B3-09B509BA09BB09C509C609C909CA09CF-09D609D8-09DB09DE09E409E509FC-0A000A040A0B-0A0E0A110A120A290A310A340A370A3A0A3B0A3D0A43-0A460A490A4A0A4E-0A500A52-0A580A5D0A5F-0A650A76-0A800A840A8E0A920AA90AB10AB40ABA0ABB0AC60ACA0ACE0ACF0AD1-0ADF0AE40AE50AF00AF2-0B000B040B0D0B0E0B110B120B290B310B340B3A0B3B0B450B460B490B4A0B4E-0B550B58-0B5B0B5E0B640B650B72-0B810B840B8B-0B8D0B910B96-0B980B9B0B9D0BA0-0BA20BA5-0BA70BAB-0BAD0BBA-0BBD0BC3-0BC50BC90BCE0BCF0BD1-0BD60BD8-0BE50BFB-0C000C040C0D0C110C290C340C3A-0C3C0C450C490C4E-0C540C570C5A-0C5F0C640C650C70-0C770C800C810C840C8D0C910CA90CB40CBA0CBB0CC50CC90CCE-0CD40CD7-0CDD0CDF0CE40CE50CF00CF3-0D010D040D0D0D110D290D3A-0D3C0D450D490D4E-0D560D58-0D5F0D640D650D76-0D780D800D810D840D97-0D990DB20DBC0DBE0DBF0DC7-0DC90DCB-0DCE0DD50DD70DE0-0DF10DF5-0E000E3B-0E3E0E5C-0E800E830E850E860E890E8B0E8C0E8E-0E930E980EA00EA40EA60EA80EA90EAC0EBA0EBE0EBF0EC50EC70ECE0ECF0EDA0EDB0EDE-0EFF0F480F6D-0F700F8C-0F8F0F980FBD0FCD0FD9-0FFF10C6-10CF10FD-10FF1249124E124F12571259125E125F1289128E128F12B112B612B712BF12C112C612C712D7131113161317135B-135E137D-137F139A-139F13F5-13FF169D-169F16F1-16FF170D1715-171F1737-173F1754-175F176D17711774-177F17DE17DF17EA-17EF17FA-17FF180F181A-181F1878-187F18AB-18AF18F6-18FF191D-191F192C-192F193C-193F1941-1943196E196F1975-197F19AC-19AF19CA-19CF19DB-19DD1A1C1A1D1A5F1A7D1A7E1A8A-1A8F1A9A-1A9F1AAE-1AFF1B4C-1B4F1B7D-1B7F1BAB-1BAD1BBA-1BFF1C38-1C3A1C4A-1C4C1C80-1CCF1CF3-1CFF1DE7-1DFC1F161F171F1E1F1F1F461F471F4E1F4F1F581F5A1F5C1F5E1F7E1F7F1FB51FC51FD41FD51FDC1FF01FF11FF51FFF2065-206920722073208F2095-209F20B9-20CF20F1-20FF218A-218F23E9-23FF2427-243F244B-245F26CE26E226E4-26E727002705270A270B2728274C274E2753-2755275F27602795-279727B027BF27CB27CD-27CF2B4D-2B4F2B5A-2BFF2C2F2C5F2CF2-2CF82D26-2D2F2D66-2D6E2D70-2D7F2D97-2D9F2DA72DAF2DB72DBF2DC72DCF2DD72DDF2E32-2E7F2E9A2EF4-2EFF2FD6-2FEF2FFC-2FFF3040309730983100-3104312E-3130318F31B8-31BF31E4-31EF321F32FF4DB6-4DBF9FCC-9FFFA48D-A48FA4C7-A4CFA62C-A63FA660A661A674-A67BA698-A69FA6F8-A6FFA78D-A7FAA82C-A82FA83A-A83FA878-A87FA8C5-A8CDA8DA-A8DFA8FC-A8FFA954-A95EA97D-A97FA9CEA9DA-A9DDA9E0-A9FFAA37-AA3FAA4EAA4FAA5AAA5BAA7C-AA7FAAC3-AADAAAE0-ABBFABEEABEFABFA-ABFFD7A4-D7AFD7C7-D7CAD7FC-D7FFFA2EFA2FFA6EFA6FFADA-FAFFFB07-FB12FB18-FB1CFB37FB3DFB3FFB42FB45FBB2-FBD2FD40-FD4FFD90FD91FDC8-FDEFFDFEFDFFFE1A-FE1FFE27-FE2FFE53FE67FE6C-FE6FFE75FEFDFEFEFF00FFBF-FFC1FFC8FFC9FFD0FFD1FFD8FFD9FFDD-FFDFFFE7FFEF-FFF8FFFEFFFF"
+});
+
+function addUnicodePackage (pack) {
+ var codePoint = /\w{4}/g;
+ for (var name in pack)
+ exports.packages[name] = pack[name].replace(codePoint, "\\u$&");
+};
+
+});
+
+ace.define('ace/document', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/event_emitter', 'ace/range', 'ace/anchor'], function(require, exports, module) {
+
+
+var oop = require("./lib/oop");
+var EventEmitter = require("./lib/event_emitter").EventEmitter;
+var Range = require("./range").Range;
+var Anchor = require("./anchor").Anchor;
+
+ /**
+ * new Document([text])
+ * - text (String | Array): The starting text
+ *
+ * Creates a new `Document`. If `text` is included, the `Document` contains those strings; otherwise, it's empty.
+ *
+ **/
+
+var Document = function(text) {
+ this.$lines = [];
+
+ // There has to be one line at least in the document. If you pass an empty
+ // string to the insert function, nothing will happen. Workaround.
+ if (text.length == 0) {
+ this.$lines = [""];
+ } else if (Array.isArray(text)) {
+ this.insertLines(0, text);
+ } else {
+ this.insert({row: 0, column:0}, text);
+ }
+};
+
+(function() {
+
+ oop.implement(this, EventEmitter);
+ this.setValue = function(text) {
+ var len = this.getLength();
+ this.remove(new Range(0, 0, len, this.getLine(len-1).length));
+ this.insert({row: 0, column:0}, text);
+ };
+ this.getValue = function() {
+ return this.getAllLines().join(this.getNewLineCharacter());
+ };
+ this.createAnchor = function(row, column) {
+ return new Anchor(this, row, column);
+ };
+
+ // check for IE split bug
+ if ("aaa".split(/a/).length == 0)
+ this.$split = function(text) {
+ return text.replace(/\r\n|\r/g, "\n").split("\n");
+ }
+ else
+ this.$split = function(text) {
+ return text.split(/\r\n|\r|\n/);
+ };
+ this.$detectNewLine = function(text) {
+ var match = text.match(/^.*?(\r\n|\r|\n)/m);
+ if (match) {
+ this.$autoNewLine = match[1];
+ } else {
+ this.$autoNewLine = "\n";
+ }
+ };
+ this.getNewLineCharacter = function() {
+ switch (this.$newLineMode) {
+ case "windows":
+ return "\r\n";
+
+ case "unix":
+ return "\n";
+
+ case "auto":
+ return this.$autoNewLine;
+ }
+ };
+
+ this.$autoNewLine = "\n";
+ this.$newLineMode = "auto";
+ this.setNewLineMode = function(newLineMode) {
+ if (this.$newLineMode === newLineMode)
+ return;
+
+ this.$newLineMode = newLineMode;
+ };
+ this.getNewLineMode = function() {
+ return this.$newLineMode;
+ };
+ this.isNewLine = function(text) {
+ return (text == "\r\n" || text == "\r" || text == "\n");
+ };
+ this.getLine = function(row) {
+ return this.$lines[row] || "";
+ };
+ this.getLines = function(firstRow, lastRow) {
+ return this.$lines.slice(firstRow, lastRow + 1);
+ };
+ this.getAllLines = function() {
+ return this.getLines(0, this.getLength());
+ };
+ this.getLength = function() {
+ return this.$lines.length;
+ };
+ this.getTextRange = function(range) {
+ if (range.start.row == range.end.row) {
+ return this.$lines[range.start.row].substring(range.start.column,
+ range.end.column);
+ }
+ else {
+ var lines = this.getLines(range.start.row+1, range.end.row-1);
+ lines.unshift((this.$lines[range.start.row] || "").substring(range.start.column));
+ lines.push((this.$lines[range.end.row] || "").substring(0, range.end.column));
+ return lines.join(this.getNewLineCharacter());
+ }
+ };
+ this.$clipPosition = function(position) {
+ var length = this.getLength();
+ if (position.row >= 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);
+
+ // only detect new lines if the document has no line break yet
+ 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;
+ };
+ /**
+ * Document@change(e)
+ * - e (Object): Contains at least one property called `"action"`. `"action"` indicates the action that triggered the change. Each action also has a set of additional properties.
+ *
+ * Fires whenever the document changes.
+ *
+ * Several methods trigger different `"change"` events. Below is a list of each action type, followed by each property that's also available:
+ *
+ * * `"insertLines"` (emitted by [[Document.insertLines]])
+ * * `range`: the [[Range]] of the change within the document
+ * * `lines`: the lines in the document that are changing
+ * * `"insertText"` (emitted by [[Document.insertNewLine]])
+ * * `range`: the [[Range]] of the change within the document
+ * * `text`: the text that's being added
+ * * `"removeLines"` (emitted by [[Document.insertLines]])
+ * * `range`: the [[Range]] of the change within the document
+ * * `lines`: the lines in the document that were removed
+ * * `nl`: the new line character (as defined by [[Document.getNewLineCharacter]])
+ * * `"removeText"` (emitted by [[Document.removeInLine]] and [[Document.removeNewLine]])
+ * * `range`: the [[Range]] of the change within the document
+ * * `text`: the text that's being removed
+ *
+ **/
+ this.insertLines = function(row, lines) {
+ if (lines.length == 0)
+ return {row: row, column: 0};
+
+ // apply doesn't work for big arrays (smallest threshold is on safari 0xFFFF)
+ // to circumvent that we have to break huge inserts into smaller chunks here
+ 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) {
+ // clip to document
+ 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;
+
+ // Shortcut: If the text we want to insert is the same as it is already
+ // in the document, we don't have to replace anything.
+ 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<deltas.length; i++) {
+ var delta = deltas[i];
+ var range = Range.fromPoints(delta.range.start, delta.range.end);
+
+ if (delta.action == "insertLines")
+ this.insertLines(range.start.row, delta.lines);
+ else if (delta.action == "insertText")
+ this.insert(range.start, delta.text);
+ else if (delta.action == "removeLines")
+ this.removeLines(range.start.row, range.end.row - 1);
+ else if (delta.action == "removeText")
+ this.remove(range);
+ }
+ };
+ this.revertDeltas = function(deltas) {
+ for (var i=deltas.length-1; 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);
+ }
+ };
+
+}).call(Document.prototype);
+
+exports.Document = Document;
+});
+
+ace.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;
+
+/**
+ * new Anchor(doc, row, column)
+ * - doc (Document): The document to associate with the anchor
+ * - row (Number): The starting row position
+ * - column (Number): The starting column position
+ *
+ * Creates a new `Anchor` and associates it with a document.
+ *
+ **/
+
+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);
+
+});
+
+ace.define('ace/background_tokenizer', ['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;
+
+// tokenizing lines longer than this makes editor very slow
+var MAX_LINE_LENGTH = 5000;
+
+/**
+ * new BackgroundTokenizer(tokenizer, editor)
+ * - tokenizer (Tokenizer): The tokenizer to use
+ * - editor (Editor): The editor to associate with
+ *
+ * Creates a new `BackgroundTokenizer` object.
+ *
+ *
+ **/
+
+var BackgroundTokenizer = function(tokenizer, editor) {
+ this.running = false;
+ this.lines = [];
+ this.states = [];
+ this.currentLine = 0;
+ this.tokenizer = tokenizer;
+
+ var self = this;
+
+ this.$worker = function() {
+ if (!self.running) { return; }
+
+ var workerStart = new Date();
+ var startLine = self.currentLine;
+ var doc = self.doc;
+
+ var processedLines = 0;
+
+ var len = doc.getLength();
+ while (self.currentLine < len) {
+ self.$tokenizeRow(self.currentLine);
+ while (self.lines[self.currentLine])
+ self.currentLine++;
+
+ // only check every 5 lines
+ processedLines ++;
+ if ((processedLines % 5 == 0) && (new Date() - workerStart) > 20) {
+ self.fireUpdateEvent(startLine, self.currentLine-1);
+ self.running = setTimeout(self.$worker, 20);
+ return;
+ }
+ }
+
+ self.running = false;
+
+ self.fireUpdateEvent(startLine, len - 1);
+ };
+};
+
+(function(){
+
+ oop.implement(this, EventEmitter);
+ this.setTokenizer = function(tokenizer) {
+ this.tokenizer = tokenizer;
+ this.lines = [];
+ this.states = [];
+
+ this.start(0);
+ };
+ this.setDocument = function(doc) {
+ this.doc = doc;
+ this.lines = [];
+ this.states = [];
+
+ this.stop();
+ };
+ /**
+ * BackgroundTokenizer@update(e)
+ * - e (Object): An object containing two properties, `first` and `last`, which indicate the rows of the region being updated.
+ *
+ * Fires whenever the background tokeniziers between a range of rows are going to be updated.
+ *
+ **/
+ this.fireUpdateEvent = function(firstRow, lastRow) {
+ var data = {
+ first: firstRow,
+ last: lastRow
+ };
+ this._emit("update", {data: data});
+ };
+ this.start = function(startRow) {
+ this.currentLine = Math.min(startRow || 0, this.currentLine, this.doc.getLength());
+
+ // remove all cached items below this line
+ this.lines.splice(this.currentLine, this.lines.length);
+ this.states.splice(this.currentLine, this.states.length);
+
+ this.stop();
+ // pretty long delay to prevent the tokenizer from interfering with the user
+ this.running = setTimeout(this.$worker, 700);
+ };
+
+ this.$updateOnChange = function(delta) {
+ var range = delta.range;
+ var startRow = range.start.row;
+ var len = range.end.row - startRow;
+
+ if (len === 0) {
+ this.lines[startRow] = null;
+ } else if (delta.action == "removeText" || delta.action == "removeLines") {
+ this.lines.splice(startRow, len + 1, null);
+ this.states.splice(startRow, len + 1, null);
+ } else {
+ var args = Array(len + 1);
+ args.unshift(startRow, 1);
+ this.lines.splice.apply(this.lines, args);
+ this.states.splice.apply(this.states, args);
+ }
+
+ this.currentLine = Math.min(startRow, this.currentLine, this.doc.getLength());
+
+ this.stop();
+ // pretty long delay to prevent the tokenizer from interfering with the user
+ this.running = setTimeout(this.$worker, 700);
+ };
+ this.stop = function() {
+ if (this.running)
+ clearTimeout(this.running);
+ this.running = false;
+ };
+ this.getTokens = function(row) {
+ return this.lines[row] || this.$tokenizeRow(row);
+ };
+ this.getState = function(row) {
+ if (this.currentLine == row)
+ this.$tokenizeRow(row);
+ return this.states[row] || "start";
+ };
+
+ this.$tokenizeRow = function(row) {
+ var line = this.doc.getLine(row);
+ var state = this.states[row - 1];
+
+ if (line.length > MAX_LINE_LENGTH) {
+ var overflow = {value: line.substr(MAX_LINE_LENGTH), type: "text"};
+ line = line.slice(0, MAX_LINE_LENGTH);
+ }
+ var data = this.tokenizer.getLineTokens(line, state);
+ if (overflow) {
+ data.tokens.push(overflow);
+ data.state = "start";
+ }
+
+ if (this.states[row] !== data.state) {
+ this.states[row] = data.state;
+ this.lines[row + 1] = null;
+ if (this.currentLine > row + 1)
+ this.currentLine = row + 1;
+ } else if (this.currentLine == row) {
+ this.currentLine = row + 1;
+ }
+
+ return this.lines[row] = data.tokens;
+ };
+
+}).call(BackgroundTokenizer.prototype);
+
+exports.BackgroundTokenizer = BackgroundTokenizer;
+});
+
+ace.define('ace/search_highlight', ['require', 'exports', 'module' , 'ace/lib/lang', 'ace/lib/oop', 'ace/range'], function(require, exports, module) {
+
+
+var lang = require("./lib/lang");
+var oop = require("./lib/oop");
+var Range = require("./range").Range;
+
+var SearchHighlight = function(regExp, clazz, type) {
+ this.setRegexp(regExp);
+ this.clazz = clazz;
+ this.type = type || "text";
+};
+
+(function() {
+ this.setRegexp = function(regExp) {
+ if (this.regExp+"" == regExp+"")
+ return;
+ this.regExp = regExp;
+ this.cache = [];
+ };
+
+ this.update = function(html, markerLayer, session, config) {
+ if (!this.regExp)
+ return;
+ var start = config.firstRow, end = config.lastRow;
+
+ for (var i = start; i <= end; i++) {
+ var ranges = this.cache[i];
+ if (ranges == null) {
+ ranges = lang.getMatchOffsets(session.getLine(i), this.regExp);
+ ranges = ranges.map(function(match) {
+ return new Range(i, match.offset, i, match.offset + match.length);
+ });
+ this.cache[i] = ranges.length ? ranges : "";
+ }
+
+ for (var j = ranges.length; j --; ) {
+ markerLayer.drawSingleLineMarker(
+ html, ranges[j].toScreenRange(session), this.clazz, config,
+ null, this.type
+ );
+ }
+ }
+ };
+
+}).call(SearchHighlight.prototype);
+
+exports.SearchHighlight = SearchHighlight;
+});
+
+ace.define('ace/edit_session/folding', ['require', 'exports', 'module' , 'ace/range', 'ace/edit_session/fold_line', 'ace/edit_session/fold', 'ace/token_iterator'], function(require, exports, module) {
+
+
+var Range = require("../range").Range;
+var FoldLine = require("./fold_line").FoldLine;
+var Fold = require("./fold").Fold;
+var TokenIterator = require("../token_iterator").TokenIterator;
+
+function Folding() {
+ /*
+ * Looks up a fold at a given row/column. Possible values for side:
+ * -1: ignore a fold if fold.start = row/column
+ * +1: ignore a fold if fold.end = row/column
+ */
+ this.getFoldAt = function(row, column, side) {
+ var foldLine = this.getFoldLine(row);
+ if (!foldLine)
+ return null;
+
+ var folds = foldLine.folds;
+ for (var i = 0; i < folds.length; i++) {
+ var fold = folds[i];
+ if (fold.range.contains(row, column)) {
+ if (side == 1 && fold.range.isEnd(row, column)) {
+ continue;
+ } else if (side == -1 && fold.range.isStart(row, column)) {
+ continue;
+ }
+ return fold;
+ }
+ }
+ };
+ this.getFoldsInRange = function(range) {
+ range = range.clone();
+ var start = range.start;
+ var end = range.end;
+ var foldLines = this.$foldData;
+ var foundFolds = [];
+
+ start.column += 1;
+ end.column -= 1;
+
+ for (var i = 0; i < foldLines.length; i++) {
+ var cmp = foldLines[i].range.compareRange(range);
+ if (cmp == 2) {
+ // Range is before foldLine. No intersection. This means,
+ // there might be other foldLines that intersect.
+ continue;
+ }
+ else if (cmp == -2) {
+ // Range is after foldLine. There can't be any other foldLines then,
+ // so let's give up.
+ break;
+ }
+
+ var folds = foldLines[i].folds;
+ for (var j = 0; j < folds.length; j++) {
+ var fold = folds[j];
+ cmp = fold.range.compareRange(range);
+ if (cmp == -2) {
+ break;
+ } else if (cmp == 2) {
+ continue;
+ } else
+ // WTF-state: Can happen due to -1/+1 to start/end column.
+ if (cmp == 42) {
+ break;
+ }
+ foundFolds.push(fold);
+ }
+ }
+ return foundFolds;
+ };
+ this.getAllFolds = function() {
+ var folds = [];
+ var foldLines = this.$foldData;
+
+ function addFold(fold) {
+ folds.push(fold);
+ if (!fold.subFolds)
+ return;
+
+ for (var i = 0; i < fold.subFolds.length; i++)
+ addFold(fold.subFolds[i]);
+ }
+
+ for (var i = 0; i < foldLines.length; i++)
+ for (var j = 0; j < foldLines[i].folds.length; j++)
+ addFold(foldLines[i].folds[j]);
+
+ return folds;
+ };
+ this.getFoldStringAt = function(row, column, trim, foldLine) {
+ foldLine = foldLine || this.getFoldLine(row);
+ if (!foldLine)
+ return null;
+
+ var lastFold = {
+ end: { column: 0 }
+ };
+ // TODO: Refactor to use getNextFoldTo function.
+ var str, fold;
+ for (var i = 0; i < foldLine.folds.length; i++) {
+ fold = foldLine.folds[i];
+ var cmp = fold.range.compareEnd(row, column);
+ if (cmp == -1) {
+ str = this
+ .getLine(fold.start.row)
+ .substring(lastFold.end.column, fold.start.column);
+ break;
+ }
+ else if (cmp === 0) {
+ return null;
+ }
+ lastFold = fold;
+ }
+ if (!str)
+ str = this.getLine(fold.start.row).substring(lastFold.end.column);
+
+ if (trim == -1)
+ return str.substring(0, column - lastFold.end.column);
+ else if (trim == 1)
+ return str.substring(column - lastFold.end.column);
+ else
+ return str;
+ };
+
+ this.getFoldLine = function(docRow, startFoldLine) {
+ var foldData = this.$foldData;
+ var i = 0;
+ if (startFoldLine)
+ i = foldData.indexOf(startFoldLine);
+ if (i == -1)
+ i = 0;
+ for (i; i < foldData.length; i++) {
+ var foldLine = foldData[i];
+ if (foldLine.start.row <= docRow && foldLine.end.row >= docRow) {
+ return foldLine;
+ } else if (foldLine.end.row > docRow) {
+ return null;
+ }
+ }
+ return null;
+ };
+
+ // returns the fold which starts after or contains docRow
+ this.getNextFoldLine = function(docRow, startFoldLine) {
+ var foldData = this.$foldData;
+ var i = 0;
+ if (startFoldLine)
+ i = foldData.indexOf(startFoldLine);
+ if (i == -1)
+ i = 0;
+ for (i; i < foldData.length; i++) {
+ var foldLine = foldData[i];
+ if (foldLine.end.row >= docRow) {
+ return foldLine;
+ }
+ }
+ return null;
+ };
+
+ this.getFoldedRowCount = function(first, last) {
+ var foldData = this.$foldData, rowCount = last-first+1;
+ for (var i = 0; i < foldData.length; i++) {
+ var foldLine = foldData[i],
+ end = foldLine.end.row,
+ start = foldLine.start.row;
+ if (end >= last) {
+ if(start < last) {
+ if(start >= first)
+ rowCount -= last-start;
+ else
+ rowCount = 0;//in one fold
+ }
+ break;
+ } else if(end >= first){
+ if (start >= first) //fold inside range
+ rowCount -= end-start;
+ else
+ rowCount -= end-first+1;
+ }
+ }
+ return rowCount;
+ };
+
+ this.$addFoldLine = function(foldLine) {
+ this.$foldData.push(foldLine);
+ this.$foldData.sort(function(a, b) {
+ return a.start.row - b.start.row;
+ });
+ return foldLine;
+ };
+ this.addFold = function(placeholder, range) {
+ var foldData = this.$foldData;
+ var added = false;
+ var fold;
+
+ if (placeholder instanceof Fold)
+ fold = placeholder;
+ else
+ fold = new Fold(range, placeholder);
+
+ this.$clipRangeToDocument(fold.range);
+
+ var startRow = fold.start.row;
+ var startColumn = fold.start.column;
+ var endRow = fold.end.row;
+ var endColumn = fold.end.column;
+
+ // --- Some checking ---
+ if (fold.placeholder.length < 2)
+ throw "Placeholder has to be at least 2 characters";
+
+ if (startRow == endRow && endColumn - startColumn < 2)
+ throw "The range has to be at least 2 characters width";
+
+ var startFold = this.getFoldAt(startRow, startColumn, 1);
+ var endFold = this.getFoldAt(endRow, endColumn, -1);
+ if (startFold && endFold == startFold)
+ return startFold.addSubFold(fold);
+
+ if (
+ (startFold && !startFold.range.isStart(startRow, startColumn))
+ || (endFold && !endFold.range.isEnd(endRow, endColumn))
+ ) {
+ throw "A fold can't intersect already existing fold" + fold.range + startFold.range;
+ }
+
+ // Check if there are folds in the range we create the new fold for.
+ var folds = this.getFoldsInRange(fold.range);
+ if (folds.length > 0) {
+ // Remove the folds from fold data.
+ this.removeFolds(folds);
+ // Add the removed folds as subfolds on the new fold.
+ fold.subFolds = folds;
+ }
+
+ for (var i = 0; i < foldData.length; i++) {
+ var foldLine = foldData[i];
+ if (endRow == foldLine.start.row) {
+ foldLine.addFold(fold);
+ added = true;
+ break;
+ }
+ else if (startRow == foldLine.end.row) {
+ foldLine.addFold(fold);
+ added = true;
+ if (!fold.sameRow) {
+ // Check if we might have to merge two FoldLines.
+ var foldLineNext = foldData[i + 1];
+ if (foldLineNext && foldLineNext.start.row == endRow) {
+ // We need to merge!
+ foldLine.merge(foldLineNext);
+ break;
+ }
+ }
+ break;
+ }
+ else if (endRow <= foldLine.start.row) {
+ break;
+ }
+ }
+
+ if (!added)
+ foldLine = this.$addFoldLine(new FoldLine(this.$foldData, fold));
+
+ if (this.$useWrapMode)
+ this.$updateWrapData(foldLine.start.row, foldLine.start.row);
+ else
+ this.$updateRowLengthCache(foldLine.start.row, foldLine.start.row);
+
+ // Notify that fold data has changed.
+ this.$modified = true;
+ this._emit("changeFold", { data: fold });
+
+ return fold;
+ };
+
+ this.addFolds = function(folds) {
+ folds.forEach(function(fold) {
+ this.addFold(fold);
+ }, this);
+ };
+
+ this.removeFold = function(fold) {
+ var foldLine = fold.foldLine;
+ var startRow = foldLine.start.row;
+ var endRow = foldLine.end.row;
+
+ var foldLines = this.$foldData;
+ var folds = foldLine.folds;
+ // Simple case where there is only one fold in the FoldLine such that
+ // the entire fold line can get removed directly.
+ if (folds.length == 1) {
+ foldLines.splice(foldLines.indexOf(foldLine), 1);
+ } else
+ // If the fold is the last fold of the foldLine, just remove it.
+ if (foldLine.range.isEnd(fold.end.row, fold.end.column)) {
+ folds.pop();
+ foldLine.end.row = folds[folds.length - 1].end.row;
+ foldLine.end.column = folds[folds.length - 1].end.column;
+ } else
+ // If the fold is the first fold of the foldLine, just remove it.
+ if (foldLine.range.isStart(fold.start.row, fold.start.column)) {
+ folds.shift();
+ foldLine.start.row = folds[0].start.row;
+ foldLine.start.column = folds[0].start.column;
+ } else
+ // We know there are more then 2 folds and the fold is not at the edge.
+ // This means, the fold is somewhere in between.
+ //
+ // If the fold is in one row, we just can remove it.
+ if (fold.sameRow) {
+ folds.splice(folds.indexOf(fold), 1);
+ } else
+ // The fold goes over more then one row. This means remvoing this fold
+ // will cause the fold line to get splitted up. newFoldLine is the second part
+ {
+ var newFoldLine = foldLine.split(fold.start.row, fold.start.column);
+ folds = newFoldLine.folds;
+ folds.shift();
+ newFoldLine.start.row = folds[0].start.row;
+ newFoldLine.start.column = folds[0].start.column;
+ }
+
+ if (this.$useWrapMode)
+ this.$updateWrapData(startRow, endRow);
+ else
+ this.$updateRowLengthCache(startRow, endRow);
+
+ // Notify that fold data has changed.
+ this.$modified = true;
+ this._emit("changeFold", { data: fold });
+ };
+
+ this.removeFolds = function(folds) {
+ // We need to clone the folds array passed in as it might be the folds
+ // array of a fold line and as we call this.removeFold(fold), folds
+ // are removed from folds and changes the current index.
+ var cloneFolds = [];
+ for (var i = 0; i < folds.length; i++) {
+ cloneFolds.push(folds[i]);
+ }
+
+ cloneFolds.forEach(function(fold) {
+ this.removeFold(fold);
+ }, this);
+ this.$modified = true;
+ };
+
+ this.expandFold = function(fold) {
+ this.removeFold(fold);
+ fold.subFolds.forEach(function(fold) {
+ this.addFold(fold);
+ }, this);
+ fold.subFolds = [];
+ };
+
+ this.expandFolds = function(folds) {
+ folds.forEach(function(fold) {
+ this.expandFold(fold);
+ }, this);
+ };
+
+ this.unfold = function(location, expandInner) {
+ var range, folds;
+ if (location == null)
+ range = new Range(0, 0, this.getLength(), 0);
+ else if (typeof location == "number")
+ range = new Range(location, 0, location, this.getLine(location).length);
+ else if ("row" in location)
+ range = Range.fromPoints(location, location);
+ else
+ range = location;
+
+ folds = this.getFoldsInRange(range);
+ if (expandInner) {
+ this.removeFolds(folds);
+ } else {
+ // TODO: might need to remove and add folds in one go instead of using
+ // expandFolds several times.
+ while (folds.length) {
+ this.expandFolds(folds);
+ folds = this.getFoldsInRange(range);
+ }
+ }
+ };
+ this.isRowFolded = function(docRow, startFoldRow) {
+ return !!this.getFoldLine(docRow, startFoldRow);
+ };
+
+ this.getRowFoldEnd = function(docRow, startFoldRow) {
+ var foldLine = this.getFoldLine(docRow, startFoldRow);
+ return foldLine ? foldLine.end.row : docRow;
+ };
+
+ this.getFoldDisplayLine = function(foldLine, endRow, endColumn, startRow, startColumn) {
+ if (startRow == null) {
+ startRow = foldLine.start.row;
+ startColumn = 0;
+ }
+
+ if (endRow == null) {
+ endRow = foldLine.end.row;
+ endColumn = this.getLine(endRow).length;
+ }
+
+ // Build the textline using the FoldLine walker.
+ var doc = this.doc;
+ var textLine = "";
+
+ foldLine.walk(function(placeholder, row, column, lastColumn) {
+ if (row < startRow) {
+ return;
+ } else if (row == startRow) {
+ if (column < startColumn) {
+ return;
+ }
+ lastColumn = Math.max(startColumn, lastColumn);
+ }
+ if (placeholder) {
+ textLine += placeholder;
+ } else {
+ textLine += doc.getLine(row).substring(lastColumn, column);
+ }
+ }.bind(this), endRow, endColumn);
+ return textLine;
+ };
+
+ this.getDisplayLine = function(row, endColumn, startRow, startColumn) {
+ var foldLine = this.getFoldLine(row);
+
+ if (!foldLine) {
+ var line;
+ line = this.doc.getLine(row);
+ return line.substring(startColumn || 0, endColumn || line.length);
+ } else {
+ return this.getFoldDisplayLine(
+ foldLine, row, endColumn, startRow, startColumn);
+ }
+ };
+
+ this.$cloneFoldData = function() {
+ var fd = [];
+ fd = this.$foldData.map(function(foldLine) {
+ var folds = foldLine.folds.map(function(fold) {
+ return fold.clone();
+ });
+ return new FoldLine(fd, folds);
+ });
+
+ return fd;
+ };
+
+ this.toggleFold = function(tryToUnfold) {
+ var selection = this.selection;
+ var range = selection.getRange();
+ var fold;
+ var bracketPos;
+
+ if (range.isEmpty()) {
+ var cursor = range.start;
+ fold = this.getFoldAt(cursor.row, cursor.column);
+
+ if (fold) {
+ this.expandFold(fold);
+ return;
+ }
+ else if (bracketPos = this.findMatchingBracket(cursor)) {
+ if (range.comparePoint(bracketPos) == 1) {
+ range.end = bracketPos;
+ }
+ else {
+ range.start = bracketPos;
+ range.start.column++;
+ range.end.column--;
+ }
+ }
+ else if (bracketPos = this.findMatchingBracket({row: cursor.row, column: cursor.column + 1})) {
+ if (range.comparePoint(bracketPos) == 1)
+ range.end = bracketPos;
+ else
+ range.start = bracketPos;
+
+ range.start.column++;
+ }
+ else {
+ range = this.getCommentFoldRange(cursor.row, cursor.column) || range;
+ }
+ } else {
+ var folds = this.getFoldsInRange(range);
+ if (tryToUnfold && folds.length) {
+ this.expandFolds(folds);
+ return;
+ }
+ else if (folds.length == 1 ) {
+ fold = folds[0];
+ }
+ }
+
+ if (!fold)
+ fold = this.getFoldAt(range.start.row, range.start.column);
+
+ if (fold && fold.range.toString() == range.toString()) {
+ this.expandFold(fold);
+ return;
+ }
+
+ var placeholder = "...";
+ if (!range.isMultiLine()) {
+ placeholder = this.getTextRange(range);
+ if(placeholder.length < 4)
+ return;
+ placeholder = placeholder.trim().substring(0, 2) + "..";
+ }
+
+ this.addFold(placeholder, range);
+ };
+
+ this.getCommentFoldRange = function(row, column) {
+ var iterator = new TokenIterator(this, row, column);
+ var token = iterator.getCurrentToken();
+ if (token && /^comment|string/.test(token.type)) {
+ var range = new Range();
+ var re = new RegExp(token.type.replace(/\..*/, "\\."));
+ do {
+ token = iterator.stepBackward();
+ } while(token && re.test(token.type));
+
+ iterator.stepForward();
+ range.start.row = iterator.getCurrentTokenRow();
+ range.start.column = iterator.getCurrentTokenColumn() + 2;
+
+ iterator = new TokenIterator(this, row, column);
+
+ do {
+ token = iterator.stepForward();
+ } while(token && re.test(token.type));
+
+ token = iterator.stepBackward();
+
+ range.end.row = iterator.getCurrentTokenRow();
+ range.end.column = iterator.getCurrentTokenColumn() + token.value.length;
+ return range;
+ }
+ };
+
+ this.foldAll = function(startRow, endRow) {
+ var foldWidgets = this.foldWidgets;
+ endRow = endRow || this.getLength();
+ for (var row = startRow || 0; row < endRow; row++) {
+ if (foldWidgets[row] == null)
+ foldWidgets[row] = this.getFoldWidget(row);
+ if (foldWidgets[row] != "start")
+ continue;
+
+ var range = this.getFoldWidgetRange(row);
+ // sometimes range can be incompatible with existing fold
+ // wouldn't it be better for addFold to return null istead of throwing?
+ if (range && range.end.row < endRow) try {
+ this.addFold("...", range);
+ } catch(e) {}
+ }
+ };
+
+ this.$foldStyles = {
+ "manual": 1,
+ "markbegin": 1,
+ "markbeginend": 1
+ };
+ this.$foldStyle = "markbegin";
+ this.setFoldStyle = function(style) {
+ if (!this.$foldStyles[style])
+ throw new Error("invalid fold style: " + style + "[" + Object.keys(this.$foldStyles).join(", ") + "]");
+
+ if (this.$foldStyle == style)
+ return;
+
+ this.$foldStyle = style;
+
+ if (style == "manual")
+ this.unfold();
+
+ // reset folding
+ var mode = this.$foldMode;
+ this.$setFolding(null);
+ this.$setFolding(mode);
+ };
+
+ // structured folding
+ this.$setFolding = function(foldMode) {
+ if (this.$foldMode == foldMode)
+ return;
+
+ this.$foldMode = foldMode;
+
+ this.removeListener('change', this.$updateFoldWidgets);
+ this._emit("changeAnnotation");
+
+ if (!foldMode || this.$foldStyle == "manual") {
+ this.foldWidgets = null;
+ return;
+ }
+
+ this.foldWidgets = [];
+ this.getFoldWidget = foldMode.getFoldWidget.bind(foldMode, this, this.$foldStyle);
+ this.getFoldWidgetRange = foldMode.getFoldWidgetRange.bind(foldMode, this, this.$foldStyle);
+
+ this.$updateFoldWidgets = this.updateFoldWidgets.bind(this);
+ this.on('change', this.$updateFoldWidgets);
+
+ };
+
+ this.onFoldWidgetClick = function(row, e) {
+ var type = this.getFoldWidget(row);
+ var line = this.getLine(row);
+ var onlySubfolds = e.shiftKey;
+ var addSubfolds = onlySubfolds || e.ctrlKey || e.altKey || e.metaKey;
+ var fold;
+
+ if (type == "end")
+ fold = this.getFoldAt(row, 0, -1);
+ else
+ fold = this.getFoldAt(row, line.length, 1);
+
+ if (fold) {
+ if (addSubfolds)
+ this.removeFold(fold);
+ else
+ this.expandFold(fold);
+ return;
+ }
+
+ var range = this.getFoldWidgetRange(row);
+ if (range) {
+ // sometimes singleline folds can be missed by the code above
+ if (!range.isMultiLine()) {
+ fold = this.getFoldAt(range.start.row, range.start.column, 1);
+ if (fold && range.isEqual(fold.range)) {
+ this.removeFold(fold);
+ return;
+ }
+ }
+
+ if (!onlySubfolds)
+ this.addFold("...", range);
+
+ if (addSubfolds)
+ this.foldAll(range.start.row + 1, range.end.row);
+ } else {
+ if (addSubfolds)
+ this.foldAll(row + 1, this.getLength());
+ (e.target || e.srcElement).className += " invalid"
+ }
+ };
+
+ this.updateFoldWidgets = function(e) {
+ var delta = e.data;
+ var range = delta.range;
+ var firstRow = range.start.row;
+ var len = range.end.row - firstRow;
+
+ if (len === 0) {
+ this.foldWidgets[firstRow] = null;
+ } else if (delta.action == "removeText" || delta.action == "removeLines") {
+ this.foldWidgets.splice(firstRow, len + 1, null);
+ } else {
+ var args = Array(len + 1);
+ args.unshift(firstRow, 1);
+ this.foldWidgets.splice.apply(this.foldWidgets, args);
+ }
+ };
+
+}
+
+exports.Folding = Folding;
+
+});
+
+ace.define('ace/edit_session/fold_line', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
+
+
+var Range = require("../range").Range;
+function FoldLine(foldData, folds) {
+ this.foldData = foldData;
+ if (Array.isArray(folds)) {
+ this.folds = folds;
+ } else {
+ folds = this.folds = [ folds ];
+ }
+
+ var last = folds[folds.length - 1]
+ this.range = new Range(folds[0].start.row, folds[0].start.column,
+ last.end.row, last.end.column);
+ this.start = this.range.start;
+ this.end = this.range.end;
+
+ this.folds.forEach(function(fold) {
+ fold.setFoldLine(this);
+ }, this);
+}
+
+(function() {
+ /*
+ * Note: This doesn't update wrapData!
+ */
+ this.shiftRow = function(shift) {
+ this.start.row += shift;
+ this.end.row += shift;
+ this.folds.forEach(function(fold) {
+ fold.start.row += shift;
+ fold.end.row += shift;
+ });
+ }
+
+ this.addFold = function(fold) {
+ if (fold.sameRow) {
+ if (fold.start.row < this.startRow || fold.endRow > this.endRow) {
+ throw "Can't add a fold to this FoldLine as it has no connection";
+ }
+ this.folds.push(fold);
+ this.folds.sort(function(a, b) {
+ return -a.range.compareEnd(b.start.row, b.start.column);
+ });
+ if (this.range.compareEnd(fold.start.row, fold.start.column) > 0) {
+ this.end.row = fold.end.row;
+ this.end.column = fold.end.column;
+ } else if (this.range.compareStart(fold.end.row, fold.end.column) < 0) {
+ this.start.row = fold.start.row;
+ this.start.column = fold.start.column;
+ }
+ } else if (fold.start.row == this.end.row) {
+ this.folds.push(fold);
+ this.end.row = fold.end.row;
+ this.end.column = fold.end.column;
+ } else if (fold.end.row == this.start.row) {
+ this.folds.unshift(fold);
+ this.start.row = fold.start.row;
+ this.start.column = fold.start.column;
+ } else {
+ throw "Trying to add fold to FoldRow that doesn't have a matching row";
+ }
+ fold.foldLine = this;
+ }
+
+ this.containsRow = function(row) {
+ return row >= this.start.row && row <= this.end.row;
+ }
+
+ this.walk = function(callback, endRow, endColumn) {
+ var lastEnd = 0,
+ folds = this.folds,
+ fold,
+ comp, stop, isNewRow = true;
+
+ if (endRow == null) {
+ endRow = this.end.row;
+ endColumn = this.end.column;
+ }
+
+ for (var i = 0; i < folds.length; i++) {
+ fold = folds[i];
+
+ comp = fold.range.compareStart(endRow, endColumn);
+ // This fold is after the endRow/Column.
+ if (comp == -1) {
+ callback(null, endRow, endColumn, lastEnd, isNewRow);
+ return;
+ }
+
+ stop = callback(null, fold.start.row, fold.start.column, lastEnd, isNewRow);
+ stop = !stop && callback(fold.placeholder, fold.start.row, fold.start.column, lastEnd);
+
+ // If the user requested to stop the walk or endRow/endColumn is
+ // inside of this fold (comp == 0), then end here.
+ if (stop || comp == 0) {
+ return;
+ }
+
+ // Note the new lastEnd might not be on the same line. However,
+ // it's the callback's job to recognize this.
+ isNewRow = !fold.sameRow;
+ lastEnd = fold.end.column;
+ }
+ callback(null, endRow, endColumn, lastEnd, isNewRow);
+ }
+
+ this.getNextFoldTo = function(row, column) {
+ var fold, cmp;
+ for (var i = 0; i < this.folds.length; i++) {
+ fold = this.folds[i];
+ cmp = fold.range.compareEnd(row, column);
+ if (cmp == -1) {
+ return {
+ fold: fold,
+ kind: "after"
+ };
+ } else if (cmp == 0) {
+ return {
+ fold: fold,
+ kind: "inside"
+ }
+ }
+ }
+ return null;
+ }
+
+ this.addRemoveChars = function(row, column, len) {
+ var ret = this.getNextFoldTo(row, column),
+ fold, folds;
+ if (ret) {
+ fold = ret.fold;
+ if (ret.kind == "inside"
+ && fold.start.column != column
+ && fold.start.row != row)
+ {
+ //throwing here breaks whole editor
+ //TODO: properly handle this
+ window.console && window.console.log(row, column, fold);
+ } else if (fold.start.row == row) {
+ folds = this.folds;
+ var i = folds.indexOf(fold);
+ if (i == 0) {
+ this.start.column += len;
+ }
+ for (i; i < folds.length; i++) {
+ fold = folds[i];
+ fold.start.column += len;
+ if (!fold.sameRow) {
+ return;
+ }
+ fold.end.column += len;
+ }
+ this.end.column += len;
+ }
+ }
+ }
+
+ this.split = function(row, column) {
+ var fold = this.getNextFoldTo(row, column).fold,
+ folds = this.folds;
+ var foldData = this.foldData;
+
+ if (!fold) {
+ return null;
+ }
+ var i = folds.indexOf(fold);
+ var foldBefore = folds[i - 1];
+ this.end.row = foldBefore.end.row;
+ this.end.column = foldBefore.end.column;
+
+ // Remove the folds after row/column and create a new FoldLine
+ // containing these removed folds.
+ folds = folds.splice(i, folds.length - i);
+
+ var newFoldLine = new FoldLine(foldData, folds);
+ foldData.splice(foldData.indexOf(this) + 1, 0, newFoldLine);
+ return newFoldLine;
+ }
+
+ this.merge = function(foldLineNext) {
+ var folds = foldLineNext.folds;
+ for (var i = 0; i < folds.length; i++) {
+ this.addFold(folds[i]);
+ }
+ // Remove the foldLineNext - no longer needed, as
+ // it's merged now with foldLineNext.
+ var foldData = this.foldData;
+ foldData.splice(foldData.indexOf(foldLineNext), 1);
+ }
+
+ this.toString = function() {
+ var ret = [this.range.toString() + ": [" ];
+
+ this.folds.forEach(function(fold) {
+ ret.push(" " + fold.toString());
+ });
+ ret.push("]")
+ return ret.join("\n");
+ }
+
+ this.idxToPosition = function(idx) {
+ var lastFoldEndColumn = 0;
+ var fold;
+
+ for (var i = 0; i < this.folds.length; i++) {
+ var fold = this.folds[i];
+
+ idx -= fold.start.column - lastFoldEndColumn;
+ if (idx < 0) {
+ return {
+ row: fold.start.row,
+ column: fold.start.column + idx
+ };
+ }
+
+ idx -= fold.placeholder.length;
+ if (idx < 0) {
+ return fold.start;
+ }
+
+ lastFoldEndColumn = fold.end.column;
+ }
+
+ return {
+ row: this.end.row,
+ column: this.end.column + idx
+ };
+ }
+}).call(FoldLine.prototype);
+
+exports.FoldLine = FoldLine;
+});
+
+ace.define('ace/edit_session/fold', ['require', 'exports', 'module' ], function(require, exports, module) {
+
+
+/*
+ * Simple fold-data struct.
+ **/
+var Fold = exports.Fold = function(range, placeholder) {
+ this.foldLine = null;
+ this.placeholder = placeholder;
+ this.range = range;
+ this.start = range.start;
+ this.end = range.end;
+
+ this.sameRow = range.start.row == range.end.row;
+ this.subFolds = [];
+};
+
+(function() {
+
+ this.toString = function() {
+ return '"' + this.placeholder + '" ' + this.range.toString();
+ };
+
+ this.setFoldLine = function(foldLine) {
+ this.foldLine = foldLine;
+ this.subFolds.forEach(function(fold) {
+ fold.setFoldLine(foldLine);
+ });
+ };
+
+ this.clone = function() {
+ var range = this.range.clone();
+ var fold = new Fold(range, this.placeholder);
+ this.subFolds.forEach(function(subFold) {
+ fold.subFolds.push(subFold.clone());
+ });
+ return fold;
+ };
+
+ this.addSubFold = function(fold) {
+ if (this.range.isEqual(fold))
+ return this;
+
+ if (!this.range.containsRange(fold))
+ throw "A fold can't intersect already existing fold" + fold.range + this.range;
+
+ var row = fold.range.start.row, column = fold.range.start.column;
+ for (var i = 0, cmp = -1; i < this.subFolds.length; i++) {
+ cmp = this.subFolds[i].range.compare(row, column);
+ if (cmp != 1)
+ break;
+ }
+ var afterStart = this.subFolds[i];
+
+ if (cmp == 0)
+ return afterStart.addSubFold(fold);
+
+ // cmp == -1
+ var row = fold.range.end.row, column = fold.range.end.column;
+ for (var j = i, cmp = -1; j < this.subFolds.length; j++) {
+ cmp = this.subFolds[j].range.compare(row, column);
+ if (cmp != 1)
+ break;
+ }
+ var afterEnd = this.subFolds[j];
+
+ if (cmp == 0)
+ throw "A fold can't intersect already existing fold" + fold.range + this.range;
+
+ var consumedFolds = this.subFolds.splice(i, j - i, fold);
+ fold.setFoldLine(this.foldLine);
+
+ return fold;
+ };
+
+}).call(Fold.prototype);
+
+});
+
+ace.define('ace/token_iterator', ['require', 'exports', 'module' ], function(require, exports, module) {
+
+
+/**
+ * class TokenIterator
+ *
+ * This class provides an essay way to treat the document as a stream of tokens, and provides methods to iterate over these tokens.
+ *
+ **/
+
+/**
+ * new TokenIterator(session, initialRow, initialColumn)
+ * - session (EditSession): The session to associate with
+ * - initialRow (Number): The row to start the tokenizing at
+ * - initialColumn (Number): The column to start the tokenizing at
+ *
+ * Creates a new token iterator object. The inital token index is set to the provided row and column coordinates.
+ *
+ **/
+var TokenIterator = function(session, initialRow, initialColumn) {
+ this.$session = session;
+ this.$row = initialRow;
+ this.$rowTokens = session.getTokens(initialRow);
+
+ var token = session.getTokenAt(initialRow, initialColumn);
+ this.$tokenIndex = token ? token.index : -1;
+};
+
+(function() {
+
+ /**
+ * TokenIterator.stepBackward() -> [String]
+ * + (String): If the current point is not at the top of the file, this function returns `null`. Otherwise, it returns an array of the tokenized strings.
+ *
+ * Tokenizes all the items from the current point to the row prior in the document.
+ **/
+ this.stepBackward = function() {
+ this.$tokenIndex -= 1;
+
+ while (this.$tokenIndex < 0) {
+ this.$row -= 1;
+ if (this.$row < 0) {
+ this.$row = 0;
+ return null;
+ }
+
+ this.$rowTokens = this.$session.getTokens(this.$row);
+ this.$tokenIndex = this.$rowTokens.length - 1;
+ }
+
+ return this.$rowTokens[this.$tokenIndex];
+ };
+ this.stepForward = function() {
+ var rowCount = this.$session.getLength();
+ this.$tokenIndex += 1;
+
+ while (this.$tokenIndex >= this.$rowTokens.length) {
+ this.$row += 1;
+ if (this.$row >= rowCount) {
+ this.$row = rowCount - 1;
+ return null;
+ }
+
+ this.$rowTokens = this.$session.getTokens(this.$row);
+ this.$tokenIndex = 0;
+ }
+
+ return this.$rowTokens[this.$tokenIndex];
+ };
+ this.getCurrentToken = function () {
+ return this.$rowTokens[this.$tokenIndex];
+ };
+ this.getCurrentTokenRow = function () {
+ return this.$row;
+ };
+ this.getCurrentTokenColumn = function() {
+ var rowTokens = this.$rowTokens;
+ var tokenIndex = this.$tokenIndex;
+
+ // If a column was cached by EditSession.getTokenAt, then use it
+ var column = rowTokens[tokenIndex].start;
+ if (column !== undefined)
+ return column;
+
+ column = 0;
+ while (tokenIndex > 0) {
+ tokenIndex -= 1;
+ column += rowTokens[tokenIndex].value.length;
+ }
+
+ return column;
+ };
+
+}).call(TokenIterator.prototype);
+
+exports.TokenIterator = TokenIterator;
+});
+
+ace.define('ace/edit_session/bracket_match', ['require', 'exports', 'module' , 'ace/token_iterator', 'ace/range'], function(require, exports, module) {
+
+
+var TokenIterator = require("../token_iterator").TokenIterator;
+var Range = require("../range").Range;
+
+
+function BracketMatch() {
+
+ this.findMatchingBracket = function(position) {
+ if (position.column == 0) return null;
+
+ var charBeforeCursor = this.getLine(position.row).charAt(position.column-1);
+ if (charBeforeCursor == "") return null;
+
+ var match = charBeforeCursor.match(/([\(\[\{])|([\)\]\}])/);
+ if (!match)
+ return null;
+
+ if (match[1])
+ return this.$findClosingBracket(match[1], position);
+ else
+ return this.$findOpeningBracket(match[2], position);
+ };
+
+ this.getBracketRange = function(pos) {
+ var line = this.getLine(pos.row);
+ var before = true, range;
+
+ var chr = line.charAt(pos.column-1);
+ var match = chr && chr.match(/([\(\[\{])|([\)\]\}])/);
+ if (!match) {
+ chr = line.charAt(pos.column);
+ pos = {row: pos.row, column: pos.column + 1};
+ match = chr && chr.match(/([\(\[\{])|([\)\]\}])/);
+ before = false;
+ }
+ if (!match)
+ return null;
+
+ if (match[1]) {
+ var bracketPos = this.$findClosingBracket(match[1], pos);
+ if (!bracketPos)
+ return null;
+ range = Range.fromPoints(pos, bracketPos);
+ if (!before) {
+ range.end.column++;
+ range.start.column--;
+ }
+ range.cursor = range.end;
+ } else {
+ var bracketPos = this.$findOpeningBracket(match[2], pos);
+ if (!bracketPos)
+ return null;
+ range = Range.fromPoints(bracketPos, pos);
+ if (!before) {
+ range.start.column++;
+ range.end.column--;
+ }
+ range.cursor = range.start;
+ }
+
+ return range;
+ };
+
+ this.$brackets = {
+ ")": "(",
+ "(": ")",
+ "]": "[",
+ "[": "]",
+ "{": "}",
+ "}": "{"
+ };
+
+ this.$findOpeningBracket = function(bracket, position, typeRe) {
+ var openBracket = this.$brackets[bracket];
+ var depth = 1;
+
+ var iterator = new TokenIterator(this, position.row, position.column);
+ var token = iterator.getCurrentToken();
+ if (!token)
+ token = iterator.stepForward();
+ if (!token)
+ return;
+
+ if (!typeRe){
+ typeRe = new RegExp(
+ "(\\.?" +
+ token.type.replace(".", "\\.").replace("rparen", ".paren")
+ + ")+"
+ );
+ }
+
+ // Start searching in token, just before the character at position.column
+ var valueIndex = position.column - iterator.getCurrentTokenColumn() - 2;
+ var value = token.value;
+
+ while (true) {
+
+ while (valueIndex >= 0) {
+ var chr = value.charAt(valueIndex);
+ if (chr == openBracket) {
+ depth -= 1;
+ if (depth == 0) {
+ return {row: iterator.getCurrentTokenRow(),
+ column: valueIndex + iterator.getCurrentTokenColumn()};
+ }
+ }
+ else if (chr == bracket) {
+ depth += 1;
+ }
+ valueIndex -= 1;
+ }
+
+ // Scan backward through the document, looking for the next token
+ // whose type matches typeRe
+ do {
+ token = iterator.stepBackward();
+ } while (token && !typeRe.test(token.type));
+
+ if (token == null)
+ break;
+
+ value = token.value;
+ valueIndex = value.length - 1;
+ }
+
+ return null;
+ };
+
+ this.$findClosingBracket = function(bracket, position, typeRe) {
+ var closingBracket = this.$brackets[bracket];
+ var depth = 1;
+
+ var iterator = new TokenIterator(this, position.row, position.column);
+ var token = iterator.getCurrentToken();
+ if (!token)
+ token = iterator.stepForward();
+ if (!token)
+ return;
+
+ if (!typeRe){
+ typeRe = new RegExp(
+ "(\\.?" +
+ token.type.replace(".", "\\.").replace("lparen", ".paren")
+ + ")+"
+ );
+ }
+
+ // Start searching in token, after the character at position.column
+ var valueIndex = position.column - iterator.getCurrentTokenColumn();
+
+ while (true) {
+
+ var value = token.value;
+ var valueLength = value.length;
+ while (valueIndex < valueLength) {
+ var chr = value.charAt(valueIndex);
+ if (chr == closingBracket) {
+ depth -= 1;
+ if (depth == 0) {
+ return {row: iterator.getCurrentTokenRow(),
+ column: valueIndex + iterator.getCurrentTokenColumn()};
+ }
+ }
+ else if (chr == bracket) {
+ depth += 1;
+ }
+ valueIndex += 1;
+ }
+
+ // Scan forward through the document, looking for the next token
+ // whose type matches typeRe
+ do {
+ token = iterator.stepForward();
+ } while (token && !typeRe.test(token.type));
+
+ if (token == null)
+ break;
+
+ valueIndex = 0;
+ }
+
+ return null;
+ };
+}
+exports.BracketMatch = BracketMatch;
+
+});
+
+ace.define('ace/search', ['require', 'exports', 'module' , 'ace/lib/lang', 'ace/lib/oop', 'ace/range'], function(require, exports, module) {
+
+
+var lang = require("./lib/lang");
+var oop = require("./lib/oop");
+var Range = require("./range").Range;
+
+/**
+ * new Search()
+ *
+ * Creates a new `Search` object. The following search options are avaliable:
+ *
+ * * `needle`: The string or regular expression you're looking for
+ * * `backwards`: Whether to search backwards from where cursor currently is. Defaults to `false`.
+ * * `wrap`: Whether to wrap the search back to the beginning when it hits the end. Defaults to `false`.
+ * * `caseSensitive`: Whether the search ought to be case-sensitive. Defaults to `false`.
+ * * `wholeWord`: Whether the search matches only on whole words. Defaults to `false`.
+ * * `range`: The [[Range]] to search within. Set this to `null` for the whole document
+ * * `regExp`: Whether the search is a regular expression or not. Defaults to `false`.
+ * * `start`: The starting [[Range]] or cursor position to begin the search
+ * * `skipCurrent`: Whether or not to include the current line in the search. Default to `false`.
+ *
+**/
+
+var Search = function() {
+ this.$options = {};
+};
+
+(function() {
+ /**
+ * Search.set(options) -> Search
+ * - options (Object): An object containing all the new search properties
+ *
+ * Sets the search options via the `options` parameter.
+ *
+ **/
+ this.set = function(options) {
+ oop.mixin(this.$options, options);
+ return this;
+ };
+ this.getOptions = function() {
+ return lang.copyObject(this.$options);
+ };
+
+ this.setOptions = function(options) {
+ this.$options = options;
+ };
+ this.find = function(session) {
+ var iterator = this.$matchIterator(session, this.$options);
+
+ if (!iterator)
+ return false;
+
+ var firstRange = null;
+ iterator.forEach(function(range, row, offset) {
+ if (!range.start) {
+ var column = range.offset + (offset || 0);
+ firstRange = new Range(row, column, row, column+range.length);
+ } else
+ firstRange = range;
+ return true;
+ });
+
+ return firstRange;
+ };
+ this.findAll = function(session) {
+ var options = this.$options;
+ if (!options.needle)
+ return [];
+ this.$assembleRegExp(options);
+
+ var range = options.range;
+ var lines = range
+ ? session.getLines(range.start.row, range.end.row)
+ : session.doc.getAllLines();
+
+ var ranges = [];
+ var re = options.re;
+ if (options.$isMultiLine) {
+ var len = re.length;
+ var maxRow = lines.length - len;
+ for (var row = re.offset || 0; row <= maxRow; row++) {
+ for (var j = 0; j < len; j++)
+ if (lines[row + j].search(re[j]) == -1)
+ break;
+
+ var startLine = lines[row];
+ var line = lines[row + len - 1];
+ var startIndex = startLine.match(re[0])[0].length;
+ var endIndex = line.match(re[len - 1])[0].length;
+
+ ranges.push(new Range(
+ row, startLine.length - startIndex,
+ row + len - 1, endIndex
+ ));
+ }
+ } else {
+ for (var i = 0; i < lines.length; i++) {
+ var matches = lang.getMatchOffsets(lines[i], re);
+ for (var j = 0; j < matches.length; j++) {
+ var match = matches[j];
+ ranges.push(new Range(i, match.offset, i, match.offset + match.length));
+ }
+ }
+ }
+
+ if (range) {
+ var startColumn = range.start.column;
+ var endColumn = range.start.column;
+ var i = 0, j = ranges.length - 1;
+ while (i < j && ranges[i].start.column < startColumn && ranges[i].start.row == range.start.row)
+ i++;
+
+ while (i < j && ranges[j].end.column > endColumn && ranges[j].end.row == range.end.row)
+ j--;
+ return ranges.slice(i, j + 1);
+ }
+
+ return ranges;
+ };
+ this.replace = function(input, replacement) {
+ var options = this.$options;
+
+ var re = this.$assembleRegExp(options);
+ if (options.$isMultiLine)
+ return replacement;
+
+ if (!re)
+ return;
+
+ var match = re.exec(input);
+ if (!match || match[0].length != input.length)
+ return null;
+
+ replacement = input.replace(re, replacement);
+ if (options.preserveCase) {
+ replacement = replacement.split("");
+ for (var i = Math.min(input.length, input.length); i--; ) {
+ var ch = input[i];
+ if (ch && ch.toLowerCase() != ch)
+ replacement[i] = replacement[i].toUpperCase();
+ else
+ replacement[i] = replacement[i].toLowerCase();
+ }
+ replacement = replacement.join("");
+ }
+
+ return replacement;
+ };
+ this.$matchIterator = function(session, options) {
+ var re = this.$assembleRegExp(options);
+ if (!re)
+ return false;
+
+ var self = this, callback, backwards = options.backwards;
+
+ if (options.$isMultiLine) {
+ var len = re.length;
+ var matchIterator = function(line, row, offset) {
+ var startIndex = line.search(re[0]);
+ if (startIndex == -1)
+ return;
+ for (var i = 1; i < len; i++) {
+ line = session.getLine(row + i);
+ if (line.search(re[i]) == -1)
+ return;
+ }
+
+ var endIndex = line.match(re[len - 1])[0].length;
+
+ var range = new Range(row, startIndex, row + len - 1, endIndex);
+ if (re.offset == 1) {
+ range.start.row--;
+ range.start.column = Number.MAX_VALUE;
+ } else if (offset)
+ range.start.column += offset;
+
+ if (callback(range))
+ return true;
+ };
+ } else if (backwards) {
+ var matchIterator = function(line, row, startIndex) {
+ var matches = lang.getMatchOffsets(line, re);
+ for (var i = matches.length-1; i >= 0; i--)
+ if (callback(matches[i], row, startIndex))
+ return true;
+ };
+ } else {
+ var matchIterator = function(line, row, startIndex) {
+ var matches = lang.getMatchOffsets(line, re);
+ for (var i = 0; i < matches.length; i++)
+ if (callback(matches[i], row, startIndex))
+ return true;
+ };
+ }
+
+ return {
+ forEach: function(_callback) {
+ callback = _callback;
+ self.$lineIterator(session, options).forEach(matchIterator);
+ }
+ };
+ };
+
+ this.$assembleRegExp = function(options) {
+ if (options.needle instanceof RegExp)
+ return options.re = options.needle;
+
+ var needle = options.needle;
+
+ if (!options.needle)
+ return options.re = false;
+
+ if (!options.regExp)
+ needle = lang.escapeRegExp(needle);
+
+ if (options.wholeWord)
+ needle = "\\b" + needle + "\\b";
+
+ var modifier = options.caseSensitive ? "g" : "gi";
+
+ options.$isMultiLine = /[\n\r]/.test(needle);
+ if (options.$isMultiLine)
+ return options.re = this.$assembleMultilineRegExp(needle, modifier);
+
+ try {
+ var re = new RegExp(needle, modifier);
+ } catch(e) {
+ re = false;
+ }
+ return options.re = re;
+ };
+
+ this.$assembleMultilineRegExp = function(needle, modifier) {
+ var parts = needle.replace(/\r\n|\r|\n/g, "$\n^").split("\n");
+ var re = [];
+ for (var i = 0; i < parts.length; i++) try {
+ re.push(new RegExp(parts[i], modifier));
+ } catch(e) {
+ return false;
+ }
+ if (parts[0] == "") {
+ re.shift();
+ re.offset = 1;
+ } else {
+ re.offset = 0;
+ }
+ return re;
+ };
+
+ this.$lineIterator = function(session, options) {
+ var backwards = options.backwards == true;
+ var skipCurrent = options.skipCurrent != false;
+
+ var range = options.range;
+ var start = options.start;
+ if (!start)
+ start = range ? range[backwards ? "end" : "start"] : session.selection.getRange();
+
+ if (start.start)
+ start = start[skipCurrent != backwards ? "end" : "start"];
+
+ var firstRow = range ? range.start.row : 0;
+ var lastRow = range ? range.end.row : session.getLength() - 1;
+
+ var forEach = backwards ? function(callback) {
+ var row = start.row;
+
+ var line = session.getLine(row).substring(0, start.column);
+ if (callback(line, row))
+ return;
+
+ for (row--; row >= firstRow; row--)
+ if (callback(session.getLine(row), row))
+ return;
+
+ if (options.wrap == false)
+ return;
+
+ for (row = lastRow, firstRow = start.row; row >= firstRow; row--)
+ if (callback(session.getLine(row), row))
+ return;
+ } : function(callback) {
+ var row = start.row;
+
+ var line = session.getLine(row).substr(start.column);
+ if (callback(line, row, start.column))
+ return;
+
+ for (row = row+1; row <= lastRow; row++)
+ if (callback(session.getLine(row), row))
+ return;
+
+ if (options.wrap == false)
+ return;
+
+ for (row = firstRow, lastRow = start.row; row <= lastRow; row++)
+ if (callback(session.getLine(row), row))
+ return;
+ };
+
+ return {forEach: forEach};
+ };
+
+}).call(Search.prototype);
+
+exports.Search = Search;
+});
+ace.define('ace/commands/command_manager', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/keyboard/hash_handler', 'ace/lib/event_emitter'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var HashHandler = require("../keyboard/hash_handler").HashHandler;
+var EventEmitter = require("../lib/event_emitter").EventEmitter;
+
+/**
+ * new CommandManager(platform, commands)
+ * - platform (String): Identifier for the platform; must be either `'mac'` or `'win'`
+ * - commands (Array): A list of commands
+ *
+ * TODO
+ *
+ *
+ **/
+
+var CommandManager = function(platform, commands) {
+ this.platform = platform;
+ this.commands = this.byName = {};
+ this.commmandKeyBinding = {};
+
+ this.addCommands(commands);
+
+ this.setDefaultHandler("exec", function(e) {
+ return e.command.exec(e.editor, e.args || {});
+ });
+};
+
+oop.inherits(CommandManager, HashHandler);
+
+(function() {
+
+ oop.implement(this, EventEmitter);
+
+ this.exec = function(command, editor, args) {
+ if (typeof command === 'string')
+ command = this.commands[command];
+
+ if (!command)
+ return false;
+
+ if (editor && editor.$readOnly && !command.readOnly)
+ return false;
+
+ var retvalue = this._emit("exec", {
+ editor: editor,
+ command: command,
+ args: args
+ });
+
+ return retvalue === false ? false : true;
+ };
+
+ this.toggleRecording = function(editor) {
+ if (this.$inReplay)
+ return;
+
+ editor && editor._emit("changeStatus");
+ if (this.recording) {
+ this.macro.pop();
+ this.removeEventListener("exec", this.$addCommandToMacro);
+
+ if (!this.macro.length)
+ this.macro = this.oldMacro;
+
+ return this.recording = false;
+ }
+ if (!this.$addCommandToMacro) {
+ this.$addCommandToMacro = function(e) {
+ this.macro.push([e.command, e.args]);
+ }.bind(this);
+ }
+
+ this.oldMacro = this.macro;
+ this.macro = [];
+ this.on("exec", this.$addCommandToMacro);
+ return this.recording = true;
+ };
+
+ this.replay = function(editor) {
+ if (this.$inReplay || !this.macro)
+ return;
+
+ if (this.recording)
+ return this.toggleRecording(editor);
+
+ try {
+ this.$inReplay = true;
+ this.macro.forEach(function(x) {
+ if (typeof x == "string")
+ this.exec(x, editor);
+ else
+ this.exec(x[0], editor, x[1]);
+ }, this);
+ } finally {
+ this.$inReplay = false;
+ }
+ };
+
+ this.trimMacro = function(m) {
+ return m.map(function(x){
+ if (typeof x[0] != "string")
+ x[0] = x[0].name;
+ if (!x[1])
+ x = x[0];
+ return x;
+ });
+ };
+
+}).call(CommandManager.prototype);
+
+exports.CommandManager = CommandManager;
+
+});
+
+ace.define('ace/keyboard/hash_handler', ['require', 'exports', 'module' , 'ace/lib/keys'], function(require, exports, module) {
+
+
+var keyUtil = require("../lib/keys");
+
+function HashHandler(config, platform) {
+ this.platform = platform;
+ this.commands = {};
+ this.commmandKeyBinding = {};
+
+ this.addCommands(config);
+};
+
+(function() {
+
+ this.addCommand = function(command) {
+ if (this.commands[command.name])
+ this.removeCommand(command);
+
+ this.commands[command.name] = command;
+
+ if (command.bindKey)
+ this._buildKeyHash(command);
+ };
+
+ this.removeCommand = function(command) {
+ var name = (typeof command === 'string' ? command : command.name);
+ command = this.commands[name];
+ delete this.commands[name];
+
+ // exhaustive search is brute force but since removeCommand is
+ // not a performance critical operation this should be OK
+ var ckb = this.commmandKeyBinding;
+ for (var hashId in ckb) {
+ for (var key in ckb[hashId]) {
+ if (ckb[hashId][key] == command)
+ delete ckb[hashId][key];
+ }
+ }
+ };
+
+ this.bindKey = function(key, command) {
+ if(!key)
+ return;
+ if (typeof command == "function") {
+ this.addCommand({exec: command, bindKey: key, name: key});
+ return;
+ }
+
+ var ckb = this.commmandKeyBinding;
+ key.split("|").forEach(function(keyPart) {
+ var binding = this.parseKeys(keyPart, command);
+ var hashId = binding.hashId;
+ (ckb[hashId] || (ckb[hashId] = {}))[binding.key] = command;
+ }, this);
+ };
+
+ this.addCommands = function(commands) {
+ commands && Object.keys(commands).forEach(function(name) {
+ var command = commands[name];
+ if (typeof command === "string")
+ return this.bindKey(command, name);
+
+ if (typeof command === "function")
+ command = { exec: command };
+
+ if (!command.name)
+ command.name = name;
+
+ this.addCommand(command);
+ }, this);
+ };
+
+ this.removeCommands = function(commands) {
+ Object.keys(commands).forEach(function(name) {
+ this.removeCommand(commands[name]);
+ }, this);
+ };
+
+ this.bindKeys = function(keyList) {
+ Object.keys(keyList).forEach(function(key) {
+ this.bindKey(key, keyList[key]);
+ }, this);
+ };
+
+ this._buildKeyHash = function(command) {
+ var binding = command.bindKey;
+ if (!binding)
+ return;
+
+ var key = typeof binding == "string" ? binding: binding[this.platform];
+ this.bindKey(key, command);
+ };
+
+ // accepts keys in the form ctrl+Enter or ctrl-Enter
+ // keys without modifiers or shift only
+ this.parseKeys = function(keys) {
+ var parts = keys.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(x){return x});
+ var key = parts.pop();
+
+ var keyCode = keyUtil[key];
+ if (keyUtil.FUNCTION_KEYS[keyCode])
+ key = keyUtil.FUNCTION_KEYS[keyCode].toLowerCase();
+ else if (!parts.length)
+ return {key: key, hashId: -1};
+ else if (parts.length == 1 && parts[0] == "shift")
+ return {key: key.toUpperCase(), hashId: -1};
+
+ var hashId = 0;
+ for (var i = parts.length; i--;) {
+ var modifier = keyUtil.KEY_MODS[parts[i]];
+ if (modifier == null)
+ throw "invalid modifier " + parts[i] + " in " + keys;
+ hashId |= modifier;
+ }
+ return {key: key, hashId: hashId};
+ };
+
+ this.findKeyCommand = function findKeyCommand(hashId, keyString) {
+ var ckbr = this.commmandKeyBinding;
+ return ckbr[hashId] && ckbr[hashId][keyString];
+ };
+
+ this.handleKeyboard = function(data, hashId, keyString, keyCode) {
+ return {
+ command: this.findKeyCommand(hashId, keyString)
+ };
+ };
+
+}).call(HashHandler.prototype)
+
+exports.HashHandler = HashHandler;
+});
+
+ace.define('ace/commands/default_commands', ['require', 'exports', 'module' , 'ace/lib/lang'], function(require, exports, module) {
+
+
+var lang = require("../lib/lang");
+
+function bindKey(win, mac) {
+ return {
+ win: win,
+ mac: mac
+ };
+}
+
+exports.commands = [{
+ name: "selectall",
+ bindKey: bindKey("Ctrl-A", "Command-A"),
+ exec: function(editor) { editor.selectAll(); },
+ readOnly: true
+}, {
+ name: "centerselection",
+ bindKey: bindKey(null, "Ctrl-L"),
+ exec: function(editor) { editor.centerSelection(); },
+ readOnly: true
+}, {
+ name: "gotoline",
+ bindKey: bindKey("Ctrl-L", "Command-L"),
+ exec: function(editor) {
+ var line = parseInt(prompt("Enter line number:"), 10);
+ if (!isNaN(line)) {
+ editor.gotoLine(line);
+ }
+ },
+ readOnly: true
+}, {
+ name: "fold",
+ bindKey: bindKey("Alt-L|Ctrl-F1", "Command-Alt-L|Command-F1"),
+ exec: function(editor) { editor.session.toggleFold(false); },
+ readOnly: true
+}, {
+ name: "unfold",
+ bindKey: bindKey("Alt-Shift-L|Ctrl-Shift-F1", "Command-Alt-Shift-L|Command-Shift-F1"),
+ exec: function(editor) { editor.session.toggleFold(true); },
+ readOnly: true
+}, {
+ name: "foldall",
+ bindKey: bindKey("Alt-0", "Command-Option-0"),
+ exec: function(editor) { editor.session.foldAll(); },
+ readOnly: true
+}, {
+ name: "unfoldall",
+ bindKey: bindKey("Alt-Shift-0", "Command-Option-Shift-0"),
+ exec: function(editor) { editor.session.unfold(); },
+ readOnly: true
+}, {
+ name: "findnext",
+ bindKey: bindKey("Ctrl-K", "Command-G"),
+ exec: function(editor) { editor.findNext(); },
+ readOnly: true
+}, {
+ name: "findprevious",
+ bindKey: bindKey("Ctrl-Shift-K", "Command-Shift-G"),
+ exec: function(editor) { editor.findPrevious(); },
+ readOnly: true
+}, {
+ name: "find",
+ bindKey: bindKey("Ctrl-F", "Command-F"),
+ exec: function(editor) {
+ var needle = prompt("Find:", editor.getCopyText());
+ editor.find(needle);
+ },
+ readOnly: true
+}, {
+ name: "overwrite",
+ bindKey: "Insert",
+ exec: function(editor) { editor.toggleOverwrite(); },
+ readOnly: true
+}, {
+ name: "selecttostart",
+ bindKey: bindKey("Ctrl-Shift-Home", "Command-Shift-Up"),
+ exec: function(editor) { editor.getSelection().selectFileStart(); },
+ multiSelectAction: "forEach",
+ readOnly: true
+}, {
+ name: "gotostart",
+ bindKey: bindKey("Ctrl-Home", "Command-Home|Command-Up"),
+ exec: function(editor) { editor.navigateFileStart(); },
+ multiSelectAction: "forEach",
+ readOnly: true
+}, {
+ name: "selectup",
+ bindKey: bindKey("Shift-Up", "Shift-Up"),
+ exec: function(editor) { editor.getSelection().selectUp(); },
+ multiSelectAction: "forEach",
+ readOnly: true
+}, {
+ name: "golineup",
+ bindKey: bindKey("Up", "Up|Ctrl-P"),
+ exec: function(editor, args) { editor.navigateUp(args.times); },
+ multiSelectAction: "forEach",
+ readOnly: true
+}, {
+ name: "selecttoend",
+ bindKey: bindKey("Ctrl-Shift-End", "Command-Shift-Down"),
+ exec: function(editor) { editor.getSelection().selectFileEnd(); },
+ multiSelectAction: "forEach",
+ readOnly: true
+}, {
+ name: "gotoend",
+ bindKey: bindKey("Ctrl-End", "Command-End|Command-Down"),
+ exec: function(editor) { editor.navigateFileEnd(); },
+ multiSelectAction: "forEach",
+ readOnly: true
+}, {
+ name: "selectdown",
+ bindKey: bindKey("Shift-Down", "Shift-Down"),
+ exec: function(editor) { editor.getSelection().selectDown(); },
+ multiSelectAction: "forEach",
+ readOnly: true
+}, {
+ name: "golinedown",
+ bindKey: bindKey("Down", "Down|Ctrl-N"),
+ exec: function(editor, args) { editor.navigateDown(args.times); },
+ multiSelectAction: "forEach",
+ readOnly: true
+}, {
+ name: "selectwordleft",
+ bindKey: bindKey("Ctrl-Shift-Left", "Option-Shift-Left"),
+ exec: function(editor) { editor.getSelection().selectWordLeft(); },
+ multiSelectAction: "forEach",
+ readOnly: true
+}, {
+ name: "gotowordleft",
+ bindKey: bindKey("Ctrl-Left", "Option-Left"),
+ exec: function(editor) { editor.navigateWordLeft(); },
+ multiSelectAction: "forEach",
+ readOnly: true
+}, {
+ name: "selecttolinestart",
+ bindKey: bindKey("Alt-Shift-Left", "Command-Shift-Left"),
+ exec: function(editor) { editor.getSelection().selectLineStart(); },
+ multiSelectAction: "forEach",
+ readOnly: true
+}, {
+ name: "gotolinestart",
+ bindKey: bindKey("Alt-Left|Home", "Command-Left|Home|Ctrl-A"),
+ exec: function(editor) { editor.navigateLineStart(); },
+ multiSelectAction: "forEach",
+ readOnly: true
+}, {
+ name: "selectleft",
+ bindKey: bindKey("Shift-Left", "Shift-Left"),
+ exec: function(editor) { editor.getSelection().selectLeft(); },
+ multiSelectAction: "forEach",
+ readOnly: true
+}, {
+ name: "gotoleft",
+ bindKey: bindKey("Left", "Left|Ctrl-B"),
+ exec: function(editor, args) { editor.navigateLeft(args.times); },
+ multiSelectAction: "forEach",
+ readOnly: true
+}, {
+ name: "selectwordright",
+ bindKey: bindKey("Ctrl-Shift-Right", "Option-Shift-Right"),
+ exec: function(editor) { editor.getSelection().selectWordRight(); },
+ multiSelectAction: "forEach",
+ readOnly: true
+}, {
+ name: "gotowordright",
+ bindKey: bindKey("Ctrl-Right", "Option-Right"),
+ exec: function(editor) { editor.navigateWordRight(); },
+ multiSelectAction: "forEach",
+ readOnly: true
+}, {
+ name: "selecttolineend",
+ bindKey: bindKey("Alt-Shift-Right", "Command-Shift-Right"),
+ exec: function(editor) { editor.getSelection().selectLineEnd(); },
+ multiSelectAction: "forEach",
+ readOnly: true
+}, {
+ name: "gotolineend",
+ bindKey: bindKey("Alt-Right|End", "Command-Right|End|Ctrl-E"),
+ exec: function(editor) { editor.navigateLineEnd(); },
+ multiSelectAction: "forEach",
+ readOnly: true
+}, {
+ name: "selectright",
+ bindKey: bindKey("Shift-Right", "Shift-Right"),
+ exec: function(editor) { editor.getSelection().selectRight(); },
+ multiSelectAction: "forEach",
+ readOnly: true
+}, {
+ name: "gotoright",
+ bindKey: bindKey("Right", "Right|Ctrl-F"),
+ exec: function(editor, args) { editor.navigateRight(args.times); },
+ multiSelectAction: "forEach",
+ readOnly: true
+}, {
+ name: "selectpagedown",
+ bindKey: "Shift-PageDown",
+ exec: function(editor) { editor.selectPageDown(); },
+ readOnly: true
+}, {
+ name: "pagedown",
+ bindKey: bindKey(null, "Option-PageDown"),
+ exec: function(editor) { editor.scrollPageDown(); },
+ readOnly: true
+}, {
+ name: "gotopagedown",
+ bindKey: bindKey("PageDown", "PageDown|Ctrl-V"),
+ exec: function(editor) { editor.gotoPageDown(); },
+ readOnly: true
+}, {
+ name: "selectpageup",
+ bindKey: "Shift-PageUp",
+ exec: function(editor) { editor.selectPageUp(); },
+ readOnly: true
+}, {
+ name: "pageup",
+ bindKey: bindKey(null, "Option-PageUp"),
+ exec: function(editor) { editor.scrollPageUp(); },
+ readOnly: true
+}, {
+ name: "gotopageup",
+ bindKey: "PageUp",
+ exec: function(editor) { editor.gotoPageUp(); },
+ readOnly: true
+}, {
+ name: "scrollup",
+ bindKey: bindKey("Ctrl-Up", null),
+ exec: function(e) { e.renderer.scrollBy(0, -2 * e.renderer.layerConfig.lineHeight); },
+ readOnly: true
+}, {
+ name: "scrolldown",
+ bindKey: bindKey("Ctrl-Down", null),
+ exec: function(e) { e.renderer.scrollBy(0, 2 * e.renderer.layerConfig.lineHeight); },
+ readOnly: true
+}, {
+ name: "selectlinestart",
+ bindKey: "Shift-Home",
+ exec: function(editor) { editor.getSelection().selectLineStart(); },
+ multiSelectAction: "forEach",
+ readOnly: true
+}, {
+ name: "selectlineend",
+ bindKey: "Shift-End",
+ exec: function(editor) { editor.getSelection().selectLineEnd(); },
+ multiSelectAction: "forEach",
+ readOnly: true
+}, {
+ name: "togglerecording",
+ bindKey: bindKey("Ctrl-Alt-E", "Command-Option-E"),
+ exec: function(editor) { editor.commands.toggleRecording(editor); },
+ readOnly: true
+}, {
+ name: "replaymacro",
+ bindKey: bindKey("Ctrl-Shift-E", "Command-Shift-E"),
+ exec: function(editor) { editor.commands.replay(editor); },
+ readOnly: true
+}, {
+ name: "jumptomatching",
+ bindKey: bindKey("Ctrl-P", "Ctrl-Shift-P"),
+ exec: function(editor) { editor.jumpToMatching(); },
+ multiSelectAction: "forEach",
+ readOnly: true
+}, {
+ name: "selecttomatching",
+ bindKey: bindKey("Ctrl-Shift-P", null),
+ exec: function(editor) { editor.jumpToMatching(true); },
+ readOnly: true
+},
+
+// commands disabled in readOnly mode
+{
+ name: "cut",
+ exec: function(editor) {
+ var range = editor.getSelectionRange();
+ editor._emit("cut", range);
+
+ if (!editor.selection.isEmpty()) {
+ editor.session.remove(range);
+ editor.clearSelection();
+ }
+ },
+ multiSelectAction: "forEach"
+}, {
+ name: "removeline",
+ bindKey: bindKey("Ctrl-D", "Command-D"),
+ exec: function(editor) { editor.removeLines(); },
+ multiSelectAction: "forEach"
+}, {
+ name: "duplicateSelection",
+ bindKey: bindKey("Ctrl-Shift-D", "Command-Shift-D"),
+ exec: function(editor) { editor.duplicateSelection(); },
+ multiSelectAction: "forEach"
+}, {
+ name: "togglecomment",
+ bindKey: bindKey("Ctrl-/", "Command-/"),
+ exec: function(editor) { editor.toggleCommentLines(); },
+ multiSelectAction: "forEach"
+}, {
+ name: "replace",
+ bindKey: bindKey("Ctrl-R", "Command-Option-F"),
+ exec: function(editor) {
+ var needle = prompt("Find:", editor.getCopyText());
+ if (!needle)
+ return;
+ var replacement = prompt("Replacement:");
+ if (!replacement)
+ return;
+ editor.replace(replacement, {needle: needle});
+ }
+}, {
+ name: "replaceall",
+ bindKey: bindKey("Ctrl-Shift-R", "Command-Shift-Option-F"),
+ exec: function(editor) {
+ var needle = prompt("Find:");
+ if (!needle)
+ return;
+ var replacement = prompt("Replacement:");
+ if (!replacement)
+ return;
+ editor.replaceAll(replacement, {needle: needle});
+ }
+}, {
+ name: "undo",
+ bindKey: bindKey("Ctrl-Z", "Command-Z"),
+ exec: function(editor) { editor.undo(); }
+}, {
+ name: "redo",
+ bindKey: bindKey("Ctrl-Shift-Z|Ctrl-Y", "Command-Shift-Z|Command-Y"),
+ exec: function(editor) { editor.redo(); }
+}, {
+ name: "copylinesup",
+ bindKey: bindKey("Alt-Shift-Up", "Command-Option-Up"),
+ exec: function(editor) { editor.copyLinesUp(); }
+}, {
+ name: "movelinesup",
+ bindKey: bindKey("Alt-Up", "Option-Up"),
+ exec: function(editor) { editor.moveLinesUp(); }
+}, {
+ name: "copylinesdown",
+ bindKey: bindKey("Alt-Shift-Down", "Command-Option-Down"),
+ exec: function(editor) { editor.copyLinesDown(); }
+}, {
+ name: "movelinesdown",
+ bindKey: bindKey("Alt-Down", "Option-Down"),
+ exec: function(editor) { editor.moveLinesDown(); }
+}, {
+ name: "del",
+ bindKey: bindKey("Delete", "Delete|Ctrl-D"),
+ exec: function(editor) { editor.remove("right"); },
+ multiSelectAction: "forEach"
+}, {
+ name: "backspace",
+ bindKey: bindKey(
+ "Command-Backspace|Option-Backspace|Shift-Backspace|Backspace",
+ "Ctrl-Backspace|Command-Backspace|Shift-Backspace|Backspace|Ctrl-H"
+ ),
+ exec: function(editor) { editor.remove("left"); },
+ multiSelectAction: "forEach"
+}, {
+ name: "removetolinestart",
+ bindKey: bindKey("Alt-Backspace", "Command-Backspace"),
+ exec: function(editor) { editor.removeToLineStart(); },
+ multiSelectAction: "forEach"
+}, {
+ name: "removetolineend",
+ bindKey: bindKey("Alt-Delete", "Ctrl-K"),
+ exec: function(editor) { editor.removeToLineEnd(); },
+ multiSelectAction: "forEach"
+}, {
+ name: "removewordleft",
+ bindKey: bindKey("Ctrl-Backspace", "Alt-Backspace|Ctrl-Alt-Backspace"),
+ exec: function(editor) { editor.removeWordLeft(); },
+ multiSelectAction: "forEach"
+}, {
+ name: "removewordright",
+ bindKey: bindKey("Ctrl-Delete", "Alt-Delete"),
+ exec: function(editor) { editor.removeWordRight(); },
+ multiSelectAction: "forEach"
+}, {
+ name: "outdent",
+ bindKey: bindKey("Shift-Tab", "Shift-Tab"),
+ exec: function(editor) { editor.blockOutdent(); },
+ multiSelectAction: "forEach"
+}, {
+ name: "indent",
+ bindKey: bindKey("Tab", "Tab"),
+ exec: function(editor) { editor.indent(); },
+ multiSelectAction: "forEach"
+}, {
+ name: "insertstring",
+ exec: function(editor, str) { editor.insert(str); },
+ multiSelectAction: "forEach"
+}, {
+ name: "inserttext",
+ exec: function(editor, args) {
+ editor.insert(lang.stringRepeat(args.text || "", args.times || 1));
+ },
+ multiSelectAction: "forEach"
+}, {
+ name: "splitline",
+ bindKey: bindKey(null, "Ctrl-O"),
+ exec: function(editor) { editor.splitLine(); },
+ multiSelectAction: "forEach"
+}, {
+ name: "transposeletters",
+ bindKey: bindKey("Ctrl-T", "Ctrl-T"),
+ exec: function(editor) { editor.transposeLetters(); },
+ multiSelectAction: function(editor) {editor.transposeSelections(1); }
+}, {
+ name: "touppercase",
+ bindKey: bindKey("Ctrl-U", "Ctrl-U"),
+ exec: function(editor) { editor.toUpperCase(); },
+ multiSelectAction: "forEach"
+}, {
+ name: "tolowercase",
+ bindKey: bindKey("Ctrl-Shift-U", "Ctrl-Shift-U"),
+ exec: function(editor) { editor.toLowerCase(); },
+ multiSelectAction: "forEach"
+}];
+
+});
+
+ace.define('ace/undomanager', ['require', 'exports', 'module' ], function(require, exports, module) {
+
+
+/**
+ * class UndoManager
+ *
+ * This object maintains the undo stack for an [[EditSession `EditSession`]].
+ *
+ **/
+
+/**
+ * new UndoManager()
+ *
+ * Resets the current undo state and creates a new `UndoManager`.
+ **/
+var UndoManager = function() {
+ this.reset();
+};
+
+(function() {
+
+ /**
+ * UndoManager.execute(options) -> Void
+ * - options (Object): Contains additional properties
+ *
+ * Provides a means for implementing your own undo manager. `options` has one property, `args`, an [[Array `Array`]], with two elements:
+ *
+ * * `args[0]` is an array of deltas
+ * * `args[1]` is the document to associate with
+ *
+ **/
+ this.execute = function(options) {
+ var deltas = options.args[0];
+ this.$doc = options.args[1];
+ this.$undoStack.push(deltas);
+ this.$redoStack = [];
+ };
+ this.undo = function(dontSelect) {
+ var deltas = this.$undoStack.pop();
+ var undoSelectionRange = null;
+ if (deltas) {
+ undoSelectionRange =
+ this.$doc.undoChanges(deltas, dontSelect);
+ this.$redoStack.push(deltas);
+ }
+ return undoSelectionRange;
+ };
+ this.redo = function(dontSelect) {
+ var deltas = this.$redoStack.pop();
+ var redoSelectionRange = null;
+ if (deltas) {
+ redoSelectionRange =
+ this.$doc.redoChanges(deltas, dontSelect);
+ this.$undoStack.push(deltas);
+ }
+ return redoSelectionRange;
+ };
+ this.reset = function() {
+ this.$undoStack = [];
+ this.$redoStack = [];
+ };
+ this.hasUndo = function() {
+ return this.$undoStack.length > 0;
+ };
+ this.hasRedo = function() {
+ return this.$redoStack.length > 0;
+ };
+
+}).call(UndoManager.prototype);
+
+exports.UndoManager = UndoManager;
+});
+
+ace.define('ace/virtual_renderer', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/dom', 'ace/lib/event', 'ace/lib/useragent', 'ace/config', 'ace/lib/net', 'ace/layer/gutter', 'ace/layer/marker', 'ace/layer/text', 'ace/layer/cursor', 'ace/scrollbar', 'ace/renderloop', 'ace/lib/event_emitter', 'text!ace/css/editor.css'], function(require, exports, module) {
+
+
+var oop = require("./lib/oop");
+var dom = require("./lib/dom");
+var event = require("./lib/event");
+var useragent = require("./lib/useragent");
+var config = require("./config");
+var net = require("./lib/net");
+var GutterLayer = require("./layer/gutter").Gutter;
+var MarkerLayer = require("./layer/marker").Marker;
+var TextLayer = require("./layer/text").Text;
+var CursorLayer = require("./layer/cursor").Cursor;
+var ScrollBar = require("./scrollbar").ScrollBar;
+var RenderLoop = require("./renderloop").RenderLoop;
+var EventEmitter = require("./lib/event_emitter").EventEmitter;
+var editorCss = require("text!./css/editor.css");
+
+dom.importCssString(editorCss, "ace_editor");
+
+/**
+ * new VirtualRenderer(container, theme)
+ * - container (DOMElement): The root element of the editor
+ * - theme (String): The starting theme
+ *
+ * Constructs a new `VirtualRenderer` within the `container` specified, applying the given `theme`.
+ *
+ **/
+
+var VirtualRenderer = function(container, theme) {
+ var _self = this;
+
+ this.container = container;
+
+ // TODO: this breaks rendering in Cloud9 with multiple ace instances
+// // Imports CSS once per DOM document ('ace_editor' serves as an identifier).
+// dom.importCssString(editorCss, "ace_editor", container.ownerDocument);
+
+ // in IE <= 9 the native cursor always shines through
+ this.$keepTextAreaAtCursor = !useragent.isIE;
+
+ dom.addCssClass(container, "ace_editor");
+
+ this.setTheme(theme);
+
+ this.$gutter = dom.createElement("div");
+ this.$gutter.className = "ace_gutter";
+ this.container.appendChild(this.$gutter);
+
+ this.scroller = dom.createElement("div");
+ this.scroller.className = "ace_scroller";
+ this.container.appendChild(this.scroller);
+
+ this.content = dom.createElement("div");
+ this.content.className = "ace_content";
+ this.scroller.appendChild(this.content);
+
+ this.setHighlightGutterLine(true);
+ this.$gutterLayer = new GutterLayer(this.$gutter);
+ this.$gutterLayer.on("changeGutterWidth", this.onResize.bind(this, true));
+
+ this.$markerBack = new MarkerLayer(this.content);
+
+ var textLayer = this.$textLayer = new TextLayer(this.content);
+ this.canvas = textLayer.element;
+
+ this.$markerFront = new MarkerLayer(this.content);
+
+ this.characterWidth = textLayer.getCharacterWidth();
+ this.lineHeight = textLayer.getLineHeight();
+
+ this.$cursorLayer = new CursorLayer(this.content);
+ this.$cursorPadding = 8;
+
+ // Indicates whether the horizontal scrollbar is visible
+ this.$horizScroll = false;
+ this.$horizScrollAlwaysVisible = false;
+
+ this.$animatedScroll = false;
+
+ this.scrollBar = new ScrollBar(container);
+ this.scrollBar.addEventListener("scroll", function(e) {
+ if (!_self.$inScrollAnimation)
+ _self.session.setScrollTop(e.data);
+ });
+
+ this.scrollTop = 0;
+ this.scrollLeft = 0;
+
+ event.addListener(this.scroller, "scroll", function() {
+ var scrollLeft = _self.scroller.scrollLeft;
+ _self.scrollLeft = scrollLeft;
+ _self.session.setScrollLeft(scrollLeft);
+ });
+
+ this.cursorPos = {
+ row : 0,
+ column : 0
+ };
+
+ this.$textLayer.addEventListener("changeCharacterSize", function() {
+ _self.characterWidth = textLayer.getCharacterWidth();
+ _self.lineHeight = textLayer.getLineHeight();
+ _self.$updatePrintMargin();
+ _self.onResize(true);
+
+ _self.$loop.schedule(_self.CHANGE_FULL);
+ });
+
+ this.$size = {
+ width: 0,
+ height: 0,
+ scrollerHeight: 0,
+ scrollerWidth: 0
+ };
+
+ this.layerConfig = {
+ width : 1,
+ padding : 0,
+ firstRow : 0,
+ firstRowScreen: 0,
+ lastRow : 0,
+ lineHeight : 1,
+ characterWidth : 1,
+ minHeight : 1,
+ maxHeight : 1,
+ offset : 0,
+ height : 1
+ };
+
+ this.$loop = new RenderLoop(
+ this.$renderChanges.bind(this),
+ this.container.ownerDocument.defaultView
+ );
+ this.$loop.schedule(this.CHANGE_FULL);
+
+ this.setPadding(4);
+ this.$updatePrintMargin();
+};
+
+(function() {
+ this.showGutter = true;
+
+ this.CHANGE_CURSOR = 1;
+ this.CHANGE_MARKER = 2;
+ this.CHANGE_GUTTER = 4;
+ this.CHANGE_SCROLL = 8;
+ this.CHANGE_LINES = 16;
+ this.CHANGE_TEXT = 32;
+ this.CHANGE_SIZE = 64;
+ this.CHANGE_MARKER_BACK = 128;
+ this.CHANGE_MARKER_FRONT = 256;
+ this.CHANGE_FULL = 512;
+ this.CHANGE_H_SCROLL = 1024;
+
+ oop.implement(this, EventEmitter);
+ this.setSession = function(session) {
+ this.session = session;
+
+ this.scroller.className = "ace_scroller";
+
+ this.$cursorLayer.setSession(session);
+ this.$markerBack.setSession(session);
+ this.$markerFront.setSession(session);
+ this.$gutterLayer.setSession(session);
+ this.$textLayer.setSession(session);
+ this.$loop.schedule(this.CHANGE_FULL);
+
+ };
+ this.updateLines = function(firstRow, lastRow) {
+ if (lastRow === undefined)
+ lastRow = Infinity;
+
+ if (!this.$changedLines) {
+ this.$changedLines = {
+ firstRow: firstRow,
+ lastRow: lastRow
+ };
+ }
+ else {
+ if (this.$changedLines.firstRow > firstRow)
+ this.$changedLines.firstRow = firstRow;
+
+ if (this.$changedLines.lastRow < lastRow)
+ this.$changedLines.lastRow = lastRow;
+ }
+
+ this.$loop.schedule(this.CHANGE_LINES);
+ };
+
+ this.onChangeTabSize = function() {
+ this.$loop.schedule(this.CHANGE_TEXT | this.CHANGE_MARKER);
+ this.$textLayer.onChangeTabSize();
+ };
+ this.updateText = function() {
+ this.$loop.schedule(this.CHANGE_TEXT);
+ };
+ this.updateFull = function(force) {
+ if (force){
+ this.$renderChanges(this.CHANGE_FULL, true);
+ }
+ else {
+ this.$loop.schedule(this.CHANGE_FULL);
+ }
+ };
+ this.updateFontSize = function() {
+ this.$textLayer.checkForSizeChanges();
+ };
+ this.onResize = function(force, gutterWidth, width, height) {
+ var changes = this.CHANGE_SIZE;
+ var size = this.$size;
+
+ if (this.resizing > 2)
+ return;
+ else if (this.resizing > 1)
+ this.resizing++;
+ else
+ this.resizing = force ? 1 : 0;
+
+ if (!height)
+ height = dom.getInnerHeight(this.container);
+ if (force || size.height != height) {
+ size.height = height;
+
+ this.scroller.style.height = height + "px";
+ size.scrollerHeight = this.scroller.clientHeight;
+ this.scrollBar.setHeight(size.scrollerHeight);
+
+ if (this.session) {
+ this.session.setScrollTop(this.getScrollTop());
+ changes = changes | this.CHANGE_FULL;
+ }
+ }
+
+ if (!width)
+ width = dom.getInnerWidth(this.container);
+ if (force || this.resizing > 1 || size.width != width) {
+ size.width = width;
+
+ var gutterWidth = this.showGutter ? this.$gutter.offsetWidth : 0;
+ this.scroller.style.left = gutterWidth + "px";
+ size.scrollerWidth = Math.max(0, width - gutterWidth - this.scrollBar.getWidth());
+ this.scroller.style.right = this.scrollBar.getWidth() + "px";
+
+ if (this.session.getUseWrapMode() && this.adjustWrapLimit() || force)
+ changes = changes | this.CHANGE_FULL;
+ }
+
+ if (force)
+ this.$renderChanges(changes, true);
+ else
+ this.$loop.schedule(changes);
+
+ if (force)
+ delete this.resizing;
+ };
+ this.adjustWrapLimit = function() {
+ var availableWidth = this.$size.scrollerWidth - this.$padding * 2;
+ var limit = Math.floor(availableWidth / this.characterWidth);
+ return this.session.adjustWrapLimit(limit);
+ };
+ this.setAnimatedScroll = function(shouldAnimate){
+ this.$animatedScroll = shouldAnimate;
+ };
+ this.getAnimatedScroll = function() {
+ return this.$animatedScroll;
+ };
+ this.setShowInvisibles = function(showInvisibles) {
+ if (this.$textLayer.setShowInvisibles(showInvisibles))
+ this.$loop.schedule(this.CHANGE_TEXT);
+ };
+ this.getShowInvisibles = function() {
+ return this.$textLayer.showInvisibles;
+ };
+
+ this.getDisplayIndentGuides = function() {
+ return this.$textLayer.displayIndentGuides;
+ };
+
+ this.setDisplayIndentGuides = function(display) {
+ if (this.$textLayer.setDisplayIndentGuides(display))
+ this.$loop.schedule(this.CHANGE_TEXT);
+ };
+
+ this.$showPrintMargin = true;
+ this.setShowPrintMargin = function(showPrintMargin) {
+ this.$showPrintMargin = showPrintMargin;
+ this.$updatePrintMargin();
+ };
+ this.getShowPrintMargin = function() {
+ return this.$showPrintMargin;
+ };
+
+ this.$printMarginColumn = 80;
+ this.setPrintMarginColumn = function(showPrintMargin) {
+ this.$printMarginColumn = showPrintMargin;
+ this.$updatePrintMargin();
+ };
+ this.getPrintMarginColumn = function() {
+ return this.$printMarginColumn;
+ };
+ this.getShowGutter = function(){
+ return this.showGutter;
+ };
+ this.setShowGutter = function(show){
+ if(this.showGutter === show)
+ return;
+ this.$gutter.style.display = show ? "block" : "none";
+ this.showGutter = show;
+ this.onResize(true);
+ };
+
+ this.getFadeFoldWidgets = function(){
+ return dom.hasCssClass(this.$gutter, "ace_fade-fold-widgets");
+ };
+
+ this.setFadeFoldWidgets = function(show) {
+ if (show)
+ dom.addCssClass(this.$gutter, "ace_fade-fold-widgets");
+ else
+ dom.removeCssClass(this.$gutter, "ace_fade-fold-widgets");
+ };
+
+ this.$highlightGutterLine = false;
+ this.setHighlightGutterLine = function(shouldHighlight) {
+ if (this.$highlightGutterLine == shouldHighlight)
+ return;
+ this.$highlightGutterLine = shouldHighlight;
+
+ if (!this.$gutterLineHighlight) {
+ this.$gutterLineHighlight = dom.createElement("div");
+ this.$gutterLineHighlight.className = "ace_gutter_active_line";
+ this.$gutter.appendChild(this.$gutterLineHighlight);
+ return;
+ }
+
+ this.$gutterLineHighlight.style.display = shouldHighlight ? "" : "none";
+ // if cursorlayer have never been updated there's nothing on screen to update
+ if (this.$cursorLayer.$pixelPos)
+ this.$updateGutterLineHighlight();
+ };
+
+ this.getHighlightGutterLine = function() {
+ return this.$highlightGutterLine;
+ };
+
+ this.$updateGutterLineHighlight = function() {
+ this.$gutterLineHighlight.style.top = this.$cursorLayer.$pixelPos.top - this.layerConfig.offset + "px";
+ this.$gutterLineHighlight.style.height = this.layerConfig.lineHeight + "px";
+ };
+
+ this.$updatePrintMargin = function() {
+ var containerEl;
+
+ if (!this.$showPrintMargin && !this.$printMarginEl)
+ return;
+
+ if (!this.$printMarginEl) {
+ containerEl = dom.createElement("div");
+ containerEl.className = "ace_print_margin_layer";
+ this.$printMarginEl = dom.createElement("div");
+ this.$printMarginEl.className = "ace_print_margin";
+ containerEl.appendChild(this.$printMarginEl);
+ this.content.insertBefore(containerEl, this.$textLayer.element);
+ }
+
+ var style = this.$printMarginEl.style;
+ style.left = ((this.characterWidth * this.$printMarginColumn) + this.$padding) + "px";
+ style.visibility = this.$showPrintMargin ? "visible" : "hidden";
+ };
+ this.getContainerElement = function() {
+ return this.container;
+ };
+ this.getMouseEventTarget = function() {
+ return this.content;
+ };
+ this.getTextAreaContainer = function() {
+ return this.container;
+ };
+
+ // move text input over the cursor
+ // this is required for iOS and IME
+ this.$moveTextAreaToCursor = function() {
+ if (!this.$keepTextAreaAtCursor)
+ return;
+
+ var posTop = this.$cursorLayer.$pixelPos.top;
+ var posLeft = this.$cursorLayer.$pixelPos.left;
+ posTop -= this.layerConfig.offset;
+
+ if (posTop < 0 || posTop > this.layerConfig.height - this.lineHeight)
+ return;
+
+ var w = this.characterWidth;
+ if (this.$composition)
+ w += this.textarea.scrollWidth;
+ posLeft -= this.scrollLeft;
+ if (posLeft > this.$size.scrollerWidth - w)
+ posLeft = this.$size.scrollerWidth - w;
+
+ if (this.showGutter)
+ posLeft += this.$gutterLayer.gutterWidth;
+
+ this.textarea.style.height = this.lineHeight + "px";
+ this.textarea.style.width = w + "px";
+ this.textarea.style.left = posLeft + "px";
+ this.textarea.style.top = posTop - 1 + "px";
+ };
+ this.getFirstVisibleRow = function() {
+ return this.layerConfig.firstRow;
+ };
+ this.getFirstFullyVisibleRow = function() {
+ return this.layerConfig.firstRow + (this.layerConfig.offset === 0 ? 0 : 1);
+ };
+ this.getLastFullyVisibleRow = function() {
+ var flint = Math.floor((this.layerConfig.height + this.layerConfig.offset) / this.layerConfig.lineHeight);
+ return this.layerConfig.firstRow - 1 + flint;
+ };
+ this.getLastVisibleRow = function() {
+ return this.layerConfig.lastRow;
+ };
+
+ this.$padding = null;
+ this.setPadding = function(padding) {
+ this.$padding = padding;
+ this.$textLayer.setPadding(padding);
+ this.$cursorLayer.setPadding(padding);
+ this.$markerFront.setPadding(padding);
+ this.$markerBack.setPadding(padding);
+ this.$loop.schedule(this.CHANGE_FULL);
+ this.$updatePrintMargin();
+ };
+ this.getHScrollBarAlwaysVisible = function() {
+ return this.$horizScrollAlwaysVisible;
+ };
+ this.setHScrollBarAlwaysVisible = function(alwaysVisible) {
+ if (this.$horizScrollAlwaysVisible != alwaysVisible) {
+ this.$horizScrollAlwaysVisible = alwaysVisible;
+ if (!this.$horizScrollAlwaysVisible || !this.$horizScroll)
+ this.$loop.schedule(this.CHANGE_SCROLL);
+ }
+ };
+
+ this.$updateScrollBar = function() {
+ this.scrollBar.setInnerHeight(this.layerConfig.maxHeight);
+ this.scrollBar.setScrollTop(this.scrollTop);
+ };
+
+ this.$renderChanges = function(changes, force) {
+ if (!force && (!changes || !this.session || !this.container.offsetWidth))
+ return;
+
+ // text, scrolling and resize changes can cause the view port size to change
+ if (changes & this.CHANGE_FULL ||
+ changes & this.CHANGE_SIZE ||
+ changes & this.CHANGE_TEXT ||
+ changes & this.CHANGE_LINES ||
+ changes & this.CHANGE_SCROLL
+ )
+ this.$computeLayerConfig();
+
+ // horizontal scrolling
+ if (changes & this.CHANGE_H_SCROLL) {
+ this.scroller.scrollLeft = this.scrollLeft;
+
+ // read the value after writing it since the value might get clipped
+ var scrollLeft = this.scroller.scrollLeft;
+ this.scrollLeft = scrollLeft;
+ this.session.setScrollLeft(scrollLeft);
+
+ this.scroller.className = this.scrollLeft == 0 ? "ace_scroller" : "ace_scroller horscroll";
+ }
+
+ // full
+ if (changes & this.CHANGE_FULL) {
+ this.$textLayer.checkForSizeChanges();
+ // update scrollbar first to not lose scroll position when gutter calls resize
+ this.$updateScrollBar();
+ this.$textLayer.update(this.layerConfig);
+ if (this.showGutter)
+ this.$gutterLayer.update(this.layerConfig);
+ this.$markerBack.update(this.layerConfig);
+ this.$markerFront.update(this.layerConfig);
+ this.$cursorLayer.update(this.layerConfig);
+ this.$moveTextAreaToCursor();
+ this.$highlightGutterLine && this.$updateGutterLineHighlight();
+ return;
+ }
+
+ // scrolling
+ if (changes & this.CHANGE_SCROLL) {
+ this.$updateScrollBar();
+ if (changes & this.CHANGE_TEXT || changes & this.CHANGE_LINES)
+ this.$textLayer.update(this.layerConfig);
+ else
+ this.$textLayer.scrollLines(this.layerConfig);
+
+ if (this.showGutter)
+ this.$gutterLayer.update(this.layerConfig);
+ this.$markerBack.update(this.layerConfig);
+ this.$markerFront.update(this.layerConfig);
+ this.$cursorLayer.update(this.layerConfig);
+ this.$moveTextAreaToCursor();
+ this.$highlightGutterLine && this.$updateGutterLineHighlight();
+ return;
+ }
+
+ if (changes & this.CHANGE_TEXT) {
+ this.$textLayer.update(this.layerConfig);
+ if (this.showGutter)
+ this.$gutterLayer.update(this.layerConfig);
+ }
+ else if (changes & this.CHANGE_LINES) {
+ if (this.$updateLines() || (changes & this.CHANGE_GUTTER) && this.showGutter)
+ this.$gutterLayer.update(this.layerConfig);
+ }
+ else if (changes & this.CHANGE_TEXT || changes & this.CHANGE_GUTTER) {
+ if (this.showGutter)
+ this.$gutterLayer.update(this.layerConfig);
+ }
+
+ if (changes & this.CHANGE_CURSOR) {
+ this.$cursorLayer.update(this.layerConfig);
+ this.$moveTextAreaToCursor();
+ this.$highlightGutterLine && this.$updateGutterLineHighlight();
+ }
+
+ if (changes & (this.CHANGE_MARKER | this.CHANGE_MARKER_FRONT)) {
+ this.$markerFront.update(this.layerConfig);
+ }
+
+ if (changes & (this.CHANGE_MARKER | this.CHANGE_MARKER_BACK)) {
+ this.$markerBack.update(this.layerConfig);
+ }
+
+ if (changes & this.CHANGE_SIZE)
+ this.$updateScrollBar();
+ };
+
+ this.$computeLayerConfig = function() {
+ var session = this.session;
+
+ var offset = this.scrollTop % this.lineHeight;
+ var minHeight = this.$size.scrollerHeight + this.lineHeight;
+
+ var longestLine = this.$getLongestLine();
+
+ var horizScroll = this.$horizScrollAlwaysVisible || this.$size.scrollerWidth - longestLine < 0;
+ var horizScrollChanged = this.$horizScroll !== horizScroll;
+ this.$horizScroll = horizScroll;
+ if (horizScrollChanged) {
+ this.scroller.style.overflowX = horizScroll ? "scroll" : "hidden";
+ // when we hide scrollbar scroll event isn't emited
+ // leaving session with wrong scrollLeft value
+ if (!horizScroll)
+ this.session.setScrollLeft(0);
+ }
+ var maxHeight = this.session.getScreenLength() * this.lineHeight;
+ this.session.setScrollTop(Math.max(0, Math.min(this.scrollTop, maxHeight - this.$size.scrollerHeight)));
+
+ var lineCount = Math.ceil(minHeight / this.lineHeight) - 1;
+ var firstRow = Math.max(0, Math.round((this.scrollTop - offset) / this.lineHeight));
+ var lastRow = firstRow + lineCount;
+
+ // Map lines on the screen to lines in the document.
+ var firstRowScreen, firstRowHeight;
+ var lineHeight = this.lineHeight;
+ firstRow = session.screenToDocumentRow(firstRow, 0);
+
+ // Check if firstRow is inside of a foldLine. If true, then use the first
+ // row of the foldLine.
+ var foldLine = session.getFoldLine(firstRow);
+ if (foldLine) {
+ firstRow = foldLine.start.row;
+ }
+
+ firstRowScreen = session.documentToScreenRow(firstRow, 0);
+ firstRowHeight = session.getRowLength(firstRow) * lineHeight;
+
+ lastRow = Math.min(session.screenToDocumentRow(lastRow, 0), session.getLength() - 1);
+ minHeight = this.$size.scrollerHeight + session.getRowLength(lastRow) * lineHeight +
+ firstRowHeight;
+
+ offset = this.scrollTop - firstRowScreen * lineHeight;
+
+ this.layerConfig = {
+ width : longestLine,
+ padding : this.$padding,
+ firstRow : firstRow,
+ firstRowScreen: firstRowScreen,
+ lastRow : lastRow,
+ lineHeight : lineHeight,
+ characterWidth : this.characterWidth,
+ minHeight : minHeight,
+ maxHeight : maxHeight,
+ offset : offset,
+ height : this.$size.scrollerHeight
+ };
+
+ // For debugging.
+ // console.log(JSON.stringify(this.layerConfig));
+
+ this.$gutterLayer.element.style.marginTop = (-offset) + "px";
+ this.content.style.marginTop = (-offset) + "px";
+ this.content.style.width = longestLine + 2 * this.$padding + "px";
+ this.content.style.height = minHeight + "px";
+
+ // Horizontal scrollbar visibility may have changed, which changes
+ // the client height of the scroller
+ if (horizScrollChanged)
+ this.onResize(true);
+ };
+
+ this.$updateLines = function() {
+ var firstRow = this.$changedLines.firstRow;
+ var lastRow = this.$changedLines.lastRow;
+ this.$changedLines = null;
+
+ var layerConfig = this.layerConfig;
+
+ if (firstRow > layerConfig.lastRow + 1) { return; }
+ if (lastRow < layerConfig.firstRow) { return; }
+
+ // if the last row is unknown -> redraw everything
+ if (lastRow === Infinity) {
+ if (this.showGutter)
+ this.$gutterLayer.update(layerConfig);
+ this.$textLayer.update(layerConfig);
+ return;
+ }
+
+ // else update only the changed rows
+ this.$textLayer.updateLines(layerConfig, firstRow, lastRow);
+ return true;
+ };
+
+ this.$getLongestLine = function() {
+ var charCount = this.session.getScreenWidth();
+ if (this.$textLayer.showInvisibles)
+ charCount += 1;
+
+ return Math.max(this.$size.scrollerWidth - 2 * this.$padding, Math.round(charCount * this.characterWidth));
+ };
+ this.updateFrontMarkers = function() {
+ this.$markerFront.setMarkers(this.session.getMarkers(true));
+ this.$loop.schedule(this.CHANGE_MARKER_FRONT);
+ };
+ this.updateBackMarkers = function() {
+ this.$markerBack.setMarkers(this.session.getMarkers());
+ this.$loop.schedule(this.CHANGE_MARKER_BACK);
+ };
+ this.addGutterDecoration = function(row, className){
+ this.$gutterLayer.addGutterDecoration(row, className);
+ };
+ this.removeGutterDecoration = function(row, className){
+ this.$gutterLayer.removeGutterDecoration(row, className);
+ };
+ this.updateBreakpoints = function(rows) {
+ this.$loop.schedule(this.CHANGE_GUTTER);
+ };
+ this.setAnnotations = function(annotations) {
+ this.$gutterLayer.setAnnotations(annotations);
+ this.$loop.schedule(this.CHANGE_GUTTER);
+ };
+ this.updateCursor = function() {
+ this.$loop.schedule(this.CHANGE_CURSOR);
+ };
+ this.hideCursor = function() {
+ this.$cursorLayer.hideCursor();
+ };
+ this.showCursor = function() {
+ this.$cursorLayer.showCursor();
+ };
+
+ this.scrollSelectionIntoView = function(anchor, lead, offset) {
+ // first scroll anchor into view then scroll lead into view
+ this.scrollCursorIntoView(anchor, offset);
+ this.scrollCursorIntoView(lead, offset);
+ };
+ this.scrollCursorIntoView = function(cursor, offset) {
+ // the editor is not visible
+ if (this.$size.scrollerHeight === 0)
+ return;
+
+ var pos = this.$cursorLayer.getPixelPosition(cursor);
+
+ var left = pos.left;
+ var top = pos.top;
+
+ if (this.scrollTop > top) {
+ if (offset)
+ top -= offset * this.$size.scrollerHeight;
+ this.session.setScrollTop(top);
+ } else if (this.scrollTop + this.$size.scrollerHeight < top + this.lineHeight) {
+ if (offset)
+ top += offset * this.$size.scrollerHeight;
+ this.session.setScrollTop(top + this.lineHeight - this.$size.scrollerHeight);
+ }
+
+ var scrollLeft = this.scrollLeft;
+
+ if (scrollLeft > left) {
+ if (left < this.$padding + 2 * this.layerConfig.characterWidth)
+ left = 0;
+ this.session.setScrollLeft(left);
+ } else if (scrollLeft + this.$size.scrollerWidth < left + this.characterWidth) {
+ this.session.setScrollLeft(Math.round(left + this.characterWidth - this.$size.scrollerWidth));
+ }
+ };
+ this.getScrollTop = function() {
+ return this.session.getScrollTop();
+ };
+ this.getScrollLeft = function() {
+ return this.session.getScrollLeft();
+ };
+ this.getScrollTopRow = function() {
+ return this.scrollTop / this.lineHeight;
+ };
+ this.getScrollBottomRow = function() {
+ return Math.max(0, Math.floor((this.scrollTop + this.$size.scrollerHeight) / this.lineHeight) - 1);
+ };
+ this.scrollToRow = function(row) {
+ this.session.setScrollTop(row * this.lineHeight);
+ };
+
+ this.alignCursor = function(cursor, alignment) {
+ if (typeof cursor == "number")
+ cursor = {row: cursor, column: 0};
+
+ var pos = this.$cursorLayer.getPixelPosition(cursor);
+ var h = this.$size.scrollerHeight - this.lineHeight;
+ var offset = pos.top - h * (alignment || 0);
+
+ this.session.setScrollTop(offset);
+ return offset;
+ };
+
+ this.STEPS = 8;
+ this.$calcSteps = function(fromValue, toValue){
+ var i = 0;
+ var l = this.STEPS;
+ var steps = [];
+
+ var func = function(t, x_min, dx) {
+ return dx * (Math.pow(t - 1, 3) + 1) + x_min;
+ };
+
+ for (i = 0; i < l; ++i)
+ steps.push(func(i / this.STEPS, fromValue, toValue - fromValue));
+
+ return steps;
+ };
+ this.scrollToLine = function(line, center, animate, callback) {
+ var pos = this.$cursorLayer.getPixelPosition({row: line, column: 0});
+ var offset = pos.top;
+ if (center)
+ offset -= this.$size.scrollerHeight / 2;
+
+ var initialScroll = this.scrollTop;
+ this.session.setScrollTop(offset);
+ if (animate !== false)
+ this.animateScrolling(initialScroll, callback);
+ };
+
+ this.animateScrolling = function(fromValue, callback) {
+ var toValue = this.scrollTop;
+ if (this.$animatedScroll && Math.abs(fromValue - toValue) < 100000) {
+ var _self = this;
+ var steps = _self.$calcSteps(fromValue, toValue);
+ this.$inScrollAnimation = true;
+
+ clearInterval(this.$timer);
+
+ _self.session.setScrollTop(steps.shift());
+ this.$timer = setInterval(function() {
+ if (steps.length) {
+ _self.session.setScrollTop(steps.shift());
+ // trick session to think it's already scrolled to not loose toValue
+ _self.session.$scrollTop = toValue;
+ } else if (toValue != null) {
+ _self.session.$scrollTop = -1;
+ _self.session.setScrollTop(toValue);
+ toValue = null;
+ } else {
+ // do this on separate step to not get spurious scroll event from scrollbar
+ _self.$timer = clearInterval(_self.$timer);
+ _self.$inScrollAnimation = false;
+ callback && callback();
+ }
+ }, 10);
+ }
+ };
+ this.scrollToY = function(scrollTop) {
+ // after calling scrollBar.setScrollTop
+ // scrollbar sends us event with same scrollTop. ignore it
+ if (this.scrollTop !== scrollTop) {
+ this.$loop.schedule(this.CHANGE_SCROLL);
+ this.scrollTop = scrollTop;
+ }
+ };
+ this.scrollToX = function(scrollLeft) {
+ if (scrollLeft < 0)
+ scrollLeft = 0;
+
+ if (this.scrollLeft !== scrollLeft)
+ this.scrollLeft = scrollLeft;
+ this.$loop.schedule(this.CHANGE_H_SCROLL);
+ };
+ this.scrollBy = function(deltaX, deltaY) {
+ deltaY && this.session.setScrollTop(this.session.getScrollTop() + deltaY);
+ deltaX && this.session.setScrollLeft(this.session.getScrollLeft() + deltaX);
+ };
+ this.isScrollableBy = function(deltaX, deltaY) {
+ if (deltaY < 0 && this.session.getScrollTop() > 0)
+ return true;
+ if (deltaY > 0 && this.session.getScrollTop() + this.$size.scrollerHeight < this.layerConfig.maxHeight)
+ return true;
+ // todo: handle horizontal scrolling
+ };
+
+ this.pixelToScreenCoordinates = function(x, y) {
+ var canvasPos = this.scroller.getBoundingClientRect();
+
+ var offset = (x + this.scrollLeft - canvasPos.left - this.$padding) / this.characterWidth;
+ var row = Math.floor((y + this.scrollTop - canvasPos.top) / this.lineHeight);
+ var col = Math.round(offset);
+
+ return {row: row, column: col, side: offset - col > 0 ? 1 : -1};
+ };
+
+ this.screenToTextCoordinates = function(x, y) {
+ var canvasPos = this.scroller.getBoundingClientRect();
+
+ var col = Math.round(
+ (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, Math.max(col, 0));
+ };
+ this.textToScreenCoordinates = function(row, column) {
+ var canvasPos = this.scroller.getBoundingClientRect();
+ var pos = this.session.documentToScreenPosition(row, column);
+
+ var x = this.$padding + Math.round(pos.column * this.characterWidth);
+ var y = pos.row * this.lineHeight;
+
+ return {
+ pageX: canvasPos.left + x - this.scrollLeft,
+ pageY: canvasPos.top + y - this.scrollTop
+ };
+ };
+ this.visualizeFocus = function() {
+ dom.addCssClass(this.container, "ace_focus");
+ };
+ this.visualizeBlur = function() {
+ dom.removeCssClass(this.container, "ace_focus");
+ };
+ this.showComposition = function(position) {
+ if (!this.$composition)
+ this.$composition = {
+ keepTextAreaAtCursor: this.$keepTextAreaAtCursor,
+ cssText: this.textarea.style.cssText
+ };
+
+ this.$keepTextAreaAtCursor = true;
+ dom.addCssClass(this.textarea, "ace_composition");
+ this.textarea.style.cssText = "";
+ this.$moveTextAreaToCursor();
+ };
+ this.setCompositionText = function(text) {
+ this.$moveTextAreaToCursor();
+ };
+ this.hideComposition = function() {
+ if (!this.$composition)
+ return;
+
+ dom.removeCssClass(this.textarea, "ace_composition");
+ this.$keepTextAreaAtCursor = this.$composition.keepTextAreaAtCursor;
+ this.textarea.style.cssText = this.$composition.cssText;
+ this.$composition = null;
+ };
+
+ this._loadTheme = function(name, callback) {
+ if (!config.get("packaged"))
+ return callback();
+
+ net.loadScript(config.moduleUrl(name, "theme"), callback);
+ };
+ this.setTheme = function(theme) {
+ var _self = this;
+
+ this.$themeValue = theme;
+ if (!theme || typeof theme == "string") {
+ var moduleName = theme || "ace/theme/textmate";
+
+ var module;
+ try {
+ module = require(moduleName);
+ } catch (e) {};
+ if (module)
+ return afterLoad(module);
+
+ _self._loadTheme(moduleName, function() {
+ require([moduleName], function(module) {
+ if (_self.$themeValue !== theme)
+ return;
+
+ afterLoad(module);
+ });
+ });
+ } else {
+ afterLoad(theme);
+ }
+
+ function afterLoad(theme) {
+ dom.importCssString(
+ theme.cssText,
+ theme.cssClass,
+ _self.container.ownerDocument
+ );
+
+ if (_self.$theme)
+ dom.removeCssClass(_self.container, _self.$theme);
+
+ _self.$theme = theme ? theme.cssClass : null;
+
+ if (_self.$theme)
+ dom.addCssClass(_self.container, _self.$theme);
+
+ if (theme && theme.isDark)
+ dom.addCssClass(_self.container, "ace_dark");
+ else
+ dom.removeCssClass(_self.container, "ace_dark");
+
+ // force re-measure of the gutter width
+ if (_self.$size) {
+ _self.$size.width = 0;
+ _self.onResize();
+ }
+ }
+ };
+ this.getTheme = function() {
+ return this.$themeValue;
+ };
+
+ // Methods allows to add / remove CSS classnames to the editor element.
+ // This feature can be used by plug-ins to provide a visual indication of
+ // a certain mode that editor is in.
+
+ /**
+ * VirtualRenderer.setStyle(style)
+ * - style (String): A class name
+ *
+ * [Adds a new class, `style`, to the editor.]{: #VirtualRenderer.setStyle}
+ **/
+ this.setStyle = function setStyle(style) {
+ dom.addCssClass(this.container, style);
+ };
+ this.unsetStyle = function unsetStyle(style) {
+ dom.removeCssClass(this.container, style);
+ };
+ this.destroy = function() {
+ this.$textLayer.destroy();
+ this.$cursorLayer.destroy();
+ };
+
+}).call(VirtualRenderer.prototype);
+
+exports.VirtualRenderer = VirtualRenderer;
+});
+
+ace.define('ace/layer/gutter', ['require', 'exports', 'module' , 'ace/lib/dom', 'ace/lib/oop', 'ace/lib/event_emitter'], function(require, exports, module) {
+
+
+var dom = require("../lib/dom");
+var oop = require("../lib/oop");
+var EventEmitter = require("../lib/event_emitter").EventEmitter;
+
+var Gutter = function(parentEl) {
+ this.element = dom.createElement("div");
+ this.element.className = "ace_layer ace_gutter-layer";
+ parentEl.appendChild(this.element);
+ this.setShowFoldWidgets(this.$showFoldWidgets);
+
+ this.gutterWidth = 0;
+
+ this.$annotations = [];
+};
+
+(function() {
+
+ oop.implement(this, EventEmitter);
+
+ this.setSession = function(session) {
+ this.session = session;
+ };
+
+ this.addGutterDecoration = function(row, className){
+ if (window.console)
+ console.warn && console.warn("deprecated use session.addGutterDecoration");
+ this.session.addGutterDecoration(row, className);
+ };
+
+ this.removeGutterDecoration = function(row, className){
+ if (window.console)
+ console.warn && console.warn("deprecated use session.removeGutterDecoration");
+ this.session.removeGutterDecoration(row, className);
+ };
+
+ this.setAnnotations = function(annotations) {
+ // iterate over sparse array
+ this.$annotations = [];
+ for (var row in annotations) if (annotations.hasOwnProperty(row)) {
+ var rowAnnotations = annotations[row];
+ if (!rowAnnotations)
+ continue;
+
+ var rowInfo = this.$annotations[row] = {
+ text: []
+ };
+ for (var i=0; i<rowAnnotations.length; i++) {
+ var annotation = rowAnnotations[i];
+ var annoText = annotation.text.replace(/"/g, "&quot;").replace(/'/g, "&#8217;").replace(/</, "&lt;");
+ if (rowInfo.text.indexOf(annoText) === -1)
+ rowInfo.text.push(annoText);
+ var type = annotation.type;
+ if (type == "error")
+ rowInfo.className = " ace_error";
+ else if (type == "warning" && rowInfo.className != " ace_error")
+ rowInfo.className = " ace_warning";
+ else if (type == "info" && (!rowInfo.className))
+ rowInfo.className = " ace_info";
+ }
+ }
+ };
+
+ this.update = function(config) {
+ var emptyAnno = {className: ""};
+ var html = [];
+ var i = config.firstRow;
+ var lastRow = config.lastRow;
+ var fold = this.session.getNextFoldLine(i);
+ var foldStart = fold ? fold.start.row : Infinity;
+ var foldWidgets = this.$showFoldWidgets && this.session.foldWidgets;
+ var breakpoints = this.session.$breakpoints;
+ var decorations = this.session.$decorations;
+ var lastLineNumber = 0;
+
+ while (true) {
+ if(i > foldStart) {
+ i = fold.end.row + 1;
+ fold = this.session.getNextFoldLine(i, fold);
+ foldStart = fold ?fold.start.row :Infinity;
+ }
+ if(i > lastRow)
+ break;
+
+ var annotation = this.$annotations[i] || emptyAnno;
+ html.push(
+ "<div class='ace_gutter-cell ",
+ breakpoints[i] || "", decorations[i] || "", annotation.className,
+ "' style='height:", this.session.getRowLength(i) * config.lineHeight, "px;'>",
+ lastLineNumber = i + 1
+ );
+
+ if (foldWidgets) {
+ var c = foldWidgets[i];
+ // check if cached value is invalidated and we need to recompute
+ if (c == null)
+ c = foldWidgets[i] = this.session.getFoldWidget(i);
+ if (c)
+ html.push(
+ "<span class='ace_fold-widget ", c,
+ c == "start" && i == foldStart && i < fold.end.row ? " closed" : " open",
+ "' style='height:", config.lineHeight, "px",
+ "'></span>"
+ );
+ }
+
+ html.push("</div>");
+
+ 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;
+
+});
+
+ace.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 = Math.round(
+ this.$padding + range.start.column * config.characterWidth
+ );
+ marker.renderer(html, range, left, top, config);
+ }
+ else if (range.isMultiLine()) {
+ if (marker.type == "text") {
+ this.drawTextMarker(html, range, marker.clazz, config);
+ } else {
+ this.drawMultiLineMarker(
+ html, range, marker.clazz, config,
+ marker.type
+ );
+ }
+ }
+ else {
+ this.drawSingleLineMarker(
+ html, range, marker.clazz + " start", config,
+ null, marker.type
+ );
+ }
+ }
+ this.element = dom.setInnerHtml(this.element, html.join(""));
+ };
+
+ this.$getTop = function(row, layerConfig) {
+ return (row - layerConfig.firstRowScreen) * layerConfig.lineHeight;
+ };
+
+ // Draws a marker, which spans a range of text on multiple lines
+ this.drawTextMarker = function(stringBuilder, range, clazz, layerConfig) {
+ // selection start
+ var row = range.start.row;
+
+ var lineRange = new Range(
+ row, range.start.column,
+ row, this.session.getScreenLastRowColumn(row)
+ );
+ this.drawSingleLineMarker(stringBuilder, lineRange, clazz + " start", layerConfig, 1, "text");
+
+ // selection end
+ 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");
+ }
+ };
+
+ // Draws a multi line marker, where lines span the full width
+ this.drawMultiLineMarker = function(stringBuilder, range, clazz, config, type) {
+ var padding = type === "background" ? 0 : this.$padding;
+ // from selection start to the end of the line
+ var height = config.lineHeight;
+ var top = this.$getTop(range.start.row, config);
+ var left = Math.round(padding + range.start.column * config.characterWidth);
+
+ stringBuilder.push(
+ "<div class='", clazz, " start' style='",
+ "height:", height, "px;",
+ "right:0;",
+ "top:", top, "px;",
+ "left:", left, "px;'></div>"
+ );
+
+ // from start of the last line to the selection end
+ top = this.$getTop(range.end.row, config);
+ var width = Math.round(range.end.column * config.characterWidth);
+
+ stringBuilder.push(
+ "<div class='", clazz, "' style='",
+ "height:", height, "px;",
+ "width:", width, "px;",
+ "top:", top, "px;",
+ "left:", padding, "px;'></div>"
+ );
+
+ // all the complete lines
+ height = (range.end.row - range.start.row - 1) * config.lineHeight;
+ if (height < 0)
+ return;
+ top = this.$getTop(range.start.row + 1, config);
+
+ stringBuilder.push(
+ "<div class='", clazz, "' style='",
+ "height:", height, "px;",
+ "right:0;",
+ "top:", top, "px;",
+ "left:", padding, "px;'></div>"
+ );
+ };
+
+ // Draws a marker which covers part or whole width of a single screen line
+ this.drawSingleLineMarker = function(stringBuilder, range, clazz, layerConfig, extraLength, type) {
+ var padding = type === "background" ? 0 : this.$padding;
+ var height = layerConfig.lineHeight;
+
+ if (type === "background")
+ var width = layerConfig.width;
+ else
+ width = Math.round((range.end.column + (extraLength || 0) - range.start.column) * layerConfig.characterWidth);
+
+ var top = this.$getTop(range.start.row, layerConfig);
+ var left = Math.round(
+ padding + range.start.column * layerConfig.characterWidth
+ );
+
+ stringBuilder.push(
+ "<div class='", clazz, "' style='",
+ "height:", height, "px;",
+ "width:", width, "px;",
+ "top:", top, "px;",
+ "left:", left,"px;'></div>"
+ );
+ };
+
+}).call(Marker.prototype);
+
+exports.Marker = Marker;
+
+});
+
+ace.define('ace/layer/text', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/dom', 'ace/lib/lang', 'ace/lib/useragent', 'ace/lib/event_emitter'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var dom = require("../lib/dom");
+var lang = require("../lib/lang");
+var useragent = require("../lib/useragent");
+var EventEmitter = require("../lib/event_emitter").EventEmitter;
+
+var Text = function(parentEl) {
+ this.element = dom.createElement("div");
+ this.element.className = "ace_layer ace_text-layer";
+ parentEl.appendChild(this.element);
+
+ this.$characterSize = this.$measureSizes() || {width: 0, height: 0};
+ this.$pollSizeChanges();
+};
+
+(function() {
+
+ oop.implement(this, EventEmitter);
+
+ this.EOF_CHAR = "\xB6"; //"&para;";
+ this.EOL_CHAR = "\xAC"; //"&not;";
+ this.TAB_CHAR = "\u2192"; //"&rarr;" "\u21E5";
+ this.SPACE_CHAR = "\xB7"; //"&middot;";
+ this.$padding = 0;
+
+ this.setPadding = function(padding) {
+ this.$padding = padding;
+ this.element.style.padding = "0 " + padding + "px";
+ };
+
+ this.getLineHeight = function() {
+ return this.$characterSize.height || 1;
+ };
+
+ this.getCharacterWidth = function() {
+ return this.$characterSize.width || 1;
+ };
+
+ this.checkForSizeChanges = function() {
+ var size = this.$measureSizes();
+ if (size && (this.$characterSize.width !== size.width || this.$characterSize.height !== size.height)) {
+ this.$characterSize = size;
+ this._emit("changeCharacterSize", {data: size});
+ }
+ };
+
+ this.$pollSizeChanges = function() {
+ var self = this;
+ this.$pollSizeChangesTimer = setInterval(function() {
+ self.checkForSizeChanges();
+ }, 500);
+ };
+
+ this.$fontStyles = {
+ fontFamily : 1,
+ fontSize : 1,
+ fontWeight : 1,
+ fontStyle : 1,
+ lineHeight : 1
+ };
+
+ this.$measureSizes = useragent.isIE || useragent.isOldGecko ? function() {
+ var n = 1000;
+ if (!this.$measureNode) {
+ var measureNode = this.$measureNode = dom.createElement("div");
+ var style = measureNode.style;
+
+ style.width = style.height = "auto";
+ style.left = style.top = (-n * 40) + "px";
+
+ style.visibility = "hidden";
+ style.position = "fixed";
+ style.overflow = "visible";
+ style.whiteSpace = "nowrap";
+
+ // in FF 3.6 monospace fonts can have a fixed sub pixel width.
+ // that's why we have to measure many characters
+ // Note: characterWidth can be a float!
+ measureNode.innerHTML = lang.stringRepeat("Xy", n);
+
+ if (this.element.ownerDocument.body) {
+ this.element.ownerDocument.body.appendChild(measureNode);
+ } else {
+ var container = this.element.parentNode;
+ while (!dom.hasCssClass(container, "ace_editor"))
+ container = container.parentNode;
+ container.appendChild(measureNode);
+ }
+ }
+
+ // Size and width can be null if the editor is not visible or
+ // detached from the document
+ if (!this.element.offsetWidth)
+ return null;
+
+ var style = this.$measureNode.style;
+ var computedStyle = dom.computedStyle(this.element);
+ for (var prop in this.$fontStyles)
+ style[prop] = computedStyle[prop];
+
+ var size = {
+ height: this.$measureNode.offsetHeight,
+ width: this.$measureNode.offsetWidth / (n * 2)
+ };
+
+ // Size and width can be null if the editor is not visible or
+ // detached from the document
+ if (size.width == 0 || size.height == 0)
+ return null;
+
+ return size;
+ }
+ : function() {
+ if (!this.$measureNode) {
+ var measureNode = this.$measureNode = dom.createElement("div");
+ var style = measureNode.style;
+
+ style.width = style.height = "auto";
+ style.left = style.top = -100 + "px";
+
+ style.visibility = "hidden";
+ style.position = "fixed";
+ style.overflow = "visible";
+ style.whiteSpace = "nowrap";
+
+ measureNode.innerHTML = "X";
+
+ var container = this.element.parentNode;
+ while (container && !dom.hasCssClass(container, "ace_editor"))
+ container = container.parentNode;
+
+ if (!container)
+ return this.$measureNode = null;
+
+ container.appendChild(measureNode);
+ }
+
+ var rect = this.$measureNode.getBoundingClientRect();
+
+ var size = {
+ height: rect.height,
+ width: rect.width
+ };
+
+ // Size and width can be null if the editor is not visible or
+ // detached from the document
+ if (size.width == 0 || size.height == 0)
+ return null;
+
+ return size;
+ };
+
+ this.setSession = function(session) {
+ this.session = session;
+ this.$computeTabString();
+ };
+
+ this.showInvisibles = false;
+ this.setShowInvisibles = function(showInvisibles) {
+ if (this.showInvisibles == showInvisibles)
+ return false;
+
+ this.showInvisibles = showInvisibles;
+ this.$computeTabString();
+ return true;
+ };
+
+ this.displayIndentGuides = true;
+ this.setDisplayIndentGuides = function(display) {
+ if (this.displayIndentGuides == display)
+ return false;
+
+ this.displayIndentGuides = display;
+ this.$computeTabString();
+ return true;
+ };
+
+ this.$tabStrings = [];
+ this.onChangeTabSize =
+ this.$computeTabString = function() {
+ var tabSize = this.session.getTabSize();
+ this.tabSize = tabSize;
+ var tabStr = this.$tabStrings = [0];
+ for (var i = 1; i < tabSize + 1; i++) {
+ if (this.showInvisibles) {
+ tabStr.push("<span class='ace_invisible'>"
+ + this.TAB_CHAR
+ + Array(i).join("&#160;")
+ + "</span>");
+ } else {
+ tabStr.push(new Array(i+1).join("&#160;"));
+ }
+ }
+ if (this.displayIndentGuides) {
+ this.$indentGuideRe = /\s\S| \t|\t |\s$/;
+ var className = "ace_indent-guide";
+ var content = Array(this.tabSize + 1).join("&#160;");
+ var tabContent = content;
+ if (this.showInvisibles) {
+ className += " ace_invisible";
+ tabContent = this.TAB_CHAR + content.substr(6);
+ }
+
+ this.$tabStrings[" "] = "<span class='" + className + "'>" + content + "</span>";
+ this.$tabStrings["\t"] = "<span class='" + className + "'>" + tabContent + "</span>";
+ }
+ };
+
+ this.updateLines = function(config, firstRow, lastRow) {
+ // Due to wrap line changes there can be new lines if e.g.
+ // the line to updated wrapped in the meantime.
+ if (this.config.lastRow != config.lastRow ||
+ this.config.firstRow != config.firstRow) {
+ this.scrollLines(config);
+ }
+ this.config = config;
+
+ var first = Math.max(firstRow, config.firstRow);
+ var last = Math.min(lastRow, config.lastRow);
+
+ var lineElements = this.element.childNodes;
+ var lineElementsIdx = 0;
+
+ for (var row = config.firstRow; row < first; row++) {
+ var foldLine = this.session.getFoldLine(row);
+ if (foldLine) {
+ if (foldLine.containsRow(first)) {
+ first = foldLine.start.row;
+ break;
+ } else {
+ row = foldLine.end.row;
+ }
+ }
+ lineElementsIdx ++;
+ }
+
+ var row = first;
+ var foldLine = this.session.getNextFoldLine(row);
+ var foldStart = foldLine ? foldLine.start.row : Infinity;
+
+ while (true) {
+ if (row > foldStart) {
+ row = foldLine.end.row+1;
+ foldLine = this.session.getNextFoldLine(row, foldLine);
+ foldStart = foldLine ? foldLine.start.row :Infinity;
+ }
+ if (row > last)
+ break;
+
+ var lineElement = lineElements[lineElementsIdx++];
+ if (lineElement) {
+ var html = [];
+ this.$renderLine(
+ html, row, !this.$useLineGroups(), row == foldStart ? foldLine : false
+ );
+ dom.setInnerHtml(lineElement, html.join(""));
+ }
+ row++;
+ }
+ };
+
+ this.scrollLines = function(config) {
+ var oldConfig = this.config;
+ this.config = config;
+
+ if (!oldConfig || oldConfig.lastRow < config.firstRow)
+ return this.update(config);
+
+ if (config.lastRow < oldConfig.firstRow)
+ return this.update(config);
+
+ var el = this.element;
+ if (oldConfig.firstRow < config.firstRow)
+ for (var row=this.session.getFoldedRowCount(oldConfig.firstRow, config.firstRow - 1); row>0; row--)
+ el.removeChild(el.firstChild);
+
+ if (oldConfig.lastRow > config.lastRow)
+ for (var row=this.session.getFoldedRowCount(config.lastRow + 1, oldConfig.lastRow); row>0; row--)
+ el.removeChild(el.lastChild);
+
+ if (config.firstRow < oldConfig.firstRow) {
+ var fragment = this.$renderLinesFragment(config, config.firstRow, oldConfig.firstRow - 1);
+ if (el.firstChild)
+ el.insertBefore(fragment, el.firstChild);
+ else
+ el.appendChild(fragment);
+ }
+
+ if (config.lastRow > oldConfig.lastRow) {
+ var fragment = this.$renderLinesFragment(config, oldConfig.lastRow + 1, config.lastRow);
+ el.appendChild(fragment);
+ }
+ };
+
+ this.$renderLinesFragment = function(config, firstRow, lastRow) {
+ var fragment = this.element.ownerDocument.createDocumentFragment();
+ var row = firstRow;
+ var foldLine = this.session.getNextFoldLine(row);
+ var foldStart = foldLine ? foldLine.start.row : Infinity;
+
+ while (true) {
+ if (row > foldStart) {
+ row = foldLine.end.row+1;
+ foldLine = this.session.getNextFoldLine(row, foldLine);
+ foldStart = foldLine ? foldLine.start.row : Infinity;
+ }
+ if (row > lastRow)
+ break;
+
+ var container = dom.createElement("div");
+
+ var html = [];
+ // Get the tokens per line as there might be some lines in between
+ // beeing folded.
+ this.$renderLine(html, row, false, row == foldStart ? foldLine : false);
+
+ // don't use setInnerHtml since we are working with an empty DIV
+ container.innerHTML = html.join("");
+ if (this.$useLineGroups()) {
+ container.className = 'ace_line_group';
+ fragment.appendChild(container);
+ } else {
+ var lines = container.childNodes
+ while(lines.length)
+ fragment.appendChild(lines[0]);
+ }
+
+ row++;
+ }
+ return fragment;
+ };
+
+ this.update = function(config) {
+ this.config = config;
+
+ var html = [];
+ var firstRow = config.firstRow, lastRow = config.lastRow;
+
+ var row = firstRow;
+ var foldLine = this.session.getNextFoldLine(row);
+ var foldStart = foldLine ? foldLine.start.row : Infinity;
+
+ while (true) {
+ if (row > foldStart) {
+ row = foldLine.end.row+1;
+ foldLine = this.session.getNextFoldLine(row, foldLine);
+ foldStart = foldLine ? foldLine.start.row :Infinity;
+ }
+ if (row > lastRow)
+ break;
+
+ if (this.$useLineGroups())
+ html.push("<div class='ace_line_group'>")
+
+ this.$renderLine(html, row, false, row == foldStart ? foldLine : false);
+
+ if (this.$useLineGroups())
+ html.push("</div>"); // 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 new Array(c.length+1).join("&#160;");
+ } else if (c == "&") {
+ return "&#38;";
+ } else if (c == "<") {
+ return "&#60;";
+ } else if (c == "\t") {
+ var tabSize = self.session.getScreenTabSize(screenColumn + tabIdx);
+ screenColumn += tabSize - 1;
+ return self.$tabStrings[tabSize];
+ } else if (c == "\u3000") {
+ // U+3000 is both invisible AND full-width, so must be handled uniquely
+ var classToUse = self.showInvisibles ? "ace_cjk ace_invisible" : "ace_cjk";
+ var space = self.showInvisibles ? self.SPACE_CHAR : "";
+ screenColumn += 1;
+ return "<span class='" + classToUse + "' style='width:" +
+ (self.config.characterWidth * 2) +
+ "px'>" + space + "</span>";
+ } else if (b) {
+ return "<span class='ace_invisible ace_invalid'>" + self.SPACE_CHAR + "</span>";
+ } else {
+ screenColumn += 1;
+ return "<span class='ace_cjk' style='width:" +
+ (self.config.characterWidth * 2) +
+ "px'>" + c + "</span>";
+ }
+ };
+
+ var output = value.replace(replaceReg, replaceFunc);
+
+ if (!this.$textToken[token.type]) {
+ var classes = "ace_" + token.type.replace(/\./g, " ace_");
+ var style = "";
+ if (token.type == "fold")
+ style = " style='width:" + (token.value.length * this.config.characterWidth) + "px;' ";
+ stringBuilder.push("<span class='", classes, "'", style, ">", output, "</span>");
+ }
+ else {
+ stringBuilder.push(output);
+ }
+ return screenColumn + value.length;
+ };
+
+ this.renderIndentGuide = function(stringBuilder, value) {
+ var cols = value.search(this.$indentGuideRe);
+ if (cols <= 0)
+ return value;
+ if (value[0] == " ") {
+ cols -= cols % this.tabSize;
+ stringBuilder.push(Array(cols/this.tabSize + 1).join(this.$tabStrings[" "]));
+ return value.substr(cols);
+ } else if (value[0] == "\t") {
+ stringBuilder.push(Array(cols + 1).join(this.$tabStrings["\t"]));
+ return value.substr(cols);
+ }
+ return value;
+ };
+
+ this.$renderWrappedLine = function(stringBuilder, tokens, splits, onlyContents) {
+ var chars = 0;
+ var split = 0;
+ var splitChars = splits[0];
+ var screenColumn = 0;
+
+ for (var i = 0; i < tokens.length; i++) {
+ var token = tokens[i];
+ var value = token.value;
+ if (i == 0 && this.displayIndentGuides) {
+ chars = value.length;
+ value = this.renderIndentGuide(stringBuilder, value);
+ if (!value)
+ continue;
+ chars -= value.length;
+ }
+
+ if (chars + value.length < splitChars) {
+ screenColumn = this.$renderToken(stringBuilder, screenColumn, token, value);
+ chars += value.length;
+ } else {
+ while (chars + value.length >= splitChars) {
+ screenColumn = this.$renderToken(
+ stringBuilder, screenColumn,
+ token, value.substring(0, splitChars - chars)
+ );
+ value = value.substring(splitChars - chars);
+ chars = splitChars;
+
+ if (!onlyContents) {
+ stringBuilder.push("</div>",
+ "<div class='ace_line' style='height:",
+ this.config.lineHeight, "px'>"
+ );
+ }
+
+ 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);
+ }
+ };
+
+ // row is either first row of foldline or not in fold
+ 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(
+ "<div class='ace_line' style='height:", this.config.lineHeight, "px'>"
+ );
+ }
+
+ 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(
+ "<span class='ace_invisible'>",
+ row == this.session.getLength() - 1 ? this.EOF_CHAR : this.EOL_CHAR,
+ "</span>"
+ );
+ }
+ if (!onlyContents)
+ stringBuilder.push("</div>");
+ };
+
+ 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);
+ // Check if the token value is longer then the from...to spacing.
+ 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) {
+ 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() {
+ // For the updateLines function to work correctly, it's important that the
+ // child nodes of this.element correspond on a 1-to-1 basis to rows in the
+ // document (as distinct from lines on the screen). For sessions that are
+ // wrapped, this means we need to add a layer to the node hierarchy (tagged
+ // with the class name ace_line_group).
+ 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;
+
+});
+
+ace.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.cursors = [];
+ this.cursor = this.addCursor();
+};
+
+(function() {
+
+ this.$padding = 0;
+ this.setPadding = function(padding) {
+ this.$padding = padding;
+ };
+
+ this.setSession = function(session) {
+ this.session = session;
+ };
+
+ this.setBlinking = function(blinking) {
+ this.isBlinking = blinking;
+ if (blinking)
+ this.restartTimer();
+ };
+
+ this.addCursor = function() {
+ var el = dom.createElement("div");
+ var className = "ace_cursor";
+ if (!this.isVisible)
+ className += " ace_hidden";
+ if (this.overwrite)
+ className += " ace_overwrite";
+
+ el.className = className;
+ 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;
+ for (var i = this.cursors.length; i--; )
+ dom.addCssClass(this.cursors[i], "ace_hidden");
+ clearInterval(this.blinkId);
+ };
+
+ this.showCursor = function() {
+ this.isVisible = true;
+ for (var i = this.cursors.length; i--; )
+ dom.removeCssClass(this.cursors[i], "ace_hidden");
+
+ this.element.style.visibility = "";
+ this.restartTimer();
+ };
+
+ this.restartTimer = function() {
+ clearInterval(this.blinkId);
+ if (!this.isBlinking)
+ return;
+ if (!this.isVisible)
+ return;
+
+ var element = this.cursors.length == 1 ? this.cursor : this.element;
+ this.blinkId = setInterval(function() {
+ element.style.visibility = "hidden";
+ setTimeout(function() {
+ element.style.visibility = "";
+ }, 400);
+ }, 1000);
+ };
+
+ 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 = Math.round(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;
+
+ if (this.session.selectionMarkerCount > 0) {
+ var selections = this.session.$selectionMarkers;
+ var i = 0, sel, cursorIndex = 0;
+
+ for (var i = selections.length; i--; ) {
+ sel = selections[i];
+ var pixelPos = this.getPixelPosition(sel.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";
+ }
+ if (cursorIndex > 1)
+ while (this.cursors.length > cursorIndex)
+ this.removeCursor();
+ } else {
+ var pixelPos = this.getPixelPosition(null, true);
+ var style = this.cursor.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 > 1)
+ this.removeCursor();
+ }
+
+ var overwrite = this.session.getOverwrite();
+ if (overwrite != this.overwrite)
+ this.$setOverite(overwrite);
+
+ // cache for textarea and gutter highlight
+ this.$pixelPos = pixelPos;
+
+ this.restartTimer();
+ };
+
+ this.$setOverite = function(overwrite) {
+ this.overwrite = overwrite;
+ for (var i = this.cursors.length; i--; ) {
+ if (overwrite)
+ dom.addCssClass(this.cursors[i], "ace_overwrite");
+ else
+ dom.removeCssClass(this.cursors[i], "ace_overwrite");
+ }
+ };
+
+ this.destroy = function() {
+ clearInterval(this.blinkId);
+ }
+
+}).call(Cursor.prototype);
+
+exports.Cursor = Cursor;
+
+});
+
+ace.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;
+
+/**
+ * new ScrollBar(parent)
+ * - parent (DOMElement): A DOM element
+ *
+ * Creates a new `ScrollBar`. `parent` is the owner of the scroll bar.
+ *
+ **/
+var ScrollBar = function(parent) {
+ this.element = dom.createElement("div");
+ this.element.className = "ace_sb";
+
+ this.inner = dom.createElement("div");
+ this.element.appendChild(this.inner);
+
+ parent.appendChild(this.element);
+
+ // in OSX lion the scrollbars appear to have no width. In this case resize
+ // the to show the scrollbar but still pretend that the scrollbar has a width
+ // of 0px
+ // in Firefox 6+ scrollbar is hidden if element has the same width as scrollbar
+ // make element a little bit wider to retain scrollbar when page is zoomed
+ 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() {
+ this._emit("scroll", {data: this.element.scrollTop});
+ };
+ 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";
+ };
+ // TODO: on chrome 17+ for small zoom levels after calling this function
+ // this.element.scrollTop != scrollTop which makes page to scroll up.
+ this.setScrollTop = function(scrollTop) {
+ this.element.scrollTop = scrollTop;
+ };
+
+}).call(ScrollBar.prototype);
+
+exports.ScrollBar = ScrollBar;
+});
+
+ace.define('ace/renderloop', ['require', 'exports', 'module' , 'ace/lib/event'], function(require, exports, module) {
+
+
+var event = require("./lib/event");
+
+/** internal, hide
+ * new RenderLoop(onRender, win)
+ *
+ *
+ *
+**/
+var RenderLoop = function(onRender, win) {
+ this.onRender = onRender;
+ this.pending = false;
+ this.changes = 0;
+ this.window = win || window;
+};
+
+(function() {
+
+ /** internal, hide
+ * RenderLoop.schedule(change)
+ * - change (Array):
+ *
+ *
+ **/
+ this.schedule = function(change) {
+ //this.onRender(change);
+ //return;
+ this.changes = this.changes | change;
+ if (!this.pending) {
+ this.pending = true;
+ var _self = this;
+ event.nextTick(function() {
+ _self.pending = false;
+ var changes;
+ while (changes = _self.changes) {
+ _self.changes = 0;
+ _self.onRender(changes);
+ }
+ }, this.window);
+ }
+ };
+
+}).call(RenderLoop.prototype);
+
+exports.RenderLoop = RenderLoop;
+});
+ace.define("text!ace/css/editor.css", [], ".ace_editor {\n" +
+ " position: absolute;\n" +
+ " overflow: hidden;\n" +
+ " font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Droid Sans Mono', 'Consolas', monospace;\n" +
+ " font-size: 12px;\n" +
+ "}\n" +
+ "\n" +
+ ".ace_scroller {\n" +
+ " position: absolute;\n" +
+ " overflow: hidden;\n" +
+ "}\n" +
+ "\n" +
+ ".ace_content {\n" +
+ " position: absolute;\n" +
+ " box-sizing: border-box;\n" +
+ " -moz-box-sizing: border-box;\n" +
+ " -webkit-box-sizing: border-box;\n" +
+ " cursor: text;\n" +
+ "}\n" +
+ "\n" +
+ ".ace_gutter {\n" +
+ " position: absolute;\n" +
+ " overflow : hidden;\n" +
+ " height: 100%;\n" +
+ " width: auto;\n" +
+ " cursor: default;\n" +
+ " z-index: 4;\n" +
+ "}\n" +
+ "\n" +
+ ".ace_gutter_active_line {\n" +
+ " position: absolute;\n" +
+ " left: 0;\n" +
+ " right: 0;\n" +
+ "}\n" +
+ "\n" +
+ ".ace_scroller.horscroll {\n" +
+ " box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;\n" +
+ "}\n" +
+ "\n" +
+ ".ace_gutter-cell {\n" +
+ " padding-left: 19px;\n" +
+ " padding-right: 6px;\n" +
+ " background-repeat: no-repeat;\n" +
+ "}\n" +
+ "\n" +
+ ".ace_gutter-cell.ace_error {\n" +
+ " background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QUM2OEZDQTQ4RTU0MTFFMUEzM0VFRTM2RUY1M0RBMjYiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6QUM2OEZDQTU4RTU0MTFFMUEzM0VFRTM2RUY1M0RBMjYiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpBQzY4RkNBMjhFNTQxMUUxQTMzRUVFMzZFRjUzREEyNiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpBQzY4RkNBMzhFNTQxMUUxQTMzRUVFMzZFRjUzREEyNiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PkgXxbAAAAJbSURBVHjapFNNaBNBFH4zs5vdZLP5sQmNpT82QY209heh1ioWisaDRcSKF0WKJ0GQnrzrxasHsR6EnlrwD0TagxJabaVEpFYxLWlLSS822tr87m66ccfd2GKyVhA6MMybgfe97/vmPUQphd0sZjto9XIn9OOsvlu2nkqRzVU+6vvlzPf8W6bk8dxQ0NPbxAALgCgg2JkaQuhzQau/El0zbmUA7U0Es8v2CiYmKQJHGO1QICCLoqilMhkmurDAyapKgqItezi/USRdJqEYY4D5jCy03ht2yMkkvL91jTTX10qzyyu2hruPRN7jgbH+EOsXcMLgYiThEgAMhABW85oqy1DXdRIdvP1AHJ2acQXvDIrVHcdQNrEKNYSVMSZGMjEzIIAwDXIo+6G/FxcGnzkC3T2oMhLjre49sBB+RRcHLqdafK6sYdE/GGBwU1VpFNj0aN8pJbe+BkZyevUrvLl6Xmm0W9IuTc0DxrDNAJd5oEvI/KRsNC3bQyNjPO9yQ1YHcfj2QvfQc/5TUhJTBc2iM0U7AWDQtc1nJHvD/cfO2s7jaGkiTEfa/Ep8coLu7zmNmh8+dc5lZDuUeFAGUNA/OY6JVaypQ0vjr7XYjUvJM37vt+j1vuTK5DgVfVUoTjVe+y3/LxMxY2GgU+CSLy4cpfsYorRXuXIOi0Vt40h67uZFTdIo6nLaZcwUJWAzwNS0tBnqqKzQDnjdG/iPyZxo46HaKUpbvYkj8qYRTZsBhge+JHhZyh0x9b95JqjVJkT084kZIPwu/mPWqPgfQ5jXh2+92Ay7HedfAgwA6KDWafb4w3cAAAAASUVORK5CYII=\");\n" +
+ " background-repeat: no-repeat;\n" +
+ " background-position: 2px center;\n" +
+ "}\n" +
+ "\n" +
+ ".ace_gutter-cell.ace_warning {\n" +
+ " background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QUM2OEZDQTg4RTU0MTFFMUEzM0VFRTM2RUY1M0RBMjYiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6QUM2OEZDQTk4RTU0MTFFMUEzM0VFRTM2RUY1M0RBMjYiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpBQzY4RkNBNjhFNTQxMUUxQTMzRUVFMzZFRjUzREEyNiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpBQzY4RkNBNzhFNTQxMUUxQTMzRUVFMzZFRjUzREEyNiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pgd7PfIAAAGmSURBVHjaYvr//z8DJZiJgUIANoCRkREb9gLiSVAaQx4OQM7AAkwd7XU2/v++/rOttdYGEB9dASEvOMydGKfH8Gv/p4XTkvRBfLxeQAP+1cUhXopyvzhP7P/IoSj7g7Mw09cNKO6J1QQ0L4gICPIv/veg/8W+JdFvQNLHVsW9/nmn9zk7B+cCkDwhL7gt6knSZnx9/LuCEOcvkIAMP+cvto9nfqyZmmUAksfnBUtbM60gX/3/kgyv3/xSFOL5DZT+L8vP+Yfh5cvfPvp/xUHyQHXGyAYwgpwBjZYFT3Y1OEl/OfCH4ffv3wzc4iwMvNIsDJ+f/mH4+vIPAxsb631WW0Yln6ZpQLXdMK/DXGDflh+sIv37EivD5x//Gb7+YWT4y86sl7BCCkSD+Z++/1dkvsFRl+HnD1Rvje4F8whjMXmGj58YGf5zsDMwcnAwfPvKcml62DsQDeaDxN+/Y0qwlpEHqrdB94IRNIDUgfgfKJChGK4OikEW3gTiXUB950ASLFAF54AC94A0G9QAfOnmF9DCDzABFqS08IHYDIScdijOjQABBgC+/9awBH96jwAAAABJRU5ErkJggg==\");\n" +
+ " background-position: 2px center;\n" +
+ "}\n" +
+ "\n" +
+ ".ace_gutter-cell.ace_info {\n" +
+ " background-image: url(\"data:image/gif;base64,R0lGODlhEAAQAMQAAAAAAEFBQVJSUl5eXmRkZGtra39/f4WFhYmJiZGRkaampry8vMPDw8zMzNXV1dzc3OTk5Orq6vDw8P///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkAABQALAAAAAAQABAAAAUuICWOZGmeaBml5XGwFCQSBGyXRSAwtqQIiRuiwIM5BoYVbEFIyGCQoeJGrVptIQA7\");\n" +
+ " background-position: 2px center;\n" +
+ "}\n" +
+ ".ace_dark .ace_gutter-cell.ace_info {\n" +
+ " background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoTWFjaW50b3NoKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpGRTk5MTVGREIxNDkxMUUxOTc5Q0FFREQyMTNGMjBFQyIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDpGRTk5MTVGRUIxNDkxMUUxOTc5Q0FFREQyMTNGMjBFQyI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkZFOTkxNUZCQjE0OTExRTE5NzlDQUVERDIxM0YyMEVDIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkZFOTkxNUZDQjE0OTExRTE5NzlDQUVERDIxM0YyMEVDIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+SIDkjAAAAJ1JREFUeNpi/P//PwMlgImBQkB7A6qrq/+DMC55FkIGKCoq4pVnpFkgTp069f/+/fv/r1u37r+tre1/kg0A+ptn9uzZYLaRkRHpLvjw4cNXWVlZhufPnzOcO3eOdAO0tbVPAjHDmzdvGA4fPsxIsgGSkpJmv379Ynj37h2DjIyMCMkG3LhxQ/T27dsMampqDHZ2dq/pH41DxwCAAAMAFdc68dUsFZgAAAAASUVORK5CYII=\");\n" +
+ "}\n" +
+ "\n" +
+ ".ace_editor .ace_sb {\n" +
+ " position: absolute;\n" +
+ " overflow-x: hidden;\n" +
+ " overflow-y: scroll;\n" +
+ " right: 0;\n" +
+ "}\n" +
+ "\n" +
+ ".ace_editor .ace_sb div {\n" +
+ " position: absolute;\n" +
+ " width: 1px;\n" +
+ " left: 0;\n" +
+ "}\n" +
+ "\n" +
+ ".ace_editor .ace_print_margin_layer {\n" +
+ " z-index: 0;\n" +
+ " position: absolute;\n" +
+ " overflow: hidden;\n" +
+ " margin: 0;\n" +
+ " left: 0;\n" +
+ " height: 100%;\n" +
+ " width: 100%;\n" +
+ "}\n" +
+ "\n" +
+ ".ace_editor .ace_print_margin {\n" +
+ " position: absolute;\n" +
+ " height: 100%;\n" +
+ "}\n" +
+ "\n" +
+ ".ace_editor > textarea {\n" +
+ " position: absolute;\n" +
+ " z-index: 0;\n" +
+ " width: 0.5em;\n" +
+ " height: 1em;\n" +
+ " opacity: 0;\n" +
+ " background: transparent;\n" +
+ " appearance: none;\n" +
+ " -moz-appearance: none;\n" +
+ " border: none;\n" +
+ " resize: none;\n" +
+ " outline: none;\n" +
+ " overflow: hidden;\n" +
+ "}\n" +
+ "\n" +
+ ".ace_editor > textarea.ace_composition {\n" +
+ " background: #fff;\n" +
+ " color: #000;\n" +
+ " z-index: 1000;\n" +
+ " opacity: 1;\n" +
+ " border: solid lightgray 1px;\n" +
+ " margin: -1px\n" +
+ "}\n" +
+ "\n" +
+ ".ace_layer {\n" +
+ " z-index: 1;\n" +
+ " position: absolute;\n" +
+ " overflow: hidden;\n" +
+ " white-space: nowrap;\n" +
+ " height: 100%;\n" +
+ " width: 100%;\n" +
+ " box-sizing: border-box;\n" +
+ " -moz-box-sizing: border-box;\n" +
+ " -webkit-box-sizing: border-box;\n" +
+ " /* setting pointer-events: auto; on node under the mouse, which changes\n" +
+ " during scroll, will break mouse wheel scrolling in Safari */\n" +
+ " pointer-events: none;\n" +
+ "}\n" +
+ "\n" +
+ ".ace_gutter .ace_layer {\n" +
+ " position: relative;\n" +
+ " width: auto;\n" +
+ " text-align: right;\n" +
+ " pointer-events: auto;\n" +
+ "}\n" +
+ "\n" +
+ ".ace_text-layer {\n" +
+ " color: black;\n" +
+ " font: inherit !important;\n" +
+ "}\n" +
+ "\n" +
+ ".ace_cjk {\n" +
+ " display: inline-block;\n" +
+ " text-align: center;\n" +
+ "}\n" +
+ "\n" +
+ ".ace_cursor-layer {\n" +
+ " z-index: 4;\n" +
+ "}\n" +
+ "\n" +
+ ".ace_cursor {\n" +
+ " z-index: 4;\n" +
+ " position: absolute;\n" +
+ "}\n" +
+ "\n" +
+ ".ace_cursor.ace_hidden {\n" +
+ " opacity: 0.2;\n" +
+ "}\n" +
+ "\n" +
+ ".ace_editor.multiselect .ace_cursor {\n" +
+ " border-left-width: 1px;\n" +
+ "}\n" +
+ "\n" +
+ ".ace_line {\n" +
+ " white-space: nowrap;\n" +
+ "}\n" +
+ "\n" +
+ ".ace_marker-layer .ace_step {\n" +
+ " position: absolute;\n" +
+ " z-index: 3;\n" +
+ "}\n" +
+ "\n" +
+ ".ace_marker-layer .ace_selection {\n" +
+ " position: absolute;\n" +
+ " z-index: 5;\n" +
+ "}\n" +
+ "\n" +
+ ".ace_marker-layer .ace_bracket {\n" +
+ " position: absolute;\n" +
+ " z-index: 6;\n" +
+ "}\n" +
+ "\n" +
+ ".ace_marker-layer .ace_active_line {\n" +
+ " position: absolute;\n" +
+ " z-index: 2;\n" +
+ "}\n" +
+ "\n" +
+ ".ace_marker-layer .ace_selected_word {\n" +
+ " position: absolute;\n" +
+ " z-index: 4;\n" +
+ " box-sizing: border-box;\n" +
+ " -moz-box-sizing: border-box;\n" +
+ " -webkit-box-sizing: border-box;\n" +
+ "}\n" +
+ "\n" +
+ ".ace_line .ace_fold {\n" +
+ " box-sizing: border-box;\n" +
+ " -moz-box-sizing: border-box;\n" +
+ " -webkit-box-sizing: border-box;\n" +
+ "\n" +
+ " display: inline-block;\n" +
+ " height: 11px;\n" +
+ " margin-top: -2px;\n" +
+ " vertical-align: middle;\n" +
+ "\n" +
+ " background-image:\n" +
+ " url(\"data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%11%00%00%00%09%08%06%00%00%00%D4%E8%C7%0C%00%00%03%1EiCCPICC%20Profile%00%00x%01%85T%DFk%D3P%14%FE%DAe%9D%B0%E1%8B%3Ag%11%09%3Eh%91ndStC%9C%B6kW%BA%CDZ%EA6%B7!H%9B%A6m%5C%9A%C6%24%ED~%B0%07%D9%8Bo%3A%C5w%F1%07%3E%F9%07%0C%D9%83o%7B%92%0D%C6%14a%F8%AC%88%22L%F6%22%B3%9E%9B4M'S%03%B9%F7%BB%DF%F9%EE9'%E7%E4%5E%A0%F9qZ%D3%14%2F%0F%14USO%C5%C2%FC%C4%E4%14%DF%F2%01%5E%1CC%2B%FChM%8B%86%16J%26G%40%0F%D3%B2y%EF%B3%F3%0E%1E%C6lt%EEo%DF%AB%FEc%D5%9A%95%0C%11%F0%1C%20%BE%945%C4%22%E1Y%A0i%5C%D4t%13%E0%D6%89%EF%9D15%C2%CDLsX%A7%04%09%1Fg8oc%81%E1%8C%8D%23%96f45%40%9A%09%C2%07%C5B%3AK%B8%408%98i%E0%F3%0D%D8%CE%81%14%E4'%26%A9%92.%8B%3C%ABER%2F%E5dE%B2%0C%F6%F0%1Fs%83%F2_%B0%A8%94%E9%9B%AD%E7%10%8Dm%9A%19N%D1%7C%8A%DE%1F9%7Dp%8C%E6%00%D5%C1%3F_%18%BDA%B8%9DpX6%E3%A35~B%CD%24%AE%11%26%BD%E7%EEti%98%EDe%9A%97Y)%12%25%1C%24%BCbT%AE3li%E6%0B%03%89%9A%E6%D3%ED%F4P%92%B0%9F4%BF43Y%F3%E3%EDP%95%04%EB1%C5%F5%F6KF%F4%BA%BD%D7%DB%91%93%07%E35%3E%A7)%D6%7F%40%FE%BD%F7%F5r%8A%E5y%92%F0%EB%B4%1E%8D%D5%F4%5B%92%3AV%DB%DB%E4%CD%A6%23%C3%C4wQ%3F%03HB%82%8E%1Cd(%E0%91B%0Ca%9Ac%C4%AA%F8L%16%19%22J%A4%D2itTy%B28%D6%3B(%93%96%ED%1CGx%C9_%0E%B8%5E%16%F5%5B%B2%B8%F6%E0%FB%9E%DD%25%D7%8E%BC%15%85%C5%B7%A3%D8Q%ED%B5%81%E9%BA%B2%13%9A%1B%7Fua%A5%A3n%E17%B9%E5%9B%1Bm%AB%0B%08Q%FE%8A%E5%B1H%5Ee%CAO%82Q%D7u6%E6%90S%97%FCu%0B%CF2%94%EE%25v%12X%0C%BA%AC%F0%5E%F8*l%0AO%85%17%C2%97%BF%D4%C8%CE%DE%AD%11%CB%80q%2C%3E%AB%9ES%CD%C6%EC%25%D2L%D2%EBd%B8%BF%8A%F5B%C6%18%F9%901CZ%9D%BE%24M%9C%8A9%F2%DAP%0B'%06w%82%EB%E6%E2%5C%2F%D7%07%9E%BB%CC%5D%E1%FA%B9%08%AD.r%23%8E%C2%17%F5E%7C!%F0%BE3%BE%3E_%B7o%88a%A7%DB%BE%D3d%EB%A31Z%EB%BB%D3%91%BA%A2%B1z%94%8F%DB'%F6%3D%8E%AA%13%19%B2%B1%BE%B1~V%08%2B%B4%A2cjJ%B3tO%00%03%25mN%97%F3%05%93%EF%11%84%0B%7C%88%AE-%89%8F%ABbW%90O%2B%0Ao%99%0C%5E%97%0CI%AFH%D9.%B0%3B%8F%ED%03%B6S%D6%5D%E6i_s9%F3*p%E9%1B%FD%C3%EB.7U%06%5E%19%C0%D1s.%17%A03u%E4%09%B0%7C%5E%2C%EB%15%DB%1F%3C%9E%B7%80%91%3B%DBc%AD%3Dma%BA%8B%3EV%AB%DBt.%5B%1E%01%BB%0F%AB%D5%9F%CF%AA%D5%DD%E7%E4%7F%0Bx%A3%FC%06%A9%23%0A%D6%C2%A1_2%00%00%00%09pHYs%00%00%0B%13%00%00%0B%13%01%00%9A%9C%18%00%00%00%B5IDAT(%15%A5%91%3D%0E%02!%10%85ac%E1%05%D6%CE%D6%C6%CE%D2%E8%ED%CD%DE%C0%C6%D6N.%E0V%F8%3D%9Ca%891XH%C2%BE%D9y%3F%90!%E6%9C%C3%BFk%E5%011%C6-%F5%C8N%04%DF%BD%FF%89%DFt%83DN%60%3E%F3%AB%A0%DE%1A%5Dg%BE%10Q%97%1B%40%9C%A8o%10%8F%5E%828%B4%1B%60%87%F6%02%26%85%1Ch%1E%C1%2B%5Bk%FF%86%EE%B7j%09%9A%DA%9B%ACe%A3%F9%EC%DA!9%B4%D5%A6%81%86%86%98%CC%3C%5B%40%FA%81%B3%E9%CB%23%94%C16Azo%05%D4%E1%C1%95a%3B%8A'%A0%E8%CC%17%22%85%1D%BA%00%A2%FA%DC%0A%94%D1%D1%8D%8B%3A%84%17B%C7%60%1A%25Z%FC%8D%00%00%00%00IEND%AEB%60%82\"),\n" +
+ " url(\"data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%05%00%00%007%08%06%00%00%00%C4%DD%80C%00%00%03%1EiCCPICC%20Profile%00%00x%01%85T%DFk%D3P%14%FE%DAe%9D%B0%E1%8B%3Ag%11%09%3Eh%91ndStC%9C%B6kW%BA%CDZ%EA6%B7!H%9B%A6m%5C%9A%C6%24%ED~%B0%07%D9%8Bo%3A%C5w%F1%07%3E%F9%07%0C%D9%83o%7B%92%0D%C6%14a%F8%AC%88%22L%F6%22%B3%9E%9B4M'S%03%B9%F7%BB%DF%F9%EE9'%E7%E4%5E%A0%F9qZ%D3%14%2F%0F%14USO%C5%C2%FC%C4%E4%14%DF%F2%01%5E%1CC%2B%FChM%8B%86%16J%26G%40%0F%D3%B2y%EF%B3%F3%0E%1E%C6lt%EEo%DF%AB%FEc%D5%9A%95%0C%11%F0%1C%20%BE%945%C4%22%E1Y%A0i%5C%D4t%13%E0%D6%89%EF%9D15%C2%CDLsX%A7%04%09%1Fg8oc%81%E1%8C%8D%23%96f45%40%9A%09%C2%07%C5B%3AK%B8%408%98i%E0%F3%0D%D8%CE%81%14%E4'%26%A9%92.%8B%3C%ABER%2F%E5dE%B2%0C%F6%F0%1Fs%83%F2_%B0%A8%94%E9%9B%AD%E7%10%8Dm%9A%19N%D1%7C%8A%DE%1F9%7Dp%8C%E6%00%D5%C1%3F_%18%BDA%B8%9DpX6%E3%A35~B%CD%24%AE%11%26%BD%E7%EEti%98%EDe%9A%97Y)%12%25%1C%24%BCbT%AE3li%E6%0B%03%89%9A%E6%D3%ED%F4P%92%B0%9F4%BF43Y%F3%E3%EDP%95%04%EB1%C5%F5%F6KF%F4%BA%BD%D7%DB%91%93%07%E35%3E%A7)%D6%7F%40%FE%BD%F7%F5r%8A%E5y%92%F0%EB%B4%1E%8D%D5%F4%5B%92%3AV%DB%DB%E4%CD%A6%23%C3%C4wQ%3F%03HB%82%8E%1Cd(%E0%91B%0Ca%9Ac%C4%AA%F8L%16%19%22J%A4%D2itTy%B28%D6%3B(%93%96%ED%1CGx%C9_%0E%B8%5E%16%F5%5B%B2%B8%F6%E0%FB%9E%DD%25%D7%8E%BC%15%85%C5%B7%A3%D8Q%ED%B5%81%E9%BA%B2%13%9A%1B%7Fua%A5%A3n%E17%B9%E5%9B%1Bm%AB%0B%08Q%FE%8A%E5%B1H%5Ee%CAO%82Q%D7u6%E6%90S%97%FCu%0B%CF2%94%EE%25v%12X%0C%BA%AC%F0%5E%F8*l%0AO%85%17%C2%97%BF%D4%C8%CE%DE%AD%11%CB%80q%2C%3E%AB%9ES%CD%C6%EC%25%D2L%D2%EBd%B8%BF%8A%F5B%C6%18%F9%901CZ%9D%BE%24M%9C%8A9%F2%DAP%0B'%06w%82%EB%E6%E2%5C%2F%D7%07%9E%BB%CC%5D%E1%FA%B9%08%AD.r%23%8E%C2%17%F5E%7C!%F0%BE3%BE%3E_%B7o%88a%A7%DB%BE%D3d%EB%A31Z%EB%BB%D3%91%BA%A2%B1z%94%8F%DB'%F6%3D%8E%AA%13%19%B2%B1%BE%B1~V%08%2B%B4%A2cjJ%B3tO%00%03%25mN%97%F3%05%93%EF%11%84%0B%7C%88%AE-%89%8F%ABbW%90O%2B%0Ao%99%0C%5E%97%0CI%AFH%D9.%B0%3B%8F%ED%03%B6S%D6%5D%E6i_s9%F3*p%E9%1B%FD%C3%EB.7U%06%5E%19%C0%D1s.%17%A03u%E4%09%B0%7C%5E%2C%EB%15%DB%1F%3C%9E%B7%80%91%3B%DBc%AD%3Dma%BA%8B%3EV%AB%DBt.%5B%1E%01%BB%0F%AB%D5%9F%CF%AA%D5%DD%E7%E4%7F%0Bx%A3%FC%06%A9%23%0A%D6%C2%A1_2%00%00%00%09pHYs%00%00%0B%13%00%00%0B%13%01%00%9A%9C%18%00%00%00%3AIDAT8%11c%FC%FF%FF%7F%18%03%1A%60%01%F2%3F%A0%891%80%04%FF%11-%F8%17%9BJ%E2%05%B1ZD%81v%26t%E7%80%F8%A3%82h%A12%1A%20%A3%01%02%0F%01%BA%25%06%00%19%C0%0D%AEF%D5%3ES%00%00%00%00IEND%AEB%60%82\");\n" +
+ " background-repeat: no-repeat, repeat-x;\n" +
+ " background-position: center center, top left;\n" +
+ " color: transparent;\n" +
+ "\n" +
+ " border: 1px solid black;\n" +
+ " -moz-border-radius: 2px;\n" +
+ " -webkit-border-radius: 2px;\n" +
+ " border-radius: 2px;\n" +
+ "\n" +
+ " cursor: pointer;\n" +
+ " pointer-events: auto;\n" +
+ "}\n" +
+ "\n" +
+ ".ace_dark .ace_fold {\n" +
+ "}\n" +
+ "\n" +
+ ".ace_fold:hover{\n" +
+ " background-image:\n" +
+ " url(\"data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%11%00%00%00%09%08%06%00%00%00%D4%E8%C7%0C%00%00%03%1EiCCPICC%20Profile%00%00x%01%85T%DFk%D3P%14%FE%DAe%9D%B0%E1%8B%3Ag%11%09%3Eh%91ndStC%9C%B6kW%BA%CDZ%EA6%B7!H%9B%A6m%5C%9A%C6%24%ED~%B0%07%D9%8Bo%3A%C5w%F1%07%3E%F9%07%0C%D9%83o%7B%92%0D%C6%14a%F8%AC%88%22L%F6%22%B3%9E%9B4M'S%03%B9%F7%BB%DF%F9%EE9'%E7%E4%5E%A0%F9qZ%D3%14%2F%0F%14USO%C5%C2%FC%C4%E4%14%DF%F2%01%5E%1CC%2B%FChM%8B%86%16J%26G%40%0F%D3%B2y%EF%B3%F3%0E%1E%C6lt%EEo%DF%AB%FEc%D5%9A%95%0C%11%F0%1C%20%BE%945%C4%22%E1Y%A0i%5C%D4t%13%E0%D6%89%EF%9D15%C2%CDLsX%A7%04%09%1Fg8oc%81%E1%8C%8D%23%96f45%40%9A%09%C2%07%C5B%3AK%B8%408%98i%E0%F3%0D%D8%CE%81%14%E4'%26%A9%92.%8B%3C%ABER%2F%E5dE%B2%0C%F6%F0%1Fs%83%F2_%B0%A8%94%E9%9B%AD%E7%10%8Dm%9A%19N%D1%7C%8A%DE%1F9%7Dp%8C%E6%00%D5%C1%3F_%18%BDA%B8%9DpX6%E3%A35~B%CD%24%AE%11%26%BD%E7%EEti%98%EDe%9A%97Y)%12%25%1C%24%BCbT%AE3li%E6%0B%03%89%9A%E6%D3%ED%F4P%92%B0%9F4%BF43Y%F3%E3%EDP%95%04%EB1%C5%F5%F6KF%F4%BA%BD%D7%DB%91%93%07%E35%3E%A7)%D6%7F%40%FE%BD%F7%F5r%8A%E5y%92%F0%EB%B4%1E%8D%D5%F4%5B%92%3AV%DB%DB%E4%CD%A6%23%C3%C4wQ%3F%03HB%82%8E%1Cd(%E0%91B%0Ca%9Ac%C4%AA%F8L%16%19%22J%A4%D2itTy%B28%D6%3B(%93%96%ED%1CGx%C9_%0E%B8%5E%16%F5%5B%B2%B8%F6%E0%FB%9E%DD%25%D7%8E%BC%15%85%C5%B7%A3%D8Q%ED%B5%81%E9%BA%B2%13%9A%1B%7Fua%A5%A3n%E17%B9%E5%9B%1Bm%AB%0B%08Q%FE%8A%E5%B1H%5Ee%CAO%82Q%D7u6%E6%90S%97%FCu%0B%CF2%94%EE%25v%12X%0C%BA%AC%F0%5E%F8*l%0AO%85%17%C2%97%BF%D4%C8%CE%DE%AD%11%CB%80q%2C%3E%AB%9ES%CD%C6%EC%25%D2L%D2%EBd%B8%BF%8A%F5B%C6%18%F9%901CZ%9D%BE%24M%9C%8A9%F2%DAP%0B'%06w%82%EB%E6%E2%5C%2F%D7%07%9E%BB%CC%5D%E1%FA%B9%08%AD.r%23%8E%C2%17%F5E%7C!%F0%BE3%BE%3E_%B7o%88a%A7%DB%BE%D3d%EB%A31Z%EB%BB%D3%91%BA%A2%B1z%94%8F%DB'%F6%3D%8E%AA%13%19%B2%B1%BE%B1~V%08%2B%B4%A2cjJ%B3tO%00%03%25mN%97%F3%05%93%EF%11%84%0B%7C%88%AE-%89%8F%ABbW%90O%2B%0Ao%99%0C%5E%97%0CI%AFH%D9.%B0%3B%8F%ED%03%B6S%D6%5D%E6i_s9%F3*p%E9%1B%FD%C3%EB.7U%06%5E%19%C0%D1s.%17%A03u%E4%09%B0%7C%5E%2C%EB%15%DB%1F%3C%9E%B7%80%91%3B%DBc%AD%3Dma%BA%8B%3EV%AB%DBt.%5B%1E%01%BB%0F%AB%D5%9F%CF%AA%D5%DD%E7%E4%7F%0Bx%A3%FC%06%A9%23%0A%D6%C2%A1_2%00%00%00%09pHYs%00%00%0B%13%00%00%0B%13%01%00%9A%9C%18%00%00%00%B5IDAT(%15%A5%91%3D%0E%02!%10%85ac%E1%05%D6%CE%D6%C6%CE%D2%E8%ED%CD%DE%C0%C6%D6N.%E0V%F8%3D%9Ca%891XH%C2%BE%D9y%3F%90!%E6%9C%C3%BFk%E5%011%C6-%F5%C8N%04%DF%BD%FF%89%DFt%83DN%60%3E%F3%AB%A0%DE%1A%5Dg%BE%10Q%97%1B%40%9C%A8o%10%8F%5E%828%B4%1B%60%87%F6%02%26%85%1Ch%1E%C1%2B%5Bk%FF%86%EE%B7j%09%9A%DA%9B%ACe%A3%F9%EC%DA!9%B4%D5%A6%81%86%86%98%CC%3C%5B%40%FA%81%B3%E9%CB%23%94%C16Azo%05%D4%E1%C1%95a%3B%8A'%A0%E8%CC%17%22%85%1D%BA%00%A2%FA%DC%0A%94%D1%D1%8D%8B%3A%84%17B%C7%60%1A%25Z%FC%8D%00%00%00%00IEND%AEB%60%82\"),\n" +
+ " url(\"data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%05%00%00%007%08%06%00%00%00%C4%DD%80C%00%00%03%1EiCCPICC%20Profile%00%00x%01%85T%DFk%D3P%14%FE%DAe%9D%B0%E1%8B%3Ag%11%09%3Eh%91ndStC%9C%B6kW%BA%CDZ%EA6%B7!H%9B%A6m%5C%9A%C6%24%ED~%B0%07%D9%8Bo%3A%C5w%F1%07%3E%F9%07%0C%D9%83o%7B%92%0D%C6%14a%F8%AC%88%22L%F6%22%B3%9E%9B4M'S%03%B9%F7%BB%DF%F9%EE9'%E7%E4%5E%A0%F9qZ%D3%14%2F%0F%14USO%C5%C2%FC%C4%E4%14%DF%F2%01%5E%1CC%2B%FChM%8B%86%16J%26G%40%0F%D3%B2y%EF%B3%F3%0E%1E%C6lt%EEo%DF%AB%FEc%D5%9A%95%0C%11%F0%1C%20%BE%945%C4%22%E1Y%A0i%5C%D4t%13%E0%D6%89%EF%9D15%C2%CDLsX%A7%04%09%1Fg8oc%81%E1%8C%8D%23%96f45%40%9A%09%C2%07%C5B%3AK%B8%408%98i%E0%F3%0D%D8%CE%81%14%E4'%26%A9%92.%8B%3C%ABER%2F%E5dE%B2%0C%F6%F0%1Fs%83%F2_%B0%A8%94%E9%9B%AD%E7%10%8Dm%9A%19N%D1%7C%8A%DE%1F9%7Dp%8C%E6%00%D5%C1%3F_%18%BDA%B8%9DpX6%E3%A35~B%CD%24%AE%11%26%BD%E7%EEti%98%EDe%9A%97Y)%12%25%1C%24%BCbT%AE3li%E6%0B%03%89%9A%E6%D3%ED%F4P%92%B0%9F4%BF43Y%F3%E3%EDP%95%04%EB1%C5%F5%F6KF%F4%BA%BD%D7%DB%91%93%07%E35%3E%A7)%D6%7F%40%FE%BD%F7%F5r%8A%E5y%92%F0%EB%B4%1E%8D%D5%F4%5B%92%3AV%DB%DB%E4%CD%A6%23%C3%C4wQ%3F%03HB%82%8E%1Cd(%E0%91B%0Ca%9Ac%C4%AA%F8L%16%19%22J%A4%D2itTy%B28%D6%3B(%93%96%ED%1CGx%C9_%0E%B8%5E%16%F5%5B%B2%B8%F6%E0%FB%9E%DD%25%D7%8E%BC%15%85%C5%B7%A3%D8Q%ED%B5%81%E9%BA%B2%13%9A%1B%7Fua%A5%A3n%E17%B9%E5%9B%1Bm%AB%0B%08Q%FE%8A%E5%B1H%5Ee%CAO%82Q%D7u6%E6%90S%97%FCu%0B%CF2%94%EE%25v%12X%0C%BA%AC%F0%5E%F8*l%0AO%85%17%C2%97%BF%D4%C8%CE%DE%AD%11%CB%80q%2C%3E%AB%9ES%CD%C6%EC%25%D2L%D2%EBd%B8%BF%8A%F5B%C6%18%F9%901CZ%9D%BE%24M%9C%8A9%F2%DAP%0B'%06w%82%EB%E6%E2%5C%2F%D7%07%9E%BB%CC%5D%E1%FA%B9%08%AD.r%23%8E%C2%17%F5E%7C!%F0%BE3%BE%3E_%B7o%88a%A7%DB%BE%D3d%EB%A31Z%EB%BB%D3%91%BA%A2%B1z%94%8F%DB'%F6%3D%8E%AA%13%19%B2%B1%BE%B1~V%08%2B%B4%A2cjJ%B3tO%00%03%25mN%97%F3%05%93%EF%11%84%0B%7C%88%AE-%89%8F%ABbW%90O%2B%0Ao%99%0C%5E%97%0CI%AFH%D9.%B0%3B%8F%ED%03%B6S%D6%5D%E6i_s9%F3*p%E9%1B%FD%C3%EB.7U%06%5E%19%C0%D1s.%17%A03u%E4%09%B0%7C%5E%2C%EB%15%DB%1F%3C%9E%B7%80%91%3B%DBc%AD%3Dma%BA%8B%3EV%AB%DBt.%5B%1E%01%BB%0F%AB%D5%9F%CF%AA%D5%DD%E7%E4%7F%0Bx%A3%FC%06%A9%23%0A%D6%C2%A1_2%00%00%00%09pHYs%00%00%0B%13%00%00%0B%13%01%00%9A%9C%18%00%00%003IDAT8%11c%FC%FF%FF%7F%3E%03%1A%60%01%F2%3F%A3%891%80%04%FFQ%26%F8w%C0%B43%A1%DB%0C%E2%8F%0A%A2%85%CAh%80%8C%06%08%3C%04%E8%96%18%00%A3S%0D%CD%CF%D8%C1%9D%00%00%00%00IEND%AEB%60%82\");\n" +
+ " background-repeat: no-repeat, repeat-x;\n" +
+ " background-position: center center, top left;\n" +
+ "}\n" +
+ "\n" +
+ ".ace_dragging .ace_content {\n" +
+ " cursor: move;\n" +
+ "}\n" +
+ "\n" +
+ ".ace_gutter_tooltip {\n" +
+ " background-color: #FFFFD5;\n" +
+ " border: 1px solid gray;\n" +
+ " box-shadow: 0 1px 1px rgba(0, 0, 0, 0.4);\n" +
+ " color: black;\n" +
+ " display: inline-block;\n" +
+ " padding: 4px;\n" +
+ " position: absolute;\n" +
+ " z-index: 300;\n" +
+ " box-sizing: border-box;\n" +
+ " -moz-box-sizing: border-box;\n" +
+ " -webkit-box-sizing: border-box;\n" +
+ " cursor: default;\n" +
+ "}\n" +
+ "\n" +
+ ".ace_folding-enabled > .ace_gutter-cell {\n" +
+ " padding-right: 13px;\n" +
+ "}\n" +
+ "\n" +
+ ".ace_fold-widget {\n" +
+ " box-sizing: border-box;\n" +
+ " -moz-box-sizing: border-box;\n" +
+ " -webkit-box-sizing: border-box;\n" +
+ "\n" +
+ " margin: 0 -12px 0 1px;\n" +
+ " display: inline-block;\n" +
+ " width: 11px;\n" +
+ " vertical-align: top;\n" +
+ "\n" +
+ " background-image: url(\"data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%05%00%00%00%05%08%06%00%00%00%8Do%26%E5%00%00%004IDATx%DAe%8A%B1%0D%000%0C%C2%F2%2CK%96%BC%D0%8F9%81%88H%E9%D0%0E%96%C0%10%92%3E%02%80%5E%82%E4%A9*-%EEsw%C8%CC%11%EE%96w%D8%DC%E9*Eh%0C%151(%00%00%00%00IEND%AEB%60%82\");\n" +
+ " background-repeat: no-repeat;\n" +
+ " background-position: center;\n" +
+ "\n" +
+ " border-radius: 3px;\n" +
+ " \n" +
+ " border: 1px solid transparent;\n" +
+ "}\n" +
+ "\n" +
+ ".ace_fold-widget.end {\n" +
+ " background-image: url(\"data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%05%00%00%00%05%08%06%00%00%00%8Do%26%E5%00%00%004IDATx%DAm%C7%C1%09%000%08C%D1%8C%ECE%C8E(%8E%EC%02)%1EZJ%F1%C1'%04%07I%E1%E5%EE%CAL%F5%A2%99%99%22%E2%D6%1FU%B5%FE0%D9x%A7%26Wz5%0E%D5%00%00%00%00IEND%AEB%60%82\");\n" +
+ "}\n" +
+ "\n" +
+ ".ace_fold-widget.closed {\n" +
+ " background-image: url(\"data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%03%00%00%00%06%08%06%00%00%00%06%E5%24%0C%00%00%009IDATx%DA5%CA%C1%09%000%08%03%C0%AC*(%3E%04%C1%0D%BA%B1%23%A4Uh%E0%20%81%C0%CC%F8%82%81%AA%A2%AArGfr%88%08%11%11%1C%DD%7D%E0%EE%5B%F6%F6%CB%B8%05Q%2F%E9tai%D9%00%00%00%00IEND%AEB%60%82\");\n" +
+ "}\n" +
+ "\n" +
+ ".ace_fold-widget:hover {\n" +
+ " border: 1px solid rgba(0, 0, 0, 0.3);\n" +
+ " background-color: rgba(255, 255, 255, 0.2);\n" +
+ " -moz-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);\n" +
+ " -webkit-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);\n" +
+ " box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);\n" +
+ "}\n" +
+ "\n" +
+ ".ace_fold-widget:active {\n" +
+ " border: 1px solid rgba(0, 0, 0, 0.4);\n" +
+ " background-color: rgba(0, 0, 0, 0.05);\n" +
+ " -moz-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);\n" +
+ " -webkit-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);\n" +
+ " box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);\n" +
+ "}\n" +
+ "/**\n" +
+ " * Dark version for fold widgets\n" +
+ " */\n" +
+ ".ace_dark .ace_fold-widget {\n" +
+ " background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC\");\n" +
+ "}\n" +
+ ".ace_dark .ace_fold-widget.end {\n" +
+ " background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==\");\n" +
+ "}\n" +
+ ".ace_dark .ace_fold-widget.closed {\n" +
+ " background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==\");\n" +
+ "}\n" +
+ ".ace_dark .ace_fold-widget:hover {\n" +
+ " box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);\n" +
+ " background-color: rgba(255, 255, 255, 0.1);\n" +
+ "}\n" +
+ ".ace_dark .ace_fold-widget:active {\n" +
+ " -moz-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);\n" +
+ " -webkit-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);\n" +
+ " box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);\n" +
+ "}\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ ".ace_fold-widget.invalid {\n" +
+ " background-color: #FFB4B4;\n" +
+ " border-color: #DE5555;\n" +
+ "}\n" +
+ "\n" +
+ ".ace_fade-fold-widgets .ace_fold-widget {\n" +
+ " -moz-transition: opacity 0.4s ease 0.05s;\n" +
+ " -webkit-transition: opacity 0.4s ease 0.05s;\n" +
+ " -o-transition: opacity 0.4s ease 0.05s;\n" +
+ " -ms-transition: opacity 0.4s ease 0.05s;\n" +
+ " transition: opacity 0.4s ease 0.05s;\n" +
+ " opacity: 0;\n" +
+ "}\n" +
+ "\n" +
+ ".ace_fade-fold-widgets:hover .ace_fold-widget {\n" +
+ " -moz-transition: opacity 0.05s ease 0.05s;\n" +
+ " -webkit-transition: opacity 0.05s ease 0.05s;\n" +
+ " -o-transition: opacity 0.05s ease 0.05s;\n" +
+ " -ms-transition: opacity 0.05s ease 0.05s;\n" +
+ " transition: opacity 0.05s ease 0.05s;\n" +
+ " opacity:1;\n" +
+ "}\n" +
+ "\n" +
+ ".ace_underline {\n" +
+ " text-decoration: underline;\n" +
+ "}\n" +
+ "\n" +
+ ".ace_bold {\n" +
+ " font-weight: bold;\n" +
+ "}\n" +
+ "\n" +
+ ".ace_italic {\n" +
+ " font-style: italic;\n" +
+ "}\n" +
+ "");
+
+ace.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);
+
+// Todo: session.find or editor.findVolatile that returns range
+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);
+}
+
+// extend EditSession
+var EditSession = require("./edit_session").EditSession;
+(function() {
+ this.getSelectionMarkers = function() {
+ return this.$selectionMarkers;
+ };
+}).call(EditSession.prototype);
+
+// extend Selection
+(function() {
+ // list of ranges in reverse addition order
+ this.ranges = null;
+
+ // automatically sorted list of ranges
+ 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);
+ };
+
+ // adds multicursor support to selection
+ 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);
+
+// extend Editor
+var Editor = require("./editor").Editor;
+(function() {
+
+ /** extension
+ * Editor.updateSelectionMarkers()
+ *
+ * Updates the cursor and marker layers.
+ **/
+ 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("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("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;
+ };
+
+ // todo this should change when paste becomes a command
+ 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;
+ };
+
+ // commands
+ /** extension
+ * Editor.selectMoreLines(dir, skip)
+ * - dir (Number): The direction of lines to select: -1 for up, 1 for down
+ * - skip (Boolean): If `true`, removes the active selection range
+ *
+ * Adds a cursor above or below the active cursor.
+ **/
+ 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;
+ }
+ }
+
+ /** extension
+ * Editor.selectMore(dir, skip)
+ * - dir (Number): The direction of lines to select: -1 for up, 1 for down
+ * - skip (Boolean): If `true`, removes the active selection range
+ *
+ * Finds the next occurence of text in an active selection and adds it to the selections.
+ **/
+ 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 {
+ // filter out ranges on same row
+ 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 strRepeat(n, ch) {
+ return Array(n + 1).join(ch)
+ }
+
+ function alignLeft(m) {
+ return !m[2] ? m[0] : strRepeat(startW, " ") + m[2]
+ + strRepeat(textW - m[2].length + endW, " ")
+ + m[4].replace(/^([=:])\s+/, "$1 ")
+ }
+ function alignRight(m) {
+ return !m[2] ? m[0] : strRepeat(startW + textW - m[2].length, " ") + m[2]
+ + strRepeat(endW, " ")
+ + m[4].replace(/^([=:])\s+/, "$1 ")
+ }
+ function unAlign(m) {
+ return !m[2] ? m[0] : strRepeat(startW, " ") + m[2]
+ + strRepeat(endW, " ")
+ + m[4].replace(/^([=:])\s+/, "$1 ")
+ }
+ }
+}).call(Editor.prototype);
+
+
+function isSamePoint(p1, p2) {
+ return p1.row == p2.row && p1.column == p2.column;
+}
+
+// patch
+// adds multicursor support to a session
+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) {
+ // todo use events
+ 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);
+
+ // this.$onSelectionChange = this.onSelectionChange.bind(this);
+
+ if (this.inMultiSelectMode != session.selection.inMultiSelectMode) {
+ if (session.selection.inMultiSelectMode)
+ this.$onMultiSelect();
+ else
+ this.$onSingleSelect();
+ }
+};
+
+// MultiSelect(editor)
+// adds multiple selection support to the editor
+// (note: should be called only once for each editor instance)
+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;
+
+});
+
+ace.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);
+ };
+
+ // merge overlapping ranges
+ 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;
+});
+
+ace.define('ace/mouse/multi_select_handler', ['require', 'exports', 'module' , 'ace/lib/event'], function(require, exports, module) {
+
+var event = require("../lib/event");
+
+
+// mouse
+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;
+
+});
+
+ace.define('ace/commands/multi_select_commands', ['require', 'exports', 'module' , 'ace/keyboard/hash_handler'], function(require, exports, module) {
+
+// commands to enter multiselect mode
+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"}
+}];
+
+// commands active only in multiselect mode
+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);
+
+});
+
+ace.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);
+
+ if (config.get("packaged")) {
+ this.$worker = new Worker(config.moduleUrl(mod, "worker"));
+ }
+ else {
+ var workerUrl;
+ if (typeof require.supports !== "undefined" && require.supports.indexOf("ucjs2-pinf-0") >= 0) {
+ // We are running in the sourcemint loader.
+ workerUrl = require.nameToUrl("ace/worker/worker_sourcemint");
+ } else {
+ // We are running in RequireJS.
+ // nameToUrl is renamed to toUrl in requirejs 2
+ if (require.nameToUrl && !require.toUrl)
+ require.toUrl = require.nameToUrl;
+ workerUrl = this.$normalizePath(require.toUrl("ace/worker/worker", null, "_"));
+ }
+ this.$worker = new Worker(workerUrl);
+
+ var tlns = {};
+ for (var i=0; i<topLevelNamespaces.length; i++) {
+ var ns = topLevelNamespaces[i];
+ var path = this.$normalizePath(require.toUrl(ns, null, "_").replace(/.js(\?.*)?$/, ""));
+
+ tlns[ns] = path;
+ }
+ }
+
+ this.$worker.postMessage({
+ init : true,
+ tlns: tlns,
+ module: mod,
+ classname: classname
+ });
+
+ this.callbackId = 1;
+ this.callbacks = {};
+
+ var _self = this;
+ this.$worker.onerror = function(e) {
+ window.console && console.log && console.log(e);
+ throw e;
+ };
+ this.$worker.onmessage = function(e) {
+ var msg = e.data;
+ switch(msg.type) {
+ case "log":
+ window.console && console.log && console.log(msg.data);
+ break;
+
+ case "event":
+ _self._emit(msg.name, {data: msg.data});
+ break;
+
+ case "call":
+ var callback = _self.callbacks[msg.id];
+ if (callback) {
+ callback(msg.data);
+ delete _self.callbacks[msg.id];
+ }
+ break;
+ }
+ };
+};
+
+(function(){
+
+ oop.implement(this, EventEmitter);
+
+ 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
+ // paths starting with a slash are relative to the root (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 {
+ // firefox refuses to clone objects which have function properties
+ // TODO: cleanup event
+ 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);
+
+exports.WorkerClient = WorkerClient;
+
+});
+
+ace.define('ace/keyboard/state_handler', ['require', 'exports', 'module' ], function(require, exports, module) {
+
+
+// If you're developing a new keymapping and want to get an idea what's going
+// on, then enable debugging.
+var DEBUG = false;
+
+function StateHandler(keymapping) {
+ this.keymapping = this.$buildKeymappingRegex(keymapping);
+}
+
+StateHandler.prototype = {
+ /*
+ * Build the RegExp from the keymapping as RegExp can't stored directly
+ * in the metadata JSON and as the RegExp used to match the keys/buffer
+ * need to be adapted.
+ */
+ $buildKeymappingRegex: function(keymapping) {
+ for (var state in keymapping) {
+ this.$buildBindingsRegex(keymapping[state]);
+ }
+ return keymapping;
+ },
+
+ $buildBindingsRegex: function(bindings) {
+ // Escape a given Regex string.
+ bindings.forEach(function(binding) {
+ if (binding.key) {
+ binding.key = new RegExp('^' + binding.key + '$');
+ } else if (Array.isArray(binding.regex)) {
+ if (!('key' in binding))
+ binding.key = new RegExp('^' + binding.regex[1] + '$');
+ binding.regex = new RegExp(binding.regex.join('') + '$');
+ } else if (binding.regex) {
+ binding.regex = new RegExp(binding.regex + '$');
+ }
+ });
+ },
+
+ $composeBuffer: function(data, hashId, key, e) {
+ // Initialize the data object.
+ if (data.state == null || data.buffer == null) {
+ data.state = "start";
+ data.buffer = "";
+ }
+
+ var keyArray = [];
+ if (hashId & 1) keyArray.push("ctrl");
+ if (hashId & 8) keyArray.push("command");
+ if (hashId & 2) keyArray.push("option");
+ if (hashId & 4) keyArray.push("shift");
+ if (key) keyArray.push(key);
+
+ var symbolicName = keyArray.join("-");
+ var bufferToUse = data.buffer + symbolicName;
+
+ // Don't add the symbolic name to the key buffer if the alt_ key is
+ // part of the symbolic name. If it starts with alt_, this means
+ // that the user hit an alt keycombo and there will be a single,
+ // new character detected after this event, which then will be
+ // added to the buffer (e.g. alt_j will result in ∆).
+ //
+ // We test for 2 and not for & 2 as we only want to exclude the case where
+ // the option key is pressed alone.
+ if (hashId != 2) {
+ data.buffer = bufferToUse;
+ }
+
+ var bufferObj = {
+ bufferToUse: bufferToUse,
+ symbolicName: symbolicName
+ };
+
+ if (e) {
+ bufferObj.keyIdentifier = e.keyIdentifier;
+ }
+
+ return bufferObj;
+ },
+
+ $find: function(data, buffer, symbolicName, hashId, key, keyIdentifier) {
+ // Holds the command to execute and the args if a command matched.
+ var result = {};
+
+ // Loop over all the bindings of the keymap until a match is found.
+ this.keymapping[data.state].some(function(binding) {
+ var match;
+
+ // Check if the key matches.
+ if (binding.key && !binding.key.test(symbolicName)) {
+ return false;
+ }
+
+ // Check if the regex matches.
+ if (binding.regex && !(match = binding.regex.exec(buffer))) {
+ return false;
+ }
+
+ // Check if the match function matches.
+ if (binding.match && !binding.match(buffer, hashId, key, symbolicName, keyIdentifier)) {
+ return false;
+ }
+
+ // Check for disallowed matches.
+ if (binding.disallowMatches) {
+ for (var i = 0; i < binding.disallowMatches.length; i++) {
+ if (!!match[binding.disallowMatches[i]]) {
+ return false;
+ }
+ }
+ }
+
+ // If there is a command to execute, then figure out the
+ // command and the arguments.
+ if (binding.exec) {
+ result.command = binding.exec;
+
+ // Build the arguments.
+ if (binding.params) {
+ var value;
+ result.args = {};
+ binding.params.forEach(function(param) {
+ if (param.match != null && match != null) {
+ value = match[param.match] || param.defaultValue;
+ } else {
+ value = param.defaultValue;
+ }
+
+ if (param.type === 'number') {
+ value = parseInt(value);
+ }
+
+ result.args[param.name] = value;
+ });
+ }
+ data.buffer = "";
+ }
+
+ // Handle the 'then' property.
+ if (binding.then) {
+ data.state = binding.then;
+ data.buffer = "";
+ }
+
+ // If no command is set, then execute the "null" fake command.
+ if (result.command == null) {
+ result.command = "null";
+ }
+
+ if (DEBUG) {
+ console.log("KeyboardStateMapper#find", binding);
+ }
+ return true;
+ });
+
+ if (result.command) {
+ return result;
+ } else {
+ data.buffer = "";
+ return false;
+ }
+ },
+
+ /*
+ * This function is called by keyBinding.
+ */
+ handleKeyboard: function(data, hashId, key, keyCode, e) {
+ if (hashId == -1)
+ hashId = 0
+ // If we pressed any command key but no other key, then ignore the input.
+ // Otherwise "shift-" is added to the buffer, and later on "shift-g"
+ // which results in "shift-shift-g" which doesn't make sense.
+ if (hashId != 0 && (key == "" || key == String.fromCharCode(0))) {
+ return null;
+ }
+
+ // Compute the current value of the keyboard input buffer.
+ var r = this.$composeBuffer(data, hashId, key, e);
+ var buffer = r.bufferToUse;
+ var symbolicName = r.symbolicName;
+ var keyId = r.keyIdentifier;
+
+ r = this.$find(data, buffer, symbolicName, hashId, key, keyId);
+ if (DEBUG) {
+ console.log("KeyboardStateMapper#match", buffer, symbolicName, r);
+ }
+
+ return r;
+ }
+}
+
+/*
+ * This is a useful matching function and therefore is defined here so that
+ * users of KeyboardStateMapper can use it.
+ *
+ * @return boolean
+ * If no command key (Command|Option|Shift|Ctrl) is pressed, it
+ * returns true. If the only the Shift key is pressed + a character
+ * true is returned as well. Otherwise, false is returned.
+ * Summing up, the function returns true whenever the user typed
+ * a normal character on the keyboard and no shortcut.
+ */
+exports.matchCharacterOnly = function(buffer, hashId, key, symbolicName) {
+ // If no command keys are pressed, then catch the input.
+ if (hashId == 0) {
+ return true;
+ }
+ // If only the shift key is pressed and a character key, then
+ // catch that input as well.
+ else if ((hashId == 4) && key.length == 1) {
+ return true;
+ }
+ // Otherwise, we let the input got through.
+ else {
+ return false;
+ }
+};
+
+exports.StateHandler = StateHandler;
+});
+ace.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");
+
+/**
+ * new PlaceHolder(session, length, pos, others, mainClass, othersClass)
+ * - session (Document): The document to associate with the anchor
+ * - length (Number): The starting row position
+ * - pos (Number): The starting column position
+ * - others (String):
+ * - mainClass (String):
+ * - othersClass (String):
+ *
+ * TODO
+ *
+ **/
+
+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;
+ // Used for reset
+ 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));
+ }
+ }
+ // Special case: insert in beginning
+ 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;
+});
+
+ace.define('ace/theme/textmate', ['require', 'exports', 'module' , 'text!ace/theme/textmate.css', 'ace/lib/dom'], function(require, exports, module) {
+
+
+exports.isDark = false;
+exports.cssClass = "ace-tm";
+exports.cssText = require('text!./textmate.css');
+
+var dom = require("../lib/dom");
+dom.importCssString(exports.cssText, exports.cssClass);
+});
+ace.define("text!ace/theme/textmate.css", [], ".ace-tm .ace_editor {\n" +
+ " border: 2px solid rgb(159, 159, 159);\n" +
+ "}\n" +
+ "\n" +
+ ".ace-tm .ace_editor.ace_focus {\n" +
+ " border: 2px solid #327fbd;\n" +
+ "}\n" +
+ "\n" +
+ ".ace-tm .ace_gutter {\n" +
+ " background: #f0f0f0;\n" +
+ " color: #333;\n" +
+ "}\n" +
+ "\n" +
+ ".ace-tm .ace_print_margin {\n" +
+ " width: 1px;\n" +
+ " background: #e8e8e8;\n" +
+ "}\n" +
+ "\n" +
+ ".ace-tm .ace_fold {\n" +
+ " background-color: #6B72E6;\n" +
+ "}\n" +
+ "\n" +
+ ".ace-tm .ace_scroller {\n" +
+ " background-color: #FFFFFF;\n" +
+ "}\n" +
+ "\n" +
+ ".ace-tm .ace_cursor {\n" +
+ " border-left: 2px solid black;\n" +
+ "}\n" +
+ "\n" +
+ ".ace-tm .ace_cursor.ace_overwrite {\n" +
+ " border-left: 0px;\n" +
+ " border-bottom: 1px solid black;\n" +
+ "}\n" +
+ " \n" +
+ ".ace-tm .ace_line .ace_invisible {\n" +
+ " color: rgb(191, 191, 191);\n" +
+ "}\n" +
+ "\n" +
+ ".ace-tm .ace_line .ace_storage,\n" +
+ ".ace-tm .ace_line .ace_keyword {\n" +
+ " color: blue;\n" +
+ "}\n" +
+ "\n" +
+ ".ace-tm .ace_line .ace_constant {\n" +
+ " color: rgb(197, 6, 11);\n" +
+ "}\n" +
+ "\n" +
+ ".ace-tm .ace_line .ace_constant.ace_buildin {\n" +
+ " color: rgb(88, 72, 246);\n" +
+ "}\n" +
+ "\n" +
+ ".ace-tm .ace_line .ace_constant.ace_language {\n" +
+ " color: rgb(88, 92, 246);\n" +
+ "}\n" +
+ "\n" +
+ ".ace-tm .ace_line .ace_constant.ace_library {\n" +
+ " color: rgb(6, 150, 14);\n" +
+ "}\n" +
+ "\n" +
+ ".ace-tm .ace_line .ace_invalid {\n" +
+ " background-color: rgba(255, 0, 0, 0.1);\n" +
+ " color: red;\n" +
+ "}\n" +
+ "\n" +
+ ".ace-tm .ace_line .ace_support.ace_function {\n" +
+ " color: rgb(60, 76, 114);\n" +
+ "}\n" +
+ "\n" +
+ ".ace-tm .ace_line .ace_support.ace_constant {\n" +
+ " color: rgb(6, 150, 14);\n" +
+ "}\n" +
+ "\n" +
+ ".ace-tm .ace_line .ace_support.ace_type,\n" +
+ ".ace-tm .ace_line .ace_support.ace_class {\n" +
+ " color: rgb(109, 121, 222);\n" +
+ "}\n" +
+ "\n" +
+ ".ace-tm .ace_line .ace_keyword.ace_operator {\n" +
+ " color: rgb(104, 118, 135);\n" +
+ "}\n" +
+ "\n" +
+ ".ace-tm .ace_line .ace_string {\n" +
+ " color: rgb(3, 106, 7);\n" +
+ "}\n" +
+ "\n" +
+ ".ace-tm .ace_line .ace_comment {\n" +
+ " color: rgb(76, 136, 107);\n" +
+ "}\n" +
+ "\n" +
+ ".ace-tm .ace_line .ace_comment.ace_doc {\n" +
+ " color: rgb(0, 102, 255);\n" +
+ "}\n" +
+ "\n" +
+ ".ace-tm .ace_line .ace_comment.ace_doc.ace_tag {\n" +
+ " color: rgb(128, 159, 191);\n" +
+ "}\n" +
+ "\n" +
+ ".ace-tm .ace_line .ace_constant.ace_numeric {\n" +
+ " color: rgb(0, 0, 205);\n" +
+ "}\n" +
+ "\n" +
+ ".ace-tm .ace_line .ace_variable {\n" +
+ " color: rgb(49, 132, 149);\n" +
+ "}\n" +
+ "\n" +
+ ".ace-tm .ace_line .ace_xml_pe {\n" +
+ " color: rgb(104, 104, 91);\n" +
+ "}\n" +
+ "\n" +
+ ".ace-tm .ace_entity.ace_name.ace_function {\n" +
+ " color: #0000A2;\n" +
+ "}\n" +
+ "\n" +
+ "\n" +
+ ".ace-tm .ace_markup.ace_heading {\n" +
+ " color: rgb(12, 7, 255);\n" +
+ "}\n" +
+ "\n" +
+ ".ace-tm .ace_markup.ace_list {\n" +
+ " color:rgb(185, 6, 144);\n" +
+ "}\n" +
+ "\n" +
+ ".ace-tm .ace_meta.ace_tag {\n" +
+ " color:rgb(0, 22, 142);\n" +
+ "}\n" +
+ "\n" +
+ ".ace-tm .ace_string.ace_regex {\n" +
+ " color: rgb(255, 0, 0)\n" +
+ "}\n" +
+ "\n" +
+ ".ace-tm .ace_marker-layer .ace_selection {\n" +
+ " background: rgb(181, 213, 255);\n" +
+ "}\n" +
+ ".ace-tm.multiselect .ace_selection.start {\n" +
+ " box-shadow: 0 0 3px 0px white;\n" +
+ " border-radius: 2px;\n" +
+ "}\n" +
+ ".ace-tm .ace_marker-layer .ace_step {\n" +
+ " background: rgb(252, 255, 0);\n" +
+ "}\n" +
+ "\n" +
+ ".ace-tm .ace_marker-layer .ace_stack {\n" +
+ " background: rgb(164, 229, 101);\n" +
+ "}\n" +
+ "\n" +
+ ".ace-tm .ace_marker-layer .ace_bracket {\n" +
+ " margin: -1px 0 0 -1px;\n" +
+ " border: 1px solid rgb(192, 192, 192);\n" +
+ "}\n" +
+ "\n" +
+ ".ace-tm .ace_marker-layer .ace_active_line {\n" +
+ " background: rgba(0, 0, 0, 0.07);\n" +
+ "}\n" +
+ "\n" +
+ ".ace-tm .ace_gutter_active_line {\n" +
+ " background-color : #dcdcdc;\n" +
+ "}\n" +
+ "\n" +
+ ".ace-tm .ace_marker-layer .ace_selected_word {\n" +
+ " background: rgb(250, 250, 255);\n" +
+ " border: 1px solid rgb(200, 200, 250);\n" +
+ "}\n" +
+ "\n" +
+ ".ace-tm .ace_indent-guide {\n" +
+ " background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==\") right repeat-y;\n" +
+ "}\n" +
+ "");
+
+;
+ (function() {
+ ace.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/vendor/assets/javascripts/ace-src-noconflict/keybinding-emacs.js b/vendor/assets/javascripts/ace-src-noconflict/keybinding-emacs.js
new file mode 100644
index 00000000000..ba53c7c5ff5
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/keybinding-emacs.js
@@ -0,0 +1,374 @@
+/* ***** 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 ***** */
+
+ace.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(pageX, pageY) {
+ var canvasPos = this.scroller.getBoundingClientRect();
+
+ var col = Math.floor(
+ (pageX + this.scrollLeft - canvasPos.left - this.$padding - dom.getPageScrollLeft()) / this.characterWidth
+ );
+ var row = Math.floor(
+ (pageY + this.scrollTop - canvasPos.top - dom.getPageScrollTop()) / this.lineHeight
+ );
+
+ return this.session.screenToDocumentPosition(row, col);
+};
+
+var HashHandler = require("./hash_handler").HashHandler;
+exports.handler = new HashHandler();
+
+var initialized = false;
+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;\
+ 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_cursor.ace_overwrite {\
+ 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'
+ );
+ }
+
+ editor.renderer.screenToTextCoordinates = screenToTextBlockCoordinates;
+ editor.setStyle("emacs-mode");
+};
+
+exports.handler.detach = function(editor) {
+ delete editor.renderer.screenToTextCoordinates;
+ editor.unsetStyle("emacs-mode");
+};
+
+
+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) {
+ 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 (typeof command == "string") {
+ 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 = {
+ // movement
+ "Up|C-p" : "golineup",
+ "Down|C-n" : "golinedown",
+ "Left|C-b" : "gotoleft",
+ "Right|C-f" : "gotoright",
+ "C-Left|M-b" : "gotowordleft",
+ "C-Right|M-f" : "gotowordright",
+ "Home|C-a" : "gotolinestart",
+ "End|C-e" : "gotolineend",
+ "C-Home|S-M-,": "gotostart",
+ "C-End|S-M-." : "gotoend",
+
+ // selection
+ "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",
+
+ // todo fix these
+ "C-Down": "gotopagedown",
+ "C-Up": "gotopageup",
+ "PageDown|C-v": "gotopagedown",
+ "PageUp|M-v": "gotopageup",
+ "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",
+
+ // basic editing
+ "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",
+ "M-l": "tolowercase",
+ "M-/": "autocomplete",
+ "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?
+ // vertical editing
+ "C-x r": "selectRectangularRegion"
+
+ // todo
+ // "M-x" "C-x C-t" "M-t" "M-c" "F11" "C-M- "M-q"
+};
+
+
+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() {
+ },
+ 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) {
+ editor.selection.selectLine();
+ 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/vendor/assets/javascripts/ace-src-noconflict/keybinding-vim.js b/vendor/assets/javascripts/ace-src-noconflict/keybinding-vim.js
new file mode 100644
index 00000000000..88ebc4e7c31
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/keybinding-vim.js
@@ -0,0 +1,1679 @@
+/* ***** 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 ***** */
+
+ace.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 = {
+ // workaround for j not repeating with `defaults write -g ApplePressAndHoldEnabled -bool true`
+ handleMacRepeat: function(data, hashId, key) {
+ if (hashId == -1) {
+ // record key
+ data.inputChar = key;
+ data.lastEvent = "input";
+ } else if (data.inputChar && data.$lastHash == hashId && data.$lastKey == key) {
+ // check for repeated keypress
+ if (data.lastEvent == "input") {
+ data.lastEvent = "input1";
+ } else if (data.lastEvent == "input1") {
+ // simulate textinput
+ return true;
+ }
+ } else {
+ // reset
+ data.$lastHash = hashId;
+ data.$lastKey = key;
+ data.lastEvent = "keypress";
+ }
+ },
+
+ handleKeyboard: function(data, hashId, key, keyCode, e) {
+ // ignore command keys (shift, ctrl etc.)
+ 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) {
+ if (cmds.inputBuffer.idle && startCommands[key])
+ return startCommands[key];
+ return {
+ command: {
+ exec: function(editor) {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;
+};
+
+});
+
+ace.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.alignCursor(null, 0.5);
+ break;
+ case "t":
+ editor.alignCursor(null, 0);
+ break;
+ case "b":
+ editor.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);
+ }
+ },
+ "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) {
+ //editor.selection.selectLine();
+ //editor.selection.selectLeft();
+ 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) {
+ // not implemented
+ }
+ },
+ "/": {
+ fn: function(editor, range, count, param) {
+ // not implemented
+ }
+ },
+ "?": {
+ fn: function(editor, range, count, param) {
+ // not implemented
+ }
+ },
+ ".": {
+ 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);
+ }
+ }
+};
+
+var inputBuffer = exports.inputBuffer = {
+ accepting: [NUMBER, OPERATOR, MOTION, ACTION],
+ currentCmd: null,
+ //currentMode: 0,
+ currentCount: "",
+ status: "",
+
+ // Types
+ operator: null,
+ motion: null,
+
+ lastInsertCommands: [],
+
+ push: function(editor, char, keyId) {
+ this.idle = false;
+ var wObj = this.waitingForParam;
+ if (wObj) {
+ this.exec(editor, wObj, char);
+ }
+ // If input is a number (that doesn't start with 0)
+ else if (!(char === "0" && !this.currentCount.length) &&
+ (char.match(/^\d+$/) && this.isAccepting(NUMBER))) {
+ // Assuming that char is always of type String, and not Number
+ this.currentCount += char;
+ this.currentCmd = NUMBER;
+ this.accepting = [NUMBER, OPERATOR, MOTION, ACTION];
+ }
+ else if (!this.operator && this.isAccepting(OPERATOR) && operators[char]) {
+ this.operator = {
+ char: char,
+ count: this.getCount()
+ };
+ this.currentCmd = OPERATOR;
+ this.accepting = [NUMBER, MOTION, ACTION];
+ this.exec(editor, { operator: this.operator });
+ }
+ else if (motions[char] && this.isAccepting(MOTION)) {
+ this.currentCmd = MOTION;
+
+ var ctx = {
+ operator: this.operator,
+ motion: {
+ char: char,
+ count: this.getCount()
+ }
+ };
+
+ if (motions[char].param)
+ this.waitForParam(ctx);
+ else
+ this.exec(editor, ctx);
+ }
+ else if (alias[char] && this.isAccepting(MOTION)) {
+ alias[char].operator.count = this.getCount();
+ this.exec(editor, alias[char]);
+ }
+ else if (actions[char] && this.isAccepting(ACTION)) {
+ var actionObj = {
+ action: {
+ fn: actions[char].fn,
+ count: this.getCount()
+ }
+ };
+
+ if (actions[char].param) {
+ this.waitForParam(actionObj);
+ }
+ else {
+ this.exec(editor, actionObj);
+ }
+
+ if (actions[char].acceptsMotion)
+ this.idle = false;
+ }
+ else if (this.operator) {
+ this.exec(editor, { operator: this.operator }, char);
+ }
+ else {
+ this.reset();
+ }
+
+ if (this.waitingForParam || this.motion || this.operator) {
+ this.status += char;
+ } else if (this.currentCount) {
+ this.status = this.currentCount;
+ } else if (this.status) {
+ this.status = "";
+ } else {
+ return;
+ }
+ editor._emit("changeStatus");
+ },
+
+ 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.char].selFn) {
+ operators[o.char].selFn(editor, editor.getSelectionRange(), o.count, param);
+ this.reset();
+ }
+ return;
+ }
+
+ // There is an operator, but no motion or action. We try to pass the
+ // current char to the operator to see if it responds to it (an example
+ // of this is the 'dd' operator).
+ else if (!m && !a && o && param) {
+ operators[o.char].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.char];
+ 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.char].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 Insert mode as soon as possible. Works like typing <Esc> in
+ // insert mode.
+ 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;
+ }
+};
+});
+ace.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';
+ // Switch editor to insert mode
+ 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) {
+ // Ok, we're apparently replaying ("."), so let's do it
+ editor.commands.macro = this.onInsertReplaySequence;
+ editor.commands.replay(editor);
+ this.onInsertReplaySequence = null;
+ this.normalMode(editor);
+ } else {
+ editor._emit("changeStatus");
+ // Record any movements, insertions in insert mode
+ if(!editor.commands.recording)
+ editor.commands.toggleRecording(editor);
+ }
+ },
+ normalMode: function(editor) {
+ // Switch editor to normal mode
+ 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");
+ // Save recorded keystrokes
+ 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, char, n) {
+ var line = editor.getSession().getLine(cursor.row);
+ var matches = line.substr(cursor.column + 1).split(char);
+
+ return n < matches.length ? matches.slice(0, n).join(char).length : null;
+ },
+ getLeftNthChar: function(editor, cursor, char, n) {
+ var line = editor.getSession().getLine(cursor.row);
+ var matches = line.substr(0, cursor.column).split(char);
+
+ return n < matches.length ? matches.slice(-1 * n).join(char).length : null;
+ },
+ toRealChar: function(char) {
+ if (char.length === 1)
+ return char;
+
+ if (/^shift-./.test(char))
+ return char[char.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);
+ }
+};
+});
+
+ace.define('ace/keyboard/vim/registers', ['require', 'exports', 'module' ], function(require, exports, module) {
+
+"never use strict";
+
+module.exports = {
+ _default: {
+ text: "",
+ isLine: false
+ }
+};
+
+});
+
+"use strict"
+
+ace.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(getRange, type){
+ if (type == 'extend')
+ var extend = true;
+ else
+ var reverse = type;
+
+ this.nav = function(editor) {
+ var r = getRange(editor);
+ if (!r)
+ return;
+ if (!r.end)
+ var a = r;
+ else if (reverse)
+ var a = r.start;
+ else
+ var a = r.end;
+
+ editor.clearSelection();
+ editor.moveCursorTo(a.row, a.column);
+ }
+ this.sel = function(editor){
+ var r = getRange(editor);
+ if (!r)
+ return;
+ if (extend)
+ return editor.selection.setSelectionRange(r);
+
+ if (!r.end)
+ var a = r;
+ else if (reverse)
+ var a = r.start;
+ else
+ var a = r.end;
+
+ editor.selection.selectTo(a.row, a.column);
+ }
+}
+
+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);
+ //this.debug()
+ return this.ch;
+ }
+ this.prev = function() {
+ this.ch = line[--this.col] || this.handleNewLine(-1);
+ //this.debug()
+ 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("ace/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("ace/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};
+ }, true),
+ "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) {
+ editor.navigateRight();
+ },
+ sel: function(editor) {
+ var pos = editor.getCursorPosition();
+ var col = pos.column;
+ var lineLen = editor.session.getLine(pos.row).length;
+
+ // Solving the behavior at the end of the line due to the
+ // different 0 index-based colum positions in ACE.
+ 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": {
+ param: true,
+ handlesCount: true,
+ nav: function(editor, range, count, param) {
+ var ed = editor;
+ var cursor = ed.getCursorPosition();
+ var column = util.getRightNthChar(editor, cursor, param, count || 1);
+
+ if (typeof column === "number") {
+ ed.selection.clearSelection(); // Why does it select in the first place?
+ ed.moveCursorTo(cursor.row, column + cursor.column + 1);
+ }
+ },
+ sel: function(editor, range, count, param) {
+ var ed = editor;
+ var cursor = ed.getCursorPosition();
+ var column = util.getRightNthChar(editor, cursor, param, count || 1);
+
+ if (typeof column === "number") {
+ ed.moveCursorTo(cursor.row, column + cursor.column + 1);
+ }
+ }
+ },
+ "F": {
+ param: true,
+ handlesCount: true,
+ nav: function(editor, range, count, param) {
+ var ed = editor;
+ var cursor = ed.getCursorPosition();
+ var column = util.getLeftNthChar(editor, cursor, param, count || 1);
+
+ if (typeof column === "number") {
+ ed.selection.clearSelection(); // Why does it select in the first place?
+ ed.moveCursorTo(cursor.row, cursor.column - column - 1);
+ }
+ },
+ sel: function(editor, range, count, param) {
+ var ed = editor;
+ var cursor = ed.getCursorPosition();
+ var column = util.getLeftNthChar(editor, cursor, param, count || 1);
+
+ if (typeof column === "number") {
+ ed.moveCursorTo(cursor.row, cursor.column - column - 1);
+ }
+ }
+ },
+ "t": {
+ param: true,
+ handlesCount: true,
+ nav: function(editor, range, count, param) {
+ var ed = editor;
+ var cursor = ed.getCursorPosition();
+ var column = util.getRightNthChar(editor, cursor, param, count || 1);
+
+ if (typeof column === "number") {
+ ed.selection.clearSelection(); // Why does it select in the first place?
+ ed.moveCursorTo(cursor.row, column + cursor.column);
+ }
+ },
+ sel: function(editor, range, count, param) {
+ var ed = editor;
+ var cursor = ed.getCursorPosition();
+ var column = util.getRightNthChar(editor, cursor, param, count || 1);
+
+ if (typeof column === "number") {
+ ed.moveCursorTo(cursor.row, column + cursor.column);
+ }
+ }
+ },
+ "T": {
+ param: true,
+ handlesCount: true,
+ nav: function(editor, range, count, param) {
+ var ed = editor;
+ var cursor = ed.getCursorPosition();
+ var column = util.getLeftNthChar(editor, cursor, param, count || 1);
+
+ if (typeof column === "number") {
+ ed.selection.clearSelection(); // Why does it select in the first place?
+ ed.moveCursorTo(cursor.row, -column + cursor.column);
+ }
+ },
+ sel: function(editor, range, count, param) {
+ var ed = editor;
+ var cursor = ed.getCursorPosition();
+ var column = util.getLeftNthChar(editor, cursor, param, count || 1);
+
+ if (typeof column === "number") {
+ ed.moveCursorTo(cursor.row, -column + cursor.column);
+ }
+ }
+ },
+
+ "^": {
+ 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);
+ }
+ },
+};
+
+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"];
+
+});
+
+ace.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();
+ // check if end of the document was reached
+ 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) {
+
+ // range.end.column ++;
+ 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"
+
+ace.define('ace/keyboard/vim/maps/aliases', ['require', 'exports', 'module' ], function(require, exports, module) {
+module.exports = {
+ "x": {
+ operator: {
+ char: "d",
+ count: 1
+ },
+ motion: {
+ char: "l",
+ count: 1
+ }
+ },
+ "X": {
+ operator: {
+ char: "d",
+ count: 1
+ },
+ motion: {
+ char: "h",
+ count: 1
+ }
+ },
+ "D": {
+ operator: {
+ char: "d",
+ count: 1
+ },
+ motion: {
+ char: "$",
+ count: 1
+ }
+ },
+ "C": {
+ operator: {
+ char: "c",
+ count: 1
+ },
+ motion: {
+ char: "$",
+ count: 1
+ }
+ },
+ "s": {
+ operator: {
+ char: "c",
+ count: 1
+ },
+ motion: {
+ char: "l",
+ count: 1
+ }
+ },
+ "S": {
+ operator: {
+ char: "c",
+ count: 1
+ },
+ param: "c"
+ }
+};
+});
+
diff --git a/vendor/assets/javascripts/ace-src-noconflict/mode-c9search.js b/vendor/assets/javascripts/ace-src-noconflict/mode-c9search.js
new file mode 100644
index 00000000000..9f8401b7531
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/mode-c9search.js
@@ -0,0 +1,268 @@
+/* ***** 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 ***** */
+
+ace.define('ace/mode/c9search', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/c9search_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/mode/folding/c9search'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var TextMode = require("./text").Mode;
+var Tokenizer = require("../tokenizer").Tokenizer;
+var C9SearchHighlightRules = require("./c9search_highlight_rules").C9SearchHighlightRules;
+var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
+var C9StyleFoldMode = require("./folding/c9search").FoldMode;
+
+var Mode = function() {
+ this.$tokenizer = new Tokenizer(new C9SearchHighlightRules().getRules(), "i");
+ this.$outdent = new MatchingBraceOutdent();
+ this.foldingRules = new C9StyleFoldMode();
+};
+oop.inherits(Mode, TextMode);
+
+(function() {
+
+ this.getNextLineIndent = function(state, line, tab) {
+ var indent = this.$getIndent(line);
+ 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;
+
+});
+
+ace.define('ace/mode/c9search_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 C9SearchHighlightRules = function() {
+
+ // regexp must not have capturing parentheses. Use (?:) instead.
+ // regexps are ordered -> the first match is used
+ this.$rules = {
+ "start" : [
+ {
+ token : ["c9searchresults.constant.numeric", "c9searchresults.text", "c9searchresults.text"],
+ regex : "(^\\s+[0-9]+)(:\\s*)(.+)"
+ },
+ {
+ token : ["string", "text"], // single line
+ regex : "(.+)(:$)"
+ }
+ ]
+ };
+};
+
+oop.inherits(C9SearchHighlightRules, TextHighlightRules);
+
+exports.C9SearchHighlightRules = C9SearchHighlightRules;
+
+});
+
+ace.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;
+});
+
+
+ace.define('ace/mode/folding/c9search', ['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.*\:|Searching for.*)$/;
+ this.foldingStopMarker = /^(\s+|Found.*)$/;
+
+ this.getFoldWidgetRange = function(session, foldStyle, row) {
+ var lines = session.doc.getAllLines(row);
+ var line = lines[row];
+ var level1 = /^(Found.*|Searching for.*)$/;
+ var level2 = /^(\S.*\:|\s*)$/;
+ var re = level1.test(line) ? level1 : level2;
+
+ if (this.foldingStartMarker.test(line)) {
+ for (var i = row + 1, l = session.getLength(); i < l; i++) {
+ if (re.test(lines[i]))
+ break;
+ }
+
+ return new Range(row, line.length, i, 0);
+ }
+
+ if (this.foldingStopMarker.test(line)) {
+ for (var i = row - 1; i >= 0; i--) {
+ line = lines[i];
+ if (re.test(line))
+ break;
+ }
+
+ return new Range(i, line.length, row, 0);
+ }
+ };
+
+}).call(FoldMode.prototype);
+
+});
+
+ace.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;
+
+ // must return "" if there's no fold, to enable caching
+ 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);
+ };
+
+}).call(FoldMode.prototype);
+
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/mode-c_cpp.js b/vendor/assets/javascripts/ace-src-noconflict/mode-c_cpp.js
new file mode 100644
index 00000000000..4b128fa40b2
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/mode-c_cpp.js
@@ -0,0 +1,759 @@
+/* ***** 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 ***** */
+
+ace.define('ace/mode/c_cpp', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/c_cpp_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var TextMode = require("./text").Mode;
+var Tokenizer = require("../tokenizer").Tokenizer;
+var c_cppHighlightRules = require("./c_cpp_highlight_rules").c_cppHighlightRules;
+var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
+var Range = require("../range").Range;
+var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
+var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+
+var Mode = function() {
+ this.$tokenizer = new Tokenizer(new c_cppHighlightRules().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") {
+ var match = line.match(/^.*[\{\(\[]\s*$/);
+ if (match) {
+ indent += tab;
+ }
+ } else if (state == "doc-start") {
+ if (endState == "start") {
+ 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);
+ };
+
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+});
+
+ace.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;
+
+// used by objective-c
+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.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";
+
+ // regexp must not have capturing parentheses. Use (?:) instead.
+ // regexps are ordered -> the first match is used
+
+ this.$rules = {
+ "start" : [
+ {
+ token : "comment",
+ regex : "\\/\\/.*$"
+ },
+ DocCommentHighlightRules.getStartRule("doc-start"),
+ {
+ token : "comment", // multi line comment
+ merge : true,
+ regex : "\\/\\*",
+ next : "comment"
+ }, {
+ token : "string", // single line
+ regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
+ }, {
+ token : "string", // multi line string start
+ merge : true,
+ regex : '["].*\\\\$',
+ next : "qqstring"
+ }, {
+ token : "string", // single line
+ regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
+ }, {
+ token : "string", // multi line string start
+ merge : true,
+ 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 : "constant", // <CONSTANT>
+ regex : "<[a-zA-Z0-9.]+>"
+ }, {
+ token : "keyword", // pre-compiler directivs
+ regex : "(?:#include|#pragma|#line|#define|#undef|#ifdef|#else|#elif|#endif|#ifndef)"
+ }, {
+ token : "support.function.C99.c",
+ regex : cFunctions
+ }, {
+ // function myFunc(arg) { }
+ token : [
+ "text", "entity.name.function", "text", "paren.lparen"
+ ],
+ regex : "(\\s+)(" + identifierRe + ")(\\s*)(\\()"
+ }, {
+ 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
+ merge : true,
+ regex : ".+"
+ }
+ ],
+ "qqstring" : [
+ {
+ token : "string",
+ regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"',
+ next : "start"
+ }, {
+ token : "string",
+ merge : true,
+ regex : '.+'
+ }
+ ],
+ "qstring" : [
+ {
+ token : "string",
+ regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'",
+ next : "start"
+ }, {
+ token : "string",
+ merge : true,
+ regex : '.+'
+ }
+ ]
+ };
+
+ this.embedRules(DocCommentHighlightRules, "doc-",
+ [ DocCommentHighlightRules.getEndRule("start") ]);
+};
+
+oop.inherits(c_cppHighlightRules, TextHighlightRules);
+
+exports.c_cppHighlightRules = c_cppHighlightRules;
+});
+
+ace.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",
+ merge : true,
+ regex : "\\s+"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "TODO"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "[^@\\*]+"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "."
+ }]
+ };
+};
+
+oop.inherits(DocCommentHighlightRules, TextHighlightRules);
+
+DocCommentHighlightRules.getStartRule = function(start) {
+ return {
+ token : "comment.doc", // doc comment
+ merge : true,
+ regex : "\\/\\*(?=\\*)",
+ next : start
+ };
+};
+
+DocCommentHighlightRules.getEndRule = function (start) {
+ return {
+ token : "comment.doc", // closing comment
+ merge : true,
+ regex : "\\*\\/",
+ next : start
+ };
+};
+
+
+exports.DocCommentHighlightRules = DocCommentHighlightRules;
+
+});
+
+ace.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;
+});
+
+ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour'], function(require, exports, module) {
+
+
+var oop = require("../../lib/oop");
+var Behaviour = require("../behaviour").Behaviour;
+
+var CstyleBehaviour = function () {
+
+ this.add("braces", "insertion", function (state, action, editor, session, text) {
+ if (text == '{') {
+ var selection = editor.getSelectionRange();
+ var selected = session.doc.getTextRange(selection);
+ if (selected !== "") {
+ return {
+ text: '{' + selected + '}',
+ selection: false
+ };
+ } else {
+ 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) {
+ return {
+ text: '',
+ selection: [1, 1]
+ };
+ }
+ }
+ } else if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ if (rightChar == '}') {
+ var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column + 1});
+ if (!openBracePos)
+ return null;
+
+ var indent = this.getNextLineIndent(state, line.substring(0, line.length - 1), session.getTabString());
+ var next_indent = this.$getIndent(session.doc.getLine(openBracePos.row));
+
+ return {
+ text: '\n' + indent + '\n' + next_indent,
+ 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;
+ }
+ }
+ });
+
+ this.add("parens", "insertion", function (state, action, editor, session, text) {
+ if (text == '(') {
+ var selection = editor.getSelectionRange();
+ var selected = session.doc.getTextRange(selection);
+ if (selected !== "") {
+ return {
+ text: '(' + selected + ')',
+ selection: false
+ };
+ } else {
+ 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) {
+ 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 !== "") {
+ return {
+ text: '[' + selected + ']',
+ selection: false
+ };
+ } else {
+ 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) {
+ 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 !== "") {
+ 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);
+
+ // We're escaped.
+ if (leftChar == '\\') {
+ return null;
+ }
+
+ // Find what token we're inside.
+ 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;
+ }
+
+ // Try and be smart about when we auto insert.
+ 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)))) {
+ return {
+ text: quote + quote,
+ selection: [1,1]
+ };
+ } else if (token && token.type === "string") {
+ // Ignore input and move right one if we're typing over the closing quote.
+ 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 == '"') {
+ range.end.column++;
+ return range;
+ }
+ }
+ });
+
+};
+
+oop.inherits(CstyleBehaviour, Behaviour);
+
+exports.CstyleBehaviour = CstyleBehaviour;
+});
+
+ace.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);
+
+ var range = session.getCommentFoldRange(row, i + match[0].length);
+ range.end.column -= 2;
+ return range;
+ }
+
+ if (foldStyle !== "markbeginend")
+ return;
+
+ var match = line.match(this.foldingStopMarker);
+ if (match) {
+ var i = match.index + match[0].length;
+
+ if (match[2]) {
+ var range = session.getCommentFoldRange(row, i);
+ range.end.column -= 2;
+ return range;
+ }
+
+ var end = {row: row, column: i};
+ var start = session.$findOpeningBracket(match[1], end);
+
+ if (!start)
+ return;
+
+ start.column++;
+ end.column--;
+
+ return Range.fromPoints(start, end);
+ }
+ };
+
+}).call(FoldMode.prototype);
+
+});
+
+ace.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;
+
+ // must return "" if there's no fold, to enable caching
+ 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);
+ };
+
+}).call(FoldMode.prototype);
+
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/mode-clojure.js b/vendor/assets/javascripts/ace-src-noconflict/mode-clojure.js
new file mode 100644
index 00000000000..6aa6fd717cf
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/mode-clojure.js
@@ -0,0 +1,347 @@
+/* ***** 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 ***** */
+
+ace.define('ace/mode/clojure', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/clojure_highlight_rules', 'ace/mode/matching_parens_outdent', 'ace/range'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var TextMode = require("./text").Mode;
+var Tokenizer = require("../tokenizer").Tokenizer;
+var ClojureHighlightRules = require("./clojure_highlight_rules").ClojureHighlightRules;
+var MatchingParensOutdent = require("./matching_parens_outdent").MatchingParensOutdent;
+var Range = require("../range").Range;
+
+var Mode = function() {
+ this.$tokenizer = new Tokenizer(new ClojureHighlightRules().getRules());
+ this.$outdent = new MatchingParensOutdent();
+};
+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;
+
+ if (tokens.length && tokens[tokens.length-1].type == "comment") {
+ return indent;
+ }
+
+ if (state == "start") {
+ var match = line.match(/[\(\[]/);
+ if (match) {
+ indent += " ";
+ }
+ match = line.match(/[\)]/);
+ if (match) {
+ 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);
+ };
+
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+});
+
+ace.define('ace/mode/clojure_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 ClojureHighlightRules = function() {
+
+ var builtinFunctions = (
+ '* *1 *2 *3 *agent* *allow-unresolved-vars* *assert* *clojure-version* ' +
+ '*command-line-args* *compile-files* *compile-path* *e *err* *file* ' +
+ '*flush-on-newline* *in* *macro-meta* *math-context* *ns* *out* ' +
+ '*print-dup* *print-length* *print-level* *print-meta* *print-readably* ' +
+ '*read-eval* *source-path* *use-context-classloader* ' +
+ '*warn-on-reflection* + - -> ->> .. / < <= = ' +
+ '== > &gt; >= &gt;= accessor aclone ' +
+ 'add-classpath add-watch agent agent-errors aget alength alias all-ns ' +
+ 'alter alter-meta! alter-var-root amap ancestors and apply areduce ' +
+ 'array-map aset aset-boolean aset-byte aset-char aset-double aset-float ' +
+ 'aset-int aset-long aset-short assert assoc assoc! assoc-in associative? ' +
+ 'atom await await-for await1 bases bean bigdec bigint binding bit-and ' +
+ 'bit-and-not bit-clear bit-flip bit-not bit-or bit-set bit-shift-left ' +
+ 'bit-shift-right bit-test bit-xor boolean boolean-array booleans ' +
+ 'bound-fn bound-fn* butlast byte byte-array bytes cast char char-array ' +
+ 'char-escape-string char-name-string char? chars chunk chunk-append ' +
+ 'chunk-buffer chunk-cons chunk-first chunk-next chunk-rest chunked-seq? ' +
+ 'class class? clear-agent-errors clojure-version coll? comment commute ' +
+ 'comp comparator compare compare-and-set! compile complement concat cond ' +
+ 'condp conj conj! cons constantly construct-proxy contains? count ' +
+ 'counted? create-ns create-struct cycle dec decimal? declare definline ' +
+ 'defmacro defmethod defmulti defn defn- defonce defstruct delay delay? ' +
+ 'deliver deref derive descendants destructure disj disj! dissoc dissoc! ' +
+ 'distinct distinct? doall doc dorun doseq dosync dotimes doto double ' +
+ 'double-array doubles drop drop-last drop-while empty empty? ensure ' +
+ 'enumeration-seq eval even? every? false? ffirst file-seq filter find ' +
+ 'find-doc find-ns find-var first float float-array float? floats flush ' +
+ 'fn fn? fnext for force format future future-call future-cancel ' +
+ 'future-cancelled? future-done? future? gen-class gen-interface gensym ' +
+ 'get get-in get-method get-proxy-class get-thread-bindings get-validator ' +
+ 'hash hash-map hash-set identical? identity if-let if-not ifn? import ' +
+ 'in-ns inc init-proxy instance? int int-array integer? interleave intern ' +
+ 'interpose into into-array ints io! isa? iterate iterator-seq juxt key ' +
+ 'keys keyword keyword? last lazy-cat lazy-seq let letfn line-seq list ' +
+ 'list* list? load load-file load-reader load-string loaded-libs locking ' +
+ 'long long-array longs loop macroexpand macroexpand-1 make-array ' +
+ 'make-hierarchy map map? mapcat max max-key memfn memoize merge ' +
+ 'merge-with meta method-sig methods min min-key mod name namespace neg? ' +
+ 'newline next nfirst nil? nnext not not-any? not-empty not-every? not= ' +
+ 'ns ns-aliases ns-imports ns-interns ns-map ns-name ns-publics ' +
+ 'ns-refers ns-resolve ns-unalias ns-unmap nth nthnext num number? odd? ' +
+ 'or parents partial partition pcalls peek persistent! pmap pop pop! ' +
+ 'pop-thread-bindings pos? pr pr-str prefer-method prefers ' +
+ 'primitives-classnames print print-ctor print-doc print-dup print-method ' +
+ 'print-namespace-doc print-simple print-special-doc print-str printf ' +
+ 'println println-str prn prn-str promise proxy proxy-call-with-super ' +
+ 'proxy-mappings proxy-name proxy-super push-thread-bindings pvalues quot ' +
+ 'rand rand-int range ratio? rational? rationalize re-find re-groups ' +
+ 're-matcher re-matches re-pattern re-seq read read-line read-string ' +
+ 'reduce ref ref-history-count ref-max-history ref-min-history ref-set ' +
+ 'refer refer-clojure release-pending-sends rem remove remove-method ' +
+ 'remove-ns remove-watch repeat repeatedly replace replicate require ' +
+ 'reset! reset-meta! resolve rest resultset-seq reverse reversible? rseq ' +
+ 'rsubseq second select-keys send send-off seq seq? seque sequence ' +
+ 'sequential? set set-validator! set? short short-array shorts ' +
+ 'shutdown-agents slurp some sort sort-by sorted-map sorted-map-by ' +
+ 'sorted-set sorted-set-by sorted? special-form-anchor special-symbol? ' +
+ 'split-at split-with str stream? string? struct struct-map subs subseq ' +
+ 'subvec supers swap! symbol symbol? sync syntax-symbol-anchor take ' +
+ 'take-last take-nth take-while test the-ns time to-array to-array-2d ' +
+ 'trampoline transient tree-seq true? type unchecked-add unchecked-dec ' +
+ 'unchecked-divide unchecked-inc unchecked-multiply unchecked-negate ' +
+ 'unchecked-remainder unchecked-subtract underive unquote ' +
+ 'unquote-splicing update-in update-proxy use val vals var-get var-set ' +
+ 'var? vary-meta vec vector vector? when when-first when-let when-not ' +
+ 'while with-bindings with-bindings* with-in-str with-loading-context ' +
+ 'with-local-vars with-meta with-open with-out-str with-precision xml-seq ' +
+ 'zero? zipmap'
+ );
+
+ var keywords = ('throw try var ' +
+ 'def do fn if let loop monitor-enter monitor-exit new quote recur set!'
+ );
+
+ var buildinConstants = ("true false nil");
+
+ var keywordMapper = this.createKeywordMapper({
+ "keyword": keywords,
+ "constant.language": buildinConstants,
+ "support.function": builtinFunctions
+ }, "identifier", false, " ");
+
+ // regexp must not have capturing parentheses. Use (?:) instead.
+ // regexps are ordered -> the first match is used
+
+ this.$rules = {
+ "start" : [
+ {
+ token : "comment",
+ regex : ";.*$"
+ }, {
+ token : "comment", // multi line comment
+ regex : "^=begin$",
+ next : "comment"
+ }, {
+ token : "keyword", //parens
+ regex : "[\\(|\\)]"
+ }, {
+ token : "keyword", //lists
+ regex : "[\\'\\(]"
+ }, {
+ token : "keyword", //vectors
+ regex : "[\\[|\\]]"
+ }, {
+ token : "keyword", //sets and maps
+ regex : "[\\{|\\}|\\#\\{|\\#\\}]"
+ }, {
+ token : "keyword", // ampersands
+ regex : '[\\&]'
+ }, {
+ token : "keyword", // metadata
+ regex : '[\\#\\^\\{]'
+ }, {
+ token : "keyword", // anonymous fn syntactic sugar
+ regex : '[\\%]'
+ }, {
+ token : "keyword", // deref reader macro
+ 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",
+ regex : '[!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+||=|!=|<=|>=|<>|<|>|!|&&]'
+ }, {
+ token : keywordMapper,
+ // TODO: Unicode escape sequences
+ // TODO: Unicode identifiers
+ regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
+ }, {
+ token : "string", // single line
+ regex : '"',
+ next: "string"
+ }, {
+ token : "string", // symbol
+ regex : "[:](?:[a-zA-Z]|\\d)+"
+ }, {
+ token : "string.regexp", //Regular Expressions
+ regex : '/#"(?:\\.|(?:\\\")|[^\""\n])*"/g'
+ }
+
+ ],
+ "comment" : [
+ {
+ token : "comment", // closing comment
+ regex : "^=end$",
+ next : "start"
+ }, {
+ token : "comment", // comment spanning whole line
+ merge : true,
+ regex : ".+"
+ }
+ ],
+ "string" : [
+ {
+ token : "constant.language.escape",
+ merge : true,
+ regex : "\\\\.|\\\\$"
+ }, {
+ token : "string",
+ merge : true,
+ regex : '[^"\\\\]+'
+ }, {
+ token : "string",
+ regex : '"',
+ next : "start"
+ }
+ ]
+ };
+};
+
+oop.inherits(ClojureHighlightRules, TextHighlightRules);
+
+exports.ClojureHighlightRules = ClojureHighlightRules;
+});
+
+ace.define('ace/mode/matching_parens_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
+
+
+var Range = require("../range").Range;
+
+var MatchingParensOutdent = 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(MatchingParensOutdent.prototype);
+
+exports.MatchingParensOutdent = MatchingParensOutdent;
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/mode-coffee.js b/vendor/assets/javascripts/ace-src-noconflict/mode-coffee.js
new file mode 100644
index 00000000000..b1d5e5f2b77
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/mode-coffee.js
@@ -0,0 +1,513 @@
+/* ***** 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 ***** */
+
+ace.define('ace/mode/coffee', ['require', 'exports', 'module' , 'ace/tokenizer', 'ace/mode/coffee_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/mode/folding/coffee', 'ace/range', 'ace/mode/text', 'ace/worker/worker_client', 'ace/lib/oop'], function(require, exports, module) {
+
+
+var Tokenizer = require("../tokenizer").Tokenizer;
+var Rules = require("./coffee_highlight_rules").CoffeeHighlightRules;
+var Outdent = require("./matching_brace_outdent").MatchingBraceOutdent;
+var FoldMode = require("./folding/coffee").FoldMode;
+var Range = require("../range").Range;
+var TextMode = require("./text").Mode;
+var WorkerClient = require("../worker/worker_client").WorkerClient;
+var oop = require("../lib/oop");
+
+function Mode() {
+ this.$tokenizer = new Tokenizer(new Rules().getRules());
+ this.$outdent = new Outdent();
+ this.foldingRules = new FoldMode();
+}
+
+oop.inherits(Mode, TextMode);
+
+(function() {
+
+ var indenter = /(?:[({[=:]|[-=]>|\b(?:else|switch|try|catch(?:\s*[$A-Za-z_\x7f-\uffff][$\w\x7f-\uffff]*)?|finally))\s*$/;
+ var commentLine = /^(\s*)#/;
+ var hereComment = /^\s*###(?!#)/;
+ var indentation = /^\s*/;
+
+ 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') &&
+ state === 'start' && indenter.test(line))
+ indent += tab;
+ return indent;
+ };
+
+ this.toggleCommentLines = function(state, doc, startRow, endRow){
+ console.log("toggle");
+ var range = new Range(0, 0, 0, 0);
+ for (var i = startRow; i <= endRow; ++i) {
+ var line = doc.getLine(i);
+ if (hereComment.test(line))
+ continue;
+
+ if (commentLine.test(line))
+ line = line.replace(commentLine, '$1');
+ else
+ line = line.replace(indentation, '$&#');
+
+ range.end.row = range.start.row = i;
+ range.end.column = line.length + 1;
+ doc.replace(range, line);
+ }
+ };
+
+ 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/coffee_worker", "Worker");
+ worker.attachToDocument(session.getDocument());
+
+ worker.on("error", function(e) {
+ session.setAnnotations([e.data]);
+ });
+
+ worker.on("ok", function(e) {
+ session.clearAnnotations();
+ });
+
+ return worker;
+ };
+
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+
+});
+
+ace.define('ace/mode/coffee_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;
+
+ oop.inherits(CoffeeHighlightRules, TextHighlightRules);
+
+ function CoffeeHighlightRules() {
+ var identifier = "[$A-Za-z_\\x7f-\\uffff][$\\w\\x7f-\\uffff]*";
+ var stringfill = {
+ token : "string",
+ merge : true,
+ regex : ".+"
+ };
+
+ var keywords = (
+ "this|throw|then|try|typeof|super|switch|return|break|by)|continue|" +
+ "catch|class|in|instanceof|is|isnt|if|else|extends|for|forown|" +
+ "finally|function|while|when|new|no|not|delete|debugger|do|loop|of|off|" +
+ "or|on|unless|until|and|yes"
+ );
+
+ var langConstant = (
+ "true|false|null|undefined"
+ );
+
+ var illegal = (
+ "case|const|default|function|var|void|with|enum|export|implements|" +
+ "interface|let|package|private|protected|public|static|yield|" +
+ "__hasProp|extends|slice|bind|indexOf"
+ );
+
+ var supportClass = (
+ "Array|Boolean|Date|Function|Number|Object|RegExp|ReferenceError|" +
+ "String|RangeError|SyntaxError|Error|EvalError|TypeError|URIError"
+ );
+
+ var supportFunction = (
+ "Math|JSON|isNaN|isFinite|parseInt|parseFloat|encodeURI|" +
+ "encodeURIComponent|decodeURI|decodeURIComponent|String|"
+ );
+
+ var keywordMapper = this.createKeywordMapper({
+ "keyword": keywords,
+ "constant.language": langConstant,
+ "invalid.illegal": illegal,
+ "language.support.class": supportClass,
+ "language.support.function": supportFunction,
+ }, "identifier");
+
+ this.$rules = {
+ start : [
+ {
+ token : "identifier",
+ regex : "(?:(?:\\.|::)\\s*)" + identifier
+ }, {
+ token : "variable",
+ regex : "@(?:" + identifier + ")?"
+ }, {
+ token: keywordMapper,
+ regex : identifier
+ }, {
+ token : "constant.numeric",
+ regex : "(?:0x[\\da-fA-F]+|(?:\\d+(?:\\.\\d+)?|\\.\\d+)(?:[eE][+-]?\\d+)?)"
+ }, {
+ token : "string",
+ merge : true,
+ regex : "'''",
+ next : "qdoc"
+ }, {
+ token : "string",
+ merge : true,
+ regex : '"""',
+ next : "qqdoc"
+ }, {
+ token : "string",
+ merge : true,
+ regex : "'",
+ next : "qstring"
+ }, {
+ token : "string",
+ merge : true,
+ regex : '"',
+ next : "qqstring"
+ }, {
+ token : "string",
+ merge : true,
+ regex : "`",
+ next : "js"
+ }, {
+ token : "string.regex",
+ merge : true,
+ regex : "///",
+ next : "heregex"
+ }, {
+ token : "string.regex",
+ regex : "/(?!\\s)[^[/\\n\\\\]*(?: (?:\\\\.|\\[[^\\]\\n\\\\]*(?:\\\\.[^\\]\\n\\\\]*)*\\])[^[/\\n\\\\]*)*/[imgy]{0,4}(?!\\w)"
+ }, {
+ token : "comment",
+ merge : true,
+ regex : "###(?!#)",
+ next : "comment"
+ }, {
+ token : "comment",
+ regex : "#.*"
+ }, {
+ token : "punctuation.operator",
+ regex : "\\?|\\:|\\,|\\."
+ }, {
+ token : "keyword.operator",
+ regex : "(?:[\\-=]>|[-+*/%<>&|^!?=]=|>>>=?|\\-\\-|\\+\\+|::|&&=|\\|\\|=|<<=|>>=|\\?\\.|\\.{2,3}|[!*+-=><])"
+ }, {
+ token : "paren.lparen",
+ regex : "[({[]"
+ }, {
+ token : "paren.rparen",
+ regex : "[\\]})]"
+ }, {
+ token : "text",
+ regex : "\\s+"
+ }],
+
+ qdoc : [{
+ token : "string",
+ regex : ".*?'''",
+ next : "start"
+ }, stringfill],
+
+ qqdoc : [{
+ token : "string",
+ regex : '.*?"""',
+ next : "start"
+ }, stringfill],
+
+ qstring : [{
+ token : "string",
+ regex : "[^\\\\']*(?:\\\\.[^\\\\']*)*'",
+ merge : true,
+ next : "start"
+ }, stringfill],
+
+ qqstring : [{
+ token : "string",
+ regex : '[^\\\\"]*(?:\\\\.[^\\\\"]*)*"',
+ merge : true,
+ next : "start"
+ }, stringfill],
+
+ js : [{
+ token : "string",
+ merge : true,
+ regex : "[^\\\\`]*(?:\\\\.[^\\\\`]*)*`",
+ next : "start"
+ }, stringfill],
+
+ heregex : [{
+ token : "string.regex",
+ regex : '.*?///[imgy]{0,4}',
+ next : "start"
+ }, {
+ token : "comment.regex",
+ regex : "\\s+(?:#.*)?"
+ }, {
+ token : "string.regex",
+ merge : true,
+ regex : "\\S+"
+ }],
+
+ comment : [{
+ token : "comment",
+ regex : '.*?###',
+ next : "start"
+ }, {
+ token : "comment",
+ merge : true,
+ regex : ".+"
+ }]
+ };
+ }
+
+ exports.CoffeeHighlightRules = CoffeeHighlightRules;
+});
+
+ace.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;
+});
+
+ace.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);
+ }
+ };
+
+ // must return "" if there's no fold, to enable caching
+ 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 "";
+ }
+
+ // documentation comments
+ 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);
+
+});
+
+ace.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;
+
+ // must return "" if there's no fold, to enable caching
+ 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);
+ };
+
+}).call(FoldMode.prototype);
+
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/mode-coldfusion.js b/vendor/assets/javascripts/ace-src-noconflict/mode-coldfusion.js
new file mode 100644
index 00000000000..1b41d001a25
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/mode-coldfusion.js
@@ -0,0 +1,1852 @@
+/* ***** 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 ***** */
+
+ace.define('ace/mode/coldfusion', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/xml', 'ace/mode/javascript', 'ace/mode/css', 'ace/tokenizer', 'ace/mode/coldfusion_highlight_rules'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var XmlMode = require("./xml").Mode;
+var JavaScriptMode = require("./javascript").Mode;
+var CssMode = require("./css").Mode;
+var Tokenizer = require("../tokenizer").Tokenizer;
+var ColdfusionHighlightRules = require("./coldfusion_highlight_rules").ColdfusionHighlightRules;
+
+var Mode = function() {
+ XmlMode.call(this);
+
+ var highlighter = new ColdfusionHighlightRules();
+ this.$tokenizer = new Tokenizer(highlighter.getRules());
+
+ this.$embeds = highlighter.getEmbeds();
+ this.createModeDelegates({
+ "js-": JavaScriptMode,
+ "css-": CssMode
+ });
+};
+oop.inherits(Mode, XmlMode);
+
+(function() {
+
+ this.getNextLineIndent = function(state, line, tab) {
+ return this.$getIndent(line);
+ };
+
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+});
+
+ace.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;
+});
+
+ace.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() {
+
+ // regexp must not have capturing parentheses
+ // regexps are ordered -> the first match is used
+ this.$rules = {
+ start : [{
+ token : "text",
+ regex : "<\\!\\[CDATA\\[",
+ next : "cdata"
+ }, {
+ token : "xml_pe",
+ regex : "<\\?.*?\\?>"
+ }, {
+ token : "comment",
+ merge : true,
+ regex : "<\\!--",
+ next : "comment"
+ }, {
+ token : "xml_pe",
+ regex : "<\\!.*?>"
+ }, {
+ token : "meta.tag", // opening tag
+ regex : "<\\/?",
+ next : "tag"
+ }, {
+ token : "text",
+ regex : "\\s+"
+ }, {
+ token : "constant.character.entity",
+ regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
+ }, {
+ token : "text",
+ regex : "[^<]+"
+ }],
+
+ cdata : [{
+ token : "text",
+ regex : "\\]\\]>",
+ next : "start"
+ }, {
+ token : "text",
+ regex : "\\s+"
+ }, {
+ token : "text",
+ regex : "(?:[^\\]]|\\](?!\\]>))+"
+ }],
+
+ comment : [{
+ token : "comment",
+ regex : ".*?-->",
+ next : "start"
+ }, {
+ token : "comment",
+ merge : true,
+ regex : ".+"
+ }]
+ };
+
+ xmlUtil.tag(this.$rules, "tag", "start");
+};
+
+oop.inherits(XmlHighlightRules, TextHighlightRules);
+
+exports.XmlHighlightRules = XmlHighlightRules;
+});
+
+ace.define('ace/mode/xml_util', ['require', 'exports', 'module' ], function(require, exports, module) {
+
+
+function string(state) {
+ return [{
+ token : "string",
+ regex : '".*?"'
+ }, {
+ token : "string", // multi line string start
+ merge : true,
+ regex : '["].*',
+ next : state + "_qqstring"
+ }, {
+ token : "string",
+ regex : "'.*?'"
+ }, {
+ token : "string", // multi line string start
+ merge : true,
+ regex : "['].*",
+ next : state + "_qstring"
+ }];
+}
+
+function multiLineString(quote, state) {
+ return [{
+ token : "string",
+ merge : true,
+ regex : ".*?" + quote,
+ next : state
+ }, {
+ token : "string",
+ merge : true,
+ regex : '.+'
+ }];
+}
+
+exports.tag = function(states, name, nextState, tagMap) {
+ states[name] = [{
+ token : "text",
+ regex : "\\s+"
+ }, {
+ //token : "meta.tag",
+
+ token : !tagMap ? "meta.tag.tag-name" : function(value) {
+ if (tagMap[value])
+ return "meta.tag.tag-name." + tagMap[value];
+ else
+ return "meta.tag.tag-name";
+ },
+ merge : true,
+ 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",
+ merge : true,
+ 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));
+};
+
+});
+
+ace.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;
+});
+
+ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour'], function(require, exports, module) {
+
+
+var oop = require("../../lib/oop");
+var Behaviour = require("../behaviour").Behaviour;
+
+var CstyleBehaviour = function () {
+
+ this.add("braces", "insertion", function (state, action, editor, session, text) {
+ if (text == '{') {
+ var selection = editor.getSelectionRange();
+ var selected = session.doc.getTextRange(selection);
+ if (selected !== "") {
+ return {
+ text: '{' + selected + '}',
+ selection: false
+ };
+ } else {
+ 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) {
+ return {
+ text: '',
+ selection: [1, 1]
+ };
+ }
+ }
+ } else if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ if (rightChar == '}') {
+ var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column + 1});
+ if (!openBracePos)
+ return null;
+
+ var indent = this.getNextLineIndent(state, line.substring(0, line.length - 1), session.getTabString());
+ var next_indent = this.$getIndent(session.doc.getLine(openBracePos.row));
+
+ return {
+ text: '\n' + indent + '\n' + next_indent,
+ 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;
+ }
+ }
+ });
+
+ this.add("parens", "insertion", function (state, action, editor, session, text) {
+ if (text == '(') {
+ var selection = editor.getSelectionRange();
+ var selected = session.doc.getTextRange(selection);
+ if (selected !== "") {
+ return {
+ text: '(' + selected + ')',
+ selection: false
+ };
+ } else {
+ 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) {
+ 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 !== "") {
+ return {
+ text: '[' + selected + ']',
+ selection: false
+ };
+ } else {
+ 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) {
+ 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 !== "") {
+ 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);
+
+ // We're escaped.
+ if (leftChar == '\\') {
+ return null;
+ }
+
+ // Find what token we're inside.
+ 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;
+ }
+
+ // Try and be smart about when we auto insert.
+ 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)))) {
+ return {
+ text: quote + quote,
+ selection: [1,1]
+ };
+ } else if (token && token.type === "string") {
+ // Ignore input and move right one if we're typing over the closing quote.
+ 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 == '"') {
+ range.end.column++;
+ return range;
+ }
+ }
+ });
+
+};
+
+oop.inherits(CstyleBehaviour, Behaviour);
+
+exports.CstyleBehaviour = CstyleBehaviour;
+});
+
+ace.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);
+
+});
+
+ace.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;
+
+ // must return "" if there's no fold, to enable caching
+ 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);
+ };
+
+}).call(FoldMode.prototype);
+
+});
+
+ace.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) {
+ var errors = [];
+ for (var i=0; i<results.data.length; i++) {
+ var error = results.data[i];
+ if (error)
+ errors.push({
+ row: error.line-1,
+ column: error.character-1,
+ text: error.reason,
+ type: "warning",
+ lint: error
+ });
+ }
+ session.setAnnotations(errors);
+ });
+
+ worker.on("narcissus", function(e) {
+ session.setAnnotations([e.data]);
+ });
+
+ worker.on("terminate", function() {
+ session.clearAnnotations();
+ });
+
+ return worker;
+ };
+
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+});
+
+ace.define('ace/mode/javascript_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/unicode', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var unicode = require("../unicode");
+var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
+var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+
+var JavaScriptHighlightRules = function() {
+ // see: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects
+ 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
+ "invalid.deprecated":
+ "__parent__|__count__|escape|unescape|with|__proto__|debugger",
+ "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|",
+ "storage.type":
+ "const|let|var|function",
+ "invalid.illegal":
+ "class|enum|extends|super|export|implements|private|" +
+ "public|interface|package|protected|static",
+ "constant.language":
+ "null|Infinity|NaN|undefined",
+ }, "identifier");
+
+
+ // keywords which can be followed by regular expressions
+ var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield";
+
+ // TODO: Unicode escape sequences
+ 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
+ ".)";
+
+ // regexp must not have capturing parentheses. Use (?:) instead.
+ // regexps are ordered -> the first match is used
+
+ this.$rules = {
+ "start" : [
+ {
+ token : "comment",
+ regex : /\/\/.*$/
+ },
+ DocCommentHighlightRules.getStartRule("doc-start"),
+ {
+ token : "comment", // multi line comment
+ merge : true,
+ 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/
+ }, {
+ // Sound.prototype.play =
+ token : [
+ "storage.type", "punctuation.operator", "support.function",
+ "punctuation.operator", "entity.name.function", "text","keyword.operator"
+ ],
+ regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)",
+ next: "function_arguments"
+ }, {
+ // Sound.play = function() { }
+ 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"
+ }, {
+ // play = function() { }
+ token : [
+ "entity.name.function", "text", "keyword.operator", "text", "storage.type",
+ "text", "paren.lparen"
+ ],
+ regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ // Sound.play = function play() { }
+ 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"
+ }, {
+ // function myFunc(arg) { }
+ token : [
+ "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ ],
+ regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ // foobar: function() { }
+ token : [
+ "entity.name.function", "text", "punctuation.operator",
+ "text", "storage.type", "text", "paren.lparen"
+ ],
+ regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ // : function() { } (this is for issues with 'foo': function() { })
+ token : [
+ "text", "text", "storage.type", "text", "paren.lparen"
+ ],
+ regex : "(:)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ token : "constant.language.boolean",
+ regex : /(?:true|false)\b/
+ }, {
+ 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 : /!|\$|%|&|\*|\-\-|\-|\+\+|\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=|\b(?:in|instanceof|new|delete|typeof|void)/,
+ 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: /^#!.*$/
+ }, {
+ token : "text",
+ regex : /\s+/
+ }
+ ],
+ // regular expressions are only allowed after certain tokens. This
+ // makes sure we don't mix up regexps with the divison operator
+ "regex_allowed": [
+ DocCommentHighlightRules.getStartRule("doc-start"),
+ {
+ token : "comment", // multi line comment
+ merge : true,
+ regex : "\\/\\*",
+ next : "comment_regex_allowed"
+ }, {
+ token : "comment",
+ regex : "\\/\\/.*$"
+ }, {
+ token: "string.regexp",
+ regex: "\\/",
+ next: "regex",
+ merge: true
+ }, {
+ token : "text",
+ regex : "\\s+"
+ }, {
+ // immediately return to the start mode without matching
+ // anything
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "regex": [
+ {
+ // escapes
+ token: "regexp.keyword.operator",
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
+ }, {
+ // flag
+ token: "string.regexp",
+ regex: "/\\w*",
+ next: "start",
+ merge: true
+ }, {
+ // invalid operators
+ token : "invalid",
+ regex: /\{\d+,?(?:\d+)?}[+*]|[+*^$?][+*]|\?\?/ // |[^$][?]
+ }, {
+ // operators
+ token : "constant.language.escape",
+ regex: /\(\?[:=!]|\)|\{\d+,?(?:\d+)?}|[+*]\?|[(|)$^+*?]/
+ }, {
+ token: "string.regexp",
+ regex: /{|[^\[\\{()$^+*?\/]+/,
+ merge: true
+ }, {
+ token: "constant.language.escape",
+ regex: /\[\^?/,
+ next: "regex_character_class",
+ merge: true
+ }, {
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "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",
+ merge: true
+ }, {
+ token: "constant.language.escape",
+ regex: "-",
+ }, {
+ token: "string.regexp.charachterclass",
+ regex: /[^\]\-\\]+/,
+ merge: true
+ }, {
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "function_arguments": [
+ {
+ token: "variable.parameter",
+ regex: identifierRe
+ }, {
+ token: "punctuation.operator",
+ regex: "[, ]+",
+ merge: true
+ }, {
+ token: "punctuation.operator",
+ regex: "$",
+ merge: true
+ }, {
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "comment_regex_allowed" : [
+ {
+ token : "comment", // closing comment
+ regex : ".*?\\*\\/",
+ merge : true,
+ next : "regex_allowed"
+ }, {
+ token : "comment", // comment spanning whole line
+ merge : true,
+ regex : ".+"
+ }
+ ],
+ "comment" : [
+ {
+ token : "comment", // closing comment
+ regex : ".*?\\*\\/",
+ merge : true,
+ next : "start"
+ }, {
+ token : "comment", // comment spanning whole line
+ merge : true,
+ regex : ".+"
+ }
+ ],
+ "qqstring" : [
+ {
+ token : "constant.language.escape",
+ regex : escapedRe
+ }, {
+ token : "string",
+ regex : '[^"\\\\]+',
+ merge : true
+ }, {
+ token : "string",
+ regex : "\\\\$",
+ next : "qqstring",
+ merge : true
+ }, {
+ token : "string",
+ regex : '"|$',
+ next : "start",
+ merge : true
+ }
+ ],
+ "qstring" : [
+ {
+ token : "constant.language.escape",
+ regex : escapedRe
+ }, {
+ token : "string",
+ regex : "[^'\\\\]+",
+ merge : true
+ }, {
+ token : "string",
+ regex : "\\\\$",
+ next : "qstring",
+ merge : true
+ }, {
+ token : "string",
+ regex : "'|$",
+ next : "start",
+ merge : true
+ }
+ ]
+ };
+
+ this.embedRules(DocCommentHighlightRules, "doc-",
+ [ DocCommentHighlightRules.getEndRule("start") ]);
+};
+
+oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
+
+exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
+});
+
+ace.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",
+ merge : true,
+ regex : "\\s+"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "TODO"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "[^@\\*]+"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "."
+ }]
+ };
+};
+
+oop.inherits(DocCommentHighlightRules, TextHighlightRules);
+
+DocCommentHighlightRules.getStartRule = function(start) {
+ return {
+ token : "comment.doc", // doc comment
+ merge : true,
+ regex : "\\/\\*(?=\\*)",
+ next : start
+ };
+};
+
+DocCommentHighlightRules.getEndRule = function (start) {
+ return {
+ token : "comment.doc", // closing comment
+ merge : true,
+ regex : "\\*\\/",
+ next : start
+ };
+};
+
+
+exports.DocCommentHighlightRules = DocCommentHighlightRules;
+
+});
+
+ace.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;
+});
+
+ace.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);
+
+ var range = session.getCommentFoldRange(row, i + match[0].length);
+ range.end.column -= 2;
+ return range;
+ }
+
+ if (foldStyle !== "markbeginend")
+ return;
+
+ var match = line.match(this.foldingStopMarker);
+ if (match) {
+ var i = match.index + match[0].length;
+
+ if (match[2]) {
+ var range = session.getCommentFoldRange(row, i);
+ range.end.column -= 2;
+ return range;
+ }
+
+ var end = {row: row, column: i};
+ var start = session.$findOpeningBracket(match[1], end);
+
+ if (!start)
+ return;
+
+ start.column++;
+ end.column--;
+
+ return Range.fromPoints(start, end);
+ }
+ };
+
+}).call(FoldMode.prototype);
+
+});
+
+ace.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/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 CStyleFoldMode = require("./folding/cstyle").FoldMode;
+
+var Mode = function() {
+ this.$tokenizer = new Tokenizer(new CssHighlightRules().getRules(), "i");
+ this.$outdent = new MatchingBraceOutdent();
+ this.foldingRules = new CStyleFoldMode();
+};
+oop.inherits(Mode, TextMode);
+
+(function() {
+
+ this.foldingRules = "cStyle";
+
+ this.getNextLineIndent = function(state, line, tab) {
+ var indent = this.$getIndent(line);
+
+ // ignore braces in comments
+ 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) {
+ var errors = [];
+ e.data.forEach(function(message) {
+ errors.push({
+ row: message.line - 1,
+ column: message.col - 1,
+ text: message.message,
+ type: message.type,
+ lint: message
+ });
+ });
+
+ session.setAnnotations(errors);
+ });
+ return worker;
+ };
+
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+
+});
+
+ace.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 CssHighlightRules = function() {
+ var keywordMapper = this.createKeywordMapper({
+ "support.type": "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",
+ "support.function": "rgb|rgba|url|attr|counter|counters",
+ "support.constant": "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",
+ "support.constant.color": "aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow",
+ "support.constant.fonts": "arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace"
+ }, "text", true);
+
+ // regexp must not have capturing parentheses. Use (?:) instead.
+ // regexps are ordered -> the first match is used
+
+ var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
+ var pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
+ var 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 base_ruleset = [
+ {
+ token : "comment", // multi line comment
+ merge : true,
+ 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 : "([0-9]+)"
+ }, {
+ 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
+ merge : true,
+ 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
+ merge : true,
+ 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
+ merge : true,
+ 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;
+
+});
+
+ace.define('ace/mode/coldfusion_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/css_highlight_rules', 'ace/mode/javascript_highlight_rules', 'ace/mode/text_highlight_rules', 'ace/mode/xml_util'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
+var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
+var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+var xml_util = require("./xml_util");
+
+var ColdfusionHighlightRules = function() {
+
+ // regexp must not have capturing parentheses
+ // regexps are ordered -> the first match is used
+
+ this.$rules = {
+ start : [ {
+ token : "text",
+ merge : true,
+ regex : "<\\!\\[CDATA\\[",
+ next : "cdata"
+ }, {
+ token : "xml_pe",
+ regex : "<\\?.*?\\?>"
+ }, {
+ token : "comment",
+ merge : true,
+ regex : "<\\!--",
+ next : "comment"
+ }, {
+ token : "meta.tag",
+ regex : "<(?=\s*script)",
+ next : "script"
+ }, {
+ token : "meta.tag",
+ regex : "<(?=\s*style)",
+ next : "style"
+ }, {
+ token : "meta.tag", // opening tag
+ regex : "<\\/?",
+ next : "tag"
+ }, {
+ token : "text",
+ regex : "\\s+"
+ }, {
+ token : "text",
+ regex : "[^<]+"
+ } ],
+
+ cdata : [ {
+ token : "text",
+ regex : "\\]\\]>",
+ next : "start"
+ }, {
+ token : "text",
+ merge : true,
+ regex : "\\s+"
+ }, {
+ token : "text",
+ merge : true,
+ regex : ".+"
+ } ],
+
+ comment : [ {
+ token : "comment",
+ regex : ".*?-->",
+ next : "start"
+ }, {
+ token : "comment",
+ merge : true,
+ regex : ".+"
+ } ]
+ };
+
+ xml_util.tag(this.$rules, "tag", "start");
+ xml_util.tag(this.$rules, "style", "css-start");
+ xml_util.tag(this.$rules, "script", "js-start");
+
+ 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(ColdfusionHighlightRules, TextHighlightRules);
+
+exports.ColdfusionHighlightRules = ColdfusionHighlightRules;
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/mode-csharp.js b/vendor/assets/javascripts/ace-src-noconflict/mode-csharp.js
new file mode 100644
index 00000000000..7aa8082fa42
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/mode-csharp.js
@@ -0,0 +1,619 @@
+ace.define('ace/mode/csharp', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/csharp_highlight_rules', 'ace/mode/matching_brace_outdent', '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 CSharpHighlightRules = require("./csharp_highlight_rules").CSharpHighlightRules;
+var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
+var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
+var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+
+var Mode = function() {
+ this.$tokenizer = new Tokenizer(new CSharpHighlightRules().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);
+
+ var tokenizedLine = this.$tokenizer.getLineTokens(line, state);
+ var tokens = tokenizedLine.tokens;
+
+ if (tokens.length && tokens[tokens.length-1].type == "comment") {
+ return indent;
+ }
+
+ if (state == "start") {
+ var match = line.match(/^.*[\{\(\[]\s*$/);
+ 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) {
+ return null;
+ };
+
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+});
+ace.define('ace/mode/csharp_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
+var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+
+var CSharpHighlightRules = function() {
+ var keywordMapper = this.createKeywordMapper({
+ "variable.language": "this",
+ "keyword": "abstract|event|new|struct|as|explicit|null|switch|base|extern|object|this|bool|false|operator|throw|break|finally|out|true|byte|fixed|override|try|case|float|params|typeof|catch|for|private|uint|char|foreach|protected|ulong|checked|goto|public|unchecked|class|if|readonly|unsafe|const|implicit|ref|ushort|continue|in|return|using|decimal|int|sbyte|virtual|default|interface|sealed|volatile|delegate|internal|short|void|do|is|sizeof|while|double|lock|stackalloc|else|long|static|enum|namespace|string|var|dynamic",
+ "constant.language": "null|true|false"
+ }, "identifier");
+
+ // regexp must not have capturing parentheses. Use (?:) instead.
+ // regexps are ordered -> the first match is used
+
+ this.$rules = {
+ "start" : [
+ {
+ token : "comment",
+ regex : "\\/\\/.*$"
+ },
+ DocCommentHighlightRules.getStartRule("doc-start"),
+ {
+ token : "comment", // multi line comment
+ regex : "\\/\\*",
+ merge : true,
+ 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,
+ // TODO: Unicode escape sequences
+ // TODO: Unicode identifiers
+ regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
+ }, {
+ token : "keyword.operator",
+ regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|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
+ merge : true,
+ regex : ".+"
+ }
+ ]
+ };
+
+ this.embedRules(DocCommentHighlightRules, "doc-",
+ [ DocCommentHighlightRules.getEndRule("start") ]);
+};
+
+oop.inherits(CSharpHighlightRules, TextHighlightRules);
+
+exports.CSharpHighlightRules = CSharpHighlightRules;
+});
+
+ace.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",
+ merge : true,
+ regex : "\\s+"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "TODO"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "[^@\\*]+"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "."
+ }]
+ };
+};
+
+oop.inherits(DocCommentHighlightRules, TextHighlightRules);
+
+DocCommentHighlightRules.getStartRule = function(start) {
+ return {
+ token : "comment.doc", // doc comment
+ merge : true,
+ regex : "\\/\\*(?=\\*)",
+ next : start
+ };
+};
+
+DocCommentHighlightRules.getEndRule = function (start) {
+ return {
+ token : "comment.doc", // closing comment
+ merge : true,
+ regex : "\\*\\/",
+ next : start
+ };
+};
+
+
+exports.DocCommentHighlightRules = DocCommentHighlightRules;
+
+});
+
+ace.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;
+});
+
+ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour'], function(require, exports, module) {
+
+
+var oop = require("../../lib/oop");
+var Behaviour = require("../behaviour").Behaviour;
+
+var CstyleBehaviour = function () {
+
+ this.add("braces", "insertion", function (state, action, editor, session, text) {
+ if (text == '{') {
+ var selection = editor.getSelectionRange();
+ var selected = session.doc.getTextRange(selection);
+ if (selected !== "") {
+ return {
+ text: '{' + selected + '}',
+ selection: false
+ };
+ } else {
+ 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) {
+ return {
+ text: '',
+ selection: [1, 1]
+ };
+ }
+ }
+ } else if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ if (rightChar == '}') {
+ var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column + 1});
+ if (!openBracePos)
+ return null;
+
+ var indent = this.getNextLineIndent(state, line.substring(0, line.length - 1), session.getTabString());
+ var next_indent = this.$getIndent(session.doc.getLine(openBracePos.row));
+
+ return {
+ text: '\n' + indent + '\n' + next_indent,
+ 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;
+ }
+ }
+ });
+
+ this.add("parens", "insertion", function (state, action, editor, session, text) {
+ if (text == '(') {
+ var selection = editor.getSelectionRange();
+ var selected = session.doc.getTextRange(selection);
+ if (selected !== "") {
+ return {
+ text: '(' + selected + ')',
+ selection: false
+ };
+ } else {
+ 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) {
+ 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 !== "") {
+ return {
+ text: '[' + selected + ']',
+ selection: false
+ };
+ } else {
+ 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) {
+ 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 !== "") {
+ 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);
+
+ // We're escaped.
+ if (leftChar == '\\') {
+ return null;
+ }
+
+ // Find what token we're inside.
+ 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;
+ }
+
+ // Try and be smart about when we auto insert.
+ 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)))) {
+ return {
+ text: quote + quote,
+ selection: [1,1]
+ };
+ } else if (token && token.type === "string") {
+ // Ignore input and move right one if we're typing over the closing quote.
+ 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 == '"') {
+ range.end.column++;
+ return range;
+ }
+ }
+ });
+
+};
+
+oop.inherits(CstyleBehaviour, Behaviour);
+
+exports.CstyleBehaviour = CstyleBehaviour;
+});
+
+ace.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);
+
+ var range = session.getCommentFoldRange(row, i + match[0].length);
+ range.end.column -= 2;
+ return range;
+ }
+
+ if (foldStyle !== "markbeginend")
+ return;
+
+ var match = line.match(this.foldingStopMarker);
+ if (match) {
+ var i = match.index + match[0].length;
+
+ if (match[2]) {
+ var range = session.getCommentFoldRange(row, i);
+ range.end.column -= 2;
+ return range;
+ }
+
+ var end = {row: row, column: i};
+ var start = session.$findOpeningBracket(match[1], end);
+
+ if (!start)
+ return;
+
+ start.column++;
+ end.column--;
+
+ return Range.fromPoints(start, end);
+ }
+ };
+
+}).call(FoldMode.prototype);
+
+});
+
+ace.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;
+
+ // must return "" if there's no fold, to enable caching
+ 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);
+ };
+
+}).call(FoldMode.prototype);
+
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/mode-css.js b/vendor/assets/javascripts/ace-src-noconflict/mode-css.js
new file mode 100644
index 00000000000..48665f95108
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/mode-css.js
@@ -0,0 +1,457 @@
+/* ***** 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 ***** */
+
+ace.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/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 CStyleFoldMode = require("./folding/cstyle").FoldMode;
+
+var Mode = function() {
+ this.$tokenizer = new Tokenizer(new CssHighlightRules().getRules(), "i");
+ this.$outdent = new MatchingBraceOutdent();
+ this.foldingRules = new CStyleFoldMode();
+};
+oop.inherits(Mode, TextMode);
+
+(function() {
+
+ this.foldingRules = "cStyle";
+
+ this.getNextLineIndent = function(state, line, tab) {
+ var indent = this.$getIndent(line);
+
+ // ignore braces in comments
+ 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) {
+ var errors = [];
+ e.data.forEach(function(message) {
+ errors.push({
+ row: message.line - 1,
+ column: message.col - 1,
+ text: message.message,
+ type: message.type,
+ lint: message
+ });
+ });
+
+ session.setAnnotations(errors);
+ });
+ return worker;
+ };
+
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+
+});
+
+ace.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 CssHighlightRules = function() {
+ var keywordMapper = this.createKeywordMapper({
+ "support.type": "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",
+ "support.function": "rgb|rgba|url|attr|counter|counters",
+ "support.constant": "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",
+ "support.constant.color": "aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow",
+ "support.constant.fonts": "arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace"
+ }, "text", true);
+
+ // regexp must not have capturing parentheses. Use (?:) instead.
+ // regexps are ordered -> the first match is used
+
+ var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
+ var pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
+ var 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 base_ruleset = [
+ {
+ token : "comment", // multi line comment
+ merge : true,
+ 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 : "([0-9]+)"
+ }, {
+ 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
+ merge : true,
+ 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
+ merge : true,
+ 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
+ merge : true,
+ 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;
+
+});
+
+ace.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;
+});
+
+ace.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);
+
+ var range = session.getCommentFoldRange(row, i + match[0].length);
+ range.end.column -= 2;
+ return range;
+ }
+
+ if (foldStyle !== "markbeginend")
+ return;
+
+ var match = line.match(this.foldingStopMarker);
+ if (match) {
+ var i = match.index + match[0].length;
+
+ if (match[2]) {
+ var range = session.getCommentFoldRange(row, i);
+ range.end.column -= 2;
+ return range;
+ }
+
+ var end = {row: row, column: i};
+ var start = session.$findOpeningBracket(match[1], end);
+
+ if (!start)
+ return;
+
+ start.column++;
+ end.column--;
+
+ return Range.fromPoints(start, end);
+ }
+ };
+
+}).call(FoldMode.prototype);
+
+});
+
+ace.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;
+
+ // must return "" if there's no fold, to enable caching
+ 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);
+ };
+
+}).call(FoldMode.prototype);
+
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/mode-diff.js b/vendor/assets/javascripts/ace-src-noconflict/mode-diff.js
new file mode 100644
index 00000000000..75e26cc7056
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/mode-diff.js
@@ -0,0 +1,244 @@
+/* ***** 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 ***** */
+
+ace.define('ace/mode/diff', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/diff_highlight_rules', 'ace/mode/folding/diff'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var TextMode = require("./text").Mode;
+var Tokenizer = require("../tokenizer").Tokenizer;
+var HighlightRules = require("./diff_highlight_rules").DiffHighlightRules;
+var FoldMode = require("./folding/diff").FoldMode;
+
+var Mode = function() {
+ this.$tokenizer = new Tokenizer(new HighlightRules().getRules(), "i");
+ this.foldingRules = new FoldMode(["diff", "index", "\\+{3}", "@@|\\*{5}"], "i");
+};
+oop.inherits(Mode, TextMode);
+
+(function() {
+
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+
+});
+
+ace.define('ace/mode/diff_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 DiffHighlightRules = function() {
+ // regexp must not have capturing parentheses. Use (?:) instead.
+ // regexps are ordered -> the first match is used
+
+ this.$rules = {
+ "start" : [{
+ "regex": "^(?:\\*{15}|={67}|-{3}|\\+{3})$",
+ "token": "punctuation.definition.separator.diff",
+ "name": "keyword"
+ }, { //diff.range.unified
+ "regex": "^(@@)(\\s*.+?\\s*)(@@)(.*)$",
+ "token": [
+ "constant",
+ "constant.numeric",
+ "constant",
+ "comment.doc.tag"
+ ]
+ }, { //diff.range.normal
+ "regex": "^(\\d+)([,\\d]+)(a|d|c)(\\d+)([,\\d]+)(.*)$",
+ "token": [
+ "constant.numeric",
+ "punctuation.definition.range.diff",
+ "constant.function",
+ "constant.numeric",
+ "punctuation.definition.range.diff",
+ "invalid"
+ ],
+ "name": "meta."
+ }, {
+ "regex": "^(?:(\\-{3}|\\+{3}|\\*{3})( .+))$",
+ "token": [
+ "constant.numeric",
+ "meta.tag"
+ ]
+ }, { // added
+ "regex": "^([!+>])(.*?)(\\s*)$",
+ "token": [
+ "support.constant",
+ "text",
+ "invalid"
+ ],
+ }, { // removed
+ "regex": "^([<\\-])(.*?)(\\s*)$",
+ "token": [
+ "support.function",
+ "string",
+ "invalid"
+ ],
+ }, {
+ "regex": "^(diff)(\\s+--\\w+)?(.+?)( .+)?$",
+ "token": ["variable", "variable", "keyword", "variable"]
+ }, {
+ "regex": "^Index.+$",
+ "token": "variable"
+ }, {
+ "regex": "^(.*?)(\\s*)$",
+ "token": ["invisible", "invalid"]
+ }
+ ]
+ };
+};
+
+oop.inherits(DiffHighlightRules, TextHighlightRules);
+
+exports.DiffHighlightRules = DiffHighlightRules;
+});
+
+ace.define('ace/mode/folding/diff', ['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(levels, flag) {
+ this.regExpList = levels;
+ this.flag = flag;
+ this.foldingStartMarker = RegExp("^(" + levels.join("|") + ")", this.flag);
+};
+oop.inherits(FoldMode, BaseFoldMode);
+
+(function() {
+ this.getFoldWidgetRange = function(session, foldStyle, row) {
+ var line = session.getLine(row);
+ var start = {row: row, column: line.length};
+
+ var regList = this.regExpList;
+ for (var i = 1; i <= regList.length; i++) {
+ var re = RegExp("^(" + regList.slice(0, i).join("|") + ")", this.flag);
+ if (re.test(line))
+ break;
+ }
+
+ for (var l = session.getLength(); ++row < l; ) {
+ line = session.getLine(row);
+ if (re.test(line))
+ break;
+ }
+ if (row == start.row + 1)
+ return;
+ return Range.fromPoints(start, {row: row - 1, column: line.length});
+ };
+
+}).call(FoldMode.prototype);
+
+});
+
+ace.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;
+
+ // must return "" if there's no fold, to enable caching
+ 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);
+ };
+
+}).call(FoldMode.prototype);
+
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/mode-glsl.js b/vendor/assets/javascripts/ace-src-noconflict/mode-glsl.js
new file mode 100644
index 00000000000..c46651b20da
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/mode-glsl.js
@@ -0,0 +1,834 @@
+/* ***** 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 ***** */
+
+ace.define('ace/mode/glsl', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/c_cpp', 'ace/tokenizer', 'ace/mode/glsl_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var CMode = require("./c_cpp").Mode;
+var Tokenizer = require("../tokenizer").Tokenizer;
+var glslHighlightRules = require("./glsl_highlight_rules").glslHighlightRules;
+var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
+var Range = require("../range").Range;
+var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
+var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+
+var Mode = function() {
+ this.$tokenizer = new Tokenizer(new glslHighlightRules().getRules());
+ this.$outdent = new MatchingBraceOutdent();
+ this.$behaviour = new CstyleBehaviour();
+ this.foldingRules = new CStyleFoldMode();
+};
+oop.inherits(Mode, CMode);
+
+exports.Mode = Mode;
+});
+
+ace.define('ace/mode/c_cpp', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/c_cpp_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var TextMode = require("./text").Mode;
+var Tokenizer = require("../tokenizer").Tokenizer;
+var c_cppHighlightRules = require("./c_cpp_highlight_rules").c_cppHighlightRules;
+var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
+var Range = require("../range").Range;
+var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
+var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+
+var Mode = function() {
+ this.$tokenizer = new Tokenizer(new c_cppHighlightRules().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") {
+ var match = line.match(/^.*[\{\(\[]\s*$/);
+ if (match) {
+ indent += tab;
+ }
+ } else if (state == "doc-start") {
+ if (endState == "start") {
+ 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);
+ };
+
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+});
+
+ace.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;
+
+// used by objective-c
+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.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";
+
+ // regexp must not have capturing parentheses. Use (?:) instead.
+ // regexps are ordered -> the first match is used
+
+ this.$rules = {
+ "start" : [
+ {
+ token : "comment",
+ regex : "\\/\\/.*$"
+ },
+ DocCommentHighlightRules.getStartRule("doc-start"),
+ {
+ token : "comment", // multi line comment
+ merge : true,
+ regex : "\\/\\*",
+ next : "comment"
+ }, {
+ token : "string", // single line
+ regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
+ }, {
+ token : "string", // multi line string start
+ merge : true,
+ regex : '["].*\\\\$',
+ next : "qqstring"
+ }, {
+ token : "string", // single line
+ regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
+ }, {
+ token : "string", // multi line string start
+ merge : true,
+ 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 : "constant", // <CONSTANT>
+ regex : "<[a-zA-Z0-9.]+>"
+ }, {
+ token : "keyword", // pre-compiler directivs
+ regex : "(?:#include|#pragma|#line|#define|#undef|#ifdef|#else|#elif|#endif|#ifndef)"
+ }, {
+ token : "support.function.C99.c",
+ regex : cFunctions
+ }, {
+ // function myFunc(arg) { }
+ token : [
+ "text", "entity.name.function", "text", "paren.lparen"
+ ],
+ regex : "(\\s+)(" + identifierRe + ")(\\s*)(\\()"
+ }, {
+ 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
+ merge : true,
+ regex : ".+"
+ }
+ ],
+ "qqstring" : [
+ {
+ token : "string",
+ regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"',
+ next : "start"
+ }, {
+ token : "string",
+ merge : true,
+ regex : '.+'
+ }
+ ],
+ "qstring" : [
+ {
+ token : "string",
+ regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'",
+ next : "start"
+ }, {
+ token : "string",
+ merge : true,
+ regex : '.+'
+ }
+ ]
+ };
+
+ this.embedRules(DocCommentHighlightRules, "doc-",
+ [ DocCommentHighlightRules.getEndRule("start") ]);
+};
+
+oop.inherits(c_cppHighlightRules, TextHighlightRules);
+
+exports.c_cppHighlightRules = c_cppHighlightRules;
+});
+
+ace.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",
+ merge : true,
+ regex : "\\s+"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "TODO"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "[^@\\*]+"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "."
+ }]
+ };
+};
+
+oop.inherits(DocCommentHighlightRules, TextHighlightRules);
+
+DocCommentHighlightRules.getStartRule = function(start) {
+ return {
+ token : "comment.doc", // doc comment
+ merge : true,
+ regex : "\\/\\*(?=\\*)",
+ next : start
+ };
+};
+
+DocCommentHighlightRules.getEndRule = function (start) {
+ return {
+ token : "comment.doc", // closing comment
+ merge : true,
+ regex : "\\*\\/",
+ next : start
+ };
+};
+
+
+exports.DocCommentHighlightRules = DocCommentHighlightRules;
+
+});
+
+ace.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;
+});
+
+ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour'], function(require, exports, module) {
+
+
+var oop = require("../../lib/oop");
+var Behaviour = require("../behaviour").Behaviour;
+
+var CstyleBehaviour = function () {
+
+ this.add("braces", "insertion", function (state, action, editor, session, text) {
+ if (text == '{') {
+ var selection = editor.getSelectionRange();
+ var selected = session.doc.getTextRange(selection);
+ if (selected !== "") {
+ return {
+ text: '{' + selected + '}',
+ selection: false
+ };
+ } else {
+ 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) {
+ return {
+ text: '',
+ selection: [1, 1]
+ };
+ }
+ }
+ } else if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ if (rightChar == '}') {
+ var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column + 1});
+ if (!openBracePos)
+ return null;
+
+ var indent = this.getNextLineIndent(state, line.substring(0, line.length - 1), session.getTabString());
+ var next_indent = this.$getIndent(session.doc.getLine(openBracePos.row));
+
+ return {
+ text: '\n' + indent + '\n' + next_indent,
+ 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;
+ }
+ }
+ });
+
+ this.add("parens", "insertion", function (state, action, editor, session, text) {
+ if (text == '(') {
+ var selection = editor.getSelectionRange();
+ var selected = session.doc.getTextRange(selection);
+ if (selected !== "") {
+ return {
+ text: '(' + selected + ')',
+ selection: false
+ };
+ } else {
+ 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) {
+ 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 !== "") {
+ return {
+ text: '[' + selected + ']',
+ selection: false
+ };
+ } else {
+ 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) {
+ 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 !== "") {
+ 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);
+
+ // We're escaped.
+ if (leftChar == '\\') {
+ return null;
+ }
+
+ // Find what token we're inside.
+ 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;
+ }
+
+ // Try and be smart about when we auto insert.
+ 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)))) {
+ return {
+ text: quote + quote,
+ selection: [1,1]
+ };
+ } else if (token && token.type === "string") {
+ // Ignore input and move right one if we're typing over the closing quote.
+ 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 == '"') {
+ range.end.column++;
+ return range;
+ }
+ }
+ });
+
+};
+
+oop.inherits(CstyleBehaviour, Behaviour);
+
+exports.CstyleBehaviour = CstyleBehaviour;
+});
+
+ace.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);
+
+ var range = session.getCommentFoldRange(row, i + match[0].length);
+ range.end.column -= 2;
+ return range;
+ }
+
+ if (foldStyle !== "markbeginend")
+ return;
+
+ var match = line.match(this.foldingStopMarker);
+ if (match) {
+ var i = match.index + match[0].length;
+
+ if (match[2]) {
+ var range = session.getCommentFoldRange(row, i);
+ range.end.column -= 2;
+ return range;
+ }
+
+ var end = {row: row, column: i};
+ var start = session.$findOpeningBracket(match[1], end);
+
+ if (!start)
+ return;
+
+ start.column++;
+ end.column--;
+
+ return Range.fromPoints(start, end);
+ }
+ };
+
+}).call(FoldMode.prototype);
+
+});
+
+ace.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;
+
+ // must return "" if there's no fold, to enable caching
+ 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);
+ };
+
+}).call(FoldMode.prototype);
+
+});
+
+ace.define('ace/mode/glsl_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/c_cpp_highlight_rules'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var c_cppHighlightRules = require("./c_cpp_highlight_rules").c_cppHighlightRules;
+
+var glslHighlightRules = function() {
+
+ var keywords = (
+ "attribute|const|uniform|varying|break|continue|do|for|while|" +
+ "if|else|in|out|inout|float|int|void|bool|true|false|" +
+ "lowp|mediump|highp|precision|invariant|discard|return|mat2|mat3|" +
+ "mat4|vec2|vec3|vec4|ivec2|ivec3|ivec4|bvec2|bvec3|bvec4|sampler2D|" +
+ "samplerCube|struct"
+ );
+
+ var buildinConstants = (
+ "radians|degrees|sin|cos|tan|asin|acos|atan|pow|" +
+ "exp|log|exp2|log2|sqrt|inversesqrt|abs|sign|floor|ceil|fract|mod|" +
+ "min|max|clamp|mix|step|smoothstep|length|distance|dot|cross|" +
+ "normalize|faceforward|reflect|refract|matrixCompMult|lessThan|" +
+ "lessThanEqual|greaterThan|greaterThanEqual|equal|notEqual|any|all|" +
+ "not|dFdx|dFdy|fwidth|texture2D|texture2DProj|texture2DLod|" +
+ "texture2DProjLod|textureCube|textureCubeLod|" +
+ "gl_MaxVertexAttribs|gl_MaxVertexUniformVectors|gl_MaxVaryingVectors|" +
+ "gl_MaxVertexTextureImageUnits|gl_MaxCombinedTextureImageUnits|" +
+ "gl_MaxTextureImageUnits|gl_MaxFragmentUniformVectors|gl_MaxDrawBuffers|" +
+ "gl_DepthRangeParameters|gl_DepthRange|" +
+ // The following two are only for MIME x-shader/x-vertex.
+ "gl_Position|gl_PointSize|" +
+ // The following five are only for MIME x-shader/x-fragment.
+ "gl_FragCoord|gl_FrontFacing|gl_PointCoord|gl_FragColor|gl_FragData"
+ );
+
+ var keywordMapper = this.createKeywordMapper({
+ "variable.language": "this",
+ "keyword": keywords,
+ "constant.language": buildinConstants
+ }, "identifier");
+
+ this.$rules = new c_cppHighlightRules().$rules;
+ this.$rules.start.forEach(function(rule) {
+ if (typeof rule.token == "function")
+ rule.token = keywordMapper;
+ })
+};
+
+oop.inherits(glslHighlightRules, c_cppHighlightRules);
+
+exports.glslHighlightRules = glslHighlightRules;
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/mode-golang.js b/vendor/assets/javascripts/ace-src-noconflict/mode-golang.js
new file mode 100644
index 00000000000..c894682da0f
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/mode-golang.js
@@ -0,0 +1,674 @@
+ace.define('ace/mode/golang', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/golang_highlight_rules', 'ace/mode/matching_brace_outdent', '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 GolangHighlightRules = require("./golang_highlight_rules").GolangHighlightRules;
+ var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
+ var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
+ var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+
+ var Mode = function() {
+ this.$tokenizer = new Tokenizer(new GolangHighlightRules().getRules());
+ this.$outdent = new MatchingBraceOutdent();
+ this.foldingRules = new CStyleFoldMode();
+ };
+ 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, "//");
+ }
+ };
+
+ 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") {
+ var match = line.match(/^.*[\{\(\[]\s*$/);
+ if (match) {
+ indent += tab;
+ }
+ }
+
+ return indent;
+ };//end getNextLineIndent
+
+ 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;
+});
+ace.define('ace/mode/golang_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
+ var oop = require("../lib/oop");
+ var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+
+ var GolangHighlightRules = function() {
+ var keywords = (
+ "true|else|false|break|case|return|goto|if|const|" +
+ "continue|struct|default|switch|for|" +
+ "func|import|package|chan|defer|fallthrough|go|interface|map|range" +
+ "select|type|var"
+ );
+ var buildinConstants = ("nil|true|false|iota");
+
+ var keywordMapper = this.createKeywordMapper({
+ "variable.language": "this",
+ "keyword": keywords,
+ "constant.language": buildinConstants
+ }, "identifier");
+
+ this.$rules = {
+ "start" : [
+ {
+ token : "comment",
+ regex : "\\/\\/.*$"
+ },
+ DocCommentHighlightRules.getStartRule("doc-start"),
+ {
+ token : "comment", // multi line comment
+ merge : true,
+ regex : "\\/\\*",
+ next : "comment"
+ }, {
+ token : "string", // single line
+ regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
+ }, {
+ token : "string", // multi line string start
+ merge : true,
+ regex : '["].*\\\\$',
+ next : "qqstring"
+ }, {
+ token : "string", // single line
+ regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
+ }, {
+ token : "string", // multi line string start
+ merge : true,
+ 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 : "constant", // <CONSTANT>
+ regex : "<[a-zA-Z0-9.]+>"
+ }, {
+ token : "keyword", // pre-compiler directivs
+ regex : "(?:#include|#pragma|#line|#define|#undef|#ifdef|#else|#elif|#endif|#ifndef)"
+ }, {
+ 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
+ merge : true,
+ regex : ".+"
+ }
+ ],
+ "qqstring" : [
+ {
+ token : "string",
+ regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"',
+ next : "start"
+ }, {
+ token : "string",
+ merge : true,
+ regex : '.+'
+ }
+ ],
+ "qstring" : [
+ {
+ token : "string",
+ regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'",
+ next : "start"
+ }, {
+ token : "string",
+ merge : true,
+ regex : '.+'
+ }
+ ]
+ };
+
+ this.embedRules(DocCommentHighlightRules, "doc-",
+ [ DocCommentHighlightRules.getEndRule("start") ]);
+ }
+ oop.inherits(GolangHighlightRules, TextHighlightRules);
+
+ exports.GolangHighlightRules = GolangHighlightRules;
+});
+
+ace.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",
+ merge : true,
+ regex : "\\s+"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "TODO"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "[^@\\*]+"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "."
+ }]
+ };
+};
+
+oop.inherits(DocCommentHighlightRules, TextHighlightRules);
+
+DocCommentHighlightRules.getStartRule = function(start) {
+ return {
+ token : "comment.doc", // doc comment
+ merge : true,
+ regex : "\\/\\*(?=\\*)",
+ next : start
+ };
+};
+
+DocCommentHighlightRules.getEndRule = function (start) {
+ return {
+ token : "comment.doc", // closing comment
+ merge : true,
+ regex : "\\*\\/",
+ next : start
+ };
+};
+
+
+exports.DocCommentHighlightRules = DocCommentHighlightRules;
+
+});
+
+ace.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;
+});
+
+ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour'], function(require, exports, module) {
+
+
+var oop = require("../../lib/oop");
+var Behaviour = require("../behaviour").Behaviour;
+
+var CstyleBehaviour = function () {
+
+ this.add("braces", "insertion", function (state, action, editor, session, text) {
+ if (text == '{') {
+ var selection = editor.getSelectionRange();
+ var selected = session.doc.getTextRange(selection);
+ if (selected !== "") {
+ return {
+ text: '{' + selected + '}',
+ selection: false
+ };
+ } else {
+ 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) {
+ return {
+ text: '',
+ selection: [1, 1]
+ };
+ }
+ }
+ } else if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ if (rightChar == '}') {
+ var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column + 1});
+ if (!openBracePos)
+ return null;
+
+ var indent = this.getNextLineIndent(state, line.substring(0, line.length - 1), session.getTabString());
+ var next_indent = this.$getIndent(session.doc.getLine(openBracePos.row));
+
+ return {
+ text: '\n' + indent + '\n' + next_indent,
+ 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;
+ }
+ }
+ });
+
+ this.add("parens", "insertion", function (state, action, editor, session, text) {
+ if (text == '(') {
+ var selection = editor.getSelectionRange();
+ var selected = session.doc.getTextRange(selection);
+ if (selected !== "") {
+ return {
+ text: '(' + selected + ')',
+ selection: false
+ };
+ } else {
+ 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) {
+ 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 !== "") {
+ return {
+ text: '[' + selected + ']',
+ selection: false
+ };
+ } else {
+ 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) {
+ 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 !== "") {
+ 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);
+
+ // We're escaped.
+ if (leftChar == '\\') {
+ return null;
+ }
+
+ // Find what token we're inside.
+ 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;
+ }
+
+ // Try and be smart about when we auto insert.
+ 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)))) {
+ return {
+ text: quote + quote,
+ selection: [1,1]
+ };
+ } else if (token && token.type === "string") {
+ // Ignore input and move right one if we're typing over the closing quote.
+ 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 == '"') {
+ range.end.column++;
+ return range;
+ }
+ }
+ });
+
+};
+
+oop.inherits(CstyleBehaviour, Behaviour);
+
+exports.CstyleBehaviour = CstyleBehaviour;
+});
+
+ace.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);
+
+ var range = session.getCommentFoldRange(row, i + match[0].length);
+ range.end.column -= 2;
+ return range;
+ }
+
+ if (foldStyle !== "markbeginend")
+ return;
+
+ var match = line.match(this.foldingStopMarker);
+ if (match) {
+ var i = match.index + match[0].length;
+
+ if (match[2]) {
+ var range = session.getCommentFoldRange(row, i);
+ range.end.column -= 2;
+ return range;
+ }
+
+ var end = {row: row, column: i};
+ var start = session.$findOpeningBracket(match[1], end);
+
+ if (!start)
+ return;
+
+ start.column++;
+ end.column--;
+
+ return Range.fromPoints(start, end);
+ }
+ };
+
+}).call(FoldMode.prototype);
+
+});
+
+ace.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;
+
+ // must return "" if there's no fold, to enable caching
+ 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);
+ };
+
+}).call(FoldMode.prototype);
+
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/mode-groovy.js b/vendor/assets/javascripts/ace-src-noconflict/mode-groovy.js
new file mode 100644
index 00000000000..ad7bdf58855
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/mode-groovy.js
@@ -0,0 +1,1160 @@
+ace.define('ace/mode/groovy', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/javascript', 'ace/tokenizer', 'ace/mode/groovy_highlight_rules'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var JavaScriptMode = require("./javascript").Mode;
+var Tokenizer = require("../tokenizer").Tokenizer;
+var GroovyHighlightRules = require("./groovy_highlight_rules").GroovyHighlightRules;
+
+var Mode = function() {
+ JavaScriptMode.call(this);
+ this.$tokenizer = new Tokenizer(new GroovyHighlightRules().getRules());
+};
+oop.inherits(Mode, JavaScriptMode);
+
+(function() {
+
+ this.createWorker = function(session) {
+ return null;
+ };
+
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+});
+
+ace.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) {
+ var errors = [];
+ for (var i=0; i<results.data.length; i++) {
+ var error = results.data[i];
+ if (error)
+ errors.push({
+ row: error.line-1,
+ column: error.character-1,
+ text: error.reason,
+ type: "warning",
+ lint: error
+ });
+ }
+ session.setAnnotations(errors);
+ });
+
+ worker.on("narcissus", function(e) {
+ session.setAnnotations([e.data]);
+ });
+
+ worker.on("terminate", function() {
+ session.clearAnnotations();
+ });
+
+ return worker;
+ };
+
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+});
+
+ace.define('ace/mode/javascript_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/unicode', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var unicode = require("../unicode");
+var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
+var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+
+var JavaScriptHighlightRules = function() {
+ // see: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects
+ 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
+ "invalid.deprecated":
+ "__parent__|__count__|escape|unescape|with|__proto__|debugger",
+ "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|",
+ "storage.type":
+ "const|let|var|function",
+ "invalid.illegal":
+ "class|enum|extends|super|export|implements|private|" +
+ "public|interface|package|protected|static",
+ "constant.language":
+ "null|Infinity|NaN|undefined",
+ }, "identifier");
+
+
+ // keywords which can be followed by regular expressions
+ var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield";
+
+ // TODO: Unicode escape sequences
+ 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
+ ".)";
+
+ // regexp must not have capturing parentheses. Use (?:) instead.
+ // regexps are ordered -> the first match is used
+
+ this.$rules = {
+ "start" : [
+ {
+ token : "comment",
+ regex : /\/\/.*$/
+ },
+ DocCommentHighlightRules.getStartRule("doc-start"),
+ {
+ token : "comment", // multi line comment
+ merge : true,
+ 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/
+ }, {
+ // Sound.prototype.play =
+ token : [
+ "storage.type", "punctuation.operator", "support.function",
+ "punctuation.operator", "entity.name.function", "text","keyword.operator"
+ ],
+ regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)",
+ next: "function_arguments"
+ }, {
+ // Sound.play = function() { }
+ 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"
+ }, {
+ // play = function() { }
+ token : [
+ "entity.name.function", "text", "keyword.operator", "text", "storage.type",
+ "text", "paren.lparen"
+ ],
+ regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ // Sound.play = function play() { }
+ 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"
+ }, {
+ // function myFunc(arg) { }
+ token : [
+ "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ ],
+ regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ // foobar: function() { }
+ token : [
+ "entity.name.function", "text", "punctuation.operator",
+ "text", "storage.type", "text", "paren.lparen"
+ ],
+ regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ // : function() { } (this is for issues with 'foo': function() { })
+ token : [
+ "text", "text", "storage.type", "text", "paren.lparen"
+ ],
+ regex : "(:)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ token : "constant.language.boolean",
+ regex : /(?:true|false)\b/
+ }, {
+ 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 : /!|\$|%|&|\*|\-\-|\-|\+\+|\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=|\b(?:in|instanceof|new|delete|typeof|void)/,
+ 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: /^#!.*$/
+ }, {
+ token : "text",
+ regex : /\s+/
+ }
+ ],
+ // regular expressions are only allowed after certain tokens. This
+ // makes sure we don't mix up regexps with the divison operator
+ "regex_allowed": [
+ DocCommentHighlightRules.getStartRule("doc-start"),
+ {
+ token : "comment", // multi line comment
+ merge : true,
+ regex : "\\/\\*",
+ next : "comment_regex_allowed"
+ }, {
+ token : "comment",
+ regex : "\\/\\/.*$"
+ }, {
+ token: "string.regexp",
+ regex: "\\/",
+ next: "regex",
+ merge: true
+ }, {
+ token : "text",
+ regex : "\\s+"
+ }, {
+ // immediately return to the start mode without matching
+ // anything
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "regex": [
+ {
+ // escapes
+ token: "regexp.keyword.operator",
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
+ }, {
+ // flag
+ token: "string.regexp",
+ regex: "/\\w*",
+ next: "start",
+ merge: true
+ }, {
+ // invalid operators
+ token : "invalid",
+ regex: /\{\d+,?(?:\d+)?}[+*]|[+*^$?][+*]|\?\?/ // |[^$][?]
+ }, {
+ // operators
+ token : "constant.language.escape",
+ regex: /\(\?[:=!]|\)|\{\d+,?(?:\d+)?}|[+*]\?|[(|)$^+*?]/
+ }, {
+ token: "string.regexp",
+ regex: /{|[^\[\\{()$^+*?\/]+/,
+ merge: true
+ }, {
+ token: "constant.language.escape",
+ regex: /\[\^?/,
+ next: "regex_character_class",
+ merge: true
+ }, {
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "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",
+ merge: true
+ }, {
+ token: "constant.language.escape",
+ regex: "-",
+ }, {
+ token: "string.regexp.charachterclass",
+ regex: /[^\]\-\\]+/,
+ merge: true
+ }, {
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "function_arguments": [
+ {
+ token: "variable.parameter",
+ regex: identifierRe
+ }, {
+ token: "punctuation.operator",
+ regex: "[, ]+",
+ merge: true
+ }, {
+ token: "punctuation.operator",
+ regex: "$",
+ merge: true
+ }, {
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "comment_regex_allowed" : [
+ {
+ token : "comment", // closing comment
+ regex : ".*?\\*\\/",
+ merge : true,
+ next : "regex_allowed"
+ }, {
+ token : "comment", // comment spanning whole line
+ merge : true,
+ regex : ".+"
+ }
+ ],
+ "comment" : [
+ {
+ token : "comment", // closing comment
+ regex : ".*?\\*\\/",
+ merge : true,
+ next : "start"
+ }, {
+ token : "comment", // comment spanning whole line
+ merge : true,
+ regex : ".+"
+ }
+ ],
+ "qqstring" : [
+ {
+ token : "constant.language.escape",
+ regex : escapedRe
+ }, {
+ token : "string",
+ regex : '[^"\\\\]+',
+ merge : true
+ }, {
+ token : "string",
+ regex : "\\\\$",
+ next : "qqstring",
+ merge : true
+ }, {
+ token : "string",
+ regex : '"|$',
+ next : "start",
+ merge : true
+ }
+ ],
+ "qstring" : [
+ {
+ token : "constant.language.escape",
+ regex : escapedRe
+ }, {
+ token : "string",
+ regex : "[^'\\\\]+",
+ merge : true
+ }, {
+ token : "string",
+ regex : "\\\\$",
+ next : "qstring",
+ merge : true
+ }, {
+ token : "string",
+ regex : "'|$",
+ next : "start",
+ merge : true
+ }
+ ]
+ };
+
+ this.embedRules(DocCommentHighlightRules, "doc-",
+ [ DocCommentHighlightRules.getEndRule("start") ]);
+};
+
+oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
+
+exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
+});
+
+ace.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",
+ merge : true,
+ regex : "\\s+"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "TODO"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "[^@\\*]+"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "."
+ }]
+ };
+};
+
+oop.inherits(DocCommentHighlightRules, TextHighlightRules);
+
+DocCommentHighlightRules.getStartRule = function(start) {
+ return {
+ token : "comment.doc", // doc comment
+ merge : true,
+ regex : "\\/\\*(?=\\*)",
+ next : start
+ };
+};
+
+DocCommentHighlightRules.getEndRule = function (start) {
+ return {
+ token : "comment.doc", // closing comment
+ merge : true,
+ regex : "\\*\\/",
+ next : start
+ };
+};
+
+
+exports.DocCommentHighlightRules = DocCommentHighlightRules;
+
+});
+
+ace.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;
+});
+
+ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour'], function(require, exports, module) {
+
+
+var oop = require("../../lib/oop");
+var Behaviour = require("../behaviour").Behaviour;
+
+var CstyleBehaviour = function () {
+
+ this.add("braces", "insertion", function (state, action, editor, session, text) {
+ if (text == '{') {
+ var selection = editor.getSelectionRange();
+ var selected = session.doc.getTextRange(selection);
+ if (selected !== "") {
+ return {
+ text: '{' + selected + '}',
+ selection: false
+ };
+ } else {
+ 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) {
+ return {
+ text: '',
+ selection: [1, 1]
+ };
+ }
+ }
+ } else if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ if (rightChar == '}') {
+ var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column + 1});
+ if (!openBracePos)
+ return null;
+
+ var indent = this.getNextLineIndent(state, line.substring(0, line.length - 1), session.getTabString());
+ var next_indent = this.$getIndent(session.doc.getLine(openBracePos.row));
+
+ return {
+ text: '\n' + indent + '\n' + next_indent,
+ 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;
+ }
+ }
+ });
+
+ this.add("parens", "insertion", function (state, action, editor, session, text) {
+ if (text == '(') {
+ var selection = editor.getSelectionRange();
+ var selected = session.doc.getTextRange(selection);
+ if (selected !== "") {
+ return {
+ text: '(' + selected + ')',
+ selection: false
+ };
+ } else {
+ 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) {
+ 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 !== "") {
+ return {
+ text: '[' + selected + ']',
+ selection: false
+ };
+ } else {
+ 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) {
+ 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 !== "") {
+ 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);
+
+ // We're escaped.
+ if (leftChar == '\\') {
+ return null;
+ }
+
+ // Find what token we're inside.
+ 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;
+ }
+
+ // Try and be smart about when we auto insert.
+ 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)))) {
+ return {
+ text: quote + quote,
+ selection: [1,1]
+ };
+ } else if (token && token.type === "string") {
+ // Ignore input and move right one if we're typing over the closing quote.
+ 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 == '"') {
+ range.end.column++;
+ return range;
+ }
+ }
+ });
+
+};
+
+oop.inherits(CstyleBehaviour, Behaviour);
+
+exports.CstyleBehaviour = CstyleBehaviour;
+});
+
+ace.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);
+
+ var range = session.getCommentFoldRange(row, i + match[0].length);
+ range.end.column -= 2;
+ return range;
+ }
+
+ if (foldStyle !== "markbeginend")
+ return;
+
+ var match = line.match(this.foldingStopMarker);
+ if (match) {
+ var i = match.index + match[0].length;
+
+ if (match[2]) {
+ var range = session.getCommentFoldRange(row, i);
+ range.end.column -= 2;
+ return range;
+ }
+
+ var end = {row: row, column: i};
+ var start = session.$findOpeningBracket(match[1], end);
+
+ if (!start)
+ return;
+
+ start.column++;
+ end.column--;
+
+ return Range.fromPoints(start, end);
+ }
+ };
+
+}).call(FoldMode.prototype);
+
+});
+
+ace.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;
+
+ // must return "" if there's no fold, to enable caching
+ 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);
+ };
+
+}).call(FoldMode.prototype);
+
+});
+ace.define('ace/mode/groovy_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 GroovyHighlightRules = function() {
+
+ var keywords = (
+ "assert|with|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|" +
+ "def|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"
+ );
+
+ // TODO var importClasses = "";
+
+ var keywordMapper = this.createKeywordMapper({
+ "variable.language": "this",
+ "keyword": keywords,
+ "support.function": langClasses,
+ "constant.language": buildinConstants
+ }, "identifier");
+
+ // regexp must not have capturing parentheses. Use (?:) instead.
+ // regexps are ordered -> the first match is used
+
+ this.$rules = {
+ "start" : [
+ {
+ token : "comment",
+ regex : "\\/\\/.*$"
+ },
+ DocCommentHighlightRules.getStartRule("doc-start"),
+ {
+ token : "comment", // multi line comment
+ merge : true,
+ regex : "\\/\\*",
+ next : "comment"
+ }, {
+ token : "string.regexp",
+ regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"
+ }, {
+ token : "string",
+ regex : '"""',
+ next : "qqstring"
+ }, {
+ token : "string",
+ regex : "'''",
+ next : "qstring"
+ }, {
+ 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,
+ // TODO: Unicode escape sequences
+ // TODO: Unicode identifiers
+ regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
+ }, {
+ token : "keyword.operator",
+ regex : "\\?:|\\?\\.|\\*\\.|<=>|=~|==~|\\.@|\\*\\.@|\\.&|as|in|is|!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\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
+ merge : true,
+ regex : ".+"
+ }
+ ],
+ "qqstring" : [
+ {
+ token : "constant.language.escape",
+ regex : /\\(?:u[0-9A-Fa-f]{4}|.|$)/
+ }, {
+ token : "constant.language.escape",
+ regex : /\$[\w\d]+/
+ }, {
+ token : "constant.language.escape",
+ regex : /\$\{[^"\}]+\}?/
+ }, {
+ token : "string",
+ regex : '"{3,5}',
+ next : "start"
+ }, {
+ token : "string",
+ regex : '.+?'
+ }
+ ],
+ "qstring" : [
+ {
+ token : "constant.language.escape",
+ regex : /\\(?:u[0-9A-Fa-f]{4}|.|$)/
+ }, {
+ token : "string",
+ regex : "'{3,5}",
+ next : "start"
+ }, {
+ token : "string",
+ regex : ".+?"
+ }
+ ]
+ };
+
+ this.embedRules(DocCommentHighlightRules, "doc-",
+ [ DocCommentHighlightRules.getEndRule("start") ]);
+};
+
+oop.inherits(GroovyHighlightRules, TextHighlightRules);
+
+exports.GroovyHighlightRules = GroovyHighlightRules;
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/mode-haxe.js b/vendor/assets/javascripts/ace-src-noconflict/mode-haxe.js
new file mode 100644
index 00000000000..78910005af7
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/mode-haxe.js
@@ -0,0 +1,624 @@
+ace.define('ace/mode/haxe', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/haxe_highlight_rules', 'ace/mode/matching_brace_outdent', '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 HaxeHighlightRules = require("./haxe_highlight_rules").HaxeHighlightRules;
+var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
+var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
+var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+
+var Mode = function() {
+ this.$tokenizer = new Tokenizer(new HaxeHighlightRules().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);
+
+ var tokenizedLine = this.$tokenizer.getLineTokens(line, state);
+ var tokens = tokenizedLine.tokens;
+
+ if (tokens.length && tokens[tokens.length-1].type == "comment") {
+ return indent;
+ }
+
+ if (state == "start") {
+ var match = line.match(/^.*[\{\(\[]\s*$/);
+ 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;
+});
+ace.define('ace/mode/haxe_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+
+var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
+var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+
+var HaxeHighlightRules = function() {
+
+ var keywords = (
+ "break|case|cast|catch|class|continue|default|else|enum|extends|for|function|if|implements|import|in|inline|interface|new|override|package|private|public|return|static|super|switch|this|throw|trace|try|typedef|untyped|var|while|Array|Void|Bool|Int|UInt|Float|Dynamic|String|List|Hash|IntHash|Error|Unknown|Type|Std"
+ );
+
+ var buildinConstants = (
+ "null|true|false"
+ );
+
+ var keywordMapper = this.createKeywordMapper({
+ "variable.language": "this",
+ "keyword": keywords,
+ "constant.language": buildinConstants
+ }, "identifier");
+
+ // regexp must not have capturing parentheses. Use (?:) instead.
+ // regexps are ordered -> the first match is used
+
+ this.$rules = {
+ "start" : [
+ {
+ token : "comment",
+ regex : "\\/\\/.*$"
+ },
+ DocCommentHighlightRules.getStartRule("doc-start"),
+ {
+ token : "comment", // multi line comment
+ regex : "\\/\\*",
+ merge : true,
+ 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,
+ // TODO: Unicode escape sequences
+ // TODO: Unicode identifiers
+ regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
+ }, {
+ token : "keyword.operator",
+ regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|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
+ merge : true,
+ regex : ".+"
+ }
+ ]
+ };
+
+ this.embedRules(DocCommentHighlightRules, "doc-",
+ [ DocCommentHighlightRules.getEndRule("start") ]);
+};
+
+oop.inherits(HaxeHighlightRules, TextHighlightRules);
+
+exports.HaxeHighlightRules = HaxeHighlightRules;
+});
+
+ace.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",
+ merge : true,
+ regex : "\\s+"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "TODO"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "[^@\\*]+"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "."
+ }]
+ };
+};
+
+oop.inherits(DocCommentHighlightRules, TextHighlightRules);
+
+DocCommentHighlightRules.getStartRule = function(start) {
+ return {
+ token : "comment.doc", // doc comment
+ merge : true,
+ regex : "\\/\\*(?=\\*)",
+ next : start
+ };
+};
+
+DocCommentHighlightRules.getEndRule = function (start) {
+ return {
+ token : "comment.doc", // closing comment
+ merge : true,
+ regex : "\\*\\/",
+ next : start
+ };
+};
+
+
+exports.DocCommentHighlightRules = DocCommentHighlightRules;
+
+});
+
+ace.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;
+});
+
+ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour'], function(require, exports, module) {
+
+
+var oop = require("../../lib/oop");
+var Behaviour = require("../behaviour").Behaviour;
+
+var CstyleBehaviour = function () {
+
+ this.add("braces", "insertion", function (state, action, editor, session, text) {
+ if (text == '{') {
+ var selection = editor.getSelectionRange();
+ var selected = session.doc.getTextRange(selection);
+ if (selected !== "") {
+ return {
+ text: '{' + selected + '}',
+ selection: false
+ };
+ } else {
+ 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) {
+ return {
+ text: '',
+ selection: [1, 1]
+ };
+ }
+ }
+ } else if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ if (rightChar == '}') {
+ var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column + 1});
+ if (!openBracePos)
+ return null;
+
+ var indent = this.getNextLineIndent(state, line.substring(0, line.length - 1), session.getTabString());
+ var next_indent = this.$getIndent(session.doc.getLine(openBracePos.row));
+
+ return {
+ text: '\n' + indent + '\n' + next_indent,
+ 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;
+ }
+ }
+ });
+
+ this.add("parens", "insertion", function (state, action, editor, session, text) {
+ if (text == '(') {
+ var selection = editor.getSelectionRange();
+ var selected = session.doc.getTextRange(selection);
+ if (selected !== "") {
+ return {
+ text: '(' + selected + ')',
+ selection: false
+ };
+ } else {
+ 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) {
+ 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 !== "") {
+ return {
+ text: '[' + selected + ']',
+ selection: false
+ };
+ } else {
+ 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) {
+ 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 !== "") {
+ 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);
+
+ // We're escaped.
+ if (leftChar == '\\') {
+ return null;
+ }
+
+ // Find what token we're inside.
+ 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;
+ }
+
+ // Try and be smart about when we auto insert.
+ 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)))) {
+ return {
+ text: quote + quote,
+ selection: [1,1]
+ };
+ } else if (token && token.type === "string") {
+ // Ignore input and move right one if we're typing over the closing quote.
+ 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 == '"') {
+ range.end.column++;
+ return range;
+ }
+ }
+ });
+
+};
+
+oop.inherits(CstyleBehaviour, Behaviour);
+
+exports.CstyleBehaviour = CstyleBehaviour;
+});
+
+ace.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);
+
+ var range = session.getCommentFoldRange(row, i + match[0].length);
+ range.end.column -= 2;
+ return range;
+ }
+
+ if (foldStyle !== "markbeginend")
+ return;
+
+ var match = line.match(this.foldingStopMarker);
+ if (match) {
+ var i = match.index + match[0].length;
+
+ if (match[2]) {
+ var range = session.getCommentFoldRange(row, i);
+ range.end.column -= 2;
+ return range;
+ }
+
+ var end = {row: row, column: i};
+ var start = session.$findOpeningBracket(match[1], end);
+
+ if (!start)
+ return;
+
+ start.column++;
+ end.column--;
+
+ return Range.fromPoints(start, end);
+ }
+ };
+
+}).call(FoldMode.prototype);
+
+});
+
+ace.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;
+
+ // must return "" if there's no fold, to enable caching
+ 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);
+ };
+
+}).call(FoldMode.prototype);
+
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/mode-html.js b/vendor/assets/javascripts/ace-src-noconflict/mode-html.js
new file mode 100644
index 00000000000..0ea36845d75
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/mode-html.js
@@ -0,0 +1,1950 @@
+/* ***** 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 ***** */
+
+ace.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;
+});
+
+ace.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) {
+ var errors = [];
+ for (var i=0; i<results.data.length; i++) {
+ var error = results.data[i];
+ if (error)
+ errors.push({
+ row: error.line-1,
+ column: error.character-1,
+ text: error.reason,
+ type: "warning",
+ lint: error
+ });
+ }
+ session.setAnnotations(errors);
+ });
+
+ worker.on("narcissus", function(e) {
+ session.setAnnotations([e.data]);
+ });
+
+ worker.on("terminate", function() {
+ session.clearAnnotations();
+ });
+
+ return worker;
+ };
+
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+});
+
+ace.define('ace/mode/javascript_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/unicode', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var unicode = require("../unicode");
+var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
+var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+
+var JavaScriptHighlightRules = function() {
+ // see: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects
+ 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
+ "invalid.deprecated":
+ "__parent__|__count__|escape|unescape|with|__proto__|debugger",
+ "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|",
+ "storage.type":
+ "const|let|var|function",
+ "invalid.illegal":
+ "class|enum|extends|super|export|implements|private|" +
+ "public|interface|package|protected|static",
+ "constant.language":
+ "null|Infinity|NaN|undefined",
+ }, "identifier");
+
+
+ // keywords which can be followed by regular expressions
+ var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield";
+
+ // TODO: Unicode escape sequences
+ 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
+ ".)";
+
+ // regexp must not have capturing parentheses. Use (?:) instead.
+ // regexps are ordered -> the first match is used
+
+ this.$rules = {
+ "start" : [
+ {
+ token : "comment",
+ regex : /\/\/.*$/
+ },
+ DocCommentHighlightRules.getStartRule("doc-start"),
+ {
+ token : "comment", // multi line comment
+ merge : true,
+ 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/
+ }, {
+ // Sound.prototype.play =
+ token : [
+ "storage.type", "punctuation.operator", "support.function",
+ "punctuation.operator", "entity.name.function", "text","keyword.operator"
+ ],
+ regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)",
+ next: "function_arguments"
+ }, {
+ // Sound.play = function() { }
+ 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"
+ }, {
+ // play = function() { }
+ token : [
+ "entity.name.function", "text", "keyword.operator", "text", "storage.type",
+ "text", "paren.lparen"
+ ],
+ regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ // Sound.play = function play() { }
+ 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"
+ }, {
+ // function myFunc(arg) { }
+ token : [
+ "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ ],
+ regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ // foobar: function() { }
+ token : [
+ "entity.name.function", "text", "punctuation.operator",
+ "text", "storage.type", "text", "paren.lparen"
+ ],
+ regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ // : function() { } (this is for issues with 'foo': function() { })
+ token : [
+ "text", "text", "storage.type", "text", "paren.lparen"
+ ],
+ regex : "(:)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ token : "constant.language.boolean",
+ regex : /(?:true|false)\b/
+ }, {
+ 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 : /!|\$|%|&|\*|\-\-|\-|\+\+|\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=|\b(?:in|instanceof|new|delete|typeof|void)/,
+ 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: /^#!.*$/
+ }, {
+ token : "text",
+ regex : /\s+/
+ }
+ ],
+ // regular expressions are only allowed after certain tokens. This
+ // makes sure we don't mix up regexps with the divison operator
+ "regex_allowed": [
+ DocCommentHighlightRules.getStartRule("doc-start"),
+ {
+ token : "comment", // multi line comment
+ merge : true,
+ regex : "\\/\\*",
+ next : "comment_regex_allowed"
+ }, {
+ token : "comment",
+ regex : "\\/\\/.*$"
+ }, {
+ token: "string.regexp",
+ regex: "\\/",
+ next: "regex",
+ merge: true
+ }, {
+ token : "text",
+ regex : "\\s+"
+ }, {
+ // immediately return to the start mode without matching
+ // anything
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "regex": [
+ {
+ // escapes
+ token: "regexp.keyword.operator",
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
+ }, {
+ // flag
+ token: "string.regexp",
+ regex: "/\\w*",
+ next: "start",
+ merge: true
+ }, {
+ // invalid operators
+ token : "invalid",
+ regex: /\{\d+,?(?:\d+)?}[+*]|[+*^$?][+*]|\?\?/ // |[^$][?]
+ }, {
+ // operators
+ token : "constant.language.escape",
+ regex: /\(\?[:=!]|\)|\{\d+,?(?:\d+)?}|[+*]\?|[(|)$^+*?]/
+ }, {
+ token: "string.regexp",
+ regex: /{|[^\[\\{()$^+*?\/]+/,
+ merge: true
+ }, {
+ token: "constant.language.escape",
+ regex: /\[\^?/,
+ next: "regex_character_class",
+ merge: true
+ }, {
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "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",
+ merge: true
+ }, {
+ token: "constant.language.escape",
+ regex: "-",
+ }, {
+ token: "string.regexp.charachterclass",
+ regex: /[^\]\-\\]+/,
+ merge: true
+ }, {
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "function_arguments": [
+ {
+ token: "variable.parameter",
+ regex: identifierRe
+ }, {
+ token: "punctuation.operator",
+ regex: "[, ]+",
+ merge: true
+ }, {
+ token: "punctuation.operator",
+ regex: "$",
+ merge: true
+ }, {
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "comment_regex_allowed" : [
+ {
+ token : "comment", // closing comment
+ regex : ".*?\\*\\/",
+ merge : true,
+ next : "regex_allowed"
+ }, {
+ token : "comment", // comment spanning whole line
+ merge : true,
+ regex : ".+"
+ }
+ ],
+ "comment" : [
+ {
+ token : "comment", // closing comment
+ regex : ".*?\\*\\/",
+ merge : true,
+ next : "start"
+ }, {
+ token : "comment", // comment spanning whole line
+ merge : true,
+ regex : ".+"
+ }
+ ],
+ "qqstring" : [
+ {
+ token : "constant.language.escape",
+ regex : escapedRe
+ }, {
+ token : "string",
+ regex : '[^"\\\\]+',
+ merge : true
+ }, {
+ token : "string",
+ regex : "\\\\$",
+ next : "qqstring",
+ merge : true
+ }, {
+ token : "string",
+ regex : '"|$',
+ next : "start",
+ merge : true
+ }
+ ],
+ "qstring" : [
+ {
+ token : "constant.language.escape",
+ regex : escapedRe
+ }, {
+ token : "string",
+ regex : "[^'\\\\]+",
+ merge : true
+ }, {
+ token : "string",
+ regex : "\\\\$",
+ next : "qstring",
+ merge : true
+ }, {
+ token : "string",
+ regex : "'|$",
+ next : "start",
+ merge : true
+ }
+ ]
+ };
+
+ this.embedRules(DocCommentHighlightRules, "doc-",
+ [ DocCommentHighlightRules.getEndRule("start") ]);
+};
+
+oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
+
+exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
+});
+
+ace.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",
+ merge : true,
+ regex : "\\s+"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "TODO"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "[^@\\*]+"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "."
+ }]
+ };
+};
+
+oop.inherits(DocCommentHighlightRules, TextHighlightRules);
+
+DocCommentHighlightRules.getStartRule = function(start) {
+ return {
+ token : "comment.doc", // doc comment
+ merge : true,
+ regex : "\\/\\*(?=\\*)",
+ next : start
+ };
+};
+
+DocCommentHighlightRules.getEndRule = function (start) {
+ return {
+ token : "comment.doc", // closing comment
+ merge : true,
+ regex : "\\*\\/",
+ next : start
+ };
+};
+
+
+exports.DocCommentHighlightRules = DocCommentHighlightRules;
+
+});
+
+ace.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;
+});
+
+ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour'], function(require, exports, module) {
+
+
+var oop = require("../../lib/oop");
+var Behaviour = require("../behaviour").Behaviour;
+
+var CstyleBehaviour = function () {
+
+ this.add("braces", "insertion", function (state, action, editor, session, text) {
+ if (text == '{') {
+ var selection = editor.getSelectionRange();
+ var selected = session.doc.getTextRange(selection);
+ if (selected !== "") {
+ return {
+ text: '{' + selected + '}',
+ selection: false
+ };
+ } else {
+ 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) {
+ return {
+ text: '',
+ selection: [1, 1]
+ };
+ }
+ }
+ } else if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ if (rightChar == '}') {
+ var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column + 1});
+ if (!openBracePos)
+ return null;
+
+ var indent = this.getNextLineIndent(state, line.substring(0, line.length - 1), session.getTabString());
+ var next_indent = this.$getIndent(session.doc.getLine(openBracePos.row));
+
+ return {
+ text: '\n' + indent + '\n' + next_indent,
+ 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;
+ }
+ }
+ });
+
+ this.add("parens", "insertion", function (state, action, editor, session, text) {
+ if (text == '(') {
+ var selection = editor.getSelectionRange();
+ var selected = session.doc.getTextRange(selection);
+ if (selected !== "") {
+ return {
+ text: '(' + selected + ')',
+ selection: false
+ };
+ } else {
+ 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) {
+ 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 !== "") {
+ return {
+ text: '[' + selected + ']',
+ selection: false
+ };
+ } else {
+ 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) {
+ 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 !== "") {
+ 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);
+
+ // We're escaped.
+ if (leftChar == '\\') {
+ return null;
+ }
+
+ // Find what token we're inside.
+ 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;
+ }
+
+ // Try and be smart about when we auto insert.
+ 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)))) {
+ return {
+ text: quote + quote,
+ selection: [1,1]
+ };
+ } else if (token && token.type === "string") {
+ // Ignore input and move right one if we're typing over the closing quote.
+ 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 == '"') {
+ range.end.column++;
+ return range;
+ }
+ }
+ });
+
+};
+
+oop.inherits(CstyleBehaviour, Behaviour);
+
+exports.CstyleBehaviour = CstyleBehaviour;
+});
+
+ace.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);
+
+ var range = session.getCommentFoldRange(row, i + match[0].length);
+ range.end.column -= 2;
+ return range;
+ }
+
+ if (foldStyle !== "markbeginend")
+ return;
+
+ var match = line.match(this.foldingStopMarker);
+ if (match) {
+ var i = match.index + match[0].length;
+
+ if (match[2]) {
+ var range = session.getCommentFoldRange(row, i);
+ range.end.column -= 2;
+ return range;
+ }
+
+ var end = {row: row, column: i};
+ var start = session.$findOpeningBracket(match[1], end);
+
+ if (!start)
+ return;
+
+ start.column++;
+ end.column--;
+
+ return Range.fromPoints(start, end);
+ }
+ };
+
+}).call(FoldMode.prototype);
+
+});
+
+ace.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;
+
+ // must return "" if there's no fold, to enable caching
+ 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);
+ };
+
+}).call(FoldMode.prototype);
+
+});
+
+ace.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/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 CStyleFoldMode = require("./folding/cstyle").FoldMode;
+
+var Mode = function() {
+ this.$tokenizer = new Tokenizer(new CssHighlightRules().getRules(), "i");
+ this.$outdent = new MatchingBraceOutdent();
+ this.foldingRules = new CStyleFoldMode();
+};
+oop.inherits(Mode, TextMode);
+
+(function() {
+
+ this.foldingRules = "cStyle";
+
+ this.getNextLineIndent = function(state, line, tab) {
+ var indent = this.$getIndent(line);
+
+ // ignore braces in comments
+ 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) {
+ var errors = [];
+ e.data.forEach(function(message) {
+ errors.push({
+ row: message.line - 1,
+ column: message.col - 1,
+ text: message.message,
+ type: message.type,
+ lint: message
+ });
+ });
+
+ session.setAnnotations(errors);
+ });
+ return worker;
+ };
+
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+
+});
+
+ace.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 CssHighlightRules = function() {
+ var keywordMapper = this.createKeywordMapper({
+ "support.type": "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",
+ "support.function": "rgb|rgba|url|attr|counter|counters",
+ "support.constant": "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",
+ "support.constant.color": "aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow",
+ "support.constant.fonts": "arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace"
+ }, "text", true);
+
+ // regexp must not have capturing parentheses. Use (?:) instead.
+ // regexps are ordered -> the first match is used
+
+ var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
+ var pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
+ var 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 base_ruleset = [
+ {
+ token : "comment", // multi line comment
+ merge : true,
+ 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 : "([0-9]+)"
+ }, {
+ 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
+ merge : true,
+ 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
+ merge : true,
+ 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
+ merge : true,
+ 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;
+
+});
+
+ace.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() {
+
+ // regexp must not have capturing parentheses
+ // regexps are ordered -> the first match is used
+ this.$rules = {
+ start : [{
+ token : "text",
+ merge : true,
+ regex : "<\\!\\[CDATA\\[",
+ next : "cdata"
+ }, {
+ token : "xml_pe",
+ regex : "<\\?.*?\\?>"
+ }, {
+ token : "comment",
+ merge : true,
+ regex : "<\\!--",
+ next : "comment"
+ }, {
+ token : "xml_pe",
+ regex : "<\\!.*?>"
+ }, {
+ token : "meta.tag",
+ regex : "<(?=\s*script\\b)",
+ next : "script"
+ }, {
+ token : "meta.tag",
+ regex : "<(?=\s*style\\b)",
+ next : "style"
+ }, {
+ token : "meta.tag", // opening tag
+ regex : "<\\/?",
+ next : "tag"
+ }, {
+ token : "text",
+ regex : "\\s+"
+ }, {
+ token : "constant.character.entity",
+ regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
+ }, {
+ token : "text",
+ regex : "[^<]+"
+ } ],
+
+ cdata : [ {
+ token : "text",
+ regex : "\\]\\]>",
+ next : "start"
+ }, {
+ token : "text",
+ merge : true,
+ regex : "\\s+"
+ }, {
+ token : "text",
+ merge : true,
+ regex : ".+"
+ } ],
+
+ comment : [ {
+ token : "comment",
+ regex : ".*?-->",
+ next : "start"
+ }, {
+ token : "comment",
+ merge : true,
+ regex : ".+"
+ } ]
+ };
+
+ 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;
+});
+
+ace.define('ace/mode/xml_util', ['require', 'exports', 'module' ], function(require, exports, module) {
+
+
+function string(state) {
+ return [{
+ token : "string",
+ regex : '".*?"'
+ }, {
+ token : "string", // multi line string start
+ merge : true,
+ regex : '["].*',
+ next : state + "_qqstring"
+ }, {
+ token : "string",
+ regex : "'.*?'"
+ }, {
+ token : "string", // multi line string start
+ merge : true,
+ regex : "['].*",
+ next : state + "_qstring"
+ }];
+}
+
+function multiLineString(quote, state) {
+ return [{
+ token : "string",
+ merge : true,
+ regex : ".*?" + quote,
+ next : state
+ }, {
+ token : "string",
+ merge : true,
+ regex : '.+'
+ }];
+}
+
+exports.tag = function(states, name, nextState, tagMap) {
+ states[name] = [{
+ token : "text",
+ regex : "\\s+"
+ }, {
+ //token : "meta.tag",
+
+ token : !tagMap ? "meta.tag.tag-name" : function(value) {
+ if (tagMap[value])
+ return "meta.tag.tag-name." + tagMap[value];
+ else
+ return "meta.tag.tag-name";
+ },
+ merge : true,
+ 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",
+ merge : true,
+ 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));
+};
+
+});
+
+ace.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;
+});
+
+ace.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;
+});
+
+ace.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({
+ // void elements
+ "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,
+
+ // optional tags
+ "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);
+
+});
+
+ace.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);
+
+});
+
+ace.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/vendor/assets/javascripts/ace-src-noconflict/mode-jade.js b/vendor/assets/javascripts/ace-src-noconflict/mode-jade.js
new file mode 100644
index 00000000000..c01a359835a
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/mode-jade.js
@@ -0,0 +1,2038 @@
+/* ***** 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):
+ *
+ * Garen J. Torikian <gjtorikian @ gmail DOT com>
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+ace.define('ace/mode/jade', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/jade_highlight_rules'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var TextMode = require("./text").Mode;
+var Tokenizer = require("../tokenizer").Tokenizer;
+var JadeHighlightRules = require("./jade_highlight_rules").JadeHighlightRules;
+// var JavascriptMode = require("ace/mode/javascript").Mode;
+// var CssMode = require("ace/mode/css").Mode;
+
+var Mode = function() {
+ var highlighter = new JadeHighlightRules();
+
+ this.$tokenizer = new Tokenizer(highlighter.getRules());
+};
+oop.inherits(Mode, TextMode);
+
+(function() {
+ // Extra logic goes here.
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+});
+
+/*
+ THIS FILE WAS AUTOGENERATED BY mode_highlight_rules.tmpl.js (UUID: C5B73B98-5F2A-42E3-9F0E-028A74A9FE4B)
+*/
+
+ace.define('ace/mode/jade_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules', 'ace/mode/markdown_highlight_rules', 'ace/mode/scss_highlight_rules', 'ace/mode/less_highlight_rules', 'ace/mode/coffee_highlight_rules', 'ace/mode/javascript_highlight_rules'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+var MarkdownHighlightRules = require("./markdown_highlight_rules").MarkdownHighlightRules;
+var SassHighlightRules = require("./scss_highlight_rules").ScssHighlightRules;
+var LessHighlightRules = require("./less_highlight_rules").LessHighlightRules;
+var CoffeeHighlightRules = require("./coffee_highlight_rules").CoffeeHighlightRules;
+var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
+
+function mixin_embed(tag, prefix) {
+ return {
+ token : "entity.name.function.jade",
+ regex : "^\\s*\\:" + tag,
+ next : prefix + "start"
+ };
+}
+
+var JadeHighlightRules = function() {
+
+ 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
+ ".)";
+
+ // regexp must not have capturing parentheses. Use (?:) instead.
+ // regexps are ordered -> the first match is used
+
+ this.$rules =
+ {
+ "start": [
+ {
+ "token": "keyword.control.import.include.jade",
+ "regex": "\\s*\\binclude\\b"
+ },
+ {
+ "token": "keyword.other.doctype.jade",
+ "regex": "^!!!\\s*(?:[a-zA-Z0-9-_]+)?"
+ },
+ {
+ "token" : "punctuation.section.comment",
+ "regex" : "^\\s*\/\/(?:\\s*[^-\\s]|\\s+\\S)(?:.*$)",
+ },
+ {
+ "token" : function(space, text) {
+ return "punctuation.section.comment";
+ },
+ "regex" : "^((\\s*)\/\/)(?:\\s*$)",
+ "next": "comment_block"
+ },
+ mixin_embed("markdown", "markdown-"),
+ mixin_embed("sass", "sass-"),
+ mixin_embed("less", "less-"),
+ mixin_embed("coffee", "coffee-"),
+ /*
+ {
+ "token": {
+ "2": {
+ "name": "entity.name.function.jade"
+ }
+ },
+ "regex": "^(\\s*)(\\:cdata)",
+ "next": "state_9"
+ },*/
+ // match stuff like: mixin dialog-title-desc(title, desc)
+ {
+ "token": [ "storage.type.function.jade",
+ "entity.name.function.jade",
+ "punctuation.definition.parameters.begin.jade",
+ "variable.parameter.function.jade",
+ "punctuation.definition.parameters.end.jade"
+ ],
+ "regex": "^(\\s*mixin)( [\\w\\-]+)(\\s*\\()(.*?)(\\))"
+ },
+ // match stuff like: mixin dialog-title-desc
+ {
+ "token": [ "storage.type.function.jade", "entity.name.function.jade"],
+ "regex": "^(\\s*mixin)( [\\w\\-]+)"
+ },
+ /* {
+ "token": "source.js.embedded.jade",
+ "regex": "^\\s*-|=|!=",
+ "next": "js_code"
+ },*/
+ /*{
+ "token": "entity.name.tag.script.jade",
+ "regex": "^\\s*script",
+ "next": "js_code_tag"
+ },*/
+ {
+ "token": "string.interpolated.jade",
+ "regex": "[#!]\\{[^\\}]+\\}"
+ },
+ // Match any tag, id or class. skip AST filters
+ {
+ "token": ["meta.tag.any.jade", "entity.variable.tag.jade"],
+ "regex": /^\s*(?!\w+\:)(?:[\w]+|(?=\.|#)])/,
+ "next": "tag_single"
+ },
+ {
+ "token": "suport.type.attribute.id.jade",
+ "regex": "#\\w+"
+ },
+ {
+ "token": "suport.type.attribute.class.jade",
+ "regex": "\\.\\w+"
+ },
+ {
+ "token": "punctuation",
+ "regex": "\\s*(?:\\()",
+ "next": "tag_attributes"
+ }
+ ],
+ "comment_block": [
+ {
+ "token": function(text) {
+ return "text";
+ },
+ "regex": "^(\\1\\S|$)",
+ "captures": "1",
+ "next": "start"
+ },
+ {
+ "token": "comment.block.jade",
+ "merge" : true,
+ "regex" : ".+"
+ }
+ ],
+ /*
+
+ "state_9": [
+ {
+ "token": "TODO",
+ "regex": "^(?!\\1\\s+)",
+ "next": "start"
+ },
+ {
+ "token": "TODO",
+ "regex": ".+",
+ "next": "state_9"
+ }
+ ],*/
+ /*"js_code": [
+ {
+ "token": "keyword.control.js",
+ "regex": "\\beach\\b"
+ },
+ {
+ "token": "text",
+ "regex": "$",
+ "next": "start"
+ }
+ ],*/
+ /*"js_code_tag": [
+ {
+ "include": "source.js"
+ },
+ {
+ "token": "TODO",
+ "regex": "^((?=(\\1)([\\w#\\.]|$\\n?))|^$\\n?)",
+ "next": "start"
+ }
+ ],*/
+ "tag_single": [
+ {
+ "token": "suport.type.attribute.class.jade",
+ "regex": "\\.[\\w-]+"
+ },
+ {
+ "token": "suport.type.attribute.id.jade",
+ "regex": "#[\\w-]+"
+ },
+ {
+ "token": ["text", "punctuation"],
+ "regex": "($)|((?!\\.|#|=|-))",
+ "next": "start"
+ }
+ ],
+ "tag_attributes": [
+ {
+ "token": ["entity.other.attribute-name.jade", "punctuation"],
+ "regex": "\\b([a-zA-Z:\\.-]+)(=)",
+ "next": "attribute_strings"
+ },
+ {
+ "token": "punctuation",
+ "regex": "\\)",
+ "next": "start"
+ }
+ ],
+ "attribute_strings": [
+ {
+ "token" : "string",
+ "regex" : "'(?=.)",
+ "next" : "qstring"
+ },
+ {
+ "token" : "string",
+ "regex" : '"(?=.)',
+ "next" : "qqstring"
+ }
+ ],
+ "qqstring" : [
+ {
+ token : "constant.language.escape",
+ regex : escapedRe
+ }, {
+ token : "string",
+ regex : '[^"\\\\]+',
+ merge : true
+ }, {
+ token : "string",
+ regex : "\\\\$",
+ next : "qqstring",
+ merge : true
+ }, {
+ token : "string",
+ regex : '"|$',
+ next : "tag_attributes",
+ merge : true
+ }
+ ],
+ "qstring" : [
+ {
+ token : "constant.language.escape",
+ regex : escapedRe
+ }, {
+ token : "string",
+ regex : "[^'\\\\]+",
+ merge : true
+ }, {
+ token : "string",
+ regex : "\\\\$",
+ next : "qstring",
+ merge : true
+ }, {
+ token : "string",
+ regex : "'|$",
+ next : "tag_attributes",
+ merge : true
+ }
+ ]
+};
+};
+
+oop.inherits(JadeHighlightRules, TextHighlightRules);
+
+exports.JadeHighlightRules = JadeHighlightRules;
+});
+
+ace.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() {
+
+ // regexp must not have capturing parentheses
+ // regexps are ordered -> the first match is used
+
+ this.$rules = {
+ "start" : [ {
+ token : "empty_line",
+ regex : '^$'
+ }, { // code span `
+ token : ["support.function", "support.function", "support.function"],
+ regex : "(`+)([^\\r]*?[^`])(\\1)"
+ }, { // code block
+ token : "support.function",
+ regex : "^[ ]{4}.+"
+ }, { // 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 : "^```[a-zA-Z]+\\s*$",
+ next : "githubblock"
+ }, { // block quote
+ token : "string",
+ regex : "^>[ ].+$",
+ next : "blockquote"
+ }, { // 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]*)?)"+
+ "(\\))"
+ }, { // HR *
+ token : "constant",
+ regex : "^[ ]{0,2}(?:[ ]?\\*[ ]?){3,}\\s*$"
+ }, { // HR -
+ token : "constant",
+ regex : "^[ ]{0,2}(?:[ ]?\\-[ ]?){3,}\\s*$"
+ }, { // HR _
+ token : "constant",
+ regex : "^[ ]{0,2}(?:[ ]?\\_[ ]?){3,}\\s*$"
+ }, { // list
+ token : "markup.list",
+ regex : "^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+",
+ next : "listblock"
+ }, { // strong ** __
+ token : ["string", "string", "string"],
+ regex : "([*]{2}|[_]{2}(?=\\S))([^\\r]*?\\S[*_]*)(\\1)"
+ }, { // emphasis * _
+ token : ["string", "string", "string"],
+ regex : "([*]|[_](?=\\S))([^\\r]*?\\S[*_]*)(\\1)"
+ }, { //
+ token : ["text", "url", "text"],
+ regex : "(<)("+
+ "(?:https?|ftp|dict):[^'\">\\s]+"+
+ "|"+
+ "(?:mailto:)?[-.\\w]+\\@[-a-z0-9]+(?:\\.[-a-z0-9]+)*\\.[a-z]+"+
+ ")(>)"
+ }, {
+ token : "text",
+ regex : "[^\\*_%$`\\[#<>]+"
+ } ],
+
+ "listblock" : [ { // Lists only escape on completely blank lines.
+ token : "empty_line",
+ regex : "^$",
+ next : "start"
+ }, {
+ token : "markup.list",
+ regex : ".+"
+ } ],
+
+ "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"
+ }]);
+};
+oop.inherits(MarkdownHighlightRules, TextHighlightRules);
+
+exports.MarkdownHighlightRules = MarkdownHighlightRules;
+});
+
+ace.define('ace/mode/javascript_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/unicode', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var unicode = require("../unicode");
+var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
+var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+
+var JavaScriptHighlightRules = function() {
+ // see: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects
+ 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
+ "invalid.deprecated":
+ "__parent__|__count__|escape|unescape|with|__proto__|debugger",
+ "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|",
+ "storage.type":
+ "const|let|var|function",
+ "invalid.illegal":
+ "class|enum|extends|super|export|implements|private|" +
+ "public|interface|package|protected|static",
+ "constant.language":
+ "null|Infinity|NaN|undefined",
+ }, "identifier");
+
+
+ // keywords which can be followed by regular expressions
+ var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield";
+
+ // TODO: Unicode escape sequences
+ 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
+ ".)";
+
+ // regexp must not have capturing parentheses. Use (?:) instead.
+ // regexps are ordered -> the first match is used
+
+ this.$rules = {
+ "start" : [
+ {
+ token : "comment",
+ regex : /\/\/.*$/
+ },
+ DocCommentHighlightRules.getStartRule("doc-start"),
+ {
+ token : "comment", // multi line comment
+ merge : true,
+ 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/
+ }, {
+ // Sound.prototype.play =
+ token : [
+ "storage.type", "punctuation.operator", "support.function",
+ "punctuation.operator", "entity.name.function", "text","keyword.operator"
+ ],
+ regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)",
+ next: "function_arguments"
+ }, {
+ // Sound.play = function() { }
+ 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"
+ }, {
+ // play = function() { }
+ token : [
+ "entity.name.function", "text", "keyword.operator", "text", "storage.type",
+ "text", "paren.lparen"
+ ],
+ regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ // Sound.play = function play() { }
+ 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"
+ }, {
+ // function myFunc(arg) { }
+ token : [
+ "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ ],
+ regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ // foobar: function() { }
+ token : [
+ "entity.name.function", "text", "punctuation.operator",
+ "text", "storage.type", "text", "paren.lparen"
+ ],
+ regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ // : function() { } (this is for issues with 'foo': function() { })
+ token : [
+ "text", "text", "storage.type", "text", "paren.lparen"
+ ],
+ regex : "(:)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ token : "constant.language.boolean",
+ regex : /(?:true|false)\b/
+ }, {
+ 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 : /!|\$|%|&|\*|\-\-|\-|\+\+|\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=|\b(?:in|instanceof|new|delete|typeof|void)/,
+ 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: /^#!.*$/
+ }, {
+ token : "text",
+ regex : /\s+/
+ }
+ ],
+ // regular expressions are only allowed after certain tokens. This
+ // makes sure we don't mix up regexps with the divison operator
+ "regex_allowed": [
+ DocCommentHighlightRules.getStartRule("doc-start"),
+ {
+ token : "comment", // multi line comment
+ merge : true,
+ regex : "\\/\\*",
+ next : "comment_regex_allowed"
+ }, {
+ token : "comment",
+ regex : "\\/\\/.*$"
+ }, {
+ token: "string.regexp",
+ regex: "\\/",
+ next: "regex",
+ merge: true
+ }, {
+ token : "text",
+ regex : "\\s+"
+ }, {
+ // immediately return to the start mode without matching
+ // anything
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "regex": [
+ {
+ // escapes
+ token: "regexp.keyword.operator",
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
+ }, {
+ // flag
+ token: "string.regexp",
+ regex: "/\\w*",
+ next: "start",
+ merge: true
+ }, {
+ // invalid operators
+ token : "invalid",
+ regex: /\{\d+,?(?:\d+)?}[+*]|[+*^$?][+*]|\?\?/ // |[^$][?]
+ }, {
+ // operators
+ token : "constant.language.escape",
+ regex: /\(\?[:=!]|\)|\{\d+,?(?:\d+)?}|[+*]\?|[(|)$^+*?]/
+ }, {
+ token: "string.regexp",
+ regex: /{|[^\[\\{()$^+*?\/]+/,
+ merge: true
+ }, {
+ token: "constant.language.escape",
+ regex: /\[\^?/,
+ next: "regex_character_class",
+ merge: true
+ }, {
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "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",
+ merge: true
+ }, {
+ token: "constant.language.escape",
+ regex: "-",
+ }, {
+ token: "string.regexp.charachterclass",
+ regex: /[^\]\-\\]+/,
+ merge: true
+ }, {
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "function_arguments": [
+ {
+ token: "variable.parameter",
+ regex: identifierRe
+ }, {
+ token: "punctuation.operator",
+ regex: "[, ]+",
+ merge: true
+ }, {
+ token: "punctuation.operator",
+ regex: "$",
+ merge: true
+ }, {
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "comment_regex_allowed" : [
+ {
+ token : "comment", // closing comment
+ regex : ".*?\\*\\/",
+ merge : true,
+ next : "regex_allowed"
+ }, {
+ token : "comment", // comment spanning whole line
+ merge : true,
+ regex : ".+"
+ }
+ ],
+ "comment" : [
+ {
+ token : "comment", // closing comment
+ regex : ".*?\\*\\/",
+ merge : true,
+ next : "start"
+ }, {
+ token : "comment", // comment spanning whole line
+ merge : true,
+ regex : ".+"
+ }
+ ],
+ "qqstring" : [
+ {
+ token : "constant.language.escape",
+ regex : escapedRe
+ }, {
+ token : "string",
+ regex : '[^"\\\\]+',
+ merge : true
+ }, {
+ token : "string",
+ regex : "\\\\$",
+ next : "qqstring",
+ merge : true
+ }, {
+ token : "string",
+ regex : '"|$',
+ next : "start",
+ merge : true
+ }
+ ],
+ "qstring" : [
+ {
+ token : "constant.language.escape",
+ regex : escapedRe
+ }, {
+ token : "string",
+ regex : "[^'\\\\]+",
+ merge : true
+ }, {
+ token : "string",
+ regex : "\\\\$",
+ next : "qstring",
+ merge : true
+ }, {
+ token : "string",
+ regex : "'|$",
+ next : "start",
+ merge : true
+ }
+ ]
+ };
+
+ this.embedRules(DocCommentHighlightRules, "doc-",
+ [ DocCommentHighlightRules.getEndRule("start") ]);
+};
+
+oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
+
+exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
+});
+
+ace.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",
+ merge : true,
+ regex : "\\s+"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "TODO"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "[^@\\*]+"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "."
+ }]
+ };
+};
+
+oop.inherits(DocCommentHighlightRules, TextHighlightRules);
+
+DocCommentHighlightRules.getStartRule = function(start) {
+ return {
+ token : "comment.doc", // doc comment
+ merge : true,
+ regex : "\\/\\*(?=\\*)",
+ next : start
+ };
+};
+
+DocCommentHighlightRules.getEndRule = function (start) {
+ return {
+ token : "comment.doc", // closing comment
+ merge : true,
+ regex : "\\*\\/",
+ next : start
+ };
+};
+
+
+exports.DocCommentHighlightRules = DocCommentHighlightRules;
+
+});
+
+ace.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() {
+
+ // regexp must not have capturing parentheses
+ // regexps are ordered -> the first match is used
+ this.$rules = {
+ start : [{
+ token : "text",
+ regex : "<\\!\\[CDATA\\[",
+ next : "cdata"
+ }, {
+ token : "xml_pe",
+ regex : "<\\?.*?\\?>"
+ }, {
+ token : "comment",
+ merge : true,
+ regex : "<\\!--",
+ next : "comment"
+ }, {
+ token : "xml_pe",
+ regex : "<\\!.*?>"
+ }, {
+ token : "meta.tag", // opening tag
+ regex : "<\\/?",
+ next : "tag"
+ }, {
+ token : "text",
+ regex : "\\s+"
+ }, {
+ token : "constant.character.entity",
+ regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
+ }, {
+ token : "text",
+ regex : "[^<]+"
+ }],
+
+ cdata : [{
+ token : "text",
+ regex : "\\]\\]>",
+ next : "start"
+ }, {
+ token : "text",
+ regex : "\\s+"
+ }, {
+ token : "text",
+ regex : "(?:[^\\]]|\\](?!\\]>))+"
+ }],
+
+ comment : [{
+ token : "comment",
+ regex : ".*?-->",
+ next : "start"
+ }, {
+ token : "comment",
+ merge : true,
+ regex : ".+"
+ }]
+ };
+
+ xmlUtil.tag(this.$rules, "tag", "start");
+};
+
+oop.inherits(XmlHighlightRules, TextHighlightRules);
+
+exports.XmlHighlightRules = XmlHighlightRules;
+});
+
+ace.define('ace/mode/xml_util', ['require', 'exports', 'module' ], function(require, exports, module) {
+
+
+function string(state) {
+ return [{
+ token : "string",
+ regex : '".*?"'
+ }, {
+ token : "string", // multi line string start
+ merge : true,
+ regex : '["].*',
+ next : state + "_qqstring"
+ }, {
+ token : "string",
+ regex : "'.*?'"
+ }, {
+ token : "string", // multi line string start
+ merge : true,
+ regex : "['].*",
+ next : state + "_qstring"
+ }];
+}
+
+function multiLineString(quote, state) {
+ return [{
+ token : "string",
+ merge : true,
+ regex : ".*?" + quote,
+ next : state
+ }, {
+ token : "string",
+ merge : true,
+ regex : '.+'
+ }];
+}
+
+exports.tag = function(states, name, nextState, tagMap) {
+ states[name] = [{
+ token : "text",
+ regex : "\\s+"
+ }, {
+ //token : "meta.tag",
+
+ token : !tagMap ? "meta.tag.tag-name" : function(value) {
+ if (tagMap[value])
+ return "meta.tag.tag-name." + tagMap[value];
+ else
+ return "meta.tag.tag-name";
+ },
+ merge : true,
+ 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",
+ merge : true,
+ 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));
+};
+
+});
+
+ace.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() {
+
+ // regexp must not have capturing parentheses
+ // regexps are ordered -> the first match is used
+ this.$rules = {
+ start : [{
+ token : "text",
+ merge : true,
+ regex : "<\\!\\[CDATA\\[",
+ next : "cdata"
+ }, {
+ token : "xml_pe",
+ regex : "<\\?.*?\\?>"
+ }, {
+ token : "comment",
+ merge : true,
+ regex : "<\\!--",
+ next : "comment"
+ }, {
+ token : "xml_pe",
+ regex : "<\\!.*?>"
+ }, {
+ token : "meta.tag",
+ regex : "<(?=\s*script\\b)",
+ next : "script"
+ }, {
+ token : "meta.tag",
+ regex : "<(?=\s*style\\b)",
+ next : "style"
+ }, {
+ token : "meta.tag", // opening tag
+ regex : "<\\/?",
+ next : "tag"
+ }, {
+ token : "text",
+ regex : "\\s+"
+ }, {
+ token : "constant.character.entity",
+ regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
+ }, {
+ token : "text",
+ regex : "[^<]+"
+ } ],
+
+ cdata : [ {
+ token : "text",
+ regex : "\\]\\]>",
+ next : "start"
+ }, {
+ token : "text",
+ merge : true,
+ regex : "\\s+"
+ }, {
+ token : "text",
+ merge : true,
+ regex : ".+"
+ } ],
+
+ comment : [ {
+ token : "comment",
+ regex : ".*?-->",
+ next : "start"
+ }, {
+ token : "comment",
+ merge : true,
+ regex : ".+"
+ } ]
+ };
+
+ 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;
+});
+
+ace.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 CssHighlightRules = function() {
+ var keywordMapper = this.createKeywordMapper({
+ "support.type": "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",
+ "support.function": "rgb|rgba|url|attr|counter|counters",
+ "support.constant": "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",
+ "support.constant.color": "aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow",
+ "support.constant.fonts": "arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace"
+ }, "text", true);
+
+ // regexp must not have capturing parentheses. Use (?:) instead.
+ // regexps are ordered -> the first match is used
+
+ var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
+ var pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
+ var 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 base_ruleset = [
+ {
+ token : "comment", // multi line comment
+ merge : true,
+ 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 : "([0-9]+)"
+ }, {
+ 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
+ merge : true,
+ 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
+ merge : true,
+ 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
+ merge : true,
+ 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;
+
+});
+
+ace.define('ace/mode/scss_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 ScssHighlightRules = function() {
+
+ var properties = lang.arrayToMap( (function () {
+
+ var browserPrefix = ("-webkit-|-moz-|-o-|-ms-|-svg-|-pie-|-khtml-").split("|");
+
+ var prefixProperties = ("appearance|background-clip|background-inline-policy|background-origin|" +
+ "background-size|binding|border-bottom-colors|border-left-colors|" +
+ "border-right-colors|border-top-colors|border-end|border-end-color|" +
+ "border-end-style|border-end-width|border-image|border-start|" +
+ "border-start-color|border-start-style|border-start-width|box-align|" +
+ "box-direction|box-flex|box-flexgroup|box-ordinal-group|box-orient|" +
+ "box-pack|box-sizing|column-count|column-gap|column-width|column-rule|" +
+ "column-rule-width|column-rule-style|column-rule-color|float-edge|" +
+ "font-feature-settings|font-language-override|force-broken-image-icon|" +
+ "image-region|margin-end|margin-start|opacity|outline|outline-color|" +
+ "outline-offset|outline-radius|outline-radius-bottomleft|" +
+ "outline-radius-bottomright|outline-radius-topleft|outline-radius-topright|" +
+ "outline-style|outline-width|padding-end|padding-start|stack-sizing|" +
+ "tab-size|text-blink|text-decoration-color|text-decoration-line|" +
+ "text-decoration-style|transform|transform-origin|transition|" +
+ "transition-delay|transition-duration|transition-property|" +
+ "transition-timing-function|user-focus|user-input|user-modify|user-select|" +
+ "window-shadow|border-radius").split("|");
+
+ var properties = ("azimuth|background-attachment|background-color|background-image|" +
+ "background-position|background-repeat|background|border-bottom-color|" +
+ "border-bottom-style|border-bottom-width|border-bottom|border-collapse|" +
+ "border-color|border-left-color|border-left-style|border-left-width|" +
+ "border-left|border-right-color|border-right-style|border-right-width|" +
+ "border-right|border-spacing|border-style|border-top-color|" +
+ "border-top-style|border-top-width|border-top|border-width|border|" +
+ "bottom|box-sizing|caption-side|clear|clip|color|content|counter-increment|" +
+ "counter-reset|cue-after|cue-before|cue|cursor|direction|display|" +
+ "elevation|empty-cells|float|font-family|font-size-adjust|font-size|" +
+ "font-stretch|font-style|font-variant|font-weight|font|height|left|" +
+ "letter-spacing|line-height|list-style-image|list-style-position|" +
+ "list-style-type|list-style|margin-bottom|margin-left|margin-right|" +
+ "margin-top|marker-offset|margin|marks|max-height|max-width|min-height|" +
+ "min-width|opacity|orphans|outline-color|" +
+ "outline-style|outline-width|outline|overflow|overflow-x|overflow-y|padding-bottom|" +
+ "padding-left|padding-right|padding-top|padding|page-break-after|" +
+ "page-break-before|page-break-inside|page|pause-after|pause-before|" +
+ "pause|pitch-range|pitch|play-during|position|quotes|richness|right|" +
+ "size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|" +
+ "stress|table-layout|text-align|text-decoration|text-indent|" +
+ "text-shadow|text-transform|top|unicode-bidi|vertical-align|" +
+ "visibility|voice-family|volume|white-space|widows|width|word-spacing|" +
+ "z-index").split("|");
+
+ //The return array
+ var ret = [];
+
+ //All prefixProperties will get the browserPrefix in
+ //the begning by join the prefixProperties array with the value of browserPrefix
+ for (var i=0, ln=browserPrefix.length; i<ln; i++) {
+ Array.prototype.push.apply(
+ ret,
+ (( browserPrefix[i] + prefixProperties.join("|" + browserPrefix[i]) ).split("|"))
+ );
+ }
+
+ //Add also prefixProperties and properties without any browser prefix
+ Array.prototype.push.apply(ret, prefixProperties);
+ Array.prototype.push.apply(ret, properties);
+
+ return ret;
+
+ })() );
+
+
+
+ var functions = lang.arrayToMap(
+ ("hsl|hsla|rgb|rgba|url|attr|counter|counters|abs|adjust_color|adjust_hue|" +
+ "alpha|join|blue|ceil|change_color|comparable|complement|darken|desaturate|" +
+ "floor|grayscale|green|hue|if|invert|join|length|lighten|lightness|mix|" +
+ "nth|opacify|opacity|percentage|quote|red|round|saturate|saturation|" +
+ "scale_color|transparentize|type_of|unit|unitless|unqoute").split("|")
+ );
+
+ var constants = lang.arrayToMap(
+ ("absolute|all-scroll|always|armenian|auto|baseline|below|bidi-override|" +
+ "block|bold|bolder|border-box|both|bottom|break-all|break-word|capitalize|center|" +
+ "char|circle|cjk-ideographic|col-resize|collapse|content-box|crosshair|dashed|" +
+ "decimal-leading-zero|decimal|default|disabled|disc|" +
+ "distribute-all-lines|distribute-letter|distribute-space|" +
+ "distribute|dotted|double|e-resize|ellipsis|fixed|georgian|groove|" +
+ "hand|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|" +
+ "ideograph-alpha|ideograph-numeric|ideograph-parenthesis|" +
+ "ideograph-space|inactive|inherit|inline-block|inline|inset|inside|" +
+ "inter-ideograph|inter-word|italic|justify|katakana-iroha|katakana|" +
+ "keep-all|left|lighter|line-edge|line-through|line|list-item|loose|" +
+ "lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|" +
+ "medium|middle|move|n-resize|ne-resize|newspaper|no-drop|no-repeat|" +
+ "nw-resize|none|normal|not-allowed|nowrap|oblique|outset|outside|" +
+ "overline|pointer|progress|relative|repeat-x|repeat-y|repeat|right|" +
+ "ridge|row-resize|rtl|s-resize|scroll|se-resize|separate|small-caps|" +
+ "solid|square|static|strict|super|sw-resize|table-footer-group|" +
+ "table-header-group|tb-rl|text-bottom|text-top|text|thick|thin|top|" +
+ "transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|" +
+ "vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|" +
+ "zero").split("|")
+ );
+
+ var colors = lang.arrayToMap(
+ ("aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|" +
+ "purple|red|silver|teal|white|yellow").split("|")
+ );
+
+ var keywords = lang.arrayToMap(
+ ("@mixin|@extend|@include|@import|@media|@debug|@warn|@if|@for|@each|@while|@else|@font-face|@-webkit-keyframes|if|and|!default|module|def|end|declare").split("|")
+ )
+
+ var tags = lang.arrayToMap(
+ ("a|abbr|acronym|address|applet|area|article|aside|audio|b|base|basefont|bdo|" +
+ "big|blockquote|body|br|button|canvas|caption|center|cite|code|col|colgroup|" +
+ "command|datalist|dd|del|details|dfn|dir|div|dl|dt|em|embed|fieldset|" +
+ "figcaption|figure|font|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|" +
+ "header|hgroup|hr|html|i|iframe|img|input|ins|keygen|kbd|label|legend|li|" +
+ "link|map|mark|menu|meta|meter|nav|noframes|noscript|object|ol|optgroup|" +
+ "option|output|p|param|pre|progress|q|rp|rt|ruby|s|samp|script|section|select|" +
+ "small|source|span|strike|strong|style|sub|summary|sup|table|tbody|td|" +
+ "textarea|tfoot|th|thead|time|title|tr|tt|u|ul|var|video|wbr|xmp").split("|")
+ );
+
+ // regexp must not have capturing parentheses. Use (?:) instead.
+ // regexps are ordered -> the first match is used
+
+ var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
+
+ // regexp must not have capturing parentheses. Use (?:) instead.
+ // regexps are ordered -> the first match is used
+
+ this.$rules = {
+ "start" : [
+ {
+ token : "comment",
+ regex : "\\/\\/.*$"
+ },
+ {
+ token : "comment", // multi line comment
+ merge : true,
+ regex : "\\/\\*",
+ next : "comment"
+ }, {
+ token : "string", // single line
+ regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
+ }, {
+ token : "string", // multi line string start
+ merge : true,
+ regex : '["].*\\\\$',
+ next : "qqstring"
+ }, {
+ token : "string", // single line
+ regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
+ }, {
+ token : "string", // multi line string start
+ merge : true,
+ regex : "['].*\\\\$",
+ next : "qstring"
+ }, {
+ token : "constant.numeric",
+ regex : numRe + "(?:em|ex|px|cm|mm|in|pt|pc|deg|rad|grad|ms|s|hz|khz|%)"
+ }, {
+ token : "constant.numeric", // hex6 color
+ regex : "#[a-f0-9]{6}"
+ }, {
+ token : "constant.numeric", // hex3 color
+ regex : "#[a-f0-9]{3}"
+ }, {
+ token : "constant.numeric",
+ regex : numRe
+ }, {
+ token : function(value) {
+ if (properties.hasOwnProperty(value.toLowerCase()))
+ return "support.type";
+ if (keywords.hasOwnProperty(value))
+ return "keyword";
+ else if (constants.hasOwnProperty(value))
+ return "constant.language";
+ else if (functions.hasOwnProperty(value))
+ return "support.function";
+ else if (colors.hasOwnProperty(value.toLowerCase()))
+ return "support.constant.color";
+ else if (tags.hasOwnProperty(value.toLowerCase()))
+ return "variable.language";
+ else
+ return "text";
+ },
+ regex : "\\-?[@a-z_][@a-z0-9_\\-]*"
+ }, {
+ token : "variable",
+ regex : "[a-z_\\-$][a-z0-9_\\-$]*\\b"
+ }, {
+ token: "variable.language",
+ regex: "#[a-z0-9-_]+"
+ }, {
+ token: "variable.language",
+ regex: "\\.[a-z0-9-_]+"
+ }, {
+ token: "variable.language",
+ regex: ":[a-z0-9-_]+"
+ }, {
+ token: "constant",
+ regex: "[a-z0-9-_]+"
+ }, {
+ token : "keyword.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
+ merge : true,
+ regex : ".+"
+ }
+ ],
+ "qqstring" : [
+ {
+ token : "string",
+ regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"',
+ next : "start"
+ }, {
+ token : "string",
+ merge : true,
+ regex : '.+'
+ }
+ ],
+ "qstring" : [
+ {
+ token : "string",
+ regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'",
+ next : "start"
+ }, {
+ token : "string",
+ merge : true,
+ regex : '.+'
+ }
+ ]
+ };
+};
+
+oop.inherits(ScssHighlightRules, TextHighlightRules);
+
+exports.ScssHighlightRules = ScssHighlightRules;
+
+});
+
+ace.define('ace/mode/less_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 LessHighlightRules = function() {
+
+ var properties = lang.arrayToMap( (function () {
+
+ var browserPrefix = ("-webkit-|-moz-|-o-|-ms-|-svg-|-pie-|-khtml-").split("|");
+
+ var prefixProperties = ("appearance|background-clip|background-inline-policy|background-origin|" +
+ "background-size|binding|border-bottom-colors|border-left-colors|" +
+ "border-right-colors|border-top-colors|border-end|border-end-color|" +
+ "border-end-style|border-end-width|border-image|border-start|" +
+ "border-start-color|border-start-style|border-start-width|box-align|" +
+ "box-direction|box-flex|box-flexgroup|box-ordinal-group|box-orient|" +
+ "box-pack|box-sizing|column-count|column-gap|column-width|column-rule|" +
+ "column-rule-width|column-rule-style|column-rule-color|float-edge|" +
+ "font-feature-settings|font-language-override|force-broken-image-icon|" +
+ "image-region|margin-end|margin-start|opacity|outline|outline-color|" +
+ "outline-offset|outline-radius|outline-radius-bottomleft|" +
+ "outline-radius-bottomright|outline-radius-topleft|outline-radius-topright|" +
+ "outline-style|outline-width|padding-end|padding-start|stack-sizing|" +
+ "tab-size|text-blink|text-decoration-color|text-decoration-line|" +
+ "text-decoration-style|transform|transform-origin|transition|" +
+ "transition-delay|transition-duration|transition-property|" +
+ "transition-timing-function|user-focus|user-input|user-modify|user-select|" +
+ "window-shadow|border-radius").split("|");
+
+ var properties = ("azimuth|background-attachment|background-color|background-image|" +
+ "background-position|background-repeat|background|border-bottom-color|" +
+ "border-bottom-style|border-bottom-width|border-bottom|border-collapse|" +
+ "border-color|border-left-color|border-left-style|border-left-width|" +
+ "border-left|border-right-color|border-right-style|border-right-width|" +
+ "border-right|border-spacing|border-style|border-top-color|" +
+ "border-top-style|border-top-width|border-top|border-width|border|" +
+ "bottom|box-sizing|caption-side|clear|clip|color|content|counter-increment|" +
+ "counter-reset|cue-after|cue-before|cue|cursor|direction|display|" +
+ "elevation|empty-cells|float|font-family|font-size-adjust|font-size|" +
+ "font-stretch|font-style|font-variant|font-weight|font|height|left|" +
+ "letter-spacing|line-height|list-style-image|list-style-position|" +
+ "list-style-type|list-style|margin-bottom|margin-left|margin-right|" +
+ "margin-top|marker-offset|margin|marks|max-height|max-width|min-height|" +
+ "min-width|opacity|orphans|outline-color|" +
+ "outline-style|outline-width|outline|overflow|overflow-x|overflow-y|padding-bottom|" +
+ "padding-left|padding-right|padding-top|padding|page-break-after|" +
+ "page-break-before|page-break-inside|page|pause-after|pause-before|" +
+ "pause|pitch-range|pitch|play-during|position|quotes|richness|right|" +
+ "size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|" +
+ "stress|table-layout|text-align|text-decoration|text-indent|" +
+ "text-shadow|text-transform|top|unicode-bidi|vertical-align|" +
+ "visibility|voice-family|volume|white-space|widows|width|word-spacing|" +
+ "z-index").split("|");
+
+ //The return array
+ var ret = [];
+
+ //All prefixProperties will get the browserPrefix in
+ //the begning by join the prefixProperties array with the value of browserPrefix
+ for (var i=0, ln=browserPrefix.length; i<ln; i++) {
+ Array.prototype.push.apply(
+ ret,
+ (( browserPrefix[i] + prefixProperties.join("|" + browserPrefix[i]) ).split("|"))
+ );
+ }
+
+ //Add also prefixProperties and properties without any browser prefix
+ Array.prototype.push.apply(ret, prefixProperties);
+ Array.prototype.push.apply(ret, properties);
+
+ return ret;
+
+ })() );
+
+
+
+ var functions = lang.arrayToMap(
+ ("hsl|hsla|rgb|rgba|url|attr|counter|counters|lighten|darken|saturate|" +
+ "desaturate|fadein|fadeout|fade|spin|mix|hue|saturation|lightness|" +
+ "alpha|round|ceil|floor|percentage|color|iscolor|isnumber|isstring|" +
+ "iskeyword|isurl|ispixel|ispercentage|isem").split("|")
+ );
+
+ var constants = lang.arrayToMap(
+ ("absolute|all-scroll|always|armenian|auto|baseline|below|bidi-override|" +
+ "block|bold|bolder|border-box|both|bottom|break-all|break-word|capitalize|center|" +
+ "char|circle|cjk-ideographic|col-resize|collapse|content-box|crosshair|dashed|" +
+ "decimal-leading-zero|decimal|default|disabled|disc|" +
+ "distribute-all-lines|distribute-letter|distribute-space|" +
+ "distribute|dotted|double|e-resize|ellipsis|fixed|georgian|groove|" +
+ "hand|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|" +
+ "ideograph-alpha|ideograph-numeric|ideograph-parenthesis|" +
+ "ideograph-space|inactive|inherit|inline-block|inline|inset|inside|" +
+ "inter-ideograph|inter-word|italic|justify|katakana-iroha|katakana|" +
+ "keep-all|left|lighter|line-edge|line-through|line|list-item|loose|" +
+ "lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|" +
+ "medium|middle|move|n-resize|ne-resize|newspaper|no-drop|no-repeat|" +
+ "nw-resize|none|normal|not-allowed|nowrap|oblique|outset|outside|" +
+ "overline|pointer|progress|relative|repeat-x|repeat-y|repeat|right|" +
+ "ridge|row-resize|rtl|s-resize|scroll|se-resize|separate|small-caps|" +
+ "solid|square|static|strict|super|sw-resize|table-footer-group|" +
+ "table-header-group|tb-rl|text-bottom|text-top|text|thick|thin|top|" +
+ "transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|" +
+ "vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|" +
+ "zero").split("|")
+ );
+
+ var colors = lang.arrayToMap(
+ ("aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|" +
+ "purple|red|silver|teal|white|yellow").split("|")
+ );
+
+ var keywords = lang.arrayToMap(
+ ("@mixin|@extend|@include|@import|@media|@debug|@warn|@if|@for|@each|" +
+ "@while|@else|@font-face|@-webkit-keyframes|if|and|!default|module|" +
+ "def|end|declare|when|not|and").split("|")
+ );
+
+ var tags = lang.arrayToMap(
+ ("a|abbr|acronym|address|applet|area|article|aside|audio|b|base|basefont|bdo|" +
+ "big|blockquote|body|br|button|canvas|caption|center|cite|code|col|colgroup|" +
+ "command|datalist|dd|del|details|dfn|dir|div|dl|dt|em|embed|fieldset|" +
+ "figcaption|figure|font|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|" +
+ "header|hgroup|hr|html|i|iframe|img|input|ins|keygen|kbd|label|legend|li|" +
+ "link|map|mark|menu|meta|meter|nav|noframes|noscript|object|ol|optgroup|" +
+ "option|output|p|param|pre|progress|q|rp|rt|ruby|s|samp|script|section|select|" +
+ "small|source|span|strike|strong|style|sub|summary|sup|table|tbody|td|" +
+ "textarea|tfoot|th|thead|time|title|tr|tt|u|ul|var|video|wbr|xmp").split("|")
+ );
+
+ // regexp must not have capturing parentheses. Use (?:) instead.
+ // regexps are ordered -> the first match is used
+
+ var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
+
+ // regexp must not have capturing parentheses. Use (?:) instead.
+ // regexps are ordered -> the first match is used
+
+ this.$rules = {
+ "start" : [
+ {
+ token : "comment",
+ regex : "\\/\\/.*$"
+ },
+ {
+ token : "comment", // multi line comment
+ merge : true,
+ regex : "\\/\\*",
+ next : "comment"
+ }, {
+ token : "string", // single line
+ regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
+ }, {
+ token : "string", // single line
+ regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
+ }, {
+ token : "constant.numeric",
+ regex : numRe + "(?:em|ex|px|cm|mm|in|pt|pc|deg|rad|grad|ms|s|hz|khz|%)"
+ }, {
+ token : "constant.numeric", // hex6 color
+ regex : "#[a-f0-9]{6}"
+ }, {
+ token : "constant.numeric", // hex3 color
+ regex : "#[a-f0-9]{3}"
+ }, {
+ token : "constant.numeric",
+ regex : numRe
+ }, {
+ token : function(value) {
+ if (keywords.hasOwnProperty(value))
+ return "keyword";
+ else
+ return "variable";
+ },
+ regex : "@[a-z0-9_\\-@]*\\b"
+ }, {
+ token : function(value) {
+ if (properties.hasOwnProperty(value.toLowerCase()))
+ return "support.type";
+ else if (keywords.hasOwnProperty(value))
+ return "keyword";
+ else if (constants.hasOwnProperty(value))
+ return "constant.language";
+ else if (functions.hasOwnProperty(value))
+ return "support.function";
+ else if (colors.hasOwnProperty(value.toLowerCase()))
+ return "support.constant.color";
+ else if (tags.hasOwnProperty(value.toLowerCase()))
+ return "variable.language";
+ else
+ return "text";
+ },
+ regex : "\\-?[@a-z_][@a-z0-9_\\-]*"
+ }, {
+ token: "variable.language",
+ regex: "#[a-z0-9-_]+"
+ }, {
+ token: "variable.language",
+ regex: "\\.[a-z0-9-_]+"
+ }, {
+ token: "variable.language",
+ regex: ":[a-z0-9-_]+"
+ }, {
+ token: "constant",
+ regex: "[a-z0-9-_]+"
+ }, {
+ token : "keyword.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
+ merge : true,
+ regex : ".+"
+ }
+ ]
+ };
+};
+
+oop.inherits(LessHighlightRules, TextHighlightRules);
+
+exports.LessHighlightRules = LessHighlightRules;
+
+});
+
+ace.define('ace/mode/coffee_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;
+
+ oop.inherits(CoffeeHighlightRules, TextHighlightRules);
+
+ function CoffeeHighlightRules() {
+ var identifier = "[$A-Za-z_\\x7f-\\uffff][$\\w\\x7f-\\uffff]*";
+ var stringfill = {
+ token : "string",
+ merge : true,
+ regex : ".+"
+ };
+
+ var keywords = (
+ "this|throw|then|try|typeof|super|switch|return|break|by)|continue|" +
+ "catch|class|in|instanceof|is|isnt|if|else|extends|for|forown|" +
+ "finally|function|while|when|new|no|not|delete|debugger|do|loop|of|off|" +
+ "or|on|unless|until|and|yes"
+ );
+
+ var langConstant = (
+ "true|false|null|undefined"
+ );
+
+ var illegal = (
+ "case|const|default|function|var|void|with|enum|export|implements|" +
+ "interface|let|package|private|protected|public|static|yield|" +
+ "__hasProp|extends|slice|bind|indexOf"
+ );
+
+ var supportClass = (
+ "Array|Boolean|Date|Function|Number|Object|RegExp|ReferenceError|" +
+ "String|RangeError|SyntaxError|Error|EvalError|TypeError|URIError"
+ );
+
+ var supportFunction = (
+ "Math|JSON|isNaN|isFinite|parseInt|parseFloat|encodeURI|" +
+ "encodeURIComponent|decodeURI|decodeURIComponent|String|"
+ );
+
+ var keywordMapper = this.createKeywordMapper({
+ "keyword": keywords,
+ "constant.language": langConstant,
+ "invalid.illegal": illegal,
+ "language.support.class": supportClass,
+ "language.support.function": supportFunction,
+ }, "identifier");
+
+ this.$rules = {
+ start : [
+ {
+ token : "identifier",
+ regex : "(?:(?:\\.|::)\\s*)" + identifier
+ }, {
+ token : "variable",
+ regex : "@(?:" + identifier + ")?"
+ }, {
+ token: keywordMapper,
+ regex : identifier
+ }, {
+ token : "constant.numeric",
+ regex : "(?:0x[\\da-fA-F]+|(?:\\d+(?:\\.\\d+)?|\\.\\d+)(?:[eE][+-]?\\d+)?)"
+ }, {
+ token : "string",
+ merge : true,
+ regex : "'''",
+ next : "qdoc"
+ }, {
+ token : "string",
+ merge : true,
+ regex : '"""',
+ next : "qqdoc"
+ }, {
+ token : "string",
+ merge : true,
+ regex : "'",
+ next : "qstring"
+ }, {
+ token : "string",
+ merge : true,
+ regex : '"',
+ next : "qqstring"
+ }, {
+ token : "string",
+ merge : true,
+ regex : "`",
+ next : "js"
+ }, {
+ token : "string.regex",
+ merge : true,
+ regex : "///",
+ next : "heregex"
+ }, {
+ token : "string.regex",
+ regex : "/(?!\\s)[^[/\\n\\\\]*(?: (?:\\\\.|\\[[^\\]\\n\\\\]*(?:\\\\.[^\\]\\n\\\\]*)*\\])[^[/\\n\\\\]*)*/[imgy]{0,4}(?!\\w)"
+ }, {
+ token : "comment",
+ merge : true,
+ regex : "###(?!#)",
+ next : "comment"
+ }, {
+ token : "comment",
+ regex : "#.*"
+ }, {
+ token : "punctuation.operator",
+ regex : "\\?|\\:|\\,|\\."
+ }, {
+ token : "keyword.operator",
+ regex : "(?:[\\-=]>|[-+*/%<>&|^!?=]=|>>>=?|\\-\\-|\\+\\+|::|&&=|\\|\\|=|<<=|>>=|\\?\\.|\\.{2,3}|[!*+-=><])"
+ }, {
+ token : "paren.lparen",
+ regex : "[({[]"
+ }, {
+ token : "paren.rparen",
+ regex : "[\\]})]"
+ }, {
+ token : "text",
+ regex : "\\s+"
+ }],
+
+ qdoc : [{
+ token : "string",
+ regex : ".*?'''",
+ next : "start"
+ }, stringfill],
+
+ qqdoc : [{
+ token : "string",
+ regex : '.*?"""',
+ next : "start"
+ }, stringfill],
+
+ qstring : [{
+ token : "string",
+ regex : "[^\\\\']*(?:\\\\.[^\\\\']*)*'",
+ merge : true,
+ next : "start"
+ }, stringfill],
+
+ qqstring : [{
+ token : "string",
+ regex : '[^\\\\"]*(?:\\\\.[^\\\\"]*)*"',
+ merge : true,
+ next : "start"
+ }, stringfill],
+
+ js : [{
+ token : "string",
+ merge : true,
+ regex : "[^\\\\`]*(?:\\\\.[^\\\\`]*)*`",
+ next : "start"
+ }, stringfill],
+
+ heregex : [{
+ token : "string.regex",
+ regex : '.*?///[imgy]{0,4}',
+ next : "start"
+ }, {
+ token : "comment.regex",
+ regex : "\\s+(?:#.*)?"
+ }, {
+ token : "string.regex",
+ merge : true,
+ regex : "\\S+"
+ }],
+
+ comment : [{
+ token : "comment",
+ regex : '.*?###',
+ next : "start"
+ }, {
+ token : "comment",
+ merge : true,
+ regex : ".+"
+ }]
+ };
+ }
+
+ exports.CoffeeHighlightRules = CoffeeHighlightRules;
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/mode-java.js b/vendor/assets/javascripts/ace-src-noconflict/mode-java.js
new file mode 100644
index 00000000000..23f9e60396b
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/mode-java.js
@@ -0,0 +1,1120 @@
+ace.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;
+});
+
+ace.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) {
+ var errors = [];
+ for (var i=0; i<results.data.length; i++) {
+ var error = results.data[i];
+ if (error)
+ errors.push({
+ row: error.line-1,
+ column: error.character-1,
+ text: error.reason,
+ type: "warning",
+ lint: error
+ });
+ }
+ session.setAnnotations(errors);
+ });
+
+ worker.on("narcissus", function(e) {
+ session.setAnnotations([e.data]);
+ });
+
+ worker.on("terminate", function() {
+ session.clearAnnotations();
+ });
+
+ return worker;
+ };
+
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+});
+
+ace.define('ace/mode/javascript_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/unicode', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var unicode = require("../unicode");
+var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
+var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+
+var JavaScriptHighlightRules = function() {
+ // see: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects
+ 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
+ "invalid.deprecated":
+ "__parent__|__count__|escape|unescape|with|__proto__|debugger",
+ "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|",
+ "storage.type":
+ "const|let|var|function",
+ "invalid.illegal":
+ "class|enum|extends|super|export|implements|private|" +
+ "public|interface|package|protected|static",
+ "constant.language":
+ "null|Infinity|NaN|undefined",
+ }, "identifier");
+
+
+ // keywords which can be followed by regular expressions
+ var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield";
+
+ // TODO: Unicode escape sequences
+ 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
+ ".)";
+
+ // regexp must not have capturing parentheses. Use (?:) instead.
+ // regexps are ordered -> the first match is used
+
+ this.$rules = {
+ "start" : [
+ {
+ token : "comment",
+ regex : /\/\/.*$/
+ },
+ DocCommentHighlightRules.getStartRule("doc-start"),
+ {
+ token : "comment", // multi line comment
+ merge : true,
+ 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/
+ }, {
+ // Sound.prototype.play =
+ token : [
+ "storage.type", "punctuation.operator", "support.function",
+ "punctuation.operator", "entity.name.function", "text","keyword.operator"
+ ],
+ regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)",
+ next: "function_arguments"
+ }, {
+ // Sound.play = function() { }
+ 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"
+ }, {
+ // play = function() { }
+ token : [
+ "entity.name.function", "text", "keyword.operator", "text", "storage.type",
+ "text", "paren.lparen"
+ ],
+ regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ // Sound.play = function play() { }
+ 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"
+ }, {
+ // function myFunc(arg) { }
+ token : [
+ "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ ],
+ regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ // foobar: function() { }
+ token : [
+ "entity.name.function", "text", "punctuation.operator",
+ "text", "storage.type", "text", "paren.lparen"
+ ],
+ regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ // : function() { } (this is for issues with 'foo': function() { })
+ token : [
+ "text", "text", "storage.type", "text", "paren.lparen"
+ ],
+ regex : "(:)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ token : "constant.language.boolean",
+ regex : /(?:true|false)\b/
+ }, {
+ 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 : /!|\$|%|&|\*|\-\-|\-|\+\+|\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=|\b(?:in|instanceof|new|delete|typeof|void)/,
+ 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: /^#!.*$/
+ }, {
+ token : "text",
+ regex : /\s+/
+ }
+ ],
+ // regular expressions are only allowed after certain tokens. This
+ // makes sure we don't mix up regexps with the divison operator
+ "regex_allowed": [
+ DocCommentHighlightRules.getStartRule("doc-start"),
+ {
+ token : "comment", // multi line comment
+ merge : true,
+ regex : "\\/\\*",
+ next : "comment_regex_allowed"
+ }, {
+ token : "comment",
+ regex : "\\/\\/.*$"
+ }, {
+ token: "string.regexp",
+ regex: "\\/",
+ next: "regex",
+ merge: true
+ }, {
+ token : "text",
+ regex : "\\s+"
+ }, {
+ // immediately return to the start mode without matching
+ // anything
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "regex": [
+ {
+ // escapes
+ token: "regexp.keyword.operator",
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
+ }, {
+ // flag
+ token: "string.regexp",
+ regex: "/\\w*",
+ next: "start",
+ merge: true
+ }, {
+ // invalid operators
+ token : "invalid",
+ regex: /\{\d+,?(?:\d+)?}[+*]|[+*^$?][+*]|\?\?/ // |[^$][?]
+ }, {
+ // operators
+ token : "constant.language.escape",
+ regex: /\(\?[:=!]|\)|\{\d+,?(?:\d+)?}|[+*]\?|[(|)$^+*?]/
+ }, {
+ token: "string.regexp",
+ regex: /{|[^\[\\{()$^+*?\/]+/,
+ merge: true
+ }, {
+ token: "constant.language.escape",
+ regex: /\[\^?/,
+ next: "regex_character_class",
+ merge: true
+ }, {
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "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",
+ merge: true
+ }, {
+ token: "constant.language.escape",
+ regex: "-",
+ }, {
+ token: "string.regexp.charachterclass",
+ regex: /[^\]\-\\]+/,
+ merge: true
+ }, {
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "function_arguments": [
+ {
+ token: "variable.parameter",
+ regex: identifierRe
+ }, {
+ token: "punctuation.operator",
+ regex: "[, ]+",
+ merge: true
+ }, {
+ token: "punctuation.operator",
+ regex: "$",
+ merge: true
+ }, {
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "comment_regex_allowed" : [
+ {
+ token : "comment", // closing comment
+ regex : ".*?\\*\\/",
+ merge : true,
+ next : "regex_allowed"
+ }, {
+ token : "comment", // comment spanning whole line
+ merge : true,
+ regex : ".+"
+ }
+ ],
+ "comment" : [
+ {
+ token : "comment", // closing comment
+ regex : ".*?\\*\\/",
+ merge : true,
+ next : "start"
+ }, {
+ token : "comment", // comment spanning whole line
+ merge : true,
+ regex : ".+"
+ }
+ ],
+ "qqstring" : [
+ {
+ token : "constant.language.escape",
+ regex : escapedRe
+ }, {
+ token : "string",
+ regex : '[^"\\\\]+',
+ merge : true
+ }, {
+ token : "string",
+ regex : "\\\\$",
+ next : "qqstring",
+ merge : true
+ }, {
+ token : "string",
+ regex : '"|$',
+ next : "start",
+ merge : true
+ }
+ ],
+ "qstring" : [
+ {
+ token : "constant.language.escape",
+ regex : escapedRe
+ }, {
+ token : "string",
+ regex : "[^'\\\\]+",
+ merge : true
+ }, {
+ token : "string",
+ regex : "\\\\$",
+ next : "qstring",
+ merge : true
+ }, {
+ token : "string",
+ regex : "'|$",
+ next : "start",
+ merge : true
+ }
+ ]
+ };
+
+ this.embedRules(DocCommentHighlightRules, "doc-",
+ [ DocCommentHighlightRules.getEndRule("start") ]);
+};
+
+oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
+
+exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
+});
+
+ace.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",
+ merge : true,
+ regex : "\\s+"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "TODO"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "[^@\\*]+"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "."
+ }]
+ };
+};
+
+oop.inherits(DocCommentHighlightRules, TextHighlightRules);
+
+DocCommentHighlightRules.getStartRule = function(start) {
+ return {
+ token : "comment.doc", // doc comment
+ merge : true,
+ regex : "\\/\\*(?=\\*)",
+ next : start
+ };
+};
+
+DocCommentHighlightRules.getEndRule = function (start) {
+ return {
+ token : "comment.doc", // closing comment
+ merge : true,
+ regex : "\\*\\/",
+ next : start
+ };
+};
+
+
+exports.DocCommentHighlightRules = DocCommentHighlightRules;
+
+});
+
+ace.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;
+});
+
+ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour'], function(require, exports, module) {
+
+
+var oop = require("../../lib/oop");
+var Behaviour = require("../behaviour").Behaviour;
+
+var CstyleBehaviour = function () {
+
+ this.add("braces", "insertion", function (state, action, editor, session, text) {
+ if (text == '{') {
+ var selection = editor.getSelectionRange();
+ var selected = session.doc.getTextRange(selection);
+ if (selected !== "") {
+ return {
+ text: '{' + selected + '}',
+ selection: false
+ };
+ } else {
+ 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) {
+ return {
+ text: '',
+ selection: [1, 1]
+ };
+ }
+ }
+ } else if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ if (rightChar == '}') {
+ var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column + 1});
+ if (!openBracePos)
+ return null;
+
+ var indent = this.getNextLineIndent(state, line.substring(0, line.length - 1), session.getTabString());
+ var next_indent = this.$getIndent(session.doc.getLine(openBracePos.row));
+
+ return {
+ text: '\n' + indent + '\n' + next_indent,
+ 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;
+ }
+ }
+ });
+
+ this.add("parens", "insertion", function (state, action, editor, session, text) {
+ if (text == '(') {
+ var selection = editor.getSelectionRange();
+ var selected = session.doc.getTextRange(selection);
+ if (selected !== "") {
+ return {
+ text: '(' + selected + ')',
+ selection: false
+ };
+ } else {
+ 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) {
+ 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 !== "") {
+ return {
+ text: '[' + selected + ']',
+ selection: false
+ };
+ } else {
+ 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) {
+ 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 !== "") {
+ 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);
+
+ // We're escaped.
+ if (leftChar == '\\') {
+ return null;
+ }
+
+ // Find what token we're inside.
+ 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;
+ }
+
+ // Try and be smart about when we auto insert.
+ 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)))) {
+ return {
+ text: quote + quote,
+ selection: [1,1]
+ };
+ } else if (token && token.type === "string") {
+ // Ignore input and move right one if we're typing over the closing quote.
+ 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 == '"') {
+ range.end.column++;
+ return range;
+ }
+ }
+ });
+
+};
+
+oop.inherits(CstyleBehaviour, Behaviour);
+
+exports.CstyleBehaviour = CstyleBehaviour;
+});
+
+ace.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);
+
+ var range = session.getCommentFoldRange(row, i + match[0].length);
+ range.end.column -= 2;
+ return range;
+ }
+
+ if (foldStyle !== "markbeginend")
+ return;
+
+ var match = line.match(this.foldingStopMarker);
+ if (match) {
+ var i = match.index + match[0].length;
+
+ if (match[2]) {
+ var range = session.getCommentFoldRange(row, i);
+ range.end.column -= 2;
+ return range;
+ }
+
+ var end = {row: row, column: i};
+ var start = session.$findOpeningBracket(match[1], end);
+
+ if (!start)
+ return;
+
+ start.column++;
+ end.column--;
+
+ return Range.fromPoints(start, end);
+ }
+ };
+
+}).call(FoldMode.prototype);
+
+});
+
+ace.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;
+
+ // must return "" if there's no fold, to enable caching
+ 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);
+ };
+
+}).call(FoldMode.prototype);
+
+});
+ace.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() {
+
+ // taken from http://download.oracle.com/javase/tutorial/java/nutsandbolts/_keywords.html
+ 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");
+
+ // regexp must not have capturing parentheses. Use (?:) instead.
+ // regexps are ordered -> the first match is used
+
+ this.$rules = {
+ "start" : [
+ {
+ token : "comment",
+ regex : "\\/\\/.*$"
+ },
+ DocCommentHighlightRules.getStartRule("doc-start"),
+ {
+ token : "comment", // multi line comment
+ merge : true,
+ 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,
+ // TODO: Unicode escape sequences
+ // TODO: Unicode identifiers
+ 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
+ merge : true,
+ regex : ".+"
+ }
+ ]
+ };
+
+ this.embedRules(DocCommentHighlightRules, "doc-",
+ [ DocCommentHighlightRules.getEndRule("start") ]);
+};
+
+oop.inherits(JavaHighlightRules, TextHighlightRules);
+
+exports.JavaHighlightRules = JavaHighlightRules;
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/mode-javascript.js b/vendor/assets/javascripts/ace-src-noconflict/mode-javascript.js
new file mode 100644
index 00000000000..d266bffb19a
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/mode-javascript.js
@@ -0,0 +1,990 @@
+/* ***** 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 ***** */
+
+ace.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) {
+ var errors = [];
+ for (var i=0; i<results.data.length; i++) {
+ var error = results.data[i];
+ if (error)
+ errors.push({
+ row: error.line-1,
+ column: error.character-1,
+ text: error.reason,
+ type: "warning",
+ lint: error
+ });
+ }
+ session.setAnnotations(errors);
+ });
+
+ worker.on("narcissus", function(e) {
+ session.setAnnotations([e.data]);
+ });
+
+ worker.on("terminate", function() {
+ session.clearAnnotations();
+ });
+
+ return worker;
+ };
+
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+});
+
+ace.define('ace/mode/javascript_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/unicode', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var unicode = require("../unicode");
+var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
+var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+
+var JavaScriptHighlightRules = function() {
+ // see: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects
+ 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
+ "invalid.deprecated":
+ "__parent__|__count__|escape|unescape|with|__proto__|debugger",
+ "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|",
+ "storage.type":
+ "const|let|var|function",
+ "invalid.illegal":
+ "class|enum|extends|super|export|implements|private|" +
+ "public|interface|package|protected|static",
+ "constant.language":
+ "null|Infinity|NaN|undefined",
+ }, "identifier");
+
+
+ // keywords which can be followed by regular expressions
+ var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield";
+
+ // TODO: Unicode escape sequences
+ 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
+ ".)";
+
+ // regexp must not have capturing parentheses. Use (?:) instead.
+ // regexps are ordered -> the first match is used
+
+ this.$rules = {
+ "start" : [
+ {
+ token : "comment",
+ regex : /\/\/.*$/
+ },
+ DocCommentHighlightRules.getStartRule("doc-start"),
+ {
+ token : "comment", // multi line comment
+ merge : true,
+ 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/
+ }, {
+ // Sound.prototype.play =
+ token : [
+ "storage.type", "punctuation.operator", "support.function",
+ "punctuation.operator", "entity.name.function", "text","keyword.operator"
+ ],
+ regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)",
+ next: "function_arguments"
+ }, {
+ // Sound.play = function() { }
+ 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"
+ }, {
+ // play = function() { }
+ token : [
+ "entity.name.function", "text", "keyword.operator", "text", "storage.type",
+ "text", "paren.lparen"
+ ],
+ regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ // Sound.play = function play() { }
+ 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"
+ }, {
+ // function myFunc(arg) { }
+ token : [
+ "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ ],
+ regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ // foobar: function() { }
+ token : [
+ "entity.name.function", "text", "punctuation.operator",
+ "text", "storage.type", "text", "paren.lparen"
+ ],
+ regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ // : function() { } (this is for issues with 'foo': function() { })
+ token : [
+ "text", "text", "storage.type", "text", "paren.lparen"
+ ],
+ regex : "(:)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ token : "constant.language.boolean",
+ regex : /(?:true|false)\b/
+ }, {
+ 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 : /!|\$|%|&|\*|\-\-|\-|\+\+|\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=|\b(?:in|instanceof|new|delete|typeof|void)/,
+ 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: /^#!.*$/
+ }, {
+ token : "text",
+ regex : /\s+/
+ }
+ ],
+ // regular expressions are only allowed after certain tokens. This
+ // makes sure we don't mix up regexps with the divison operator
+ "regex_allowed": [
+ DocCommentHighlightRules.getStartRule("doc-start"),
+ {
+ token : "comment", // multi line comment
+ merge : true,
+ regex : "\\/\\*",
+ next : "comment_regex_allowed"
+ }, {
+ token : "comment",
+ regex : "\\/\\/.*$"
+ }, {
+ token: "string.regexp",
+ regex: "\\/",
+ next: "regex",
+ merge: true
+ }, {
+ token : "text",
+ regex : "\\s+"
+ }, {
+ // immediately return to the start mode without matching
+ // anything
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "regex": [
+ {
+ // escapes
+ token: "regexp.keyword.operator",
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
+ }, {
+ // flag
+ token: "string.regexp",
+ regex: "/\\w*",
+ next: "start",
+ merge: true
+ }, {
+ // invalid operators
+ token : "invalid",
+ regex: /\{\d+,?(?:\d+)?}[+*]|[+*^$?][+*]|\?\?/ // |[^$][?]
+ }, {
+ // operators
+ token : "constant.language.escape",
+ regex: /\(\?[:=!]|\)|\{\d+,?(?:\d+)?}|[+*]\?|[(|)$^+*?]/
+ }, {
+ token: "string.regexp",
+ regex: /{|[^\[\\{()$^+*?\/]+/,
+ merge: true
+ }, {
+ token: "constant.language.escape",
+ regex: /\[\^?/,
+ next: "regex_character_class",
+ merge: true
+ }, {
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "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",
+ merge: true
+ }, {
+ token: "constant.language.escape",
+ regex: "-",
+ }, {
+ token: "string.regexp.charachterclass",
+ regex: /[^\]\-\\]+/,
+ merge: true
+ }, {
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "function_arguments": [
+ {
+ token: "variable.parameter",
+ regex: identifierRe
+ }, {
+ token: "punctuation.operator",
+ regex: "[, ]+",
+ merge: true
+ }, {
+ token: "punctuation.operator",
+ regex: "$",
+ merge: true
+ }, {
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "comment_regex_allowed" : [
+ {
+ token : "comment", // closing comment
+ regex : ".*?\\*\\/",
+ merge : true,
+ next : "regex_allowed"
+ }, {
+ token : "comment", // comment spanning whole line
+ merge : true,
+ regex : ".+"
+ }
+ ],
+ "comment" : [
+ {
+ token : "comment", // closing comment
+ regex : ".*?\\*\\/",
+ merge : true,
+ next : "start"
+ }, {
+ token : "comment", // comment spanning whole line
+ merge : true,
+ regex : ".+"
+ }
+ ],
+ "qqstring" : [
+ {
+ token : "constant.language.escape",
+ regex : escapedRe
+ }, {
+ token : "string",
+ regex : '[^"\\\\]+',
+ merge : true
+ }, {
+ token : "string",
+ regex : "\\\\$",
+ next : "qqstring",
+ merge : true
+ }, {
+ token : "string",
+ regex : '"|$',
+ next : "start",
+ merge : true
+ }
+ ],
+ "qstring" : [
+ {
+ token : "constant.language.escape",
+ regex : escapedRe
+ }, {
+ token : "string",
+ regex : "[^'\\\\]+",
+ merge : true
+ }, {
+ token : "string",
+ regex : "\\\\$",
+ next : "qstring",
+ merge : true
+ }, {
+ token : "string",
+ regex : "'|$",
+ next : "start",
+ merge : true
+ }
+ ]
+ };
+
+ this.embedRules(DocCommentHighlightRules, "doc-",
+ [ DocCommentHighlightRules.getEndRule("start") ]);
+};
+
+oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
+
+exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
+});
+
+ace.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",
+ merge : true,
+ regex : "\\s+"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "TODO"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "[^@\\*]+"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "."
+ }]
+ };
+};
+
+oop.inherits(DocCommentHighlightRules, TextHighlightRules);
+
+DocCommentHighlightRules.getStartRule = function(start) {
+ return {
+ token : "comment.doc", // doc comment
+ merge : true,
+ regex : "\\/\\*(?=\\*)",
+ next : start
+ };
+};
+
+DocCommentHighlightRules.getEndRule = function (start) {
+ return {
+ token : "comment.doc", // closing comment
+ merge : true,
+ regex : "\\*\\/",
+ next : start
+ };
+};
+
+
+exports.DocCommentHighlightRules = DocCommentHighlightRules;
+
+});
+
+ace.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;
+});
+
+ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour'], function(require, exports, module) {
+
+
+var oop = require("../../lib/oop");
+var Behaviour = require("../behaviour").Behaviour;
+
+var CstyleBehaviour = function () {
+
+ this.add("braces", "insertion", function (state, action, editor, session, text) {
+ if (text == '{') {
+ var selection = editor.getSelectionRange();
+ var selected = session.doc.getTextRange(selection);
+ if (selected !== "") {
+ return {
+ text: '{' + selected + '}',
+ selection: false
+ };
+ } else {
+ 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) {
+ return {
+ text: '',
+ selection: [1, 1]
+ };
+ }
+ }
+ } else if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ if (rightChar == '}') {
+ var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column + 1});
+ if (!openBracePos)
+ return null;
+
+ var indent = this.getNextLineIndent(state, line.substring(0, line.length - 1), session.getTabString());
+ var next_indent = this.$getIndent(session.doc.getLine(openBracePos.row));
+
+ return {
+ text: '\n' + indent + '\n' + next_indent,
+ 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;
+ }
+ }
+ });
+
+ this.add("parens", "insertion", function (state, action, editor, session, text) {
+ if (text == '(') {
+ var selection = editor.getSelectionRange();
+ var selected = session.doc.getTextRange(selection);
+ if (selected !== "") {
+ return {
+ text: '(' + selected + ')',
+ selection: false
+ };
+ } else {
+ 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) {
+ 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 !== "") {
+ return {
+ text: '[' + selected + ']',
+ selection: false
+ };
+ } else {
+ 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) {
+ 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 !== "") {
+ 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);
+
+ // We're escaped.
+ if (leftChar == '\\') {
+ return null;
+ }
+
+ // Find what token we're inside.
+ 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;
+ }
+
+ // Try and be smart about when we auto insert.
+ 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)))) {
+ return {
+ text: quote + quote,
+ selection: [1,1]
+ };
+ } else if (token && token.type === "string") {
+ // Ignore input and move right one if we're typing over the closing quote.
+ 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 == '"') {
+ range.end.column++;
+ return range;
+ }
+ }
+ });
+
+};
+
+oop.inherits(CstyleBehaviour, Behaviour);
+
+exports.CstyleBehaviour = CstyleBehaviour;
+});
+
+ace.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);
+
+ var range = session.getCommentFoldRange(row, i + match[0].length);
+ range.end.column -= 2;
+ return range;
+ }
+
+ if (foldStyle !== "markbeginend")
+ return;
+
+ var match = line.match(this.foldingStopMarker);
+ if (match) {
+ var i = match.index + match[0].length;
+
+ if (match[2]) {
+ var range = session.getCommentFoldRange(row, i);
+ range.end.column -= 2;
+ return range;
+ }
+
+ var end = {row: row, column: i};
+ var start = session.$findOpeningBracket(match[1], end);
+
+ if (!start)
+ return;
+
+ start.column++;
+ end.column--;
+
+ return Range.fromPoints(start, end);
+ }
+ };
+
+}).call(FoldMode.prototype);
+
+});
+
+ace.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;
+
+ // must return "" if there's no fold, to enable caching
+ 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);
+ };
+
+}).call(FoldMode.prototype);
+
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/mode-json.js b/vendor/assets/javascripts/ace-src-noconflict/mode-json.js
new file mode 100644
index 00000000000..19260b4729b
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/mode-json.js
@@ -0,0 +1,581 @@
+/* ***** 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 ***** */
+
+ace.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;
+});
+
+ace.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() {
+
+ // regexp must not have capturing parentheses. Use (?:) instead.
+ // regexps are ordered -> the first match is used
+ 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 : '[^"\\\\]+',
+ merge : true
+ }, {
+ token : "string",
+ regex : '"',
+ next : "start",
+ merge : true
+ }, {
+ token : "string",
+ regex : "",
+ next : "start",
+ merge : true
+ }
+ ]
+ };
+
+};
+
+oop.inherits(JsonHighlightRules, TextHighlightRules);
+
+exports.JsonHighlightRules = JsonHighlightRules;
+});
+
+ace.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;
+});
+
+ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour'], function(require, exports, module) {
+
+
+var oop = require("../../lib/oop");
+var Behaviour = require("../behaviour").Behaviour;
+
+var CstyleBehaviour = function () {
+
+ this.add("braces", "insertion", function (state, action, editor, session, text) {
+ if (text == '{') {
+ var selection = editor.getSelectionRange();
+ var selected = session.doc.getTextRange(selection);
+ if (selected !== "") {
+ return {
+ text: '{' + selected + '}',
+ selection: false
+ };
+ } else {
+ 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) {
+ return {
+ text: '',
+ selection: [1, 1]
+ };
+ }
+ }
+ } else if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ if (rightChar == '}') {
+ var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column + 1});
+ if (!openBracePos)
+ return null;
+
+ var indent = this.getNextLineIndent(state, line.substring(0, line.length - 1), session.getTabString());
+ var next_indent = this.$getIndent(session.doc.getLine(openBracePos.row));
+
+ return {
+ text: '\n' + indent + '\n' + next_indent,
+ 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;
+ }
+ }
+ });
+
+ this.add("parens", "insertion", function (state, action, editor, session, text) {
+ if (text == '(') {
+ var selection = editor.getSelectionRange();
+ var selected = session.doc.getTextRange(selection);
+ if (selected !== "") {
+ return {
+ text: '(' + selected + ')',
+ selection: false
+ };
+ } else {
+ 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) {
+ 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 !== "") {
+ return {
+ text: '[' + selected + ']',
+ selection: false
+ };
+ } else {
+ 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) {
+ 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 !== "") {
+ 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);
+
+ // We're escaped.
+ if (leftChar == '\\') {
+ return null;
+ }
+
+ // Find what token we're inside.
+ 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;
+ }
+
+ // Try and be smart about when we auto insert.
+ 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)))) {
+ return {
+ text: quote + quote,
+ selection: [1,1]
+ };
+ } else if (token && token.type === "string") {
+ // Ignore input and move right one if we're typing over the closing quote.
+ 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 == '"') {
+ range.end.column++;
+ return range;
+ }
+ }
+ });
+
+};
+
+oop.inherits(CstyleBehaviour, Behaviour);
+
+exports.CstyleBehaviour = CstyleBehaviour;
+});
+
+ace.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);
+
+ var range = session.getCommentFoldRange(row, i + match[0].length);
+ range.end.column -= 2;
+ return range;
+ }
+
+ if (foldStyle !== "markbeginend")
+ return;
+
+ var match = line.match(this.foldingStopMarker);
+ if (match) {
+ var i = match.index + match[0].length;
+
+ if (match[2]) {
+ var range = session.getCommentFoldRange(row, i);
+ range.end.column -= 2;
+ return range;
+ }
+
+ var end = {row: row, column: i};
+ var start = session.$findOpeningBracket(match[1], end);
+
+ if (!start)
+ return;
+
+ start.column++;
+ end.column--;
+
+ return Range.fromPoints(start, end);
+ }
+ };
+
+}).call(FoldMode.prototype);
+
+});
+
+ace.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;
+
+ // must return "" if there's no fold, to enable caching
+ 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);
+ };
+
+}).call(FoldMode.prototype);
+
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/mode-jsp.js b/vendor/assets/javascripts/ace-src-noconflict/mode-jsp.js
new file mode 100644
index 00000000000..c96d25e936e
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/mode-jsp.js
@@ -0,0 +1,1664 @@
+/* ***** 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 ***** */
+
+ace.define('ace/mode/jsp', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/jsp_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle', 'ace/mode/javascript', 'ace/mode/css'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var TextMode = require("./text").Mode;
+var Tokenizer = require("../tokenizer").Tokenizer;
+var JspHighlightRules = require("./jsp_highlight_rules").JspHighlightRules;
+var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
+var Range = require("../range").Range;
+var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
+var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+
+
+var JavaScriptMode = require("./javascript").Mode;
+var CssMode = require("./css").Mode;
+
+var Mode = function() {
+ var highlighter = new JspHighlightRules();
+ this.$tokenizer = new Tokenizer(highlighter.getRules());
+ this.$outdent = new MatchingBraceOutdent();
+ this.$behaviour = new CstyleBehaviour();
+ this.foldingRules = new CStyleFoldMode();
+};
+oop.inherits(Mode, TextMode);
+
+(function() {
+
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+});
+
+ace.define('ace/mode/jsp_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/html_highlight_rules', 'ace/mode/java_highlight_rules'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
+var JavaHighlightRules = require("./java_highlight_rules").JavaHighlightRules;
+
+var JspHighlightRules = function() {
+ HtmlHighlightRules.call(this);
+ for (var i in this.$rules) {
+ this.$rules[i].unshift({
+ token : "meta.tag", // jsp open tag
+ regex : "<%@?|<%=?|<jsp:[^>]+>",
+ next : "jsp-start"
+ });
+ }
+
+ var builtinVariables = 'request|response|out|session|' +
+ 'application|config|pageContext|page|Exception';
+
+ var keywords = 'page|include|taglib';
+
+ this.embedRules(JavaHighlightRules, "jsp-");
+
+ this.$rules["start"].unshift({
+ token : "comment",
+ merge : true,
+ regex : "<%--",
+ next : "comment"
+ });
+
+ this.$rules["jsp-start"].unshift({
+ token : "meta.tag", // jsp close tag
+ regex : "%>|<\\/jsp:[^>]+>",
+ next : "start"
+ },
+ {
+ token: "variable.language",
+ regex : builtinVariables
+ }, {
+ token: "keyword",
+ regex : keywords
+ });
+
+ this.$rules.comment.unshift({
+ token : "comment",
+ regex : ".*?--%>",
+ next : "start"
+ });
+};
+
+oop.inherits(JspHighlightRules, HtmlHighlightRules);
+
+exports.JspHighlightRules = JspHighlightRules;
+});
+
+ace.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() {
+
+ // regexp must not have capturing parentheses
+ // regexps are ordered -> the first match is used
+ this.$rules = {
+ start : [{
+ token : "text",
+ merge : true,
+ regex : "<\\!\\[CDATA\\[",
+ next : "cdata"
+ }, {
+ token : "xml_pe",
+ regex : "<\\?.*?\\?>"
+ }, {
+ token : "comment",
+ merge : true,
+ regex : "<\\!--",
+ next : "comment"
+ }, {
+ token : "xml_pe",
+ regex : "<\\!.*?>"
+ }, {
+ token : "meta.tag",
+ regex : "<(?=\s*script\\b)",
+ next : "script"
+ }, {
+ token : "meta.tag",
+ regex : "<(?=\s*style\\b)",
+ next : "style"
+ }, {
+ token : "meta.tag", // opening tag
+ regex : "<\\/?",
+ next : "tag"
+ }, {
+ token : "text",
+ regex : "\\s+"
+ }, {
+ token : "constant.character.entity",
+ regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
+ }, {
+ token : "text",
+ regex : "[^<]+"
+ } ],
+
+ cdata : [ {
+ token : "text",
+ regex : "\\]\\]>",
+ next : "start"
+ }, {
+ token : "text",
+ merge : true,
+ regex : "\\s+"
+ }, {
+ token : "text",
+ merge : true,
+ regex : ".+"
+ } ],
+
+ comment : [ {
+ token : "comment",
+ regex : ".*?-->",
+ next : "start"
+ }, {
+ token : "comment",
+ merge : true,
+ regex : ".+"
+ } ]
+ };
+
+ 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;
+});
+
+ace.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 CssHighlightRules = function() {
+ var keywordMapper = this.createKeywordMapper({
+ "support.type": "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",
+ "support.function": "rgb|rgba|url|attr|counter|counters",
+ "support.constant": "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",
+ "support.constant.color": "aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow",
+ "support.constant.fonts": "arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace"
+ }, "text", true);
+
+ // regexp must not have capturing parentheses. Use (?:) instead.
+ // regexps are ordered -> the first match is used
+
+ var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
+ var pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
+ var 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 base_ruleset = [
+ {
+ token : "comment", // multi line comment
+ merge : true,
+ 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 : "([0-9]+)"
+ }, {
+ 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
+ merge : true,
+ 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
+ merge : true,
+ 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
+ merge : true,
+ 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;
+
+});
+
+ace.define('ace/mode/javascript_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/unicode', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var unicode = require("../unicode");
+var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
+var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+
+var JavaScriptHighlightRules = function() {
+ // see: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects
+ 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
+ "invalid.deprecated":
+ "__parent__|__count__|escape|unescape|with|__proto__|debugger",
+ "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|",
+ "storage.type":
+ "const|let|var|function",
+ "invalid.illegal":
+ "class|enum|extends|super|export|implements|private|" +
+ "public|interface|package|protected|static",
+ "constant.language":
+ "null|Infinity|NaN|undefined",
+ }, "identifier");
+
+
+ // keywords which can be followed by regular expressions
+ var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield";
+
+ // TODO: Unicode escape sequences
+ 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
+ ".)";
+
+ // regexp must not have capturing parentheses. Use (?:) instead.
+ // regexps are ordered -> the first match is used
+
+ this.$rules = {
+ "start" : [
+ {
+ token : "comment",
+ regex : /\/\/.*$/
+ },
+ DocCommentHighlightRules.getStartRule("doc-start"),
+ {
+ token : "comment", // multi line comment
+ merge : true,
+ 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/
+ }, {
+ // Sound.prototype.play =
+ token : [
+ "storage.type", "punctuation.operator", "support.function",
+ "punctuation.operator", "entity.name.function", "text","keyword.operator"
+ ],
+ regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)",
+ next: "function_arguments"
+ }, {
+ // Sound.play = function() { }
+ 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"
+ }, {
+ // play = function() { }
+ token : [
+ "entity.name.function", "text", "keyword.operator", "text", "storage.type",
+ "text", "paren.lparen"
+ ],
+ regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ // Sound.play = function play() { }
+ 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"
+ }, {
+ // function myFunc(arg) { }
+ token : [
+ "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ ],
+ regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ // foobar: function() { }
+ token : [
+ "entity.name.function", "text", "punctuation.operator",
+ "text", "storage.type", "text", "paren.lparen"
+ ],
+ regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ // : function() { } (this is for issues with 'foo': function() { })
+ token : [
+ "text", "text", "storage.type", "text", "paren.lparen"
+ ],
+ regex : "(:)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ token : "constant.language.boolean",
+ regex : /(?:true|false)\b/
+ }, {
+ 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 : /!|\$|%|&|\*|\-\-|\-|\+\+|\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=|\b(?:in|instanceof|new|delete|typeof|void)/,
+ 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: /^#!.*$/
+ }, {
+ token : "text",
+ regex : /\s+/
+ }
+ ],
+ // regular expressions are only allowed after certain tokens. This
+ // makes sure we don't mix up regexps with the divison operator
+ "regex_allowed": [
+ DocCommentHighlightRules.getStartRule("doc-start"),
+ {
+ token : "comment", // multi line comment
+ merge : true,
+ regex : "\\/\\*",
+ next : "comment_regex_allowed"
+ }, {
+ token : "comment",
+ regex : "\\/\\/.*$"
+ }, {
+ token: "string.regexp",
+ regex: "\\/",
+ next: "regex",
+ merge: true
+ }, {
+ token : "text",
+ regex : "\\s+"
+ }, {
+ // immediately return to the start mode without matching
+ // anything
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "regex": [
+ {
+ // escapes
+ token: "regexp.keyword.operator",
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
+ }, {
+ // flag
+ token: "string.regexp",
+ regex: "/\\w*",
+ next: "start",
+ merge: true
+ }, {
+ // invalid operators
+ token : "invalid",
+ regex: /\{\d+,?(?:\d+)?}[+*]|[+*^$?][+*]|\?\?/ // |[^$][?]
+ }, {
+ // operators
+ token : "constant.language.escape",
+ regex: /\(\?[:=!]|\)|\{\d+,?(?:\d+)?}|[+*]\?|[(|)$^+*?]/
+ }, {
+ token: "string.regexp",
+ regex: /{|[^\[\\{()$^+*?\/]+/,
+ merge: true
+ }, {
+ token: "constant.language.escape",
+ regex: /\[\^?/,
+ next: "regex_character_class",
+ merge: true
+ }, {
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "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",
+ merge: true
+ }, {
+ token: "constant.language.escape",
+ regex: "-",
+ }, {
+ token: "string.regexp.charachterclass",
+ regex: /[^\]\-\\]+/,
+ merge: true
+ }, {
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "function_arguments": [
+ {
+ token: "variable.parameter",
+ regex: identifierRe
+ }, {
+ token: "punctuation.operator",
+ regex: "[, ]+",
+ merge: true
+ }, {
+ token: "punctuation.operator",
+ regex: "$",
+ merge: true
+ }, {
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "comment_regex_allowed" : [
+ {
+ token : "comment", // closing comment
+ regex : ".*?\\*\\/",
+ merge : true,
+ next : "regex_allowed"
+ }, {
+ token : "comment", // comment spanning whole line
+ merge : true,
+ regex : ".+"
+ }
+ ],
+ "comment" : [
+ {
+ token : "comment", // closing comment
+ regex : ".*?\\*\\/",
+ merge : true,
+ next : "start"
+ }, {
+ token : "comment", // comment spanning whole line
+ merge : true,
+ regex : ".+"
+ }
+ ],
+ "qqstring" : [
+ {
+ token : "constant.language.escape",
+ regex : escapedRe
+ }, {
+ token : "string",
+ regex : '[^"\\\\]+',
+ merge : true
+ }, {
+ token : "string",
+ regex : "\\\\$",
+ next : "qqstring",
+ merge : true
+ }, {
+ token : "string",
+ regex : '"|$',
+ next : "start",
+ merge : true
+ }
+ ],
+ "qstring" : [
+ {
+ token : "constant.language.escape",
+ regex : escapedRe
+ }, {
+ token : "string",
+ regex : "[^'\\\\]+",
+ merge : true
+ }, {
+ token : "string",
+ regex : "\\\\$",
+ next : "qstring",
+ merge : true
+ }, {
+ token : "string",
+ regex : "'|$",
+ next : "start",
+ merge : true
+ }
+ ]
+ };
+
+ this.embedRules(DocCommentHighlightRules, "doc-",
+ [ DocCommentHighlightRules.getEndRule("start") ]);
+};
+
+oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
+
+exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
+});
+
+ace.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",
+ merge : true,
+ regex : "\\s+"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "TODO"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "[^@\\*]+"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "."
+ }]
+ };
+};
+
+oop.inherits(DocCommentHighlightRules, TextHighlightRules);
+
+DocCommentHighlightRules.getStartRule = function(start) {
+ return {
+ token : "comment.doc", // doc comment
+ merge : true,
+ regex : "\\/\\*(?=\\*)",
+ next : start
+ };
+};
+
+DocCommentHighlightRules.getEndRule = function (start) {
+ return {
+ token : "comment.doc", // closing comment
+ merge : true,
+ regex : "\\*\\/",
+ next : start
+ };
+};
+
+
+exports.DocCommentHighlightRules = DocCommentHighlightRules;
+
+});
+
+ace.define('ace/mode/xml_util', ['require', 'exports', 'module' ], function(require, exports, module) {
+
+
+function string(state) {
+ return [{
+ token : "string",
+ regex : '".*?"'
+ }, {
+ token : "string", // multi line string start
+ merge : true,
+ regex : '["].*',
+ next : state + "_qqstring"
+ }, {
+ token : "string",
+ regex : "'.*?'"
+ }, {
+ token : "string", // multi line string start
+ merge : true,
+ regex : "['].*",
+ next : state + "_qstring"
+ }];
+}
+
+function multiLineString(quote, state) {
+ return [{
+ token : "string",
+ merge : true,
+ regex : ".*?" + quote,
+ next : state
+ }, {
+ token : "string",
+ merge : true,
+ regex : '.+'
+ }];
+}
+
+exports.tag = function(states, name, nextState, tagMap) {
+ states[name] = [{
+ token : "text",
+ regex : "\\s+"
+ }, {
+ //token : "meta.tag",
+
+ token : !tagMap ? "meta.tag.tag-name" : function(value) {
+ if (tagMap[value])
+ return "meta.tag.tag-name." + tagMap[value];
+ else
+ return "meta.tag.tag-name";
+ },
+ merge : true,
+ 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",
+ merge : true,
+ 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));
+};
+
+});
+ace.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() {
+
+ // taken from http://download.oracle.com/javase/tutorial/java/nutsandbolts/_keywords.html
+ 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");
+
+ // regexp must not have capturing parentheses. Use (?:) instead.
+ // regexps are ordered -> the first match is used
+
+ this.$rules = {
+ "start" : [
+ {
+ token : "comment",
+ regex : "\\/\\/.*$"
+ },
+ DocCommentHighlightRules.getStartRule("doc-start"),
+ {
+ token : "comment", // multi line comment
+ merge : true,
+ 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,
+ // TODO: Unicode escape sequences
+ // TODO: Unicode identifiers
+ 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
+ merge : true,
+ regex : ".+"
+ }
+ ]
+ };
+
+ this.embedRules(DocCommentHighlightRules, "doc-",
+ [ DocCommentHighlightRules.getEndRule("start") ]);
+};
+
+oop.inherits(JavaHighlightRules, TextHighlightRules);
+
+exports.JavaHighlightRules = JavaHighlightRules;
+});
+
+ace.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;
+});
+
+ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour'], function(require, exports, module) {
+
+
+var oop = require("../../lib/oop");
+var Behaviour = require("../behaviour").Behaviour;
+
+var CstyleBehaviour = function () {
+
+ this.add("braces", "insertion", function (state, action, editor, session, text) {
+ if (text == '{') {
+ var selection = editor.getSelectionRange();
+ var selected = session.doc.getTextRange(selection);
+ if (selected !== "") {
+ return {
+ text: '{' + selected + '}',
+ selection: false
+ };
+ } else {
+ 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) {
+ return {
+ text: '',
+ selection: [1, 1]
+ };
+ }
+ }
+ } else if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ if (rightChar == '}') {
+ var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column + 1});
+ if (!openBracePos)
+ return null;
+
+ var indent = this.getNextLineIndent(state, line.substring(0, line.length - 1), session.getTabString());
+ var next_indent = this.$getIndent(session.doc.getLine(openBracePos.row));
+
+ return {
+ text: '\n' + indent + '\n' + next_indent,
+ 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;
+ }
+ }
+ });
+
+ this.add("parens", "insertion", function (state, action, editor, session, text) {
+ if (text == '(') {
+ var selection = editor.getSelectionRange();
+ var selected = session.doc.getTextRange(selection);
+ if (selected !== "") {
+ return {
+ text: '(' + selected + ')',
+ selection: false
+ };
+ } else {
+ 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) {
+ 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 !== "") {
+ return {
+ text: '[' + selected + ']',
+ selection: false
+ };
+ } else {
+ 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) {
+ 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 !== "") {
+ 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);
+
+ // We're escaped.
+ if (leftChar == '\\') {
+ return null;
+ }
+
+ // Find what token we're inside.
+ 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;
+ }
+
+ // Try and be smart about when we auto insert.
+ 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)))) {
+ return {
+ text: quote + quote,
+ selection: [1,1]
+ };
+ } else if (token && token.type === "string") {
+ // Ignore input and move right one if we're typing over the closing quote.
+ 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 == '"') {
+ range.end.column++;
+ return range;
+ }
+ }
+ });
+
+};
+
+oop.inherits(CstyleBehaviour, Behaviour);
+
+exports.CstyleBehaviour = CstyleBehaviour;
+});
+
+ace.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);
+
+ var range = session.getCommentFoldRange(row, i + match[0].length);
+ range.end.column -= 2;
+ return range;
+ }
+
+ if (foldStyle !== "markbeginend")
+ return;
+
+ var match = line.match(this.foldingStopMarker);
+ if (match) {
+ var i = match.index + match[0].length;
+
+ if (match[2]) {
+ var range = session.getCommentFoldRange(row, i);
+ range.end.column -= 2;
+ return range;
+ }
+
+ var end = {row: row, column: i};
+ var start = session.$findOpeningBracket(match[1], end);
+
+ if (!start)
+ return;
+
+ start.column++;
+ end.column--;
+
+ return Range.fromPoints(start, end);
+ }
+ };
+
+}).call(FoldMode.prototype);
+
+});
+
+ace.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;
+
+ // must return "" if there's no fold, to enable caching
+ 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);
+ };
+
+}).call(FoldMode.prototype);
+
+});
+
+ace.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) {
+ var errors = [];
+ for (var i=0; i<results.data.length; i++) {
+ var error = results.data[i];
+ if (error)
+ errors.push({
+ row: error.line-1,
+ column: error.character-1,
+ text: error.reason,
+ type: "warning",
+ lint: error
+ });
+ }
+ session.setAnnotations(errors);
+ });
+
+ worker.on("narcissus", function(e) {
+ session.setAnnotations([e.data]);
+ });
+
+ worker.on("terminate", function() {
+ session.clearAnnotations();
+ });
+
+ return worker;
+ };
+
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+});
+
+ace.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/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 CStyleFoldMode = require("./folding/cstyle").FoldMode;
+
+var Mode = function() {
+ this.$tokenizer = new Tokenizer(new CssHighlightRules().getRules(), "i");
+ this.$outdent = new MatchingBraceOutdent();
+ this.foldingRules = new CStyleFoldMode();
+};
+oop.inherits(Mode, TextMode);
+
+(function() {
+
+ this.foldingRules = "cStyle";
+
+ this.getNextLineIndent = function(state, line, tab) {
+ var indent = this.$getIndent(line);
+
+ // ignore braces in comments
+ 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) {
+ var errors = [];
+ e.data.forEach(function(message) {
+ errors.push({
+ row: message.line - 1,
+ column: message.col - 1,
+ text: message.message,
+ type: message.type,
+ lint: message
+ });
+ });
+
+ session.setAnnotations(errors);
+ });
+ return worker;
+ };
+
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/mode-jsx.js b/vendor/assets/javascripts/ace-src-noconflict/mode-jsx.js
new file mode 100644
index 00000000000..986edd9a899
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/mode-jsx.js
@@ -0,0 +1,646 @@
+ace.define('ace/mode/jsx', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/jsx_highlight_rules', 'ace/mode/matching_brace_outdent', '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 JsxHighlightRules = require("./jsx_highlight_rules").JsxHighlightRules;
+var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
+var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
+var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+
+function Mode() {
+ this.$tokenizer = new Tokenizer(new JsxHighlightRules().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);
+
+ var tokenizedLine = this.$tokenizer.getLineTokens(line, state);
+ var tokens = tokenizedLine.tokens;
+
+ if (tokens.length && tokens[tokens.length-1].type == "comment") {
+ return indent;
+ }
+
+ if (state == "start") {
+ var match = line.match(/^.*[\{\(\[]\s*$/);
+ 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;
+});
+ace.define('ace/mode/jsx_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
+ var oop = require("../lib/oop");
+ var lang = require("../lib/lang");
+ var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+
+ var JsxHighlightRules = function() {
+ var keywords = lang.arrayToMap(
+ ("break|do|instanceof|typeof|case|else|new|var|catch|finally|return|void|continue|for|switch|default|while|function|this|" +
+ "if|throw|" +
+ "delete|in|try|" +
+ "class|extends|super|import|from|into|implements|interface|static|mixin|override|abstract|final|" +
+ "number|int|string|boolean|variant|" +
+ "log|assert").split("|")
+ );
+
+ var buildinConstants = lang.arrayToMap(
+ ("null|true|false|NaN|Infinity|__FILE__|__LINE__|undefined").split("|")
+ );
+
+ var reserved = lang.arrayToMap(
+ ("debugger|with|" +
+ "const|export|" +
+ "let|private|public|yield|protected|" +
+ "extern|native|as|operator|__fake__|__readonly__").split("|")
+ );
+
+ var identifierRe = "[a-zA-Z_][a-zA-Z0-9_]*\\b";
+
+ this.$rules = {
+ "start" : [
+ {
+ token : "comment",
+ regex : "\\/\\/.*$"
+ },
+ DocCommentHighlightRules.getStartRule("doc-start"),
+ {
+ token : "comment", // multi line comment
+ regex : "\\/\\*",
+ merge : true,
+ 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 : [
+ "storage.type",
+ "text",
+ "entity.name.function"
+ ],
+ regex : "(function)(\\s+)(" + identifierRe + ")"
+ }, {
+ token : function(value) {
+ if (value == "this")
+ return "variable.language";
+ else if (value == "function")
+ return "storage.type";
+ else if (keywords.hasOwnProperty(value) || reserved.hasOwnProperty(value))
+ return "keyword";
+ else if (buildinConstants.hasOwnProperty(value))
+ return "constant.language";
+ else if (/^_?[A-Z][a-zA-Z0-9_]*$/.test(value))
+ return "language.support.class";
+ else
+ return "identifier";
+ },
+ // TODO: Unicode escape sequences
+ // TODO: Unicode identifiers
+ regex : identifierRe
+ }, {
+ token : "keyword.operator",
+ regex : "!|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|==|=|!=|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|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
+ merge : true,
+ regex : ".+"
+ }
+ ]
+ };
+
+ this.embedRules(DocCommentHighlightRules, "doc-",
+ [ DocCommentHighlightRules.getEndRule("start") ]);
+ };
+
+ oop.inherits(JsxHighlightRules, TextHighlightRules);
+
+ exports.JsxHighlightRules = JsxHighlightRules;
+});
+
+ace.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",
+ merge : true,
+ regex : "\\s+"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "TODO"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "[^@\\*]+"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "."
+ }]
+ };
+};
+
+oop.inherits(DocCommentHighlightRules, TextHighlightRules);
+
+DocCommentHighlightRules.getStartRule = function(start) {
+ return {
+ token : "comment.doc", // doc comment
+ merge : true,
+ regex : "\\/\\*(?=\\*)",
+ next : start
+ };
+};
+
+DocCommentHighlightRules.getEndRule = function (start) {
+ return {
+ token : "comment.doc", // closing comment
+ merge : true,
+ regex : "\\*\\/",
+ next : start
+ };
+};
+
+
+exports.DocCommentHighlightRules = DocCommentHighlightRules;
+
+});
+
+ace.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;
+});
+
+ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour'], function(require, exports, module) {
+
+
+var oop = require("../../lib/oop");
+var Behaviour = require("../behaviour").Behaviour;
+
+var CstyleBehaviour = function () {
+
+ this.add("braces", "insertion", function (state, action, editor, session, text) {
+ if (text == '{') {
+ var selection = editor.getSelectionRange();
+ var selected = session.doc.getTextRange(selection);
+ if (selected !== "") {
+ return {
+ text: '{' + selected + '}',
+ selection: false
+ };
+ } else {
+ 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) {
+ return {
+ text: '',
+ selection: [1, 1]
+ };
+ }
+ }
+ } else if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ if (rightChar == '}') {
+ var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column + 1});
+ if (!openBracePos)
+ return null;
+
+ var indent = this.getNextLineIndent(state, line.substring(0, line.length - 1), session.getTabString());
+ var next_indent = this.$getIndent(session.doc.getLine(openBracePos.row));
+
+ return {
+ text: '\n' + indent + '\n' + next_indent,
+ 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;
+ }
+ }
+ });
+
+ this.add("parens", "insertion", function (state, action, editor, session, text) {
+ if (text == '(') {
+ var selection = editor.getSelectionRange();
+ var selected = session.doc.getTextRange(selection);
+ if (selected !== "") {
+ return {
+ text: '(' + selected + ')',
+ selection: false
+ };
+ } else {
+ 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) {
+ 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 !== "") {
+ return {
+ text: '[' + selected + ']',
+ selection: false
+ };
+ } else {
+ 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) {
+ 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 !== "") {
+ 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);
+
+ // We're escaped.
+ if (leftChar == '\\') {
+ return null;
+ }
+
+ // Find what token we're inside.
+ 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;
+ }
+
+ // Try and be smart about when we auto insert.
+ 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)))) {
+ return {
+ text: quote + quote,
+ selection: [1,1]
+ };
+ } else if (token && token.type === "string") {
+ // Ignore input and move right one if we're typing over the closing quote.
+ 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 == '"') {
+ range.end.column++;
+ return range;
+ }
+ }
+ });
+
+};
+
+oop.inherits(CstyleBehaviour, Behaviour);
+
+exports.CstyleBehaviour = CstyleBehaviour;
+});
+
+ace.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);
+
+ var range = session.getCommentFoldRange(row, i + match[0].length);
+ range.end.column -= 2;
+ return range;
+ }
+
+ if (foldStyle !== "markbeginend")
+ return;
+
+ var match = line.match(this.foldingStopMarker);
+ if (match) {
+ var i = match.index + match[0].length;
+
+ if (match[2]) {
+ var range = session.getCommentFoldRange(row, i);
+ range.end.column -= 2;
+ return range;
+ }
+
+ var end = {row: row, column: i};
+ var start = session.$findOpeningBracket(match[1], end);
+
+ if (!start)
+ return;
+
+ start.column++;
+ end.column--;
+
+ return Range.fromPoints(start, end);
+ }
+ };
+
+}).call(FoldMode.prototype);
+
+});
+
+ace.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;
+
+ // must return "" if there's no fold, to enable caching
+ 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);
+ };
+
+}).call(FoldMode.prototype);
+
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/mode-latex.js b/vendor/assets/javascripts/ace-src-noconflict/mode-latex.js
new file mode 100644
index 00000000000..eb706bbdb60
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/mode-latex.js
@@ -0,0 +1,95 @@
+ace.define('ace/mode/latex', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/latex_highlight_rules', 'ace/range'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var TextMode = require("./text").Mode;
+var Tokenizer = require("../tokenizer").Tokenizer;
+var LatexHighlightRules = require("./latex_highlight_rules").LatexHighlightRules;
+var Range = require("../range").Range;
+
+var Mode = function()
+{
+ this.$tokenizer = new Tokenizer(new LatexHighlightRules().getRules());
+};
+oop.inherits(Mode, TextMode);
+
+(function() {
+ this.toggleCommentLines = function(state, doc, startRow, endRow) {
+ // This code is adapted from ruby.js
+ var outdent = true;
+
+ // LaTeX comments begin with % and go to the end of the line
+ var commentRegEx = /^(\s*)\%/;
+
+ for (var i = startRow; i <= endRow; i++) {
+ if (!commentRegEx.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(commentRegEx);
+ deleteRange.start.row = i;
+ deleteRange.end.row = i;
+ deleteRange.end.column = m[0].length;
+ doc.replace(deleteRange, m[1]);
+ }
+ }
+ else {
+ doc.indentRows(startRow, endRow, "%");
+ }
+ };
+
+ // There is no universally accepted way of indenting a tex document
+ // so just maintain the indentation of the previous line
+ this.getNextLineIndent = function(state, line, tab) {
+ return this.$getIndent(line);
+ };
+
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+
+});
+ace.define('ace/mode/latex_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 LatexHighlightRules = function() {
+ this.$rules = {
+ "start" : [{
+ // A tex command e.g. \foo
+ token : "keyword",
+ regex : "\\\\(?:[^a-zA-Z]|[a-zA-Z]+)",
+ }, {
+ // Curly and square braces
+ token : "lparen",
+ regex : "[[({]"
+ }, {
+ // Curly and square braces
+ token : "rparen",
+ regex : "[\\])}]"
+ }, {
+ // Inline math between two $ symbols
+ token : "string",
+ regex : "\\$(?:(?:\\\\.)|(?:[^\\$\\\\]))*?\\$"
+ }, {
+ // A comment. Tex comments start with % and go to
+ // the end of the line
+ token : "comment",
+ regex : "%.*$"
+ }]
+ };
+};
+
+oop.inherits(LatexHighlightRules, TextHighlightRules);
+
+exports.LatexHighlightRules = LatexHighlightRules;
+
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/mode-less.js b/vendor/assets/javascripts/ace-src-noconflict/mode-less.js
new file mode 100644
index 00000000000..43bf8a9d524
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/mode-less.js
@@ -0,0 +1,504 @@
+/* ***** 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 ***** */
+
+ace.define('ace/mode/less', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/less_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/mode/folding/cstyle'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var TextMode = require("./text").Mode;
+var Tokenizer = require("../tokenizer").Tokenizer;
+var LessHighlightRules = require("./less_highlight_rules").LessHighlightRules;
+var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
+var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+
+var Mode = function() {
+ this.$tokenizer = new Tokenizer(new LessHighlightRules().getRules(), "i");
+ this.$outdent = new MatchingBraceOutdent();
+ this.foldingRules = new CStyleFoldMode();
+};
+oop.inherits(Mode, TextMode);
+
+(function() {
+
+ this.getNextLineIndent = function(state, line, tab) {
+ var indent = this.$getIndent(line);
+
+ // ignore braces in comments
+ 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);
+ };
+
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+
+});
+
+ace.define('ace/mode/less_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 LessHighlightRules = function() {
+
+ var properties = lang.arrayToMap( (function () {
+
+ var browserPrefix = ("-webkit-|-moz-|-o-|-ms-|-svg-|-pie-|-khtml-").split("|");
+
+ var prefixProperties = ("appearance|background-clip|background-inline-policy|background-origin|" +
+ "background-size|binding|border-bottom-colors|border-left-colors|" +
+ "border-right-colors|border-top-colors|border-end|border-end-color|" +
+ "border-end-style|border-end-width|border-image|border-start|" +
+ "border-start-color|border-start-style|border-start-width|box-align|" +
+ "box-direction|box-flex|box-flexgroup|box-ordinal-group|box-orient|" +
+ "box-pack|box-sizing|column-count|column-gap|column-width|column-rule|" +
+ "column-rule-width|column-rule-style|column-rule-color|float-edge|" +
+ "font-feature-settings|font-language-override|force-broken-image-icon|" +
+ "image-region|margin-end|margin-start|opacity|outline|outline-color|" +
+ "outline-offset|outline-radius|outline-radius-bottomleft|" +
+ "outline-radius-bottomright|outline-radius-topleft|outline-radius-topright|" +
+ "outline-style|outline-width|padding-end|padding-start|stack-sizing|" +
+ "tab-size|text-blink|text-decoration-color|text-decoration-line|" +
+ "text-decoration-style|transform|transform-origin|transition|" +
+ "transition-delay|transition-duration|transition-property|" +
+ "transition-timing-function|user-focus|user-input|user-modify|user-select|" +
+ "window-shadow|border-radius").split("|");
+
+ var properties = ("azimuth|background-attachment|background-color|background-image|" +
+ "background-position|background-repeat|background|border-bottom-color|" +
+ "border-bottom-style|border-bottom-width|border-bottom|border-collapse|" +
+ "border-color|border-left-color|border-left-style|border-left-width|" +
+ "border-left|border-right-color|border-right-style|border-right-width|" +
+ "border-right|border-spacing|border-style|border-top-color|" +
+ "border-top-style|border-top-width|border-top|border-width|border|" +
+ "bottom|box-sizing|caption-side|clear|clip|color|content|counter-increment|" +
+ "counter-reset|cue-after|cue-before|cue|cursor|direction|display|" +
+ "elevation|empty-cells|float|font-family|font-size-adjust|font-size|" +
+ "font-stretch|font-style|font-variant|font-weight|font|height|left|" +
+ "letter-spacing|line-height|list-style-image|list-style-position|" +
+ "list-style-type|list-style|margin-bottom|margin-left|margin-right|" +
+ "margin-top|marker-offset|margin|marks|max-height|max-width|min-height|" +
+ "min-width|opacity|orphans|outline-color|" +
+ "outline-style|outline-width|outline|overflow|overflow-x|overflow-y|padding-bottom|" +
+ "padding-left|padding-right|padding-top|padding|page-break-after|" +
+ "page-break-before|page-break-inside|page|pause-after|pause-before|" +
+ "pause|pitch-range|pitch|play-during|position|quotes|richness|right|" +
+ "size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|" +
+ "stress|table-layout|text-align|text-decoration|text-indent|" +
+ "text-shadow|text-transform|top|unicode-bidi|vertical-align|" +
+ "visibility|voice-family|volume|white-space|widows|width|word-spacing|" +
+ "z-index").split("|");
+
+ //The return array
+ var ret = [];
+
+ //All prefixProperties will get the browserPrefix in
+ //the begning by join the prefixProperties array with the value of browserPrefix
+ for (var i=0, ln=browserPrefix.length; i<ln; i++) {
+ Array.prototype.push.apply(
+ ret,
+ (( browserPrefix[i] + prefixProperties.join("|" + browserPrefix[i]) ).split("|"))
+ );
+ }
+
+ //Add also prefixProperties and properties without any browser prefix
+ Array.prototype.push.apply(ret, prefixProperties);
+ Array.prototype.push.apply(ret, properties);
+
+ return ret;
+
+ })() );
+
+
+
+ var functions = lang.arrayToMap(
+ ("hsl|hsla|rgb|rgba|url|attr|counter|counters|lighten|darken|saturate|" +
+ "desaturate|fadein|fadeout|fade|spin|mix|hue|saturation|lightness|" +
+ "alpha|round|ceil|floor|percentage|color|iscolor|isnumber|isstring|" +
+ "iskeyword|isurl|ispixel|ispercentage|isem").split("|")
+ );
+
+ var constants = lang.arrayToMap(
+ ("absolute|all-scroll|always|armenian|auto|baseline|below|bidi-override|" +
+ "block|bold|bolder|border-box|both|bottom|break-all|break-word|capitalize|center|" +
+ "char|circle|cjk-ideographic|col-resize|collapse|content-box|crosshair|dashed|" +
+ "decimal-leading-zero|decimal|default|disabled|disc|" +
+ "distribute-all-lines|distribute-letter|distribute-space|" +
+ "distribute|dotted|double|e-resize|ellipsis|fixed|georgian|groove|" +
+ "hand|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|" +
+ "ideograph-alpha|ideograph-numeric|ideograph-parenthesis|" +
+ "ideograph-space|inactive|inherit|inline-block|inline|inset|inside|" +
+ "inter-ideograph|inter-word|italic|justify|katakana-iroha|katakana|" +
+ "keep-all|left|lighter|line-edge|line-through|line|list-item|loose|" +
+ "lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|" +
+ "medium|middle|move|n-resize|ne-resize|newspaper|no-drop|no-repeat|" +
+ "nw-resize|none|normal|not-allowed|nowrap|oblique|outset|outside|" +
+ "overline|pointer|progress|relative|repeat-x|repeat-y|repeat|right|" +
+ "ridge|row-resize|rtl|s-resize|scroll|se-resize|separate|small-caps|" +
+ "solid|square|static|strict|super|sw-resize|table-footer-group|" +
+ "table-header-group|tb-rl|text-bottom|text-top|text|thick|thin|top|" +
+ "transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|" +
+ "vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|" +
+ "zero").split("|")
+ );
+
+ var colors = lang.arrayToMap(
+ ("aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|" +
+ "purple|red|silver|teal|white|yellow").split("|")
+ );
+
+ var keywords = lang.arrayToMap(
+ ("@mixin|@extend|@include|@import|@media|@debug|@warn|@if|@for|@each|" +
+ "@while|@else|@font-face|@-webkit-keyframes|if|and|!default|module|" +
+ "def|end|declare|when|not|and").split("|")
+ );
+
+ var tags = lang.arrayToMap(
+ ("a|abbr|acronym|address|applet|area|article|aside|audio|b|base|basefont|bdo|" +
+ "big|blockquote|body|br|button|canvas|caption|center|cite|code|col|colgroup|" +
+ "command|datalist|dd|del|details|dfn|dir|div|dl|dt|em|embed|fieldset|" +
+ "figcaption|figure|font|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|" +
+ "header|hgroup|hr|html|i|iframe|img|input|ins|keygen|kbd|label|legend|li|" +
+ "link|map|mark|menu|meta|meter|nav|noframes|noscript|object|ol|optgroup|" +
+ "option|output|p|param|pre|progress|q|rp|rt|ruby|s|samp|script|section|select|" +
+ "small|source|span|strike|strong|style|sub|summary|sup|table|tbody|td|" +
+ "textarea|tfoot|th|thead|time|title|tr|tt|u|ul|var|video|wbr|xmp").split("|")
+ );
+
+ // regexp must not have capturing parentheses. Use (?:) instead.
+ // regexps are ordered -> the first match is used
+
+ var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
+
+ // regexp must not have capturing parentheses. Use (?:) instead.
+ // regexps are ordered -> the first match is used
+
+ this.$rules = {
+ "start" : [
+ {
+ token : "comment",
+ regex : "\\/\\/.*$"
+ },
+ {
+ token : "comment", // multi line comment
+ merge : true,
+ regex : "\\/\\*",
+ next : "comment"
+ }, {
+ token : "string", // single line
+ regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
+ }, {
+ token : "string", // single line
+ regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
+ }, {
+ token : "constant.numeric",
+ regex : numRe + "(?:em|ex|px|cm|mm|in|pt|pc|deg|rad|grad|ms|s|hz|khz|%)"
+ }, {
+ token : "constant.numeric", // hex6 color
+ regex : "#[a-f0-9]{6}"
+ }, {
+ token : "constant.numeric", // hex3 color
+ regex : "#[a-f0-9]{3}"
+ }, {
+ token : "constant.numeric",
+ regex : numRe
+ }, {
+ token : function(value) {
+ if (keywords.hasOwnProperty(value))
+ return "keyword";
+ else
+ return "variable";
+ },
+ regex : "@[a-z0-9_\\-@]*\\b"
+ }, {
+ token : function(value) {
+ if (properties.hasOwnProperty(value.toLowerCase()))
+ return "support.type";
+ else if (keywords.hasOwnProperty(value))
+ return "keyword";
+ else if (constants.hasOwnProperty(value))
+ return "constant.language";
+ else if (functions.hasOwnProperty(value))
+ return "support.function";
+ else if (colors.hasOwnProperty(value.toLowerCase()))
+ return "support.constant.color";
+ else if (tags.hasOwnProperty(value.toLowerCase()))
+ return "variable.language";
+ else
+ return "text";
+ },
+ regex : "\\-?[@a-z_][@a-z0-9_\\-]*"
+ }, {
+ token: "variable.language",
+ regex: "#[a-z0-9-_]+"
+ }, {
+ token: "variable.language",
+ regex: "\\.[a-z0-9-_]+"
+ }, {
+ token: "variable.language",
+ regex: ":[a-z0-9-_]+"
+ }, {
+ token: "constant",
+ regex: "[a-z0-9-_]+"
+ }, {
+ token : "keyword.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
+ merge : true,
+ regex : ".+"
+ }
+ ]
+ };
+};
+
+oop.inherits(LessHighlightRules, TextHighlightRules);
+
+exports.LessHighlightRules = LessHighlightRules;
+
+});
+
+ace.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;
+});
+
+ace.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);
+
+ var range = session.getCommentFoldRange(row, i + match[0].length);
+ range.end.column -= 2;
+ return range;
+ }
+
+ if (foldStyle !== "markbeginend")
+ return;
+
+ var match = line.match(this.foldingStopMarker);
+ if (match) {
+ var i = match.index + match[0].length;
+
+ if (match[2]) {
+ var range = session.getCommentFoldRange(row, i);
+ range.end.column -= 2;
+ return range;
+ }
+
+ var end = {row: row, column: i};
+ var start = session.$findOpeningBracket(match[1], end);
+
+ if (!start)
+ return;
+
+ start.column++;
+ end.column--;
+
+ return Range.fromPoints(start, end);
+ }
+ };
+
+}).call(FoldMode.prototype);
+
+});
+
+ace.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;
+
+ // must return "" if there's no fold, to enable caching
+ 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);
+ };
+
+}).call(FoldMode.prototype);
+
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/mode-liquid.js b/vendor/assets/javascripts/ace-src-noconflict/mode-liquid.js
new file mode 100644
index 00000000000..2623396ca0a
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/mode-liquid.js
@@ -0,0 +1,1003 @@
+/* ***** 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 ***** */
+
+ace.define('ace/mode/liquid', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/liquid_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range'], function(require, exports, module) {
+
+var oop = require("../lib/oop");
+var TextMode = require("./text").Mode;
+var Tokenizer = require("../tokenizer").Tokenizer;
+var LiquidHighlightRules = require("./liquid_highlight_rules").LiquidHighlightRules;
+var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
+var Range = require("../range").Range;
+
+var Mode = function() {
+ this.$tokenizer = new Tokenizer(new LiquidHighlightRules().getRules());
+ this.$outdent = new MatchingBraceOutdent();
+};
+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, "#");
+ }
+ };
+
+ 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") {
+ 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;
+});
+
+ace.define('ace/mode/liquid_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', '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 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 LiquidHighlightRules = function() {
+
+ // see: https://developer.mozilla.org/en/Liquid/Reference/Global_Objects
+ var functions = (
+ // Standard Filters
+ "date|capitalize|downcase|upcase|first|last|join|sort|map|size|escape|" +
+ "escape_once|strip_html|strip_newlines|newline_to_br|replace|replace_first|" +
+ "truncate|truncatewords|prepend|append|minus|plus|times|divided_by|split"
+ );
+
+ var keywords = (
+ // Standard Tags
+ "capture|endcapture|case|endcase|when|comment|endcomment|" +
+ "cycle|for|endfor|in|reversed|if|endif|else|elsif|include|endinclude|unless|endunless|" +
+ // Commonly used tags
+ "style|text|image|widget|plugin|marker|endmarker|tablerow|endtablerow"
+ );
+
+ var builtinVariables = 'forloop|tablerowloop';
+ // "forloop\\.(length|index|index0|rindex|rindex0|first|last)|limit|offset|range" +
+ // "tablerowloop\\.(length|index|index0|rindex|rindex0|first|last|col|col0|"+
+ // "col_first|col_last)"
+
+ var definitions = ("assign");
+
+ var keywordMapper = this.createKeywordMapper({
+ "variable.language": builtinVariables,
+ "keyword": keywords,
+ "support.function": functions,
+ "keyword.definition": definitions
+ }, "identifier");
+
+ // regexp must not have capturing parentheses. Use (?:) instead.
+ // regexps are ordered -> the first match is used
+
+ this.$rules = {
+ start : [{
+ token : "variable",
+ regex : "{%",
+ next : "liquid_start"
+ }, {
+ token : "variable",
+ regex : "{{",
+ next : "liquid_start"
+ }, {
+ token : "meta.tag",
+ merge : true,
+ regex : "<\\!\\[CDATA\\[",
+ next : "cdata"
+ }, {
+ token : "xml_pe",
+ regex : "<\\?.*?\\?>"
+ }, {
+ token : "comment",
+ merge : true,
+ regex : "<\\!--",
+ next : "comment"
+ }, {
+ token : "meta.tag",
+ regex : "<(?=\\s*script\\b)",
+ next : "script"
+ }, {
+ token : "meta.tag",
+ regex : "<(?=\\s*style\\b)",
+ next : "style"
+ }, {
+ token : "meta.tag", // opening tag
+ regex : "<\\/?",
+ next : "tag"
+ }, {
+ token : "text",
+ regex : "\\s+"
+ }, {
+ token : "text",
+ regex : "[^<]+"
+ } ],
+
+ cdata : [ {
+ token : "text",
+ regex : "\\]\\]>",
+ next : "start"
+ }, {
+ token : "text",
+ merge : true,
+ regex : "\\s+"
+ }, {
+ token : "text",
+ merge : true,
+ regex : ".+"
+ } ],
+
+ comment : [ {
+ token : "comment",
+ regex : ".*?-->",
+ next : "start"
+ }, {
+ token : "comment",
+ merge : true,
+ regex : ".+"
+ } ] ,
+
+ liquid_start : [{
+ token: "variable",
+ regex: "}}",
+ next: "start"
+ }, {
+ token: "variable",
+ regex: "%}",
+ next: "start"
+ }, {
+ 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 : "\/|\\*|\\-|\\+|=|!=|\\?\\:"
+ }, {
+ token : "paren.lparen",
+ regex : /[\[\({]/
+ }, {
+ token : "paren.rparen",
+ regex : /[\])}]/
+ }, {
+ token : "text",
+ regex : "\\s+"
+ }]
+ };
+
+ xmlUtil.tag(this.$rules, "tag", "start");
+ xmlUtil.tag(this.$rules, "style", "css-start");
+ xmlUtil.tag(this.$rules, "script", "js-start");
+
+ 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(LiquidHighlightRules, TextHighlightRules);
+
+exports.LiquidHighlightRules = LiquidHighlightRules;
+});
+
+ace.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 CssHighlightRules = function() {
+ var keywordMapper = this.createKeywordMapper({
+ "support.type": "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",
+ "support.function": "rgb|rgba|url|attr|counter|counters",
+ "support.constant": "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",
+ "support.constant.color": "aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow",
+ "support.constant.fonts": "arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace"
+ }, "text", true);
+
+ // regexp must not have capturing parentheses. Use (?:) instead.
+ // regexps are ordered -> the first match is used
+
+ var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
+ var pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
+ var 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 base_ruleset = [
+ {
+ token : "comment", // multi line comment
+ merge : true,
+ 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 : "([0-9]+)"
+ }, {
+ 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
+ merge : true,
+ 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
+ merge : true,
+ 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
+ merge : true,
+ 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;
+
+});
+
+ace.define('ace/mode/javascript_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/unicode', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var unicode = require("../unicode");
+var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
+var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+
+var JavaScriptHighlightRules = function() {
+ // see: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects
+ 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
+ "invalid.deprecated":
+ "__parent__|__count__|escape|unescape|with|__proto__|debugger",
+ "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|",
+ "storage.type":
+ "const|let|var|function",
+ "invalid.illegal":
+ "class|enum|extends|super|export|implements|private|" +
+ "public|interface|package|protected|static",
+ "constant.language":
+ "null|Infinity|NaN|undefined",
+ }, "identifier");
+
+
+ // keywords which can be followed by regular expressions
+ var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield";
+
+ // TODO: Unicode escape sequences
+ 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
+ ".)";
+
+ // regexp must not have capturing parentheses. Use (?:) instead.
+ // regexps are ordered -> the first match is used
+
+ this.$rules = {
+ "start" : [
+ {
+ token : "comment",
+ regex : /\/\/.*$/
+ },
+ DocCommentHighlightRules.getStartRule("doc-start"),
+ {
+ token : "comment", // multi line comment
+ merge : true,
+ 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/
+ }, {
+ // Sound.prototype.play =
+ token : [
+ "storage.type", "punctuation.operator", "support.function",
+ "punctuation.operator", "entity.name.function", "text","keyword.operator"
+ ],
+ regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)",
+ next: "function_arguments"
+ }, {
+ // Sound.play = function() { }
+ 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"
+ }, {
+ // play = function() { }
+ token : [
+ "entity.name.function", "text", "keyword.operator", "text", "storage.type",
+ "text", "paren.lparen"
+ ],
+ regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ // Sound.play = function play() { }
+ 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"
+ }, {
+ // function myFunc(arg) { }
+ token : [
+ "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ ],
+ regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ // foobar: function() { }
+ token : [
+ "entity.name.function", "text", "punctuation.operator",
+ "text", "storage.type", "text", "paren.lparen"
+ ],
+ regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ // : function() { } (this is for issues with 'foo': function() { })
+ token : [
+ "text", "text", "storage.type", "text", "paren.lparen"
+ ],
+ regex : "(:)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ token : "constant.language.boolean",
+ regex : /(?:true|false)\b/
+ }, {
+ 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 : /!|\$|%|&|\*|\-\-|\-|\+\+|\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=|\b(?:in|instanceof|new|delete|typeof|void)/,
+ 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: /^#!.*$/
+ }, {
+ token : "text",
+ regex : /\s+/
+ }
+ ],
+ // regular expressions are only allowed after certain tokens. This
+ // makes sure we don't mix up regexps with the divison operator
+ "regex_allowed": [
+ DocCommentHighlightRules.getStartRule("doc-start"),
+ {
+ token : "comment", // multi line comment
+ merge : true,
+ regex : "\\/\\*",
+ next : "comment_regex_allowed"
+ }, {
+ token : "comment",
+ regex : "\\/\\/.*$"
+ }, {
+ token: "string.regexp",
+ regex: "\\/",
+ next: "regex",
+ merge: true
+ }, {
+ token : "text",
+ regex : "\\s+"
+ }, {
+ // immediately return to the start mode without matching
+ // anything
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "regex": [
+ {
+ // escapes
+ token: "regexp.keyword.operator",
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
+ }, {
+ // flag
+ token: "string.regexp",
+ regex: "/\\w*",
+ next: "start",
+ merge: true
+ }, {
+ // invalid operators
+ token : "invalid",
+ regex: /\{\d+,?(?:\d+)?}[+*]|[+*^$?][+*]|\?\?/ // |[^$][?]
+ }, {
+ // operators
+ token : "constant.language.escape",
+ regex: /\(\?[:=!]|\)|\{\d+,?(?:\d+)?}|[+*]\?|[(|)$^+*?]/
+ }, {
+ token: "string.regexp",
+ regex: /{|[^\[\\{()$^+*?\/]+/,
+ merge: true
+ }, {
+ token: "constant.language.escape",
+ regex: /\[\^?/,
+ next: "regex_character_class",
+ merge: true
+ }, {
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "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",
+ merge: true
+ }, {
+ token: "constant.language.escape",
+ regex: "-",
+ }, {
+ token: "string.regexp.charachterclass",
+ regex: /[^\]\-\\]+/,
+ merge: true
+ }, {
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "function_arguments": [
+ {
+ token: "variable.parameter",
+ regex: identifierRe
+ }, {
+ token: "punctuation.operator",
+ regex: "[, ]+",
+ merge: true
+ }, {
+ token: "punctuation.operator",
+ regex: "$",
+ merge: true
+ }, {
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "comment_regex_allowed" : [
+ {
+ token : "comment", // closing comment
+ regex : ".*?\\*\\/",
+ merge : true,
+ next : "regex_allowed"
+ }, {
+ token : "comment", // comment spanning whole line
+ merge : true,
+ regex : ".+"
+ }
+ ],
+ "comment" : [
+ {
+ token : "comment", // closing comment
+ regex : ".*?\\*\\/",
+ merge : true,
+ next : "start"
+ }, {
+ token : "comment", // comment spanning whole line
+ merge : true,
+ regex : ".+"
+ }
+ ],
+ "qqstring" : [
+ {
+ token : "constant.language.escape",
+ regex : escapedRe
+ }, {
+ token : "string",
+ regex : '[^"\\\\]+',
+ merge : true
+ }, {
+ token : "string",
+ regex : "\\\\$",
+ next : "qqstring",
+ merge : true
+ }, {
+ token : "string",
+ regex : '"|$',
+ next : "start",
+ merge : true
+ }
+ ],
+ "qstring" : [
+ {
+ token : "constant.language.escape",
+ regex : escapedRe
+ }, {
+ token : "string",
+ regex : "[^'\\\\]+",
+ merge : true
+ }, {
+ token : "string",
+ regex : "\\\\$",
+ next : "qstring",
+ merge : true
+ }, {
+ token : "string",
+ regex : "'|$",
+ next : "start",
+ merge : true
+ }
+ ]
+ };
+
+ this.embedRules(DocCommentHighlightRules, "doc-",
+ [ DocCommentHighlightRules.getEndRule("start") ]);
+};
+
+oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
+
+exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
+});
+
+ace.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",
+ merge : true,
+ regex : "\\s+"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "TODO"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "[^@\\*]+"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "."
+ }]
+ };
+};
+
+oop.inherits(DocCommentHighlightRules, TextHighlightRules);
+
+DocCommentHighlightRules.getStartRule = function(start) {
+ return {
+ token : "comment.doc", // doc comment
+ merge : true,
+ regex : "\\/\\*(?=\\*)",
+ next : start
+ };
+};
+
+DocCommentHighlightRules.getEndRule = function (start) {
+ return {
+ token : "comment.doc", // closing comment
+ merge : true,
+ regex : "\\*\\/",
+ next : start
+ };
+};
+
+
+exports.DocCommentHighlightRules = DocCommentHighlightRules;
+
+});
+
+ace.define('ace/mode/xml_util', ['require', 'exports', 'module' ], function(require, exports, module) {
+
+
+function string(state) {
+ return [{
+ token : "string",
+ regex : '".*?"'
+ }, {
+ token : "string", // multi line string start
+ merge : true,
+ regex : '["].*',
+ next : state + "_qqstring"
+ }, {
+ token : "string",
+ regex : "'.*?'"
+ }, {
+ token : "string", // multi line string start
+ merge : true,
+ regex : "['].*",
+ next : state + "_qstring"
+ }];
+}
+
+function multiLineString(quote, state) {
+ return [{
+ token : "string",
+ merge : true,
+ regex : ".*?" + quote,
+ next : state
+ }, {
+ token : "string",
+ merge : true,
+ regex : '.+'
+ }];
+}
+
+exports.tag = function(states, name, nextState, tagMap) {
+ states[name] = [{
+ token : "text",
+ regex : "\\s+"
+ }, {
+ //token : "meta.tag",
+
+ token : !tagMap ? "meta.tag.tag-name" : function(value) {
+ if (tagMap[value])
+ return "meta.tag.tag-name." + tagMap[value];
+ else
+ return "meta.tag.tag-name";
+ },
+ merge : true,
+ 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",
+ merge : true,
+ 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));
+};
+
+});
+
+ace.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;
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/mode-lua.js b/vendor/assets/javascripts/ace-src-noconflict/mode-lua.js
new file mode 100644
index 00000000000..22d35f18a31
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/mode-lua.js
@@ -0,0 +1,524 @@
+/* ***** 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 ***** */
+
+ace.define('ace/mode/lua', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/lua_highlight_rules', 'ace/range'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var TextMode = require("./text").Mode;
+var Tokenizer = require("../tokenizer").Tokenizer;
+var LuaHighlightRules = require("./lua_highlight_rules").LuaHighlightRules;
+var Range = require("../range").Range;
+
+var Mode = function() {
+ this.$tokenizer = new Tokenizer(new LuaHighlightRules().getRules());
+};
+oop.inherits(Mode, TextMode);
+
+(function() {
+ var indentKeywords = {
+ "function": 1,
+ "then": 1,
+ "do": 1,
+ "else": 1,
+ "elseif": 1,
+ "repeat": 1,
+ "end": -1,
+ "until": -1,
+ };
+ var outdentKeywords = [
+ "else",
+ "elseif",
+ "end",
+ "until"
+ ];
+
+ function getNetIndentLevel(tokens) {
+ var level = 0;
+ // Support single-line blocks by decrementing the indent level if
+ // an ending token is found
+ for (var i in tokens){
+ var token = tokens[i];
+ if (token.type == "keyword") {
+ if (token.value in indentKeywords) {
+ level += indentKeywords[token.value];
+ }
+ } else if (token.type == "paren.lparen") {
+ level ++;
+ } else if (token.type == "paren.rparen") {
+ level --;
+ }
+ }
+ // Limit the level to +/- 1 since usually users only indent one level
+ // at a time regardless of the logical nesting level
+ if (level < 0) {
+ return -1;
+ } else if (level > 0) {
+ return 1;
+ } else {
+ return 0;
+ }
+ }
+
+ this.getNextLineIndent = function(state, line, tab) {
+ var indent = this.$getIndent(line);
+ var level = 0;
+
+ var tokenizedLine = this.$tokenizer.getLineTokens(line, state);
+ var tokens = tokenizedLine.tokens;
+
+ if (state == "start") {
+ level = getNetIndentLevel(tokens);
+ }
+ if (level > 0) {
+ return indent + tab;
+ } else if (level < 0 && indent.substr(indent.length - tab.length) == tab) {
+ // Don't do a next-line outdent if we're going to do a real outdent of this line
+ if (!this.checkOutdent(state, line, "\n")) {
+ return indent.substr(0, indent.length - tab.length);
+ }
+ }
+ return indent;
+ };
+
+ this.checkOutdent = function(state, line, input) {
+ if (input != "\n" && input != "\r" && input != "\r\n")
+ return false;
+
+ if (line.match(/^\s*[\)\}\]]$/))
+ return true;
+
+ var tokens = this.$tokenizer.getLineTokens(line.trim(), state).tokens;
+
+ if (!tokens || !tokens.length)
+ return false;
+
+ return (tokens[0].type == "keyword" && outdentKeywords.indexOf(tokens[0].value) != -1);
+ };
+
+ this.autoOutdent = function(state, session, row) {
+ var prevLine = session.getLine(row - 1);
+ var prevIndent = this.$getIndent(prevLine).length;
+ var prevTokens = this.$tokenizer.getLineTokens(prevLine, "start").tokens;
+ var tabLength = session.getTabString().length;
+ var expectedIndent = prevIndent + tabLength * getNetIndentLevel(prevTokens);
+ var curIndent = this.$getIndent(session.getLine(row)).length;
+ if (curIndent < expectedIndent) {
+ // User already outdented //
+ return;
+ }
+ session.outdentRows(new Range(row, 0, row + 2, 0));
+ };
+
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+});
+
+ace.define('ace/mode/lua_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 LuaHighlightRules = function() {
+
+ var keywords = (
+ "break|do|else|elseif|end|for|function|if|in|local|repeat|"+
+ "return|then|until|while|or|and|not"
+ );
+
+ var builtinConstants = ("true|false|nil|_G|_VERSION");
+
+ var functions = (
+ // builtinFunctions
+ "string|xpcall|package|tostring|print|os|unpack|require|"+
+ "getfenv|setmetatable|next|assert|tonumber|io|rawequal|"+
+ "collectgarbage|getmetatable|module|rawset|math|debug|"+
+ "pcall|table|newproxy|type|coroutine|_G|select|gcinfo|"+
+ "pairs|rawget|loadstring|ipairs|_VERSION|dofile|setfenv|"+
+ "load|error|loadfile|"+
+
+ "sub|upper|len|gfind|rep|find|match|char|dump|gmatch|"+
+ "reverse|byte|format|gsub|lower|preload|loadlib|loaded|"+
+ "loaders|cpath|config|path|seeall|exit|setlocale|date|"+
+ "getenv|difftime|remove|time|clock|tmpname|rename|execute|"+
+ "lines|write|close|flush|open|output|type|read|stderr|"+
+ "stdin|input|stdout|popen|tmpfile|log|max|acos|huge|"+
+ "ldexp|pi|cos|tanh|pow|deg|tan|cosh|sinh|random|randomseed|"+
+ "frexp|ceil|floor|rad|abs|sqrt|modf|asin|min|mod|fmod|log10|"+
+ "atan2|exp|sin|atan|getupvalue|debug|sethook|getmetatable|"+
+ "gethook|setmetatable|setlocal|traceback|setfenv|getinfo|"+
+ "setupvalue|getlocal|getregistry|getfenv|setn|insert|getn|"+
+ "foreachi|maxn|foreach|concat|sort|remove|resume|yield|"+
+ "status|wrap|create|running|"+
+ // metatableMethods
+ "__add|__sub|__mod|__unm|__concat|__lt|__index|__call|__gc|__metatable|"+
+ "__mul|__div|__pow|__len|__eq|__le|__newindex|__tostring|__mode|__tonumber"
+ );
+
+ var stdLibaries = ("string|package|os|io|math|debug|table|coroutine");
+
+ var futureReserved = "";
+
+ var deprecatedIn5152 = ("setn|foreach|foreachi|gcinfo|log10|maxn");
+
+ var keywordMapper = this.createKeywordMapper({
+ "keyword": keywords,
+ "support.function": functions,
+ "invalid.deprecated": deprecatedIn5152,
+ "constant.library": stdLibaries,
+ "constant.language": builtinConstants,
+ "invalid.illegal": futureReserved,
+ "variable.language": "this"
+ }, "identifier");
+
+ var strPre = "";
+
+ var decimalInteger = "(?:(?:[1-9]\\d*)|(?:0))";
+ var hexInteger = "(?:0[xX][\\dA-Fa-f]+)";
+ var integer = "(?:" + decimalInteger + "|" + hexInteger + ")";
+
+ var fraction = "(?:\\.\\d+)";
+ var intPart = "(?:\\d+)";
+ var pointFloat = "(?:(?:" + intPart + "?" + fraction + ")|(?:" + intPart + "\\.))";
+ var floatNumber = "(?:" + pointFloat + ")";
+
+ var comment_stack = [];
+
+ this.$rules = {
+ "start" :
+
+
+ // bracketed comments
+ [{
+ token : "comment", // --[[ comment
+ regex : strPre + '\\-\\-\\[\\[.*\\]\\]'
+ }, {
+ token : "comment", // --[=[ comment
+ regex : strPre + '\\-\\-\\[\\=\\[.*\\]\\=\\]'
+ }, {
+ token : "comment", // --[==[ comment
+ regex : strPre + '\\-\\-\\[\\={2}\\[.*\\]\\={2}\\]'
+ }, {
+ token : "comment", // --[===[ comment
+ regex : strPre + '\\-\\-\\[\\={3}\\[.*\\]\\={3}\\]'
+ }, {
+ token : "comment", // --[====[ comment
+ regex : strPre + '\\-\\-\\[\\={4}\\[.*\\]\\={4}\\]'
+ }, {
+ token : "comment", // --[====+[ comment
+ regex : strPre + '\\-\\-\\[\\={5}\\=*\\[.*\\]\\={5}\\=*\\]'
+ },
+
+ // multiline bracketed comments
+ {
+ token : "comment", // --[[ comment
+ regex : strPre + '\\-\\-\\[\\[.*$',
+ merge : true,
+ next : "qcomment"
+ }, {
+ token : "comment", // --[=[ comment
+ regex : strPre + '\\-\\-\\[\\=\\[.*$',
+ merge : true,
+ next : "qcomment1"
+ }, {
+ token : "comment", // --[==[ comment
+ regex : strPre + '\\-\\-\\[\\={2}\\[.*$',
+ merge : true,
+ next : "qcomment2"
+ }, {
+ token : "comment", // --[===[ comment
+ regex : strPre + '\\-\\-\\[\\={3}\\[.*$',
+ merge : true,
+ next : "qcomment3"
+ }, {
+ token : "comment", // --[====[ comment
+ regex : strPre + '\\-\\-\\[\\={4}\\[.*$',
+ merge : true,
+ next : "qcomment4"
+ }, {
+ token : function(value){ // --[====+[ comment
+ // WARNING: EXTREMELY SLOW, but this is the only way to circumvent the
+ // limits imposed by the current automaton.
+ // I've never personally seen any practical code where 5 or more '='s are
+ // used for string or commenting, so this will rarely be invoked.
+ var pattern = /\-\-\[(\=+)\[/, match;
+ // you can never be too paranoid ;)
+ if ((match = pattern.exec(value)) != null && (match = match[1]) != undefined)
+ comment_stack.push(match.length);
+
+ return "comment";
+ },
+ regex : strPre + '\\-\\-\\[\\={5}\\=*\\[.*$',
+ merge : true,
+ next : "qcomment5"
+ },
+
+ // single line comments
+ {
+ token : "comment",
+ regex : "\\-\\-.*$"
+ },
+
+ // bracketed strings
+ {
+ token : "string", // [[ string
+ regex : strPre + '\\[\\[.*\\]\\]'
+ }, {
+ token : "string", // [=[ string
+ regex : strPre + '\\[\\=\\[.*\\]\\=\\]'
+ }, {
+ token : "string", // [==[ string
+ regex : strPre + '\\[\\={2}\\[.*\\]\\={2}\\]'
+ }, {
+ token : "string", // [===[ string
+ regex : strPre + '\\[\\={3}\\[.*\\]\\={3}\\]'
+ }, {
+ token : "string", // [====[ string
+ regex : strPre + '\\[\\={4}\\[.*\\]\\={4}\\]'
+ }, {
+ token : "string", // [====+[ string
+ regex : strPre + '\\[\\={5}\\=*\\[.*\\]\\={5}\\=*\\]'
+ },
+
+ // multiline bracketed strings
+ {
+ token : "string", // [[ string
+ regex : strPre + '\\[\\[.*$',
+ merge : true,
+ next : "qstring"
+ }, {
+ token : "string", // [=[ string
+ regex : strPre + '\\[\\=\\[.*$',
+ merge : true,
+ next : "qstring1"
+ }, {
+ token : "string", // [==[ string
+ regex : strPre + '\\[\\={2}\\[.*$',
+ merge : true,
+ next : "qstring2"
+ }, {
+ token : "string", // [===[ string
+ regex : strPre + '\\[\\={3}\\[.*$',
+ merge : true,
+ next : "qstring3"
+ }, {
+ token : "string", // [====[ string
+ regex : strPre + '\\[\\={4}\\[.*$',
+ merge : true,
+ next : "qstring4"
+ }, {
+ token : function(value){ // --[====+[ string
+ // WARNING: EXTREMELY SLOW, see above.
+ var pattern = /\[(\=+)\[/, match;
+ if ((match = pattern.exec(value)) != null && (match = match[1]) != undefined)
+ comment_stack.push(match.length);
+
+ return "string";
+ },
+ regex : strPre + '\\[\\={5}\\=*\\[.*$',
+ merge : true,
+ next : "qstring5"
+ },
+
+ {
+ token : "string", // " string
+ regex : strPre + '"(?:[^\\\\]|\\\\.)*?"'
+ }, {
+ token : "string", // ' string
+ regex : strPre + "'(?:[^\\\\]|\\\\.)*?'"
+ }, {
+ token : "constant.numeric", // float
+ regex : floatNumber
+ }, {
+ token : "constant.numeric", // integer
+ regex : integer + "\\b"
+ }, {
+ token : keywordMapper,
+ regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
+ }, {
+ token : "keyword.operator",
+ regex : "\\+|\\-|\\*|\\/|%|\\#|\\^|~|<|>|<=|=>|==|~=|=|\\:|\\.\\.\\.|\\.\\."
+ }, {
+ token : "paren.lparen",
+ regex : "[\\[\\(\\{]"
+ }, {
+ token : "paren.rparen",
+ regex : "[\\]\\)\\}]"
+ }, {
+ token : "text",
+ regex : "\\s+"
+ } ],
+
+ "qcomment": [ {
+ token : "comment",
+ regex : "(?:[^\\\\]|\\\\.)*?\\]\\]",
+ next : "start"
+ }, {
+ token : "comment",
+ merge : true,
+ regex : '.+'
+ } ],
+ "qcomment1": [ {
+ token : "comment",
+ regex : "(?:[^\\\\]|\\\\.)*?\\]\\=\\]",
+ next : "start"
+ }, {
+ token : "comment",
+ merge : true,
+ regex : '.+'
+ } ],
+ "qcomment2": [ {
+ token : "comment",
+ regex : "(?:[^\\\\]|\\\\.)*?\\]\\={2}\\]",
+ next : "start"
+ }, {
+ token : "comment",
+ merge : true,
+ regex : '.+'
+ } ],
+ "qcomment3": [ {
+ token : "comment",
+ regex : "(?:[^\\\\]|\\\\.)*?\\]\\={3}\\]",
+ next : "start"
+ }, {
+ token : "comment",
+ merge : true,
+ regex : '.+'
+ } ],
+ "qcomment4": [ {
+ token : "comment",
+ regex : "(?:[^\\\\]|\\\\.)*?\\]\\={4}\\]",
+ next : "start"
+ }, {
+ token : "comment",
+ merge : true,
+ regex : '.+'
+ } ],
+ "qcomment5": [ {
+ token : function(value){
+ // very hackish, mutates the qcomment5 field on the fly.
+ var pattern = /\](\=+)\]/, rule = this.rules.qcomment5[0], match;
+ rule.next = "start";
+ if ((match = pattern.exec(value)) != null && (match = match[1]) != undefined){
+ var found = match.length, expected;
+ if ((expected = comment_stack.pop()) != found){
+ comment_stack.push(expected);
+ rule.next = "qcomment5";
+ }
+ }
+
+ return "comment";
+ },
+ regex : "(?:[^\\\\]|\\\\.)*?\\]\\={5}\\=*\\]",
+ next : "start"
+ }, {
+ token : "comment",
+ merge : true,
+ regex : '.+'
+ } ],
+
+ "qstring": [ {
+ token : "string",
+ regex : "(?:[^\\\\]|\\\\.)*?\\]\\]",
+ next : "start"
+ }, {
+ token : "string",
+ merge : true,
+ regex : '.+'
+ } ],
+ "qstring1": [ {
+ token : "string",
+ regex : "(?:[^\\\\]|\\\\.)*?\\]\\=\\]",
+ next : "start"
+ }, {
+ token : "string",
+ merge : true,
+ regex : '.+'
+ } ],
+ "qstring2": [ {
+ token : "string",
+ regex : "(?:[^\\\\]|\\\\.)*?\\]\\={2}\\]",
+ next : "start"
+ }, {
+ token : "string",
+ merge : true,
+ regex : '.+'
+ } ],
+ "qstring3": [ {
+ token : "string",
+ regex : "(?:[^\\\\]|\\\\.)*?\\]\\={3}\\]",
+ next : "start"
+ }, {
+ token : "string",
+ merge : true,
+ regex : '.+'
+ } ],
+ "qstring4": [ {
+ token : "string",
+ regex : "(?:[^\\\\]|\\\\.)*?\\]\\={4}\\]",
+ next : "start"
+ }, {
+ token : "string",
+ merge : true,
+ regex : '.+'
+ } ],
+ "qstring5": [ {
+ token : function(value){
+ // very hackish, mutates the qstring5 field on the fly.
+ var pattern = /\](\=+)\]/, rule = this.rules.qstring5[0], match;
+ rule.next = "start";
+ if ((match = pattern.exec(value)) != null && (match = match[1]) != undefined){
+ var found = match.length, expected;
+ if ((expected = comment_stack.pop()) != found){
+ comment_stack.push(expected);
+ rule.next = "qstring5";
+ }
+ }
+
+ return "string";
+ },
+ regex : "(?:[^\\\\]|\\\\.)*?\\]\\={5}\\=*\\]",
+ next : "start"
+ }, {
+ token : "string",
+ merge : true,
+ regex : '.+'
+ } ]
+
+ };
+
+}
+
+oop.inherits(LuaHighlightRules, TextHighlightRules);
+
+exports.LuaHighlightRules = LuaHighlightRules;
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/mode-luahtml.js b/vendor/assets/javascripts/ace-src-noconflict/mode-luahtml.js
new file mode 100644
index 00000000000..89bc2ec783f
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/mode-luahtml.js
@@ -0,0 +1,2415 @@
+ace.define('ace/mode/luahtml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/html', 'ace/mode/lua', 'ace/tokenizer', 'ace/mode/luahtml_highlight_rules'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var HtmlMode = require("./html").Mode;
+var LuaMode = require("./lua").Mode;
+var Tokenizer = require("../tokenizer").Tokenizer;
+var LuaHtmlHighlightRules = require("./luahtml_highlight_rules").LuaHtmlHighlightRules;
+
+var Mode = function() {
+ var highlighter = new LuaHtmlHighlightRules();
+
+ this.$tokenizer = new Tokenizer(new LuaHtmlHighlightRules().getRules());
+ this.$embeds = highlighter.getEmbeds();
+ this.createModeDelegates({
+ "lua-": LuaMode
+ });
+};
+oop.inherits(Mode, HtmlMode);
+
+exports.Mode = Mode;
+});
+
+ace.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/xml', '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 XmlBehaviour = require("./behaviour/xml").XmlBehaviour;
+var HtmlFoldMode = require("./folding/html").FoldMode;
+
+var Mode = function() {
+ var highlighter = new HtmlHighlightRules();
+ this.$tokenizer = new Tokenizer(highlighter.getRules());
+ this.$behaviour = new XmlBehaviour();
+
+ 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;
+});
+
+ace.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"], "worker-javascript.js", "ace/mode/javascript_worker", "JavaScriptWorker");
+ worker.attachToDocument(session.getDocument());
+
+ worker.on("jslint", function(results) {
+ var errors = [];
+ for (var i=0; i<results.data.length; i++) {
+ var error = results.data[i];
+ if (error)
+ errors.push({
+ row: error.line-1,
+ column: error.character-1,
+ text: error.reason,
+ type: "warning",
+ lint: error
+ });
+ }
+ session.setAnnotations(errors);
+ });
+
+ worker.on("narcissus", function(e) {
+ session.setAnnotations([e.data]);
+ });
+
+ worker.on("terminate", function() {
+ session.clearAnnotations();
+ });
+
+ return worker;
+ };
+
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+});
+
+ace.define('ace/mode/javascript_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/unicode', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var lang = require("../lib/lang");
+var unicode = require("../unicode");
+var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
+var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+
+var JavaScriptHighlightRules = function() {
+
+ // see: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects
+ var globals = lang.arrayToMap(
+ // Constructors
+ ("Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" +
+ // E4X
+ "Namespace|QName|XML|XMLList|" +
+ "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
+ "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" +
+ // Errors
+ "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" +
+ "SyntaxError|TypeError|URIError|" +
+ // Non-constructor functions
+ "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" +
+ "isNaN|parseFloat|parseInt|" +
+ // Other
+ "JSON|Math|" +
+ // Pseudo
+ "this|arguments|prototype|window|document"
+ ).split("|")
+ );
+
+ var keywords = lang.arrayToMap(
+ ("break|case|catch|continue|default|delete|do|else|finally|for|function|" +
+ "if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|" +
+ "const|yield|import|get|set").split("|")
+ );
+
+ // keywords which can be followed by regular expressions
+ var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield";
+
+ var deprecated = lang.arrayToMap(
+ ("__parent__|__count__|escape|unescape|with|__proto__").split("|")
+ );
+
+ var definitions = lang.arrayToMap(("const|let|var|function").split("|"));
+
+ var buildinConstants = lang.arrayToMap(
+ ("null|Infinity|NaN|undefined").split("|")
+ );
+
+ var futureReserved = lang.arrayToMap(
+ ("class|enum|extends|super|export|implements|private|" +
+ "public|interface|package|protected|static").split("|")
+ );
+
+ // TODO: Unicode escape sequences
+ var identifierRe = "[" + unicode.packages.L + "\\$_]["
+ + unicode.packages.L
+ + unicode.packages.Mn + unicode.packages.Mc
+ + unicode.packages.Nd
+ + unicode.packages.Pc + "\\$_]*\\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
+ ".)";
+
+ // regexp must not have capturing parentheses. Use (?:) instead.
+ // regexps are ordered -> the first match is used
+
+ this.$rules = {
+ "start" : [
+ {
+ token : "comment",
+ regex : /\/\/.*$/
+ },
+ DocCommentHighlightRules.getStartRule("doc-start"),
+ {
+ token : "comment", // multi line comment
+ merge : true,
+ 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/
+ }, { // match stuff like: Sound.prototype.play = function() { }
+ token : [
+ "storage.type",
+ "punctuation.operator",
+ "support.function",
+ "punctuation.operator",
+ "entity.name.function",
+ "text",
+ "keyword.operator",
+ "text",
+ "storage.type",
+ "text",
+ "paren.lparen"
+ ],
+ regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
+ }, { // match stuff like: Sound.prototype.play = myfunc
+ token : [
+ "storage.type",
+ "punctuation.operator",
+ "support.function",
+ "punctuation.operator",
+ "entity.name.function",
+ "text",
+ "keyword.operator",
+ "text"
+ ],
+ regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)",
+ next: "function_arguments"
+ }, { // match stuff like: Sound.play = function() { }
+ 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"
+ }, { // match stuff like: play = function() { }
+ token : [
+ "entity.name.function",
+ "text",
+ "keyword.operator",
+ "text",
+ "storage.type",
+ "text",
+ "paren.lparen"
+ ],
+ regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
+ }, { // match stuff like: Sound.play = function play() { }
+ 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"
+ }, { // match regular function like: function myFunc(arg) { }
+ token : [
+ "storage.type",
+ "text",
+ "entity.name.function",
+ "text",
+ "paren.lparen"
+ ],
+ regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ next: "function_arguments"
+ }, { // match stuff like: foobar: function() { }
+ token : [
+ "entity.name.function",
+ "text",
+ "punctuation.operator",
+ "text",
+ "storage.type",
+ "text",
+ "paren.lparen"
+ ],
+ regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
+ }, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
+ token : [
+ "text",
+ "text",
+ "storage.type",
+ "text",
+ "paren.lparen"
+ ],
+ regex : "(:)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ token : "constant.language.boolean",
+ regex : /(?:true|false)\b/
+ }, {
+ 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 : function(value) {
+ if (globals.hasOwnProperty(value))
+ return "variable.language";
+ else if (deprecated.hasOwnProperty(value))
+ return "invalid.deprecated";
+ else if (definitions.hasOwnProperty(value))
+ return "storage.type";
+ else if (keywords.hasOwnProperty(value))
+ return "keyword";
+ else if (buildinConstants.hasOwnProperty(value))
+ return "constant.language";
+ else if (futureReserved.hasOwnProperty(value))
+ return "invalid.illegal";
+ else if (value == "debugger")
+ return "invalid.deprecated";
+ else
+ return "identifier";
+ },
+ regex : identifierRe
+ }, {
+ token : "keyword.operator",
+ regex : /!|\$|%|&|\*|\-\-|\-|\+\+|\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=|\b(?:in|instanceof|new|delete|typeof|void)/,
+ 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: /^#!.*$/
+ }, {
+ token : "text",
+ regex : /\s+/
+ }
+ ],
+ // regular expressions are only allowed after certain tokens. This
+ // makes sure we don't mix up regexps with the divison operator
+ "regex_allowed": [
+ DocCommentHighlightRules.getStartRule("doc-start"),
+ {
+ token : "comment", // multi line comment
+ merge : true,
+ regex : "\\/\\*",
+ next : "comment_regex_allowed"
+ }, {
+ token : "comment",
+ regex : "\\/\\/.*$"
+ }, {
+ token: "string.regexp",
+ regex: "\\/",
+ next: "regex",
+ merge: true
+ }, {
+ token : "text",
+ regex : "\\s+"
+ }, {
+ // immediately return to the start mode without matching
+ // anything
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "regex": [
+ {
+ token: "regexp.keyword.operator",
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
+ }, {
+ // flag
+ token: "string.regexp",
+ regex: "/\\w*",
+ next: "start",
+ merge: true
+ }, {
+ token: "string.regexp",
+ regex: "[^\\\\/\\[]+",
+ merge: true
+ }, {
+ token: "string.regexp.charachterclass",
+ regex: "\\[",
+ next: "regex_character_class",
+ merge: true
+ }, {
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "regex_character_class": [
+ {
+ token: "regexp.keyword.operator",
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
+ }, {
+ token: "string.regexp.charachterclass",
+ regex: "]",
+ next: "regex",
+ merge: true
+ }, {
+ token: "string.regexp.charachterclass",
+ regex: "[^\\\\\\]]+",
+ merge: true
+ }, {
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "function_arguments": [
+ {
+ token: "variable.parameter",
+ regex: identifierRe,
+ }, {
+ token: "punctuation.operator",
+ regex: "[, ]+",
+ merge: true
+ }, {
+ token: "punctuation.operator",
+ regex: "$",
+ merge: true
+ }, {
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "comment_regex_allowed" : [
+ {
+ token : "comment", // closing comment
+ regex : ".*?\\*\\/",
+ merge : true,
+ next : "regex_allowed"
+ }, {
+ token : "comment", // comment spanning whole line
+ merge : true,
+ regex : ".+"
+ }
+ ],
+ "comment" : [
+ {
+ token : "comment", // closing comment
+ regex : ".*?\\*\\/",
+ merge : true,
+ next : "start"
+ }, {
+ token : "comment", // comment spanning whole line
+ merge : true,
+ regex : ".+"
+ }
+ ],
+ "qqstring" : [
+ {
+ token : "constant.language.escape",
+ regex : escapedRe
+ }, {
+ token : "string",
+ regex : '[^"\\\\]+',
+ merge : true
+ }, {
+ token : "string",
+ regex : "\\\\$",
+ next : "qqstring",
+ merge : true
+ }, {
+ token : "string",
+ regex : '"|$',
+ next : "start",
+ merge : true
+ }
+ ],
+ "qstring" : [
+ {
+ token : "constant.language.escape",
+ regex : escapedRe
+ }, {
+ token : "string",
+ regex : "[^'\\\\]+",
+ merge : true
+ }, {
+ token : "string",
+ regex : "\\\\$",
+ next : "qstring",
+ merge : true
+ }, {
+ token : "string",
+ regex : "'|$",
+ next : "start",
+ merge : true
+ }
+ ]
+ };
+
+ this.embedRules(DocCommentHighlightRules, "doc-",
+ [ DocCommentHighlightRules.getEndRule("start") ]);
+};
+
+oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
+
+exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
+});
+
+ace.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",
+ merge : true,
+ regex : "\\s+"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "TODO"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "[^@\\*]+"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "."
+ }]
+ };
+};
+
+oop.inherits(DocCommentHighlightRules, TextHighlightRules);
+
+DocCommentHighlightRules.getStartRule = function(start) {
+ return {
+ token : "comment.doc", // doc comment
+ merge : true,
+ regex : "\\/\\*(?=\\*)",
+ next : start
+ };
+};
+
+DocCommentHighlightRules.getEndRule = function (start) {
+ return {
+ token : "comment.doc", // closing comment
+ merge : true,
+ regex : "\\*\\/",
+ next : start
+ };
+};
+
+
+exports.DocCommentHighlightRules = DocCommentHighlightRules;
+
+});
+
+ace.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;
+});
+
+ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour'], function(require, exports, module) {
+
+
+var oop = require("../../lib/oop");
+var Behaviour = require("../behaviour").Behaviour;
+
+var CstyleBehaviour = function () {
+
+ this.add("braces", "insertion", function (state, action, editor, session, text) {
+ if (text == '{') {
+ var selection = editor.getSelectionRange();
+ var selected = session.doc.getTextRange(selection);
+ if (selected !== "") {
+ return {
+ text: '{' + selected + '}',
+ selection: false
+ };
+ } else {
+ 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) {
+ return {
+ text: '',
+ selection: [1, 1]
+ };
+ }
+ }
+ } else if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ if (rightChar == '}') {
+ var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column + 1});
+ if (!openBracePos)
+ return null;
+
+ var indent = this.getNextLineIndent(state, line.substring(0, line.length - 1), session.getTabString());
+ var next_indent = this.$getIndent(session.doc.getLine(openBracePos.row));
+
+ return {
+ text: '\n' + indent + '\n' + next_indent,
+ 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;
+ }
+ }
+ });
+
+ this.add("parens", "insertion", function (state, action, editor, session, text) {
+ if (text == '(') {
+ var selection = editor.getSelectionRange();
+ var selected = session.doc.getTextRange(selection);
+ if (selected !== "") {
+ return {
+ text: '(' + selected + ')',
+ selection: false
+ };
+ } else {
+ 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) {
+ 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("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 !== "") {
+ 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);
+
+ // We're escaped.
+ if (leftChar == '\\') {
+ return null;
+ }
+
+ // Find what token we're inside.
+ 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;
+ }
+
+ // Try and be smart about when we auto insert.
+ 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)))) {
+ return {
+ text: quote + quote,
+ selection: [1,1]
+ };
+ } else if (token && token.type === "string") {
+ // Ignore input and move right one if we're typing over the closing quote.
+ 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 == '"') {
+ range.end.column++;
+ return range;
+ }
+ }
+ });
+
+};
+
+oop.inherits(CstyleBehaviour, Behaviour);
+
+exports.CstyleBehaviour = CstyleBehaviour;
+});
+
+ace.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);
+
+ var range = session.getCommentFoldRange(row, i + match[0].length);
+ range.end.column -= 2;
+ return range;
+ }
+
+ if (foldStyle !== "markbeginend")
+ return;
+
+ var match = line.match(this.foldingStopMarker);
+ if (match) {
+ var i = match.index + match[0].length;
+
+ if (match[2]) {
+ var range = session.getCommentFoldRange(row, i);
+ range.end.column -= 2;
+ return range;
+ }
+
+ var end = {row: row, column: i};
+ var start = session.$findOpeningBracket(match[1], end);
+
+ if (!start)
+ return;
+
+ start.column++;
+ end.column--;
+
+ return Range.fromPoints(start, end);
+ }
+ };
+
+}).call(FoldMode.prototype);
+
+});
+
+ace.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;
+
+ // must return "" if there's no fold, to enable caching
+ 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 startRow = row;
+ var endRow = row;
+ var line = session.getLine(row);
+ var startColumn = column || line.length;
+ var startLevel = line.match(re)[0].length;
+ var maxRow = session.getLength()
+
+ while (++row < maxRow) {
+ line = session.getLine(row);
+ var level = line.match(re)[0].length;
+
+ if (level == line.length)
+ 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, allowBlankLine) {
+ var start = {row: row, column: column + 1};
+ var end = session.$findClosingBracket(bracket, start, typeRe, allowBlankLine);
+ if (!end)
+ return;
+
+ var fw = session.foldWidgets[end.row];
+ if (fw == null)
+ fw = this.getFoldWidget(session, end.row);
+
+ if (fw == "start") {
+ end.row --;
+ end.column = session.getLine(end.row).length;
+ }
+ return Range.fromPoints(start, end);
+ };
+
+}).call(FoldMode.prototype);
+
+});
+
+ace.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/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 CStyleFoldMode = require("./folding/cstyle").FoldMode;
+
+var Mode = function() {
+ this.$tokenizer = new Tokenizer(new CssHighlightRules().getRules(), "i");
+ this.$outdent = new MatchingBraceOutdent();
+ this.foldingRules = new CStyleFoldMode();
+};
+oop.inherits(Mode, TextMode);
+
+(function() {
+
+ this.foldingRules = "cStyle";
+
+ this.getNextLineIndent = function(state, line, tab) {
+ var indent = this.$getIndent(line);
+
+ // ignore braces in comments
+ 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"], "worker-css.js", "ace/mode/css_worker", "Worker");
+ worker.attachToDocument(session.getDocument());
+
+ worker.on("csslint", function(e) {
+ var errors = [];
+ e.data.forEach(function(message) {
+ errors.push({
+ row: message.line - 1,
+ column: message.col - 1,
+ text: message.message,
+ type: message.type,
+ lint: message
+ });
+ });
+
+ session.setAnnotations(errors);
+ });
+ return worker;
+ };
+
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+
+});
+
+ace.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 CssHighlightRules = function() {
+
+ var properties = lang.arrayToMap(
+ ("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").split("|")
+ );
+
+ var functions = lang.arrayToMap(
+ ("rgb|rgba|url|attr|counter|counters").split("|")
+ );
+
+ var constants = lang.arrayToMap(
+ ("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|font-size|font|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|top|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero").split("|")
+ );
+
+ var colors = lang.arrayToMap(
+ ("aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|" +
+ "purple|red|silver|teal|white|yellow").split("|")
+ );
+
+ var fonts = lang.arrayToMap(
+ ("arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|" +
+ "symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|" +
+ "serif|monospace").split("|")
+ );
+
+ // regexp must not have capturing parentheses. Use (?:) instead.
+ // regexps are ordered -> the first match is used
+
+ var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
+ var pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
+ var 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 base_ruleset = [
+ {
+ token : "comment", // multi line comment
+ merge : true,
+ 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 : "([0-9]+)"
+ }, {
+ 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 : function(value) {
+ if (properties.hasOwnProperty(value.toLowerCase())) {
+ return "support.type";
+ }
+ else if (functions.hasOwnProperty(value.toLowerCase())) {
+ return "support.function";
+ }
+ else if (constants.hasOwnProperty(value.toLowerCase())) {
+ return "support.constant";
+ }
+ else if (colors.hasOwnProperty(value.toLowerCase())) {
+ return "support.constant.color";
+ }
+ else if (fonts.hasOwnProperty(value.toLowerCase())) {
+ return "support.constant.fonts";
+ }
+ else {
+ return "text";
+ }
+ },
+ 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
+ merge : true,
+ 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
+ merge : true,
+ 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
+ merge : true,
+ 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;
+
+});
+
+ace.define('ace/mode/html_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', '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 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 HtmlHighlightRules = function() {
+
+ // regexp must not have capturing parentheses
+ // regexps are ordered -> the first match is used
+ this.$rules = {
+ start : [{
+ token : "text",
+ merge : true,
+ regex : "<\\!\\[CDATA\\[",
+ next : "cdata"
+ }, {
+ token : "xml_pe",
+ regex : "<\\?.*?\\?>"
+ }, {
+ token : "comment",
+ merge : true,
+ regex : "<\\!--",
+ next : "comment"
+ }, {
+ token : "xml_pe",
+ regex : "<\\!.*?>"
+ }, {
+ token : "meta.tag",
+ regex : "<(?=\s*script\\b)",
+ next : "script"
+ }, {
+ token : "meta.tag",
+ regex : "<(?=\s*style\\b)",
+ next : "style"
+ }, {
+ token : "meta.tag", // opening tag
+ regex : "<\\/?",
+ next : "tag"
+ }, {
+ token : "text",
+ regex : "\\s+"
+ }, {
+ token : "constant.character.entity",
+ regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
+ }, {
+ token : "text",
+ regex : "[^<]+"
+ } ],
+
+ cdata : [ {
+ token : "text",
+ regex : "\\]\\]>",
+ next : "start"
+ }, {
+ token : "text",
+ merge : true,
+ regex : "\\s+"
+ }, {
+ token : "text",
+ merge : true,
+ regex : ".+"
+ } ],
+
+ comment : [ {
+ token : "comment",
+ regex : ".*?-->",
+ next : "start"
+ }, {
+ token : "comment",
+ merge : true,
+ regex : ".+"
+ } ]
+ };
+
+ xmlUtil.tag(this.$rules, "tag", "start");
+ xmlUtil.tag(this.$rules, "style", "css-start");
+ xmlUtil.tag(this.$rules, "script", "js-start");
+
+ 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;
+});
+
+ace.define('ace/mode/xml_util', ['require', 'exports', 'module' , 'ace/lib/lang'], function(require, exports, module) {
+
+
+var lang = require("../lib/lang");
+
+var formTags = lang.arrayToMap(
+ ("button|form|input|label|select|textarea").split("|")
+);
+
+var tableTags = lang.arrayToMap(
+ ("table|tbody|td|tfoot|th|tr").split("|")
+);
+
+function string(state) {
+ return [{
+ token : "string",
+ regex : '".*?"'
+ }, {
+ token : "string", // multi line string start
+ merge : true,
+ regex : '["].*',
+ next : state + "_qqstring"
+ }, {
+ token : "string",
+ regex : "'.*?'"
+ }, {
+ token : "string", // multi line string start
+ merge : true,
+ regex : "['].*",
+ next : state + "_qstring"
+ }];
+}
+
+function multiLineString(quote, state) {
+ return [{
+ token : "string",
+ merge : true,
+ regex : ".*?" + quote,
+ next : state
+ }, {
+ token : "string",
+ merge : true,
+ regex : '.+'
+ }];
+}
+
+exports.tag = function(states, name, nextState) {
+ states[name] = [{
+ token : "text",
+ regex : "\\s+"
+ }, {
+ //token : "meta.tag",
+
+ token : function(value) {
+ if ( value==='a' ) {
+ return "meta.tag.anchor";
+ }
+ else if ( value==='img' ) {
+ return "meta.tag.image";
+ }
+ else if ( value==='script' ) {
+ return "meta.tag.script";
+ }
+ else if ( value==='style' ) {
+ return "meta.tag.style";
+ }
+ else if (formTags.hasOwnProperty(value.toLowerCase())) {
+ return "meta.tag.form";
+ }
+ else if (tableTags.hasOwnProperty(value.toLowerCase())) {
+ return "meta.tag.table";
+ }
+ else {
+ return "meta.tag";
+ }
+ },
+ merge : true,
+ 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",
+ merge : true,
+ 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));
+};
+
+});
+
+ace.define('ace/mode/behaviour/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/mode/behaviour/cstyle'], function(require, exports, module) {
+
+
+var oop = require("../../lib/oop");
+var Behaviour = require("../behaviour").Behaviour;
+var CstyleBehaviour = require("./cstyle").CstyleBehaviour;
+
+var XmlBehaviour = function () {
+
+ this.inherit(CstyleBehaviour, ["string_dquotes"]); // Get string behaviour
+
+ this.add("brackets", "insertion", function (state, action, editor, session, text) {
+ if (text == '<') {
+ var selection = editor.getSelectionRange();
+ var selected = session.doc.getTextRange(selection);
+ if (selected !== "") {
+ return false;
+ } else {
+ 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 == '>') { // need some kind of matching check here
+ return {
+ text: '',
+ selection: [1, 1]
+ }
+ }
+ } else 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;
+});
+
+ace.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({
+ // void elements
+ "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,
+
+ // optional tags
+ "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);
+
+});
+
+ace.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);
+
+});
+
+ace.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);
+
+});
+
+ace.define('ace/mode/lua', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/lua_highlight_rules'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var TextMode = require("./text").Mode;
+var Tokenizer = require("../tokenizer").Tokenizer;
+var LuaHighlightRules = require("./lua_highlight_rules").LuaHighlightRules;
+
+var Mode = function() {
+ this.$tokenizer = new Tokenizer(new LuaHighlightRules().getRules());
+};
+oop.inherits(Mode, TextMode);
+
+(function() {
+ this.getNextLineIndent = function(state, line, tab) {
+ var indent = this.$getIndent(line);
+
+ var tokenizedLine = this.$tokenizer.getLineTokens(line, state);
+ var tokens = tokenizedLine.tokens;
+
+ var chunks = ["function", "then", "do", "repeat"];
+
+ if (state == "start") {
+ var match = line.match(/^.*[\{\(\[]\s*$/);
+ if (match) {
+ indent += tab;
+ } else {
+ for (var i in tokens){
+ var token = tokens[i];
+ if (token.type != "keyword") continue;
+ var chunk_i = chunks.indexOf(token.value);
+ if (chunk_i != -1){
+ indent += tab;
+ break;
+ }
+ }
+ }
+ }
+
+ return indent;
+ };
+
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+});
+
+ace.define('ace/mode/lua_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 LuaHighlightRules = function() {
+
+ var keywords = lang.arrayToMap(
+ ("break|do|else|elseif|end|for|function|if|in|local|repeat|"+
+ "return|then|until|while|or|and|not").split("|")
+ );
+
+ var builtinConstants = lang.arrayToMap(
+ ("true|false|nil|_G|_VERSION").split("|")
+ );
+
+ var builtinFunctions = lang.arrayToMap(
+ ("string|xpcall|package|tostring|print|os|unpack|require|"+
+ "getfenv|setmetatable|next|assert|tonumber|io|rawequal|"+
+ "collectgarbage|getmetatable|module|rawset|math|debug|"+
+ "pcall|table|newproxy|type|coroutine|_G|select|gcinfo|"+
+ "pairs|rawget|loadstring|ipairs|_VERSION|dofile|setfenv|"+
+ "load|error|loadfile|"+
+
+ "sub|upper|len|gfind|rep|find|match|char|dump|gmatch|"+
+ "reverse|byte|format|gsub|lower|preload|loadlib|loaded|"+
+ "loaders|cpath|config|path|seeall|exit|setlocale|date|"+
+ "getenv|difftime|remove|time|clock|tmpname|rename|execute|"+
+ "lines|write|close|flush|open|output|type|read|stderr|"+
+ "stdin|input|stdout|popen|tmpfile|log|max|acos|huge|"+
+ "ldexp|pi|cos|tanh|pow|deg|tan|cosh|sinh|random|randomseed|"+
+ "frexp|ceil|floor|rad|abs|sqrt|modf|asin|min|mod|fmod|log10|"+
+ "atan2|exp|sin|atan|getupvalue|debug|sethook|getmetatable|"+
+ "gethook|setmetatable|setlocal|traceback|setfenv|getinfo|"+
+ "setupvalue|getlocal|getregistry|getfenv|setn|insert|getn|"+
+ "foreachi|maxn|foreach|concat|sort|remove|resume|yield|"+
+ "status|wrap|create|running").split("|")
+ );
+
+ var stdLibaries = lang.arrayToMap(
+ ("string|package|os|io|math|debug|table|coroutine").split("|")
+ );
+
+ var metatableMethods = lang.arrayToMap(
+ ("__add|__sub|__mod|__unm|__concat|__lt|__index|__call|__gc|__metatable|"+
+ "__mul|__div|__pow|__len|__eq|__le|__newindex|__tostring|__mode|__tonumber").split("|")
+ );
+
+ var futureReserved = lang.arrayToMap(
+ ("").split("|")
+ );
+
+ var deprecatedIn5152 = lang.arrayToMap(
+ ("setn|foreach|foreachi|gcinfo|log10|maxn").split("|")
+ );
+
+ var strPre = "";
+
+ var decimalInteger = "(?:(?:[1-9]\\d*)|(?:0))";
+ var hexInteger = "(?:0[xX][\\dA-Fa-f]+)";
+ var integer = "(?:" + decimalInteger + "|" + hexInteger + ")";
+
+ var fraction = "(?:\\.\\d+)";
+ var intPart = "(?:\\d+)";
+ var pointFloat = "(?:(?:" + intPart + "?" + fraction + ")|(?:" + intPart + "\\.))";
+ var floatNumber = "(?:" + pointFloat + ")";
+
+ var comment_stack = [];
+
+ this.$rules = {
+ "start" :
+
+
+ // bracketed comments
+ [{
+ token : "comment", // --[[ comment
+ regex : strPre + '\\-\\-\\[\\[.*\\]\\]'
+ }, {
+ token : "comment", // --[=[ comment
+ regex : strPre + '\\-\\-\\[\\=\\[.*\\]\\=\\]'
+ }, {
+ token : "comment", // --[==[ comment
+ regex : strPre + '\\-\\-\\[\\={2}\\[.*\\]\\={2}\\]'
+ }, {
+ token : "comment", // --[===[ comment
+ regex : strPre + '\\-\\-\\[\\={3}\\[.*\\]\\={3}\\]'
+ }, {
+ token : "comment", // --[====[ comment
+ regex : strPre + '\\-\\-\\[\\={4}\\[.*\\]\\={4}\\]'
+ }, {
+ token : "comment", // --[====+[ comment
+ regex : strPre + '\\-\\-\\[\\={5}\\=*\\[.*\\]\\={5}\\=*\\]'
+ },
+
+ // multiline bracketed comments
+ {
+ token : "comment", // --[[ comment
+ regex : strPre + '\\-\\-\\[\\[.*$',
+ merge : true,
+ next : "qcomment"
+ }, {
+ token : "comment", // --[=[ comment
+ regex : strPre + '\\-\\-\\[\\=\\[.*$',
+ merge : true,
+ next : "qcomment1"
+ }, {
+ token : "comment", // --[==[ comment
+ regex : strPre + '\\-\\-\\[\\={2}\\[.*$',
+ merge : true,
+ next : "qcomment2"
+ }, {
+ token : "comment", // --[===[ comment
+ regex : strPre + '\\-\\-\\[\\={3}\\[.*$',
+ merge : true,
+ next : "qcomment3"
+ }, {
+ token : "comment", // --[====[ comment
+ regex : strPre + '\\-\\-\\[\\={4}\\[.*$',
+ merge : true,
+ next : "qcomment4"
+ }, {
+ token : function(value){ // --[====+[ comment
+ // WARNING: EXTREMELY SLOW, but this is the only way to circumvent the
+ // limits imposed by the current automaton.
+ // I've never personally seen any practical code where 5 or more '='s are
+ // used for string or commenting, so this will rarely be invoked.
+ var pattern = /\-\-\[(\=+)\[/, match;
+ // you can never be too paranoid ;)
+ if ((match = pattern.exec(value)) != null && (match = match[1]) != undefined)
+ comment_stack.push(match.length);
+
+ return "comment";
+ },
+ regex : strPre + '\\-\\-\\[\\={5}\\=*\\[.*$',
+ merge : true,
+ next : "qcomment5"
+ },
+
+ // single line comments
+ {
+ token : "comment",
+ regex : "\\-\\-.*$"
+ },
+
+ // bracketed strings
+ {
+ token : "string", // [[ string
+ regex : strPre + '\\[\\[.*\\]\\]'
+ }, {
+ token : "string", // [=[ string
+ regex : strPre + '\\[\\=\\[.*\\]\\=\\]'
+ }, {
+ token : "string", // [==[ string
+ regex : strPre + '\\[\\={2}\\[.*\\]\\={2}\\]'
+ }, {
+ token : "string", // [===[ string
+ regex : strPre + '\\[\\={3}\\[.*\\]\\={3}\\]'
+ }, {
+ token : "string", // [====[ string
+ regex : strPre + '\\[\\={4}\\[.*\\]\\={4}\\]'
+ }, {
+ token : "string", // [====+[ string
+ regex : strPre + '\\[\\={5}\\=*\\[.*\\]\\={5}\\=*\\]'
+ },
+
+ // multiline bracketed strings
+ {
+ token : "string", // [[ string
+ regex : strPre + '\\[\\[.*$',
+ merge : true,
+ next : "qstring"
+ }, {
+ token : "string", // [=[ string
+ regex : strPre + '\\[\\=\\[.*$',
+ merge : true,
+ next : "qstring1"
+ }, {
+ token : "string", // [==[ string
+ regex : strPre + '\\[\\={2}\\[.*$',
+ merge : true,
+ next : "qstring2"
+ }, {
+ token : "string", // [===[ string
+ regex : strPre + '\\[\\={3}\\[.*$',
+ merge : true,
+ next : "qstring3"
+ }, {
+ token : "string", // [====[ string
+ regex : strPre + '\\[\\={4}\\[.*$',
+ merge : true,
+ next : "qstring4"
+ }, {
+ token : function(value){ // --[====+[ string
+ // WARNING: EXTREMELY SLOW, see above.
+ var pattern = /\[(\=+)\[/, match;
+ if ((match = pattern.exec(value)) != null && (match = match[1]) != undefined)
+ comment_stack.push(match.length);
+
+ return "string";
+ },
+ regex : strPre + '\\[\\={5}\\=*\\[.*$',
+ merge : true,
+ next : "qstring5"
+ },
+
+ {
+ token : "string", // " string
+ regex : strPre + '"(?:[^\\\\]|\\\\.)*?"'
+ }, {
+ token : "string", // ' string
+ regex : strPre + "'(?:[^\\\\]|\\\\.)*?'"
+ }, {
+ token : "constant.numeric", // float
+ regex : floatNumber
+ }, {
+ token : "constant.numeric", // integer
+ regex : integer + "\\b"
+ }, {
+ token : function(value) {
+ if (keywords.hasOwnProperty(value))
+ return "keyword";
+ else if (builtinConstants.hasOwnProperty(value))
+ return "constant.language";
+ else if (futureReserved.hasOwnProperty(value))
+ return "invalid.illegal";
+ else if (stdLibaries.hasOwnProperty(value))
+ return "constant.library";
+ else if (deprecatedIn5152.hasOwnProperty(value))
+ return "invalid.deprecated";
+ else if (builtinFunctions.hasOwnProperty(value))
+ return "support.function";
+ else if (metatableMethods.hasOwnProperty(value))
+ return "support.function";
+ else
+ return "identifier";
+ },
+ 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+"
+ } ],
+
+ "qcomment": [ {
+ token : "comment",
+ regex : "(?:[^\\\\]|\\\\.)*?\\]\\]",
+ next : "start"
+ }, {
+ token : "comment",
+ merge : true,
+ regex : '.+'
+ } ],
+ "qcomment1": [ {
+ token : "comment",
+ regex : "(?:[^\\\\]|\\\\.)*?\\]\\=\\]",
+ next : "start"
+ }, {
+ token : "comment",
+ merge : true,
+ regex : '.+'
+ } ],
+ "qcomment2": [ {
+ token : "comment",
+ regex : "(?:[^\\\\]|\\\\.)*?\\]\\={2}\\]",
+ next : "start"
+ }, {
+ token : "comment",
+ merge : true,
+ regex : '.+'
+ } ],
+ "qcomment3": [ {
+ token : "comment",
+ regex : "(?:[^\\\\]|\\\\.)*?\\]\\={3}\\]",
+ next : "start"
+ }, {
+ token : "comment",
+ merge : true,
+ regex : '.+'
+ } ],
+ "qcomment4": [ {
+ token : "comment",
+ regex : "(?:[^\\\\]|\\\\.)*?\\]\\={4}\\]",
+ next : "start"
+ }, {
+ token : "comment",
+ merge : true,
+ regex : '.+'
+ } ],
+ "qcomment5": [ {
+ token : function(value){
+ // very hackish, mutates the qcomment5 field on the fly.
+ var pattern = /\](\=+)\]/, rule = this.rules.qcomment5[0], match;
+ rule.next = "start";
+ if ((match = pattern.exec(value)) != null && (match = match[1]) != undefined){
+ var found = match.length, expected;
+ if ((expected = comment_stack.pop()) != found){
+ comment_stack.push(expected);
+ rule.next = "qcomment5";
+ }
+ }
+
+ return "comment";
+ },
+ regex : "(?:[^\\\\]|\\\\.)*?\\]\\={5}\\=*\\]",
+ next : "start"
+ }, {
+ token : "comment",
+ merge : true,
+ regex : '.+'
+ } ],
+
+ "qstring": [ {
+ token : "string",
+ regex : "(?:[^\\\\]|\\\\.)*?\\]\\]",
+ next : "start"
+ }, {
+ token : "string",
+ merge : true,
+ regex : '.+'
+ } ],
+ "qstring1": [ {
+ token : "string",
+ regex : "(?:[^\\\\]|\\\\.)*?\\]\\=\\]",
+ next : "start"
+ }, {
+ token : "string",
+ merge : true,
+ regex : '.+'
+ } ],
+ "qstring2": [ {
+ token : "string",
+ regex : "(?:[^\\\\]|\\\\.)*?\\]\\={2}\\]",
+ next : "start"
+ }, {
+ token : "string",
+ merge : true,
+ regex : '.+'
+ } ],
+ "qstring3": [ {
+ token : "string",
+ regex : "(?:[^\\\\]|\\\\.)*?\\]\\={3}\\]",
+ next : "start"
+ }, {
+ token : "string",
+ merge : true,
+ regex : '.+'
+ } ],
+ "qstring4": [ {
+ token : "string",
+ regex : "(?:[^\\\\]|\\\\.)*?\\]\\={4}\\]",
+ next : "start"
+ }, {
+ token : "string",
+ merge : true,
+ regex : '.+'
+ } ],
+ "qstring5": [ {
+ token : function(value){
+ // very hackish, mutates the qstring5 field on the fly.
+ var pattern = /\](\=+)\]/, rule = this.rules.qstring5[0], match;
+ rule.next = "start";
+ if ((match = pattern.exec(value)) != null && (match = match[1]) != undefined){
+ var found = match.length, expected;
+ if ((expected = comment_stack.pop()) != found){
+ comment_stack.push(expected);
+ rule.next = "qstring5";
+ }
+ }
+
+ return "string";
+ },
+ regex : "(?:[^\\\\]|\\\\.)*?\\]\\={5}\\=*\\]",
+ next : "start"
+ }, {
+ token : "string",
+ merge : true,
+ regex : '.+'
+ } ]
+
+ };
+
+}
+
+oop.inherits(LuaHighlightRules, TextHighlightRules);
+
+exports.LuaHighlightRules = LuaHighlightRules;
+});
+ace.define('ace/mode/luahtml_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/html_highlight_rules', 'ace/mode/lua_highlight_rules'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
+var LuaHighlightRules = require("./lua_highlight_rules").LuaHighlightRules;
+
+var LuaHtmlHighlightRules = function() {
+ this.$rules = new HtmlHighlightRules().getRules();
+
+ for (var i in this.$rules)
+ this.$rules[i].unshift({
+ token: "luatag-percent",
+ regex: "<\\%",
+ next: "lua-start"
+ }, {
+ token: "luatag-lua",
+ regex: "<\\?lua",
+ next: "lua-start"
+ });
+
+ this.embedRules(LuaHighlightRules, "lua-", [
+ {
+ token: "keyword1",
+ regex: "\\%>",
+ next: "start"
+ },
+ {
+ token: "keyword2",
+ regex: "\\?>",
+ next: "start"
+ }
+ ]);
+};
+
+oop.inherits(LuaHtmlHighlightRules, HtmlHighlightRules);
+
+exports.LuaHtmlHighlightRules = LuaHtmlHighlightRules;
+
+}); \ No newline at end of file
diff --git a/vendor/assets/javascripts/ace-src-noconflict/mode-luapage.js b/vendor/assets/javascripts/ace-src-noconflict/mode-luapage.js
new file mode 100644
index 00000000000..8f03866ddaf
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/mode-luapage.js
@@ -0,0 +1,2480 @@
+ace.define('ace/mode/luapage', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/html', 'ace/mode/lua', 'ace/tokenizer', 'ace/mode/luapage_highlight_rules'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var HtmlMode = require("./html").Mode;
+var LuaMode = require("./lua").Mode;
+var Tokenizer = require("../tokenizer").Tokenizer;
+var LuaPageHighlightRules = require("./luapage_highlight_rules").LuaPageHighlightRules;
+
+var Mode = function() {
+ var highlighter = new LuaPageHighlightRules();
+
+ this.$tokenizer = new Tokenizer(new LuaPageHighlightRules().getRules());
+ this.$embeds = highlighter.getEmbeds();
+ this.createModeDelegates({
+ "lua-": LuaMode
+ });
+};
+oop.inherits(Mode, HtmlMode);
+
+exports.Mode = Mode;
+});
+
+ace.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;
+});
+
+ace.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) {
+ var errors = [];
+ for (var i=0; i<results.data.length; i++) {
+ var error = results.data[i];
+ if (error)
+ errors.push({
+ row: error.line-1,
+ column: error.character-1,
+ text: error.reason,
+ type: "warning",
+ lint: error
+ });
+ }
+ session.setAnnotations(errors);
+ });
+
+ worker.on("narcissus", function(e) {
+ session.setAnnotations([e.data]);
+ });
+
+ worker.on("terminate", function() {
+ session.clearAnnotations();
+ });
+
+ return worker;
+ };
+
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+});
+
+ace.define('ace/mode/javascript_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/unicode', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var unicode = require("../unicode");
+var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
+var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+
+var JavaScriptHighlightRules = function() {
+ // see: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects
+ 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
+ "invalid.deprecated":
+ "__parent__|__count__|escape|unescape|with|__proto__|debugger",
+ "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|",
+ "storage.type":
+ "const|let|var|function",
+ "invalid.illegal":
+ "class|enum|extends|super|export|implements|private|" +
+ "public|interface|package|protected|static",
+ "constant.language":
+ "null|Infinity|NaN|undefined",
+ }, "identifier");
+
+
+ // keywords which can be followed by regular expressions
+ var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield";
+
+ // TODO: Unicode escape sequences
+ 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
+ ".)";
+
+ // regexp must not have capturing parentheses. Use (?:) instead.
+ // regexps are ordered -> the first match is used
+
+ this.$rules = {
+ "start" : [
+ {
+ token : "comment",
+ regex : /\/\/.*$/
+ },
+ DocCommentHighlightRules.getStartRule("doc-start"),
+ {
+ token : "comment", // multi line comment
+ merge : true,
+ 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/
+ }, {
+ // Sound.prototype.play =
+ token : [
+ "storage.type", "punctuation.operator", "support.function",
+ "punctuation.operator", "entity.name.function", "text","keyword.operator"
+ ],
+ regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)",
+ next: "function_arguments"
+ }, {
+ // Sound.play = function() { }
+ 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"
+ }, {
+ // play = function() { }
+ token : [
+ "entity.name.function", "text", "keyword.operator", "text", "storage.type",
+ "text", "paren.lparen"
+ ],
+ regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ // Sound.play = function play() { }
+ 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"
+ }, {
+ // function myFunc(arg) { }
+ token : [
+ "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ ],
+ regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ // foobar: function() { }
+ token : [
+ "entity.name.function", "text", "punctuation.operator",
+ "text", "storage.type", "text", "paren.lparen"
+ ],
+ regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ // : function() { } (this is for issues with 'foo': function() { })
+ token : [
+ "text", "text", "storage.type", "text", "paren.lparen"
+ ],
+ regex : "(:)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ token : "constant.language.boolean",
+ regex : /(?:true|false)\b/
+ }, {
+ 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 : /!|\$|%|&|\*|\-\-|\-|\+\+|\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=|\b(?:in|instanceof|new|delete|typeof|void)/,
+ 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: /^#!.*$/
+ }, {
+ token : "text",
+ regex : /\s+/
+ }
+ ],
+ // regular expressions are only allowed after certain tokens. This
+ // makes sure we don't mix up regexps with the divison operator
+ "regex_allowed": [
+ DocCommentHighlightRules.getStartRule("doc-start"),
+ {
+ token : "comment", // multi line comment
+ merge : true,
+ regex : "\\/\\*",
+ next : "comment_regex_allowed"
+ }, {
+ token : "comment",
+ regex : "\\/\\/.*$"
+ }, {
+ token: "string.regexp",
+ regex: "\\/",
+ next: "regex",
+ merge: true
+ }, {
+ token : "text",
+ regex : "\\s+"
+ }, {
+ // immediately return to the start mode without matching
+ // anything
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "regex": [
+ {
+ // escapes
+ token: "regexp.keyword.operator",
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
+ }, {
+ // flag
+ token: "string.regexp",
+ regex: "/\\w*",
+ next: "start",
+ merge: true
+ }, {
+ // invalid operators
+ token : "invalid",
+ regex: /\{\d+,?(?:\d+)?}[+*]|[+*^$?][+*]|\?\?/ // |[^$][?]
+ }, {
+ // operators
+ token : "constant.language.escape",
+ regex: /\(\?[:=!]|\)|\{\d+,?(?:\d+)?}|[+*]\?|[(|)$^+*?]/
+ }, {
+ token: "string.regexp",
+ regex: /{|[^\[\\{()$^+*?\/]+/,
+ merge: true
+ }, {
+ token: "constant.language.escape",
+ regex: /\[\^?/,
+ next: "regex_character_class",
+ merge: true
+ }, {
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "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",
+ merge: true
+ }, {
+ token: "constant.language.escape",
+ regex: "-",
+ }, {
+ token: "string.regexp.charachterclass",
+ regex: /[^\]\-\\]+/,
+ merge: true
+ }, {
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "function_arguments": [
+ {
+ token: "variable.parameter",
+ regex: identifierRe
+ }, {
+ token: "punctuation.operator",
+ regex: "[, ]+",
+ merge: true
+ }, {
+ token: "punctuation.operator",
+ regex: "$",
+ merge: true
+ }, {
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "comment_regex_allowed" : [
+ {
+ token : "comment", // closing comment
+ regex : ".*?\\*\\/",
+ merge : true,
+ next : "regex_allowed"
+ }, {
+ token : "comment", // comment spanning whole line
+ merge : true,
+ regex : ".+"
+ }
+ ],
+ "comment" : [
+ {
+ token : "comment", // closing comment
+ regex : ".*?\\*\\/",
+ merge : true,
+ next : "start"
+ }, {
+ token : "comment", // comment spanning whole line
+ merge : true,
+ regex : ".+"
+ }
+ ],
+ "qqstring" : [
+ {
+ token : "constant.language.escape",
+ regex : escapedRe
+ }, {
+ token : "string",
+ regex : '[^"\\\\]+',
+ merge : true
+ }, {
+ token : "string",
+ regex : "\\\\$",
+ next : "qqstring",
+ merge : true
+ }, {
+ token : "string",
+ regex : '"|$',
+ next : "start",
+ merge : true
+ }
+ ],
+ "qstring" : [
+ {
+ token : "constant.language.escape",
+ regex : escapedRe
+ }, {
+ token : "string",
+ regex : "[^'\\\\]+",
+ merge : true
+ }, {
+ token : "string",
+ regex : "\\\\$",
+ next : "qstring",
+ merge : true
+ }, {
+ token : "string",
+ regex : "'|$",
+ next : "start",
+ merge : true
+ }
+ ]
+ };
+
+ this.embedRules(DocCommentHighlightRules, "doc-",
+ [ DocCommentHighlightRules.getEndRule("start") ]);
+};
+
+oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
+
+exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
+});
+
+ace.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",
+ merge : true,
+ regex : "\\s+"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "TODO"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "[^@\\*]+"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "."
+ }]
+ };
+};
+
+oop.inherits(DocCommentHighlightRules, TextHighlightRules);
+
+DocCommentHighlightRules.getStartRule = function(start) {
+ return {
+ token : "comment.doc", // doc comment
+ merge : true,
+ regex : "\\/\\*(?=\\*)",
+ next : start
+ };
+};
+
+DocCommentHighlightRules.getEndRule = function (start) {
+ return {
+ token : "comment.doc", // closing comment
+ merge : true,
+ regex : "\\*\\/",
+ next : start
+ };
+};
+
+
+exports.DocCommentHighlightRules = DocCommentHighlightRules;
+
+});
+
+ace.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;
+});
+
+ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour'], function(require, exports, module) {
+
+
+var oop = require("../../lib/oop");
+var Behaviour = require("../behaviour").Behaviour;
+
+var CstyleBehaviour = function () {
+
+ this.add("braces", "insertion", function (state, action, editor, session, text) {
+ if (text == '{') {
+ var selection = editor.getSelectionRange();
+ var selected = session.doc.getTextRange(selection);
+ if (selected !== "") {
+ return {
+ text: '{' + selected + '}',
+ selection: false
+ };
+ } else {
+ 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) {
+ return {
+ text: '',
+ selection: [1, 1]
+ };
+ }
+ }
+ } else if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ if (rightChar == '}') {
+ var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column + 1});
+ if (!openBracePos)
+ return null;
+
+ var indent = this.getNextLineIndent(state, line.substring(0, line.length - 1), session.getTabString());
+ var next_indent = this.$getIndent(session.doc.getLine(openBracePos.row));
+
+ return {
+ text: '\n' + indent + '\n' + next_indent,
+ 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;
+ }
+ }
+ });
+
+ this.add("parens", "insertion", function (state, action, editor, session, text) {
+ if (text == '(') {
+ var selection = editor.getSelectionRange();
+ var selected = session.doc.getTextRange(selection);
+ if (selected !== "") {
+ return {
+ text: '(' + selected + ')',
+ selection: false
+ };
+ } else {
+ 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) {
+ 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 !== "") {
+ return {
+ text: '[' + selected + ']',
+ selection: false
+ };
+ } else {
+ 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) {
+ 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 !== "") {
+ 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);
+
+ // We're escaped.
+ if (leftChar == '\\') {
+ return null;
+ }
+
+ // Find what token we're inside.
+ 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;
+ }
+
+ // Try and be smart about when we auto insert.
+ 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)))) {
+ return {
+ text: quote + quote,
+ selection: [1,1]
+ };
+ } else if (token && token.type === "string") {
+ // Ignore input and move right one if we're typing over the closing quote.
+ 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 == '"') {
+ range.end.column++;
+ return range;
+ }
+ }
+ });
+
+};
+
+oop.inherits(CstyleBehaviour, Behaviour);
+
+exports.CstyleBehaviour = CstyleBehaviour;
+});
+
+ace.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);
+
+ var range = session.getCommentFoldRange(row, i + match[0].length);
+ range.end.column -= 2;
+ return range;
+ }
+
+ if (foldStyle !== "markbeginend")
+ return;
+
+ var match = line.match(this.foldingStopMarker);
+ if (match) {
+ var i = match.index + match[0].length;
+
+ if (match[2]) {
+ var range = session.getCommentFoldRange(row, i);
+ range.end.column -= 2;
+ return range;
+ }
+
+ var end = {row: row, column: i};
+ var start = session.$findOpeningBracket(match[1], end);
+
+ if (!start)
+ return;
+
+ start.column++;
+ end.column--;
+
+ return Range.fromPoints(start, end);
+ }
+ };
+
+}).call(FoldMode.prototype);
+
+});
+
+ace.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;
+
+ // must return "" if there's no fold, to enable caching
+ 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);
+ };
+
+}).call(FoldMode.prototype);
+
+});
+
+ace.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/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 CStyleFoldMode = require("./folding/cstyle").FoldMode;
+
+var Mode = function() {
+ this.$tokenizer = new Tokenizer(new CssHighlightRules().getRules(), "i");
+ this.$outdent = new MatchingBraceOutdent();
+ this.foldingRules = new CStyleFoldMode();
+};
+oop.inherits(Mode, TextMode);
+
+(function() {
+
+ this.foldingRules = "cStyle";
+
+ this.getNextLineIndent = function(state, line, tab) {
+ var indent = this.$getIndent(line);
+
+ // ignore braces in comments
+ 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) {
+ var errors = [];
+ e.data.forEach(function(message) {
+ errors.push({
+ row: message.line - 1,
+ column: message.col - 1,
+ text: message.message,
+ type: message.type,
+ lint: message
+ });
+ });
+
+ session.setAnnotations(errors);
+ });
+ return worker;
+ };
+
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+
+});
+
+ace.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 CssHighlightRules = function() {
+ var keywordMapper = this.createKeywordMapper({
+ "support.type": "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",
+ "support.function": "rgb|rgba|url|attr|counter|counters",
+ "support.constant": "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",
+ "support.constant.color": "aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow",
+ "support.constant.fonts": "arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace"
+ }, "text", true);
+
+ // regexp must not have capturing parentheses. Use (?:) instead.
+ // regexps are ordered -> the first match is used
+
+ var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
+ var pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
+ var 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 base_ruleset = [
+ {
+ token : "comment", // multi line comment
+ merge : true,
+ 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 : "([0-9]+)"
+ }, {
+ 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
+ merge : true,
+ 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
+ merge : true,
+ 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
+ merge : true,
+ 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;
+
+});
+
+ace.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() {
+
+ // regexp must not have capturing parentheses
+ // regexps are ordered -> the first match is used
+ this.$rules = {
+ start : [{
+ token : "text",
+ merge : true,
+ regex : "<\\!\\[CDATA\\[",
+ next : "cdata"
+ }, {
+ token : "xml_pe",
+ regex : "<\\?.*?\\?>"
+ }, {
+ token : "comment",
+ merge : true,
+ regex : "<\\!--",
+ next : "comment"
+ }, {
+ token : "xml_pe",
+ regex : "<\\!.*?>"
+ }, {
+ token : "meta.tag",
+ regex : "<(?=\s*script\\b)",
+ next : "script"
+ }, {
+ token : "meta.tag",
+ regex : "<(?=\s*style\\b)",
+ next : "style"
+ }, {
+ token : "meta.tag", // opening tag
+ regex : "<\\/?",
+ next : "tag"
+ }, {
+ token : "text",
+ regex : "\\s+"
+ }, {
+ token : "constant.character.entity",
+ regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
+ }, {
+ token : "text",
+ regex : "[^<]+"
+ } ],
+
+ cdata : [ {
+ token : "text",
+ regex : "\\]\\]>",
+ next : "start"
+ }, {
+ token : "text",
+ merge : true,
+ regex : "\\s+"
+ }, {
+ token : "text",
+ merge : true,
+ regex : ".+"
+ } ],
+
+ comment : [ {
+ token : "comment",
+ regex : ".*?-->",
+ next : "start"
+ }, {
+ token : "comment",
+ merge : true,
+ regex : ".+"
+ } ]
+ };
+
+ 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;
+});
+
+ace.define('ace/mode/xml_util', ['require', 'exports', 'module' ], function(require, exports, module) {
+
+
+function string(state) {
+ return [{
+ token : "string",
+ regex : '".*?"'
+ }, {
+ token : "string", // multi line string start
+ merge : true,
+ regex : '["].*',
+ next : state + "_qqstring"
+ }, {
+ token : "string",
+ regex : "'.*?'"
+ }, {
+ token : "string", // multi line string start
+ merge : true,
+ regex : "['].*",
+ next : state + "_qstring"
+ }];
+}
+
+function multiLineString(quote, state) {
+ return [{
+ token : "string",
+ merge : true,
+ regex : ".*?" + quote,
+ next : state
+ }, {
+ token : "string",
+ merge : true,
+ regex : '.+'
+ }];
+}
+
+exports.tag = function(states, name, nextState, tagMap) {
+ states[name] = [{
+ token : "text",
+ regex : "\\s+"
+ }, {
+ //token : "meta.tag",
+
+ token : !tagMap ? "meta.tag.tag-name" : function(value) {
+ if (tagMap[value])
+ return "meta.tag.tag-name." + tagMap[value];
+ else
+ return "meta.tag.tag-name";
+ },
+ merge : true,
+ 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",
+ merge : true,
+ 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));
+};
+
+});
+
+ace.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;
+});
+
+ace.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;
+});
+
+ace.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({
+ // void elements
+ "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,
+
+ // optional tags
+ "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);
+
+});
+
+ace.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);
+
+});
+
+ace.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);
+
+});
+
+ace.define('ace/mode/lua', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/lua_highlight_rules', 'ace/range'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var TextMode = require("./text").Mode;
+var Tokenizer = require("../tokenizer").Tokenizer;
+var LuaHighlightRules = require("./lua_highlight_rules").LuaHighlightRules;
+var Range = require("../range").Range;
+
+var Mode = function() {
+ this.$tokenizer = new Tokenizer(new LuaHighlightRules().getRules());
+};
+oop.inherits(Mode, TextMode);
+
+(function() {
+ var indentKeywords = {
+ "function": 1,
+ "then": 1,
+ "do": 1,
+ "else": 1,
+ "elseif": 1,
+ "repeat": 1,
+ "end": -1,
+ "until": -1,
+ };
+ var outdentKeywords = [
+ "else",
+ "elseif",
+ "end",
+ "until"
+ ];
+
+ function getNetIndentLevel(tokens) {
+ var level = 0;
+ // Support single-line blocks by decrementing the indent level if
+ // an ending token is found
+ for (var i in tokens){
+ var token = tokens[i];
+ if (token.type == "keyword") {
+ if (token.value in indentKeywords) {
+ level += indentKeywords[token.value];
+ }
+ } else if (token.type == "paren.lparen") {
+ level ++;
+ } else if (token.type == "paren.rparen") {
+ level --;
+ }
+ }
+ // Limit the level to +/- 1 since usually users only indent one level
+ // at a time regardless of the logical nesting level
+ if (level < 0) {
+ return -1;
+ } else if (level > 0) {
+ return 1;
+ } else {
+ return 0;
+ }
+ }
+
+ this.getNextLineIndent = function(state, line, tab) {
+ var indent = this.$getIndent(line);
+ var level = 0;
+
+ var tokenizedLine = this.$tokenizer.getLineTokens(line, state);
+ var tokens = tokenizedLine.tokens;
+
+ if (state == "start") {
+ level = getNetIndentLevel(tokens);
+ }
+ if (level > 0) {
+ return indent + tab;
+ } else if (level < 0 && indent.substr(indent.length - tab.length) == tab) {
+ // Don't do a next-line outdent if we're going to do a real outdent of this line
+ if (!this.checkOutdent(state, line, "\n")) {
+ return indent.substr(0, indent.length - tab.length);
+ }
+ }
+ return indent;
+ };
+
+ this.checkOutdent = function(state, line, input) {
+ if (input != "\n" && input != "\r" && input != "\r\n")
+ return false;
+
+ if (line.match(/^\s*[\)\}\]]$/))
+ return true;
+
+ var tokens = this.$tokenizer.getLineTokens(line.trim(), state).tokens;
+
+ if (!tokens || !tokens.length)
+ return false;
+
+ return (tokens[0].type == "keyword" && outdentKeywords.indexOf(tokens[0].value) != -1);
+ };
+
+ this.autoOutdent = function(state, session, row) {
+ var prevLine = session.getLine(row - 1);
+ var prevIndent = this.$getIndent(prevLine).length;
+ var prevTokens = this.$tokenizer.getLineTokens(prevLine, "start").tokens;
+ var tabLength = session.getTabString().length;
+ var expectedIndent = prevIndent + tabLength * getNetIndentLevel(prevTokens);
+ var curIndent = this.$getIndent(session.getLine(row)).length;
+ if (curIndent < expectedIndent) {
+ // User already outdented //
+ return;
+ }
+ session.outdentRows(new Range(row, 0, row + 2, 0));
+ };
+
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+});
+
+ace.define('ace/mode/lua_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 LuaHighlightRules = function() {
+
+ var keywords = (
+ "break|do|else|elseif|end|for|function|if|in|local|repeat|"+
+ "return|then|until|while|or|and|not"
+ );
+
+ var builtinConstants = ("true|false|nil|_G|_VERSION");
+
+ var functions = (
+ // builtinFunctions
+ "string|xpcall|package|tostring|print|os|unpack|require|"+
+ "getfenv|setmetatable|next|assert|tonumber|io|rawequal|"+
+ "collectgarbage|getmetatable|module|rawset|math|debug|"+
+ "pcall|table|newproxy|type|coroutine|_G|select|gcinfo|"+
+ "pairs|rawget|loadstring|ipairs|_VERSION|dofile|setfenv|"+
+ "load|error|loadfile|"+
+
+ "sub|upper|len|gfind|rep|find|match|char|dump|gmatch|"+
+ "reverse|byte|format|gsub|lower|preload|loadlib|loaded|"+
+ "loaders|cpath|config|path|seeall|exit|setlocale|date|"+
+ "getenv|difftime|remove|time|clock|tmpname|rename|execute|"+
+ "lines|write|close|flush|open|output|type|read|stderr|"+
+ "stdin|input|stdout|popen|tmpfile|log|max|acos|huge|"+
+ "ldexp|pi|cos|tanh|pow|deg|tan|cosh|sinh|random|randomseed|"+
+ "frexp|ceil|floor|rad|abs|sqrt|modf|asin|min|mod|fmod|log10|"+
+ "atan2|exp|sin|atan|getupvalue|debug|sethook|getmetatable|"+
+ "gethook|setmetatable|setlocal|traceback|setfenv|getinfo|"+
+ "setupvalue|getlocal|getregistry|getfenv|setn|insert|getn|"+
+ "foreachi|maxn|foreach|concat|sort|remove|resume|yield|"+
+ "status|wrap|create|running|"+
+ // metatableMethods
+ "__add|__sub|__mod|__unm|__concat|__lt|__index|__call|__gc|__metatable|"+
+ "__mul|__div|__pow|__len|__eq|__le|__newindex|__tostring|__mode|__tonumber"
+ );
+
+ var stdLibaries = ("string|package|os|io|math|debug|table|coroutine");
+
+ var futureReserved = "";
+
+ var deprecatedIn5152 = ("setn|foreach|foreachi|gcinfo|log10|maxn");
+
+ var keywordMapper = this.createKeywordMapper({
+ "keyword": keywords,
+ "support.function": functions,
+ "invalid.deprecated": deprecatedIn5152,
+ "constant.library": stdLibaries,
+ "constant.language": builtinConstants,
+ "invalid.illegal": futureReserved,
+ "variable.language": "this"
+ }, "identifier");
+
+ var strPre = "";
+
+ var decimalInteger = "(?:(?:[1-9]\\d*)|(?:0))";
+ var hexInteger = "(?:0[xX][\\dA-Fa-f]+)";
+ var integer = "(?:" + decimalInteger + "|" + hexInteger + ")";
+
+ var fraction = "(?:\\.\\d+)";
+ var intPart = "(?:\\d+)";
+ var pointFloat = "(?:(?:" + intPart + "?" + fraction + ")|(?:" + intPart + "\\.))";
+ var floatNumber = "(?:" + pointFloat + ")";
+
+ var comment_stack = [];
+
+ this.$rules = {
+ "start" :
+
+
+ // bracketed comments
+ [{
+ token : "comment", // --[[ comment
+ regex : strPre + '\\-\\-\\[\\[.*\\]\\]'
+ }, {
+ token : "comment", // --[=[ comment
+ regex : strPre + '\\-\\-\\[\\=\\[.*\\]\\=\\]'
+ }, {
+ token : "comment", // --[==[ comment
+ regex : strPre + '\\-\\-\\[\\={2}\\[.*\\]\\={2}\\]'
+ }, {
+ token : "comment", // --[===[ comment
+ regex : strPre + '\\-\\-\\[\\={3}\\[.*\\]\\={3}\\]'
+ }, {
+ token : "comment", // --[====[ comment
+ regex : strPre + '\\-\\-\\[\\={4}\\[.*\\]\\={4}\\]'
+ }, {
+ token : "comment", // --[====+[ comment
+ regex : strPre + '\\-\\-\\[\\={5}\\=*\\[.*\\]\\={5}\\=*\\]'
+ },
+
+ // multiline bracketed comments
+ {
+ token : "comment", // --[[ comment
+ regex : strPre + '\\-\\-\\[\\[.*$',
+ merge : true,
+ next : "qcomment"
+ }, {
+ token : "comment", // --[=[ comment
+ regex : strPre + '\\-\\-\\[\\=\\[.*$',
+ merge : true,
+ next : "qcomment1"
+ }, {
+ token : "comment", // --[==[ comment
+ regex : strPre + '\\-\\-\\[\\={2}\\[.*$',
+ merge : true,
+ next : "qcomment2"
+ }, {
+ token : "comment", // --[===[ comment
+ regex : strPre + '\\-\\-\\[\\={3}\\[.*$',
+ merge : true,
+ next : "qcomment3"
+ }, {
+ token : "comment", // --[====[ comment
+ regex : strPre + '\\-\\-\\[\\={4}\\[.*$',
+ merge : true,
+ next : "qcomment4"
+ }, {
+ token : function(value){ // --[====+[ comment
+ // WARNING: EXTREMELY SLOW, but this is the only way to circumvent the
+ // limits imposed by the current automaton.
+ // I've never personally seen any practical code where 5 or more '='s are
+ // used for string or commenting, so this will rarely be invoked.
+ var pattern = /\-\-\[(\=+)\[/, match;
+ // you can never be too paranoid ;)
+ if ((match = pattern.exec(value)) != null && (match = match[1]) != undefined)
+ comment_stack.push(match.length);
+
+ return "comment";
+ },
+ regex : strPre + '\\-\\-\\[\\={5}\\=*\\[.*$',
+ merge : true,
+ next : "qcomment5"
+ },
+
+ // single line comments
+ {
+ token : "comment",
+ regex : "\\-\\-.*$"
+ },
+
+ // bracketed strings
+ {
+ token : "string", // [[ string
+ regex : strPre + '\\[\\[.*\\]\\]'
+ }, {
+ token : "string", // [=[ string
+ regex : strPre + '\\[\\=\\[.*\\]\\=\\]'
+ }, {
+ token : "string", // [==[ string
+ regex : strPre + '\\[\\={2}\\[.*\\]\\={2}\\]'
+ }, {
+ token : "string", // [===[ string
+ regex : strPre + '\\[\\={3}\\[.*\\]\\={3}\\]'
+ }, {
+ token : "string", // [====[ string
+ regex : strPre + '\\[\\={4}\\[.*\\]\\={4}\\]'
+ }, {
+ token : "string", // [====+[ string
+ regex : strPre + '\\[\\={5}\\=*\\[.*\\]\\={5}\\=*\\]'
+ },
+
+ // multiline bracketed strings
+ {
+ token : "string", // [[ string
+ regex : strPre + '\\[\\[.*$',
+ merge : true,
+ next : "qstring"
+ }, {
+ token : "string", // [=[ string
+ regex : strPre + '\\[\\=\\[.*$',
+ merge : true,
+ next : "qstring1"
+ }, {
+ token : "string", // [==[ string
+ regex : strPre + '\\[\\={2}\\[.*$',
+ merge : true,
+ next : "qstring2"
+ }, {
+ token : "string", // [===[ string
+ regex : strPre + '\\[\\={3}\\[.*$',
+ merge : true,
+ next : "qstring3"
+ }, {
+ token : "string", // [====[ string
+ regex : strPre + '\\[\\={4}\\[.*$',
+ merge : true,
+ next : "qstring4"
+ }, {
+ token : function(value){ // --[====+[ string
+ // WARNING: EXTREMELY SLOW, see above.
+ var pattern = /\[(\=+)\[/, match;
+ if ((match = pattern.exec(value)) != null && (match = match[1]) != undefined)
+ comment_stack.push(match.length);
+
+ return "string";
+ },
+ regex : strPre + '\\[\\={5}\\=*\\[.*$',
+ merge : true,
+ next : "qstring5"
+ },
+
+ {
+ token : "string", // " string
+ regex : strPre + '"(?:[^\\\\]|\\\\.)*?"'
+ }, {
+ token : "string", // ' string
+ regex : strPre + "'(?:[^\\\\]|\\\\.)*?'"
+ }, {
+ token : "constant.numeric", // float
+ regex : floatNumber
+ }, {
+ token : "constant.numeric", // integer
+ regex : integer + "\\b"
+ }, {
+ token : keywordMapper,
+ regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
+ }, {
+ token : "keyword.operator",
+ regex : "\\+|\\-|\\*|\\/|%|\\#|\\^|~|<|>|<=|=>|==|~=|=|\\:|\\.\\.\\.|\\.\\."
+ }, {
+ token : "paren.lparen",
+ regex : "[\\[\\(\\{]"
+ }, {
+ token : "paren.rparen",
+ regex : "[\\]\\)\\}]"
+ }, {
+ token : "text",
+ regex : "\\s+"
+ } ],
+
+ "qcomment": [ {
+ token : "comment",
+ regex : "(?:[^\\\\]|\\\\.)*?\\]\\]",
+ next : "start"
+ }, {
+ token : "comment",
+ merge : true,
+ regex : '.+'
+ } ],
+ "qcomment1": [ {
+ token : "comment",
+ regex : "(?:[^\\\\]|\\\\.)*?\\]\\=\\]",
+ next : "start"
+ }, {
+ token : "comment",
+ merge : true,
+ regex : '.+'
+ } ],
+ "qcomment2": [ {
+ token : "comment",
+ regex : "(?:[^\\\\]|\\\\.)*?\\]\\={2}\\]",
+ next : "start"
+ }, {
+ token : "comment",
+ merge : true,
+ regex : '.+'
+ } ],
+ "qcomment3": [ {
+ token : "comment",
+ regex : "(?:[^\\\\]|\\\\.)*?\\]\\={3}\\]",
+ next : "start"
+ }, {
+ token : "comment",
+ merge : true,
+ regex : '.+'
+ } ],
+ "qcomment4": [ {
+ token : "comment",
+ regex : "(?:[^\\\\]|\\\\.)*?\\]\\={4}\\]",
+ next : "start"
+ }, {
+ token : "comment",
+ merge : true,
+ regex : '.+'
+ } ],
+ "qcomment5": [ {
+ token : function(value){
+ // very hackish, mutates the qcomment5 field on the fly.
+ var pattern = /\](\=+)\]/, rule = this.rules.qcomment5[0], match;
+ rule.next = "start";
+ if ((match = pattern.exec(value)) != null && (match = match[1]) != undefined){
+ var found = match.length, expected;
+ if ((expected = comment_stack.pop()) != found){
+ comment_stack.push(expected);
+ rule.next = "qcomment5";
+ }
+ }
+
+ return "comment";
+ },
+ regex : "(?:[^\\\\]|\\\\.)*?\\]\\={5}\\=*\\]",
+ next : "start"
+ }, {
+ token : "comment",
+ merge : true,
+ regex : '.+'
+ } ],
+
+ "qstring": [ {
+ token : "string",
+ regex : "(?:[^\\\\]|\\\\.)*?\\]\\]",
+ next : "start"
+ }, {
+ token : "string",
+ merge : true,
+ regex : '.+'
+ } ],
+ "qstring1": [ {
+ token : "string",
+ regex : "(?:[^\\\\]|\\\\.)*?\\]\\=\\]",
+ next : "start"
+ }, {
+ token : "string",
+ merge : true,
+ regex : '.+'
+ } ],
+ "qstring2": [ {
+ token : "string",
+ regex : "(?:[^\\\\]|\\\\.)*?\\]\\={2}\\]",
+ next : "start"
+ }, {
+ token : "string",
+ merge : true,
+ regex : '.+'
+ } ],
+ "qstring3": [ {
+ token : "string",
+ regex : "(?:[^\\\\]|\\\\.)*?\\]\\={3}\\]",
+ next : "start"
+ }, {
+ token : "string",
+ merge : true,
+ regex : '.+'
+ } ],
+ "qstring4": [ {
+ token : "string",
+ regex : "(?:[^\\\\]|\\\\.)*?\\]\\={4}\\]",
+ next : "start"
+ }, {
+ token : "string",
+ merge : true,
+ regex : '.+'
+ } ],
+ "qstring5": [ {
+ token : function(value){
+ // very hackish, mutates the qstring5 field on the fly.
+ var pattern = /\](\=+)\]/, rule = this.rules.qstring5[0], match;
+ rule.next = "start";
+ if ((match = pattern.exec(value)) != null && (match = match[1]) != undefined){
+ var found = match.length, expected;
+ if ((expected = comment_stack.pop()) != found){
+ comment_stack.push(expected);
+ rule.next = "qstring5";
+ }
+ }
+
+ return "string";
+ },
+ regex : "(?:[^\\\\]|\\\\.)*?\\]\\={5}\\=*\\]",
+ next : "start"
+ }, {
+ token : "string",
+ merge : true,
+ regex : '.+'
+ } ]
+
+ };
+
+}
+
+oop.inherits(LuaHighlightRules, TextHighlightRules);
+
+exports.LuaHighlightRules = LuaHighlightRules;
+});
+// LuaPage implements the LuaPage markup as described by the Kepler Project's CGILua
+// documentation: http://keplerproject.github.com/cgilua/manual.html#templates
+ace.define('ace/mode/luapage_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/html_highlight_rules', 'ace/mode/lua_highlight_rules'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
+var LuaHighlightRules = require("./lua_highlight_rules").LuaHighlightRules;
+
+var LuaPageHighlightRules = function() {
+ this.$rules = new HtmlHighlightRules().getRules();
+
+ for (var i in this.$rules) {
+ this.$rules[i].unshift({
+ token: "keyword",
+ regex: "<\\%\\=?",
+ next: "lua-start"
+ }, {
+ token: "keyword",
+ regex: "<\\?lua\\=?",
+ next: "lua-start"
+ });
+ }
+ this.embedRules(LuaHighlightRules, "lua-", [
+ {
+ token: "keyword",
+ regex: "\\%>",
+ next: "start"
+ },
+ {
+ token: "keyword",
+ regex: "\\?>",
+ next: "start"
+ }
+ ]);
+};
+
+oop.inherits(LuaPageHighlightRules, HtmlHighlightRules);
+
+exports.LuaPageHighlightRules = LuaPageHighlightRules;
+
+}); \ No newline at end of file
diff --git a/vendor/assets/javascripts/ace-src-noconflict/mode-markdown.js b/vendor/assets/javascripts/ace-src-noconflict/mode-markdown.js
new file mode 100644
index 00000000000..179376aa403
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/mode-markdown.js
@@ -0,0 +1,2252 @@
+/* ***** 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 ***** */
+
+ace.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'], 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 Mode = function() {
+ var highlighter = new MarkdownHighlightRules();
+
+ this.$tokenizer = new Tokenizer(highlighter.getRules());
+ this.$embeds = highlighter.getEmbeds();
+ this.createModeDelegates({
+ "js-": JavaScriptMode,
+ "xml-": XmlMode,
+ "html-": HtmlMode
+ });
+};
+oop.inherits(Mode, TextMode);
+
+(function() {
+ this.getNextLineIndent = function(state, line, tab) {
+ if (state == "listblock") {
+ var match = /^((?:.+)?)(([-+*]|\d+\.)\s+)/.exec(line);
+ if (match) {
+ return new Array(match[1].length + 1).join(" ") + match[2];
+ } else {
+ return "";
+ }
+ } else {
+ return this.$getIndent(line);
+ }
+ };
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+});
+
+ace.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) {
+ var errors = [];
+ for (var i=0; i<results.data.length; i++) {
+ var error = results.data[i];
+ if (error)
+ errors.push({
+ row: error.line-1,
+ column: error.character-1,
+ text: error.reason,
+ type: "warning",
+ lint: error
+ });
+ }
+ session.setAnnotations(errors);
+ });
+
+ worker.on("narcissus", function(e) {
+ session.setAnnotations([e.data]);
+ });
+
+ worker.on("terminate", function() {
+ session.clearAnnotations();
+ });
+
+ return worker;
+ };
+
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+});
+
+ace.define('ace/mode/javascript_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/unicode', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var unicode = require("../unicode");
+var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
+var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+
+var JavaScriptHighlightRules = function() {
+ // see: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects
+ 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
+ "invalid.deprecated":
+ "__parent__|__count__|escape|unescape|with|__proto__|debugger",
+ "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|",
+ "storage.type":
+ "const|let|var|function",
+ "invalid.illegal":
+ "class|enum|extends|super|export|implements|private|" +
+ "public|interface|package|protected|static",
+ "constant.language":
+ "null|Infinity|NaN|undefined",
+ }, "identifier");
+
+
+ // keywords which can be followed by regular expressions
+ var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield";
+
+ // TODO: Unicode escape sequences
+ 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
+ ".)";
+
+ // regexp must not have capturing parentheses. Use (?:) instead.
+ // regexps are ordered -> the first match is used
+
+ this.$rules = {
+ "start" : [
+ {
+ token : "comment",
+ regex : /\/\/.*$/
+ },
+ DocCommentHighlightRules.getStartRule("doc-start"),
+ {
+ token : "comment", // multi line comment
+ merge : true,
+ 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/
+ }, {
+ // Sound.prototype.play =
+ token : [
+ "storage.type", "punctuation.operator", "support.function",
+ "punctuation.operator", "entity.name.function", "text","keyword.operator"
+ ],
+ regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)",
+ next: "function_arguments"
+ }, {
+ // Sound.play = function() { }
+ 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"
+ }, {
+ // play = function() { }
+ token : [
+ "entity.name.function", "text", "keyword.operator", "text", "storage.type",
+ "text", "paren.lparen"
+ ],
+ regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ // Sound.play = function play() { }
+ 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"
+ }, {
+ // function myFunc(arg) { }
+ token : [
+ "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ ],
+ regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ // foobar: function() { }
+ token : [
+ "entity.name.function", "text", "punctuation.operator",
+ "text", "storage.type", "text", "paren.lparen"
+ ],
+ regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ // : function() { } (this is for issues with 'foo': function() { })
+ token : [
+ "text", "text", "storage.type", "text", "paren.lparen"
+ ],
+ regex : "(:)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ token : "constant.language.boolean",
+ regex : /(?:true|false)\b/
+ }, {
+ 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 : /!|\$|%|&|\*|\-\-|\-|\+\+|\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=|\b(?:in|instanceof|new|delete|typeof|void)/,
+ 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: /^#!.*$/
+ }, {
+ token : "text",
+ regex : /\s+/
+ }
+ ],
+ // regular expressions are only allowed after certain tokens. This
+ // makes sure we don't mix up regexps with the divison operator
+ "regex_allowed": [
+ DocCommentHighlightRules.getStartRule("doc-start"),
+ {
+ token : "comment", // multi line comment
+ merge : true,
+ regex : "\\/\\*",
+ next : "comment_regex_allowed"
+ }, {
+ token : "comment",
+ regex : "\\/\\/.*$"
+ }, {
+ token: "string.regexp",
+ regex: "\\/",
+ next: "regex",
+ merge: true
+ }, {
+ token : "text",
+ regex : "\\s+"
+ }, {
+ // immediately return to the start mode without matching
+ // anything
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "regex": [
+ {
+ // escapes
+ token: "regexp.keyword.operator",
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
+ }, {
+ // flag
+ token: "string.regexp",
+ regex: "/\\w*",
+ next: "start",
+ merge: true
+ }, {
+ // invalid operators
+ token : "invalid",
+ regex: /\{\d+,?(?:\d+)?}[+*]|[+*^$?][+*]|\?\?/ // |[^$][?]
+ }, {
+ // operators
+ token : "constant.language.escape",
+ regex: /\(\?[:=!]|\)|\{\d+,?(?:\d+)?}|[+*]\?|[(|)$^+*?]/
+ }, {
+ token: "string.regexp",
+ regex: /{|[^\[\\{()$^+*?\/]+/,
+ merge: true
+ }, {
+ token: "constant.language.escape",
+ regex: /\[\^?/,
+ next: "regex_character_class",
+ merge: true
+ }, {
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "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",
+ merge: true
+ }, {
+ token: "constant.language.escape",
+ regex: "-",
+ }, {
+ token: "string.regexp.charachterclass",
+ regex: /[^\]\-\\]+/,
+ merge: true
+ }, {
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "function_arguments": [
+ {
+ token: "variable.parameter",
+ regex: identifierRe
+ }, {
+ token: "punctuation.operator",
+ regex: "[, ]+",
+ merge: true
+ }, {
+ token: "punctuation.operator",
+ regex: "$",
+ merge: true
+ }, {
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "comment_regex_allowed" : [
+ {
+ token : "comment", // closing comment
+ regex : ".*?\\*\\/",
+ merge : true,
+ next : "regex_allowed"
+ }, {
+ token : "comment", // comment spanning whole line
+ merge : true,
+ regex : ".+"
+ }
+ ],
+ "comment" : [
+ {
+ token : "comment", // closing comment
+ regex : ".*?\\*\\/",
+ merge : true,
+ next : "start"
+ }, {
+ token : "comment", // comment spanning whole line
+ merge : true,
+ regex : ".+"
+ }
+ ],
+ "qqstring" : [
+ {
+ token : "constant.language.escape",
+ regex : escapedRe
+ }, {
+ token : "string",
+ regex : '[^"\\\\]+',
+ merge : true
+ }, {
+ token : "string",
+ regex : "\\\\$",
+ next : "qqstring",
+ merge : true
+ }, {
+ token : "string",
+ regex : '"|$',
+ next : "start",
+ merge : true
+ }
+ ],
+ "qstring" : [
+ {
+ token : "constant.language.escape",
+ regex : escapedRe
+ }, {
+ token : "string",
+ regex : "[^'\\\\]+",
+ merge : true
+ }, {
+ token : "string",
+ regex : "\\\\$",
+ next : "qstring",
+ merge : true
+ }, {
+ token : "string",
+ regex : "'|$",
+ next : "start",
+ merge : true
+ }
+ ]
+ };
+
+ this.embedRules(DocCommentHighlightRules, "doc-",
+ [ DocCommentHighlightRules.getEndRule("start") ]);
+};
+
+oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
+
+exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
+});
+
+ace.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",
+ merge : true,
+ regex : "\\s+"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "TODO"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "[^@\\*]+"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "."
+ }]
+ };
+};
+
+oop.inherits(DocCommentHighlightRules, TextHighlightRules);
+
+DocCommentHighlightRules.getStartRule = function(start) {
+ return {
+ token : "comment.doc", // doc comment
+ merge : true,
+ regex : "\\/\\*(?=\\*)",
+ next : start
+ };
+};
+
+DocCommentHighlightRules.getEndRule = function (start) {
+ return {
+ token : "comment.doc", // closing comment
+ merge : true,
+ regex : "\\*\\/",
+ next : start
+ };
+};
+
+
+exports.DocCommentHighlightRules = DocCommentHighlightRules;
+
+});
+
+ace.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;
+});
+
+ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour'], function(require, exports, module) {
+
+
+var oop = require("../../lib/oop");
+var Behaviour = require("../behaviour").Behaviour;
+
+var CstyleBehaviour = function () {
+
+ this.add("braces", "insertion", function (state, action, editor, session, text) {
+ if (text == '{') {
+ var selection = editor.getSelectionRange();
+ var selected = session.doc.getTextRange(selection);
+ if (selected !== "") {
+ return {
+ text: '{' + selected + '}',
+ selection: false
+ };
+ } else {
+ 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) {
+ return {
+ text: '',
+ selection: [1, 1]
+ };
+ }
+ }
+ } else if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ if (rightChar == '}') {
+ var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column + 1});
+ if (!openBracePos)
+ return null;
+
+ var indent = this.getNextLineIndent(state, line.substring(0, line.length - 1), session.getTabString());
+ var next_indent = this.$getIndent(session.doc.getLine(openBracePos.row));
+
+ return {
+ text: '\n' + indent + '\n' + next_indent,
+ 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;
+ }
+ }
+ });
+
+ this.add("parens", "insertion", function (state, action, editor, session, text) {
+ if (text == '(') {
+ var selection = editor.getSelectionRange();
+ var selected = session.doc.getTextRange(selection);
+ if (selected !== "") {
+ return {
+ text: '(' + selected + ')',
+ selection: false
+ };
+ } else {
+ 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) {
+ 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 !== "") {
+ return {
+ text: '[' + selected + ']',
+ selection: false
+ };
+ } else {
+ 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) {
+ 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 !== "") {
+ 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);
+
+ // We're escaped.
+ if (leftChar == '\\') {
+ return null;
+ }
+
+ // Find what token we're inside.
+ 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;
+ }
+
+ // Try and be smart about when we auto insert.
+ 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)))) {
+ return {
+ text: quote + quote,
+ selection: [1,1]
+ };
+ } else if (token && token.type === "string") {
+ // Ignore input and move right one if we're typing over the closing quote.
+ 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 == '"') {
+ range.end.column++;
+ return range;
+ }
+ }
+ });
+
+};
+
+oop.inherits(CstyleBehaviour, Behaviour);
+
+exports.CstyleBehaviour = CstyleBehaviour;
+});
+
+ace.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);
+
+ var range = session.getCommentFoldRange(row, i + match[0].length);
+ range.end.column -= 2;
+ return range;
+ }
+
+ if (foldStyle !== "markbeginend")
+ return;
+
+ var match = line.match(this.foldingStopMarker);
+ if (match) {
+ var i = match.index + match[0].length;
+
+ if (match[2]) {
+ var range = session.getCommentFoldRange(row, i);
+ range.end.column -= 2;
+ return range;
+ }
+
+ var end = {row: row, column: i};
+ var start = session.$findOpeningBracket(match[1], end);
+
+ if (!start)
+ return;
+
+ start.column++;
+ end.column--;
+
+ return Range.fromPoints(start, end);
+ }
+ };
+
+}).call(FoldMode.prototype);
+
+});
+
+ace.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;
+
+ // must return "" if there's no fold, to enable caching
+ 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);
+ };
+
+}).call(FoldMode.prototype);
+
+});
+
+ace.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;
+});
+
+ace.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() {
+
+ // regexp must not have capturing parentheses
+ // regexps are ordered -> the first match is used
+ this.$rules = {
+ start : [{
+ token : "text",
+ regex : "<\\!\\[CDATA\\[",
+ next : "cdata"
+ }, {
+ token : "xml_pe",
+ regex : "<\\?.*?\\?>"
+ }, {
+ token : "comment",
+ merge : true,
+ regex : "<\\!--",
+ next : "comment"
+ }, {
+ token : "xml_pe",
+ regex : "<\\!.*?>"
+ }, {
+ token : "meta.tag", // opening tag
+ regex : "<\\/?",
+ next : "tag"
+ }, {
+ token : "text",
+ regex : "\\s+"
+ }, {
+ token : "constant.character.entity",
+ regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
+ }, {
+ token : "text",
+ regex : "[^<]+"
+ }],
+
+ cdata : [{
+ token : "text",
+ regex : "\\]\\]>",
+ next : "start"
+ }, {
+ token : "text",
+ regex : "\\s+"
+ }, {
+ token : "text",
+ regex : "(?:[^\\]]|\\](?!\\]>))+"
+ }],
+
+ comment : [{
+ token : "comment",
+ regex : ".*?-->",
+ next : "start"
+ }, {
+ token : "comment",
+ merge : true,
+ regex : ".+"
+ }]
+ };
+
+ xmlUtil.tag(this.$rules, "tag", "start");
+};
+
+oop.inherits(XmlHighlightRules, TextHighlightRules);
+
+exports.XmlHighlightRules = XmlHighlightRules;
+});
+
+ace.define('ace/mode/xml_util', ['require', 'exports', 'module' ], function(require, exports, module) {
+
+
+function string(state) {
+ return [{
+ token : "string",
+ regex : '".*?"'
+ }, {
+ token : "string", // multi line string start
+ merge : true,
+ regex : '["].*',
+ next : state + "_qqstring"
+ }, {
+ token : "string",
+ regex : "'.*?'"
+ }, {
+ token : "string", // multi line string start
+ merge : true,
+ regex : "['].*",
+ next : state + "_qstring"
+ }];
+}
+
+function multiLineString(quote, state) {
+ return [{
+ token : "string",
+ merge : true,
+ regex : ".*?" + quote,
+ next : state
+ }, {
+ token : "string",
+ merge : true,
+ regex : '.+'
+ }];
+}
+
+exports.tag = function(states, name, nextState, tagMap) {
+ states[name] = [{
+ token : "text",
+ regex : "\\s+"
+ }, {
+ //token : "meta.tag",
+
+ token : !tagMap ? "meta.tag.tag-name" : function(value) {
+ if (tagMap[value])
+ return "meta.tag.tag-name." + tagMap[value];
+ else
+ return "meta.tag.tag-name";
+ },
+ merge : true,
+ 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",
+ merge : true,
+ 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));
+};
+
+});
+
+ace.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;
+});
+
+ace.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);
+
+});
+
+ace.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;
+});
+
+ace.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/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 CStyleFoldMode = require("./folding/cstyle").FoldMode;
+
+var Mode = function() {
+ this.$tokenizer = new Tokenizer(new CssHighlightRules().getRules(), "i");
+ this.$outdent = new MatchingBraceOutdent();
+ this.foldingRules = new CStyleFoldMode();
+};
+oop.inherits(Mode, TextMode);
+
+(function() {
+
+ this.foldingRules = "cStyle";
+
+ this.getNextLineIndent = function(state, line, tab) {
+ var indent = this.$getIndent(line);
+
+ // ignore braces in comments
+ 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) {
+ var errors = [];
+ e.data.forEach(function(message) {
+ errors.push({
+ row: message.line - 1,
+ column: message.col - 1,
+ text: message.message,
+ type: message.type,
+ lint: message
+ });
+ });
+
+ session.setAnnotations(errors);
+ });
+ return worker;
+ };
+
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+
+});
+
+ace.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 CssHighlightRules = function() {
+ var keywordMapper = this.createKeywordMapper({
+ "support.type": "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",
+ "support.function": "rgb|rgba|url|attr|counter|counters",
+ "support.constant": "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",
+ "support.constant.color": "aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow",
+ "support.constant.fonts": "arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace"
+ }, "text", true);
+
+ // regexp must not have capturing parentheses. Use (?:) instead.
+ // regexps are ordered -> the first match is used
+
+ var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
+ var pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
+ var 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 base_ruleset = [
+ {
+ token : "comment", // multi line comment
+ merge : true,
+ 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 : "([0-9]+)"
+ }, {
+ 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
+ merge : true,
+ 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
+ merge : true,
+ 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
+ merge : true,
+ 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;
+
+});
+
+ace.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() {
+
+ // regexp must not have capturing parentheses
+ // regexps are ordered -> the first match is used
+ this.$rules = {
+ start : [{
+ token : "text",
+ merge : true,
+ regex : "<\\!\\[CDATA\\[",
+ next : "cdata"
+ }, {
+ token : "xml_pe",
+ regex : "<\\?.*?\\?>"
+ }, {
+ token : "comment",
+ merge : true,
+ regex : "<\\!--",
+ next : "comment"
+ }, {
+ token : "xml_pe",
+ regex : "<\\!.*?>"
+ }, {
+ token : "meta.tag",
+ regex : "<(?=\s*script\\b)",
+ next : "script"
+ }, {
+ token : "meta.tag",
+ regex : "<(?=\s*style\\b)",
+ next : "style"
+ }, {
+ token : "meta.tag", // opening tag
+ regex : "<\\/?",
+ next : "tag"
+ }, {
+ token : "text",
+ regex : "\\s+"
+ }, {
+ token : "constant.character.entity",
+ regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
+ }, {
+ token : "text",
+ regex : "[^<]+"
+ } ],
+
+ cdata : [ {
+ token : "text",
+ regex : "\\]\\]>",
+ next : "start"
+ }, {
+ token : "text",
+ merge : true,
+ regex : "\\s+"
+ }, {
+ token : "text",
+ merge : true,
+ regex : ".+"
+ } ],
+
+ comment : [ {
+ token : "comment",
+ regex : ".*?-->",
+ next : "start"
+ }, {
+ token : "comment",
+ merge : true,
+ regex : ".+"
+ } ]
+ };
+
+ 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;
+});
+
+ace.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;
+});
+
+ace.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({
+ // void elements
+ "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,
+
+ // optional tags
+ "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);
+
+});
+
+ace.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);
+
+});
+
+ace.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() {
+
+ // regexp must not have capturing parentheses
+ // regexps are ordered -> the first match is used
+
+ this.$rules = {
+ "start" : [ {
+ token : "empty_line",
+ regex : '^$'
+ }, { // code span `
+ token : ["support.function", "support.function", "support.function"],
+ regex : "(`+)([^\\r]*?[^`])(\\1)"
+ }, { // code block
+ token : "support.function",
+ regex : "^[ ]{4}.+"
+ }, { // 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 : "^```[a-zA-Z]+\\s*$",
+ next : "githubblock"
+ }, { // block quote
+ token : "string",
+ regex : "^>[ ].+$",
+ next : "blockquote"
+ }, { // 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]*)?)"+
+ "(\\))"
+ }, { // HR *
+ token : "constant",
+ regex : "^[ ]{0,2}(?:[ ]?\\*[ ]?){3,}\\s*$"
+ }, { // HR -
+ token : "constant",
+ regex : "^[ ]{0,2}(?:[ ]?\\-[ ]?){3,}\\s*$"
+ }, { // HR _
+ token : "constant",
+ regex : "^[ ]{0,2}(?:[ ]?\\_[ ]?){3,}\\s*$"
+ }, { // list
+ token : "markup.list",
+ regex : "^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+",
+ next : "listblock"
+ }, { // strong ** __
+ token : ["string", "string", "string"],
+ regex : "([*]{2}|[_]{2}(?=\\S))([^\\r]*?\\S[*_]*)(\\1)"
+ }, { // emphasis * _
+ token : ["string", "string", "string"],
+ regex : "([*]|[_](?=\\S))([^\\r]*?\\S[*_]*)(\\1)"
+ }, { //
+ token : ["text", "url", "text"],
+ regex : "(<)("+
+ "(?:https?|ftp|dict):[^'\">\\s]+"+
+ "|"+
+ "(?:mailto:)?[-.\\w]+\\@[-a-z0-9]+(?:\\.[-a-z0-9]+)*\\.[a-z]+"+
+ ")(>)"
+ }, {
+ token : "text",
+ regex : "[^\\*_%$`\\[#<>]+"
+ } ],
+
+ "listblock" : [ { // Lists only escape on completely blank lines.
+ token : "empty_line",
+ regex : "^$",
+ next : "start"
+ }, {
+ token : "markup.list",
+ regex : ".+"
+ } ],
+
+ "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"
+ }]);
+};
+oop.inherits(MarkdownHighlightRules, TextHighlightRules);
+
+exports.MarkdownHighlightRules = MarkdownHighlightRules;
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/mode-ocaml.js b/vendor/assets/javascripts/ace-src-noconflict/mode-ocaml.js
new file mode 100644
index 00000000000..e6188c73234
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/mode-ocaml.js
@@ -0,0 +1,452 @@
+/* ***** 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 ***** */
+
+ace.define('ace/mode/ocaml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/ocaml_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var TextMode = require("./text").Mode;
+var Tokenizer = require("../tokenizer").Tokenizer;
+var OcamlHighlightRules = require("./ocaml_highlight_rules").OcamlHighlightRules;
+var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
+var Range = require("../range").Range;
+
+var Mode = function() {
+ this.$tokenizer = new Tokenizer(new OcamlHighlightRules().getRules());
+ this.$outdent = new MatchingBraceOutdent();
+};
+oop.inherits(Mode, TextMode);
+
+var indenter = /(?:[({[=:]|[-=]>|\b(?:else|try|with))\s*$/;
+
+(function() {
+
+ this.toggleCommentLines = function(state, doc, startRow, endRow) {
+ var i, line;
+ var outdent = true;
+ var re = /^\s*\(\*(.*)\*\)/;
+
+ for (i=startRow; i<= endRow; i++) {
+ if (!re.test(doc.getLine(i))) {
+ outdent = false;
+ break;
+ }
+ }
+
+ var range = new Range(0, 0, 0, 0);
+ for (i=startRow; i<= endRow; i++) {
+ line = doc.getLine(i);
+ range.start.row = i;
+ range.end.row = i;
+ range.end.column = line.length;
+
+ doc.replace(range, outdent ? line.match(re)[1] : "(*" + line + "*)");
+ }
+ };
+
+ 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') &&
+ state === 'start' && indenter.test(line))
+ 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;
+});
+
+ace.define('ace/mode/ocaml_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 OcamlHighlightRules = function() {
+
+ var keywords = (
+ "and|as|assert|begin|class|constraint|do|done|downto|else|end|" +
+ "exception|external|for|fun|function|functor|if|in|include|" +
+ "inherit|initializer|lazy|let|match|method|module|mutable|new|" +
+ "object|of|open|or|private|rec|sig|struct|then|to|try|type|val|" +
+ "virtual|when|while|with"
+ );
+
+ var builtinConstants = ("true|false");
+
+ var builtinFunctions = (
+ "abs|abs_big_int|abs_float|abs_num|abstract_tag|accept|access|acos|add|" +
+ "add_available_units|add_big_int|add_buffer|add_channel|add_char|" +
+ "add_initializer|add_int_big_int|add_interfaces|add_num|add_string|" +
+ "add_substitute|add_substring|alarm|allocated_bytes|allow_only|" +
+ "allow_unsafe_modules|always|append|appname_get|appname_set|" +
+ "approx_num_exp|approx_num_fix|arg|argv|arith_status|array|" +
+ "array1_of_genarray|array2_of_genarray|array3_of_genarray|asin|asr|" +
+ "assoc|assq|at_exit|atan|atan2|auto_synchronize|background|basename|" +
+ "beginning_of_input|big_int_of_int|big_int_of_num|big_int_of_string|bind|" +
+ "bind_class|bind_tag|bits|bits_of_float|black|blit|blit_image|blue|bool|" +
+ "bool_of_string|bounded_full_split|bounded_split|bounded_split_delim|" +
+ "bprintf|break|broadcast|bscanf|button_down|c_layout|capitalize|cardinal|" +
+ "cardinal|catch|catch_break|ceil|ceiling_num|channel|char|char_of_int|" +
+ "chdir|check|check_suffix|chmod|choose|chop_extension|chop_suffix|chown|" +
+ "chown|chr|chroot|classify_float|clear|clear_available_units|" +
+ "clear_close_on_exec|clear_graph|clear_nonblock|clear_parser|" +
+ "close|close|closeTk|close_box|close_graph|close_in|close_in_noerr|" +
+ "close_out|close_out_noerr|close_process|close_process|" +
+ "close_process_full|close_process_in|close_process_out|close_subwindow|" +
+ "close_tag|close_tbox|closedir|closedir|closure_tag|code|combine|" +
+ "combine|combine|command|compact|compare|compare_big_int|compare_num|" +
+ "complex32|complex64|concat|conj|connect|contains|contains_from|contents|" +
+ "copy|cos|cosh|count|count|counters|create|create_alarm|create_image|" +
+ "create_matrix|create_matrix|create_matrix|create_object|" +
+ "create_object_and_run_initializers|create_object_opt|create_process|" +
+ "create_process|create_process_env|create_process_env|create_table|" +
+ "current|current_dir_name|current_point|current_x|current_y|curveto|" +
+ "custom_tag|cyan|data_size|decr|decr_num|default_available_units|delay|" +
+ "delete_alarm|descr_of_in_channel|descr_of_out_channel|destroy|diff|dim|" +
+ "dim1|dim2|dim3|dims|dirname|display_mode|div|div_big_int|div_num|" +
+ "double_array_tag|double_tag|draw_arc|draw_char|draw_circle|draw_ellipse|" +
+ "draw_image|draw_poly|draw_poly_line|draw_rect|draw_segments|draw_string|" +
+ "dummy_pos|dummy_table|dump_image|dup|dup2|elements|empty|end_of_input|" +
+ "environment|eprintf|epsilon_float|eq_big_int|eq_num|equal|err_formatter|" +
+ "error_message|escaped|establish_server|executable_name|execv|execve|execvp|" +
+ "execvpe|exists|exists2|exit|exp|failwith|fast_sort|fchmod|fchown|field|" +
+ "file|file_exists|fill|fill_arc|fill_circle|fill_ellipse|fill_poly|fill_rect|" +
+ "filter|final_tag|finalise|find|find_all|first_chars|firstkey|flatten|" +
+ "float|float32|float64|float_of_big_int|float_of_bits|float_of_int|" +
+ "float_of_num|float_of_string|floor|floor_num|flush|flush_all|flush_input|" +
+ "flush_str_formatter|fold|fold_left|fold_left2|fold_right|fold_right2|" +
+ "for_all|for_all2|force|force_newline|force_val|foreground|fork|" +
+ "format_of_string|formatter_of_buffer|formatter_of_out_channel|" +
+ "fortran_layout|forward_tag|fprintf|frexp|from|from_channel|from_file|" +
+ "from_file_bin|from_function|from_string|fscanf|fst|fstat|ftruncate|" +
+ "full_init|full_major|full_split|gcd_big_int|ge_big_int|ge_num|" +
+ "genarray_of_array1|genarray_of_array2|genarray_of_array3|get|" +
+ "get_all_formatter_output_functions|get_approx_printing|get_copy|" +
+ "get_ellipsis_text|get_error_when_null_denominator|get_floating_precision|" +
+ "get_formatter_output_functions|get_formatter_tag_functions|get_image|" +
+ "get_margin|get_mark_tags|get_max_boxes|get_max_indent|get_method|" +
+ "get_method_label|get_normalize_ratio|get_normalize_ratio_when_printing|" +
+ "get_print_tags|get_state|get_variable|getcwd|getegid|getegid|getenv|" +
+ "getenv|getenv|geteuid|geteuid|getgid|getgid|getgrgid|getgrgid|getgrnam|" +
+ "getgrnam|getgroups|gethostbyaddr|gethostbyname|gethostname|getitimer|" +
+ "getlogin|getpeername|getpid|getppid|getprotobyname|getprotobynumber|" +
+ "getpwnam|getpwuid|getservbyname|getservbyport|getsockname|getsockopt|" +
+ "getsockopt_float|getsockopt_int|getsockopt_optint|gettimeofday|getuid|" +
+ "global_replace|global_substitute|gmtime|green|grid|group_beginning|" +
+ "group_end|gt_big_int|gt_num|guard|handle_unix_error|hash|hash_param|" +
+ "hd|header_size|i|id|ignore|in_channel_length|in_channel_of_descr|incr|" +
+ "incr_num|index|index_from|inet_addr_any|inet_addr_of_string|infinity|" +
+ "infix_tag|init|init_class|input|input_binary_int|input_byte|input_char|" +
+ "input_line|input_value|int|int16_signed|int16_unsigned|int32|int64|" +
+ "int8_signed|int8_unsigned|int_of_big_int|int_of_char|int_of_float|" +
+ "int_of_num|int_of_string|integer_num|inter|interactive|inv|invalid_arg|" +
+ "is_block|is_empty|is_implicit|is_int|is_int_big_int|is_integer_num|" +
+ "is_relative|iter|iter2|iteri|join|junk|key_pressed|kill|kind|kprintf|" +
+ "kscanf|land|last_chars|layout|lazy_from_fun|lazy_from_val|lazy_is_val|" +
+ "lazy_tag|ldexp|le_big_int|le_num|length|lexeme|lexeme_char|lexeme_end|" +
+ "lexeme_end_p|lexeme_start|lexeme_start_p|lineto|link|list|listen|lnot|" +
+ "loadfile|loadfile_private|localtime|lock|lockf|log|log10|logand|lognot|" +
+ "logor|logxor|lor|lower_window|lowercase|lseek|lsl|lsr|lstat|lt_big_int|" +
+ "lt_num|lxor|magenta|magic|mainLoop|major|major_slice|make|make_formatter|" +
+ "make_image|make_lexer|make_matrix|make_self_init|map|map2|map_file|mapi|" +
+ "marshal|match_beginning|match_end|matched_group|matched_string|max|" +
+ "max_array_length|max_big_int|max_elt|max_float|max_int|max_num|" +
+ "max_string_length|mem|mem_assoc|mem_assq|memq|merge|min|min_big_int|" +
+ "min_elt|min_float|min_int|min_num|minor|minus_big_int|minus_num|" +
+ "minus_one|mkdir|mkfifo|mktime|mod|mod_big_int|mod_float|mod_num|modf|" +
+ "mouse_pos|moveto|mul|mult_big_int|mult_int_big_int|mult_num|nan|narrow|" +
+ "nat_of_num|nativeint|neg|neg_infinity|new_block|new_channel|new_method|" +
+ "new_variable|next|nextkey|nice|nice|no_scan_tag|norm|norm2|not|npeek|" +
+ "nth|nth_dim|num_digits_big_int|num_dims|num_of_big_int|num_of_int|" +
+ "num_of_nat|num_of_ratio|num_of_string|O|obj|object_tag|ocaml_version|" +
+ "of_array|of_channel|of_float|of_int|of_int32|of_list|of_nativeint|" +
+ "of_string|one|openTk|open_box|open_connection|open_graph|open_hbox|" +
+ "open_hovbox|open_hvbox|open_in|open_in_bin|open_in_gen|open_out|" +
+ "open_out_bin|open_out_gen|open_process|open_process_full|open_process_in|" +
+ "open_process_out|open_subwindow|open_tag|open_tbox|open_temp_file|" +
+ "open_vbox|opendbm|opendir|openfile|or|os_type|out_channel_length|" +
+ "out_channel_of_descr|output|output_binary_int|output_buffer|output_byte|" +
+ "output_char|output_string|output_value|over_max_boxes|pack|params|" +
+ "parent_dir_name|parse|parse_argv|partition|pause|peek|pipe|pixels|" +
+ "place|plot|plots|point_color|polar|poll|pop|pos_in|pos_out|pow|" +
+ "power_big_int_positive_big_int|power_big_int_positive_int|" +
+ "power_int_positive_big_int|power_int_positive_int|power_num|" +
+ "pp_close_box|pp_close_tag|pp_close_tbox|pp_force_newline|" +
+ "pp_get_all_formatter_output_functions|pp_get_ellipsis_text|" +
+ "pp_get_formatter_output_functions|pp_get_formatter_tag_functions|" +
+ "pp_get_margin|pp_get_mark_tags|pp_get_max_boxes|pp_get_max_indent|" +
+ "pp_get_print_tags|pp_open_box|pp_open_hbox|pp_open_hovbox|pp_open_hvbox|" +
+ "pp_open_tag|pp_open_tbox|pp_open_vbox|pp_over_max_boxes|pp_print_as|" +
+ "pp_print_bool|pp_print_break|pp_print_char|pp_print_cut|pp_print_float|" +
+ "pp_print_flush|pp_print_if_newline|pp_print_int|pp_print_newline|" +
+ "pp_print_space|pp_print_string|pp_print_tab|pp_print_tbreak|" +
+ "pp_set_all_formatter_output_functions|pp_set_ellipsis_text|" +
+ "pp_set_formatter_out_channel|pp_set_formatter_output_functions|" +
+ "pp_set_formatter_tag_functions|pp_set_margin|pp_set_mark_tags|" +
+ "pp_set_max_boxes|pp_set_max_indent|pp_set_print_tags|pp_set_tab|" +
+ "pp_set_tags|pred|pred_big_int|pred_num|prerr_char|prerr_endline|" +
+ "prerr_float|prerr_int|prerr_newline|prerr_string|print|print_as|" +
+ "print_bool|print_break|print_char|print_cut|print_endline|print_float|" +
+ "print_flush|print_if_newline|print_int|print_newline|print_space|" +
+ "print_stat|print_string|print_tab|print_tbreak|printf|prohibit|" +
+ "public_method_label|push|putenv|quo_num|quomod_big_int|quote|raise|" +
+ "raise_window|ratio_of_num|rcontains_from|read|read_float|read_int|" +
+ "read_key|read_line|readdir|readdir|readlink|really_input|receive|recv|" +
+ "recvfrom|red|ref|regexp|regexp_case_fold|regexp_string|" +
+ "regexp_string_case_fold|register|register_exception|rem|remember_mode|" +
+ "remove|remove_assoc|remove_assq|rename|replace|replace_first|" +
+ "replace_matched|repr|reset|reshape|reshape_1|reshape_2|reshape_3|rev|" +
+ "rev_append|rev_map|rev_map2|rewinddir|rgb|rhs_end|rhs_end_pos|rhs_start|" +
+ "rhs_start_pos|rindex|rindex_from|rlineto|rmdir|rmoveto|round_num|" +
+ "run_initializers|run_initializers_opt|scanf|search_backward|" +
+ "search_forward|seek_in|seek_out|select|self|self_init|send|sendto|set|" +
+ "set_all_formatter_output_functions|set_approx_printing|" +
+ "set_binary_mode_in|set_binary_mode_out|set_close_on_exec|" +
+ "set_close_on_exec|set_color|set_ellipsis_text|" +
+ "set_error_when_null_denominator|set_field|set_floating_precision|" +
+ "set_font|set_formatter_out_channel|set_formatter_output_functions|" +
+ "set_formatter_tag_functions|set_line_width|set_margin|set_mark_tags|" +
+ "set_max_boxes|set_max_indent|set_method|set_nonblock|set_nonblock|" +
+ "set_normalize_ratio|set_normalize_ratio_when_printing|set_print_tags|" +
+ "set_signal|set_state|set_tab|set_tag|set_tags|set_text_size|" +
+ "set_window_title|setgid|setgid|setitimer|setitimer|setsid|setsid|" +
+ "setsockopt|setsockopt|setsockopt_float|setsockopt_float|setsockopt_int|" +
+ "setsockopt_int|setsockopt_optint|setsockopt_optint|setuid|setuid|" +
+ "shift_left|shift_left|shift_left|shift_right|shift_right|shift_right|" +
+ "shift_right_logical|shift_right_logical|shift_right_logical|show_buckets|" +
+ "shutdown|shutdown|shutdown_connection|shutdown_connection|sigabrt|" +
+ "sigalrm|sigchld|sigcont|sigfpe|sighup|sigill|sigint|sigkill|sign_big_int|" +
+ "sign_num|signal|signal|sigpending|sigpending|sigpipe|sigprocmask|" +
+ "sigprocmask|sigprof|sigquit|sigsegv|sigstop|sigsuspend|sigsuspend|" +
+ "sigterm|sigtstp|sigttin|sigttou|sigusr1|sigusr2|sigvtalrm|sin|singleton|" +
+ "sinh|size|size|size_x|size_y|sleep|sleep|sleep|slice_left|slice_left|" +
+ "slice_left_1|slice_left_2|slice_right|slice_right|slice_right_1|" +
+ "slice_right_2|snd|socket|socket|socket|socketpair|socketpair|sort|sound|" +
+ "split|split_delim|sprintf|sprintf|sqrt|sqrt|sqrt_big_int|square_big_int|" +
+ "square_num|sscanf|stable_sort|stable_sort|stable_sort|stable_sort|stable_sort|" +
+ "stable_sort|stat|stat|stat|stat|stat|stats|stats|std_formatter|stdbuf|" +
+ "stderr|stderr|stderr|stdib|stdin|stdin|stdin|stdout|stdout|stdout|" +
+ "str_formatter|string|string_after|string_before|string_match|" +
+ "string_of_big_int|string_of_bool|string_of_float|string_of_format|" +
+ "string_of_inet_addr|string_of_inet_addr|string_of_int|string_of_num|" +
+ "string_partial_match|string_tag|sub|sub|sub_big_int|sub_left|sub_num|" +
+ "sub_right|subset|subset|substitute_first|substring|succ|succ|" +
+ "succ|succ|succ_big_int|succ_num|symbol_end|symbol_end_pos|symbol_start|" +
+ "symbol_start_pos|symlink|symlink|sync|synchronize|system|system|system|" +
+ "tag|take|tan|tanh|tcdrain|tcdrain|tcflow|tcflow|tcflush|tcflush|" +
+ "tcgetattr|tcgetattr|tcsendbreak|tcsendbreak|tcsetattr|tcsetattr|" +
+ "temp_file|text_size|time|time|time|timed_read|timed_write|times|times|" +
+ "tl|tl|tl|to_buffer|to_channel|to_float|to_hex|to_int|to_int32|to_list|" +
+ "to_list|to_list|to_nativeint|to_string|to_string|to_string|to_string|" +
+ "to_string|top|top|total_size|transfer|transp|truncate|truncate|truncate|" +
+ "truncate|truncate|truncate|try_lock|umask|umask|uncapitalize|uncapitalize|" +
+ "uncapitalize|union|union|unit_big_int|unlink|unlink|unlock|unmarshal|" +
+ "unsafe_blit|unsafe_fill|unsafe_get|unsafe_get|unsafe_set|unsafe_set|" +
+ "update|uppercase|uppercase|uppercase|uppercase|usage|utimes|utimes|wait|" +
+ "wait|wait|wait|wait_next_event|wait_pid|wait_read|wait_signal|" +
+ "wait_timed_read|wait_timed_write|wait_write|waitpid|white|" +
+ "widen|window_id|word_size|wrap|wrap_abort|write|yellow|yield|zero|zero_big_int|" +
+
+ "Arg|Arith_status|Array|Array1|Array2|Array3|ArrayLabels|Big_int|Bigarray|" +
+ "Buffer|Callback|CamlinternalOO|Char|Complex|Condition|Dbm|Digest|Dynlink|" +
+ "Event|Filename|Format|Gc|Genarray|Genlex|Graphics|GraphicsX11|Hashtbl|" +
+ "Int32|Int64|LargeFile|Lazy|Lexing|List|ListLabels|Make|Map|Marshal|" +
+ "MoreLabels|Mutex|Nativeint|Num|Obj|Oo|Parsing|Pervasives|Printexc|" +
+ "Printf|Queue|Random|Scanf|Scanning|Set|Sort|Stack|State|StdLabels|Str|" +
+ "Stream|String|StringLabels|Sys|Thread|ThreadUnix|Tk|Unix|UnixLabels|Weak"
+ );
+
+ var keywordMapper = this.createKeywordMapper({
+ "variable.language": "this",
+ "keyword": keywords,
+ "constant.language": builtinConstants,
+ "support.function": builtinFunctions
+ }, "identifier");
+
+ var decimalInteger = "(?:(?:[1-9]\\d*)|(?:0))";
+ var octInteger = "(?:0[oO]?[0-7]+)";
+ var hexInteger = "(?:0[xX][\\dA-Fa-f]+)";
+ var binInteger = "(?:0[bB][01]+)";
+ var integer = "(?:" + decimalInteger + "|" + octInteger + "|" + hexInteger + "|" + binInteger + ")";
+
+ var exponent = "(?:[eE][+-]?\\d+)";
+ var fraction = "(?:\\.\\d+)";
+ var intPart = "(?:\\d+)";
+ var pointFloat = "(?:(?:" + intPart + "?" + fraction + ")|(?:" + intPart + "\\.))";
+ var exponentFloat = "(?:(?:" + pointFloat + "|" + intPart + ")" + exponent + ")";
+ var floatNumber = "(?:" + exponentFloat + "|" + pointFloat + ")";
+
+ this.$rules = {
+ "start" : [
+ {
+ token : "comment",
+ regex : '\\(\\*.*?\\*\\)\\s*?$'
+ },
+ {
+ token : "comment",
+ merge : true,
+ regex : '\\(\\*.*',
+ next : "comment"
+ },
+ {
+ token : "string", // single line
+ regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
+ },
+ {
+ token : "string", // single char
+ regex : "'.'"
+ },
+ {
+ token : "string", // " string
+ merge : true,
+ regex : '"',
+ next : "qstring"
+ },
+ {
+ token : "constant.numeric", // imaginary
+ regex : "(?:" + floatNumber + "|\\d+)[jJ]\\b"
+ },
+ {
+ token : "constant.numeric", // float
+ regex : floatNumber
+ },
+ {
+ token : "constant.numeric", // integer
+ regex : integer + "\\b"
+ },
+ {
+ token : keywordMapper,
+ regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
+ },
+ {
+ token : "keyword.operator",
+ regex : "\\+\\.|\\-\\.|\\*\\.|\\/\\.|#|;;|\\+|\\-|\\*|\\*\\*\\/|\\/\\/|%|<<|>>|&|\\||\\^|~|<|>|<=|=>|==|!=|<>|<-|="
+ },
+ {
+ token : "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
+ merge : true,
+ regex : ".+"
+ }
+ ],
+
+ "qstring" : [
+ {
+ token : "string",
+ regex : '"',
+ next : "start"
+ }, {
+ token : "string",
+ merge : true,
+ regex : '.+'
+ }
+ ]
+ };
+};
+
+oop.inherits(OcamlHighlightRules, TextHighlightRules);
+
+exports.OcamlHighlightRules = OcamlHighlightRules;
+});
+
+ace.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;
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/mode-perl.js b/vendor/assets/javascripts/ace-src-noconflict/mode-perl.js
new file mode 100644
index 00000000000..d53a347ae85
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/mode-perl.js
@@ -0,0 +1,419 @@
+/* ***** 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 ***** */
+
+ace.define('ace/mode/perl', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/perl_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/mode/folding/cstyle'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var TextMode = require("./text").Mode;
+var Tokenizer = require("../tokenizer").Tokenizer;
+var PerlHighlightRules = require("./perl_highlight_rules").PerlHighlightRules;
+var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
+var Range = require("../range").Range;
+var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+
+var Mode = function() {
+ this.$tokenizer = new Tokenizer(new PerlHighlightRules().getRules());
+ this.$outdent = new MatchingBraceOutdent();
+ 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;
+
+ if (tokens.length && tokens[tokens.length-1].type == "comment") {
+ return indent;
+ }
+
+ 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;
+});
+
+ace.define('ace/mode/perl_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 PerlHighlightRules = function() {
+
+ var keywords = (
+ "base|constant|continue|else|elsif|for|foreach|format|goto|if|last|local|my|next|" +
+ "no|package|parent|redo|require|scalar|sub|unless|until|while|use|vars"
+ );
+
+ var buildinConstants = ("ARGV|ENV|INC|SIG");
+
+ var builtinFunctions = (
+ "getprotobynumber|getprotobyname|getservbyname|gethostbyaddr|" +
+ "gethostbyname|getservbyport|getnetbyaddr|getnetbyname|getsockname|" +
+ "getpeername|setpriority|getprotoent|setprotoent|getpriority|" +
+ "endprotoent|getservent|setservent|endservent|sethostent|socketpair|" +
+ "getsockopt|gethostent|endhostent|setsockopt|setnetent|quotemeta|" +
+ "localtime|prototype|getnetent|endnetent|rewinddir|wantarray|getpwuid|" +
+ "closedir|getlogin|readlink|endgrent|getgrgid|getgrnam|shmwrite|" +
+ "shutdown|readline|endpwent|setgrent|readpipe|formline|truncate|" +
+ "dbmclose|syswrite|setpwent|getpwnam|getgrent|getpwent|ucfirst|sysread|" +
+ "setpgrp|shmread|sysseek|sysopen|telldir|defined|opendir|connect|" +
+ "lcfirst|getppid|binmode|syscall|sprintf|getpgrp|readdir|seekdir|" +
+ "waitpid|reverse|unshift|symlink|dbmopen|semget|msgrcv|rename|listen|" +
+ "chroot|msgsnd|shmctl|accept|unpack|exists|fileno|shmget|system|" +
+ "unlink|printf|gmtime|msgctl|semctl|values|rindex|substr|splice|" +
+ "length|msgget|select|socket|return|caller|delete|alarm|ioctl|index|" +
+ "undef|lstat|times|srand|chown|fcntl|close|write|umask|rmdir|study|" +
+ "sleep|chomp|untie|print|utime|mkdir|atan2|split|crypt|flock|chmod|" +
+ "BEGIN|bless|chdir|semop|shift|reset|link|stat|chop|grep|fork|dump|" +
+ "join|open|tell|pipe|exit|glob|warn|each|bind|sort|pack|eval|push|" +
+ "keys|getc|kill|seek|sqrt|send|wait|rand|tied|read|time|exec|recv|" +
+ "eof|chr|int|ord|exp|pos|pop|sin|log|abs|oct|hex|tie|cos|vec|END|ref|" +
+ "map|die|uc|lc|do"
+ );
+
+ var keywordMapper = this.createKeywordMapper({
+ "keyword": keywords,
+ "constant.language": buildinConstants,
+ "support.function": builtinFunctions
+ }, "identifier");
+
+ // regexp must not have capturing parentheses. Use (?:) instead.
+ // regexps are ordered -> the first match is used
+
+ this.$rules = {
+ "start" : [
+ {
+ token : "comment",
+ regex : "#.*$"
+ }, {
+ token : "string.regexp",
+ regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"
+ }, {
+ token : "string", // single line
+ regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
+ }, {
+ token : "string", // multi line string start
+ merge : true,
+ regex : '["].*\\\\$',
+ next : "qqstring"
+ }, {
+ token : "string", // single line
+ regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
+ }, {
+ token : "string", // multi line string start
+ merge : true,
+ regex : "['].*\\\\$",
+ next : "qstring"
+ }, {
+ token : "constant.numeric", // hex
+ regex : "0x[0-9a-fA-F]+\\b"
+ }, {
+ 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 : "\\.\\.\\.|\\|\\|=|>>=|<<=|<=>|&&=|=>|!~|\\^=|&=|\\|=|\\.=|x=|%=|\\/=|\\*=|\\-=|\\+=|=~|\\*\\*|\\-\\-|\\.\\.|\\|\\||&&|\\+\\+|\\->|!=|==|>=|<=|>>|<<|,|=|\\?\\:|\\^|\\||x|%|\\/|\\*|<|&|\\\\|~|!|>|\\.|\\-|\\+|\\-C|\\-b|\\-S|\\-u|\\-t|\\-p|\\-l|\\-d|\\-f|\\-g|\\-s|\\-z|\\-k|\\-e|\\-O|\\-T|\\-B|\\-M|\\-A|\\-X|\\-W|\\-c|\\-R|\\-o|\\-x|\\-w|\\-r|\\b(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|xor)"
+ }, {
+ token : "lparen",
+ regex : "[[({]"
+ }, {
+ token : "rparen",
+ regex : "[\\])}]"
+ }, {
+ token : "text",
+ regex : "\\s+"
+ }
+ ],
+ "qqstring" : [
+ {
+ token : "string",
+ regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"',
+ next : "start"
+ }, {
+ token : "string",
+ merge : true,
+ regex : '.+'
+ }
+ ],
+ "qstring" : [
+ {
+ token : "string",
+ regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'",
+ next : "start"
+ }, {
+ token : "string",
+ merge : true,
+ regex : '.+'
+ }
+ ]
+ };
+};
+
+oop.inherits(PerlHighlightRules, TextHighlightRules);
+
+exports.PerlHighlightRules = PerlHighlightRules;
+});
+
+ace.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;
+});
+
+ace.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);
+
+ var range = session.getCommentFoldRange(row, i + match[0].length);
+ range.end.column -= 2;
+ return range;
+ }
+
+ if (foldStyle !== "markbeginend")
+ return;
+
+ var match = line.match(this.foldingStopMarker);
+ if (match) {
+ var i = match.index + match[0].length;
+
+ if (match[2]) {
+ var range = session.getCommentFoldRange(row, i);
+ range.end.column -= 2;
+ return range;
+ }
+
+ var end = {row: row, column: i};
+ var start = session.$findOpeningBracket(match[1], end);
+
+ if (!start)
+ return;
+
+ start.column++;
+ end.column--;
+
+ return Range.fromPoints(start, end);
+ }
+ };
+
+}).call(FoldMode.prototype);
+
+});
+
+ace.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;
+
+ // must return "" if there's no fold, to enable caching
+ 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);
+ };
+
+}).call(FoldMode.prototype);
+
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/mode-pgsql.js b/vendor/assets/javascripts/ace-src-noconflict/mode-pgsql.js
new file mode 100644
index 00000000000..2bc99ff9cad
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/mode-pgsql.js
@@ -0,0 +1,963 @@
+/* ***** 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 ***** */
+
+ace.define('ace/mode/pgsql', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/pgsql_highlight_rules', 'ace/range'], function(require, exports, module) {
+
+ var oop = require("../lib/oop");
+ var TextMode = require("../mode/text").Mode;
+ var Tokenizer = require("../tokenizer").Tokenizer;
+ var PgsqlHighlightRules = require("./pgsql_highlight_rules").PgsqlHighlightRules;
+ var Range = require("../range").Range;
+
+ var Mode = function() {
+ this.$tokenizer = new Tokenizer(new PgsqlHighlightRules().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, "--");
+ }
+ };
+
+
+ this.getNextLineIndent = function(state, line, tab) {
+ if (state == "start" || state == "keyword.statementEnd") {
+ return "";
+ } else {
+ return this.$getIndent(line); // Keep whatever indent the previous line has
+ }
+ }
+
+ }).call(Mode.prototype);
+
+ exports.Mode = Mode;
+});
+
+ace.define('ace/mode/pgsql_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules', 'ace/mode/perl_highlight_rules', 'ace/mode/python_highlight_rules'], function(require, exports, module) {
+
+var oop = require("../lib/oop");
+var lang = require("../lib/lang");
+var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
+var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+// Supporting perl and python for now -- both in pg core and ace
+var PerlHighlightRules = require("./perl_highlight_rules").PerlHighlightRules;
+var PythonHighlightRules = require("./python_highlight_rules").PythonHighlightRules;
+
+var PgsqlHighlightRules = function() {
+
+ // Keywords, functions, operators last updated for pg 9.1.
+ var keywords = (
+ "abort|absolute|abstime|access|aclitem|action|add|admin|after|aggregate|all|also|alter|always|" +
+ "analyse|analyze|and|any|anyarray|anyelement|anyenum|anynonarray|array|as|asc|assertion|" +
+ "assignment|asymmetric|at|attribute|authorization|backward|before|begin|between|bigint|" +
+ "binary|bit|bool|boolean|both|box|bpchar|by|bytea|cache|called|cascade|cascaded|case|cast|" +
+ "catalog|chain|char|character|characteristics|check|checkpoint|cid|cidr|circle|class|close|" +
+ "cluster|coalesce|collate|collation|column|comment|comments|commit|committed|concurrently|" +
+ "configuration|connection|constraint|constraints|content|continue|conversion|copy|cost|" +
+ "create|cross|cstring|csv|current|current_catalog|current_date|current_role|" +
+ "current_schema|current_time|current_timestamp|current_user|cursor|cycle|data|database|" +
+ "date|day|deallocate|dec|decimal|declare|default|defaults|deferrable|deferred|definer|delete|" +
+ "delimiter|delimiters|desc|dictionary|disable|discard|distinct|do|document|domain|double|" +
+ "drop|each|else|enable|encoding|encrypted|end|enum|escape|except|exclude|excluding|exclusive|" +
+ "execute|exists|explain|extension|external|extract|false|family|fdw_handler|fetch|first|" +
+ "float|float4|float8|following|for|force|foreign|forward|freeze|from|full|function|functions|" +
+ "global|grant|granted|greatest|group|gtsvector|handler|having|header|hold|hour|identity|if|" +
+ "ilike|immediate|immutable|implicit|in|including|increment|index|indexes|inet|inherit|" +
+ "inherits|initially|inline|inner|inout|input|insensitive|insert|instead|int|int2|int2vector|" +
+ "int4|int8|integer|internal|intersect|interval|into|invoker|is|isnull|isolation|join|key|label|" +
+ "language|language_handler|large|last|lc_collate|lc_ctype|leading|least|left|level|like|" +
+ "limit|line|listen|load|local|localtime|localtimestamp|location|lock|lseg|macaddr|mapping|" +
+ "match|maxvalue|minute|minvalue|mode|money|month|move|name|names|national|natural|nchar|next|no|" +
+ "none|not|nothing|notify|notnull|nowait|null|nullif|nulls|numeric|object|of|off|offset|oid|oids|" +
+ "oidvector|on|only|opaque|operator|option|options|or|order|out|outer|over|overlaps|overlay|" +
+ "owned|owner|parser|partial|partition|passing|password|path|pg_attribute|pg_auth_members|" +
+ "pg_authid|pg_class|pg_database|pg_node_tree|pg_proc|pg_type|placing|plans|point|polygon|" +
+ "position|preceding|precision|prepare|prepared|preserve|primary|prior|privileges|" +
+ "procedural|procedure|quote|range|read|real|reassign|recheck|record|recursive|ref|refcursor|" +
+ "references|regclass|regconfig|regdictionary|regoper|regoperator|regproc|regprocedure|" +
+ "regtype|reindex|relative|release|reltime|rename|repeatable|replace|replica|reset|restart|" +
+ "restrict|returning|returns|revoke|right|role|rollback|row|rows|rule|savepoint|schema|scroll|" +
+ "search|second|security|select|sequence|sequences|serializable|server|session|session_user|" +
+ "set|setof|share|show|similar|simple|smallint|smgr|some|stable|standalone|start|statement|" +
+ "statistics|stdin|stdout|storage|strict|strip|substring|symmetric|sysid|system|table|tables|" +
+ "tablespace|temp|template|temporary|text|then|tid|time|timestamp|timestamptz|timetz|" +
+ "tinterval|to|trailing|transaction|treat|trigger|trim|true|truncate|trusted|tsquery|tsvector|" +
+ "txid_snapshot|type|unbounded|uncommitted|unencrypted|union|unique|unknown|unlisten|" +
+ "unlogged|until|update|user|using|uuid|vacuum|valid|validate|validator|value|values|varbit|" +
+ "varchar|variadic|varying|verbose|version|view|void|volatile|when|where|whitespace|window|" +
+ "with|without|work|wrapper|write|xid|xml|xmlattributes|xmlconcat|xmlelement|xmlexists|" +
+ "xmlforest|xmlparse|xmlpi|xmlroot|xmlserialize|year|yes|zone"
+ );
+
+
+ var builtinFunctions = (
+ "RI_FKey_cascade_del|RI_FKey_cascade_upd|RI_FKey_check_ins|RI_FKey_check_upd|" +
+ "RI_FKey_noaction_del|RI_FKey_noaction_upd|RI_FKey_restrict_del|RI_FKey_restrict_upd|" +
+ "RI_FKey_setdefault_del|RI_FKey_setdefault_upd|RI_FKey_setnull_del|" +
+ "RI_FKey_setnull_upd|abbrev|abs|abstime|abstimeeq|abstimege|abstimegt|abstimein|abstimele|" +
+ "abstimelt|abstimene|abstimeout|abstimerecv|abstimesend|aclcontains|aclexplode|aclinsert|" +
+ "aclitemeq|aclitemin|aclitemout|aclremove|acos|age|any_in|any_out|anyarray_in|anyarray_out|" +
+ "anyarray_recv|anyarray_send|anyelement_in|anyelement_out|anyenum_in|anyenum_out|" +
+ "anynonarray_in|anynonarray_out|anytextcat|area|areajoinsel|areasel|array_agg|" +
+ "array_agg_finalfn|array_agg_transfn|array_append|array_cat|array_dims|array_eq|" +
+ "array_fill|array_ge|array_gt|array_in|array_larger|array_le|array_length|array_lower|" +
+ "array_lt|array_ndims|array_ne|array_out|array_prepend|array_recv|array_send|" +
+ "array_smaller|array_to_string|array_upper|arraycontained|arraycontains|arrayoverlap|" +
+ "ascii|ascii_to_mic|ascii_to_utf8|asin|atan|atan2|avg|big5_to_euc_tw|big5_to_mic|" +
+ "big5_to_utf8|bit_and|bit_in|bit_length|bit_or|bit_out|bit_recv|bit_send|bitand|bitcat|" +
+ "bitcmp|biteq|bitge|bitgt|bitle|bitlt|bitne|bitnot|bitor|bitshiftleft|bitshiftright|" +
+ "bittypmodin|bittypmodout|bitxor|bool|bool_and|bool_or|booland_statefunc|booleq|boolge|" +
+ "boolgt|boolin|boolle|boollt|boolne|boolor_statefunc|boolout|boolrecv|boolsend|box|" +
+ "box_above|box_above_eq|box_add|box_below|box_below_eq|box_center|box_contain|" +
+ "box_contain_pt|box_contained|box_distance|box_div|box_eq|box_ge|box_gt|box_in|" +
+ "box_intersect|box_le|box_left|box_lt|box_mul|box_out|box_overabove|box_overbelow|" +
+ "box_overlap|box_overleft|box_overright|box_recv|box_right|box_same|box_send|box_sub|" +
+ "bpchar_larger|bpchar_pattern_ge|bpchar_pattern_gt|bpchar_pattern_le|" +
+ "bpchar_pattern_lt|bpchar_smaller|bpcharcmp|bpchareq|bpcharge|bpchargt|bpchariclike|" +
+ "bpcharicnlike|bpcharicregexeq|bpcharicregexne|bpcharin|bpcharle|bpcharlike|bpcharlt|" +
+ "bpcharne|bpcharnlike|bpcharout|bpcharrecv|bpcharregexeq|bpcharregexne|bpcharsend|" +
+ "bpchartypmodin|bpchartypmodout|broadcast|btabstimecmp|btarraycmp|btbeginscan|btboolcmp|" +
+ "btbpchar_pattern_cmp|btbuild|btbuildempty|btbulkdelete|btcharcmp|btcostestimate|" +
+ "btendscan|btfloat48cmp|btfloat4cmp|btfloat84cmp|btfloat8cmp|btgetbitmap|btgettuple|" +
+ "btinsert|btint24cmp|btint28cmp|btint2cmp|btint42cmp|btint48cmp|btint4cmp|btint82cmp|" +
+ "btint84cmp|btint8cmp|btmarkpos|btnamecmp|btoidcmp|btoidvectorcmp|btoptions|btrecordcmp|" +
+ "btreltimecmp|btrescan|btrestrpos|btrim|bttext_pattern_cmp|bttextcmp|bttidcmp|" +
+ "bttintervalcmp|btvacuumcleanup|byteacat|byteacmp|byteaeq|byteage|byteagt|byteain|byteale|" +
+ "bytealike|bytealt|byteane|byteanlike|byteaout|bytearecv|byteasend|cash_cmp|cash_div_cash|" +
+ "cash_div_flt4|cash_div_flt8|cash_div_int2|cash_div_int4|cash_eq|cash_ge|cash_gt|cash_in|" +
+ "cash_le|cash_lt|cash_mi|cash_mul_flt4|cash_mul_flt8|cash_mul_int2|cash_mul_int4|cash_ne|" +
+ "cash_out|cash_pl|cash_recv|cash_send|cash_words|cashlarger|cashsmaller|cbrt|ceil|ceiling|" +
+ "center|char|char_length|character_length|chareq|charge|chargt|charin|charle|charlt|charne|" +
+ "charout|charrecv|charsend|chr|cideq|cidin|cidout|cidr|cidr_in|cidr_out|cidr_recv|cidr_send|" +
+ "cidrecv|cidsend|circle|circle_above|circle_add_pt|circle_below|circle_center|" +
+ "circle_contain|circle_contain_pt|circle_contained|circle_distance|circle_div_pt|" +
+ "circle_eq|circle_ge|circle_gt|circle_in|circle_le|circle_left|circle_lt|circle_mul_pt|" +
+ "circle_ne|circle_out|circle_overabove|circle_overbelow|circle_overlap|circle_overleft|" +
+ "circle_overright|circle_recv|circle_right|circle_same|circle_send|circle_sub_pt|" +
+ "clock_timestamp|close_lb|close_ls|close_lseg|close_pb|close_pl|close_ps|close_sb|" +
+ "close_sl|col_description|concat|concat_ws|contjoinsel|contsel|convert|convert_from|" +
+ "convert_to|corr|cos|cot|count|covar_pop|covar_samp|cstring_in|cstring_out|cstring_recv|" +
+ "cstring_send|cume_dist|current_database|current_query|current_schema|current_schemas|" +
+ "current_setting|current_user|currtid|currtid2|currval|cursor_to_xml|" +
+ "cursor_to_xmlschema|database_to_xml|database_to_xml_and_xmlschema|" +
+ "database_to_xmlschema|date|date_cmp|date_cmp_timestamp|date_cmp_timestamptz|date_eq|" +
+ "date_eq_timestamp|date_eq_timestamptz|date_ge|date_ge_timestamp|date_ge_timestamptz|" +
+ "date_gt|date_gt_timestamp|date_gt_timestamptz|date_in|date_larger|date_le|" +
+ "date_le_timestamp|date_le_timestamptz|date_lt|date_lt_timestamp|date_lt_timestamptz|" +
+ "date_mi|date_mi_interval|date_mii|date_ne|date_ne_timestamp|date_ne_timestamptz|" +
+ "date_out|date_part|date_pl_interval|date_pli|date_recv|date_send|date_smaller|" +
+ "date_trunc|datetime_pl|datetimetz_pl|dcbrt|decode|degrees|dense_rank|dexp|diagonal|" +
+ "diameter|dispell_init|dispell_lexize|dist_cpoly|dist_lb|dist_pb|dist_pc|dist_pl|" +
+ "dist_ppath|dist_ps|dist_sb|dist_sl|div|dlog1|dlog10|domain_in|domain_recv|dpow|dround|" +
+ "dsimple_init|dsimple_lexize|dsnowball_init|dsnowball_lexize|dsqrt|dsynonym_init|" +
+ "dsynonym_lexize|dtrunc|encode|enum_cmp|enum_eq|enum_first|enum_ge|enum_gt|enum_in|" +
+ "enum_larger|enum_last|enum_le|enum_lt|enum_ne|enum_out|enum_range|enum_recv|enum_send|" +
+ "enum_smaller|eqjoinsel|eqsel|euc_cn_to_mic|euc_cn_to_utf8|" +
+ "euc_jis_2004_to_shift_jis_2004|euc_jis_2004_to_utf8|euc_jp_to_mic|euc_jp_to_sjis|" +
+ "euc_jp_to_utf8|euc_kr_to_mic|euc_kr_to_utf8|euc_tw_to_big5|euc_tw_to_mic|" +
+ "euc_tw_to_utf8|every|exp|factorial|family|fdw_handler_in|fdw_handler_out|first_value|" +
+ "float4|float48div|float48eq|float48ge|float48gt|float48le|float48lt|float48mi|float48mul|" +
+ "float48ne|float48pl|float4_accum|float4abs|float4div|float4eq|float4ge|float4gt|float4in|" +
+ "float4larger|float4le|float4lt|float4mi|float4mul|float4ne|float4out|float4pl|float4recv|" +
+ "float4send|float4smaller|float4um|float4up|float8|float84div|float84eq|float84ge|" +
+ "float84gt|float84le|float84lt|float84mi|float84mul|float84ne|float84pl|float8_accum|" +
+ "float8_avg|float8_corr|float8_covar_pop|float8_covar_samp|float8_regr_accum|" +
+ "float8_regr_avgx|float8_regr_avgy|float8_regr_intercept|float8_regr_r2|" +
+ "float8_regr_slope|float8_regr_sxx|float8_regr_sxy|float8_regr_syy|float8_stddev_pop|" +
+ "float8_stddev_samp|float8_var_pop|float8_var_samp|float8abs|float8div|float8eq|" +
+ "float8ge|float8gt|float8in|float8larger|float8le|float8lt|float8mi|float8mul|float8ne|" +
+ "float8out|float8pl|float8recv|float8send|float8smaller|float8um|float8up|floor|" +
+ "flt4_mul_cash|flt8_mul_cash|fmgr_c_validator|fmgr_internal_validator|" +
+ "fmgr_sql_validator|format|format_type|gb18030_to_utf8|gbk_to_utf8|generate_series|" +
+ "generate_subscripts|get_bit|get_byte|get_current_ts_config|getdatabaseencoding|" +
+ "getpgusername|gin_cmp_prefix|gin_cmp_tslexeme|gin_extract_tsquery|" +
+ "gin_extract_tsvector|gin_tsquery_consistent|ginarrayconsistent|ginarrayextract|" +
+ "ginbeginscan|ginbuild|ginbuildempty|ginbulkdelete|gincostestimate|ginendscan|" +
+ "gingetbitmap|gininsert|ginmarkpos|ginoptions|ginqueryarrayextract|ginrescan|" +
+ "ginrestrpos|ginvacuumcleanup|gist_box_compress|gist_box_consistent|" +
+ "gist_box_decompress|gist_box_penalty|gist_box_picksplit|gist_box_same|gist_box_union|" +
+ "gist_circle_compress|gist_circle_consistent|gist_point_compress|" +
+ "gist_point_consistent|gist_point_distance|gist_poly_compress|gist_poly_consistent|" +
+ "gistbeginscan|gistbuild|gistbuildempty|gistbulkdelete|gistcostestimate|gistendscan|" +
+ "gistgetbitmap|gistgettuple|gistinsert|gistmarkpos|gistoptions|gistrescan|gistrestrpos|" +
+ "gistvacuumcleanup|gtsquery_compress|gtsquery_consistent|gtsquery_decompress|" +
+ "gtsquery_penalty|gtsquery_picksplit|gtsquery_same|gtsquery_union|gtsvector_compress|" +
+ "gtsvector_consistent|gtsvector_decompress|gtsvector_penalty|gtsvector_picksplit|" +
+ "gtsvector_same|gtsvector_union|gtsvectorin|gtsvectorout|has_any_column_privilege|" +
+ "has_column_privilege|has_database_privilege|has_foreign_data_wrapper_privilege|" +
+ "has_function_privilege|has_language_privilege|has_schema_privilege|" +
+ "has_sequence_privilege|has_server_privilege|has_table_privilege|" +
+ "has_tablespace_privilege|hash_aclitem|hash_array|hash_numeric|hashbeginscan|" +
+ "hashbpchar|hashbuild|hashbuildempty|hashbulkdelete|hashchar|hashcostestimate|" +
+ "hashendscan|hashenum|hashfloat4|hashfloat8|hashgetbitmap|hashgettuple|hashinet|" +
+ "hashinsert|hashint2|hashint2vector|hashint4|hashint8|hashmacaddr|hashmarkpos|hashname|" +
+ "hashoid|hashoidvector|hashoptions|hashrescan|hashrestrpos|hashtext|hashvacuumcleanup|" +
+ "hashvarlena|height|host|hostmask|iclikejoinsel|iclikesel|icnlikejoinsel|icnlikesel|" +
+ "icregexeqjoinsel|icregexeqsel|icregexnejoinsel|icregexnesel|inet_client_addr|" +
+ "inet_client_port|inet_in|inet_out|inet_recv|inet_send|inet_server_addr|" +
+ "inet_server_port|inetand|inetmi|inetmi_int8|inetnot|inetor|inetpl|initcap|int2|int24div|" +
+ "int24eq|int24ge|int24gt|int24le|int24lt|int24mi|int24mul|int24ne|int24pl|int28div|int28eq|" +
+ "int28ge|int28gt|int28le|int28lt|int28mi|int28mul|int28ne|int28pl|int2_accum|" +
+ "int2_avg_accum|int2_mul_cash|int2_sum|int2abs|int2and|int2div|int2eq|int2ge|int2gt|int2in|" +
+ "int2larger|int2le|int2lt|int2mi|int2mod|int2mul|int2ne|int2not|int2or|int2out|int2pl|" +
+ "int2recv|int2send|int2shl|int2shr|int2smaller|int2um|int2up|int2vectoreq|int2vectorin|" +
+ "int2vectorout|int2vectorrecv|int2vectorsend|int2xor|int4|int42div|int42eq|int42ge|" +
+ "int42gt|int42le|int42lt|int42mi|int42mul|int42ne|int42pl|int48div|int48eq|int48ge|int48gt|" +
+ "int48le|int48lt|int48mi|int48mul|int48ne|int48pl|int4_accum|int4_avg_accum|int4_mul_cash|" +
+ "int4_sum|int4abs|int4and|int4div|int4eq|int4ge|int4gt|int4in|int4inc|int4larger|int4le|" +
+ "int4lt|int4mi|int4mod|int4mul|int4ne|int4not|int4or|int4out|int4pl|int4recv|int4send|" +
+ "int4shl|int4shr|int4smaller|int4um|int4up|int4xor|int8|int82div|int82eq|int82ge|int82gt|" +
+ "int82le|int82lt|int82mi|int82mul|int82ne|int82pl|int84div|int84eq|int84ge|int84gt|int84le|" +
+ "int84lt|int84mi|int84mul|int84ne|int84pl|int8_accum|int8_avg|int8_avg_accum|int8_sum|" +
+ "int8abs|int8and|int8div|int8eq|int8ge|int8gt|int8in|int8inc|int8inc_any|" +
+ "int8inc_float8_float8|int8larger|int8le|int8lt|int8mi|int8mod|int8mul|int8ne|int8not|" +
+ "int8or|int8out|int8pl|int8pl_inet|int8recv|int8send|int8shl|int8shr|int8smaller|int8um|" +
+ "int8up|int8xor|integer_pl_date|inter_lb|inter_sb|inter_sl|internal_in|internal_out|" +
+ "interval_accum|interval_avg|interval_cmp|interval_div|interval_eq|interval_ge|" +
+ "interval_gt|interval_hash|interval_in|interval_larger|interval_le|interval_lt|" +
+ "interval_mi|interval_mul|interval_ne|interval_out|interval_pl|interval_pl_date|" +
+ "interval_pl_time|interval_pl_timestamp|interval_pl_timestamptz|interval_pl_timetz|" +
+ "interval_recv|interval_send|interval_smaller|interval_um|intervaltypmodin|" +
+ "intervaltypmodout|intinterval|isclosed|isfinite|ishorizontal|iso8859_1_to_utf8|" +
+ "iso8859_to_utf8|iso_to_koi8r|iso_to_mic|iso_to_win1251|iso_to_win866|isopen|isparallel|" +
+ "isperp|isvertical|johab_to_utf8|justify_days|justify_hours|justify_interval|" +
+ "koi8r_to_iso|koi8r_to_mic|koi8r_to_utf8|koi8r_to_win1251|koi8r_to_win866|" +
+ "koi8u_to_utf8|lag|language_handler_in|language_handler_out|last_value|lastval|" +
+ "latin1_to_mic|latin2_to_mic|latin2_to_win1250|latin3_to_mic|latin4_to_mic|lead|left|" +
+ "length|like|like_escape|likejoinsel|likesel|line|line_distance|line_eq|line_horizontal|" +
+ "line_in|line_interpt|line_intersect|line_out|line_parallel|line_perp|line_recv|" +
+ "line_send|line_vertical|ln|lo_close|lo_creat|lo_create|lo_export|lo_import|lo_lseek|" +
+ "lo_open|lo_tell|lo_truncate|lo_unlink|log|loread|lower|lowrite|lpad|lseg|lseg_center|" +
+ "lseg_distance|lseg_eq|lseg_ge|lseg_gt|lseg_horizontal|lseg_in|lseg_interpt|" +
+ "lseg_intersect|lseg_le|lseg_length|lseg_lt|lseg_ne|lseg_out|lseg_parallel|lseg_perp|" +
+ "lseg_recv|lseg_send|lseg_vertical|ltrim|macaddr_cmp|macaddr_eq|macaddr_ge|macaddr_gt|" +
+ "macaddr_in|macaddr_le|macaddr_lt|macaddr_ne|macaddr_out|macaddr_recv|macaddr_send|" +
+ "makeaclitem|masklen|max|md5|mic_to_ascii|mic_to_big5|mic_to_euc_cn|mic_to_euc_jp|" +
+ "mic_to_euc_kr|mic_to_euc_tw|mic_to_iso|mic_to_koi8r|mic_to_latin1|mic_to_latin2|" +
+ "mic_to_latin3|mic_to_latin4|mic_to_sjis|mic_to_win1250|mic_to_win1251|mic_to_win866|" +
+ "min|mktinterval|mod|money|mul_d_interval|name|nameeq|namege|namegt|nameiclike|nameicnlike|" +
+ "nameicregexeq|nameicregexne|namein|namele|namelike|namelt|namene|namenlike|nameout|" +
+ "namerecv|nameregexeq|nameregexne|namesend|neqjoinsel|neqsel|netmask|network|network_cmp|" +
+ "network_eq|network_ge|network_gt|network_le|network_lt|network_ne|network_sub|" +
+ "network_subeq|network_sup|network_supeq|nextval|nlikejoinsel|nlikesel|notlike|now|" +
+ "npoints|nth_value|ntile|numeric_abs|numeric_accum|numeric_add|numeric_avg|" +
+ "numeric_avg_accum|numeric_cmp|numeric_div|numeric_div_trunc|numeric_eq|numeric_exp|" +
+ "numeric_fac|numeric_ge|numeric_gt|numeric_in|numeric_inc|numeric_larger|numeric_le|" +
+ "numeric_ln|numeric_log|numeric_lt|numeric_mod|numeric_mul|numeric_ne|numeric_out|" +
+ "numeric_power|numeric_recv|numeric_send|numeric_smaller|numeric_sqrt|" +
+ "numeric_stddev_pop|numeric_stddev_samp|numeric_sub|numeric_uminus|numeric_uplus|" +
+ "numeric_var_pop|numeric_var_samp|numerictypmodin|numerictypmodout|numnode|" +
+ "obj_description|octet_length|oid|oideq|oidge|oidgt|oidin|oidlarger|oidle|oidlt|oidne|oidout|" +
+ "oidrecv|oidsend|oidsmaller|oidvectoreq|oidvectorge|oidvectorgt|oidvectorin|oidvectorle|" +
+ "oidvectorlt|oidvectorne|oidvectorout|oidvectorrecv|oidvectorsend|oidvectortypes|on_pb|" +
+ "on_pl|on_ppath|on_ps|on_sb|on_sl|opaque_in|opaque_out|overlaps|overlay|path|path_add|" +
+ "path_add_pt|path_center|path_contain_pt|path_distance|path_div_pt|path_in|path_inter|" +
+ "path_length|path_mul_pt|path_n_eq|path_n_ge|path_n_gt|path_n_le|path_n_lt|path_npoints|" +
+ "path_out|path_recv|path_send|path_sub_pt|pclose|percent_rank|pg_advisory_lock|" +
+ "pg_advisory_lock_shared|pg_advisory_unlock|pg_advisory_unlock_all|" +
+ "pg_advisory_unlock_shared|pg_advisory_xact_lock|pg_advisory_xact_lock_shared|" +
+ "pg_available_extension_versions|pg_available_extensions|pg_backend_pid|" +
+ "pg_cancel_backend|pg_char_to_encoding|pg_client_encoding|pg_collation_is_visible|" +
+ "pg_column_size|pg_conf_load_time|pg_conversion_is_visible|pg_create_restore_point|" +
+ "pg_current_xlog_insert_location|pg_current_xlog_location|pg_cursor|pg_database_size|" +
+ "pg_describe_object|pg_encoding_max_length|pg_encoding_to_char|" +
+ "pg_extension_config_dump|pg_extension_update_paths|pg_function_is_visible|" +
+ "pg_get_constraintdef|pg_get_expr|pg_get_function_arguments|" +
+ "pg_get_function_identity_arguments|pg_get_function_result|pg_get_functiondef|" +
+ "pg_get_indexdef|pg_get_keywords|pg_get_ruledef|pg_get_serial_sequence|" +
+ "pg_get_triggerdef|pg_get_userbyid|pg_get_viewdef|pg_has_role|pg_indexes_size|" +
+ "pg_is_in_recovery|pg_is_other_temp_schema|pg_is_xlog_replay_paused|" +
+ "pg_last_xact_replay_timestamp|pg_last_xlog_receive_location|" +
+ "pg_last_xlog_replay_location|pg_listening_channels|pg_lock_status|pg_ls_dir|" +
+ "pg_my_temp_schema|pg_node_tree_in|pg_node_tree_out|pg_node_tree_recv|" +
+ "pg_node_tree_send|pg_notify|pg_opclass_is_visible|pg_operator_is_visible|" +
+ "pg_options_to_table|pg_postmaster_start_time|pg_prepared_statement|pg_prepared_xact|" +
+ "pg_read_binary_file|pg_read_file|pg_relation_filenode|pg_relation_filepath|" +
+ "pg_relation_size|pg_reload_conf|pg_rotate_logfile|pg_sequence_parameters|" +
+ "pg_show_all_settings|pg_size_pretty|pg_sleep|pg_start_backup|pg_stat_clear_snapshot|" +
+ "pg_stat_file|pg_stat_get_activity|pg_stat_get_analyze_count|" +
+ "pg_stat_get_autoanalyze_count|pg_stat_get_autovacuum_count|" +
+ "pg_stat_get_backend_activity|pg_stat_get_backend_activity_start|" +
+ "pg_stat_get_backend_client_addr|pg_stat_get_backend_client_port|" +
+ "pg_stat_get_backend_dbid|pg_stat_get_backend_idset|pg_stat_get_backend_pid|" +
+ "pg_stat_get_backend_start|pg_stat_get_backend_userid|pg_stat_get_backend_waiting|" +
+ "pg_stat_get_backend_xact_start|pg_stat_get_bgwriter_buf_written_checkpoints|" +
+ "pg_stat_get_bgwriter_buf_written_clean|pg_stat_get_bgwriter_maxwritten_clean|" +
+ "pg_stat_get_bgwriter_requested_checkpoints|pg_stat_get_bgwriter_stat_reset_time|" +
+ "pg_stat_get_bgwriter_timed_checkpoints|pg_stat_get_blocks_fetched|" +
+ "pg_stat_get_blocks_hit|pg_stat_get_buf_alloc|pg_stat_get_buf_fsync_backend|" +
+ "pg_stat_get_buf_written_backend|pg_stat_get_db_blocks_fetched|" +
+ "pg_stat_get_db_blocks_hit|pg_stat_get_db_conflict_all|" +
+ "pg_stat_get_db_conflict_bufferpin|pg_stat_get_db_conflict_lock|" +
+ "pg_stat_get_db_conflict_snapshot|pg_stat_get_db_conflict_startup_deadlock|" +
+ "pg_stat_get_db_conflict_tablespace|pg_stat_get_db_numbackends|" +
+ "pg_stat_get_db_stat_reset_time|pg_stat_get_db_tuples_deleted|" +
+ "pg_stat_get_db_tuples_fetched|pg_stat_get_db_tuples_inserted|" +
+ "pg_stat_get_db_tuples_returned|pg_stat_get_db_tuples_updated|" +
+ "pg_stat_get_db_xact_commit|pg_stat_get_db_xact_rollback|pg_stat_get_dead_tuples|" +
+ "pg_stat_get_function_calls|pg_stat_get_function_self_time|" +
+ "pg_stat_get_function_time|pg_stat_get_last_analyze_time|" +
+ "pg_stat_get_last_autoanalyze_time|pg_stat_get_last_autovacuum_time|" +
+ "pg_stat_get_last_vacuum_time|pg_stat_get_live_tuples|pg_stat_get_numscans|" +
+ "pg_stat_get_tuples_deleted|pg_stat_get_tuples_fetched|" +
+ "pg_stat_get_tuples_hot_updated|pg_stat_get_tuples_inserted|" +
+ "pg_stat_get_tuples_returned|pg_stat_get_tuples_updated|pg_stat_get_vacuum_count|" +
+ "pg_stat_get_wal_senders|pg_stat_get_xact_blocks_fetched|" +
+ "pg_stat_get_xact_blocks_hit|pg_stat_get_xact_function_calls|" +
+ "pg_stat_get_xact_function_self_time|pg_stat_get_xact_function_time|" +
+ "pg_stat_get_xact_numscans|pg_stat_get_xact_tuples_deleted|" +
+ "pg_stat_get_xact_tuples_fetched|pg_stat_get_xact_tuples_hot_updated|" +
+ "pg_stat_get_xact_tuples_inserted|pg_stat_get_xact_tuples_returned|" +
+ "pg_stat_get_xact_tuples_updated|pg_stat_reset|pg_stat_reset_shared|" +
+ "pg_stat_reset_single_function_counters|pg_stat_reset_single_table_counters|" +
+ "pg_stop_backup|pg_switch_xlog|pg_table_is_visible|pg_table_size|" +
+ "pg_tablespace_databases|pg_tablespace_size|pg_terminate_backend|pg_timezone_abbrevs|" +
+ "pg_timezone_names|pg_total_relation_size|pg_try_advisory_lock|" +
+ "pg_try_advisory_lock_shared|pg_try_advisory_xact_lock|" +
+ "pg_try_advisory_xact_lock_shared|pg_ts_config_is_visible|pg_ts_dict_is_visible|" +
+ "pg_ts_parser_is_visible|pg_ts_template_is_visible|pg_type_is_visible|pg_typeof|" +
+ "pg_xlog_replay_pause|pg_xlog_replay_resume|pg_xlogfile_name|pg_xlogfile_name_offset|" +
+ "pi|plainto_tsquery|plpgsql_call_handler|plpgsql_inline_handler|plpgsql_validator|" +
+ "point|point_above|point_add|point_below|point_distance|point_div|point_eq|point_horiz|" +
+ "point_in|point_left|point_mul|point_ne|point_out|point_recv|point_right|point_send|" +
+ "point_sub|point_vert|poly_above|poly_below|poly_center|poly_contain|poly_contain_pt|" +
+ "poly_contained|poly_distance|poly_in|poly_left|poly_npoints|poly_out|poly_overabove|" +
+ "poly_overbelow|poly_overlap|poly_overleft|poly_overright|poly_recv|poly_right|" +
+ "poly_same|poly_send|polygon|popen|position|positionjoinsel|positionsel|" +
+ "postgresql_fdw_validator|pow|power|prsd_end|prsd_headline|prsd_lextype|prsd_nexttoken|" +
+ "prsd_start|pt_contained_circle|pt_contained_poly|query_to_xml|" +
+ "query_to_xml_and_xmlschema|query_to_xmlschema|querytree|quote_ident|quote_literal|" +
+ "quote_nullable|radians|radius|random|rank|record_eq|record_ge|record_gt|record_in|" +
+ "record_le|record_lt|record_ne|record_out|record_recv|record_send|regclass|regclassin|" +
+ "regclassout|regclassrecv|regclasssend|regconfigin|regconfigout|regconfigrecv|" +
+ "regconfigsend|regdictionaryin|regdictionaryout|regdictionaryrecv|regdictionarysend|" +
+ "regexeqjoinsel|regexeqsel|regexnejoinsel|regexnesel|regexp_matches|regexp_replace|" +
+ "regexp_split_to_array|regexp_split_to_table|regoperatorin|regoperatorout|" +
+ "regoperatorrecv|regoperatorsend|regoperin|regoperout|regoperrecv|regopersend|" +
+ "regprocedurein|regprocedureout|regprocedurerecv|regproceduresend|regprocin|regprocout|" +
+ "regprocrecv|regprocsend|regr_avgx|regr_avgy|regr_count|regr_intercept|regr_r2|" +
+ "regr_slope|regr_sxx|regr_sxy|regr_syy|regtypein|regtypeout|regtyperecv|regtypesend|" +
+ "reltime|reltimeeq|reltimege|reltimegt|reltimein|reltimele|reltimelt|reltimene|reltimeout|" +
+ "reltimerecv|reltimesend|repeat|replace|reverse|right|round|row_number|rpad|rtrim|" +
+ "scalargtjoinsel|scalargtsel|scalarltjoinsel|scalarltsel|schema_to_xml|" +
+ "schema_to_xml_and_xmlschema|schema_to_xmlschema|session_user|set_bit|set_byte|" +
+ "set_config|set_masklen|setseed|setval|setweight|shell_in|shell_out|" +
+ "shift_jis_2004_to_euc_jis_2004|shift_jis_2004_to_utf8|shobj_description|sign|" +
+ "similar_escape|sin|sjis_to_euc_jp|sjis_to_mic|sjis_to_utf8|slope|smgreq|smgrin|smgrne|" +
+ "smgrout|split_part|sqrt|statement_timestamp|stddev|stddev_pop|stddev_samp|string_agg|" +
+ "string_agg_finalfn|string_agg_transfn|string_to_array|strip|strpos|substr|substring|sum|" +
+ "suppress_redundant_updates_trigger|table_to_xml|table_to_xml_and_xmlschema|" +
+ "table_to_xmlschema|tan|text|text_ge|text_gt|text_larger|text_le|text_lt|text_pattern_ge|" +
+ "text_pattern_gt|text_pattern_le|text_pattern_lt|text_smaller|textanycat|textcat|texteq|" +
+ "texticlike|texticnlike|texticregexeq|texticregexne|textin|textlen|textlike|textne|" +
+ "textnlike|textout|textrecv|textregexeq|textregexne|textsend|thesaurus_init|" +
+ "thesaurus_lexize|tideq|tidge|tidgt|tidin|tidlarger|tidle|tidlt|tidne|tidout|tidrecv|tidsend|" +
+ "tidsmaller|time_cmp|time_eq|time_ge|time_gt|time_hash|time_in|time_larger|time_le|time_lt|" +
+ "time_mi_interval|time_mi_time|time_ne|time_out|time_pl_interval|time_recv|time_send|" +
+ "time_smaller|timedate_pl|timemi|timenow|timeofday|timepl|timestamp_cmp|" +
+ "timestamp_cmp_date|timestamp_cmp_timestamptz|timestamp_eq|timestamp_eq_date|" +
+ "timestamp_eq_timestamptz|timestamp_ge|timestamp_ge_date|timestamp_ge_timestamptz|" +
+ "timestamp_gt|timestamp_gt_date|timestamp_gt_timestamptz|timestamp_hash|timestamp_in|" +
+ "timestamp_larger|timestamp_le|timestamp_le_date|timestamp_le_timestamptz|" +
+ "timestamp_lt|timestamp_lt_date|timestamp_lt_timestamptz|timestamp_mi|" +
+ "timestamp_mi_interval|timestamp_ne|timestamp_ne_date|timestamp_ne_timestamptz|" +
+ "timestamp_out|timestamp_pl_interval|timestamp_recv|timestamp_send|timestamp_smaller|" +
+ "timestamptypmodin|timestamptypmodout|timestamptz_cmp|timestamptz_cmp_date|" +
+ "timestamptz_cmp_timestamp|timestamptz_eq|timestamptz_eq_date|" +
+ "timestamptz_eq_timestamp|timestamptz_ge|timestamptz_ge_date|" +
+ "timestamptz_ge_timestamp|timestamptz_gt|timestamptz_gt_date|" +
+ "timestamptz_gt_timestamp|timestamptz_in|timestamptz_larger|timestamptz_le|" +
+ "timestamptz_le_date|timestamptz_le_timestamp|timestamptz_lt|timestamptz_lt_date|" +
+ "timestamptz_lt_timestamp|timestamptz_mi|timestamptz_mi_interval|timestamptz_ne|" +
+ "timestamptz_ne_date|timestamptz_ne_timestamp|timestamptz_out|" +
+ "timestamptz_pl_interval|timestamptz_recv|timestamptz_send|timestamptz_smaller|" +
+ "timestamptztypmodin|timestamptztypmodout|timetypmodin|timetypmodout|timetz_cmp|" +
+ "timetz_eq|timetz_ge|timetz_gt|timetz_hash|timetz_in|timetz_larger|timetz_le|timetz_lt|" +
+ "timetz_mi_interval|timetz_ne|timetz_out|timetz_pl_interval|timetz_recv|timetz_send|" +
+ "timetz_smaller|timetzdate_pl|timetztypmodin|timetztypmodout|timezone|tinterval|" +
+ "tintervalct|tintervalend|tintervaleq|tintervalge|tintervalgt|tintervalin|tintervalle|" +
+ "tintervalleneq|tintervallenge|tintervallengt|tintervallenle|tintervallenlt|" +
+ "tintervallenne|tintervallt|tintervalne|tintervalout|tintervalov|tintervalrecv|" +
+ "tintervalrel|tintervalsame|tintervalsend|tintervalstart|to_ascii|to_char|to_date|to_hex|" +
+ "to_number|to_timestamp|to_tsquery|to_tsvector|transaction_timestamp|translate|" +
+ "trigger_in|trigger_out|trunc|ts_debug|ts_headline|ts_lexize|ts_match_qv|ts_match_tq|" +
+ "ts_match_tt|ts_match_vq|ts_parse|ts_rank|ts_rank_cd|ts_rewrite|ts_stat|ts_token_type|" +
+ "ts_typanalyze|tsmatchjoinsel|tsmatchsel|tsq_mcontained|tsq_mcontains|tsquery_and|" +
+ "tsquery_cmp|tsquery_eq|tsquery_ge|tsquery_gt|tsquery_le|tsquery_lt|tsquery_ne|" +
+ "tsquery_not|tsquery_or|tsqueryin|tsqueryout|tsqueryrecv|tsquerysend|tsvector_cmp|" +
+ "tsvector_concat|tsvector_eq|tsvector_ge|tsvector_gt|tsvector_le|tsvector_lt|" +
+ "tsvector_ne|tsvector_update_trigger|tsvector_update_trigger_column|tsvectorin|" +
+ "tsvectorout|tsvectorrecv|tsvectorsend|txid_current|txid_current_snapshot|" +
+ "txid_snapshot_in|txid_snapshot_out|txid_snapshot_recv|txid_snapshot_send|" +
+ "txid_snapshot_xip|txid_snapshot_xmax|txid_snapshot_xmin|txid_visible_in_snapshot|" +
+ "uhc_to_utf8|unique_key_recheck|unknownin|unknownout|unknownrecv|unknownsend|unnest|" +
+ "upper|utf8_to_ascii|utf8_to_big5|utf8_to_euc_cn|utf8_to_euc_jis_2004|utf8_to_euc_jp|" +
+ "utf8_to_euc_kr|utf8_to_euc_tw|utf8_to_gb18030|utf8_to_gbk|utf8_to_iso8859|" +
+ "utf8_to_iso8859_1|utf8_to_johab|utf8_to_koi8r|utf8_to_koi8u|utf8_to_shift_jis_2004|" +
+ "utf8_to_sjis|utf8_to_uhc|utf8_to_win|uuid_cmp|uuid_eq|uuid_ge|uuid_gt|uuid_hash|uuid_in|" +
+ "uuid_le|uuid_lt|uuid_ne|uuid_out|uuid_recv|uuid_send|var_pop|var_samp|varbit_in|" +
+ "varbit_out|varbit_recv|varbit_send|varbitcmp|varbiteq|varbitge|varbitgt|varbitle|" +
+ "varbitlt|varbitne|varbittypmodin|varbittypmodout|varcharin|varcharout|varcharrecv|" +
+ "varcharsend|varchartypmodin|varchartypmodout|variance|version|void_in|void_out|" +
+ "void_recv|void_send|width|width_bucket|win1250_to_latin2|win1250_to_mic|win1251_to_iso|" +
+ "win1251_to_koi8r|win1251_to_mic|win1251_to_win866|win866_to_iso|win866_to_koi8r|" +
+ "win866_to_mic|win866_to_win1251|win_to_utf8|xideq|xideqint4|xidin|xidout|xidrecv|xidsend|" +
+ "xml|xml_in|xml_is_well_formed|xml_is_well_formed_content|xml_is_well_formed_document|" +
+ "xml_out|xml_recv|xml_send|xmlagg|xmlcomment|xmlconcat2|xmlexists|xmlvalidate|xpath|" +
+ "xpath_exists"
+ );
+
+ var keywordMapper = this.createKeywordMapper({
+ "support.function": builtinFunctions,
+ "keyword": keywords,
+ }, "identifier", true);
+
+
+ var sqlRules = [
+ {
+ token : "string", // single line string -- assume dollar strings if multi-line for now
+ regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
+ }, {
+ token : "variable.language", // pg identifier
+ regex : '".*?"'
+ }, {
+ token : "constant.numeric", // float
+ regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
+ }, {
+ token : keywordMapper,
+ regex : "[a-zA-Z_][a-zA-Z0-9_$]*\\b" // TODO - Unicode in identifiers
+ }, {
+ token : "keyword.operator",
+ regex : "!|!!|!~|!~\\*|!~~|!~~\\*|#|##|#<|#<=|#<>|#=|#>|#>=|%|\\&|\\&\\&|\\&<|\\&<\\||\\&>|\\*|\\+|" +
+ "\\-|/|<|<#>|<\\->|<<|<<=|<<\\||<=|<>|<\\?>|<@|<\\^|=|>|>=|>>|>>=|>\\^|\\?#|\\?\\-|\\?\\-\\||" +
+ "\\?\\||\\?\\|\\||@|@\\-@|@>|@@|@@@|\\^|\\||\\|\\&>|\\|/|\\|>>|\\|\\||\\|\\|/|~|~\\*|~<=~|~<~|" +
+ "~=|~>=~|~>~|~~|~~\\*"
+ }, {
+ token : "paren.lparen",
+ regex : "[\\(]"
+ }, {
+ token : "paren.rparen",
+ regex : "[\\)]"
+ }, {
+ token : "text",
+ regex : "\\s+"
+ }
+ ];
+
+
+ this.$rules = {
+ "start" : [
+ {
+ token : "comment",
+ regex : "--.*$"
+ },
+ DocCommentHighlightRules.getStartRule("doc-start"),
+ {
+ token : "comment", // multi-line comment
+ merge : true,
+ regex : "\\/\\*",
+ next : "comment"
+ },{
+ token : "keyword.statementBegin",
+ regex : "^[a-zA-Z]+", // Could enumerate starting keywords but this allows things to work when new statements are added.
+ next : "statement"
+ },{
+ token : "support.buildin", // psql directive
+ regex : "^\\\\[\\S]+.*$"
+ }
+ ],
+
+ "statement" : [
+ {
+ token : "comment",
+ regex : "--.*$"
+ }, {
+ token : "comment", // multi-line comment
+ merge : true,
+ regex : "\\/\\*",
+ next : "commentStatement"
+ }, {
+ token : "statementEnd",
+ regex : ";",
+ next : "start"
+ }, {
+ token : "string", // perl, python, tcl are in the pg default dist (no tcl highlighter)
+ regex : "\\$perl\\$",
+ next : "perl-start"
+ }, {
+ token : "string",
+ regex : "\\$python\\$",
+ next : "python-start"
+ },{
+ token : "string",
+ regex : "\\$[\\w_0-9]*\\$$", // dollar quote at the end of a line
+ next : "dollarSql"
+ }, {
+ token : "string",
+ regex : "\\$[\\w_0-9]*\\$",
+ next : "dollarStatementString"
+ }
+ ].concat(sqlRules),
+
+ "dollarSql" : [
+ {
+ token : "comment",
+ regex : "--.*$"
+ }, {
+ token : "comment", // multi-line comment
+ merge : true,
+ regex : "\\/\\*",
+ next : "commentDollarSql"
+ }, {
+ token : "string", // end quoting with dollar at the start of a line
+ regex : "^\\$[\\w_0-9]*\\$",
+ next : "statement"
+ }, {
+ token : "string",
+ regex : "\\$[\\w_0-9]*\\$",
+ next : "dollarSqlString"
+ }
+ ].concat(sqlRules),
+
+ "comment" : [
+ {
+ token : "comment", // closing comment
+ regex : ".*?\\*\\/",
+ next : "start"
+ }, {
+ token : "comment", // comment spanning whole line
+ merge : true,
+ regex : ".+"
+ }
+ ],
+
+ "commentStatement" : [
+ {
+ token : "comment", // closing comment
+ regex : ".*?\\*\\/",
+ next : "statement"
+ }, {
+ token : "comment", // comment spanning whole line
+ merge : true,
+ regex : ".+"
+ }
+ ],
+
+ "commentDollarSql" : [
+ {
+ token : "comment", // closing comment
+ regex : ".*?\\*\\/",
+ next : "dollarSql"
+ }, {
+ token : "comment", // comment spanning whole line
+ merge : true,
+ regex : ".+"
+ }
+ ],
+
+ "dollarStatementString" : [
+ {
+ token : "string", // closing dollarstring
+ regex : ".*?\\$[\\w_0-9]*\\$",
+ next : "statement"
+ }, {
+ token : "string", // dollarstring spanning whole line
+ merge : true,
+ regex : ".+"
+ }
+ ],
+
+ "dollarSqlString" : [
+ {
+ token : "string", // closing dollarstring
+ regex : ".*?\\$[\\w_0-9]*\\$",
+ next : "dollarSql"
+ }, {
+ token : "string", // dollarstring spanning whole line
+ merge : true,
+ regex : ".+"
+ }
+ ]
+ };
+
+ this.embedRules(DocCommentHighlightRules, "doc-", [ DocCommentHighlightRules.getEndRule("start") ]);
+ this.embedRules(PerlHighlightRules, "perl-", [{token : "string", regex : "\\$perl\\$", next : "statement"}]);
+ this.embedRules(PythonHighlightRules, "python-", [{token : "string", regex : "\\$python\\$", next : "statement"}]);
+};
+
+oop.inherits(PgsqlHighlightRules, TextHighlightRules);
+
+exports.PgsqlHighlightRules = PgsqlHighlightRules;
+});
+
+ace.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",
+ merge : true,
+ regex : "\\s+"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "TODO"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "[^@\\*]+"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "."
+ }]
+ };
+};
+
+oop.inherits(DocCommentHighlightRules, TextHighlightRules);
+
+DocCommentHighlightRules.getStartRule = function(start) {
+ return {
+ token : "comment.doc", // doc comment
+ merge : true,
+ regex : "\\/\\*(?=\\*)",
+ next : start
+ };
+};
+
+DocCommentHighlightRules.getEndRule = function (start) {
+ return {
+ token : "comment.doc", // closing comment
+ merge : true,
+ regex : "\\*\\/",
+ next : start
+ };
+};
+
+
+exports.DocCommentHighlightRules = DocCommentHighlightRules;
+
+});
+
+ace.define('ace/mode/perl_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 PerlHighlightRules = function() {
+
+ var keywords = (
+ "base|constant|continue|else|elsif|for|foreach|format|goto|if|last|local|my|next|" +
+ "no|package|parent|redo|require|scalar|sub|unless|until|while|use|vars"
+ );
+
+ var buildinConstants = ("ARGV|ENV|INC|SIG");
+
+ var builtinFunctions = (
+ "getprotobynumber|getprotobyname|getservbyname|gethostbyaddr|" +
+ "gethostbyname|getservbyport|getnetbyaddr|getnetbyname|getsockname|" +
+ "getpeername|setpriority|getprotoent|setprotoent|getpriority|" +
+ "endprotoent|getservent|setservent|endservent|sethostent|socketpair|" +
+ "getsockopt|gethostent|endhostent|setsockopt|setnetent|quotemeta|" +
+ "localtime|prototype|getnetent|endnetent|rewinddir|wantarray|getpwuid|" +
+ "closedir|getlogin|readlink|endgrent|getgrgid|getgrnam|shmwrite|" +
+ "shutdown|readline|endpwent|setgrent|readpipe|formline|truncate|" +
+ "dbmclose|syswrite|setpwent|getpwnam|getgrent|getpwent|ucfirst|sysread|" +
+ "setpgrp|shmread|sysseek|sysopen|telldir|defined|opendir|connect|" +
+ "lcfirst|getppid|binmode|syscall|sprintf|getpgrp|readdir|seekdir|" +
+ "waitpid|reverse|unshift|symlink|dbmopen|semget|msgrcv|rename|listen|" +
+ "chroot|msgsnd|shmctl|accept|unpack|exists|fileno|shmget|system|" +
+ "unlink|printf|gmtime|msgctl|semctl|values|rindex|substr|splice|" +
+ "length|msgget|select|socket|return|caller|delete|alarm|ioctl|index|" +
+ "undef|lstat|times|srand|chown|fcntl|close|write|umask|rmdir|study|" +
+ "sleep|chomp|untie|print|utime|mkdir|atan2|split|crypt|flock|chmod|" +
+ "BEGIN|bless|chdir|semop|shift|reset|link|stat|chop|grep|fork|dump|" +
+ "join|open|tell|pipe|exit|glob|warn|each|bind|sort|pack|eval|push|" +
+ "keys|getc|kill|seek|sqrt|send|wait|rand|tied|read|time|exec|recv|" +
+ "eof|chr|int|ord|exp|pos|pop|sin|log|abs|oct|hex|tie|cos|vec|END|ref|" +
+ "map|die|uc|lc|do"
+ );
+
+ var keywordMapper = this.createKeywordMapper({
+ "keyword": keywords,
+ "constant.language": buildinConstants,
+ "support.function": builtinFunctions
+ }, "identifier");
+
+ // regexp must not have capturing parentheses. Use (?:) instead.
+ // regexps are ordered -> the first match is used
+
+ this.$rules = {
+ "start" : [
+ {
+ token : "comment",
+ regex : "#.*$"
+ }, {
+ token : "string.regexp",
+ regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"
+ }, {
+ token : "string", // single line
+ regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
+ }, {
+ token : "string", // multi line string start
+ merge : true,
+ regex : '["].*\\\\$',
+ next : "qqstring"
+ }, {
+ token : "string", // single line
+ regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
+ }, {
+ token : "string", // multi line string start
+ merge : true,
+ regex : "['].*\\\\$",
+ next : "qstring"
+ }, {
+ token : "constant.numeric", // hex
+ regex : "0x[0-9a-fA-F]+\\b"
+ }, {
+ 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 : "\\.\\.\\.|\\|\\|=|>>=|<<=|<=>|&&=|=>|!~|\\^=|&=|\\|=|\\.=|x=|%=|\\/=|\\*=|\\-=|\\+=|=~|\\*\\*|\\-\\-|\\.\\.|\\|\\||&&|\\+\\+|\\->|!=|==|>=|<=|>>|<<|,|=|\\?\\:|\\^|\\||x|%|\\/|\\*|<|&|\\\\|~|!|>|\\.|\\-|\\+|\\-C|\\-b|\\-S|\\-u|\\-t|\\-p|\\-l|\\-d|\\-f|\\-g|\\-s|\\-z|\\-k|\\-e|\\-O|\\-T|\\-B|\\-M|\\-A|\\-X|\\-W|\\-c|\\-R|\\-o|\\-x|\\-w|\\-r|\\b(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|xor)"
+ }, {
+ token : "lparen",
+ regex : "[[({]"
+ }, {
+ token : "rparen",
+ regex : "[\\])}]"
+ }, {
+ token : "text",
+ regex : "\\s+"
+ }
+ ],
+ "qqstring" : [
+ {
+ token : "string",
+ regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"',
+ next : "start"
+ }, {
+ token : "string",
+ merge : true,
+ regex : '.+'
+ }
+ ],
+ "qstring" : [
+ {
+ token : "string",
+ regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'",
+ next : "start"
+ }, {
+ token : "string",
+ merge : true,
+ regex : '.+'
+ }
+ ]
+ };
+};
+
+oop.inherits(PerlHighlightRules, TextHighlightRules);
+
+exports.PerlHighlightRules = PerlHighlightRules;
+});
+/*
+ * TODO: python delimiters
+ */
+
+ace.define('ace/mode/python_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 PythonHighlightRules = function() {
+
+ var keywords = (
+ "and|as|assert|break|class|continue|def|del|elif|else|except|exec|" +
+ "finally|for|from|global|if|import|in|is|lambda|not|or|pass|print|" +
+ "raise|return|try|while|with|yield"
+ );
+
+ var builtinConstants = (
+ "True|False|None|NotImplemented|Ellipsis|__debug__"
+ );
+
+ var builtinFunctions = (
+ "abs|divmod|input|open|staticmethod|all|enumerate|int|ord|str|any|" +
+ "eval|isinstance|pow|sum|basestring|execfile|issubclass|print|super|" +
+ "binfile|iter|property|tuple|bool|filter|len|range|type|bytearray|" +
+ "float|list|raw_input|unichr|callable|format|locals|reduce|unicode|" +
+ "chr|frozenset|long|reload|vars|classmethod|getattr|map|repr|xrange|" +
+ "cmp|globals|max|reversed|zip|compile|hasattr|memoryview|round|" +
+ "__import__|complex|hash|min|set|apply|delattr|help|next|setattr|" +
+ "buffer|dict|hex|object|slice|coerce|dir|id|oct|sorted|intern"
+ );
+
+ //var futureReserved = "";
+ var keywordMapper = this.createKeywordMapper({
+ "invalid.deprecated": "debugger",
+ "support.function": builtinFunctions,
+ //"invalid.illegal": futureReserved,
+ "constant.language": builtinConstants,
+ "keyword": keywords
+ }, "identifier");
+
+ var strPre = "(?:r|u|ur|R|U|UR|Ur|uR)?";
+
+ var decimalInteger = "(?:(?:[1-9]\\d*)|(?:0))";
+ var octInteger = "(?:0[oO]?[0-7]+)";
+ var hexInteger = "(?:0[xX][\\dA-Fa-f]+)";
+ var binInteger = "(?:0[bB][01]+)";
+ var integer = "(?:" + decimalInteger + "|" + octInteger + "|" + hexInteger + "|" + binInteger + ")";
+
+ var exponent = "(?:[eE][+-]?\\d+)";
+ var fraction = "(?:\\.\\d+)";
+ var intPart = "(?:\\d+)";
+ var pointFloat = "(?:(?:" + intPart + "?" + fraction + ")|(?:" + intPart + "\\.))";
+ var exponentFloat = "(?:(?:" + pointFloat + "|" + intPart + ")" + exponent + ")";
+ var floatNumber = "(?:" + exponentFloat + "|" + pointFloat + ")";
+
+ this.$rules = {
+ "start" : [ {
+ token : "comment",
+ regex : "#.*$"
+ }, {
+ token : "string", // """ string
+ regex : strPre + '"{3}(?:[^\\\\]|\\\\.)*?"{3}'
+ }, {
+ token : "string", // multi line """ string start
+ merge : true,
+ regex : strPre + '"{3}.*$',
+ next : "qqstring"
+ }, {
+ token : "string", // " string
+ regex : strPre + '"(?:[^\\\\]|\\\\.)*?"'
+ }, {
+ token : "string", // ''' string
+ regex : strPre + "'{3}(?:[^\\\\]|\\\\.)*?'{3}"
+ }, {
+ token : "string", // multi line ''' string start
+ merge : true,
+ regex : strPre + "'{3}.*$",
+ next : "qstring"
+ }, {
+ token : "string", // ' string
+ regex : strPre + "'(?:[^\\\\]|\\\\.)*?'"
+ }, {
+ token : "constant.numeric", // imaginary
+ regex : "(?:" + floatNumber + "|\\d+)[jJ]\\b"
+ }, {
+ token : "constant.numeric", // float
+ regex : floatNumber
+ }, {
+ token : "constant.numeric", // long integer
+ regex : integer + "[lL]\\b"
+ }, {
+ token : "constant.numeric", // integer
+ regex : integer + "\\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+"
+ } ],
+ "qqstring" : [ {
+ token : "string", // multi line """ string end
+ regex : '(?:[^\\\\]|\\\\.)*?"{3}',
+ next : "start"
+ }, {
+ token : "string",
+ merge : true,
+ regex : '.+'
+ } ],
+ "qstring" : [ {
+ token : "string", // multi line ''' string end
+ regex : "(?:[^\\\\]|\\\\.)*?'{3}",
+ next : "start"
+ }, {
+ token : "string",
+ merge : true,
+ regex : '.+'
+ } ]
+ };
+};
+
+oop.inherits(PythonHighlightRules, TextHighlightRules);
+
+exports.PythonHighlightRules = PythonHighlightRules;
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/mode-php.js b/vendor/assets/javascripts/ace-src-noconflict/mode-php.js
new file mode 100644
index 00000000000..d3deefc6618
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/mode-php.js
@@ -0,0 +1,2359 @@
+/* ***** 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 ***** */
+
+ace.define('ace/mode/php', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/php_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', '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 PhpHighlightRules = require("./php_highlight_rules").PhpHighlightRules;
+var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
+var Range = require("../range").Range;
+var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
+var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+
+var Mode = function() {
+ this.$tokenizer = new Tokenizer(new PhpHighlightRules().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;
+
+ if (tokens.length && tokens[tokens.length-1].type == "comment") {
+ return indent;
+ }
+
+ 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;
+});
+
+ace.define('ace/mode/php_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules', 'ace/mode/html_highlight_rules'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var lang = require("../lib/lang");
+var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
+var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
+
+var PhpLangHighlightRules = function() {
+ var docComment = DocCommentHighlightRules;
+ // http://php.net/quickref.php
+ var builtinFunctions = lang.arrayToMap(
+ ('abs|acos|acosh|addcslashes|addslashes|aggregate|aggregate_info|aggregate_methods|aggregate_methods_by_list|aggregate_methods_by_regexp|' +
+ 'aggregate_properties|aggregate_properties_by_list|aggregate_properties_by_regexp|aggregation_info|amqpconnection|amqpexchange|amqpqueue|' +
+ 'apache_child_terminate|apache_get_modules|apache_get_version|apache_getenv|apache_lookup_uri|apache_note|apache_request_headers|' +
+ 'apache_reset_timeout|apache_response_headers|apache_setenv|apc_add|apc_bin_dump|apc_bin_dumpfile|apc_bin_load|apc_bin_loadfile|' +
+ 'apc_cache_info|apc_cas|apc_clear_cache|apc_compile_file|apc_dec|apc_define_constants|apc_delete|apc_delete_file|apc_exists|apc_fetch|' +
+ 'apc_inc|apc_load_constants|apc_sma_info|apc_store|apciterator|apd_breakpoint|apd_callstack|apd_clunk|apd_continue|apd_croak|' +
+ 'apd_dump_function_table|apd_dump_persistent_resources|apd_dump_regular_resources|apd_echo|apd_get_active_symbols|apd_set_pprof_trace|' +
+ 'apd_set_session|apd_set_session_trace|apd_set_session_trace_socket|appenditerator|array|array_change_key_case|array_chunk|array_combine|' +
+ 'array_count_values|array_diff|array_diff_assoc|array_diff_key|array_diff_uassoc|array_diff_ukey|array_fill|array_fill_keys|array_filter|' +
+ 'array_flip|array_intersect|array_intersect_assoc|array_intersect_key|array_intersect_uassoc|array_intersect_ukey|array_key_exists|' +
+ 'array_keys|array_map|array_merge|array_merge_recursive|array_multisort|array_pad|array_pop|array_product|array_push|array_rand|' +
+ 'array_reduce|array_replace|array_replace_recursive|array_reverse|array_search|array_shift|array_slice|array_splice|array_sum|array_udiff|' +
+ 'array_udiff_assoc|array_udiff_uassoc|array_uintersect|array_uintersect_assoc|array_uintersect_uassoc|array_unique|array_unshift|' +
+ 'array_values|array_walk|array_walk_recursive|arrayaccess|arrayiterator|arrayobject|arsort|asin|asinh|asort|assert|assert_options|atan|' +
+ 'atan2|atanh|audioproperties|badfunctioncallexception|badmethodcallexception|base64_decode|base64_encode|base_convert|basename|' +
+ 'bbcode_add_element|bbcode_add_smiley|bbcode_create|bbcode_destroy|bbcode_parse|bbcode_set_arg_parser|bbcode_set_flags|bcadd|bccomp|bcdiv|' +
+ 'bcmod|bcmul|bcompiler_load|bcompiler_load_exe|bcompiler_parse_class|bcompiler_read|bcompiler_write_class|bcompiler_write_constant|' +
+ 'bcompiler_write_exe_footer|bcompiler_write_file|bcompiler_write_footer|bcompiler_write_function|bcompiler_write_functions_from_file|' +
+ 'bcompiler_write_header|bcompiler_write_included_filename|bcpow|bcpowmod|bcscale|bcsqrt|bcsub|bin2hex|bind_textdomain_codeset|bindec|' +
+ 'bindtextdomain|bson_decode|bson_encode|bumpValue|bzclose|bzcompress|bzdecompress|bzerrno|bzerror|bzerrstr|bzflush|bzopen|bzread|bzwrite|' +
+ 'cachingiterator|cairo|cairo_create|cairo_font_face_get_type|cairo_font_face_status|cairo_font_options_create|cairo_font_options_equal|' +
+ 'cairo_font_options_get_antialias|cairo_font_options_get_hint_metrics|cairo_font_options_get_hint_style|' +
+ 'cairo_font_options_get_subpixel_order|cairo_font_options_hash|cairo_font_options_merge|cairo_font_options_set_antialias|' +
+ 'cairo_font_options_set_hint_metrics|cairo_font_options_set_hint_style|cairo_font_options_set_subpixel_order|cairo_font_options_status|' +
+ 'cairo_format_stride_for_width|cairo_image_surface_create|cairo_image_surface_create_for_data|cairo_image_surface_create_from_png|' +
+ 'cairo_image_surface_get_data|cairo_image_surface_get_format|cairo_image_surface_get_height|cairo_image_surface_get_stride|' +
+ 'cairo_image_surface_get_width|cairo_matrix_create_scale|cairo_matrix_create_translate|cairo_matrix_invert|cairo_matrix_multiply|' +
+ 'cairo_matrix_rotate|cairo_matrix_transform_distance|cairo_matrix_transform_point|cairo_matrix_translate|cairo_pattern_add_color_stop_rgb|' +
+ 'cairo_pattern_add_color_stop_rgba|cairo_pattern_create_for_surface|cairo_pattern_create_linear|cairo_pattern_create_radial|' +
+ 'cairo_pattern_create_rgb|cairo_pattern_create_rgba|cairo_pattern_get_color_stop_count|cairo_pattern_get_color_stop_rgba|' +
+ 'cairo_pattern_get_extend|cairo_pattern_get_filter|cairo_pattern_get_linear_points|cairo_pattern_get_matrix|' +
+ 'cairo_pattern_get_radial_circles|cairo_pattern_get_rgba|cairo_pattern_get_surface|cairo_pattern_get_type|cairo_pattern_set_extend|' +
+ 'cairo_pattern_set_filter|cairo_pattern_set_matrix|cairo_pattern_status|cairo_pdf_surface_create|cairo_pdf_surface_set_size|' +
+ 'cairo_ps_get_levels|cairo_ps_level_to_string|cairo_ps_surface_create|cairo_ps_surface_dsc_begin_page_setup|' +
+ 'cairo_ps_surface_dsc_begin_setup|cairo_ps_surface_dsc_comment|cairo_ps_surface_get_eps|cairo_ps_surface_restrict_to_level|' +
+ 'cairo_ps_surface_set_eps|cairo_ps_surface_set_size|cairo_scaled_font_create|cairo_scaled_font_extents|cairo_scaled_font_get_ctm|' +
+ 'cairo_scaled_font_get_font_face|cairo_scaled_font_get_font_matrix|cairo_scaled_font_get_font_options|cairo_scaled_font_get_scale_matrix|' +
+ 'cairo_scaled_font_get_type|cairo_scaled_font_glyph_extents|cairo_scaled_font_status|cairo_scaled_font_text_extents|' +
+ 'cairo_surface_copy_page|cairo_surface_create_similar|cairo_surface_finish|cairo_surface_flush|cairo_surface_get_content|' +
+ 'cairo_surface_get_device_offset|cairo_surface_get_font_options|cairo_surface_get_type|cairo_surface_mark_dirty|' +
+ 'cairo_surface_mark_dirty_rectangle|cairo_surface_set_device_offset|cairo_surface_set_fallback_resolution|cairo_surface_show_page|' +
+ 'cairo_surface_status|cairo_surface_write_to_png|cairo_svg_surface_create|cairo_svg_surface_restrict_to_version|' +
+ 'cairo_svg_version_to_string|cairoantialias|cairocontent|cairocontext|cairoexception|cairoextend|cairofillrule|cairofilter|cairofontface|' +
+ 'cairofontoptions|cairofontslant|cairofonttype|cairofontweight|cairoformat|cairogradientpattern|cairohintmetrics|cairohintstyle|' +
+ 'cairoimagesurface|cairolineargradient|cairolinecap|cairolinejoin|cairomatrix|cairooperator|cairopath|cairopattern|cairopatterntype|' +
+ 'cairopdfsurface|cairopslevel|cairopssurface|cairoradialgradient|cairoscaledfont|cairosolidpattern|cairostatus|cairosubpixelorder|' +
+ 'cairosurface|cairosurfacepattern|cairosurfacetype|cairosvgsurface|cairosvgversion|cairotoyfontface|cal_days_in_month|cal_from_jd|cal_info|' +
+ 'cal_to_jd|calcul_hmac|calculhmac|call_user_func|call_user_func_array|call_user_method|call_user_method_array|callbackfilteriterator|ceil|' +
+ 'chdb|chdb_create|chdir|checkdate|checkdnsrr|chgrp|chmod|chop|chown|chr|chroot|chunk_split|class_alias|class_exists|class_implements|' +
+ 'class_parents|classkit_import|classkit_method_add|classkit_method_copy|classkit_method_redefine|classkit_method_remove|' +
+ 'classkit_method_rename|clearstatcache|clone|closedir|closelog|collator|com|com_addref|com_create_guid|com_event_sink|com_get|' +
+ 'com_get_active_object|com_invoke|com_isenum|com_load|com_load_typelib|com_message_pump|com_print_typeinfo|com_propget|com_propput|' +
+ 'com_propset|com_release|com_set|compact|connection_aborted|connection_status|connection_timeout|constant|construct|construct|construct|' +
+ 'convert_cyr_string|convert_uudecode|convert_uuencode|copy|cos|cosh|count|count_chars|countable|counter_bump|counter_bump_value|' +
+ 'counter_create|counter_get|counter_get_meta|counter_get_named|counter_get_value|counter_reset|counter_reset_value|crack_check|' +
+ 'crack_closedict|crack_getlastmessage|crack_opendict|crc32|create_function|crypt|ctype_alnum|ctype_alpha|ctype_cntrl|ctype_digit|' +
+ 'ctype_graph|ctype_lower|ctype_print|ctype_punct|ctype_space|ctype_upper|ctype_xdigit|cubrid_affected_rows|cubrid_bind|' +
+ 'cubrid_client_encoding|cubrid_close|cubrid_close_prepare|cubrid_close_request|cubrid_col_get|cubrid_col_size|cubrid_column_names|' +
+ 'cubrid_column_types|cubrid_commit|cubrid_connect|cubrid_connect_with_url|cubrid_current_oid|cubrid_data_seek|cubrid_db_name|' +
+ 'cubrid_disconnect|cubrid_drop|cubrid_errno|cubrid_error|cubrid_error_code|cubrid_error_code_facility|cubrid_error_msg|cubrid_execute|' +
+ 'cubrid_fetch|cubrid_fetch_array|cubrid_fetch_assoc|cubrid_fetch_field|cubrid_fetch_lengths|cubrid_fetch_object|cubrid_fetch_row|' +
+ 'cubrid_field_flags|cubrid_field_len|cubrid_field_name|cubrid_field_seek|cubrid_field_table|cubrid_field_type|cubrid_free_result|' +
+ 'cubrid_get|cubrid_get_autocommit|cubrid_get_charset|cubrid_get_class_name|cubrid_get_client_info|cubrid_get_db_parameter|' +
+ 'cubrid_get_server_info|cubrid_insert_id|cubrid_is_instance|cubrid_list_dbs|cubrid_load_from_glo|cubrid_lob_close|cubrid_lob_export|' +
+ 'cubrid_lob_get|cubrid_lob_send|cubrid_lob_size|cubrid_lock_read|cubrid_lock_write|cubrid_move_cursor|cubrid_new_glo|cubrid_next_result|' +
+ 'cubrid_num_cols|cubrid_num_fields|cubrid_num_rows|cubrid_ping|cubrid_prepare|cubrid_put|cubrid_query|cubrid_real_escape_string|' +
+ 'cubrid_result|cubrid_rollback|cubrid_save_to_glo|cubrid_schema|cubrid_send_glo|cubrid_seq_drop|cubrid_seq_insert|cubrid_seq_put|' +
+ 'cubrid_set_add|cubrid_set_autocommit|cubrid_set_db_parameter|cubrid_set_drop|cubrid_unbuffered_query|cubrid_version|curl_close|' +
+ 'curl_copy_handle|curl_errno|curl_error|curl_exec|curl_getinfo|curl_init|curl_multi_add_handle|curl_multi_close|curl_multi_exec|' +
+ 'curl_multi_getcontent|curl_multi_info_read|curl_multi_init|curl_multi_remove_handle|curl_multi_select|curl_setopt|curl_setopt_array|' +
+ 'curl_version|current|cyrus_authenticate|cyrus_bind|cyrus_close|cyrus_connect|cyrus_query|cyrus_unbind|date|date_add|date_create|' +
+ 'date_create_from_format|date_date_set|date_default_timezone_get|date_default_timezone_set|date_diff|date_format|date_get_last_errors|' +
+ 'date_interval_create_from_date_string|date_interval_format|date_isodate_set|date_modify|date_offset_get|date_parse|date_parse_from_format|' +
+ 'date_sub|date_sun_info|date_sunrise|date_sunset|date_time_set|date_timestamp_get|date_timestamp_set|date_timezone_get|date_timezone_set|' +
+ 'dateinterval|dateperiod|datetime|datetimezone|db2_autocommit|db2_bind_param|db2_client_info|db2_close|db2_column_privileges|db2_columns|' +
+ 'db2_commit|db2_conn_error|db2_conn_errormsg|db2_connect|db2_cursor_type|db2_escape_string|db2_exec|db2_execute|db2_fetch_array|' +
+ 'db2_fetch_assoc|db2_fetch_both|db2_fetch_object|db2_fetch_row|db2_field_display_size|db2_field_name|db2_field_num|db2_field_precision|' +
+ 'db2_field_scale|db2_field_type|db2_field_width|db2_foreign_keys|db2_free_result|db2_free_stmt|db2_get_option|db2_last_insert_id|' +
+ 'db2_lob_read|db2_next_result|db2_num_fields|db2_num_rows|db2_pclose|db2_pconnect|db2_prepare|db2_primary_keys|db2_procedure_columns|' +
+ 'db2_procedures|db2_result|db2_rollback|db2_server_info|db2_set_option|db2_special_columns|db2_statistics|db2_stmt_error|db2_stmt_errormsg|' +
+ 'db2_table_privileges|db2_tables|dba_close|dba_delete|dba_exists|dba_fetch|dba_firstkey|dba_handlers|dba_insert|dba_key_split|dba_list|' +
+ 'dba_nextkey|dba_open|dba_optimize|dba_popen|dba_replace|dba_sync|dbase_add_record|dbase_close|dbase_create|dbase_delete_record|' +
+ 'dbase_get_header_info|dbase_get_record|dbase_get_record_with_names|dbase_numfields|dbase_numrecords|dbase_open|dbase_pack|' +
+ 'dbase_replace_record|dbplus_add|dbplus_aql|dbplus_chdir|dbplus_close|dbplus_curr|dbplus_errcode|dbplus_errno|dbplus_find|dbplus_first|' +
+ 'dbplus_flush|dbplus_freealllocks|dbplus_freelock|dbplus_freerlocks|dbplus_getlock|dbplus_getunique|dbplus_info|dbplus_last|dbplus_lockrel|' +
+ 'dbplus_next|dbplus_open|dbplus_prev|dbplus_rchperm|dbplus_rcreate|dbplus_rcrtexact|dbplus_rcrtlike|dbplus_resolve|dbplus_restorepos|' +
+ 'dbplus_rkeys|dbplus_ropen|dbplus_rquery|dbplus_rrename|dbplus_rsecindex|dbplus_runlink|dbplus_rzap|dbplus_savepos|dbplus_setindex|' +
+ 'dbplus_setindexbynumber|dbplus_sql|dbplus_tcl|dbplus_tremove|dbplus_undo|dbplus_undoprepare|dbplus_unlockrel|dbplus_unselect|' +
+ 'dbplus_update|dbplus_xlockrel|dbplus_xunlockrel|dbx_close|dbx_compare|dbx_connect|dbx_error|dbx_escape_string|dbx_fetch_row|dbx_query|' +
+ 'dbx_sort|dcgettext|dcngettext|deaggregate|debug_backtrace|debug_print_backtrace|debug_zval_dump|decbin|dechex|decoct|define|' +
+ 'define_syslog_variables|defined|deg2rad|delete|dgettext|die|dio_close|dio_fcntl|dio_open|dio_read|dio_seek|dio_stat|dio_tcsetattr|' +
+ 'dio_truncate|dio_write|dir|directoryiterator|dirname|disk_free_space|disk_total_space|diskfreespace|dl|dngettext|dns_check_record|' +
+ 'dns_get_mx|dns_get_record|dom_import_simplexml|domainexception|domattr|domattribute_name|domattribute_set_value|domattribute_specified|' +
+ 'domattribute_value|domcharacterdata|domcomment|domdocument|domdocument_add_root|domdocument_create_attribute|' +
+ 'domdocument_create_cdata_section|domdocument_create_comment|domdocument_create_element|domdocument_create_element_ns|' +
+ 'domdocument_create_entity_reference|domdocument_create_processing_instruction|domdocument_create_text_node|domdocument_doctype|' +
+ 'domdocument_document_element|domdocument_dump_file|domdocument_dump_mem|domdocument_get_element_by_id|domdocument_get_elements_by_tagname|' +
+ 'domdocument_html_dump_mem|domdocument_xinclude|domdocumentfragment|domdocumenttype|domdocumenttype_entities|' +
+ 'domdocumenttype_internal_subset|domdocumenttype_name|domdocumenttype_notations|domdocumenttype_public_id|domdocumenttype_system_id|' +
+ 'domelement|domelement_get_attribute|domelement_get_attribute_node|domelement_get_elements_by_tagname|domelement_has_attribute|' +
+ 'domelement_remove_attribute|domelement_set_attribute|domelement_set_attribute_node|domelement_tagname|domentity|domentityreference|' +
+ 'domexception|domimplementation|domnamednodemap|domnode|domnode_add_namespace|domnode_append_child|domnode_append_sibling|' +
+ 'domnode_attributes|domnode_child_nodes|domnode_clone_node|domnode_dump_node|domnode_first_child|domnode_get_content|' +
+ 'domnode_has_attributes|domnode_has_child_nodes|domnode_insert_before|domnode_is_blank_node|domnode_last_child|domnode_next_sibling|' +
+ 'domnode_node_name|domnode_node_type|domnode_node_value|domnode_owner_document|domnode_parent_node|domnode_prefix|domnode_previous_sibling|' +
+ 'domnode_remove_child|domnode_replace_child|domnode_replace_node|domnode_set_content|domnode_set_name|domnode_set_namespace|' +
+ 'domnode_unlink_node|domnodelist|domnotation|domprocessinginstruction|domprocessinginstruction_data|domprocessinginstruction_target|' +
+ 'domtext|domxml_new_doc|domxml_open_file|domxml_open_mem|domxml_version|domxml_xmltree|domxml_xslt_stylesheet|domxml_xslt_stylesheet_doc|' +
+ 'domxml_xslt_stylesheet_file|domxml_xslt_version|domxpath|domxsltstylesheet_process|domxsltstylesheet_result_dump_file|' +
+ 'domxsltstylesheet_result_dump_mem|dotnet|dotnet_load|doubleval|each|easter_date|easter_days|echo|empty|emptyiterator|' +
+ 'enchant_broker_describe|enchant_broker_dict_exists|enchant_broker_free|enchant_broker_free_dict|enchant_broker_get_error|' +
+ 'enchant_broker_init|enchant_broker_list_dicts|enchant_broker_request_dict|enchant_broker_request_pwl_dict|enchant_broker_set_ordering|' +
+ 'enchant_dict_add_to_personal|enchant_dict_add_to_session|enchant_dict_check|enchant_dict_describe|enchant_dict_get_error|' +
+ 'enchant_dict_is_in_session|enchant_dict_quick_check|enchant_dict_store_replacement|enchant_dict_suggest|end|ereg|ereg_replace|eregi|' +
+ 'eregi_replace|error_get_last|error_log|error_reporting|errorexception|escapeshellarg|escapeshellcmd|eval|event_add|event_base_free|' +
+ 'event_base_loop|event_base_loopbreak|event_base_loopexit|event_base_new|event_base_priority_init|event_base_set|event_buffer_base_set|' +
+ 'event_buffer_disable|event_buffer_enable|event_buffer_fd_set|event_buffer_free|event_buffer_new|event_buffer_priority_set|' +
+ 'event_buffer_read|event_buffer_set_callback|event_buffer_timeout_set|event_buffer_watermark_set|event_buffer_write|event_del|event_free|' +
+ 'event_new|event_set|exception|exec|exif_imagetype|exif_read_data|exif_tagname|exif_thumbnail|exit|exp|expect_expectl|expect_popen|explode|' +
+ 'expm1|export|export|extension_loaded|extract|ezmlm_hash|fam_cancel_monitor|fam_close|fam_monitor_collection|fam_monitor_directory|' +
+ 'fam_monitor_file|fam_next_event|fam_open|fam_pending|fam_resume_monitor|fam_suspend_monitor|fbsql_affected_rows|fbsql_autocommit|' +
+ 'fbsql_blob_size|fbsql_change_user|fbsql_clob_size|fbsql_close|fbsql_commit|fbsql_connect|fbsql_create_blob|fbsql_create_clob|' +
+ 'fbsql_create_db|fbsql_data_seek|fbsql_database|fbsql_database_password|fbsql_db_query|fbsql_db_status|fbsql_drop_db|fbsql_errno|' +
+ 'fbsql_error|fbsql_fetch_array|fbsql_fetch_assoc|fbsql_fetch_field|fbsql_fetch_lengths|fbsql_fetch_object|fbsql_fetch_row|' +
+ 'fbsql_field_flags|fbsql_field_len|fbsql_field_name|fbsql_field_seek|fbsql_field_table|fbsql_field_type|fbsql_free_result|' +
+ 'fbsql_get_autostart_info|fbsql_hostname|fbsql_insert_id|fbsql_list_dbs|fbsql_list_fields|fbsql_list_tables|fbsql_next_result|' +
+ 'fbsql_num_fields|fbsql_num_rows|fbsql_password|fbsql_pconnect|fbsql_query|fbsql_read_blob|fbsql_read_clob|fbsql_result|fbsql_rollback|' +
+ 'fbsql_rows_fetched|fbsql_select_db|fbsql_set_characterset|fbsql_set_lob_mode|fbsql_set_password|fbsql_set_transaction|fbsql_start_db|' +
+ 'fbsql_stop_db|fbsql_table_name|fbsql_tablename|fbsql_username|fbsql_warnings|fclose|fdf_add_doc_javascript|fdf_add_template|fdf_close|' +
+ 'fdf_create|fdf_enum_values|fdf_errno|fdf_error|fdf_get_ap|fdf_get_attachment|fdf_get_encoding|fdf_get_file|fdf_get_flags|fdf_get_opt|' +
+ 'fdf_get_status|fdf_get_value|fdf_get_version|fdf_header|fdf_next_field_name|fdf_open|fdf_open_string|fdf_remove_item|fdf_save|' +
+ 'fdf_save_string|fdf_set_ap|fdf_set_encoding|fdf_set_file|fdf_set_flags|fdf_set_javascript_action|fdf_set_on_import_javascript|fdf_set_opt|' +
+ 'fdf_set_status|fdf_set_submit_form_action|fdf_set_target_frame|fdf_set_value|fdf_set_version|feof|fflush|fgetc|fgetcsv|fgets|fgetss|file|' +
+ 'file_exists|file_get_contents|file_put_contents|fileatime|filectime|filegroup|fileinode|filemtime|fileowner|fileperms|filepro|' +
+ 'filepro_fieldcount|filepro_fieldname|filepro_fieldtype|filepro_fieldwidth|filepro_retrieve|filepro_rowcount|filesize|filesystemiterator|' +
+ 'filetype|filter_has_var|filter_id|filter_input|filter_input_array|filter_list|filter_var|filter_var_array|filteriterator|finfo_buffer|' +
+ 'finfo_close|finfo_file|finfo_open|finfo_set_flags|floatval|flock|floor|flush|fmod|fnmatch|fopen|forward_static_call|' +
+ 'forward_static_call_array|fpassthru|fprintf|fputcsv|fputs|fread|frenchtojd|fribidi_log2vis|fscanf|fseek|fsockopen|fstat|ftell|ftok|' +
+ 'ftp_alloc|ftp_cdup|ftp_chdir|ftp_chmod|ftp_close|ftp_connect|ftp_delete|ftp_exec|ftp_fget|ftp_fput|ftp_get|ftp_get_option|ftp_login|' +
+ 'ftp_mdtm|ftp_mkdir|ftp_nb_continue|ftp_nb_fget|ftp_nb_fput|ftp_nb_get|ftp_nb_put|ftp_nlist|ftp_pasv|ftp_put|ftp_pwd|ftp_quit|ftp_raw|' +
+ 'ftp_rawlist|ftp_rename|ftp_rmdir|ftp_set_option|ftp_site|ftp_size|ftp_ssl_connect|ftp_systype|ftruncate|func_get_arg|func_get_args|' +
+ 'func_num_args|function_exists|fwrite|gc_collect_cycles|gc_disable|gc_enable|gc_enabled|gd_info|gearmanclient|gearmanjob|gearmantask|' +
+ 'gearmanworker|geoip_continent_code_by_name|geoip_country_code3_by_name|geoip_country_code_by_name|geoip_country_name_by_name|' +
+ 'geoip_database_info|geoip_db_avail|geoip_db_filename|geoip_db_get_all_info|geoip_id_by_name|geoip_isp_by_name|geoip_org_by_name|' +
+ 'geoip_record_by_name|geoip_region_by_name|geoip_region_name_by_code|geoip_time_zone_by_country_and_region|getMeta|getNamed|getValue|' +
+ 'get_browser|get_called_class|get_cfg_var|get_class|get_class_methods|get_class_vars|get_current_user|get_declared_classes|' +
+ 'get_declared_interfaces|get_defined_constants|get_defined_functions|get_defined_vars|get_extension_funcs|get_headers|' +
+ 'get_html_translation_table|get_include_path|get_included_files|get_loaded_extensions|get_magic_quotes_gpc|get_magic_quotes_runtime|' +
+ 'get_meta_tags|get_object_vars|get_parent_class|get_required_files|get_resource_type|getallheaders|getconstant|getconstants|getconstructor|' +
+ 'getcwd|getdate|getdefaultproperties|getdoccomment|getendline|getenv|getextension|getextensionname|getfilename|gethostbyaddr|gethostbyname|' +
+ 'gethostbynamel|gethostname|getimagesize|getinterfacenames|getinterfaces|getlastmod|getmethod|getmethods|getmodifiers|getmxrr|getmygid|' +
+ 'getmyinode|getmypid|getmyuid|getname|getnamespacename|getopt|getparentclass|getproperties|getproperty|getprotobyname|getprotobynumber|' +
+ 'getrandmax|getrusage|getservbyname|getservbyport|getshortname|getstartline|getstaticproperties|getstaticpropertyvalue|gettext|' +
+ 'gettimeofday|gettype|glob|globiterator|gmagick|gmagickdraw|gmagickpixel|gmdate|gmmktime|gmp_abs|gmp_add|gmp_and|gmp_clrbit|gmp_cmp|' +
+ 'gmp_com|gmp_div|gmp_div_q|gmp_div_qr|gmp_div_r|gmp_divexact|gmp_fact|gmp_gcd|gmp_gcdext|gmp_hamdist|gmp_init|gmp_intval|gmp_invert|' +
+ 'gmp_jacobi|gmp_legendre|gmp_mod|gmp_mul|gmp_neg|gmp_nextprime|gmp_or|gmp_perfect_square|gmp_popcount|gmp_pow|gmp_powm|gmp_prob_prime|' +
+ 'gmp_random|gmp_scan0|gmp_scan1|gmp_setbit|gmp_sign|gmp_sqrt|gmp_sqrtrem|gmp_strval|gmp_sub|gmp_testbit|gmp_xor|gmstrftime|' +
+ 'gnupg_adddecryptkey|gnupg_addencryptkey|gnupg_addsignkey|gnupg_cleardecryptkeys|gnupg_clearencryptkeys|gnupg_clearsignkeys|gnupg_decrypt|' +
+ 'gnupg_decryptverify|gnupg_encrypt|gnupg_encryptsign|gnupg_export|gnupg_geterror|gnupg_getprotocol|gnupg_import|gnupg_init|gnupg_keyinfo|' +
+ 'gnupg_setarmor|gnupg_seterrormode|gnupg_setsignmode|gnupg_sign|gnupg_verify|gopher_parsedir|grapheme_extract|grapheme_stripos|' +
+ 'grapheme_stristr|grapheme_strlen|grapheme_strpos|grapheme_strripos|grapheme_strrpos|grapheme_strstr|grapheme_substr|gregoriantojd|' +
+ 'gupnp_context_get_host_ip|gupnp_context_get_port|gupnp_context_get_subscription_timeout|gupnp_context_host_path|gupnp_context_new|' +
+ 'gupnp_context_set_subscription_timeout|gupnp_context_timeout_add|gupnp_context_unhost_path|gupnp_control_point_browse_start|' +
+ 'gupnp_control_point_browse_stop|gupnp_control_point_callback_set|gupnp_control_point_new|gupnp_device_action_callback_set|' +
+ 'gupnp_device_info_get|gupnp_device_info_get_service|gupnp_root_device_get_available|gupnp_root_device_get_relative_location|' +
+ 'gupnp_root_device_new|gupnp_root_device_set_available|gupnp_root_device_start|gupnp_root_device_stop|gupnp_service_action_get|' +
+ 'gupnp_service_action_return|gupnp_service_action_return_error|gupnp_service_action_set|gupnp_service_freeze_notify|gupnp_service_info_get|' +
+ 'gupnp_service_info_get_introspection|gupnp_service_introspection_get_state_variable|gupnp_service_notify|gupnp_service_proxy_action_get|' +
+ 'gupnp_service_proxy_action_set|gupnp_service_proxy_add_notify|gupnp_service_proxy_callback_set|gupnp_service_proxy_get_subscribed|' +
+ 'gupnp_service_proxy_remove_notify|gupnp_service_proxy_set_subscribed|gupnp_service_thaw_notify|gzclose|gzcompress|gzdecode|gzdeflate|' +
+ 'gzencode|gzeof|gzfile|gzgetc|gzgets|gzgetss|gzinflate|gzopen|gzpassthru|gzputs|gzread|gzrewind|gzseek|gztell|gzuncompress|gzwrite|' +
+ 'halt_compiler|haruannotation|haruannotation_setborderstyle|haruannotation_sethighlightmode|haruannotation_seticon|' +
+ 'haruannotation_setopened|harudestination|harudestination_setfit|harudestination_setfitb|harudestination_setfitbh|harudestination_setfitbv|' +
+ 'harudestination_setfith|harudestination_setfitr|harudestination_setfitv|harudestination_setxyz|harudoc|harudoc_addpage|' +
+ 'harudoc_addpagelabel|harudoc_construct|harudoc_createoutline|harudoc_getcurrentencoder|harudoc_getcurrentpage|harudoc_getencoder|' +
+ 'harudoc_getfont|harudoc_getinfoattr|harudoc_getpagelayout|harudoc_getpagemode|harudoc_getstreamsize|harudoc_insertpage|harudoc_loadjpeg|' +
+ 'harudoc_loadpng|harudoc_loadraw|harudoc_loadttc|harudoc_loadttf|harudoc_loadtype1|harudoc_output|harudoc_readfromstream|' +
+ 'harudoc_reseterror|harudoc_resetstream|harudoc_save|harudoc_savetostream|harudoc_setcompressionmode|harudoc_setcurrentencoder|' +
+ 'harudoc_setencryptionmode|harudoc_setinfoattr|harudoc_setinfodateattr|harudoc_setopenaction|harudoc_setpagelayout|harudoc_setpagemode|' +
+ 'harudoc_setpagesconfiguration|harudoc_setpassword|harudoc_setpermission|harudoc_usecnsencodings|harudoc_usecnsfonts|' +
+ 'harudoc_usecntencodings|harudoc_usecntfonts|harudoc_usejpencodings|harudoc_usejpfonts|harudoc_usekrencodings|harudoc_usekrfonts|' +
+ 'haruencoder|haruencoder_getbytetype|haruencoder_gettype|haruencoder_getunicode|haruencoder_getwritingmode|haruexception|harufont|' +
+ 'harufont_getascent|harufont_getcapheight|harufont_getdescent|harufont_getencodingname|harufont_getfontname|harufont_gettextwidth|' +
+ 'harufont_getunicodewidth|harufont_getxheight|harufont_measuretext|haruimage|haruimage_getbitspercomponent|haruimage_getcolorspace|' +
+ 'haruimage_getheight|haruimage_getsize|haruimage_getwidth|haruimage_setcolormask|haruimage_setmaskimage|haruoutline|' +
+ 'haruoutline_setdestination|haruoutline_setopened|harupage|harupage_arc|harupage_begintext|harupage_circle|harupage_closepath|' +
+ 'harupage_concat|harupage_createdestination|harupage_createlinkannotation|harupage_createtextannotation|harupage_createurlannotation|' +
+ 'harupage_curveto|harupage_curveto2|harupage_curveto3|harupage_drawimage|harupage_ellipse|harupage_endpath|harupage_endtext|' +
+ 'harupage_eofill|harupage_eofillstroke|harupage_fill|harupage_fillstroke|harupage_getcharspace|harupage_getcmykfill|harupage_getcmykstroke|' +
+ 'harupage_getcurrentfont|harupage_getcurrentfontsize|harupage_getcurrentpos|harupage_getcurrenttextpos|harupage_getdash|' +
+ 'harupage_getfillingcolorspace|harupage_getflatness|harupage_getgmode|harupage_getgrayfill|harupage_getgraystroke|harupage_getheight|' +
+ 'harupage_gethorizontalscaling|harupage_getlinecap|harupage_getlinejoin|harupage_getlinewidth|harupage_getmiterlimit|harupage_getrgbfill|' +
+ 'harupage_getrgbstroke|harupage_getstrokingcolorspace|harupage_gettextleading|harupage_gettextmatrix|harupage_gettextrenderingmode|' +
+ 'harupage_gettextrise|harupage_gettextwidth|harupage_gettransmatrix|harupage_getwidth|harupage_getwordspace|harupage_lineto|' +
+ 'harupage_measuretext|harupage_movetextpos|harupage_moveto|harupage_movetonextline|harupage_rectangle|harupage_setcharspace|' +
+ 'harupage_setcmykfill|harupage_setcmykstroke|harupage_setdash|harupage_setflatness|harupage_setfontandsize|harupage_setgrayfill|' +
+ 'harupage_setgraystroke|harupage_setheight|harupage_sethorizontalscaling|harupage_setlinecap|harupage_setlinejoin|harupage_setlinewidth|' +
+ 'harupage_setmiterlimit|harupage_setrgbfill|harupage_setrgbstroke|harupage_setrotate|harupage_setsize|harupage_setslideshow|' +
+ 'harupage_settextleading|harupage_settextmatrix|harupage_settextrenderingmode|harupage_settextrise|harupage_setwidth|harupage_setwordspace|' +
+ 'harupage_showtext|harupage_showtextnextline|harupage_stroke|harupage_textout|harupage_textrect|hasconstant|hash|hash_algos|hash_copy|' +
+ 'hash_file|hash_final|hash_hmac|hash_hmac_file|hash_init|hash_update|hash_update_file|hash_update_stream|hasmethod|hasproperty|header|' +
+ 'header_register_callback|header_remove|headers_list|headers_sent|hebrev|hebrevc|hex2bin|hexdec|highlight_file|highlight_string|' +
+ 'html_entity_decode|htmlentities|htmlspecialchars|htmlspecialchars_decode|http_build_cookie|http_build_query|http_build_str|http_build_url|' +
+ 'http_cache_etag|http_cache_last_modified|http_chunked_decode|http_date|http_deflate|http_get|http_get_request_body|' +
+ 'http_get_request_body_stream|http_get_request_headers|http_head|http_inflate|http_match_etag|http_match_modified|' +
+ 'http_match_request_header|http_negotiate_charset|http_negotiate_content_type|http_negotiate_language|http_parse_cookie|http_parse_headers|' +
+ 'http_parse_message|http_parse_params|http_persistent_handles_clean|http_persistent_handles_count|http_persistent_handles_ident|' +
+ 'http_post_data|http_post_fields|http_put_data|http_put_file|http_put_stream|http_redirect|http_request|http_request_body_encode|' +
+ 'http_request_method_exists|http_request_method_name|http_request_method_register|http_request_method_unregister|http_response_code|' +
+ 'http_send_content_disposition|http_send_content_type|http_send_data|http_send_file|http_send_last_modified|http_send_status|' +
+ 'http_send_stream|http_support|http_throttle|httpdeflatestream|httpdeflatestream_construct|httpdeflatestream_factory|' +
+ 'httpdeflatestream_finish|httpdeflatestream_flush|httpdeflatestream_update|httpinflatestream|httpinflatestream_construct|' +
+ 'httpinflatestream_factory|httpinflatestream_finish|httpinflatestream_flush|httpinflatestream_update|httpmessage|httpmessage_addheaders|' +
+ 'httpmessage_construct|httpmessage_detach|httpmessage_factory|httpmessage_fromenv|httpmessage_fromstring|httpmessage_getbody|' +
+ 'httpmessage_getheader|httpmessage_getheaders|httpmessage_gethttpversion|httpmessage_getparentmessage|httpmessage_getrequestmethod|' +
+ 'httpmessage_getrequesturl|httpmessage_getresponsecode|httpmessage_getresponsestatus|httpmessage_gettype|httpmessage_guesscontenttype|' +
+ 'httpmessage_prepend|httpmessage_reverse|httpmessage_send|httpmessage_setbody|httpmessage_setheaders|httpmessage_sethttpversion|' +
+ 'httpmessage_setrequestmethod|httpmessage_setrequesturl|httpmessage_setresponsecode|httpmessage_setresponsestatus|httpmessage_settype|' +
+ 'httpmessage_tomessagetypeobject|httpmessage_tostring|httpquerystring|httpquerystring_construct|httpquerystring_get|httpquerystring_mod|' +
+ 'httpquerystring_set|httpquerystring_singleton|httpquerystring_toarray|httpquerystring_tostring|httpquerystring_xlate|httprequest|' +
+ 'httprequest_addcookies|httprequest_addheaders|httprequest_addpostfields|httprequest_addpostfile|httprequest_addputdata|' +
+ 'httprequest_addquerydata|httprequest_addrawpostdata|httprequest_addssloptions|httprequest_clearhistory|httprequest_construct|' +
+ 'httprequest_enablecookies|httprequest_getcontenttype|httprequest_getcookies|httprequest_getheaders|httprequest_gethistory|' +
+ 'httprequest_getmethod|httprequest_getoptions|httprequest_getpostfields|httprequest_getpostfiles|httprequest_getputdata|' +
+ 'httprequest_getputfile|httprequest_getquerydata|httprequest_getrawpostdata|httprequest_getrawrequestmessage|' +
+ 'httprequest_getrawresponsemessage|httprequest_getrequestmessage|httprequest_getresponsebody|httprequest_getresponsecode|' +
+ 'httprequest_getresponsecookies|httprequest_getresponsedata|httprequest_getresponseheader|httprequest_getresponseinfo|' +
+ 'httprequest_getresponsemessage|httprequest_getresponsestatus|httprequest_getssloptions|httprequest_geturl|httprequest_resetcookies|' +
+ 'httprequest_send|httprequest_setcontenttype|httprequest_setcookies|httprequest_setheaders|httprequest_setmethod|httprequest_setoptions|' +
+ 'httprequest_setpostfields|httprequest_setpostfiles|httprequest_setputdata|httprequest_setputfile|httprequest_setquerydata|' +
+ 'httprequest_setrawpostdata|httprequest_setssloptions|httprequest_seturl|httprequestpool|httprequestpool_attach|httprequestpool_construct|' +
+ 'httprequestpool_destruct|httprequestpool_detach|httprequestpool_getattachedrequests|httprequestpool_getfinishedrequests|' +
+ 'httprequestpool_reset|httprequestpool_send|httprequestpool_socketperform|httprequestpool_socketselect|httpresponse|httpresponse_capture|' +
+ 'httpresponse_getbuffersize|httpresponse_getcache|httpresponse_getcachecontrol|httpresponse_getcontentdisposition|' +
+ 'httpresponse_getcontenttype|httpresponse_getdata|httpresponse_getetag|httpresponse_getfile|httpresponse_getgzip|httpresponse_getheader|' +
+ 'httpresponse_getlastmodified|httpresponse_getrequestbody|httpresponse_getrequestbodystream|httpresponse_getrequestheaders|' +
+ 'httpresponse_getstream|httpresponse_getthrottledelay|httpresponse_guesscontenttype|httpresponse_redirect|httpresponse_send|' +
+ 'httpresponse_setbuffersize|httpresponse_setcache|httpresponse_setcachecontrol|httpresponse_setcontentdisposition|' +
+ 'httpresponse_setcontenttype|httpresponse_setdata|httpresponse_setetag|httpresponse_setfile|httpresponse_setgzip|httpresponse_setheader|' +
+ 'httpresponse_setlastmodified|httpresponse_setstream|httpresponse_setthrottledelay|httpresponse_status|hw_array2objrec|hw_changeobject|' +
+ 'hw_children|hw_childrenobj|hw_close|hw_connect|hw_connection_info|hw_cp|hw_deleteobject|hw_docbyanchor|hw_docbyanchorobj|' +
+ 'hw_document_attributes|hw_document_bodytag|hw_document_content|hw_document_setcontent|hw_document_size|hw_dummy|hw_edittext|hw_error|' +
+ 'hw_errormsg|hw_free_document|hw_getanchors|hw_getanchorsobj|hw_getandlock|hw_getchildcoll|hw_getchildcollobj|hw_getchilddoccoll|' +
+ 'hw_getchilddoccollobj|hw_getobject|hw_getobjectbyquery|hw_getobjectbyquerycoll|hw_getobjectbyquerycollobj|hw_getobjectbyqueryobj|' +
+ 'hw_getparents|hw_getparentsobj|hw_getrellink|hw_getremote|hw_getremotechildren|hw_getsrcbydestobj|hw_gettext|hw_getusername|hw_identify|' +
+ 'hw_incollections|hw_info|hw_inscoll|hw_insdoc|hw_insertanchors|hw_insertdocument|hw_insertobject|hw_mapid|hw_modifyobject|hw_mv|' +
+ 'hw_new_document|hw_objrec2array|hw_output_document|hw_pconnect|hw_pipedocument|hw_root|hw_setlinkroot|hw_stat|hw_unlock|hw_who|' +
+ 'hwapi_attribute|hwapi_attribute_key|hwapi_attribute_langdepvalue|hwapi_attribute_value|hwapi_attribute_values|hwapi_checkin|' +
+ 'hwapi_checkout|hwapi_children|hwapi_content|hwapi_content_mimetype|hwapi_content_read|hwapi_copy|hwapi_dbstat|hwapi_dcstat|' +
+ 'hwapi_dstanchors|hwapi_dstofsrcanchor|hwapi_error_count|hwapi_error_reason|hwapi_find|hwapi_ftstat|hwapi_hgcsp|hwapi_hwstat|' +
+ 'hwapi_identify|hwapi_info|hwapi_insert|hwapi_insertanchor|hwapi_insertcollection|hwapi_insertdocument|hwapi_link|hwapi_lock|hwapi_move|' +
+ 'hwapi_new_content|hwapi_object|hwapi_object_assign|hwapi_object_attreditable|hwapi_object_count|hwapi_object_insert|hwapi_object_new|' +
+ 'hwapi_object_remove|hwapi_object_title|hwapi_object_value|hwapi_objectbyanchor|hwapi_parents|hwapi_reason_description|hwapi_reason_type|' +
+ 'hwapi_remove|hwapi_replace|hwapi_setcommittedversion|hwapi_srcanchors|hwapi_srcsofdst|hwapi_unlock|hwapi_user|hwapi_userlist|hypot|' +
+ 'ibase_add_user|ibase_affected_rows|ibase_backup|ibase_blob_add|ibase_blob_cancel|ibase_blob_close|ibase_blob_create|ibase_blob_echo|' +
+ 'ibase_blob_get|ibase_blob_import|ibase_blob_info|ibase_blob_open|ibase_close|ibase_commit|ibase_commit_ret|ibase_connect|ibase_db_info|' +
+ 'ibase_delete_user|ibase_drop_db|ibase_errcode|ibase_errmsg|ibase_execute|ibase_fetch_assoc|ibase_fetch_object|ibase_fetch_row|' +
+ 'ibase_field_info|ibase_free_event_handler|ibase_free_query|ibase_free_result|ibase_gen_id|ibase_maintain_db|ibase_modify_user|' +
+ 'ibase_name_result|ibase_num_fields|ibase_num_params|ibase_param_info|ibase_pconnect|ibase_prepare|ibase_query|ibase_restore|' +
+ 'ibase_rollback|ibase_rollback_ret|ibase_server_info|ibase_service_attach|ibase_service_detach|ibase_set_event_handler|ibase_timefmt|' +
+ 'ibase_trans|ibase_wait_event|iconv|iconv_get_encoding|iconv_mime_decode|iconv_mime_decode_headers|iconv_mime_encode|iconv_set_encoding|' +
+ 'iconv_strlen|iconv_strpos|iconv_strrpos|iconv_substr|id3_get_frame_long_name|id3_get_frame_short_name|id3_get_genre_id|id3_get_genre_list|' +
+ 'id3_get_genre_name|id3_get_tag|id3_get_version|id3_remove_tag|id3_set_tag|id3v2attachedpictureframe|id3v2frame|id3v2tag|idate|' +
+ 'idn_to_ascii|idn_to_unicode|idn_to_utf8|ifx_affected_rows|ifx_blobinfile_mode|ifx_byteasvarchar|ifx_close|ifx_connect|ifx_copy_blob|' +
+ 'ifx_create_blob|ifx_create_char|ifx_do|ifx_error|ifx_errormsg|ifx_fetch_row|ifx_fieldproperties|ifx_fieldtypes|ifx_free_blob|' +
+ 'ifx_free_char|ifx_free_result|ifx_get_blob|ifx_get_char|ifx_getsqlca|ifx_htmltbl_result|ifx_nullformat|ifx_num_fields|ifx_num_rows|' +
+ 'ifx_pconnect|ifx_prepare|ifx_query|ifx_textasvarchar|ifx_update_blob|ifx_update_char|ifxus_close_slob|ifxus_create_slob|ifxus_free_slob|' +
+ 'ifxus_open_slob|ifxus_read_slob|ifxus_seek_slob|ifxus_tell_slob|ifxus_write_slob|ignore_user_abort|iis_add_server|iis_get_dir_security|' +
+ 'iis_get_script_map|iis_get_server_by_comment|iis_get_server_by_path|iis_get_server_rights|iis_get_service_state|iis_remove_server|' +
+ 'iis_set_app_settings|iis_set_dir_security|iis_set_script_map|iis_set_server_rights|iis_start_server|iis_start_service|iis_stop_server|' +
+ 'iis_stop_service|image2wbmp|image_type_to_extension|image_type_to_mime_type|imagealphablending|imageantialias|imagearc|imagechar|' +
+ 'imagecharup|imagecolorallocate|imagecolorallocatealpha|imagecolorat|imagecolorclosest|imagecolorclosestalpha|imagecolorclosesthwb|' +
+ 'imagecolordeallocate|imagecolorexact|imagecolorexactalpha|imagecolormatch|imagecolorresolve|imagecolorresolvealpha|imagecolorset|' +
+ 'imagecolorsforindex|imagecolorstotal|imagecolortransparent|imageconvolution|imagecopy|imagecopymerge|imagecopymergegray|' +
+ 'imagecopyresampled|imagecopyresized|imagecreate|imagecreatefromgd|imagecreatefromgd2|imagecreatefromgd2part|imagecreatefromgif|' +
+ 'imagecreatefromjpeg|imagecreatefrompng|imagecreatefromstring|imagecreatefromwbmp|imagecreatefromxbm|imagecreatefromxpm|' +
+ 'imagecreatetruecolor|imagedashedline|imagedestroy|imageellipse|imagefill|imagefilledarc|imagefilledellipse|imagefilledpolygon|' +
+ 'imagefilledrectangle|imagefilltoborder|imagefilter|imagefontheight|imagefontwidth|imageftbbox|imagefttext|imagegammacorrect|imagegd|' +
+ 'imagegd2|imagegif|imagegrabscreen|imagegrabwindow|imageinterlace|imageistruecolor|imagejpeg|imagelayereffect|imageline|imageloadfont|' +
+ 'imagepalettecopy|imagepng|imagepolygon|imagepsbbox|imagepsencodefont|imagepsextendfont|imagepsfreefont|imagepsloadfont|imagepsslantfont|' +
+ 'imagepstext|imagerectangle|imagerotate|imagesavealpha|imagesetbrush|imagesetpixel|imagesetstyle|imagesetthickness|imagesettile|' +
+ 'imagestring|imagestringup|imagesx|imagesy|imagetruecolortopalette|imagettfbbox|imagettftext|imagetypes|imagewbmp|imagexbm|imagick|' +
+ 'imagick_adaptiveblurimage|imagick_adaptiveresizeimage|imagick_adaptivesharpenimage|imagick_adaptivethresholdimage|imagick_addimage|' +
+ 'imagick_addnoiseimage|imagick_affinetransformimage|imagick_animateimages|imagick_annotateimage|imagick_appendimages|imagick_averageimages|' +
+ 'imagick_blackthresholdimage|imagick_blurimage|imagick_borderimage|imagick_charcoalimage|imagick_chopimage|imagick_clear|imagick_clipimage|' +
+ 'imagick_clippathimage|imagick_clone|imagick_clutimage|imagick_coalesceimages|imagick_colorfloodfillimage|imagick_colorizeimage|' +
+ 'imagick_combineimages|imagick_commentimage|imagick_compareimagechannels|imagick_compareimagelayers|imagick_compareimages|' +
+ 'imagick_compositeimage|imagick_construct|imagick_contrastimage|imagick_contraststretchimage|imagick_convolveimage|imagick_cropimage|' +
+ 'imagick_cropthumbnailimage|imagick_current|imagick_cyclecolormapimage|imagick_decipherimage|imagick_deconstructimages|' +
+ 'imagick_deleteimageartifact|imagick_despeckleimage|imagick_destroy|imagick_displayimage|imagick_displayimages|imagick_distortimage|' +
+ 'imagick_drawimage|imagick_edgeimage|imagick_embossimage|imagick_encipherimage|imagick_enhanceimage|imagick_equalizeimage|' +
+ 'imagick_evaluateimage|imagick_extentimage|imagick_flattenimages|imagick_flipimage|imagick_floodfillpaintimage|imagick_flopimage|' +
+ 'imagick_frameimage|imagick_fximage|imagick_gammaimage|imagick_gaussianblurimage|imagick_getcolorspace|imagick_getcompression|' +
+ 'imagick_getcompressionquality|imagick_getcopyright|imagick_getfilename|imagick_getfont|imagick_getformat|imagick_getgravity|' +
+ 'imagick_gethomeurl|imagick_getimage|imagick_getimagealphachannel|imagick_getimageartifact|imagick_getimagebackgroundcolor|' +
+ 'imagick_getimageblob|imagick_getimageblueprimary|imagick_getimagebordercolor|imagick_getimagechanneldepth|' +
+ 'imagick_getimagechanneldistortion|imagick_getimagechanneldistortions|imagick_getimagechannelextrema|imagick_getimagechannelmean|' +
+ 'imagick_getimagechannelrange|imagick_getimagechannelstatistics|imagick_getimageclipmask|imagick_getimagecolormapcolor|' +
+ 'imagick_getimagecolors|imagick_getimagecolorspace|imagick_getimagecompose|imagick_getimagecompression|imagick_getimagecompressionquality|' +
+ 'imagick_getimagedelay|imagick_getimagedepth|imagick_getimagedispose|imagick_getimagedistortion|imagick_getimageextrema|' +
+ 'imagick_getimagefilename|imagick_getimageformat|imagick_getimagegamma|imagick_getimagegeometry|imagick_getimagegravity|' +
+ 'imagick_getimagegreenprimary|imagick_getimageheight|imagick_getimagehistogram|imagick_getimageindex|imagick_getimageinterlacescheme|' +
+ 'imagick_getimageinterpolatemethod|imagick_getimageiterations|imagick_getimagelength|imagick_getimagemagicklicense|imagick_getimagematte|' +
+ 'imagick_getimagemattecolor|imagick_getimageorientation|imagick_getimagepage|imagick_getimagepixelcolor|imagick_getimageprofile|' +
+ 'imagick_getimageprofiles|imagick_getimageproperties|imagick_getimageproperty|imagick_getimageredprimary|imagick_getimageregion|' +
+ 'imagick_getimagerenderingintent|imagick_getimageresolution|imagick_getimagesblob|imagick_getimagescene|imagick_getimagesignature|' +
+ 'imagick_getimagesize|imagick_getimagetickspersecond|imagick_getimagetotalinkdensity|imagick_getimagetype|imagick_getimageunits|' +
+ 'imagick_getimagevirtualpixelmethod|imagick_getimagewhitepoint|imagick_getimagewidth|imagick_getinterlacescheme|imagick_getiteratorindex|' +
+ 'imagick_getnumberimages|imagick_getoption|imagick_getpackagename|imagick_getpage|imagick_getpixeliterator|imagick_getpixelregioniterator|' +
+ 'imagick_getpointsize|imagick_getquantumdepth|imagick_getquantumrange|imagick_getreleasedate|imagick_getresource|imagick_getresourcelimit|' +
+ 'imagick_getsamplingfactors|imagick_getsize|imagick_getsizeoffset|imagick_getversion|imagick_hasnextimage|imagick_haspreviousimage|' +
+ 'imagick_identifyimage|imagick_implodeimage|imagick_labelimage|imagick_levelimage|imagick_linearstretchimage|imagick_liquidrescaleimage|' +
+ 'imagick_magnifyimage|imagick_mapimage|imagick_mattefloodfillimage|imagick_medianfilterimage|imagick_mergeimagelayers|imagick_minifyimage|' +
+ 'imagick_modulateimage|imagick_montageimage|imagick_morphimages|imagick_mosaicimages|imagick_motionblurimage|imagick_negateimage|' +
+ 'imagick_newimage|imagick_newpseudoimage|imagick_nextimage|imagick_normalizeimage|imagick_oilpaintimage|imagick_opaquepaintimage|' +
+ 'imagick_optimizeimagelayers|imagick_orderedposterizeimage|imagick_paintfloodfillimage|imagick_paintopaqueimage|' +
+ 'imagick_painttransparentimage|imagick_pingimage|imagick_pingimageblob|imagick_pingimagefile|imagick_polaroidimage|imagick_posterizeimage|' +
+ 'imagick_previewimages|imagick_previousimage|imagick_profileimage|imagick_quantizeimage|imagick_quantizeimages|imagick_queryfontmetrics|' +
+ 'imagick_queryfonts|imagick_queryformats|imagick_radialblurimage|imagick_raiseimage|imagick_randomthresholdimage|imagick_readimage|' +
+ 'imagick_readimageblob|imagick_readimagefile|imagick_recolorimage|imagick_reducenoiseimage|imagick_removeimage|imagick_removeimageprofile|' +
+ 'imagick_render|imagick_resampleimage|imagick_resetimagepage|imagick_resizeimage|imagick_rollimage|imagick_rotateimage|' +
+ 'imagick_roundcorners|imagick_sampleimage|imagick_scaleimage|imagick_separateimagechannel|imagick_sepiatoneimage|' +
+ 'imagick_setbackgroundcolor|imagick_setcolorspace|imagick_setcompression|imagick_setcompressionquality|imagick_setfilename|' +
+ 'imagick_setfirstiterator|imagick_setfont|imagick_setformat|imagick_setgravity|imagick_setimage|imagick_setimagealphachannel|' +
+ 'imagick_setimageartifact|imagick_setimagebackgroundcolor|imagick_setimagebias|imagick_setimageblueprimary|imagick_setimagebordercolor|' +
+ 'imagick_setimagechanneldepth|imagick_setimageclipmask|imagick_setimagecolormapcolor|imagick_setimagecolorspace|imagick_setimagecompose|' +
+ 'imagick_setimagecompression|imagick_setimagecompressionquality|imagick_setimagedelay|imagick_setimagedepth|imagick_setimagedispose|' +
+ 'imagick_setimageextent|imagick_setimagefilename|imagick_setimageformat|imagick_setimagegamma|imagick_setimagegravity|' +
+ 'imagick_setimagegreenprimary|imagick_setimageindex|imagick_setimageinterlacescheme|imagick_setimageinterpolatemethod|' +
+ 'imagick_setimageiterations|imagick_setimagematte|imagick_setimagemattecolor|imagick_setimageopacity|imagick_setimageorientation|' +
+ 'imagick_setimagepage|imagick_setimageprofile|imagick_setimageproperty|imagick_setimageredprimary|imagick_setimagerenderingintent|' +
+ 'imagick_setimageresolution|imagick_setimagescene|imagick_setimagetickspersecond|imagick_setimagetype|imagick_setimageunits|' +
+ 'imagick_setimagevirtualpixelmethod|imagick_setimagewhitepoint|imagick_setinterlacescheme|imagick_setiteratorindex|imagick_setlastiterator|' +
+ 'imagick_setoption|imagick_setpage|imagick_setpointsize|imagick_setresolution|imagick_setresourcelimit|imagick_setsamplingfactors|' +
+ 'imagick_setsize|imagick_setsizeoffset|imagick_settype|imagick_shadeimage|imagick_shadowimage|imagick_sharpenimage|imagick_shaveimage|' +
+ 'imagick_shearimage|imagick_sigmoidalcontrastimage|imagick_sketchimage|imagick_solarizeimage|imagick_spliceimage|imagick_spreadimage|' +
+ 'imagick_steganoimage|imagick_stereoimage|imagick_stripimage|imagick_swirlimage|imagick_textureimage|imagick_thresholdimage|' +
+ 'imagick_thumbnailimage|imagick_tintimage|imagick_transformimage|imagick_transparentpaintimage|imagick_transposeimage|' +
+ 'imagick_transverseimage|imagick_trimimage|imagick_uniqueimagecolors|imagick_unsharpmaskimage|imagick_valid|imagick_vignetteimage|' +
+ 'imagick_waveimage|imagick_whitethresholdimage|imagick_writeimage|imagick_writeimagefile|imagick_writeimages|imagick_writeimagesfile|' +
+ 'imagickdraw|imagickdraw_affine|imagickdraw_annotation|imagickdraw_arc|imagickdraw_bezier|imagickdraw_circle|imagickdraw_clear|' +
+ 'imagickdraw_clone|imagickdraw_color|imagickdraw_comment|imagickdraw_composite|imagickdraw_construct|imagickdraw_destroy|' +
+ 'imagickdraw_ellipse|imagickdraw_getclippath|imagickdraw_getcliprule|imagickdraw_getclipunits|imagickdraw_getfillcolor|' +
+ 'imagickdraw_getfillopacity|imagickdraw_getfillrule|imagickdraw_getfont|imagickdraw_getfontfamily|imagickdraw_getfontsize|' +
+ 'imagickdraw_getfontstyle|imagickdraw_getfontweight|imagickdraw_getgravity|imagickdraw_getstrokeantialias|imagickdraw_getstrokecolor|' +
+ 'imagickdraw_getstrokedasharray|imagickdraw_getstrokedashoffset|imagickdraw_getstrokelinecap|imagickdraw_getstrokelinejoin|' +
+ 'imagickdraw_getstrokemiterlimit|imagickdraw_getstrokeopacity|imagickdraw_getstrokewidth|imagickdraw_gettextalignment|' +
+ 'imagickdraw_gettextantialias|imagickdraw_gettextdecoration|imagickdraw_gettextencoding|imagickdraw_gettextundercolor|' +
+ 'imagickdraw_getvectorgraphics|imagickdraw_line|imagickdraw_matte|imagickdraw_pathclose|imagickdraw_pathcurvetoabsolute|' +
+ 'imagickdraw_pathcurvetoquadraticbezierabsolute|imagickdraw_pathcurvetoquadraticbezierrelative|' +
+ 'imagickdraw_pathcurvetoquadraticbeziersmoothabsolute|imagickdraw_pathcurvetoquadraticbeziersmoothrelative|imagickdraw_pathcurvetorelative|' +
+ 'imagickdraw_pathcurvetosmoothabsolute|imagickdraw_pathcurvetosmoothrelative|imagickdraw_pathellipticarcabsolute|' +
+ 'imagickdraw_pathellipticarcrelative|imagickdraw_pathfinish|imagickdraw_pathlinetoabsolute|imagickdraw_pathlinetohorizontalabsolute|' +
+ 'imagickdraw_pathlinetohorizontalrelative|imagickdraw_pathlinetorelative|imagickdraw_pathlinetoverticalabsolute|' +
+ 'imagickdraw_pathlinetoverticalrelative|imagickdraw_pathmovetoabsolute|imagickdraw_pathmovetorelative|imagickdraw_pathstart|' +
+ 'imagickdraw_point|imagickdraw_polygon|imagickdraw_polyline|imagickdraw_pop|imagickdraw_popclippath|imagickdraw_popdefs|' +
+ 'imagickdraw_poppattern|imagickdraw_push|imagickdraw_pushclippath|imagickdraw_pushdefs|imagickdraw_pushpattern|imagickdraw_rectangle|' +
+ 'imagickdraw_render|imagickdraw_rotate|imagickdraw_roundrectangle|imagickdraw_scale|imagickdraw_setclippath|imagickdraw_setcliprule|' +
+ 'imagickdraw_setclipunits|imagickdraw_setfillalpha|imagickdraw_setfillcolor|imagickdraw_setfillopacity|imagickdraw_setfillpatternurl|' +
+ 'imagickdraw_setfillrule|imagickdraw_setfont|imagickdraw_setfontfamily|imagickdraw_setfontsize|imagickdraw_setfontstretch|' +
+ 'imagickdraw_setfontstyle|imagickdraw_setfontweight|imagickdraw_setgravity|imagickdraw_setstrokealpha|imagickdraw_setstrokeantialias|' +
+ 'imagickdraw_setstrokecolor|imagickdraw_setstrokedasharray|imagickdraw_setstrokedashoffset|imagickdraw_setstrokelinecap|' +
+ 'imagickdraw_setstrokelinejoin|imagickdraw_setstrokemiterlimit|imagickdraw_setstrokeopacity|imagickdraw_setstrokepatternurl|' +
+ 'imagickdraw_setstrokewidth|imagickdraw_settextalignment|imagickdraw_settextantialias|imagickdraw_settextdecoration|' +
+ 'imagickdraw_settextencoding|imagickdraw_settextundercolor|imagickdraw_setvectorgraphics|imagickdraw_setviewbox|imagickdraw_skewx|' +
+ 'imagickdraw_skewy|imagickdraw_translate|imagickpixel|imagickpixel_clear|imagickpixel_construct|imagickpixel_destroy|imagickpixel_getcolor|' +
+ 'imagickpixel_getcolorasstring|imagickpixel_getcolorcount|imagickpixel_getcolorvalue|imagickpixel_gethsl|imagickpixel_issimilar|' +
+ 'imagickpixel_setcolor|imagickpixel_setcolorvalue|imagickpixel_sethsl|imagickpixeliterator|imagickpixeliterator_clear|' +
+ 'imagickpixeliterator_construct|imagickpixeliterator_destroy|imagickpixeliterator_getcurrentiteratorrow|' +
+ 'imagickpixeliterator_getiteratorrow|imagickpixeliterator_getnextiteratorrow|imagickpixeliterator_getpreviousiteratorrow|' +
+ 'imagickpixeliterator_newpixeliterator|imagickpixeliterator_newpixelregioniterator|imagickpixeliterator_resetiterator|' +
+ 'imagickpixeliterator_setiteratorfirstrow|imagickpixeliterator_setiteratorlastrow|imagickpixeliterator_setiteratorrow|' +
+ 'imagickpixeliterator_synciterator|imap_8bit|imap_alerts|imap_append|imap_base64|imap_binary|imap_body|imap_bodystruct|imap_check|' +
+ 'imap_clearflag_full|imap_close|imap_create|imap_createmailbox|imap_delete|imap_deletemailbox|imap_errors|imap_expunge|imap_fetch_overview|' +
+ 'imap_fetchbody|imap_fetchheader|imap_fetchmime|imap_fetchstructure|imap_fetchtext|imap_gc|imap_get_quota|imap_get_quotaroot|imap_getacl|' +
+ 'imap_getmailboxes|imap_getsubscribed|imap_header|imap_headerinfo|imap_headers|imap_last_error|imap_list|imap_listmailbox|imap_listscan|' +
+ 'imap_listsubscribed|imap_lsub|imap_mail|imap_mail_compose|imap_mail_copy|imap_mail_move|imap_mailboxmsginfo|imap_mime_header_decode|' +
+ 'imap_msgno|imap_num_msg|imap_num_recent|imap_open|imap_ping|imap_qprint|imap_rename|imap_renamemailbox|imap_reopen|' +
+ 'imap_rfc822_parse_adrlist|imap_rfc822_parse_headers|imap_rfc822_write_address|imap_savebody|imap_scan|imap_scanmailbox|imap_search|' +
+ 'imap_set_quota|imap_setacl|imap_setflag_full|imap_sort|imap_status|imap_subscribe|imap_thread|imap_timeout|imap_uid|imap_undelete|' +
+ 'imap_unsubscribe|imap_utf7_decode|imap_utf7_encode|imap_utf8|implementsinterface|implode|import_request_variables|in_array|include|' +
+ 'include_once|inclued_get_data|inet_ntop|inet_pton|infiniteiterator|ingres_autocommit|ingres_autocommit_state|ingres_charset|ingres_close|' +
+ 'ingres_commit|ingres_connect|ingres_cursor|ingres_errno|ingres_error|ingres_errsqlstate|ingres_escape_string|ingres_execute|' +
+ 'ingres_fetch_array|ingres_fetch_assoc|ingres_fetch_object|ingres_fetch_proc_return|ingres_fetch_row|ingres_field_length|ingres_field_name|' +
+ 'ingres_field_nullable|ingres_field_precision|ingres_field_scale|ingres_field_type|ingres_free_result|ingres_next_error|ingres_num_fields|' +
+ 'ingres_num_rows|ingres_pconnect|ingres_prepare|ingres_query|ingres_result_seek|ingres_rollback|ingres_set_environment|' +
+ 'ingres_unbuffered_query|ini_alter|ini_get|ini_get_all|ini_restore|ini_set|innamespace|inotify_add_watch|inotify_init|inotify_queue_len|' +
+ 'inotify_read|inotify_rm_watch|interface_exists|intl_error_name|intl_get_error_code|intl_get_error_message|intl_is_failure|' +
+ 'intldateformatter|intval|invalidargumentexception|invoke|invokeargs|ip2long|iptcembed|iptcparse|is_a|is_array|is_bool|is_callable|is_dir|' +
+ 'is_double|is_executable|is_file|is_finite|is_float|is_infinite|is_int|is_integer|is_link|is_long|is_nan|is_null|is_numeric|is_object|' +
+ 'is_readable|is_real|is_resource|is_scalar|is_soap_fault|is_string|is_subclass_of|is_uploaded_file|is_writable|is_writeable|isabstract|' +
+ 'iscloneable|isdisabled|isfinal|isinstance|isinstantiable|isinterface|isinternal|isiterateable|isset|issubclassof|isuserdefined|iterator|' +
+ 'iterator_apply|iterator_count|iterator_to_array|iteratoraggregate|iteratoriterator|java_last_exception_clear|java_last_exception_get|' +
+ 'jddayofweek|jdmonthname|jdtofrench|jdtogregorian|jdtojewish|jdtojulian|jdtounix|jewishtojd|join|jpeg2wbmp|json_decode|json_encode|' +
+ 'json_last_error|jsonserializable|judy|judy_type|judy_version|juliantojd|kadm5_chpass_principal|kadm5_create_principal|' +
+ 'kadm5_delete_principal|kadm5_destroy|kadm5_flush|kadm5_get_policies|kadm5_get_principal|kadm5_get_principals|kadm5_init_with_password|' +
+ 'kadm5_modify_principal|key|krsort|ksort|lcfirst|lcg_value|lchgrp|lchown|ldap_8859_to_t61|ldap_add|ldap_bind|ldap_close|ldap_compare|' +
+ 'ldap_connect|ldap_count_entries|ldap_delete|ldap_dn2ufn|ldap_err2str|ldap_errno|ldap_error|ldap_explode_dn|ldap_first_attribute|' +
+ 'ldap_first_entry|ldap_first_reference|ldap_free_result|ldap_get_attributes|ldap_get_dn|ldap_get_entries|ldap_get_option|ldap_get_values|' +
+ 'ldap_get_values_len|ldap_list|ldap_mod_add|ldap_mod_del|ldap_mod_replace|ldap_modify|ldap_next_attribute|ldap_next_entry|' +
+ 'ldap_next_reference|ldap_parse_reference|ldap_parse_result|ldap_read|ldap_rename|ldap_sasl_bind|ldap_search|ldap_set_option|' +
+ 'ldap_set_rebind_proc|ldap_sort|ldap_start_tls|ldap_t61_to_8859|ldap_unbind|lengthexception|levenshtein|libxml_clear_errors|' +
+ 'libxml_disable_entity_loader|libxml_get_errors|libxml_get_last_error|libxml_set_streams_context|libxml_use_internal_errors|libxmlerror|' +
+ 'limititerator|link|linkinfo|list|locale|localeconv|localtime|log|log10|log1p|logicexception|long2ip|lstat|ltrim|lzf_compress|' +
+ 'lzf_decompress|lzf_optimized_for|m_checkstatus|m_completeauthorizations|m_connect|m_connectionerror|m_deletetrans|m_destroyconn|' +
+ 'm_destroyengine|m_getcell|m_getcellbynum|m_getcommadelimited|m_getheader|m_initconn|m_initengine|m_iscommadelimited|m_maxconntimeout|' +
+ 'm_monitor|m_numcolumns|m_numrows|m_parsecommadelimited|m_responsekeys|m_responseparam|m_returnstatus|m_setblocking|m_setdropfile|m_setip|' +
+ 'm_setssl|m_setssl_cafile|m_setssl_files|m_settimeout|m_sslcert_gen_hash|m_transactionssent|m_transinqueue|m_transkeyval|m_transnew|' +
+ 'm_transsend|m_uwait|m_validateidentifier|m_verifyconnection|m_verifysslcert|magic_quotes_runtime|mail|' +
+ 'mailparse_determine_best_xfer_encoding|mailparse_msg_create|mailparse_msg_extract_part|mailparse_msg_extract_part_file|' +
+ 'mailparse_msg_extract_whole_part_file|mailparse_msg_free|mailparse_msg_get_part|mailparse_msg_get_part_data|mailparse_msg_get_structure|' +
+ 'mailparse_msg_parse|mailparse_msg_parse_file|mailparse_rfc822_parse_addresses|mailparse_stream_encode|mailparse_uudecode_all|main|max|' +
+ 'maxdb_affected_rows|maxdb_autocommit|maxdb_bind_param|maxdb_bind_result|maxdb_change_user|maxdb_character_set_name|maxdb_client_encoding|' +
+ 'maxdb_close|maxdb_close_long_data|maxdb_commit|maxdb_connect|maxdb_connect_errno|maxdb_connect_error|maxdb_data_seek|maxdb_debug|' +
+ 'maxdb_disable_reads_from_master|maxdb_disable_rpl_parse|maxdb_dump_debug_info|maxdb_embedded_connect|maxdb_enable_reads_from_master|' +
+ 'maxdb_enable_rpl_parse|maxdb_errno|maxdb_error|maxdb_escape_string|maxdb_execute|maxdb_fetch|maxdb_fetch_array|maxdb_fetch_assoc|' +
+ 'maxdb_fetch_field|maxdb_fetch_field_direct|maxdb_fetch_fields|maxdb_fetch_lengths|maxdb_fetch_object|maxdb_fetch_row|maxdb_field_count|' +
+ 'maxdb_field_seek|maxdb_field_tell|maxdb_free_result|maxdb_get_client_info|maxdb_get_client_version|maxdb_get_host_info|maxdb_get_metadata|' +
+ 'maxdb_get_proto_info|maxdb_get_server_info|maxdb_get_server_version|maxdb_info|maxdb_init|maxdb_insert_id|maxdb_kill|maxdb_master_query|' +
+ 'maxdb_more_results|maxdb_multi_query|maxdb_next_result|maxdb_num_fields|maxdb_num_rows|maxdb_options|maxdb_param_count|maxdb_ping|' +
+ 'maxdb_prepare|maxdb_query|maxdb_real_connect|maxdb_real_escape_string|maxdb_real_query|maxdb_report|maxdb_rollback|' +
+ 'maxdb_rpl_parse_enabled|maxdb_rpl_probe|maxdb_rpl_query_type|maxdb_select_db|maxdb_send_long_data|maxdb_send_query|maxdb_server_end|' +
+ 'maxdb_server_init|maxdb_set_opt|maxdb_sqlstate|maxdb_ssl_set|maxdb_stat|maxdb_stmt_affected_rows|maxdb_stmt_bind_param|' +
+ 'maxdb_stmt_bind_result|maxdb_stmt_close|maxdb_stmt_close_long_data|maxdb_stmt_data_seek|maxdb_stmt_errno|maxdb_stmt_error|' +
+ 'maxdb_stmt_execute|maxdb_stmt_fetch|maxdb_stmt_free_result|maxdb_stmt_init|maxdb_stmt_num_rows|maxdb_stmt_param_count|maxdb_stmt_prepare|' +
+ 'maxdb_stmt_reset|maxdb_stmt_result_metadata|maxdb_stmt_send_long_data|maxdb_stmt_sqlstate|maxdb_stmt_store_result|maxdb_store_result|' +
+ 'maxdb_thread_id|maxdb_thread_safe|maxdb_use_result|maxdb_warning_count|mb_check_encoding|mb_convert_case|mb_convert_encoding|' +
+ 'mb_convert_kana|mb_convert_variables|mb_decode_mimeheader|mb_decode_numericentity|mb_detect_encoding|mb_detect_order|mb_encode_mimeheader|' +
+ 'mb_encode_numericentity|mb_encoding_aliases|mb_ereg|mb_ereg_match|mb_ereg_replace|mb_ereg_search|mb_ereg_search_getpos|' +
+ 'mb_ereg_search_getregs|mb_ereg_search_init|mb_ereg_search_pos|mb_ereg_search_regs|mb_ereg_search_setpos|mb_eregi|mb_eregi_replace|' +
+ 'mb_get_info|mb_http_input|mb_http_output|mb_internal_encoding|mb_language|mb_list_encodings|mb_output_handler|mb_parse_str|' +
+ 'mb_preferred_mime_name|mb_regex_encoding|mb_regex_set_options|mb_send_mail|mb_split|mb_strcut|mb_strimwidth|mb_stripos|mb_stristr|' +
+ 'mb_strlen|mb_strpos|mb_strrchr|mb_strrichr|mb_strripos|mb_strrpos|mb_strstr|mb_strtolower|mb_strtoupper|mb_strwidth|' +
+ 'mb_substitute_character|mb_substr|mb_substr_count|mcrypt_cbc|mcrypt_cfb|mcrypt_create_iv|mcrypt_decrypt|mcrypt_ecb|' +
+ 'mcrypt_enc_get_algorithms_name|mcrypt_enc_get_block_size|mcrypt_enc_get_iv_size|mcrypt_enc_get_key_size|mcrypt_enc_get_modes_name|' +
+ 'mcrypt_enc_get_supported_key_sizes|mcrypt_enc_is_block_algorithm|mcrypt_enc_is_block_algorithm_mode|mcrypt_enc_is_block_mode|' +
+ 'mcrypt_enc_self_test|mcrypt_encrypt|mcrypt_generic|mcrypt_generic_deinit|mcrypt_generic_end|mcrypt_generic_init|mcrypt_get_block_size|' +
+ 'mcrypt_get_cipher_name|mcrypt_get_iv_size|mcrypt_get_key_size|mcrypt_list_algorithms|mcrypt_list_modes|mcrypt_module_close|' +
+ 'mcrypt_module_get_algo_block_size|mcrypt_module_get_algo_key_size|mcrypt_module_get_supported_key_sizes|mcrypt_module_is_block_algorithm|' +
+ 'mcrypt_module_is_block_algorithm_mode|mcrypt_module_is_block_mode|mcrypt_module_open|mcrypt_module_self_test|mcrypt_ofb|md5|md5_file|' +
+ 'mdecrypt_generic|memcache|memcache_debug|memcached|memory_get_peak_usage|memory_get_usage|messageformatter|metaphone|method_exists|mhash|' +
+ 'mhash_count|mhash_get_block_size|mhash_get_hash_name|mhash_keygen_s2k|microtime|mime_content_type|min|ming_keypress|' +
+ 'ming_setcubicthreshold|ming_setscale|ming_setswfcompression|ming_useconstants|ming_useswfversion|mkdir|mktime|money_format|mongo|' +
+ 'mongobindata|mongocode|mongocollection|mongoconnectionexception|mongocursor|mongocursorexception|mongocursortimeoutexception|mongodate|' +
+ 'mongodb|mongodbref|mongoexception|mongogridfs|mongogridfscursor|mongogridfsexception|mongogridfsfile|mongoid|mongoint32|mongoint64|' +
+ 'mongomaxkey|mongominkey|mongoregex|mongotimestamp|move_uploaded_file|mpegfile|mqseries_back|mqseries_begin|mqseries_close|mqseries_cmit|' +
+ 'mqseries_conn|mqseries_connx|mqseries_disc|mqseries_get|mqseries_inq|mqseries_open|mqseries_put|mqseries_put1|mqseries_set|' +
+ 'mqseries_strerror|msession_connect|msession_count|msession_create|msession_destroy|msession_disconnect|msession_find|msession_get|' +
+ 'msession_get_array|msession_get_data|msession_inc|msession_list|msession_listvar|msession_lock|msession_plugin|msession_randstr|' +
+ 'msession_set|msession_set_array|msession_set_data|msession_timeout|msession_uniq|msession_unlock|msg_get_queue|msg_queue_exists|' +
+ 'msg_receive|msg_remove_queue|msg_send|msg_set_queue|msg_stat_queue|msql|msql_affected_rows|msql_close|msql_connect|msql_create_db|' +
+ 'msql_createdb|msql_data_seek|msql_db_query|msql_dbname|msql_drop_db|msql_error|msql_fetch_array|msql_fetch_field|msql_fetch_object|' +
+ 'msql_fetch_row|msql_field_flags|msql_field_len|msql_field_name|msql_field_seek|msql_field_table|msql_field_type|msql_fieldflags|' +
+ 'msql_fieldlen|msql_fieldname|msql_fieldtable|msql_fieldtype|msql_free_result|msql_list_dbs|msql_list_fields|msql_list_tables|' +
+ 'msql_num_fields|msql_num_rows|msql_numfields|msql_numrows|msql_pconnect|msql_query|msql_regcase|msql_result|msql_select_db|msql_tablename|' +
+ 'mssql_bind|mssql_close|mssql_connect|mssql_data_seek|mssql_execute|mssql_fetch_array|mssql_fetch_assoc|mssql_fetch_batch|' +
+ 'mssql_fetch_field|mssql_fetch_object|mssql_fetch_row|mssql_field_length|mssql_field_name|mssql_field_seek|mssql_field_type|' +
+ 'mssql_free_result|mssql_free_statement|mssql_get_last_message|mssql_guid_string|mssql_init|mssql_min_error_severity|' +
+ 'mssql_min_message_severity|mssql_next_result|mssql_num_fields|mssql_num_rows|mssql_pconnect|mssql_query|mssql_result|mssql_rows_affected|' +
+ 'mssql_select_db|mt_getrandmax|mt_rand|mt_srand|multipleiterator|mysql_affected_rows|mysql_client_encoding|mysql_close|mysql_connect|' +
+ 'mysql_create_db|mysql_data_seek|mysql_db_name|mysql_db_query|mysql_drop_db|mysql_errno|mysql_error|mysql_escape_string|mysql_fetch_array|' +
+ 'mysql_fetch_assoc|mysql_fetch_field|mysql_fetch_lengths|mysql_fetch_object|mysql_fetch_row|mysql_field_flags|mysql_field_len|' +
+ 'mysql_field_name|mysql_field_seek|mysql_field_table|mysql_field_type|mysql_free_result|mysql_get_client_info|mysql_get_host_info|' +
+ 'mysql_get_proto_info|mysql_get_server_info|mysql_info|mysql_insert_id|mysql_list_dbs|mysql_list_fields|mysql_list_processes|' +
+ 'mysql_list_tables|mysql_num_fields|mysql_num_rows|mysql_pconnect|mysql_ping|mysql_query|mysql_real_escape_string|mysql_result|' +
+ 'mysql_select_db|mysql_set_charset|mysql_stat|mysql_tablename|mysql_thread_id|mysql_unbuffered_query|mysqli|mysqli_bind_param|' +
+ 'mysqli_bind_result|mysqli_client_encoding|mysqli_connect|mysqli_disable_reads_from_master|mysqli_disable_rpl_parse|mysqli_driver|' +
+ 'mysqli_enable_reads_from_master|mysqli_enable_rpl_parse|mysqli_escape_string|mysqli_execute|mysqli_fetch|mysqli_get_metadata|' +
+ 'mysqli_master_query|mysqli_param_count|mysqli_report|mysqli_result|mysqli_rpl_parse_enabled|mysqli_rpl_probe|mysqli_rpl_query_type|' +
+ 'mysqli_send_long_data|mysqli_send_query|mysqli_set_opt|mysqli_slave_query|mysqli_stmt|mysqli_warning|mysqlnd_ms_get_stats|' +
+ 'mysqlnd_ms_query_is_select|mysqlnd_ms_set_user_pick_server|mysqlnd_qc_change_handler|mysqlnd_qc_clear_cache|mysqlnd_qc_get_cache_info|' +
+ 'mysqlnd_qc_get_core_stats|mysqlnd_qc_get_handler|mysqlnd_qc_get_query_trace_log|mysqlnd_qc_set_user_handlers|natcasesort|natsort|' +
+ 'ncurses_addch|ncurses_addchnstr|ncurses_addchstr|ncurses_addnstr|ncurses_addstr|ncurses_assume_default_colors|ncurses_attroff|' +
+ 'ncurses_attron|ncurses_attrset|ncurses_baudrate|ncurses_beep|ncurses_bkgd|ncurses_bkgdset|ncurses_border|ncurses_bottom_panel|' +
+ 'ncurses_can_change_color|ncurses_cbreak|ncurses_clear|ncurses_clrtobot|ncurses_clrtoeol|ncurses_color_content|ncurses_color_set|' +
+ 'ncurses_curs_set|ncurses_def_prog_mode|ncurses_def_shell_mode|ncurses_define_key|ncurses_del_panel|ncurses_delay_output|ncurses_delch|' +
+ 'ncurses_deleteln|ncurses_delwin|ncurses_doupdate|ncurses_echo|ncurses_echochar|ncurses_end|ncurses_erase|ncurses_erasechar|ncurses_filter|' +
+ 'ncurses_flash|ncurses_flushinp|ncurses_getch|ncurses_getmaxyx|ncurses_getmouse|ncurses_getyx|ncurses_halfdelay|ncurses_has_colors|' +
+ 'ncurses_has_ic|ncurses_has_il|ncurses_has_key|ncurses_hide_panel|ncurses_hline|ncurses_inch|ncurses_init|ncurses_init_color|' +
+ 'ncurses_init_pair|ncurses_insch|ncurses_insdelln|ncurses_insertln|ncurses_insstr|ncurses_instr|ncurses_isendwin|ncurses_keyok|' +
+ 'ncurses_keypad|ncurses_killchar|ncurses_longname|ncurses_meta|ncurses_mouse_trafo|ncurses_mouseinterval|ncurses_mousemask|ncurses_move|' +
+ 'ncurses_move_panel|ncurses_mvaddch|ncurses_mvaddchnstr|ncurses_mvaddchstr|ncurses_mvaddnstr|ncurses_mvaddstr|ncurses_mvcur|' +
+ 'ncurses_mvdelch|ncurses_mvgetch|ncurses_mvhline|ncurses_mvinch|ncurses_mvvline|ncurses_mvwaddstr|ncurses_napms|ncurses_new_panel|' +
+ 'ncurses_newpad|ncurses_newwin|ncurses_nl|ncurses_nocbreak|ncurses_noecho|ncurses_nonl|ncurses_noqiflush|ncurses_noraw|' +
+ 'ncurses_pair_content|ncurses_panel_above|ncurses_panel_below|ncurses_panel_window|ncurses_pnoutrefresh|ncurses_prefresh|ncurses_putp|' +
+ 'ncurses_qiflush|ncurses_raw|ncurses_refresh|ncurses_replace_panel|ncurses_reset_prog_mode|ncurses_reset_shell_mode|ncurses_resetty|' +
+ 'ncurses_savetty|ncurses_scr_dump|ncurses_scr_init|ncurses_scr_restore|ncurses_scr_set|ncurses_scrl|ncurses_show_panel|ncurses_slk_attr|' +
+ 'ncurses_slk_attroff|ncurses_slk_attron|ncurses_slk_attrset|ncurses_slk_clear|ncurses_slk_color|ncurses_slk_init|ncurses_slk_noutrefresh|' +
+ 'ncurses_slk_refresh|ncurses_slk_restore|ncurses_slk_set|ncurses_slk_touch|ncurses_standend|ncurses_standout|ncurses_start_color|' +
+ 'ncurses_termattrs|ncurses_termname|ncurses_timeout|ncurses_top_panel|ncurses_typeahead|ncurses_ungetch|ncurses_ungetmouse|' +
+ 'ncurses_update_panels|ncurses_use_default_colors|ncurses_use_env|ncurses_use_extended_names|ncurses_vidattr|ncurses_vline|ncurses_waddch|' +
+ 'ncurses_waddstr|ncurses_wattroff|ncurses_wattron|ncurses_wattrset|ncurses_wborder|ncurses_wclear|ncurses_wcolor_set|ncurses_werase|' +
+ 'ncurses_wgetch|ncurses_whline|ncurses_wmouse_trafo|ncurses_wmove|ncurses_wnoutrefresh|ncurses_wrefresh|ncurses_wstandend|' +
+ 'ncurses_wstandout|ncurses_wvline|newinstance|newinstanceargs|newt_bell|newt_button|newt_button_bar|newt_centered_window|newt_checkbox|' +
+ 'newt_checkbox_get_value|newt_checkbox_set_flags|newt_checkbox_set_value|newt_checkbox_tree|newt_checkbox_tree_add_item|' +
+ 'newt_checkbox_tree_find_item|newt_checkbox_tree_get_current|newt_checkbox_tree_get_entry_value|newt_checkbox_tree_get_multi_selection|' +
+ 'newt_checkbox_tree_get_selection|newt_checkbox_tree_multi|newt_checkbox_tree_set_current|newt_checkbox_tree_set_entry|' +
+ 'newt_checkbox_tree_set_entry_value|newt_checkbox_tree_set_width|newt_clear_key_buffer|newt_cls|newt_compact_button|' +
+ 'newt_component_add_callback|newt_component_takes_focus|newt_create_grid|newt_cursor_off|newt_cursor_on|newt_delay|newt_draw_form|' +
+ 'newt_draw_root_text|newt_entry|newt_entry_get_value|newt_entry_set|newt_entry_set_filter|newt_entry_set_flags|newt_finished|newt_form|' +
+ 'newt_form_add_component|newt_form_add_components|newt_form_add_hot_key|newt_form_destroy|newt_form_get_current|newt_form_run|' +
+ 'newt_form_set_background|newt_form_set_height|newt_form_set_size|newt_form_set_timer|newt_form_set_width|newt_form_watch_fd|' +
+ 'newt_get_screen_size|newt_grid_add_components_to_form|newt_grid_basic_window|newt_grid_free|newt_grid_get_size|newt_grid_h_close_stacked|' +
+ 'newt_grid_h_stacked|newt_grid_place|newt_grid_set_field|newt_grid_simple_window|newt_grid_v_close_stacked|newt_grid_v_stacked|' +
+ 'newt_grid_wrapped_window|newt_grid_wrapped_window_at|newt_init|newt_label|newt_label_set_text|newt_listbox|newt_listbox_append_entry|' +
+ 'newt_listbox_clear|newt_listbox_clear_selection|newt_listbox_delete_entry|newt_listbox_get_current|newt_listbox_get_selection|' +
+ 'newt_listbox_insert_entry|newt_listbox_item_count|newt_listbox_select_item|newt_listbox_set_current|newt_listbox_set_current_by_key|' +
+ 'newt_listbox_set_data|newt_listbox_set_entry|newt_listbox_set_width|newt_listitem|newt_listitem_get_data|newt_listitem_set|' +
+ 'newt_open_window|newt_pop_help_line|newt_pop_window|newt_push_help_line|newt_radio_get_current|newt_radiobutton|newt_redraw_help_line|' +
+ 'newt_reflow_text|newt_refresh|newt_resize_screen|newt_resume|newt_run_form|newt_scale|newt_scale_set|newt_scrollbar_set|' +
+ 'newt_set_help_callback|newt_set_suspend_callback|newt_suspend|newt_textbox|newt_textbox_get_num_lines|newt_textbox_reflowed|' +
+ 'newt_textbox_set_height|newt_textbox_set_text|newt_vertical_scrollbar|newt_wait_for_key|newt_win_choice|newt_win_entries|newt_win_menu|' +
+ 'newt_win_message|newt_win_messagev|newt_win_ternary|next|ngettext|nl2br|nl_langinfo|norewinditerator|normalizer|notes_body|notes_copy_db|' +
+ 'notes_create_db|notes_create_note|notes_drop_db|notes_find_note|notes_header_info|notes_list_msgs|notes_mark_read|notes_mark_unread|' +
+ 'notes_nav_create|notes_search|notes_unread|notes_version|nsapi_request_headers|nsapi_response_headers|nsapi_virtual|nthmac|number_format|' +
+ 'numberformatter|oauth|oauth_get_sbs|oauth_urlencode|oauthexception|oauthprovider|ob_clean|ob_deflatehandler|ob_end_clean|ob_end_flush|' +
+ 'ob_etaghandler|ob_flush|ob_get_clean|ob_get_contents|ob_get_flush|ob_get_length|ob_get_level|ob_get_status|ob_gzhandler|ob_iconv_handler|' +
+ 'ob_implicit_flush|ob_inflatehandler|ob_list_handlers|ob_start|ob_tidyhandler|oci_bind_array_by_name|oci_bind_by_name|oci_cancel|' +
+ 'oci_client_version|oci_close|oci_collection_append|oci_collection_assign|oci_collection_element_assign|oci_collection_element_get|' +
+ 'oci_collection_free|oci_collection_max|oci_collection_size|oci_collection_trim|oci_commit|oci_connect|oci_define_by_name|oci_error|' +
+ 'oci_execute|oci_fetch|oci_fetch_all|oci_fetch_array|oci_fetch_assoc|oci_fetch_object|oci_fetch_row|oci_field_is_null|oci_field_name|' +
+ 'oci_field_precision|oci_field_scale|oci_field_size|oci_field_type|oci_field_type_raw|oci_free_statement|oci_internal_debug|oci_lob_append|' +
+ 'oci_lob_close|oci_lob_copy|oci_lob_eof|oci_lob_erase|oci_lob_export|oci_lob_flush|oci_lob_free|oci_lob_getbuffering|oci_lob_import|' +
+ 'oci_lob_is_equal|oci_lob_load|oci_lob_read|oci_lob_rewind|oci_lob_save|oci_lob_savefile|oci_lob_seek|oci_lob_setbuffering|oci_lob_size|' +
+ 'oci_lob_tell|oci_lob_truncate|oci_lob_write|oci_lob_writetemporary|oci_lob_writetofile|oci_new_collection|oci_new_connect|oci_new_cursor|' +
+ 'oci_new_descriptor|oci_num_fields|oci_num_rows|oci_parse|oci_password_change|oci_pconnect|oci_result|oci_rollback|oci_server_version|' +
+ 'oci_set_action|oci_set_client_identifier|oci_set_client_info|oci_set_edition|oci_set_module_name|oci_set_prefetch|oci_statement_type|' +
+ 'ocibindbyname|ocicancel|ocicloselob|ocicollappend|ocicollassign|ocicollassignelem|ocicollgetelem|ocicollmax|ocicollsize|ocicolltrim|' +
+ 'ocicolumnisnull|ocicolumnname|ocicolumnprecision|ocicolumnscale|ocicolumnsize|ocicolumntype|ocicolumntyperaw|ocicommit|ocidefinebyname|' +
+ 'ocierror|ociexecute|ocifetch|ocifetchinto|ocifetchstatement|ocifreecollection|ocifreecursor|ocifreedesc|ocifreestatement|ociinternaldebug|' +
+ 'ociloadlob|ocilogoff|ocilogon|ocinewcollection|ocinewcursor|ocinewdescriptor|ocinlogon|ocinumcols|ociparse|ociplogon|ociresult|' +
+ 'ocirollback|ocirowcount|ocisavelob|ocisavelobfile|ociserverversion|ocisetprefetch|ocistatementtype|ociwritelobtofile|ociwritetemporarylob|' +
+ 'octdec|odbc_autocommit|odbc_binmode|odbc_close|odbc_close_all|odbc_columnprivileges|odbc_columns|odbc_commit|odbc_connect|odbc_cursor|' +
+ 'odbc_data_source|odbc_do|odbc_error|odbc_errormsg|odbc_exec|odbc_execute|odbc_fetch_array|odbc_fetch_into|odbc_fetch_object|' +
+ 'odbc_fetch_row|odbc_field_len|odbc_field_name|odbc_field_num|odbc_field_precision|odbc_field_scale|odbc_field_type|odbc_foreignkeys|' +
+ 'odbc_free_result|odbc_gettypeinfo|odbc_longreadlen|odbc_next_result|odbc_num_fields|odbc_num_rows|odbc_pconnect|odbc_prepare|' +
+ 'odbc_primarykeys|odbc_procedurecolumns|odbc_procedures|odbc_result|odbc_result_all|odbc_rollback|odbc_setoption|odbc_specialcolumns|' +
+ 'odbc_statistics|odbc_tableprivileges|odbc_tables|openal_buffer_create|openal_buffer_data|openal_buffer_destroy|openal_buffer_get|' +
+ 'openal_buffer_loadwav|openal_context_create|openal_context_current|openal_context_destroy|openal_context_process|openal_context_suspend|' +
+ 'openal_device_close|openal_device_open|openal_listener_get|openal_listener_set|openal_source_create|openal_source_destroy|' +
+ 'openal_source_get|openal_source_pause|openal_source_play|openal_source_rewind|openal_source_set|openal_source_stop|openal_stream|opendir|' +
+ 'openlog|openssl_cipher_iv_length|openssl_csr_export|openssl_csr_export_to_file|openssl_csr_get_public_key|openssl_csr_get_subject|' +
+ 'openssl_csr_new|openssl_csr_sign|openssl_decrypt|openssl_dh_compute_key|openssl_digest|openssl_encrypt|openssl_error_string|' +
+ 'openssl_free_key|openssl_get_cipher_methods|openssl_get_md_methods|openssl_get_privatekey|openssl_get_publickey|openssl_open|' +
+ 'openssl_pkcs12_export|openssl_pkcs12_export_to_file|openssl_pkcs12_read|openssl_pkcs7_decrypt|openssl_pkcs7_encrypt|openssl_pkcs7_sign|' +
+ 'openssl_pkcs7_verify|openssl_pkey_export|openssl_pkey_export_to_file|openssl_pkey_free|openssl_pkey_get_details|openssl_pkey_get_private|' +
+ 'openssl_pkey_get_public|openssl_pkey_new|openssl_private_decrypt|openssl_private_encrypt|openssl_public_decrypt|openssl_public_encrypt|' +
+ 'openssl_random_pseudo_bytes|openssl_seal|openssl_sign|openssl_verify|openssl_x509_check_private_key|openssl_x509_checkpurpose|' +
+ 'openssl_x509_export|openssl_x509_export_to_file|openssl_x509_free|openssl_x509_parse|openssl_x509_read|ord|outeriterator|' +
+ 'outofboundsexception|outofrangeexception|output_add_rewrite_var|output_reset_rewrite_vars|overflowexception|overload|override_function|' +
+ 'ovrimos_close|ovrimos_commit|ovrimos_connect|ovrimos_cursor|ovrimos_exec|ovrimos_execute|ovrimos_fetch_into|ovrimos_fetch_row|' +
+ 'ovrimos_field_len|ovrimos_field_name|ovrimos_field_num|ovrimos_field_type|ovrimos_free_result|ovrimos_longreadlen|ovrimos_num_fields|' +
+ 'ovrimos_num_rows|ovrimos_prepare|ovrimos_result|ovrimos_result_all|ovrimos_rollback|pack|parentiterator|parse_ini_file|parse_ini_string|' +
+ 'parse_str|parse_url|parsekit_compile_file|parsekit_compile_string|parsekit_func_arginfo|passthru|pathinfo|pclose|pcntl_alarm|pcntl_exec|' +
+ 'pcntl_fork|pcntl_getpriority|pcntl_setpriority|pcntl_signal|pcntl_signal_dispatch|pcntl_sigprocmask|pcntl_sigtimedwait|pcntl_sigwaitinfo|' +
+ 'pcntl_wait|pcntl_waitpid|pcntl_wexitstatus|pcntl_wifexited|pcntl_wifsignaled|pcntl_wifstopped|pcntl_wstopsig|pcntl_wtermsig|' +
+ 'pdf_activate_item|pdf_add_annotation|pdf_add_bookmark|pdf_add_launchlink|pdf_add_locallink|pdf_add_nameddest|pdf_add_note|pdf_add_outline|' +
+ 'pdf_add_pdflink|pdf_add_table_cell|pdf_add_textflow|pdf_add_thumbnail|pdf_add_weblink|pdf_arc|pdf_arcn|pdf_attach_file|pdf_begin_document|' +
+ 'pdf_begin_font|pdf_begin_glyph|pdf_begin_item|pdf_begin_layer|pdf_begin_page|pdf_begin_page_ext|pdf_begin_pattern|pdf_begin_template|' +
+ 'pdf_begin_template_ext|pdf_circle|pdf_clip|pdf_close|pdf_close_image|pdf_close_pdi|pdf_close_pdi_page|pdf_closepath|' +
+ 'pdf_closepath_fill_stroke|pdf_closepath_stroke|pdf_concat|pdf_continue_text|pdf_create_3dview|pdf_create_action|pdf_create_annotation|' +
+ 'pdf_create_bookmark|pdf_create_field|pdf_create_fieldgroup|pdf_create_gstate|pdf_create_pvf|pdf_create_textflow|pdf_curveto|' +
+ 'pdf_define_layer|pdf_delete|pdf_delete_pvf|pdf_delete_table|pdf_delete_textflow|pdf_encoding_set_char|pdf_end_document|pdf_end_font|' +
+ 'pdf_end_glyph|pdf_end_item|pdf_end_layer|pdf_end_page|pdf_end_page_ext|pdf_end_pattern|pdf_end_template|pdf_endpath|pdf_fill|' +
+ 'pdf_fill_imageblock|pdf_fill_pdfblock|pdf_fill_stroke|pdf_fill_textblock|pdf_findfont|pdf_fit_image|pdf_fit_pdi_page|pdf_fit_table|' +
+ 'pdf_fit_textflow|pdf_fit_textline|pdf_get_apiname|pdf_get_buffer|pdf_get_errmsg|pdf_get_errnum|pdf_get_font|pdf_get_fontname|' +
+ 'pdf_get_fontsize|pdf_get_image_height|pdf_get_image_width|pdf_get_majorversion|pdf_get_minorversion|pdf_get_parameter|' +
+ 'pdf_get_pdi_parameter|pdf_get_pdi_value|pdf_get_value|pdf_info_font|pdf_info_matchbox|pdf_info_table|pdf_info_textflow|pdf_info_textline|' +
+ 'pdf_initgraphics|pdf_lineto|pdf_load_3ddata|pdf_load_font|pdf_load_iccprofile|pdf_load_image|pdf_makespotcolor|pdf_moveto|pdf_new|' +
+ 'pdf_open_ccitt|pdf_open_file|pdf_open_gif|pdf_open_image|pdf_open_image_file|pdf_open_jpeg|pdf_open_memory_image|pdf_open_pdi|' +
+ 'pdf_open_pdi_document|pdf_open_pdi_page|pdf_open_tiff|pdf_pcos_get_number|pdf_pcos_get_stream|pdf_pcos_get_string|pdf_place_image|' +
+ 'pdf_place_pdi_page|pdf_process_pdi|pdf_rect|pdf_restore|pdf_resume_page|pdf_rotate|pdf_save|pdf_scale|pdf_set_border_color|' +
+ 'pdf_set_border_dash|pdf_set_border_style|pdf_set_char_spacing|pdf_set_duration|pdf_set_gstate|pdf_set_horiz_scaling|pdf_set_info|' +
+ 'pdf_set_info_author|pdf_set_info_creator|pdf_set_info_keywords|pdf_set_info_subject|pdf_set_info_title|pdf_set_layer_dependency|' +
+ 'pdf_set_leading|pdf_set_parameter|pdf_set_text_matrix|pdf_set_text_pos|pdf_set_text_rendering|pdf_set_text_rise|pdf_set_value|' +
+ 'pdf_set_word_spacing|pdf_setcolor|pdf_setdash|pdf_setdashpattern|pdf_setflat|pdf_setfont|pdf_setgray|pdf_setgray_fill|pdf_setgray_stroke|' +
+ 'pdf_setlinecap|pdf_setlinejoin|pdf_setlinewidth|pdf_setmatrix|pdf_setmiterlimit|pdf_setpolydash|pdf_setrgbcolor|pdf_setrgbcolor_fill|' +
+ 'pdf_setrgbcolor_stroke|pdf_shading|pdf_shading_pattern|pdf_shfill|pdf_show|pdf_show_boxed|pdf_show_xy|pdf_skew|pdf_stringwidth|pdf_stroke|' +
+ 'pdf_suspend_page|pdf_translate|pdf_utf16_to_utf8|pdf_utf32_to_utf16|pdf_utf8_to_utf16|pdo|pdo_cubrid_schema|pdo_pgsqllobcreate|' +
+ 'pdo_pgsqllobopen|pdo_pgsqllobunlink|pdo_sqlitecreateaggregate|pdo_sqlitecreatefunction|pdoexception|pdostatement|pfsockopen|' +
+ 'pg_affected_rows|pg_cancel_query|pg_client_encoding|pg_close|pg_connect|pg_connection_busy|pg_connection_reset|pg_connection_status|' +
+ 'pg_convert|pg_copy_from|pg_copy_to|pg_dbname|pg_delete|pg_end_copy|pg_escape_bytea|pg_escape_string|pg_execute|pg_fetch_all|' +
+ 'pg_fetch_all_columns|pg_fetch_array|pg_fetch_assoc|pg_fetch_object|pg_fetch_result|pg_fetch_row|pg_field_is_null|pg_field_name|' +
+ 'pg_field_num|pg_field_prtlen|pg_field_size|pg_field_table|pg_field_type|pg_field_type_oid|pg_free_result|pg_get_notify|pg_get_pid|' +
+ 'pg_get_result|pg_host|pg_insert|pg_last_error|pg_last_notice|pg_last_oid|pg_lo_close|pg_lo_create|pg_lo_export|pg_lo_import|pg_lo_open|' +
+ 'pg_lo_read|pg_lo_read_all|pg_lo_seek|pg_lo_tell|pg_lo_unlink|pg_lo_write|pg_meta_data|pg_num_fields|pg_num_rows|pg_options|' +
+ 'pg_parameter_status|pg_pconnect|pg_ping|pg_port|pg_prepare|pg_put_line|pg_query|pg_query_params|pg_result_error|pg_result_error_field|' +
+ 'pg_result_seek|pg_result_status|pg_select|pg_send_execute|pg_send_prepare|pg_send_query|pg_send_query_params|pg_set_client_encoding|' +
+ 'pg_set_error_verbosity|pg_trace|pg_transaction_status|pg_tty|pg_unescape_bytea|pg_untrace|pg_update|pg_version|php_check_syntax|' +
+ 'php_ini_loaded_file|php_ini_scanned_files|php_logo_guid|php_sapi_name|php_strip_whitespace|php_uname|phpcredits|phpinfo|phpversion|pi|' +
+ 'png2wbmp|popen|pos|posix_access|posix_ctermid|posix_errno|posix_get_last_error|posix_getcwd|posix_getegid|posix_geteuid|posix_getgid|' +
+ 'posix_getgrgid|posix_getgrnam|posix_getgroups|posix_getlogin|posix_getpgid|posix_getpgrp|posix_getpid|posix_getppid|posix_getpwnam|' +
+ 'posix_getpwuid|posix_getrlimit|posix_getsid|posix_getuid|posix_initgroups|posix_isatty|posix_kill|posix_mkfifo|posix_mknod|posix_setegid|' +
+ 'posix_seteuid|posix_setgid|posix_setpgid|posix_setsid|posix_setuid|posix_strerror|posix_times|posix_ttyname|posix_uname|pow|preg_filter|' +
+ 'preg_grep|preg_last_error|preg_match|preg_match_all|preg_quote|preg_replace|preg_replace_callback|preg_split|prev|print|print_r|' +
+ 'printer_abort|printer_close|printer_create_brush|printer_create_dc|printer_create_font|printer_create_pen|printer_delete_brush|' +
+ 'printer_delete_dc|printer_delete_font|printer_delete_pen|printer_draw_bmp|printer_draw_chord|printer_draw_elipse|printer_draw_line|' +
+ 'printer_draw_pie|printer_draw_rectangle|printer_draw_roundrect|printer_draw_text|printer_end_doc|printer_end_page|printer_get_option|' +
+ 'printer_list|printer_logical_fontheight|printer_open|printer_select_brush|printer_select_font|printer_select_pen|printer_set_option|' +
+ 'printer_start_doc|printer_start_page|printer_write|printf|proc_close|proc_get_status|proc_nice|proc_open|proc_terminate|property_exists|' +
+ 'ps_add_bookmark|ps_add_launchlink|ps_add_locallink|ps_add_note|ps_add_pdflink|ps_add_weblink|ps_arc|ps_arcn|ps_begin_page|' +
+ 'ps_begin_pattern|ps_begin_template|ps_circle|ps_clip|ps_close|ps_close_image|ps_closepath|ps_closepath_stroke|ps_continue_text|ps_curveto|' +
+ 'ps_delete|ps_end_page|ps_end_pattern|ps_end_template|ps_fill|ps_fill_stroke|ps_findfont|ps_get_buffer|ps_get_parameter|ps_get_value|' +
+ 'ps_hyphenate|ps_include_file|ps_lineto|ps_makespotcolor|ps_moveto|ps_new|ps_open_file|ps_open_image|ps_open_image_file|' +
+ 'ps_open_memory_image|ps_place_image|ps_rect|ps_restore|ps_rotate|ps_save|ps_scale|ps_set_border_color|ps_set_border_dash|' +
+ 'ps_set_border_style|ps_set_info|ps_set_parameter|ps_set_text_pos|ps_set_value|ps_setcolor|ps_setdash|ps_setflat|ps_setfont|ps_setgray|' +
+ 'ps_setlinecap|ps_setlinejoin|ps_setlinewidth|ps_setmiterlimit|ps_setoverprintmode|ps_setpolydash|ps_shading|ps_shading_pattern|ps_shfill|' +
+ 'ps_show|ps_show2|ps_show_boxed|ps_show_xy|ps_show_xy2|ps_string_geometry|ps_stringwidth|ps_stroke|ps_symbol|ps_symbol_name|' +
+ 'ps_symbol_width|ps_translate|pspell_add_to_personal|pspell_add_to_session|pspell_check|pspell_clear_session|pspell_config_create|' +
+ 'pspell_config_data_dir|pspell_config_dict_dir|pspell_config_ignore|pspell_config_mode|pspell_config_personal|pspell_config_repl|' +
+ 'pspell_config_runtogether|pspell_config_save_repl|pspell_new|pspell_new_config|pspell_new_personal|pspell_save_wordlist|' +
+ 'pspell_store_replacement|pspell_suggest|putenv|px_close|px_create_fp|px_date2string|px_delete|px_delete_record|px_get_field|px_get_info|' +
+ 'px_get_parameter|px_get_record|px_get_schema|px_get_value|px_insert_record|px_new|px_numfields|px_numrecords|px_open_fp|px_put_record|' +
+ 'px_retrieve_record|px_set_blob_file|px_set_parameter|px_set_tablename|px_set_targetencoding|px_set_value|px_timestamp2string|' +
+ 'px_update_record|qdom_error|qdom_tree|quoted_printable_decode|quoted_printable_encode|quotemeta|rad2deg|radius_acct_open|' +
+ 'radius_add_server|radius_auth_open|radius_close|radius_config|radius_create_request|radius_cvt_addr|radius_cvt_int|radius_cvt_string|' +
+ 'radius_demangle|radius_demangle_mppe_key|radius_get_attr|radius_get_vendor_attr|radius_put_addr|radius_put_attr|radius_put_int|' +
+ 'radius_put_string|radius_put_vendor_addr|radius_put_vendor_attr|radius_put_vendor_int|radius_put_vendor_string|' +
+ 'radius_request_authenticator|radius_send_request|radius_server_secret|radius_strerror|rand|range|rangeexception|rar_wrapper_cache_stats|' +
+ 'rararchive|rarentry|rarexception|rawurldecode|rawurlencode|read_exif_data|readdir|readfile|readgzfile|readline|readline_add_history|' +
+ 'readline_callback_handler_install|readline_callback_handler_remove|readline_callback_read_char|readline_clear_history|' +
+ 'readline_completion_function|readline_info|readline_list_history|readline_on_new_line|readline_read_history|readline_redisplay|' +
+ 'readline_write_history|readlink|realpath|realpath_cache_get|realpath_cache_size|recode|recode_file|recode_string|recursivearrayiterator|' +
+ 'recursivecachingiterator|recursivecallbackfilteriterator|recursivedirectoryiterator|recursivefilteriterator|recursiveiterator|' +
+ 'recursiveiteratoriterator|recursiveregexiterator|recursivetreeiterator|reflection|reflectionclass|reflectionexception|reflectionextension|' +
+ 'reflectionfunction|reflectionfunctionabstract|reflectionmethod|reflectionobject|reflectionparameter|reflectionproperty|reflector|' +
+ 'regexiterator|register_shutdown_function|register_tick_function|rename|rename_function|require|require_once|reset|resetValue|' +
+ 'resourcebundle|restore_error_handler|restore_exception_handler|restore_include_path|return|rewind|rewinddir|rmdir|round|rpm_close|' +
+ 'rpm_get_tag|rpm_is_valid|rpm_open|rpm_version|rrd_create|rrd_error|rrd_fetch|rrd_first|rrd_graph|rrd_info|rrd_last|rrd_lastupdate|' +
+ 'rrd_restore|rrd_tune|rrd_update|rrd_xport|rrdcreator|rrdgraph|rrdupdater|rsort|rtrim|runkit_class_adopt|runkit_class_emancipate|' +
+ 'runkit_constant_add|runkit_constant_redefine|runkit_constant_remove|runkit_function_add|runkit_function_copy|runkit_function_redefine|' +
+ 'runkit_function_remove|runkit_function_rename|runkit_import|runkit_lint|runkit_lint_file|runkit_method_add|runkit_method_copy|' +
+ 'runkit_method_redefine|runkit_method_remove|runkit_method_rename|runkit_return_value_used|runkit_sandbox_output_handler|' +
+ 'runkit_superglobals|runtimeexception|samconnection_commit|samconnection_connect|samconnection_constructor|samconnection_disconnect|' +
+ 'samconnection_errno|samconnection_error|samconnection_isconnected|samconnection_peek|samconnection_peekall|samconnection_receive|' +
+ 'samconnection_remove|samconnection_rollback|samconnection_send|samconnection_setDebug|samconnection_subscribe|samconnection_unsubscribe|' +
+ 'sammessage_body|sammessage_constructor|sammessage_header|sca_createdataobject|sca_getservice|sca_localproxy_createdataobject|' +
+ 'sca_soapproxy_createdataobject|scandir|sdo_das_changesummary_beginlogging|sdo_das_changesummary_endlogging|' +
+ 'sdo_das_changesummary_getchangeddataobjects|sdo_das_changesummary_getchangetype|sdo_das_changesummary_getoldcontainer|' +
+ 'sdo_das_changesummary_getoldvalues|sdo_das_changesummary_islogging|sdo_das_datafactory_addpropertytotype|sdo_das_datafactory_addtype|' +
+ 'sdo_das_datafactory_getdatafactory|sdo_das_dataobject_getchangesummary|sdo_das_relational_applychanges|sdo_das_relational_construct|' +
+ 'sdo_das_relational_createrootdataobject|sdo_das_relational_executepreparedquery|sdo_das_relational_executequery|' +
+ 'sdo_das_setting_getlistindex|sdo_das_setting_getpropertyindex|sdo_das_setting_getpropertyname|sdo_das_setting_getvalue|' +
+ 'sdo_das_setting_isset|sdo_das_xml_addtypes|sdo_das_xml_create|sdo_das_xml_createdataobject|sdo_das_xml_createdocument|' +
+ 'sdo_das_xml_document_getrootdataobject|sdo_das_xml_document_getrootelementname|sdo_das_xml_document_getrootelementuri|' +
+ 'sdo_das_xml_document_setencoding|sdo_das_xml_document_setxmldeclaration|sdo_das_xml_document_setxmlversion|sdo_das_xml_loadfile|' +
+ 'sdo_das_xml_loadstring|sdo_das_xml_savefile|sdo_das_xml_savestring|sdo_datafactory_create|sdo_dataobject_clear|' +
+ 'sdo_dataobject_createdataobject|sdo_dataobject_getcontainer|sdo_dataobject_getsequence|sdo_dataobject_gettypename|' +
+ 'sdo_dataobject_gettypenamespaceuri|sdo_exception_getcause|sdo_list_insert|sdo_model_property_getcontainingtype|' +
+ 'sdo_model_property_getdefault|sdo_model_property_getname|sdo_model_property_gettype|sdo_model_property_iscontainment|' +
+ 'sdo_model_property_ismany|sdo_model_reflectiondataobject_construct|sdo_model_reflectiondataobject_export|' +
+ 'sdo_model_reflectiondataobject_getcontainmentproperty|sdo_model_reflectiondataobject_getinstanceproperties|' +
+ 'sdo_model_reflectiondataobject_gettype|sdo_model_type_getbasetype|sdo_model_type_getname|sdo_model_type_getnamespaceuri|' +
+ 'sdo_model_type_getproperties|sdo_model_type_getproperty|sdo_model_type_isabstracttype|sdo_model_type_isdatatype|sdo_model_type_isinstance|' +
+ 'sdo_model_type_isopentype|sdo_model_type_issequencedtype|sdo_sequence_getproperty|sdo_sequence_insert|sdo_sequence_move|seekableiterator|' +
+ 'sem_acquire|sem_get|sem_release|sem_remove|serializable|serialize|session_cache_expire|session_cache_limiter|session_commit|' +
+ 'session_decode|session_destroy|session_encode|session_get_cookie_params|session_id|session_is_registered|session_module_name|session_name|' +
+ 'session_pgsql_add_error|session_pgsql_get_error|session_pgsql_get_field|session_pgsql_reset|session_pgsql_set_field|session_pgsql_status|' +
+ 'session_regenerate_id|session_register|session_save_path|session_set_cookie_params|session_set_save_handler|session_start|' +
+ 'session_unregister|session_unset|session_write_close|setCounterClass|set_error_handler|set_exception_handler|set_file_buffer|' +
+ 'set_include_path|set_magic_quotes_runtime|set_socket_blocking|set_time_limit|setcookie|setlocale|setproctitle|setrawcookie|' +
+ 'setstaticpropertyvalue|setthreadtitle|settype|sha1|sha1_file|shell_exec|shm_attach|shm_detach|shm_get_var|shm_has_var|shm_put_var|' +
+ 'shm_remove|shm_remove_var|shmop_close|shmop_delete|shmop_open|shmop_read|shmop_size|shmop_write|show_source|shuffle|signeurlpaiement|' +
+ 'similar_text|simplexml_import_dom|simplexml_load_file|simplexml_load_string|simplexmlelement|simplexmliterator|sin|sinh|sizeof|sleep|snmp|' +
+ 'snmp2_get|snmp2_getnext|snmp2_real_walk|snmp2_set|snmp2_walk|snmp3_get|snmp3_getnext|snmp3_real_walk|snmp3_set|snmp3_walk|' +
+ 'snmp_get_quick_print|snmp_get_valueretrieval|snmp_read_mib|snmp_set_enum_print|snmp_set_oid_numeric_print|snmp_set_oid_output_format|' +
+ 'snmp_set_quick_print|snmp_set_valueretrieval|snmpget|snmpgetnext|snmprealwalk|snmpset|snmpwalk|snmpwalkoid|soapclient|soapfault|' +
+ 'soapheader|soapparam|soapserver|soapvar|socket_accept|socket_bind|socket_clear_error|socket_close|socket_connect|socket_create|' +
+ 'socket_create_listen|socket_create_pair|socket_get_option|socket_get_status|socket_getpeername|socket_getsockname|socket_last_error|' +
+ 'socket_listen|socket_read|socket_recv|socket_recvfrom|socket_select|socket_send|socket_sendto|socket_set_block|socket_set_blocking|' +
+ 'socket_set_nonblock|socket_set_option|socket_set_timeout|socket_shutdown|socket_strerror|socket_write|solr_get_version|solrclient|' +
+ 'solrclientexception|solrdocument|solrdocumentfield|solrexception|solrgenericresponse|solrillegalargumentexception|' +
+ 'solrillegaloperationexception|solrinputdocument|solrmodifiableparams|solrobject|solrparams|solrpingresponse|solrquery|solrqueryresponse|' +
+ 'solrresponse|solrupdateresponse|solrutils|sort|soundex|sphinxclient|spl_autoload|spl_autoload_call|spl_autoload_extensions|' +
+ 'spl_autoload_functions|spl_autoload_register|spl_autoload_unregister|spl_classes|spl_object_hash|splbool|spldoublylinkedlist|splenum|' +
+ 'splfileinfo|splfileobject|splfixedarray|splfloat|splheap|splint|split|spliti|splmaxheap|splminheap|splobjectstorage|splobserver|' +
+ 'splpriorityqueue|splqueue|splstack|splstring|splsubject|spltempfileobject|spoofchecker|sprintf|sql_regcase|sqlite3|sqlite3result|' +
+ 'sqlite3stmt|sqlite_array_query|sqlite_busy_timeout|sqlite_changes|sqlite_close|sqlite_column|sqlite_create_aggregate|' +
+ 'sqlite_create_function|sqlite_current|sqlite_error_string|sqlite_escape_string|sqlite_exec|sqlite_factory|sqlite_fetch_all|' +
+ 'sqlite_fetch_array|sqlite_fetch_column_types|sqlite_fetch_object|sqlite_fetch_single|sqlite_fetch_string|sqlite_field_name|' +
+ 'sqlite_has_more|sqlite_has_prev|sqlite_key|sqlite_last_error|sqlite_last_insert_rowid|sqlite_libencoding|sqlite_libversion|sqlite_next|' +
+ 'sqlite_num_fields|sqlite_num_rows|sqlite_open|sqlite_popen|sqlite_prev|sqlite_query|sqlite_rewind|sqlite_seek|sqlite_single_query|' +
+ 'sqlite_udf_decode_binary|sqlite_udf_encode_binary|sqlite_unbuffered_query|sqlite_valid|sqrt|srand|sscanf|ssdeep_fuzzy_compare|' +
+ 'ssdeep_fuzzy_hash|ssdeep_fuzzy_hash_filename|ssh2_auth_hostbased_file|ssh2_auth_none|ssh2_auth_password|ssh2_auth_pubkey_file|' +
+ 'ssh2_connect|ssh2_exec|ssh2_fetch_stream|ssh2_fingerprint|ssh2_methods_negotiated|ssh2_publickey_add|ssh2_publickey_init|' +
+ 'ssh2_publickey_list|ssh2_publickey_remove|ssh2_scp_recv|ssh2_scp_send|ssh2_sftp|ssh2_sftp_lstat|ssh2_sftp_mkdir|ssh2_sftp_readlink|' +
+ 'ssh2_sftp_realpath|ssh2_sftp_rename|ssh2_sftp_rmdir|ssh2_sftp_stat|ssh2_sftp_symlink|ssh2_sftp_unlink|ssh2_shell|ssh2_tunnel|stat|' +
+ 'stats_absolute_deviation|stats_cdf_beta|stats_cdf_binomial|stats_cdf_cauchy|stats_cdf_chisquare|stats_cdf_exponential|stats_cdf_f|' +
+ 'stats_cdf_gamma|stats_cdf_laplace|stats_cdf_logistic|stats_cdf_negative_binomial|stats_cdf_noncentral_chisquare|stats_cdf_noncentral_f|' +
+ 'stats_cdf_poisson|stats_cdf_t|stats_cdf_uniform|stats_cdf_weibull|stats_covariance|stats_den_uniform|stats_dens_beta|stats_dens_cauchy|' +
+ 'stats_dens_chisquare|stats_dens_exponential|stats_dens_f|stats_dens_gamma|stats_dens_laplace|stats_dens_logistic|' +
+ 'stats_dens_negative_binomial|stats_dens_normal|stats_dens_pmf_binomial|stats_dens_pmf_hypergeometric|stats_dens_pmf_poisson|stats_dens_t|' +
+ 'stats_dens_weibull|stats_harmonic_mean|stats_kurtosis|stats_rand_gen_beta|stats_rand_gen_chisquare|stats_rand_gen_exponential|' +
+ 'stats_rand_gen_f|stats_rand_gen_funiform|stats_rand_gen_gamma|stats_rand_gen_ibinomial|stats_rand_gen_ibinomial_negative|' +
+ 'stats_rand_gen_int|stats_rand_gen_ipoisson|stats_rand_gen_iuniform|stats_rand_gen_noncenral_chisquare|stats_rand_gen_noncentral_f|' +
+ 'stats_rand_gen_noncentral_t|stats_rand_gen_normal|stats_rand_gen_t|stats_rand_get_seeds|stats_rand_phrase_to_seeds|stats_rand_ranf|' +
+ 'stats_rand_setall|stats_skew|stats_standard_deviation|stats_stat_binomial_coef|stats_stat_correlation|stats_stat_gennch|' +
+ 'stats_stat_independent_t|stats_stat_innerproduct|stats_stat_noncentral_t|stats_stat_paired_t|stats_stat_percentile|stats_stat_powersum|' +
+ 'stats_variance|stomp|stomp_connect_error|stomp_version|stompexception|stompframe|str_getcsv|str_ireplace|str_pad|str_repeat|str_replace|' +
+ 'str_rot13|str_shuffle|str_split|str_word_count|strcasecmp|strchr|strcmp|strcoll|strcspn|stream_bucket_append|stream_bucket_make_writeable|' +
+ 'stream_bucket_new|stream_bucket_prepend|stream_context_create|stream_context_get_default|stream_context_get_options|' +
+ 'stream_context_get_params|stream_context_set_default|stream_context_set_option|stream_context_set_params|stream_copy_to_stream|' +
+ 'stream_encoding|stream_filter_append|stream_filter_prepend|stream_filter_register|stream_filter_remove|stream_get_contents|' +
+ 'stream_get_filters|stream_get_line|stream_get_meta_data|stream_get_transports|stream_get_wrappers|stream_is_local|' +
+ 'stream_notification_callback|stream_register_wrapper|stream_resolve_include_path|stream_select|stream_set_blocking|stream_set_read_buffer|' +
+ 'stream_set_timeout|stream_set_write_buffer|stream_socket_accept|stream_socket_client|stream_socket_enable_crypto|stream_socket_get_name|' +
+ 'stream_socket_pair|stream_socket_recvfrom|stream_socket_sendto|stream_socket_server|stream_socket_shutdown|stream_supports_lock|' +
+ 'stream_wrapper_register|stream_wrapper_restore|stream_wrapper_unregister|streamwrapper|strftime|strip_tags|stripcslashes|stripos|' +
+ 'stripslashes|stristr|strlen|strnatcasecmp|strnatcmp|strncasecmp|strncmp|strpbrk|strpos|strptime|strrchr|strrev|strripos|strrpos|strspn|' +
+ 'strstr|strtok|strtolower|strtotime|strtoupper|strtr|strval|substr|substr_compare|substr_count|substr_replace|svm|svmmodel|svn_add|' +
+ 'svn_auth_get_parameter|svn_auth_set_parameter|svn_blame|svn_cat|svn_checkout|svn_cleanup|svn_client_version|svn_commit|svn_delete|' +
+ 'svn_diff|svn_export|svn_fs_abort_txn|svn_fs_apply_text|svn_fs_begin_txn2|svn_fs_change_node_prop|svn_fs_check_path|' +
+ 'svn_fs_contents_changed|svn_fs_copy|svn_fs_delete|svn_fs_dir_entries|svn_fs_file_contents|svn_fs_file_length|svn_fs_is_dir|svn_fs_is_file|' +
+ 'svn_fs_make_dir|svn_fs_make_file|svn_fs_node_created_rev|svn_fs_node_prop|svn_fs_props_changed|svn_fs_revision_prop|svn_fs_revision_root|' +
+ 'svn_fs_txn_root|svn_fs_youngest_rev|svn_import|svn_log|svn_ls|svn_mkdir|svn_repos_create|svn_repos_fs|svn_repos_fs_begin_txn_for_commit|' +
+ 'svn_repos_fs_commit_txn|svn_repos_hotcopy|svn_repos_open|svn_repos_recover|svn_revert|svn_status|svn_update|swf_actiongeturl|' +
+ 'swf_actiongotoframe|swf_actiongotolabel|swf_actionnextframe|swf_actionplay|swf_actionprevframe|swf_actionsettarget|swf_actionstop|' +
+ 'swf_actiontogglequality|swf_actionwaitforframe|swf_addbuttonrecord|swf_addcolor|swf_closefile|swf_definebitmap|swf_definefont|' +
+ 'swf_defineline|swf_definepoly|swf_definerect|swf_definetext|swf_endbutton|swf_enddoaction|swf_endshape|swf_endsymbol|swf_fontsize|' +
+ 'swf_fontslant|swf_fonttracking|swf_getbitmapinfo|swf_getfontinfo|swf_getframe|swf_labelframe|swf_lookat|swf_modifyobject|swf_mulcolor|' +
+ 'swf_nextid|swf_oncondition|swf_openfile|swf_ortho|swf_ortho2|swf_perspective|swf_placeobject|swf_polarview|swf_popmatrix|swf_posround|' +
+ 'swf_pushmatrix|swf_removeobject|swf_rotate|swf_scale|swf_setfont|swf_setframe|swf_shapearc|swf_shapecurveto|swf_shapecurveto3|' +
+ 'swf_shapefillbitmapclip|swf_shapefillbitmaptile|swf_shapefilloff|swf_shapefillsolid|swf_shapelinesolid|swf_shapelineto|swf_shapemoveto|' +
+ 'swf_showframe|swf_startbutton|swf_startdoaction|swf_startshape|swf_startsymbol|swf_textwidth|swf_translate|swf_viewport|swfaction|' +
+ 'swfbitmap|swfbutton|swfdisplayitem|swffill|swffont|swffontchar|swfgradient|swfmorph|swfmovie|swfprebuiltclip|swfshape|swfsound|' +
+ 'swfsoundinstance|swfsprite|swftext|swftextfield|swfvideostream|swish_construct|swish_getmetalist|swish_getpropertylist|swish_prepare|' +
+ 'swish_query|swishresult_getmetalist|swishresult_stem|swishresults_getparsedwords|swishresults_getremovedstopwords|swishresults_nextresult|' +
+ 'swishresults_seekresult|swishsearch_execute|swishsearch_resetlimit|swishsearch_setlimit|swishsearch_setphrasedelimiter|' +
+ 'swishsearch_setsort|swishsearch_setstructure|sybase_affected_rows|sybase_close|sybase_connect|sybase_data_seek|' +
+ 'sybase_deadlock_retry_count|sybase_fetch_array|sybase_fetch_assoc|sybase_fetch_field|sybase_fetch_object|sybase_fetch_row|' +
+ 'sybase_field_seek|sybase_free_result|sybase_get_last_message|sybase_min_client_severity|sybase_min_error_severity|' +
+ 'sybase_min_message_severity|sybase_min_server_severity|sybase_num_fields|sybase_num_rows|sybase_pconnect|sybase_query|sybase_result|' +
+ 'sybase_select_db|sybase_set_message_handler|sybase_unbuffered_query|symlink|sys_get_temp_dir|sys_getloadavg|syslog|system|tag|tan|tanh|' +
+ 'tcpwrap_check|tempnam|textdomain|tidy|tidy_access_count|tidy_config_count|tidy_diagnose|tidy_error_count|tidy_get_error_buffer|' +
+ 'tidy_get_output|tidy_load_config|tidy_reset_config|tidy_save_config|tidy_set_encoding|tidy_setopt|tidy_warning_count|tidynode|time|' +
+ 'time_nanosleep|time_sleep_until|timezone_abbreviations_list|timezone_identifiers_list|timezone_location_get|timezone_name_from_abbr|' +
+ 'timezone_name_get|timezone_offset_get|timezone_open|timezone_transitions_get|timezone_version_get|tmpfile|token_get_all|token_name|' +
+ 'tokyotyrant|tokyotyrantquery|tokyotyranttable|tostring|tostring|touch|transliterator|traversable|trigger_error|trim|uasort|ucfirst|' +
+ 'ucwords|udm_add_search_limit|udm_alloc_agent|udm_alloc_agent_array|udm_api_version|udm_cat_list|udm_cat_path|udm_check_charset|' +
+ 'udm_check_stored|udm_clear_search_limits|udm_close_stored|udm_crc32|udm_errno|udm_error|udm_find|udm_free_agent|udm_free_ispell_data|' +
+ 'udm_free_res|udm_get_doc_count|udm_get_res_field|udm_get_res_param|udm_hash32|udm_load_ispell_data|udm_open_stored|udm_set_agent_param|' +
+ 'uksort|umask|underflowexception|unexpectedvalueexception|uniqid|unixtojd|unlink|unpack|unregister_tick_function|unserialize|unset|' +
+ 'urldecode|urlencode|use_soap_error_handler|user_error|usleep|usort|utf8_decode|utf8_encode|v8js|v8jsexception|var_dump|var_export|variant|' +
+ 'variant_abs|variant_add|variant_and|variant_cast|variant_cat|variant_cmp|variant_date_from_timestamp|variant_date_to_timestamp|' +
+ 'variant_div|variant_eqv|variant_fix|variant_get_type|variant_idiv|variant_imp|variant_int|variant_mod|variant_mul|variant_neg|variant_not|' +
+ 'variant_or|variant_pow|variant_round|variant_set|variant_set_type|variant_sub|variant_xor|version_compare|vfprintf|virtual|' +
+ 'vpopmail_add_alias_domain|vpopmail_add_alias_domain_ex|vpopmail_add_domain|vpopmail_add_domain_ex|vpopmail_add_user|vpopmail_alias_add|' +
+ 'vpopmail_alias_del|vpopmail_alias_del_domain|vpopmail_alias_get|vpopmail_alias_get_all|vpopmail_auth_user|vpopmail_del_domain|' +
+ 'vpopmail_del_domain_ex|vpopmail_del_user|vpopmail_error|vpopmail_passwd|vpopmail_set_user_quota|vprintf|vsprintf|w32api_deftype|' +
+ 'w32api_init_dtype|w32api_invoke_function|w32api_register_function|w32api_set_call_method|wddx_add_vars|wddx_deserialize|wddx_packet_end|' +
+ 'wddx_packet_start|wddx_serialize_value|wddx_serialize_vars|win32_continue_service|win32_create_service|win32_delete_service|' +
+ 'win32_get_last_control_message|win32_pause_service|win32_ps_list_procs|win32_ps_stat_mem|win32_ps_stat_proc|win32_query_service_status|' +
+ 'win32_set_service_status|win32_start_service|win32_start_service_ctrl_dispatcher|win32_stop_service|wincache_fcache_fileinfo|' +
+ 'wincache_fcache_meminfo|wincache_lock|wincache_ocache_fileinfo|wincache_ocache_meminfo|wincache_refresh_if_changed|' +
+ 'wincache_rplist_fileinfo|wincache_rplist_meminfo|wincache_scache_info|wincache_scache_meminfo|wincache_ucache_add|wincache_ucache_cas|' +
+ 'wincache_ucache_clear|wincache_ucache_dec|wincache_ucache_delete|wincache_ucache_exists|wincache_ucache_get|wincache_ucache_inc|' +
+ 'wincache_ucache_info|wincache_ucache_meminfo|wincache_ucache_set|wincache_unlock|wordwrap|xattr_get|xattr_list|xattr_remove|xattr_set|' +
+ 'xattr_supported|xdiff_file_bdiff|xdiff_file_bdiff_size|xdiff_file_bpatch|xdiff_file_diff|xdiff_file_diff_binary|xdiff_file_merge3|' +
+ 'xdiff_file_patch|xdiff_file_patch_binary|xdiff_file_rabdiff|xdiff_string_bdiff|xdiff_string_bdiff_size|xdiff_string_bpatch|' +
+ 'xdiff_string_diff|xdiff_string_diff_binary|xdiff_string_merge3|xdiff_string_patch|xdiff_string_patch_binary|xdiff_string_rabdiff|' +
+ 'xhprof_disable|xhprof_enable|xhprof_sample_disable|xhprof_sample_enable|xml_error_string|xml_get_current_byte_index|' +
+ 'xml_get_current_column_number|xml_get_current_line_number|xml_get_error_code|xml_parse|xml_parse_into_struct|xml_parser_create|' +
+ 'xml_parser_create_ns|xml_parser_free|xml_parser_get_option|xml_parser_set_option|xml_set_character_data_handler|xml_set_default_handler|' +
+ 'xml_set_element_handler|xml_set_end_namespace_decl_handler|xml_set_external_entity_ref_handler|xml_set_notation_decl_handler|' +
+ 'xml_set_object|xml_set_processing_instruction_handler|xml_set_start_namespace_decl_handler|xml_set_unparsed_entity_decl_handler|xmlreader|' +
+ 'xmlrpc_decode|xmlrpc_decode_request|xmlrpc_encode|xmlrpc_encode_request|xmlrpc_get_type|xmlrpc_is_fault|xmlrpc_parse_method_descriptions|' +
+ 'xmlrpc_server_add_introspection_data|xmlrpc_server_call_method|xmlrpc_server_create|xmlrpc_server_destroy|' +
+ 'xmlrpc_server_register_introspection_callback|xmlrpc_server_register_method|xmlrpc_set_type|xmlwriter_end_attribute|xmlwriter_end_cdata|' +
+ 'xmlwriter_end_comment|xmlwriter_end_document|xmlwriter_end_dtd|xmlwriter_end_dtd_attlist|xmlwriter_end_dtd_element|' +
+ 'xmlwriter_end_dtd_entity|xmlwriter_end_element|xmlwriter_end_pi|xmlwriter_flush|xmlwriter_full_end_element|xmlwriter_open_memory|' +
+ 'xmlwriter_open_uri|xmlwriter_output_memory|xmlwriter_set_indent|xmlwriter_set_indent_string|xmlwriter_start_attribute|' +
+ 'xmlwriter_start_attribute_ns|xmlwriter_start_cdata|xmlwriter_start_comment|xmlwriter_start_document|xmlwriter_start_dtd|' +
+ 'xmlwriter_start_dtd_attlist|xmlwriter_start_dtd_element|xmlwriter_start_dtd_entity|xmlwriter_start_element|xmlwriter_start_element_ns|' +
+ 'xmlwriter_start_pi|xmlwriter_text|xmlwriter_write_attribute|xmlwriter_write_attribute_ns|xmlwriter_write_cdata|xmlwriter_write_comment|' +
+ 'xmlwriter_write_dtd|xmlwriter_write_dtd_attlist|xmlwriter_write_dtd_element|xmlwriter_write_dtd_entity|xmlwriter_write_element|' +
+ 'xmlwriter_write_element_ns|xmlwriter_write_pi|xmlwriter_write_raw|xpath_eval|xpath_eval_expression|xpath_new_context|xpath_register_ns|' +
+ 'xpath_register_ns_auto|xptr_eval|xptr_new_context|xslt_backend_info|xslt_backend_name|xslt_backend_version|xslt_create|xslt_errno|' +
+ 'xslt_error|xslt_free|xslt_getopt|xslt_process|xslt_set_base|xslt_set_encoding|xslt_set_error_handler|xslt_set_log|xslt_set_object|' +
+ 'xslt_set_sax_handler|xslt_set_sax_handlers|xslt_set_scheme_handler|xslt_set_scheme_handlers|xslt_setopt|xsltprocessor|yaml_emit|' +
+ 'yaml_emit_file|yaml_parse|yaml_parse_file|yaml_parse_url|yaz_addinfo|yaz_ccl_conf|yaz_ccl_parse|yaz_close|yaz_connect|yaz_database|' +
+ 'yaz_element|yaz_errno|yaz_error|yaz_es|yaz_es_result|yaz_get_option|yaz_hits|yaz_itemorder|yaz_present|yaz_range|yaz_record|yaz_scan|' +
+ 'yaz_scan_result|yaz_schema|yaz_search|yaz_set_option|yaz_sort|yaz_syntax|yaz_wait|yp_all|yp_cat|yp_err_string|yp_errno|yp_first|' +
+ 'yp_get_default_domain|yp_master|yp_match|yp_next|yp_order|zend_logo_guid|zend_thread_id|zend_version|zip_close|zip_entry_close|' +
+ 'zip_entry_compressedsize|zip_entry_compressionmethod|zip_entry_filesize|zip_entry_name|zip_entry_open|zip_entry_read|zip_open|zip_read|' +
+ 'ziparchive|ziparchive_addemptydir|ziparchive_addfile|ziparchive_addfromstring|ziparchive_close|ziparchive_deleteindex|' +
+ 'ziparchive_deletename|ziparchive_extractto|ziparchive_getarchivecomment|ziparchive_getcommentindex|ziparchive_getcommentname|' +
+ 'ziparchive_getfromindex|ziparchive_getfromname|ziparchive_getnameindex|ziparchive_getstatusstring|ziparchive_getstream|' +
+ 'ziparchive_locatename|ziparchive_open|ziparchive_renameindex|ziparchive_renamename|ziparchive_setCommentName|ziparchive_setarchivecomment|' +
+ 'ziparchive_setcommentindex|ziparchive_statindex|ziparchive_statname|ziparchive_unchangeall|ziparchive_unchangearchive|' +
+ 'ziparchive_unchangeindex|ziparchive_unchangename|zlib_get_coding_type').split('|')
+ );
+
+ // http://php.net/manual/en/reserved.keywords.php
+ var keywords = lang.arrayToMap(
+ ('abstract|and|array|as|break|case|catch|class|clone|const|continue|declare|default|do|else|elseif|enddeclare|endfor|endforeach|endif|' +
+ 'endswitch|endwhile|extends|final|for|foreach|function|global|goto|if|implements|interface|instanceof|namespace|new|or|private|protected|' +
+ 'public|static|switch|throw|try|use|var|while|xor').split('|')
+ );
+
+ // http://php.net/manual/en/reserved.keywords.php
+ var languageConstructs = lang.arrayToMap(
+ ('die|echo|empty|exit|eval|include|include_once|isset|list|require|require_once|return|print|unset').split('|')
+ );
+
+ var builtinConstants = lang.arrayToMap(
+ ('true|false|null|__CLASS__|__DIR__|__FILE__|__LINE__|__METHOD__|__FUNCTION__|__NAMESPACE__').split('|')
+ );
+
+ var builtinVariables = lang.arrayToMap(
+ ('$GLOBALS|$_SERVER|$_GET|$_POST|$_FILES|$_REQUEST|$_SESSION|$_ENV|$_COOKIE|$php_errormsg|$HTTP_RAW_POST_DATA|' +
+ '$http_response_header|$argc|$argv').split('|')
+ );
+
+ // Discovery done by downloading 'Many HTML files' from: http://php.net/download-docs.php
+ // Then search for files containing 'deprecated' (case-insensitive) and look at each file that turns up.
+ var builtinFunctionsDeprecated = lang.arrayToMap(
+ ('key_exists|cairo_matrix_create_scale|cairo_matrix_create_translate|call_user_method|call_user_method_array|com_addref|com_get|' +
+ 'com_invoke|com_isenum|com_load|com_release|com_set|connection_timeout|cubrid_load_from_glo|cubrid_new_glo|cubrid_save_to_glo|' +
+ 'cubrid_send_glo|define_syslog_variables|dl|ereg|ereg_replace|eregi|eregi_replace|hw_documentattributes|hw_documentbodytag|' +
+ 'hw_documentsize|hw_outputdocument|imagedashedline|maxdb_bind_param|maxdb_bind_result|maxdb_client_encoding|maxdb_close_long_data|' +
+ 'maxdb_execute|maxdb_fetch|maxdb_get_metadata|maxdb_param_count|maxdb_send_long_data|mcrypt_ecb|mcrypt_generic_end|mime_content_type|' +
+ 'mysql_createdb|mysql_dbname|mysql_db_query|mysql_drop_db|mysql_dropdb|mysql_escape_string|mysql_fieldflags|mysql_fieldflags|' +
+ 'mysql_fieldname|mysql_fieldtable|mysql_fieldtype|mysql_freeresult|mysql_listdbs|mysql_list_fields|mysql_listfields|mysql_list_tables|' +
+ 'mysql_listtables|mysql_numfields|mysql_numrows|mysql_selectdb|mysql_tablename|mysqli_bind_param|mysqli_bind_result|' +
+ 'mysqli_disable_reads_from_master|mysqli_disable_rpl_parse|mysqli_enable_reads_from_master|mysqli_enable_rpl_parse|mysqli_execute|' +
+ 'mysqli_fetch|mysqli_get_metadata|mysqli_master_query|mysqli_param_count|mysqli_rpl_parse_enabled|mysqli_rpl_probe|mysqli_rpl_query_type|' +
+ 'mysqli_send_long_data|mysqli_send_query|mysqli_slave_query|ocibindbyname|ocicancel|ocicloselob|ocicollappend|ocicollassign|' +
+ 'ocicollassignelem|ocicollgetelem|ocicollmax|ocicollsize|ocicolltrim|ocicolumnisnull|ocicolumnname|ocicolumnprecision|ocicolumnscale|' +
+ 'ocicolumnsize|ocicolumntype|ocicolumntyperaw|ocicommit|ocidefinebyname|ocierror|ociexecute|ocifetch|ocifetchinto|ocifetchstatement|' +
+ 'ocifreecollection|ocifreecursor|ocifreedesc|ocifreestatement|ociinternaldebug|ociloadlob|ocilogoff|ocilogon|ocinewcollection|' +
+ 'ocinewcursor|ocinewdescriptor|ocinlogon|ocinumcols|ociparse|ociplogon|ociresult|ocirollback|ocirowcount|ocisavelob|ocisavelobfile|' +
+ 'ociserverversion|ocisetprefetch|ocistatementtype|ociwritelobtofile|ociwritetemporarylob|PDF_add_annotation|PDF_add_bookmark|' +
+ 'PDF_add_launchlink|PDF_add_locallink|PDF_add_note|PDF_add_outline|PDF_add_pdflink|PDF_add_weblink|PDF_attach_file|PDF_begin_page|' +
+ 'PDF_begin_template|PDF_close_pdi|PDF_close|PDF_findfont|PDF_get_font|PDF_get_fontname|PDF_get_fontsize|PDF_get_image_height|' +
+ 'PDF_get_image_width|PDF_get_majorversion|PDF_get_minorversion|PDF_get_pdi_parameter|PDF_get_pdi_value|PDF_open_ccitt|PDF_open_file|' +
+ 'PDF_open_gif|PDF_open_image_file|PDF_open_image|PDF_open_jpeg|PDF_open_pdi|PDF_open_tiff|PDF_place_image|PDF_place_pdi_page|' +
+ 'PDF_set_border_color|PDF_set_border_dash|PDF_set_border_style|PDF_set_char_spacing|PDF_set_duration|PDF_set_horiz_scaling|' +
+ 'PDF_set_info_author|PDF_set_info_creator|PDF_set_info_keywords|PDF_set_info_subject|PDF_set_info_title|PDF_set_leading|' +
+ 'PDF_set_text_matrix|PDF_set_text_rendering|PDF_set_text_rise|PDF_set_word_spacing|PDF_setgray_fill|PDF_setgray_stroke|PDF_setgray|' +
+ 'PDF_setpolydash|PDF_setrgbcolor_fill|PDF_setrgbcolor_stroke|PDF_setrgbcolor|PDF_show_boxed|php_check_syntax|px_set_tablename|' +
+ 'px_set_targetencoding|runkit_sandbox_output_handler|session_is_registered|session_register|session_unregister' +
+ 'set_magic_quotes_runtime|magic_quotes_runtime|set_socket_blocking|socket_set_blocking|set_socket_timeout|socket_set_timeout|split|spliti|' +
+ 'sql_regcase').split('|')
+ );
+
+ var keywordsDeprecated = lang.arrayToMap(
+ ('cfunction|old_function').split('|')
+ );
+
+ var futureReserved = lang.arrayToMap([]);
+
+ // regexp must not have capturing parentheses. Use (?:) instead.
+ // regexps are ordered -> the first match is used
+
+ this.$rules = {
+ "start" : [
+ {
+ token : "comment",
+ regex : "\\/\\/.*$"
+ },
+ {
+ token : "comment",
+ regex : "#.*$"
+ },
+ docComment.getStartRule("doc-start"),
+ {
+ token : "comment", // multi line comment
+ regex : "\\/\\*",
+ next : "comment"
+ }, {
+ token : "string.regexp",
+ regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/][gimy]*\\s*(?=[).,;]|$)"
+ }, {
+ token : "string", // " string start
+ regex : '"',
+ next : "qqstring"
+ }, {
+ token : "string", // ' 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 : "constant.language", // constants
+ regex : "\\b(?:DEFAULT_INCLUDE_PATH|E_(?:ALL|CO(?:MPILE_(?:ERROR|WARNING)|RE_(?:ERROR|WARNING))|" +
+ "ERROR|NOTICE|PARSE|STRICT|USER_(?:ERROR|NOTICE|WARNING)|WARNING)|P(?:EAR_(?:EXTENSION_DIR|INSTALL_DIR)|" +
+ "HP_(?:BINDIR|CONFIG_FILE_(?:PATH|SCAN_DIR)|DATADIR|E(?:OL|XTENSION_DIR)|INT_(?:MAX|SIZE)|" +
+ "L(?:IBDIR|OCALSTATEDIR)|O(?:S|UTPUT_HANDLER_(?:CONT|END|START))|PREFIX|S(?:API|HLIB_SUFFIX|YSCONFDIR)|" +
+ "VERSION))|__COMPILER_HALT_OFFSET__)\\b"
+ }, {
+ token : "constant.language", // constants
+ regex : "\\b(?:A(?:B(?:DAY_(?:1|2|3|4|5|6|7)|MON_(?:1(?:0|1|2|)|2|3|4|5|6|7|8|9))|LT_DIGITS|M_STR|" +
+ "SSERT_(?:ACTIVE|BAIL|CALLBACK|QUIET_EVAL|WARNING))|C(?:ASE_(?:LOWER|UPPER)|HAR_MAX|" +
+ "O(?:DESET|NNECTION_(?:ABORTED|NORMAL|TIMEOUT)|UNT_(?:NORMAL|RECURSIVE))|" +
+ "R(?:EDITS_(?:ALL|DOCS|FULLPAGE|G(?:ENERAL|ROUP)|MODULES|QA|SAPI)|NCYSTR|" +
+ "YPT_(?:BLOWFISH|EXT_DES|MD5|S(?:ALT_LENGTH|TD_DES)))|URRENCY_SYMBOL)|D(?:AY_(?:1|2|3|4|5|6|7)|" +
+ "ECIMAL_POINT|IRECTORY_SEPARATOR|_(?:FMT|T_FMT))|E(?:NT_(?:COMPAT|NOQUOTES|QUOTES)|RA(?:_(?:D_(?:FMT|T_FMT)|" +
+ "T_FMT|YEAR)|)|XTR_(?:IF_EXISTS|OVERWRITE|PREFIX_(?:ALL|I(?:F_EXISTS|NVALID)|SAME)|SKIP))|FRAC_DIGITS|GROUPING|" +
+ "HTML_(?:ENTITIES|SPECIALCHARS)|IN(?:FO_(?:ALL|C(?:ONFIGURATION|REDITS)|ENVIRONMENT|GENERAL|LICENSE|MODULES|VARIABLES)|" +
+ "I_(?:ALL|PERDIR|SYSTEM|USER)|T_(?:CURR_SYMBOL|FRAC_DIGITS))|L(?:C_(?:ALL|C(?:OLLATE|TYPE)|M(?:ESSAGES|ONETARY)|NUMERIC|TIME)|" +
+ "O(?:CK_(?:EX|NB|SH|UN)|G_(?:A(?:LERT|UTH(?:PRIV|))|C(?:ONS|R(?:IT|ON))|D(?:AEMON|EBUG)|E(?:MERG|RR)|INFO|KERN|" +
+ "L(?:OCAL(?:0|1|2|3|4|5|6|7)|PR)|MAIL|N(?:DELAY|EWS|O(?:TICE|WAIT))|ODELAY|P(?:ERROR|ID)|SYSLOG|U(?:SER|UCP)|WARNING)))|" +
+ "M(?:ON_(?:1(?:0|1|2|)|2|3|4|5|6|7|8|9|DECIMAL_POINT|GROUPING|THOUSANDS_SEP)|_(?:1_PI|2_(?:PI|SQRTPI)|E|L(?:N(?:10|2)|" +
+ "OG(?:10E|2E))|PI(?:_(?:2|4)|)|SQRT(?:1_2|2)))|N(?:EGATIVE_SIGN|O(?:EXPR|STR)|_(?:CS_PRECEDES|S(?:EP_BY_SPACE|IGN_POSN)))|" +
+ "P(?:ATH(?:INFO_(?:BASENAME|DIRNAME|EXTENSION)|_SEPARATOR)|M_STR|OSITIVE_SIGN|_(?:CS_PRECEDES|S(?:EP_BY_SPACE|IGN_POSN)))|" +
+ "RADIXCHAR|S(?:EEK_(?:CUR|END|SET)|ORT_(?:ASC|DESC|NUMERIC|REGULAR|STRING)|TR_PAD_(?:BOTH|LEFT|RIGHT))|" +
+ "T(?:HOUS(?:ANDS_SEP|EP)|_FMT(?:_AMPM|))|YES(?:EXPR|STR)|STD(?:IN|OUT|ERR))\\b"
+ }, {
+ token : function(value) {
+ if (keywords.hasOwnProperty(value))
+ return "keyword";
+ else if (builtinConstants.hasOwnProperty(value))
+ return "constant.language";
+ else if (builtinVariables.hasOwnProperty(value))
+ return "variable.language";
+ else if (futureReserved.hasOwnProperty(value))
+ return "invalid.illegal";
+ else if (builtinFunctions.hasOwnProperty(value))
+ return "support.function";
+ else if (value == "debugger")
+ return "invalid.deprecated";
+ else
+ if(value.match(/^(\$[a-zA-Z][a-zA-Z0-9_]*|self|parent)$/))
+ return "variable";
+ return "identifier";
+ },
+ // TODO: Unicode escape sequences
+ // TODO: Unicode identifiers
+ 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 : ".+"
+ }
+ ],
+ "qqstring" : [
+ {
+ token : "constant.language.escape",
+ regex : '\\\\(?:[nrtvef\\\\"$]|[0-7]{1,3}|x[0-9A-Fa-f]{1,2})'
+ }, {
+ token : "constant.language.escape",
+ regex : /\$[\w\d]+(?:\[[\w\d]+\])?/
+ }, {
+ token : "constant.language.escape",
+ regex : /\$\{[^"\}]+\}?/ // this is wrong but ok for now
+ }, {
+ token : "string",
+ regex : '"',
+ next : "start"
+ }, {
+ token : "string",
+ regex : '.+?'
+ }
+ ],
+ "qstring" : [
+ {
+ token : "constant.language.escape",
+ regex : "\\\\['\\\\]"
+ }, {
+ token : "string",
+ regex : "'",
+ next : "start"
+ }, {
+ token : "string",
+ regex : ".+?"
+ }
+ ]
+ };
+
+ this.embedRules(DocCommentHighlightRules, "doc-",
+ [ DocCommentHighlightRules.getEndRule("start") ]);
+};
+
+oop.inherits(PhpLangHighlightRules, TextHighlightRules);
+
+
+var PhpHighlightRules = function() {
+ HtmlHighlightRules.call(this);
+
+ for (var i in this.$rules) {
+ this.$rules[i].unshift({
+ token : "support.php_tag", // php open tag
+ regex : "<\\?(?:php|\\=)",
+ next : "php-start"
+ });
+ }
+
+ this.embedRules(PhpLangHighlightRules, "php-");
+
+ this.$rules["php-start"].unshift({
+ token : "support.php_tag", // php close tag
+ regex : "\\?>",
+ next : "start"
+ });
+};
+
+oop.inherits(PhpHighlightRules, HtmlHighlightRules);
+
+exports.PhpHighlightRules = PhpHighlightRules;
+});
+
+ace.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",
+ merge : true,
+ regex : "\\s+"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "TODO"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "[^@\\*]+"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "."
+ }]
+ };
+};
+
+oop.inherits(DocCommentHighlightRules, TextHighlightRules);
+
+DocCommentHighlightRules.getStartRule = function(start) {
+ return {
+ token : "comment.doc", // doc comment
+ merge : true,
+ regex : "\\/\\*(?=\\*)",
+ next : start
+ };
+};
+
+DocCommentHighlightRules.getEndRule = function (start) {
+ return {
+ token : "comment.doc", // closing comment
+ merge : true,
+ regex : "\\*\\/",
+ next : start
+ };
+};
+
+
+exports.DocCommentHighlightRules = DocCommentHighlightRules;
+
+});
+
+ace.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() {
+
+ // regexp must not have capturing parentheses
+ // regexps are ordered -> the first match is used
+ this.$rules = {
+ start : [{
+ token : "text",
+ merge : true,
+ regex : "<\\!\\[CDATA\\[",
+ next : "cdata"
+ }, {
+ token : "xml_pe",
+ regex : "<\\?.*?\\?>"
+ }, {
+ token : "comment",
+ merge : true,
+ regex : "<\\!--",
+ next : "comment"
+ }, {
+ token : "xml_pe",
+ regex : "<\\!.*?>"
+ }, {
+ token : "meta.tag",
+ regex : "<(?=\s*script\\b)",
+ next : "script"
+ }, {
+ token : "meta.tag",
+ regex : "<(?=\s*style\\b)",
+ next : "style"
+ }, {
+ token : "meta.tag", // opening tag
+ regex : "<\\/?",
+ next : "tag"
+ }, {
+ token : "text",
+ regex : "\\s+"
+ }, {
+ token : "constant.character.entity",
+ regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
+ }, {
+ token : "text",
+ regex : "[^<]+"
+ } ],
+
+ cdata : [ {
+ token : "text",
+ regex : "\\]\\]>",
+ next : "start"
+ }, {
+ token : "text",
+ merge : true,
+ regex : "\\s+"
+ }, {
+ token : "text",
+ merge : true,
+ regex : ".+"
+ } ],
+
+ comment : [ {
+ token : "comment",
+ regex : ".*?-->",
+ next : "start"
+ }, {
+ token : "comment",
+ merge : true,
+ regex : ".+"
+ } ]
+ };
+
+ 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;
+});
+
+ace.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 CssHighlightRules = function() {
+ var keywordMapper = this.createKeywordMapper({
+ "support.type": "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",
+ "support.function": "rgb|rgba|url|attr|counter|counters",
+ "support.constant": "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",
+ "support.constant.color": "aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow",
+ "support.constant.fonts": "arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace"
+ }, "text", true);
+
+ // regexp must not have capturing parentheses. Use (?:) instead.
+ // regexps are ordered -> the first match is used
+
+ var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
+ var pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
+ var 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 base_ruleset = [
+ {
+ token : "comment", // multi line comment
+ merge : true,
+ 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 : "([0-9]+)"
+ }, {
+ 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
+ merge : true,
+ 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
+ merge : true,
+ 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
+ merge : true,
+ 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;
+
+});
+
+ace.define('ace/mode/javascript_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/unicode', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var unicode = require("../unicode");
+var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
+var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+
+var JavaScriptHighlightRules = function() {
+ // see: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects
+ 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
+ "invalid.deprecated":
+ "__parent__|__count__|escape|unescape|with|__proto__|debugger",
+ "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|",
+ "storage.type":
+ "const|let|var|function",
+ "invalid.illegal":
+ "class|enum|extends|super|export|implements|private|" +
+ "public|interface|package|protected|static",
+ "constant.language":
+ "null|Infinity|NaN|undefined",
+ }, "identifier");
+
+
+ // keywords which can be followed by regular expressions
+ var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield";
+
+ // TODO: Unicode escape sequences
+ 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
+ ".)";
+
+ // regexp must not have capturing parentheses. Use (?:) instead.
+ // regexps are ordered -> the first match is used
+
+ this.$rules = {
+ "start" : [
+ {
+ token : "comment",
+ regex : /\/\/.*$/
+ },
+ DocCommentHighlightRules.getStartRule("doc-start"),
+ {
+ token : "comment", // multi line comment
+ merge : true,
+ 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/
+ }, {
+ // Sound.prototype.play =
+ token : [
+ "storage.type", "punctuation.operator", "support.function",
+ "punctuation.operator", "entity.name.function", "text","keyword.operator"
+ ],
+ regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)",
+ next: "function_arguments"
+ }, {
+ // Sound.play = function() { }
+ 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"
+ }, {
+ // play = function() { }
+ token : [
+ "entity.name.function", "text", "keyword.operator", "text", "storage.type",
+ "text", "paren.lparen"
+ ],
+ regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ // Sound.play = function play() { }
+ 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"
+ }, {
+ // function myFunc(arg) { }
+ token : [
+ "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ ],
+ regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ // foobar: function() { }
+ token : [
+ "entity.name.function", "text", "punctuation.operator",
+ "text", "storage.type", "text", "paren.lparen"
+ ],
+ regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ // : function() { } (this is for issues with 'foo': function() { })
+ token : [
+ "text", "text", "storage.type", "text", "paren.lparen"
+ ],
+ regex : "(:)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ token : "constant.language.boolean",
+ regex : /(?:true|false)\b/
+ }, {
+ 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 : /!|\$|%|&|\*|\-\-|\-|\+\+|\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=|\b(?:in|instanceof|new|delete|typeof|void)/,
+ 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: /^#!.*$/
+ }, {
+ token : "text",
+ regex : /\s+/
+ }
+ ],
+ // regular expressions are only allowed after certain tokens. This
+ // makes sure we don't mix up regexps with the divison operator
+ "regex_allowed": [
+ DocCommentHighlightRules.getStartRule("doc-start"),
+ {
+ token : "comment", // multi line comment
+ merge : true,
+ regex : "\\/\\*",
+ next : "comment_regex_allowed"
+ }, {
+ token : "comment",
+ regex : "\\/\\/.*$"
+ }, {
+ token: "string.regexp",
+ regex: "\\/",
+ next: "regex",
+ merge: true
+ }, {
+ token : "text",
+ regex : "\\s+"
+ }, {
+ // immediately return to the start mode without matching
+ // anything
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "regex": [
+ {
+ // escapes
+ token: "regexp.keyword.operator",
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
+ }, {
+ // flag
+ token: "string.regexp",
+ regex: "/\\w*",
+ next: "start",
+ merge: true
+ }, {
+ // invalid operators
+ token : "invalid",
+ regex: /\{\d+,?(?:\d+)?}[+*]|[+*^$?][+*]|\?\?/ // |[^$][?]
+ }, {
+ // operators
+ token : "constant.language.escape",
+ regex: /\(\?[:=!]|\)|\{\d+,?(?:\d+)?}|[+*]\?|[(|)$^+*?]/
+ }, {
+ token: "string.regexp",
+ regex: /{|[^\[\\{()$^+*?\/]+/,
+ merge: true
+ }, {
+ token: "constant.language.escape",
+ regex: /\[\^?/,
+ next: "regex_character_class",
+ merge: true
+ }, {
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "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",
+ merge: true
+ }, {
+ token: "constant.language.escape",
+ regex: "-",
+ }, {
+ token: "string.regexp.charachterclass",
+ regex: /[^\]\-\\]+/,
+ merge: true
+ }, {
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "function_arguments": [
+ {
+ token: "variable.parameter",
+ regex: identifierRe
+ }, {
+ token: "punctuation.operator",
+ regex: "[, ]+",
+ merge: true
+ }, {
+ token: "punctuation.operator",
+ regex: "$",
+ merge: true
+ }, {
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "comment_regex_allowed" : [
+ {
+ token : "comment", // closing comment
+ regex : ".*?\\*\\/",
+ merge : true,
+ next : "regex_allowed"
+ }, {
+ token : "comment", // comment spanning whole line
+ merge : true,
+ regex : ".+"
+ }
+ ],
+ "comment" : [
+ {
+ token : "comment", // closing comment
+ regex : ".*?\\*\\/",
+ merge : true,
+ next : "start"
+ }, {
+ token : "comment", // comment spanning whole line
+ merge : true,
+ regex : ".+"
+ }
+ ],
+ "qqstring" : [
+ {
+ token : "constant.language.escape",
+ regex : escapedRe
+ }, {
+ token : "string",
+ regex : '[^"\\\\]+',
+ merge : true
+ }, {
+ token : "string",
+ regex : "\\\\$",
+ next : "qqstring",
+ merge : true
+ }, {
+ token : "string",
+ regex : '"|$',
+ next : "start",
+ merge : true
+ }
+ ],
+ "qstring" : [
+ {
+ token : "constant.language.escape",
+ regex : escapedRe
+ }, {
+ token : "string",
+ regex : "[^'\\\\]+",
+ merge : true
+ }, {
+ token : "string",
+ regex : "\\\\$",
+ next : "qstring",
+ merge : true
+ }, {
+ token : "string",
+ regex : "'|$",
+ next : "start",
+ merge : true
+ }
+ ]
+ };
+
+ this.embedRules(DocCommentHighlightRules, "doc-",
+ [ DocCommentHighlightRules.getEndRule("start") ]);
+};
+
+oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
+
+exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
+});
+
+ace.define('ace/mode/xml_util', ['require', 'exports', 'module' ], function(require, exports, module) {
+
+
+function string(state) {
+ return [{
+ token : "string",
+ regex : '".*?"'
+ }, {
+ token : "string", // multi line string start
+ merge : true,
+ regex : '["].*',
+ next : state + "_qqstring"
+ }, {
+ token : "string",
+ regex : "'.*?'"
+ }, {
+ token : "string", // multi line string start
+ merge : true,
+ regex : "['].*",
+ next : state + "_qstring"
+ }];
+}
+
+function multiLineString(quote, state) {
+ return [{
+ token : "string",
+ merge : true,
+ regex : ".*?" + quote,
+ next : state
+ }, {
+ token : "string",
+ merge : true,
+ regex : '.+'
+ }];
+}
+
+exports.tag = function(states, name, nextState, tagMap) {
+ states[name] = [{
+ token : "text",
+ regex : "\\s+"
+ }, {
+ //token : "meta.tag",
+
+ token : !tagMap ? "meta.tag.tag-name" : function(value) {
+ if (tagMap[value])
+ return "meta.tag.tag-name." + tagMap[value];
+ else
+ return "meta.tag.tag-name";
+ },
+ merge : true,
+ 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",
+ merge : true,
+ 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));
+};
+
+});
+
+ace.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;
+});
+
+ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour'], function(require, exports, module) {
+
+
+var oop = require("../../lib/oop");
+var Behaviour = require("../behaviour").Behaviour;
+
+var CstyleBehaviour = function () {
+
+ this.add("braces", "insertion", function (state, action, editor, session, text) {
+ if (text == '{') {
+ var selection = editor.getSelectionRange();
+ var selected = session.doc.getTextRange(selection);
+ if (selected !== "") {
+ return {
+ text: '{' + selected + '}',
+ selection: false
+ };
+ } else {
+ 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) {
+ return {
+ text: '',
+ selection: [1, 1]
+ };
+ }
+ }
+ } else if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ if (rightChar == '}') {
+ var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column + 1});
+ if (!openBracePos)
+ return null;
+
+ var indent = this.getNextLineIndent(state, line.substring(0, line.length - 1), session.getTabString());
+ var next_indent = this.$getIndent(session.doc.getLine(openBracePos.row));
+
+ return {
+ text: '\n' + indent + '\n' + next_indent,
+ 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;
+ }
+ }
+ });
+
+ this.add("parens", "insertion", function (state, action, editor, session, text) {
+ if (text == '(') {
+ var selection = editor.getSelectionRange();
+ var selected = session.doc.getTextRange(selection);
+ if (selected !== "") {
+ return {
+ text: '(' + selected + ')',
+ selection: false
+ };
+ } else {
+ 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) {
+ 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 !== "") {
+ return {
+ text: '[' + selected + ']',
+ selection: false
+ };
+ } else {
+ 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) {
+ 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 !== "") {
+ 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);
+
+ // We're escaped.
+ if (leftChar == '\\') {
+ return null;
+ }
+
+ // Find what token we're inside.
+ 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;
+ }
+
+ // Try and be smart about when we auto insert.
+ 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)))) {
+ return {
+ text: quote + quote,
+ selection: [1,1]
+ };
+ } else if (token && token.type === "string") {
+ // Ignore input and move right one if we're typing over the closing quote.
+ 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 == '"') {
+ range.end.column++;
+ return range;
+ }
+ }
+ });
+
+};
+
+oop.inherits(CstyleBehaviour, Behaviour);
+
+exports.CstyleBehaviour = CstyleBehaviour;
+});
+
+ace.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);
+
+ var range = session.getCommentFoldRange(row, i + match[0].length);
+ range.end.column -= 2;
+ return range;
+ }
+
+ if (foldStyle !== "markbeginend")
+ return;
+
+ var match = line.match(this.foldingStopMarker);
+ if (match) {
+ var i = match.index + match[0].length;
+
+ if (match[2]) {
+ var range = session.getCommentFoldRange(row, i);
+ range.end.column -= 2;
+ return range;
+ }
+
+ var end = {row: row, column: i};
+ var start = session.$findOpeningBracket(match[1], end);
+
+ if (!start)
+ return;
+
+ start.column++;
+ end.column--;
+
+ return Range.fromPoints(start, end);
+ }
+ };
+
+}).call(FoldMode.prototype);
+
+});
+
+ace.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;
+
+ // must return "" if there's no fold, to enable caching
+ 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);
+ };
+
+}).call(FoldMode.prototype);
+
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/mode-powershell.js b/vendor/assets/javascripts/ace-src-noconflict/mode-powershell.js
new file mode 100644
index 00000000000..6e58237bde1
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/mode-powershell.js
@@ -0,0 +1,608 @@
+ace.define('ace/mode/powershell', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/powershell_highlight_rules', 'ace/mode/matching_brace_outdent', '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 PowershellHighlightRules = require("./powershell_highlight_rules").PowershellHighlightRules;
+var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
+var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
+var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+
+var Mode = function() {
+ this.$tokenizer = new Tokenizer(new PowershellHighlightRules().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);
+
+ var tokenizedLine = this.$tokenizer.getLineTokens(line, state);
+ var tokens = tokenizedLine.tokens;
+
+ if (tokens.length && tokens[tokens.length-1].type == "comment") {
+ return indent;
+ }
+
+ if (state == "start") {
+ var match = line.match(/^.*[\{\(\[]\s*$/);
+ 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) {
+ return null;
+ };
+
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+});
+ace.define('ace/mode/powershell_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 PowershellHighlightRules = function() {
+
+ var keywords = (
+ "function|if|else|elseif|switch|while|default|for|do|until|break|continue|" +
+ "foreach|return|filter|in|trap|throw|param|begin|process|end"
+ );
+
+ var builtinFunctions = (
+ "Get-Alias|Import-Alias|New-Alias|Set-Alias|Get-AuthenticodeSignature|Set-AuthenticodeSignature|" +
+ "Set-Location|Get-ChildItem|Clear-Item|Get-Command|Measure-Command|Trace-Command|" +
+ "Add-Computer|Checkpoint-Computer|Remove-Computer|Restart-Computer|Restore-Computer|Stop-Computer|" +
+ "Reset-ComputerMachinePassword|Test-ComputerSecureChannel|Add-Content|Get-Content|Set-Content|Clear-Content|" +
+ "Get-Command|Invoke-Command|Enable-ComputerRestore|Disable-ComputerRestore|Get-ComputerRestorePoint|Test-Connection|" +
+ "ConvertFrom-CSV|ConvertTo-CSV|ConvertTo-Html|ConvertTo-Xml|ConvertFrom-SecureString|ConvertTo-SecureString|" +
+ "Copy-Item|Export-Counter|Get-Counter|Import-Counter|Get-Credential|Get-Culture|" +
+ "Get-ChildItem|Get-Date|Set-Date|Remove-Item|Compare-Object|Get-Event|" +
+ "Get-WinEvent|New-Event|Remove-Event|Unregister-Event|Wait-Event|Clear-EventLog|" +
+ "Get-Eventlog|Limit-EventLog|New-Eventlog|Remove-EventLog|Show-EventLog|Write-EventLog|" +
+ "Get-EventSubscriber|Register-EngineEvent|Register-ObjectEvent|Register-WmiEvent|Get-ExecutionPolicy|Set-ExecutionPolicy|" +
+ "Export-Alias|Export-Clixml|Export-Console|Export-Csv|ForEach-Object|Format-Custom|" +
+ "Format-List|Format-Table|Format-Wide|Export-FormatData|Get-FormatData|Get-Item|" +
+ "Get-ChildItem|Get-Help|Add-History|Clear-History|Get-History|Invoke-History|" +
+ "Get-Host|Read-Host|Write-Host|Get-HotFix|Import-Clixml|Import-Csv|" +
+ "Invoke-Command|Invoke-Expression|Get-Item|Invoke-Item|New-Item|Remove-Item|" +
+ "Set-Item|Clear-ItemProperty|Copy-ItemProperty|Get-ItemProperty|Move-ItemProperty|New-ItemProperty|" +
+ "Remove-ItemProperty|Rename-ItemProperty|Set-ItemProperty|Get-Job|Receive-Job|Remove-Job|" +
+ "Start-Job|Stop-Job|Wait-Job|Stop-Process|Update-List|Get-Location|" +
+ "Pop-Location|Push-Location|Set-Location|Send-MailMessage|Add-Member|Get-Member|" +
+ "Move-Item|Compare-Object|Group-Object|Measure-Object|New-Object|Select-Object|" +
+ "Sort-Object|Where-Object|Out-Default|Out-File|Out-GridView|Out-Host|" +
+ "Out-Null|Out-Printer|Out-String|Convert-Path|Join-Path|Resolve-Path|" +
+ "Split-Path|Test-Path|Get-Pfxcertificate|Pop-Location|Push-Location|Get-Process|" +
+ "Start-Process|Stop-Process|Wait-Process|Enable-PSBreakpoint|Disable-PSBreakpoint|Get-PSBreakpoint|" +
+ "Set-PSBreakpoint|Remove-PSBreakpoint|Get-PSDrive|New-PSDrive|Remove-PSDrive|Get-PSProvider|" +
+ "Set-PSdebug|Enter-PSSession|Exit-PSSession|Export-PSSession|Get-PSSession|Import-PSSession|" +
+ "New-PSSession|Remove-PSSession|Disable-PSSessionConfiguration|Enable-PSSessionConfiguration|Get-PSSessionConfiguration|Register-PSSessionConfiguration|" +
+ "Set-PSSessionConfiguration|Unregister-PSSessionConfiguration|New-PSSessionOption|Add-PsSnapIn|Get-PsSnapin|Remove-PSSnapin|" +
+ "Get-Random|Read-Host|Remove-Item|Rename-Item|Rename-ItemProperty|Select-Object|" +
+ "Select-XML|Send-MailMessage|Get-Service|New-Service|Restart-Service|Resume-Service|" +
+ "Set-Service|Start-Service|Stop-Service|Suspend-Service|Sort-Object|Start-Sleep|" +
+ "ConvertFrom-StringData|Select-String|Tee-Object|New-Timespan|Trace-Command|Get-Tracesource|" +
+ "Set-Tracesource|Start-Transaction|Complete-Transaction|Get-Transaction|Use-Transaction|Undo-Transaction|" +
+ "Start-Transcript|Stop-Transcript|Add-Type|Update-TypeData|Get-Uiculture|Get-Unique|" +
+ "Update-Formatdata|Update-Typedata|Clear-Variable|Get-Variable|New-Variable|Remove-Variable|" +
+ "Set-Variable|New-WebServiceProxy|Where-Object|Write-Debug|Write-Error|Write-Host|" +
+ "Write-Output|Write-Progress|Write-Verbose|Write-Warning|Set-WmiInstance|Invoke-WmiMethod|" +
+ "Get-WmiObject|Remove-WmiObject|Connect-WSMan|Disconnect-WSMan|Test-WSMan|Invoke-WSManAction|" +
+ "Disable-WSManCredSSP|Enable-WSManCredSSP|Get-WSManCredSSP|New-WSManInstance|Get-WSManInstance|Set-WSManInstance|" +
+ "Remove-WSManInstance|Set-WSManQuickConfig|New-WSManSessionOption"
+ );
+
+ var keywordMapper = this.createKeywordMapper({
+ "support.function": builtinFunctions,
+ "keyword": keywords
+ }, "identifier");
+
+ var binaryOperatorsRe = "eq|ne|ge|gt|lt|le|like|notlike|match|notmatch|replace|contains|notcontains|" +
+ "ieq|ine|ige|igt|ile|ilt|ilike|inotlike|imatch|inotmatch|ireplace|icontains|inotcontains|" +
+ "is|isnot|as|" +
+ "and|or|band|bor|not";
+
+ // regexp must not have capturing parentheses. Use (?:) instead.
+ // regexps are ordered -> the first match is used
+
+ this.$rules = {
+ "start" : [
+ {
+ token : "comment",
+ regex : "#.*$"
+ }, {
+ 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 : "[$](?:[Tt]rue|[Ff]alse)\\b"
+ }, {
+ token : "constant.language",
+ regex : "[$][Nn]ull\\b"
+ }, {
+ token : "variable.instance",
+ regex : "[$][a-zA-Z][a-zA-Z0-9_]*\\b"
+ }, {
+ token : keywordMapper,
+ // TODO: Unicode escape sequences
+ // TODO: Unicode identifiers
+ regex : "[a-zA-Z_$][a-zA-Z0-9_$\\-]*\\b"
+ }, {
+ token : "keyword.operator",
+ regex : "\\-(?:" + binaryOperatorsRe + ")"
+ }, {
+ token : "keyword.operator",
+ regex : "&|\\*|\\+|\\-|\\=|\\+=|\\-="
+ }, {
+ token : "lparen",
+ regex : "[[({]"
+ }, {
+ token : "rparen",
+ regex : "[\\])}]"
+ }, {
+ token : "text",
+ regex : "\\s+"
+ }
+ ],
+ "comment" : [
+ {
+ token : "comment", // closing comment
+ regex : ".*?\\*\\/",
+ next : "start"
+ }, {
+ token : "comment", // comment spanning whole line
+ merge : true,
+ regex : ".+"
+ }
+ ]
+ };
+};
+
+oop.inherits(PowershellHighlightRules, TextHighlightRules);
+
+exports.PowershellHighlightRules = PowershellHighlightRules;
+});
+
+ace.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;
+});
+
+ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour'], function(require, exports, module) {
+
+
+var oop = require("../../lib/oop");
+var Behaviour = require("../behaviour").Behaviour;
+
+var CstyleBehaviour = function () {
+
+ this.add("braces", "insertion", function (state, action, editor, session, text) {
+ if (text == '{') {
+ var selection = editor.getSelectionRange();
+ var selected = session.doc.getTextRange(selection);
+ if (selected !== "") {
+ return {
+ text: '{' + selected + '}',
+ selection: false
+ };
+ } else {
+ 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) {
+ return {
+ text: '',
+ selection: [1, 1]
+ };
+ }
+ }
+ } else if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ if (rightChar == '}') {
+ var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column + 1});
+ if (!openBracePos)
+ return null;
+
+ var indent = this.getNextLineIndent(state, line.substring(0, line.length - 1), session.getTabString());
+ var next_indent = this.$getIndent(session.doc.getLine(openBracePos.row));
+
+ return {
+ text: '\n' + indent + '\n' + next_indent,
+ 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;
+ }
+ }
+ });
+
+ this.add("parens", "insertion", function (state, action, editor, session, text) {
+ if (text == '(') {
+ var selection = editor.getSelectionRange();
+ var selected = session.doc.getTextRange(selection);
+ if (selected !== "") {
+ return {
+ text: '(' + selected + ')',
+ selection: false
+ };
+ } else {
+ 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) {
+ 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 !== "") {
+ return {
+ text: '[' + selected + ']',
+ selection: false
+ };
+ } else {
+ 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) {
+ 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 !== "") {
+ 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);
+
+ // We're escaped.
+ if (leftChar == '\\') {
+ return null;
+ }
+
+ // Find what token we're inside.
+ 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;
+ }
+
+ // Try and be smart about when we auto insert.
+ 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)))) {
+ return {
+ text: quote + quote,
+ selection: [1,1]
+ };
+ } else if (token && token.type === "string") {
+ // Ignore input and move right one if we're typing over the closing quote.
+ 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 == '"') {
+ range.end.column++;
+ return range;
+ }
+ }
+ });
+
+};
+
+oop.inherits(CstyleBehaviour, Behaviour);
+
+exports.CstyleBehaviour = CstyleBehaviour;
+});
+
+ace.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);
+
+ var range = session.getCommentFoldRange(row, i + match[0].length);
+ range.end.column -= 2;
+ return range;
+ }
+
+ if (foldStyle !== "markbeginend")
+ return;
+
+ var match = line.match(this.foldingStopMarker);
+ if (match) {
+ var i = match.index + match[0].length;
+
+ if (match[2]) {
+ var range = session.getCommentFoldRange(row, i);
+ range.end.column -= 2;
+ return range;
+ }
+
+ var end = {row: row, column: i};
+ var start = session.$findOpeningBracket(match[1], end);
+
+ if (!start)
+ return;
+
+ start.column++;
+ end.column--;
+
+ return Range.fromPoints(start, end);
+ }
+ };
+
+}).call(FoldMode.prototype);
+
+});
+
+ace.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;
+
+ // must return "" if there's no fold, to enable caching
+ 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);
+ };
+
+}).call(FoldMode.prototype);
+
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/mode-python.js b/vendor/assets/javascripts/ace-src-noconflict/mode-python.js
new file mode 100644
index 00000000000..51e1acf7b75
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/mode-python.js
@@ -0,0 +1,383 @@
+/* ***** 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 ***** */
+
+ace.define('ace/mode/python', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/python_highlight_rules', 'ace/mode/folding/pythonic', 'ace/range'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var TextMode = require("./text").Mode;
+var Tokenizer = require("../tokenizer").Tokenizer;
+var PythonHighlightRules = require("./python_highlight_rules").PythonHighlightRules;
+var PythonFoldMode = require("./folding/pythonic").FoldMode;
+var Range = require("../range").Range;
+
+var Mode = function() {
+ this.$tokenizer = new Tokenizer(new PythonHighlightRules().getRules());
+ this.foldingRules = new PythonFoldMode("\\:");
+};
+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;
+
+ if (tokens.length && tokens[tokens.length-1].type == "comment") {
+ return indent;
+ }
+
+ if (state == "start") {
+ var match = line.match(/^.*[\{\(\[\:]\s*$/);
+ if (match) {
+ indent += tab;
+ }
+ }
+
+ return indent;
+ };
+
+ var outdents = {
+ "pass": 1,
+ "return": 1,
+ "raise": 1,
+ "break": 1,
+ "continue": 1
+ };
+
+ this.checkOutdent = function(state, line, input) {
+ if (input !== "\r\n" && input !== "\r" && input !== "\n")
+ return false;
+
+ var tokens = this.$tokenizer.getLineTokens(line.trim(), state).tokens;
+
+ if (!tokens)
+ return false;
+
+ // ignore trailing comments
+ do {
+ var last = tokens.pop();
+ } while (last && (last.type == "comment" || (last.type == "text" && last.value.match(/^\s+$/))));
+
+ if (!last)
+ return false;
+
+ return (last.type == "keyword" && outdents[last.value]);
+ };
+
+ this.autoOutdent = function(state, doc, row) {
+ // outdenting in python is slightly different because it always applies
+ // to the next line and only of a new line is inserted
+
+ row += 1;
+ var indent = this.$getIndent(doc.getLine(row));
+ var tab = doc.getTabString();
+ if (indent.slice(-tab.length) == tab)
+ doc.remove(new Range(row, indent.length-tab.length, row, indent.length));
+ };
+
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+});
+/*
+ * TODO: python delimiters
+ */
+
+ace.define('ace/mode/python_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 PythonHighlightRules = function() {
+
+ var keywords = (
+ "and|as|assert|break|class|continue|def|del|elif|else|except|exec|" +
+ "finally|for|from|global|if|import|in|is|lambda|not|or|pass|print|" +
+ "raise|return|try|while|with|yield"
+ );
+
+ var builtinConstants = (
+ "True|False|None|NotImplemented|Ellipsis|__debug__"
+ );
+
+ var builtinFunctions = (
+ "abs|divmod|input|open|staticmethod|all|enumerate|int|ord|str|any|" +
+ "eval|isinstance|pow|sum|basestring|execfile|issubclass|print|super|" +
+ "binfile|iter|property|tuple|bool|filter|len|range|type|bytearray|" +
+ "float|list|raw_input|unichr|callable|format|locals|reduce|unicode|" +
+ "chr|frozenset|long|reload|vars|classmethod|getattr|map|repr|xrange|" +
+ "cmp|globals|max|reversed|zip|compile|hasattr|memoryview|round|" +
+ "__import__|complex|hash|min|set|apply|delattr|help|next|setattr|" +
+ "buffer|dict|hex|object|slice|coerce|dir|id|oct|sorted|intern"
+ );
+
+ //var futureReserved = "";
+ var keywordMapper = this.createKeywordMapper({
+ "invalid.deprecated": "debugger",
+ "support.function": builtinFunctions,
+ //"invalid.illegal": futureReserved,
+ "constant.language": builtinConstants,
+ "keyword": keywords
+ }, "identifier");
+
+ var strPre = "(?:r|u|ur|R|U|UR|Ur|uR)?";
+
+ var decimalInteger = "(?:(?:[1-9]\\d*)|(?:0))";
+ var octInteger = "(?:0[oO]?[0-7]+)";
+ var hexInteger = "(?:0[xX][\\dA-Fa-f]+)";
+ var binInteger = "(?:0[bB][01]+)";
+ var integer = "(?:" + decimalInteger + "|" + octInteger + "|" + hexInteger + "|" + binInteger + ")";
+
+ var exponent = "(?:[eE][+-]?\\d+)";
+ var fraction = "(?:\\.\\d+)";
+ var intPart = "(?:\\d+)";
+ var pointFloat = "(?:(?:" + intPart + "?" + fraction + ")|(?:" + intPart + "\\.))";
+ var exponentFloat = "(?:(?:" + pointFloat + "|" + intPart + ")" + exponent + ")";
+ var floatNumber = "(?:" + exponentFloat + "|" + pointFloat + ")";
+
+ this.$rules = {
+ "start" : [ {
+ token : "comment",
+ regex : "#.*$"
+ }, {
+ token : "string", // """ string
+ regex : strPre + '"{3}(?:[^\\\\]|\\\\.)*?"{3}'
+ }, {
+ token : "string", // multi line """ string start
+ merge : true,
+ regex : strPre + '"{3}.*$',
+ next : "qqstring"
+ }, {
+ token : "string", // " string
+ regex : strPre + '"(?:[^\\\\]|\\\\.)*?"'
+ }, {
+ token : "string", // ''' string
+ regex : strPre + "'{3}(?:[^\\\\]|\\\\.)*?'{3}"
+ }, {
+ token : "string", // multi line ''' string start
+ merge : true,
+ regex : strPre + "'{3}.*$",
+ next : "qstring"
+ }, {
+ token : "string", // ' string
+ regex : strPre + "'(?:[^\\\\]|\\\\.)*?'"
+ }, {
+ token : "constant.numeric", // imaginary
+ regex : "(?:" + floatNumber + "|\\d+)[jJ]\\b"
+ }, {
+ token : "constant.numeric", // float
+ regex : floatNumber
+ }, {
+ token : "constant.numeric", // long integer
+ regex : integer + "[lL]\\b"
+ }, {
+ token : "constant.numeric", // integer
+ regex : integer + "\\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+"
+ } ],
+ "qqstring" : [ {
+ token : "string", // multi line """ string end
+ regex : '(?:[^\\\\]|\\\\.)*?"{3}',
+ next : "start"
+ }, {
+ token : "string",
+ merge : true,
+ regex : '.+'
+ } ],
+ "qstring" : [ {
+ token : "string", // multi line ''' string end
+ regex : "(?:[^\\\\]|\\\\.)*?'{3}",
+ next : "start"
+ }, {
+ token : "string",
+ merge : true,
+ regex : '.+'
+ } ]
+ };
+};
+
+oop.inherits(PythonHighlightRules, TextHighlightRules);
+
+exports.PythonHighlightRules = PythonHighlightRules;
+});
+
+ace.define('ace/mode/folding/pythonic', ['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(markers) {
+ this.foldingStartMarker = new RegExp("([\\[{])(?:\\s*)$|(" + markers + ")(?:\\s*)(?:#.*)?$");
+};
+oop.inherits(FoldMode, BaseFoldMode);
+
+(function() {
+
+ this.getFoldWidgetRange = function(session, foldStyle, row) {
+ var line = session.getLine(row);
+ var match = line.match(this.foldingStartMarker);
+ if (match) {
+ if (match[1])
+ return this.openingBracketBlock(session, match[1], row, match.index);
+ if (match[2])
+ return this.indentationBlock(session, row, match.index + match[2].length);
+ return this.indentationBlock(session, row);
+ }
+ }
+
+}).call(FoldMode.prototype);
+
+});
+
+ace.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;
+
+ // must return "" if there's no fold, to enable caching
+ 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);
+ };
+
+}).call(FoldMode.prototype);
+
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/mode-ruby.js b/vendor/assets/javascripts/ace-src-noconflict/mode-ruby.js
new file mode 100644
index 00000000000..72ad0a4a2ca
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/mode-ruby.js
@@ -0,0 +1,302 @@
+/* ***** 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 ***** */
+
+ace.define('ace/mode/ruby', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/ruby_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var TextMode = require("./text").Mode;
+var Tokenizer = require("../tokenizer").Tokenizer;
+var RubyHighlightRules = require("./ruby_highlight_rules").RubyHighlightRules;
+var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
+var Range = require("../range").Range;
+
+var Mode = function() {
+ this.$tokenizer = new Tokenizer(new RubyHighlightRules().getRules());
+ this.$outdent = new MatchingBraceOutdent();
+};
+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;
+
+ if (tokens.length && tokens[tokens.length-1].type == "comment") {
+ return indent;
+ }
+
+ 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;
+});
+
+ace.define('ace/mode/ruby_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 RubyHighlightRules = function() {
+
+ var builtinFunctions = (
+ "abort|Array|assert|assert_equal|assert_not_equal|assert_same|assert_not_same|" +
+ "assert_nil|assert_not_nil|assert_match|assert_no_match|assert_in_delta|assert_throws|" +
+ "assert_raise|assert_nothing_raised|assert_instance_of|assert_kind_of|assert_respond_to|" +
+ "assert_operator|assert_send|assert_difference|assert_no_difference|assert_recognizes|" +
+ "assert_generates|assert_response|assert_redirected_to|assert_template|assert_select|" +
+ "assert_select_email|assert_select_rjs|assert_select_encoded|css_select|at_exit|" +
+ "attr|attr_writer|attr_reader|attr_accessor|attr_accessible|autoload|binding|block_given?|callcc|" +
+ "caller|catch|chomp|chomp!|chop|chop!|defined?|delete_via_redirect|eval|exec|exit|" +
+ "exit!|fail|Float|flunk|follow_redirect!|fork|form_for|form_tag|format|gets|global_variables|gsub|" +
+ "gsub!|get_via_redirect|h|host!|https?|https!|include|Integer|lambda|link_to|" +
+ "link_to_unless_current|link_to_function|link_to_remote|load|local_variables|loop|open|open_session|" +
+ "p|print|printf|proc|putc|puts|post_via_redirect|put_via_redirect|raise|rand|" +
+ "raw|readline|readlines|redirect?|request_via_redirect|require|scan|select|" +
+ "set_trace_func|sleep|split|sprintf|srand|String|stylesheet_link_tag|syscall|system|sub|sub!|test|" +
+ "throw|trace_var|trap|untrace_var|atan2|cos|exp|frexp|ldexp|log|log10|sin|sqrt|tan|" +
+ "render|javascript_include_tag|csrf_meta_tag|label_tag|text_field_tag|submit_tag|check_box_tag|" +
+ "content_tag|radio_button_tag|text_area_tag|password_field_tag|hidden_field_tag|" +
+ "fields_for|select_tag|options_for_select|options_from_collection_for_select|collection_select|" +
+ "time_zone_select|select_date|select_time|select_datetime|date_select|time_select|datetime_select|" +
+ "select_year|select_month|select_day|select_hour|select_minute|select_second|file_field_tag|" +
+ "file_field|respond_to|skip_before_filter|around_filter|after_filter|verify|" +
+ "protect_from_forgery|rescue_from|helper_method|redirect_to|before_filter|" +
+ "send_data|send_file|validates_presence_of|validates_uniqueness_of|validates_length_of|" +
+ "validates_format_of|validates_acceptance_of|validates_associated|validates_exclusion_of|" +
+ "validates_inclusion_of|validates_numericality_of|validates_with|validates_each|" +
+ "authenticate_or_request_with_http_basic|authenticate_or_request_with_http_digest|" +
+ "filter_parameter_logging|match|get|post|resources|redirect|scope|assert_routing|" +
+ "translate|localize|extract_locale_from_tld|t|l|caches_page|expire_page|caches_action|expire_action|" +
+ "cache|expire_fragment|expire_cache_for|observe|cache_sweeper|" +
+ "has_many|has_one|belongs_to|has_and_belongs_to_many"
+ );
+
+ var keywords = (
+ "alias|and|BEGIN|begin|break|case|class|def|defined|do|else|elsif|END|end|ensure|" +
+ "__FILE__|finally|for|gem|if|in|__LINE__|module|next|not|or|private|protected|public|" +
+ "redo|rescue|retry|return|super|then|undef|unless|until|when|while|yield"
+ );
+
+ var buildinConstants = (
+ "true|TRUE|false|FALSE|nil|NIL|ARGF|ARGV|DATA|ENV|RUBY_PLATFORM|RUBY_RELEASE_DATE|" +
+ "RUBY_VERSION|STDERR|STDIN|STDOUT|TOPLEVEL_BINDING"
+ );
+
+ var builtinVariables = (
+ "\$DEBUG|\$defout|\$FILENAME|\$LOAD_PATH|\$SAFE|\$stdin|\$stdout|\$stderr|\$VERBOSE|" +
+ "$!|root_url|flash|session|cookies|params|request|response|logger|self"
+ );
+
+ var keywordMapper = this.createKeywordMapper({
+ "keyword": keywords,
+ "constant.language": buildinConstants,
+ "variable.language": builtinVariables,
+ "support.function": builtinFunctions,
+ "invalid.deprecated": "debugger" // TODO is this a remnant from js mode?
+ }, "identifier");
+
+ // regexp must not have capturing parentheses. Use (?:) instead.
+ // regexps are ordered -> the first match is used
+
+ this.$rules = {
+ "start" : [
+ {
+ token : "comment",
+ regex : "#.*$"
+ }, {
+ token : "comment", // multi line comment
+ merge : true,
+ regex : "^\=begin$",
+ next : "comment"
+ }, {
+ token : "string.regexp",
+ regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"
+ }, {
+ token : "string", // single line
+ regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
+ }, {
+ token : "string", // single line
+ regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
+ }, {
+ token : "string", // backtick string
+ regex : "[`](?:(?:\\\\.)|(?:[^'\\\\]))*?[`]"
+ }, {
+ token : "text", // namespaces aren't symbols
+ regex : "::"
+ }, {
+ token : "variable.instancce", // instance variable
+ regex : "@{1,2}(?:[a-zA-Z_]|\d)+"
+ }, {
+ token : "variable.class", // class name
+ regex : "[A-Z](?:[a-zA-Z_]|\d)+"
+ }, {
+ token : "string", // symbol
+ regex : "[:](?:[A-Za-z_]|[@$](?=[a-zA-Z0-9_]))[a-zA-Z0-9_]*[!=?]?"
+ }, {
+ token : "constant.numeric", // hex
+ regex : "0[xX][0-9a-fA-F](?:[0-9a-fA-F]|_(?=[0-9a-fA-F]))*\\b"
+ }, {
+ token : "constant.numeric", // float
+ regex : "[+-]?\\d(?:\\d|_(?=\\d))*(?:(?:\\.\\d(?:\\d|_(?=\\d))*)?(?:[eE][+-]?\\d+)?)?\\b"
+ }, {
+ token : "constant.language.boolean",
+ regex : "(?:true|false)\\b"
+ }, {
+ token : keywordMapper,
+ // TODO: Unicode escape sequences
+ // TODO: Unicode identifiers
+ regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
+ }, {
+ token : "keyword.operator",
+ regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"
+ }, {
+ token : "paren.lparen",
+ regex : "[[({]"
+ }, {
+ token : "paren.rparen",
+ regex : "[\\])}]"
+ }, {
+ token : "text",
+ regex : "\\s+"
+ }
+ ],
+ "comment" : [
+ {
+ token : "comment", // closing comment
+ regex : "^\=end$",
+ next : "start"
+ }, {
+ token : "comment", // comment spanning whole line
+ merge : true,
+ regex : ".+"
+ }
+ ]
+ };
+};
+
+oop.inherits(RubyHighlightRules, TextHighlightRules);
+
+exports.RubyHighlightRules = RubyHighlightRules;
+});
+
+ace.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;
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/mode-scad.js b/vendor/assets/javascripts/ace-src-noconflict/mode-scad.js
new file mode 100644
index 00000000000..3d3c42cd187
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/mode-scad.js
@@ -0,0 +1,712 @@
+/* ***** 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 ***** */
+
+ace.define('ace/mode/scad', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/scad_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', '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 scadHighlightRules = require("./scad_highlight_rules").scadHighlightRules;
+var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
+var Range = require("../range").Range;
+var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
+var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+
+var Mode = function() {
+ this.$tokenizer = new Tokenizer(new scadHighlightRules().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") {
+ var match = line.match(/^.*[\{\(\[]\s*$/);
+ if (match) {
+ indent += tab;
+ }
+ } else if (state == "doc-start") {
+ if (endState == "start") {
+ 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);
+ };
+
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+});
+
+ace.define('ace/mode/scad_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var lang = require("../lib/lang");
+var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
+var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+
+var scadHighlightRules = function() {
+ var keywordMapper = this.createKeywordMapper({
+ "variable.language": "this",
+ "keyword": "module|if|else|for",
+ "constant.language": "NULL",
+ }, "identifier");
+
+ // regexp must not have capturing parentheses. Use (?:) instead.
+ // regexps are ordered -> the first match is used
+
+ this.$rules = {
+ "start" : [
+ {
+ token : "comment",
+ regex : "\\/\\/.*$"
+ },
+ DocCommentHighlightRules.getStartRule("start"),
+ {
+ token : "comment", // multi line comment
+ merge : true,
+ 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 : "constant", // <CONSTANT>
+ regex : "<[a-zA-Z0-9.]+>"
+ }, {
+ token : "keyword", // pre-compiler directivs
+ regex : "(?:use|include)"
+ }, {
+ token : keywordMapper,
+ regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
+ }, {
+ token : "keyword.operator",
+ regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|==|=|!=|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|new|delete|typeof|void)"
+ }, {
+ 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
+ merge : true,
+ regex : ".+"
+ }
+ ],
+ "qqstring" : [
+ {
+ token : "string",
+ regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"',
+ next : "start"
+ }, {
+ token : "string",
+ merge : true,
+ regex : '.+'
+ }
+ ],
+ "qstring" : [
+ {
+ token : "string",
+ regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'",
+ next : "start"
+ }, {
+ token : "string",
+ merge : true,
+ regex : '.+'
+ }
+ ]
+ };
+
+ this.embedRules(DocCommentHighlightRules, "doc-",
+ [ DocCommentHighlightRules.getEndRule("start") ]);
+};
+
+oop.inherits(scadHighlightRules, TextHighlightRules);
+
+exports.scadHighlightRules = scadHighlightRules;
+});
+
+ace.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",
+ merge : true,
+ regex : "\\s+"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "TODO"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "[^@\\*]+"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "."
+ }]
+ };
+};
+
+oop.inherits(DocCommentHighlightRules, TextHighlightRules);
+
+DocCommentHighlightRules.getStartRule = function(start) {
+ return {
+ token : "comment.doc", // doc comment
+ merge : true,
+ regex : "\\/\\*(?=\\*)",
+ next : start
+ };
+};
+
+DocCommentHighlightRules.getEndRule = function (start) {
+ return {
+ token : "comment.doc", // closing comment
+ merge : true,
+ regex : "\\*\\/",
+ next : start
+ };
+};
+
+
+exports.DocCommentHighlightRules = DocCommentHighlightRules;
+
+});
+
+ace.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;
+});
+
+ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour'], function(require, exports, module) {
+
+
+var oop = require("../../lib/oop");
+var Behaviour = require("../behaviour").Behaviour;
+
+var CstyleBehaviour = function () {
+
+ this.add("braces", "insertion", function (state, action, editor, session, text) {
+ if (text == '{') {
+ var selection = editor.getSelectionRange();
+ var selected = session.doc.getTextRange(selection);
+ if (selected !== "") {
+ return {
+ text: '{' + selected + '}',
+ selection: false
+ };
+ } else {
+ 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) {
+ return {
+ text: '',
+ selection: [1, 1]
+ };
+ }
+ }
+ } else if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ if (rightChar == '}') {
+ var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column + 1});
+ if (!openBracePos)
+ return null;
+
+ var indent = this.getNextLineIndent(state, line.substring(0, line.length - 1), session.getTabString());
+ var next_indent = this.$getIndent(session.doc.getLine(openBracePos.row));
+
+ return {
+ text: '\n' + indent + '\n' + next_indent,
+ 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;
+ }
+ }
+ });
+
+ this.add("parens", "insertion", function (state, action, editor, session, text) {
+ if (text == '(') {
+ var selection = editor.getSelectionRange();
+ var selected = session.doc.getTextRange(selection);
+ if (selected !== "") {
+ return {
+ text: '(' + selected + ')',
+ selection: false
+ };
+ } else {
+ 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) {
+ 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 !== "") {
+ return {
+ text: '[' + selected + ']',
+ selection: false
+ };
+ } else {
+ 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) {
+ 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 !== "") {
+ 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);
+
+ // We're escaped.
+ if (leftChar == '\\') {
+ return null;
+ }
+
+ // Find what token we're inside.
+ 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;
+ }
+
+ // Try and be smart about when we auto insert.
+ 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)))) {
+ return {
+ text: quote + quote,
+ selection: [1,1]
+ };
+ } else if (token && token.type === "string") {
+ // Ignore input and move right one if we're typing over the closing quote.
+ 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 == '"') {
+ range.end.column++;
+ return range;
+ }
+ }
+ });
+
+};
+
+oop.inherits(CstyleBehaviour, Behaviour);
+
+exports.CstyleBehaviour = CstyleBehaviour;
+});
+
+ace.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);
+
+ var range = session.getCommentFoldRange(row, i + match[0].length);
+ range.end.column -= 2;
+ return range;
+ }
+
+ if (foldStyle !== "markbeginend")
+ return;
+
+ var match = line.match(this.foldingStopMarker);
+ if (match) {
+ var i = match.index + match[0].length;
+
+ if (match[2]) {
+ var range = session.getCommentFoldRange(row, i);
+ range.end.column -= 2;
+ return range;
+ }
+
+ var end = {row: row, column: i};
+ var start = session.$findOpeningBracket(match[1], end);
+
+ if (!start)
+ return;
+
+ start.column++;
+ end.column--;
+
+ return Range.fromPoints(start, end);
+ }
+ };
+
+}).call(FoldMode.prototype);
+
+});
+
+ace.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;
+
+ // must return "" if there's no fold, to enable caching
+ 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);
+ };
+
+}).call(FoldMode.prototype);
+
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/mode-scala.js b/vendor/assets/javascripts/ace-src-noconflict/mode-scala.js
new file mode 100644
index 00000000000..ee8ebb8fc0c
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/mode-scala.js
@@ -0,0 +1,1151 @@
+ace.define('ace/mode/scala', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/javascript', 'ace/tokenizer', 'ace/mode/scala_highlight_rules'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var JavaScriptMode = require("./javascript").Mode;
+var Tokenizer = require("../tokenizer").Tokenizer;
+var ScalaHighlightRules = require("./scala_highlight_rules").ScalaHighlightRules;
+
+var Mode = function() {
+ JavaScriptMode.call(this);
+
+ this.$tokenizer = new Tokenizer(new ScalaHighlightRules().getRules());
+};
+oop.inherits(Mode, JavaScriptMode);
+
+(function() {
+
+ this.createWorker = function(session) {
+ return null;
+ };
+
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+});
+
+ace.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) {
+ var errors = [];
+ for (var i=0; i<results.data.length; i++) {
+ var error = results.data[i];
+ if (error)
+ errors.push({
+ row: error.line-1,
+ column: error.character-1,
+ text: error.reason,
+ type: "warning",
+ lint: error
+ });
+ }
+ session.setAnnotations(errors);
+ });
+
+ worker.on("narcissus", function(e) {
+ session.setAnnotations([e.data]);
+ });
+
+ worker.on("terminate", function() {
+ session.clearAnnotations();
+ });
+
+ return worker;
+ };
+
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+});
+
+ace.define('ace/mode/javascript_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/unicode', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var unicode = require("../unicode");
+var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
+var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+
+var JavaScriptHighlightRules = function() {
+ // see: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects
+ 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
+ "invalid.deprecated":
+ "__parent__|__count__|escape|unescape|with|__proto__|debugger",
+ "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|",
+ "storage.type":
+ "const|let|var|function",
+ "invalid.illegal":
+ "class|enum|extends|super|export|implements|private|" +
+ "public|interface|package|protected|static",
+ "constant.language":
+ "null|Infinity|NaN|undefined",
+ }, "identifier");
+
+
+ // keywords which can be followed by regular expressions
+ var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield";
+
+ // TODO: Unicode escape sequences
+ 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
+ ".)";
+
+ // regexp must not have capturing parentheses. Use (?:) instead.
+ // regexps are ordered -> the first match is used
+
+ this.$rules = {
+ "start" : [
+ {
+ token : "comment",
+ regex : /\/\/.*$/
+ },
+ DocCommentHighlightRules.getStartRule("doc-start"),
+ {
+ token : "comment", // multi line comment
+ merge : true,
+ 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/
+ }, {
+ // Sound.prototype.play =
+ token : [
+ "storage.type", "punctuation.operator", "support.function",
+ "punctuation.operator", "entity.name.function", "text","keyword.operator"
+ ],
+ regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)",
+ next: "function_arguments"
+ }, {
+ // Sound.play = function() { }
+ 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"
+ }, {
+ // play = function() { }
+ token : [
+ "entity.name.function", "text", "keyword.operator", "text", "storage.type",
+ "text", "paren.lparen"
+ ],
+ regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ // Sound.play = function play() { }
+ 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"
+ }, {
+ // function myFunc(arg) { }
+ token : [
+ "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ ],
+ regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ // foobar: function() { }
+ token : [
+ "entity.name.function", "text", "punctuation.operator",
+ "text", "storage.type", "text", "paren.lparen"
+ ],
+ regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ // : function() { } (this is for issues with 'foo': function() { })
+ token : [
+ "text", "text", "storage.type", "text", "paren.lparen"
+ ],
+ regex : "(:)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ token : "constant.language.boolean",
+ regex : /(?:true|false)\b/
+ }, {
+ 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 : /!|\$|%|&|\*|\-\-|\-|\+\+|\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=|\b(?:in|instanceof|new|delete|typeof|void)/,
+ 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: /^#!.*$/
+ }, {
+ token : "text",
+ regex : /\s+/
+ }
+ ],
+ // regular expressions are only allowed after certain tokens. This
+ // makes sure we don't mix up regexps with the divison operator
+ "regex_allowed": [
+ DocCommentHighlightRules.getStartRule("doc-start"),
+ {
+ token : "comment", // multi line comment
+ merge : true,
+ regex : "\\/\\*",
+ next : "comment_regex_allowed"
+ }, {
+ token : "comment",
+ regex : "\\/\\/.*$"
+ }, {
+ token: "string.regexp",
+ regex: "\\/",
+ next: "regex",
+ merge: true
+ }, {
+ token : "text",
+ regex : "\\s+"
+ }, {
+ // immediately return to the start mode without matching
+ // anything
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "regex": [
+ {
+ // escapes
+ token: "regexp.keyword.operator",
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
+ }, {
+ // flag
+ token: "string.regexp",
+ regex: "/\\w*",
+ next: "start",
+ merge: true
+ }, {
+ // invalid operators
+ token : "invalid",
+ regex: /\{\d+,?(?:\d+)?}[+*]|[+*^$?][+*]|\?\?/ // |[^$][?]
+ }, {
+ // operators
+ token : "constant.language.escape",
+ regex: /\(\?[:=!]|\)|\{\d+,?(?:\d+)?}|[+*]\?|[(|)$^+*?]/
+ }, {
+ token: "string.regexp",
+ regex: /{|[^\[\\{()$^+*?\/]+/,
+ merge: true
+ }, {
+ token: "constant.language.escape",
+ regex: /\[\^?/,
+ next: "regex_character_class",
+ merge: true
+ }, {
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "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",
+ merge: true
+ }, {
+ token: "constant.language.escape",
+ regex: "-",
+ }, {
+ token: "string.regexp.charachterclass",
+ regex: /[^\]\-\\]+/,
+ merge: true
+ }, {
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "function_arguments": [
+ {
+ token: "variable.parameter",
+ regex: identifierRe
+ }, {
+ token: "punctuation.operator",
+ regex: "[, ]+",
+ merge: true
+ }, {
+ token: "punctuation.operator",
+ regex: "$",
+ merge: true
+ }, {
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "comment_regex_allowed" : [
+ {
+ token : "comment", // closing comment
+ regex : ".*?\\*\\/",
+ merge : true,
+ next : "regex_allowed"
+ }, {
+ token : "comment", // comment spanning whole line
+ merge : true,
+ regex : ".+"
+ }
+ ],
+ "comment" : [
+ {
+ token : "comment", // closing comment
+ regex : ".*?\\*\\/",
+ merge : true,
+ next : "start"
+ }, {
+ token : "comment", // comment spanning whole line
+ merge : true,
+ regex : ".+"
+ }
+ ],
+ "qqstring" : [
+ {
+ token : "constant.language.escape",
+ regex : escapedRe
+ }, {
+ token : "string",
+ regex : '[^"\\\\]+',
+ merge : true
+ }, {
+ token : "string",
+ regex : "\\\\$",
+ next : "qqstring",
+ merge : true
+ }, {
+ token : "string",
+ regex : '"|$',
+ next : "start",
+ merge : true
+ }
+ ],
+ "qstring" : [
+ {
+ token : "constant.language.escape",
+ regex : escapedRe
+ }, {
+ token : "string",
+ regex : "[^'\\\\]+",
+ merge : true
+ }, {
+ token : "string",
+ regex : "\\\\$",
+ next : "qstring",
+ merge : true
+ }, {
+ token : "string",
+ regex : "'|$",
+ next : "start",
+ merge : true
+ }
+ ]
+ };
+
+ this.embedRules(DocCommentHighlightRules, "doc-",
+ [ DocCommentHighlightRules.getEndRule("start") ]);
+};
+
+oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
+
+exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
+});
+
+ace.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",
+ merge : true,
+ regex : "\\s+"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "TODO"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "[^@\\*]+"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "."
+ }]
+ };
+};
+
+oop.inherits(DocCommentHighlightRules, TextHighlightRules);
+
+DocCommentHighlightRules.getStartRule = function(start) {
+ return {
+ token : "comment.doc", // doc comment
+ merge : true,
+ regex : "\\/\\*(?=\\*)",
+ next : start
+ };
+};
+
+DocCommentHighlightRules.getEndRule = function (start) {
+ return {
+ token : "comment.doc", // closing comment
+ merge : true,
+ regex : "\\*\\/",
+ next : start
+ };
+};
+
+
+exports.DocCommentHighlightRules = DocCommentHighlightRules;
+
+});
+
+ace.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;
+});
+
+ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour'], function(require, exports, module) {
+
+
+var oop = require("../../lib/oop");
+var Behaviour = require("../behaviour").Behaviour;
+
+var CstyleBehaviour = function () {
+
+ this.add("braces", "insertion", function (state, action, editor, session, text) {
+ if (text == '{') {
+ var selection = editor.getSelectionRange();
+ var selected = session.doc.getTextRange(selection);
+ if (selected !== "") {
+ return {
+ text: '{' + selected + '}',
+ selection: false
+ };
+ } else {
+ 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) {
+ return {
+ text: '',
+ selection: [1, 1]
+ };
+ }
+ }
+ } else if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ if (rightChar == '}') {
+ var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column + 1});
+ if (!openBracePos)
+ return null;
+
+ var indent = this.getNextLineIndent(state, line.substring(0, line.length - 1), session.getTabString());
+ var next_indent = this.$getIndent(session.doc.getLine(openBracePos.row));
+
+ return {
+ text: '\n' + indent + '\n' + next_indent,
+ 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;
+ }
+ }
+ });
+
+ this.add("parens", "insertion", function (state, action, editor, session, text) {
+ if (text == '(') {
+ var selection = editor.getSelectionRange();
+ var selected = session.doc.getTextRange(selection);
+ if (selected !== "") {
+ return {
+ text: '(' + selected + ')',
+ selection: false
+ };
+ } else {
+ 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) {
+ 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 !== "") {
+ return {
+ text: '[' + selected + ']',
+ selection: false
+ };
+ } else {
+ 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) {
+ 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 !== "") {
+ 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);
+
+ // We're escaped.
+ if (leftChar == '\\') {
+ return null;
+ }
+
+ // Find what token we're inside.
+ 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;
+ }
+
+ // Try and be smart about when we auto insert.
+ 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)))) {
+ return {
+ text: quote + quote,
+ selection: [1,1]
+ };
+ } else if (token && token.type === "string") {
+ // Ignore input and move right one if we're typing over the closing quote.
+ 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 == '"') {
+ range.end.column++;
+ return range;
+ }
+ }
+ });
+
+};
+
+oop.inherits(CstyleBehaviour, Behaviour);
+
+exports.CstyleBehaviour = CstyleBehaviour;
+});
+
+ace.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);
+
+ var range = session.getCommentFoldRange(row, i + match[0].length);
+ range.end.column -= 2;
+ return range;
+ }
+
+ if (foldStyle !== "markbeginend")
+ return;
+
+ var match = line.match(this.foldingStopMarker);
+ if (match) {
+ var i = match.index + match[0].length;
+
+ if (match[2]) {
+ var range = session.getCommentFoldRange(row, i);
+ range.end.column -= 2;
+ return range;
+ }
+
+ var end = {row: row, column: i};
+ var start = session.$findOpeningBracket(match[1], end);
+
+ if (!start)
+ return;
+
+ start.column++;
+ end.column--;
+
+ return Range.fromPoints(start, end);
+ }
+ };
+
+}).call(FoldMode.prototype);
+
+});
+
+ace.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;
+
+ // must return "" if there's no fold, to enable caching
+ 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);
+ };
+
+}).call(FoldMode.prototype);
+
+});
+ace.define('ace/mode/scala_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 ScalaHighlightRules = function() {
+
+ // taken from http://download.oracle.com/javase/tutorial/java/nutsandbolts/_keywords.html
+ var keywords = (
+ "case|default|do|else|for|if|match|while|throw|return|try|catch|finally|yield|" +
+ "abstract|class|def|extends|final|forSome|implicit|implicits|import|lazy|new|object|" +
+ "override|package|private|protected|sealed|super|this|trait|type|val|var|with"
+ );
+
+ var buildinConstants = ("true|false");
+
+ 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|" +
+ "Unit|Any|AnyVal|AnyRef|Null|ScalaObject|Singleton|Seq|Iterable|List|" +
+ "Option|Array|Char|Byte|Short|Int|Long|Nothing"
+
+
+ );
+
+ var keywordMapper = this.createKeywordMapper({
+ "variable.language": "this",
+ "keyword": keywords,
+ "support.function": langClasses,
+ "constant.language": buildinConstants
+ }, "identifier");
+
+ // regexp must not have capturing parentheses. Use (?:) instead.
+ // regexps are ordered -> the first match is used
+
+ this.$rules = {
+ "start" : [
+ {
+ token : "comment",
+ regex : "\\/\\/.*$"
+ },
+ DocCommentHighlightRules.getStartRule("doc-start"),
+ {
+ token : "comment", // multi line comment
+ merge : true,
+ regex : "\\/\\*",
+ next : "comment"
+ }, {
+ token : "string.regexp",
+ regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"
+ }, {
+ token : "string",
+ regex : '"""',
+ next : "tstring"
+ }, {
+ token : "string",
+ regex : '"(?=.)', // " strings can't span multiple lines
+ next : "string"
+ }, {
+ token : "symbol.constant", // single line
+ regex : "'[\\w\\d_]+"
+ }, {
+ 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,
+ // TODO: Unicode escape sequences
+ // TODO: Unicode identifiers
+ regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
+ }, {
+ token : "keyword.operator",
+ regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"
+ }, {
+ 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
+ merge : true,
+ regex : ".+"
+ }
+ ],
+ "string" : [
+ {
+ token : "escape",
+ regex : '\\\\"',
+ }, {
+ token : "string",
+ merge : true,
+ regex : '"',
+ next : "start"
+ }, {
+ token : "string.invalid",
+ regex : '[^"\\\\]*$',
+ next : "start"
+ }, {
+ token : "string",
+ regex : '[^"\\\\]+',
+ merge : true
+ }
+ ],
+ "tstring" : [
+ {
+ token : "string", // closing comment
+ regex : '"{3,5}',
+ next : "start"
+ }, {
+ token : "string", // comment spanning whole line
+ merge : true,
+ regex : ".+?"
+ }
+ ]
+ };
+
+ this.embedRules(DocCommentHighlightRules, "doc-",
+ [ DocCommentHighlightRules.getEndRule("start") ]);
+};
+
+oop.inherits(ScalaHighlightRules, TextHighlightRules);
+
+exports.ScalaHighlightRules = ScalaHighlightRules;
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/mode-scss.js b/vendor/assets/javascripts/ace-src-noconflict/mode-scss.js
new file mode 100644
index 00000000000..10a2b33d8fe
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/mode-scss.js
@@ -0,0 +1,530 @@
+/* ***** 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 ***** */
+
+ace.define('ace/mode/scss', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/scss_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/mode/folding/cstyle'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var TextMode = require("./text").Mode;
+var Tokenizer = require("../tokenizer").Tokenizer;
+var ScssHighlightRules = require("./scss_highlight_rules").ScssHighlightRules;
+var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
+var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+
+var Mode = function() {
+ this.$tokenizer = new Tokenizer(new ScssHighlightRules().getRules(), "i");
+ this.$outdent = new MatchingBraceOutdent();
+ this.foldingRules = new CStyleFoldMode();
+};
+oop.inherits(Mode, TextMode);
+
+(function() {
+
+ this.getNextLineIndent = function(state, line, tab) {
+ var indent = this.$getIndent(line);
+
+ // ignore braces in comments
+ 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);
+ };
+
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+
+});
+
+ace.define('ace/mode/scss_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 ScssHighlightRules = function() {
+
+ var properties = lang.arrayToMap( (function () {
+
+ var browserPrefix = ("-webkit-|-moz-|-o-|-ms-|-svg-|-pie-|-khtml-").split("|");
+
+ var prefixProperties = ("appearance|background-clip|background-inline-policy|background-origin|" +
+ "background-size|binding|border-bottom-colors|border-left-colors|" +
+ "border-right-colors|border-top-colors|border-end|border-end-color|" +
+ "border-end-style|border-end-width|border-image|border-start|" +
+ "border-start-color|border-start-style|border-start-width|box-align|" +
+ "box-direction|box-flex|box-flexgroup|box-ordinal-group|box-orient|" +
+ "box-pack|box-sizing|column-count|column-gap|column-width|column-rule|" +
+ "column-rule-width|column-rule-style|column-rule-color|float-edge|" +
+ "font-feature-settings|font-language-override|force-broken-image-icon|" +
+ "image-region|margin-end|margin-start|opacity|outline|outline-color|" +
+ "outline-offset|outline-radius|outline-radius-bottomleft|" +
+ "outline-radius-bottomright|outline-radius-topleft|outline-radius-topright|" +
+ "outline-style|outline-width|padding-end|padding-start|stack-sizing|" +
+ "tab-size|text-blink|text-decoration-color|text-decoration-line|" +
+ "text-decoration-style|transform|transform-origin|transition|" +
+ "transition-delay|transition-duration|transition-property|" +
+ "transition-timing-function|user-focus|user-input|user-modify|user-select|" +
+ "window-shadow|border-radius").split("|");
+
+ var properties = ("azimuth|background-attachment|background-color|background-image|" +
+ "background-position|background-repeat|background|border-bottom-color|" +
+ "border-bottom-style|border-bottom-width|border-bottom|border-collapse|" +
+ "border-color|border-left-color|border-left-style|border-left-width|" +
+ "border-left|border-right-color|border-right-style|border-right-width|" +
+ "border-right|border-spacing|border-style|border-top-color|" +
+ "border-top-style|border-top-width|border-top|border-width|border|" +
+ "bottom|box-sizing|caption-side|clear|clip|color|content|counter-increment|" +
+ "counter-reset|cue-after|cue-before|cue|cursor|direction|display|" +
+ "elevation|empty-cells|float|font-family|font-size-adjust|font-size|" +
+ "font-stretch|font-style|font-variant|font-weight|font|height|left|" +
+ "letter-spacing|line-height|list-style-image|list-style-position|" +
+ "list-style-type|list-style|margin-bottom|margin-left|margin-right|" +
+ "margin-top|marker-offset|margin|marks|max-height|max-width|min-height|" +
+ "min-width|opacity|orphans|outline-color|" +
+ "outline-style|outline-width|outline|overflow|overflow-x|overflow-y|padding-bottom|" +
+ "padding-left|padding-right|padding-top|padding|page-break-after|" +
+ "page-break-before|page-break-inside|page|pause-after|pause-before|" +
+ "pause|pitch-range|pitch|play-during|position|quotes|richness|right|" +
+ "size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|" +
+ "stress|table-layout|text-align|text-decoration|text-indent|" +
+ "text-shadow|text-transform|top|unicode-bidi|vertical-align|" +
+ "visibility|voice-family|volume|white-space|widows|width|word-spacing|" +
+ "z-index").split("|");
+
+ //The return array
+ var ret = [];
+
+ //All prefixProperties will get the browserPrefix in
+ //the begning by join the prefixProperties array with the value of browserPrefix
+ for (var i=0, ln=browserPrefix.length; i<ln; i++) {
+ Array.prototype.push.apply(
+ ret,
+ (( browserPrefix[i] + prefixProperties.join("|" + browserPrefix[i]) ).split("|"))
+ );
+ }
+
+ //Add also prefixProperties and properties without any browser prefix
+ Array.prototype.push.apply(ret, prefixProperties);
+ Array.prototype.push.apply(ret, properties);
+
+ return ret;
+
+ })() );
+
+
+
+ var functions = lang.arrayToMap(
+ ("hsl|hsla|rgb|rgba|url|attr|counter|counters|abs|adjust_color|adjust_hue|" +
+ "alpha|join|blue|ceil|change_color|comparable|complement|darken|desaturate|" +
+ "floor|grayscale|green|hue|if|invert|join|length|lighten|lightness|mix|" +
+ "nth|opacify|opacity|percentage|quote|red|round|saturate|saturation|" +
+ "scale_color|transparentize|type_of|unit|unitless|unqoute").split("|")
+ );
+
+ var constants = lang.arrayToMap(
+ ("absolute|all-scroll|always|armenian|auto|baseline|below|bidi-override|" +
+ "block|bold|bolder|border-box|both|bottom|break-all|break-word|capitalize|center|" +
+ "char|circle|cjk-ideographic|col-resize|collapse|content-box|crosshair|dashed|" +
+ "decimal-leading-zero|decimal|default|disabled|disc|" +
+ "distribute-all-lines|distribute-letter|distribute-space|" +
+ "distribute|dotted|double|e-resize|ellipsis|fixed|georgian|groove|" +
+ "hand|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|" +
+ "ideograph-alpha|ideograph-numeric|ideograph-parenthesis|" +
+ "ideograph-space|inactive|inherit|inline-block|inline|inset|inside|" +
+ "inter-ideograph|inter-word|italic|justify|katakana-iroha|katakana|" +
+ "keep-all|left|lighter|line-edge|line-through|line|list-item|loose|" +
+ "lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|" +
+ "medium|middle|move|n-resize|ne-resize|newspaper|no-drop|no-repeat|" +
+ "nw-resize|none|normal|not-allowed|nowrap|oblique|outset|outside|" +
+ "overline|pointer|progress|relative|repeat-x|repeat-y|repeat|right|" +
+ "ridge|row-resize|rtl|s-resize|scroll|se-resize|separate|small-caps|" +
+ "solid|square|static|strict|super|sw-resize|table-footer-group|" +
+ "table-header-group|tb-rl|text-bottom|text-top|text|thick|thin|top|" +
+ "transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|" +
+ "vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|" +
+ "zero").split("|")
+ );
+
+ var colors = lang.arrayToMap(
+ ("aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|" +
+ "purple|red|silver|teal|white|yellow").split("|")
+ );
+
+ var keywords = lang.arrayToMap(
+ ("@mixin|@extend|@include|@import|@media|@debug|@warn|@if|@for|@each|@while|@else|@font-face|@-webkit-keyframes|if|and|!default|module|def|end|declare").split("|")
+ )
+
+ var tags = lang.arrayToMap(
+ ("a|abbr|acronym|address|applet|area|article|aside|audio|b|base|basefont|bdo|" +
+ "big|blockquote|body|br|button|canvas|caption|center|cite|code|col|colgroup|" +
+ "command|datalist|dd|del|details|dfn|dir|div|dl|dt|em|embed|fieldset|" +
+ "figcaption|figure|font|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|" +
+ "header|hgroup|hr|html|i|iframe|img|input|ins|keygen|kbd|label|legend|li|" +
+ "link|map|mark|menu|meta|meter|nav|noframes|noscript|object|ol|optgroup|" +
+ "option|output|p|param|pre|progress|q|rp|rt|ruby|s|samp|script|section|select|" +
+ "small|source|span|strike|strong|style|sub|summary|sup|table|tbody|td|" +
+ "textarea|tfoot|th|thead|time|title|tr|tt|u|ul|var|video|wbr|xmp").split("|")
+ );
+
+ // regexp must not have capturing parentheses. Use (?:) instead.
+ // regexps are ordered -> the first match is used
+
+ var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
+
+ // regexp must not have capturing parentheses. Use (?:) instead.
+ // regexps are ordered -> the first match is used
+
+ this.$rules = {
+ "start" : [
+ {
+ token : "comment",
+ regex : "\\/\\/.*$"
+ },
+ {
+ token : "comment", // multi line comment
+ merge : true,
+ regex : "\\/\\*",
+ next : "comment"
+ }, {
+ token : "string", // single line
+ regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
+ }, {
+ token : "string", // multi line string start
+ merge : true,
+ regex : '["].*\\\\$',
+ next : "qqstring"
+ }, {
+ token : "string", // single line
+ regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
+ }, {
+ token : "string", // multi line string start
+ merge : true,
+ regex : "['].*\\\\$",
+ next : "qstring"
+ }, {
+ token : "constant.numeric",
+ regex : numRe + "(?:em|ex|px|cm|mm|in|pt|pc|deg|rad|grad|ms|s|hz|khz|%)"
+ }, {
+ token : "constant.numeric", // hex6 color
+ regex : "#[a-f0-9]{6}"
+ }, {
+ token : "constant.numeric", // hex3 color
+ regex : "#[a-f0-9]{3}"
+ }, {
+ token : "constant.numeric",
+ regex : numRe
+ }, {
+ token : function(value) {
+ if (properties.hasOwnProperty(value.toLowerCase()))
+ return "support.type";
+ if (keywords.hasOwnProperty(value))
+ return "keyword";
+ else if (constants.hasOwnProperty(value))
+ return "constant.language";
+ else if (functions.hasOwnProperty(value))
+ return "support.function";
+ else if (colors.hasOwnProperty(value.toLowerCase()))
+ return "support.constant.color";
+ else if (tags.hasOwnProperty(value.toLowerCase()))
+ return "variable.language";
+ else
+ return "text";
+ },
+ regex : "\\-?[@a-z_][@a-z0-9_\\-]*"
+ }, {
+ token : "variable",
+ regex : "[a-z_\\-$][a-z0-9_\\-$]*\\b"
+ }, {
+ token: "variable.language",
+ regex: "#[a-z0-9-_]+"
+ }, {
+ token: "variable.language",
+ regex: "\\.[a-z0-9-_]+"
+ }, {
+ token: "variable.language",
+ regex: ":[a-z0-9-_]+"
+ }, {
+ token: "constant",
+ regex: "[a-z0-9-_]+"
+ }, {
+ token : "keyword.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
+ merge : true,
+ regex : ".+"
+ }
+ ],
+ "qqstring" : [
+ {
+ token : "string",
+ regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"',
+ next : "start"
+ }, {
+ token : "string",
+ merge : true,
+ regex : '.+'
+ }
+ ],
+ "qstring" : [
+ {
+ token : "string",
+ regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'",
+ next : "start"
+ }, {
+ token : "string",
+ merge : true,
+ regex : '.+'
+ }
+ ]
+ };
+};
+
+oop.inherits(ScssHighlightRules, TextHighlightRules);
+
+exports.ScssHighlightRules = ScssHighlightRules;
+
+});
+
+ace.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;
+});
+
+ace.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);
+
+ var range = session.getCommentFoldRange(row, i + match[0].length);
+ range.end.column -= 2;
+ return range;
+ }
+
+ if (foldStyle !== "markbeginend")
+ return;
+
+ var match = line.match(this.foldingStopMarker);
+ if (match) {
+ var i = match.index + match[0].length;
+
+ if (match[2]) {
+ var range = session.getCommentFoldRange(row, i);
+ range.end.column -= 2;
+ return range;
+ }
+
+ var end = {row: row, column: i};
+ var start = session.$findOpeningBracket(match[1], end);
+
+ if (!start)
+ return;
+
+ start.column++;
+ end.column--;
+
+ return Range.fromPoints(start, end);
+ }
+ };
+
+}).call(FoldMode.prototype);
+
+});
+
+ace.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;
+
+ // must return "" if there's no fold, to enable caching
+ 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);
+ };
+
+}).call(FoldMode.prototype);
+
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/mode-sh.js b/vendor/assets/javascripts/ace-src-noconflict/mode-sh.js
new file mode 100644
index 00000000000..52fbfae3313
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/mode-sh.js
@@ -0,0 +1,238 @@
+/* ***** 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 ***** */
+
+ace.define('ace/mode/sh', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/sh_highlight_rules', 'ace/range'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var TextMode = require("./text").Mode;
+var Tokenizer = require("../tokenizer").Tokenizer;
+var ShHighlightRules = require("./sh_highlight_rules").ShHighlightRules;
+var Range = require("../range").Range;
+
+var Mode = function() {
+ this.$tokenizer = new Tokenizer(new ShHighlightRules().getRules());
+};
+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;
+
+ if (tokens.length && tokens[tokens.length-1].type == "comment") {
+ return indent;
+ }
+
+ if (state == "start") {
+ var match = line.match(/^.*[\{\(\[\:]\s*$/);
+ if (match) {
+ indent += tab;
+ }
+ }
+
+ return indent;
+ };
+
+ var outdents = {
+ "pass": 1,
+ "return": 1,
+ "raise": 1,
+ "break": 1,
+ "continue": 1
+ };
+
+ this.checkOutdent = function(state, line, input) {
+ if (input !== "\r\n" && input !== "\r" && input !== "\n")
+ return false;
+
+ var tokens = this.$tokenizer.getLineTokens(line.trim(), state).tokens;
+
+ if (!tokens)
+ return false;
+
+ // ignore trailing comments
+ do {
+ var last = tokens.pop();
+ } while (last && (last.type == "comment" || (last.type == "text" && last.value.match(/^\s+$/))));
+
+ if (!last)
+ return false;
+
+ return (last.type == "keyword" && outdents[last.value]);
+ };
+
+ this.autoOutdent = function(state, doc, row) {
+ // outdenting in sh is slightly different because it always applies
+ // to the next line and only of a new line is inserted
+
+ row += 1;
+ var indent = this.$getIndent(doc.getLine(row));
+ var tab = doc.getTabString();
+ if (indent.slice(-tab.length) == tab)
+ doc.remove(new Range(row, indent.length-tab.length, row, indent.length));
+ };
+
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+});
+
+ace.define('ace/mode/sh_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 ShHighlightRules = function() {
+
+ var reservedKeywords = (
+ '!|{|}|case|do|done|elif|else|'+
+ 'esac|fi|for|if|in|then|until|while|'+
+ '&|;|export|local|read|typeset|unset|'+
+ 'elif|select|set'
+ );
+
+ var languageConstructs = (
+ '[|]|alias|bg|bind|break|builtin|'+
+ 'cd|command|compgen|complete|continue|'+
+ 'dirs|disown|echo|enable|eval|exec|'+
+ 'exit|fc|fg|getopts|hash|help|history|'+
+ 'jobs|kill|let|logout|popd|printf|pushd|'+
+ 'pwd|return|set|shift|shopt|source|'+
+ 'suspend|test|times|trap|type|ulimit|'+
+ 'umask|unalias|wait'
+ );
+
+ var keywordMapper = this.createKeywordMapper({
+ "keyword": reservedKeywords,
+ "constant.language": languageConstructs,
+ "invalid.deprecated": "debugger"
+ }, "identifier");
+
+ var integer = "(?:(?:[1-9]\\d*)|(?:0))";
+ // var integer = "(?:" + decimalInteger + ")";
+
+ var fraction = "(?:\\.\\d+)";
+ var intPart = "(?:\\d+)";
+ var pointFloat = "(?:(?:" + intPart + "?" + fraction + ")|(?:" + intPart + "\\.))";
+ var exponentFloat = "(?:(?:" + pointFloat + "|" + intPart + ")" + ")";
+ var floatNumber = "(?:" + exponentFloat + "|" + pointFloat + ")";
+ var fileDescriptor = "(?:&" + intPart + ")";
+
+ var variableName = "[a-zA-Z][a-zA-Z0-9_]*";
+ var variable = "(?:(?:\\$" + variableName + ")|(?:" + variableName + "=))";
+
+ var builtinVariable = "(?:\\$(?:SHLVL|\\$|\\!|\\?))";
+
+ var func = "(?:" + variableName + "\\s*\\(\\))";
+
+ this.$rules = {
+ "start" : [ {
+ token : "comment",
+ regex : "#.*$"
+ }, {
+ token : "string", // " string
+ regex : '"(?:[^\\\\]|\\\\.)*?"'
+ }, {
+ token : "variable.language",
+ regex : builtinVariable
+ }, {
+ token : "variable",
+ regex : variable
+ }, {
+ token : "support.function",
+ regex : func,
+ }, {
+ token : "support.function",
+ regex : fileDescriptor
+ }, {
+ token : "string", // ' string
+ regex : "'(?:[^\\\\]|\\\\.)*?'"
+ }, {
+ token : "constant.numeric", // float
+ regex : floatNumber
+ }, {
+ token : "constant.numeric", // integer
+ regex : integer + "\\b"
+ }, {
+ token : keywordMapper,
+ regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
+ }, {
+ token : "keyword.operator",
+ regex : "\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|~|<|>|<=|=>|=|!="
+ }, {
+ token : "paren.lparen",
+ regex : "[\\[\\(\\{]"
+ }, {
+ token : "paren.rparen",
+ regex : "[\\]\\)\\}]"
+ }, {
+ token : "text",
+ regex : "\\s+"
+ } ]
+ };
+};
+
+oop.inherits(ShHighlightRules, TextHighlightRules);
+
+exports.ShHighlightRules = ShHighlightRules;
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/mode-sql.js b/vendor/assets/javascripts/ace-src-noconflict/mode-sql.js
new file mode 100644
index 00000000000..d7fab1c53ec
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/mode-sql.js
@@ -0,0 +1,145 @@
+/* ***** 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 ***** */
+
+ace.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;
+
+});
+
+ace.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|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/vendor/assets/javascripts/ace-src-noconflict/mode-svg.js b/vendor/assets/javascripts/ace-src-noconflict/mode-svg.js
new file mode 100644
index 00000000000..29c2b17bdd3
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/mode-svg.js
@@ -0,0 +1,1602 @@
+/* ***** 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 ***** */
+
+ace.define('ace/mode/svg', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/xml', 'ace/mode/javascript', 'ace/tokenizer', 'ace/mode/svg_highlight_rules', 'ace/mode/folding/mixed', 'ace/mode/folding/xml', 'ace/mode/folding/cstyle'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var XmlMode = require("./xml").Mode;
+var JavaScriptMode = require("./javascript").Mode;
+var Tokenizer = require("../tokenizer").Tokenizer;
+var SvgHighlightRules = require("./svg_highlight_rules").SvgHighlightRules;
+var MixedFoldMode = require("./folding/mixed").FoldMode;
+var XmlFoldMode = require("./folding/xml").FoldMode;
+var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+
+var Mode = function() {
+ XmlMode.call(this);
+
+ this.highlighter = new SvgHighlightRules();
+ this.$tokenizer = new Tokenizer(this.highlighter.getRules());
+
+ this.$embeds = this.highlighter.getEmbeds();
+ this.createModeDelegates({
+ "js-": JavaScriptMode
+ });
+
+ this.foldingRules = new MixedFoldMode(new XmlFoldMode({}), {
+ "js-": new CStyleFoldMode()
+ });
+};
+
+oop.inherits(Mode, XmlMode);
+
+(function() {
+
+ this.getNextLineIndent = function(state, line, tab) {
+ return this.$getIndent(line);
+ };
+
+
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+});
+
+ace.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;
+});
+
+ace.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() {
+
+ // regexp must not have capturing parentheses
+ // regexps are ordered -> the first match is used
+ this.$rules = {
+ start : [{
+ token : "text",
+ regex : "<\\!\\[CDATA\\[",
+ next : "cdata"
+ }, {
+ token : "xml_pe",
+ regex : "<\\?.*?\\?>"
+ }, {
+ token : "comment",
+ merge : true,
+ regex : "<\\!--",
+ next : "comment"
+ }, {
+ token : "xml_pe",
+ regex : "<\\!.*?>"
+ }, {
+ token : "meta.tag", // opening tag
+ regex : "<\\/?",
+ next : "tag"
+ }, {
+ token : "text",
+ regex : "\\s+"
+ }, {
+ token : "constant.character.entity",
+ regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
+ }, {
+ token : "text",
+ regex : "[^<]+"
+ }],
+
+ cdata : [{
+ token : "text",
+ regex : "\\]\\]>",
+ next : "start"
+ }, {
+ token : "text",
+ regex : "\\s+"
+ }, {
+ token : "text",
+ regex : "(?:[^\\]]|\\](?!\\]>))+"
+ }],
+
+ comment : [{
+ token : "comment",
+ regex : ".*?-->",
+ next : "start"
+ }, {
+ token : "comment",
+ merge : true,
+ regex : ".+"
+ }]
+ };
+
+ xmlUtil.tag(this.$rules, "tag", "start");
+};
+
+oop.inherits(XmlHighlightRules, TextHighlightRules);
+
+exports.XmlHighlightRules = XmlHighlightRules;
+});
+
+ace.define('ace/mode/xml_util', ['require', 'exports', 'module' ], function(require, exports, module) {
+
+
+function string(state) {
+ return [{
+ token : "string",
+ regex : '".*?"'
+ }, {
+ token : "string", // multi line string start
+ merge : true,
+ regex : '["].*',
+ next : state + "_qqstring"
+ }, {
+ token : "string",
+ regex : "'.*?'"
+ }, {
+ token : "string", // multi line string start
+ merge : true,
+ regex : "['].*",
+ next : state + "_qstring"
+ }];
+}
+
+function multiLineString(quote, state) {
+ return [{
+ token : "string",
+ merge : true,
+ regex : ".*?" + quote,
+ next : state
+ }, {
+ token : "string",
+ merge : true,
+ regex : '.+'
+ }];
+}
+
+exports.tag = function(states, name, nextState, tagMap) {
+ states[name] = [{
+ token : "text",
+ regex : "\\s+"
+ }, {
+ //token : "meta.tag",
+
+ token : !tagMap ? "meta.tag.tag-name" : function(value) {
+ if (tagMap[value])
+ return "meta.tag.tag-name." + tagMap[value];
+ else
+ return "meta.tag.tag-name";
+ },
+ merge : true,
+ 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",
+ merge : true,
+ 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));
+};
+
+});
+
+ace.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;
+});
+
+ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour'], function(require, exports, module) {
+
+
+var oop = require("../../lib/oop");
+var Behaviour = require("../behaviour").Behaviour;
+
+var CstyleBehaviour = function () {
+
+ this.add("braces", "insertion", function (state, action, editor, session, text) {
+ if (text == '{') {
+ var selection = editor.getSelectionRange();
+ var selected = session.doc.getTextRange(selection);
+ if (selected !== "") {
+ return {
+ text: '{' + selected + '}',
+ selection: false
+ };
+ } else {
+ 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) {
+ return {
+ text: '',
+ selection: [1, 1]
+ };
+ }
+ }
+ } else if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ if (rightChar == '}') {
+ var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column + 1});
+ if (!openBracePos)
+ return null;
+
+ var indent = this.getNextLineIndent(state, line.substring(0, line.length - 1), session.getTabString());
+ var next_indent = this.$getIndent(session.doc.getLine(openBracePos.row));
+
+ return {
+ text: '\n' + indent + '\n' + next_indent,
+ 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;
+ }
+ }
+ });
+
+ this.add("parens", "insertion", function (state, action, editor, session, text) {
+ if (text == '(') {
+ var selection = editor.getSelectionRange();
+ var selected = session.doc.getTextRange(selection);
+ if (selected !== "") {
+ return {
+ text: '(' + selected + ')',
+ selection: false
+ };
+ } else {
+ 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) {
+ 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 !== "") {
+ return {
+ text: '[' + selected + ']',
+ selection: false
+ };
+ } else {
+ 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) {
+ 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 !== "") {
+ 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);
+
+ // We're escaped.
+ if (leftChar == '\\') {
+ return null;
+ }
+
+ // Find what token we're inside.
+ 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;
+ }
+
+ // Try and be smart about when we auto insert.
+ 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)))) {
+ return {
+ text: quote + quote,
+ selection: [1,1]
+ };
+ } else if (token && token.type === "string") {
+ // Ignore input and move right one if we're typing over the closing quote.
+ 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 == '"') {
+ range.end.column++;
+ return range;
+ }
+ }
+ });
+
+};
+
+oop.inherits(CstyleBehaviour, Behaviour);
+
+exports.CstyleBehaviour = CstyleBehaviour;
+});
+
+ace.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);
+
+});
+
+ace.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;
+
+ // must return "" if there's no fold, to enable caching
+ 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);
+ };
+
+}).call(FoldMode.prototype);
+
+});
+
+ace.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) {
+ var errors = [];
+ for (var i=0; i<results.data.length; i++) {
+ var error = results.data[i];
+ if (error)
+ errors.push({
+ row: error.line-1,
+ column: error.character-1,
+ text: error.reason,
+ type: "warning",
+ lint: error
+ });
+ }
+ session.setAnnotations(errors);
+ });
+
+ worker.on("narcissus", function(e) {
+ session.setAnnotations([e.data]);
+ });
+
+ worker.on("terminate", function() {
+ session.clearAnnotations();
+ });
+
+ return worker;
+ };
+
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+});
+
+ace.define('ace/mode/javascript_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/unicode', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var unicode = require("../unicode");
+var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
+var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+
+var JavaScriptHighlightRules = function() {
+ // see: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects
+ 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
+ "invalid.deprecated":
+ "__parent__|__count__|escape|unescape|with|__proto__|debugger",
+ "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|",
+ "storage.type":
+ "const|let|var|function",
+ "invalid.illegal":
+ "class|enum|extends|super|export|implements|private|" +
+ "public|interface|package|protected|static",
+ "constant.language":
+ "null|Infinity|NaN|undefined",
+ }, "identifier");
+
+
+ // keywords which can be followed by regular expressions
+ var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield";
+
+ // TODO: Unicode escape sequences
+ 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
+ ".)";
+
+ // regexp must not have capturing parentheses. Use (?:) instead.
+ // regexps are ordered -> the first match is used
+
+ this.$rules = {
+ "start" : [
+ {
+ token : "comment",
+ regex : /\/\/.*$/
+ },
+ DocCommentHighlightRules.getStartRule("doc-start"),
+ {
+ token : "comment", // multi line comment
+ merge : true,
+ 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/
+ }, {
+ // Sound.prototype.play =
+ token : [
+ "storage.type", "punctuation.operator", "support.function",
+ "punctuation.operator", "entity.name.function", "text","keyword.operator"
+ ],
+ regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)",
+ next: "function_arguments"
+ }, {
+ // Sound.play = function() { }
+ 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"
+ }, {
+ // play = function() { }
+ token : [
+ "entity.name.function", "text", "keyword.operator", "text", "storage.type",
+ "text", "paren.lparen"
+ ],
+ regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ // Sound.play = function play() { }
+ 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"
+ }, {
+ // function myFunc(arg) { }
+ token : [
+ "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ ],
+ regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ // foobar: function() { }
+ token : [
+ "entity.name.function", "text", "punctuation.operator",
+ "text", "storage.type", "text", "paren.lparen"
+ ],
+ regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ // : function() { } (this is for issues with 'foo': function() { })
+ token : [
+ "text", "text", "storage.type", "text", "paren.lparen"
+ ],
+ regex : "(:)(\\s*)(function)(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ token : "constant.language.boolean",
+ regex : /(?:true|false)\b/
+ }, {
+ 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 : /!|\$|%|&|\*|\-\-|\-|\+\+|\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=|\b(?:in|instanceof|new|delete|typeof|void)/,
+ 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: /^#!.*$/
+ }, {
+ token : "text",
+ regex : /\s+/
+ }
+ ],
+ // regular expressions are only allowed after certain tokens. This
+ // makes sure we don't mix up regexps with the divison operator
+ "regex_allowed": [
+ DocCommentHighlightRules.getStartRule("doc-start"),
+ {
+ token : "comment", // multi line comment
+ merge : true,
+ regex : "\\/\\*",
+ next : "comment_regex_allowed"
+ }, {
+ token : "comment",
+ regex : "\\/\\/.*$"
+ }, {
+ token: "string.regexp",
+ regex: "\\/",
+ next: "regex",
+ merge: true
+ }, {
+ token : "text",
+ regex : "\\s+"
+ }, {
+ // immediately return to the start mode without matching
+ // anything
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "regex": [
+ {
+ // escapes
+ token: "regexp.keyword.operator",
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
+ }, {
+ // flag
+ token: "string.regexp",
+ regex: "/\\w*",
+ next: "start",
+ merge: true
+ }, {
+ // invalid operators
+ token : "invalid",
+ regex: /\{\d+,?(?:\d+)?}[+*]|[+*^$?][+*]|\?\?/ // |[^$][?]
+ }, {
+ // operators
+ token : "constant.language.escape",
+ regex: /\(\?[:=!]|\)|\{\d+,?(?:\d+)?}|[+*]\?|[(|)$^+*?]/
+ }, {
+ token: "string.regexp",
+ regex: /{|[^\[\\{()$^+*?\/]+/,
+ merge: true
+ }, {
+ token: "constant.language.escape",
+ regex: /\[\^?/,
+ next: "regex_character_class",
+ merge: true
+ }, {
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "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",
+ merge: true
+ }, {
+ token: "constant.language.escape",
+ regex: "-",
+ }, {
+ token: "string.regexp.charachterclass",
+ regex: /[^\]\-\\]+/,
+ merge: true
+ }, {
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "function_arguments": [
+ {
+ token: "variable.parameter",
+ regex: identifierRe
+ }, {
+ token: "punctuation.operator",
+ regex: "[, ]+",
+ merge: true
+ }, {
+ token: "punctuation.operator",
+ regex: "$",
+ merge: true
+ }, {
+ token: "empty",
+ regex: "",
+ next: "start"
+ }
+ ],
+ "comment_regex_allowed" : [
+ {
+ token : "comment", // closing comment
+ regex : ".*?\\*\\/",
+ merge : true,
+ next : "regex_allowed"
+ }, {
+ token : "comment", // comment spanning whole line
+ merge : true,
+ regex : ".+"
+ }
+ ],
+ "comment" : [
+ {
+ token : "comment", // closing comment
+ regex : ".*?\\*\\/",
+ merge : true,
+ next : "start"
+ }, {
+ token : "comment", // comment spanning whole line
+ merge : true,
+ regex : ".+"
+ }
+ ],
+ "qqstring" : [
+ {
+ token : "constant.language.escape",
+ regex : escapedRe
+ }, {
+ token : "string",
+ regex : '[^"\\\\]+',
+ merge : true
+ }, {
+ token : "string",
+ regex : "\\\\$",
+ next : "qqstring",
+ merge : true
+ }, {
+ token : "string",
+ regex : '"|$',
+ next : "start",
+ merge : true
+ }
+ ],
+ "qstring" : [
+ {
+ token : "constant.language.escape",
+ regex : escapedRe
+ }, {
+ token : "string",
+ regex : "[^'\\\\]+",
+ merge : true
+ }, {
+ token : "string",
+ regex : "\\\\$",
+ next : "qstring",
+ merge : true
+ }, {
+ token : "string",
+ regex : "'|$",
+ next : "start",
+ merge : true
+ }
+ ]
+ };
+
+ this.embedRules(DocCommentHighlightRules, "doc-",
+ [ DocCommentHighlightRules.getEndRule("start") ]);
+};
+
+oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
+
+exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
+});
+
+ace.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",
+ merge : true,
+ regex : "\\s+"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "TODO"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "[^@\\*]+"
+ }, {
+ token : "comment.doc",
+ merge : true,
+ regex : "."
+ }]
+ };
+};
+
+oop.inherits(DocCommentHighlightRules, TextHighlightRules);
+
+DocCommentHighlightRules.getStartRule = function(start) {
+ return {
+ token : "comment.doc", // doc comment
+ merge : true,
+ regex : "\\/\\*(?=\\*)",
+ next : start
+ };
+};
+
+DocCommentHighlightRules.getEndRule = function (start) {
+ return {
+ token : "comment.doc", // closing comment
+ merge : true,
+ regex : "\\*\\/",
+ next : start
+ };
+};
+
+
+exports.DocCommentHighlightRules = DocCommentHighlightRules;
+
+});
+
+ace.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;
+});
+
+ace.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);
+
+ var range = session.getCommentFoldRange(row, i + match[0].length);
+ range.end.column -= 2;
+ return range;
+ }
+
+ if (foldStyle !== "markbeginend")
+ return;
+
+ var match = line.match(this.foldingStopMarker);
+ if (match) {
+ var i = match.index + match[0].length;
+
+ if (match[2]) {
+ var range = session.getCommentFoldRange(row, i);
+ range.end.column -= 2;
+ return range;
+ }
+
+ var end = {row: row, column: i};
+ var start = session.$findOpeningBracket(match[1], end);
+
+ if (!start)
+ return;
+
+ start.column++;
+ end.column--;
+
+ return Range.fromPoints(start, end);
+ }
+ };
+
+}).call(FoldMode.prototype);
+
+});
+
+ace.define('ace/mode/svg_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/javascript_highlight_rules', 'ace/mode/xml_highlight_rules', 'ace/mode/xml_util'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
+var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules;
+var xmlUtil = require("./xml_util");
+
+var SvgHighlightRules = function() {
+ XmlHighlightRules.call(this);
+
+ this.$rules.start.splice(3, 0, {
+ token : "meta.tag",
+ regex : "<(?=\s*script)",
+ next : "script"
+ });
+
+ xmlUtil.tag(this.$rules, "script", "js-start");
+
+ this.embedRules(JavaScriptHighlightRules, "js-", [{
+ token: "comment",
+ regex: "\\/\\/.*(?=<\\/script>)",
+ next: "tag"
+ }, {
+ token: "meta.tag",
+ regex: "<\\/(?=script)",
+ next: "tag"
+ }]);
+};
+
+oop.inherits(SvgHighlightRules, XmlHighlightRules);
+
+exports.SvgHighlightRules = SvgHighlightRules;
+});
+
+ace.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);
+
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/mode-tcl.js b/vendor/assets/javascripts/ace-src-noconflict/mode-tcl.js
new file mode 100644
index 00000000000..64473a24797
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/mode-tcl.js
@@ -0,0 +1,444 @@
+/* ***** 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 ***** */
+
+ace.define('ace/mode/tcl', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/folding/cstyle', 'ace/mode/tcl_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var TextMode = require("./text").Mode;
+var Tokenizer = require("../tokenizer").Tokenizer;
+var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+var TclHighlightRules = require("./tcl_highlight_rules").TclHighlightRules;
+var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
+var Range = require("../range").Range;
+
+var Mode = function() {
+ this.$tokenizer = new Tokenizer(new TclHighlightRules().getRules());
+ this.$outdent = new MatchingBraceOutdent();
+ 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;
+
+ if (tokens.length && tokens[tokens.length-1].type == "comment") {
+ return indent;
+ }
+
+ 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;
+});
+
+ace.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);
+
+ var range = session.getCommentFoldRange(row, i + match[0].length);
+ range.end.column -= 2;
+ return range;
+ }
+
+ if (foldStyle !== "markbeginend")
+ return;
+
+ var match = line.match(this.foldingStopMarker);
+ if (match) {
+ var i = match.index + match[0].length;
+
+ if (match[2]) {
+ var range = session.getCommentFoldRange(row, i);
+ range.end.column -= 2;
+ return range;
+ }
+
+ var end = {row: row, column: i};
+ var start = session.$findOpeningBracket(match[1], end);
+
+ if (!start)
+ return;
+
+ start.column++;
+ end.column--;
+
+ return Range.fromPoints(start, end);
+ }
+ };
+
+}).call(FoldMode.prototype);
+
+});
+
+ace.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;
+
+ // must return "" if there's no fold, to enable caching
+ 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);
+ };
+
+}).call(FoldMode.prototype);
+
+});
+
+ace.define('ace/mode/tcl_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 TclHighlightRules = function() {
+
+ //TODO var builtinFunctions = "";
+
+ this.$rules = {
+ "start" : [
+ {
+ token : "comment",
+ merge : true,
+ regex : "#.*\\\\$",
+ next : "commentfollow"
+ }, {
+ token : "comment",
+ regex : "#.*$"
+ }, {
+ token : "support.function",
+ regex : '[\\\\]$',
+ next : "splitlineStart"
+ }, {
+ token : "text",
+ regex : '[\\\\](?:["]|[{]|[}]|[[]|[]]|[$]|[\])'
+ }, {
+ token : "text", // last value before command
+ regex : '^|[^{][;][^}]|[/\r/]',
+ next : "commandItem"
+ }, {
+ token : "string", // single line
+ regex : '[ ]*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
+ }, {
+ token : "string", // multi line """ string start
+ merge : true,
+ regex : '[ ]*["]',
+ next : "qqstring"
+ }, {
+ token : "variable.instancce", // variable xotcl with braces
+ merge : true,
+ regex : "[$]",
+ next : "variable"
+ }, {
+ token : "support.function",
+ regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|{\\*}|;|::"
+ }, {
+ token : "identifier",
+ regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
+ }, {
+ token : "paren.lparen",
+ regex : "[[{]",
+ next : "commandItem"
+ }, {
+ token : "paren.lparen",
+ regex : "[(]"
+ }, {
+ token : "paren.rparen",
+ regex : "[\\])}]"
+ }, {
+ token : "text",
+ regex : "\\s+"
+ }
+ ],
+ "commandItem" : [
+ {
+ token : "comment",
+ merge : true,
+ regex : "#.*\\\\$",
+ next : "commentfollow"
+ }, {
+ token : "comment",
+ regex : "#.*$",
+ next : "start"
+ }, {
+ token : "string", // single line
+ regex : '[ ]*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
+ }, {
+ token : "variable.instancce", // variable xotcl with braces
+ merge : true,
+ regex : "[$]",
+ next : "variable"
+ }, {
+ token : "support.function",
+ regex : "(?:[:][:])[a-zA-Z0-9_/]+(?:[:][:])",
+ next : "commandItem"
+ }, {
+ token : "support.function",
+ regex : "[a-zA-Z0-9_/]+(?:[:][:])",
+ next : "commandItem"
+ }, {
+ token : "support.function",
+ regex : "(?:[:][:])",
+ next : "commandItem"
+ }, {
+ token : "support.function",
+ regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|{\\*}|;|::"
+ }, {
+ token : "keyword",
+ regex : "[a-zA-Z0-9_/]+",
+ next : "start"
+ } ],
+ "commentfollow" : [
+ {
+ token : "comment",
+ regex : ".*\\\\$",
+ next : "commentfollow"
+ }, {
+ token : "comment",
+ merge : true,
+ regex : '.+',
+ next : "start"
+ } ],
+ "splitlineStart" : [
+ {
+ token : "text",
+ regex : "^.",
+ next : "start"
+ }],
+ "variable" : [
+ {
+ token : "variable.instancce", // variable xotcl with braces
+ regex : "(?:[:][:])?(?:[a-zA-Z_]|\d)+(?:(?:[:][:])?(?:[a-zA-Z_]|\d)+)?(?:[(](?:[a-zA-Z_]|\d)+[)])?",
+ next : "start"
+ }, {
+ token : "variable.instancce", // variable tcl
+ regex : "(?:[a-zA-Z_]|\d)+(?:[(](?:[a-zA-Z_]|\d)+[)])?",
+ next : "start"
+ }, {
+ token : "variable.instancce", // variable tcl with braces
+ regex : "{?(?:[a-zA-Z_]|\d)+}?",
+ next : "start"
+ }],
+ "qqstring" : [ {
+ token : "string", // multi line """ string end
+ regex : '(?:[^\\\\]|\\\\.)*?["]',
+ next : "start"
+ }, {
+ token : "string",
+ merge : true,
+ regex : '.+'
+ } ]
+ };
+};
+
+oop.inherits(TclHighlightRules, TextHighlightRules);
+
+exports.TclHighlightRules = TclHighlightRules;
+});
+
+ace.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;
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/mode-text.js b/vendor/assets/javascripts/ace-src-noconflict/mode-text.js
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/mode-text.js
diff --git a/vendor/assets/javascripts/ace-src-noconflict/mode-textile.js b/vendor/assets/javascripts/ace-src-noconflict/mode-textile.js
new file mode 100644
index 00000000000..fb70ddc0e20
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/mode-textile.js
@@ -0,0 +1,175 @@
+/* ***** 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 ***** */
+
+ace.define('ace/mode/textile', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/textile_highlight_rules', 'ace/mode/matching_brace_outdent'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var TextMode = require("./text").Mode;
+var Tokenizer = require("../tokenizer").Tokenizer;
+var TextileHighlightRules = require("./textile_highlight_rules").TextileHighlightRules;
+var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
+
+var Mode = function() {
+ this.$tokenizer = new Tokenizer(new TextileHighlightRules().getRules());
+ this.$outdent = new MatchingBraceOutdent();
+};
+oop.inherits(Mode, TextMode);
+
+(function() {
+ this.getNextLineIndent = function(state, line, tab) {
+ if (state == "intag")
+ return tab;
+
+ return "";
+ };
+
+ 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;
+
+});
+
+ace.define('ace/mode/textile_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 TextileHighlightRules = function() {
+ this.$rules = {
+ "start" : [
+ {
+ token : function(value) {
+ if (value.charAt(0) == "h")
+ return "markup.heading." + value.charAt(1);
+ else
+ return "markup.heading";
+ },
+ regex : "h1|h2|h3|h4|h5|h6|bq|p|bc|pre",
+ next : "blocktag"
+ },
+ {
+ token : "keyword",
+ regex : "[\\*]+|[#]+"
+ },
+ {
+ token : "text",
+ regex : ".+"
+ }
+ ],
+ "blocktag" : [
+ {
+ token : "keyword",
+ regex : "\\. ",
+ next : "start"
+ },
+ {
+ token : "keyword",
+ regex : "\\(",
+ next : "blocktagproperties"
+ }
+ ],
+ "blocktagproperties" : [
+ {
+ token : "keyword",
+ regex : "\\)",
+ next : "blocktag"
+ },
+ {
+ token : "string",
+ regex : "[a-zA-Z0-9\\-_]+"
+ },
+ {
+ token : "keyword",
+ regex : "#"
+ }
+ ]
+ };
+};
+
+oop.inherits(TextileHighlightRules, TextHighlightRules);
+
+exports.TextileHighlightRules = TextileHighlightRules;
+
+});
+
+ace.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;
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/mode-xml.js b/vendor/assets/javascripts/ace-src-noconflict/mode-xml.js
new file mode 100644
index 00000000000..07a154d6df0
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/mode-xml.js
@@ -0,0 +1,822 @@
+/* ***** 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 ***** */
+
+ace.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;
+});
+
+ace.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() {
+
+ // regexp must not have capturing parentheses
+ // regexps are ordered -> the first match is used
+ this.$rules = {
+ start : [{
+ token : "text",
+ regex : "<\\!\\[CDATA\\[",
+ next : "cdata"
+ }, {
+ token : "xml_pe",
+ regex : "<\\?.*?\\?>"
+ }, {
+ token : "comment",
+ merge : true,
+ regex : "<\\!--",
+ next : "comment"
+ }, {
+ token : "xml_pe",
+ regex : "<\\!.*?>"
+ }, {
+ token : "meta.tag", // opening tag
+ regex : "<\\/?",
+ next : "tag"
+ }, {
+ token : "text",
+ regex : "\\s+"
+ }, {
+ token : "constant.character.entity",
+ regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
+ }, {
+ token : "text",
+ regex : "[^<]+"
+ }],
+
+ cdata : [{
+ token : "text",
+ regex : "\\]\\]>",
+ next : "start"
+ }, {
+ token : "text",
+ regex : "\\s+"
+ }, {
+ token : "text",
+ regex : "(?:[^\\]]|\\](?!\\]>))+"
+ }],
+
+ comment : [{
+ token : "comment",
+ regex : ".*?-->",
+ next : "start"
+ }, {
+ token : "comment",
+ merge : true,
+ regex : ".+"
+ }]
+ };
+
+ xmlUtil.tag(this.$rules, "tag", "start");
+};
+
+oop.inherits(XmlHighlightRules, TextHighlightRules);
+
+exports.XmlHighlightRules = XmlHighlightRules;
+});
+
+ace.define('ace/mode/xml_util', ['require', 'exports', 'module' ], function(require, exports, module) {
+
+
+function string(state) {
+ return [{
+ token : "string",
+ regex : '".*?"'
+ }, {
+ token : "string", // multi line string start
+ merge : true,
+ regex : '["].*',
+ next : state + "_qqstring"
+ }, {
+ token : "string",
+ regex : "'.*?'"
+ }, {
+ token : "string", // multi line string start
+ merge : true,
+ regex : "['].*",
+ next : state + "_qstring"
+ }];
+}
+
+function multiLineString(quote, state) {
+ return [{
+ token : "string",
+ merge : true,
+ regex : ".*?" + quote,
+ next : state
+ }, {
+ token : "string",
+ merge : true,
+ regex : '.+'
+ }];
+}
+
+exports.tag = function(states, name, nextState, tagMap) {
+ states[name] = [{
+ token : "text",
+ regex : "\\s+"
+ }, {
+ //token : "meta.tag",
+
+ token : !tagMap ? "meta.tag.tag-name" : function(value) {
+ if (tagMap[value])
+ return "meta.tag.tag-name." + tagMap[value];
+ else
+ return "meta.tag.tag-name";
+ },
+ merge : true,
+ 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",
+ merge : true,
+ 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));
+};
+
+});
+
+ace.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;
+});
+
+ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour'], function(require, exports, module) {
+
+
+var oop = require("../../lib/oop");
+var Behaviour = require("../behaviour").Behaviour;
+
+var CstyleBehaviour = function () {
+
+ this.add("braces", "insertion", function (state, action, editor, session, text) {
+ if (text == '{') {
+ var selection = editor.getSelectionRange();
+ var selected = session.doc.getTextRange(selection);
+ if (selected !== "") {
+ return {
+ text: '{' + selected + '}',
+ selection: false
+ };
+ } else {
+ 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) {
+ return {
+ text: '',
+ selection: [1, 1]
+ };
+ }
+ }
+ } else if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ if (rightChar == '}') {
+ var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column + 1});
+ if (!openBracePos)
+ return null;
+
+ var indent = this.getNextLineIndent(state, line.substring(0, line.length - 1), session.getTabString());
+ var next_indent = this.$getIndent(session.doc.getLine(openBracePos.row));
+
+ return {
+ text: '\n' + indent + '\n' + next_indent,
+ 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;
+ }
+ }
+ });
+
+ this.add("parens", "insertion", function (state, action, editor, session, text) {
+ if (text == '(') {
+ var selection = editor.getSelectionRange();
+ var selected = session.doc.getTextRange(selection);
+ if (selected !== "") {
+ return {
+ text: '(' + selected + ')',
+ selection: false
+ };
+ } else {
+ 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) {
+ 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 !== "") {
+ return {
+ text: '[' + selected + ']',
+ selection: false
+ };
+ } else {
+ 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) {
+ 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 !== "") {
+ 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);
+
+ // We're escaped.
+ if (leftChar == '\\') {
+ return null;
+ }
+
+ // Find what token we're inside.
+ 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;
+ }
+
+ // Try and be smart about when we auto insert.
+ 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)))) {
+ return {
+ text: quote + quote,
+ selection: [1,1]
+ };
+ } else if (token && token.type === "string") {
+ // Ignore input and move right one if we're typing over the closing quote.
+ 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 == '"') {
+ range.end.column++;
+ return range;
+ }
+ }
+ });
+
+};
+
+oop.inherits(CstyleBehaviour, Behaviour);
+
+exports.CstyleBehaviour = CstyleBehaviour;
+});
+
+ace.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);
+
+});
+
+ace.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;
+
+ // must return "" if there's no fold, to enable caching
+ 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);
+ };
+
+}).call(FoldMode.prototype);
+
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/mode-xquery.js b/vendor/assets/javascripts/ace-src-noconflict/mode-xquery.js
new file mode 100644
index 00000000000..b42730f900b
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/mode-xquery.js
@@ -0,0 +1,591 @@
+/* ***** 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 ***** */
+ace.define('ace/mode/xquery', ['require', 'exports', 'module' , 'ace/worker/worker_client', 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/xquery_highlight_rules', 'ace/mode/behaviour/xquery', 'ace/range'], function(require, exports, module) {
+
+
+var WorkerClient = require("../worker/worker_client").WorkerClient;
+var oop = require("../lib/oop");
+var TextMode = require("./text").Mode;
+var Tokenizer = require("../tokenizer").Tokenizer;
+var XQueryHighlightRules = require("./xquery_highlight_rules").XQueryHighlightRules;
+var XQueryBehaviour = require("./behaviour/xquery").XQueryBehaviour;
+//var XQueryBackgroundHighlighter = require("./xquery_background_highlighter").XQueryBackgroundHighlighter;
+var Range = require("../range").Range;
+
+var Mode = function(parent) {
+ this.$tokenizer = new Tokenizer(new XQueryHighlightRules().getRules());
+ this.$behaviour = new XQueryBehaviour(parent);
+};
+
+oop.inherits(Mode, TextMode);
+
+(function() {
+
+ this.getNextLineIndent = function(state, line, tab) {
+ var indent = this.$getIndent(line);
+ var match = line.match(/\s*(?:then|else|return|[{\(]|<\w+>)\s*$/);
+ if (match)
+ indent += tab;
+ return indent;
+ };
+
+ this.checkOutdent = function(state, line, input) {
+ if (! /^\s+$/.test(line))
+ return false;
+
+ return /^\s*[\}\)]/.test(input);
+ };
+
+ this.autoOutdent = function(state, 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 "";
+ };
+
+ this.toggleCommentLines = function(state, doc, startRow, endRow) {
+ var i, line;
+ var outdent = true;
+ var re = /^\s*\(:(.*):\)/;
+
+ for (i=startRow; i<= endRow; i++) {
+ if (!re.test(doc.getLine(i))) {
+ outdent = false;
+ break;
+ }
+ }
+
+ var range = new Range(0, 0, 0, 0);
+ for (i=startRow; i<= endRow; i++) {
+ line = doc.getLine(i);
+ range.start.row = i;
+ range.end.row = i;
+ range.end.column = line.length;
+
+ doc.replace(range, outdent ? line.match(re)[1] : "(:" + line + ":)");
+ }
+ };
+
+ this.createWorker = function(session) {
+ this.$deltas = [];
+ var worker = new WorkerClient(["ace"], "ace/mode/xquery_worker", "XQueryWorker");
+ var that = this;
+
+ session.getDocument().on('change', function(evt){
+ that.$deltas.push(evt.data);
+ });
+
+ worker.attachToDocument(session.getDocument());
+
+ worker.on("start", function(e) {
+ //console.log("start");
+ that.$deltas = [];
+ });
+
+ worker.on("error", function(e) {
+ session.setAnnotations([e.data]);
+ });
+
+ worker.on("ok", function(e) {
+ session.clearAnnotations();
+ });
+
+ worker.on("highlight", function(tokens) {
+ var firstRow = 0;
+ var lastRow = session.getLength() - 1;
+
+ var lines = tokens.data.lines;
+ var states = tokens.data.states;
+
+ for(var i=0; i < that.$deltas.length; i++)
+ {
+ var delta = that.$deltas[i];
+
+ if (delta.action === "insertLines")
+ {
+ var newLineCount = delta.lines.length;
+ for (var i = 0; i < newLineCount; i++) {
+ lines.splice(delta.range.start.row + i, 0, undefined);
+ states.splice(delta.range.start.row + i, 0, undefined);
+ }
+ }
+ else if (delta.action === "insertText")
+ {
+ if (session.getDocument().isNewLine(delta.text))
+ {
+ lines.splice(delta.range.end.row, 0, undefined);
+ states.splice(delta.range.end.row, 0, undefined);
+ } else {
+ lines[delta.range.start.row] = undefined;
+ states[delta.range.start.row] = undefined;
+ }
+ } else if (delta.action === "removeLines") {
+ var oldLineCount = delta.lines.length;
+ lines.splice(delta.range.start.row, oldLineCount);
+ states.splice(delta.range.start.row, oldLineCount);
+ } else if (delta.action === "removeText") {
+ if (session.getDocument().isNewLine(delta.text))
+ {
+ lines[delta.range.start.row] = undefined;
+ lines.splice(delta.range.end.row, 1);
+ states[delta.range.start.row] = undefined;
+ states.splice(delta.range.end.row, 1);
+ } else {
+ lines[delta.range.start.row] = undefined;
+ states[delta.range.start.row] = undefined;
+ }
+ }
+ }
+ session.bgTokenizer.lines = lines;
+ session.bgTokenizer.states = states;
+ session.bgTokenizer.fireUpdateEvent(firstRow, lastRow);
+ });
+
+ return worker;
+ };
+
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+});
+ace.define('ace/mode/xquery_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 XQueryHighlightRules = function() {
+
+ var keywordMapper = this.createKeywordMapper({
+ keyword: "after|ancestor|ancestor-or-self|and|as|ascending|attribute|before|case|cast|castable|child|collation|comment|copy|count|declare|default|delete|descendant|descendant-or-self|descending|div|document|document-node|element|else|empty|empty-sequence|end|eq|every|except|first|following|following-sibling|for|function|ge|group|gt|idiv|if|import|insert|instance|intersect|into|is|item|last|le|let|lt|mod|modify|module|namespace|namespace-node|ne|node|only|or|order|ordered|parent|preceding|preceding-sibling|processing-instruction|rename|replace|return|satisfies|schema-attribute|schema-element|self|some|stable|start|switch|text|to|treat|try|typeswitch|union|unordered|validate|where|with|xquery|contains|paragraphs|sentences|times|words|by|collectionreturn|variable|version|option|when|encoding|toswitch|catch|tumbling|sliding|window|at|using|stemming|collection|schema|while|on|nodes|index|external|then|in|updating|value|of|containsbreak|loop|continue|exit|returning|append|json|position"
+ }, "identifier");
+
+ // regexp must not have capturing parentheses
+ // regexps are ordered -> the first match is used
+
+ this.$rules = {
+ start : [ {
+ token : "text",
+ regex : "<\\!\\[CDATA\\[",
+ next : "cdata"
+ }, {
+ token : "xml_pe",
+ regex : "<\\?.*?\\?>"
+ }, {
+ token : "comment",
+ regex : "<\\!--",
+ next : "comment"
+ }, {
+ token : "comment",
+ regex : "\\(:",
+ next : "comment"
+ }, {
+ token : "text", // opening tag
+ regex : "<\\/?",
+ next : "tag"
+ }, {
+ token : "constant", // number
+ regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
+ }, {
+ token : "variable", // variable
+ regex : "\\$[a-zA-Z_][a-zA-Z0-9_\\-:]*\\b"
+ }, {
+ token: "string",
+ regex : '".*?"'
+ }, {
+ token: "string",
+ regex : "'.*?'"
+ }, {
+ token : "text",
+ regex : "\\s+"
+ }, {
+ token: "support.function",
+ regex: "\\w[\\w+_\\-:]+(?=\\()"
+ }, {
+ token : keywordMapper,
+ regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
+ }, {
+ token: "keyword.operator",
+ regex: "\\*|=|<|>|\\-|\\+"
+ }, {
+ token: "lparen",
+ regex: "[[({]"
+ }, {
+ token: "rparen",
+ regex: "[\\])}]"
+ } ],
+
+ tag : [ {
+ token : "text",
+ regex : ">",
+ next : "start"
+ }, {
+ token : "meta.tag",
+ regex : "[-_a-zA-Z0-9:]+"
+ }, {
+ token : "text",
+ regex : "\\s+"
+ }, {
+ token : "string",
+ regex : '".*?"'
+ }, {
+ token : "string",
+ regex : "'.*?'"
+ } ],
+
+ cdata : [ {
+ token : "comment",
+ regex : "\\]\\]>",
+ next : "start"
+ }, {
+ token : "comment",
+ regex : "\\s+"
+ }, {
+ token : "comment",
+ regex : "(?:[^\\]]|\\](?!\\]>))+"
+ } ],
+
+ comment : [ {
+ token : "comment",
+ regex : ".*?-->",
+ next : "start"
+ }, {
+ token: "comment",
+ regex : ".*:\\)",
+ next : "start"
+ }, {
+ token : "comment",
+ regex : ".+"
+ } ]
+ };
+};
+
+oop.inherits(XQueryHighlightRules, TextHighlightRules);
+
+exports.XQueryHighlightRules = XQueryHighlightRules;
+});
+ace.define('ace/mode/behaviour/xquery', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/mode/behaviour/cstyle'], function(require, exports, module) {
+
+
+ var oop = require("../../lib/oop");
+ var Behaviour = require('../behaviour').Behaviour;
+ var CstyleBehaviour = require('./cstyle').CstyleBehaviour;
+
+ var XQueryBehaviour = function (parent) {
+
+ this.inherit(CstyleBehaviour, ["braces", "parens", "string_dquotes"]); // Get string behaviour
+ this.parent = parent;
+
+// this.add("brackets", "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]
+// }
+// }
+// }
+// return false;
+// });
+
+ // Check for open tag if user enters / and auto-close it.
+// this.add("slash", "insertion", function (state, action, editor, session, text) {
+// if (text == "/") {
+// var cursor = editor.getCursorPosition();
+// var line = session.doc.getLine(cursor.row);
+// if (cursor.column > 0 && line.charAt(cursor.column - 1) == "<") {
+// line = line.substring(0, cursor.column) + "/" + line.substring(cursor.column);
+// var lines = session.doc.getAllLines();
+// lines[cursor.row] = line;
+// // call mode helper to close the tag if possible
+// parent.exec("closeTag", lines.join(session.doc.getNewLineCharacter()), cursor.row);
+// }
+// }
+// return false;
+// });
+ }
+ oop.inherits(XQueryBehaviour, Behaviour);
+
+ exports.XQueryBehaviour = XQueryBehaviour;
+});
+
+ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour'], function(require, exports, module) {
+
+
+var oop = require("../../lib/oop");
+var Behaviour = require("../behaviour").Behaviour;
+
+var CstyleBehaviour = function () {
+
+ this.add("braces", "insertion", function (state, action, editor, session, text) {
+ if (text == '{') {
+ var selection = editor.getSelectionRange();
+ var selected = session.doc.getTextRange(selection);
+ if (selected !== "") {
+ return {
+ text: '{' + selected + '}',
+ selection: false
+ };
+ } else {
+ 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) {
+ return {
+ text: '',
+ selection: [1, 1]
+ };
+ }
+ }
+ } else if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ if (rightChar == '}') {
+ var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column + 1});
+ if (!openBracePos)
+ return null;
+
+ var indent = this.getNextLineIndent(state, line.substring(0, line.length - 1), session.getTabString());
+ var next_indent = this.$getIndent(session.doc.getLine(openBracePos.row));
+
+ return {
+ text: '\n' + indent + '\n' + next_indent,
+ 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;
+ }
+ }
+ });
+
+ this.add("parens", "insertion", function (state, action, editor, session, text) {
+ if (text == '(') {
+ var selection = editor.getSelectionRange();
+ var selected = session.doc.getTextRange(selection);
+ if (selected !== "") {
+ return {
+ text: '(' + selected + ')',
+ selection: false
+ };
+ } else {
+ 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) {
+ 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 !== "") {
+ return {
+ text: '[' + selected + ']',
+ selection: false
+ };
+ } else {
+ 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) {
+ 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 !== "") {
+ 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);
+
+ // We're escaped.
+ if (leftChar == '\\') {
+ return null;
+ }
+
+ // Find what token we're inside.
+ 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;
+ }
+
+ // Try and be smart about when we auto insert.
+ 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)))) {
+ return {
+ text: quote + quote,
+ selection: [1,1]
+ };
+ } else if (token && token.type === "string") {
+ // Ignore input and move right one if we're typing over the closing quote.
+ 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 == '"') {
+ range.end.column++;
+ return range;
+ }
+ }
+ });
+
+};
+
+oop.inherits(CstyleBehaviour, Behaviour);
+
+exports.CstyleBehaviour = CstyleBehaviour;
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/mode-yaml.js b/vendor/assets/javascripts/ace-src-noconflict/mode-yaml.js
new file mode 100644
index 00000000000..87a059fa6b8
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/mode-yaml.js
@@ -0,0 +1,371 @@
+/* ***** 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 ***** */
+
+ace.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;
+
+});
+
+ace.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() {
+
+ // regexp must not have capturing parentheses. Use (?:) instead.
+ // regexps are ordered -> the first match is used
+ this.$rules = {
+ "start" : [
+ {
+ token : "comment",
+ regex : "#.*$"
+ }, {
+ token : "comment",
+ regex : "^---"
+ }, {
+ token: "variable",
+ regex: "[&\\*][a-zA-Z0-9-_]+"
+ }, {
+ token: ["identifier", "text"],
+ regex: "(\\w+\\s*:)(\\w*)"
+ }, {
+ token : "keyword.operator",
+ regex : "<<\\w*:\\w*"
+ }, {
+ token : "keyword.operator",
+ regex : "-\\s*(?=[{])"
+ }, {
+ token : "string", // single line
+ regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
+ }, {
+ token : "string", // multi line string start
+ merge : true,
+ regex : '[\\|>]\\w*',
+ next : "qqstring"
+ }, {
+ token : "string", // single quoted string
+ regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
+ }, {
+ token : "constant.numeric", // float
+ regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
+ }, {
+ token : "constant.language.boolean",
+ regex : "(?:true|false|yes|no)\\b"
+ }, {
+ token : "invalid.illegal", // comments are not allowed
+ regex : "\\/\\/.*$"
+ }, {
+ token : "paren.lparen",
+ regex : "[[({]"
+ }, {
+ token : "paren.rparen",
+ regex : "[\\])}]"
+ }, {
+ token : "text",
+ regex : "\\s+"
+ }
+ ],
+ "qqstring" : [
+ {
+ token : "string",
+ regex : '(?=(?:(?:\\\\.)|(?:[^:]))*?:)',
+ next : "start"
+ }, {
+ token : "string",
+ merge : true,
+ regex : '.+'
+ }
+ ]}
+
+};
+
+oop.inherits(YamlHighlightRules, TextHighlightRules);
+
+exports.YamlHighlightRules = YamlHighlightRules;
+});
+
+ace.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;
+});
+
+ace.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);
+ }
+ };
+
+ // must return "" if there's no fold, to enable caching
+ 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 "";
+ }
+
+ // documentation comments
+ 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);
+
+});
+
+ace.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;
+
+ // must return "" if there's no fold, to enable caching
+ 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);
+ };
+
+}).call(FoldMode.prototype);
+
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/theme-ambiance.js b/vendor/assets/javascripts/ace-src-noconflict/theme-ambiance.js
new file mode 100644
index 00000000000..fb4e15707ef
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/theme-ambiance.js
@@ -0,0 +1,269 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Distributed under the BSD license:
+ *
+ * Copyright 2011 Irakli Gozalishvili. All rights reserved.
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ * ***** END LICENSE BLOCK ***** */
+
+ace.define('ace/theme/ambiance', ['require', 'exports', 'module', 'ace/lib/dom'], function(require, exports, module) {
+
+exports.isDark = true;
+exports.cssClass = "ace-ambiance";
+exports.cssText = ".ace-ambiance {\
+ background-color: #202020;\
+}\
+\
+.ace-ambiance .ace_editor {\
+ border: 2px solid rgb(159, 159, 159);\
+}\
+\
+.ace-ambiance .ace_editor.ace_focus {\
+ border: 2px solid #327fbd;\
+}\
+\
+.ace-ambiance .ace_gutter {\
+ background-image: -moz-linear-gradient(left, #3D3D3D, #333);\
+ background-image: -ms-linear-gradient(left, #3D3D3D, #333);\
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#3D3D3D), to(#333));\
+ background-image: -webkit-linear-gradient(left, #3D3D3D, #333);\
+ background-image: -o-linear-gradient(left, #3D3D3D, #333);\
+ background-image: linear-gradient(left, #3D3D3D, #333);\
+ background-repeat: repeat-x;\
+\
+ text-shadow: 0px 1px 1px #4d4d4d;\
+ color: #222;\
+ border-right: 1px solid #4d4d4d;\
+ overflow : hidden;\
+}\
+\
+.ace-ambiance .ace_gutter-layer {\
+ background: repeat left top;\
+ width: 100%;\
+ text-align: right;\
+}\
+\
+.ace-ambiance .ace_gutter-layer .ace_gutter-cell .ace_fold-widget {\
+ position: absolute;\
+ right: 2px;\
+ margin: 0;\
+ vertical-align: middle;\
+ height: inherit;\
+ width: auto;\
+ background: none;\
+ border: none;\
+ box-shadow: none;\
+ outline: none;\
+}\
+\
+.ace-ambiance .ace_gutter-layer .ace_gutter-cell .ace_fold-widget:hover {\
+ color: #777;\
+}\
+\
+.ace-ambiance .ace_gutter-layer .ace_gutter-cell .ace_fold-widget:hover {\
+ color: #777;\
+}\
+\
+.ace-ambiance .ace_gutter-layer .ace_gutter-cell .ace_fold-widget.open:after {\
+ content: 'â–¾'\
+}\
+\
+.ace-ambiance .ace_gutter-layer .ace_gutter-cell .ace_fold-widget.closed:after {\
+ content: '‣'\
+}\
+\
+.ace-ambiance .ace_print_margin {\
+ border-left: 1px dotted #2D2D2D;\
+ width: 100%;\
+ background: #262626;\
+}\
+\
+.ace-ambiance .ace_scroller {\
+ background-color: #202020;\
+ -webkit-box-shadow: inset 0 0 10px black;\
+ -moz-box-shadow: inset 0 0 10px black;\
+ -o-box-shadow: inset 0 0 10px black;\
+ box-shadow: inset 0 0 10px black;\
+}\
+\
+.ace-ambiance .ace_text-layer {\
+ cursor: text;\
+ color: #E6E1DC;\
+ background: url(\"noise.png\") repeat left top;\
+}\
+\
+.ace-ambiance .ace_cursor {\
+ border-left: 1px solid #7991E8;\
+}\
+\
+.ace-ambiance .ace_cursor.ace_overwrite {\
+ border: 1px solid #FFE300;\
+ background: #766B13;\
+}\
+\
+.ace-ambiance.normal-mode .ace_cursor-layer {\
+ z-index: 0;\
+}\
+ \
+.ace-ambiance .ace_marker-layer .ace_selection {\
+ background: rgba(221, 240, 255, 0.20);\
+}\
+\
+.ace-ambiance .ace_marker-layer .ace_selected_word {\
+ border-radius: 4px;\
+ border: 8px solid #3f475d;\
+ box-shadow: 0 0 4px black;\
+}\
+\
+.ace-ambiance .ace_marker-layer .ace_step {\
+ background: rgb(198, 219, 174);\
+}\
+\
+.ace-ambiance .ace_marker-layer .ace_bracket {\
+ margin: -1px 0 0 -1px;\
+ border: 1px solid rgba(255, 255, 255, 0.25);\
+}\
+\
+.ace-ambiance .ace_marker-layer .ace_active_line {\
+ background: rgba(255, 255, 255, 0.031);\
+}\
+\
+\
+\
+.ace-ambiance .ace_invisible {\
+ color: #333;\
+}\
+\
+.ace-ambiance .ace_paren {\
+ color: #24C2C7;\
+}\
+\
+.ace-ambiance .ace_keyword {\
+ color: #cda869;\
+}\
+\
+.ace-ambiance .ace_keyword.ace_operator {\
+ color: #fa8d6a;\
+}\
+\
+.ace-ambiance .ace_punctuation.ace_operator {\
+ color: #fa8d6a;\
+}\
+\
+.ace-ambiance .ace_identifier {\
+}\
+\
+.ace-ambiance .ace-statement {\
+ color: #cda869;\
+}\
+\
+.ace-ambiance .ace_constant {\
+ color: #CF7EA9;\
+}\
+\
+.ace-ambiance .ace_constant.ace_language {\
+ color: #CF7EA9;\
+}\
+\
+.ace-ambiance .ace_constant.ace_library {\
+ \
+}\
+\
+.ace-ambiance .ace_constant.ace_numeric {\
+ color: #78CF8A;\
+}\
+\
+.ace-ambiance .ace_invalid {\
+ text-decoration: underline;\
+}\
+\
+.ace-ambiance .ace_invalid.ace_illegal {\
+ color:#F8F8F8;\
+ background-color: rgba(86, 45, 86, 0.75);\
+}\
+\
+.ace-ambiance .ace_invalid,\
+.ace-ambiance .ace_deprecated {\
+ text-decoration: underline;\
+ font-style: italic;\
+ color: #D2A8A1;\
+}\
+\
+.ace-ambiance .ace_support {\
+ color: #9B859D;\
+}\
+\
+.ace-ambiance .ace_support.ace_function {\
+ color: #DAD085;\
+}\
+\
+.ace-ambiance .ace_function.ace_buildin {\
+ color: #9b859d;\
+}\
+\
+.ace-ambiance .ace_string {\
+ color: #8f9d6a;\
+}\
+\
+.ace-ambiance .ace_string.ace_regexp {\
+ color: #DAD085;\
+}\
+\
+.ace-ambiance .ace_comment {\
+ font-style: italic;\
+ color: #555;\
+}\
+\
+.ace-ambiance .ace_comment.ace_doc {\
+}\
+\
+.ace-ambiance .ace_comment.ace_doc.ace_tag {\
+ color: #666;\
+ font-style: normal;\
+}\
+\
+.ace-ambiance .ace_definition,\
+.ace-ambiance .ace_type {\
+ color: #aac6e3;\
+}\
+\
+.ace-ambiance .ace_variable {\
+ color: #9999cc;\
+}\
+\
+.ace-ambiance .ace_variable.ace_language {\
+ color: #9b859d;\
+}\
+\
+.ace-ambiance .ace_xml_pe {\
+ color: #494949;\
+}\
+\
+.ace-ambiance .ace_gutter-layer,\
+.ace-ambiance .ace_text-layer {\
+ background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAQAAAAHUWYVAABFFUlEQVQYGbzBCeDVU/74/6fj9HIcx/FRHx9JCFmzMyGRURhLZIkUsoeRfUjS2FNDtr6WkMhO9sm+S8maJfu+Jcsg+/o/c+Z4z/t97/vezy3z+z8ekGlnYICG/o7gdk+wmSHZ1z4pJItqapjoKXWahm8NmV6eOTbWUOp6/6a/XIg6GQqmenJ2lDHyvCFZ2cBDbmtHA043VFhHwXxClWmeYAdLhV00Bd85go8VmaFCkbVkzlQENzfBDZ5gtN7HwF0KDrTwJ0dypSOzpaKCMwQHKTIreYIxlmhXTzTWkVm+LTynZhiSBT3RZQ7aGfjGEd3qyXQ1FDymqbKxpspERQN2MiRjNZlFFQXfCNFm9nM1zpAsoYjmtRTc5ajwuaXc5xrWskT97RaKzAGe5ARHhVUsDbjKklziiX5WROcJwSNCNI+9w1Jwv4Zb2r7lCMZ4oq5C0EdTx+2GzNuKpJ+iFf38JEWkHJn9DNF7mmBDITrWEg0VWL3pHU20tSZnuqWu+R3BtYa8XxV1HO7GyD32UkOpL/yDloINFTmvtId+nmAjxRw40VMwVKiwrKLE4bK5UOVntYwhOcSSXKrJHKPJedocpGjVz/ZMIbnYUPB10/eKCrs5apqpgVmWzBYWpmtKHecJPjaUuEgRDDaU0oZghCJ6zNMQ5ZhDYx05r5v2muQdM0EILtXUsaKiQX9WMEUotagQzFbUNN6NUPC2nm5pxEWGCjMc3GdJHjSU2kORLK/JGSrkfGEIjncU/CYUnOipoYemwj8tST9NsJmB7TUVXtbUtXATJVZXBMvYeTXJfobgJUPmGMP/yFaWonaa6BcFO3nqcIqCozSZoZoSr1g4zJOzuyGnxTEX3lUEJ7WcZgme8ddaWvWJo2AJR9DZU3CUIbhCSG6ybSwN6qtJVnCU2svDTP2ZInOw2cBTrqtQahtNZn9NcJ4l2NaSmSkkP1noZWnVwkLmdUPOwLZEwy2Z3S3R+4rIG9hcbpPXHFVWcQdZkn2FOta3cKWQnNRC5g1LsJah4GCzSVsKnCOY5OAFRTBekyyryeyilhFKva75r4Mc0aWanGEaThcy31s439KKxTzJYY5WTHPU1FtIHjQU3Oip4xlNzj/lBw23dYZVliQa7WAXf4shetcQfatI+jWRDBPmyNeW6A1P5kdDgyYJlba0BIM8BZu1JfrFwItyjcAMR3K0BWOIrtMEXyhyrlVEx3ui5dUBjmB/Q3CXW85R4mBD0s7B+4q5tKUjOlb9qqmhi5AZ6GFIC5HXtOobdYGlVdMVbNJ8toNTFcHxnoL+muBagcctjWnbNMuR00uI7nQESwg5q2qqrKWIfrNUmeQocY6HuyxJV02wj36w00yhpmUFenv4p6fUkZYqLyuinx2RGOjhCXYyJF84oiU00YMOOhhquNdfbOB7gU88pY4xJO8LVdp6/q2voeB4R04vIdhSE40xZObx1HGGJ/ja0LBthFInKaLPPFzuCaYaoj8JjPME8yoyxo6zlBqkiUZYgq00OYMswbWO5NGmq+xhipxHLRW29ARjNKXO0wRnear8XSg4XFPLKEPUS1GqvyLwiuBUoa7zpZ0l5xxFwWmWZC1H5h5FwU8eQ7K+g8UcVY6TMQreVQT/8uQ8Z+ALIXnSEa2pYZQneE9RZbSBNYXfWYJzW/h/4j4Dp1tYVcFIC5019Vyi4ThPqSFCzjGWaHQTBU8q6vrVwgxP9Lkm840imWKpcLCjYTtrKuwvsKSnrvHCXGkSMk9p6lhckfRpIeis+N2PiszT+mFLspyGleUhDwcLrZqmyeylxwjBcKHEapqkmyangyLZRVOijwOtCY5SsG5zL0OwlCJ4y5KznF3EUNDDrinwiyLZRzOXtlBbK5ITHFGLp8Q0R6ab6mS7enI2cFrxOyHvOCFaT1HThS1krjCwqWeurCkk+willhCC+RSZnRXBiZaC5RXRIZYKp2lyfrHwiKPKR0JDzrdU2EFgpidawlFDR6FgXUMNa+g1FY3bUQh2cLCwosRdnuQTS/S+JVrGLeWIvtQUvONJxlqSQYYKpwoN2kaocLjdVsis4Mk80ESF2YpSkzwldjHkjFCUutI/r+EHDU8oCs6yzL3PhWiEooZdFMkymlas4AcI3KmoMMNSQ3tHzjGWCrcJJdYyZC7QFGwjRL9p+MrRkAGWzIaWCn9W0F3TsK01c2ZvQw0byvxuQU0r1lM0qJO7wW0kRIMdDTtXEdzi4VIh+EoIHm0mWtAtpCixlabgn83fKTI7anJe9ST7WIK1DMGpQmYeA58ImV6ezOGOzK2Kgq01pd60cKWiUi9Lievb/0vIDPHQ05Kzt4ddPckQBQtoaurjyHnek/nKzpQLrVgKPjIkh2v4uyezpv+Xoo7fPFXaGFp1vaLKxQ4uUpQQS5VuQs7BCq4xRJv7fwpVvvFEB3j+620haOuocqMhWd6TTPAEx+mdFNGHdranFe95WrWmIvlY4F1Dle2ECgc6cto7SryuqGGGha0tFQ5V53migUKmg6XKAo4qS3mik+0OZpAhOLeZKicacgaYcyx5hypYQE02ZA4xi/pNhOQxR4klNKyqacj+mpxnLTnnGSo85++3ZCZq6lrZkXlGEX3o+C9FieccJbZWVFjC0Yo1FZnJhoYMFoI1hEZ9r6hwg75HwzBNhbZCdJEfJwTPGzJvaKImw1yYX1HDAmpXR+ZJQ/SmgqMNVQb5vgamGwLtt7VwvP7Qk1xpiM5x5Cyv93E06MZmgs0Nya2azIKOYKCGBQQW97RmhKNKF02JZqHEJ4o58qp7X5EcZmc56trXEqzjCBZ1MFGR87Ql2tSTs6CGxS05PTzRQorkbw7aKoKXFDXsYW42VJih/q+FP2BdTzDTwVqOYB13liM50vG7wy28qagyuIXMeQI/Oqq8bcn5wJI50xH00CRntyfpL1T4hydYpoXgNiFzoIUTDZnLNRzh4TBHwbYGDvZkxmlyJloyr6tRihpeUG94GnKtIznREF0tzJG/OOr73JBcrSh1k6WuTprgLU+mnSGnv6Zge0NNz+kTDdH8nuAuTdJDCNb21LCiIuqlYbqGzT3RAoZofQfjFazkqeNWdYaGvYTM001EW2oKPvVk1ldUGSgUtHFwjKM1h9jnFcmy5lChoLNaQMGGDsYbKixlaMBmmsx1QjCfflwTfO/gckW0ruZ3jugKR3R5W9hGUWqCgxuFgsuaCHorotGKzGaeZB9DMsaTnKCpMtwTvOzhYk0rdrArKCqcaWmVk1+F372ur1YkKxgatI8Qfe1gIX9wE9FgS8ESmuABIXnRUbCapcKe+nO7slClSZFzpV/LkLncEb1qiO42fS3R855Su2mCLh62t1SYZZYVmKwIHjREF2uihTzB20JOkz7dkxzYQnK0UOU494wh+VWRc6Un2kpTaVgLDFEkJ/uhzRcI0YKGgpGWOlocBU/a4fKoJ/pEaNV6jip3+Es9VXY078rGnmAdf7t9ylPXS34RBSuYPs1UecZTU78WanhBCHpZ5sAoTz0LGZKjPf9TRypqWEiTvOFglL1fCEY3wY/++rbk7C8bWebA6p6om6PgOL2kp44TFJlVNBXae2rqqdZztOJpT87GQsE9jqCPIe9VReZuQ/CIgacsyZdCpIScSYqcZk8r+nsyCzhyfhOqHGOIvrLknC8wTpFcaYiGC/RU1NRbUeUpocQOnkRpGOrIOcNRx+1uA0UrzhSSt+VyS3SJpnFWkzNDqOFGIWcfR86DnmARTQ1HKIL33ExPiemeOhYSSjzlSUZZuE4TveoJLnBUOFof6KiysCbnAEcZgcUNTDOwkqWu3RWtmGpZwlHhJENdZ3miGz0lJlsKnjbwqSHQjpxnFDlTLLwqJPMZMjd7KrzkSG7VsxXBZE+F8YZkb01Oe00yyRK9psh5SYh29ySPKBo2ylNht7ZkZnsKenjKNJu9PNEyZpaCHv4Kt6RQsLvAVp7M9kIimmCUwGeWqLMmGuIotYMmWNpSahkhZw9FqZsVnKJhsjAHvtHMsTM9fCI06Dx/u3vfUXCqfsKRc4oFY2jMsoo/7DJDwZ1CsIKnJu+J9ldkpmiCxQx1rWjI+T9FwcWWzOuaYH0Hj7klNRVWEQpmaqosakiGNTFHdjS/qnUdmf0NJW5xsL0HhimCCZZSRzmSPTXJQ4aaztAwtZnoabebJ+htCaZ7Cm535ByoqXKbX1WRc4Eh2MkRXWzImVc96Cj4VdOKVxR84VdQsIUM8Psoou2byVHyZFuq7O8otbSQ2UAoeEWTudATLGSpZzVLlXVkPU2Jc+27lsw2jmg5T5VhbeE3BT083K9WsTTkFU/Osi0rC5lRlpwRHUiesNS0sOvmqGML1aRbPAxTJD9ZKtxuob+hhl8cwYGWpJ8nub7t5p6coYbMovZ1BTdaKn1jYD6h4GFDNFyT/Kqe1XCXphXHOKLZmuRSRdBPEfVUXQzJm5YGPGGJdvAEr7hHNdGZnuBvrpciGmopOLf5N0uVMy0FfYToJk90uUCbJupaVpO53UJXR2bVpoU00V2KOo4zMFrBd0Jtz2pa0clT5Q5L8IpQ177mWQejPMEJhuQjS10ref6HHjdEhy1P1EYR7GtO0uSsKJQYLiTnG1rVScj5lyazpqWGl5uBbRWl7m6ixGOOnEsMJR7z8J0n6KMnCdxhiNYQCoZ6CmYLnO8omC3MkW3bktlPmEt/VQQHejL3+dOE5FlPdK/Mq8hZxxJtLyRrepLThYKbLZxkSb5W52vYxNOaOxUF0yxMUPwBTYqCzy01XayYK0sJyWBLqX0MwU5CzoymRzV0EjjeUeLgDpTo6ij42ZAzvD01dHUUTPLU96MdLbBME8nFBn7zJCMtJcZokn8YoqU0FS5WFKyniHobguMcmW8N0XkWZjkyN3hqOMtS08r+/xTBwpZSZ3qiVRX8SzMHHjfUNFjgHEPmY9PL3ykEzxkSre/1ZD6z/NuznuB0RcE1TWTm9zRgfUWVJiG6yrzgmWPXC8EAR4Wxhlad0ZbgQyEz3pG5RVEwwDJH2mgKpjcTiCOzn1lfUWANFbZ2BA8balnEweJC9J0iuaeZoI+ippFCztEKVvckR2iice1JvhVytrQwUAZpgsubCPaU7xUe9vWnaOpaSBEspalykhC9bUlOMpT42ZHca6hyrqKmw/wMR8H5ZmdFoBVJb03O4UL0tSNnvIeRmkrLWqrs78gcrEn2tpcboh0UPOW3UUR9PMk4T4nnNKWmCjlrefhCwxRNztfmIQVdDElvS4m1/WuOujoZCs5XVOjtKPGokJzsYCtFYoWonSPT21DheU/wWhM19FcElwqNGOsp9Q8N/cwXaiND1MmeL1Q5XROtYYgGeFq1aTMsoMmcrKjQrOFQTQ1fmBYhmW6o8Jkjc7iDJRTBIo5kgJD5yMEYA3srCg7VFKwiVJkmRCc5ohGOKhsYMn/XBLdo5taZjlb9YAlGWRimqbCsoY7HFAXLa5I1HPRxMMsQDHFkWtRNniqT9UEeNjcE7RUlrCJ4R2CSJuqlKHWvJXjAUNcITYkenuBRB84TbeepcqTj3zZyFJzgYQdHnqfgI0ddUwS6GqWpsKWhjq9cV0vBAEMN2znq+EBfIWT+pClYw5xsTlJU6GeIBsjGmmANTzJZiIYpgrM0Oa8ZMjd7NP87jxhqGOhJlnQtjuQpB+8aEE00wZFznSJPyHxgH3HkPOsJFvYk8zqCHzTs1BYOa4J3PFU+UVRZxlHDM4YavlNUuMoRveiZA2d7grMNc2g+RbSCEKzmgYsUmWmazFJyoiOZ4KnyhKOGRzWJa0+moyV4TVHDzn51Awtqaphfk/lRQ08FX1iiqxTB/kLwd0VynKfEvI6cd4XMV5bMhZ7gZUWVzYQ6Nm2BYzxJbw3bGthEUUMfgbGeorae6DxHtJoZ6alhZ0+ytiVoK1R4z5PTrOECT/SugseEOlb1MMNR4VRNcJy+V1Hg9ONClSZFZjdHlc6W6FBLdJja2MC5hhpu0DBYEY1TFGwiFAxRRCsYkiM9JRb0JNMVkW6CZYT/2EiTGWmo8k+h4FhDNE7BvppoTSFnmCV5xZKzvcCdDo7VVPnIU+I+Rc68juApC90MwcFCsJ5hDqxgScYKreruyQwTqrzoqDCmhWi4IbhB0Yrt3RGa6GfDv52rKXWhh28dyZaWUvcZeMTBaZoSGyiCtRU5J8iviioHaErs7Jkj61syVzTTgOcUOQ8buFBTYWdL5g3T4qlpe0+wvD63heAXRfCCIed9RbCsp2CiI7raUOYOTU13N8PNHvpaGvayo4a3LLT1lDrVEPT2zLUlheB1R+ZTRfKWJ+dcocLJfi11vyJ51lLqJ0WD7tRwryezjiV5W28uJO9qykzX8JDe2lHl/9oyBwa2UMfOngpXCixvKdXTk3wrsKmiVYdZIqsoWEERjbcUNDuiaQomGoIbFdEHmsyWnuR+IeriKDVLnlawlyNHKwKlSU631PKep8J4Q+ayjkSLKYLhalNHlYvttb6fHm0p6OApsZ4l2VfdqZkjuysy6ysKLlckf1KUutCTs39bmCgEyyoasIWlVaMF7mgmWtBT8Kol5xpH9IGllo8cJdopcvZ2sImlDmMIbtDk3KIpeNiS08lQw11NFPTwVFlPP6pJ2gvRfI7gQUfmNAtf6Gs0wQxDsKGlVBdF8rCa3jzdwMaGHOsItrZk7hAyOzpK9VS06j5F49b0VNGOOfKs3lDToMsMBe9ZWtHFEgxTJLs7qrygKZjUnmCYoeAqeU6jqWuLJup4WghOdvCYJnrSkSzoyRkm5M2StQwVltPkfCAk58tET/CSg+8MUecmotMEnhBKfWBIZsg2ihruMJQaoIm+tkTLKEqspMh00w95gvFCQRtDwTT1gVDDSEVdlwqZfxoQRbK0g+tbiBZxzKlpnpypejdDwTaeOvorMk/IJE10h9CqRe28hhLbe0pMsdSwv4ZbhKivo2BjDWfL8UKJgeavwlwb5KlwhyE4u4XkGE2ytZCznKLCDZZq42VzT8HLCrpruFbIfOIINmh/qCdZ1ZBc65kLHR1Bkyf5zn6pN3SvGKIlFNGplhrO9QSXanLOMQTLCa0YJCRrCZm/CZmrLTm7WzCK4GJDiWUdFeYx1LCFg3NMd0XmCuF3Y5rITLDUsYS9zoHVzwnJoYpSTQoObyEzr4cFBNqYTopoaU/wkyLZ2lPhX/5Y95ulxGTV7KjhWrOZgl8MyUUafjYraNjNU1N3IWcjT5WzWqjwtoarHSUObGYO3GCJZpsBlnJGPd6ZYLyl1GdCA2625IwwJDP8GUKymbzuyPlZlvTUsaUh5zFDhRWFzPKKZLAlWdcQbObgF9tOqOsmB1dqcqYJmWstFbZRRI9poolmqiLnU0POvxScpah2iSL5UJNzgScY5+AuIbpO0YD3NCW+dLMszFSdFCWGqG6eVq2uYVNDdICGD6W7EPRWZEY5gpsE9rUkS3mijzzJnm6UpUFXG1hCUeVoS5WfNcFpblELL2qqrCvMvRfd45oalvKU2tiQ6ePJOVMRXase9iTtLJztPxJKLWpo2CRDcJwn2sWSLKIO1WQWNTCvpVUvOZhgSC40JD0dOctaSqzkCRbXsKlb11Oip6PCJ0IwSJM31j3akRxlP7Rwn6aGaUL0qiLnJkvB3xWZ2+Q1TfCwpQH3G0o92UzmX4o/oJNQMMSQc547wVHhdk+VCw01DFYEnTxzZKAm74QmeNNR1w6WzEhNK15VJzuCdxQ53dRUDws5KvwgBMOEgpcVNe0hZI6RXT1Jd0cyj5nsaEAHgVmGaJIlWdsc5Ui2ElrRR6jrRAttNMEAIWrTDFubkZaok7/AkzfIwfuWVq0jHzuCK4QabtLUMVPB3kJ0oyHTSVFlqMALilJf2Rf8k5aaHtMfayocLBS8L89oKoxpJvnAkDPa0qp5DAUTHKWmCcnthlou8iCKaFFLHWcINd1nyIwXqrSxMNmSs6KmoL2QrKuWtlQ5V0120xQ5vRyZS1rgFkWwhiOwiuQbR0OOVhQM9iS3tiXp4RawRPMp5tDletOOBL95MpM01dZTBM9pkn5qF010rIeHFcFZhmSGpYpTsI6nwhqe5C9ynhlpp5ophuRb6WcJFldkVnVEwwxVfrVkvnWUuNLCg5bgboFHPDlDPDmnK7hUrWiIbjadDclujlZcaokOFup4Ri1kacV6jmrrK1hN9bGwpKEBQ4Q6DvIUXOmo6U5LqQM6EPyiKNjVkPnJkDPNEaxhiFay5ExW1NXVUGqcpYYdPcGiCq7z/TSlbhL4pplWXKd7NZO5QQFrefhRQW/NHOsqcIglc4UhWklR8K0QzbAw08CBDnpbgqXdeD/QUsM4RZXDFBW6WJKe/mFPdH0LtBgiq57wFLzlyQzz82qYx5D5WJP5yVJDW01BfyHnS6HKO/reZqId1WGa4Hkh2kWodJ8i6KoIPlAj2hPt76CzXsVR6koPRzWTfKqIentatYpQw2me4AA3y1Kind3SwoOKZDcFXTwl9tWU6mfgRk9d71sKtlNwrjnYw5tC5n5LdKiGry3JKNlHEd3oaMCFHrazBPMp/uNJ+V7IudcSbeOIdjUEdwl0VHCOZo5t6YluEuaC9mQeMgSfOyKnYGFHcIeQ84yQWbuJYJpZw5CzglDH7gKnWqqM9ZTaXcN0TeYhR84eQtJT76JJ1lREe7WnnvsMmRc9FQ7SBBM9mV3lCUdmHk/S2RAMt0QjFNFqQpWjDPQ01DXWUdDBkXziKPjGEP3VP+zIWU2t7im41FOloyWzn/L6dkUy3VLDaZ6appgDLHPjJEsyvJngWEPUyVBiAaHCTEXwrLvSEbV1e1gKJniicWorC1MUrVjB3uDhJE/wgSOzk1DXpk0k73qCM8xw2UvD5kJmDUfOomqMpWCkJRlvKXGmoeBm18USjVIk04SClxTB6YrgLAPLWYK9HLUt5cmc0vYES8GnTeRc6skZbQkWdxRsIcyBRzx1DbTk9FbU0caTPOgJHhJKnOGIVhQqvKmo0llRw9sabrZkDtdg3PqaKi9oatjY8B+G371paMg6+mZFNNtQ04mWBq3rYLOmtWWQp8KJnpy9DdFensyjdqZ+yY40VJlH8wcdLzC8PZnvHMFUTZUrDTkLyQaGus5X5LzpYAf3i+e/ZlhqGqWhh6Ou6xTR9Z6oi5AZZtp7Mj2EEm8oSpxiYZCHU/1fbGdNNNRRoZMhmilEb2gqHOEJDtXkHK/JnG6IrvbPCwV3NhONVdS1thBMs1T4QOBcTWa2IzhMk2nW5Kyn9tXUtpv9RsG2msxk+ZsQzRQacJncpgke0+T8y5Fzj8BiGo7XlJjaTIlpQs7KFjpqGnKuoyEPeIKnFMkZHvopgh81ySxNFWvJWcKRs70j2FOT012IllEEO1n4pD1513Yg2ssQPOThOkvyrqHUdEXOSEsihmBbTbKX1kLBPWqWkLOqJbjB3GBIZmoa8qWl4CG/iZ7oiA72ZL7TJNeZUY7kFQftDcHHluBzRbCegzMtrRjVQpX2lgoPKKLJAkcbMl01XK2p7yhL8pCBbQ3BN2avJgKvttcrWDK3CiUOVxQ8ZP+pqXKyIxnmBymCg5vJjNfkPK4+c8cIfK8ocVt7kmfd/I5SR1hKvCzUtb+lhgc00ZaO6CyhIQP1Uv4yIZjload72PXX0OIJvnFU+0Zf6MhsJwTfW0r0UwQfW4LNLZl5HK261JCZ4qnBaAreVAS3WrjV0LBnNDUNNDToCEeFfwgcb4gOEqLRhirWkexrCEYKVV711DLYEE1XBEsp5tpTGjorkomKYF9FDXv7fR3BGwbettSxnyL53MBPjsxDZjMh+VUW9NRxq1DhVk+FSxQcaGjV9Pawv6eGByw5qzoy7xk4RsOShqjJwWKe/1pEEfzkobeD/dQJmpqedcyBTy2sr4nGNRH0c0SPWTLrqAc0OQcb/gemKgqucQT7ySWKCn2EUotoCvpZct7RO2sy/QW0IWcXd7pQRQyZVwT2USRO87uhjioTLKV2brpMUcMQRbKH/N2T+UlTpaMls6cmc6CCNy3JdYYSUzzJQ4oSD3oKLncULOiJvjBEC2oqnCJkJluCYy2ZQ5so9YYlZ1VLlQU1mXEW1jZERwj/MUSRc24TdexlqLKfQBtDTScJUV8FszXBEY5ktpD5Ur9hYB4Nb1iikw3JoYpkKX+RodRKFt53MMuRnKSpY31PwYaGaILh3wxJGz9TkTPEETxoCWZrgvOlmyMzxFEwVJE5xZKzvyJ4WxEc16Gd4Xe3Weq4XH2jKRikqOkGQ87hQnC7wBmGYLAnesX3M+S87eFATauuN+Qcrh7xIxXJbUIdMw3JGE3ylCWzrieaqCn4zhGM19TQ3z1oH1AX+pWEqIc7wNGAkULBo/ZxRaV9NNyh4Br3rCHZzbzmSfawBL0dNRwpW1kK9mxPXR9povcdrGSZK9c2k0xwFGzjuniCtRSZCZ6ccZ7gaktmgAOtKbG/JnOkJrjcQTdFMsxRQ2cLY3WTIrlCw1eWKn8R6pvt4GFDso3QoL4a3nLk3G6JrtME3dSenpx7PNFTmga0EaJTLQ061sEeQoWXhSo9LTXsaSjoJQRXeZLtDclbCrYzfzHHeaKjHCVOUkQHO3JeEepr56mhiyaYYKjjNU+Fed1wS5VlhWSqI/hYUdDOkaxiKehoyOnrCV5yBHtbWFqTHCCwtpDcYolesVR5yUzTZBb3RNMd0d6WP+SvhuBmRcGxnuQzT95IC285cr41cLGQ6aJJhmi4TMGempxeimBRQw1tFKV+8jd6KuzoSTqqDxzRtpZkurvKEHxlqXKRIjjfUNNXQsNOsRScoWFLT+YeRZVD3GRN0MdQcKqQjHDMrdGGVu3iYJpQx3WGUvfbmxwFfR20WBq0oYY7LMFhhgYtr8jpaEnaOzjawWWaTP8mMr0t/EPDPoqcnxTBI5o58L7uoWnMrpoqPwgVrlAUWE+V+TQl9rawoyP6QGAlQw2TPRX+YSkxyBC8Z6jhHkXBgQL7WII3DVFnRfCrBfxewv9D6xsyjys4VkhWb9pUU627JllV0YDNHMku/ldNMMXDEo4aFnAkk4U6frNEU4XgZUPmEKHUl44KrzmYamjAbh0JFvGnaTLPu1s9jPCwjFpYiN7z1DTOk/nc07CfDFzmCf7i+bfNHXhDtLeBXzTBT5rkMvWOIxpl4EMh2LGJBu2syDnAEx2naEhHDWMMzPZEhygyS1mS5RTJr5ZkoKbEUoYqr2kqdDUE8ztK7OaIntJkFrIECwv8LJTaVx5XJE86go8dFeZ3FN3rjabCAYpoYEeC9zzJVULBbmZhDyd7ko09ydpNZ3nm2Kee4FPPXHnYEF1nqOFEC08LUVcDvYXkJHW8gTaKCk9YGOeIJhqiE4ToPEepdp7IWFjdwnWaufGMwJJCMtUTTBBK9BGCOy2tGGrJTHIwyEOzp6aPzNMOtlZkDvcEWpP5SVNhfkvDxhmSazTJXYrM9U1E0xwFVwqZQwzJxw6+kGGGUj2FglGGmnb1/G51udRSMNlTw6GGnCcUwVcOpmsqTHa06o72sw1RL02p9z0VbnMLOaIX3QKaYKSCFQzBKEUNHTSc48k53RH9wxGMtpQa5KjjW0W0n6XCCCG4yxNNdhQ4R4l1Ff+2sSd6UFHiIEOyqqFgT01mEUMD+joy75jPhOA+oVVLm309FR4yVOlp4RhLiScNmSmaYF5Pw0STrOIoWMSR2UkRXOMp+M4SHW8o8Zoi6OZgjKOaFar8zZDzkWzvKOjkKBjmCXby8JahhjXULY4KlzgKLvAwxVGhvyd4zxB1d9T0piazmKLCVZY5sKiD0y2ZSYrkUEPUbIk+dlQ4SJHTR50k1DPaUWIdTZW9NJwnJMOECgd7ou/MnppMJ02O1VT4Wsh85MnZzcFTngpXGKo84qmwgKbCL/orR/SzJ2crA+t6Mp94KvxJUeIbT3CQu1uIdlQEOzlKfS3UMcrTiFmOuroocrZrT2AcmamOKg8YomeEKm/rlT2sociMaybaUlFhuqHCM2qIJ+rg4EcDFymiDSxzaHdPcpE62pD5kyM5SBMoA1PaUtfIthS85ig1VPiPPYXgYEMNk4Qq7TXBgo7oT57gPUdwgCHzhIVFPFU6OYJzHAX9m5oNrVjeE61miDrqQ4VSa1oiURTsKHC0IfjNwU2WzK6eqK8jWln4g15TVBnqmDteCJ501PGAocJhhqjZdtBEB6lnhLreFJKxmlKbeGrqLiSThVIbCdGzloasa6lpMQXHCME2boLpJgT7yWaemu6wBONbqGNVRS0PKIL7LckbjmQtR7K8I5qtqel+T/ChJTNIKLjdUMNIRyvOEko9YYl2cwQveBikCNawJKcLBbc7+JM92mysNvd/Fqp8a0k6CNEe7cnZrxlW0wQXaXjaktnRwNOGZKYiONwS7a1JVheq3WgJHlQUGKHKmp4KAxXR/ULURcNgoa4zhKSLpZR3kxRRb0NmD0OFn+UCS7CzI1nbP6+o4x47QZE5xRCt3ZagnYcvmpYQktXdk5YKXTzBC57kKEe0VVuiSYqapssMS3C9p2CKkHOg8B8Pa8p5atrIw3qezIWanMGa5HRDNF6RM9wcacl0N+Q8Z8hsIkSnaIIdHRUOEebAPy1zbCkhM062FCJtif7PU+UtoVXzWKqM1PxXO8cfdruhFQ/a6x3JKYagvVDhQEtNiyiiSQ7OsuRsZUku0CRNDs4Sog6KKjsZgk2bYJqijgsEenoKeniinRXBn/U3lgpPdyDZynQx8IiioMnCep5Ky8mjGs6Wty0l1hUQTcNWswS3WRp2kCNZwJG8omG8JphPUaFbC8lEfabwP7VtM9yoaNCAjpR41VNhrD9LkbN722v0CoZMByFzhaW+MyzRYEWFDQwN2M4/JiT76PuljT3VU/A36eaIThb+R9oZGOAJ9tewkgGvqOMNRWYjT/Cwu99Q8LqDE4TgbLWxJ1jaDDAERsFOFrobgjUsBScaguXU8kKm2RL19tRypSHnHNlHiIZqgufs4opgQdVdwxBNNFBR6kVFqb8ogimOzB6a6HTzrlDHEpYaxjiiA4TMQobkDg2vejjfwJGWmnbVFAw3H3hq2NyQfG7hz4aC+w3BbwbesG0swYayvpAs6++Ri1Vfzx93mFChvyN5xVHTS+0p9aqCAxyZ6ZacZyw5+7uuQkFPR9DDk9NOiE7X1PCYJVjVUqq7JlrHwWALF5nfHNGjApdpqgzx5OwilDhCiDYTgnc9waGW4BdLNNUQvOtpzDOWHDH8D7TR/A/85KljEQu3NREc4Pl/6B1Hhc8Umb5CsKMmGC9EPcxoT2amwHNCmeOEnOPbklnMkbOgIvO5UMOpQrS9UGVdt6iH/fURjhI/WOpaW9OKLYRod6HCUEdOX000wpDZQ6hwg6LgZfOqo1RfT/CrJzjekXOGhpc1VW71ZLbXyyp+93ILbC1kPtIEYx0FIx1VDrLoVzXRKRYWk809yYlC9ImcrinxtabKnzRJk3lAU1OLEN1j2zrYzr2myHRXJFf4h4QKT1qSTzTB5+ZNTzTRkAxX8FcLV2uS8eoQQ2aAkFzvCM72sJIcJET3WPjRk5wi32uSS9rfZajpWEvj9hW42F4o5NytSXYy8IKHay10VYdrcl4SkqscrXpMwyGOgtkajheSxdQqmpxP1L3t4R5PqasFnrQEjytq6qgp9Y09Qx9o4S1FzhUCn1kyHSzBWLemoSGvOqLNhZyBjmCaAUYpMgt4Ck7wBBMMwWKWgjsUwTaGVsxWC1mYoKiyqqeGKYqonSIRQ3KIkHO0pmAxTdBHkbOvfllfr+AA+7gnc50huVKYK393FOyg7rbPO/izI7hE4CnHHHnJ0ogNPRUGeUpsrZZTBJcrovUcJe51BPsr6GkJdhCCsZ6aTtMEb2pqWkqeVtDXE/QVggsU/Nl86d9RMF3DxvZTA58agu810RWawCiSzzXBeU3MMW9oyJUedvNEvQyNu1f10BSMddR1vaLCYpYa/mGocLSiYDcLbQz8aMn5iyF4xBNMs1P0QEOV7o5gaWGuzSeLue4tt3ro7y4Tgm4G/mopdZgl6q0o6KzJWE3mMksNr3r+a6CbT8g5wZNzT9O7fi/zpaOmnz3BRoqos+tv9zMbdpxsqDBOEewtJLt7cg5wtKKbvldpSzRRCD43VFheCI7yZLppggMVBS/KMAdHODJvOwq2NQSbKKKPLdFWQs7Fqo+mpl01JXYRgq8dnGLhTiFzqmWsUMdpllZdbKlyvSdYxhI9YghOtxR8LgSLWHK62mGGVoxzBE8LNWzqH9CUesQzFy5RQzTc56mhi6fgXEWwpKfE5Z7M05ZgZUPmo6auiv8YKzDYwWBLMErIbKHJvOwIrvEdhOBcQ9JdU1NHQ7CXn2XIDFBKU2WAgcX9UAUzDXWd5alwuyJ41Z9rjKLCL4aCp4WarhPm2rH+SaHUYE001JDZ2ZAzXPjdMpZWvC9wmqIB2lLhQ01D5jO06hghWMndbM7yRJMsoCj1vYbnFQVrW9jak3OlEJ3s/96+p33dEPRV5GxiqaGjIthUU6FFEZyqCa5qJrpBdzSw95IUnOPIrCUUjRZQFrbw5PR0R1qiYx3cb6nrWUMrBmmiBQxVHtTew5ICP/ip6g4hed/Akob/32wvBHsIOX83cI8hGeNeNPCIkPmXe8fPKx84OMSRM1MTdXSwjCZ4S30jVGhvqTRak/OVhgGazHuOCud5onEO1lJr6ecVyaOK6H7zqlBlIaHE0oroCgfvGJIdPcmfLNGLjpz7hZwZQpUbFME0A1cIJa7VNORkgfsMBatbKgwwJM9bSvQXeNOvbIjelg6WWvo5kvbKaJJNHexkKNHL9xRyFlH8Ti2riB5wVPhUk7nGkJnoCe428LR/wRGdYIlmWebCyxou1rCk4g/ShugBDX0V0ZQWkh0dOVsagkM0yV6OoLd5ye+pRlsCr0n+KiQrGuq5yJDzrTAXHtLUMduTDBVKrSm3eHL+6ijxhFDX9Z5gVU/wliHYTMiMFpKLNMEywu80wd3meoFmt6VbRMPenhrOc6DVe4pgXU8DnnHakLOIIrlF4FZPIw6R+zxBP0dyq6OOZ4Q5sLKCcz084ok+VsMMyQhNZmmBgX5xIXOEJTmi7VsGTvMTNdHHhpzdbE8Du2oKxgvBqQKdDDnTFOylCFaxR1syz2iqrOI/FEpNc3C6f11/7+ASS6l2inq2ciTrCCzgyemrCL5SVPjQkdPZUmGy2c9Sw9FtR1sS30RmsKPCS4rkIC/2U0MduwucYolGaPjKEyhzmiPYXagyWbYz8LWBDdzRimAXzxx4z8K9hpzlhLq+NiQ97HuKorMUfK/OVvC2JfiHUPCQI/q7J2gjK+tTDNxkCc4TMssqCs4TGtLVwQihyoAWgj9bosU80XGW6Ac9TJGziaUh5+hnFcHOnlaM1iRn29NaqGENTTTSUHCH2tWTeV0osUhH6psuVLjRUmGWhm6OZEshGeNowABHcJ2Bpy2ZszRcKkRXd2QuKVEeXnbfaEq825FguqfgfE2whlChSRMdron+LATTPQ2Z369t4B9C5gs/ylzv+CMmepIDPclFQl13W0rspPd1JOcbghGOEutqCv5qacURQl3dDKyvyJlqKXGPgcM9FfawJAMVmdcspcYKOZc4GjDYkFlK05olNMHyHn4zFNykyOxt99RkHlfwmiHo60l2EKI+mhreEKp080Tbug08BVPcgoqC5zWt+NLDTZ7oNSF51N1qie7Va3uCCwyZbkINf/NED6jzOsBdZjFN8oqG3wxVunqCSYYKf3EdhJyf9YWGf7tRU2oH3VHgPr1fe5J9hOgHd7xQ0y7qBwXr23aGErP0cm64JVjZwsOGqL+mhNgZmhJLW2oY4UhedsyBgzrCKrq7BmcpNVhR6jBPq64Vgi+kn6XE68pp8J5/+0wRHGOpsKenQn9DZntPzjRLZpDAdD2fnSgkG9tmIXnUwQ6WVighs7Yi2MxQ0N3CqYaCXkJ0oyOztMDJjmSSpcpvlrk0RMMOjmArQ04PRV1DO1FwhCVaUVPpKUM03JK5SxPsIWRu8/CGHi8UHChiqGFDTbSRJWeYUDDcH6vJWUxR4k1FXbMUwV6e4AJFXS8oMqsZKqzvYQ9DDQdZckY4aGsIhtlubbd2r3j4QBMoTamdPZk7O/Bf62lacZwneNjQoGcdVU7zJOd7ghsUHOkosagic6cnWc8+4gg285R6zZP5s1/LUbCKIznTwK36PkdwlOrl4U1LwfdCCa+IrvFkmgw1PCAUXKWo0sURXWcI2muKJlgyFzhynCY4RBOsqCjoI1R5zREco0n2Vt09BQtYSizgKNHfUmUrQ5UOCh51BFcLmY7umhYqXKQomOop8bUnWNNQcIiBcYaC6xzMNOS8JQQfeqKBmmglB+97ok/lfk3ygaHSyZaCRTzRxQo6GzLfa2jWBPepw+UmT7SQEJyiyRkhBLMVOfcoMjcK0eZChfUNzFAUzCsEN5vP/X1uP/n/aoMX+K+nw/Hjr/9xOo7j7Pju61tLcgvJpTWXNbfN5jLpi6VfCOviTktKlFusQixdEKWmEBUKNaIpjZRSSOXSgzaaKLdabrm1/9nZ+/f+vd/vz/v9+Xy+zZ7PRorYoZqyLrCwQdEAixxVOEXNNnjX2nUSRlkqGmWowk8lxR50JPy9Bo6qJXaXwNvREBvnThPEPrewryLhcAnj5WE15Fqi8W7R1sAuEu86S4ENikItFN4xkv9Af4nXSnUVcLiA9xzesFpivRRVeFKtsMRaKBhuSbjOELnAUtlSQUpXgdfB4Z1oSbnFEetbQ0IrAe+Y+pqnDcEJFj6S8LDZzZHwY4e3XONNlARraomNEt2bkvGsosA3ioyHm+6jCMbI59wqt4eeara28IzEmyPgoRaUOEDhTVdEJhmCoTWfC0p8aNkCp0oYqih2iqGi4yXeMkOsn4LdLLnmKfh/YogjNsPebeFGR4m9BJHLzB61XQ3BtpISfS2FugsK9FAtLWX1dCRcrCnUp44CNzuCowUZmxSRgYaE6Za0W2u/E7CVXCiI/UOR8aAm1+OSyE3mOUcwyc1zBBeoX1kiKy0Zfxck1Gsyulti11i83QTBF5Kg3pDQThFMVHiPSlK+0cSedng/VaS8bOZbtsBcTcZAR8JP5KeqQ1OYKAi20njdNNRpgnsU//K+JnaXJaGTomr7aYIphoRn9aeShJWKEq9LcozSF7QleEfDI5LYm5bgVkFkRwVDBCVu0DDIkGupo8TZBq+/pMQURYErJQmPKGKjNDkWOLx7Jd5QizdUweIaKrlP7SwJDhZvONjLkOsBBX9UpGxnydhXkfBLQ8IxgojQbLFnJf81JytSljclYYyEFyx0kVBvKWOFJmONpshGAcsduQY5giVNCV51eOdJYo/pLhbvM0uDHSevNKRcrKZIqnCtJeEsO95RoqcgGK4ocZcho1tTYtcZvH41pNQ7vA0WrhIfOSraIIntIAi+NXWCErdbkvrWwjRLrt0NKUdL6KSOscTOdMSOUtBHwL6OLA0vNSdynaWQEnCpIvKaIrJJEbvHkmuNhn6OjM8VkSGSqn1uYJCGHnq9I3aLhNME3t6GjIkO7xrNFumpyTNX/NrwX7CrIRiqqWijI9JO4d1iieykyfiposQIQ8YjjsjlBh6oHWbwRjgYJQn2NgSnNycmJAk3NiXhx44Sxykihxm8ybUwT1OVKySc7vi3OXVkdBJ4AyXBeksDXG0IhgtYY0lY5ahCD0ehborIk5aUWRJviMA7Xt5kyRjonrXENkm8yYqgs8VzgrJmClK20uMM3jRJ0FiQICQF9hdETlLQWRIb5ki6WDfWRPobvO6a4GP5mcOrNzDFELtTkONLh9dXE8xypEg7z8A9jkhrQ6Fhjlg/QVktJXxt4WXzT/03Q8IaQWSqIuEvloQ2mqC9Jfi7wRul4RX3pSPlzpoVlmCtI2jvKHCFhjcM3sN6lqF6HxnKelLjXWbwrpR4xzuCrTUZx2qq9oAh8p6ixCUGr78g8oyjRAtB5CZFwi80VerVpI0h+IeBxa6Zg6kWvpDHaioYYuEsRbDC3eOmC2JvGYLeioxGknL2UATNJN6hmtj1DlpLvDVmocYbrGCVJKOrg4X6DgddLA203BKMFngdJJFtFd7vJLm6KEpc5yjQrkk7M80SGe34X24nSex1Ra5Omgb71JKyg8SrU3i/kARKwWpH0kOGhKkObyfd0ZGjvyXlAkVZ4xRbYJ2irFMkFY1SwyWxr2oo4zlNiV+7zmaweFpT4kR3kaDAFW6xpSqzJay05FtYR4HmZhc9UxKbbfF2V8RG1MBmSaE+kmC6JnaRXK9gsiXhJHl/U0qM0WTcbyhwkYIvFGwjSbjfwhiJt8ZSQU+Bd5+marPMOkVkD0muxYLIfEuhh60x/J92itguihJSEMySVPQnTewnEm+620rTQEMsOfo4/kP/0ARvWjitlpSX7GxBgcMEsd3EEeYWvdytd+Saawi6aCIj1CkGb6Aj9rwhx16Cf3vAwFy5pyLhVonXzy51FDpdEblbkdJbUcEPDEFzQ8qNmhzzLTmmKWKbFCXeEuRabp6rxbvAtLF442QjQ+wEA9eL1xSR7Q0JXzlSHjJ4exq89yR0laScJ/FW6z4a73pFMEfDiRZvuvijIt86RaSFOl01riV2mD1UEvxGk/Geg5aWwGki1zgKPG9J2U8PEg8qYvMsZeytiTRXBMslCU8JSlxi8EabjwUldlDNLfzTUmCgxWsjqWCOHavYAqsknKFIO0yQ61VL5AVFxk6WhEaCAkdJgt9aSkzXlKNX2jEa79waYuc7gq0N3GDJGCBhoiTXUEPsdknCUE1CK0fwsiaylSF2uiDyO4XX3pFhNd7R4itFGc0k/ElBZwWvq+GC6szVeEoS/MZ+qylwpKNKv9Z469UOjqCjwlusicyTxG6VpNxcQ8IncoR4RhLbR+NdpGGmJWOcIzJGUuKPGpQg8rrG21dOMqQssJQ4RxH5jaUqnZuQ0F4Q+cjxLwPtpZbIAk3QTJHQWBE5S1BokoVtDd6lhqr9UpHSUxMcIYl9pojsb8h4SBOsMQcqvOWC2E8EVehqiJ1hrrAEbQxeK0NGZ0Gkq+guSRgniM23bIHVkqwx4hiHd7smaOyglyIyQuM978j4VS08J/A2G1KeMBRo4fBaSNhKUEZfQewVQ/C1I+MgfbEleEzCUw7mKXI0M3hd1EESVji8x5uQ41nxs1q4RMJCCXs7Iq9acpxn22oSDnQ/sJTxsCbHIYZiLyhY05TY0ZLIOQrGaSJDDN4t8pVaIrsqqFdEegtizc1iTew5Q4ayBDMUsQMkXocaYkc0hZua412siZ1rSXlR460zRJ5SlHGe5j801RLMlJTxtaOM3Q1pvxJ45zUlWFD7rsAbpfEm1JHxG0eh8w2R7QQVzBUw28FhFp5QZzq8t2rx2joqulYTWSuJdTYfWwqMFMcovFmSyJPNyLhE4E10pHzYjOC3huArRa571ZsGajQpQx38SBP5pyZB6lMU3khDnp0MBV51BE9o2E+TY5Ml2E8S7C0o6w1xvCZjf0HkVEHCzFoyNmqC+9wdcqN+Tp7jSDheE9ws8Y5V0NJCn2bk2tqSY4okdrEhx1iDN8cSudwepWmAGXKcJXK65H9to8jYQRH7SBF01ESUJdd0TayVInaWhLkOjlXE5irKGOnI6GSWGCJa482zBI9rCr0jyTVcEuzriC1vcr6mwFGSiqy5zMwxBH/TJHwjSPhL8+01kaaSUuMFKTcLEvaUePcrSmwn8DZrgikWb7CGPxkSjhQwrRk57tctmxLsb9sZvL9LSlyuSLlWkqOjwduo8b6Uv1DkmudIeFF2dHCgxVtk8dpIvHpBxhEOdhKk7OLIUSdJ+cSRY57B+0DgGUUlNfpthTfGkauzxrvTsUUaCVhlKeteTXCoJDCa2NOKhOmC4G1H8JBd4OBZReSRGkqcb/CO1PyLJTLB4j1q8JYaIutEjSLX8YKM+a6phdMsdLFUoV5RTm9JSkuDN8WcIon0NZMNZWh1q8C7SJEwV5HxrmnnTrf3KoJBlmCYI2ilSLlfEvlE4011NNgjgthzEua0oKK7JLE7HZHlEl60BLMVFewg4EWNt0ThrVNEVkkiTwpKXSWJzdRENgvKGq4IhjsiezgSFtsfCUq8qki5S1LRQeYQQ4nemmCkImWMw3tFUoUBZk4NOeZYEp4XRKTGa6wJjrWNHBVJR4m3FCnbuD6aak2WsMTh3SZImGCIPKNgsDpVwnsa70K31lCFJZYcwwSMFcQulGTsZuEaSdBXkPGZhu0FsdUO73RHjq8MPGGIfaGIbVTk6iuI3GFgucHrIQkmWSJdBd7BBu+uOryWAhY7+Lki9rK5wtEQzWwvtbqGhIMFwWRJsElsY4m9IIg9L6lCX0VklaPAYkfkZEGDnOWowlBJjtMUkcGK4Lg6EtoZInMUBVYLgn0UsdmCyCz7gIGHFfk+k1QwTh5We7A9x+IdJ6CvIkEagms0hR50eH9UnTQJ+2oiKyVlLFUE+8gBGu8MQ3CppUHesnjTHN4QB/UGPhCTHLFPHMFrCqa73gqObUJGa03wgbhHkrCfpEpzNLE7JDS25FMKhlhKKWKfCgqstLCPu1zBXy0J2ztwjtixBu8UTRn9LVtkmCN2iyFhtME70JHRQ1KVZXqKI/KNIKYMCYs1GUMEKbM1bKOI9LDXC7zbHS+bt+1MTWS9odA9DtrYtpbImQJ2VHh/lisEwaHqUk1kjKTAKknkBEXkbkdMGwq0dnhzLJF3NJH3JVwrqOB4Sca2hti75nmJN0WzxS6UxDYoEpxpa4htVlRjkYE7DZGzJVU72uC9IyhQL4i8YfGWSYLLNcHXloyz7QhNifmKSE9JgfGmuyLhc403Xm9vqcp6gXe3xuuv8F6VJNxkyTHEkHG2g0aKXL0MsXc1bGfgas2//dCONXiNLCX+5mB7eZIl1kHh7ajwpikyzlUUWOVOsjSQlsS+M0R+pPje/dzBXRZGO0rMtgQrLLG9VSu9n6CMXS3BhwYmSoIBhsjNBmZbgusE9BCPCP5triU4VhNbJfE+swSP27aayE8tuTpYYjtrYjMVGZdp2NpS1s6aBnKSHDsbKuplKbHM4a0wMFd/5/DmGyKrJSUaW4IBrqUhx0vyfzTBBLPIUcnZdrAkNsKR0sWRspumSns6Ch0v/qqIbBYUWKvPU/CFoyrDJGwSNFhbA/MlzKqjrO80hRbpKx0Jewsi/STftwGSlKc1JZyAzx05dhLEdnfQvhZOqiHWWEAHC7+30FuRcZUgaO5gpaIK+xsiHRUsqaPElTV40xQZQ107Q9BZE1nryDVGU9ZSQ47bmhBpLcYpUt7S+xuK/FiT8qKjwXYw5ypS2iuCv7q1gtgjhuBuB8LCFY5cUuCNtsQOFcT+4Ih9JX+k8Ea6v0iCIRZOtCT0Et00JW5UeC85Cg0ScK0k411HcG1zKtre3SeITBRk7WfwDhEvaYLTHP9le0m8By0JDwn4TlLW/aJOvGHxdjYUes+ScZigCkYQdNdEOhkiezgShqkx8ueKjI8lDfK2oNiOFvrZH1hS+tk7NV7nOmLHicGWEgubkXKdwdtZknCLJXaCpkrjZBtLZFsDP9CdxWsSr05Sxl6CMmoFbCOgryX40uDtamB7SVmXW4Ihlgpmq+00tBKUUa83WbjLUNkzDmY7cow1JDygyPGlhgGKYKz4vcV7QBNbJIgM11TUqZaMdwTeSguH6rOaw1JRKzaaGyxVm2EJ/uCIrVWUcZUkcp2grMsEjK+DMwS59jQk3Kd6SEq1d0S6uVmO4Bc1lDXTUcHjluCXEq+1OlBDj1pi9zgiXxnKuE0SqTXwhqbETW6RggMEnGl/q49UT2iCzgJvRwVXS2K/d6+ZkyUl7jawSVLit46EwxVljDZwoSQ20sDBihztHfk2yA8NVZghiXwrYHQdfKAOtzsayjhY9bY0yE2CWEeJ9xfzO423xhL5syS2TFJofO2pboHob0nY4GiAgRrvGQEDa/FWSsoaaYl0syRsEt3kWoH3B01shCXhTUWe9w3Bt44SC9QCh3eShQctwbaK2ApLroGCMlZrYqvlY3qYhM0aXpFkPOuoqJ3Dm6fxXrGwVF9gCWZagjPqznfkuMKQ8DPTQRO8ZqG1hPGKEm9IgpGW4DZDgTNriTxvFiq+Lz+0cKfp4wj6OCK9JSnzNSn9LFU7UhKZZMnYwcJ8s8yRsECScK4j5UOB95HFO0CzhY4xJxuCix0lDlEUeMdS6EZBkTsUkZ4K74dugyTXS7aNgL8aqjDfkCE0ZbwkCXpaWCKhl8P7VD5jxykivSyxyZrYERbe168LYu9ZYh86IkscgVLE7tWPKmJv11CgoyJltMEbrohtVAQfO4ImltiHEroYEs7RxAarVpY8AwXMcMReFOTYWe5iiLRQxJ5Q8DtJ8LQhWOhIeFESPGsILhbNDRljNbHzNRlTFbk2S3L0NOS6V1KFJYKUbSTcIIhM0wQ/s2TM0SRMNcQmSap3jCH4yhJZKSkwyRHpYYgsFeQ4U7xoCB7VVOExhXepo9ABBsYbvGWKXPME3lyH95YioZ0gssQRWWbI+FaSMkXijZXwgiTlYdPdkNLaETxlyDVIwqeaEus0aTcYcg0RVOkpR3CSJqIddK+90JCxzsDVloyrFd5ZAr4TBKfaWa6boEA7C7s6EpYaeFPjveooY72mjIccLHJ9HUwVlDhKkmutJDJBwnp1rvulJZggKDRfbXAkvC/4l3ozQOG9a8lxjx0i7nV4jSXc7vhe3OwIxjgSHjdEhhsif9YkPGlus3iLFDnWOFhtCZbJg0UbQcIaR67JjthoCyMEZRwhiXWyxO5QxI6w5NhT4U1WsJvDO60J34fW9hwzwlKij6ZAW9ne4L0s8C6XeBMEkd/LQy1VucBRot6QMlbivaBhoBgjqGiCJNhsqVp/S2SsG6DIONCR0dXhvWbJ+MRRZJkkuEjgDXJjFQW6SSL7GXK8Z2CZg7cVsbWGoKmEpzQ5elpiy8Ryg7dMkLLUEauzeO86CuwlSOlgYLojZWeJ9xM3S1PWfEfKl5ISLQ0MEKR8YOB2QfCxJBjrKPCN4f9MkaSsqoVXJBmP7EpFZ9UQfOoOFwSzBN4MQ8LsGrymlipcJQhmy0GaQjPqCHaXRwuCZwRbqK2Fg9wlClZqYicrIgMdZfxTQ0c7TBIbrChxmuzoKG8XRaSrIhhiyNFJkrC7oIAWMEOQa5aBekPCRknCo4IKPrYkvCDI8aYmY7WFtprgekcJZ3oLIqssCSMtFbQTJKwXYy3BY5oCh2iKPCpJOE+zRdpYgi6O2KmOAgvVCYaU4ySRek1sgyFhJ403QFHiVEmJHwtybO1gs8Hr5+BETQX3War0qZngYGgtVZtoqd6vFSk/UwdZElYqyjrF4HXUeFspIi9IGKf4j92pKGAdCYMVsbcV3kRF0N+R8LUd5PCsIGWoxDtBkCI0nKofdJQxT+LtZflvuc8Q3CjwWkq8KwUpHzkK/NmSsclCL0nseQdj5FRH5CNHSgtLiW80Of5HU9Hhlsga9bnBq3fEVltKfO5IaSTmGjjc4J0otcP7QsJUSQM8pEj5/wCuUuC2DWz8AAAAAElFTkSuQmCC\");\
+}\
+\
+.ace-ambiance .ace_indent-guide {\
+ background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNQUFD4z6Crq/sfAAuYAuYl+7lfAAAAAElFTkSuQmCC\") right repeat-y;\
+}";
+
+var dom = require("../lib/dom");
+dom.importCssString(exports.cssText, exports.cssClass);
+
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/theme-chrome.js b/vendor/assets/javascripts/ace-src-noconflict/theme-chrome.js
new file mode 100644
index 00000000000..dbbe865f78e
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/theme-chrome.js
@@ -0,0 +1,205 @@
+/* ***** 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 ***** */
+
+ace.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_editor {\
+ border: 2px solid rgb(159, 159, 159);\
+}\
+\
+.ace-chrome .ace_editor.ace_focus {\
+ border: 2px solid #327fbd;\
+}\
+\
+.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_cursor.ace_overwrite {\
+ border-left: 0px;\
+ border-bottom: 1px solid black;\
+}\
+\
+.ace-chrome .ace_line .ace_invisible {\
+ color: rgb(191, 191, 191);\
+}\
+\
+.ace-chrome .ace_line .ace_constant.ace_buildin {\
+ color: rgb(88, 72, 246);\
+}\
+\
+.ace-chrome .ace_line .ace_constant.ace_language {\
+ color: rgb(88, 92, 246);\
+}\
+\
+.ace-chrome .ace_line .ace_constant.ace_library {\
+ color: rgb(6, 150, 14);\
+}\
+\
+.ace-chrome .ace_line .ace_invalid {\
+ background-color: rgb(153, 0, 0);\
+ color: white;\
+}\
+\
+.ace-chrome .ace_line .ace_fold {\
+}\
+\
+.ace-chrome .ace_line .ace_support.ace_function {\
+ color: rgb(60, 76, 114);\
+}\
+\
+.ace-chrome .ace_line .ace_support.ace_constant {\
+ color: rgb(6, 150, 14);\
+}\
+\
+.ace-chrome .ace_line .ace_support.ace_type,\
+.ace-chrome .ace_line .ace_support.ace_class\
+.ace-chrome .ace_line .ace_support.ace_other, {\
+ color: rgb(109, 121, 222);\
+}\
+\
+.ace-chrome .ace_variable.ace_parameter {\
+ font-style:italic;\
+ color:#FD971F;\
+}\
+.ace-chrome .ace_line .ace_keyword.ace_operator {\
+ color: rgb(104, 118, 135);\
+}\
+\
+.ace-chrome .ace_line .ace_comment {\
+ color: #236e24;\
+}\
+\
+.ace-chrome .ace_line .ace_comment.ace_doc {\
+ color: #236e24;\
+}\
+\
+.ace-chrome .ace_line .ace_comment.ace_doc.ace_tag {\
+ color: #236e24;\
+}\
+\
+.ace-chrome .ace_line .ace_constant.ace_numeric {\
+ color: rgb(0, 0, 205);\
+}\
+\
+.ace-chrome .ace_line .ace_variable {\
+ color: rgb(49, 132, 149);\
+}\
+\
+.ace-chrome .ace_line .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_line .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_line .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/vendor/assets/javascripts/ace-src-noconflict/theme-clouds.js b/vendor/assets/javascripts/ace-src-noconflict/theme-clouds.js
new file mode 100644
index 00000000000..b6d474907da
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/theme-clouds.js
@@ -0,0 +1,170 @@
+/* ***** 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 ***** */
+
+ace.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_editor {\
+ border: 2px solid rgb(159, 159, 159)\
+}\
+\
+.ace-clouds .ace_editor.ace_focus {\
+ border: 2px solid #327fbd\
+}\
+\
+.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_cursor.ace_overwrite {\
+ border-left: 0px;\
+ border-bottom: 1px solid #000000\
+}\
+\
+.ace-clouds .ace_marker-layer .ace_selection {\
+ background: #BDD5FC\
+}\
+\
+.ace-clouds.multiselect .ace_selection.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/vendor/assets/javascripts/ace-src-noconflict/theme-clouds_midnight.js b/vendor/assets/javascripts/ace-src-noconflict/theme-clouds_midnight.js
new file mode 100644
index 00000000000..57501d91d02
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/theme-clouds_midnight.js
@@ -0,0 +1,171 @@
+/* ***** 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 ***** */
+
+ace.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_editor {\
+ border: 2px solid rgb(159, 159, 159)\
+}\
+\
+.ace-clouds-midnight .ace_editor.ace_focus {\
+ border: 2px solid #327fbd\
+}\
+\
+.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_cursor.ace_overwrite {\
+ border-left: 0px;\
+ border-bottom: 1px solid #7DA5DC\
+}\
+\
+.ace-clouds-midnight .ace_marker-layer .ace_selection {\
+ background: #000000\
+}\
+\
+.ace-clouds-midnight.multiselect .ace_selection.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/vendor/assets/javascripts/ace-src-noconflict/theme-cobalt.js b/vendor/assets/javascripts/ace-src-noconflict/theme-cobalt.js
new file mode 100644
index 00000000000..d0c8d24ece3
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/theme-cobalt.js
@@ -0,0 +1,182 @@
+/* ***** 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 ***** */
+
+ace.define('ace/theme/cobalt', ['require', 'exports', 'module', 'ace/lib/dom'], function(require, exports, module) {
+
+exports.isDark = true;
+exports.cssClass = "ace-cobalt";
+exports.cssText = ".ace-cobalt .ace_editor {\
+ border: 2px solid rgb(159, 159, 159)\
+}\
+\
+.ace-cobalt .ace_editor.ace_focus {\
+ border: 2px solid #327fbd\
+}\
+\
+.ace-cobalt .ace_gutter {\
+ background: #011e3a;\
+ color: #fff\
+}\
+\
+.ace-cobalt .ace_print_margin {\
+ width: 1px;\
+ background: #011e3a\
+}\
+\
+.ace-cobalt .ace_scroller {\
+ background-color: #002240\
+}\
+\
+.ace-cobalt .ace_text-layer {\
+ color: #FFFFFF\
+}\
+\
+.ace-cobalt .ace_cursor {\
+ border-left: 2px solid #FFFFFF\
+}\
+\
+.ace-cobalt .ace_cursor.ace_overwrite {\
+ border-left: 0px;\
+ border-bottom: 1px solid #FFFFFF\
+}\
+\
+.ace-cobalt .ace_marker-layer .ace_selection {\
+ background: rgba(179, 101, 57, 0.75)\
+}\
+\
+.ace-cobalt.multiselect .ace_selection.start {\
+ box-shadow: 0 0 3px 0px #002240;\
+ border-radius: 2px\
+}\
+\
+.ace-cobalt .ace_marker-layer .ace_step {\
+ background: rgb(127, 111, 19)\
+}\
+\
+.ace-cobalt .ace_marker-layer .ace_bracket {\
+ margin: -1px 0 0 -1px;\
+ border: 1px solid rgba(255, 255, 255, 0.15)\
+}\
+\
+.ace-cobalt .ace_marker-layer .ace_active_line {\
+ background: rgba(0, 0, 0, 0.35)\
+}\
+\
+.ace-cobalt .ace_gutter_active_line {\
+ background-color: rgba(0, 0, 0, 0.35)\
+}\
+\
+.ace-cobalt .ace_marker-layer .ace_selected_word {\
+ border: 1px solid rgba(179, 101, 57, 0.75)\
+}\
+\
+.ace-cobalt .ace_invisible {\
+ color: rgba(255, 255, 255, 0.15)\
+}\
+\
+.ace-cobalt .ace_keyword,\
+.ace-cobalt .ace_meta {\
+ color: #FF9D00\
+}\
+\
+.ace-cobalt .ace_constant,\
+.ace-cobalt .ace_constant.ace_character,\
+.ace-cobalt .ace_constant.ace_character.ace_escape,\
+.ace-cobalt .ace_constant.ace_other {\
+ color: #FF628C\
+}\
+\
+.ace-cobalt .ace_invalid {\
+ color: #F8F8F8;\
+ background-color: #800F00\
+}\
+\
+.ace-cobalt .ace_support {\
+ color: #80FFBB\
+}\
+\
+.ace-cobalt .ace_support.ace_constant {\
+ color: #EB939A\
+}\
+\
+.ace-cobalt .ace_fold {\
+ background-color: #FF9D00;\
+ border-color: #FFFFFF\
+}\
+\
+.ace-cobalt .ace_support.ace_function {\
+ color: #FFB054\
+}\
+\
+.ace-cobalt .ace_storage {\
+ color: #FFEE80\
+}\
+\
+.ace-cobalt .ace_string.ace_regexp {\
+ color: #80FFC2\
+}\
+\
+.ace-cobalt .ace_comment {\
+ font-style: italic;\
+ color: #0088FF\
+}\
+\
+.ace-cobalt .ace_variable {\
+ color: #CCCCCC\
+}\
+\
+.ace-cobalt .ace_variable.ace_language {\
+ color: #FF80E1\
+}\
+\
+.ace-cobalt .ace_meta.ace_tag {\
+ color: #9EFFFF\
+}\
+\
+.ace-cobalt .ace_markup.ace_underline {\
+ text-decoration: underline\
+}\
+\
+.ace-cobalt .ace_markup.ace_heading {\
+ color: #C8E4FD;\
+ background-color: #001221\
+}\
+\
+.ace-cobalt .ace_markup.ace_list {\
+ background-color: #130D26\
+}\
+\
+.ace-cobalt .ace_indent-guide {\
+ background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgUHL4zzBz5sz/AA80BCzv+WXhAAAAAElFTkSuQmCC) right repeat-y\
+}";
+
+var dom = require("../lib/dom");
+dom.importCssString(exports.cssText, exports.cssClass);
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/theme-crimson_editor.js b/vendor/assets/javascripts/ace-src-noconflict/theme-crimson_editor.js
new file mode 100644
index 00000000000..38230ae8cce
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/theme-crimson_editor.js
@@ -0,0 +1,197 @@
+/* ***** 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 ***** */
+
+ace.define('ace/theme/crimson_editor', ['require', 'exports', 'module', 'ace/lib/dom'], function(require, exports, module) {
+exports.isDark = false;
+exports.cssText = ".ace-crimson-editor .ace_editor {\
+ border: 2px solid rgb(159, 159, 159);\
+}\
+\
+.ace-crimson-editor .ace_editor.ace_focus {\
+ border: 2px solid #327fbd;\
+}\
+\
+.ace-crimson-editor .ace_gutter {\
+ background: #ebebeb;\
+ color: #333;\
+ overflow : hidden;\
+}\
+\
+.ace-crimson-editor .ace_gutter-layer {\
+ width: 100%;\
+ text-align: right;\
+}\
+\
+.ace-crimson-editor .ace_print_margin {\
+ width: 1px;\
+ background: #e8e8e8;\
+}\
+\
+.ace-crimson-editor .ace_scroller {\
+ background-color: #FFFFFF;\
+}\
+\
+.ace-crimson-editor .ace_text-layer {\
+ color: rgb(64, 64, 64);\
+}\
+\
+.ace-crimson-editor .ace_cursor {\
+ border-left: 2px solid black;\
+}\
+\
+.ace-crimson-editor .ace_cursor.ace_overwrite {\
+ border-left: 0px;\
+ border-bottom: 1px solid black;\
+}\
+\
+.ace-crimson-editor .ace_line .ace_invisible {\
+ color: rgb(191, 191, 191);\
+}\
+\
+.ace-crimson-editor .ace_line .ace_identifier {\
+ color: black;\
+}\
+\
+.ace-crimson-editor .ace_line .ace_keyword {\
+ color: blue;\
+}\
+\
+.ace-crimson-editor .ace_line .ace_constant.ace_buildin {\
+ color: rgb(88, 72, 246);\
+}\
+\
+.ace-crimson-editor .ace_line .ace_constant.ace_language {\
+ color: rgb(255, 156, 0);\
+}\
+\
+.ace-crimson-editor .ace_line .ace_constant.ace_library {\
+ color: rgb(6, 150, 14);\
+}\
+\
+.ace-crimson-editor .ace_line .ace_invalid {\
+ text-decoration: line-through;\
+ color: rgb(224, 0, 0);\
+}\
+\
+.ace-crimson-editor .ace_line .ace_fold {\
+}\
+\
+.ace-crimson-editor .ace_line .ace_support.ace_function {\
+ color: rgb(192, 0, 0);\
+}\
+\
+.ace-crimson-editor .ace_line .ace_support.ace_constant {\
+ color: rgb(6, 150, 14);\
+}\
+\
+.ace-crimson-editor .ace_line .ace_support.ace_type,\
+.ace-crimson-editor .ace_line .ace_support.ace_class {\
+ color: rgb(109, 121, 222);\
+}\
+\
+.ace-crimson-editor .ace_line .ace_keyword.ace_operator {\
+ color: rgb(49, 132, 149);\
+}\
+\
+.ace-crimson-editor .ace_line .ace_string {\
+ color: rgb(128, 0, 128);\
+}\
+\
+.ace-crimson-editor .ace_line .ace_comment {\
+ color: rgb(76, 136, 107);\
+}\
+\
+.ace-crimson-editor .ace_line .ace_comment.ace_doc {\
+ color: rgb(0, 102, 255);\
+}\
+\
+.ace-crimson-editor .ace_line .ace_comment.ace_doc.ace_tag {\
+ color: rgb(128, 159, 191);\
+}\
+\
+.ace-crimson-editor .ace_line .ace_constant.ace_numeric {\
+ color: rgb(0, 0, 64);\
+}\
+\
+.ace-crimson-editor .ace_line .ace_variable {\
+ color: rgb(0, 64, 128);\
+}\
+\
+.ace-crimson-editor .ace_line .ace_xml_pe {\
+ color: rgb(104, 104, 91);\
+}\
+\
+.ace-crimson-editor .ace_marker-layer .ace_selection {\
+ background: rgb(181, 213, 255);\
+}\
+\
+.ace-crimson-editor .ace_marker-layer .ace_step {\
+ background: rgb(252, 255, 0);\
+}\
+\
+.ace-crimson-editor .ace_marker-layer .ace_stack {\
+ background: rgb(164, 229, 101);\
+}\
+\
+.ace-crimson-editor .ace_marker-layer .ace_bracket {\
+ margin: -1px 0 0 -1px;\
+ border: 1px solid rgb(192, 192, 192);\
+}\
+\
+.ace-crimson-editor .ace_marker-layer .ace_active_line {\
+ background: rgb(232, 242, 254);\
+}\
+\
+.ace-crimson-editor .ace_gutter_active_line {\
+ background-color : #dcdcdc;\
+}\
+\
+.ace-crimson-editor .ace_meta.ace_tag {\
+ color:rgb(28, 2, 255);\
+}\
+\
+.ace-crimson-editor .ace_marker-layer .ace_selected_word {\
+ background: rgb(250, 250, 255);\
+ border: 1px solid rgb(200, 200, 250);\
+}\
+\
+.ace-crimson-editor .ace_string.ace_regex {\
+ color: rgb(192, 0, 192);\
+}\
+\
+.ace-crimson-editor .ace_indent-guide {\
+ background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==\") right repeat-y;\
+}";
+
+exports.cssClass = "ace-crimson-editor";
+
+var dom = require("../lib/dom");
+dom.importCssString(exports.cssText, exports.cssClass);
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/theme-dawn.js b/vendor/assets/javascripts/ace-src-noconflict/theme-dawn.js
new file mode 100644
index 00000000000..8ac1239a584
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/theme-dawn.js
@@ -0,0 +1,183 @@
+/* ***** 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 ***** */
+
+ace.define('ace/theme/dawn', ['require', 'exports', 'module', 'ace/lib/dom'], function(require, exports, module) {
+
+exports.isDark = false;
+exports.cssClass = "ace-dawn";
+exports.cssText = ".ace-dawn .ace_editor {\
+ border: 2px solid rgb(159, 159, 159)\
+}\
+\
+.ace-dawn .ace_editor.ace_focus {\
+ border: 2px solid #327fbd\
+}\
+\
+.ace-dawn .ace_gutter {\
+ background: #ebebeb;\
+ color: #333\
+}\
+\
+.ace-dawn .ace_print_margin {\
+ width: 1px;\
+ background: #e8e8e8\
+}\
+\
+.ace-dawn .ace_scroller {\
+ background-color: #F9F9F9\
+}\
+\
+.ace-dawn .ace_text-layer {\
+ color: #080808\
+}\
+\
+.ace-dawn .ace_cursor {\
+ border-left: 2px solid #000000\
+}\
+\
+.ace-dawn .ace_cursor.ace_overwrite {\
+ border-left: 0px;\
+ border-bottom: 1px solid #000000\
+}\
+\
+.ace-dawn .ace_marker-layer .ace_selection {\
+ background: rgba(39, 95, 255, 0.30)\
+}\
+\
+.ace-dawn.multiselect .ace_selection.start {\
+ box-shadow: 0 0 3px 0px #F9F9F9;\
+ border-radius: 2px\
+}\
+\
+.ace-dawn .ace_marker-layer .ace_step {\
+ background: rgb(255, 255, 0)\
+}\
+\
+.ace-dawn .ace_marker-layer .ace_bracket {\
+ margin: -1px 0 0 -1px;\
+ border: 1px solid rgba(75, 75, 126, 0.50)\
+}\
+\
+.ace-dawn .ace_marker-layer .ace_active_line {\
+ background: rgba(36, 99, 180, 0.12)\
+}\
+\
+.ace-dawn .ace_gutter_active_line {\
+ background-color : #dcdcdc\
+}\
+\
+.ace-dawn .ace_marker-layer .ace_selected_word {\
+ border: 1px solid rgba(39, 95, 255, 0.30)\
+}\
+\
+.ace-dawn .ace_invisible {\
+ color: rgba(75, 75, 126, 0.50)\
+}\
+\
+.ace-dawn .ace_keyword,\
+.ace-dawn .ace_meta {\
+ color: #794938\
+}\
+\
+.ace-dawn .ace_constant,\
+.ace-dawn .ace_constant.ace_character,\
+.ace-dawn .ace_constant.ace_character.ace_escape,\
+.ace-dawn .ace_constant.ace_other {\
+ color: #811F24\
+}\
+\
+.ace-dawn .ace_invalid.ace_illegal {\
+ text-decoration: underline;\
+ font-style: italic;\
+ color: #F8F8F8;\
+ background-color: #B52A1D\
+}\
+\
+.ace-dawn .ace_invalid.ace_deprecated {\
+ text-decoration: underline;\
+ font-style: italic;\
+ color: #B52A1D\
+}\
+\
+.ace-dawn .ace_support {\
+ color: #691C97\
+}\
+\
+.ace-dawn .ace_support.ace_constant {\
+ color: #B4371F\
+}\
+\
+.ace-dawn .ace_fold {\
+ background-color: #794938;\
+ border-color: #080808\
+}\
+\
+.ace-dawn .ace_markup.ace_list,\
+.ace-dawn .ace_support.ace_function {\
+ color: #693A17\
+}\
+\
+.ace-dawn .ace_storage {\
+ font-style: italic;\
+ color: #A71D5D\
+}\
+\
+.ace-dawn .ace_string {\
+ color: #0B6125\
+}\
+\
+.ace-dawn .ace_string.ace_regexp {\
+ color: #CF5628\
+}\
+\
+.ace-dawn .ace_comment {\
+ font-style: italic;\
+ color: #5A525F\
+}\
+\
+.ace-dawn .ace_variable {\
+ color: #234A97\
+}\
+\
+.ace-dawn .ace_markup.ace_underline {\
+ text-decoration: underline\
+}\
+\
+.ace-dawn .ace_markup.ace_heading {\
+ color: #19356D\
+}\
+\
+.ace-dawn .ace_indent-guide {\
+ background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4+fPnf4ZVq1b9BwAkVQboFQv98gAAAABJRU5ErkJggg==) right repeat-y\
+}";
+
+var dom = require("../lib/dom");
+dom.importCssString(exports.cssText, exports.cssClass);
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/theme-dreamweaver.js b/vendor/assets/javascripts/ace-src-noconflict/theme-dreamweaver.js
new file mode 100644
index 00000000000..315df6b30af
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/theme-dreamweaver.js
@@ -0,0 +1,224 @@
+/* ***** 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 ***** */
+
+ace.define('ace/theme/dreamweaver', ['require', 'exports', 'module', 'ace/lib/dom'], function(require, exports, module) {
+exports.isDark = false;
+exports.cssClass = "ace-dreamweaver";
+exports.cssText = ".ace-dreamweaver .ace_editor {\
+ border: 2px solid rgb(159, 159, 159);\
+}\
+\
+.ace-dreamweaver .ace_editor.ace_focus {\
+ border: 2px solid #327fbd;\
+}\
+\
+.ace-dreamweaver .ace_gutter {\
+ background: #e8e8e8;\
+ color: #333;\
+}\
+\
+.ace-dreamweaver .ace_print_margin {\
+ width: 1px;\
+ background: #e8e8e8;\
+}\
+\
+.ace-dreamweaver .ace_scroller {\
+ background-color: #FFFFFF;\
+}\
+\
+.ace-dreamweaver .ace_fold {\
+ background-color: #757AD8;\
+}\
+\
+.ace-dreamweaver .ace_text-layer {\
+}\
+\
+.ace-dreamweaver .ace_cursor {\
+ border-left: 2px solid black;\
+}\
+\
+.ace-dreamweaver .ace_cursor.ace_overwrite {\
+ border-left: 0px;\
+ border-bottom: 1px solid black;\
+}\
+ \
+.ace-dreamweaver .ace_line .ace_invisible {\
+ color: rgb(191, 191, 191);\
+}\
+\
+.ace-dreamweaver .ace_line .ace_storage,\
+.ace-dreamweaver .ace_line .ace_keyword {\
+ color: blue;\
+}\
+\
+.ace-dreamweaver .ace_line .ace_constant.ace_buildin {\
+ color: rgb(88, 72, 246);\
+}\
+\
+.ace-dreamweaver .ace_line .ace_constant.ace_language {\
+ color: rgb(88, 92, 246);\
+}\
+\
+.ace-dreamweaver .ace_line .ace_constant.ace_library {\
+ color: rgb(6, 150, 14);\
+}\
+\
+.ace-dreamweaver .ace_line .ace_invalid {\
+ background-color: rgb(153, 0, 0);\
+ color: white;\
+}\
+\
+.ace-dreamweaver .ace_line .ace_support.ace_function {\
+ color: rgb(60, 76, 114);\
+}\
+\
+.ace-dreamweaver .ace_line .ace_support.ace_constant {\
+ color: rgb(6, 150, 14);\
+}\
+\
+.ace-dreamweaver .ace_line .ace_support.ace_type,\
+.ace-dreamweaver .ace_line .ace_support.ace_class {\
+ color: #009;\
+}\
+\
+.ace-dreamweaver .ace_line .ace_support.ace_php_tag {\
+ color: #f00;\
+}\
+\
+.ace-dreamweaver .ace_line .ace_keyword.ace_operator {\
+ color: rgb(104, 118, 135);\
+}\
+\
+.ace-dreamweaver .ace_line .ace_string {\
+ color: #00F;\
+}\
+\
+.ace-dreamweaver .ace_line .ace_comment {\
+ color: rgb(76, 136, 107);\
+}\
+\
+.ace-dreamweaver .ace_line .ace_comment.ace_doc {\
+ color: rgb(0, 102, 255);\
+}\
+\
+.ace-dreamweaver .ace_line .ace_comment.ace_doc.ace_tag {\
+ color: rgb(128, 159, 191);\
+}\
+\
+.ace-dreamweaver .ace_line .ace_constant.ace_numeric {\
+ color: rgb(0, 0, 205);\
+}\
+\
+.ace-dreamweaver .ace_line .ace_variable {\
+ color: #06F\
+}\
+\
+.ace-dreamweaver .ace_line .ace_xml_pe {\
+ color: rgb(104, 104, 91);\
+}\
+\
+.ace-dreamweaver .ace_entity.ace_name.ace_function {\
+ color: #00F;\
+}\
+\
+\
+.ace-dreamweaver .ace_markup.ace_heading {\
+ color: rgb(12, 7, 255);\
+}\
+\
+.ace-dreamweaver .ace_markup.ace_list {\
+ color:rgb(185, 6, 144);\
+}\
+\
+.ace-dreamweaver .ace_marker-layer .ace_selection {\
+ background: rgb(181, 213, 255);\
+}\
+\
+.ace-dreamweaver .ace_marker-layer .ace_step {\
+ background: rgb(252, 255, 0);\
+}\
+\
+.ace-dreamweaver .ace_marker-layer .ace_stack {\
+ background: rgb(164, 229, 101);\
+}\
+\
+.ace-dreamweaver .ace_marker-layer .ace_bracket {\
+ margin: -1px 0 0 -1px;\
+ border: 1px solid rgb(192, 192, 192);\
+}\
+\
+.ace-dreamweaver .ace_marker-layer .ace_active_line {\
+ background: rgba(0, 0, 0, 0.07);\
+}\
+\
+.ace-dreamweaver .ace_marker-layer .ace_selected_word {\
+ background: rgb(250, 250, 255);\
+ border: 1px solid rgb(200, 200, 250);\
+}\
+\
+.ace-dreamweaver .ace_meta.ace_tag {\
+ color:#009;\
+}\
+\
+.ace-dreamweaver .ace_meta.ace_tag.ace_anchor {\
+ color:#060;\
+}\
+\
+.ace-dreamweaver .ace_meta.ace_tag.ace_form {\
+ color:#F90;\
+}\
+\
+.ace-dreamweaver .ace_meta.ace_tag.ace_image {\
+ color:#909;\
+}\
+\
+.ace-dreamweaver .ace_meta.ace_tag.ace_script {\
+ color:#900;\
+}\
+\
+.ace-dreamweaver .ace_meta.ace_tag.ace_style {\
+ color:#909;\
+}\
+\
+.ace-dreamweaver .ace_meta.ace_tag.ace_table {\
+ color:#099;\
+}\
+\
+.ace-dreamweaver .ace_string.ace_regex {\
+ color: rgb(255, 0, 0)\
+}\
+\
+.ace-dreamweaver .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/vendor/assets/javascripts/ace-src-noconflict/theme-eclipse.js b/vendor/assets/javascripts/ace-src-noconflict/theme-eclipse.js
new file mode 100644
index 00000000000..a26af55ee84
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/theme-eclipse.js
@@ -0,0 +1,154 @@
+/* ***** 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 ***** */
+
+ace.define('ace/theme/eclipse', ['require', 'exports', 'module', 'ace/lib/dom'], function(require, exports, module) {
+
+
+exports.isDark = false;
+exports.cssText = ".ace-eclipse .ace_editor {\
+ border: 2px solid rgb(159, 159, 159);\
+}\
+\
+.ace-eclipse .ace_editor.ace_focus {\
+ border: 2px solid #327fbd;\
+}\
+\
+.ace-eclipse .ace_gutter {\
+ background: #ebebeb;\
+ border-right: 1px solid rgb(159, 159, 159);\
+ color: rgb(136, 136, 136);\
+}\
+\
+.ace-eclipse .ace_print_margin {\
+ width: 1px;\
+ background: #ebebeb;\
+}\
+\
+.ace-eclipse .ace_scroller {\
+ background-color: #FFFFFF;\
+}\
+\
+.ace-eclipse .ace_fold {\
+ background-color: rgb(60, 76, 114);\
+}\
+\
+.ace-eclipse .ace_text-layer {\
+}\
+\
+.ace-eclipse .ace_cursor {\
+ border-left: 2px solid black;\
+}\
+\
+.ace-eclipse .ace_line .ace_storage,\
+.ace-eclipse .ace_line .ace_keyword,\
+.ace-eclipse .ace_line .ace_variable {\
+ color: rgb(127, 0, 85);\
+}\
+\
+.ace-eclipse .ace_line .ace_constant.ace_buildin {\
+ color: rgb(88, 72, 246);\
+}\
+\
+.ace-eclipse .ace_line .ace_constant.ace_library {\
+ color: rgb(6, 150, 14);\
+}\
+\
+.ace-eclipse .ace_line .ace_function {\
+ color: rgb(60, 76, 114);\
+}\
+\
+.ace-eclipse .ace_line .ace_string {\
+ color: rgb(42, 0, 255);\
+}\
+\
+.ace-eclipse .ace_line .ace_comment {\
+ color: rgb(63, 127, 95);\
+}\
+\
+.ace-eclipse .ace_line .ace_comment.ace_doc {\
+ color: rgb(63, 95, 191);\
+}\
+\
+.ace-eclipse .ace_line .ace_comment.ace_doc.ace_tag {\
+ color: rgb(127, 159, 191);\
+}\
+\
+.ace-eclipse .ace_line .ace_constant.ace_numeric {\
+}\
+\
+.ace-eclipse .ace_line .ace_tag {\
+ color: rgb(63, 127, 127);\
+}\
+\
+.ace-eclipse .ace_line .ace_type {\
+ color: rgb(127, 0, 127);\
+}\
+\
+.ace-eclipse .ace_line .ace_xml_pe {\
+ color: rgb(104, 104, 91);\
+}\
+\
+.ace-eclipse .ace_marker-layer .ace_selection {\
+ background: rgb(181, 213, 255);\
+}\
+\
+.ace-eclipse .ace_marker-layer .ace_bracket {\
+ margin: -1px 0 0 -1px;\
+ border: 1px solid rgb(192, 192, 192);\
+}\
+\
+.ace-eclipse .ace_line .ace_meta.ace_tag {\
+ color:rgb(63, 127, 127);\
+}\
+\
+.ace-eclipse .ace_entity.ace_other.ace_attribute-name {\
+ color:rgb(127, 0, 127);\
+}\
+.ace-eclipse .ace_marker-layer .ace_step {\
+ background: rgb(255, 255, 0);\
+}\
+\
+.ace-eclipse .ace_marker-layer .ace_active_line {\
+ background: rgb(232, 242, 254);\
+}\
+\
+.ace-eclipse .ace_marker-layer .ace_selected_word {\
+ border: 1px solid rgb(181, 213, 255);\
+}\
+\
+.ace-eclipse .ace_indent-guide {\
+ background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==\") right repeat-y;\
+}";
+
+exports.cssClass = "ace-eclipse";
+
+var dom = require("../lib/dom");
+dom.importCssString(exports.cssText, exports.cssClass);
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/theme-github.js b/vendor/assets/javascripts/ace-src-noconflict/theme-github.js
new file mode 100644
index 00000000000..7aacdf1a696
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/theme-github.js
@@ -0,0 +1,175 @@
+/* ***** 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 ***** */
+
+ace.define('ace/theme/github', ['require', 'exports', 'module', 'ace/lib/dom'], function(require, exports, module) {
+
+exports.isDark = false;
+exports.cssClass = "ace-github";
+exports.cssText = "/* CSS style content from github's default pygments highlighter template.\
+ Cursor and selection styles from textmate.css. */\
+.ace-github .ace_editor {\
+ color: #333;\
+ background-color: #F8F8F8;\
+ border: 1px solid #CCC;\
+ font: 13px 'Bitstream Vera Sans Mono', Courier, monospace !important;\
+ line-height: 19px !important;\
+ overflow: auto;\
+ padding: 6px 10px;\
+ border-radius: 3px;\
+ position: relative;\
+ margin-bottom: 15px;\
+}\
+\
+.ace-github .ace_gutter {\
+ background: #e8e8e8;\
+ color: #AAA;\
+}\
+\
+.ace-github .ace_scroller {\
+ background: #fff;\
+}\
+\
+.ace-github .ace_keyword {\
+ font-weight: bold;\
+}\
+\
+.ace-github .ace_string {\
+ color: #D14;\
+}\
+\
+.ace-github .ace_variable.ace_class {\
+ color: teal;\
+}\
+\
+.ace-github .ace_constant.ace_numeric {\
+ color: #099;\
+}\
+\
+.ace-github .ace_constant.ace_buildin {\
+ color: #0086B3;\
+}\
+\
+.ace-github .ace_support.ace_function {\
+ color: #0086B3;\
+}\
+\
+.ace-github .ace_comment {\
+ color: #998;\
+ font-style: italic;\
+}\
+\
+.ace-github .ace_variable.ace_language {\
+ color: #0086B3;\
+}\
+\
+.ace-github .ace_paren {\
+ font-weight: bold;\
+}\
+\
+.ace-github .ace_boolean {\
+ font-weight: bold;\
+}\
+\
+.ace-github .ace_string.ace_regexp {\
+ color: #009926;\
+ font-weight: normal;\
+}\
+\
+.ace-github .ace_variable.ace_instancce {\
+ color: teal;\
+}\
+\
+.ace-github .ace_constant.ace_language {\
+ font-weight: bold;\
+}\
+\
+.ace-github .ace_text-layer {\
+}\
+\
+.ace-github .ace_cursor {\
+ border-left: 2px solid black;\
+}\
+\
+.ace-github .ace_cursor.ace_overwrite {\
+ border-left: 0px;\
+ border-bottom: 1px solid black;\
+}\
+\
+.ace-github .ace_marker-layer .ace_active_line {\
+ background: rgb(255, 255, 204);\
+}\
+.ace-github .ace_marker-layer .ace_selection {\
+ background: rgb(181, 213, 255);\
+}\
+.ace-github.multiselect .ace_selection.start {\
+ box-shadow: 0 0 3px 0px white;\
+ border-radius: 2px;\
+}\
+/* bold keywords cause cursor issues for some fonts */\
+/* this disables bold style for editor and keeps for static highlighter */\
+.ace-github.ace_editor .ace_line > span {\
+ font-weight: normal !important;\
+}\
+\
+.ace-github .ace_marker-layer .ace_step {\
+ background: rgb(252, 255, 0);\
+}\
+\
+.ace-github .ace_marker-layer .ace_stack {\
+ background: rgb(164, 229, 101);\
+}\
+\
+.ace-github .ace_marker-layer .ace_bracket {\
+ margin: -1px 0 0 -1px;\
+ border: 1px solid rgb(192, 192, 192);\
+}\
+\
+.ace-github .ace_gutter_active_line {\
+ background-color : rgba(0, 0, 0, 0.07);\
+}\
+\
+.ace-github .ace_marker-layer .ace_selected_word {\
+ background: rgb(250, 250, 255);\
+ border: 1px solid rgb(200, 200, 250);\
+\
+}\
+\
+.ace-github .ace_print_margin {\
+ width: 1px;\
+ background: #e8e8e8;\
+}\
+\
+.ace-github .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/vendor/assets/javascripts/ace-src-noconflict/theme-idle_fingers.js b/vendor/assets/javascripts/ace-src-noconflict/theme-idle_fingers.js
new file mode 100644
index 00000000000..79c12990187
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/theme-idle_fingers.js
@@ -0,0 +1,171 @@
+/* ***** 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 ***** */
+
+ace.define('ace/theme/idle_fingers', ['require', 'exports', 'module', 'ace/lib/dom'], function(require, exports, module) {
+
+exports.isDark = true;
+exports.cssClass = "ace-idle-fingers";
+exports.cssText = ".ace-idle-fingers .ace_editor {\
+ border: 2px solid rgb(159, 159, 159)\
+}\
+\
+.ace-idle-fingers .ace_editor.ace_focus {\
+ border: 2px solid #327fbd\
+}\
+\
+.ace-idle-fingers .ace_gutter {\
+ background: #3b3b3b;\
+ color: #fff\
+}\
+\
+.ace-idle-fingers .ace_print_margin {\
+ width: 1px;\
+ background: #3b3b3b\
+}\
+\
+.ace-idle-fingers .ace_scroller {\
+ background-color: #323232\
+}\
+\
+.ace-idle-fingers .ace_text-layer {\
+ color: #FFFFFF\
+}\
+\
+.ace-idle-fingers .ace_cursor {\
+ border-left: 2px solid #91FF00\
+}\
+\
+.ace-idle-fingers .ace_cursor.ace_overwrite {\
+ border-left: 0px;\
+ border-bottom: 1px solid #91FF00\
+}\
+\
+.ace-idle-fingers .ace_marker-layer .ace_selection {\
+ background: rgba(90, 100, 126, 0.88)\
+}\
+\
+.ace-idle-fingers.multiselect .ace_selection.start {\
+ box-shadow: 0 0 3px 0px #323232;\
+ border-radius: 2px\
+}\
+\
+.ace-idle-fingers .ace_marker-layer .ace_step {\
+ background: rgb(102, 82, 0)\
+}\
+\
+.ace-idle-fingers .ace_marker-layer .ace_bracket {\
+ margin: -1px 0 0 -1px;\
+ border: 1px solid #404040\
+}\
+\
+.ace-idle-fingers .ace_marker-layer .ace_active_line {\
+ background: #353637\
+}\
+\
+.ace-idle-fingers .ace_gutter_active_line {\
+ background-color: #353637\
+}\
+\
+.ace-idle-fingers .ace_marker-layer .ace_selected_word {\
+ border: 1px solid rgba(90, 100, 126, 0.88)\
+}\
+\
+.ace-idle-fingers .ace_invisible {\
+ color: #404040\
+}\
+\
+.ace-idle-fingers .ace_keyword,\
+.ace-idle-fingers .ace_meta {\
+ color: #CC7833\
+}\
+\
+.ace-idle-fingers .ace_constant,\
+.ace-idle-fingers .ace_constant.ace_character,\
+.ace-idle-fingers .ace_constant.ace_character.ace_escape,\
+.ace-idle-fingers .ace_constant.ace_other,\
+.ace-idle-fingers .ace_support.ace_constant {\
+ color: #6C99BB\
+}\
+\
+.ace-idle-fingers .ace_invalid {\
+ color: #FFFFFF;\
+ background-color: #FF0000\
+}\
+\
+.ace-idle-fingers .ace_fold {\
+ background-color: #CC7833;\
+ border-color: #FFFFFF\
+}\
+\
+.ace-idle-fingers .ace_support.ace_function {\
+ color: #B83426\
+}\
+\
+.ace-idle-fingers .ace_variable.ace_parameter {\
+ font-style: italic\
+}\
+\
+.ace-idle-fingers .ace_string {\
+ color: #A5C261\
+}\
+\
+.ace-idle-fingers .ace_string.ace_regexp {\
+ color: #CCCC33\
+}\
+\
+.ace-idle-fingers .ace_comment {\
+ font-style: italic;\
+ color: #BC9458\
+}\
+\
+.ace-idle-fingers .ace_meta.ace_tag {\
+ color: #FFE5BB\
+}\
+\
+.ace-idle-fingers .ace_entity.ace_name {\
+ color: #FFC66D\
+}\
+\
+.ace-idle-fingers .ace_markup.ace_underline {\
+ text-decoration: underline\
+}\
+\
+.ace-idle-fingers .ace_collab.ace_user1 {\
+ color: #323232;\
+ background-color: #FFF980\
+}\
+\
+.ace-idle-fingers .ace_indent-guide {\
+ background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWMwMjL6zzBz5sz/ABEUBGCqhK6UAAAAAElFTkSuQmCC) right repeat-y\
+}";
+
+var dom = require("../lib/dom");
+dom.importCssString(exports.cssText, exports.cssClass);
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/theme-kr_theme.js b/vendor/assets/javascripts/ace-src-noconflict/theme-kr_theme.js
new file mode 100644
index 00000000000..12f5d5b38e1
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/theme-kr_theme.js
@@ -0,0 +1,177 @@
+/* ***** 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 ***** */
+
+ace.define('ace/theme/kr_theme', ['require', 'exports', 'module', 'ace/lib/dom'], function(require, exports, module) {
+
+exports.isDark = true;
+exports.cssClass = "ace-kr-theme";
+exports.cssText = ".ace-kr-theme .ace_editor {\
+ border: 2px solid rgb(159, 159, 159)\
+}\
+\
+.ace-kr-theme .ace_editor.ace_focus {\
+ border: 2px solid #327fbd\
+}\
+\
+.ace-kr-theme .ace_gutter {\
+ background: #1c1917;\
+ color: #FCFFE0\
+}\
+\
+.ace-kr-theme .ace_print_margin {\
+ width: 1px;\
+ background: #1c1917\
+}\
+\
+.ace-kr-theme .ace_scroller {\
+ background-color: #0B0A09\
+}\
+\
+.ace-kr-theme .ace_text-layer {\
+ color: #FCFFE0\
+}\
+\
+.ace-kr-theme .ace_cursor {\
+ border-left: 2px solid #FF9900\
+}\
+\
+.ace-kr-theme .ace_cursor.ace_overwrite {\
+ border-left: 0px;\
+ border-bottom: 1px solid #FF9900\
+}\
+\
+.ace-kr-theme .ace_marker-layer .ace_selection {\
+ background: rgba(170, 0, 255, 0.45)\
+}\
+\
+.ace-kr-theme.multiselect .ace_selection.start {\
+ box-shadow: 0 0 3px 0px #0B0A09;\
+ border-radius: 2px\
+}\
+\
+.ace-kr-theme .ace_marker-layer .ace_step {\
+ background: rgb(102, 82, 0)\
+}\
+\
+.ace-kr-theme .ace_marker-layer .ace_bracket {\
+ margin: -1px 0 0 -1px;\
+ border: 1px solid rgba(255, 177, 111, 0.32)\
+}\
+\
+.ace-kr-theme .ace_marker-layer .ace_active_line {\
+ background: #38403D\
+}\
+\
+.ace-kr-theme .ace_gutter_active_line {\
+ background-color : #38403D\
+}\
+\
+.ace-kr-theme .ace_marker-layer .ace_selected_word {\
+ border: 1px solid rgba(170, 0, 255, 0.45)\
+}\
+\
+.ace-kr-theme .ace_invisible {\
+ color: rgba(255, 177, 111, 0.32)\
+}\
+\
+.ace-kr-theme .ace_keyword,\
+.ace-kr-theme .ace_meta {\
+ color: #949C8B\
+}\
+\
+.ace-kr-theme .ace_constant,\
+.ace-kr-theme .ace_constant.ace_character,\
+.ace-kr-theme .ace_constant.ace_character.ace_escape,\
+.ace-kr-theme .ace_constant.ace_other {\
+ color: rgba(210, 117, 24, 0.76)\
+}\
+\
+.ace-kr-theme .ace_invalid {\
+ color: #F8F8F8;\
+ background-color: #A41300\
+}\
+\
+.ace-kr-theme .ace_support {\
+ color: #9FC28A\
+}\
+\
+.ace-kr-theme .ace_support.ace_constant {\
+ color: #C27E66\
+}\
+\
+.ace-kr-theme .ace_fold {\
+ background-color: #949C8B;\
+ border-color: #FCFFE0\
+}\
+\
+.ace-kr-theme .ace_support.ace_function {\
+ color: #85873A\
+}\
+\
+.ace-kr-theme .ace_storage {\
+ color: #FFEE80\
+}\
+\
+.ace-kr-theme .ace_string.ace_regexp {\
+ color: rgba(125, 255, 192, 0.65)\
+}\
+\
+.ace-kr-theme .ace_comment {\
+ font-style: italic;\
+ color: #706D5B\
+}\
+\
+.ace-kr-theme .ace_variable {\
+ color: #D1A796\
+}\
+\
+.ace-kr-theme .ace_variable.ace_language {\
+ color: #FF80E1\
+}\
+\
+.ace-kr-theme .ace_meta.ace_tag {\
+ color: #BABD9C\
+}\
+\
+.ace-kr-theme .ace_markup.ace_underline {\
+ text-decoration: underline\
+}\
+\
+.ace-kr-theme .ace_markup.ace_list {\
+ background-color: #0F0040\
+}\
+\
+.ace-kr-theme .ace_indent-guide {\
+ background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPg5uL8zzBz5sz/AA1WA+hUYIqjAAAAAElFTkSuQmCC) right repeat-y\
+}";
+
+var dom = require("../lib/dom");
+dom.importCssString(exports.cssText, exports.cssClass);
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/theme-merbivore.js b/vendor/assets/javascripts/ace-src-noconflict/theme-merbivore.js
new file mode 100644
index 00000000000..2e2926d5321
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/theme-merbivore.js
@@ -0,0 +1,168 @@
+/* ***** 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 ***** */
+
+ace.define('ace/theme/merbivore', ['require', 'exports', 'module', 'ace/lib/dom'], function(require, exports, module) {
+
+exports.isDark = true;
+exports.cssClass = "ace-merbivore";
+exports.cssText = ".ace-merbivore .ace_editor {\
+ border: 2px solid rgb(159, 159, 159)\
+}\
+\
+.ace-merbivore .ace_editor.ace_focus {\
+ border: 2px solid #327fbd\
+}\
+\
+.ace-merbivore .ace_gutter {\
+ background: #202020;\
+ color: #E6E1DC\
+}\
+\
+.ace-merbivore .ace_print_margin {\
+ width: 1px;\
+ background: #555651\
+}\
+\
+.ace-merbivore .ace_scroller {\
+ background-color: #161616\
+}\
+\
+.ace-merbivore .ace_text-layer {\
+ color: #E6E1DC\
+}\
+\
+.ace-merbivore .ace_cursor {\
+ border-left: 2px solid #FFFFFF\
+}\
+\
+.ace-merbivore .ace_cursor.ace_overwrite {\
+ border-left: 0px;\
+ border-bottom: 1px solid #FFFFFF\
+}\
+\
+.ace-merbivore .ace_marker-layer .ace_selection {\
+ background: #454545\
+}\
+\
+.ace-merbivore.multiselect .ace_selection.start {\
+ box-shadow: 0 0 3px 0px #161616;\
+ border-radius: 2px\
+}\
+\
+.ace-merbivore .ace_marker-layer .ace_step {\
+ background: rgb(102, 82, 0)\
+}\
+\
+.ace-merbivore .ace_marker-layer .ace_bracket {\
+ margin: -1px 0 0 -1px;\
+ border: 1px solid #404040\
+}\
+\
+.ace-merbivore .ace_marker-layer .ace_active_line {\
+ background: #333435\
+}\
+\
+.ace-merbivore .ace_gutter_active_line {\
+ background-color: #333435\
+}\
+\
+.ace-merbivore .ace_marker-layer .ace_selected_word {\
+ border: 1px solid #454545\
+}\
+\
+.ace-merbivore .ace_invisible {\
+ color: #404040\
+}\
+\
+.ace-merbivore .ace_entity.ace_name.ace_tag,\
+.ace-merbivore .ace_keyword,\
+.ace-merbivore .ace_meta,\
+.ace-merbivore .ace_meta.ace_tag,\
+.ace-merbivore .ace_storage,\
+.ace-merbivore .ace_support.ace_function {\
+ color: #FC6F09\
+}\
+\
+.ace-merbivore .ace_constant,\
+.ace-merbivore .ace_constant.ace_character,\
+.ace-merbivore .ace_constant.ace_character.ace_escape,\
+.ace-merbivore .ace_constant.ace_other,\
+.ace-merbivore .ace_support.ace_type {\
+ color: #1EDAFB\
+}\
+\
+.ace-merbivore .ace_constant.ace_character.ace_escape {\
+ color: #519F50\
+}\
+\
+.ace-merbivore .ace_constant.ace_language {\
+ color: #FDC251\
+}\
+\
+.ace-merbivore .ace_constant.ace_library,\
+.ace-merbivore .ace_string,\
+.ace-merbivore .ace_support.ace_constant {\
+ color: #8DFF0A\
+}\
+\
+.ace-merbivore .ace_constant.ace_numeric {\
+ color: #58C554\
+}\
+\
+.ace-merbivore .ace_invalid {\
+ color: #FFFFFF;\
+ background-color: #990000\
+}\
+\
+.ace-merbivore .ace_fold {\
+ background-color: #FC6F09;\
+ border-color: #E6E1DC\
+}\
+\
+.ace-merbivore .ace_comment {\
+ font-style: italic;\
+ color: #AD2EA4\
+}\
+\
+.ace-merbivore .ace_entity.ace_other.ace_attribute-name {\
+ color: #FFFF89\
+}\
+\
+.ace-merbivore .ace_markup.ace_underline {\
+ text-decoration: underline\
+}\
+\
+.ace-merbivore .ace_indent-guide {\
+ background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWMQExP7zzBz5sz/AA50BAyDznYhAAAAAElFTkSuQmCC) right repeat-y\
+}";
+
+var dom = require("../lib/dom");
+dom.importCssString(exports.cssText, exports.cssClass);
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/theme-merbivore_soft.js b/vendor/assets/javascripts/ace-src-noconflict/theme-merbivore_soft.js
new file mode 100644
index 00000000000..9e41cb7cdf3
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/theme-merbivore_soft.js
@@ -0,0 +1,169 @@
+/* ***** 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 ***** */
+
+ace.define('ace/theme/merbivore_soft', ['require', 'exports', 'module', 'ace/lib/dom'], function(require, exports, module) {
+
+exports.isDark = true;
+exports.cssClass = "ace-merbivore-soft";
+exports.cssText = ".ace-merbivore-soft .ace_editor {\
+ border: 2px solid rgb(159, 159, 159)\
+}\
+\
+.ace-merbivore-soft .ace_editor.ace_focus {\
+ border: 2px solid #327fbd\
+}\
+\
+.ace-merbivore-soft .ace_gutter {\
+ background: #262424;\
+ color: #E6E1DC\
+}\
+\
+.ace-merbivore-soft .ace_print_margin {\
+ width: 1px;\
+ background: #262424\
+}\
+\
+.ace-merbivore-soft .ace_scroller {\
+ background-color: #1C1C1C\
+}\
+\
+.ace-merbivore-soft .ace_text-layer {\
+ color: #E6E1DC\
+}\
+\
+.ace-merbivore-soft .ace_cursor {\
+ border-left: 2px solid #FFFFFF\
+}\
+\
+.ace-merbivore-soft .ace_cursor.ace_overwrite {\
+ border-left: 0px;\
+ border-bottom: 1px solid #FFFFFF\
+}\
+\
+.ace-merbivore-soft .ace_marker-layer .ace_selection {\
+ background: #494949\
+}\
+\
+.ace-merbivore-soft.multiselect .ace_selection.start {\
+ box-shadow: 0 0 3px 0px #1C1C1C;\
+ border-radius: 2px\
+}\
+\
+.ace-merbivore-soft .ace_marker-layer .ace_step {\
+ background: rgb(102, 82, 0)\
+}\
+\
+.ace-merbivore-soft .ace_marker-layer .ace_bracket {\
+ margin: -1px 0 0 -1px;\
+ border: 1px solid #404040\
+}\
+\
+.ace-merbivore-soft .ace_marker-layer .ace_active_line {\
+ background: #333435\
+}\
+\
+.ace-merbivore-soft .ace_gutter_active_line {\
+ background-color: #333435\
+}\
+\
+.ace-merbivore-soft .ace_marker-layer .ace_selected_word {\
+ border: 1px solid #494949\
+}\
+\
+.ace-merbivore-soft .ace_invisible {\
+ color: #404040\
+}\
+\
+.ace-merbivore-soft .ace_entity.ace_name.ace_tag,\
+.ace-merbivore-soft .ace_keyword,\
+.ace-merbivore-soft .ace_meta,\
+.ace-merbivore-soft .ace_meta.ace_tag,\
+.ace-merbivore-soft .ace_storage {\
+ color: #FC803A\
+}\
+\
+.ace-merbivore-soft .ace_constant,\
+.ace-merbivore-soft .ace_constant.ace_character,\
+.ace-merbivore-soft .ace_constant.ace_character.ace_escape,\
+.ace-merbivore-soft .ace_constant.ace_other,\
+.ace-merbivore-soft .ace_support.ace_type {\
+ color: #68C1D8\
+}\
+\
+.ace-merbivore-soft .ace_constant.ace_character.ace_escape {\
+ color: #B3E5B4\
+}\
+\
+.ace-merbivore-soft .ace_constant.ace_language {\
+ color: #E1C582\
+}\
+\
+.ace-merbivore-soft .ace_constant.ace_library,\
+.ace-merbivore-soft .ace_string,\
+.ace-merbivore-soft .ace_support.ace_constant {\
+ color: #8EC65F\
+}\
+\
+.ace-merbivore-soft .ace_constant.ace_numeric {\
+ color: #7FC578\
+}\
+\
+.ace-merbivore-soft .ace_invalid,\
+.ace-merbivore-soft .ace_invalid.ace_deprecated {\
+ color: #FFFFFF;\
+ background-color: #FE3838\
+}\
+\
+.ace-merbivore-soft .ace_fold {\
+ background-color: #FC803A;\
+ border-color: #E6E1DC\
+}\
+\
+.ace-merbivore-soft .ace_comment,\
+.ace-merbivore-soft .ace_meta {\
+ font-style: italic;\
+ color: #AC4BB8\
+}\
+\
+.ace-merbivore-soft .ace_entity.ace_other.ace_attribute-name {\
+ color: #EAF1A3\
+}\
+\
+.ace-merbivore-soft .ace_markup.ace_underline {\
+ text-decoration: underline\
+}\
+\
+.ace-merbivore-soft .ace_indent-guide {\
+ background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWOQkZH5zzBz5sz/AA8EBB6crd1rAAAAAElFTkSuQmCC) right repeat-y\
+}";
+
+var dom = require("../lib/dom");
+dom.importCssString(exports.cssText, exports.cssClass);
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/theme-mono_industrial.js b/vendor/assets/javascripts/ace-src-noconflict/theme-mono_industrial.js
new file mode 100644
index 00000000000..7f9c355d1ae
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/theme-mono_industrial.js
@@ -0,0 +1,180 @@
+/* ***** 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 ***** */
+
+ace.define('ace/theme/mono_industrial', ['require', 'exports', 'module', 'ace/lib/dom'], function(require, exports, module) {
+
+exports.isDark = true;
+exports.cssClass = "ace-mono-industrial";
+exports.cssText = ".ace-mono-industrial .ace_editor {\
+ border: 2px solid rgb(159, 159, 159)\
+}\
+\
+.ace-mono-industrial .ace_editor.ace_focus {\
+ border: 2px solid #327fbd\
+}\
+\
+.ace-mono-industrial .ace_gutter {\
+ background: #1d2521;\
+ color: #C5C9C9\
+}\
+\
+.ace-mono-industrial .ace_print_margin {\
+ width: 1px;\
+ background: #555651\
+}\
+\
+.ace-mono-industrial .ace_scroller {\
+ background-color: #222C28\
+}\
+\
+.ace-mono-industrial .ace_text-layer {\
+ color: #FFFFFF\
+}\
+\
+.ace-mono-industrial .ace_cursor {\
+ border-left: 2px solid #FFFFFF\
+}\
+\
+.ace-mono-industrial .ace_cursor.ace_overwrite {\
+ border-left: 0px;\
+ border-bottom: 1px solid #FFFFFF\
+}\
+\
+.ace-mono-industrial .ace_marker-layer .ace_selection {\
+ background: rgba(145, 153, 148, 0.40)\
+}\
+\
+.ace-mono-industrial.multiselect .ace_selection.start {\
+ box-shadow: 0 0 3px 0px #222C28;\
+ border-radius: 2px\
+}\
+\
+.ace-mono-industrial .ace_marker-layer .ace_step {\
+ background: rgb(102, 82, 0)\
+}\
+\
+.ace-mono-industrial .ace_marker-layer .ace_bracket {\
+ margin: -1px 0 0 -1px;\
+ border: 1px solid rgba(102, 108, 104, 0.50)\
+}\
+\
+.ace-mono-industrial .ace_marker-layer .ace_active_line {\
+ background: rgba(12, 13, 12, 0.25)\
+}\
+\
+.ace-mono-industrial .ace_gutter_active_line {\
+ background-color: rgba(12, 13, 12, 0.25)\
+}\
+\
+.ace-mono-industrial .ace_marker-layer .ace_selected_word {\
+ border: 1px solid rgba(145, 153, 148, 0.40)\
+}\
+\
+.ace-mono-industrial .ace_invisible {\
+ color: rgba(102, 108, 104, 0.50)\
+}\
+\
+.ace-mono-industrial .ace_keyword,\
+.ace-mono-industrial .ace_meta {\
+ color: #A39E64\
+}\
+\
+.ace-mono-industrial .ace_constant,\
+.ace-mono-industrial .ace_constant.ace_character,\
+.ace-mono-industrial .ace_constant.ace_character.ace_escape,\
+.ace-mono-industrial .ace_constant.ace_numeric,\
+.ace-mono-industrial .ace_constant.ace_other {\
+ color: #E98800\
+}\
+\
+.ace-mono-industrial .ace_entity.ace_name.ace_function,\
+.ace-mono-industrial .ace_keyword.ace_operator,\
+.ace-mono-industrial .ace_variable {\
+ color: #A8B3AB\
+}\
+\
+.ace-mono-industrial .ace_invalid {\
+ color: #FFFFFF;\
+ background-color: rgba(153, 0, 0, 0.68)\
+}\
+\
+.ace-mono-industrial .ace_support.ace_constant {\
+ color: #C87500\
+}\
+\
+.ace-mono-industrial .ace_fold {\
+ background-color: #A8B3AB;\
+ border-color: #FFFFFF\
+}\
+\
+.ace-mono-industrial .ace_support.ace_function {\
+ color: #588E60\
+}\
+\
+.ace-mono-industrial .ace_entity.ace_name,\
+.ace-mono-industrial .ace_support.ace_class,\
+.ace-mono-industrial .ace_support.ace_type {\
+ color: #5778B6\
+}\
+\
+.ace-mono-industrial .ace_storage {\
+ color: #C23B00\
+}\
+\
+.ace-mono-industrial .ace_variable.ace_language,\
+.ace-mono-industrial .ace_variable.ace_parameter {\
+ color: #648BD2\
+}\
+\
+.ace-mono-industrial .ace_comment {\
+ color: #666C68;\
+ background-color: #151C19\
+}\
+\
+.ace-mono-industrial .ace_entity.ace_other.ace_attribute-name {\
+ color: #909993\
+}\
+\
+.ace-mono-industrial .ace_markup.ace_underline {\
+ text-decoration: underline\
+}\
+\
+.ace-mono-industrial .ace_entity.ace_name.ace_tag {\
+ color: #A65EFF\
+}\
+\
+.ace-mono-industrial .ace_indent-guide {\
+ background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNQ0tH4zzBz5sz/ABAOBECKH+evAAAAAElFTkSuQmCC) right repeat-y\
+}\
+";
+
+var dom = require("../lib/dom");
+dom.importCssString(exports.cssText, exports.cssClass);
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/theme-monokai.js b/vendor/assets/javascripts/ace-src-noconflict/theme-monokai.js
new file mode 100644
index 00000000000..e1f832aad92
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/theme-monokai.js
@@ -0,0 +1,174 @@
+/* ***** 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 ***** */
+
+ace.define('ace/theme/monokai', ['require', 'exports', 'module', 'ace/lib/dom'], function(require, exports, module) {
+
+exports.isDark = true;
+exports.cssClass = "ace-monokai";
+exports.cssText = ".ace-monokai .ace_editor {\
+ border: 2px solid rgb(159, 159, 159)\
+}\
+\
+.ace-monokai .ace_editor.ace_focus {\
+ border: 2px solid #327fbd\
+}\
+\
+.ace-monokai .ace_gutter {\
+ background: #2f3129;\
+ color: #f1f1f1\
+}\
+\
+.ace-monokai .ace_print_margin {\
+ width: 1px;\
+ background: #555651\
+}\
+\
+.ace-monokai .ace_scroller {\
+ background-color: #272822\
+}\
+\
+.ace-monokai .ace_text-layer {\
+ color: #F8F8F2\
+}\
+\
+.ace-monokai .ace_cursor {\
+ border-left: 2px solid #F8F8F0\
+}\
+\
+.ace-monokai .ace_cursor.ace_overwrite {\
+ border-left: 0px;\
+ border-bottom: 1px solid #F8F8F0\
+}\
+\
+.ace-monokai .ace_marker-layer .ace_selection {\
+ background: #49483E\
+}\
+\
+.ace-monokai.multiselect .ace_selection.start {\
+ box-shadow: 0 0 3px 0px #272822;\
+ border-radius: 2px\
+}\
+\
+.ace-monokai .ace_marker-layer .ace_step {\
+ background: rgb(102, 82, 0)\
+}\
+\
+.ace-monokai .ace_marker-layer .ace_bracket {\
+ margin: -1px 0 0 -1px;\
+ border: 1px solid #49483E\
+}\
+\
+.ace-monokai .ace_marker-layer .ace_active_line {\
+ background: #202020\
+}\
+\
+.ace-monokai .ace_gutter_active_line {\
+ background-color: #272727\
+}\
+\
+.ace-monokai .ace_marker-layer .ace_selected_word {\
+ border: 1px solid #49483E\
+}\
+\
+.ace-monokai .ace_invisible {\
+ color: #49483E\
+}\
+\
+.ace-monokai .ace_entity.ace_name.ace_tag,\
+.ace-monokai .ace_keyword,\
+.ace-monokai .ace_meta,\
+.ace-monokai .ace_storage {\
+ color: #F92672\
+}\
+\
+.ace-monokai .ace_constant.ace_character,\
+.ace-monokai .ace_constant.ace_language,\
+.ace-monokai .ace_constant.ace_numeric,\
+.ace-monokai .ace_constant.ace_other {\
+ color: #AE81FF\
+}\
+\
+.ace-monokai .ace_invalid {\
+ color: #F8F8F0;\
+ background-color: #F92672\
+}\
+\
+.ace-monokai .ace_invalid.ace_deprecated {\
+ color: #F8F8F0;\
+ background-color: #AE81FF\
+}\
+\
+.ace-monokai .ace_support.ace_constant,\
+.ace-monokai .ace_support.ace_function {\
+ color: #66D9EF\
+}\
+\
+.ace-monokai .ace_fold {\
+ background-color: #A6E22E;\
+ border-color: #F8F8F2\
+}\
+\
+.ace-monokai .ace_storage.ace_type,\
+.ace-monokai .ace_support.ace_class,\
+.ace-monokai .ace_support.ace_type {\
+ font-style: italic;\
+ color: #66D9EF\
+}\
+\
+.ace-monokai .ace_entity.ace_name.ace_function,\
+.ace-monokai .ace_entity.ace_other.ace_attribute-name,\
+.ace-monokai .ace_variable {\
+ color: #A6E22E\
+}\
+\
+.ace-monokai .ace_variable.ace_parameter {\
+ font-style: italic;\
+ color: #FD971F\
+}\
+\
+.ace-monokai .ace_string {\
+ color: #E6DB74\
+}\
+\
+.ace-monokai .ace_comment {\
+ color: #75715E\
+}\
+\
+.ace-monokai .ace_markup.ace_underline {\
+ text-decoration: underline\
+}\
+\
+.ace-monokai .ace_indent-guide {\
+ background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNQ11D6z7Bq1ar/ABCKBG6g04U2AAAAAElFTkSuQmCC) right repeat-y\
+}";
+
+var dom = require("../lib/dom");
+dom.importCssString(exports.cssText, exports.cssClass);
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/theme-pastel_on_dark.js b/vendor/assets/javascripts/ace-src-noconflict/theme-pastel_on_dark.js
new file mode 100644
index 00000000000..df29686a6b4
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/theme-pastel_on_dark.js
@@ -0,0 +1,187 @@
+/* ***** 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 ***** */
+
+ace.define('ace/theme/pastel_on_dark', ['require', 'exports', 'module', 'ace/lib/dom'], function(require, exports, module) {
+
+exports.isDark = true;
+exports.cssClass = "ace-pastel-on-dark";
+exports.cssText = ".ace-pastel-on-dark .ace_editor {\
+ border: 2px solid rgb(159, 159, 159)\
+}\
+\
+.ace-pastel-on-dark .ace_editor.ace_focus {\
+ border: 2px solid #327fbd\
+}\
+\
+.ace-pastel-on-dark .ace_gutter {\
+ background: #353030;\
+ color: #8F938F\
+}\
+\
+.ace-pastel-on-dark .ace_print_margin {\
+ width: 1px;\
+ background: #353030\
+}\
+\
+.ace-pastel-on-dark .ace_scroller {\
+ background-color: #2C2828\
+}\
+\
+.ace-pastel-on-dark .ace_text-layer {\
+ color: #8F938F\
+}\
+\
+.ace-pastel-on-dark .ace_cursor {\
+ border-left: 2px solid #A7A7A7\
+}\
+\
+.ace-pastel-on-dark .ace_cursor.ace_overwrite {\
+ border-left: 0px;\
+ border-bottom: 1px solid #A7A7A7\
+}\
+\
+.ace-pastel-on-dark .ace_marker-layer .ace_selection {\
+ background: rgba(221, 240, 255, 0.20)\
+}\
+\
+.ace-pastel-on-dark.multiselect .ace_selection.start {\
+ box-shadow: 0 0 3px 0px #2C2828;\
+ border-radius: 2px\
+}\
+\
+.ace-pastel-on-dark .ace_marker-layer .ace_step {\
+ background: rgb(102, 82, 0)\
+}\
+\
+.ace-pastel-on-dark .ace_marker-layer .ace_bracket {\
+ margin: -1px 0 0 -1px;\
+ border: 1px solid rgba(255, 255, 255, 0.25)\
+}\
+\
+.ace-pastel-on-dark .ace_marker-layer .ace_active_line {\
+ background: rgba(255, 255, 255, 0.031)\
+}\
+\
+.ace-pastel-on-dark .ace_gutter_active_line {\
+ background-color: rgba(255, 255, 255, 0.031)\
+}\
+\
+.ace-pastel-on-dark .ace_marker-layer .ace_selected_word {\
+ border: 1px solid rgba(221, 240, 255, 0.20)\
+}\
+\
+.ace-pastel-on-dark .ace_invisible {\
+ color: rgba(255, 255, 255, 0.25)\
+}\
+\
+.ace-pastel-on-dark .ace_keyword,\
+.ace-pastel-on-dark .ace_meta {\
+ color: #757aD8\
+}\
+\
+.ace-pastel-on-dark .ace_constant,\
+.ace-pastel-on-dark .ace_constant.ace_character,\
+.ace-pastel-on-dark .ace_constant.ace_character.ace_escape,\
+.ace-pastel-on-dark .ace_constant.ace_other {\
+ color: #4FB7C5\
+}\
+\
+.ace-pastel-on-dark .ace_keyword.ace_operator {\
+ color: #797878\
+}\
+\
+.ace-pastel-on-dark .ace_constant.ace_character {\
+ color: #AFA472\
+}\
+\
+.ace-pastel-on-dark .ace_constant.ace_language {\
+ color: #DE8E30\
+}\
+\
+.ace-pastel-on-dark .ace_constant.ace_numeric {\
+ color: #CCCCCC\
+}\
+\
+.ace-pastel-on-dark .ace_invalid,\
+.ace-pastel-on-dark .ace_invalid.ace_illegal {\
+ color: #F8F8F8;\
+ background-color: rgba(86, 45, 86, 0.75)\
+}\
+\
+.ace-pastel-on-dark .ace_invalid.ace_deprecated {\
+ text-decoration: underline;\
+ font-style: italic;\
+ color: #D2A8A1\
+}\
+\
+.ace-pastel-on-dark .ace_fold {\
+ background-color: #757aD8;\
+ border-color: #8F938F\
+}\
+\
+.ace-pastel-on-dark .ace_support.ace_function {\
+ color: #AEB2F8\
+}\
+\
+.ace-pastel-on-dark .ace_string {\
+ color: #66A968\
+}\
+\
+.ace-pastel-on-dark .ace_string.ace_regexp {\
+ color: #E9C062\
+}\
+\
+.ace-pastel-on-dark .ace_comment {\
+ color: #A6C6FF\
+}\
+\
+.ace-pastel-on-dark .ace_variable {\
+ color: #BEBF55\
+}\
+\
+.ace-pastel-on-dark .ace_variable.ace_language {\
+ color: #C1C144\
+}\
+\
+.ace-pastel-on-dark .ace_xml_pe {\
+ color: #494949\
+}\
+\
+.ace-pastel-on-dark .ace_markup.ace_underline {\
+ text-decoration: underline\
+}\
+\
+.ace-pastel-on-dark .ace_indent-guide {\
+ background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPQ0dD4z9DR0fEfAA+vBBPqhbn1AAAAAElFTkSuQmCC) right repeat-y\
+}";
+
+var dom = require("../lib/dom");
+dom.importCssString(exports.cssText, exports.cssClass);
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/theme-solarized_dark.js b/vendor/assets/javascripts/ace-src-noconflict/theme-solarized_dark.js
new file mode 100644
index 00000000000..7894bdef012
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/theme-solarized_dark.js
@@ -0,0 +1,159 @@
+/* ***** 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 ***** */
+
+ace.define('ace/theme/solarized_dark', ['require', 'exports', 'module', 'ace/lib/dom'], function(require, exports, module) {
+
+exports.isDark = true;
+exports.cssClass = "ace-solarized-dark";
+exports.cssText = ".ace-solarized-dark .ace_editor {\
+ border: 2px solid rgb(159, 159, 159)\
+}\
+\
+.ace-solarized-dark .ace_editor.ace_focus {\
+ border: 2px solid #327fbd\
+}\
+\
+.ace-solarized-dark .ace_gutter {\
+ background: #01313f;\
+ color: #d0edf7\
+}\
+\
+.ace-solarized-dark .ace_print_margin {\
+ width: 1px;\
+ background: #33555E\
+}\
+\
+.ace-solarized-dark .ace_scroller {\
+ background-color: #002B36\
+}\
+\
+.ace-solarized-dark .ace_entity.ace_other.ace_attribute-name,\
+.ace-solarized-dark .ace_storage,\
+.ace-solarized-dark .ace_text-layer {\
+ color: #93A1A1\
+}\
+\
+.ace-solarized-dark .ace_cursor {\
+ border-left: 2px solid #D30102\
+}\
+\
+.ace-solarized-dark .ace_cursor.ace_overwrite {\
+ border-left: 0px;\
+ border-bottom: 1px solid #D30102\
+}\
+\
+.ace-solarized-dark .ace_marker-layer .ace_active_line,\
+.ace-solarized-dark .ace_marker-layer .ace_selection {\
+ background: rgba(255, 255, 255, 0.1)\
+}\
+\
+.ace-solarized-dark.multiselect .ace_selection.start {\
+ box-shadow: 0 0 3px 0px #002B36;\
+ border-radius: 2px\
+}\
+\
+.ace-solarized-dark .ace_marker-layer .ace_step {\
+ background: rgb(102, 82, 0)\
+}\
+\
+.ace-solarized-dark .ace_marker-layer .ace_bracket {\
+ margin: -1px 0 0 -1px;\
+ border: 1px solid rgba(147, 161, 161, 0.50)\
+}\
+\
+.ace-solarized-dark .ace_gutter_active_line {\
+ background-color: #0d3440\
+}\
+\
+.ace-solarized-dark .ace_marker-layer .ace_selected_word {\
+ border: 1px solid #073642\
+}\
+\
+.ace-solarized-dark .ace_invisible {\
+ color: rgba(147, 161, 161, 0.50)\
+}\
+\
+.ace-solarized-dark .ace_keyword,\
+.ace-solarized-dark .ace_meta,\
+.ace-solarized-dark .ace_support.ace_class,\
+.ace-solarized-dark .ace_support.ace_type {\
+ color: #859900\
+}\
+\
+.ace-solarized-dark .ace_constant.ace_character,\
+.ace-solarized-dark .ace_constant.ace_other {\
+ color: #CB4B16\
+}\
+\
+.ace-solarized-dark .ace_constant.ace_language {\
+ color: #B58900\
+}\
+\
+.ace-solarized-dark .ace_constant.ace_numeric {\
+ color: #D33682\
+}\
+\
+.ace-solarized-dark .ace_fold {\
+ background-color: #268BD2;\
+ border-color: #93A1A1\
+}\
+\
+.ace-solarized-dark .ace_entity.ace_name.ace_function,\
+.ace-solarized-dark .ace_entity.ace_name.ace_tag,\
+.ace-solarized-dark .ace_support.ace_function,\
+.ace-solarized-dark .ace_variable,\
+.ace-solarized-dark .ace_variable.ace_language {\
+ color: #268BD2\
+}\
+\
+.ace-solarized-dark .ace_string {\
+ color: #2AA198\
+}\
+\
+.ace-solarized-dark .ace_string.ace_regexp {\
+ color: #D30102\
+}\
+\
+.ace-solarized-dark .ace_comment {\
+ font-style: italic;\
+ color: #657B83\
+}\
+\
+.ace-solarized-dark .ace_markup.ace_underline {\
+ text-decoration: underline\
+}\
+\
+.ace-solarized-dark .ace_indent-guide {\
+ background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNg0Db7zzBz5sz/AA82BCv7wOIDAAAAAElFTkSuQmCC) right repeat-y\
+}";
+
+var dom = require("../lib/dom");
+dom.importCssString(exports.cssText, exports.cssClass);
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/theme-solarized_light.js b/vendor/assets/javascripts/ace-src-noconflict/theme-solarized_light.js
new file mode 100644
index 00000000000..35f880c26ae
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/theme-solarized_light.js
@@ -0,0 +1,164 @@
+/* ***** 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 ***** */
+
+ace.define('ace/theme/solarized_light', ['require', 'exports', 'module', 'ace/lib/dom'], function(require, exports, module) {
+
+exports.isDark = false;
+exports.cssClass = "ace-solarized-light";
+exports.cssText = ".ace-solarized-light .ace_editor {\
+ border: 2px solid rgb(159, 159, 159)\
+}\
+\
+.ace-solarized-light .ace_editor.ace_focus {\
+ border: 2px solid #327fbd\
+}\
+\
+.ace-solarized-light .ace_gutter {\
+ background: #fbf1d3;\
+ color: #333\
+}\
+\
+.ace-solarized-light .ace_print_margin {\
+ width: 1px;\
+ background: #e8e8e8\
+}\
+\
+.ace-solarized-light .ace_scroller {\
+ background-color: #FDF6E3\
+}\
+\
+.ace-solarized-light .ace_text-layer {\
+ color: #586E75\
+}\
+\
+.ace-solarized-light .ace_cursor {\
+ border-left: 2px solid #000000\
+}\
+\
+.ace-solarized-light .ace_cursor.ace_overwrite {\
+ border-left: 0px;\
+ border-bottom: 1px solid #000000\
+}\
+\
+.ace-solarized-light .ace_marker-layer .ace_selection {\
+ background: #073642\
+}\
+\
+.ace-solarized-light.multiselect .ace_selection.start {\
+ box-shadow: 0 0 3px 0px #FDF6E3;\
+ border-radius: 2px\
+}\
+\
+.ace-solarized-light .ace_marker-layer .ace_step {\
+ background: rgb(255, 255, 0)\
+}\
+\
+.ace-solarized-light .ace_marker-layer .ace_bracket {\
+ margin: -1px 0 0 -1px;\
+ border: 1px solid rgba(147, 161, 161, 0.50)\
+}\
+\
+.ace-solarized-light .ace_marker-layer .ace_active_line {\
+ background: #EEE8D5\
+}\
+\
+.ace-solarized-light .ace_gutter_active_line {\
+ background-color : #dcdcdc\
+}\
+\
+.ace-solarized-light .ace_marker-layer .ace_selected_word {\
+ border: 1px solid #073642\
+}\
+\
+.ace-solarized-light .ace_invisible {\
+ color: rgba(147, 161, 161, 0.50)\
+}\
+\
+.ace-solarized-light .ace_keyword,\
+.ace-solarized-light .ace_meta,\
+.ace-solarized-light .ace_support.ace_class,\
+.ace-solarized-light .ace_support.ace_type {\
+ color: #859900\
+}\
+\
+.ace-solarized-light .ace_constant.ace_character,\
+.ace-solarized-light .ace_constant.ace_other {\
+ color: #CB4B16\
+}\
+\
+.ace-solarized-light .ace_constant.ace_language {\
+ color: #B58900\
+}\
+\
+.ace-solarized-light .ace_constant.ace_numeric {\
+ color: #D33682\
+}\
+\
+.ace-solarized-light .ace_fold {\
+ background-color: #268BD2;\
+ border-color: #586E75\
+}\
+\
+.ace-solarized-light .ace_entity.ace_name.ace_function,\
+.ace-solarized-light .ace_entity.ace_name.ace_tag,\
+.ace-solarized-light .ace_support.ace_function,\
+.ace-solarized-light .ace_variable,\
+.ace-solarized-light .ace_variable.ace_language {\
+ color: #268BD2\
+}\
+\
+.ace-solarized-light .ace_storage {\
+ color: #073642\
+}\
+\
+.ace-solarized-light .ace_string {\
+ color: #2AA198\
+}\
+\
+.ace-solarized-light .ace_string.ace_regexp {\
+ color: #D30102\
+}\
+\
+.ace-solarized-light .ace_comment,\
+.ace-solarized-light .ace_entity.ace_other.ace_attribute-name {\
+ color: #93A1A1\
+}\
+\
+.ace-solarized-light .ace_markup.ace_underline {\
+ text-decoration: underline\
+}\
+\
+.ace-solarized-light .ace_indent-guide {\
+ background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4++3xf4ZVq1b9BwAjxwbT1g3hiwAAAABJRU5ErkJggg==) right repeat-y\
+}";
+
+var dom = require("../lib/dom");
+dom.importCssString(exports.cssText, exports.cssClass);
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/theme-textmate.js b/vendor/assets/javascripts/ace-src-noconflict/theme-textmate.js
new file mode 100644
index 00000000000..97c0b183174
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/theme-textmate.js
@@ -0,0 +1,207 @@
+/* ***** 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 ***** */
+
+ace.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_editor {\
+ border: 2px solid rgb(159, 159, 159);\
+}\
+\
+.ace-tm .ace_editor.ace_focus {\
+ border: 2px solid #327fbd;\
+}\
+\
+.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_cursor.ace_overwrite {\
+ border-left: 0px;\
+ border-bottom: 1px solid black;\
+}\
+ \
+.ace-tm .ace_line .ace_invisible {\
+ color: rgb(191, 191, 191);\
+}\
+\
+.ace-tm .ace_line .ace_storage,\
+.ace-tm .ace_line .ace_keyword {\
+ color: blue;\
+}\
+\
+.ace-tm .ace_line .ace_constant {\
+ color: rgb(197, 6, 11);\
+}\
+\
+.ace-tm .ace_line .ace_constant.ace_buildin {\
+ color: rgb(88, 72, 246);\
+}\
+\
+.ace-tm .ace_line .ace_constant.ace_language {\
+ color: rgb(88, 92, 246);\
+}\
+\
+.ace-tm .ace_line .ace_constant.ace_library {\
+ color: rgb(6, 150, 14);\
+}\
+\
+.ace-tm .ace_line .ace_invalid {\
+ background-color: rgba(255, 0, 0, 0.1);\
+ color: red;\
+}\
+\
+.ace-tm .ace_line .ace_support.ace_function {\
+ color: rgb(60, 76, 114);\
+}\
+\
+.ace-tm .ace_line .ace_support.ace_constant {\
+ color: rgb(6, 150, 14);\
+}\
+\
+.ace-tm .ace_line .ace_support.ace_type,\
+.ace-tm .ace_line .ace_support.ace_class {\
+ color: rgb(109, 121, 222);\
+}\
+\
+.ace-tm .ace_line .ace_keyword.ace_operator {\
+ color: rgb(104, 118, 135);\
+}\
+\
+.ace-tm .ace_line .ace_string {\
+ color: rgb(3, 106, 7);\
+}\
+\
+.ace-tm .ace_line .ace_comment {\
+ color: rgb(76, 136, 107);\
+}\
+\
+.ace-tm .ace_line .ace_comment.ace_doc {\
+ color: rgb(0, 102, 255);\
+}\
+\
+.ace-tm .ace_line .ace_comment.ace_doc.ace_tag {\
+ color: rgb(128, 159, 191);\
+}\
+\
+.ace-tm .ace_line .ace_constant.ace_numeric {\
+ color: rgb(0, 0, 205);\
+}\
+\
+.ace-tm .ace_line .ace_variable {\
+ color: rgb(49, 132, 149);\
+}\
+\
+.ace-tm .ace_line .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.multiselect .ace_selection.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/vendor/assets/javascripts/ace-src-noconflict/theme-tomorrow.js b/vendor/assets/javascripts/ace-src-noconflict/theme-tomorrow.js
new file mode 100644
index 00000000000..f7e24444cf2
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/theme-tomorrow.js
@@ -0,0 +1,182 @@
+/* ***** 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 ***** */
+
+ace.define('ace/theme/tomorrow', ['require', 'exports', 'module', 'ace/lib/dom'], function(require, exports, module) {
+
+exports.isDark = false;
+exports.cssClass = "ace-tomorrow";
+exports.cssText = ".ace-tomorrow .ace_editor {\
+ border: 2px solid rgb(159, 159, 159)\
+}\
+\
+.ace-tomorrow .ace_editor.ace_focus {\
+ border: 2px solid #327fbd\
+}\
+\
+.ace-tomorrow .ace_gutter {\
+ background: #f6f6f6;\
+ color: #4D4D4C\
+}\
+\
+.ace-tomorrow .ace_print_margin {\
+ width: 1px;\
+ background: #f6f6f6\
+}\
+\
+.ace-tomorrow .ace_scroller {\
+ background-color: #FFFFFF\
+}\
+\
+.ace-tomorrow .ace_text-layer {\
+ color: #4D4D4C\
+}\
+\
+.ace-tomorrow .ace_cursor {\
+ border-left: 2px solid #AEAFAD\
+}\
+\
+.ace-tomorrow .ace_cursor.ace_overwrite {\
+ border-left: 0px;\
+ border-bottom: 1px solid #AEAFAD\
+}\
+\
+.ace-tomorrow .ace_marker-layer .ace_selection {\
+ background: #D6D6D6\
+}\
+\
+.ace-tomorrow.multiselect .ace_selection.start {\
+ box-shadow: 0 0 3px 0px #FFFFFF;\
+ border-radius: 2px\
+}\
+\
+.ace-tomorrow .ace_marker-layer .ace_step {\
+ background: rgb(255, 255, 0)\
+}\
+\
+.ace-tomorrow .ace_marker-layer .ace_bracket {\
+ margin: -1px 0 0 -1px;\
+ border: 1px solid #D1D1D1\
+}\
+\
+.ace-tomorrow .ace_marker-layer .ace_active_line {\
+ background: #EFEFEF\
+}\
+\
+.ace-tomorrow .ace_gutter_active_line {\
+ background-color : #dcdcdc\
+}\
+\
+.ace-tomorrow .ace_marker-layer .ace_selected_word {\
+ border: 1px solid #D6D6D6\
+}\
+\
+.ace-tomorrow .ace_invisible {\
+ color: #D1D1D1\
+}\
+\
+.ace-tomorrow .ace_keyword,\
+.ace-tomorrow .ace_meta,\
+.ace-tomorrow .ace_storage,\
+.ace-tomorrow .ace_storage.ace_type,\
+.ace-tomorrow .ace_support.ace_type {\
+ color: #8959A8\
+}\
+\
+.ace-tomorrow .ace_keyword.ace_operator {\
+ color: #3E999F\
+}\
+\
+.ace-tomorrow .ace_constant.ace_character,\
+.ace-tomorrow .ace_constant.ace_language,\
+.ace-tomorrow .ace_constant.ace_numeric,\
+.ace-tomorrow .ace_keyword.ace_other.ace_unit,\
+.ace-tomorrow .ace_support.ace_constant,\
+.ace-tomorrow .ace_variable.ace_parameter {\
+ color: #F5871F\
+}\
+\
+.ace-tomorrow .ace_constant.ace_other {\
+ color: #666969\
+}\
+\
+.ace-tomorrow .ace_invalid {\
+ color: #FFFFFF;\
+ background-color: #C82829\
+}\
+\
+.ace-tomorrow .ace_invalid.ace_deprecated {\
+ color: #FFFFFF;\
+ background-color: #8959A8\
+}\
+\
+.ace-tomorrow .ace_fold {\
+ background-color: #4271AE;\
+ border-color: #4D4D4C\
+}\
+\
+.ace-tomorrow .ace_entity.ace_name.ace_function,\
+.ace-tomorrow .ace_support.ace_function,\
+.ace-tomorrow .ace_variable {\
+ color: #4271AE\
+}\
+\
+.ace-tomorrow .ace_support.ace_class,\
+.ace-tomorrow .ace_support.ace_type {\
+ color: #C99E00\
+}\
+\
+.ace-tomorrow .ace_markup.ace_heading,\
+.ace-tomorrow .ace_string {\
+ color: #718C00\
+}\
+\
+.ace-tomorrow .ace_entity.ace_name.ace_tag,\
+.ace-tomorrow .ace_entity.ace_other.ace_attribute-name,\
+.ace-tomorrow .ace_meta.ace_tag,\
+.ace-tomorrow .ace_string.ace_regexp,\
+.ace-tomorrow .ace_variable {\
+ color: #C82829\
+}\
+\
+.ace-tomorrow .ace_comment {\
+ color: #8E908C\
+}\
+\
+.ace-tomorrow .ace_markup.ace_underline {\
+ text-decoration: underline\
+}\
+\
+.ace-tomorrow .ace_indent-guide {\
+ background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bdu3f/BwAlfgctduB85QAAAABJRU5ErkJggg==) right repeat-y\
+}";
+
+var dom = require("../lib/dom");
+dom.importCssString(exports.cssText, exports.cssClass);
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/theme-tomorrow_night.js b/vendor/assets/javascripts/ace-src-noconflict/theme-tomorrow_night.js
new file mode 100644
index 00000000000..9e65098d9ea
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/theme-tomorrow_night.js
@@ -0,0 +1,182 @@
+/* ***** 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 ***** */
+
+ace.define('ace/theme/tomorrow_night', ['require', 'exports', 'module', 'ace/lib/dom'], function(require, exports, module) {
+
+exports.isDark = true;
+exports.cssClass = "ace-tomorrow-night";
+exports.cssText = ".ace-tomorrow-night .ace_editor {\
+ border: 2px solid rgb(159, 159, 159)\
+}\
+\
+.ace-tomorrow-night .ace_editor.ace_focus {\
+ border: 2px solid #327fbd\
+}\
+\
+.ace-tomorrow-night .ace_gutter {\
+ background: #25282c;\
+ color: #C5C8C6\
+}\
+\
+.ace-tomorrow-night .ace_print_margin {\
+ width: 1px;\
+ background: #25282c\
+}\
+\
+.ace-tomorrow-night .ace_scroller {\
+ background-color: #1D1F21\
+}\
+\
+.ace-tomorrow-night .ace_text-layer {\
+ color: #C5C8C6\
+}\
+\
+.ace-tomorrow-night .ace_cursor {\
+ border-left: 2px solid #AEAFAD\
+}\
+\
+.ace-tomorrow-night .ace_cursor.ace_overwrite {\
+ border-left: 0px;\
+ border-bottom: 1px solid #AEAFAD\
+}\
+\
+.ace-tomorrow-night .ace_marker-layer .ace_selection {\
+ background: #373B41\
+}\
+\
+.ace-tomorrow-night.multiselect .ace_selection.start {\
+ box-shadow: 0 0 3px 0px #1D1F21;\
+ border-radius: 2px\
+}\
+\
+.ace-tomorrow-night .ace_marker-layer .ace_step {\
+ background: rgb(102, 82, 0)\
+}\
+\
+.ace-tomorrow-night .ace_marker-layer .ace_bracket {\
+ margin: -1px 0 0 -1px;\
+ border: 1px solid #4B4E55\
+}\
+\
+.ace-tomorrow-night .ace_marker-layer .ace_active_line {\
+ background: #282A2E\
+}\
+\
+.ace-tomorrow-night .ace_gutter_active_line {\
+ background-color: #282A2E\
+}\
+\
+.ace-tomorrow-night .ace_marker-layer .ace_selected_word {\
+ border: 1px solid #373B41\
+}\
+\
+.ace-tomorrow-night .ace_invisible {\
+ color: #4B4E55\
+}\
+\
+.ace-tomorrow-night .ace_keyword,\
+.ace-tomorrow-night .ace_meta,\
+.ace-tomorrow-night .ace_storage,\
+.ace-tomorrow-night .ace_storage.ace_type,\
+.ace-tomorrow-night .ace_support.ace_type {\
+ color: #B294BB\
+}\
+\
+.ace-tomorrow-night .ace_keyword.ace_operator {\
+ color: #8ABEB7\
+}\
+\
+.ace-tomorrow-night .ace_constant.ace_character,\
+.ace-tomorrow-night .ace_constant.ace_language,\
+.ace-tomorrow-night .ace_constant.ace_numeric,\
+.ace-tomorrow-night .ace_keyword.ace_other.ace_unit,\
+.ace-tomorrow-night .ace_support.ace_constant,\
+.ace-tomorrow-night .ace_variable.ace_parameter {\
+ color: #DE935F\
+}\
+\
+.ace-tomorrow-night .ace_constant.ace_other {\
+ color: #CED1CF\
+}\
+\
+.ace-tomorrow-night .ace_invalid {\
+ color: #CED2CF;\
+ background-color: #DF5F5F\
+}\
+\
+.ace-tomorrow-night .ace_invalid.ace_deprecated {\
+ color: #CED2CF;\
+ background-color: #B798BF\
+}\
+\
+.ace-tomorrow-night .ace_fold {\
+ background-color: #81A2BE;\
+ border-color: #C5C8C6\
+}\
+\
+.ace-tomorrow-night .ace_entity.ace_name.ace_function,\
+.ace-tomorrow-night .ace_support.ace_function,\
+.ace-tomorrow-night .ace_variable {\
+ color: #81A2BE\
+}\
+\
+.ace-tomorrow-night .ace_support.ace_class,\
+.ace-tomorrow-night .ace_support.ace_type {\
+ color: #F0C674\
+}\
+\
+.ace-tomorrow-night .ace_markup.ace_heading,\
+.ace-tomorrow-night .ace_string {\
+ color: #B5BD68\
+}\
+\
+.ace-tomorrow-night .ace_entity.ace_name.ace_tag,\
+.ace-tomorrow-night .ace_entity.ace_other.ace_attribute-name,\
+.ace-tomorrow-night .ace_meta.ace_tag,\
+.ace-tomorrow-night .ace_string.ace_regexp,\
+.ace-tomorrow-night .ace_variable {\
+ color: #CC6666\
+}\
+\
+.ace-tomorrow-night .ace_comment {\
+ color: #969896\
+}\
+\
+.ace-tomorrow-night .ace_markup.ace_underline {\
+ text-decoration: underline\
+}\
+\
+.ace-tomorrow-night .ace_indent-guide {\
+ background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWOQlVf8z7Bq1ar/AA/hBFp7egmpAAAAAElFTkSuQmCC) right repeat-y\
+}";
+
+var dom = require("../lib/dom");
+dom.importCssString(exports.cssText, exports.cssClass);
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/theme-tomorrow_night_blue.js b/vendor/assets/javascripts/ace-src-noconflict/theme-tomorrow_night_blue.js
new file mode 100644
index 00000000000..19d8c3b5ddf
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/theme-tomorrow_night_blue.js
@@ -0,0 +1,179 @@
+/* ***** 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 ***** */
+
+ace.define('ace/theme/tomorrow_night_blue', ['require', 'exports', 'module', 'ace/lib/dom'], function(require, exports, module) {
+
+exports.isDark = true;
+exports.cssClass = "ace-tomorrow-night-blue";
+exports.cssText = ".ace-tomorrow-night-blue .ace_editor {\
+ border: 2px solid rgb(159, 159, 159)\
+}\
+\
+.ace-tomorrow-night-blue .ace_editor.ace_focus {\
+ border: 2px solid #327fbd\
+}\
+\
+.ace-tomorrow-night-blue .ace_gutter {\
+ background: #00204b;\
+ color: #7388b5\
+}\
+\
+.ace-tomorrow-night-blue .ace_print_margin {\
+ width: 1px;\
+ background: #00204b\
+}\
+\
+.ace-tomorrow-night-blue .ace_scroller {\
+ background-color: #002451\
+}\
+\
+.ace-tomorrow-night-blue .ace_constant.ace_other,\
+.ace-tomorrow-night-blue .ace_text-layer {\
+ color: #FFFFFF\
+}\
+\
+.ace-tomorrow-night-blue .ace_cursor {\
+ border-left: 2px solid #FFFFFF\
+}\
+\
+.ace-tomorrow-night-blue .ace_cursor.ace_overwrite {\
+ border-left: 0px;\
+ border-bottom: 1px solid #FFFFFF\
+}\
+\
+.ace-tomorrow-night-blue .ace_marker-layer .ace_selection {\
+ background: #003F8E\
+}\
+\
+.ace-tomorrow-night-blue.multiselect .ace_selection.start {\
+ box-shadow: 0 0 3px 0px #002451;\
+ border-radius: 2px\
+}\
+\
+.ace-tomorrow-night-blue .ace_marker-layer .ace_step {\
+ background: rgb(127, 111, 19)\
+}\
+\
+.ace-tomorrow-night-blue .ace_marker-layer .ace_bracket {\
+ margin: -1px 0 0 -1px;\
+ border: 1px solid #404F7D\
+}\
+\
+.ace-tomorrow-night-blue .ace_marker-layer .ace_active_line {\
+ background: #00346E\
+}\
+\
+.ace-tomorrow-night-blue .ace_gutter_active_line {\
+ background-color: #022040\
+}\
+\
+.ace-tomorrow-night-blue .ace_marker-layer .ace_selected_word {\
+ border: 1px solid #003F8E\
+}\
+\
+.ace-tomorrow-night-blue .ace_invisible {\
+ color: #404F7D\
+}\
+\
+.ace-tomorrow-night-blue .ace_keyword,\
+.ace-tomorrow-night-blue .ace_meta,\
+.ace-tomorrow-night-blue .ace_storage,\
+.ace-tomorrow-night-blue .ace_storage.ace_type,\
+.ace-tomorrow-night-blue .ace_support.ace_type {\
+ color: #EBBBFF\
+}\
+\
+.ace-tomorrow-night-blue .ace_keyword.ace_operator {\
+ color: #99FFFF\
+}\
+\
+.ace-tomorrow-night-blue .ace_constant.ace_character,\
+.ace-tomorrow-night-blue .ace_constant.ace_language,\
+.ace-tomorrow-night-blue .ace_constant.ace_numeric,\
+.ace-tomorrow-night-blue .ace_keyword.ace_other.ace_unit,\
+.ace-tomorrow-night-blue .ace_support.ace_constant,\
+.ace-tomorrow-night-blue .ace_variable.ace_parameter {\
+ color: #FFC58F\
+}\
+\
+.ace-tomorrow-night-blue .ace_invalid {\
+ color: #FFFFFF;\
+ background-color: #F99DA5\
+}\
+\
+.ace-tomorrow-night-blue .ace_invalid.ace_deprecated {\
+ color: #FFFFFF;\
+ background-color: #EBBBFF\
+}\
+\
+.ace-tomorrow-night-blue .ace_fold {\
+ background-color: #BBDAFF;\
+ border-color: #FFFFFF\
+}\
+\
+.ace-tomorrow-night-blue .ace_entity.ace_name.ace_function,\
+.ace-tomorrow-night-blue .ace_support.ace_function,\
+.ace-tomorrow-night-blue .ace_variable {\
+ color: #BBDAFF\
+}\
+\
+.ace-tomorrow-night-blue .ace_support.ace_class,\
+.ace-tomorrow-night-blue .ace_support.ace_type {\
+ color: #FFEEAD\
+}\
+\
+.ace-tomorrow-night-blue .ace_markup.ace_heading,\
+.ace-tomorrow-night-blue .ace_string {\
+ color: #D1F1A9\
+}\
+\
+.ace-tomorrow-night-blue .ace_entity.ace_name.ace_tag,\
+.ace-tomorrow-night-blue .ace_entity.ace_other.ace_attribute-name,\
+.ace-tomorrow-night-blue .ace_meta.ace_tag,\
+.ace-tomorrow-night-blue .ace_string.ace_regexp,\
+.ace-tomorrow-night-blue .ace_variable {\
+ color: #FF9DA4\
+}\
+\
+.ace-tomorrow-night-blue .ace_comment {\
+ color: #7285B7\
+}\
+\
+.ace-tomorrow-night-blue .ace_markup.ace_underline {\
+ text-decoration: underline\
+}\
+\
+.ace-tomorrow-night-blue .ace_indent-guide {\
+ background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgUAn8z7Bq1ar/ABBUBHJ4/r3JAAAAAElFTkSuQmCC) right repeat-y\
+}";
+
+var dom = require("../lib/dom");
+dom.importCssString(exports.cssText, exports.cssClass);
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/theme-tomorrow_night_bright.js b/vendor/assets/javascripts/ace-src-noconflict/theme-tomorrow_night_bright.js
new file mode 100644
index 00000000000..c5009ba7790
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/theme-tomorrow_night_bright.js
@@ -0,0 +1,182 @@
+/* ***** 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 ***** */
+
+ace.define('ace/theme/tomorrow_night_bright', ['require', 'exports', 'module', 'ace/lib/dom'], function(require, exports, module) {
+
+exports.isDark = true;
+exports.cssClass = "ace-tomorrow-night-bright";
+exports.cssText = ".ace-tomorrow-night-bright .ace_editor {\
+ border: 2px solid rgb(159, 159, 159)\
+}\
+\
+.ace-tomorrow-night-bright .ace_editor.ace_focus {\
+ border: 2px solid #327fbd\
+}\
+\
+.ace-tomorrow-night-bright .ace_gutter {\
+ background: #1a1a1a;\
+ color: #DEDEDE\
+}\
+\
+.ace-tomorrow-night-bright .ace_print_margin {\
+ width: 1px;\
+ background: #1a1a1a\
+}\
+\
+.ace-tomorrow-night-bright .ace_scroller {\
+ background-color: #000000\
+}\
+\
+.ace-tomorrow-night-bright .ace_text-layer {\
+ color: #DEDEDE\
+}\
+\
+.ace-tomorrow-night-bright .ace_cursor {\
+ border-left: 2px solid #9F9F9F\
+}\
+\
+.ace-tomorrow-night-bright .ace_cursor.ace_overwrite {\
+ border-left: 0px;\
+ border-bottom: 1px solid #9F9F9F\
+}\
+\
+.ace-tomorrow-night-bright .ace_marker-layer .ace_selection {\
+ background: #424242\
+}\
+\
+.ace-tomorrow-night-bright.multiselect .ace_selection.start {\
+ box-shadow: 0 0 3px 0px #000000;\
+ border-radius: 2px\
+}\
+\
+.ace-tomorrow-night-bright .ace_marker-layer .ace_step {\
+ background: rgb(102, 82, 0)\
+}\
+\
+.ace-tomorrow-night-bright .ace_marker-layer .ace_bracket {\
+ margin: -1px 0 0 -1px;\
+ border: 1px solid #343434\
+}\
+\
+.ace-tomorrow-night-bright .ace_marker-layer .ace_active_line {\
+ background: #2A2A2A\
+}\
+\
+.ace-tomorrow-night-bright .ace_gutter_active_line {\
+ background-color: #2A2A2A\
+}\
+\
+.ace-tomorrow-night-bright .ace_marker-layer .ace_selected_word {\
+ border: 1px solid #424242\
+}\
+\
+.ace-tomorrow-night-bright .ace_invisible {\
+ color: #343434\
+}\
+\
+.ace-tomorrow-night-bright .ace_keyword,\
+.ace-tomorrow-night-bright .ace_meta,\
+.ace-tomorrow-night-bright .ace_storage,\
+.ace-tomorrow-night-bright .ace_storage.ace_type,\
+.ace-tomorrow-night-bright .ace_support.ace_type {\
+ color: #C397D8\
+}\
+\
+.ace-tomorrow-night-bright .ace_keyword.ace_operator {\
+ color: #70C0B1\
+}\
+\
+.ace-tomorrow-night-bright .ace_constant.ace_character,\
+.ace-tomorrow-night-bright .ace_constant.ace_language,\
+.ace-tomorrow-night-bright .ace_constant.ace_numeric,\
+.ace-tomorrow-night-bright .ace_keyword.ace_other.ace_unit,\
+.ace-tomorrow-night-bright .ace_support.ace_constant,\
+.ace-tomorrow-night-bright .ace_variable.ace_parameter {\
+ color: #E78C45\
+}\
+\
+.ace-tomorrow-night-bright .ace_constant.ace_other {\
+ color: #EEEEEE\
+}\
+\
+.ace-tomorrow-night-bright .ace_invalid {\
+ color: #CED2CF;\
+ background-color: #DF5F5F\
+}\
+\
+.ace-tomorrow-night-bright .ace_invalid.ace_deprecated {\
+ color: #CED2CF;\
+ background-color: #B798BF\
+}\
+\
+.ace-tomorrow-night-bright .ace_fold {\
+ background-color: #7AA6DA;\
+ border-color: #DEDEDE\
+}\
+\
+.ace-tomorrow-night-bright .ace_entity.ace_name.ace_function,\
+.ace-tomorrow-night-bright .ace_support.ace_function,\
+.ace-tomorrow-night-bright .ace_variable {\
+ color: #7AA6DA\
+}\
+\
+.ace-tomorrow-night-bright .ace_support.ace_class,\
+.ace-tomorrow-night-bright .ace_support.ace_type {\
+ color: #E7C547\
+}\
+\
+.ace-tomorrow-night-bright .ace_markup.ace_heading,\
+.ace-tomorrow-night-bright .ace_string {\
+ color: #B9CA4A\
+}\
+\
+.ace-tomorrow-night-bright .ace_entity.ace_name.ace_tag,\
+.ace-tomorrow-night-bright .ace_entity.ace_other.ace_attribute-name,\
+.ace-tomorrow-night-bright .ace_meta.ace_tag,\
+.ace-tomorrow-night-bright .ace_string.ace_regexp,\
+.ace-tomorrow-night-bright .ace_variable {\
+ color: #D54E53\
+}\
+\
+.ace-tomorrow-night-bright .ace_comment {\
+ color: #969896\
+}\
+\
+.ace-tomorrow-night-bright .ace_markup.ace_underline {\
+ text-decoration: underline\
+}\
+\
+.ace-tomorrow-night-bright .ace_indent-guide {\
+ background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGD4z7Bq1ar/AAz9A/2naJQKAAAAAElFTkSuQmCC) right repeat-y\
+}";
+
+var dom = require("../lib/dom");
+dom.importCssString(exports.cssText, exports.cssClass);
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/theme-tomorrow_night_eighties.js b/vendor/assets/javascripts/ace-src-noconflict/theme-tomorrow_night_eighties.js
new file mode 100644
index 00000000000..e68e3279d4d
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/theme-tomorrow_night_eighties.js
@@ -0,0 +1,178 @@
+/* ***** 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 ***** */
+
+ace.define('ace/theme/tomorrow_night_eighties', ['require', 'exports', 'module', 'ace/lib/dom'], function(require, exports, module) {
+
+exports.isDark = true;
+exports.cssClass = "ace-tomorrow-night-eighties";
+exports.cssText = ".ace-tomorrow-night-eighties .ace_editor {\
+ border: 2px solid rgb(159, 159, 159)\
+}\
+\
+.ace-tomorrow-night-eighties .ace_editor.ace_focus {\
+ border: 2px solid #327fbd\
+}\
+\
+.ace-tomorrow-night-eighties .ace_gutter {\
+ background: #272727;\
+ color: #CCC\
+}\
+\
+.ace-tomorrow-night-eighties .ace_print_margin {\
+ width: 1px;\
+ background: #272727\
+}\
+\
+.ace-tomorrow-night-eighties .ace_scroller {\
+ background-color: #2D2D2D\
+}\
+\
+.ace-tomorrow-night-eighties .ace_constant.ace_other,\
+.ace-tomorrow-night-eighties .ace_text-layer {\
+ color: #CCCCCC\
+}\
+\
+.ace-tomorrow-night-eighties .ace_cursor {\
+ border-left: 2px solid #CCCCCC\
+}\
+\
+.ace-tomorrow-night-eighties .ace_cursor.ace_overwrite {\
+ border-left: 0px;\
+ border-bottom: 1px solid #CCCCCC\
+}\
+\
+.ace-tomorrow-night-eighties .ace_marker-layer .ace_selection {\
+ background: #515151\
+}\
+\
+.ace-tomorrow-night-eighties.multiselect .ace_selection.start {\
+ box-shadow: 0 0 3px 0px #2D2D2D;\
+ border-radius: 2px\
+}\
+\
+.ace-tomorrow-night-eighties .ace_marker-layer .ace_step {\
+ background: rgb(102, 82, 0)\
+}\
+\
+.ace-tomorrow-night-eighties .ace_marker-layer .ace_bracket {\
+ margin: -1px 0 0 -1px;\
+ border: 1px solid #6A6A6A\
+}\
+\
+.ace-tomorrow-night-eighties .ace_marker-layer .ace_active_line {\
+ background: #393939\
+}\
+\
+.ace-tomorrow-night-eighties .ace_gutter_active_line {\
+ background-color: #393939\
+}\
+\
+.ace-tomorrow-night-eighties .ace_marker-layer .ace_selected_word {\
+ border: 1px solid #515151\
+}\
+\
+.ace-tomorrow-night-eighties .ace_invisible {\
+ color: #6A6A6A\
+}\
+\
+.ace-tomorrow-night-eighties .ace_keyword,\
+.ace-tomorrow-night-eighties .ace_meta,\
+.ace-tomorrow-night-eighties .ace_storage,\
+.ace-tomorrow-night-eighties .ace_storage.ace_type,\
+.ace-tomorrow-night-eighties .ace_support.ace_type {\
+ color: #CC99CC\
+}\
+\
+.ace-tomorrow-night-eighties .ace_keyword.ace_operator {\
+ color: #66CCCC\
+}\
+\
+.ace-tomorrow-night-eighties .ace_constant.ace_character,\
+.ace-tomorrow-night-eighties .ace_constant.ace_language,\
+.ace-tomorrow-night-eighties .ace_constant.ace_numeric,\
+.ace-tomorrow-night-eighties .ace_keyword.ace_other.ace_unit,\
+.ace-tomorrow-night-eighties .ace_support.ace_constant,\
+.ace-tomorrow-night-eighties .ace_variable.ace_parameter {\
+ color: #F99157\
+}\
+\
+.ace-tomorrow-night-eighties .ace_invalid {\
+ color: #CDCDCD;\
+ background-color: #F2777A\
+}\
+\
+.ace-tomorrow-night-eighties .ace_invalid.ace_deprecated {\
+ color: #CDCDCD;\
+ background-color: #CC99CC\
+}\
+\
+.ace-tomorrow-night-eighties .ace_fold {\
+ background-color: #6699CC;\
+ border-color: #CCCCCC\
+}\
+\
+.ace-tomorrow-night-eighties .ace_entity.ace_name.ace_function,\
+.ace-tomorrow-night-eighties .ace_support.ace_function,\
+.ace-tomorrow-night-eighties .ace_variable {\
+ color: #6699CC\
+}\
+\
+.ace-tomorrow-night-eighties .ace_support.ace_class,\
+.ace-tomorrow-night-eighties .ace_support.ace_type {\
+ color: #FFCC66\
+}\
+\
+.ace-tomorrow-night-eighties .ace_markup.ace_heading,\
+.ace-tomorrow-night-eighties .ace_string {\
+ color: #99CC99\
+}\
+\
+.ace-tomorrow-night-eighties .ace_comment {\
+ color: #999999\
+}\
+\
+.ace-tomorrow-night-eighties .ace_entity.ace_name.ace_tag,\
+.ace-tomorrow-night-eighties .ace_entity.ace_other.ace_attribute-name,\
+.ace-tomorrow-night-eighties .ace_meta.ace_tag,\
+.ace-tomorrow-night-eighties .ace_variable {\
+ color: #F2777A\
+}\
+\
+.ace-tomorrow-night-eighties .ace_markup.ace_underline {\
+ text-decoration: underline\
+}\
+\
+.ace-tomorrow-night-eighties .ace_indent-guide {\
+ background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPQ1dX9z7Bq1ar/ABE1BITwhhuFAAAAAElFTkSuQmCC) right repeat-y\
+}";
+
+var dom = require("../lib/dom");
+dom.importCssString(exports.cssText, exports.cssClass);
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/theme-twilight.js b/vendor/assets/javascripts/ace-src-noconflict/theme-twilight.js
new file mode 100644
index 00000000000..925093bbc26
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/theme-twilight.js
@@ -0,0 +1,184 @@
+/* ***** 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 ***** */
+
+ace.define('ace/theme/twilight', ['require', 'exports', 'module', 'ace/lib/dom'], function(require, exports, module) {
+
+exports.isDark = true;
+exports.cssClass = "ace-twilight";
+exports.cssText = ".ace-twilight .ace_editor {\
+ border: 2px solid rgb(159, 159, 159)\
+}\
+\
+.ace-twilight .ace_editor.ace_focus {\
+ border: 2px solid #327fbd\
+}\
+\
+.ace-twilight .ace_gutter {\
+ background: #232323;\
+ color: #E2E2E2\
+}\
+\
+.ace-twilight .ace_print_margin {\
+ width: 1px;\
+ background: #232323\
+}\
+\
+.ace-twilight .ace_scroller {\
+ background-color: #141414\
+}\
+\
+.ace-twilight .ace_text-layer {\
+ color: #F8F8F8\
+}\
+\
+.ace-twilight .ace_cursor {\
+ border-left: 2px solid #A7A7A7\
+}\
+\
+.ace-twilight .ace_cursor.ace_overwrite {\
+ border-left: 0px;\
+ border-bottom: 1px solid #A7A7A7\
+}\
+\
+.ace-twilight .ace_marker-layer .ace_selection {\
+ background: rgba(221, 240, 255, 0.20)\
+}\
+\
+.ace-twilight.multiselect .ace_selection.start {\
+ box-shadow: 0 0 3px 0px #141414;\
+ border-radius: 2px\
+}\
+\
+.ace-twilight .ace_marker-layer .ace_step {\
+ background: rgb(102, 82, 0)\
+}\
+\
+.ace-twilight .ace_marker-layer .ace_bracket {\
+ margin: -1px 0 0 -1px;\
+ border: 1px solid rgba(255, 255, 255, 0.25)\
+}\
+\
+.ace-twilight .ace_marker-layer .ace_active_line {\
+ background: rgba(255, 255, 255, 0.031)\
+}\
+\
+.ace-twilight .ace_gutter_active_line {\
+ background-color: rgba(255, 255, 255, 0.031)\
+}\
+\
+.ace-twilight .ace_marker-layer .ace_selected_word {\
+ border: 1px solid rgba(221, 240, 255, 0.20)\
+}\
+\
+.ace-twilight .ace_invisible {\
+ color: rgba(255, 255, 255, 0.25)\
+}\
+\
+.ace-twilight .ace_keyword,\
+.ace-twilight .ace_meta {\
+ color: #CDA869\
+}\
+\
+.ace-twilight .ace_constant,\
+.ace-twilight .ace_constant.ace_character,\
+.ace-twilight .ace_constant.ace_character.ace_escape,\
+.ace-twilight .ace_constant.ace_other,\
+.ace-twilight .ace_markup.ace_heading,\
+.ace-twilight .ace_support.ace_constant {\
+ color: #CF6A4C\
+}\
+\
+.ace-twilight .ace_invalid.ace_illegal {\
+ color: #F8F8F8;\
+ background-color: rgba(86, 45, 86, 0.75)\
+}\
+\
+.ace-twilight .ace_invalid.ace_deprecated {\
+ text-decoration: underline;\
+ font-style: italic;\
+ color: #D2A8A1\
+}\
+\
+.ace-twilight .ace_support {\
+ color: #9B859D\
+}\
+\
+.ace-twilight .ace_fold {\
+ background-color: #AC885B;\
+ border-color: #F8F8F8\
+}\
+\
+.ace-twilight .ace_support.ace_function {\
+ color: #DAD085\
+}\
+\
+.ace-twilight .ace_markup.ace_list,\
+.ace-twilight .ace_storage {\
+ color: #F9EE98\
+}\
+\
+.ace-twilight .ace_entity.ace_name.ace_function,\
+.ace-twilight .ace_meta.ace_tag,\
+.ace-twilight .ace_variable {\
+ color: #AC885B\
+}\
+\
+.ace-twilight .ace_string {\
+ color: #8F9D6A\
+}\
+\
+.ace-twilight .ace_string.ace_regexp {\
+ color: #E9C062\
+}\
+\
+.ace-twilight .ace_comment {\
+ font-style: italic;\
+ color: #5F5A60\
+}\
+\
+.ace-twilight .ace_variable {\
+ color: #7587A6\
+}\
+\
+.ace-twilight .ace_xml_pe {\
+ color: #494949\
+}\
+\
+.ace-twilight .ace_markup.ace_underline {\
+ text-decoration: underline\
+}\
+\
+.ace-twilight .ace_indent-guide {\
+ background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWMQERH5zzBz5sz/AA5EBAYqeZXWAAAAAElFTkSuQmCC) right repeat-y\
+}";
+
+var dom = require("../lib/dom");
+dom.importCssString(exports.cssText, exports.cssClass);
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/theme-vibrant_ink.js b/vendor/assets/javascripts/ace-src-noconflict/theme-vibrant_ink.js
new file mode 100644
index 00000000000..097810cd389
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/theme-vibrant_ink.js
@@ -0,0 +1,164 @@
+/* ***** 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 ***** */
+
+ace.define('ace/theme/vibrant_ink', ['require', 'exports', 'module', 'ace/lib/dom'], function(require, exports, module) {
+
+exports.isDark = true;
+exports.cssClass = "ace-vibrant-ink";
+exports.cssText = ".ace-vibrant-ink .ace_editor {\
+ border: 2px solid rgb(159, 159, 159)\
+}\
+\
+.ace-vibrant-ink .ace_editor.ace_focus {\
+ border: 2px solid #327fbd\
+}\
+\
+.ace-vibrant-ink .ace_gutter {\
+ background: #1a1a1a;\
+ color: #BEBEBE\
+}\
+\
+.ace-vibrant-ink .ace_print_margin {\
+ width: 1px;\
+ background: #1a1a1a\
+}\
+\
+.ace-vibrant-ink .ace_scroller {\
+ background-color: #0F0F0F\
+}\
+\
+.ace-vibrant-ink .ace_text-layer {\
+ color: #FFFFFF\
+}\
+\
+.ace-vibrant-ink .ace_cursor {\
+ border-left: 2px solid #FFFFFF\
+}\
+\
+.ace-vibrant-ink .ace_cursor.ace_overwrite {\
+ border-left: 0px;\
+ border-bottom: 1px solid #FFFFFF\
+}\
+\
+.ace-vibrant-ink .ace_marker-layer .ace_selection {\
+ background: #6699CC\
+}\
+\
+.ace-vibrant-ink.multiselect .ace_selection.start {\
+ box-shadow: 0 0 3px 0px #0F0F0F;\
+ border-radius: 2px\
+}\
+\
+.ace-vibrant-ink .ace_marker-layer .ace_step {\
+ background: rgb(102, 82, 0)\
+}\
+\
+.ace-vibrant-ink .ace_marker-layer .ace_bracket {\
+ margin: -1px 0 0 -1px;\
+ border: 1px solid #404040\
+}\
+\
+.ace-vibrant-ink .ace_marker-layer .ace_active_line {\
+ background: #333333\
+}\
+\
+.ace-vibrant-ink .ace_gutter_active_line {\
+ background-color: #333333\
+}\
+\
+.ace-vibrant-ink .ace_marker-layer .ace_selected_word {\
+ border: 1px solid #6699CC\
+}\
+\
+.ace-vibrant-ink .ace_invisible {\
+ color: #404040\
+}\
+\
+.ace-vibrant-ink .ace_keyword,\
+.ace-vibrant-ink .ace_meta {\
+ color: #FF6600\
+}\
+\
+.ace-vibrant-ink .ace_constant,\
+.ace-vibrant-ink .ace_constant.ace_character,\
+.ace-vibrant-ink .ace_constant.ace_character.ace_escape,\
+.ace-vibrant-ink .ace_constant.ace_other {\
+ color: #339999\
+}\
+\
+.ace-vibrant-ink .ace_constant.ace_numeric {\
+ color: #99CC99\
+}\
+\
+.ace-vibrant-ink .ace_invalid,\
+.ace-vibrant-ink .ace_invalid.ace_deprecated {\
+ color: #CCFF33;\
+ background-color: #000000\
+}\
+\
+.ace-vibrant-ink .ace_fold {\
+ background-color: #FFCC00;\
+ border-color: #FFFFFF\
+}\
+\
+.ace-vibrant-ink .ace_entity.ace_name.ace_function,\
+.ace-vibrant-ink .ace_support.ace_function,\
+.ace-vibrant-ink .ace_variable {\
+ color: #FFCC00\
+}\
+\
+.ace-vibrant-ink .ace_variable.ace_parameter {\
+ font-style: italic\
+}\
+\
+.ace-vibrant-ink .ace_string {\
+ color: #66FF00\
+}\
+\
+.ace-vibrant-ink .ace_string.ace_regexp {\
+ color: #44B4CC\
+}\
+\
+.ace-vibrant-ink .ace_comment {\
+ color: #9933CC\
+}\
+\
+.ace-vibrant-ink .ace_entity.ace_other.ace_attribute-name {\
+ font-style: italic;\
+ color: #99CC99\
+}\
+\
+.ace-vibrant-ink .ace_indent-guide {\
+ background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPg5+f/z7Bq1ar/AA5lBCqoLxsgAAAAAElFTkSuQmCC) right repeat-y\
+}";
+
+var dom = require("../lib/dom");
+dom.importCssString(exports.cssText, exports.cssClass);
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/theme-xcode.js b/vendor/assets/javascripts/ace-src-noconflict/theme-xcode.js
new file mode 100644
index 00000000000..7c040fa2810
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/theme-xcode.js
@@ -0,0 +1,156 @@
+/* ***** 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 ***** */
+
+ace.define('ace/theme/xcode', ['require', 'exports', 'module', 'ace/lib/dom'], function(require, exports, module) {
+
+exports.isDark = false;
+exports.cssClass = "ace-xcode";
+exports.cssText = "/* THIS THEME WAS AUTOGENERATED BY Theme.tmpl.css (UUID: EE3AD170-2B7F-4DE1-B724-C75F13FE0085) */\
+.ace-xcode .ace_editor {\
+ border: 2px solid rgb(159, 159, 159)\
+}\
+\
+.ace-xcode .ace_editor.ace_focus {\
+ border: 2px solid #327fbd\
+}\
+\
+.ace-xcode .ace_gutter {\
+ background: #e8e8e8;\
+ color: #333\
+}\
+\
+.ace-xcode .ace_print_margin {\
+ width: 1px;\
+ background: #e8e8e8\
+}\
+\
+.ace-xcode .ace_scroller {\
+ background-color: #FFFFFF\
+}\
+\
+.ace-xcode .ace_text-layer {\
+ color: #000000\
+}\
+\
+.ace-xcode .ace_cursor {\
+ border-left: 2px solid #000000\
+}\
+\
+.ace-xcode .ace_cursor.ace_overwrite {\
+ border-left: 0px;\
+ border-bottom: 1px solid #000000\
+}\
+\
+.ace-xcode .ace_marker-layer .ace_selection {\
+ background: #B5D5FF\
+}\
+\
+.ace-xcode.multiselect .ace_selection.start {\
+ box-shadow: 0 0 3px 0px #FFFFFF;\
+ border-radius: 2px\
+}\
+\
+.ace-xcode .ace_marker-layer .ace_step {\
+ background: rgb(198, 219, 174)\
+}\
+\
+.ace-xcode .ace_marker-layer .ace_bracket {\
+ margin: -1px 0 0 -1px;\
+ border: 1px solid #BFBFBF\
+}\
+\
+.ace-xcode .ace_marker-layer .ace_active_line {\
+ background: rgba(0, 0, 0, 0.071)\
+}\
+\
+.ace-xcode .ace_gutter_active_line {\
+ background-color: rgba(0, 0, 0, 0.071)\
+}\
+\
+.ace-xcode .ace_marker-layer .ace_selected_word {\
+ border: 1px solid #B5D5FF\
+}\
+\
+.ace-xcode .ace_constant.ace_language,\
+.ace-xcode .ace_keyword,\
+.ace-xcode .ace_meta,\
+.ace-xcode .ace_variable.ace_language {\
+ color: #C800A4\
+}\
+\
+.ace-xcode .ace_invisible {\
+ color: #BFBFBF\
+}\
+\
+.ace-xcode .ace_constant.ace_character,\
+.ace-xcode .ace_constant.ace_other {\
+ color: #275A5E\
+}\
+\
+.ace-xcode .ace_constant.ace_numeric {\
+ color: #3A00DC\
+}\
+\
+.ace-xcode .ace_entity.ace_other.ace_attribute-name,\
+.ace-xcode .ace_support.ace_constant,\
+.ace-xcode .ace_support.ace_function {\
+ color: #450084\
+}\
+\
+.ace-xcode .ace_fold {\
+ background-color: #C800A4;\
+ border-color: #000000\
+}\
+\
+.ace-xcode .ace_entity.ace_name.ace_tag,\
+.ace-xcode .ace_support.ace_class,\
+.ace-xcode .ace_support.ace_type {\
+ color: #790EAD\
+}\
+\
+.ace-xcode .ace_storage {\
+ color: #C900A4\
+}\
+\
+.ace-xcode .ace_string {\
+ color: #DF0002\
+}\
+\
+.ace-xcode .ace_comment {\
+ color: #008E00\
+}\
+\
+.ace-xcode .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/vendor/assets/javascripts/ace-src-noconflict/worker-coffee.js b/vendor/assets/javascripts/ace-src-noconflict/worker-coffee.js
new file mode 100644
index 00000000000..3a7bf80fcec
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/worker-coffee.js
@@ -0,0 +1,7213 @@
+"no use strict";
+
+var console = {
+ log: function(msgs) {
+ postMessage({type: "log", data: arguments.join(" ")});
+ }
+};
+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("/");
+ var moduleName = base + "/" + moduleName;
+
+ while(moduleName.indexOf(".") !== -1 && previous != moduleName) {
+ var previous = moduleName;
+ var 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");
+
+ var 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) {
+ main[msg.command].apply(main, msg.args);
+ }
+ 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:
+// -- kriskowal Kris Kowal Copyright (C) 2009-2010 MIT License
+// -- tlrobinson Tom Robinson Copyright (C) 2009-2010 MIT License (Narwhal Project)
+// -- dantman Daniel Friesen Copyright(C) 2010 XXX No License Specified
+// -- fschaefer Florian Schäfer Copyright (C) 2010 MIT License
+// -- Irakli Gozalishvili Copyright (C) 2010 MIT License
+
+/*!
+ Copyright (c) 2009, 280 North Inc. http://280north.com/
+ MIT License. http://github.com/280north/narwhal/blob/master/README.md
+*/
+
+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) {
+
+
+ //---------------------------------
+ // Private variables
+ //---------------------------------
+
+ 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;
+
+ //---------------------------------
+ // Overriden native methods
+ //---------------------------------
+
+ // Adds named capture support (with backreferences returned as `result.name`), and fixes two
+ // cross-browser issues per ES3:
+ // - Captured values for nonparticipating capturing groups should be returned as `undefined`,
+ // rather than the empty string.
+ // - `lastIndex` should not be incremented after zero-length matches.
+ RegExp.prototype.exec = function (str) {
+ var match = real.exec.apply(this, arguments),
+ name, r2;
+ if ( typeof(str) == 'string' && match) {
+ // Fix browsers whose `exec` methods don't consistently return `undefined` for
+ // nonparticipating capturing groups
+ if (!compliantExecNpcg && match.length > 1 && indexOf(match, "") > -1) {
+ r2 = RegExp(this.source, real.replace.call(getNativeFlags(this), "g", ""));
+ // Using `str.slice(match.index)` rather than `match[0]` in case lookahead allowed
+ // matching due to characters outside the match
+ 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;
+ }
+ });
+ }
+ // Attach named capture properties
+ 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];
+ }
+ }
+ // Fix browsers that increment `lastIndex` after zero-length matches
+ if (!compliantLastIndexIncrement && this.global && !match[0].length && (this.lastIndex > match.index))
+ this.lastIndex--;
+ }
+ return match;
+ };
+
+ // Don't override `test` if it won't change anything
+ if (!compliantLastIndexIncrement) {
+ // Fix browser bug in native method
+ RegExp.prototype.test = function (str) {
+ // Use the native `exec` to skip some processing overhead, even though the overriden
+ // `exec` would take care of the `lastIndex` fix
+ var match = real.exec.call(this, str);
+ // Fix browsers that increment `lastIndex` after zero-length matches
+ if (match && this.global && !match[0].length && (this.lastIndex > match.index))
+ this.lastIndex--;
+ return !!match;
+ };
+ }
+
+ //---------------------------------
+ // Private helper functions
+ //---------------------------------
+
+ 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;
+ }
+
+});
+// vim: ts=4 sts=4 sw=4 expandtab
+// -- kriskowal Kris Kowal Copyright (C) 2009-2011 MIT License
+// -- tlrobinson Tom Robinson Copyright (C) 2009-2010 MIT License (Narwhal Project)
+// -- dantman Daniel Friesen Copyright (C) 2010 XXX TODO License or CLA
+// -- fschaefer Florian Schäfer Copyright (C) 2010 MIT License
+// -- Gozala Irakli Gozalishvili Copyright (C) 2010 MIT License
+// -- kitcambridge Kit Cambridge Copyright (C) 2011 MIT License
+// -- kossnocorp Sasha Koss XXX TODO License or CLA
+// -- bryanforbes Bryan Forbes XXX TODO License or CLA
+// -- killdream Quildreen Motta Copyright (C) 2011 MIT Licence
+// -- michaelficarra Michael Ficarra Copyright (C) 2011 3-clause BSD License
+// -- sharkbrainguy Gerard Paapu Copyright (C) 2011 MIT License
+// -- bbqsrc Brendan Molloy (C) 2011 Creative Commons Zero (public domain)
+// -- iwyg XXX TODO License or CLA
+// -- DomenicDenicola Domenic Denicola Copyright (C) 2011 MIT License
+// -- xavierm02 Montillet Xavier XXX TODO License or CLA
+// -- Raynos Raynos XXX TODO License or CLA
+// -- samsonjs Sami Samhuri Copyright (C) 2010 MIT License
+// -- rwldrn Rick Waldron Copyright (C) 2011 MIT License
+// -- lexer Alexey Zakharov XXX TODO License or CLA
+
+/*!
+ Copyright (c) 2009, 280 North Inc. http://280north.com/
+ MIT License. http://github.com/280north/narwhal/blob/master/README.md
+*/
+
+define('ace/lib/es5-shim', ['require', 'exports', 'module' ], function(require, exports, module) {
+
+/*
+ * Brings an environment as close to ECMAScript 5 compliance
+ * as is possible with the facilities of erstwhile engines.
+ *
+ * Annotated ES5: http://es5.github.com/ (specific links below)
+ * ES5 Spec: http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf
+ *
+ * @module
+ */
+
+/*whatsupdoc*/
+
+//
+// Function
+// ========
+//
+
+// ES-5 15.3.4.5
+// http://es5.github.com/#x15.3.4.5
+
+if (!Function.prototype.bind) {
+ Function.prototype.bind = function bind(that) { // .length is 1
+ // 1. Let Target be the this value.
+ var target = this;
+ // 2. If IsCallable(Target) is false, throw a TypeError exception.
+ if (typeof target != "function")
+ throw new TypeError(); // TODO message
+ // 3. Let A be a new (possibly empty) internal list of all of the
+ // argument values provided after thisArg (arg1, arg2 etc), in order.
+ // XXX slicedArgs will stand in for "A" if used
+ var args = slice.call(arguments, 1); // for normal call
+ // 4. Let F be a new native ECMAScript object.
+ // 11. Set the [[Prototype]] internal property of F to the standard
+ // built-in Function prototype object as specified in 15.3.3.1.
+ // 12. Set the [[Call]] internal property of F as described in
+ // 15.3.4.5.1.
+ // 13. Set the [[Construct]] internal property of F as described in
+ // 15.3.4.5.2.
+ // 14. Set the [[HasInstance]] internal property of F as described in
+ // 15.3.4.5.3.
+ var bound = function () {
+
+ if (this instanceof bound) {
+ // 15.3.4.5.2 [[Construct]]
+ // When the [[Construct]] internal method of a function object,
+ // F that was created using the bind function is called with a
+ // list of arguments ExtraArgs, the following steps are taken:
+ // 1. Let target be the value of F's [[TargetFunction]]
+ // internal property.
+ // 2. If target has no [[Construct]] internal method, a
+ // TypeError exception is thrown.
+ // 3. Let boundArgs be the value of F's [[BoundArgs]] internal
+ // property.
+ // 4. Let args be a new list containing the same values as the
+ // list boundArgs in the same order followed by the same
+ // values as the list ExtraArgs in the same order.
+ // 5. Return the result of calling the [[Construct]] internal
+ // method of target providing args as the arguments.
+
+ var F = function(){};
+ F.prototype = target.prototype;
+ var self = new F;
+
+ var result = target.apply(
+ self,
+ args.concat(slice.call(arguments))
+ );
+ if (result !== null && Object(result) === result)
+ return result;
+ return self;
+
+ } else {
+ // 15.3.4.5.1 [[Call]]
+ // When the [[Call]] internal method of a function object, F,
+ // which was created using the bind function is called with a
+ // this value and a list of arguments ExtraArgs, the following
+ // steps are taken:
+ // 1. Let boundArgs be the value of F's [[BoundArgs]] internal
+ // property.
+ // 2. Let boundThis be the value of F's [[BoundThis]] internal
+ // property.
+ // 3. Let target be the value of F's [[TargetFunction]] internal
+ // property.
+ // 4. Let args be a new list containing the same values as the
+ // list boundArgs in the same order followed by the same
+ // values as the list ExtraArgs in the same order.
+ // 5. Return the result of calling the [[Call]] internal method
+ // of target providing boundThis as the this value and
+ // providing args as the arguments.
+
+ // equiv: target.call(this, ...boundArgs, ...args)
+ return target.apply(
+ that,
+ args.concat(slice.call(arguments))
+ );
+
+ }
+
+ };
+ // XXX bound.length is never writable, so don't even try
+ //
+ // 15. If the [[Class]] internal property of Target is "Function", then
+ // a. Let L be the length property of Target minus the length of A.
+ // b. Set the length own property of F to either 0 or L, whichever is
+ // larger.
+ // 16. Else set the length own property of F to 0.
+ // 17. Set the attributes of the length own property of F to the values
+ // specified in 15.3.5.1.
+
+ // TODO
+ // 18. Set the [[Extensible]] internal property of F to true.
+
+ // TODO
+ // 19. Let thrower be the [[ThrowTypeError]] function Object (13.2.3).
+ // 20. Call the [[DefineOwnProperty]] internal method of F with
+ // arguments "caller", PropertyDescriptor {[[Get]]: thrower, [[Set]]:
+ // thrower, [[Enumerable]]: false, [[Configurable]]: false}, and
+ // false.
+ // 21. Call the [[DefineOwnProperty]] internal method of F with
+ // arguments "arguments", PropertyDescriptor {[[Get]]: thrower,
+ // [[Set]]: thrower, [[Enumerable]]: false, [[Configurable]]: false},
+ // and false.
+
+ // TODO
+ // NOTE Function objects created using Function.prototype.bind do not
+ // have a prototype property or the [[Code]], [[FormalParameters]], and
+ // [[Scope]] internal properties.
+ // XXX can't delete prototype in pure-js.
+
+ // 22. Return F.
+ return bound;
+ };
+}
+
+// Shortcut to an often accessed properties, in order to avoid multiple
+// dereference that costs universally.
+// _Please note: Shortcuts are defined after `Function.prototype.bind` as we
+// us it in defining shortcuts.
+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);
+
+// If JS engine supports accessors creating shortcuts.
+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__);
+}
+
+//
+// Array
+// =====
+//
+
+// ES5 15.4.3.2
+// http://es5.github.com/#x15.4.3.2
+// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/isArray
+if (!Array.isArray) {
+ Array.isArray = function isArray(obj) {
+ return toString(obj) == "[object Array]";
+ };
+}
+
+// The IsCallable() check in the Array functions
+// has been replaced with a strict check on the
+// internal class of the object to trap cases where
+// the provided function was actually a regular
+// expression literal, which in V8 and
+// JavaScriptCore is a typeof "function". Only in
+// V8 are regular expression literals permitted as
+// reduce parameters, so it is desirable in the
+// general case for the shim to match the more
+// strict and common behavior of rejecting regular
+// expressions.
+
+// ES5 15.4.4.18
+// http://es5.github.com/#x15.4.4.18
+// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/array/forEach
+if (!Array.prototype.forEach) {
+ Array.prototype.forEach = function forEach(fun /*, thisp*/) {
+ var self = toObject(this),
+ thisp = arguments[1],
+ i = 0,
+ length = self.length >>> 0;
+
+ // If no callback function or if callback is not a callable function
+ if (toString(fun) != "[object Function]") {
+ throw new TypeError(); // TODO message
+ }
+
+ while (i < length) {
+ if (i in self) {
+ // Invoke the callback function with call, passing arguments:
+ // context, property value, property key, thisArg object context
+ fun.call(thisp, self[i], i, self);
+ }
+ i++;
+ }
+ };
+}
+
+// ES5 15.4.4.19
+// http://es5.github.com/#x15.4.4.19
+// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/map
+if (!Array.prototype.map) {
+ Array.prototype.map = function map(fun /*, thisp*/) {
+ var self = toObject(this),
+ length = self.length >>> 0,
+ result = Array(length),
+ thisp = arguments[1];
+
+ // If no callback function or if callback is not a callable function
+ if (toString(fun) != "[object Function]") {
+ throw new TypeError(); // TODO message
+ }
+
+ for (var i = 0; i < length; i++) {
+ if (i in self)
+ result[i] = fun.call(thisp, self[i], i, self);
+ }
+ return result;
+ };
+}
+
+// ES5 15.4.4.20
+// http://es5.github.com/#x15.4.4.20
+// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/filter
+if (!Array.prototype.filter) {
+ Array.prototype.filter = function filter(fun /*, thisp */) {
+ var self = toObject(this),
+ length = self.length >>> 0,
+ result = [],
+ thisp = arguments[1];
+
+ // If no callback function or if callback is not a callable function
+ if (toString(fun) != "[object Function]") {
+ throw new TypeError(); // TODO message
+ }
+
+ for (var i = 0; i < length; i++) {
+ if (i in self && fun.call(thisp, self[i], i, self))
+ result.push(self[i]);
+ }
+ return result;
+ };
+}
+
+// ES5 15.4.4.16
+// http://es5.github.com/#x15.4.4.16
+// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/every
+if (!Array.prototype.every) {
+ Array.prototype.every = function every(fun /*, thisp */) {
+ var self = toObject(this),
+ length = self.length >>> 0,
+ thisp = arguments[1];
+
+ // If no callback function or if callback is not a callable function
+ if (toString(fun) != "[object Function]") {
+ throw new TypeError(); // TODO message
+ }
+
+ for (var i = 0; i < length; i++) {
+ if (i in self && !fun.call(thisp, self[i], i, self))
+ return false;
+ }
+ return true;
+ };
+}
+
+// ES5 15.4.4.17
+// http://es5.github.com/#x15.4.4.17
+// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/some
+if (!Array.prototype.some) {
+ Array.prototype.some = function some(fun /*, thisp */) {
+ var self = toObject(this),
+ length = self.length >>> 0,
+ thisp = arguments[1];
+
+ // If no callback function or if callback is not a callable function
+ if (toString(fun) != "[object Function]") {
+ throw new TypeError(); // TODO message
+ }
+
+ for (var i = 0; i < length; i++) {
+ if (i in self && fun.call(thisp, self[i], i, self))
+ return true;
+ }
+ return false;
+ };
+}
+
+// ES5 15.4.4.21
+// http://es5.github.com/#x15.4.4.21
+// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/reduce
+if (!Array.prototype.reduce) {
+ Array.prototype.reduce = function reduce(fun /*, initial*/) {
+ var self = toObject(this),
+ length = self.length >>> 0;
+
+ // If no callback function or if callback is not a callable function
+ if (toString(fun) != "[object Function]") {
+ throw new TypeError(); // TODO message
+ }
+
+ // no value to return if no initial value and an empty array
+ if (!length && arguments.length == 1)
+ throw new TypeError(); // TODO message
+
+ var i = 0;
+ var result;
+ if (arguments.length >= 2) {
+ result = arguments[1];
+ } else {
+ do {
+ if (i in self) {
+ result = self[i++];
+ break;
+ }
+
+ // if array contains no values, no initial value to return
+ if (++i >= length)
+ throw new TypeError(); // TODO message
+ } while (true);
+ }
+
+ for (; i < length; i++) {
+ if (i in self)
+ result = fun.call(void 0, result, self[i], i, self);
+ }
+
+ return result;
+ };
+}
+
+// ES5 15.4.4.22
+// http://es5.github.com/#x15.4.4.22
+// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/reduceRight
+if (!Array.prototype.reduceRight) {
+ Array.prototype.reduceRight = function reduceRight(fun /*, initial*/) {
+ var self = toObject(this),
+ length = self.length >>> 0;
+
+ // If no callback function or if callback is not a callable function
+ if (toString(fun) != "[object Function]") {
+ throw new TypeError(); // TODO message
+ }
+
+ // no value to return if no initial value, empty array
+ if (!length && arguments.length == 1)
+ throw new TypeError(); // TODO message
+
+ var result, i = length - 1;
+ if (arguments.length >= 2) {
+ result = arguments[1];
+ } else {
+ do {
+ if (i in self) {
+ result = self[i--];
+ break;
+ }
+
+ // if array contains no values, no initial value to return
+ if (--i < 0)
+ throw new TypeError(); // TODO message
+ } while (true);
+ }
+
+ do {
+ if (i in this)
+ result = fun.call(void 0, result, self[i], i, self);
+ } while (i--);
+
+ return result;
+ };
+}
+
+// ES5 15.4.4.14
+// http://es5.github.com/#x15.4.4.14
+// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/indexOf
+if (!Array.prototype.indexOf) {
+ Array.prototype.indexOf = function indexOf(sought /*, fromIndex */ ) {
+ var self = toObject(this),
+ length = self.length >>> 0;
+
+ if (!length)
+ return -1;
+
+ var i = 0;
+ if (arguments.length > 1)
+ i = toInteger(arguments[1]);
+
+ // handle negative indices
+ i = i >= 0 ? i : Math.max(0, length + i);
+ for (; i < length; i++) {
+ if (i in self && self[i] === sought) {
+ return i;
+ }
+ }
+ return -1;
+ };
+}
+
+// ES5 15.4.4.15
+// http://es5.github.com/#x15.4.4.15
+// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/lastIndexOf
+if (!Array.prototype.lastIndexOf) {
+ Array.prototype.lastIndexOf = function lastIndexOf(sought /*, fromIndex */) {
+ var self = 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]));
+ // handle negative indices
+ i = i >= 0 ? i : length - Math.abs(i);
+ for (; i >= 0; i--) {
+ if (i in self && sought === self[i])
+ return i;
+ }
+ return -1;
+ };
+}
+
+//
+// Object
+// ======
+//
+
+// ES5 15.2.3.2
+// http://es5.github.com/#x15.2.3.2
+if (!Object.getPrototypeOf) {
+ // https://github.com/kriskowal/es5-shim/issues#issue/2
+ // http://ejohn.org/blog/objectgetprototypeof/
+ // recommended by fschaefer on github
+ Object.getPrototypeOf = function getPrototypeOf(object) {
+ return object.__proto__ || (
+ object.constructor ?
+ object.constructor.prototype :
+ prototypeOfObject
+ );
+ };
+}
+
+// ES5 15.2.3.3
+// http://es5.github.com/#x15.2.3.3
+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 object does not owns property return undefined immediately.
+ if (!owns(object, property))
+ return;
+
+ var descriptor, getter, setter;
+
+ // If object has a property then it's for sure both `enumerable` and
+ // `configurable`.
+ descriptor = { enumerable: true, configurable: true };
+
+ // If JS engine supports accessor properties then property may be a
+ // getter or setter.
+ if (supportsAccessors) {
+ // Unfortunately `__lookupGetter__` will return a getter even
+ // if object has own non getter property along with a same named
+ // inherited getter. To avoid misbehavior we temporary remove
+ // `__proto__` so that `__lookupGetter__` will return getter only
+ // if it's owned by an object.
+ var prototype = object.__proto__;
+ object.__proto__ = prototypeOfObject;
+
+ var getter = lookupGetter(object, property);
+ var setter = lookupSetter(object, property);
+
+ // Once we have getter and setter we can put values back.
+ object.__proto__ = prototype;
+
+ if (getter || setter) {
+ if (getter) descriptor.get = getter;
+ if (setter) descriptor.set = setter;
+
+ // If it was accessor property we're done and return here
+ // in order to avoid adding `value` to the descriptor.
+ return descriptor;
+ }
+ }
+
+ // If we got this far we know that object has an own property that is
+ // not an accessor so we set it as a value and return descriptor.
+ descriptor.value = object[property];
+ return descriptor;
+ };
+}
+
+// ES5 15.2.3.4
+// http://es5.github.com/#x15.2.3.4
+if (!Object.getOwnPropertyNames) {
+ Object.getOwnPropertyNames = function getOwnPropertyNames(object) {
+ return Object.keys(object);
+ };
+}
+
+// ES5 15.2.3.5
+// http://es5.github.com/#x15.2.3.5
+if (!Object.create) {
+ Object.create = function create(prototype, properties) {
+ var object;
+ if (prototype === null) {
+ object = { "__proto__": null };
+ } else {
+ if (typeof prototype != "object")
+ throw new TypeError("typeof prototype["+(typeof prototype)+"] != 'object'");
+ var Type = function () {};
+ Type.prototype = prototype;
+ object = new Type();
+ // IE has no built-in implementation of `Object.getPrototypeOf`
+ // neither `__proto__`, but this manually setting `__proto__` will
+ // guarantee that `Object.getPrototypeOf` will work as expected with
+ // objects created using `Object.create`
+ object.__proto__ = prototype;
+ }
+ if (properties !== void 0)
+ Object.defineProperties(object, properties);
+ return object;
+ };
+}
+
+// ES5 15.2.3.6
+// http://es5.github.com/#x15.2.3.6
+
+// Patch for WebKit and IE8 standard mode
+// Designed by hax <hax.github.com>
+// related issue: https://github.com/kriskowal/es5-shim/issues#issue/5
+// IE8 Reference:
+// http://msdn.microsoft.com/en-us/library/dd282900.aspx
+// http://msdn.microsoft.com/en-us/library/dd229916.aspx
+// WebKit Bugs:
+// https://bugs.webkit.org/show_bug.cgi?id=36423
+
+function doesDefinePropertyWork(object) {
+ try {
+ Object.defineProperty(object, "sentinel", {});
+ return "sentinel" in object;
+ } catch (exception) {
+ // returns falsy
+ }
+}
+
+// check whether defineProperty works if it's given. Otherwise,
+// shim partially.
+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);
+
+ // make a valiant attempt to use the real defineProperty
+ // for I8's DOM elements.
+ if (definePropertyFallback) {
+ try {
+ return definePropertyFallback.call(Object, object, property, descriptor);
+ } catch (exception) {
+ // try the shim if the real one doesn't work
+ }
+ }
+
+ // If it's a data property.
+ if (owns(descriptor, "value")) {
+ // fail silently if "writable", "enumerable", or "configurable"
+ // are requested but not supported
+ /*
+ // alternate approach:
+ if ( // can't implement these features; allow false but not true
+ !(owns(descriptor, "writable") ? descriptor.writable : true) ||
+ !(owns(descriptor, "enumerable") ? descriptor.enumerable : true) ||
+ !(owns(descriptor, "configurable") ? descriptor.configurable : true)
+ )
+ throw new RangeError(
+ "This implementation of Object.defineProperty does not " +
+ "support configurable, enumerable, or writable."
+ );
+ */
+
+ if (supportsAccessors && (lookupGetter(object, property) ||
+ lookupSetter(object, property)))
+ {
+ // As accessors are supported only on engines implementing
+ // `__proto__` we can safely override `__proto__` while defining
+ // a property to make sure that we don't hit an inherited
+ // accessor.
+ var prototype = object.__proto__;
+ object.__proto__ = prototypeOfObject;
+ // Deleting a property anyway since getter / setter may be
+ // defined on object itself.
+ delete object[property];
+ object[property] = descriptor.value;
+ // Setting original `__proto__` back now.
+ object.__proto__ = prototype;
+ } else {
+ object[property] = descriptor.value;
+ }
+ } else {
+ if (!supportsAccessors)
+ throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED);
+ // If we got that far then getters and setters can be defined !!
+ if (owns(descriptor, "get"))
+ defineGetter(object, property, descriptor.get);
+ if (owns(descriptor, "set"))
+ defineSetter(object, property, descriptor.set);
+ }
+
+ return object;
+ };
+}
+
+// ES5 15.2.3.7
+// http://es5.github.com/#x15.2.3.7
+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;
+ };
+}
+
+// ES5 15.2.3.8
+// http://es5.github.com/#x15.2.3.8
+if (!Object.seal) {
+ Object.seal = function seal(object) {
+ // this is misleading and breaks feature-detection, but
+ // allows "securable" code to "gracefully" degrade to working
+ // but insecure code.
+ return object;
+ };
+}
+
+// ES5 15.2.3.9
+// http://es5.github.com/#x15.2.3.9
+if (!Object.freeze) {
+ Object.freeze = function freeze(object) {
+ // this is misleading and breaks feature-detection, but
+ // allows "securable" code to "gracefully" degrade to working
+ // but insecure code.
+ return object;
+ };
+}
+
+// detect a Rhino bug and patch it
+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);
+}
+
+// ES5 15.2.3.10
+// http://es5.github.com/#x15.2.3.10
+if (!Object.preventExtensions) {
+ Object.preventExtensions = function preventExtensions(object) {
+ // this is misleading and breaks feature-detection, but
+ // allows "securable" code to "gracefully" degrade to working
+ // but insecure code.
+ return object;
+ };
+}
+
+// ES5 15.2.3.11
+// http://es5.github.com/#x15.2.3.11
+if (!Object.isSealed) {
+ Object.isSealed = function isSealed(object) {
+ return false;
+ };
+}
+
+// ES5 15.2.3.12
+// http://es5.github.com/#x15.2.3.12
+if (!Object.isFrozen) {
+ Object.isFrozen = function isFrozen(object) {
+ return false;
+ };
+}
+
+// ES5 15.2.3.13
+// http://es5.github.com/#x15.2.3.13
+if (!Object.isExtensible) {
+ Object.isExtensible = function isExtensible(object) {
+ // 1. If Type(O) is not Object throw a TypeError exception.
+ if (Object(object) === object) {
+ throw new TypeError(); // TODO message
+ }
+ // 2. Return the Boolean value of the [[Extensible]] internal property of O.
+ var name = '';
+ while (owns(object, name)) {
+ name += '?';
+ }
+ object[name] = true;
+ var returnValue = owns(object, name);
+ delete object[name];
+ return returnValue;
+ };
+}
+
+// ES5 15.2.3.14
+// http://es5.github.com/#x15.2.3.14
+if (!Object.keys) {
+ // http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation
+ 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;
+ };
+
+}
+
+//
+// Date
+// ====
+//
+
+// ES5 15.9.5.43
+// http://es5.github.com/#x15.9.5.43
+// This function returns a String value represent the instance in time
+// represented by this Date object. The format of the String is the Date Time
+// string format defined in 15.9.1.15. All fields are present in the String.
+// The time zone is always UTC, denoted by the suffix Z. If the time value of
+// this object is not a finite Number a RangeError exception is thrown.
+if (!Date.prototype.toISOString || (new Date(-62198755200000).toISOString().indexOf('-000001') === -1)) {
+ Date.prototype.toISOString = function toISOString() {
+ var result, length, value, year;
+ if (!isFinite(this))
+ throw new RangeError;
+
+ // the date time string format is specified in 15.9.1.15.
+ result = [this.getUTCMonth() + 1, this.getUTCDate(),
+ this.getUTCHours(), this.getUTCMinutes(), this.getUTCSeconds()];
+ year = this.getUTCFullYear();
+ year = (year < 0 ? '-' : (year > 9999 ? '+' : '')) + ('00000' + Math.abs(year)).slice(0 <= year && year <= 9999 ? -4 : -6);
+
+ length = result.length;
+ while (length--) {
+ value = result[length];
+ // pad months, days, hours, minutes, and seconds to have two digits.
+ if (value < 10)
+ result[length] = "0" + value;
+ }
+ // pad milliseconds to have three digits.
+ return year + "-" + result.slice(0, 2).join("-") + "T" + result.slice(2).join(":") + "." +
+ ("000" + this.getUTCMilliseconds()).slice(-3) + "Z";
+ }
+}
+
+// ES5 15.9.4.4
+// http://es5.github.com/#x15.9.4.4
+if (!Date.now) {
+ Date.now = function now() {
+ return new Date().getTime();
+ };
+}
+
+// ES5 15.9.5.44
+// http://es5.github.com/#x15.9.5.44
+// This function provides a String representation of a Date object for use by
+// JSON.stringify (15.12.3).
+if (!Date.prototype.toJSON) {
+ Date.prototype.toJSON = function toJSON(key) {
+ // When the toJSON method is called with argument key, the following
+ // steps are taken:
+
+ // 1. Let O be the result of calling ToObject, giving it the this
+ // value as its argument.
+ // 2. Let tv be ToPrimitive(O, hint Number).
+ // 3. If tv is a Number and is not finite, return null.
+ // XXX
+ // 4. Let toISO be the result of calling the [[Get]] internal method of
+ // O with argument "toISOString".
+ // 5. If IsCallable(toISO) is false, throw a TypeError exception.
+ if (typeof this.toISOString != "function")
+ throw new TypeError(); // TODO message
+ // 6. Return the result of calling the [[Call]] internal method of
+ // toISO with O as the this value and an empty argument list.
+ return this.toISOString();
+
+ // NOTE 1 The argument is ignored.
+
+ // NOTE 2 The toJSON function is intentionally generic; it does not
+ // require that its this value be a Date object. Therefore, it can be
+ // transferred to other kinds of objects for use as a method. However,
+ // it does require that any such object have a toISOString method. An
+ // object is free to use the argument key to filter its
+ // stringification.
+ };
+}
+
+// ES5 15.9.4.2
+// http://es5.github.com/#x15.9.4.2
+// based on work shared by Daniel Friesen (dantman)
+// http://gist.github.com/303249
+if (Date.parse("+275760-09-13T00:00:00.000Z") !== 8.64e15) {
+ // XXX global assignment won't work in embeddings that use
+ // an alternate object for the context.
+ Date = (function(NativeDate) {
+
+ // Date.length === 7
+ var Date = function Date(Y, M, D, h, m, s, ms) {
+ var length = arguments.length;
+ if (this instanceof NativeDate) {
+ var date = length == 1 && String(Y) === Y ? // isString(Y)
+ // We explicitly pass it through parse:
+ new NativeDate(Date.parse(Y)) :
+ // We have to manually make calls depending on argument
+ // length here
+ length >= 7 ? new NativeDate(Y, M, D, h, m, s, ms) :
+ length >= 6 ? new NativeDate(Y, M, D, h, m, s) :
+ length >= 5 ? new NativeDate(Y, M, D, h, m) :
+ length >= 4 ? new NativeDate(Y, M, D, h) :
+ length >= 3 ? new NativeDate(Y, M, D) :
+ length >= 2 ? new NativeDate(Y, M) :
+ length >= 1 ? new NativeDate(Y) :
+ new NativeDate();
+ // Prevent mixups with unfixed Date object
+ date.constructor = Date;
+ return date;
+ }
+ return NativeDate.apply(this, arguments);
+ };
+
+ // 15.9.1.15 Date Time String Format.
+ var isoDateExpression = new RegExp("^" +
+ "(\\d{4}|[\+\-]\\d{6})" + // four-digit year capture or sign + 6-digit extended year
+ "(?:-(\\d{2})" + // optional month capture
+ "(?:-(\\d{2})" + // optional day capture
+ "(?:" + // capture hours:minutes:seconds.milliseconds
+ "T(\\d{2})" + // hours capture
+ ":(\\d{2})" + // minutes capture
+ "(?:" + // optional :seconds.milliseconds
+ ":(\\d{2})" + // seconds capture
+ "(?:\\.(\\d{3}))?" + // milliseconds capture
+ ")?" +
+ "(?:" + // capture UTC offset component
+ "Z|" + // UTC capture
+ "(?:" + // offset specifier +/-hours:minutes
+ "([-+])" + // sign capture
+ "(\\d{2})" + // hours offset capture
+ ":(\\d{2})" + // minutes offset capture
+ ")" +
+ ")?)?)?)?" +
+ "$");
+
+ // Copy any custom methods a 3rd party library may have added
+ for (var key in NativeDate)
+ Date[key] = NativeDate[key];
+
+ // Copy "native" methods explicitly; they may be non-enumerable
+ Date.now = NativeDate.now;
+ Date.UTC = NativeDate.UTC;
+ Date.prototype = NativeDate.prototype;
+ Date.prototype.constructor = Date;
+
+ // Upgrade Date.parse to handle simplified ISO 8601 strings
+ Date.parse = function parse(string) {
+ var match = isoDateExpression.exec(string);
+ if (match) {
+ match.shift(); // kill match[0], the full match
+ // parse months, days, hours, minutes, seconds, and milliseconds
+ for (var i = 1; i < 7; i++) {
+ // provide default values if necessary
+ match[i] = +(match[i] || (i < 3 ? 1 : 0));
+ // match[1] is the month. Months are 0-11 in JavaScript
+ // `Date` objects, but 1-12 in ISO notation, so we
+ // decrement.
+ if (i == 1)
+ match[i]--;
+ }
+
+ // parse the UTC offset component
+ var minuteOffset = +match.pop(), hourOffset = +match.pop(), sign = match.pop();
+
+ // compute the explicit time zone offset if specified
+ var offset = 0;
+ if (sign) {
+ // detect invalid offsets and return early
+ if (hourOffset > 23 || minuteOffset > 59)
+ return NaN;
+
+ // express the provided time zone offset in minutes. The offset is
+ // negative for time zones west of UTC; positive otherwise.
+ offset = (hourOffset * 60 + minuteOffset) * 6e4 * (sign == "+" ? -1 : 1);
+ }
+
+ // Date.UTC for years between 0 and 99 converts year to 1900 + year
+ // The Gregorian calendar has a 400-year cycle, so
+ // to Date.UTC(year + 400, .... ) - 12622780800000 == Date.UTC(year, ...),
+ // where 12622780800000 - number of milliseconds in Gregorian calendar 400 years
+ var year = +match[0];
+ if (0 <= year && year <= 99) {
+ match[0] = year + 400;
+ return NativeDate.UTC.apply(this, match) + offset - 12622780800000;
+ }
+
+ // compute a new UTC date value, accounting for the optional offset
+ return NativeDate.UTC.apply(this, match) + offset;
+ }
+ return NativeDate.parse.apply(this, arguments);
+ };
+
+ return Date;
+ })(Date);
+}
+
+//
+// String
+// ======
+//
+
+// ES5 15.5.4.20
+// http://es5.github.com/#x15.5.4.20
+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()) {
+ // http://blog.stevenlevithan.com/archives/faster-trim-javascript
+ // http://perfectionkills.com/whitespace-deviations/
+ ws = "[" + ws + "]";
+ var trimBeginRegexp = new RegExp("^" + ws + ws + "*"),
+ trimEndRegexp = new RegExp(ws + ws + "*$");
+ String.prototype.trim = function trim() {
+ return String(this).replace(trimBeginRegexp, "").replace(trimEndRegexp, "");
+ };
+}
+
+//
+// Util
+// ======
+//
+
+// ES5 9.4
+// http://es5.github.com/#x9.4
+// http://jsperf.com/to-integer
+var toInteger = function (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;
+};
+
+var prepareString = "a"[0] != "a",
+ // ES5 9.9
+ // http://es5.github.com/#x9.9
+ toObject = function (o) {
+ if (o == null) { // this matches both null and undefined
+ throw new TypeError(); // TODO message
+ }
+ // If the implementation doesn't support by-index access of
+ // string characters (ex. IE < 7), split the string
+ if (prepareString && typeof o == "string" && o) {
+ return o.split("");
+ }
+ 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<listeners.length; i++) {
+ listeners[i](e);
+ if (e.propagationStopped)
+ break;
+ }
+
+ if (defaultHandler && !e.defaultPrevented)
+ return defaultHandler(e);
+};
+
+EventEmitter.setDefaultHandler = function(eventName, callback) {
+ this._defaultHandlers = this._defaultHandlers || {};
+
+ if (this._defaultHandlers[eventName])
+ throw new Error("The default handler for '" + eventName + "' is already set");
+
+ this._defaultHandlers[eventName] = callback;
+};
+
+EventEmitter.on =
+EventEmitter.addEventListener = function(eventName, callback) {
+ this._eventRegistry = this._eventRegistry || {};
+
+ var listeners = this._eventRegistry[eventName];
+ if (!listeners)
+ listeners = this._eventRegistry[eventName] = [];
+
+ if (listeners.indexOf(callback) == -1)
+ listeners.push(callback);
+};
+
+EventEmitter.removeListener =
+EventEmitter.removeEventListener = function(eventName, callback) {
+ this._eventRegistry = this._eventRegistry || {};
+
+ var listeners = this._eventRegistry[eventName];
+ if (!listeners)
+ return;
+
+ var index = listeners.indexOf(callback);
+ if (index !== -1)
+ listeners.splice(index, 1);
+};
+
+EventEmitter.removeAllListeners = function(eventName) {
+ if (this._eventRegistry) this._eventRegistry[eventName] = [];
+};
+
+exports.EventEmitter = EventEmitter;
+
+});
+
+define('ace/lib/oop', ['require', 'exports', 'module' ], function(require, exports, module) {
+
+
+exports.inherits = (function() {
+ var tempCtor = function() {};
+ return function(ctor, superCtor) {
+ tempCtor.prototype = superCtor.prototype;
+ ctor.super_ = superCtor.prototype;
+ ctor.prototype = new tempCtor();
+ ctor.prototype.constructor = ctor;
+ };
+}());
+
+exports.mixin = function(obj, mixin) {
+ for (var key in mixin) {
+ obj[key] = mixin[key];
+ }
+};
+
+exports.implement = function(proto, mixin) {
+ exports.mixin(proto, mixin);
+};
+
+});
+
+define('ace/mode/coffee_worker', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/worker/mirror', 'ace/mode/coffee/coffee-script'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var Mirror = require("../worker/mirror").Mirror;
+var coffee = require("../mode/coffee/coffee-script");
+
+window.addEventListener = function() {};
+
+
+var Worker = exports.Worker = function(sender) {
+ Mirror.call(this, sender);
+ this.setTimeout(200);
+};
+
+oop.inherits(Worker, Mirror);
+
+(function() {
+
+ this.onUpdate = function() {
+ var value = this.doc.getValue();
+
+ try {
+ coffee.parse(value);
+ } catch(e) {
+ var m = e.message.match(/Parse error on line (\d+): (.*)/);
+ if (m) {
+ this.sender.emit("error", {
+ row: parseInt(m[1], 10) - 1,
+ column: null,
+ text: m[2],
+ type: "error"
+ });
+ return;
+ }
+
+ if (e instanceof SyntaxError) {
+ var m = e.message.match(/ on line (\d+)/);
+ if (m) {
+ this.sender.emit("error", {
+ row: parseInt(m[1], 10) - 1,
+ column: null,
+ text: e.message.replace(m[0], ""),
+ type: "error"
+ });
+ }
+ }
+ return;
+ }
+ this.sender.emit("ok");
+ };
+
+}).call(Worker.prototype);
+
+});
+define('ace/worker/mirror', ['require', 'exports', 'module' , 'ace/document', 'ace/lib/lang'], function(require, exports, module) {
+
+
+var Document = require("../document").Document;
+var lang = require("../lib/lang");
+
+var Mirror = exports.Mirror = function(sender) {
+ this.sender = sender;
+ var doc = this.doc = new Document("");
+
+ var deferredUpdate = this.deferredUpdate = lang.deferredCall(this.onUpdate.bind(this));
+
+ var _self = this;
+ sender.on("change", function(e) {
+ doc.applyDeltas([e.data]);
+ deferredUpdate.schedule(_self.$timeout);
+ });
+};
+
+(function() {
+
+ this.$timeout = 500;
+
+ this.setTimeout = function(timeout) {
+ this.$timeout = timeout;
+ };
+
+ this.setValue = function(value) {
+ this.doc.setValue(value);
+ this.deferredUpdate.schedule(this.$timeout);
+ };
+
+ this.getValue = function(callbackId) {
+ this.sender.callback(this.doc.getValue(), callbackId);
+ };
+
+ this.onUpdate = function() {
+ // abstract method
+ };
+
+}).call(Mirror.prototype);
+
+});
+
+define('ace/document', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/event_emitter', 'ace/range', 'ace/anchor'], function(require, exports, module) {
+
+
+var oop = require("./lib/oop");
+var EventEmitter = require("./lib/event_emitter").EventEmitter;
+var Range = require("./range").Range;
+var Anchor = require("./anchor").Anchor;
+
+ /**
+ * new Document([text])
+ * - text (String | Array): The starting text
+ *
+ * Creates a new `Document`. If `text` is included, the `Document` contains those strings; otherwise, it's empty.
+ *
+ **/
+
+var Document = function(text) {
+ this.$lines = [];
+
+ // There has to be one line at least in the document. If you pass an empty
+ // string to the insert function, nothing will happen. Workaround.
+ if (text.length == 0) {
+ this.$lines = [""];
+ } else if (Array.isArray(text)) {
+ this.insertLines(0, text);
+ } else {
+ this.insert({row: 0, column:0}, text);
+ }
+};
+
+(function() {
+
+ oop.implement(this, EventEmitter);
+ this.setValue = function(text) {
+ var len = this.getLength();
+ this.remove(new Range(0, 0, len, this.getLine(len-1).length));
+ this.insert({row: 0, column:0}, text);
+ };
+ this.getValue = function() {
+ return this.getAllLines().join(this.getNewLineCharacter());
+ };
+ this.createAnchor = function(row, column) {
+ return new Anchor(this, row, column);
+ };
+
+ // check for IE split bug
+ if ("aaa".split(/a/).length == 0)
+ this.$split = function(text) {
+ return text.replace(/\r\n|\r/g, "\n").split("\n");
+ }
+ else
+ this.$split = function(text) {
+ return text.split(/\r\n|\r|\n/);
+ };
+ this.$detectNewLine = function(text) {
+ var match = text.match(/^.*?(\r\n|\r|\n)/m);
+ if (match) {
+ this.$autoNewLine = match[1];
+ } else {
+ this.$autoNewLine = "\n";
+ }
+ };
+ this.getNewLineCharacter = function() {
+ switch (this.$newLineMode) {
+ case "windows":
+ return "\r\n";
+
+ case "unix":
+ return "\n";
+
+ case "auto":
+ return this.$autoNewLine;
+ }
+ };
+
+ this.$autoNewLine = "\n";
+ this.$newLineMode = "auto";
+ this.setNewLineMode = function(newLineMode) {
+ if (this.$newLineMode === newLineMode)
+ return;
+
+ this.$newLineMode = newLineMode;
+ };
+ this.getNewLineMode = function() {
+ return this.$newLineMode;
+ };
+ this.isNewLine = function(text) {
+ return (text == "\r\n" || text == "\r" || text == "\n");
+ };
+ this.getLine = function(row) {
+ return this.$lines[row] || "";
+ };
+ this.getLines = function(firstRow, lastRow) {
+ return this.$lines.slice(firstRow, lastRow + 1);
+ };
+ this.getAllLines = function() {
+ return this.getLines(0, this.getLength());
+ };
+ this.getLength = function() {
+ return this.$lines.length;
+ };
+ this.getTextRange = function(range) {
+ if (range.start.row == range.end.row) {
+ return this.$lines[range.start.row].substring(range.start.column,
+ range.end.column);
+ }
+ else {
+ var lines = this.getLines(range.start.row+1, range.end.row-1);
+ lines.unshift((this.$lines[range.start.row] || "").substring(range.start.column));
+ lines.push((this.$lines[range.end.row] || "").substring(0, range.end.column));
+ return lines.join(this.getNewLineCharacter());
+ }
+ };
+ this.$clipPosition = function(position) {
+ var length = this.getLength();
+ if (position.row >= 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);
+
+ // only detect new lines if the document has no line break yet
+ 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;
+ };
+ /**
+ * Document@change(e)
+ * - e (Object): Contains at least one property called `"action"`. `"action"` indicates the action that triggered the change. Each action also has a set of additional properties.
+ *
+ * Fires whenever the document changes.
+ *
+ * Several methods trigger different `"change"` events. Below is a list of each action type, followed by each property that's also available:
+ *
+ * * `"insertLines"` (emitted by [[Document.insertLines]])
+ * * `range`: the [[Range]] of the change within the document
+ * * `lines`: the lines in the document that are changing
+ * * `"insertText"` (emitted by [[Document.insertNewLine]])
+ * * `range`: the [[Range]] of the change within the document
+ * * `text`: the text that's being added
+ * * `"removeLines"` (emitted by [[Document.insertLines]])
+ * * `range`: the [[Range]] of the change within the document
+ * * `lines`: the lines in the document that were removed
+ * * `nl`: the new line character (as defined by [[Document.getNewLineCharacter]])
+ * * `"removeText"` (emitted by [[Document.removeInLine]] and [[Document.removeNewLine]])
+ * * `range`: the [[Range]] of the change within the document
+ * * `text`: the text that's being removed
+ *
+ **/
+ this.insertLines = function(row, lines) {
+ if (lines.length == 0)
+ return {row: row, column: 0};
+
+ // apply doesn't work for big arrays (smallest threshold is on safari 0xFFFF)
+ // to circumvent that we have to break huge inserts into smaller chunks here
+ 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) {
+ // clip to document
+ 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;
+
+ // Shortcut: If the text we want to insert is the same as it is already
+ // in the document, we don't have to replace anything.
+ 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<deltas.length; i++) {
+ var delta = deltas[i];
+ var range = Range.fromPoints(delta.range.start, delta.range.end);
+
+ if (delta.action == "insertLines")
+ this.insertLines(range.start.row, delta.lines);
+ else if (delta.action == "insertText")
+ this.insert(range.start, delta.text);
+ else if (delta.action == "removeLines")
+ this.removeLines(range.start.row, range.end.row - 1);
+ else if (delta.action == "removeText")
+ this.remove(range);
+ }
+ };
+ this.revertDeltas = function(deltas) {
+ for (var i=deltas.length-1; 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);
+ }
+ };
+
+}).call(Document.prototype);
+
+exports.Document = Document;
+});
+
+define('ace/range', ['require', 'exports', 'module' ], function(require, exports, module) {
+
+
+/**
+ * class Range
+ *
+ * This object is used in various places to indicate a region within the editor. To better visualize how this works, imagine a rectangle. Each quadrant of the rectangle is analogus to a range, as ranges contain a starting row and starting column, and an ending row, and ending column.
+ *
+ **/
+
+/**
+ * new Range(startRow, startColumn, endRow, endColumn)
+ * - startRow (Number): The starting row
+ * - startColumn (Number): The starting column
+ * - endRow (Number): The ending row
+ * - endColumn (Number): The ending column
+ *
+ * Creates a new `Range` object with the given starting and ending row and column points.
+ *
+ **/
+var Range = function(startRow, startColumn, endRow, endColumn) {
+ this.start = {
+ row: startRow,
+ column: startColumn
+ };
+
+ this.end = {
+ row: endRow,
+ column: endColumn
+ };
+};
+
+(function() {
+ /**
+ * Range.isEqual(range) -> Boolean
+ * - range (Range): A range to check against
+ *
+ * Returns `true` if and only if the starting row and column, and ending tow and column, are equivalent to those given by `range`.
+ *
+ **/
+ 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;
+ }
+ }
+ }
+
+ /** related to: Range.compare
+ * Range.comparePoint(p) -> Number
+ * - p (Range): A point to compare with
+ * + (Number): This method returns one of the following numbers:<br/>
+ * * `0` if the two points are exactly equal<br/>
+ * * `-1` if `p.row` is less then the calling range<br/>
+ * * `1` if `p.row` is greater than the calling range<br/>
+ * <br/>
+ * If the starting row of the calling range is equal to `p.row`, and:<br/>
+ * * `p.column` is greater than or equal to the calling range's starting column, this returns `0`<br/>
+ * * Otherwise, it returns -1<br/>
+ *<br/>
+ * If the ending row of the calling range is equal to `p.row`, and:<br/>
+ * * `p.column` is less than or equal to the calling range's ending column, this returns `0`<br/>
+ * * Otherwise, it returns 1<br/>
+ *
+ * Checks the row and column points of `p` with the row and column points of the calling range.
+ *
+ *
+ *
+ **/
+ this.comparePoint = function(p) {
+ return this.compare(p.row, p.column);
+ }
+
+ /** related to: Range.comparePoint
+ * Range.containsRange(range) -> Boolean
+ * - range (Range): A range to compare with
+ *
+ * Checks the start and end points of `range` and compares them to the calling range. Returns `true` if the `range` is contained within the caller's range.
+ *
+ **/
+ this.containsRange = function(range) {
+ return this.comparePoint(range.start) == 0 && this.comparePoint(range.end) == 0;
+ }
+
+ /**
+ * Range.intersects(range) -> Boolean
+ * - range (Range): A range to compare with
+ *
+ * Returns `true` if passed in `range` intersects with the one calling this method.
+ *
+ **/
+ this.intersects = function(range) {
+ var cmp = this.compareRange(range);
+ return (cmp == -1 || cmp == 0 || cmp == 1);
+ }
+
+ /**
+ * Range.isEnd(row, column) -> Boolean
+ * - row (Number): A row point to compare with
+ * - column (Number): A column point to compare with
+ *
+ * Returns `true` if the caller's ending row point is the same as `row`, and if the caller's ending column is the same as `column`.
+ *
+ **/
+ this.isEnd = function(row, column) {
+ return this.end.row == row && this.end.column == column;
+ }
+
+ /**
+ * Range.isStart(row, column) -> Boolean
+ * - row (Number): A row point to compare with
+ * - column (Number): A column point to compare with
+ *
+ * Returns `true` if the caller's starting row point is the same as `row`, and if the caller's starting column is the same as `column`.
+ *
+ **/
+ this.isStart = function(row, column) {
+ return this.start.row == row && this.start.column == column;
+ }
+
+ /**
+ * Range.setStart(row, column)
+ * - row (Number): A row point to set
+ * - column (Number): A column point to set
+ *
+ * Sets the starting row and column for the range.
+ *
+ **/
+ 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;
+ }
+ }
+
+ /**
+ * Range.setEnd(row, column)
+ * - row (Number): A row point to set
+ * - column (Number): A column point to set
+ *
+ * Sets the starting row and column for the range.
+ *
+ **/
+ 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;
+ }
+ }
+
+ /** related to: Range.compare
+ * Range.inside(row, column) -> Boolean
+ * - row (Number): A row point to compare with
+ * - column (Number): A column point to compare with
+ *
+ * Returns `true` if the `row` and `column` are within the given range.
+ *
+ **/
+ 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;
+ }
+
+ /** related to: Range.compare
+ * Range.insideStart(row, column) -> Boolean
+ * - row (Number): A row point to compare with
+ * - column (Number): A column point to compare with
+ *
+ * Returns `true` if the `row` and `column` are within the given range's starting points.
+ *
+ **/
+ this.insideStart = function(row, column) {
+ if (this.compare(row, column) == 0) {
+ if (this.isEnd(row, column)) {
+ return false;
+ } else {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /** related to: Range.compare
+ * Range.insideEnd(row, column) -> Boolean
+ * - row (Number): A row point to compare with
+ * - column (Number): A column point to compare with
+ *
+ * Returns `true` if the `row` and `column` are within the given range's ending points.
+ *
+ **/
+ this.insideEnd = function(row, column) {
+ if (this.compare(row, column) == 0) {
+ if (this.isStart(row, column)) {
+ return false;
+ } else {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Range.compare(row, column) -> Number
+ * - row (Number): A row point to compare with
+ * - column (Number): A column point to compare with
+ * + (Number): This method returns one of the following numbers:<br/>
+ * * `0` if the two points are exactly equal <br/>
+ * * `-1` if `p.row` is less then the calling range <br/>
+ * * `1` if `p.row` is greater than the calling range <br/>
+ * <br/>
+ * If the starting row of the calling range is equal to `p.row`, and: <br/>
+ * * `p.column` is greater than or equal to the calling range's starting column, this returns `0`<br/>
+ * * Otherwise, it returns -1<br/>
+ * <br/>
+ * If the ending row of the calling range is equal to `p.row`, and: <br/>
+ * * `p.column` is less than or equal to the calling range's ending column, this returns `0` <br/>
+ * * Otherwise, it returns 1
+ *
+ * Checks the row and column points with the row and column points of the calling range.
+ *
+ *
+ **/
+ 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);
+ }
+ }
+
+ /**
+ * Range.compareEnd(row, column) -> Number
+ * - row (Number): A row point to compare with
+ * - column (Number): A column point to compare with
+ * + (Number): This method returns one of the following numbers:<br/>
+ * * `0` if the two points are exactly equal<br/>
+ * * `-1` if `p.row` is less then the calling range<br/>
+ * * `1` if `p.row` is greater than the calling range, or if `isEnd` is `true.<br/>
+ * <br/>
+ * If the starting row of the calling range is equal to `p.row`, and:<br/>
+ * * `p.column` is greater than or equal to the calling range's starting column, this returns `0`<br/>
+ * * Otherwise, it returns -1<br/>
+ *<br/>
+ * If the ending row of the calling range is equal to `p.row`, and:<br/>
+ * * `p.column` is less than or equal to the calling range's ending column, this returns `0`<br/>
+ * * Otherwise, it returns 1
+ *
+ * Checks the row and column points with the row and column points of the calling range.
+ *
+ *
+ **/
+ this.compareEnd = function(row, column) {
+ if (this.end.row == row && this.end.column == column) {
+ return 1;
+ } else {
+ return this.compare(row, column);
+ }
+ }
+
+ /**
+ * Range.compareInside(row, column) -> Number
+ * - row (Number): A row point to compare with
+ * - column (Number): A column point to compare with
+ * + (Number): This method returns one of the following numbers:<br/>
+ * * `1` if the ending row of the calling range is equal to `row`, and the ending column of the calling range is equal to `column`<br/>
+ * * `-1` if the starting row of the calling range is equal to `row`, and the starting column of the calling range is equal to `column`<br/>
+ * <br/>
+ * Otherwise, it returns the value after calling [[Range.compare `compare()`]].
+ *
+ * Checks the row and column points with the row and column points of the calling range.
+ *
+ *
+ *
+ **/
+ 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);
+ }
+ }
+
+ /**
+ * Range.clipRows(firstRow, lastRow) -> Range
+ * - firstRow (Number): The starting row
+ * - lastRow (Number): The ending row
+ *
+ * Returns the part of the current `Range` that occurs within the boundaries of `firstRow` and `lastRow` as a new `Range` object.
+ *
+ **/
+ 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;
+
+/**
+ * new Anchor(doc, row, column)
+ * - doc (Document): The document to associate with the anchor
+ * - row (Number): The starting row position
+ * - column (Number): The starting column position
+ *
+ * Creates a new `Anchor` and associates it with a document.
+ *
+ **/
+
+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) {
+ return new Array(count + 1).join(string);
+};
+
+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<l; i++) {
+ if (array[i] && typeof array[i] == "object")
+ copy[i] = this.copyObject( array[i] );
+ else
+ copy[i] = array[i];
+ }
+ return copy;
+};
+
+exports.deepCopy = function (obj) {
+ if (typeof obj != "object") {
+ return obj;
+ }
+
+ var copy = obj.constructor();
+ for (var key in obj) {
+ if (typeof obj[key] == "object") {
+ copy[key] = this.deepCopy(obj[key]);
+ } else {
+ copy[key] = obj[key];
+ }
+ }
+ return copy;
+};
+
+exports.arrayToMap = function(arr) {
+ var map = {};
+ for (var i=0; i<arr.length; i++) {
+ map[arr[i]] = 1;
+ }
+ return map;
+
+};
+
+exports.createMap = function(props) {
+ var map = Object.create(null);
+ for (var i in props) {
+ map[i] = props[i];
+ }
+ return map;
+};
+exports.arrayRemove = function(array, value) {
+ for (var i = 0; i <= array.length; i++) {
+ if (value === array[i]) {
+ array.splice(i, 1);
+ }
+ }
+};
+
+exports.escapeRegExp = function(str) {
+ return str.replace(/([.*+?^${}()|[\]\/\\])/g, '\\$1');
+};
+
+exports.getMatchOffsets = function(string, regExp) {
+ var matches = [];
+
+ string.replace(regExp, function(str) {
+ matches.push({
+ offset: arguments[arguments.length-2],
+ length: str.length
+ });
+ });
+
+ return matches;
+};
+
+
+exports.deferredCall = function(fcn) {
+
+ var timer = null;
+ var callback = function() {
+ timer = null;
+ fcn();
+ };
+
+ var deferred = function(timeout) {
+ deferred.cancel();
+ timer = setTimeout(callback, timeout || 0);
+ return deferred;
+ };
+
+ deferred.schedule = deferred;
+
+ deferred.call = function() {
+ this.cancel();
+ fcn();
+ return deferred;
+ };
+
+ deferred.cancel = function() {
+ clearTimeout(timer);
+ timer = null;
+ return deferred;
+ };
+
+ return deferred;
+};
+
+});
+
+define('ace/mode/coffee/coffee-script', ['require', 'exports', 'module' , 'ace/mode/coffee/lexer', 'ace/mode/coffee/parser', 'ace/mode/coffee/nodes'], function(require, exports, module) {
+
+ var Lexer = require("./lexer").Lexer;
+ var parser = require("./parser");
+
+ var lexer = new Lexer();
+ parser.lexer = {
+ lex: function() {
+ var tag, _ref2;
+ _ref2 = this.tokens[this.pos++] || [''], tag = _ref2[0], this.yytext = _ref2[1], this.yylineno = _ref2[2];
+ return tag;
+ },
+ setInput: function(tokens) {
+ this.tokens = tokens;
+ return this.pos = 0;
+ },
+ upcomingInput: function() {
+ return "";
+ }
+ };
+ parser.yy = require('./nodes');
+
+ exports.parse = function(code) {
+ return parser.parse(lexer.tokenize(code));
+ };
+});
+
+define('ace/mode/coffee/lexer', ['require', 'exports', 'module' , 'ace/mode/coffee/rewriter', 'ace/mode/coffee/helpers'], function(require, exports, module) {
+// Generated by CoffeeScript 1.2.1-pre
+
+ var BOOL, CALLABLE, CODE, COFFEE_ALIASES, COFFEE_ALIAS_MAP, COFFEE_KEYWORDS, COMMENT, COMPARE, COMPOUND_ASSIGN, HEREDOC, HEREDOC_ILLEGAL, HEREDOC_INDENT, HEREGEX, HEREGEX_OMIT, IDENTIFIER, INDEXABLE, INVERSES, JSTOKEN, JS_FORBIDDEN, JS_KEYWORDS, LINE_BREAK, LINE_CONTINUER, LOGIC, Lexer, MATH, MULTILINER, MULTI_DENT, NOT_REGEX, NOT_SPACED_REGEX, NUMBER, OPERATOR, REGEX, RELATION, RESERVED, Rewriter, SHIFT, SIMPLESTR, STRICT_PROSCRIBED, TRAILING_SPACES, UNARY, WHITESPACE, compact, count, key, last, starts, _ref, _ref1,
+ __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; };
+
+ _ref = require('./rewriter'), Rewriter = _ref.Rewriter, INVERSES = _ref.INVERSES;
+
+ _ref1 = require('./helpers'), count = _ref1.count, starts = _ref1.starts, compact = _ref1.compact, last = _ref1.last;
+
+ exports.Lexer = Lexer = (function() {
+
+ Lexer.name = 'Lexer';
+
+ function Lexer() {}
+
+ Lexer.prototype.tokenize = function(code, opts) {
+ var i, tag;
+ if (opts == null) opts = {};
+ if (WHITESPACE.test(code)) code = "\n" + code;
+ code = code.replace(/\r/g, '').replace(TRAILING_SPACES, '');
+ this.code = code;
+ this.line = opts.line || 0;
+ this.indent = 0;
+ this.indebt = 0;
+ this.outdebt = 0;
+ this.indents = [];
+ this.ends = [];
+ this.tokens = [];
+ i = 0;
+ while (this.chunk = code.slice(i)) {
+ i += this.identifierToken() || this.commentToken() || this.whitespaceToken() || this.lineToken() || this.heredocToken() || this.stringToken() || this.numberToken() || this.regexToken() || this.jsToken() || this.literalToken();
+ }
+ this.closeIndentation();
+ if (tag = this.ends.pop()) this.error("missing " + tag);
+ if (opts.rewrite === false) return this.tokens;
+ return (new Rewriter).rewrite(this.tokens);
+ };
+
+ Lexer.prototype.identifierToken = function() {
+ var colon, forcedIdentifier, id, input, match, prev, tag, _ref2, _ref3;
+ if (!(match = IDENTIFIER.exec(this.chunk))) return 0;
+ input = match[0], id = match[1], colon = match[2];
+ if (id === 'own' && this.tag() === 'FOR') {
+ this.token('OWN', id);
+ return id.length;
+ }
+ forcedIdentifier = colon || (prev = last(this.tokens)) && (((_ref2 = prev[0]) === '.' || _ref2 === '?.' || _ref2 === '::') || !prev.spaced && prev[0] === '@');
+ tag = 'IDENTIFIER';
+ if (!forcedIdentifier && (__indexOf.call(JS_KEYWORDS, id) >= 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':
+ case 'null':
+ case 'undefined':
+ 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 (/E/.test(number)) {
+ this.error("exponential notation '" + number + "' must be indicated with a lowercase 'e'");
+ } else if (/[BOX]/.test(number)) {
+ this.error("radix prefix '" + number + "' must be lowercase");
+ } else if (/^0[89]/.test(number)) {
+ this.error("decimal literal '" + number + "' must not be prefixed with '0'");
+ } else if (/^0[0-7]/.test(number)) {
+ this.error("octal literal '" + number + "' must be prefixed with '0o'");
+ }
+ lexedLength = number.length;
+ if (octalLiteral = /0o([0-7]+)/.exec(number)) {
+ number = (parseInt(octalLiteral[1], 8)).toString();
+ }
+ if (binaryLiteral = /0b([01]+)/.exec(number)) {
+ number = (parseInt(binaryLiteral[1], 2)).toString();
+ }
+ 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-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));
+ 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, prev, size;
+ if (!(match = MULTI_DENT.exec(this.chunk))) return 0;
+ indent = match[0];
+ this.line += count(indent, '\n');
+ this.seenFor = false;
+ prev = last(this.tokens, 1);
+ 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', 'let', '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', 'NULL', 'UNDEFINED'];
+
+ NOT_REGEX = ['NUMBER', 'REGEX', 'BOOL', '++', '--', ']'];
+
+ NOT_SPACED_REGEX = NOT_REGEX.concat(')', '}', 'THIS', 'IDENTIFIER', 'STRING');
+
+ CALLABLE = ['IDENTIFIER', 'STRING', 'REGEX', ')', ']', '}', '?', '::', '@', 'THIS', 'SUPER'];
+
+ INDEXABLE = CALLABLE.concat('NUMBER', 'BOOL');
+
+ LINE_BREAK = ['INDENT', 'OUTDENT', 'TERMINATOR'];
+
+
+});
+
+define('ace/mode/coffee/rewriter', ['require', 'exports', 'module' ], function(require, exports, module) {
+// Generated by CoffeeScript 1.2.1-pre
+
+ 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() {
+
+ Rewriter.name = 'Rewriter';
+
+ 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, startsLine;
+ stack = [];
+ start = null;
+ startsLine = null;
+ sameLine = true;
+ startIndent = 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)) && ((!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;
+ 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', '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) {
+// Generated by CoffeeScript 1.2.1-pre
+
+ var extend, flatten;
+
+ 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];
+ };
+
+
+});
+
+define('ace/mode/coffee/parser', ['require', 'exports', 'module' ], function(require, exports, module) {
+/* Jison generated parser */
+
+undefined
+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,"BOOL":36,"Assignable":37,"=":38,"AssignObj":39,"ObjAssignable":40,":":41,"ThisProperty":42,"RETURN":43,"HERECOMMENT":44,"PARAM_START":45,"ParamList":46,"PARAM_END":47,"FuncGlyph":48,"->":49,"=>":50,"OptComma":51,",":52,"Param":53,"ParamVar":54,"...":55,"Array":56,"Object":57,"Splat":58,"SimpleAssignable":59,"Accessor":60,"Parenthetical":61,"Range":62,"This":63,".":64,"?.":65,"::":66,"Index":67,"INDEX_START":68,"IndexValue":69,"INDEX_END":70,"INDEX_SOAK":71,"Slice":72,"{":73,"AssignList":74,"}":75,"CLASS":76,"EXTENDS":77,"OptFuncExist":78,"Arguments":79,"SUPER":80,"FUNC_EXIST":81,"CALL_START":82,"CALL_END":83,"ArgList":84,"THIS":85,"@":86,"[":87,"]":88,"RangeDots":89,"..":90,"Arg":91,"SimpleArgs":92,"TRY":93,"Catch":94,"FINALLY":95,"CATCH":96,"THROW":97,"(":98,")":99,"WhileSource":100,"WHILE":101,"WHEN":102,"UNTIL":103,"Loop":104,"LOOP":105,"ForBody":106,"FOR":107,"ForStart":108,"ForSource":109,"ForVariables":110,"OWN":111,"ForValue":112,"FORIN":113,"FOROF":114,"BY":115,"SWITCH":116,"Whens":117,"ELSE":118,"When":119,"LEADING_WHEN":120,"IfBlock":121,"IF":122,"POST_IF":123,"UNARY":124,"-":125,"+":126,"--":127,"++":128,"?":129,"MATH":130,"SHIFT":131,"COMPARE":132,"LOGIC":133,"RELATION":134,"COMPOUND_ASSIGN":135,"$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:"BOOL",38:"=",41:":",43:"RETURN",44:"HERECOMMENT",45:"PARAM_START",47:"PARAM_END",49:"->",50:"=>",52:",",55:"...",64:".",65:"?.",66:"::",68:"INDEX_START",70:"INDEX_END",71:"INDEX_SOAK",73:"{",75:"}",76:"CLASS",77:"EXTENDS",80:"SUPER",81:"FUNC_EXIST",82:"CALL_START",83:"CALL_END",85:"THIS",86:"@",87:"[",88:"]",90:"..",93:"TRY",95:"FINALLY",96:"CATCH",97:"THROW",98:"(",99:")",101:"WHILE",102:"WHEN",103:"UNTIL",105:"LOOP",107:"FOR",111:"OWN",113:"FORIN",114:"FOROF",115:"BY",116:"SWITCH",118:"ELSE",120:"LEADING_WHEN",122:"IF",123:"POST_IF",124:"UNARY",125:"-",126:"+",127:"--",128:"++",129:"?",130:"MATH",131:"SHIFT",132:"COMPARE",133:"LOGIC",134:"RELATION",135:"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],[17,3],[17,4],[17,5],[39,1],[39,3],[39,5],[39,1],[40,1],[40,1],[40,1],[10,2],[10,1],[11,1],[15,5],[15,2],[48,1],[48,1],[51,0],[51,1],[46,0],[46,1],[46,3],[53,1],[53,2],[53,3],[54,1],[54,1],[54,1],[54,1],[58,2],[59,1],[59,2],[59,2],[59,1],[37,1],[37,1],[37,1],[13,1],[13,1],[13,1],[13,1],[13,1],[60,2],[60,2],[60,2],[60,1],[60,1],[67,3],[67,2],[69,1],[69,1],[57,4],[74,0],[74,1],[74,3],[74,4],[74,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],[78,0],[78,1],[79,2],[79,4],[63,1],[63,1],[42,2],[56,2],[56,4],[89,1],[89,1],[62,5],[72,3],[72,2],[72,2],[72,1],[84,1],[84,3],[84,4],[84,4],[84,6],[91,1],[91,1],[92,1],[92,3],[19,2],[19,3],[19,4],[19,5],[94,3],[24,2],[61,3],[61,5],[100,2],[100,4],[100,2],[100,4],[20,2],[20,2],[20,2],[20,1],[104,2],[104,2],[21,2],[21,2],[21,2],[106,2],[106,2],[108,2],[108,3],[112,1],[112,1],[112,1],[110,1],[110,3],[109,2],[109,2],[109,4],[109,4],[109,4],[109,6],[109,6],[22,5],[22,7],[22,4],[22,6],[117,1],[117,2],[119,3],[119,4],[121,3],[121,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.$ = (function () {
+ var val;
+ val = new yy.Literal($$[$0]);
+ if ($$[$0] === 'undefined') val.isUndefined = true;
+ return val;
+ }());
+break;
+case 34:this.$ = new yy.Assign($$[$0-2], $$[$0]);
+break;
+case 35:this.$ = new yy.Assign($$[$0-3], $$[$0]);
+break;
+case 36:this.$ = new yy.Assign($$[$0-4], $$[$0-1]);
+break;
+case 37:this.$ = new yy.Value($$[$0]);
+break;
+case 38:this.$ = new yy.Assign(new yy.Value($$[$0-2]), $$[$0], 'object');
+break;
+case 39:this.$ = new yy.Assign(new yy.Value($$[$0-4]), $$[$0-1], 'object');
+break;
+case 40:this.$ = $$[$0];
+break;
+case 41:this.$ = $$[$0];
+break;
+case 42:this.$ = $$[$0];
+break;
+case 43:this.$ = $$[$0];
+break;
+case 44:this.$ = new yy.Return($$[$0]);
+break;
+case 45:this.$ = new yy.Return;
+break;
+case 46:this.$ = new yy.Comment($$[$0]);
+break;
+case 47:this.$ = new yy.Code($$[$0-3], $$[$0], $$[$0-1]);
+break;
+case 48:this.$ = new yy.Code([], $$[$0], $$[$0-1]);
+break;
+case 49:this.$ = 'func';
+break;
+case 50:this.$ = 'boundfunc';
+break;
+case 51:this.$ = $$[$0];
+break;
+case 52:this.$ = $$[$0];
+break;
+case 53:this.$ = [];
+break;
+case 54:this.$ = [$$[$0]];
+break;
+case 55:this.$ = $$[$0-2].concat($$[$0]);
+break;
+case 56:this.$ = new yy.Param($$[$0]);
+break;
+case 57:this.$ = new yy.Param($$[$0-1], null, true);
+break;
+case 58:this.$ = new yy.Param($$[$0-2], $$[$0]);
+break;
+case 59:this.$ = $$[$0];
+break;
+case 60:this.$ = $$[$0];
+break;
+case 61:this.$ = $$[$0];
+break;
+case 62:this.$ = $$[$0];
+break;
+case 63:this.$ = new yy.Splat($$[$0-1]);
+break;
+case 64:this.$ = new yy.Value($$[$0]);
+break;
+case 65:this.$ = $$[$0-1].add($$[$0]);
+break;
+case 66:this.$ = new yy.Value($$[$0-1], [].concat($$[$0]));
+break;
+case 67:this.$ = $$[$0];
+break;
+case 68:this.$ = $$[$0];
+break;
+case 69:this.$ = new yy.Value($$[$0]);
+break;
+case 70:this.$ = new yy.Value($$[$0]);
+break;
+case 71:this.$ = $$[$0];
+break;
+case 72:this.$ = new yy.Value($$[$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.Access($$[$0]);
+break;
+case 77:this.$ = new yy.Access($$[$0], 'soak');
+break;
+case 78:this.$ = [new yy.Access(new yy.Literal('prototype')), new yy.Access($$[$0])];
+break;
+case 79:this.$ = new yy.Access(new yy.Literal('prototype'));
+break;
+case 80:this.$ = $$[$0];
+break;
+case 81:this.$ = $$[$0-1];
+break;
+case 82:this.$ = yy.extend($$[$0], {
+ soak: true
+ });
+break;
+case 83:this.$ = new yy.Index($$[$0]);
+break;
+case 84:this.$ = new yy.Slice($$[$0]);
+break;
+case 85:this.$ = new yy.Obj($$[$0-2], $$[$0-3].generated);
+break;
+case 86:this.$ = [];
+break;
+case 87:this.$ = [$$[$0]];
+break;
+case 88:this.$ = $$[$0-2].concat($$[$0]);
+break;
+case 89:this.$ = $$[$0-3].concat($$[$0]);
+break;
+case 90:this.$ = $$[$0-5].concat($$[$0-2]);
+break;
+case 91:this.$ = new yy.Class;
+break;
+case 92:this.$ = new yy.Class(null, null, $$[$0]);
+break;
+case 93:this.$ = new yy.Class(null, $$[$0]);
+break;
+case 94:this.$ = new yy.Class(null, $$[$0-1], $$[$0]);
+break;
+case 95:this.$ = new yy.Class($$[$0]);
+break;
+case 96:this.$ = new yy.Class($$[$0-1], null, $$[$0]);
+break;
+case 97:this.$ = new yy.Class($$[$0-2], $$[$0]);
+break;
+case 98:this.$ = new yy.Class($$[$0-3], $$[$0-1], $$[$0]);
+break;
+case 99:this.$ = new yy.Call($$[$0-2], $$[$0], $$[$0-1]);
+break;
+case 100:this.$ = new yy.Call($$[$0-2], $$[$0], $$[$0-1]);
+break;
+case 101:this.$ = new yy.Call('super', [new yy.Splat(new yy.Literal('arguments'))]);
+break;
+case 102:this.$ = new yy.Call('super', $$[$0]);
+break;
+case 103:this.$ = false;
+break;
+case 104:this.$ = true;
+break;
+case 105:this.$ = [];
+break;
+case 106:this.$ = $$[$0-2];
+break;
+case 107:this.$ = new yy.Value(new yy.Literal('this'));
+break;
+case 108:this.$ = new yy.Value(new yy.Literal('this'));
+break;
+case 109:this.$ = new yy.Value(new yy.Literal('this'), [new yy.Access($$[$0])], 'this');
+break;
+case 110:this.$ = new yy.Arr([]);
+break;
+case 111:this.$ = new yy.Arr($$[$0-2]);
+break;
+case 112:this.$ = 'inclusive';
+break;
+case 113:this.$ = 'exclusive';
+break;
+case 114:this.$ = new yy.Range($$[$0-3], $$[$0-1], $$[$0-2]);
+break;
+case 115:this.$ = new yy.Range($$[$0-2], $$[$0], $$[$0-1]);
+break;
+case 116:this.$ = new yy.Range($$[$0-1], null, $$[$0]);
+break;
+case 117:this.$ = new yy.Range(null, $$[$0], $$[$0-1]);
+break;
+case 118:this.$ = new yy.Range(null, null, $$[$0]);
+break;
+case 119:this.$ = [$$[$0]];
+break;
+case 120:this.$ = $$[$0-2].concat($$[$0]);
+break;
+case 121:this.$ = $$[$0-3].concat($$[$0]);
+break;
+case 122:this.$ = $$[$0-2];
+break;
+case 123:this.$ = $$[$0-5].concat($$[$0-2]);
+break;
+case 124:this.$ = $$[$0];
+break;
+case 125:this.$ = $$[$0];
+break;
+case 126:this.$ = $$[$0];
+break;
+case 127:this.$ = [].concat($$[$0-2], $$[$0]);
+break;
+case 128:this.$ = new yy.Try($$[$0]);
+break;
+case 129:this.$ = new yy.Try($$[$0-1], $$[$0][0], $$[$0][1]);
+break;
+case 130:this.$ = new yy.Try($$[$0-2], null, null, $$[$0]);
+break;
+case 131:this.$ = new yy.Try($$[$0-3], $$[$0-2][0], $$[$0-2][1], $$[$0]);
+break;
+case 132:this.$ = [$$[$0-1], $$[$0]];
+break;
+case 133:this.$ = new yy.Throw($$[$0]);
+break;
+case 134:this.$ = new yy.Parens($$[$0-1]);
+break;
+case 135:this.$ = new yy.Parens($$[$0-2]);
+break;
+case 136:this.$ = new yy.While($$[$0]);
+break;
+case 137:this.$ = new yy.While($$[$0-2], {
+ guard: $$[$0]
+ });
+break;
+case 138:this.$ = new yy.While($$[$0], {
+ invert: true
+ });
+break;
+case 139:this.$ = new yy.While($$[$0-2], {
+ invert: true,
+ guard: $$[$0]
+ });
+break;
+case 140:this.$ = $$[$0-1].addBody($$[$0]);
+break;
+case 141:this.$ = $$[$0].addBody(yy.Block.wrap([$$[$0-1]]));
+break;
+case 142:this.$ = $$[$0].addBody(yy.Block.wrap([$$[$0-1]]));
+break;
+case 143:this.$ = $$[$0];
+break;
+case 144:this.$ = new yy.While(new yy.Literal('true')).addBody($$[$0]);
+break;
+case 145:this.$ = new yy.While(new yy.Literal('true')).addBody(yy.Block.wrap([$$[$0]]));
+break;
+case 146:this.$ = new yy.For($$[$0-1], $$[$0]);
+break;
+case 147:this.$ = new yy.For($$[$0-1], $$[$0]);
+break;
+case 148:this.$ = new yy.For($$[$0], $$[$0-1]);
+break;
+case 149:this.$ = {
+ source: new yy.Value($$[$0])
+ };
+break;
+case 150:this.$ = (function () {
+ $$[$0].own = $$[$0-1].own;
+ $$[$0].name = $$[$0-1][0];
+ $$[$0].index = $$[$0-1][1];
+ return $$[$0];
+ }());
+break;
+case 151:this.$ = $$[$0];
+break;
+case 152:this.$ = (function () {
+ $$[$0].own = true;
+ return $$[$0];
+ }());
+break;
+case 153:this.$ = $$[$0];
+break;
+case 154:this.$ = new yy.Value($$[$0]);
+break;
+case 155:this.$ = new yy.Value($$[$0]);
+break;
+case 156:this.$ = [$$[$0]];
+break;
+case 157:this.$ = [$$[$0-2], $$[$0]];
+break;
+case 158:this.$ = {
+ source: $$[$0]
+ };
+break;
+case 159:this.$ = {
+ source: $$[$0],
+ object: true
+ };
+break;
+case 160:this.$ = {
+ source: $$[$0-2],
+ guard: $$[$0]
+ };
+break;
+case 161:this.$ = {
+ source: $$[$0-2],
+ guard: $$[$0],
+ object: true
+ };
+break;
+case 162:this.$ = {
+ source: $$[$0-2],
+ step: $$[$0]
+ };
+break;
+case 163:this.$ = {
+ source: $$[$0-4],
+ guard: $$[$0-2],
+ step: $$[$0]
+ };
+break;
+case 164:this.$ = {
+ source: $$[$0-4],
+ step: $$[$0-2],
+ guard: $$[$0]
+ };
+break;
+case 165:this.$ = new yy.Switch($$[$0-3], $$[$0-1]);
+break;
+case 166:this.$ = new yy.Switch($$[$0-5], $$[$0-3], $$[$0-1]);
+break;
+case 167:this.$ = new yy.Switch(null, $$[$0-1]);
+break;
+case 168:this.$ = new yy.Switch(null, $$[$0-3], $$[$0-1]);
+break;
+case 169:this.$ = $$[$0];
+break;
+case 170:this.$ = $$[$0-1].concat($$[$0]);
+break;
+case 171:this.$ = [[$$[$0-1], $$[$0]]];
+break;
+case 172:this.$ = [[$$[$0-2], $$[$0-1]]];
+break;
+case 173:this.$ = new yy.If($$[$0-1], $$[$0], {
+ type: $$[$0-2]
+ });
+break;
+case 174:this.$ = $$[$0-4].addElse(new yy.If($$[$0-1], $$[$0], {
+ type: $$[$0-2]
+ }));
+break;
+case 175:this.$ = $$[$0];
+break;
+case 176:this.$ = $$[$0-2].addElse($$[$0]);
+break;
+case 177:this.$ = new yy.If($$[$0], yy.Block.wrap([$$[$0-2]]), {
+ type: $$[$0-1],
+ statement: true
+ });
+break;
+case 178:this.$ = new yy.If($$[$0], yy.Block.wrap([$$[$0-2]]), {
+ type: $$[$0-1],
+ statement: true
+ });
+break;
+case 179:this.$ = new yy.Op($$[$0-1], $$[$0]);
+break;
+case 180:this.$ = new yy.Op('-', $$[$0]);
+break;
+case 181:this.$ = new yy.Op('+', $$[$0]);
+break;
+case 182:this.$ = new yy.Op('--', $$[$0]);
+break;
+case 183:this.$ = new yy.Op('++', $$[$0]);
+break;
+case 184:this.$ = new yy.Op('--', $$[$0-1], null, true);
+break;
+case 185:this.$ = new yy.Op('++', $$[$0-1], null, true);
+break;
+case 186:this.$ = new yy.Existence($$[$0-1]);
+break;
+case 187:this.$ = new yy.Op('+', $$[$0-2], $$[$0]);
+break;
+case 188:this.$ = new yy.Op('-', $$[$0-2], $$[$0]);
+break;
+case 189:this.$ = new yy.Op($$[$0-1], $$[$0-2], $$[$0]);
+break;
+case 190:this.$ = new yy.Op($$[$0-1], $$[$0-2], $$[$0]);
+break;
+case 191:this.$ = new yy.Op($$[$0-1], $$[$0-2], $$[$0]);
+break;
+case 192:this.$ = new yy.Op($$[$0-1], $$[$0-2], $$[$0]);
+break;
+case 193: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 194:this.$ = new yy.Assign($$[$0-2], $$[$0], $$[$0-1]);
+break;
+case 195:this.$ = new yy.Assign($$[$0-4], $$[$0-1], $$[$0-3]);
+break;
+case 196: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:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[3]},{1:[2,2],6:[1,72]},{6:[1,73]},{1:[2,4],6:[2,4],26:[2,4],99:[2,4]},{4:75,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,74],27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,7],6:[2,7],26:[2,7],99:[2,7],100:85,101:[1,63],103:[1,64],106:86,107:[1,66],108:67,123:[1,84],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{1:[2,8],6:[2,8],26:[2,8],99:[2,8],100:88,101:[1,63],103:[1,64],106:89,107:[1,66],108:67,123:[1,87]},{1:[2,12],6:[2,12],25:[2,12],26:[2,12],47:[2,12],52:[2,12],55:[2,12],60:91,64:[1,93],65:[1,94],66:[1,95],67:96,68:[1,97],70:[2,12],71:[1,98],75:[2,12],78:90,81:[1,92],82:[2,103],83:[2,12],88:[2,12],90:[2,12],99:[2,12],101:[2,12],102:[2,12],103:[2,12],107:[2,12],115:[2,12],123:[2,12],125:[2,12],126:[2,12],129:[2,12],130:[2,12],131:[2,12],132:[2,12],133:[2,12],134:[2,12]},{1:[2,13],6:[2,13],25:[2,13],26:[2,13],47:[2,13],52:[2,13],55:[2,13],60:100,64:[1,93],65:[1,94],66:[1,95],67:96,68:[1,97],70:[2,13],71:[1,98],75:[2,13],78:99,81:[1,92],82:[2,103],83:[2,13],88:[2,13],90:[2,13],99:[2,13],101:[2,13],102:[2,13],103:[2,13],107:[2,13],115:[2,13],123:[2,13],125:[2,13],126:[2,13],129:[2,13],130:[2,13],131:[2,13],132:[2,13],133:[2,13],134:[2,13]},{1:[2,14],6:[2,14],25:[2,14],26:[2,14],47:[2,14],52:[2,14],55:[2,14],70:[2,14],75:[2,14],83:[2,14],88:[2,14],90:[2,14],99:[2,14],101:[2,14],102:[2,14],103:[2,14],107:[2,14],115:[2,14],123:[2,14],125:[2,14],126:[2,14],129:[2,14],130:[2,14],131:[2,14],132:[2,14],133:[2,14],134:[2,14]},{1:[2,15],6:[2,15],25:[2,15],26:[2,15],47:[2,15],52:[2,15],55:[2,15],70:[2,15],75:[2,15],83:[2,15],88:[2,15],90:[2,15],99:[2,15],101:[2,15],102:[2,15],103:[2,15],107:[2,15],115:[2,15],123:[2,15],125:[2,15],126:[2,15],129:[2,15],130:[2,15],131:[2,15],132:[2,15],133:[2,15],134:[2,15]},{1:[2,16],6:[2,16],25:[2,16],26:[2,16],47:[2,16],52:[2,16],55:[2,16],70:[2,16],75:[2,16],83:[2,16],88:[2,16],90:[2,16],99:[2,16],101:[2,16],102:[2,16],103:[2,16],107:[2,16],115:[2,16],123:[2,16],125:[2,16],126:[2,16],129:[2,16],130:[2,16],131:[2,16],132:[2,16],133:[2,16],134:[2,16]},{1:[2,17],6:[2,17],25:[2,17],26:[2,17],47:[2,17],52:[2,17],55:[2,17],70:[2,17],75:[2,17],83:[2,17],88:[2,17],90:[2,17],99:[2,17],101:[2,17],102:[2,17],103:[2,17],107:[2,17],115:[2,17],123:[2,17],125:[2,17],126:[2,17],129:[2,17],130:[2,17],131:[2,17],132:[2,17],133:[2,17],134:[2,17]},{1:[2,18],6:[2,18],25:[2,18],26:[2,18],47:[2,18],52:[2,18],55:[2,18],70:[2,18],75:[2,18],83:[2,18],88:[2,18],90:[2,18],99:[2,18],101:[2,18],102:[2,18],103:[2,18],107:[2,18],115:[2,18],123:[2,18],125:[2,18],126:[2,18],129:[2,18],130:[2,18],131:[2,18],132:[2,18],133:[2,18],134:[2,18]},{1:[2,19],6:[2,19],25:[2,19],26:[2,19],47:[2,19],52:[2,19],55:[2,19],70:[2,19],75:[2,19],83:[2,19],88:[2,19],90:[2,19],99:[2,19],101:[2,19],102:[2,19],103:[2,19],107:[2,19],115:[2,19],123:[2,19],125:[2,19],126:[2,19],129:[2,19],130:[2,19],131:[2,19],132:[2,19],133:[2,19],134:[2,19]},{1:[2,20],6:[2,20],25:[2,20],26:[2,20],47:[2,20],52:[2,20],55:[2,20],70:[2,20],75:[2,20],83:[2,20],88:[2,20],90:[2,20],99:[2,20],101:[2,20],102:[2,20],103:[2,20],107:[2,20],115:[2,20],123:[2,20],125:[2,20],126:[2,20],129:[2,20],130:[2,20],131:[2,20],132:[2,20],133:[2,20],134:[2,20]},{1:[2,21],6:[2,21],25:[2,21],26:[2,21],47:[2,21],52:[2,21],55:[2,21],70:[2,21],75:[2,21],83:[2,21],88:[2,21],90:[2,21],99:[2,21],101:[2,21],102:[2,21],103:[2,21],107:[2,21],115:[2,21],123:[2,21],125:[2,21],126:[2,21],129:[2,21],130:[2,21],131:[2,21],132:[2,21],133:[2,21],134:[2,21]},{1:[2,22],6:[2,22],25:[2,22],26:[2,22],47:[2,22],52:[2,22],55:[2,22],70:[2,22],75:[2,22],83:[2,22],88:[2,22],90:[2,22],99:[2,22],101:[2,22],102:[2,22],103:[2,22],107:[2,22],115:[2,22],123:[2,22],125:[2,22],126:[2,22],129:[2,22],130:[2,22],131:[2,22],132:[2,22],133:[2,22],134:[2,22]},{1:[2,23],6:[2,23],25:[2,23],26:[2,23],47:[2,23],52:[2,23],55:[2,23],70:[2,23],75:[2,23],83:[2,23],88:[2,23],90:[2,23],99:[2,23],101:[2,23],102:[2,23],103:[2,23],107:[2,23],115:[2,23],123:[2,23],125:[2,23],126:[2,23],129:[2,23],130:[2,23],131:[2,23],132:[2,23],133:[2,23],134:[2,23]},{1:[2,9],6:[2,9],26:[2,9],99:[2,9],101:[2,9],103:[2,9],107:[2,9],123:[2,9]},{1:[2,10],6:[2,10],26:[2,10],99:[2,10],101:[2,10],103:[2,10],107:[2,10],123:[2,10]},{1:[2,11],6:[2,11],26:[2,11],99:[2,11],101:[2,11],103:[2,11],107:[2,11],123:[2,11]},{1:[2,71],6:[2,71],25:[2,71],26:[2,71],38:[1,101],47:[2,71],52:[2,71],55:[2,71],64:[2,71],65:[2,71],66:[2,71],68:[2,71],70:[2,71],71:[2,71],75:[2,71],81:[2,71],82:[2,71],83:[2,71],88:[2,71],90:[2,71],99:[2,71],101:[2,71],102:[2,71],103:[2,71],107:[2,71],115:[2,71],123:[2,71],125:[2,71],126:[2,71],129:[2,71],130:[2,71],131:[2,71],132:[2,71],133:[2,71],134:[2,71]},{1:[2,72],6:[2,72],25:[2,72],26:[2,72],47:[2,72],52:[2,72],55:[2,72],64:[2,72],65:[2,72],66:[2,72],68:[2,72],70:[2,72],71:[2,72],75:[2,72],81:[2,72],82:[2,72],83:[2,72],88:[2,72],90:[2,72],99:[2,72],101:[2,72],102:[2,72],103:[2,72],107:[2,72],115:[2,72],123:[2,72],125:[2,72],126:[2,72],129:[2,72],130:[2,72],131:[2,72],132:[2,72],133:[2,72],134:[2,72]},{1:[2,73],6:[2,73],25:[2,73],26:[2,73],47:[2,73],52:[2,73],55:[2,73],64:[2,73],65:[2,73],66:[2,73],68:[2,73],70:[2,73],71:[2,73],75:[2,73],81:[2,73],82:[2,73],83:[2,73],88:[2,73],90:[2,73],99:[2,73],101:[2,73],102:[2,73],103:[2,73],107:[2,73],115:[2,73],123:[2,73],125:[2,73],126:[2,73],129:[2,73],130:[2,73],131:[2,73],132:[2,73],133:[2,73],134:[2,73]},{1:[2,74],6:[2,74],25:[2,74],26:[2,74],47:[2,74],52:[2,74],55:[2,74],64:[2,74],65:[2,74],66:[2,74],68:[2,74],70:[2,74],71:[2,74],75:[2,74],81:[2,74],82:[2,74],83:[2,74],88:[2,74],90:[2,74],99:[2,74],101:[2,74],102:[2,74],103:[2,74],107:[2,74],115:[2,74],123:[2,74],125:[2,74],126:[2,74],129:[2,74],130:[2,74],131:[2,74],132:[2,74],133:[2,74],134:[2,74]},{1:[2,75],6:[2,75],25:[2,75],26:[2,75],47:[2,75],52:[2,75],55:[2,75],64:[2,75],65:[2,75],66:[2,75],68:[2,75],70:[2,75],71:[2,75],75:[2,75],81:[2,75],82:[2,75],83:[2,75],88:[2,75],90:[2,75],99:[2,75],101:[2,75],102:[2,75],103:[2,75],107:[2,75],115:[2,75],123:[2,75],125:[2,75],126:[2,75],129:[2,75],130:[2,75],131:[2,75],132:[2,75],133:[2,75],134:[2,75]},{1:[2,101],6:[2,101],25:[2,101],26:[2,101],47:[2,101],52:[2,101],55:[2,101],64:[2,101],65:[2,101],66:[2,101],68:[2,101],70:[2,101],71:[2,101],75:[2,101],79:102,81:[2,101],82:[1,103],83:[2,101],88:[2,101],90:[2,101],99:[2,101],101:[2,101],102:[2,101],103:[2,101],107:[2,101],115:[2,101],123:[2,101],125:[2,101],126:[2,101],129:[2,101],130:[2,101],131:[2,101],132:[2,101],133:[2,101],134:[2,101]},{27:107,28:[1,71],42:108,46:104,47:[2,53],52:[2,53],53:105,54:106,56:109,57:110,73:[1,68],86:[1,111],87:[1,112]},{5:113,25:[1,5]},{8:114,9:115,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:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:116,9:115,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:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:117,9:115,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:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{13:119,14:120,27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:121,42:61,56:47,57:48,59:118,61:25,62:26,63:27,73:[1,68],80:[1,28],85:[1,56],86:[1,57],87:[1,55],98:[1,54]},{13:119,14:120,27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:121,42:61,56:47,57:48,59:122,61:25,62:26,63:27,73:[1,68],80:[1,28],85:[1,56],86:[1,57],87:[1,55],98:[1,54]},{1:[2,68],6:[2,68],25:[2,68],26:[2,68],38:[2,68],47:[2,68],52:[2,68],55:[2,68],64:[2,68],65:[2,68],66:[2,68],68:[2,68],70:[2,68],71:[2,68],75:[2,68],77:[1,126],81:[2,68],82:[2,68],83:[2,68],88:[2,68],90:[2,68],99:[2,68],101:[2,68],102:[2,68],103:[2,68],107:[2,68],115:[2,68],123:[2,68],125:[2,68],126:[2,68],127:[1,123],128:[1,124],129:[2,68],130:[2,68],131:[2,68],132:[2,68],133:[2,68],134:[2,68],135:[1,125]},{1:[2,175],6:[2,175],25:[2,175],26:[2,175],47:[2,175],52:[2,175],55:[2,175],70:[2,175],75:[2,175],83:[2,175],88:[2,175],90:[2,175],99:[2,175],101:[2,175],102:[2,175],103:[2,175],107:[2,175],115:[2,175],118:[1,127],123:[2,175],125:[2,175],126:[2,175],129:[2,175],130:[2,175],131:[2,175],132:[2,175],133:[2,175],134:[2,175]},{5:128,25:[1,5]},{5:129,25:[1,5]},{1:[2,143],6:[2,143],25:[2,143],26:[2,143],47:[2,143],52:[2,143],55:[2,143],70:[2,143],75:[2,143],83:[2,143],88:[2,143],90:[2,143],99:[2,143],101:[2,143],102:[2,143],103:[2,143],107:[2,143],115:[2,143],123:[2,143],125:[2,143],126:[2,143],129:[2,143],130:[2,143],131:[2,143],132:[2,143],133:[2,143],134:[2,143]},{5:130,25:[1,5]},{8:131,9:115,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,132],27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,91],5:133,6:[2,91],13:119,14:120,25:[1,5],26:[2,91],27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:121,42:61,47:[2,91],52:[2,91],55:[2,91],56:47,57:48,59:135,61:25,62:26,63:27,70:[2,91],73:[1,68],75:[2,91],77:[1,134],80:[1,28],83:[2,91],85:[1,56],86:[1,57],87:[1,55],88:[2,91],90:[2,91],98:[1,54],99:[2,91],101:[2,91],102:[2,91],103:[2,91],107:[2,91],115:[2,91],123:[2,91],125:[2,91],126:[2,91],129:[2,91],130:[2,91],131:[2,91],132:[2,91],133:[2,91],134:[2,91]},{8:136,9:115,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:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,45],6:[2,45],8:137,9:115,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,45],27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],99:[2,45],100:39,101:[2,45],103:[2,45],104:40,105:[1,65],106:41,107:[2,45],108:67,116:[1,42],121:37,122:[1,62],123:[2,45],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,46],6:[2,46],25:[2,46],26:[2,46],52:[2,46],75:[2,46],99:[2,46],101:[2,46],103:[2,46],107:[2,46],123:[2,46]},{1:[2,69],6:[2,69],25:[2,69],26:[2,69],38:[2,69],47:[2,69],52:[2,69],55:[2,69],64:[2,69],65:[2,69],66:[2,69],68:[2,69],70:[2,69],71:[2,69],75:[2,69],81:[2,69],82:[2,69],83:[2,69],88:[2,69],90:[2,69],99:[2,69],101:[2,69],102:[2,69],103:[2,69],107:[2,69],115:[2,69],123:[2,69],125:[2,69],126:[2,69],129:[2,69],130:[2,69],131:[2,69],132:[2,69],133:[2,69],134:[2,69]},{1:[2,70],6:[2,70],25:[2,70],26:[2,70],38:[2,70],47:[2,70],52:[2,70],55:[2,70],64:[2,70],65:[2,70],66:[2,70],68:[2,70],70:[2,70],71:[2,70],75:[2,70],81:[2,70],82:[2,70],83:[2,70],88:[2,70],90:[2,70],99:[2,70],101:[2,70],102:[2,70],103:[2,70],107:[2,70],115:[2,70],123:[2,70],125:[2,70],126:[2,70],129:[2,70],130:[2,70],131:[2,70],132:[2,70],133:[2,70],134:[2,70]},{1:[2,29],6:[2,29],25:[2,29],26:[2,29],47:[2,29],52:[2,29],55:[2,29],64:[2,29],65:[2,29],66:[2,29],68:[2,29],70:[2,29],71:[2,29],75:[2,29],81:[2,29],82:[2,29],83:[2,29],88:[2,29],90:[2,29],99:[2,29],101:[2,29],102:[2,29],103:[2,29],107:[2,29],115:[2,29],123:[2,29],125:[2,29],126:[2,29],129:[2,29],130:[2,29],131:[2,29],132:[2,29],133:[2,29],134:[2,29]},{1:[2,30],6:[2,30],25:[2,30],26:[2,30],47:[2,30],52:[2,30],55:[2,30],64:[2,30],65:[2,30],66:[2,30],68:[2,30],70:[2,30],71:[2,30],75:[2,30],81:[2,30],82:[2,30],83:[2,30],88:[2,30],90:[2,30],99:[2,30],101:[2,30],102:[2,30],103:[2,30],107:[2,30],115:[2,30],123:[2,30],125:[2,30],126:[2,30],129:[2,30],130:[2,30],131:[2,30],132:[2,30],133:[2,30],134:[2,30]},{1:[2,31],6:[2,31],25:[2,31],26:[2,31],47:[2,31],52:[2,31],55:[2,31],64:[2,31],65:[2,31],66:[2,31],68:[2,31],70:[2,31],71:[2,31],75:[2,31],81:[2,31],82:[2,31],83:[2,31],88:[2,31],90:[2,31],99:[2,31],101:[2,31],102:[2,31],103:[2,31],107:[2,31],115:[2,31],123:[2,31],125:[2,31],126:[2,31],129:[2,31],130:[2,31],131:[2,31],132:[2,31],133:[2,31],134:[2,31]},{1:[2,32],6:[2,32],25:[2,32],26:[2,32],47:[2,32],52:[2,32],55:[2,32],64:[2,32],65:[2,32],66:[2,32],68:[2,32],70:[2,32],71:[2,32],75:[2,32],81:[2,32],82:[2,32],83:[2,32],88:[2,32],90:[2,32],99:[2,32],101:[2,32],102:[2,32],103:[2,32],107:[2,32],115:[2,32],123:[2,32],125:[2,32],126:[2,32],129:[2,32],130:[2,32],131:[2,32],132:[2,32],133:[2,32],134:[2,32]},{1:[2,33],6:[2,33],25:[2,33],26:[2,33],47:[2,33],52:[2,33],55:[2,33],64:[2,33],65:[2,33],66:[2,33],68:[2,33],70:[2,33],71:[2,33],75:[2,33],81:[2,33],82:[2,33],83:[2,33],88:[2,33],90:[2,33],99:[2,33],101:[2,33],102:[2,33],103:[2,33],107:[2,33],115:[2,33],123:[2,33],125:[2,33],126:[2,33],129:[2,33],130:[2,33],131:[2,33],132:[2,33],133:[2,33],134:[2,33]},{4:138,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,139],27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:140,9:115,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,144],27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,58:145,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],84:142,85:[1,56],86:[1,57],87:[1,55],88:[1,141],91:143,93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,107],6:[2,107],25:[2,107],26:[2,107],47:[2,107],52:[2,107],55:[2,107],64:[2,107],65:[2,107],66:[2,107],68:[2,107],70:[2,107],71:[2,107],75:[2,107],81:[2,107],82:[2,107],83:[2,107],88:[2,107],90:[2,107],99:[2,107],101:[2,107],102:[2,107],103:[2,107],107:[2,107],115:[2,107],123:[2,107],125:[2,107],126:[2,107],129:[2,107],130:[2,107],131:[2,107],132:[2,107],133:[2,107],134:[2,107]},{1:[2,108],6:[2,108],25:[2,108],26:[2,108],27:146,28:[1,71],47:[2,108],52:[2,108],55:[2,108],64:[2,108],65:[2,108],66:[2,108],68:[2,108],70:[2,108],71:[2,108],75:[2,108],81:[2,108],82:[2,108],83:[2,108],88:[2,108],90:[2,108],99:[2,108],101:[2,108],102:[2,108],103:[2,108],107:[2,108],115:[2,108],123:[2,108],125:[2,108],126:[2,108],129:[2,108],130:[2,108],131:[2,108],132:[2,108],133:[2,108],134:[2,108]},{25:[2,49]},{25:[2,50]},{1:[2,64],6:[2,64],25:[2,64],26:[2,64],38:[2,64],47:[2,64],52:[2,64],55:[2,64],64:[2,64],65:[2,64],66:[2,64],68:[2,64],70:[2,64],71:[2,64],75:[2,64],77:[2,64],81:[2,64],82:[2,64],83:[2,64],88:[2,64],90:[2,64],99:[2,64],101:[2,64],102:[2,64],103:[2,64],107:[2,64],115:[2,64],123:[2,64],125:[2,64],126:[2,64],127:[2,64],128:[2,64],129:[2,64],130:[2,64],131:[2,64],132:[2,64],133:[2,64],134:[2,64],135:[2,64]},{1:[2,67],6:[2,67],25:[2,67],26:[2,67],38:[2,67],47:[2,67],52:[2,67],55:[2,67],64:[2,67],65:[2,67],66:[2,67],68:[2,67],70:[2,67],71:[2,67],75:[2,67],77:[2,67],81:[2,67],82:[2,67],83:[2,67],88:[2,67],90:[2,67],99:[2,67],101:[2,67],102:[2,67],103:[2,67],107:[2,67],115:[2,67],123:[2,67],125:[2,67],126:[2,67],127:[2,67],128:[2,67],129:[2,67],130:[2,67],131:[2,67],132:[2,67],133:[2,67],134:[2,67],135:[2,67]},{8:147,9:115,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:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:148,9:115,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:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:149,9:115,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:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{5:150,8:151,9:115,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:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{27:156,28:[1,71],56:157,57:158,62:152,73:[1,68],87:[1,55],110:153,111:[1,154],112:155},{109:159,113:[1,160],114:[1,161]},{6:[2,86],11:165,25:[2,86],27:166,28:[1,71],29:167,30:[1,69],31:[1,70],39:163,40:164,42:168,44:[1,46],52:[2,86],74:162,75:[2,86],86:[1,111]},{1:[2,27],6:[2,27],25:[2,27],26:[2,27],41:[2,27],47:[2,27],52:[2,27],55:[2,27],64:[2,27],65:[2,27],66:[2,27],68:[2,27],70:[2,27],71:[2,27],75:[2,27],81:[2,27],82:[2,27],83:[2,27],88:[2,27],90:[2,27],99:[2,27],101:[2,27],102:[2,27],103:[2,27],107:[2,27],115:[2,27],123:[2,27],125:[2,27],126:[2,27],129:[2,27],130:[2,27],131:[2,27],132:[2,27],133:[2,27],134:[2,27]},{1:[2,28],6:[2,28],25:[2,28],26:[2,28],41:[2,28],47:[2,28],52:[2,28],55:[2,28],64:[2,28],65:[2,28],66:[2,28],68:[2,28],70:[2,28],71:[2,28],75:[2,28],81:[2,28],82:[2,28],83:[2,28],88:[2,28],90:[2,28],99:[2,28],101:[2,28],102:[2,28],103:[2,28],107:[2,28],115:[2,28],123:[2,28],125:[2,28],126:[2,28],129:[2,28],130:[2,28],131:[2,28],132:[2,28],133:[2,28],134:[2,28]},{1:[2,26],6:[2,26],25:[2,26],26:[2,26],38:[2,26],41:[2,26],47:[2,26],52:[2,26],55:[2,26],64:[2,26],65:[2,26],66:[2,26],68:[2,26],70:[2,26],71:[2,26],75:[2,26],77:[2,26],81:[2,26],82:[2,26],83:[2,26],88:[2,26],90:[2,26],99:[2,26],101:[2,26],102:[2,26],103:[2,26],107:[2,26],113:[2,26],114:[2,26],115:[2,26],123:[2,26],125:[2,26],126:[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]},{1:[2,6],6:[2,6],7:169,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:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],99:[2,6],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,3]},{1:[2,24],6:[2,24],25:[2,24],26:[2,24],47:[2,24],52:[2,24],55:[2,24],70:[2,24],75:[2,24],83:[2,24],88:[2,24],90:[2,24],95:[2,24],96:[2,24],99:[2,24],101:[2,24],102:[2,24],103:[2,24],107:[2,24],115:[2,24],118:[2,24],120:[2,24],123:[2,24],125:[2,24],126:[2,24],129:[2,24],130:[2,24],131:[2,24],132:[2,24],133:[2,24],134:[2,24]},{6:[1,72],26:[1,170]},{1:[2,186],6:[2,186],25:[2,186],26:[2,186],47:[2,186],52:[2,186],55:[2,186],70:[2,186],75:[2,186],83:[2,186],88:[2,186],90:[2,186],99:[2,186],101:[2,186],102:[2,186],103:[2,186],107:[2,186],115:[2,186],123:[2,186],125:[2,186],126:[2,186],129:[2,186],130:[2,186],131:[2,186],132:[2,186],133:[2,186],134:[2,186]},{8:171,9:115,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:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:172,9:115,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:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:173,9:115,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:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:174,9:115,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:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:175,9:115,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:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:176,9:115,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:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:177,9:115,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:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:178,9:115,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:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,142],6:[2,142],25:[2,142],26:[2,142],47:[2,142],52:[2,142],55:[2,142],70:[2,142],75:[2,142],83:[2,142],88:[2,142],90:[2,142],99:[2,142],101:[2,142],102:[2,142],103:[2,142],107:[2,142],115:[2,142],123:[2,142],125:[2,142],126:[2,142],129:[2,142],130:[2,142],131:[2,142],132:[2,142],133:[2,142],134:[2,142]},{1:[2,147],6:[2,147],25:[2,147],26:[2,147],47:[2,147],52:[2,147],55:[2,147],70:[2,147],75:[2,147],83:[2,147],88:[2,147],90:[2,147],99:[2,147],101:[2,147],102:[2,147],103:[2,147],107:[2,147],115:[2,147],123:[2,147],125:[2,147],126:[2,147],129:[2,147],130:[2,147],131:[2,147],132:[2,147],133:[2,147],134:[2,147]},{8:179,9:115,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:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,141],6:[2,141],25:[2,141],26:[2,141],47:[2,141],52:[2,141],55:[2,141],70:[2,141],75:[2,141],83:[2,141],88:[2,141],90:[2,141],99:[2,141],101:[2,141],102:[2,141],103:[2,141],107:[2,141],115:[2,141],123:[2,141],125:[2,141],126:[2,141],129:[2,141],130:[2,141],131:[2,141],132:[2,141],133:[2,141],134:[2,141]},{1:[2,146],6:[2,146],25:[2,146],26:[2,146],47:[2,146],52:[2,146],55:[2,146],70:[2,146],75:[2,146],83:[2,146],88:[2,146],90:[2,146],99:[2,146],101:[2,146],102:[2,146],103:[2,146],107:[2,146],115:[2,146],123:[2,146],125:[2,146],126:[2,146],129:[2,146],130:[2,146],131:[2,146],132:[2,146],133:[2,146],134:[2,146]},{79:180,82:[1,103]},{1:[2,65],6:[2,65],25:[2,65],26:[2,65],38:[2,65],47:[2,65],52:[2,65],55:[2,65],64:[2,65],65:[2,65],66:[2,65],68:[2,65],70:[2,65],71:[2,65],75:[2,65],77:[2,65],81:[2,65],82:[2,65],83:[2,65],88:[2,65],90:[2,65],99:[2,65],101:[2,65],102:[2,65],103:[2,65],107:[2,65],115:[2,65],123:[2,65],125:[2,65],126:[2,65],127:[2,65],128:[2,65],129:[2,65],130:[2,65],131:[2,65],132:[2,65],133:[2,65],134:[2,65],135:[2,65]},{82:[2,104]},{27:181,28:[1,71]},{27:182,28:[1,71]},{1:[2,79],6:[2,79],25:[2,79],26:[2,79],27:183,28:[1,71],38:[2,79],47:[2,79],52:[2,79],55:[2,79],64:[2,79],65:[2,79],66:[2,79],68:[2,79],70:[2,79],71:[2,79],75:[2,79],77:[2,79],81:[2,79],82:[2,79],83:[2,79],88:[2,79],90:[2,79],99:[2,79],101:[2,79],102:[2,79],103:[2,79],107:[2,79],115:[2,79],123:[2,79],125:[2,79],126:[2,79],127:[2,79],128:[2,79],129:[2,79],130:[2,79],131:[2,79],132:[2,79],133:[2,79],134:[2,79],135:[2,79]},{1:[2,80],6:[2,80],25:[2,80],26:[2,80],38:[2,80],47:[2,80],52:[2,80],55:[2,80],64:[2,80],65:[2,80],66:[2,80],68:[2,80],70:[2,80],71:[2,80],75:[2,80],77:[2,80],81:[2,80],82:[2,80],83:[2,80],88:[2,80],90:[2,80],99:[2,80],101:[2,80],102:[2,80],103:[2,80],107:[2,80],115:[2,80],123:[2,80],125:[2,80],126:[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]},{8:185,9:115,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:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],55:[1,189],56:47,57:48,59:36,61:25,62:26,63:27,69:184,72:186,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],89:187,90:[1,188],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{67:190,68:[1,97],71:[1,98]},{79:191,82:[1,103]},{1:[2,66],6:[2,66],25:[2,66],26:[2,66],38:[2,66],47:[2,66],52:[2,66],55:[2,66],64:[2,66],65:[2,66],66:[2,66],68:[2,66],70:[2,66],71:[2,66],75:[2,66],77:[2,66],81:[2,66],82:[2,66],83:[2,66],88:[2,66],90:[2,66],99:[2,66],101:[2,66],102:[2,66],103:[2,66],107:[2,66],115:[2,66],123:[2,66],125:[2,66],126:[2,66],127:[2,66],128:[2,66],129:[2,66],130:[2,66],131:[2,66],132:[2,66],133:[2,66],134:[2,66],135:[2,66]},{6:[1,193],8:192,9:115,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,194],27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,102],6:[2,102],25:[2,102],26:[2,102],47:[2,102],52:[2,102],55:[2,102],64:[2,102],65:[2,102],66:[2,102],68:[2,102],70:[2,102],71:[2,102],75:[2,102],81:[2,102],82:[2,102],83:[2,102],88:[2,102],90:[2,102],99:[2,102],101:[2,102],102:[2,102],103:[2,102],107:[2,102],115:[2,102],123:[2,102],125:[2,102],126:[2,102],129:[2,102],130:[2,102],131:[2,102],132:[2,102],133:[2,102],134:[2,102]},{8:197,9:115,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,144],27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,58:145,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],83:[1,195],84:196,85:[1,56],86:[1,57],87:[1,55],91:143,93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{47:[1,198],52:[1,199]},{47:[2,54],52:[2,54]},{38:[1,201],47:[2,56],52:[2,56],55:[1,200]},{38:[2,59],47:[2,59],52:[2,59],55:[2,59]},{38:[2,60],47:[2,60],52:[2,60],55:[2,60]},{38:[2,61],47:[2,61],52:[2,61],55:[2,61]},{38:[2,62],47:[2,62],52:[2,62],55:[2,62]},{27:146,28:[1,71]},{8:197,9:115,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,144],27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,58:145,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],84:142,85:[1,56],86:[1,57],87:[1,55],88:[1,141],91:143,93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,48],6:[2,48],25:[2,48],26:[2,48],47:[2,48],52:[2,48],55:[2,48],70:[2,48],75:[2,48],83:[2,48],88:[2,48],90:[2,48],99:[2,48],101:[2,48],102:[2,48],103:[2,48],107:[2,48],115:[2,48],123:[2,48],125:[2,48],126:[2,48],129:[2,48],130:[2,48],131:[2,48],132:[2,48],133:[2,48],134:[2,48]},{1:[2,179],6:[2,179],25:[2,179],26:[2,179],47:[2,179],52:[2,179],55:[2,179],70:[2,179],75:[2,179],83:[2,179],88:[2,179],90:[2,179],99:[2,179],100:85,101:[2,179],102:[2,179],103:[2,179],106:86,107:[2,179],108:67,115:[2,179],123:[2,179],125:[2,179],126:[2,179],129:[1,76],130:[2,179],131:[2,179],132:[2,179],133:[2,179],134:[2,179]},{100:88,101:[1,63],103:[1,64],106:89,107:[1,66],108:67,123:[1,87]},{1:[2,180],6:[2,180],25:[2,180],26:[2,180],47:[2,180],52:[2,180],55:[2,180],70:[2,180],75:[2,180],83:[2,180],88:[2,180],90:[2,180],99:[2,180],100:85,101:[2,180],102:[2,180],103:[2,180],106:86,107:[2,180],108:67,115:[2,180],123:[2,180],125:[2,180],126:[2,180],129:[1,76],130:[2,180],131:[2,180],132:[2,180],133:[2,180],134:[2,180]},{1:[2,181],6:[2,181],25:[2,181],26:[2,181],47:[2,181],52:[2,181],55:[2,181],70:[2,181],75:[2,181],83:[2,181],88:[2,181],90:[2,181],99:[2,181],100:85,101:[2,181],102:[2,181],103:[2,181],106:86,107:[2,181],108:67,115:[2,181],123:[2,181],125:[2,181],126:[2,181],129:[1,76],130:[2,181],131:[2,181],132:[2,181],133:[2,181],134:[2,181]},{1:[2,182],6:[2,182],25:[2,182],26:[2,182],47:[2,182],52:[2,182],55:[2,182],64:[2,68],65:[2,68],66:[2,68],68:[2,68],70:[2,182],71:[2,68],75:[2,182],81:[2,68],82:[2,68],83:[2,182],88:[2,182],90:[2,182],99:[2,182],101:[2,182],102:[2,182],103:[2,182],107:[2,182],115:[2,182],123:[2,182],125:[2,182],126:[2,182],129:[2,182],130:[2,182],131:[2,182],132:[2,182],133:[2,182],134:[2,182]},{60:91,64:[1,93],65:[1,94],66:[1,95],67:96,68:[1,97],71:[1,98],78:90,81:[1,92],82:[2,103]},{60:100,64:[1,93],65:[1,94],66:[1,95],67:96,68:[1,97],71:[1,98],78:99,81:[1,92],82:[2,103]},{64:[2,71],65:[2,71],66:[2,71],68:[2,71],71:[2,71],81:[2,71],82:[2,71]},{1:[2,183],6:[2,183],25:[2,183],26:[2,183],47:[2,183],52:[2,183],55:[2,183],64:[2,68],65:[2,68],66:[2,68],68:[2,68],70:[2,183],71:[2,68],75:[2,183],81:[2,68],82:[2,68],83:[2,183],88:[2,183],90:[2,183],99:[2,183],101:[2,183],102:[2,183],103:[2,183],107:[2,183],115:[2,183],123:[2,183],125:[2,183],126:[2,183],129:[2,183],130:[2,183],131:[2,183],132:[2,183],133:[2,183],134:[2,183]},{1:[2,184],6:[2,184],25:[2,184],26:[2,184],47:[2,184],52:[2,184],55:[2,184],70:[2,184],75:[2,184],83:[2,184],88:[2,184],90:[2,184],99:[2,184],101:[2,184],102:[2,184],103:[2,184],107:[2,184],115:[2,184],123:[2,184],125:[2,184],126:[2,184],129:[2,184],130:[2,184],131:[2,184],132:[2,184],133:[2,184],134:[2,184]},{1:[2,185],6:[2,185],25:[2,185],26:[2,185],47:[2,185],52:[2,185],55:[2,185],70:[2,185],75:[2,185],83:[2,185],88:[2,185],90:[2,185],99:[2,185],101:[2,185],102:[2,185],103:[2,185],107:[2,185],115:[2,185],123:[2,185],125:[2,185],126:[2,185],129:[2,185],130:[2,185],131:[2,185],132:[2,185],133:[2,185],134:[2,185]},{8:202,9:115,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,203],27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:204,9:115,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:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{5:205,25:[1,5],122:[1,206]},{1:[2,128],6:[2,128],25:[2,128],26:[2,128],47:[2,128],52:[2,128],55:[2,128],70:[2,128],75:[2,128],83:[2,128],88:[2,128],90:[2,128],94:207,95:[1,208],96:[1,209],99:[2,128],101:[2,128],102:[2,128],103:[2,128],107:[2,128],115:[2,128],123:[2,128],125:[2,128],126:[2,128],129:[2,128],130:[2,128],131:[2,128],132:[2,128],133:[2,128],134:[2,128]},{1:[2,140],6:[2,140],25:[2,140],26:[2,140],47:[2,140],52:[2,140],55:[2,140],70:[2,140],75:[2,140],83:[2,140],88:[2,140],90:[2,140],99:[2,140],101:[2,140],102:[2,140],103:[2,140],107:[2,140],115:[2,140],123:[2,140],125:[2,140],126:[2,140],129:[2,140],130:[2,140],131:[2,140],132:[2,140],133:[2,140],134:[2,140]},{1:[2,148],6:[2,148],25:[2,148],26:[2,148],47:[2,148],52:[2,148],55:[2,148],70:[2,148],75:[2,148],83:[2,148],88:[2,148],90:[2,148],99:[2,148],101:[2,148],102:[2,148],103:[2,148],107:[2,148],115:[2,148],123:[2,148],125:[2,148],126:[2,148],129:[2,148],130:[2,148],131:[2,148],132:[2,148],133:[2,148],134:[2,148]},{25:[1,210],100:85,101:[1,63],103:[1,64],106:86,107:[1,66],108:67,123:[1,84],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{117:211,119:212,120:[1,213]},{1:[2,92],6:[2,92],25:[2,92],26:[2,92],47:[2,92],52:[2,92],55:[2,92],70:[2,92],75:[2,92],83:[2,92],88:[2,92],90:[2,92],99:[2,92],101:[2,92],102:[2,92],103:[2,92],107:[2,92],115:[2,92],123:[2,92],125:[2,92],126:[2,92],129:[2,92],130:[2,92],131:[2,92],132:[2,92],133:[2,92],134:[2,92]},{8:214,9:115,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:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,95],5:215,6:[2,95],25:[1,5],26:[2,95],47:[2,95],52:[2,95],55:[2,95],64:[2,68],65:[2,68],66:[2,68],68:[2,68],70:[2,95],71:[2,68],75:[2,95],77:[1,216],81:[2,68],82:[2,68],83:[2,95],88:[2,95],90:[2,95],99:[2,95],101:[2,95],102:[2,95],103:[2,95],107:[2,95],115:[2,95],123:[2,95],125:[2,95],126:[2,95],129:[2,95],130:[2,95],131:[2,95],132:[2,95],133:[2,95],134:[2,95]},{1:[2,133],6:[2,133],25:[2,133],26:[2,133],47:[2,133],52:[2,133],55:[2,133],70:[2,133],75:[2,133],83:[2,133],88:[2,133],90:[2,133],99:[2,133],100:85,101:[2,133],102:[2,133],103:[2,133],106:86,107:[2,133],108:67,115:[2,133],123:[2,133],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{1:[2,44],6:[2,44],26:[2,44],99:[2,44],100:85,101:[2,44],103:[2,44],106:86,107:[2,44],108:67,123:[2,44],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{6:[1,72],99:[1,217]},{4:218,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:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{6:[2,124],25:[2,124],52:[2,124],55:[1,220],88:[2,124],89:219,90:[1,188],100:85,101:[1,63],103:[1,64],106:86,107:[1,66],108:67,123:[1,84],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{1:[2,110],6:[2,110],25:[2,110],26:[2,110],38:[2,110],47:[2,110],52:[2,110],55:[2,110],64:[2,110],65:[2,110],66:[2,110],68:[2,110],70:[2,110],71:[2,110],75:[2,110],81:[2,110],82:[2,110],83:[2,110],88:[2,110],90:[2,110],99:[2,110],101:[2,110],102:[2,110],103:[2,110],107:[2,110],113:[2,110],114:[2,110],115:[2,110],123:[2,110],125:[2,110],126:[2,110],129:[2,110],130:[2,110],131:[2,110],132:[2,110],133:[2,110],134:[2,110]},{6:[2,51],25:[2,51],51:221,52:[1,222],88:[2,51]},{6:[2,119],25:[2,119],26:[2,119],52:[2,119],83:[2,119],88:[2,119]},{8:197,9:115,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,144],27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,58:145,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],84:223,85:[1,56],86:[1,57],87:[1,55],91:143,93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{6:[2,125],25:[2,125],26:[2,125],52:[2,125],83:[2,125],88:[2,125]},{1:[2,109],6:[2,109],25:[2,109],26:[2,109],38:[2,109],41:[2,109],47:[2,109],52:[2,109],55:[2,109],64:[2,109],65:[2,109],66:[2,109],68:[2,109],70:[2,109],71:[2,109],75:[2,109],77:[2,109],81:[2,109],82:[2,109],83:[2,109],88:[2,109],90:[2,109],99:[2,109],101:[2,109],102:[2,109],103:[2,109],107:[2,109],115:[2,109],123:[2,109],125:[2,109],126:[2,109],127:[2,109],128:[2,109],129:[2,109],130:[2,109],131:[2,109],132:[2,109],133:[2,109],134:[2,109],135:[2,109]},{5:224,25:[1,5],100:85,101:[1,63],103:[1,64],106:86,107:[1,66],108:67,123:[1,84],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{1:[2,136],6:[2,136],25:[2,136],26:[2,136],47:[2,136],52:[2,136],55:[2,136],70:[2,136],75:[2,136],83:[2,136],88:[2,136],90:[2,136],99:[2,136],100:85,101:[1,63],102:[1,225],103:[1,64],106:86,107:[1,66],108:67,115:[2,136],123:[2,136],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{1:[2,138],6:[2,138],25:[2,138],26:[2,138],47:[2,138],52:[2,138],55:[2,138],70:[2,138],75:[2,138],83:[2,138],88:[2,138],90:[2,138],99:[2,138],100:85,101:[1,63],102:[1,226],103:[1,64],106:86,107:[1,66],108:67,115:[2,138],123:[2,138],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{1:[2,144],6:[2,144],25:[2,144],26:[2,144],47:[2,144],52:[2,144],55:[2,144],70:[2,144],75:[2,144],83:[2,144],88:[2,144],90:[2,144],99:[2,144],101:[2,144],102:[2,144],103:[2,144],107:[2,144],115:[2,144],123:[2,144],125:[2,144],126:[2,144],129:[2,144],130:[2,144],131:[2,144],132:[2,144],133:[2,144],134:[2,144]},{1:[2,145],6:[2,145],25:[2,145],26:[2,145],47:[2,145],52:[2,145],55:[2,145],70:[2,145],75:[2,145],83:[2,145],88:[2,145],90:[2,145],99:[2,145],100:85,101:[1,63],102:[2,145],103:[1,64],106:86,107:[1,66],108:67,115:[2,145],123:[2,145],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{1:[2,149],6:[2,149],25:[2,149],26:[2,149],47:[2,149],52:[2,149],55:[2,149],70:[2,149],75:[2,149],83:[2,149],88:[2,149],90:[2,149],99:[2,149],101:[2,149],102:[2,149],103:[2,149],107:[2,149],115:[2,149],123:[2,149],125:[2,149],126:[2,149],129:[2,149],130:[2,149],131:[2,149],132:[2,149],133:[2,149],134:[2,149]},{113:[2,151],114:[2,151]},{27:156,28:[1,71],56:157,57:158,73:[1,68],87:[1,112],110:227,112:155},{52:[1,228],113:[2,156],114:[2,156]},{52:[2,153],113:[2,153],114:[2,153]},{52:[2,154],113:[2,154],114:[2,154]},{52:[2,155],113:[2,155],114:[2,155]},{1:[2,150],6:[2,150],25:[2,150],26:[2,150],47:[2,150],52:[2,150],55:[2,150],70:[2,150],75:[2,150],83:[2,150],88:[2,150],90:[2,150],99:[2,150],101:[2,150],102:[2,150],103:[2,150],107:[2,150],115:[2,150],123:[2,150],125:[2,150],126:[2,150],129:[2,150],130:[2,150],131:[2,150],132:[2,150],133:[2,150],134:[2,150]},{8:229,9:115,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:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:230,9:115,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:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{6:[2,51],25:[2,51],51:231,52:[1,232],75:[2,51]},{6:[2,87],25:[2,87],26:[2,87],52:[2,87],75:[2,87]},{6:[2,37],25:[2,37],26:[2,37],41:[1,233],52:[2,37],75:[2,37]},{6:[2,40],25:[2,40],26:[2,40],52:[2,40],75:[2,40]},{6:[2,41],25:[2,41],26:[2,41],41:[2,41],52:[2,41],75:[2,41]},{6:[2,42],25:[2,42],26:[2,42],41:[2,42],52:[2,42],75:[2,42]},{6:[2,43],25:[2,43],26:[2,43],41:[2,43],52:[2,43],75:[2,43]},{1:[2,5],6:[2,5],26:[2,5],99:[2,5]},{1:[2,25],6:[2,25],25:[2,25],26:[2,25],47:[2,25],52:[2,25],55:[2,25],70:[2,25],75:[2,25],83:[2,25],88:[2,25],90:[2,25],95:[2,25],96:[2,25],99:[2,25],101:[2,25],102:[2,25],103:[2,25],107:[2,25],115:[2,25],118:[2,25],120:[2,25],123:[2,25],125:[2,25],126:[2,25],129:[2,25],130:[2,25],131:[2,25],132:[2,25],133:[2,25],134:[2,25]},{1:[2,187],6:[2,187],25:[2,187],26:[2,187],47:[2,187],52:[2,187],55:[2,187],70:[2,187],75:[2,187],83:[2,187],88:[2,187],90:[2,187],99:[2,187],100:85,101:[2,187],102:[2,187],103:[2,187],106:86,107:[2,187],108:67,115:[2,187],123:[2,187],125:[2,187],126:[2,187],129:[1,76],130:[1,79],131:[2,187],132:[2,187],133:[2,187],134:[2,187]},{1:[2,188],6:[2,188],25:[2,188],26:[2,188],47:[2,188],52:[2,188],55:[2,188],70:[2,188],75:[2,188],83:[2,188],88:[2,188],90:[2,188],99:[2,188],100:85,101:[2,188],102:[2,188],103:[2,188],106:86,107:[2,188],108:67,115:[2,188],123:[2,188],125:[2,188],126:[2,188],129:[1,76],130:[1,79],131:[2,188],132:[2,188],133:[2,188],134:[2,188]},{1:[2,189],6:[2,189],25:[2,189],26:[2,189],47:[2,189],52:[2,189],55:[2,189],70:[2,189],75:[2,189],83:[2,189],88:[2,189],90:[2,189],99:[2,189],100:85,101:[2,189],102:[2,189],103:[2,189],106:86,107:[2,189],108:67,115:[2,189],123:[2,189],125:[2,189],126:[2,189],129:[1,76],130:[2,189],131:[2,189],132:[2,189],133:[2,189],134:[2,189]},{1:[2,190],6:[2,190],25:[2,190],26:[2,190],47:[2,190],52:[2,190],55:[2,190],70:[2,190],75:[2,190],83:[2,190],88:[2,190],90:[2,190],99:[2,190],100:85,101:[2,190],102:[2,190],103:[2,190],106:86,107:[2,190],108:67,115:[2,190],123:[2,190],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[2,190],132:[2,190],133:[2,190],134:[2,190]},{1:[2,191],6:[2,191],25:[2,191],26:[2,191],47:[2,191],52:[2,191],55:[2,191],70:[2,191],75:[2,191],83:[2,191],88:[2,191],90:[2,191],99:[2,191],100:85,101:[2,191],102:[2,191],103:[2,191],106:86,107:[2,191],108:67,115:[2,191],123:[2,191],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[2,191],133:[2,191],134:[1,83]},{1:[2,192],6:[2,192],25:[2,192],26:[2,192],47:[2,192],52:[2,192],55:[2,192],70:[2,192],75:[2,192],83:[2,192],88:[2,192],90:[2,192],99:[2,192],100:85,101:[2,192],102:[2,192],103:[2,192],106:86,107:[2,192],108:67,115:[2,192],123:[2,192],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[2,192],134:[1,83]},{1:[2,193],6:[2,193],25:[2,193],26:[2,193],47:[2,193],52:[2,193],55:[2,193],70:[2,193],75:[2,193],83:[2,193],88:[2,193],90:[2,193],99:[2,193],100:85,101:[2,193],102:[2,193],103:[2,193],106:86,107:[2,193],108:67,115:[2,193],123:[2,193],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[2,193],133:[2,193],134:[2,193]},{1:[2,178],6:[2,178],25:[2,178],26:[2,178],47:[2,178],52:[2,178],55:[2,178],70:[2,178],75:[2,178],83:[2,178],88:[2,178],90:[2,178],99:[2,178],100:85,101:[1,63],102:[2,178],103:[1,64],106:86,107:[1,66],108:67,115:[2,178],123:[1,84],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{1:[2,177],6:[2,177],25:[2,177],26:[2,177],47:[2,177],52:[2,177],55:[2,177],70:[2,177],75:[2,177],83:[2,177],88:[2,177],90:[2,177],99:[2,177],100:85,101:[1,63],102:[2,177],103:[1,64],106:86,107:[1,66],108:67,115:[2,177],123:[1,84],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{1:[2,99],6:[2,99],25:[2,99],26:[2,99],47:[2,99],52:[2,99],55:[2,99],64:[2,99],65:[2,99],66:[2,99],68:[2,99],70:[2,99],71:[2,99],75:[2,99],81:[2,99],82:[2,99],83:[2,99],88:[2,99],90:[2,99],99:[2,99],101:[2,99],102:[2,99],103:[2,99],107:[2,99],115:[2,99],123:[2,99],125:[2,99],126:[2,99],129:[2,99],130:[2,99],131:[2,99],132:[2,99],133:[2,99],134:[2,99]},{1:[2,76],6:[2,76],25:[2,76],26:[2,76],38:[2,76],47:[2,76],52:[2,76],55:[2,76],64:[2,76],65:[2,76],66:[2,76],68:[2,76],70:[2,76],71:[2,76],75:[2,76],77:[2,76],81:[2,76],82:[2,76],83:[2,76],88:[2,76],90:[2,76],99:[2,76],101:[2,76],102:[2,76],103:[2,76],107:[2,76],115:[2,76],123:[2,76],125:[2,76],126:[2,76],127:[2,76],128:[2,76],129:[2,76],130:[2,76],131:[2,76],132:[2,76],133:[2,76],134:[2,76],135:[2,76]},{1:[2,77],6:[2,77],25:[2,77],26:[2,77],38:[2,77],47:[2,77],52:[2,77],55:[2,77],64:[2,77],65:[2,77],66:[2,77],68:[2,77],70:[2,77],71:[2,77],75:[2,77],77:[2,77],81:[2,77],82:[2,77],83:[2,77],88:[2,77],90:[2,77],99:[2,77],101:[2,77],102:[2,77],103:[2,77],107:[2,77],115:[2,77],123:[2,77],125:[2,77],126:[2,77],127:[2,77],128:[2,77],129:[2,77],130:[2,77],131:[2,77],132:[2,77],133:[2,77],134:[2,77],135:[2,77]},{1:[2,78],6:[2,78],25:[2,78],26:[2,78],38:[2,78],47:[2,78],52:[2,78],55:[2,78],64:[2,78],65:[2,78],66:[2,78],68:[2,78],70:[2,78],71:[2,78],75:[2,78],77:[2,78],81:[2,78],82:[2,78],83:[2,78],88:[2,78],90:[2,78],99:[2,78],101:[2,78],102:[2,78],103:[2,78],107:[2,78],115:[2,78],123:[2,78],125:[2,78],126:[2,78],127:[2,78],128:[2,78],129:[2,78],130:[2,78],131:[2,78],132:[2,78],133:[2,78],134:[2,78],135:[2,78]},{70:[1,234]},{55:[1,189],70:[2,83],89:235,90:[1,188],100:85,101:[1,63],103:[1,64],106:86,107:[1,66],108:67,123:[1,84],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{70:[2,84]},{8:236,9:115,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:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,70:[2,118],73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{12:[2,112],28:[2,112],30:[2,112],31:[2,112],33:[2,112],34:[2,112],35:[2,112],36:[2,112],43:[2,112],44:[2,112],45:[2,112],49:[2,112],50:[2,112],70:[2,112],73:[2,112],76:[2,112],80:[2,112],85:[2,112],86:[2,112],87:[2,112],93:[2,112],97:[2,112],98:[2,112],101:[2,112],103:[2,112],105:[2,112],107:[2,112],116:[2,112],122:[2,112],124:[2,112],125:[2,112],126:[2,112],127:[2,112],128:[2,112]},{12:[2,113],28:[2,113],30:[2,113],31:[2,113],33:[2,113],34:[2,113],35:[2,113],36:[2,113],43:[2,113],44:[2,113],45:[2,113],49:[2,113],50:[2,113],70:[2,113],73:[2,113],76:[2,113],80:[2,113],85:[2,113],86:[2,113],87:[2,113],93:[2,113],97:[2,113],98:[2,113],101:[2,113],103:[2,113],105:[2,113],107:[2,113],116:[2,113],122:[2,113],124:[2,113],125:[2,113],126:[2,113],127:[2,113],128:[2,113]},{1:[2,82],6:[2,82],25:[2,82],26:[2,82],38:[2,82],47:[2,82],52:[2,82],55:[2,82],64:[2,82],65:[2,82],66:[2,82],68:[2,82],70:[2,82],71:[2,82],75:[2,82],77:[2,82],81:[2,82],82:[2,82],83:[2,82],88:[2,82],90:[2,82],99:[2,82],101:[2,82],102:[2,82],103:[2,82],107:[2,82],115:[2,82],123:[2,82],125:[2,82],126:[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]},{1:[2,100],6:[2,100],25:[2,100],26:[2,100],47:[2,100],52:[2,100],55:[2,100],64:[2,100],65:[2,100],66:[2,100],68:[2,100],70:[2,100],71:[2,100],75:[2,100],81:[2,100],82:[2,100],83:[2,100],88:[2,100],90:[2,100],99:[2,100],101:[2,100],102:[2,100],103:[2,100],107:[2,100],115:[2,100],123:[2,100],125:[2,100],126:[2,100],129:[2,100],130:[2,100],131:[2,100],132:[2,100],133:[2,100],134:[2,100]},{1:[2,34],6:[2,34],25:[2,34],26:[2,34],47:[2,34],52:[2,34],55:[2,34],70:[2,34],75:[2,34],83:[2,34],88:[2,34],90:[2,34],99:[2,34],100:85,101:[2,34],102:[2,34],103:[2,34],106:86,107:[2,34],108:67,115:[2,34],123:[2,34],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{8:237,9:115,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:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:238,9:115,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:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,105],6:[2,105],25:[2,105],26:[2,105],47:[2,105],52:[2,105],55:[2,105],64:[2,105],65:[2,105],66:[2,105],68:[2,105],70:[2,105],71:[2,105],75:[2,105],81:[2,105],82:[2,105],83:[2,105],88:[2,105],90:[2,105],99:[2,105],101:[2,105],102:[2,105],103:[2,105],107:[2,105],115:[2,105],123:[2,105],125:[2,105],126:[2,105],129:[2,105],130:[2,105],131:[2,105],132:[2,105],133:[2,105],134:[2,105]},{6:[2,51],25:[2,51],51:239,52:[1,222],83:[2,51]},{6:[2,124],25:[2,124],26:[2,124],52:[2,124],55:[1,240],83:[2,124],88:[2,124],100:85,101:[1,63],103:[1,64],106:86,107:[1,66],108:67,123:[1,84],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{48:241,49:[1,58],50:[1,59]},{27:107,28:[1,71],42:108,53:242,54:106,56:109,57:110,73:[1,68],86:[1,111],87:[1,112]},{47:[2,57],52:[2,57]},{8:243,9:115,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:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,194],6:[2,194],25:[2,194],26:[2,194],47:[2,194],52:[2,194],55:[2,194],70:[2,194],75:[2,194],83:[2,194],88:[2,194],90:[2,194],99:[2,194],100:85,101:[2,194],102:[2,194],103:[2,194],106:86,107:[2,194],108:67,115:[2,194],123:[2,194],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{8:244,9:115,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:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,196],6:[2,196],25:[2,196],26:[2,196],47:[2,196],52:[2,196],55:[2,196],70:[2,196],75:[2,196],83:[2,196],88:[2,196],90:[2,196],99:[2,196],100:85,101:[2,196],102:[2,196],103:[2,196],106:86,107:[2,196],108:67,115:[2,196],123:[2,196],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{1:[2,176],6:[2,176],25:[2,176],26:[2,176],47:[2,176],52:[2,176],55:[2,176],70:[2,176],75:[2,176],83:[2,176],88:[2,176],90:[2,176],99:[2,176],101:[2,176],102:[2,176],103:[2,176],107:[2,176],115:[2,176],123:[2,176],125:[2,176],126:[2,176],129:[2,176],130:[2,176],131:[2,176],132:[2,176],133:[2,176],134:[2,176]},{8:245,9:115,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:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,129],6:[2,129],25:[2,129],26:[2,129],47:[2,129],52:[2,129],55:[2,129],70:[2,129],75:[2,129],83:[2,129],88:[2,129],90:[2,129],95:[1,246],99:[2,129],101:[2,129],102:[2,129],103:[2,129],107:[2,129],115:[2,129],123:[2,129],125:[2,129],126:[2,129],129:[2,129],130:[2,129],131:[2,129],132:[2,129],133:[2,129],134:[2,129]},{5:247,25:[1,5]},{27:248,28:[1,71]},{117:249,119:212,120:[1,213]},{26:[1,250],118:[1,251],119:252,120:[1,213]},{26:[2,169],118:[2,169],120:[2,169]},{8:254,9:115,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:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],92:253,93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,93],5:255,6:[2,93],25:[1,5],26:[2,93],47:[2,93],52:[2,93],55:[2,93],70:[2,93],75:[2,93],83:[2,93],88:[2,93],90:[2,93],99:[2,93],100:85,101:[1,63],102:[2,93],103:[1,64],106:86,107:[1,66],108:67,115:[2,93],123:[2,93],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{1:[2,96],6:[2,96],25:[2,96],26:[2,96],47:[2,96],52:[2,96],55:[2,96],70:[2,96],75:[2,96],83:[2,96],88:[2,96],90:[2,96],99:[2,96],101:[2,96],102:[2,96],103:[2,96],107:[2,96],115:[2,96],123:[2,96],125:[2,96],126:[2,96],129:[2,96],130:[2,96],131:[2,96],132:[2,96],133:[2,96],134:[2,96]},{8:256,9:115,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:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,134],6:[2,134],25:[2,134],26:[2,134],47:[2,134],52:[2,134],55:[2,134],64:[2,134],65:[2,134],66:[2,134],68:[2,134],70:[2,134],71:[2,134],75:[2,134],81:[2,134],82:[2,134],83:[2,134],88:[2,134],90:[2,134],99:[2,134],101:[2,134],102:[2,134],103:[2,134],107:[2,134],115:[2,134],123:[2,134],125:[2,134],126:[2,134],129:[2,134],130:[2,134],131:[2,134],132:[2,134],133:[2,134],134:[2,134]},{6:[1,72],26:[1,257]},{8:258,9:115,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:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{6:[2,63],12:[2,113],25:[2,63],28:[2,113],30:[2,113],31:[2,113],33:[2,113],34:[2,113],35:[2,113],36:[2,113],43:[2,113],44:[2,113],45:[2,113],49:[2,113],50:[2,113],52:[2,63],73:[2,113],76:[2,113],80:[2,113],85:[2,113],86:[2,113],87:[2,113],88:[2,63],93:[2,113],97:[2,113],98:[2,113],101:[2,113],103:[2,113],105:[2,113],107:[2,113],116:[2,113],122:[2,113],124:[2,113],125:[2,113],126:[2,113],127:[2,113],128:[2,113]},{6:[1,260],25:[1,261],88:[1,259]},{6:[2,52],8:197,9:115,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,52],26:[2,52],27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,58:145,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],83:[2,52],85:[1,56],86:[1,57],87:[1,55],88:[2,52],91:262,93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{6:[2,51],25:[2,51],26:[2,51],51:263,52:[1,222]},{1:[2,173],6:[2,173],25:[2,173],26:[2,173],47:[2,173],52:[2,173],55:[2,173],70:[2,173],75:[2,173],83:[2,173],88:[2,173],90:[2,173],99:[2,173],101:[2,173],102:[2,173],103:[2,173],107:[2,173],115:[2,173],118:[2,173],123:[2,173],125:[2,173],126:[2,173],129:[2,173],130:[2,173],131:[2,173],132:[2,173],133:[2,173],134:[2,173]},{8:264,9:115,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:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:265,9:115,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:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{113:[2,152],114:[2,152]},{27:156,28:[1,71],56:157,57:158,73:[1,68],87:[1,112],112:266},{1:[2,158],6:[2,158],25:[2,158],26:[2,158],47:[2,158],52:[2,158],55:[2,158],70:[2,158],75:[2,158],83:[2,158],88:[2,158],90:[2,158],99:[2,158],100:85,101:[2,158],102:[1,267],103:[2,158],106:86,107:[2,158],108:67,115:[1,268],123:[2,158],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{1:[2,159],6:[2,159],25:[2,159],26:[2,159],47:[2,159],52:[2,159],55:[2,159],70:[2,159],75:[2,159],83:[2,159],88:[2,159],90:[2,159],99:[2,159],100:85,101:[2,159],102:[1,269],103:[2,159],106:86,107:[2,159],108:67,115:[2,159],123:[2,159],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{6:[1,271],25:[1,272],75:[1,270]},{6:[2,52],11:165,25:[2,52],26:[2,52],27:166,28:[1,71],29:167,30:[1,69],31:[1,70],39:273,40:164,42:168,44:[1,46],75:[2,52],86:[1,111]},{8:274,9:115,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,275],27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,81],6:[2,81],25:[2,81],26:[2,81],38:[2,81],47:[2,81],52:[2,81],55:[2,81],64:[2,81],65:[2,81],66:[2,81],68:[2,81],70:[2,81],71:[2,81],75:[2,81],77:[2,81],81:[2,81],82:[2,81],83:[2,81],88:[2,81],90:[2,81],99:[2,81],101:[2,81],102:[2,81],103:[2,81],107:[2,81],115:[2,81],123:[2,81],125:[2,81],126:[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]},{8:276,9:115,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:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,70:[2,116],73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{70:[2,117],100:85,101:[1,63],103:[1,64],106:86,107:[1,66],108:67,123:[1,84],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{1:[2,35],6:[2,35],25:[2,35],26:[2,35],47:[2,35],52:[2,35],55:[2,35],70:[2,35],75:[2,35],83:[2,35],88:[2,35],90:[2,35],99:[2,35],100:85,101:[2,35],102:[2,35],103:[2,35],106:86,107:[2,35],108:67,115:[2,35],123:[2,35],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{26:[1,277],100:85,101:[1,63],103:[1,64],106:86,107:[1,66],108:67,123:[1,84],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{6:[1,260],25:[1,261],83:[1,278]},{6:[2,63],25:[2,63],26:[2,63],52:[2,63],83:[2,63],88:[2,63]},{5:279,25:[1,5]},{47:[2,55],52:[2,55]},{47:[2,58],52:[2,58],100:85,101:[1,63],103:[1,64],106:86,107:[1,66],108:67,123:[1,84],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{26:[1,280],100:85,101:[1,63],103:[1,64],106:86,107:[1,66],108:67,123:[1,84],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{5:281,25:[1,5],100:85,101:[1,63],103:[1,64],106:86,107:[1,66],108:67,123:[1,84],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{5:282,25:[1,5]},{1:[2,130],6:[2,130],25:[2,130],26:[2,130],47:[2,130],52:[2,130],55:[2,130],70:[2,130],75:[2,130],83:[2,130],88:[2,130],90:[2,130],99:[2,130],101:[2,130],102:[2,130],103:[2,130],107:[2,130],115:[2,130],123:[2,130],125:[2,130],126:[2,130],129:[2,130],130:[2,130],131:[2,130],132:[2,130],133:[2,130],134:[2,130]},{5:283,25:[1,5]},{26:[1,284],118:[1,285],119:252,120:[1,213]},{1:[2,167],6:[2,167],25:[2,167],26:[2,167],47:[2,167],52:[2,167],55:[2,167],70:[2,167],75:[2,167],83:[2,167],88:[2,167],90:[2,167],99:[2,167],101:[2,167],102:[2,167],103:[2,167],107:[2,167],115:[2,167],123:[2,167],125:[2,167],126:[2,167],129:[2,167],130:[2,167],131:[2,167],132:[2,167],133:[2,167],134:[2,167]},{5:286,25:[1,5]},{26:[2,170],118:[2,170],120:[2,170]},{5:287,25:[1,5],52:[1,288]},{25:[2,126],52:[2,126],100:85,101:[1,63],103:[1,64],106:86,107:[1,66],108:67,123:[1,84],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{1:[2,94],6:[2,94],25:[2,94],26:[2,94],47:[2,94],52:[2,94],55:[2,94],70:[2,94],75:[2,94],83:[2,94],88:[2,94],90:[2,94],99:[2,94],101:[2,94],102:[2,94],103:[2,94],107:[2,94],115:[2,94],123:[2,94],125:[2,94],126:[2,94],129:[2,94],130:[2,94],131:[2,94],132:[2,94],133:[2,94],134:[2,94]},{1:[2,97],5:289,6:[2,97],25:[1,5],26:[2,97],47:[2,97],52:[2,97],55:[2,97],70:[2,97],75:[2,97],83:[2,97],88:[2,97],90:[2,97],99:[2,97],100:85,101:[1,63],102:[2,97],103:[1,64],106:86,107:[1,66],108:67,115:[2,97],123:[2,97],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{99:[1,290]},{88:[1,291],100:85,101:[1,63],103:[1,64],106:86,107:[1,66],108:67,123:[1,84],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{1:[2,111],6:[2,111],25:[2,111],26:[2,111],38:[2,111],47:[2,111],52:[2,111],55:[2,111],64:[2,111],65:[2,111],66:[2,111],68:[2,111],70:[2,111],71:[2,111],75:[2,111],81:[2,111],82:[2,111],83:[2,111],88:[2,111],90:[2,111],99:[2,111],101:[2,111],102:[2,111],103:[2,111],107:[2,111],113:[2,111],114:[2,111],115:[2,111],123:[2,111],125:[2,111],126:[2,111],129:[2,111],130:[2,111],131:[2,111],132:[2,111],133:[2,111],134:[2,111]},{8:197,9:115,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:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,58:145,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],91:292,93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:197,9:115,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,144],27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,58:145,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],84:293,85:[1,56],86:[1,57],87:[1,55],91:143,93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{6:[2,120],25:[2,120],26:[2,120],52:[2,120],83:[2,120],88:[2,120]},{6:[1,260],25:[1,261],26:[1,294]},{1:[2,137],6:[2,137],25:[2,137],26:[2,137],47:[2,137],52:[2,137],55:[2,137],70:[2,137],75:[2,137],83:[2,137],88:[2,137],90:[2,137],99:[2,137],100:85,101:[1,63],102:[2,137],103:[1,64],106:86,107:[1,66],108:67,115:[2,137],123:[2,137],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{1:[2,139],6:[2,139],25:[2,139],26:[2,139],47:[2,139],52:[2,139],55:[2,139],70:[2,139],75:[2,139],83:[2,139],88:[2,139],90:[2,139],99:[2,139],100:85,101:[1,63],102:[2,139],103:[1,64],106:86,107:[1,66],108:67,115:[2,139],123:[2,139],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{113:[2,157],114:[2,157]},{8:295,9:115,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:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:296,9:115,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:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:297,9:115,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:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,85],6:[2,85],25:[2,85],26:[2,85],38:[2,85],47:[2,85],52:[2,85],55:[2,85],64:[2,85],65:[2,85],66:[2,85],68:[2,85],70:[2,85],71:[2,85],75:[2,85],81:[2,85],82:[2,85],83:[2,85],88:[2,85],90:[2,85],99:[2,85],101:[2,85],102:[2,85],103:[2,85],107:[2,85],113:[2,85],114:[2,85],115:[2,85],123:[2,85],125:[2,85],126:[2,85],129:[2,85],130:[2,85],131:[2,85],132:[2,85],133:[2,85],134:[2,85]},{11:165,27:166,28:[1,71],29:167,30:[1,69],31:[1,70],39:298,40:164,42:168,44:[1,46],86:[1,111]},{6:[2,86],11:165,25:[2,86],26:[2,86],27:166,28:[1,71],29:167,30:[1,69],31:[1,70],39:163,40:164,42:168,44:[1,46],52:[2,86],74:299,86:[1,111]},{6:[2,88],25:[2,88],26:[2,88],52:[2,88],75:[2,88]},{6:[2,38],25:[2,38],26:[2,38],52:[2,38],75:[2,38],100:85,101:[1,63],103:[1,64],106:86,107:[1,66],108:67,123:[1,84],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{8:300,9:115,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:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{70:[2,115],100:85,101:[1,63],103:[1,64],106:86,107:[1,66],108:67,123:[1,84],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{1:[2,36],6:[2,36],25:[2,36],26:[2,36],47:[2,36],52:[2,36],55:[2,36],70:[2,36],75:[2,36],83:[2,36],88:[2,36],90:[2,36],99:[2,36],101:[2,36],102:[2,36],103:[2,36],107:[2,36],115:[2,36],123:[2,36],125:[2,36],126:[2,36],129:[2,36],130:[2,36],131:[2,36],132:[2,36],133:[2,36],134:[2,36]},{1:[2,106],6:[2,106],25:[2,106],26:[2,106],47:[2,106],52:[2,106],55:[2,106],64:[2,106],65:[2,106],66:[2,106],68:[2,106],70:[2,106],71:[2,106],75:[2,106],81:[2,106],82:[2,106],83:[2,106],88:[2,106],90:[2,106],99:[2,106],101:[2,106],102:[2,106],103:[2,106],107:[2,106],115:[2,106],123:[2,106],125:[2,106],126:[2,106],129:[2,106],130:[2,106],131:[2,106],132:[2,106],133:[2,106],134:[2,106]},{1:[2,47],6:[2,47],25:[2,47],26:[2,47],47:[2,47],52:[2,47],55:[2,47],70:[2,47],75:[2,47],83:[2,47],88:[2,47],90:[2,47],99:[2,47],101:[2,47],102:[2,47],103:[2,47],107:[2,47],115:[2,47],123:[2,47],125:[2,47],126:[2,47],129:[2,47],130:[2,47],131:[2,47],132:[2,47],133:[2,47],134:[2,47]},{1:[2,195],6:[2,195],25:[2,195],26:[2,195],47:[2,195],52:[2,195],55:[2,195],70:[2,195],75:[2,195],83:[2,195],88:[2,195],90:[2,195],99:[2,195],101:[2,195],102:[2,195],103:[2,195],107:[2,195],115:[2,195],123:[2,195],125:[2,195],126:[2,195],129:[2,195],130:[2,195],131:[2,195],132:[2,195],133:[2,195],134:[2,195]},{1:[2,174],6:[2,174],25:[2,174],26:[2,174],47:[2,174],52:[2,174],55:[2,174],70:[2,174],75:[2,174],83:[2,174],88:[2,174],90:[2,174],99:[2,174],101:[2,174],102:[2,174],103:[2,174],107:[2,174],115:[2,174],118:[2,174],123:[2,174],125:[2,174],126:[2,174],129:[2,174],130:[2,174],131:[2,174],132:[2,174],133:[2,174],134:[2,174]},{1:[2,131],6:[2,131],25:[2,131],26:[2,131],47:[2,131],52:[2,131],55:[2,131],70:[2,131],75:[2,131],83:[2,131],88:[2,131],90:[2,131],99:[2,131],101:[2,131],102:[2,131],103:[2,131],107:[2,131],115:[2,131],123:[2,131],125:[2,131],126:[2,131],129:[2,131],130:[2,131],131:[2,131],132:[2,131],133:[2,131],134:[2,131]},{1:[2,132],6:[2,132],25:[2,132],26:[2,132],47:[2,132],52:[2,132],55:[2,132],70:[2,132],75:[2,132],83:[2,132],88:[2,132],90:[2,132],95:[2,132],99:[2,132],101:[2,132],102:[2,132],103:[2,132],107:[2,132],115:[2,132],123:[2,132],125:[2,132],126:[2,132],129:[2,132],130:[2,132],131:[2,132],132:[2,132],133:[2,132],134:[2,132]},{1:[2,165],6:[2,165],25:[2,165],26:[2,165],47:[2,165],52:[2,165],55:[2,165],70:[2,165],75:[2,165],83:[2,165],88:[2,165],90:[2,165],99:[2,165],101:[2,165],102:[2,165],103:[2,165],107:[2,165],115:[2,165],123:[2,165],125:[2,165],126:[2,165],129:[2,165],130:[2,165],131:[2,165],132:[2,165],133:[2,165],134:[2,165]},{5:301,25:[1,5]},{26:[1,302]},{6:[1,303],26:[2,171],118:[2,171],120:[2,171]},{8:304,9:115,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:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,98],6:[2,98],25:[2,98],26:[2,98],47:[2,98],52:[2,98],55:[2,98],70:[2,98],75:[2,98],83:[2,98],88:[2,98],90:[2,98],99:[2,98],101:[2,98],102:[2,98],103:[2,98],107:[2,98],115:[2,98],123:[2,98],125:[2,98],126:[2,98],129:[2,98],130:[2,98],131:[2,98],132:[2,98],133:[2,98],134:[2,98]},{1:[2,135],6:[2,135],25:[2,135],26:[2,135],47:[2,135],52:[2,135],55:[2,135],64:[2,135],65:[2,135],66:[2,135],68:[2,135],70:[2,135],71:[2,135],75:[2,135],81:[2,135],82:[2,135],83:[2,135],88:[2,135],90:[2,135],99:[2,135],101:[2,135],102:[2,135],103:[2,135],107:[2,135],115:[2,135],123:[2,135],125:[2,135],126:[2,135],129:[2,135],130:[2,135],131:[2,135],132:[2,135],133:[2,135],134:[2,135]},{1:[2,114],6:[2,114],25:[2,114],26:[2,114],47:[2,114],52:[2,114],55:[2,114],64:[2,114],65:[2,114],66:[2,114],68:[2,114],70:[2,114],71:[2,114],75:[2,114],81:[2,114],82:[2,114],83:[2,114],88:[2,114],90:[2,114],99:[2,114],101:[2,114],102:[2,114],103:[2,114],107:[2,114],115:[2,114],123:[2,114],125:[2,114],126:[2,114],129:[2,114],130:[2,114],131:[2,114],132:[2,114],133:[2,114],134:[2,114]},{6:[2,121],25:[2,121],26:[2,121],52:[2,121],83:[2,121],88:[2,121]},{6:[2,51],25:[2,51],26:[2,51],51:305,52:[1,222]},{6:[2,122],25:[2,122],26:[2,122],52:[2,122],83:[2,122],88:[2,122]},{1:[2,160],6:[2,160],25:[2,160],26:[2,160],47:[2,160],52:[2,160],55:[2,160],70:[2,160],75:[2,160],83:[2,160],88:[2,160],90:[2,160],99:[2,160],100:85,101:[2,160],102:[2,160],103:[2,160],106:86,107:[2,160],108:67,115:[1,306],123:[2,160],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{1:[2,162],6:[2,162],25:[2,162],26:[2,162],47:[2,162],52:[2,162],55:[2,162],70:[2,162],75:[2,162],83:[2,162],88:[2,162],90:[2,162],99:[2,162],100:85,101:[2,162],102:[1,307],103:[2,162],106:86,107:[2,162],108:67,115:[2,162],123:[2,162],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{1:[2,161],6:[2,161],25:[2,161],26:[2,161],47:[2,161],52:[2,161],55:[2,161],70:[2,161],75:[2,161],83:[2,161],88:[2,161],90:[2,161],99:[2,161],100:85,101:[2,161],102:[2,161],103:[2,161],106:86,107:[2,161],108:67,115:[2,161],123:[2,161],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{6:[2,89],25:[2,89],26:[2,89],52:[2,89],75:[2,89]},{6:[2,51],25:[2,51],26:[2,51],51:308,52:[1,232]},{26:[1,309],100:85,101:[1,63],103:[1,64],106:86,107:[1,66],108:67,123:[1,84],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{26:[1,310]},{1:[2,168],6:[2,168],25:[2,168],26:[2,168],47:[2,168],52:[2,168],55:[2,168],70:[2,168],75:[2,168],83:[2,168],88:[2,168],90:[2,168],99:[2,168],101:[2,168],102:[2,168],103:[2,168],107:[2,168],115:[2,168],123:[2,168],125:[2,168],126:[2,168],129:[2,168],130:[2,168],131:[2,168],132:[2,168],133:[2,168],134:[2,168]},{26:[2,172],118:[2,172],120:[2,172]},{25:[2,127],52:[2,127],100:85,101:[1,63],103:[1,64],106:86,107:[1,66],108:67,123:[1,84],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{6:[1,260],25:[1,261],26:[1,311]},{8:312,9:115,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:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:313,9:115,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:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{6:[1,271],25:[1,272],26:[1,314]},{6:[2,39],25:[2,39],26:[2,39],52:[2,39],75:[2,39]},{1:[2,166],6:[2,166],25:[2,166],26:[2,166],47:[2,166],52:[2,166],55:[2,166],70:[2,166],75:[2,166],83:[2,166],88:[2,166],90:[2,166],99:[2,166],101:[2,166],102:[2,166],103:[2,166],107:[2,166],115:[2,166],123:[2,166],125:[2,166],126:[2,166],129:[2,166],130:[2,166],131:[2,166],132:[2,166],133:[2,166],134:[2,166]},{6:[2,123],25:[2,123],26:[2,123],52:[2,123],83:[2,123],88:[2,123]},{1:[2,163],6:[2,163],25:[2,163],26:[2,163],47:[2,163],52:[2,163],55:[2,163],70:[2,163],75:[2,163],83:[2,163],88:[2,163],90:[2,163],99:[2,163],100:85,101:[2,163],102:[2,163],103:[2,163],106:86,107:[2,163],108:67,115:[2,163],123:[2,163],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{1:[2,164],6:[2,164],25:[2,164],26:[2,164],47:[2,164],52:[2,164],55:[2,164],70:[2,164],75:[2,164],83:[2,164],88:[2,164],90:[2,164],99:[2,164],100:85,101:[2,164],102:[2,164],103:[2,164],106:86,107:[2,164],108:67,115:[2,164],123:[2,164],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{6:[2,90],25:[2,90],26:[2,90],52:[2,90],75:[2,90]}],
+defaultActions: {58:[2,49],59:[2,50],73:[2,3],92:[2,104],186:[2,84]},
+parseError: function parseError(str, hash) {
+ throw new Error(str);
+},
+parse: function parse(input) {
+ var self = this, stack = [0], vstack = [null], lstack = [], 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;
+ 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];
+ }
+ 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?"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 (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:
+ stack.push(symbol);
+ vstack.push(this.lexer.yytext);
+ lstack.push(this.lexer.yylloc);
+ stack.push(action[1]);
+ symbol = null;
+ if (!preErrorSymbol) {
+ yyleng = this.lexer.yyleng;
+ yytext = this.lexer.yytext;
+ yylineno = this.lexer.yylineno;
+ yyloc = this.lexer.yylloc;
+ if (recovering > 0)
+ recovering--;
+ } else {
+ symbol = preErrorSymbol;
+ preErrorSymbol = null;
+ }
+ break;
+ case 2:
+ len = this.productions_[action[1]][1];
+ yyval.$ = vstack[vstack.length - len];
+ 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]);
+ vstack.push(yyval.$);
+ lstack.push(yyval._$);
+ newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
+ stack.push(newState);
+ break;
+ case 3:
+ return true;
+ }
+ }
+ return true;
+}
+};
+
+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) {
+// Generated by CoffeeScript 1.2.1-pre
+
+ 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, 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;
+
+ 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() {
+
+ Base.name = 'Base';
+
+ 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);
+
+ Block.name = 'Block';
+
+ 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);
+
+ Literal.name = 'Literal';
+
+ 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.isUndefined ? o.level >= LEVEL_ACCESS ? '(void 0)' : 'void 0' : 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.Return = Return = (function(_super) {
+
+ __extends(Return, _super);
+
+ Return.name = 'Return';
+
+ 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);
+
+ Value.name = 'Value';
+
+ 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);
+
+ Comment.name = 'Comment';
+
+ 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);
+
+ Call.name = 'Call';
+
+ 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.method;
+ 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.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" + (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" + (args.length ? ', ' : '') + args + ")";
+ };
+
+ Call.prototype.compileSplat = function(o, splatArgs) {
+ var base, fun, idt, name, ref;
+ if (this.isSuper) {
+ return "" + (this.superReference(o)) + ".apply(this, " + 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);
+
+ Extends.name = 'Extends';
+
+ 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);
+
+ Access.name = 'Access';
+
+ 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);
+
+ Index.name = 'Index';
+
+ 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.name = 'Range';
+
+ 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.name = 'Slice';
+
+ 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);
+
+ Obj.name = 'Obj';
+
+ 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, propName, propNames, props, _i, _j, _len, _len1, _ref2;
+ props = this.properties;
+ propNames = [];
+ _ref2 = this.properties;
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
+ prop = _ref2[_i];
+ if (prop.isComplex()) prop = prop.variable;
+ if (prop != null) {
+ propName = prop.unwrapAll().value.toString();
+ if (__indexOf.call(propNames, propName) >= 0) {
+ throw SyntaxError("multiple object literal properties named \"" + propName + "\"");
+ }
+ propNames.push(propName);
+ }
+ }
+ if (!props.length) return (this.front ? '({})' : '{}');
+ if (this.generated) {
+ for (_j = 0, _len1 = props.length; _j < _len1; _j++) {
+ node = props[_j];
+ 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 _k, _len2, _results;
+ _results = [];
+ for (i = _k = 0, _len2 = props.length; _k < _len2; i = ++_k) {
+ 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);
+
+ Arr.name = 'Arr';
+
+ 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);
+
+ Class.name = 'Class';
+
+ 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);
+ if (decl) {
+ this.body.expressions.unshift(new Assign(new Value(new Literal(name), [new Access(new Literal('name'))]), new Literal("'" + name + "'")));
+ }
+ 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);
+
+ Assign.name = 'Assign';
+
+ 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.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);
+
+ Code.name = 'Code';
+
+ 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];
+ if (p.name.value) o.scope.add(p.name.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);
+
+ Param.name = 'Param';
+
+ 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.variable.base.value);
+ } else 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);
+ }
+ }
+ return names;
+ };
+
+ return Param;
+
+ })(Base);
+
+ exports.Splat = Splat = (function(_super) {
+
+ __extends(Splat, _super);
+
+ Splat.name = 'Splat';
+
+ 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);
+
+ While.name = 'While';
+
+ 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);
+
+ Op.name = 'Op';
+
+ 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() && o.level > LEVEL_TOP) {
+ 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);
+
+ In.name = 'In';
+
+ 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);
+
+ Try.name = 'Try';
+
+ 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);
+
+ Throw.name = 'Throw';
+
+ 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);
+
+ Existence.name = 'Existence';
+
+ 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);
+
+ Parens.name = 'Parens';
+
+ 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);
+
+ For.name = 'For';
+
+ 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, {
+ immediate: true
+ });
+ }
+ if (index) {
+ scope.find(index, {
+ immediate: true
+ });
+ }
+ 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);
+
+ Switch.name = 'Switch';
+
+ 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);
+
+ If.name = 'If';
+
+ 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, bodyc, child, cond, exeq, ifPart, _ref2;
+ 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);
+ bodyc = body.compile(o);
+ if (1 === ((_ref2 = body.expressions) != null ? _ref2.length : void 0) && !this.elseBody && !child && bodyc && cond && -1 === (bodyc.indexOf('\n')) && 80 > cond.length + bodyc.length) {
+ return "" + this.tab + "if (" + cond + ") " + (bodyc.replace(/^\s+/, ''));
+ }
+ if (bodyc) bodyc = "\n" + bodyc + "\n" + this.tab;
+ ifPart = "if (" + cond + ") {" + bodyc + "}";
+ 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);
+ }
+ };
+
+ 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) {
+// Generated by CoffeeScript 1.2.1-pre
+
+ var Scope, extend, last, _ref;
+
+ _ref = require('./helpers'), extend = _ref.extend, last = _ref.last;
+
+ exports.Scope = Scope = (function() {
+
+ Scope.name = 'Scope';
+
+ 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.find = function(name, options) {
+ if (this.check(name, options)) 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, immediate) {
+ var found, _ref1;
+ found = !!this.type(name);
+ if (found || immediate) return found;
+ return !!((_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;
+
+ })();
+
+
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/worker-css.js b/vendor/assets/javascripts/ace-src-noconflict/worker-css.js
new file mode 100644
index 00000000000..19513c7ba99
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/worker-css.js
@@ -0,0 +1,10940 @@
+"no use strict";
+
+var console = {
+ log: function(msgs) {
+ postMessage({type: "log", data: arguments.join(" ")});
+ }
+};
+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("/");
+ var moduleName = base + "/" + moduleName;
+
+ while(moduleName.indexOf(".") !== -1 && previous != moduleName) {
+ var previous = moduleName;
+ var 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");
+
+ var 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) {
+ main[msg.command].apply(main, msg.args);
+ }
+ 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:
+// -- kriskowal Kris Kowal Copyright (C) 2009-2010 MIT License
+// -- tlrobinson Tom Robinson Copyright (C) 2009-2010 MIT License (Narwhal Project)
+// -- dantman Daniel Friesen Copyright(C) 2010 XXX No License Specified
+// -- fschaefer Florian Schäfer Copyright (C) 2010 MIT License
+// -- Irakli Gozalishvili Copyright (C) 2010 MIT License
+
+/*!
+ Copyright (c) 2009, 280 North Inc. http://280north.com/
+ MIT License. http://github.com/280north/narwhal/blob/master/README.md
+*/
+
+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) {
+
+
+ //---------------------------------
+ // Private variables
+ //---------------------------------
+
+ 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;
+
+ //---------------------------------
+ // Overriden native methods
+ //---------------------------------
+
+ // Adds named capture support (with backreferences returned as `result.name`), and fixes two
+ // cross-browser issues per ES3:
+ // - Captured values for nonparticipating capturing groups should be returned as `undefined`,
+ // rather than the empty string.
+ // - `lastIndex` should not be incremented after zero-length matches.
+ RegExp.prototype.exec = function (str) {
+ var match = real.exec.apply(this, arguments),
+ name, r2;
+ if ( typeof(str) == 'string' && match) {
+ // Fix browsers whose `exec` methods don't consistently return `undefined` for
+ // nonparticipating capturing groups
+ if (!compliantExecNpcg && match.length > 1 && indexOf(match, "") > -1) {
+ r2 = RegExp(this.source, real.replace.call(getNativeFlags(this), "g", ""));
+ // Using `str.slice(match.index)` rather than `match[0]` in case lookahead allowed
+ // matching due to characters outside the match
+ 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;
+ }
+ });
+ }
+ // Attach named capture properties
+ 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];
+ }
+ }
+ // Fix browsers that increment `lastIndex` after zero-length matches
+ if (!compliantLastIndexIncrement && this.global && !match[0].length && (this.lastIndex > match.index))
+ this.lastIndex--;
+ }
+ return match;
+ };
+
+ // Don't override `test` if it won't change anything
+ if (!compliantLastIndexIncrement) {
+ // Fix browser bug in native method
+ RegExp.prototype.test = function (str) {
+ // Use the native `exec` to skip some processing overhead, even though the overriden
+ // `exec` would take care of the `lastIndex` fix
+ var match = real.exec.call(this, str);
+ // Fix browsers that increment `lastIndex` after zero-length matches
+ if (match && this.global && !match[0].length && (this.lastIndex > match.index))
+ this.lastIndex--;
+ return !!match;
+ };
+ }
+
+ //---------------------------------
+ // Private helper functions
+ //---------------------------------
+
+ 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;
+ }
+
+});
+// vim: ts=4 sts=4 sw=4 expandtab
+// -- kriskowal Kris Kowal Copyright (C) 2009-2011 MIT License
+// -- tlrobinson Tom Robinson Copyright (C) 2009-2010 MIT License (Narwhal Project)
+// -- dantman Daniel Friesen Copyright (C) 2010 XXX TODO License or CLA
+// -- fschaefer Florian Schäfer Copyright (C) 2010 MIT License
+// -- Gozala Irakli Gozalishvili Copyright (C) 2010 MIT License
+// -- kitcambridge Kit Cambridge Copyright (C) 2011 MIT License
+// -- kossnocorp Sasha Koss XXX TODO License or CLA
+// -- bryanforbes Bryan Forbes XXX TODO License or CLA
+// -- killdream Quildreen Motta Copyright (C) 2011 MIT Licence
+// -- michaelficarra Michael Ficarra Copyright (C) 2011 3-clause BSD License
+// -- sharkbrainguy Gerard Paapu Copyright (C) 2011 MIT License
+// -- bbqsrc Brendan Molloy (C) 2011 Creative Commons Zero (public domain)
+// -- iwyg XXX TODO License or CLA
+// -- DomenicDenicola Domenic Denicola Copyright (C) 2011 MIT License
+// -- xavierm02 Montillet Xavier XXX TODO License or CLA
+// -- Raynos Raynos XXX TODO License or CLA
+// -- samsonjs Sami Samhuri Copyright (C) 2010 MIT License
+// -- rwldrn Rick Waldron Copyright (C) 2011 MIT License
+// -- lexer Alexey Zakharov XXX TODO License or CLA
+
+/*!
+ Copyright (c) 2009, 280 North Inc. http://280north.com/
+ MIT License. http://github.com/280north/narwhal/blob/master/README.md
+*/
+
+define('ace/lib/es5-shim', ['require', 'exports', 'module' ], function(require, exports, module) {
+
+/*
+ * Brings an environment as close to ECMAScript 5 compliance
+ * as is possible with the facilities of erstwhile engines.
+ *
+ * Annotated ES5: http://es5.github.com/ (specific links below)
+ * ES5 Spec: http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf
+ *
+ * @module
+ */
+
+/*whatsupdoc*/
+
+//
+// Function
+// ========
+//
+
+// ES-5 15.3.4.5
+// http://es5.github.com/#x15.3.4.5
+
+if (!Function.prototype.bind) {
+ Function.prototype.bind = function bind(that) { // .length is 1
+ // 1. Let Target be the this value.
+ var target = this;
+ // 2. If IsCallable(Target) is false, throw a TypeError exception.
+ if (typeof target != "function")
+ throw new TypeError(); // TODO message
+ // 3. Let A be a new (possibly empty) internal list of all of the
+ // argument values provided after thisArg (arg1, arg2 etc), in order.
+ // XXX slicedArgs will stand in for "A" if used
+ var args = slice.call(arguments, 1); // for normal call
+ // 4. Let F be a new native ECMAScript object.
+ // 11. Set the [[Prototype]] internal property of F to the standard
+ // built-in Function prototype object as specified in 15.3.3.1.
+ // 12. Set the [[Call]] internal property of F as described in
+ // 15.3.4.5.1.
+ // 13. Set the [[Construct]] internal property of F as described in
+ // 15.3.4.5.2.
+ // 14. Set the [[HasInstance]] internal property of F as described in
+ // 15.3.4.5.3.
+ var bound = function () {
+
+ if (this instanceof bound) {
+ // 15.3.4.5.2 [[Construct]]
+ // When the [[Construct]] internal method of a function object,
+ // F that was created using the bind function is called with a
+ // list of arguments ExtraArgs, the following steps are taken:
+ // 1. Let target be the value of F's [[TargetFunction]]
+ // internal property.
+ // 2. If target has no [[Construct]] internal method, a
+ // TypeError exception is thrown.
+ // 3. Let boundArgs be the value of F's [[BoundArgs]] internal
+ // property.
+ // 4. Let args be a new list containing the same values as the
+ // list boundArgs in the same order followed by the same
+ // values as the list ExtraArgs in the same order.
+ // 5. Return the result of calling the [[Construct]] internal
+ // method of target providing args as the arguments.
+
+ var F = function(){};
+ F.prototype = target.prototype;
+ var self = new F;
+
+ var result = target.apply(
+ self,
+ args.concat(slice.call(arguments))
+ );
+ if (result !== null && Object(result) === result)
+ return result;
+ return self;
+
+ } else {
+ // 15.3.4.5.1 [[Call]]
+ // When the [[Call]] internal method of a function object, F,
+ // which was created using the bind function is called with a
+ // this value and a list of arguments ExtraArgs, the following
+ // steps are taken:
+ // 1. Let boundArgs be the value of F's [[BoundArgs]] internal
+ // property.
+ // 2. Let boundThis be the value of F's [[BoundThis]] internal
+ // property.
+ // 3. Let target be the value of F's [[TargetFunction]] internal
+ // property.
+ // 4. Let args be a new list containing the same values as the
+ // list boundArgs in the same order followed by the same
+ // values as the list ExtraArgs in the same order.
+ // 5. Return the result of calling the [[Call]] internal method
+ // of target providing boundThis as the this value and
+ // providing args as the arguments.
+
+ // equiv: target.call(this, ...boundArgs, ...args)
+ return target.apply(
+ that,
+ args.concat(slice.call(arguments))
+ );
+
+ }
+
+ };
+ // XXX bound.length is never writable, so don't even try
+ //
+ // 15. If the [[Class]] internal property of Target is "Function", then
+ // a. Let L be the length property of Target minus the length of A.
+ // b. Set the length own property of F to either 0 or L, whichever is
+ // larger.
+ // 16. Else set the length own property of F to 0.
+ // 17. Set the attributes of the length own property of F to the values
+ // specified in 15.3.5.1.
+
+ // TODO
+ // 18. Set the [[Extensible]] internal property of F to true.
+
+ // TODO
+ // 19. Let thrower be the [[ThrowTypeError]] function Object (13.2.3).
+ // 20. Call the [[DefineOwnProperty]] internal method of F with
+ // arguments "caller", PropertyDescriptor {[[Get]]: thrower, [[Set]]:
+ // thrower, [[Enumerable]]: false, [[Configurable]]: false}, and
+ // false.
+ // 21. Call the [[DefineOwnProperty]] internal method of F with
+ // arguments "arguments", PropertyDescriptor {[[Get]]: thrower,
+ // [[Set]]: thrower, [[Enumerable]]: false, [[Configurable]]: false},
+ // and false.
+
+ // TODO
+ // NOTE Function objects created using Function.prototype.bind do not
+ // have a prototype property or the [[Code]], [[FormalParameters]], and
+ // [[Scope]] internal properties.
+ // XXX can't delete prototype in pure-js.
+
+ // 22. Return F.
+ return bound;
+ };
+}
+
+// Shortcut to an often accessed properties, in order to avoid multiple
+// dereference that costs universally.
+// _Please note: Shortcuts are defined after `Function.prototype.bind` as we
+// us it in defining shortcuts.
+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);
+
+// If JS engine supports accessors creating shortcuts.
+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__);
+}
+
+//
+// Array
+// =====
+//
+
+// ES5 15.4.3.2
+// http://es5.github.com/#x15.4.3.2
+// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/isArray
+if (!Array.isArray) {
+ Array.isArray = function isArray(obj) {
+ return toString(obj) == "[object Array]";
+ };
+}
+
+// The IsCallable() check in the Array functions
+// has been replaced with a strict check on the
+// internal class of the object to trap cases where
+// the provided function was actually a regular
+// expression literal, which in V8 and
+// JavaScriptCore is a typeof "function". Only in
+// V8 are regular expression literals permitted as
+// reduce parameters, so it is desirable in the
+// general case for the shim to match the more
+// strict and common behavior of rejecting regular
+// expressions.
+
+// ES5 15.4.4.18
+// http://es5.github.com/#x15.4.4.18
+// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/array/forEach
+if (!Array.prototype.forEach) {
+ Array.prototype.forEach = function forEach(fun /*, thisp*/) {
+ var self = toObject(this),
+ thisp = arguments[1],
+ i = 0,
+ length = self.length >>> 0;
+
+ // If no callback function or if callback is not a callable function
+ if (toString(fun) != "[object Function]") {
+ throw new TypeError(); // TODO message
+ }
+
+ while (i < length) {
+ if (i in self) {
+ // Invoke the callback function with call, passing arguments:
+ // context, property value, property key, thisArg object context
+ fun.call(thisp, self[i], i, self);
+ }
+ i++;
+ }
+ };
+}
+
+// ES5 15.4.4.19
+// http://es5.github.com/#x15.4.4.19
+// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/map
+if (!Array.prototype.map) {
+ Array.prototype.map = function map(fun /*, thisp*/) {
+ var self = toObject(this),
+ length = self.length >>> 0,
+ result = Array(length),
+ thisp = arguments[1];
+
+ // If no callback function or if callback is not a callable function
+ if (toString(fun) != "[object Function]") {
+ throw new TypeError(); // TODO message
+ }
+
+ for (var i = 0; i < length; i++) {
+ if (i in self)
+ result[i] = fun.call(thisp, self[i], i, self);
+ }
+ return result;
+ };
+}
+
+// ES5 15.4.4.20
+// http://es5.github.com/#x15.4.4.20
+// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/filter
+if (!Array.prototype.filter) {
+ Array.prototype.filter = function filter(fun /*, thisp */) {
+ var self = toObject(this),
+ length = self.length >>> 0,
+ result = [],
+ thisp = arguments[1];
+
+ // If no callback function or if callback is not a callable function
+ if (toString(fun) != "[object Function]") {
+ throw new TypeError(); // TODO message
+ }
+
+ for (var i = 0; i < length; i++) {
+ if (i in self && fun.call(thisp, self[i], i, self))
+ result.push(self[i]);
+ }
+ return result;
+ };
+}
+
+// ES5 15.4.4.16
+// http://es5.github.com/#x15.4.4.16
+// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/every
+if (!Array.prototype.every) {
+ Array.prototype.every = function every(fun /*, thisp */) {
+ var self = toObject(this),
+ length = self.length >>> 0,
+ thisp = arguments[1];
+
+ // If no callback function or if callback is not a callable function
+ if (toString(fun) != "[object Function]") {
+ throw new TypeError(); // TODO message
+ }
+
+ for (var i = 0; i < length; i++) {
+ if (i in self && !fun.call(thisp, self[i], i, self))
+ return false;
+ }
+ return true;
+ };
+}
+
+// ES5 15.4.4.17
+// http://es5.github.com/#x15.4.4.17
+// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/some
+if (!Array.prototype.some) {
+ Array.prototype.some = function some(fun /*, thisp */) {
+ var self = toObject(this),
+ length = self.length >>> 0,
+ thisp = arguments[1];
+
+ // If no callback function or if callback is not a callable function
+ if (toString(fun) != "[object Function]") {
+ throw new TypeError(); // TODO message
+ }
+
+ for (var i = 0; i < length; i++) {
+ if (i in self && fun.call(thisp, self[i], i, self))
+ return true;
+ }
+ return false;
+ };
+}
+
+// ES5 15.4.4.21
+// http://es5.github.com/#x15.4.4.21
+// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/reduce
+if (!Array.prototype.reduce) {
+ Array.prototype.reduce = function reduce(fun /*, initial*/) {
+ var self = toObject(this),
+ length = self.length >>> 0;
+
+ // If no callback function or if callback is not a callable function
+ if (toString(fun) != "[object Function]") {
+ throw new TypeError(); // TODO message
+ }
+
+ // no value to return if no initial value and an empty array
+ if (!length && arguments.length == 1)
+ throw new TypeError(); // TODO message
+
+ var i = 0;
+ var result;
+ if (arguments.length >= 2) {
+ result = arguments[1];
+ } else {
+ do {
+ if (i in self) {
+ result = self[i++];
+ break;
+ }
+
+ // if array contains no values, no initial value to return
+ if (++i >= length)
+ throw new TypeError(); // TODO message
+ } while (true);
+ }
+
+ for (; i < length; i++) {
+ if (i in self)
+ result = fun.call(void 0, result, self[i], i, self);
+ }
+
+ return result;
+ };
+}
+
+// ES5 15.4.4.22
+// http://es5.github.com/#x15.4.4.22
+// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/reduceRight
+if (!Array.prototype.reduceRight) {
+ Array.prototype.reduceRight = function reduceRight(fun /*, initial*/) {
+ var self = toObject(this),
+ length = self.length >>> 0;
+
+ // If no callback function or if callback is not a callable function
+ if (toString(fun) != "[object Function]") {
+ throw new TypeError(); // TODO message
+ }
+
+ // no value to return if no initial value, empty array
+ if (!length && arguments.length == 1)
+ throw new TypeError(); // TODO message
+
+ var result, i = length - 1;
+ if (arguments.length >= 2) {
+ result = arguments[1];
+ } else {
+ do {
+ if (i in self) {
+ result = self[i--];
+ break;
+ }
+
+ // if array contains no values, no initial value to return
+ if (--i < 0)
+ throw new TypeError(); // TODO message
+ } while (true);
+ }
+
+ do {
+ if (i in this)
+ result = fun.call(void 0, result, self[i], i, self);
+ } while (i--);
+
+ return result;
+ };
+}
+
+// ES5 15.4.4.14
+// http://es5.github.com/#x15.4.4.14
+// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/indexOf
+if (!Array.prototype.indexOf) {
+ Array.prototype.indexOf = function indexOf(sought /*, fromIndex */ ) {
+ var self = toObject(this),
+ length = self.length >>> 0;
+
+ if (!length)
+ return -1;
+
+ var i = 0;
+ if (arguments.length > 1)
+ i = toInteger(arguments[1]);
+
+ // handle negative indices
+ i = i >= 0 ? i : Math.max(0, length + i);
+ for (; i < length; i++) {
+ if (i in self && self[i] === sought) {
+ return i;
+ }
+ }
+ return -1;
+ };
+}
+
+// ES5 15.4.4.15
+// http://es5.github.com/#x15.4.4.15
+// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/lastIndexOf
+if (!Array.prototype.lastIndexOf) {
+ Array.prototype.lastIndexOf = function lastIndexOf(sought /*, fromIndex */) {
+ var self = 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]));
+ // handle negative indices
+ i = i >= 0 ? i : length - Math.abs(i);
+ for (; i >= 0; i--) {
+ if (i in self && sought === self[i])
+ return i;
+ }
+ return -1;
+ };
+}
+
+//
+// Object
+// ======
+//
+
+// ES5 15.2.3.2
+// http://es5.github.com/#x15.2.3.2
+if (!Object.getPrototypeOf) {
+ // https://github.com/kriskowal/es5-shim/issues#issue/2
+ // http://ejohn.org/blog/objectgetprototypeof/
+ // recommended by fschaefer on github
+ Object.getPrototypeOf = function getPrototypeOf(object) {
+ return object.__proto__ || (
+ object.constructor ?
+ object.constructor.prototype :
+ prototypeOfObject
+ );
+ };
+}
+
+// ES5 15.2.3.3
+// http://es5.github.com/#x15.2.3.3
+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 object does not owns property return undefined immediately.
+ if (!owns(object, property))
+ return;
+
+ var descriptor, getter, setter;
+
+ // If object has a property then it's for sure both `enumerable` and
+ // `configurable`.
+ descriptor = { enumerable: true, configurable: true };
+
+ // If JS engine supports accessor properties then property may be a
+ // getter or setter.
+ if (supportsAccessors) {
+ // Unfortunately `__lookupGetter__` will return a getter even
+ // if object has own non getter property along with a same named
+ // inherited getter. To avoid misbehavior we temporary remove
+ // `__proto__` so that `__lookupGetter__` will return getter only
+ // if it's owned by an object.
+ var prototype = object.__proto__;
+ object.__proto__ = prototypeOfObject;
+
+ var getter = lookupGetter(object, property);
+ var setter = lookupSetter(object, property);
+
+ // Once we have getter and setter we can put values back.
+ object.__proto__ = prototype;
+
+ if (getter || setter) {
+ if (getter) descriptor.get = getter;
+ if (setter) descriptor.set = setter;
+
+ // If it was accessor property we're done and return here
+ // in order to avoid adding `value` to the descriptor.
+ return descriptor;
+ }
+ }
+
+ // If we got this far we know that object has an own property that is
+ // not an accessor so we set it as a value and return descriptor.
+ descriptor.value = object[property];
+ return descriptor;
+ };
+}
+
+// ES5 15.2.3.4
+// http://es5.github.com/#x15.2.3.4
+if (!Object.getOwnPropertyNames) {
+ Object.getOwnPropertyNames = function getOwnPropertyNames(object) {
+ return Object.keys(object);
+ };
+}
+
+// ES5 15.2.3.5
+// http://es5.github.com/#x15.2.3.5
+if (!Object.create) {
+ Object.create = function create(prototype, properties) {
+ var object;
+ if (prototype === null) {
+ object = { "__proto__": null };
+ } else {
+ if (typeof prototype != "object")
+ throw new TypeError("typeof prototype["+(typeof prototype)+"] != 'object'");
+ var Type = function () {};
+ Type.prototype = prototype;
+ object = new Type();
+ // IE has no built-in implementation of `Object.getPrototypeOf`
+ // neither `__proto__`, but this manually setting `__proto__` will
+ // guarantee that `Object.getPrototypeOf` will work as expected with
+ // objects created using `Object.create`
+ object.__proto__ = prototype;
+ }
+ if (properties !== void 0)
+ Object.defineProperties(object, properties);
+ return object;
+ };
+}
+
+// ES5 15.2.3.6
+// http://es5.github.com/#x15.2.3.6
+
+// Patch for WebKit and IE8 standard mode
+// Designed by hax <hax.github.com>
+// related issue: https://github.com/kriskowal/es5-shim/issues#issue/5
+// IE8 Reference:
+// http://msdn.microsoft.com/en-us/library/dd282900.aspx
+// http://msdn.microsoft.com/en-us/library/dd229916.aspx
+// WebKit Bugs:
+// https://bugs.webkit.org/show_bug.cgi?id=36423
+
+function doesDefinePropertyWork(object) {
+ try {
+ Object.defineProperty(object, "sentinel", {});
+ return "sentinel" in object;
+ } catch (exception) {
+ // returns falsy
+ }
+}
+
+// check whether defineProperty works if it's given. Otherwise,
+// shim partially.
+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);
+
+ // make a valiant attempt to use the real defineProperty
+ // for I8's DOM elements.
+ if (definePropertyFallback) {
+ try {
+ return definePropertyFallback.call(Object, object, property, descriptor);
+ } catch (exception) {
+ // try the shim if the real one doesn't work
+ }
+ }
+
+ // If it's a data property.
+ if (owns(descriptor, "value")) {
+ // fail silently if "writable", "enumerable", or "configurable"
+ // are requested but not supported
+ /*
+ // alternate approach:
+ if ( // can't implement these features; allow false but not true
+ !(owns(descriptor, "writable") ? descriptor.writable : true) ||
+ !(owns(descriptor, "enumerable") ? descriptor.enumerable : true) ||
+ !(owns(descriptor, "configurable") ? descriptor.configurable : true)
+ )
+ throw new RangeError(
+ "This implementation of Object.defineProperty does not " +
+ "support configurable, enumerable, or writable."
+ );
+ */
+
+ if (supportsAccessors && (lookupGetter(object, property) ||
+ lookupSetter(object, property)))
+ {
+ // As accessors are supported only on engines implementing
+ // `__proto__` we can safely override `__proto__` while defining
+ // a property to make sure that we don't hit an inherited
+ // accessor.
+ var prototype = object.__proto__;
+ object.__proto__ = prototypeOfObject;
+ // Deleting a property anyway since getter / setter may be
+ // defined on object itself.
+ delete object[property];
+ object[property] = descriptor.value;
+ // Setting original `__proto__` back now.
+ object.__proto__ = prototype;
+ } else {
+ object[property] = descriptor.value;
+ }
+ } else {
+ if (!supportsAccessors)
+ throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED);
+ // If we got that far then getters and setters can be defined !!
+ if (owns(descriptor, "get"))
+ defineGetter(object, property, descriptor.get);
+ if (owns(descriptor, "set"))
+ defineSetter(object, property, descriptor.set);
+ }
+
+ return object;
+ };
+}
+
+// ES5 15.2.3.7
+// http://es5.github.com/#x15.2.3.7
+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;
+ };
+}
+
+// ES5 15.2.3.8
+// http://es5.github.com/#x15.2.3.8
+if (!Object.seal) {
+ Object.seal = function seal(object) {
+ // this is misleading and breaks feature-detection, but
+ // allows "securable" code to "gracefully" degrade to working
+ // but insecure code.
+ return object;
+ };
+}
+
+// ES5 15.2.3.9
+// http://es5.github.com/#x15.2.3.9
+if (!Object.freeze) {
+ Object.freeze = function freeze(object) {
+ // this is misleading and breaks feature-detection, but
+ // allows "securable" code to "gracefully" degrade to working
+ // but insecure code.
+ return object;
+ };
+}
+
+// detect a Rhino bug and patch it
+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);
+}
+
+// ES5 15.2.3.10
+// http://es5.github.com/#x15.2.3.10
+if (!Object.preventExtensions) {
+ Object.preventExtensions = function preventExtensions(object) {
+ // this is misleading and breaks feature-detection, but
+ // allows "securable" code to "gracefully" degrade to working
+ // but insecure code.
+ return object;
+ };
+}
+
+// ES5 15.2.3.11
+// http://es5.github.com/#x15.2.3.11
+if (!Object.isSealed) {
+ Object.isSealed = function isSealed(object) {
+ return false;
+ };
+}
+
+// ES5 15.2.3.12
+// http://es5.github.com/#x15.2.3.12
+if (!Object.isFrozen) {
+ Object.isFrozen = function isFrozen(object) {
+ return false;
+ };
+}
+
+// ES5 15.2.3.13
+// http://es5.github.com/#x15.2.3.13
+if (!Object.isExtensible) {
+ Object.isExtensible = function isExtensible(object) {
+ // 1. If Type(O) is not Object throw a TypeError exception.
+ if (Object(object) === object) {
+ throw new TypeError(); // TODO message
+ }
+ // 2. Return the Boolean value of the [[Extensible]] internal property of O.
+ var name = '';
+ while (owns(object, name)) {
+ name += '?';
+ }
+ object[name] = true;
+ var returnValue = owns(object, name);
+ delete object[name];
+ return returnValue;
+ };
+}
+
+// ES5 15.2.3.14
+// http://es5.github.com/#x15.2.3.14
+if (!Object.keys) {
+ // http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation
+ 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;
+ };
+
+}
+
+//
+// Date
+// ====
+//
+
+// ES5 15.9.5.43
+// http://es5.github.com/#x15.9.5.43
+// This function returns a String value represent the instance in time
+// represented by this Date object. The format of the String is the Date Time
+// string format defined in 15.9.1.15. All fields are present in the String.
+// The time zone is always UTC, denoted by the suffix Z. If the time value of
+// this object is not a finite Number a RangeError exception is thrown.
+if (!Date.prototype.toISOString || (new Date(-62198755200000).toISOString().indexOf('-000001') === -1)) {
+ Date.prototype.toISOString = function toISOString() {
+ var result, length, value, year;
+ if (!isFinite(this))
+ throw new RangeError;
+
+ // the date time string format is specified in 15.9.1.15.
+ result = [this.getUTCMonth() + 1, this.getUTCDate(),
+ this.getUTCHours(), this.getUTCMinutes(), this.getUTCSeconds()];
+ year = this.getUTCFullYear();
+ year = (year < 0 ? '-' : (year > 9999 ? '+' : '')) + ('00000' + Math.abs(year)).slice(0 <= year && year <= 9999 ? -4 : -6);
+
+ length = result.length;
+ while (length--) {
+ value = result[length];
+ // pad months, days, hours, minutes, and seconds to have two digits.
+ if (value < 10)
+ result[length] = "0" + value;
+ }
+ // pad milliseconds to have three digits.
+ return year + "-" + result.slice(0, 2).join("-") + "T" + result.slice(2).join(":") + "." +
+ ("000" + this.getUTCMilliseconds()).slice(-3) + "Z";
+ }
+}
+
+// ES5 15.9.4.4
+// http://es5.github.com/#x15.9.4.4
+if (!Date.now) {
+ Date.now = function now() {
+ return new Date().getTime();
+ };
+}
+
+// ES5 15.9.5.44
+// http://es5.github.com/#x15.9.5.44
+// This function provides a String representation of a Date object for use by
+// JSON.stringify (15.12.3).
+if (!Date.prototype.toJSON) {
+ Date.prototype.toJSON = function toJSON(key) {
+ // When the toJSON method is called with argument key, the following
+ // steps are taken:
+
+ // 1. Let O be the result of calling ToObject, giving it the this
+ // value as its argument.
+ // 2. Let tv be ToPrimitive(O, hint Number).
+ // 3. If tv is a Number and is not finite, return null.
+ // XXX
+ // 4. Let toISO be the result of calling the [[Get]] internal method of
+ // O with argument "toISOString".
+ // 5. If IsCallable(toISO) is false, throw a TypeError exception.
+ if (typeof this.toISOString != "function")
+ throw new TypeError(); // TODO message
+ // 6. Return the result of calling the [[Call]] internal method of
+ // toISO with O as the this value and an empty argument list.
+ return this.toISOString();
+
+ // NOTE 1 The argument is ignored.
+
+ // NOTE 2 The toJSON function is intentionally generic; it does not
+ // require that its this value be a Date object. Therefore, it can be
+ // transferred to other kinds of objects for use as a method. However,
+ // it does require that any such object have a toISOString method. An
+ // object is free to use the argument key to filter its
+ // stringification.
+ };
+}
+
+// ES5 15.9.4.2
+// http://es5.github.com/#x15.9.4.2
+// based on work shared by Daniel Friesen (dantman)
+// http://gist.github.com/303249
+if (Date.parse("+275760-09-13T00:00:00.000Z") !== 8.64e15) {
+ // XXX global assignment won't work in embeddings that use
+ // an alternate object for the context.
+ Date = (function(NativeDate) {
+
+ // Date.length === 7
+ var Date = function Date(Y, M, D, h, m, s, ms) {
+ var length = arguments.length;
+ if (this instanceof NativeDate) {
+ var date = length == 1 && String(Y) === Y ? // isString(Y)
+ // We explicitly pass it through parse:
+ new NativeDate(Date.parse(Y)) :
+ // We have to manually make calls depending on argument
+ // length here
+ length >= 7 ? new NativeDate(Y, M, D, h, m, s, ms) :
+ length >= 6 ? new NativeDate(Y, M, D, h, m, s) :
+ length >= 5 ? new NativeDate(Y, M, D, h, m) :
+ length >= 4 ? new NativeDate(Y, M, D, h) :
+ length >= 3 ? new NativeDate(Y, M, D) :
+ length >= 2 ? new NativeDate(Y, M) :
+ length >= 1 ? new NativeDate(Y) :
+ new NativeDate();
+ // Prevent mixups with unfixed Date object
+ date.constructor = Date;
+ return date;
+ }
+ return NativeDate.apply(this, arguments);
+ };
+
+ // 15.9.1.15 Date Time String Format.
+ var isoDateExpression = new RegExp("^" +
+ "(\\d{4}|[\+\-]\\d{6})" + // four-digit year capture or sign + 6-digit extended year
+ "(?:-(\\d{2})" + // optional month capture
+ "(?:-(\\d{2})" + // optional day capture
+ "(?:" + // capture hours:minutes:seconds.milliseconds
+ "T(\\d{2})" + // hours capture
+ ":(\\d{2})" + // minutes capture
+ "(?:" + // optional :seconds.milliseconds
+ ":(\\d{2})" + // seconds capture
+ "(?:\\.(\\d{3}))?" + // milliseconds capture
+ ")?" +
+ "(?:" + // capture UTC offset component
+ "Z|" + // UTC capture
+ "(?:" + // offset specifier +/-hours:minutes
+ "([-+])" + // sign capture
+ "(\\d{2})" + // hours offset capture
+ ":(\\d{2})" + // minutes offset capture
+ ")" +
+ ")?)?)?)?" +
+ "$");
+
+ // Copy any custom methods a 3rd party library may have added
+ for (var key in NativeDate)
+ Date[key] = NativeDate[key];
+
+ // Copy "native" methods explicitly; they may be non-enumerable
+ Date.now = NativeDate.now;
+ Date.UTC = NativeDate.UTC;
+ Date.prototype = NativeDate.prototype;
+ Date.prototype.constructor = Date;
+
+ // Upgrade Date.parse to handle simplified ISO 8601 strings
+ Date.parse = function parse(string) {
+ var match = isoDateExpression.exec(string);
+ if (match) {
+ match.shift(); // kill match[0], the full match
+ // parse months, days, hours, minutes, seconds, and milliseconds
+ for (var i = 1; i < 7; i++) {
+ // provide default values if necessary
+ match[i] = +(match[i] || (i < 3 ? 1 : 0));
+ // match[1] is the month. Months are 0-11 in JavaScript
+ // `Date` objects, but 1-12 in ISO notation, so we
+ // decrement.
+ if (i == 1)
+ match[i]--;
+ }
+
+ // parse the UTC offset component
+ var minuteOffset = +match.pop(), hourOffset = +match.pop(), sign = match.pop();
+
+ // compute the explicit time zone offset if specified
+ var offset = 0;
+ if (sign) {
+ // detect invalid offsets and return early
+ if (hourOffset > 23 || minuteOffset > 59)
+ return NaN;
+
+ // express the provided time zone offset in minutes. The offset is
+ // negative for time zones west of UTC; positive otherwise.
+ offset = (hourOffset * 60 + minuteOffset) * 6e4 * (sign == "+" ? -1 : 1);
+ }
+
+ // Date.UTC for years between 0 and 99 converts year to 1900 + year
+ // The Gregorian calendar has a 400-year cycle, so
+ // to Date.UTC(year + 400, .... ) - 12622780800000 == Date.UTC(year, ...),
+ // where 12622780800000 - number of milliseconds in Gregorian calendar 400 years
+ var year = +match[0];
+ if (0 <= year && year <= 99) {
+ match[0] = year + 400;
+ return NativeDate.UTC.apply(this, match) + offset - 12622780800000;
+ }
+
+ // compute a new UTC date value, accounting for the optional offset
+ return NativeDate.UTC.apply(this, match) + offset;
+ }
+ return NativeDate.parse.apply(this, arguments);
+ };
+
+ return Date;
+ })(Date);
+}
+
+//
+// String
+// ======
+//
+
+// ES5 15.5.4.20
+// http://es5.github.com/#x15.5.4.20
+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()) {
+ // http://blog.stevenlevithan.com/archives/faster-trim-javascript
+ // http://perfectionkills.com/whitespace-deviations/
+ ws = "[" + ws + "]";
+ var trimBeginRegexp = new RegExp("^" + ws + ws + "*"),
+ trimEndRegexp = new RegExp(ws + ws + "*$");
+ String.prototype.trim = function trim() {
+ return String(this).replace(trimBeginRegexp, "").replace(trimEndRegexp, "");
+ };
+}
+
+//
+// Util
+// ======
+//
+
+// ES5 9.4
+// http://es5.github.com/#x9.4
+// http://jsperf.com/to-integer
+var toInteger = function (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;
+};
+
+var prepareString = "a"[0] != "a",
+ // ES5 9.9
+ // http://es5.github.com/#x9.9
+ toObject = function (o) {
+ if (o == null) { // this matches both null and undefined
+ throw new TypeError(); // TODO message
+ }
+ // If the implementation doesn't support by-index access of
+ // string characters (ex. IE < 7), split the string
+ if (prepareString && typeof o == "string" && o) {
+ return o.split("");
+ }
+ 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<listeners.length; i++) {
+ listeners[i](e);
+ if (e.propagationStopped)
+ break;
+ }
+
+ if (defaultHandler && !e.defaultPrevented)
+ return defaultHandler(e);
+};
+
+EventEmitter.setDefaultHandler = function(eventName, callback) {
+ this._defaultHandlers = this._defaultHandlers || {};
+
+ if (this._defaultHandlers[eventName])
+ throw new Error("The default handler for '" + eventName + "' is already set");
+
+ this._defaultHandlers[eventName] = callback;
+};
+
+EventEmitter.on =
+EventEmitter.addEventListener = function(eventName, callback) {
+ this._eventRegistry = this._eventRegistry || {};
+
+ var listeners = this._eventRegistry[eventName];
+ if (!listeners)
+ listeners = this._eventRegistry[eventName] = [];
+
+ if (listeners.indexOf(callback) == -1)
+ listeners.push(callback);
+};
+
+EventEmitter.removeListener =
+EventEmitter.removeEventListener = function(eventName, callback) {
+ this._eventRegistry = this._eventRegistry || {};
+
+ var listeners = this._eventRegistry[eventName];
+ if (!listeners)
+ return;
+
+ var index = listeners.indexOf(callback);
+ if (index !== -1)
+ listeners.splice(index, 1);
+};
+
+EventEmitter.removeAllListeners = function(eventName) {
+ if (this._eventRegistry) this._eventRegistry[eventName] = [];
+};
+
+exports.EventEmitter = EventEmitter;
+
+});
+
+define('ace/lib/oop', ['require', 'exports', 'module' ], function(require, exports, module) {
+
+
+exports.inherits = (function() {
+ var tempCtor = function() {};
+ return function(ctor, superCtor) {
+ tempCtor.prototype = superCtor.prototype;
+ ctor.super_ = superCtor.prototype;
+ ctor.prototype = new tempCtor();
+ ctor.prototype.constructor = ctor;
+ };
+}());
+
+exports.mixin = function(obj, mixin) {
+ for (var key in mixin) {
+ obj[key] = mixin[key];
+ }
+};
+
+exports.implement = function(proto, mixin) {
+ exports.mixin(proto, mixin);
+};
+
+});
+
+define('ace/mode/css_worker', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/worker/mirror', 'ace/mode/css/csslint'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var Mirror = require("../worker/mirror").Mirror;
+var CSSLint = require("./css/csslint").CSSLint;
+
+var Worker = exports.Worker = function(sender) {
+ Mirror.call(this, sender);
+ this.setTimeout(200);
+};
+
+oop.inherits(Worker, Mirror);
+
+(function() {
+
+ this.onUpdate = function() {
+ var value = this.doc.getValue();
+
+ var result = CSSLint.verify(value);
+ this.sender.emit("csslint", result.messages.map(function(msg) {
+ delete msg.rule;
+ return msg;
+ }));
+ };
+
+}).call(Worker.prototype);
+
+});
+define('ace/worker/mirror', ['require', 'exports', 'module' , 'ace/document', 'ace/lib/lang'], function(require, exports, module) {
+
+
+var Document = require("../document").Document;
+var lang = require("../lib/lang");
+
+var Mirror = exports.Mirror = function(sender) {
+ this.sender = sender;
+ var doc = this.doc = new Document("");
+
+ var deferredUpdate = this.deferredUpdate = lang.deferredCall(this.onUpdate.bind(this));
+
+ var _self = this;
+ sender.on("change", function(e) {
+ doc.applyDeltas([e.data]);
+ deferredUpdate.schedule(_self.$timeout);
+ });
+};
+
+(function() {
+
+ this.$timeout = 500;
+
+ this.setTimeout = function(timeout) {
+ this.$timeout = timeout;
+ };
+
+ this.setValue = function(value) {
+ this.doc.setValue(value);
+ this.deferredUpdate.schedule(this.$timeout);
+ };
+
+ this.getValue = function(callbackId) {
+ this.sender.callback(this.doc.getValue(), callbackId);
+ };
+
+ this.onUpdate = function() {
+ // abstract method
+ };
+
+}).call(Mirror.prototype);
+
+});
+
+define('ace/document', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/event_emitter', 'ace/range', 'ace/anchor'], function(require, exports, module) {
+
+
+var oop = require("./lib/oop");
+var EventEmitter = require("./lib/event_emitter").EventEmitter;
+var Range = require("./range").Range;
+var Anchor = require("./anchor").Anchor;
+
+ /**
+ * new Document([text])
+ * - text (String | Array): The starting text
+ *
+ * Creates a new `Document`. If `text` is included, the `Document` contains those strings; otherwise, it's empty.
+ *
+ **/
+
+var Document = function(text) {
+ this.$lines = [];
+
+ // There has to be one line at least in the document. If you pass an empty
+ // string to the insert function, nothing will happen. Workaround.
+ if (text.length == 0) {
+ this.$lines = [""];
+ } else if (Array.isArray(text)) {
+ this.insertLines(0, text);
+ } else {
+ this.insert({row: 0, column:0}, text);
+ }
+};
+
+(function() {
+
+ oop.implement(this, EventEmitter);
+ this.setValue = function(text) {
+ var len = this.getLength();
+ this.remove(new Range(0, 0, len, this.getLine(len-1).length));
+ this.insert({row: 0, column:0}, text);
+ };
+ this.getValue = function() {
+ return this.getAllLines().join(this.getNewLineCharacter());
+ };
+ this.createAnchor = function(row, column) {
+ return new Anchor(this, row, column);
+ };
+
+ // check for IE split bug
+ if ("aaa".split(/a/).length == 0)
+ this.$split = function(text) {
+ return text.replace(/\r\n|\r/g, "\n").split("\n");
+ }
+ else
+ this.$split = function(text) {
+ return text.split(/\r\n|\r|\n/);
+ };
+ this.$detectNewLine = function(text) {
+ var match = text.match(/^.*?(\r\n|\r|\n)/m);
+ if (match) {
+ this.$autoNewLine = match[1];
+ } else {
+ this.$autoNewLine = "\n";
+ }
+ };
+ this.getNewLineCharacter = function() {
+ switch (this.$newLineMode) {
+ case "windows":
+ return "\r\n";
+
+ case "unix":
+ return "\n";
+
+ case "auto":
+ return this.$autoNewLine;
+ }
+ };
+
+ this.$autoNewLine = "\n";
+ this.$newLineMode = "auto";
+ this.setNewLineMode = function(newLineMode) {
+ if (this.$newLineMode === newLineMode)
+ return;
+
+ this.$newLineMode = newLineMode;
+ };
+ this.getNewLineMode = function() {
+ return this.$newLineMode;
+ };
+ this.isNewLine = function(text) {
+ return (text == "\r\n" || text == "\r" || text == "\n");
+ };
+ this.getLine = function(row) {
+ return this.$lines[row] || "";
+ };
+ this.getLines = function(firstRow, lastRow) {
+ return this.$lines.slice(firstRow, lastRow + 1);
+ };
+ this.getAllLines = function() {
+ return this.getLines(0, this.getLength());
+ };
+ this.getLength = function() {
+ return this.$lines.length;
+ };
+ this.getTextRange = function(range) {
+ if (range.start.row == range.end.row) {
+ return this.$lines[range.start.row].substring(range.start.column,
+ range.end.column);
+ }
+ else {
+ var lines = this.getLines(range.start.row+1, range.end.row-1);
+ lines.unshift((this.$lines[range.start.row] || "").substring(range.start.column));
+ lines.push((this.$lines[range.end.row] || "").substring(0, range.end.column));
+ return lines.join(this.getNewLineCharacter());
+ }
+ };
+ this.$clipPosition = function(position) {
+ var length = this.getLength();
+ if (position.row >= 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);
+
+ // only detect new lines if the document has no line break yet
+ 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;
+ };
+ /**
+ * Document@change(e)
+ * - e (Object): Contains at least one property called `"action"`. `"action"` indicates the action that triggered the change. Each action also has a set of additional properties.
+ *
+ * Fires whenever the document changes.
+ *
+ * Several methods trigger different `"change"` events. Below is a list of each action type, followed by each property that's also available:
+ *
+ * * `"insertLines"` (emitted by [[Document.insertLines]])
+ * * `range`: the [[Range]] of the change within the document
+ * * `lines`: the lines in the document that are changing
+ * * `"insertText"` (emitted by [[Document.insertNewLine]])
+ * * `range`: the [[Range]] of the change within the document
+ * * `text`: the text that's being added
+ * * `"removeLines"` (emitted by [[Document.insertLines]])
+ * * `range`: the [[Range]] of the change within the document
+ * * `lines`: the lines in the document that were removed
+ * * `nl`: the new line character (as defined by [[Document.getNewLineCharacter]])
+ * * `"removeText"` (emitted by [[Document.removeInLine]] and [[Document.removeNewLine]])
+ * * `range`: the [[Range]] of the change within the document
+ * * `text`: the text that's being removed
+ *
+ **/
+ this.insertLines = function(row, lines) {
+ if (lines.length == 0)
+ return {row: row, column: 0};
+
+ // apply doesn't work for big arrays (smallest threshold is on safari 0xFFFF)
+ // to circumvent that we have to break huge inserts into smaller chunks here
+ 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) {
+ // clip to document
+ 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;
+
+ // Shortcut: If the text we want to insert is the same as it is already
+ // in the document, we don't have to replace anything.
+ 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<deltas.length; i++) {
+ var delta = deltas[i];
+ var range = Range.fromPoints(delta.range.start, delta.range.end);
+
+ if (delta.action == "insertLines")
+ this.insertLines(range.start.row, delta.lines);
+ else if (delta.action == "insertText")
+ this.insert(range.start, delta.text);
+ else if (delta.action == "removeLines")
+ this.removeLines(range.start.row, range.end.row - 1);
+ else if (delta.action == "removeText")
+ this.remove(range);
+ }
+ };
+ this.revertDeltas = function(deltas) {
+ for (var i=deltas.length-1; 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);
+ }
+ };
+
+}).call(Document.prototype);
+
+exports.Document = Document;
+});
+
+define('ace/range', ['require', 'exports', 'module' ], function(require, exports, module) {
+
+
+/**
+ * class Range
+ *
+ * This object is used in various places to indicate a region within the editor. To better visualize how this works, imagine a rectangle. Each quadrant of the rectangle is analogus to a range, as ranges contain a starting row and starting column, and an ending row, and ending column.
+ *
+ **/
+
+/**
+ * new Range(startRow, startColumn, endRow, endColumn)
+ * - startRow (Number): The starting row
+ * - startColumn (Number): The starting column
+ * - endRow (Number): The ending row
+ * - endColumn (Number): The ending column
+ *
+ * Creates a new `Range` object with the given starting and ending row and column points.
+ *
+ **/
+var Range = function(startRow, startColumn, endRow, endColumn) {
+ this.start = {
+ row: startRow,
+ column: startColumn
+ };
+
+ this.end = {
+ row: endRow,
+ column: endColumn
+ };
+};
+
+(function() {
+ /**
+ * Range.isEqual(range) -> Boolean
+ * - range (Range): A range to check against
+ *
+ * Returns `true` if and only if the starting row and column, and ending tow and column, are equivalent to those given by `range`.
+ *
+ **/
+ 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;
+ }
+ }
+ }
+
+ /** related to: Range.compare
+ * Range.comparePoint(p) -> Number
+ * - p (Range): A point to compare with
+ * + (Number): This method returns one of the following numbers:<br/>
+ * * `0` if the two points are exactly equal<br/>
+ * * `-1` if `p.row` is less then the calling range<br/>
+ * * `1` if `p.row` is greater than the calling range<br/>
+ * <br/>
+ * If the starting row of the calling range is equal to `p.row`, and:<br/>
+ * * `p.column` is greater than or equal to the calling range's starting column, this returns `0`<br/>
+ * * Otherwise, it returns -1<br/>
+ *<br/>
+ * If the ending row of the calling range is equal to `p.row`, and:<br/>
+ * * `p.column` is less than or equal to the calling range's ending column, this returns `0`<br/>
+ * * Otherwise, it returns 1<br/>
+ *
+ * Checks the row and column points of `p` with the row and column points of the calling range.
+ *
+ *
+ *
+ **/
+ this.comparePoint = function(p) {
+ return this.compare(p.row, p.column);
+ }
+
+ /** related to: Range.comparePoint
+ * Range.containsRange(range) -> Boolean
+ * - range (Range): A range to compare with
+ *
+ * Checks the start and end points of `range` and compares them to the calling range. Returns `true` if the `range` is contained within the caller's range.
+ *
+ **/
+ this.containsRange = function(range) {
+ return this.comparePoint(range.start) == 0 && this.comparePoint(range.end) == 0;
+ }
+
+ /**
+ * Range.intersects(range) -> Boolean
+ * - range (Range): A range to compare with
+ *
+ * Returns `true` if passed in `range` intersects with the one calling this method.
+ *
+ **/
+ this.intersects = function(range) {
+ var cmp = this.compareRange(range);
+ return (cmp == -1 || cmp == 0 || cmp == 1);
+ }
+
+ /**
+ * Range.isEnd(row, column) -> Boolean
+ * - row (Number): A row point to compare with
+ * - column (Number): A column point to compare with
+ *
+ * Returns `true` if the caller's ending row point is the same as `row`, and if the caller's ending column is the same as `column`.
+ *
+ **/
+ this.isEnd = function(row, column) {
+ return this.end.row == row && this.end.column == column;
+ }
+
+ /**
+ * Range.isStart(row, column) -> Boolean
+ * - row (Number): A row point to compare with
+ * - column (Number): A column point to compare with
+ *
+ * Returns `true` if the caller's starting row point is the same as `row`, and if the caller's starting column is the same as `column`.
+ *
+ **/
+ this.isStart = function(row, column) {
+ return this.start.row == row && this.start.column == column;
+ }
+
+ /**
+ * Range.setStart(row, column)
+ * - row (Number): A row point to set
+ * - column (Number): A column point to set
+ *
+ * Sets the starting row and column for the range.
+ *
+ **/
+ 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;
+ }
+ }
+
+ /**
+ * Range.setEnd(row, column)
+ * - row (Number): A row point to set
+ * - column (Number): A column point to set
+ *
+ * Sets the starting row and column for the range.
+ *
+ **/
+ 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;
+ }
+ }
+
+ /** related to: Range.compare
+ * Range.inside(row, column) -> Boolean
+ * - row (Number): A row point to compare with
+ * - column (Number): A column point to compare with
+ *
+ * Returns `true` if the `row` and `column` are within the given range.
+ *
+ **/
+ 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;
+ }
+
+ /** related to: Range.compare
+ * Range.insideStart(row, column) -> Boolean
+ * - row (Number): A row point to compare with
+ * - column (Number): A column point to compare with
+ *
+ * Returns `true` if the `row` and `column` are within the given range's starting points.
+ *
+ **/
+ this.insideStart = function(row, column) {
+ if (this.compare(row, column) == 0) {
+ if (this.isEnd(row, column)) {
+ return false;
+ } else {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /** related to: Range.compare
+ * Range.insideEnd(row, column) -> Boolean
+ * - row (Number): A row point to compare with
+ * - column (Number): A column point to compare with
+ *
+ * Returns `true` if the `row` and `column` are within the given range's ending points.
+ *
+ **/
+ this.insideEnd = function(row, column) {
+ if (this.compare(row, column) == 0) {
+ if (this.isStart(row, column)) {
+ return false;
+ } else {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Range.compare(row, column) -> Number
+ * - row (Number): A row point to compare with
+ * - column (Number): A column point to compare with
+ * + (Number): This method returns one of the following numbers:<br/>
+ * * `0` if the two points are exactly equal <br/>
+ * * `-1` if `p.row` is less then the calling range <br/>
+ * * `1` if `p.row` is greater than the calling range <br/>
+ * <br/>
+ * If the starting row of the calling range is equal to `p.row`, and: <br/>
+ * * `p.column` is greater than or equal to the calling range's starting column, this returns `0`<br/>
+ * * Otherwise, it returns -1<br/>
+ * <br/>
+ * If the ending row of the calling range is equal to `p.row`, and: <br/>
+ * * `p.column` is less than or equal to the calling range's ending column, this returns `0` <br/>
+ * * Otherwise, it returns 1
+ *
+ * Checks the row and column points with the row and column points of the calling range.
+ *
+ *
+ **/
+ 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);
+ }
+ }
+
+ /**
+ * Range.compareEnd(row, column) -> Number
+ * - row (Number): A row point to compare with
+ * - column (Number): A column point to compare with
+ * + (Number): This method returns one of the following numbers:<br/>
+ * * `0` if the two points are exactly equal<br/>
+ * * `-1` if `p.row` is less then the calling range<br/>
+ * * `1` if `p.row` is greater than the calling range, or if `isEnd` is `true.<br/>
+ * <br/>
+ * If the starting row of the calling range is equal to `p.row`, and:<br/>
+ * * `p.column` is greater than or equal to the calling range's starting column, this returns `0`<br/>
+ * * Otherwise, it returns -1<br/>
+ *<br/>
+ * If the ending row of the calling range is equal to `p.row`, and:<br/>
+ * * `p.column` is less than or equal to the calling range's ending column, this returns `0`<br/>
+ * * Otherwise, it returns 1
+ *
+ * Checks the row and column points with the row and column points of the calling range.
+ *
+ *
+ **/
+ this.compareEnd = function(row, column) {
+ if (this.end.row == row && this.end.column == column) {
+ return 1;
+ } else {
+ return this.compare(row, column);
+ }
+ }
+
+ /**
+ * Range.compareInside(row, column) -> Number
+ * - row (Number): A row point to compare with
+ * - column (Number): A column point to compare with
+ * + (Number): This method returns one of the following numbers:<br/>
+ * * `1` if the ending row of the calling range is equal to `row`, and the ending column of the calling range is equal to `column`<br/>
+ * * `-1` if the starting row of the calling range is equal to `row`, and the starting column of the calling range is equal to `column`<br/>
+ * <br/>
+ * Otherwise, it returns the value after calling [[Range.compare `compare()`]].
+ *
+ * Checks the row and column points with the row and column points of the calling range.
+ *
+ *
+ *
+ **/
+ 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);
+ }
+ }
+
+ /**
+ * Range.clipRows(firstRow, lastRow) -> Range
+ * - firstRow (Number): The starting row
+ * - lastRow (Number): The ending row
+ *
+ * Returns the part of the current `Range` that occurs within the boundaries of `firstRow` and `lastRow` as a new `Range` object.
+ *
+ **/
+ 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;
+
+/**
+ * new Anchor(doc, row, column)
+ * - doc (Document): The document to associate with the anchor
+ * - row (Number): The starting row position
+ * - column (Number): The starting column position
+ *
+ * Creates a new `Anchor` and associates it with a document.
+ *
+ **/
+
+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) {
+ return new Array(count + 1).join(string);
+};
+
+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<l; i++) {
+ if (array[i] && typeof array[i] == "object")
+ copy[i] = this.copyObject( array[i] );
+ else
+ copy[i] = array[i];
+ }
+ return copy;
+};
+
+exports.deepCopy = function (obj) {
+ if (typeof obj != "object") {
+ return obj;
+ }
+
+ var copy = obj.constructor();
+ for (var key in obj) {
+ if (typeof obj[key] == "object") {
+ copy[key] = this.deepCopy(obj[key]);
+ } else {
+ copy[key] = obj[key];
+ }
+ }
+ return copy;
+};
+
+exports.arrayToMap = function(arr) {
+ var map = {};
+ for (var i=0; i<arr.length; i++) {
+ map[arr[i]] = 1;
+ }
+ return map;
+
+};
+
+exports.createMap = function(props) {
+ var map = Object.create(null);
+ for (var i in props) {
+ map[i] = props[i];
+ }
+ return map;
+};
+exports.arrayRemove = function(array, value) {
+ for (var i = 0; i <= array.length; i++) {
+ if (value === array[i]) {
+ array.splice(i, 1);
+ }
+ }
+};
+
+exports.escapeRegExp = function(str) {
+ return str.replace(/([.*+?^${}()|[\]\/\\])/g, '\\$1');
+};
+
+exports.getMatchOffsets = function(string, regExp) {
+ var matches = [];
+
+ string.replace(regExp, function(str) {
+ matches.push({
+ offset: arguments[arguments.length-2],
+ length: str.length
+ });
+ });
+
+ return matches;
+};
+
+
+exports.deferredCall = function(fcn) {
+
+ var timer = null;
+ var callback = function() {
+ timer = null;
+ fcn();
+ };
+
+ var deferred = function(timeout) {
+ deferred.cancel();
+ timer = setTimeout(callback, timeout || 0);
+ return deferred;
+ };
+
+ deferred.schedule = deferred;
+
+ deferred.call = function() {
+ this.cancel();
+ fcn();
+ return deferred;
+ };
+
+ deferred.cancel = function() {
+ clearTimeout(timer);
+ timer = null;
+ return deferred;
+ };
+
+ return deferred;
+};
+
+});
+define('ace/mode/css/csslint', ['require', 'exports', 'module' ], function(require, exports, module) {
+/*!
+CSSLint
+Copyright (c) 2011 Nicole Sullivan and Nicholas C. Zakas. All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+*/
+/* Build time: 2-March-2012 02:47:11 */
+
+/*!
+Parser-Lib
+Copyright (c) 2009-2011 Nicholas C. Zakas. All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+*/
+/* Version v0.1.6, Build time: 2-March-2012 02:44:32 */
+var parserlib = {};
+(function(){
+
+
+/**
+ * A generic base to inherit from for any object
+ * that needs event handling.
+ * @class EventTarget
+ * @constructor
+ */
+function EventTarget(){
+
+ /**
+ * The array of listeners for various events.
+ * @type Object
+ * @property _listeners
+ * @private
+ */
+ this._listeners = {};
+}
+
+EventTarget.prototype = {
+
+ //restore constructor
+ constructor: EventTarget,
+
+ /**
+ * Adds a listener for a given event type.
+ * @param {String} type The type of event to add a listener for.
+ * @param {Function} listener The function to call when the event occurs.
+ * @return {void}
+ * @method addListener
+ */
+ addListener: function(type, listener){
+ if (!this._listeners[type]){
+ this._listeners[type] = [];
+ }
+
+ this._listeners[type].push(listener);
+ },
+
+ /**
+ * Fires an event based on the passed-in object.
+ * @param {Object|String} event An object with at least a 'type' attribute
+ * or a string indicating the event name.
+ * @return {void}
+ * @method fire
+ */
+ 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]){
+
+ //create a copy of the array and use that so listeners can't chane
+ var listeners = this._listeners[event.type].concat();
+ for (var i=0, len=listeners.length; i < len; i++){
+ listeners[i].call(this, event);
+ }
+ }
+ },
+
+ /**
+ * Removes a listener for a given event type.
+ * @param {String} type The type of event to remove a listener from.
+ * @param {Function} listener The function to remove from the event.
+ * @return {void}
+ * @method removeListener
+ */
+ 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){
+
+ /**
+ * The input text with line endings normalized.
+ * @property _input
+ * @type String
+ * @private
+ */
+ this._input = text.replace(/\n\r?/g, "\n");
+ this._line = 1;
+ this._col = 1;
+ this._cursor = 0;
+}
+
+StringReader.prototype = {
+
+ //restore constructor
+ constructor: StringReader,
+
+ //-------------------------------------------------------------------------
+ // Position info
+ //-------------------------------------------------------------------------
+
+ /**
+ * Returns the column of the character to be read next.
+ * @return {int} The column of the character to be read next.
+ * @method getCol
+ */
+ getCol: function(){
+ return this._col;
+ },
+
+ /**
+ * Returns the row of the character to be read next.
+ * @return {int} The row of the character to be read next.
+ * @method getLine
+ */
+ getLine: function(){
+ return this._line ;
+ },
+
+ /**
+ * Determines if you're at the end of the input.
+ * @return {Boolean} True if there's no more input, false otherwise.
+ * @method eof
+ */
+ eof: function(){
+ return (this._cursor == this._input.length);
+ },
+
+ //-------------------------------------------------------------------------
+ // Basic reading
+ //-------------------------------------------------------------------------
+
+ /**
+ * Reads the next character without advancing the cursor.
+ * @param {int} count How many characters to look ahead (default is 1).
+ * @return {String} The next character or null if there is no next character.
+ * @method peek
+ */
+ peek: function(count){
+ var c = null;
+ count = (typeof count == "undefined" ? 1 : count);
+
+ //if we're not at the end of the input...
+ if (this._cursor < this._input.length){
+
+ //get character and increment cursor and column
+ c = this._input.charAt(this._cursor + count - 1);
+ }
+
+ return c;
+ },
+
+ /**
+ * Reads the next character from the input and adjusts the row and column
+ * accordingly.
+ * @return {String} The next character or null if there is no next character.
+ * @method read
+ */
+ read: function(){
+ var c = null;
+
+ //if we're not at the end of the input...
+ if (this._cursor < this._input.length){
+
+ //if the last character was a newline, increment row count
+ //and reset column count
+ if (this._input.charAt(this._cursor) == "\n"){
+ this._line++;
+ this._col=1;
+ } else {
+ this._col++;
+ }
+
+ //get character and increment cursor and column
+ c = this._input.charAt(this._cursor++);
+ }
+
+ return c;
+ },
+
+ //-------------------------------------------------------------------------
+ // Misc
+ //-------------------------------------------------------------------------
+
+ /**
+ * Saves the current location so it can be returned to later.
+ * @method mark
+ * @return {void}
+ */
+ 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;
+ }
+ },
+
+ //-------------------------------------------------------------------------
+ // Advanced reading
+ //-------------------------------------------------------------------------
+
+ /**
+ * Reads up to and including the given string. Throws an error if that
+ * string is not found.
+ * @param {String} pattern The string to read.
+ * @return {String} The string when it is found.
+ * @throws Error when the string pattern is not found.
+ * @method readTo
+ */
+ 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;
+
+ },
+
+ /**
+ * Reads characters while each character causes the given
+ * filter function to return true. The function is passed
+ * in each character and either returns true to continue
+ * reading or false to stop.
+ * @param {Function} filter The function to read on each character.
+ * @return {String} The string made up of all characters that passed the
+ * filter check.
+ * @method readWhile
+ */
+ readWhile: function(filter){
+
+ var buffer = "",
+ c = this.read();
+
+ while(c !== null && filter(c)){
+ buffer += c;
+ c = this.read();
+ }
+
+ return buffer;
+
+ },
+
+ /**
+ * Reads characters that match either text or a regular expression and
+ * returns those characters. If a match is found, the row and column
+ * are adjusted; if no match is found, the reader's state is unchanged.
+ * reading or false to stop.
+ * @param {String|RegExp} matchter If a string, then the literal string
+ * value is searched for. If a regular expression, then any string
+ * matching the pattern is search for.
+ * @return {String} The string made up of all characters that matched or
+ * null if there was no match.
+ * @method readMatch
+ */
+ readMatch: function(matcher){
+
+ var source = this._input.substring(this._cursor),
+ value = null;
+
+ //if it's a string, just do a straight match
+ 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;
+ },
+
+
+ /**
+ * Reads a given number of characters. If the end of the input is reached,
+ * it reads only the remaining characters and does not throw an error.
+ * @param {int} count The number of characters to read.
+ * @return {String} The string made up the read characters.
+ * @method readCount
+ */
+ readCount: function(count){
+ var buffer = "";
+
+ while(count--){
+ buffer += this.read();
+ }
+
+ return buffer;
+ }
+
+};
+function SyntaxError(message, line, col){
+
+ /**
+ * The column at which the error occurred.
+ * @type int
+ * @property col
+ */
+ this.col = col;
+ this.line = line;
+ this.message = message;
+
+}
+
+//inherit from Error
+SyntaxError.prototype = new Error();
+function SyntaxUnit(text, line, col, type){
+
+
+ /**
+ * The column of text on which the unit resides.
+ * @type int
+ * @property col
+ */
+ this.col = col;
+ this.line = line;
+ this.text = text;
+ this.type = type;
+}
+
+/**
+ * Create a new syntax unit based solely on the given token.
+ * Convenience method for creating a new syntax unit when
+ * it represents a single token instead of multiple.
+ * @param {Object} token The token object to represent.
+ * @return {parserlib.util.SyntaxUnit} The object representing the token.
+ * @static
+ * @method fromToken
+ */
+SyntaxUnit.fromToken = function(token){
+ return new SyntaxUnit(token.value, token.startLine, token.startCol);
+};
+
+SyntaxUnit.prototype = {
+
+ //restore constructor
+ constructor: SyntaxUnit,
+
+ /**
+ * Returns the text representation of the unit.
+ * @return {String} The text representation of the unit.
+ * @method valueOf
+ */
+ valueOf: function(){
+ return this.toString();
+ },
+
+ /**
+ * Returns the text representation of the unit.
+ * @return {String} The text representation of the unit.
+ * @method toString
+ */
+ toString: function(){
+ return this.text;
+ }
+
+};
+
+/**
+ * Generic TokenStream providing base functionality.
+ * @class TokenStreamBase
+ * @namespace parserlib.util
+ * @constructor
+ * @param {String|StringReader} input The text to tokenize or a reader from
+ * which to read the input.
+ */
+function TokenStreamBase(input, tokenData){
+
+ /**
+ * The string reader for easy access to the text.
+ * @type StringReader
+ * @property _reader
+ * @private
+ */
+ this._reader = input ? new StringReader(input.toString()) : null;
+ this._token = null;
+ this._tokenData = tokenData;
+ this._lt = [];
+ this._ltIndex = 0;
+
+ this._ltIndexCache = [];
+}
+
+/**
+ * Accepts an array of token information and outputs
+ * an array of token data containing key-value mappings
+ * and matching functions that the TokenStream needs.
+ * @param {Array} tokens An array of token descriptors.
+ * @return {Array} An array of processed token data.
+ * @method createTokenData
+ * @static
+ */
+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 = {
+
+ //restore constructor
+ constructor: TokenStreamBase,
+
+ //-------------------------------------------------------------------------
+ // Matching methods
+ //-------------------------------------------------------------------------
+
+ /**
+ * Determines if the next token matches the given token type.
+ * If so, that token is consumed; if not, the token is placed
+ * back onto the token stream. You can pass in any number of
+ * token types and this will return true if any of the token
+ * types is found.
+ * @param {int|int[]} tokenTypes Either a single token type or an array of
+ * token types that the next token might be. If an array is passed,
+ * it's assumed that the token can be any of these.
+ * @param {variant} channel (Optional) The channel to read from. If not
+ * provided, reads from the default (unnamed) channel.
+ * @return {Boolean} True if the token type matches, false if not.
+ * @method match
+ */
+ match: function(tokenTypes, channel){
+
+ //always convert to an array, makes things easier
+ 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;
+ }
+ }
+
+ //no match found, put the token back
+ this.unget();
+ return false;
+ },
+
+ /**
+ * Determines if the next token matches the given token type.
+ * If so, that token is consumed; if not, an error is thrown.
+ * @param {int|int[]} tokenTypes Either a single token type or an array of
+ * token types that the next token should be. If an array is passed,
+ * it's assumed that the token must be one of these.
+ * @param {variant} channel (Optional) The channel to read from. If not
+ * provided, reads from the default (unnamed) channel.
+ * @return {void}
+ * @method mustMatch
+ */
+ mustMatch: function(tokenTypes, channel){
+
+ var token;
+
+ //always convert to an array, makes things easier
+ 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);
+ }
+ },
+
+ //-------------------------------------------------------------------------
+ // Consuming methods
+ //-------------------------------------------------------------------------
+
+ /**
+ * Keeps reading from the token stream until either one of the specified
+ * token types is found or until the end of the input is reached.
+ * @param {int|int[]} tokenTypes Either a single token type or an array of
+ * token types that the next token should be. If an array is passed,
+ * it's assumed that the token must be one of these.
+ * @param {variant} channel (Optional) The channel to read from. If not
+ * provided, reads from the default (unnamed) channel.
+ * @return {void}
+ * @method advance
+ */
+ advance: function(tokenTypes, channel){
+
+ while(this.LA(0) !== 0 && !this.match(tokenTypes, channel)){
+ this.get();
+ }
+
+ return this.LA(0);
+ },
+
+ /**
+ * Consumes the next token from the token stream.
+ * @return {int} The token type of the token that was just consumed.
+ * @method get
+ */
+ get: function(channel){
+
+ var tokenInfo = this._tokenData,
+ reader = this._reader,
+ value,
+ i =0,
+ len = tokenInfo.length,
+ found = false,
+ token,
+ info;
+
+ //check the lookahead buffer first
+ if (this._lt.length && this._ltIndex >= 0 && this._ltIndex < this._lt.length){
+
+ i++;
+ this._token = this._lt[this._ltIndex++];
+ info = tokenInfo[this._token.type];
+
+ //obey channels logic
+ while((info.channel !== undefined && channel !== info.channel) &&
+ this._ltIndex < this._lt.length){
+ this._token = this._lt[this._ltIndex++];
+ info = tokenInfo[this._token.type];
+ i++;
+ }
+
+ //here be dragons
+ if ((info.channel === undefined || channel === info.channel) &&
+ this._ltIndex <= this._lt.length){
+ this._ltIndexCache.push(i);
+ return this._token.type;
+ }
+ }
+
+ //call token retriever method
+ token = this._getToken();
+
+ //if it should be hidden, don't save a token
+ if (token.type > -1 && !tokenInfo[token.type].hide){
+
+ //apply token channel
+ token.channel = tokenInfo[token.type].channel;
+
+ //save for later
+ this._token = token;
+ this._lt.push(token);
+
+ //save space that will be moved (must be done before array is truncated)
+ this._ltIndexCache.push(this._lt.length - this._ltIndex + i);
+
+ //keep the buffer under 5 items
+ if (this._lt.length > 5){
+ this._lt.shift();
+ }
+
+ //also keep the shift buffer under 5 items
+ if (this._ltIndexCache.length > 5){
+ this._ltIndexCache.shift();
+ }
+
+ //update lookahead index
+ this._ltIndex = this._lt.length;
+ }
+
+ /*
+ * Skip to the next token if:
+ * 1. The token type is marked as hidden.
+ * 2. The token type has a channel specified and it isn't the current channel.
+ */
+ info = tokenInfo[token.type];
+ if (info &&
+ (info.hide ||
+ (info.channel !== undefined && channel !== info.channel))){
+ return this.get(channel);
+ } else {
+ //return just the type
+ return token.type;
+ }
+ },
+
+ /**
+ * Looks ahead a certain number of tokens and returns the token type at
+ * that position. This will throw an error if you lookahead past the
+ * end of input, past the size of the lookahead buffer, or back past
+ * the first token in the lookahead buffer.
+ * @param {int} The index of the token type to retrieve. 0 for the
+ * current token, 1 for the next, -1 for the previous, etc.
+ * @return {int} The token type of the token in the given position.
+ * @method LA
+ */
+ LA: function(index){
+ var total = index,
+ tt;
+ if (index > 0){
+ //TODO: Store 5 somewhere
+ if (index > 5){
+ throw new Error("Too much lookahead.");
+ }
+
+ //get all those tokens
+ while(total){
+ tt = this.get();
+ total--;
+ }
+
+ //unget all those tokens
+ 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;
+
+ },
+
+ /**
+ * Looks ahead a certain number of tokens and returns the token at
+ * that position. This will throw an error if you lookahead past the
+ * end of input, past the size of the lookahead buffer, or back past
+ * the first token in the lookahead buffer.
+ * @param {int} The index of the token type to retrieve. 0 for the
+ * current token, 1 for the next, -1 for the previous, etc.
+ * @return {Object} The token of the token in the given position.
+ * @method LA
+ */
+ LT: function(index){
+
+ //lookahead first to prime the token buffer
+ this.LA(index);
+
+ //now find the token, subtract one because _ltIndex is already at the next index
+ return this._lt[this._ltIndex+index-1];
+ },
+
+ /**
+ * Returns the token type for the next token in the stream without
+ * consuming it.
+ * @return {int} The token type of the next token in the stream.
+ * @method peek
+ */
+ peek: function(){
+ return this.LA(1);
+ },
+
+ /**
+ * Returns the actual token object for the last consumed token.
+ * @return {Token} The token object for the last consumed token.
+ * @method token
+ */
+ token: function(){
+ return this._token;
+ },
+
+ /**
+ * Returns the name of the token for the given token type.
+ * @param {int} tokenType The type of token to get the name of.
+ * @return {String} The name of the token or "UNKNOWN_TOKEN" for any
+ * invalid token type.
+ * @method tokenName
+ */
+ tokenName: function(tokenType){
+ if (tokenType < 0 || tokenType > this._tokenData.length){
+ return "UNKNOWN_TOKEN";
+ } else {
+ return this._tokenData[tokenType].name;
+ }
+ },
+
+ /**
+ * Returns the token type value for the given token name.
+ * @param {String} tokenName The name of the token whose value should be returned.
+ * @return {int} The token type value for the given token name or -1
+ * for an unknown token.
+ * @method tokenName
+ */
+ tokenType: function(tokenName){
+ return this._tokenData[tokenName] || -1;
+ },
+
+ /**
+ * Returns the last consumed token to the token stream.
+ * @method unget
+ */
+ unget: function(){
+ //if (this._ltIndex > -1){
+ 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
+};
+})();
+/* Version v0.1.6, Build time: 2-March-2012 02:44:32 */
+(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"
+};
+/**
+ * Represents a selector combinator (whitespace, +, >).
+ * @namespace parserlib.css
+ * @class Combinator
+ * @extends parserlib.util.SyntaxUnit
+ * @constructor
+ * @param {String} text The text representation of the unit.
+ * @param {int} line The line of text on which the unit resides.
+ * @param {int} col The column of text on which the unit resides.
+ */
+function Combinator(text, line, col){
+
+ SyntaxUnit.call(this, text, line, col, Parser.COMBINATOR_TYPE);
+ this.type = "unknown";
+
+ //pretty simple
+ 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;
+/**
+ * Represents a media feature, such as max-width:500.
+ * @namespace parserlib.css
+ * @class MediaFeature
+ * @extends parserlib.util.SyntaxUnit
+ * @constructor
+ * @param {SyntaxUnit} name The name of the feature.
+ * @param {SyntaxUnit} value The value of the feature or null if none.
+ */
+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;
+/**
+ * Represents an individual media query.
+ * @namespace parserlib.css
+ * @class MediaQuery
+ * @extends parserlib.util.SyntaxUnit
+ * @constructor
+ * @param {String} modifier The modifier "not" or "only" (or null).
+ * @param {String} mediaType The type of media (i.e., "print").
+ * @param {Array} parts Array of selectors parts making up this selector.
+ * @param {int} line The line of text on which the unit resides.
+ * @param {int} col The column of text on which the unit resides.
+ */
+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;
+
+/**
+ * A CSS3 parser.
+ * @namespace parserlib.css
+ * @class Parser
+ * @constructor
+ * @param {Object} options (Optional) Various options for the parser:
+ * starHack (true|false) to allow IE6 star hack as valid,
+ * underscoreHack (true|false) to interpret leading underscores
+ * as IE6-7 targeting for known properties, ieFilters (true|false)
+ * to indicate that IE < 8 filters should be accepted and not throw
+ * syntax errors.
+ */
+function Parser(options){
+
+ //inherit event functionality
+ EventTarget.call(this);
+
+
+ this.options = options || {};
+
+ this._tokenStream = null;
+}
+
+//Static constants
+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 = {
+
+ //restore constructor
+ constructor: Parser,
+
+ //instance constants - yuck
+ 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,
+
+ //-----------------------------------------------------------------
+ // Grammar
+ //-----------------------------------------------------------------
+
+ _stylesheet: function(){
+
+ /*
+ * stylesheet
+ * : [ CHARSET_SYM S* STRING S* ';' ]?
+ * [S|CDO|CDC]* [ import [S|CDO|CDC]* ]*
+ * [ namespace [S|CDO|CDC]* ]*
+ * [ [ ruleset | media | page | font_face | keyframes ] [S|CDO|CDC]* ]*
+ * ;
+ */
+
+ var tokenStream = this._tokenStream,
+ charset = null,
+ count,
+ token,
+ tt;
+
+ this.fire("startstylesheet");
+
+ //try to read character set
+ this._charset();
+
+ this._skipCruft();
+
+ //try to read imports - may be more than one
+ while (tokenStream.peek() == Tokens.IMPORT_SYM){
+ this._import();
+ this._skipCruft();
+ }
+
+ //try to read namespaces - may be more than one
+ while (tokenStream.peek() == Tokens.NAMESPACE_SYM){
+ this._namespace();
+ this._skipCruft();
+ }
+
+ //get the next token
+ tt = tokenStream.peek();
+
+ //try to read the rest
+ 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){
+
+ //fire error event
+ this.fire({
+ type: "error",
+ error: null,
+ message: "Unknown @ rule: " + tokenStream.LT(0).value + ".",
+ line: tokenStream.LT(0).startLine,
+ col: tokenStream.LT(0).startCol
+ });
+
+ //skip braces
+ 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 {
+ //not a syntax error, rethrow it
+ throw new SyntaxError("Unknown @ rule.", tokenStream.LT(0).startLine, tokenStream.LT(0).startCol);
+ }
+ break;
+ case Tokens.S:
+ this._readWhitespace();
+ break;
+ default:
+ if(!this._ruleset()){
+
+ //error handling for known issues
+ 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){
+ /*
+ * import
+ * : IMPORT_SYM S*
+ * [STRING|URI] S* media_query_list? ';' S*
+ */
+
+ var tokenStream = this._tokenStream,
+ tt,
+ uri,
+ importToken,
+ mediaList = [];
+
+ //read import symbol
+ tokenStream.mustMatch(Tokens.IMPORT_SYM);
+ importToken = tokenStream.token();
+ this._readWhitespace();
+
+ tokenStream.mustMatch([Tokens.STRING, Tokens.URI]);
+
+ //grab the URI value
+ uri = tokenStream.token().value.replace(/(?:url\()?["']([^"']+)["']\)?/, "$1");
+
+ this._readWhitespace();
+
+ mediaList = this._media_query_list();
+
+ //must end with a semicolon
+ 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){
+ /*
+ * namespace
+ * : NAMESPACE_SYM S* [namespace_prefix S*]? [STRING|URI] S* ';' S*
+ */
+
+ var tokenStream = this._tokenStream,
+ line,
+ col,
+ prefix,
+ uri;
+
+ //read import symbol
+ tokenStream.mustMatch(Tokens.NAMESPACE_SYM);
+ line = tokenStream.token().startLine;
+ col = tokenStream.token().startCol;
+ this._readWhitespace();
+
+ //it's a namespace prefix - no _namespace_prefix() method because it's just an IDENT
+ if (tokenStream.match(Tokens.IDENT)){
+ prefix = tokenStream.token().value;
+ this._readWhitespace();
+ }
+
+ tokenStream.mustMatch([Tokens.STRING, Tokens.URI]);
+
+ //grab the URI value
+ uri = tokenStream.token().value.replace(/(?:url\()?["']([^"']+)["']\)?/, "$1");
+
+ this._readWhitespace();
+
+ //must end with a semicolon
+ tokenStream.mustMatch(Tokens.SEMICOLON);
+ this._readWhitespace();
+
+ if (emit !== false){
+ this.fire({
+ type: "namespace",
+ prefix: prefix,
+ uri: uri,
+ line: line,
+ col: col
+ });
+ }
+
+ },
+
+ _media: function(){
+ /*
+ * media
+ * : MEDIA_SYM S* media_query_list S* '{' S* ruleset* '}' S*
+ * ;
+ */
+ var tokenStream = this._tokenStream,
+ line,
+ col,
+ mediaList;// = [];
+
+ //look for @media
+ 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
+ });
+ },
+
+
+ //CSS3 Media Queries
+ _media_query_list: function(){
+ /*
+ * media_query_list
+ * : S* [media_query [ ',' S* media_query ]* ]?
+ * ;
+ */
+ 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;
+ },
+
+ /*
+ * Note: "expression" in the grammar maps to the _media_expression
+ * method.
+
+ */
+ _media_query: function(){
+ /*
+ * media_query
+ * : [ONLY | NOT]? S* media_type S* [ AND S* expression ]*
+ * | expression [ AND S* expression ]*
+ * ;
+ */
+ var tokenStream = this._tokenStream,
+ type = null,
+ ident = null,
+ token = null,
+ expressions = [];
+
+ if (tokenStream.match(Tokens.IDENT)){
+ ident = tokenStream.token().value.toLowerCase();
+
+ //since there's no custom tokens for these, need to manually check
+ 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);
+ },
+
+ //CSS3 Media Queries
+ _media_type: function(){
+ /*
+ * media_type
+ * : IDENT
+ * ;
+ */
+ return this._media_feature();
+ },
+
+ /**
+ * Note: in CSS3 Media Queries, this is called "expression".
+ * Renamed here to avoid conflict with CSS3 Selectors
+ * definition of "expression". Also note that "expr" in the
+ * grammar now maps to "expression" from CSS3 selectors.
+ * @method _media_expression
+ * @private
+ */
+ _media_expression: function(){
+ /*
+ * expression
+ * : '(' S* media_feature S* [ ':' S* expr ]? ')' S*
+ * ;
+ */
+ 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));
+ },
+
+ //CSS3 Media Queries
+ _media_feature: function(){
+ /*
+ * media_feature
+ * : IDENT
+ * ;
+ */
+ var tokenStream = this._tokenStream;
+
+ tokenStream.mustMatch(Tokens.IDENT);
+
+ return SyntaxUnit.fromToken(tokenStream.token());
+ },
+
+ //CSS3 Paged Media
+ _page: function(){
+ /*
+ * page:
+ * PAGE_SYM S* IDENT? pseudo_page? S*
+ * '{' S* [ declaration | margin ]? [ ';' S* [ declaration | margin ]? ]* '}' S*
+ * ;
+ */
+ var tokenStream = this._tokenStream,
+ line,
+ col,
+ identifier = null,
+ pseudoPage = null;
+
+ //look for @page
+ tokenStream.mustMatch(Tokens.PAGE_SYM);
+ line = tokenStream.token().startLine;
+ col = tokenStream.token().startCol;
+
+ this._readWhitespace();
+
+ if (tokenStream.match(Tokens.IDENT)){
+ identifier = tokenStream.token().value;
+
+ //The value 'auto' may not be used as a page name and MUST be treated as a syntax error.
+ if (identifier.toLowerCase() === "auto"){
+ this._unexpectedToken(tokenStream.token());
+ }
+ }
+
+ //see if there's a colon upcoming
+ 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
+ });
+
+ },
+
+ //CSS3 Paged Media
+ _margin: function(){
+ /*
+ * margin :
+ * margin_sym S* '{' declaration [ ';' S* declaration? ]* '}' S*
+ * ;
+ */
+ 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;
+ }
+ },
+
+ //CSS3 Paged Media
+ _margin_sym: function(){
+
+ /*
+ * margin_sym :
+ * TOPLEFTCORNER_SYM |
+ * TOPLEFT_SYM |
+ * TOPCENTER_SYM |
+ * TOPRIGHT_SYM |
+ * TOPRIGHTCORNER_SYM |
+ * BOTTOMLEFTCORNER_SYM |
+ * BOTTOMLEFT_SYM |
+ * BOTTOMCENTER_SYM |
+ * BOTTOMRIGHT_SYM |
+ * BOTTOMRIGHTCORNER_SYM |
+ * LEFTTOP_SYM |
+ * LEFTMIDDLE_SYM |
+ * LEFTBOTTOM_SYM |
+ * RIGHTTOP_SYM |
+ * RIGHTMIDDLE_SYM |
+ * RIGHTBOTTOM_SYM
+ * ;
+ */
+
+ 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(){
+ /*
+ * pseudo_page
+ * : ':' IDENT
+ * ;
+ */
+
+ var tokenStream = this._tokenStream;
+
+ tokenStream.mustMatch(Tokens.COLON);
+ tokenStream.mustMatch(Tokens.IDENT);
+
+ //TODO: CSS3 Paged Media says only "left", "center", and "right" are allowed
+
+ return tokenStream.token().value;
+ },
+
+ _font_face: function(){
+ /*
+ * font_face
+ * : FONT_FACE_SYM S*
+ * '{' S* declaration [ ';' S* declaration ]* '}' S*
+ * ;
+ */
+ var tokenStream = this._tokenStream,
+ line,
+ col;
+
+ //look for @page
+ 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(){
+
+ /*
+ * operator
+ * : '/' S* | ',' S* | /( empty )/
+ * ;
+ */
+
+ 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(){
+
+ /*
+ * combinator
+ * : PLUS S* | GREATER S* | TILDE S* | S+
+ * ;
+ */
+
+ 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(){
+
+ /*
+ * unary_operator
+ * : '-' | '+'
+ * ;
+ */
+
+ var tokenStream = this._tokenStream;
+
+ if (tokenStream.match([Tokens.MINUS, Tokens.PLUS])){
+ return tokenStream.token().value;
+ } else {
+ return null;
+ }
+ },
+
+ _property: function(){
+
+ /*
+ * property
+ * : IDENT S*
+ * ;
+ */
+
+ var tokenStream = this._tokenStream,
+ value = null,
+ hack = null,
+ tokenValue,
+ token,
+ line,
+ col;
+
+ //check for star hack - throws error if not allowed
+ 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;
+
+ //check for underscore hack - no error if not allowed because it's valid CSS syntax
+ 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;
+ },
+
+ //Augmented with CSS3 Selectors
+ _ruleset: function(){
+ /*
+ * ruleset
+ * : selectors_group
+ * '{' S* declaration? [ ';' S* declaration? ]* '}' S*
+ * ;
+ */
+
+ var tokenStream = this._tokenStream,
+ tt,
+ selectors;
+ try {
+ selectors = this._selectors_group();
+ } catch (ex){
+ if (ex instanceof SyntaxError && !this.options.strict){
+
+ //fire error event
+ this.fire({
+ type: "error",
+ error: ex,
+ message: ex.message,
+ line: ex.line,
+ col: ex.col
+ });
+
+ //skip over everything until closing brace
+ tt = tokenStream.advance([Tokens.RBRACE]);
+ if (tt == Tokens.RBRACE){
+ //if there's a right brace, the rule is finished so don't do anything
+ } else {
+ //otherwise, rethrow the error because it wasn't handled properly
+ throw ex;
+ }
+
+ } else {
+ //not a syntax error, rethrow it
+ throw ex;
+ }
+
+ //trigger parser to continue
+ return true;
+ }
+
+ //if it got here, all selectors parsed
+ 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;
+
+ },
+
+ //CSS3 Selectors
+ _selectors_group: function(){
+
+ /*
+ * selectors_group
+ * : selector [ COMMA S* selector ]*
+ * ;
+ */
+ 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;
+ },
+
+ //CSS3 Selectors
+ _selector: function(){
+ /*
+ * selector
+ * : simple_selector_sequence [ combinator simple_selector_sequence ]*
+ * ;
+ */
+
+ var tokenStream = this._tokenStream,
+ selector = [],
+ nextSelector = null,
+ combinator = null,
+ ws = null;
+
+ //if there's no simple selector, then there's no selector
+ nextSelector = this._simple_selector_sequence();
+ if (nextSelector === null){
+ return null;
+ }
+
+ selector.push(nextSelector);
+
+ do {
+
+ //look for a combinator
+ combinator = this._combinator();
+
+ if (combinator !== null){
+ selector.push(combinator);
+ nextSelector = this._simple_selector_sequence();
+
+ //there must be a next selector
+ if (nextSelector === null){
+ this._unexpectedToken(this.LT(1));
+ } else {
+
+ //nextSelector is an instance of SelectorPart
+ selector.push(nextSelector);
+ }
+ } else {
+
+ //if there's not whitespace, we're done
+ if (this._readWhitespace()){
+
+ //add whitespace separator
+ ws = new Combinator(tokenStream.token().value, tokenStream.token().startLine, tokenStream.token().startCol);
+
+ //combinator is not required
+ combinator = this._combinator();
+
+ //selector is required if there's a 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);
+ },
+
+ //CSS3 Selectors
+ _simple_selector_sequence: function(){
+ /*
+ * simple_selector_sequence
+ * : [ type_selector | universal ]
+ * [ HASH | class | attrib | pseudo | negation ]*
+ * | [ HASH | class | attrib | pseudo | negation ]+
+ * ;
+ */
+
+ var tokenStream = this._tokenStream,
+
+ //parts of a simple selector
+ elementName = null,
+ modifiers = [],
+
+ //complete selector text
+ selectorText= "",
+
+ //the different parts after the element name to search for
+ components = [
+ //HASH
+ 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;
+
+
+ //get starting line and column for the selector
+ 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){
+
+ //whitespace means we're done
+ if (tokenStream.peek() === Tokens.S){
+ break;
+ }
+
+ //check for each component
+ while(i < len && component === null){
+ component = components[i++].call(this);
+ }
+
+ if (component === null){
+
+ //we don't have a selector
+ 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;
+ },
+
+ //CSS3 Selectors
+ _type_selector: function(){
+ /*
+ * type_selector
+ * : [ namespace_prefix ]? element_name
+ * ;
+ */
+
+ var tokenStream = this._tokenStream,
+ ns = this._namespace_prefix(),
+ elementName = this._element_name();
+
+ if (!elementName){
+ /*
+ * Need to back out the namespace that was read due to both
+ * type_selector and universal reading namespace_prefix
+ * first. Kind of hacky, but only way I can figure out
+ * right now how to not change the grammar.
+ */
+ 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;
+ }
+ },
+
+ //CSS3 Selectors
+ _class: function(){
+ /*
+ * class
+ * : '.' IDENT
+ * ;
+ */
+
+ 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;
+ }
+
+ },
+
+ //CSS3 Selectors
+ _element_name: function(){
+ /*
+ * element_name
+ * : IDENT
+ * ;
+ */
+
+ 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;
+ }
+ },
+
+ //CSS3 Selectors
+ _namespace_prefix: function(){
+ /*
+ * namespace_prefix
+ * : [ IDENT | '*' ]? '|'
+ * ;
+ */
+ var tokenStream = this._tokenStream,
+ value = "";
+
+ //verify that this is a namespace prefix
+ 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;
+ },
+
+ //CSS3 Selectors
+ _universal: function(){
+ /*
+ * universal
+ * : [ namespace_prefix ]? '*'
+ * ;
+ */
+ 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;
+
+ },
+
+ //CSS3 Selectors
+ _attrib: function(){
+ /*
+ * attrib
+ * : '[' S* [ namespace_prefix ]? IDENT S*
+ * [ [ PREFIXMATCH |
+ * SUFFIXMATCH |
+ * SUBSTRINGMATCH |
+ * '=' |
+ * INCLUDES |
+ * DASHMATCH ] S* [ IDENT | STRING ] S*
+ * ]? ']'
+ * ;
+ */
+
+ 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;
+ }
+ },
+
+ //CSS3 Selectors
+ _pseudo: function(){
+
+ /*
+ * pseudo
+ * : ':' ':'? [ IDENT | functional_pseudo ]
+ * ;
+ */
+
+ 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;
+ },
+
+ //CSS3 Selectors
+ _functional_pseudo: function(){
+ /*
+ * functional_pseudo
+ * : FUNCTION S* expression ')'
+ * ;
+ */
+
+ 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;
+ },
+
+ //CSS3 Selectors
+ _expression: function(){
+ /*
+ * expression
+ * : [ [ PLUS | '-' | DIMENSION | NUMBER | STRING | IDENT ] S* ]+
+ * ;
+ */
+
+ 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;
+
+ },
+
+ //CSS3 Selectors
+ _negation: function(){
+ /*
+ * negation
+ * : NOT S* negation_arg S* ')'
+ * ;
+ */
+
+ 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;
+ },
+
+ //CSS3 Selectors
+ _negation_arg: function(){
+ /*
+ * negation_arg
+ * : type_selector | universal | HASH | class | attrib | pseudo
+ * ;
+ */
+
+ 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++;
+ }
+
+ //must be a negation arg
+ if (arg === null){
+ this._unexpectedToken(tokenStream.LT(1));
+ }
+
+ //it's an element name
+ 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(){
+
+ /*
+ * declaration
+ * : property ':' S* expr prio?
+ * | /( empty )/
+ * ;
+ */
+
+ var tokenStream = this._tokenStream,
+ property = null,
+ expr = null,
+ prio = null,
+ error = null,
+ invalid = null;
+
+ property = this._property();
+ if (property !== null){
+
+ tokenStream.mustMatch(Tokens.COLON);
+ this._readWhitespace();
+
+ expr = this._expr();
+
+ //if there's no parts for the value, it's an error
+ if (!expr || expr.length === 0){
+ this._unexpectedToken(tokenStream.LT(1));
+ }
+
+ prio = this._prio();
+
+ try {
+ this._validateProperty(property, 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(){
+ /*
+ * prio
+ * : IMPORTANT_SYM S*
+ * ;
+ */
+
+ var tokenStream = this._tokenStream,
+ result = tokenStream.match(Tokens.IMPORTANT_SYM);
+
+ this._readWhitespace();
+ return result;
+ },
+
+ _expr: function(){
+ /*
+ * expr
+ * : term [ operator term ]*
+ * ;
+ */
+
+ var tokenStream = this._tokenStream,
+ values = [],
+ //valueParts = [],
+ value = null,
+ operator = null;
+
+ value = this._term();
+ if (value !== null){
+
+ values.push(value);
+
+ do {
+ operator = this._operator();
+
+ //if there's an operator, keep building up the value parts
+ if (operator){
+ values.push(operator);
+ } /*else {
+ //if there's not an operator, you have a full value
+ 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);
+ }
+
+ //cleanup
+ /*if (valueParts.length){
+ values.push(new PropertyValue(valueParts, valueParts[0].line, valueParts[0].col));
+ }*/
+
+ return values.length > 0 ? new PropertyValue(values, values[0].line, values[0].col) : null;
+ },
+
+ _term: function(){
+
+ /*
+ * term
+ * : unary_operator?
+ * [ NUMBER S* | PERCENTAGE S* | LENGTH S* | ANGLE S* |
+ * TIME S* | FREQ S* | function | ie_function ]
+ * | STRING S* | IDENT S* | URI S* | UNICODERANGE S* | hexcolor
+ * ;
+ */
+
+ var tokenStream = this._tokenStream,
+ unary = null,
+ value = null,
+ token,
+ line,
+ col;
+
+ //returns the operator or null
+ unary = this._unary_operator();
+ if (unary !== null){
+ line = tokenStream.token().startLine;
+ col = tokenStream.token().startCol;
+ }
+
+ //exception for IE filters
+ if (tokenStream.peek() == Tokens.IE_FUNCTION && this.options.ieFilters){
+
+ value = this._ie_function();
+ if (unary === null){
+ line = tokenStream.token().startLine;
+ col = tokenStream.token().startCol;
+ }
+
+ //see if there's a simple match
+ } 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 {
+
+ //see if it's a color
+ token = this._hexcolor();
+ if (token === null){
+
+ //if there's no unary, get the start of the next token for line/col info
+ if (unary === null){
+ line = tokenStream.LT(1).startLine;
+ col = tokenStream.LT(1).startCol;
+ }
+
+ //has to be a function
+ if (value === null){
+
+ /*
+ * This checks for alpha(opacity=0) style of IE
+ * functions. IE_FUNCTION only presents progid: style.
+ */
+ if (tokenStream.LA(3) == Tokens.EQUALS && this.options.ieFilters){
+ value = this._ie_function();
+ } else {
+ value = this._function();
+ }
+ }
+
+ /*if (value === null){
+ return null;
+ //throw new Error("Expected identifier at line " + tokenStream.token().startLine + ", character " + tokenStream.token().startCol + ".");
+ }*/
+
+ } 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(){
+
+ /*
+ * function
+ * : FUNCTION S* expr ')' S*
+ * ;
+ */
+
+ 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;
+
+ //START: Horrible hack in case it's an IE filter
+ if (this.options.ieFilters && tokenStream.peek() == Tokens.EQUALS){
+ do {
+
+ if (this._readWhitespace()){
+ functionText += tokenStream.token().value;
+ }
+
+ //might be second time in the loop
+ 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;
+
+ //functionText += this._term();
+ 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]));
+ }
+
+ //END: Horrible Hack
+
+ tokenStream.match(Tokens.RPAREN);
+ functionText += ")";
+ this._readWhitespace();
+ }
+
+ return functionText;
+ },
+
+ _ie_function: function(){
+
+ /* (My own extension)
+ * ie_function
+ * : IE_FUNCTION S* IDENT '=' term [S* ','? IDENT '=' term]+ ')' S*
+ * ;
+ */
+
+ var tokenStream = this._tokenStream,
+ functionText = null,
+ expr = null,
+ lt;
+
+ //IE function can begin like a regular function, too
+ if (tokenStream.match([Tokens.IE_FUNCTION, Tokens.FUNCTION])){
+ functionText = tokenStream.token().value;
+
+ do {
+
+ if (this._readWhitespace()){
+ functionText += tokenStream.token().value;
+ }
+
+ //might be second time in the loop
+ 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;
+
+ //functionText += this._term();
+ 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(){
+ /*
+ * There is a constraint on the color that it must
+ * have either 3 or 6 hex-digits (i.e., [0-9a-fA-F])
+ * after the "#"; e.g., "#000" is OK, but "#abcd" is not.
+ *
+ * hexcolor
+ * : HASH S*
+ * ;
+ */
+
+ var tokenStream = this._tokenStream,
+ token = null,
+ color;
+
+ if(tokenStream.match(Tokens.HASH)){
+
+ //need to do some validation here
+
+ 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;
+ },
+
+ //-----------------------------------------------------------------
+ // Animations methods
+ //-----------------------------------------------------------------
+
+ _keyframes: function(){
+
+ /*
+ * keyframes:
+ * : KEYFRAMES_SYM S* keyframe_name S* '{' S* keyframe_rule* '}' {
+ * ;
+ */
+ var tokenStream = this._tokenStream,
+ token,
+ tt,
+ name;
+
+ tokenStream.mustMatch(Tokens.KEYFRAMES_SYM);
+ this._readWhitespace();
+ name = this._keyframe_name();
+
+ this._readWhitespace();
+ tokenStream.mustMatch(Tokens.LBRACE);
+
+ this.fire({
+ type: "startkeyframes",
+ name: name,
+ line: name.line,
+ col: name.col
+ });
+
+ this._readWhitespace();
+ tt = tokenStream.peek();
+
+ //check for key
+ while(tt == Tokens.IDENT || tt == Tokens.PERCENTAGE) {
+ this._keyframe_rule();
+ this._readWhitespace();
+ tt = tokenStream.peek();
+ }
+
+ this.fire({
+ type: "endkeyframes",
+ name: name,
+ line: name.line,
+ col: name.col
+ });
+
+ this._readWhitespace();
+ tokenStream.mustMatch(Tokens.RBRACE);
+
+ },
+
+ _keyframe_name: function(){
+
+ /*
+ * keyframe_name:
+ * : IDENT
+ * | STRING
+ * ;
+ */
+ var tokenStream = this._tokenStream,
+ token;
+
+ tokenStream.mustMatch([Tokens.IDENT, Tokens.STRING]);
+ return SyntaxUnit.fromToken(tokenStream.token());
+ },
+
+ _keyframe_rule: function(){
+
+ /*
+ * keyframe_rule:
+ * : key_list S*
+ * '{' S* declaration [ ';' S* declaration ]* '}' S*
+ * ;
+ */
+ 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(){
+
+ /*
+ * key_list:
+ * : key [ S* ',' S* key]*
+ * ;
+ */
+ var tokenStream = this._tokenStream,
+ token,
+ key,
+ keyList = [];
+
+ //must be least one key
+ keyList.push(this._key());
+
+ this._readWhitespace();
+
+ while(tokenStream.match(Tokens.COMMA)){
+ this._readWhitespace();
+ keyList.push(this._key());
+ this._readWhitespace();
+ }
+
+ return keyList;
+ },
+
+ _key: function(){
+ /*
+ * There is a restriction that IDENT can be only "from" or "to".
+ *
+ * key
+ * : PERCENTAGE
+ * | IDENT
+ * ;
+ */
+
+ 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();
+ }
+
+ //if it gets here, there wasn't a valid token, so time to explode
+ this._unexpectedToken(tokenStream.LT(1));
+ },
+
+ //-----------------------------------------------------------------
+ // Helper methods
+ //-----------------------------------------------------------------
+
+ /**
+ * Not part of CSS grammar, but useful for skipping over
+ * combination of white space and HTML-style comments.
+ * @return {void}
+ * @method _skipCruft
+ * @private
+ */
+ _skipCruft: function(){
+ while(this._tokenStream.match([Tokens.S, Tokens.CDO, Tokens.CDC])){
+ //noop
+ }
+ },
+
+ /**
+ * Not part of CSS grammar, but this pattern occurs frequently
+ * in the official CSS grammar. Split out here to eliminate
+ * duplicate code.
+ * @param {Boolean} checkStart Indicates if the rule should check
+ * for the left brace at the beginning.
+ * @param {Boolean} readMargins Indicates if the rule should check
+ * for margin patterns.
+ * @return {void}
+ * @method _readDeclarations
+ * @private
+ */
+ _readDeclarations: function(checkStart, readMargins){
+ /*
+ * Reads the pattern
+ * S* '{' S* declaration [ ';' S* declaration ]* '}' S*
+ * or
+ * S* '{' S* [ declaration | margin ]? [ ';' S* [ declaration | margin ]? ]* '}' S*
+ * Note that this is how it is described in CSS3 Paged Media, but is actually incorrect.
+ * A semicolon is only necessary following a delcaration is there's another declaration
+ * or margin afterwards.
+ */
+ 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())){
+ //noop
+ } else if (this._declaration()){
+ if (!tokenStream.match(Tokens.SEMICOLON)){
+ break;
+ }
+ } else {
+ break;
+ }
+
+ //if ((!this._margin() && !this._declaration()) || !tokenStream.match(Tokens.SEMICOLON)){
+ // break;
+ //}
+ this._readWhitespace();
+ }
+
+ tokenStream.mustMatch(Tokens.RBRACE);
+ this._readWhitespace();
+
+ } catch (ex) {
+ if (ex instanceof SyntaxError && !this.options.strict){
+
+ //fire error event
+ this.fire({
+ type: "error",
+ error: ex,
+ message: ex.message,
+ line: ex.line,
+ col: ex.col
+ });
+
+ //see if there's another declaration
+ tt = tokenStream.advance([Tokens.SEMICOLON, Tokens.RBRACE]);
+ if (tt == Tokens.SEMICOLON){
+ //if there's a semicolon, then there might be another declaration
+ this._readDeclarations(false, readMargins);
+ } else if (tt != Tokens.RBRACE){
+ //if there's a right brace, the rule is finished so don't do anything
+ //otherwise, rethrow the error because it wasn't handled properly
+ throw ex;
+ }
+
+ } else {
+ //not a syntax error, rethrow it
+ throw ex;
+ }
+ }
+
+ },
+
+ /**
+ * In some cases, you can end up with two white space tokens in a
+ * row. Instead of making a change in every function that looks for
+ * white space, this function is used to match as much white space
+ * as necessary.
+ * @method _readWhitespace
+ * @return {String} The white space if found, empty string if not.
+ * @private
+ */
+ _readWhitespace: function(){
+
+ var tokenStream = this._tokenStream,
+ ws = "";
+
+ while(tokenStream.match(Tokens.S)){
+ ws += tokenStream.token().value;
+ }
+
+ return ws;
+ },
+
+
+ /**
+ * Throws an error when an unexpected token is found.
+ * @param {Object} token The token that was found.
+ * @method _unexpectedToken
+ * @return {void}
+ * @private
+ */
+ _unexpectedToken: function(token){
+ throw new SyntaxError("Unexpected token '" + token.value + "' at line " + token.startLine + ", col " + token.startCol + ".", token.startLine, token.startCol);
+ },
+
+ /**
+ * Helper method used for parsing subparts of a style sheet.
+ * @return {void}
+ * @method _verifyEnd
+ * @private
+ */
+ _verifyEnd: function(){
+ if (this._tokenStream.LA(1) != Tokens.EOF){
+ this._unexpectedToken(this._tokenStream.LT(1));
+ }
+ },
+
+ //-----------------------------------------------------------------
+ // Validation methods
+ //-----------------------------------------------------------------
+ _validateProperty: function(property, value){
+ Validation.validate(property, value);
+ },
+
+ //-----------------------------------------------------------------
+ // Parsing methods
+ //-----------------------------------------------------------------
+
+ parse: function(input){
+ this._tokenStream = new TokenStream(input, Tokens);
+ this._stylesheet();
+ },
+
+ parseStyleSheet: function(input){
+ //just passthrough
+ return this.parse(input);
+ },
+
+ parseMediaQuery: function(input){
+ this._tokenStream = new TokenStream(input, Tokens);
+ var result = this._media_query();
+
+ //if there's anything more, then it's an invalid selector
+ this._verifyEnd();
+
+ //otherwise return result
+ return result;
+ },
+
+ /**
+ * Parses a property value (everything after the semicolon).
+ * @return {parserlib.css.PropertyValue} The property value.
+ * @throws parserlib.util.SyntaxError If an unexpected token is found.
+ * @method parserPropertyValue
+ */
+ parsePropertyValue: function(input){
+
+ this._tokenStream = new TokenStream(input, Tokens);
+ this._readWhitespace();
+
+ var result = this._expr();
+
+ //okay to have a trailing white space
+ this._readWhitespace();
+
+ //if there's anything more, then it's an invalid selector
+ this._verifyEnd();
+
+ //otherwise return result
+ return result;
+ },
+
+ /**
+ * Parses a complete CSS rule, including selectors and
+ * properties.
+ * @param {String} input The text to parser.
+ * @return {Boolean} True if the parse completed successfully, false if not.
+ * @method parseRule
+ */
+ parseRule: function(input){
+ this._tokenStream = new TokenStream(input, Tokens);
+
+ //skip any leading white space
+ this._readWhitespace();
+
+ var result = this._ruleset();
+
+ //skip any trailing white space
+ this._readWhitespace();
+
+ //if there's anything more, then it's an invalid selector
+ this._verifyEnd();
+
+ //otherwise return result
+ return result;
+ },
+
+ /**
+ * Parses a single CSS selector (no comma)
+ * @param {String} input The text to parse as a CSS selector.
+ * @return {Selector} An object representing the selector.
+ * @throws parserlib.util.SyntaxError If an unexpected token is found.
+ * @method parseSelector
+ */
+ parseSelector: function(input){
+
+ this._tokenStream = new TokenStream(input, Tokens);
+
+ //skip any leading white space
+ this._readWhitespace();
+
+ var result = this._selector();
+
+ //skip any trailing white space
+ this._readWhitespace();
+
+ //if there's anything more, then it's an invalid selector
+ this._verifyEnd();
+
+ //otherwise return result
+ return result;
+ },
+
+ /**
+ * Parses an HTML style attribute: a set of CSS declarations
+ * separated by semicolons.
+ * @param {String} input The text to parse as a style attribute
+ * @return {void}
+ * @method parseStyleAttribute
+ */
+ parseStyleAttribute: function(input){
+ input += "}"; // for error recovery in _readDeclarations()
+ this._tokenStream = new TokenStream(input, Tokens);
+ this._readDeclarations();
+ }
+ };
+
+ //copy over onto prototype
+ for (prop in additions){
+ if (additions.hasOwnProperty(prop)){
+ proto[prop] = additions[prop];
+ }
+ }
+
+ return proto;
+}();
+/*global Validation, ValidationTypes, ValidationError*/
+var Properties = {
+
+ //A
+ "alignment-adjust" : "auto | baseline | before-edge | text-before-edge | middle | central | after-edge | text-after-edge | ideographic | alphabetic | hanging | mathematical | <percentage> | <length>",
+ "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: "<time>", comma: true },
+ "animation-direction" : { multi: "normal | alternate", comma: true },
+ "animation-duration" : { multi: "<time>", comma: true },
+ "animation-iteration-count" : { multi: "<number> | infinite", comma: true },
+ "animation-name" : { multi: "none | <ident>", comma: true },
+ "animation-play-state" : { multi: "running | paused", comma: true },
+ "animation-timing-function" : 1,
+
+ //vendor prefixed
+ "-moz-animation-delay" : { multi: "<time>", comma: true },
+ "-moz-animation-direction" : { multi: "normal | alternate", comma: true },
+ "-moz-animation-duration" : { multi: "<time>", comma: true },
+ "-moz-animation-iteration-count" : { multi: "<number> | infinite", comma: true },
+ "-moz-animation-name" : { multi: "none | <ident>", comma: true },
+ "-moz-animation-play-state" : { multi: "running | paused", comma: true },
+
+ "-ms-animation-delay" : { multi: "<time>", comma: true },
+ "-ms-animation-direction" : { multi: "normal | alternate", comma: true },
+ "-ms-animation-duration" : { multi: "<time>", comma: true },
+ "-ms-animation-iteration-count" : { multi: "<number> | infinite", comma: true },
+ "-ms-animation-name" : { multi: "none | <ident>", comma: true },
+ "-ms-animation-play-state" : { multi: "running | paused", comma: true },
+
+ "-webkit-animation-delay" : { multi: "<time>", comma: true },
+ "-webkit-animation-direction" : { multi: "normal | alternate", comma: true },
+ "-webkit-animation-duration" : { multi: "<time>", comma: true },
+ "-webkit-animation-iteration-count" : { multi: "<number> | infinite", comma: true },
+ "-webkit-animation-name" : { multi: "none | <ident>", comma: true },
+ "-webkit-animation-play-state" : { multi: "running | paused", comma: true },
+
+ "-o-animation-delay" : { multi: "<time>", comma: true },
+ "-o-animation-direction" : { multi: "normal | alternate", comma: true },
+ "-o-animation-duration" : { multi: "<time>", comma: true },
+ "-o-animation-iteration-count" : { multi: "<number> | infinite", comma: true },
+ "-o-animation-name" : { multi: "none | <ident>", comma: true },
+ "-o-animation-play-state" : { multi: "running | paused", comma: true },
+
+ "appearance" : "icon | window | desktop | workspace | document | tooltip | dialog | button | push-button | hyperlink | radio-button | checkbox | menu-item | tab | menu | menubar | pull-down-menu | pop-up-menu | list-menu | radio-group | checkbox-group | outline-tree | range | field | combo-box | signature | password | normal | inherit",
+ "azimuth" : function (expression) {
+ var simple = "<angle> | leftwards | rightwards | inherit",
+ direction = "left-side | far-left | left | center-left | center | center-right | right | far-right | right-side",
+ behind = false,
+ valid = false,
+ part;
+
+ if (!ValidationTypes.isAny(expression, simple)) {
+ if (ValidationTypes.isAny(expression, "behind")) {
+ behind = true;
+ valid = true;
+ }
+
+ if (ValidationTypes.isAny(expression, direction)) {
+ valid = true;
+ if (!behind) {
+ ValidationTypes.isAny(expression, "behind");
+ }
+ }
+ }
+
+ if (expression.hasNext()) {
+ part = expression.next();
+ if (valid) {
+ throw new ValidationError("Expected end of value but found '" + part + "'.", part.line, part.col);
+ } else {
+ throw new ValidationError("Expected (<'azimuth'>) but found '" + part + "'.", part.line, part.col);
+ }
+ }
+ },
+
+ //B
+ "backface-visibility" : "visible | hidden",
+ "background" : 1,
+ "background-attachment" : { multi: "<attachment>", comma: true },
+ "background-clip" : { multi: "<box>", comma: true },
+ "background-color" : "<color> | inherit",
+ "background-image" : { multi: "<bg-image>", comma: true },
+ "background-origin" : { multi: "<box>", comma: true },
+ "background-position" : { multi: "<bg-position>", comma: true },
+ "background-repeat" : { multi: "<repeat-style>" },
+ "background-size" : { multi: "<bg-size>", comma: true },
+ "baseline-shift" : "baseline | sub | super | <percentage> | <length>",
+ "binding" : 1,
+ "bleed" : "<length>",
+ "bookmark-label" : "<content> | <attr> | <string>",
+ "bookmark-level" : "none | <integer>",
+ "bookmark-state" : "open | closed",
+ "bookmark-target" : "none | <uri> | <attr>",
+ "border" : "<border-width> || <border-style> || <color>",
+ "border-bottom" : "<border-width> || <border-style> || <color>",
+ "border-bottom-color" : "<color>",
+ "border-bottom-left-radius" : "<x-one-radius>",
+ "border-bottom-right-radius" : "<x-one-radius>",
+ "border-bottom-style" : "<border-style>",
+ "border-bottom-width" : "<border-width>",
+ "border-collapse" : "collapse | separate | inherit",
+ "border-color" : { multi: "<color> | inherit", max: 4 },
+ "border-image" : 1,
+ "border-image-outset" : { multi: "<length> | <number>", max: 4 },
+ "border-image-repeat" : { multi: "stretch | repeat | round", max: 2 },
+ "border-image-slice" : function(expression) {
+
+ var valid = false,
+ numeric = "<number> | <percentage>",
+ fill = false,
+ count = 0,
+ max = 4,
+ part;
+
+ if (ValidationTypes.isAny(expression, "fill")) {
+ fill = true;
+ valid = true;
+ }
+
+ while (expression.hasNext() && count < max) {
+ valid = ValidationTypes.isAny(expression, numeric);
+ if (!valid) {
+ break;
+ }
+ count++;
+ }
+
+
+ if (!fill) {
+ ValidationTypes.isAny(expression, "fill");
+ } else {
+ valid = true;
+ }
+
+ if (expression.hasNext()) {
+ part = expression.next();
+ if (valid) {
+ throw new ValidationError("Expected end of value but found '" + part + "'.", part.line, part.col);
+ } else {
+ throw new ValidationError("Expected ([<number> | <percentage>]{1,4} && fill?) but found '" + part + "'.", part.line, part.col);
+ }
+ }
+ },
+ "border-image-source" : "<image> | none",
+ "border-image-width" : { multi: "<length> | <percentage> | <number> | auto", max: 4 },
+ "border-left" : "<border-width> || <border-style> || <color>",
+ "border-left-color" : "<color> | inherit",
+ "border-left-style" : "<border-style>",
+ "border-left-width" : "<border-width>",
+ "border-radius" : function(expression) {
+
+ var valid = false,
+ numeric = "<length> | <percentage>",
+ slash = false,
+ fill = false,
+ count = 0,
+ max = 8,
+ part;
+
+ while (expression.hasNext() && count < max) {
+ valid = ValidationTypes.isAny(expression, numeric);
+ if (!valid) {
+
+ if (expression.peek() == "/" && count > 1 && !slash) {
+ slash = true;
+ max = count + 5;
+ expression.next();
+ } else {
+ break;
+ }
+ }
+ count++;
+ }
+
+ if (expression.hasNext()) {
+ part = expression.next();
+ if (valid) {
+ throw new ValidationError("Expected end of value but found '" + part + "'.", part.line, part.col);
+ } else {
+ throw new ValidationError("Expected (<'border-radius'>) but found '" + part + "'.", part.line, part.col);
+ }
+ }
+ },
+ "border-right" : "<border-width> || <border-style> || <color>",
+ "border-right-color" : "<color> | inherit",
+ "border-right-style" : "<border-style>",
+ "border-right-width" : "<border-width>",
+ "border-spacing" : { multi: "<length> | inherit", max: 2 },
+ "border-style" : { multi: "<border-style>", max: 4 },
+ "border-top" : "<border-width> || <border-style> || <color>",
+ "border-top-color" : "<color> | inherit",
+ "border-top-left-radius" : "<x-one-radius>",
+ "border-top-right-radius" : "<x-one-radius>",
+ "border-top-style" : "<border-style>",
+ "border-top-width" : "<border-width>",
+ "border-width" : { multi: "<border-width>", max: 4 },
+ "bottom" : "<margin-width> | inherit",
+ "box-align" : "start | end | center | baseline | stretch", //http://www.w3.org/TR/2009/WD-css3-flexbox-20090723/
+ "box-decoration-break" : "slice |clone",
+ "box-direction" : "normal | reverse | inherit",
+ "box-flex" : "<number>",
+ "box-flex-group" : "<integer>",
+ "box-lines" : "single | multiple",
+ "box-ordinal-group" : "<integer>",
+ "box-orient" : "horizontal | vertical | inline-axis | block-axis | inherit",
+ "box-pack" : "start | end | center | justify",
+ "box-shadow" : function (expression) {
+ var result = false,
+ part;
+
+ if (!ValidationTypes.isAny(expression, "none")) {
+ Validation.multiProperty("<shadow>", expression, true, Infinity);
+ } else {
+ if (expression.hasNext()) {
+ part = expression.next();
+ throw new ValidationError("Expected end of value but found '" + part + "'.", part.line, part.col);
+ }
+ }
+ },
+ "box-sizing" : "content-box | border-box | inherit",
+ "break-after" : "auto | always | avoid | left | right | page | column | avoid-page | avoid-column",
+ "break-before" : "auto | always | avoid | left | right | page | column | avoid-page | avoid-column",
+ "break-inside" : "auto | avoid | avoid-page | avoid-column",
+
+ //C
+ "caption-side" : "top | bottom | inherit",
+ "clear" : "none | right | left | both | inherit",
+ "clip" : 1,
+ "color" : "<color> | inherit",
+ "color-profile" : 1,
+ "column-count" : "<integer> | auto", //http://www.w3.org/TR/css3-multicol/
+ "column-fill" : "auto | balance",
+ "column-gap" : "<length> | normal",
+ "column-rule" : "<border-width> || <border-style> || <color>",
+ "column-rule-color" : "<color>",
+ "column-rule-style" : "<border-style>",
+ "column-rule-width" : "<border-width>",
+ "column-span" : "none | all",
+ "column-width" : "<length> | auto",
+ "columns" : 1,
+ "content" : 1,
+ "counter-increment" : 1,
+ "counter-reset" : 1,
+ "crop" : "<shape> | auto",
+ "cue" : "cue-after | cue-before | inherit",
+ "cue-after" : 1,
+ "cue-before" : 1,
+ "cursor" : 1,
+
+ //D
+ "direction" : "ltr | rtl | inherit",
+ "display" : "inline | block | list-item | inline-block | table | inline-table | table-row-group | table-header-group | table-footer-group | table-row | table-column-group | table-column | table-cell | table-caption | box | inline-box | grid | inline-grid | none | inherit",
+ "dominant-baseline" : 1,
+ "drop-initial-after-adjust" : "central | middle | after-edge | text-after-edge | ideographic | alphabetic | mathematical | <percentage> | <length>",
+ "drop-initial-after-align" : "baseline | use-script | before-edge | text-before-edge | after-edge | text-after-edge | central | middle | ideographic | alphabetic | hanging | mathematical",
+ "drop-initial-before-adjust" : "before-edge | text-before-edge | central | middle | hanging | mathematical | <percentage> | <length>",
+ "drop-initial-before-align" : "caps-height | baseline | use-script | before-edge | text-before-edge | after-edge | text-after-edge | central | middle | ideographic | alphabetic | hanging | mathematical",
+ "drop-initial-size" : "auto | line | <length> | <percentage>",
+ "drop-initial-value" : "initial | <integer>",
+
+ //E
+ "elevation" : "<angle> | below | level | above | higher | lower | inherit",
+ "empty-cells" : "show | hide | inherit",
+
+ //F
+ "filter" : 1,
+ "fit" : "fill | hidden | meet | slice",
+ "fit-position" : 1,
+ "float" : "left | right | none | inherit",
+ "float-offset" : 1,
+ "font" : 1,
+ "font-family" : 1,
+ "font-size" : "<absolute-size> | <relative-size> | <length> | <percentage> | inherit",
+ "font-size-adjust" : "<number> | none | inherit",
+ "font-stretch" : "normal | ultra-condensed | extra-condensed | condensed | semi-condensed | semi-expanded | expanded | extra-expanded | ultra-expanded | inherit",
+ "font-style" : "normal | italic | oblique | inherit",
+ "font-variant" : "normal | small-caps | inherit",
+ "font-weight" : "normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | inherit",
+
+ //G
+ "grid-cell-stacking" : "columns | rows | layer",
+ "grid-column" : 1,
+ "grid-columns" : 1,
+ "grid-column-align" : "start | end | center | stretch",
+ "grid-column-sizing" : 1,
+ "grid-column-span" : "<integer>",
+ "grid-flow" : "none | rows | columns",
+ "grid-layer" : "<integer>",
+ "grid-row" : 1,
+ "grid-rows" : 1,
+ "grid-row-align" : "start | end | center | stretch",
+ "grid-row-span" : "<integer>",
+ "grid-row-sizing" : 1,
+
+ //H
+ "hanging-punctuation" : 1,
+ "height" : "<margin-width> | inherit",
+ "hyphenate-after" : "<integer> | auto",
+ "hyphenate-before" : "<integer> | auto",
+ "hyphenate-character" : "<string> | auto",
+ "hyphenate-lines" : "no-limit | <integer>",
+ "hyphenate-resource" : 1,
+ "hyphens" : "none | manual | auto",
+
+ //I
+ "icon" : 1,
+ "image-orientation" : "angle | auto",
+ "image-rendering" : 1,
+ "image-resolution" : 1,
+ "inline-box-align" : "initial | last | <integer>",
+
+ //L
+ "left" : "<margin-width> | inherit",
+ "letter-spacing" : "<length> | normal | inherit",
+ "line-height" : "<number> | <length> | <percentage> | normal | inherit",
+ "line-break" : "auto | loose | normal | strict",
+ "line-stacking" : 1,
+ "line-stacking-ruby" : "exclude-ruby | include-ruby",
+ "line-stacking-shift" : "consider-shifts | disregard-shifts",
+ "line-stacking-strategy" : "inline-line-height | block-line-height | max-height | grid-height",
+ "list-style" : 1,
+ "list-style-image" : "<uri> | none | inherit",
+ "list-style-position" : "inside | outside | inherit",
+ "list-style-type" : "disc | circle | square | decimal | decimal-leading-zero | lower-roman | upper-roman | lower-greek | lower-latin | upper-latin | armenian | georgian | lower-alpha | upper-alpha | none | inherit",
+
+ //M
+ "margin" : { multi: "<margin-width> | inherit", max: 4 },
+ "margin-bottom" : "<margin-width> | inherit",
+ "margin-left" : "<margin-width> | inherit",
+ "margin-right" : "<margin-width> | inherit",
+ "margin-top" : "<margin-width> | inherit",
+ "mark" : 1,
+ "mark-after" : 1,
+ "mark-before" : 1,
+ "marks" : 1,
+ "marquee-direction" : 1,
+ "marquee-play-count" : 1,
+ "marquee-speed" : 1,
+ "marquee-style" : 1,
+ "max-height" : "<length> | <percentage> | none | inherit",
+ "max-width" : "<length> | <percentage> | none | inherit",
+ "min-height" : "<length> | <percentage> | inherit",
+ "min-width" : "<length> | <percentage> | inherit",
+ "move-to" : 1,
+
+ //N
+ "nav-down" : 1,
+ "nav-index" : 1,
+ "nav-left" : 1,
+ "nav-right" : 1,
+ "nav-up" : 1,
+
+ //O
+ "opacity" : "<number> | inherit",
+ "orphans" : "<integer> | inherit",
+ "outline" : 1,
+ "outline-color" : "<color> | invert | inherit",
+ "outline-offset" : 1,
+ "outline-style" : "<border-style> | inherit",
+ "outline-width" : "<border-width> | inherit",
+ "overflow" : "visible | hidden | scroll | auto | inherit",
+ "overflow-style" : 1,
+ "overflow-x" : 1,
+ "overflow-y" : 1,
+
+ //P
+ "padding" : { multi: "<padding-width> | inherit", max: 4 },
+ "padding-bottom" : "<padding-width> | inherit",
+ "padding-left" : "<padding-width> | inherit",
+ "padding-right" : "<padding-width> | inherit",
+ "padding-top" : "<padding-width> | inherit",
+ "page" : 1,
+ "page-break-after" : "auto | always | avoid | left | right | inherit",
+ "page-break-before" : "auto | always | avoid | left | right | inherit",
+ "page-break-inside" : "auto | avoid | inherit",
+ "page-policy" : 1,
+ "pause" : 1,
+ "pause-after" : 1,
+ "pause-before" : 1,
+ "perspective" : 1,
+ "perspective-origin" : 1,
+ "phonemes" : 1,
+ "pitch" : 1,
+ "pitch-range" : 1,
+ "play-during" : 1,
+ "position" : "static | relative | absolute | fixed | inherit",
+ "presentation-level" : 1,
+ "punctuation-trim" : 1,
+
+ //Q
+ "quotes" : 1,
+
+ //R
+ "rendering-intent" : 1,
+ "resize" : 1,
+ "rest" : 1,
+ "rest-after" : 1,
+ "rest-before" : 1,
+ "richness" : 1,
+ "right" : "<margin-width> | inherit",
+ "rotation" : 1,
+ "rotation-point" : 1,
+ "ruby-align" : 1,
+ "ruby-overhang" : 1,
+ "ruby-position" : 1,
+ "ruby-span" : 1,
+
+ //S
+ "size" : 1,
+ "speak" : "normal | none | spell-out | inherit",
+ "speak-header" : "once | always | inherit",
+ "speak-numeral" : "digits | continuous | inherit",
+ "speak-punctuation" : "code | none | inherit",
+ "speech-rate" : 1,
+ "src" : 1,
+ "stress" : 1,
+ "string-set" : 1,
+
+ "table-layout" : "auto | fixed | inherit",
+ "tab-size" : "<integer> | <length>",
+ "target" : 1,
+ "target-name" : 1,
+ "target-new" : 1,
+ "target-position" : 1,
+ "text-align" : "left | right | center | justify | inherit" ,
+ "text-align-last" : 1,
+ "text-decoration" : 1,
+ "text-emphasis" : 1,
+ "text-height" : 1,
+ "text-indent" : "<length> | <percentage> | inherit",
+ "text-justify" : "auto | none | inter-word | inter-ideograph | inter-cluster | distribute | kashida",
+ "text-outline" : 1,
+ "text-overflow" : 1,
+ "text-shadow" : 1,
+ "text-transform" : "capitalize | uppercase | lowercase | none | inherit",
+ "text-wrap" : "normal | none | avoid",
+ "top" : "<margin-width> | inherit",
+ "transform" : 1,
+ "transform-origin" : 1,
+ "transform-style" : 1,
+ "transition" : 1,
+ "transition-delay" : 1,
+ "transition-duration" : 1,
+ "transition-property" : 1,
+ "transition-timing-function" : 1,
+
+ //U
+ "unicode-bidi" : "normal | embed | bidi-override | inherit",
+ "user-modify" : "read-only | read-write | write-only | inherit",
+ "user-select" : "none | text | toggle | element | elements | all | inherit",
+
+ //V
+ "vertical-align" : "<percentage> | <length> | baseline | sub | super | top | text-top | middle | bottom | text-bottom | inherit",
+ "visibility" : "visible | hidden | collapse | inherit",
+ "voice-balance" : 1,
+ "voice-duration" : 1,
+ "voice-family" : 1,
+ "voice-pitch" : 1,
+ "voice-pitch-range" : 1,
+ "voice-rate" : 1,
+ "voice-stress" : 1,
+ "voice-volume" : 1,
+ "volume" : 1,
+
+ //W
+ "white-space" : "normal | pre | nowrap | pre-wrap | pre-line | inherit",
+ "white-space-collapse" : 1,
+ "widows" : "<integer> | inherit",
+ "width" : "<length> | <percentage> | auto | inherit" ,
+ "word-break" : "normal | keep-all | break-all",
+ "word-spacing" : "<length> | normal | inherit",
+ "word-wrap" : 1,
+
+ //Z
+ "z-index" : "<integer> | auto | inherit",
+ "zoom" : "<number> | <percentage> | normal"
+};
+/**
+ * Represents a selector combinator (whitespace, +, >).
+ * @namespace parserlib.css
+ * @class PropertyName
+ * @extends parserlib.util.SyntaxUnit
+ * @constructor
+ * @param {String} text The text representation of the unit.
+ * @param {String} hack The type of IE hack applied ("*", "_", or null).
+ * @param {int} line The line of text on which the unit resides.
+ * @param {int} col The column of text on which the unit resides.
+ */
+function PropertyName(text, hack, line, col){
+
+ SyntaxUnit.call(this, text, line, col, Parser.PROPERTY_NAME_TYPE);
+ this.hack = hack;
+
+}
+
+PropertyName.prototype = new SyntaxUnit();
+PropertyName.prototype.constructor = PropertyName;
+PropertyName.prototype.toString = function(){
+ return (this.hack ? this.hack : "") + this.text;
+};
+/**
+ * Represents a single part of a CSS property value, meaning that it represents
+ * just everything single part between ":" and ";". If there are multiple values
+ * separated by commas, this type represents just one of the values.
+ * @param {String[]} parts An array of value parts making up this value.
+ * @param {int} line The line of text on which the unit resides.
+ * @param {int} col The column of text on which the unit resides.
+ * @namespace parserlib.css
+ * @class PropertyValue
+ * @extends parserlib.util.SyntaxUnit
+ * @constructor
+ */
+function PropertyValue(parts, line, col){
+
+ SyntaxUnit.call(this, parts.join(" "), line, col, Parser.PROPERTY_VALUE_TYPE);
+ this.parts = parts;
+
+}
+
+PropertyValue.prototype = new SyntaxUnit();
+PropertyValue.prototype.constructor = PropertyValue;
+/**
+ * A utility class that allows for easy iteration over the various parts of a
+ * property value.
+ * @param {parserlib.css.PropertyValue} value The property value to iterate over.
+ * @namespace parserlib.css
+ * @class PropertyValueIterator
+ * @constructor
+ */
+function PropertyValueIterator(value){
+
+ /**
+ * Iterator value
+ * @type int
+ * @property _i
+ * @private
+ */
+ this._i = 0;
+ this._parts = value.parts;
+ this._marks = [];
+ this.value = value;
+
+}
+
+/**
+ * Returns the total number of parts in the value.
+ * @return {int} The total number of parts in the value.
+ * @method count
+ */
+PropertyValueIterator.prototype.count = function(){
+ return this._parts.length;
+};
+PropertyValueIterator.prototype.isFirst = function(){
+ return this._i === 0;
+};
+PropertyValueIterator.prototype.hasNext = function(){
+ return (this._i < this._parts.length);
+};
+PropertyValueIterator.prototype.mark = function(){
+ this._marks.push(this._i);
+};
+PropertyValueIterator.prototype.peek = function(count){
+ return this.hasNext() ? this._parts[this._i + (count || 0)] : null;
+};
+PropertyValueIterator.prototype.next = function(){
+ return this.hasNext() ? this._parts[this._i++] : null;
+};
+PropertyValueIterator.prototype.previous = function(){
+ return this._i > 0 ? this._parts[--this._i] : null;
+};
+PropertyValueIterator.prototype.restore = function(){
+ if (this._marks.length){
+ this._i = this._marks.pop();
+ }
+};
+/**
+ * Represents a single part of a CSS property value, meaning that it represents
+ * just one part of the data between ":" and ";".
+ * @param {String} text The text representation of the unit.
+ * @param {int} line The line of text on which the unit resides.
+ * @param {int} col The column of text on which the unit resides.
+ * @namespace parserlib.css
+ * @class PropertyValuePart
+ * @extends parserlib.util.SyntaxUnit
+ * @constructor
+ */
+function PropertyValuePart(text, line, col){
+
+ SyntaxUnit.call(this, text, line, col, Parser.PROPERTY_VALUE_PART_TYPE);
+ this.type = "unknown";
+
+ //figure out what type of data it is
+
+ var temp;
+
+ //it is a measurement?
+ if (/^([+\-]?[\d\.]+)([a-z]+)$/i.test(text)){ //dimension
+ this.type = "dimension";
+ this.value = +RegExp.$1;
+ this.units = RegExp.$2;
+
+ //try to narrow down
+ switch(this.units.toLowerCase()){
+
+ case "em":
+ case "rem":
+ case "ex":
+ case "px":
+ case "cm":
+ case "mm":
+ case "in":
+ case "pt":
+ case "pc":
+ case "ch":
+ this.type = "length";
+ break;
+
+ case "deg":
+ case "rad":
+ case "grad":
+ this.type = "angle";
+ break;
+
+ case "ms":
+ case "s":
+ this.type = "time";
+ break;
+
+ case "hz":
+ case "khz":
+ this.type = "frequency";
+ break;
+
+ case "dpi":
+ case "dpcm":
+ this.type = "resolution";
+ break;
+
+ //default
+
+ }
+
+ } else if (/^([+\-]?[\d\.]+)%$/i.test(text)){ //percentage
+ this.type = "percentage";
+ this.value = +RegExp.$1;
+ } else if (/^([+\-]?[\d\.]+)%$/i.test(text)){ //percentage
+ this.type = "percentage";
+ this.value = +RegExp.$1;
+ } else if (/^([+\-]?\d+)$/i.test(text)){ //integer
+ this.type = "integer";
+ this.value = +RegExp.$1;
+ } else if (/^([+\-]?[\d\.]+)$/i.test(text)){ //number
+ this.type = "number";
+ this.value = +RegExp.$1;
+
+ } else if (/^#([a-f0-9]{3,6})/i.test(text)){ //hexcolor
+ this.type = "color";
+ temp = RegExp.$1;
+ if (temp.length == 3){
+ this.red = parseInt(temp.charAt(0)+temp.charAt(0),16);
+ this.green = parseInt(temp.charAt(1)+temp.charAt(1),16);
+ this.blue = parseInt(temp.charAt(2)+temp.charAt(2),16);
+ } else {
+ this.red = parseInt(temp.substring(0,2),16);
+ this.green = parseInt(temp.substring(2,4),16);
+ this.blue = parseInt(temp.substring(4,6),16);
+ }
+ } else if (/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i.test(text)){ //rgb() color with absolute numbers
+ this.type = "color";
+ this.red = +RegExp.$1;
+ this.green = +RegExp.$2;
+ this.blue = +RegExp.$3;
+ } else if (/^rgb\(\s*(\d+)%\s*,\s*(\d+)%\s*,\s*(\d+)%\s*\)/i.test(text)){ //rgb() color with percentages
+ this.type = "color";
+ this.red = +RegExp.$1 * 255 / 100;
+ this.green = +RegExp.$2 * 255 / 100;
+ this.blue = +RegExp.$3 * 255 / 100;
+ } else if (/^rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d\.]+)\s*\)/i.test(text)){ //rgba() color with absolute numbers
+ this.type = "color";
+ this.red = +RegExp.$1;
+ this.green = +RegExp.$2;
+ this.blue = +RegExp.$3;
+ this.alpha = +RegExp.$4;
+ } else if (/^rgba\(\s*(\d+)%\s*,\s*(\d+)%\s*,\s*(\d+)%\s*,\s*([\d\.]+)\s*\)/i.test(text)){ //rgba() color with percentages
+ this.type = "color";
+ this.red = +RegExp.$1 * 255 / 100;
+ this.green = +RegExp.$2 * 255 / 100;
+ this.blue = +RegExp.$3 * 255 / 100;
+ this.alpha = +RegExp.$4;
+ } else if (/^hsl\(\s*(\d+)\s*,\s*(\d+)%\s*,\s*(\d+)%\s*\)/i.test(text)){ //hsl()
+ this.type = "color";
+ this.hue = +RegExp.$1;
+ this.saturation = +RegExp.$2 / 100;
+ this.lightness = +RegExp.$3 / 100;
+ } else if (/^hsla\(\s*(\d+)\s*,\s*(\d+)%\s*,\s*(\d+)%\s*,\s*([\d\.]+)\s*\)/i.test(text)){ //hsla() color with percentages
+ this.type = "color";
+ this.hue = +RegExp.$1;
+ this.saturation = +RegExp.$2 / 100;
+ this.lightness = +RegExp.$3 / 100;
+ this.alpha = +RegExp.$4;
+ } else if (/^url\(["']?([^\)"']+)["']?\)/i.test(text)){ //URI
+ this.type = "uri";
+ this.uri = RegExp.$1;
+ } else if (/^([^\(]+)\(/i.test(text)){
+ this.type = "function";
+ this.name = RegExp.$1;
+ this.value = text;
+ } else if (/^["'][^"']*["']/.test(text)){ //string
+ this.type = "string";
+ this.value = eval(text);
+ } else if (Colors[text.toLowerCase()]){ //named color
+ this.type = "color";
+ temp = Colors[text.toLowerCase()].substring(1);
+ this.red = parseInt(temp.substring(0,2),16);
+ this.green = parseInt(temp.substring(2,4),16);
+ this.blue = parseInt(temp.substring(4,6),16);
+ } else if (/^[\,\/]$/.test(text)){
+ this.type = "operator";
+ this.value = text;
+ } else if (/^[a-z\-\u0080-\uFFFF][a-z0-9\-\u0080-\uFFFF]*$/i.test(text)){
+ this.type = "identifier";
+ this.value = text;
+ }
+
+}
+
+PropertyValuePart.prototype = new SyntaxUnit();
+PropertyValuePart.prototype.constructor = PropertyValuePart;
+PropertyValuePart.fromToken = function(token){
+ return new PropertyValuePart(token.value, token.startLine, token.startCol);
+};
+var Pseudos = {
+ ":first-letter": 1,
+ ":first-line": 1,
+ ":before": 1,
+ ":after": 1
+};
+
+Pseudos.ELEMENT = 1;
+Pseudos.CLASS = 2;
+
+Pseudos.isElement = function(pseudo){
+ return pseudo.indexOf("::") === 0 || Pseudos[pseudo.toLowerCase()] == Pseudos.ELEMENT;
+};
+/**
+ * Represents an entire single selector, including all parts but not
+ * including multiple selectors (those separated by commas).
+ * @namespace parserlib.css
+ * @class Selector
+ * @extends parserlib.util.SyntaxUnit
+ * @constructor
+ * @param {Array} parts Array of selectors parts making up this selector.
+ * @param {int} line The line of text on which the unit resides.
+ * @param {int} col The column of text on which the unit resides.
+ */
+function Selector(parts, line, col){
+
+ SyntaxUnit.call(this, parts.join(" "), line, col, Parser.SELECTOR_TYPE);
+ this.parts = parts;
+ this.specificity = Specificity.calculate(this);
+
+}
+
+Selector.prototype = new SyntaxUnit();
+Selector.prototype.constructor = Selector;
+/**
+ * Represents a single part of a selector string, meaning a single set of
+ * element name and modifiers. This does not include combinators such as
+ * spaces, +, >, etc.
+ * @namespace parserlib.css
+ * @class SelectorPart
+ * @extends parserlib.util.SyntaxUnit
+ * @constructor
+ * @param {String} elementName The element name in the selector or null
+ * if there is no element name.
+ * @param {Array} modifiers Array of individual modifiers for the element.
+ * May be empty if there are none.
+ * @param {String} text The text representation of the unit.
+ * @param {int} line The line of text on which the unit resides.
+ * @param {int} col The column of text on which the unit resides.
+ */
+function SelectorPart(elementName, modifiers, text, line, col){
+
+ SyntaxUnit.call(this, text, line, col, Parser.SELECTOR_PART_TYPE);
+ this.elementName = elementName;
+ this.modifiers = modifiers;
+
+}
+
+SelectorPart.prototype = new SyntaxUnit();
+SelectorPart.prototype.constructor = SelectorPart;
+/**
+ * Represents a selector modifier string, meaning a class name, element name,
+ * element ID, pseudo rule, etc.
+ * @namespace parserlib.css
+ * @class SelectorSubPart
+ * @extends parserlib.util.SyntaxUnit
+ * @constructor
+ * @param {String} text The text representation of the unit.
+ * @param {String} type The type of selector modifier.
+ * @param {int} line The line of text on which the unit resides.
+ * @param {int} col The column of text on which the unit resides.
+ */
+function SelectorSubPart(text, type, line, col){
+
+ SyntaxUnit.call(this, text, line, col, Parser.SELECTOR_SUB_PART_TYPE);
+ this.type = type;
+ this.args = [];
+
+}
+
+SelectorSubPart.prototype = new SyntaxUnit();
+SelectorSubPart.prototype.constructor = SelectorSubPart;
+/**
+ * Represents a selector's specificity.
+ * @namespace parserlib.css
+ * @class Specificity
+ * @constructor
+ * @param {int} a Should be 1 for inline styles, zero for stylesheet styles
+ * @param {int} b Number of ID selectors
+ * @param {int} c Number of classes and pseudo classes
+ * @param {int} d Number of element names and pseudo elements
+ */
+function Specificity(a, b, c, d){
+ this.a = a;
+ this.b = b;
+ this.c = c;
+ this.d = d;
+}
+
+Specificity.prototype = {
+ constructor: Specificity,
+
+ /**
+ * Compare this specificity to another.
+ * @param {Specificity} other The other specificity to compare to.
+ * @return {int} -1 if the other specificity is larger, 1 if smaller, 0 if equal.
+ * @method compare
+ */
+ compare: function(other){
+ var comps = ["a", "b", "c", "d"],
+ i, len;
+
+ for (i=0, len=comps.length; i < len; i++){
+ if (this[comps[i]] < other[comps[i]]){
+ return -1;
+ } else if (this[comps[i]] > other[comps[i]]){
+ return 1;
+ }
+ }
+
+ return 0;
+ },
+
+ /**
+ * Creates a numeric value for the specificity.
+ * @return {int} The numeric value for the specificity.
+ * @method valueOf
+ */
+ valueOf: function(){
+ return (this.a * 1000) + (this.b * 100) + (this.c * 10) + this.d;
+ },
+
+ /**
+ * Returns a string representation for specificity.
+ * @return {String} The string representation of specificity.
+ * @method toString
+ */
+ toString: function(){
+ return this.a + "," + this.b + "," + this.c + "," + this.d;
+ }
+
+};
+Specificity.calculate = function(selector){
+
+ var i, len,
+ part,
+ b=0, c=0, d=0;
+
+ function updateValues(part){
+
+ var i, j, len, num,
+ elementName = part.elementName ? part.elementName.text : "",
+ modifier;
+
+ if (elementName && elementName.charAt(elementName.length-1) != "*") {
+ d++;
+ }
+
+ for (i=0, len=part.modifiers.length; i < len; i++){
+ modifier = part.modifiers[i];
+ switch(modifier.type){
+ case "class":
+ case "attribute":
+ c++;
+ break;
+
+ case "id":
+ b++;
+ break;
+
+ case "pseudo":
+ if (Pseudos.isElement(modifier.text)){
+ d++;
+ } else {
+ c++;
+ }
+ break;
+
+ case "not":
+ for (j=0, num=modifier.args.length; j < num; j++){
+ updateValues(modifier.args[j]);
+ }
+ }
+ }
+ }
+
+ for (i=0, len=selector.parts.length; i < len; i++){
+ part = selector.parts[i];
+
+ if (part instanceof SelectorPart){
+ updateValues(part);
+ }
+ }
+
+ return new Specificity(0, b, c, d);
+};
+
+var h = /^[0-9a-fA-F]$/,
+ nonascii = /^[\u0080-\uFFFF]$/,
+ nl = /\n|\r\n|\r|\f/;
+
+//-----------------------------------------------------------------------------
+// Helper functions
+//-----------------------------------------------------------------------------
+
+
+function isHexDigit(c){
+ return c !== null && h.test(c);
+}
+
+function isDigit(c){
+ return c !== null && /\d/.test(c);
+}
+
+function isWhitespace(c){
+ return c !== null && /\s/.test(c);
+}
+
+function isNewLine(c){
+ return c !== null && nl.test(c);
+}
+
+function isNameStart(c){
+ return c !== null && (/[a-z_\u0080-\uFFFF\\]/i.test(c));
+}
+
+function isNameChar(c){
+ return c !== null && (isNameStart(c) || /[0-9\-\\]/.test(c));
+}
+
+function isIdentStart(c){
+ return c !== null && (isNameStart(c) || /\-\\/.test(c));
+}
+
+function mix(receiver, supplier){
+ for (var prop in supplier){
+ if (supplier.hasOwnProperty(prop)){
+ receiver[prop] = supplier[prop];
+ }
+ }
+ return receiver;
+}
+
+//-----------------------------------------------------------------------------
+// CSS Token Stream
+//-----------------------------------------------------------------------------
+
+
+/**
+ * A token stream that produces CSS tokens.
+ * @param {String|Reader} input The source of text to tokenize.
+ * @constructor
+ * @class TokenStream
+ * @namespace parserlib.css
+ */
+function TokenStream(input){
+ TokenStreamBase.call(this, input, Tokens);
+}
+
+TokenStream.prototype = mix(new TokenStreamBase(), {
+
+ /**
+ * Overrides the TokenStreamBase method of the same name
+ * to produce CSS tokens.
+ * @param {variant} channel The name of the channel to use
+ * for the next token.
+ * @return {Object} A token object representing the next token.
+ * @method _getToken
+ * @private
+ */
+ _getToken: function(channel){
+
+ var c,
+ reader = this._reader,
+ token = null,
+ startLine = reader.getLine(),
+ startCol = reader.getCol();
+
+ c = reader.read();
+
+
+ while(c){
+ switch(c){
+
+ /*
+ * Potential tokens:
+ * - COMMENT
+ * - SLASH
+ * - CHAR
+ */
+ case "/":
+
+ if(reader.peek() == "*"){
+ token = this.commentToken(c, startLine, startCol);
+ } else {
+ token = this.charToken(c, startLine, startCol);
+ }
+ break;
+ case "|":
+ case "~":
+ case "^":
+ case "$":
+ case "*":
+ if(reader.peek() == "="){
+ token = this.comparisonToken(c, startLine, startCol);
+ } else {
+ token = this.charToken(c, startLine, startCol);
+ }
+ break;
+ case "\"":
+ case "'":
+ token = this.stringToken(c, startLine, startCol);
+ break;
+ case "#":
+ if (isNameChar(reader.peek())){
+ token = this.hashToken(c, startLine, startCol);
+ } else {
+ token = this.charToken(c, startLine, startCol);
+ }
+ break;
+ case ".":
+ if (isDigit(reader.peek())){
+ token = this.numberToken(c, startLine, startCol);
+ } else {
+ token = this.charToken(c, startLine, startCol);
+ }
+ break;
+ case "-":
+ if (reader.peek() == "-"){ //could be closing HTML-style comment
+ token = this.htmlCommentEndToken(c, startLine, startCol);
+ } else if (isNameStart(reader.peek())){
+ token = this.identOrFunctionToken(c, startLine, startCol);
+ } else {
+ token = this.charToken(c, startLine, startCol);
+ }
+ break;
+ case "!":
+ token = this.importantToken(c, startLine, startCol);
+ break;
+ case "@":
+ token = this.atRuleToken(c, startLine, startCol);
+ break;
+ case ":":
+ token = this.notToken(c, startLine, startCol);
+ break;
+ case "<":
+ token = this.htmlCommentStartToken(c, startLine, startCol);
+ break;
+ case "U":
+ case "u":
+ if (reader.peek() == "+"){
+ token = this.unicodeRangeToken(c, startLine, startCol);
+ break;
+ }
+ /* falls through */
+ default:
+
+ /*
+ * Potential tokens:
+ * - NUMBER
+ * - DIMENSION
+ * - LENGTH
+ * - FREQ
+ * - TIME
+ * - EMS
+ * - EXS
+ * - ANGLE
+ */
+ if (isDigit(c)){
+ token = this.numberToken(c, startLine, startCol);
+ } else
+
+ /*
+ * Potential tokens:
+ * - S
+ */
+ if (isWhitespace(c)){
+ token = this.whitespaceToken(c, startLine, startCol);
+ } else
+
+ /*
+ * Potential tokens:
+ * - IDENT
+ */
+ if (isIdentStart(c)){
+ token = this.identOrFunctionToken(c, startLine, startCol);
+ } else
+
+ /*
+ * Potential tokens:
+ * - CHAR
+ * - PLUS
+ */
+ {
+ token = this.charToken(c, startLine, startCol);
+ }
+
+
+
+
+
+
+ }
+
+ //make sure this token is wanted
+ //TODO: check channel
+ break;
+ }
+
+ if (!token && c === null){
+ token = this.createToken(Tokens.EOF,null,startLine,startCol);
+ }
+
+ return token;
+ },
+
+ //-------------------------------------------------------------------------
+ // Methods to create tokens
+ //-------------------------------------------------------------------------
+
+ /**
+ * Produces a token based on available data and the current
+ * reader position information. This method is called by other
+ * private methods to create tokens and is never called directly.
+ * @param {int} tt The token type.
+ * @param {String} value The text value of the token.
+ * @param {int} startLine The beginning line for the character.
+ * @param {int} startCol The beginning column for the character.
+ * @param {Object} options (Optional) Specifies a channel property
+ * to indicate that a different channel should be scanned
+ * and/or a hide property indicating that the token should
+ * be hidden.
+ * @return {Object} A token object.
+ * @method createToken
+ */
+ createToken: function(tt, value, startLine, startCol, options){
+ var reader = this._reader;
+ options = options || {};
+
+ return {
+ value: value,
+ type: tt,
+ channel: options.channel,
+ hide: options.hide || false,
+ startLine: startLine,
+ startCol: startCol,
+ endLine: reader.getLine(),
+ endCol: reader.getCol()
+ };
+ },
+
+ //-------------------------------------------------------------------------
+ // Methods to create specific tokens
+ //-------------------------------------------------------------------------
+
+ /**
+ * Produces a token for any at-rule. If the at-rule is unknown, then
+ * the token is for a single "@" character.
+ * @param {String} first The first character for the token.
+ * @param {int} startLine The beginning line for the character.
+ * @param {int} startCol The beginning column for the character.
+ * @return {Object} A token object.
+ * @method atRuleToken
+ */
+ atRuleToken: function(first, startLine, startCol){
+ var rule = first,
+ reader = this._reader,
+ tt = Tokens.CHAR,
+ valid = false,
+ ident,
+ c;
+ reader.mark();
+
+ //try to find the at-keyword
+ ident = this.readName();
+ rule = first + ident;
+ tt = Tokens.type(rule.toLowerCase());
+
+ //if it's not valid, use the first character only and reset the reader
+ if (tt == Tokens.CHAR || tt == Tokens.UNKNOWN){
+ if (rule.length > 1){
+ tt = Tokens.UNKNOWN_SYM;
+ } else {
+ tt = Tokens.CHAR;
+ rule = first;
+ reader.reset();
+ }
+ }
+
+ return this.createToken(tt, rule, startLine, startCol);
+ },
+
+ /**
+ * Produces a character token based on the given character
+ * and location in the stream. If there's a special (non-standard)
+ * token name, this is used; otherwise CHAR is used.
+ * @param {String} c The character for the token.
+ * @param {int} startLine The beginning line for the character.
+ * @param {int} startCol The beginning column for the character.
+ * @return {Object} A token object.
+ * @method charToken
+ */
+ charToken: function(c, startLine, startCol){
+ var tt = Tokens.type(c);
+
+ if (tt == -1){
+ tt = Tokens.CHAR;
+ }
+
+ return this.createToken(tt, c, startLine, startCol);
+ },
+
+ /**
+ * Produces a character token based on the given character
+ * and location in the stream. If there's a special (non-standard)
+ * token name, this is used; otherwise CHAR is used.
+ * @param {String} first The first character for the token.
+ * @param {int} startLine The beginning line for the character.
+ * @param {int} startCol The beginning column for the character.
+ * @return {Object} A token object.
+ * @method commentToken
+ */
+ commentToken: function(first, startLine, startCol){
+ var reader = this._reader,
+ comment = this.readComment(first);
+
+ return this.createToken(Tokens.COMMENT, comment, startLine, startCol);
+ },
+
+ /**
+ * Produces a comparison token based on the given character
+ * and location in the stream. The next character must be
+ * read and is already known to be an equals sign.
+ * @param {String} c The character for the token.
+ * @param {int} startLine The beginning line for the character.
+ * @param {int} startCol The beginning column for the character.
+ * @return {Object} A token object.
+ * @method comparisonToken
+ */
+ comparisonToken: function(c, startLine, startCol){
+ var reader = this._reader,
+ comparison = c + reader.read(),
+ tt = Tokens.type(comparison) || Tokens.CHAR;
+
+ return this.createToken(tt, comparison, startLine, startCol);
+ },
+
+ /**
+ * Produces a hash token based on the specified information. The
+ * first character provided is the pound sign (#) and then this
+ * method reads a name afterward.
+ * @param {String} first The first character (#) in the hash name.
+ * @param {int} startLine The beginning line for the character.
+ * @param {int} startCol The beginning column for the character.
+ * @return {Object} A token object.
+ * @method hashToken
+ */
+ hashToken: function(first, startLine, startCol){
+ var reader = this._reader,
+ name = this.readName(first);
+
+ return this.createToken(Tokens.HASH, name, startLine, startCol);
+ },
+
+ /**
+ * Produces a CDO or CHAR token based on the specified information. The
+ * first character is provided and the rest is read by the function to determine
+ * the correct token to create.
+ * @param {String} first The first character in the token.
+ * @param {int} startLine The beginning line for the character.
+ * @param {int} startCol The beginning column for the character.
+ * @return {Object} A token object.
+ * @method htmlCommentStartToken
+ */
+ htmlCommentStartToken: function(first, startLine, startCol){
+ var reader = this._reader,
+ text = first;
+
+ reader.mark();
+ text += reader.readCount(3);
+
+ if (text == "<!--"){
+ return this.createToken(Tokens.CDO, text, startLine, startCol);
+ } else {
+ reader.reset();
+ return this.charToken(first, startLine, startCol);
+ }
+ },
+
+ /**
+ * Produces a CDC or CHAR token based on the specified information. The
+ * first character is provided and the rest is read by the function to determine
+ * the correct token to create.
+ * @param {String} first The first character in the token.
+ * @param {int} startLine The beginning line for the character.
+ * @param {int} startCol The beginning column for the character.
+ * @return {Object} A token object.
+ * @method htmlCommentEndToken
+ */
+ htmlCommentEndToken: function(first, startLine, startCol){
+ var reader = this._reader,
+ text = first;
+
+ reader.mark();
+ text += reader.readCount(2);
+
+ if (text == "-->"){
+ return this.createToken(Tokens.CDC, text, startLine, startCol);
+ } else {
+ reader.reset();
+ return this.charToken(first, startLine, startCol);
+ }
+ },
+
+ /**
+ * Produces an IDENT or FUNCTION token based on the specified information. The
+ * first character is provided and the rest is read by the function to determine
+ * the correct token to create.
+ * @param {String} first The first character in the identifier.
+ * @param {int} startLine The beginning line for the character.
+ * @param {int} startCol The beginning column for the character.
+ * @return {Object} A token object.
+ * @method identOrFunctionToken
+ */
+ identOrFunctionToken: function(first, startLine, startCol){
+ var reader = this._reader,
+ ident = this.readName(first),
+ tt = Tokens.IDENT;
+
+ //if there's a left paren immediately after, it's a URI or function
+ if (reader.peek() == "("){
+ ident += reader.read();
+ if (ident.toLowerCase() == "url("){
+ tt = Tokens.URI;
+ ident = this.readURI(ident);
+
+ //didn't find a valid URL or there's no closing paren
+ if (ident.toLowerCase() == "url("){
+ tt = Tokens.FUNCTION;
+ }
+ } else {
+ tt = Tokens.FUNCTION;
+ }
+ } else if (reader.peek() == ":"){ //might be an IE function
+
+ //IE-specific functions always being with progid:
+ if (ident.toLowerCase() == "progid"){
+ ident += reader.readTo("(");
+ tt = Tokens.IE_FUNCTION;
+ }
+ }
+
+ return this.createToken(tt, ident, startLine, startCol);
+ },
+
+ /**
+ * Produces an IMPORTANT_SYM or CHAR token based on the specified information. The
+ * first character is provided and the rest is read by the function to determine
+ * the correct token to create.
+ * @param {String} first The first character in the token.
+ * @param {int} startLine The beginning line for the character.
+ * @param {int} startCol The beginning column for the character.
+ * @return {Object} A token object.
+ * @method importantToken
+ */
+ importantToken: function(first, startLine, startCol){
+ var reader = this._reader,
+ important = first,
+ tt = Tokens.CHAR,
+ temp,
+ c;
+
+ reader.mark();
+ c = reader.read();
+
+ while(c){
+
+ //there can be a comment in here
+ if (c == "/"){
+
+ //if the next character isn't a star, then this isn't a valid !important token
+ if (reader.peek() != "*"){
+ break;
+ } else {
+ temp = this.readComment(c);
+ if (temp === ""){ //broken!
+ break;
+ }
+ }
+ } else if (isWhitespace(c)){
+ important += c + this.readWhitespace();
+ } else if (/i/i.test(c)){
+ temp = reader.readCount(8);
+ if (/mportant/i.test(temp)){
+ important += c + temp;
+ tt = Tokens.IMPORTANT_SYM;
+
+ }
+ break; //we're done
+ } else {
+ break;
+ }
+
+ c = reader.read();
+ }
+
+ if (tt == Tokens.CHAR){
+ reader.reset();
+ return this.charToken(first, startLine, startCol);
+ } else {
+ return this.createToken(tt, important, startLine, startCol);
+ }
+
+
+ },
+
+ /**
+ * Produces a NOT or CHAR token based on the specified information. The
+ * first character is provided and the rest is read by the function to determine
+ * the correct token to create.
+ * @param {String} first The first character in the token.
+ * @param {int} startLine The beginning line for the character.
+ * @param {int} startCol The beginning column for the character.
+ * @return {Object} A token object.
+ * @method notToken
+ */
+ notToken: function(first, startLine, startCol){
+ var reader = this._reader,
+ text = first;
+
+ reader.mark();
+ text += reader.readCount(4);
+
+ if (text.toLowerCase() == ":not("){
+ return this.createToken(Tokens.NOT, text, startLine, startCol);
+ } else {
+ reader.reset();
+ return this.charToken(first, startLine, startCol);
+ }
+ },
+
+ /**
+ * Produces a number token based on the given character
+ * and location in the stream. This may return a token of
+ * NUMBER, EMS, EXS, LENGTH, ANGLE, TIME, FREQ, DIMENSION,
+ * or PERCENTAGE.
+ * @param {String} first The first character for the token.
+ * @param {int} startLine The beginning line for the character.
+ * @param {int} startCol The beginning column for the character.
+ * @return {Object} A token object.
+ * @method numberToken
+ */
+ numberToken: function(first, startLine, startCol){
+ var reader = this._reader,
+ value = this.readNumber(first),
+ ident,
+ tt = Tokens.NUMBER,
+ c = reader.peek();
+
+ if (isIdentStart(c)){
+ ident = this.readName(reader.read());
+ value += ident;
+
+ if (/^em$|^ex$|^px$|^gd$|^rem$|^vw$|^vh$|^vm$|^ch$|^cm$|^mm$|^in$|^pt$|^pc$/i.test(ident)){
+ tt = Tokens.LENGTH;
+ } else if (/^deg|^rad$|^grad$/i.test(ident)){
+ tt = Tokens.ANGLE;
+ } else if (/^ms$|^s$/i.test(ident)){
+ tt = Tokens.TIME;
+ } else if (/^hz$|^khz$/i.test(ident)){
+ tt = Tokens.FREQ;
+ } else if (/^dpi$|^dpcm$/i.test(ident)){
+ tt = Tokens.RESOLUTION;
+ } else {
+ tt = Tokens.DIMENSION;
+ }
+
+ } else if (c == "%"){
+ value += reader.read();
+ tt = Tokens.PERCENTAGE;
+ }
+
+ return this.createToken(tt, value, startLine, startCol);
+ },
+
+ /**
+ * Produces a string token based on the given character
+ * and location in the stream. Since strings may be indicated
+ * by single or double quotes, a failure to match starting
+ * and ending quotes results in an INVALID token being generated.
+ * The first character in the string is passed in and then
+ * the rest are read up to and including the final quotation mark.
+ * @param {String} first The first character in the string.
+ * @param {int} startLine The beginning line for the character.
+ * @param {int} startCol The beginning column for the character.
+ * @return {Object} A token object.
+ * @method stringToken
+ */
+ stringToken: function(first, startLine, startCol){
+ var delim = first,
+ string = first,
+ reader = this._reader,
+ prev = first,
+ tt = Tokens.STRING,
+ c = reader.read();
+
+ while(c){
+ string += c;
+
+ //if the delimiter is found with an escapement, we're done.
+ if (c == delim && prev != "\\"){
+ break;
+ }
+
+ //if there's a newline without an escapement, it's an invalid string
+ if (isNewLine(reader.peek()) && c != "\\"){
+ tt = Tokens.INVALID;
+ break;
+ }
+
+ //save previous and get next
+ prev = c;
+ c = reader.read();
+ }
+
+ //if c is null, that means we're out of input and the string was never closed
+ if (c === null){
+ tt = Tokens.INVALID;
+ }
+
+ return this.createToken(tt, string, startLine, startCol);
+ },
+
+ unicodeRangeToken: function(first, startLine, startCol){
+ var reader = this._reader,
+ value = first,
+ temp,
+ tt = Tokens.CHAR;
+
+ //then it should be a unicode range
+ if (reader.peek() == "+"){
+ reader.mark();
+ value += reader.read();
+ value += this.readUnicodeRangePart(true);
+
+ //ensure there's an actual unicode range here
+ if (value.length == 2){
+ reader.reset();
+ } else {
+
+ tt = Tokens.UNICODE_RANGE;
+
+ //if there's a ? in the first part, there can't be a second part
+ if (value.indexOf("?") == -1){
+
+ if (reader.peek() == "-"){
+ reader.mark();
+ temp = reader.read();
+ temp += this.readUnicodeRangePart(false);
+
+ //if there's not another value, back up and just take the first
+ if (temp.length == 1){
+ reader.reset();
+ } else {
+ value += temp;
+ }
+ }
+
+ }
+ }
+ }
+
+ return this.createToken(tt, value, startLine, startCol);
+ },
+
+ /**
+ * Produces a S token based on the specified information. Since whitespace
+ * may have multiple characters, this consumes all whitespace characters
+ * into a single token.
+ * @param {String} first The first character in the token.
+ * @param {int} startLine The beginning line for the character.
+ * @param {int} startCol The beginning column for the character.
+ * @return {Object} A token object.
+ * @method whitespaceToken
+ */
+ whitespaceToken: function(first, startLine, startCol){
+ var reader = this._reader,
+ value = first + this.readWhitespace();
+ return this.createToken(Tokens.S, value, startLine, startCol);
+ },
+
+
+
+
+ //-------------------------------------------------------------------------
+ // Methods to read values from the string stream
+ //-------------------------------------------------------------------------
+
+ readUnicodeRangePart: function(allowQuestionMark){
+ var reader = this._reader,
+ part = "",
+ c = reader.peek();
+
+ //first read hex digits
+ while(isHexDigit(c) && part.length < 6){
+ reader.read();
+ part += c;
+ c = reader.peek();
+ }
+
+ //then read question marks if allowed
+ if (allowQuestionMark){
+ while(c == "?" && part.length < 6){
+ reader.read();
+ part += c;
+ c = reader.peek();
+ }
+ }
+
+ //there can't be any other characters after this point
+
+ return part;
+ },
+
+ readWhitespace: function(){
+ var reader = this._reader,
+ whitespace = "",
+ c = reader.peek();
+
+ while(isWhitespace(c)){
+ reader.read();
+ whitespace += c;
+ c = reader.peek();
+ }
+
+ return whitespace;
+ },
+ readNumber: function(first){
+ var reader = this._reader,
+ number = first,
+ hasDot = (first == "."),
+ c = reader.peek();
+
+
+ while(c){
+ if (isDigit(c)){
+ number += reader.read();
+ } else if (c == "."){
+ if (hasDot){
+ break;
+ } else {
+ hasDot = true;
+ number += reader.read();
+ }
+ } else {
+ break;
+ }
+
+ c = reader.peek();
+ }
+
+ return number;
+ },
+ readString: function(){
+ var reader = this._reader,
+ delim = reader.read(),
+ string = delim,
+ prev = delim,
+ c = reader.peek();
+
+ while(c){
+ c = reader.read();
+ string += c;
+
+ //if the delimiter is found with an escapement, we're done.
+ if (c == delim && prev != "\\"){
+ break;
+ }
+
+ //if there's a newline without an escapement, it's an invalid string
+ if (isNewLine(reader.peek()) && c != "\\"){
+ string = "";
+ break;
+ }
+
+ //save previous and get next
+ prev = c;
+ c = reader.peek();
+ }
+
+ //if c is null, that means we're out of input and the string was never closed
+ if (c === null){
+ string = "";
+ }
+
+ return string;
+ },
+ readURI: function(first){
+ var reader = this._reader,
+ uri = first,
+ inner = "",
+ c = reader.peek();
+
+ reader.mark();
+
+ //skip whitespace before
+ while(c && isWhitespace(c)){
+ reader.read();
+ c = reader.peek();
+ }
+
+ //it's a string
+ if (c == "'" || c == "\""){
+ inner = this.readString();
+ } else {
+ inner = this.readURL();
+ }
+
+ c = reader.peek();
+
+ //skip whitespace after
+ while(c && isWhitespace(c)){
+ reader.read();
+ c = reader.peek();
+ }
+
+ //if there was no inner value or the next character isn't closing paren, it's not a URI
+ if (inner === "" || c != ")"){
+ uri = first;
+ reader.reset();
+ } else {
+ uri += inner + reader.read();
+ }
+
+ return uri;
+ },
+ readURL: function(){
+ var reader = this._reader,
+ url = "",
+ c = reader.peek();
+
+ //TODO: Check for escape and nonascii
+ while (/^[!#$%&\\*-~]$/.test(c)){
+ url += reader.read();
+ c = reader.peek();
+ }
+
+ return url;
+
+ },
+ readName: function(first){
+ var reader = this._reader,
+ ident = first || "",
+ c = reader.peek();
+
+ while(true){
+ if (c == "\\"){
+ ident += this.readEscape(reader.read());
+ c = reader.peek();
+ } else if(c && isNameChar(c)){
+ ident += reader.read();
+ c = reader.peek();
+ } else {
+ break;
+ }
+ }
+
+ return ident;
+ },
+
+ readEscape: function(first){
+ var reader = this._reader,
+ cssEscape = first || "",
+ i = 0,
+ c = reader.peek();
+
+ if (isHexDigit(c)){
+ do {
+ cssEscape += reader.read();
+ c = reader.peek();
+ } while(c && isHexDigit(c) && ++i < 6);
+ }
+
+ if (cssEscape.length == 3 && /\s/.test(c) ||
+ cssEscape.length == 7 || cssEscape.length == 1){
+ reader.read();
+ } else {
+ c = "";
+ }
+
+ return cssEscape + c;
+ },
+
+ readComment: function(first){
+ var reader = this._reader,
+ comment = first || "",
+ c = reader.read();
+
+ if (c == "*"){
+ while(c){
+ comment += c;
+
+ //look for end of comment
+ if (comment.length > 2 && c == "*" && reader.peek() == "/"){
+ comment += reader.read();
+ break;
+ }
+
+ c = reader.read();
+ }
+
+ return comment;
+ } else {
+ return "";
+ }
+
+ }
+});
+
+
+var Tokens = [
+
+ /*
+ * The following token names are defined in CSS3 Grammar: http://www.w3.org/TR/css3-syntax/#lexical
+ */
+
+ //HTML-style comments
+ { name: "CDO"},
+ { name: "CDC"},
+
+ //ignorables
+ { name: "S", whitespace: true/*, channel: "ws"*/},
+ { name: "COMMENT", comment: true, hide: true, channel: "comment" },
+
+ //attribute equality
+ { name: "INCLUDES", text: "~="},
+ { name: "DASHMATCH", text: "|="},
+ { name: "PREFIXMATCH", text: "^="},
+ { name: "SUFFIXMATCH", text: "$="},
+ { name: "SUBSTRINGMATCH", text: "*="},
+
+ //identifier types
+ { name: "STRING"},
+ { name: "IDENT"},
+ { name: "HASH"},
+
+ //at-keywords
+ { name: "IMPORT_SYM", text: "@import"},
+ { name: "PAGE_SYM", text: "@page"},
+ { name: "MEDIA_SYM", text: "@media"},
+ { name: "FONT_FACE_SYM", text: "@font-face"},
+ { name: "CHARSET_SYM", text: "@charset"},
+ { name: "NAMESPACE_SYM", text: "@namespace"},
+ { name: "UNKNOWN_SYM" },
+ //{ name: "ATKEYWORD"},
+
+ //CSS3 animations
+ { name: "KEYFRAMES_SYM", text: [ "@keyframes", "@-webkit-keyframes", "@-moz-keyframes", "@-ms-keyframes" ] },
+
+ //important symbol
+ { name: "IMPORTANT_SYM"},
+
+ //measurements
+ { name: "LENGTH"},
+ { name: "ANGLE"},
+ { name: "TIME"},
+ { name: "FREQ"},
+ { name: "DIMENSION"},
+ { name: "PERCENTAGE"},
+ { name: "NUMBER"},
+
+ //functions
+ { name: "URI"},
+ { name: "FUNCTION"},
+
+ //Unicode ranges
+ { name: "UNICODE_RANGE"},
+
+ /*
+ * The following token names are defined in CSS3 Selectors: http://www.w3.org/TR/css3-selectors/#selector-syntax
+ */
+
+ //invalid string
+ { name: "INVALID"},
+
+ //combinators
+ { name: "PLUS", text: "+" },
+ { name: "GREATER", text: ">"},
+ { name: "COMMA", text: ","},
+ { name: "TILDE", text: "~"},
+
+ //modifier
+ { name: "NOT"},
+
+ /*
+ * Defined in CSS3 Paged Media
+ */
+ { name: "TOPLEFTCORNER_SYM", text: "@top-left-corner"},
+ { name: "TOPLEFT_SYM", text: "@top-left"},
+ { name: "TOPCENTER_SYM", text: "@top-center"},
+ { name: "TOPRIGHT_SYM", text: "@top-right"},
+ { name: "TOPRIGHTCORNER_SYM", text: "@top-right-corner"},
+ { name: "BOTTOMLEFTCORNER_SYM", text: "@bottom-left-corner"},
+ { name: "BOTTOMLEFT_SYM", text: "@bottom-left"},
+ { name: "BOTTOMCENTER_SYM", text: "@bottom-center"},
+ { name: "BOTTOMRIGHT_SYM", text: "@bottom-right"},
+ { name: "BOTTOMRIGHTCORNER_SYM", text: "@bottom-right-corner"},
+ { name: "LEFTTOP_SYM", text: "@left-top"},
+ { name: "LEFTMIDDLE_SYM", text: "@left-middle"},
+ { name: "LEFTBOTTOM_SYM", text: "@left-bottom"},
+ { name: "RIGHTTOP_SYM", text: "@right-top"},
+ { name: "RIGHTMIDDLE_SYM", text: "@right-middle"},
+ { name: "RIGHTBOTTOM_SYM", text: "@right-bottom"},
+
+ /*
+ * The following token names are defined in CSS3 Media Queries: http://www.w3.org/TR/css3-mediaqueries/#syntax
+ */
+ /*{ name: "MEDIA_ONLY", state: "media"},
+ { name: "MEDIA_NOT", state: "media"},
+ { name: "MEDIA_AND", state: "media"},*/
+ { name: "RESOLUTION", state: "media"},
+
+ /*
+ * The following token names are not defined in any CSS specification but are used by the lexer.
+ */
+
+ //not a real token, but useful for stupid IE filters
+ { name: "IE_FUNCTION" },
+
+ //part of CSS3 grammar but not the Flex code
+ { name: "CHAR" },
+
+ //TODO: Needed?
+ //Not defined as tokens, but might as well be
+ {
+ name: "PIPE",
+ text: "|"
+ },
+ {
+ name: "SLASH",
+ text: "/"
+ },
+ {
+ name: "MINUS",
+ text: "-"
+ },
+ {
+ name: "STAR",
+ text: "*"
+ },
+
+ {
+ name: "LBRACE",
+ text: "{"
+ },
+ {
+ name: "RBRACE",
+ text: "}"
+ },
+ {
+ name: "LBRACKET",
+ text: "["
+ },
+ {
+ name: "RBRACKET",
+ text: "]"
+ },
+ {
+ name: "EQUALS",
+ text: "="
+ },
+ {
+ name: "COLON",
+ text: ":"
+ },
+ {
+ name: "SEMICOLON",
+ text: ";"
+ },
+
+ {
+ name: "LPAREN",
+ text: "("
+ },
+ {
+ name: "RPAREN",
+ text: ")"
+ },
+ {
+ name: "DOT",
+ text: "."
+ }
+];
+
+(function(){
+
+ var nameMap = [],
+ typeMap = {};
+
+ Tokens.UNKNOWN = -1;
+ Tokens.unshift({name:"EOF"});
+ for (var i=0, len = Tokens.length; i < len; i++){
+ nameMap.push(Tokens[i].name);
+ Tokens[Tokens[i].name] = i;
+ if (Tokens[i].text){
+ if (Tokens[i].text instanceof Array){
+ for (var j=0; j < Tokens[i].text.length; j++){
+ typeMap[Tokens[i].text[j]] = i;
+ }
+ } else {
+ typeMap[Tokens[i].text] = i;
+ }
+ }
+ }
+
+ Tokens.name = function(tt){
+ return nameMap[tt];
+ };
+
+ Tokens.type = function(c){
+ return typeMap[c] || -1;
+ };
+
+})();
+
+
+
+
+//This file will likely change a lot! Very experimental!
+/*global Properties, ValidationTypes, ValidationError, PropertyValueIterator */
+var Validation = {
+
+ validate: function(property, value){
+
+ //normalize name
+ var name = property.toString().toLowerCase(),
+ parts = value.parts,
+ expression = new PropertyValueIterator(value),
+ spec = Properties[name],
+ part,
+ valid,
+ j, count,
+ msg,
+ types,
+ last,
+ literals,
+ max, multi, group;
+
+ if (!spec) {
+ if (name.indexOf("-") !== 0){ //vendor prefixed are ok
+ throw new ValidationError("Unknown property '" + property + "'.", property.line, property.col);
+ }
+ } else if (typeof spec != "number"){
+
+ //initialization
+ if (typeof spec == "string"){
+ if (spec.indexOf("||") > -1) {
+ this.groupProperty(spec, expression);
+ } else {
+ this.singleProperty(spec, expression, 1);
+ }
+
+ } else if (spec.multi) {
+ this.multiProperty(spec.multi, expression, spec.comma, spec.max || Infinity);
+ } else if (typeof spec == "function") {
+ spec(expression);
+ }
+
+ }
+
+ },
+
+ singleProperty: function(types, expression, max, partial) {
+
+ var result = false,
+ value = expression.value,
+ count = 0,
+ part;
+
+ while (expression.hasNext() && count < max) {
+ result = ValidationTypes.isAny(expression, types);
+ if (!result) {
+ break;
+ }
+ count++;
+ }
+
+ if (!result) {
+ if (expression.hasNext() && !expression.isFirst()) {
+ part = expression.peek();
+ throw new ValidationError("Expected end of value but found '" + part + "'.", part.line, part.col);
+ } else {
+ throw new ValidationError("Expected (" + types + ") but found '" + value + "'.", value.line, value.col);
+ }
+ } else if (expression.hasNext()) {
+ part = expression.next();
+ throw new ValidationError("Expected end of value but found '" + part + "'.", part.line, part.col);
+ }
+
+ },
+
+ multiProperty: function (types, expression, comma, max) {
+
+ var result = false,
+ value = expression.value,
+ count = 0,
+ sep = false,
+ part;
+
+ while(expression.hasNext() && !result && count < max) {
+ if (ValidationTypes.isAny(expression, types)) {
+ count++;
+ if (!expression.hasNext()) {
+ result = true;
+
+ } else if (comma) {
+ if (expression.peek() == ",") {
+ part = expression.next();
+ } else {
+ break;
+ }
+ }
+ } else {
+ break;
+
+ }
+ }
+
+ if (!result) {
+ if (expression.hasNext() && !expression.isFirst()) {
+ part = expression.peek();
+ throw new ValidationError("Expected end of value but found '" + part + "'.", part.line, part.col);
+ } else {
+ part = expression.previous();
+ if (comma && part == ",") {
+ throw new ValidationError("Expected end of value but found '" + part + "'.", part.line, part.col);
+ } else {
+ throw new ValidationError("Expected (" + types + ") but found '" + value + "'.", value.line, value.col);
+ }
+ }
+
+ } else if (expression.hasNext()) {
+ part = expression.next();
+ throw new ValidationError("Expected end of value but found '" + part + "'.", part.line, part.col);
+ }
+
+ },
+
+ groupProperty: function (types, expression, comma) {
+
+ var result = false,
+ value = expression.value,
+ typeCount = types.split("||").length,
+ groups = { count: 0 },
+ partial = false,
+ name,
+ part;
+
+ while(expression.hasNext() && !result) {
+ name = ValidationTypes.isAnyOfGroup(expression, types);
+ if (name) {
+
+ //no dupes
+ if (groups[name]) {
+ break;
+ } else {
+ groups[name] = 1;
+ groups.count++;
+ partial = true;
+
+ if (groups.count == typeCount || !expression.hasNext()) {
+ result = true;
+ }
+ }
+ } else {
+ break;
+ }
+ }
+
+ if (!result) {
+ if (partial && expression.hasNext()) {
+ part = expression.peek();
+ throw new ValidationError("Expected end of value but found '" + part + "'.", part.line, part.col);
+ } else {
+ throw new ValidationError("Expected (" + types + ") but found '" + value + "'.", value.line, value.col);
+ }
+ } else if (expression.hasNext()) {
+ part = expression.next();
+ throw new ValidationError("Expected end of value but found '" + part + "'.", part.line, part.col);
+ }
+ }
+
+
+
+};
+function ValidationError(message, line, col){
+
+ /**
+ * The column at which the error occurred.
+ * @type int
+ * @property col
+ */
+ this.col = col;
+ this.line = line;
+ this.message = message;
+
+}
+
+//inherit from Error
+ValidationError.prototype = new Error();
+//This file will likely change a lot! Very experimental!
+/*global Properties, Validation, ValidationError, PropertyValueIterator, console*/
+var ValidationTypes = {
+
+ isLiteral: function (part, literals) {
+ var text = part.text.toString().toLowerCase(),
+ args = literals.split(" | "),
+ i, len, found = false;
+
+ for (i=0,len=args.length; i < len && !found; i++){
+ if (text == args[i]){
+ found = true;
+ }
+ }
+
+ return found;
+ },
+
+ isSimple: function(type) {
+ return !!this.simple[type];
+ },
+
+ isComplex: function(type) {
+ return !!this.complex[type];
+ },
+
+ /**
+ * Determines if the next part(s) of the given expression
+ * are any of the given types.
+ */
+ isAny: function (expression, types) {
+ var args = types.split(" | "),
+ i, len, found = false;
+
+ for (i=0,len=args.length; i < len && !found && expression.hasNext(); i++){
+ found = this.isType(expression, args[i]);
+ }
+
+ return found;
+ },
+
+ /**
+ * Determines if the next part(s) of the given expresion
+ * are one of a group.
+ */
+ isAnyOfGroup: function(expression, types) {
+ var args = types.split(" || "),
+ i, len, found = false;
+
+ for (i=0,len=args.length; i < len && !found; i++){
+ found = this.isType(expression, args[i]);
+ }
+
+ return found ? args[i-1] : false;
+ },
+
+ /**
+ * Determines if the next part(s) of the given expression
+ * are of a given type.
+ */
+ isType: function (expression, type) {
+ var part = expression.peek(),
+ result = false;
+
+ if (type.charAt(0) != "<") {
+ result = this.isLiteral(part, type);
+ if (result) {
+ expression.next();
+ }
+ } else if (this.simple[type]) {
+ result = this.simple[type](part);
+ if (result) {
+ expression.next();
+ }
+ } else {
+ result = this.complex[type](expression);
+ }
+
+ return result;
+ },
+
+
+
+ simple: {
+
+ "<absolute-size>": function(part){
+ return ValidationTypes.isLiteral(part, "xx-small | x-small | small | medium | large | x-large | xx-large");
+ },
+
+ "<attachment>": function(part){
+ return ValidationTypes.isLiteral(part, "scroll | fixed | local");
+ },
+
+ "<attr>": function(part){
+ return part.type == "function" && part.name == "attr";
+ },
+
+ "<bg-image>": function(part){
+ return this["<image>"](part) || this["<gradient>"](part) || part == "none";
+ },
+
+ "<gradient>": function(part) {
+ return part.type == "function" && /^(?:\-(?:ms|moz|o|webkit)\-)?(?:repeating\-)?(?:radial|linear)\-gradient/i.test(part);
+ },
+
+ "<box>": function(part){
+ return ValidationTypes.isLiteral(part, "padding-box | border-box | content-box");
+ },
+
+ "<content>": function(part){
+ return part.type == "function" && part.name == "content";
+ },
+
+ "<relative-size>": function(part){
+ return ValidationTypes.isLiteral(part, "smaller | larger");
+ },
+
+ //any identifier
+ "<ident>": function(part){
+ return part.type == "identifier";
+ },
+
+ "<length>": function(part){
+ return part.type == "length" || part.type == "number" || part.type == "integer" || part == "0";
+ },
+
+ "<color>": function(part){
+ return part.type == "color" || part == "transparent";
+ },
+
+ "<number>": function(part){
+ return part.type == "number" || this["<integer>"](part);
+ },
+
+ "<integer>": function(part){
+ return part.type == "integer";
+ },
+
+ "<line>": function(part){
+ return part.type == "integer";
+ },
+
+ "<angle>": function(part){
+ return part.type == "angle";
+ },
+
+ "<uri>": function(part){
+ return part.type == "uri";
+ },
+
+ "<image>": function(part){
+ return this["<uri>"](part);
+ },
+
+ "<percentage>": function(part){
+ return part.type == "percentage" || part == "0";
+ },
+
+ "<border-width>": function(part){
+ return this["<length>"](part) || ValidationTypes.isLiteral(part, "thin | medium | thick");
+ },
+
+ "<border-style>": function(part){
+ return ValidationTypes.isLiteral(part, "none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset");
+ },
+
+ "<margin-width>": function(part){
+ return this["<length>"](part) || this["<percentage>"](part) || ValidationTypes.isLiteral(part, "auto");
+ },
+
+ "<padding-width>": function(part){
+ return this["<length>"](part) || this["<percentage>"](part);
+ },
+
+ "<shape>": function(part){
+ return part.type == "function" && (part.name == "rect" || part.name == "inset-rect");
+ },
+
+ "<time>": function(part) {
+ return part.type == "time";
+ }
+ },
+
+ complex: {
+
+ "<bg-position>": function(expression){
+ var types = this,
+ result = false,
+ numeric = "<percentage> | <length>",
+ xDir = "left | center | right",
+ yDir = "top | center | bottom",
+ part,
+ i, len;
+
+
+ if (ValidationTypes.isAny(expression, "top | bottom")) {
+ result = true;
+ } else {
+
+ //must be two-part
+ if (ValidationTypes.isAny(expression, numeric)){
+ if (expression.hasNext()){
+ result = ValidationTypes.isAny(expression, numeric + " | " + yDir);
+ }
+ } else if (ValidationTypes.isAny(expression, xDir)){
+ if (expression.hasNext()){
+
+ //two- or three-part
+ if (ValidationTypes.isAny(expression, yDir)){
+ result = true;
+
+ ValidationTypes.isAny(expression, numeric);
+
+ } else if (ValidationTypes.isAny(expression, numeric)){
+
+ //could also be two-part, so check the next part
+ if (ValidationTypes.isAny(expression, yDir)){
+ ValidationTypes.isAny(expression, numeric);
+ }
+
+ result = true;
+ }
+ }
+ }
+ }
+
+
+ return result;
+ },
+
+ "<bg-size>": function(expression){
+ //<bg-size> = [ <length> | <percentage> | auto ]{1,2} | cover | contain
+ var types = this,
+ result = false,
+ numeric = "<percentage> | <length> | auto",
+ part,
+ i, len;
+
+ if (ValidationTypes.isAny(expression, "cover | contain")) {
+ result = true;
+ } else if (ValidationTypes.isAny(expression, numeric)) {
+ result = true;
+ ValidationTypes.isAny(expression, numeric);
+ }
+
+ return result;
+ },
+
+ "<repeat-style>": function(expression){
+ //repeat-x | repeat-y | [repeat | space | round | no-repeat]{1,2}
+ var result = false,
+ values = "repeat | space | round | no-repeat",
+ part;
+
+ if (expression.hasNext()){
+ part = expression.next();
+
+ if (ValidationTypes.isLiteral(part, "repeat-x | repeat-y")) {
+ result = true;
+ } else if (ValidationTypes.isLiteral(part, values)) {
+ result = true;
+
+ if (expression.hasNext() && ValidationTypes.isLiteral(expression.peek(), values)) {
+ expression.next();
+ }
+ }
+ }
+
+ return result;
+
+ },
+
+ "<shadow>": function(expression) {
+ //inset? && [ <length>{2,4} && <color>? ]
+ var result = false,
+ count = 0,
+ inset = false,
+ color = false,
+ part;
+
+ if (expression.hasNext()) {
+
+ if (ValidationTypes.isAny(expression, "inset")){
+ inset = true;
+ }
+
+ if (ValidationTypes.isAny(expression, "<color>")) {
+ color = true;
+ }
+
+ while (ValidationTypes.isAny(expression, "<length>") && count < 4) {
+ count++;
+ }
+
+
+ if (expression.hasNext()) {
+ if (!color) {
+ ValidationTypes.isAny(expression, "<color>");
+ }
+
+ if (!inset) {
+ ValidationTypes.isAny(expression, "inset");
+ }
+
+ }
+
+ result = (count >= 2 && count <= 4);
+
+ }
+
+ return result;
+ },
+
+ "<x-one-radius>": function(expression) {
+ //[ <length> | <percentage> ] [ <length> | <percentage> ]?
+ var result = false,
+ count = 0,
+ numeric = "<length> | <percentage>",
+ part;
+
+ if (ValidationTypes.isAny(expression, numeric)){
+ result = true;
+
+ ValidationTypes.isAny(expression, numeric);
+ }
+
+ return result;
+ }
+ }
+};
+
+
+parserlib.css = {
+Colors :Colors,
+Combinator :Combinator,
+Parser :Parser,
+PropertyName :PropertyName,
+PropertyValue :PropertyValue,
+PropertyValuePart :PropertyValuePart,
+MediaFeature :MediaFeature,
+MediaQuery :MediaQuery,
+Selector :Selector,
+SelectorPart :SelectorPart,
+SelectorSubPart :SelectorSubPart,
+Specificity :Specificity,
+TokenStream :TokenStream,
+Tokens :Tokens,
+ValidationError :ValidationError
+};
+})();
+/*global parserlib, Reporter*/
+var CSSLint = (function(){
+
+ var rules = [],
+ formatters = [],
+ api = new parserlib.util.EventTarget();
+
+ api.version = "0.9.7";
+
+ //-------------------------------------------------------------------------
+ // Rule Management
+ //-------------------------------------------------------------------------
+
+ /**
+ * Adds a new rule to the engine.
+ * @param {Object} rule The rule to add.
+ * @method addRule
+ */
+ api.addRule = function(rule){
+ rules.push(rule);
+ rules[rule.id] = rule;
+ };
+ api.clearRules = function(){
+ rules = [];
+ };
+ api.getRules = function(){
+ return [].concat(rules).sort(function(a,b){
+ return a.id > b.id ? 1 : 0;
+ });
+ };
+
+ //-------------------------------------------------------------------------
+ // Formatters
+ //-------------------------------------------------------------------------
+
+ /**
+ * Adds a new formatter to the engine.
+ * @param {Object} formatter The formatter to add.
+ * @method addFormatter
+ */
+ api.addFormatter = function(formatter) {
+ // formatters.push(formatter);
+ formatters[formatter.id] = formatter;
+ };
+ api.getFormatter = function(formatId){
+ return formatters[formatId];
+ };
+ api.format = function(results, filename, formatId, options) {
+ var formatter = this.getFormatter(formatId),
+ result = null;
+
+ if (formatter){
+ result = formatter.startFormat();
+ result += formatter.formatResults(results, filename, options || {});
+ result += formatter.endFormat();
+ }
+
+ return result;
+ };
+ api.hasFormat = function(formatId){
+ return formatters.hasOwnProperty(formatId);
+ };
+
+ //-------------------------------------------------------------------------
+ // Verification
+ //-------------------------------------------------------------------------
+
+ /**
+ * Starts the verification process for the given CSS text.
+ * @param {String} text The CSS text to verify.
+ * @param {Object} ruleset (Optional) List of rules to apply. If null, then
+ * all rules are used. If a rule has a value of 1 then it's a warning,
+ * a value of 2 means it's an error.
+ * @return {Object} Results of the verification.
+ * @method verify
+ */
+ api.verify = function(text, ruleset){
+
+ var i = 0,
+ len = rules.length,
+ reporter,
+ lines,
+ report,
+ parser = new parserlib.css.Parser({ starHack: true, ieFilters: true,
+ underscoreHack: true, strict: false });
+
+ lines = text.replace(/\n\r?/g, "$split$").split('$split$');
+
+ if (!ruleset){
+ ruleset = {};
+ while (i < len){
+ ruleset[rules[i++].id] = 1; //by default, everything is a warning
+ }
+ }
+
+ reporter = new Reporter(lines, ruleset);
+
+ ruleset.errors = 2; //always report parsing errors as errors
+ for (i in ruleset){
+ if(ruleset.hasOwnProperty(i)){
+ if (rules[i]){
+ rules[i].init(parser, reporter);
+ }
+ }
+ }
+
+
+ //capture most horrible error type
+ try {
+ parser.parse(text);
+ } catch (ex) {
+ reporter.error("Fatal error, cannot continue: " + ex.message, ex.line, ex.col, {});
+ }
+
+ report = {
+ messages : reporter.messages,
+ stats : reporter.stats
+ };
+
+ //sort by line numbers, rollups at the bottom
+ report.messages.sort(function (a, b){
+ if (a.rollup && !b.rollup){
+ return 1;
+ } else if (!a.rollup && b.rollup){
+ return -1;
+ } else {
+ return a.line - b.line;
+ }
+ });
+
+ return report;
+ };
+
+ //-------------------------------------------------------------------------
+ // Publish the API
+ //-------------------------------------------------------------------------
+
+ return api;
+
+})();
+/**
+ * An instance of Report is used to report results of the
+ * verification back to the main API.
+ * @class Reporter
+ * @constructor
+ * @param {String[]} lines The text lines of the source.
+ * @param {Object} ruleset The set of rules to work with, including if
+ * they are errors or warnings.
+ */
+function Reporter(lines, ruleset){
+
+ /**
+ * List of messages being reported.
+ * @property messages
+ * @type String[]
+ */
+ this.messages = [];
+ this.stats = [];
+ this.lines = lines;
+ this.ruleset = ruleset;
+}
+
+Reporter.prototype = {
+
+ //restore constructor
+ constructor: Reporter,
+
+ /**
+ * Report an error.
+ * @param {String} message The message to store.
+ * @param {int} line The line number.
+ * @param {int} col The column number.
+ * @param {Object} rule The rule this message relates to.
+ * @method error
+ */
+ error: function(message, line, col, rule){
+ this.messages.push({
+ type : "error",
+ line : line,
+ col : col,
+ message : message,
+ evidence: this.lines[line-1],
+ rule : rule || {}
+ });
+ },
+
+ /**
+ * Report an warning.
+ * @param {String} message The message to store.
+ * @param {int} line The line number.
+ * @param {int} col The column number.
+ * @param {Object} rule The rule this message relates to.
+ * @method warn
+ * @deprecated Use report instead.
+ */
+ warn: function(message, line, col, rule){
+ this.report(message, line, col, rule);
+ },
+
+ /**
+ * Report an issue.
+ * @param {String} message The message to store.
+ * @param {int} line The line number.
+ * @param {int} col The column number.
+ * @param {Object} rule The rule this message relates to.
+ * @method report
+ */
+ report: function(message, line, col, rule){
+ this.messages.push({
+ type : this.ruleset[rule.id] == 2 ? "error" : "warning",
+ line : line,
+ col : col,
+ message : message,
+ evidence: this.lines[line-1],
+ rule : rule
+ });
+ },
+
+ /**
+ * Report some informational text.
+ * @param {String} message The message to store.
+ * @param {int} line The line number.
+ * @param {int} col The column number.
+ * @param {Object} rule The rule this message relates to.
+ * @method info
+ */
+ info: function(message, line, col, rule){
+ this.messages.push({
+ type : "info",
+ line : line,
+ col : col,
+ message : message,
+ evidence: this.lines[line-1],
+ rule : rule
+ });
+ },
+
+ /**
+ * Report some rollup error information.
+ * @param {String} message The message to store.
+ * @param {Object} rule The rule this message relates to.
+ * @method rollupError
+ */
+ rollupError: function(message, rule){
+ this.messages.push({
+ type : "error",
+ rollup : true,
+ message : message,
+ rule : rule
+ });
+ },
+
+ /**
+ * Report some rollup warning information.
+ * @param {String} message The message to store.
+ * @param {Object} rule The rule this message relates to.
+ * @method rollupWarn
+ */
+ rollupWarn: function(message, rule){
+ this.messages.push({
+ type : "warning",
+ rollup : true,
+ message : message,
+ rule : rule
+ });
+ },
+
+ /**
+ * Report a statistic.
+ * @param {String} name The name of the stat to store.
+ * @param {Variant} value The value of the stat.
+ * @method stat
+ */
+ stat: function(name, value){
+ this.stats[name] = value;
+ }
+};
+
+//expose for testing purposes
+CSSLint._Reporter = Reporter;
+
+/*
+ * Utility functions that make life easier.
+ */
+CSSLint.Util = {
+ /*
+ * Adds all properties from supplier onto receiver,
+ * overwriting if the same name already exists on
+ * reciever.
+ * @param {Object} The object to receive the properties.
+ * @param {Object} The object to provide the properties.
+ * @return {Object} The receiver
+ */
+ mix: function(receiver, supplier){
+ var prop;
+
+ for (prop in supplier){
+ if (supplier.hasOwnProperty(prop)){
+ receiver[prop] = supplier[prop];
+ }
+ }
+
+ return prop;
+ },
+
+ /*
+ * Polyfill for array indexOf() method.
+ * @param {Array} values The array to search.
+ * @param {Variant} value The value to search for.
+ * @return {int} The index of the value if found, -1 if not.
+ */
+ indexOf: function(values, value){
+ if (values.indexOf){
+ return values.indexOf(value);
+ } else {
+ for (var i=0, len=values.length; i < len; i++){
+ if (values[i] === value){
+ return i;
+ }
+ }
+ return -1;
+ }
+ },
+
+ /*
+ * Polyfill for array forEach() method.
+ * @param {Array} values The array to operate on.
+ * @param {Function} func The function to call on each item.
+ * @return {void}
+ */
+ forEach: function(values, func) {
+ if (values.forEach){
+ return values.forEach(func);
+ } else {
+ for (var i=0, len=values.length; i < len; i++){
+ func(values[i], i, values);
+ }
+ }
+ }
+};
+/*
+ * Rule: Don't use adjoining classes (.foo.bar).
+ */
+CSSLint.addRule({
+
+ //rule information
+ id: "adjoining-classes",
+ name: "Disallow adjoining classes",
+ desc: "Don't use adjoining classes.",
+ browsers: "IE6",
+
+ //initialization
+ init: function(parser, reporter){
+ var rule = this;
+ parser.addListener("startrule", function(event){
+ var selectors = event.selectors,
+ selector,
+ part,
+ modifier,
+ classCount,
+ i, j, k;
+
+ for (i=0; i < selectors.length; i++){
+ selector = selectors[i];
+ for (j=0; j < selector.parts.length; j++){
+ part = selector.parts[j];
+ if (part.type == parser.SELECTOR_PART_TYPE){
+ classCount = 0;
+ for (k=0; k < part.modifiers.length; k++){
+ modifier = part.modifiers[k];
+ if (modifier.type == "class"){
+ classCount++;
+ }
+ if (classCount > 1){
+ reporter.report("Don't use adjoining classes.", part.line, part.col, rule);
+ }
+ }
+ }
+ }
+ }
+ });
+ }
+
+});
+
+/*
+ * Rule: Don't use width or height when using padding or border.
+ */
+CSSLint.addRule({
+
+ //rule information
+ id: "box-model",
+ name: "Beware of broken box size",
+ desc: "Don't use width or height when using padding or border.",
+ browsers: "All",
+
+ //initialization
+ init: function(parser, reporter){
+ var rule = this,
+ widthProperties = {
+ border: 1,
+ "border-left": 1,
+ "border-right": 1,
+ padding: 1,
+ "padding-left": 1,
+ "padding-right": 1
+ },
+ heightProperties = {
+ border: 1,
+ "border-bottom": 1,
+ "border-top": 1,
+ padding: 1,
+ "padding-bottom": 1,
+ "padding-top": 1
+ },
+ properties;
+
+ function startRule(){
+ properties = {};
+ }
+
+ function endRule(){
+ var prop;
+ if (properties.height){
+ for (prop in heightProperties){
+ if (heightProperties.hasOwnProperty(prop) && properties[prop]){
+
+ //special case for padding
+ if (!(prop == "padding" && properties[prop].value.parts.length === 2 && properties[prop].value.parts[0].value === 0)){
+ reporter.report("Using height with " + prop + " can sometimes make elements larger than you expect.", properties[prop].line, properties[prop].col, rule);
+ }
+ }
+ }
+ }
+
+ if (properties.width){
+ for (prop in widthProperties){
+ if (widthProperties.hasOwnProperty(prop) && properties[prop]){
+
+ if (!(prop == "padding" && properties[prop].value.parts.length === 2 && properties[prop].value.parts[1].value === 0)){
+ reporter.report("Using width with " + prop + " can sometimes make elements larger than you expect.", properties[prop].line, properties[prop].col, rule);
+ }
+ }
+ }
+ }
+ }
+
+ parser.addListener("startrule", startRule);
+ parser.addListener("startfontface", startRule);
+ parser.addListener("startpage", startRule);
+ parser.addListener("startpagemargin", startRule);
+ parser.addListener("startkeyframerule", startRule);
+
+ parser.addListener("property", function(event){
+ var name = event.property.text.toLowerCase();
+
+ if (heightProperties[name] || widthProperties[name]){
+ if (!/^0\S*$/.test(event.value) && !(name == "border" && event.value == "none")){
+ properties[name] = { line: event.property.line, col: event.property.col, value: event.value };
+ }
+ } else {
+ if (name == "width" || name == "height"){
+ properties[name] = 1;
+ }
+ }
+
+ });
+
+ parser.addListener("endrule", endRule);
+ parser.addListener("endfontface", endRule);
+ parser.addListener("endpage", endRule);
+ parser.addListener("endpagemargin", endRule);
+ parser.addListener("endkeyframerule", endRule);
+ }
+
+});
+
+/*
+ * Rule: box-sizing doesn't work in IE6 and IE7.
+ */
+CSSLint.addRule({
+
+ //rule information
+ id: "box-sizing",
+ name: "Disallow use of box-sizing",
+ desc: "The box-sizing properties isn't supported in IE6 and IE7.",
+ browsers: "IE6, IE7",
+ tags: ["Compatibility"],
+
+ //initialization
+ init: function(parser, reporter){
+ var rule = this;
+
+ parser.addListener("property", function(event){
+ var name = event.property.text.toLowerCase();
+
+ if (name == "box-sizing"){
+ reporter.report("The box-sizing property isn't supported in IE6 and IE7.", event.line, event.col, rule);
+ }
+ });
+ }
+
+});
+/*global CSSLint*/
+CSSLint.addRule({
+
+ //rule information
+ id: "compatible-vendor-prefixes",
+ name: "Require compatible vendor prefixes",
+ desc: "Include all compatible vendor prefixes to reach a wider range of users.",
+ browsers: "All",
+
+ //initialization
+ init: function (parser, reporter) {
+ var rule = this,
+ compatiblePrefixes,
+ properties,
+ prop,
+ variations,
+ prefixed,
+ i,
+ len,
+ arrayPush = Array.prototype.push,
+ applyTo = [];
+
+ // See http://peter.sh/experiments/vendor-prefixed-css-property-overview/ for details
+ compatiblePrefixes = {
+ "animation" : "webkit moz ms",
+ "animation-delay" : "webkit moz ms",
+ "animation-direction" : "webkit moz ms",
+ "animation-duration" : "webkit moz ms",
+ "animation-fill-mode" : "webkit moz ms",
+ "animation-iteration-count" : "webkit moz ms",
+ "animation-name" : "webkit moz ms",
+ "animation-play-state" : "webkit moz ms",
+ "animation-timing-function" : "webkit moz ms",
+ "appearance" : "webkit moz",
+ "border-end" : "webkit moz",
+ "border-end-color" : "webkit moz",
+ "border-end-style" : "webkit moz",
+ "border-end-width" : "webkit moz",
+ "border-image" : "webkit moz o",
+ "border-radius" : "webkit moz",
+ "border-start" : "webkit moz",
+ "border-start-color" : "webkit moz",
+ "border-start-style" : "webkit moz",
+ "border-start-width" : "webkit moz",
+ "box-align" : "webkit moz ms",
+ "box-direction" : "webkit moz ms",
+ "box-flex" : "webkit moz ms",
+ "box-lines" : "webkit ms",
+ "box-ordinal-group" : "webkit moz ms",
+ "box-orient" : "webkit moz ms",
+ "box-pack" : "webkit moz ms",
+ "box-sizing" : "webkit moz",
+ "box-shadow" : "webkit moz",
+ "column-count" : "webkit moz ms",
+ "column-gap" : "webkit moz ms",
+ "column-rule" : "webkit moz ms",
+ "column-rule-color" : "webkit moz ms",
+ "column-rule-style" : "webkit moz ms",
+ "column-rule-width" : "webkit moz ms",
+ "column-width" : "webkit moz ms",
+ "hyphens" : "epub moz",
+ "line-break" : "webkit ms",
+ "margin-end" : "webkit moz",
+ "margin-start" : "webkit moz",
+ "marquee-speed" : "webkit wap",
+ "marquee-style" : "webkit wap",
+ "padding-end" : "webkit moz",
+ "padding-start" : "webkit moz",
+ "tab-size" : "moz o",
+ "text-size-adjust" : "webkit ms",
+ "transform" : "webkit moz ms o",
+ "transform-origin" : "webkit moz ms o",
+ "transition" : "webkit moz o ms",
+ "transition-delay" : "webkit moz o ms",
+ "transition-duration" : "webkit moz o ms",
+ "transition-property" : "webkit moz o ms",
+ "transition-timing-function" : "webkit moz o ms",
+ "user-modify" : "webkit moz",
+ "user-select" : "webkit moz ms",
+ "word-break" : "epub ms",
+ "writing-mode" : "epub ms"
+ };
+
+
+ for (prop in compatiblePrefixes) {
+ if (compatiblePrefixes.hasOwnProperty(prop)) {
+ variations = [];
+ prefixed = compatiblePrefixes[prop].split(' ');
+ for (i = 0, len = prefixed.length; i < len; i++) {
+ variations.push('-' + prefixed[i] + '-' + prop);
+ }
+ compatiblePrefixes[prop] = variations;
+ arrayPush.apply(applyTo, variations);
+ }
+ }
+ parser.addListener("startrule", function () {
+ properties = [];
+ });
+
+ parser.addListener("property", function (event) {
+ var name = event.property;
+ if (CSSLint.Util.indexOf(applyTo, name.text) > -1) {
+ properties.push(name);
+ }
+ });
+
+ parser.addListener("endrule", function (event) {
+ if (!properties.length) {
+ return;
+ }
+
+ var propertyGroups = {},
+ i,
+ len,
+ name,
+ prop,
+ variations,
+ value,
+ full,
+ actual,
+ item,
+ propertiesSpecified;
+
+ for (i = 0, len = properties.length; i < len; i++) {
+ name = properties[i];
+
+ for (prop in compatiblePrefixes) {
+ if (compatiblePrefixes.hasOwnProperty(prop)) {
+ variations = compatiblePrefixes[prop];
+ if (CSSLint.Util.indexOf(variations, name.text) > -1) {
+ if (!propertyGroups[prop]) {
+ propertyGroups[prop] = {
+ full : variations.slice(0),
+ actual : [],
+ actualNodes: []
+ };
+ }
+ if (CSSLint.Util.indexOf(propertyGroups[prop].actual, name.text) === -1) {
+ propertyGroups[prop].actual.push(name.text);
+ propertyGroups[prop].actualNodes.push(name);
+ }
+ }
+ }
+ }
+ }
+
+ for (prop in propertyGroups) {
+ if (propertyGroups.hasOwnProperty(prop)) {
+ value = propertyGroups[prop];
+ full = value.full;
+ actual = value.actual;
+
+ if (full.length > actual.length) {
+ for (i = 0, len = full.length; i < len; i++) {
+ item = full[i];
+ if (CSSLint.Util.indexOf(actual, item) === -1) {
+ propertiesSpecified = (actual.length === 1) ? actual[0] : (actual.length == 2) ? actual.join(" and ") : actual.join(", ");
+ reporter.report("The property " + item + " is compatible with " + propertiesSpecified + " and should be included as well.", value.actualNodes[0].line, value.actualNodes[0].col, rule);
+ }
+ }
+
+ }
+ }
+ }
+ });
+ }
+});
+/*global CSSLint*/
+CSSLint.addRule({
+
+ //rule information
+ id: "display-property-grouping",
+ name: "Require properties appropriate for display",
+ desc: "Certain properties shouldn't be used with certain display property values.",
+ browsers: "All",
+
+ //initialization
+ init: function(parser, reporter){
+ var rule = this;
+
+ var propertiesToCheck = {
+ display: 1,
+ "float": "none",
+ height: 1,
+ width: 1,
+ margin: 1,
+ "margin-left": 1,
+ "margin-right": 1,
+ "margin-bottom": 1,
+ "margin-top": 1,
+ padding: 1,
+ "padding-left": 1,
+ "padding-right": 1,
+ "padding-bottom": 1,
+ "padding-top": 1,
+ "vertical-align": 1
+ },
+ properties;
+
+ function reportProperty(name, display, msg){
+ if (properties[name]){
+ if (typeof propertiesToCheck[name] != "string" || properties[name].value.toLowerCase() != propertiesToCheck[name]){
+ reporter.report(msg || name + " can't be used with display: " + display + ".", properties[name].line, properties[name].col, rule);
+ }
+ }
+ }
+
+ function startRule(){
+ properties = {};
+ }
+
+ function endRule(){
+
+ var display = properties.display ? properties.display.value : null;
+ if (display){
+ switch(display){
+
+ case "inline":
+ //height, width, margin-top, margin-bottom, float should not be used with inline
+ reportProperty("height", display);
+ reportProperty("width", display);
+ reportProperty("margin", display);
+ reportProperty("margin-top", display);
+ reportProperty("margin-bottom", display);
+ reportProperty("float", display, "display:inline has no effect on floated elements (but may be used to fix the IE6 double-margin bug).");
+ break;
+
+ case "block":
+ //vertical-align should not be used with block
+ reportProperty("vertical-align", display);
+ break;
+
+ case "inline-block":
+ //float should not be used with inline-block
+ reportProperty("float", display);
+ break;
+
+ default:
+ //margin, float should not be used with table
+ if (display.indexOf("table-") === 0){
+ reportProperty("margin", display);
+ reportProperty("margin-left", display);
+ reportProperty("margin-right", display);
+ reportProperty("margin-top", display);
+ reportProperty("margin-bottom", display);
+ reportProperty("float", display);
+ }
+
+ //otherwise do nothing
+ }
+ }
+
+ }
+
+ parser.addListener("startrule", startRule);
+ parser.addListener("startfontface", startRule);
+ parser.addListener("startkeyframerule", startRule);
+ parser.addListener("startpagemargin", startRule);
+ parser.addListener("startpage", startRule);
+
+ parser.addListener("property", function(event){
+ var name = event.property.text.toLowerCase();
+
+ if (propertiesToCheck[name]){
+ properties[name] = { value: event.value.text, line: event.property.line, col: event.property.col };
+ }
+ });
+
+ parser.addListener("endrule", endRule);
+ parser.addListener("endfontface", endRule);
+ parser.addListener("endkeyframerule", endRule);
+ parser.addListener("endpagemargin", endRule);
+ parser.addListener("endpage", endRule);
+
+ }
+
+});
+/*global CSSLint*/
+CSSLint.addRule({
+
+ //rule information
+ id: "duplicate-background-images",
+ name: "Disallow duplicate background images",
+ desc: "Every background-image should be unique. Use a common class for e.g. sprites.",
+ browsers: "All",
+
+ //initialization
+ init: function(parser, reporter){
+ var rule = this,
+ stack = {};
+
+ parser.addListener("property", function(event){
+ var name = event.property.text,
+ value = event.value,
+ i, len;
+
+ if (name.match(/background/i)) {
+ for (i=0, len=value.parts.length; i < len; i++) {
+ if (value.parts[i].type == 'uri') {
+ if (typeof stack[value.parts[i].uri] === 'undefined') {
+ stack[value.parts[i].uri] = event;
+ }
+ else {
+ reporter.report("Background image '" + value.parts[i].uri + "' was used multiple times, first declared at line " + stack[value.parts[i].uri].line + ", col " + stack[value.parts[i].uri].col + ".", event.line, event.col, rule);
+ }
+ }
+ }
+ }
+ });
+ }
+});
+/*global CSSLint*/
+CSSLint.addRule({
+
+ //rule information
+ id: "duplicate-properties",
+ name: "Disallow duplicate properties",
+ desc: "Duplicate properties must appear one after the other.",
+ browsers: "All",
+
+ //initialization
+ init: function(parser, reporter){
+ var rule = this,
+ properties,
+ lastProperty;
+
+ function startRule(event){
+ properties = {};
+ }
+
+ parser.addListener("startrule", startRule);
+ parser.addListener("startfontface", startRule);
+ parser.addListener("startpage", startRule);
+ parser.addListener("startpagemargin", startRule);
+ parser.addListener("startkeyframerule", startRule);
+
+ parser.addListener("property", function(event){
+ var property = event.property,
+ name = property.text.toLowerCase();
+
+ if (properties[name] && (lastProperty != name || properties[name] == event.value.text)){
+ reporter.report("Duplicate property '" + event.property + "' found.", event.line, event.col, rule);
+ }
+
+ properties[name] = event.value.text;
+ lastProperty = name;
+
+ });
+
+
+ }
+
+});
+/*global CSSLint*/
+CSSLint.addRule({
+
+ //rule information
+ id: "empty-rules",
+ name: "Disallow empty rules",
+ desc: "Rules without any properties specified should be removed.",
+ browsers: "All",
+
+ //initialization
+ init: function(parser, reporter){
+ var rule = this,
+ count = 0;
+
+ parser.addListener("startrule", function(){
+ count=0;
+ });
+
+ parser.addListener("property", function(){
+ count++;
+ });
+
+ parser.addListener("endrule", function(event){
+ var selectors = event.selectors;
+ if (count === 0){
+ reporter.report("Rule is empty.", selectors[0].line, selectors[0].col, rule);
+ }
+ });
+ }
+
+});
+/*global CSSLint*/
+CSSLint.addRule({
+
+ //rule information
+ id: "errors",
+ name: "Parsing Errors",
+ desc: "This rule looks for recoverable syntax errors.",
+ browsers: "All",
+
+ //initialization
+ init: function(parser, reporter){
+ var rule = this;
+
+ parser.addListener("error", function(event){
+ reporter.error(event.message, event.line, event.col, rule);
+ });
+
+ }
+
+});
+CSSLint.addRule({
+
+ //rule information
+ id: "fallback-colors",
+ name: "Require fallback colors",
+ desc: "For older browsers that don't support RGBA, HSL, or HSLA, provide a fallback color.",
+ browsers: "IE6,IE7,IE8",
+
+ //initialization
+ init: function(parser, reporter){
+ var rule = this,
+ lastProperty,
+ propertiesToCheck = {
+ color: 1,
+ background: 1,
+ "background-color": 1
+ },
+ properties;
+
+ function startRule(event){
+ properties = {};
+ lastProperty = null;
+ }
+
+ parser.addListener("startrule", startRule);
+ parser.addListener("startfontface", startRule);
+ parser.addListener("startpage", startRule);
+ parser.addListener("startpagemargin", startRule);
+ parser.addListener("startkeyframerule", startRule);
+
+ parser.addListener("property", function(event){
+ var property = event.property,
+ name = property.text.toLowerCase(),
+ parts = event.value.parts,
+ i = 0,
+ colorType = "",
+ len = parts.length;
+
+ if(propertiesToCheck[name]){
+ while(i < len){
+ if (parts[i].type == "color"){
+ if ("alpha" in parts[i] || "hue" in parts[i]){
+
+ if (/([^\)]+)\(/.test(parts[i])){
+ colorType = RegExp.$1.toUpperCase();
+ }
+
+ if (!lastProperty || (lastProperty.property.text.toLowerCase() != name || lastProperty.colorType != "compat")){
+ reporter.report("Fallback " + name + " (hex or RGB) should precede " + colorType + " " + name + ".", event.line, event.col, rule);
+ }
+ } else {
+ event.colorType = "compat";
+ }
+ }
+
+ i++;
+ }
+ }
+
+ lastProperty = event;
+ });
+
+ }
+
+});
+/*global CSSLint*/
+CSSLint.addRule({
+
+ //rule information
+ id: "floats",
+ name: "Disallow too many floats",
+ desc: "This rule tests if the float property is used too many times",
+ browsers: "All",
+
+ //initialization
+ init: function(parser, reporter){
+ var rule = this;
+ var count = 0;
+
+ //count how many times "float" is used
+ parser.addListener("property", function(event){
+ if (event.property.text.toLowerCase() == "float" &&
+ event.value.text.toLowerCase() != "none"){
+ count++;
+ }
+ });
+
+ //report the results
+ parser.addListener("endstylesheet", function(){
+ reporter.stat("floats", count);
+ if (count >= 10){
+ reporter.rollupWarn("Too many floats (" + count + "), you're probably using them for layout. Consider using a grid system instead.", rule);
+ }
+ });
+ }
+
+});
+/*global CSSLint*/
+CSSLint.addRule({
+
+ //rule information
+ id: "font-faces",
+ name: "Don't use too many web fonts",
+ desc: "Too many different web fonts in the same stylesheet.",
+ browsers: "All",
+
+ //initialization
+ init: function(parser, reporter){
+ var rule = this,
+ count = 0;
+
+
+ parser.addListener("startfontface", function(){
+ count++;
+ });
+
+ parser.addListener("endstylesheet", function(){
+ if (count > 5){
+ reporter.rollupWarn("Too many @font-face declarations (" + count + ").", rule);
+ }
+ });
+ }
+
+});
+
+/*global CSSLint*/
+CSSLint.addRule({
+
+ //rule information
+ id: "font-sizes",
+ name: "Disallow too many font sizes",
+ desc: "Checks the number of font-size declarations.",
+ browsers: "All",
+
+ //initialization
+ init: function(parser, reporter){
+ var rule = this,
+ count = 0;
+
+ //check for use of "font-size"
+ parser.addListener("property", function(event){
+ if (event.property == "font-size"){
+ count++;
+ }
+ });
+
+ //report the results
+ parser.addListener("endstylesheet", function(){
+ reporter.stat("font-sizes", count);
+ if (count >= 10){
+ reporter.rollupWarn("Too many font-size declarations (" + count + "), abstraction needed.", rule);
+ }
+ });
+ }
+
+});
+/*global CSSLint*/
+CSSLint.addRule({
+
+ //rule information
+ id: "gradients",
+ name: "Require all gradient definitions",
+ desc: "When using a vendor-prefixed gradient, make sure to use them all.",
+ browsers: "All",
+
+ //initialization
+ init: function(parser, reporter){
+ var rule = this,
+ gradients;
+
+ parser.addListener("startrule", function(){
+ gradients = {
+ moz: 0,
+ webkit: 0,
+ oldWebkit: 0,
+ ms: 0,
+ o: 0
+ };
+ });
+
+ parser.addListener("property", function(event){
+
+ if (/\-(moz|ms|o|webkit)(?:\-(?:linear|radial))\-gradient/i.test(event.value)){
+ gradients[RegExp.$1] = 1;
+ } else if (/\-webkit\-gradient/i.test(event.value)){
+ gradients.oldWebkit = 1;
+ }
+
+ });
+
+ parser.addListener("endrule", function(event){
+ var missing = [];
+
+ if (!gradients.moz){
+ missing.push("Firefox 3.6+");
+ }
+
+ if (!gradients.webkit){
+ missing.push("Webkit (Safari 5+, Chrome)");
+ }
+
+ if (!gradients.oldWebkit){
+ missing.push("Old Webkit (Safari 4+, Chrome)");
+ }
+
+ if (!gradients.ms){
+ missing.push("Internet Explorer 10+");
+ }
+
+ if (!gradients.o){
+ missing.push("Opera 11.1+");
+ }
+
+ if (missing.length && missing.length < 5){
+ reporter.report("Missing vendor-prefixed CSS gradients for " + missing.join(", ") + ".", event.selectors[0].line, event.selectors[0].col, rule);
+ }
+
+ });
+
+ }
+
+});
+/*global CSSLint*/
+CSSLint.addRule({
+
+ //rule information
+ id: "ids",
+ name: "Disallow IDs in selectors",
+ desc: "Selectors should not contain IDs.",
+ browsers: "All",
+
+ //initialization
+ init: function(parser, reporter){
+ var rule = this;
+ parser.addListener("startrule", function(event){
+ var selectors = event.selectors,
+ selector,
+ part,
+ modifier,
+ idCount,
+ i, j, k;
+
+ for (i=0; i < selectors.length; i++){
+ selector = selectors[i];
+ idCount = 0;
+
+ for (j=0; j < selector.parts.length; j++){
+ part = selector.parts[j];
+ if (part.type == parser.SELECTOR_PART_TYPE){
+ for (k=0; k < part.modifiers.length; k++){
+ modifier = part.modifiers[k];
+ if (modifier.type == "id"){
+ idCount++;
+ }
+ }
+ }
+ }
+
+ if (idCount == 1){
+ reporter.report("Don't use IDs in selectors.", selector.line, selector.col, rule);
+ } else if (idCount > 1){
+ reporter.report(idCount + " IDs in the selector, really?", selector.line, selector.col, rule);
+ }
+ }
+
+ });
+ }
+
+});
+/*global CSSLint*/
+CSSLint.addRule({
+
+ //rule information
+ id: "import",
+ name: "Disallow @import",
+ desc: "Don't use @import, use <link> instead.",
+ browsers: "All",
+
+ //initialization
+ init: function(parser, reporter){
+ var rule = this;
+
+ parser.addListener("import", function(event){
+ reporter.report("@import prevents parallel downloads, use <link> instead.", event.line, event.col, rule);
+ });
+
+ }
+
+});
+/*global CSSLint*/
+CSSLint.addRule({
+
+ //rule information
+ id: "important",
+ name: "Disallow !important",
+ desc: "Be careful when using !important declaration",
+ browsers: "All",
+
+ //initialization
+ init: function(parser, reporter){
+ var rule = this,
+ count = 0;
+
+ //warn that important is used and increment the declaration counter
+ parser.addListener("property", function(event){
+ if (event.important === true){
+ count++;
+ reporter.report("Use of !important", event.line, event.col, rule);
+ }
+ });
+
+ //if there are more than 10, show an error
+ parser.addListener("endstylesheet", function(){
+ reporter.stat("important", count);
+ if (count >= 10){
+ reporter.rollupWarn("Too many !important declarations (" + count + "), try to use less than 10 to avoid specifity issues.", rule);
+ }
+ });
+ }
+
+});
+/*global CSSLint*/
+CSSLint.addRule({
+
+ //rule information
+ id: "known-properties",
+ name: "Require use of known properties",
+ desc: "Properties should be known (listed in CSS specification) or be a vendor-prefixed property.",
+ browsers: "All",
+
+ //initialization
+ init: function(parser, reporter){
+ var rule = this,
+ properties = {
+
+ "alignment-adjust": 1,
+ "alignment-baseline": 1,
+ "animation": 1,
+ "animation-delay": 1,
+ "animation-direction": 1,
+ "animation-duration": 1,
+ "animation-fill-mode": 1,
+ "animation-iteration-count": 1,
+ "animation-name": 1,
+ "animation-play-state": 1,
+ "animation-timing-function": 1,
+ "appearance": 1,
+ "azimuth": 1,
+ "backface-visibility": 1,
+ "background": 1,
+ "background-attachment": 1,
+ "background-break": 1,
+ "background-clip": 1,
+ "background-color": 1,
+ "background-image": 1,
+ "background-origin": 1,
+ "background-position": 1,
+ "background-repeat": 1,
+ "background-size": 1,
+ "baseline-shift": 1,
+ "binding": 1,
+ "bleed": 1,
+ "bookmark-label": 1,
+ "bookmark-level": 1,
+ "bookmark-state": 1,
+ "bookmark-target": 1,
+ "border": 1,
+ "border-bottom": 1,
+ "border-bottom-color": 1,
+ "border-bottom-left-radius": 1,
+ "border-bottom-right-radius": 1,
+ "border-bottom-style": 1,
+ "border-bottom-width": 1,
+ "border-collapse": 1,
+ "border-color": 1,
+ "border-image": 1,
+ "border-image-outset": 1,
+ "border-image-repeat": 1,
+ "border-image-slice": 1,
+ "border-image-source": 1,
+ "border-image-width": 1,
+ "border-left": 1,
+ "border-left-color": 1,
+ "border-left-style": 1,
+ "border-left-width": 1,
+ "border-radius": 1,
+ "border-right": 1,
+ "border-right-color": 1,
+ "border-right-style": 1,
+ "border-right-width": 1,
+ "border-spacing": 1,
+ "border-style": 1,
+ "border-top": 1,
+ "border-top-color": 1,
+ "border-top-left-radius": 1,
+ "border-top-right-radius": 1,
+ "border-top-style": 1,
+ "border-top-width": 1,
+ "border-width": 1,
+ "bottom": 1,
+ "box-align": 1,
+ "box-decoration-break": 1,
+ "box-direction": 1,
+ "box-flex": 1,
+ "box-flex-group": 1,
+ "box-lines": 1,
+ "box-ordinal-group": 1,
+ "box-orient": 1,
+ "box-pack": 1,
+ "box-shadow": 1,
+ "box-sizing": 1,
+ "break-after": 1,
+ "break-before": 1,
+ "break-inside": 1,
+ "caption-side": 1,
+ "clear": 1,
+ "clip": 1,
+ "color": 1,
+ "color-profile": 1,
+ "column-count": 1,
+ "column-fill": 1,
+ "column-gap": 1,
+ "column-rule": 1,
+ "column-rule-color": 1,
+ "column-rule-style": 1,
+ "column-rule-width": 1,
+ "column-span": 1,
+ "column-width": 1,
+ "columns": 1,
+ "content": 1,
+ "counter-increment": 1,
+ "counter-reset": 1,
+ "crop": 1,
+ "cue": 1,
+ "cue-after": 1,
+ "cue-before": 1,
+ "cursor": 1,
+ "direction": 1,
+ "display": 1,
+ "dominant-baseline": 1,
+ "drop-initial-after-adjust": 1,
+ "drop-initial-after-align": 1,
+ "drop-initial-before-adjust": 1,
+ "drop-initial-before-align": 1,
+ "drop-initial-size": 1,
+ "drop-initial-value": 1,
+ "elevation": 1,
+ "empty-cells": 1,
+ "fit": 1,
+ "fit-position": 1,
+ "float": 1,
+ "float-offset": 1,
+ "font": 1,
+ "font-family": 1,
+ "font-size": 1,
+ "font-size-adjust": 1,
+ "font-stretch": 1,
+ "font-style": 1,
+ "font-variant": 1,
+ "font-weight": 1,
+ "grid-columns": 1,
+ "grid-rows": 1,
+ "hanging-punctuation": 1,
+ "height": 1,
+ "hyphenate-after": 1,
+ "hyphenate-before": 1,
+ "hyphenate-character": 1,
+ "hyphenate-lines": 1,
+ "hyphenate-resource": 1,
+ "hyphens": 1,
+ "icon": 1,
+ "image-orientation": 1,
+ "image-rendering": 1,
+ "image-resolution": 1,
+ "inline-box-align": 1,
+ "left": 1,
+ "letter-spacing": 1,
+ "line-height": 1,
+ "line-stacking": 1,
+ "line-stacking-ruby": 1,
+ "line-stacking-shift": 1,
+ "line-stacking-strategy": 1,
+ "list-style": 1,
+ "list-style-image": 1,
+ "list-style-position": 1,
+ "list-style-type": 1,
+ "margin": 1,
+ "margin-bottom": 1,
+ "margin-left": 1,
+ "margin-right": 1,
+ "margin-top": 1,
+ "mark": 1,
+ "mark-after": 1,
+ "mark-before": 1,
+ "marks": 1,
+ "marquee-direction": 1,
+ "marquee-play-count": 1,
+ "marquee-speed": 1,
+ "marquee-style": 1,
+ "max-height": 1,
+ "max-width": 1,
+ "min-height": 1,
+ "min-width": 1,
+ "move-to": 1,
+ "nav-down": 1,
+ "nav-index": 1,
+ "nav-left": 1,
+ "nav-right": 1,
+ "nav-up": 1,
+ "opacity": 1,
+ "orphans": 1,
+ "outline": 1,
+ "outline-color": 1,
+ "outline-offset": 1,
+ "outline-style": 1,
+ "outline-width": 1,
+ "overflow": 1,
+ "overflow-style": 1,
+ "overflow-x": 1,
+ "overflow-y": 1,
+ "padding": 1,
+ "padding-bottom": 1,
+ "padding-left": 1,
+ "padding-right": 1,
+ "padding-top": 1,
+ "page": 1,
+ "page-break-after": 1,
+ "page-break-before": 1,
+ "page-break-inside": 1,
+ "page-policy": 1,
+ "pause": 1,
+ "pause-after": 1,
+ "pause-before": 1,
+ "perspective": 1,
+ "perspective-origin": 1,
+ "phonemes": 1,
+ "pitch": 1,
+ "pitch-range": 1,
+ "play-during": 1,
+ "position": 1,
+ "presentation-level": 1,
+ "punctuation-trim": 1,
+ "quotes": 1,
+ "rendering-intent": 1,
+ "resize": 1,
+ "rest": 1,
+ "rest-after": 1,
+ "rest-before": 1,
+ "richness": 1,
+ "right": 1,
+ "rotation": 1,
+ "rotation-point": 1,
+ "ruby-align": 1,
+ "ruby-overhang": 1,
+ "ruby-position": 1,
+ "ruby-span": 1,
+ "size": 1,
+ "speak": 1,
+ "speak-header": 1,
+ "speak-numeral": 1,
+ "speak-punctuation": 1,
+ "speech-rate": 1,
+ "stress": 1,
+ "string-set": 1,
+ "table-layout": 1,
+ "target": 1,
+ "target-name": 1,
+ "target-new": 1,
+ "target-position": 1,
+ "text-align": 1,
+ "text-align-last": 1,
+ "text-decoration": 1,
+ "text-emphasis": 1,
+ "text-height": 1,
+ "text-indent": 1,
+ "text-justify": 1,
+ "text-outline": 1,
+ "text-shadow": 1,
+ "text-transform": 1,
+ "text-wrap": 1,
+ "top": 1,
+ "transform": 1,
+ "transform-origin": 1,
+ "transform-style": 1,
+ "transition": 1,
+ "transition-delay": 1,
+ "transition-duration": 1,
+ "transition-property": 1,
+ "transition-timing-function": 1,
+ "unicode-bidi": 1,
+ "user-modify": 1,
+ "user-select": 1,
+ "vertical-align": 1,
+ "visibility": 1,
+ "voice-balance": 1,
+ "voice-duration": 1,
+ "voice-family": 1,
+ "voice-pitch": 1,
+ "voice-pitch-range": 1,
+ "voice-rate": 1,
+ "voice-stress": 1,
+ "voice-volume": 1,
+ "volume": 1,
+ "white-space": 1,
+ "white-space-collapse": 1,
+ "widows": 1,
+ "width": 1,
+ "word-break": 1,
+ "word-spacing": 1,
+ "word-wrap": 1,
+ "z-index": 1,
+
+ //IE
+ "filter": 1,
+ "zoom": 1,
+
+ //@font-face
+ "src": 1
+ };
+
+ parser.addListener("property", function(event){
+ var name = event.property.text.toLowerCase();
+
+ if (event.invalid) {
+ reporter.report(event.invalid.message, event.line, event.col, rule);
+ }
+ //if (!properties[name] && name.charAt(0) != "-"){
+ // reporter.error("Unknown property '" + event.property + "'.", event.line, event.col, rule);
+ //}
+
+ });
+ }
+
+});
+/*global CSSLint*/
+CSSLint.addRule({
+
+ //rule information
+ id: "outline-none",
+ name: "Disallow outline: none",
+ desc: "Use of outline: none or outline: 0 should be limited to :focus rules.",
+ browsers: "All",
+ tags: ["Accessibility"],
+
+ //initialization
+ init: function(parser, reporter){
+ var rule = this,
+ lastRule;
+
+ function startRule(event){
+ if (event.selectors){
+ lastRule = {
+ line: event.line,
+ col: event.col,
+ selectors: event.selectors,
+ propCount: 0,
+ outline: false
+ };
+ } else {
+ lastRule = null;
+ }
+ }
+
+ function endRule(event){
+ if (lastRule){
+ if (lastRule.outline){
+ if (lastRule.selectors.toString().toLowerCase().indexOf(":focus") == -1){
+ reporter.report("Outlines should only be modified using :focus.", lastRule.line, lastRule.col, rule);
+ } else if (lastRule.propCount == 1) {
+ reporter.report("Outlines shouldn't be hidden unless other visual changes are made.", lastRule.line, lastRule.col, rule);
+ }
+ }
+ }
+ }
+
+ parser.addListener("startrule", startRule);
+ parser.addListener("startfontface", startRule);
+ parser.addListener("startpage", startRule);
+ parser.addListener("startpagemargin", startRule);
+ parser.addListener("startkeyframerule", startRule);
+
+ parser.addListener("property", function(event){
+ var name = event.property.text.toLowerCase(),
+ value = event.value;
+
+ if (lastRule){
+ lastRule.propCount++;
+ if (name == "outline" && (value == "none" || value == "0")){
+ lastRule.outline = true;
+ }
+ }
+
+ });
+
+ parser.addListener("endrule", endRule);
+ parser.addListener("endfontface", endRule);
+ parser.addListener("endpage", endRule);
+ parser.addListener("endpagemargin", endRule);
+ parser.addListener("endkeyframerule", endRule);
+
+ }
+
+});
+/*global CSSLint*/
+CSSLint.addRule({
+
+ //rule information
+ id: "overqualified-elements",
+ name: "Disallow overqualified elements",
+ desc: "Don't use classes or IDs with elements (a.foo or a#foo).",
+ browsers: "All",
+
+ //initialization
+ init: function(parser, reporter){
+ var rule = this,
+ classes = {};
+
+ parser.addListener("startrule", function(event){
+ var selectors = event.selectors,
+ selector,
+ part,
+ modifier,
+ i, j, k;
+
+ for (i=0; i < selectors.length; i++){
+ selector = selectors[i];
+
+ for (j=0; j < selector.parts.length; j++){
+ part = selector.parts[j];
+ if (part.type == parser.SELECTOR_PART_TYPE){
+ for (k=0; k < part.modifiers.length; k++){
+ modifier = part.modifiers[k];
+ if (part.elementName && modifier.type == "id"){
+ reporter.report("Element (" + part + ") is overqualified, just use " + modifier + " without element name.", part.line, part.col, rule);
+ } else if (modifier.type == "class"){
+
+ if (!classes[modifier]){
+ classes[modifier] = [];
+ }
+ classes[modifier].push({ modifier: modifier, part: part });
+ }
+ }
+ }
+ }
+ }
+ });
+
+ parser.addListener("endstylesheet", function(){
+
+ var prop;
+ for (prop in classes){
+ if (classes.hasOwnProperty(prop)){
+
+ //one use means that this is overqualified
+ if (classes[prop].length == 1 && classes[prop][0].part.elementName){
+ reporter.report("Element (" + classes[prop][0].part + ") is overqualified, just use " + classes[prop][0].modifier + " without element name.", classes[prop][0].part.line, classes[prop][0].part.col, rule);
+ }
+ }
+ }
+ });
+ }
+
+});
+/*global CSSLint*/
+CSSLint.addRule({
+
+ //rule information
+ id: "qualified-headings",
+ name: "Disallow qualified headings",
+ desc: "Headings should not be qualified (namespaced).",
+ browsers: "All",
+
+ //initialization
+ init: function(parser, reporter){
+ var rule = this;
+
+ parser.addListener("startrule", function(event){
+ var selectors = event.selectors,
+ selector,
+ part,
+ i, j;
+
+ for (i=0; i < selectors.length; i++){
+ selector = selectors[i];
+
+ for (j=0; j < selector.parts.length; j++){
+ part = selector.parts[j];
+ if (part.type == parser.SELECTOR_PART_TYPE){
+ if (part.elementName && /h[1-6]/.test(part.elementName.toString()) && j > 0){
+ reporter.report("Heading (" + part.elementName + ") should not be qualified.", part.line, part.col, rule);
+ }
+ }
+ }
+ }
+ });
+ }
+
+});
+/*global CSSLint*/
+CSSLint.addRule({
+
+ //rule information
+ id: "regex-selectors",
+ name: "Disallow selectors that look like regexs",
+ desc: "Selectors that look like regular expressions are slow and should be avoided.",
+ browsers: "All",
+
+ //initialization
+ init: function(parser, reporter){
+ var rule = this;
+
+ parser.addListener("startrule", function(event){
+ var selectors = event.selectors,
+ selector,
+ part,
+ modifier,
+ i, j, k;
+
+ for (i=0; i < selectors.length; i++){
+ selector = selectors[i];
+ for (j=0; j < selector.parts.length; j++){
+ part = selector.parts[j];
+ if (part.type == parser.SELECTOR_PART_TYPE){
+ for (k=0; k < part.modifiers.length; k++){
+ modifier = part.modifiers[k];
+ if (modifier.type == "attribute"){
+ if (/([\~\|\^\$\*]=)/.test(modifier)){
+ reporter.report("Attribute selectors with " + RegExp.$1 + " are slow!", modifier.line, modifier.col, rule);
+ }
+ }
+
+ }
+ }
+ }
+ }
+ });
+ }
+
+});
+/*global CSSLint*/
+CSSLint.addRule({
+
+ //rule information
+ id: "rules-count",
+ name: "Rules Count",
+ desc: "Track how many rules there are.",
+ browsers: "All",
+
+ //initialization
+ init: function(parser, reporter){
+ var rule = this,
+ count = 0;
+
+ //count each rule
+ parser.addListener("startrule", function(){
+ count++;
+ });
+
+ parser.addListener("endstylesheet", function(){
+ reporter.stat("rule-count", count);
+ });
+ }
+
+});
+/*global CSSLint*/
+CSSLint.addRule({
+
+ //rule information
+ id: "shorthand",
+ name: "Require shorthand properties",
+ desc: "Use shorthand properties where possible.",
+ browsers: "All",
+
+ //initialization
+ init: function(parser, reporter){
+ var rule = this,
+ prop, i, len,
+ propertiesToCheck = {},
+ properties,
+ mapping = {
+ "margin": [
+ "margin-top",
+ "margin-bottom",
+ "margin-left",
+ "margin-right"
+ ],
+ "padding": [
+ "padding-top",
+ "padding-bottom",
+ "padding-left",
+ "padding-right"
+ ]
+ };
+
+ //initialize propertiesToCheck
+ for (prop in mapping){
+ if (mapping.hasOwnProperty(prop)){
+ for (i=0, len=mapping[prop].length; i < len; i++){
+ propertiesToCheck[mapping[prop][i]] = prop;
+ }
+ }
+ }
+
+ function startRule(event){
+ properties = {};
+ }
+
+ //event handler for end of rules
+ function endRule(event){
+
+ var prop, i, len, total;
+
+ //check which properties this rule has
+ for (prop in mapping){
+ if (mapping.hasOwnProperty(prop)){
+ total=0;
+
+ for (i=0, len=mapping[prop].length; i < len; i++){
+ total += properties[mapping[prop][i]] ? 1 : 0;
+ }
+
+ if (total == mapping[prop].length){
+ reporter.report("The properties " + mapping[prop].join(", ") + " can be replaced by " + prop + ".", event.line, event.col, rule);
+ }
+ }
+ }
+ }
+
+ parser.addListener("startrule", startRule);
+ parser.addListener("startfontface", startRule);
+
+ //check for use of "font-size"
+ parser.addListener("property", function(event){
+ var name = event.property.toString().toLowerCase(),
+ value = event.value.parts[0].value;
+
+ if (propertiesToCheck[name]){
+ properties[name] = 1;
+ }
+ });
+
+ parser.addListener("endrule", endRule);
+ parser.addListener("endfontface", endRule);
+
+ }
+
+});
+/*global CSSLint*/
+CSSLint.addRule({
+
+ //rule information
+ id: "text-indent",
+ name: "Disallow negative text-indent",
+ desc: "Checks for text indent less than -99px",
+ browsers: "All",
+
+ //initialization
+ init: function(parser, reporter){
+ var rule = this,
+ textIndent = false;
+
+
+ function startRule(event){
+ textIndent = false;
+ }
+
+ //event handler for end of rules
+ function endRule(event){
+ if (textIndent){
+ reporter.report("Negative text-indent doesn't work well with RTL. If you use text-indent for image replacement explicitly set direction for that item to ltr.", textIndent.line, textIndent.col, rule);
+ }
+ }
+
+ parser.addListener("startrule", startRule);
+ parser.addListener("startfontface", startRule);
+
+ //check for use of "font-size"
+ parser.addListener("property", function(event){
+ var name = event.property.toString().toLowerCase(),
+ value = event.value;
+
+ if (name == "text-indent" && value.parts[0].value < -99){
+ textIndent = event.property;
+ } else if (name == "direction" && value == "ltr"){
+ textIndent = false;
+ }
+ });
+
+ parser.addListener("endrule", endRule);
+ parser.addListener("endfontface", endRule);
+
+ }
+
+});
+/*global CSSLint*/
+CSSLint.addRule({
+
+ //rule information
+ id: "unique-headings",
+ name: "Headings should only be defined once",
+ desc: "Headings should be defined only once.",
+ browsers: "All",
+
+ //initialization
+ init: function(parser, reporter){
+ var rule = this;
+
+ var headings = {
+ h1: 0,
+ h2: 0,
+ h3: 0,
+ h4: 0,
+ h5: 0,
+ h6: 0
+ };
+
+ parser.addListener("startrule", function(event){
+ var selectors = event.selectors,
+ selector,
+ part,
+ pseudo,
+ i, j;
+
+ for (i=0; i < selectors.length; i++){
+ selector = selectors[i];
+ part = selector.parts[selector.parts.length-1];
+
+ if (part.elementName && /(h[1-6])/i.test(part.elementName.toString())){
+
+ for (j=0; j < part.modifiers.length; j++){
+ if (part.modifiers[j].type == "pseudo"){
+ pseudo = true;
+ break;
+ }
+ }
+
+ if (!pseudo){
+ headings[RegExp.$1]++;
+ if (headings[RegExp.$1] > 1) {
+ reporter.report("Heading (" + part.elementName + ") has already been defined.", part.line, part.col, rule);
+ }
+ }
+ }
+ }
+ });
+
+ parser.addListener("endstylesheet", function(event){
+ var prop,
+ messages = [];
+
+ for (prop in headings){
+ if (headings.hasOwnProperty(prop)){
+ if (headings[prop] > 1){
+ messages.push(headings[prop] + " " + prop + "s");
+ }
+ }
+ }
+
+ if (messages.length){
+ reporter.rollupWarn("You have " + messages.join(", ") + " defined in this stylesheet.", rule);
+ }
+ });
+ }
+
+});
+/*global CSSLint*/
+CSSLint.addRule({
+
+ //rule information
+ id: "universal-selector",
+ name: "Disallow universal selector",
+ desc: "The universal selector (*) is known to be slow.",
+ browsers: "All",
+
+ //initialization
+ init: function(parser, reporter){
+ var rule = this;
+
+ parser.addListener("startrule", function(event){
+ var selectors = event.selectors,
+ selector,
+ part,
+ modifier,
+ i, j, k;
+
+ for (i=0; i < selectors.length; i++){
+ selector = selectors[i];
+
+ part = selector.parts[selector.parts.length-1];
+ if (part.elementName == "*"){
+ reporter.report(rule.desc, part.line, part.col, rule);
+ }
+ }
+ });
+ }
+
+});
+/*global CSSLint*/
+CSSLint.addRule({
+
+ //rule information
+ id: "unqualified-attributes",
+ name: "Disallow unqualified attribute selectors",
+ desc: "Unqualified attribute selectors are known to be slow.",
+ browsers: "All",
+
+ //initialization
+ init: function(parser, reporter){
+ var rule = this;
+
+ parser.addListener("startrule", function(event){
+
+ var selectors = event.selectors,
+ selector,
+ part,
+ modifier,
+ i, j, k;
+
+ for (i=0; i < selectors.length; i++){
+ selector = selectors[i];
+
+ part = selector.parts[selector.parts.length-1];
+ if (part.type == parser.SELECTOR_PART_TYPE){
+ for (k=0; k < part.modifiers.length; k++){
+ modifier = part.modifiers[k];
+ if (modifier.type == "attribute" && (!part.elementName || part.elementName == "*")){
+ reporter.report(rule.desc, part.line, part.col, rule);
+ }
+ }
+ }
+
+ }
+ });
+ }
+
+});
+/*global CSSLint*/
+CSSLint.addRule({
+
+ //rule information
+ id: "vendor-prefix",
+ name: "Require standard property with vendor prefix",
+ desc: "When using a vendor-prefixed property, make sure to include the standard one.",
+ browsers: "All",
+
+ //initialization
+ init: function(parser, reporter){
+ var rule = this,
+ properties,
+ num,
+ propertiesToCheck = {
+ "-webkit-border-radius": "border-radius",
+ "-webkit-border-top-left-radius": "border-top-left-radius",
+ "-webkit-border-top-right-radius": "border-top-right-radius",
+ "-webkit-border-bottom-left-radius": "border-bottom-left-radius",
+ "-webkit-border-bottom-right-radius": "border-bottom-right-radius",
+
+ "-o-border-radius": "border-radius",
+ "-o-border-top-left-radius": "border-top-left-radius",
+ "-o-border-top-right-radius": "border-top-right-radius",
+ "-o-border-bottom-left-radius": "border-bottom-left-radius",
+ "-o-border-bottom-right-radius": "border-bottom-right-radius",
+
+ "-moz-border-radius": "border-radius",
+ "-moz-border-radius-topleft": "border-top-left-radius",
+ "-moz-border-radius-topright": "border-top-right-radius",
+ "-moz-border-radius-bottomleft": "border-bottom-left-radius",
+ "-moz-border-radius-bottomright": "border-bottom-right-radius",
+
+ "-moz-column-count": "column-count",
+ "-webkit-column-count": "column-count",
+
+ "-moz-column-gap": "column-gap",
+ "-webkit-column-gap": "column-gap",
+
+ "-moz-column-rule": "column-rule",
+ "-webkit-column-rule": "column-rule",
+
+ "-moz-column-rule-style": "column-rule-style",
+ "-webkit-column-rule-style": "column-rule-style",
+
+ "-moz-column-rule-color": "column-rule-color",
+ "-webkit-column-rule-color": "column-rule-color",
+
+ "-moz-column-rule-width": "column-rule-width",
+ "-webkit-column-rule-width": "column-rule-width",
+
+ "-moz-column-width": "column-width",
+ "-webkit-column-width": "column-width",
+
+ "-webkit-column-span": "column-span",
+ "-webkit-columns": "columns",
+
+ "-moz-box-shadow": "box-shadow",
+ "-webkit-box-shadow": "box-shadow",
+
+ "-moz-transform" : "transform",
+ "-webkit-transform" : "transform",
+ "-o-transform" : "transform",
+ "-ms-transform" : "transform",
+
+ "-moz-transform-origin" : "transform-origin",
+ "-webkit-transform-origin" : "transform-origin",
+ "-o-transform-origin" : "transform-origin",
+ "-ms-transform-origin" : "transform-origin",
+
+ "-moz-box-sizing" : "box-sizing",
+ "-webkit-box-sizing" : "box-sizing",
+
+ "-moz-user-select" : "user-select",
+ "-khtml-user-select" : "user-select",
+ "-webkit-user-select" : "user-select"
+ };
+
+ //event handler for beginning of rules
+ function startRule(){
+ properties = {};
+ num=1;
+ }
+
+ //event handler for end of rules
+ function endRule(event){
+ var prop,
+ i, len,
+ standard,
+ needed,
+ actual,
+ needsStandard = [];
+
+ for (prop in properties){
+ if (propertiesToCheck[prop]){
+ needsStandard.push({ actual: prop, needed: propertiesToCheck[prop]});
+ }
+ }
+
+ for (i=0, len=needsStandard.length; i < len; i++){
+ needed = needsStandard[i].needed;
+ actual = needsStandard[i].actual;
+
+ if (!properties[needed]){
+ reporter.report("Missing standard property '" + needed + "' to go along with '" + actual + "'.", properties[actual][0].name.line, properties[actual][0].name.col, rule);
+ } else {
+ //make sure standard property is last
+ if (properties[needed][0].pos < properties[actual][0].pos){
+ reporter.report("Standard property '" + needed + "' should come after vendor-prefixed property '" + actual + "'.", properties[actual][0].name.line, properties[actual][0].name.col, rule);
+ }
+ }
+ }
+
+ }
+
+ parser.addListener("startrule", startRule);
+ parser.addListener("startfontface", startRule);
+ parser.addListener("startpage", startRule);
+ parser.addListener("startpagemargin", startRule);
+ parser.addListener("startkeyframerule", startRule);
+
+ parser.addListener("property", function(event){
+ var name = event.property.text.toLowerCase();
+
+ if (!properties[name]){
+ properties[name] = [];
+ }
+
+ properties[name].push({ name: event.property, value : event.value, pos:num++ });
+ });
+
+ parser.addListener("endrule", endRule);
+ parser.addListener("endfontface", endRule);
+ parser.addListener("endpage", endRule);
+ parser.addListener("endpagemargin", endRule);
+ parser.addListener("endkeyframerule", endRule);
+ }
+
+});
+/*global CSSLint*/
+CSSLint.addRule({
+
+ //rule information
+ id: "zero-units",
+ name: "Disallow units for 0 values",
+ desc: "You don't need to specify units when a value is 0.",
+ browsers: "All",
+
+ //initialization
+ init: function(parser, reporter){
+ var rule = this;
+
+ //count how many times "float" is used
+ parser.addListener("property", function(event){
+ var parts = event.value.parts,
+ i = 0,
+ len = parts.length;
+
+ while(i < len){
+ if ((parts[i].units || parts[i].type == "percentage") && parts[i].value === 0 && parts[i].type != "time"){
+ reporter.report("Values of 0 shouldn't have units specified.", parts[i].line, parts[i].col, rule);
+ }
+ i++;
+ }
+
+ });
+
+ }
+
+});
+CSSLint.addFormatter({
+ //format information
+ id: "checkstyle-xml",
+ name: "Checkstyle XML format",
+
+ /**
+ * Return opening root XML tag.
+ * @return {String} to prepend before all results
+ */
+ startFormat: function(){
+ return "<?xml version=\"1.0\" encoding=\"utf-8\"?><checkstyle>";
+ },
+
+ /**
+ * Return closing root XML tag.
+ * @return {String} to append after all results
+ */
+ endFormat: function(){
+ return "</checkstyle>";
+ },
+
+ /**
+ * Given CSS Lint results for a file, return output for this format.
+ * @param results {Object} with error and warning messages
+ * @param filename {String} relative file path
+ * @param options {Object} (UNUSED for now) specifies special handling of output
+ * @return {String} output for results
+ */
+ formatResults: function(results, filename, options) {
+ var messages = results.messages,
+ output = [];
+ var generateSource = function(rule) {
+ if (!rule || !('name' in rule)) {
+ return "";
+ }
+ return 'net.csslint.' + rule.name.replace(/\s/g,'');
+ };
+ var escapeSpecialCharacters = function(str) {
+ if (!str || str.constructor !== String) {
+ return "";
+ }
+ return str.replace(/\"/g, "'").replace(/</g, "&lt;").replace(/>/g, "&gt;");
+ };
+
+ if (messages.length > 0) {
+ output.push("<file name=\""+filename+"\">");
+ CSSLint.Util.forEach(messages, function (message, i) {
+ //ignore rollups for now
+ if (!message.rollup) {
+ output.push("<error line=\"" + message.line + "\" column=\"" + message.col + "\" severity=\"" + message.type + "\"" +
+ " message=\"" + escapeSpecialCharacters(message.message) + "\" source=\"" + generateSource(message.rule) +"\"/>");
+ }
+ });
+ output.push("</file>");
+ }
+
+ return output.join("");
+ }
+});
+CSSLint.addFormatter({
+ //format information
+ id: "compact",
+ name: "Compact, 'porcelain' format",
+
+ /**
+ * Return content to be printed before all file results.
+ * @return {String} to prepend before all results
+ */
+ startFormat: function() {
+ return "";
+ },
+
+ /**
+ * Return content to be printed after all file results.
+ * @return {String} to append after all results
+ */
+ endFormat: function() {
+ return "";
+ },
+
+ /**
+ * Given CSS Lint results for a file, return output for this format.
+ * @param results {Object} with error and warning messages
+ * @param filename {String} relative file path
+ * @param options {Object} (Optional) specifies special handling of output
+ * @return {String} output for results
+ */
+ formatResults: function(results, filename, options) {
+ var messages = results.messages,
+ output = "";
+ options = options || {};
+ var capitalize = function(str) {
+ return str.charAt(0).toUpperCase() + str.slice(1);
+ };
+
+ if (messages.length === 0) {
+ return options.quiet ? "" : filename + ": Lint Free!";
+ }
+
+ CSSLint.Util.forEach(messages, function(message, i) {
+ if (message.rollup) {
+ output += filename + ": " + capitalize(message.type) + " - " + message.message + "\n";
+ } else {
+ output += filename + ": " + "line " + message.line +
+ ", col " + message.col + ", " + capitalize(message.type) + " - " + message.message + "\n";
+ }
+ });
+
+ return output;
+ }
+});
+CSSLint.addFormatter({
+ //format information
+ id: "csslint-xml",
+ name: "CSSLint XML format",
+
+ /**
+ * Return opening root XML tag.
+ * @return {String} to prepend before all results
+ */
+ startFormat: function(){
+ return "<?xml version=\"1.0\" encoding=\"utf-8\"?><csslint>";
+ },
+
+ /**
+ * Return closing root XML tag.
+ * @return {String} to append after all results
+ */
+ endFormat: function(){
+ return "</csslint>";
+ },
+
+ /**
+ * Given CSS Lint results for a file, return output for this format.
+ * @param results {Object} with error and warning messages
+ * @param filename {String} relative file path
+ * @param options {Object} (UNUSED for now) specifies special handling of output
+ * @return {String} output for results
+ */
+ formatResults: function(results, filename, options) {
+ var messages = results.messages,
+ output = [];
+ var escapeSpecialCharacters = function(str) {
+ if (!str || str.constructor !== String) {
+ return "";
+ }
+ return str.replace(/\"/g, "'").replace(/</g, "&lt;").replace(/>/g, "&gt;");
+ };
+
+ if (messages.length > 0) {
+ output.push("<file name=\""+filename+"\">");
+ CSSLint.Util.forEach(messages, function (message, i) {
+ if (message.rollup) {
+ output.push("<issue severity=\"" + message.type + "\" reason=\"" + escapeSpecialCharacters(message.message) + "\" evidence=\"" + escapeSpecialCharacters(message.evidence) + "\"/>");
+ } else {
+ output.push("<issue line=\"" + message.line + "\" char=\"" + message.col + "\" severity=\"" + message.type + "\"" +
+ " reason=\"" + escapeSpecialCharacters(message.message) + "\" evidence=\"" + escapeSpecialCharacters(message.evidence) + "\"/>");
+ }
+ });
+ output.push("</file>");
+ }
+
+ return output.join("");
+ }
+});
+CSSLint.addFormatter({
+ //format information
+ id: "lint-xml",
+ name: "Lint XML format",
+
+ /**
+ * Return opening root XML tag.
+ * @return {String} to prepend before all results
+ */
+ startFormat: function(){
+ return "<?xml version=\"1.0\" encoding=\"utf-8\"?><lint>";
+ },
+
+ /**
+ * Return closing root XML tag.
+ * @return {String} to append after all results
+ */
+ endFormat: function(){
+ return "</lint>";
+ },
+
+ /**
+ * Given CSS Lint results for a file, return output for this format.
+ * @param results {Object} with error and warning messages
+ * @param filename {String} relative file path
+ * @param options {Object} (UNUSED for now) specifies special handling of output
+ * @return {String} output for results
+ */
+ formatResults: function(results, filename, options) {
+ var messages = results.messages,
+ output = [];
+ var escapeSpecialCharacters = function(str) {
+ if (!str || str.constructor !== String) {
+ return "";
+ }
+ return str.replace(/\"/g, "'").replace(/</g, "&lt;").replace(/>/g, "&gt;");
+ };
+
+ if (messages.length > 0) {
+
+ output.push("<file name=\""+filename+"\">");
+ CSSLint.Util.forEach(messages, function (message, i) {
+ if (message.rollup) {
+ output.push("<issue severity=\"" + message.type + "\" reason=\"" + escapeSpecialCharacters(message.message) + "\" evidence=\"" + escapeSpecialCharacters(message.evidence) + "\"/>");
+ } else {
+ output.push("<issue line=\"" + message.line + "\" char=\"" + message.col + "\" severity=\"" + message.type + "\"" +
+ " reason=\"" + escapeSpecialCharacters(message.message) + "\" evidence=\"" + escapeSpecialCharacters(message.evidence) + "\"/>");
+ }
+ });
+ output.push("</file>");
+ }
+
+ return output.join("");
+ }
+});
+CSSLint.addFormatter({
+ //format information
+ id: "text",
+ name: "Plain Text",
+
+ /**
+ * Return content to be printed before all file results.
+ * @return {String} to prepend before all results
+ */
+ startFormat: function() {
+ return "";
+ },
+
+ /**
+ * Return content to be printed after all file results.
+ * @return {String} to append after all results
+ */
+ endFormat: function() {
+ return "";
+ },
+
+ /**
+ * Given CSS Lint results for a file, return output for this format.
+ * @param results {Object} with error and warning messages
+ * @param filename {String} relative file path
+ * @param options {Object} (Optional) specifies special handling of output
+ * @return {String} output for results
+ */
+ formatResults: function(results, filename, options) {
+ var messages = results.messages,
+ output = "";
+ options = options || {};
+
+ if (messages.length === 0) {
+ return options.quiet ? "" : "\n\ncsslint: No errors in " + filename + ".";
+ }
+
+ output = "\n\ncsslint: There are " + messages.length + " problems in " + filename + ".";
+ var pos = filename.lastIndexOf("/"),
+ shortFilename = filename;
+
+ if (pos === -1){
+ pos = filename.lastIndexOf("\\");
+ }
+ if (pos > -1){
+ shortFilename = filename.substring(pos+1);
+ }
+
+ CSSLint.Util.forEach(messages, function (message, i) {
+ output = output + "\n\n" + shortFilename;
+ if (message.rollup) {
+ output += "\n" + (i+1) + ": " + message.type;
+ output += "\n" + message.message;
+ } else {
+ output += "\n" + (i+1) + ": " + message.type + " at line " + message.line + ", col " + message.col;
+ output += "\n" + message.message;
+ output += "\n" + message.evidence;
+ }
+ });
+
+ return output;
+ }
+});
+
+
+exports.CSSLint = CSSLint;
+
+
+}); \ No newline at end of file
diff --git a/vendor/assets/javascripts/ace-src-noconflict/worker-javascript.js b/vendor/assets/javascripts/ace-src-noconflict/worker-javascript.js
new file mode 100644
index 00000000000..923bac6f661
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/worker-javascript.js
@@ -0,0 +1,10319 @@
+"no use strict";
+
+var console = {
+ log: function(msgs) {
+ postMessage({type: "log", data: arguments.join(" ")});
+ }
+};
+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("/");
+ var moduleName = base + "/" + moduleName;
+
+ while(moduleName.indexOf(".") !== -1 && previous != moduleName) {
+ var previous = moduleName;
+ var 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");
+
+ var 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) {
+ main[msg.command].apply(main, msg.args);
+ }
+ 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:
+// -- kriskowal Kris Kowal Copyright (C) 2009-2010 MIT License
+// -- tlrobinson Tom Robinson Copyright (C) 2009-2010 MIT License (Narwhal Project)
+// -- dantman Daniel Friesen Copyright(C) 2010 XXX No License Specified
+// -- fschaefer Florian Schäfer Copyright (C) 2010 MIT License
+// -- Irakli Gozalishvili Copyright (C) 2010 MIT License
+
+/*!
+ Copyright (c) 2009, 280 North Inc. http://280north.com/
+ MIT License. http://github.com/280north/narwhal/blob/master/README.md
+*/
+
+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) {
+
+
+ //---------------------------------
+ // Private variables
+ //---------------------------------
+
+ 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;
+
+ //---------------------------------
+ // Overriden native methods
+ //---------------------------------
+
+ // Adds named capture support (with backreferences returned as `result.name`), and fixes two
+ // cross-browser issues per ES3:
+ // - Captured values for nonparticipating capturing groups should be returned as `undefined`,
+ // rather than the empty string.
+ // - `lastIndex` should not be incremented after zero-length matches.
+ RegExp.prototype.exec = function (str) {
+ var match = real.exec.apply(this, arguments),
+ name, r2;
+ if ( typeof(str) == 'string' && match) {
+ // Fix browsers whose `exec` methods don't consistently return `undefined` for
+ // nonparticipating capturing groups
+ if (!compliantExecNpcg && match.length > 1 && indexOf(match, "") > -1) {
+ r2 = RegExp(this.source, real.replace.call(getNativeFlags(this), "g", ""));
+ // Using `str.slice(match.index)` rather than `match[0]` in case lookahead allowed
+ // matching due to characters outside the match
+ 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;
+ }
+ });
+ }
+ // Attach named capture properties
+ 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];
+ }
+ }
+ // Fix browsers that increment `lastIndex` after zero-length matches
+ if (!compliantLastIndexIncrement && this.global && !match[0].length && (this.lastIndex > match.index))
+ this.lastIndex--;
+ }
+ return match;
+ };
+
+ // Don't override `test` if it won't change anything
+ if (!compliantLastIndexIncrement) {
+ // Fix browser bug in native method
+ RegExp.prototype.test = function (str) {
+ // Use the native `exec` to skip some processing overhead, even though the overriden
+ // `exec` would take care of the `lastIndex` fix
+ var match = real.exec.call(this, str);
+ // Fix browsers that increment `lastIndex` after zero-length matches
+ if (match && this.global && !match[0].length && (this.lastIndex > match.index))
+ this.lastIndex--;
+ return !!match;
+ };
+ }
+
+ //---------------------------------
+ // Private helper functions
+ //---------------------------------
+
+ 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;
+ }
+
+});
+// vim: ts=4 sts=4 sw=4 expandtab
+// -- kriskowal Kris Kowal Copyright (C) 2009-2011 MIT License
+// -- tlrobinson Tom Robinson Copyright (C) 2009-2010 MIT License (Narwhal Project)
+// -- dantman Daniel Friesen Copyright (C) 2010 XXX TODO License or CLA
+// -- fschaefer Florian Schäfer Copyright (C) 2010 MIT License
+// -- Gozala Irakli Gozalishvili Copyright (C) 2010 MIT License
+// -- kitcambridge Kit Cambridge Copyright (C) 2011 MIT License
+// -- kossnocorp Sasha Koss XXX TODO License or CLA
+// -- bryanforbes Bryan Forbes XXX TODO License or CLA
+// -- killdream Quildreen Motta Copyright (C) 2011 MIT Licence
+// -- michaelficarra Michael Ficarra Copyright (C) 2011 3-clause BSD License
+// -- sharkbrainguy Gerard Paapu Copyright (C) 2011 MIT License
+// -- bbqsrc Brendan Molloy (C) 2011 Creative Commons Zero (public domain)
+// -- iwyg XXX TODO License or CLA
+// -- DomenicDenicola Domenic Denicola Copyright (C) 2011 MIT License
+// -- xavierm02 Montillet Xavier XXX TODO License or CLA
+// -- Raynos Raynos XXX TODO License or CLA
+// -- samsonjs Sami Samhuri Copyright (C) 2010 MIT License
+// -- rwldrn Rick Waldron Copyright (C) 2011 MIT License
+// -- lexer Alexey Zakharov XXX TODO License or CLA
+
+/*!
+ Copyright (c) 2009, 280 North Inc. http://280north.com/
+ MIT License. http://github.com/280north/narwhal/blob/master/README.md
+*/
+
+define('ace/lib/es5-shim', ['require', 'exports', 'module' ], function(require, exports, module) {
+
+/*
+ * Brings an environment as close to ECMAScript 5 compliance
+ * as is possible with the facilities of erstwhile engines.
+ *
+ * Annotated ES5: http://es5.github.com/ (specific links below)
+ * ES5 Spec: http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf
+ *
+ * @module
+ */
+
+/*whatsupdoc*/
+
+//
+// Function
+// ========
+//
+
+// ES-5 15.3.4.5
+// http://es5.github.com/#x15.3.4.5
+
+if (!Function.prototype.bind) {
+ Function.prototype.bind = function bind(that) { // .length is 1
+ // 1. Let Target be the this value.
+ var target = this;
+ // 2. If IsCallable(Target) is false, throw a TypeError exception.
+ if (typeof target != "function")
+ throw new TypeError(); // TODO message
+ // 3. Let A be a new (possibly empty) internal list of all of the
+ // argument values provided after thisArg (arg1, arg2 etc), in order.
+ // XXX slicedArgs will stand in for "A" if used
+ var args = slice.call(arguments, 1); // for normal call
+ // 4. Let F be a new native ECMAScript object.
+ // 11. Set the [[Prototype]] internal property of F to the standard
+ // built-in Function prototype object as specified in 15.3.3.1.
+ // 12. Set the [[Call]] internal property of F as described in
+ // 15.3.4.5.1.
+ // 13. Set the [[Construct]] internal property of F as described in
+ // 15.3.4.5.2.
+ // 14. Set the [[HasInstance]] internal property of F as described in
+ // 15.3.4.5.3.
+ var bound = function () {
+
+ if (this instanceof bound) {
+ // 15.3.4.5.2 [[Construct]]
+ // When the [[Construct]] internal method of a function object,
+ // F that was created using the bind function is called with a
+ // list of arguments ExtraArgs, the following steps are taken:
+ // 1. Let target be the value of F's [[TargetFunction]]
+ // internal property.
+ // 2. If target has no [[Construct]] internal method, a
+ // TypeError exception is thrown.
+ // 3. Let boundArgs be the value of F's [[BoundArgs]] internal
+ // property.
+ // 4. Let args be a new list containing the same values as the
+ // list boundArgs in the same order followed by the same
+ // values as the list ExtraArgs in the same order.
+ // 5. Return the result of calling the [[Construct]] internal
+ // method of target providing args as the arguments.
+
+ var F = function(){};
+ F.prototype = target.prototype;
+ var self = new F;
+
+ var result = target.apply(
+ self,
+ args.concat(slice.call(arguments))
+ );
+ if (result !== null && Object(result) === result)
+ return result;
+ return self;
+
+ } else {
+ // 15.3.4.5.1 [[Call]]
+ // When the [[Call]] internal method of a function object, F,
+ // which was created using the bind function is called with a
+ // this value and a list of arguments ExtraArgs, the following
+ // steps are taken:
+ // 1. Let boundArgs be the value of F's [[BoundArgs]] internal
+ // property.
+ // 2. Let boundThis be the value of F's [[BoundThis]] internal
+ // property.
+ // 3. Let target be the value of F's [[TargetFunction]] internal
+ // property.
+ // 4. Let args be a new list containing the same values as the
+ // list boundArgs in the same order followed by the same
+ // values as the list ExtraArgs in the same order.
+ // 5. Return the result of calling the [[Call]] internal method
+ // of target providing boundThis as the this value and
+ // providing args as the arguments.
+
+ // equiv: target.call(this, ...boundArgs, ...args)
+ return target.apply(
+ that,
+ args.concat(slice.call(arguments))
+ );
+
+ }
+
+ };
+ // XXX bound.length is never writable, so don't even try
+ //
+ // 15. If the [[Class]] internal property of Target is "Function", then
+ // a. Let L be the length property of Target minus the length of A.
+ // b. Set the length own property of F to either 0 or L, whichever is
+ // larger.
+ // 16. Else set the length own property of F to 0.
+ // 17. Set the attributes of the length own property of F to the values
+ // specified in 15.3.5.1.
+
+ // TODO
+ // 18. Set the [[Extensible]] internal property of F to true.
+
+ // TODO
+ // 19. Let thrower be the [[ThrowTypeError]] function Object (13.2.3).
+ // 20. Call the [[DefineOwnProperty]] internal method of F with
+ // arguments "caller", PropertyDescriptor {[[Get]]: thrower, [[Set]]:
+ // thrower, [[Enumerable]]: false, [[Configurable]]: false}, and
+ // false.
+ // 21. Call the [[DefineOwnProperty]] internal method of F with
+ // arguments "arguments", PropertyDescriptor {[[Get]]: thrower,
+ // [[Set]]: thrower, [[Enumerable]]: false, [[Configurable]]: false},
+ // and false.
+
+ // TODO
+ // NOTE Function objects created using Function.prototype.bind do not
+ // have a prototype property or the [[Code]], [[FormalParameters]], and
+ // [[Scope]] internal properties.
+ // XXX can't delete prototype in pure-js.
+
+ // 22. Return F.
+ return bound;
+ };
+}
+
+// Shortcut to an often accessed properties, in order to avoid multiple
+// dereference that costs universally.
+// _Please note: Shortcuts are defined after `Function.prototype.bind` as we
+// us it in defining shortcuts.
+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);
+
+// If JS engine supports accessors creating shortcuts.
+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__);
+}
+
+//
+// Array
+// =====
+//
+
+// ES5 15.4.3.2
+// http://es5.github.com/#x15.4.3.2
+// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/isArray
+if (!Array.isArray) {
+ Array.isArray = function isArray(obj) {
+ return toString(obj) == "[object Array]";
+ };
+}
+
+// The IsCallable() check in the Array functions
+// has been replaced with a strict check on the
+// internal class of the object to trap cases where
+// the provided function was actually a regular
+// expression literal, which in V8 and
+// JavaScriptCore is a typeof "function". Only in
+// V8 are regular expression literals permitted as
+// reduce parameters, so it is desirable in the
+// general case for the shim to match the more
+// strict and common behavior of rejecting regular
+// expressions.
+
+// ES5 15.4.4.18
+// http://es5.github.com/#x15.4.4.18
+// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/array/forEach
+if (!Array.prototype.forEach) {
+ Array.prototype.forEach = function forEach(fun /*, thisp*/) {
+ var self = toObject(this),
+ thisp = arguments[1],
+ i = 0,
+ length = self.length >>> 0;
+
+ // If no callback function or if callback is not a callable function
+ if (toString(fun) != "[object Function]") {
+ throw new TypeError(); // TODO message
+ }
+
+ while (i < length) {
+ if (i in self) {
+ // Invoke the callback function with call, passing arguments:
+ // context, property value, property key, thisArg object context
+ fun.call(thisp, self[i], i, self);
+ }
+ i++;
+ }
+ };
+}
+
+// ES5 15.4.4.19
+// http://es5.github.com/#x15.4.4.19
+// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/map
+if (!Array.prototype.map) {
+ Array.prototype.map = function map(fun /*, thisp*/) {
+ var self = toObject(this),
+ length = self.length >>> 0,
+ result = Array(length),
+ thisp = arguments[1];
+
+ // If no callback function or if callback is not a callable function
+ if (toString(fun) != "[object Function]") {
+ throw new TypeError(); // TODO message
+ }
+
+ for (var i = 0; i < length; i++) {
+ if (i in self)
+ result[i] = fun.call(thisp, self[i], i, self);
+ }
+ return result;
+ };
+}
+
+// ES5 15.4.4.20
+// http://es5.github.com/#x15.4.4.20
+// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/filter
+if (!Array.prototype.filter) {
+ Array.prototype.filter = function filter(fun /*, thisp */) {
+ var self = toObject(this),
+ length = self.length >>> 0,
+ result = [],
+ thisp = arguments[1];
+
+ // If no callback function or if callback is not a callable function
+ if (toString(fun) != "[object Function]") {
+ throw new TypeError(); // TODO message
+ }
+
+ for (var i = 0; i < length; i++) {
+ if (i in self && fun.call(thisp, self[i], i, self))
+ result.push(self[i]);
+ }
+ return result;
+ };
+}
+
+// ES5 15.4.4.16
+// http://es5.github.com/#x15.4.4.16
+// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/every
+if (!Array.prototype.every) {
+ Array.prototype.every = function every(fun /*, thisp */) {
+ var self = toObject(this),
+ length = self.length >>> 0,
+ thisp = arguments[1];
+
+ // If no callback function or if callback is not a callable function
+ if (toString(fun) != "[object Function]") {
+ throw new TypeError(); // TODO message
+ }
+
+ for (var i = 0; i < length; i++) {
+ if (i in self && !fun.call(thisp, self[i], i, self))
+ return false;
+ }
+ return true;
+ };
+}
+
+// ES5 15.4.4.17
+// http://es5.github.com/#x15.4.4.17
+// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/some
+if (!Array.prototype.some) {
+ Array.prototype.some = function some(fun /*, thisp */) {
+ var self = toObject(this),
+ length = self.length >>> 0,
+ thisp = arguments[1];
+
+ // If no callback function or if callback is not a callable function
+ if (toString(fun) != "[object Function]") {
+ throw new TypeError(); // TODO message
+ }
+
+ for (var i = 0; i < length; i++) {
+ if (i in self && fun.call(thisp, self[i], i, self))
+ return true;
+ }
+ return false;
+ };
+}
+
+// ES5 15.4.4.21
+// http://es5.github.com/#x15.4.4.21
+// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/reduce
+if (!Array.prototype.reduce) {
+ Array.prototype.reduce = function reduce(fun /*, initial*/) {
+ var self = toObject(this),
+ length = self.length >>> 0;
+
+ // If no callback function or if callback is not a callable function
+ if (toString(fun) != "[object Function]") {
+ throw new TypeError(); // TODO message
+ }
+
+ // no value to return if no initial value and an empty array
+ if (!length && arguments.length == 1)
+ throw new TypeError(); // TODO message
+
+ var i = 0;
+ var result;
+ if (arguments.length >= 2) {
+ result = arguments[1];
+ } else {
+ do {
+ if (i in self) {
+ result = self[i++];
+ break;
+ }
+
+ // if array contains no values, no initial value to return
+ if (++i >= length)
+ throw new TypeError(); // TODO message
+ } while (true);
+ }
+
+ for (; i < length; i++) {
+ if (i in self)
+ result = fun.call(void 0, result, self[i], i, self);
+ }
+
+ return result;
+ };
+}
+
+// ES5 15.4.4.22
+// http://es5.github.com/#x15.4.4.22
+// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/reduceRight
+if (!Array.prototype.reduceRight) {
+ Array.prototype.reduceRight = function reduceRight(fun /*, initial*/) {
+ var self = toObject(this),
+ length = self.length >>> 0;
+
+ // If no callback function or if callback is not a callable function
+ if (toString(fun) != "[object Function]") {
+ throw new TypeError(); // TODO message
+ }
+
+ // no value to return if no initial value, empty array
+ if (!length && arguments.length == 1)
+ throw new TypeError(); // TODO message
+
+ var result, i = length - 1;
+ if (arguments.length >= 2) {
+ result = arguments[1];
+ } else {
+ do {
+ if (i in self) {
+ result = self[i--];
+ break;
+ }
+
+ // if array contains no values, no initial value to return
+ if (--i < 0)
+ throw new TypeError(); // TODO message
+ } while (true);
+ }
+
+ do {
+ if (i in this)
+ result = fun.call(void 0, result, self[i], i, self);
+ } while (i--);
+
+ return result;
+ };
+}
+
+// ES5 15.4.4.14
+// http://es5.github.com/#x15.4.4.14
+// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/indexOf
+if (!Array.prototype.indexOf) {
+ Array.prototype.indexOf = function indexOf(sought /*, fromIndex */ ) {
+ var self = toObject(this),
+ length = self.length >>> 0;
+
+ if (!length)
+ return -1;
+
+ var i = 0;
+ if (arguments.length > 1)
+ i = toInteger(arguments[1]);
+
+ // handle negative indices
+ i = i >= 0 ? i : Math.max(0, length + i);
+ for (; i < length; i++) {
+ if (i in self && self[i] === sought) {
+ return i;
+ }
+ }
+ return -1;
+ };
+}
+
+// ES5 15.4.4.15
+// http://es5.github.com/#x15.4.4.15
+// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/lastIndexOf
+if (!Array.prototype.lastIndexOf) {
+ Array.prototype.lastIndexOf = function lastIndexOf(sought /*, fromIndex */) {
+ var self = 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]));
+ // handle negative indices
+ i = i >= 0 ? i : length - Math.abs(i);
+ for (; i >= 0; i--) {
+ if (i in self && sought === self[i])
+ return i;
+ }
+ return -1;
+ };
+}
+
+//
+// Object
+// ======
+//
+
+// ES5 15.2.3.2
+// http://es5.github.com/#x15.2.3.2
+if (!Object.getPrototypeOf) {
+ // https://github.com/kriskowal/es5-shim/issues#issue/2
+ // http://ejohn.org/blog/objectgetprototypeof/
+ // recommended by fschaefer on github
+ Object.getPrototypeOf = function getPrototypeOf(object) {
+ return object.__proto__ || (
+ object.constructor ?
+ object.constructor.prototype :
+ prototypeOfObject
+ );
+ };
+}
+
+// ES5 15.2.3.3
+// http://es5.github.com/#x15.2.3.3
+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 object does not owns property return undefined immediately.
+ if (!owns(object, property))
+ return;
+
+ var descriptor, getter, setter;
+
+ // If object has a property then it's for sure both `enumerable` and
+ // `configurable`.
+ descriptor = { enumerable: true, configurable: true };
+
+ // If JS engine supports accessor properties then property may be a
+ // getter or setter.
+ if (supportsAccessors) {
+ // Unfortunately `__lookupGetter__` will return a getter even
+ // if object has own non getter property along with a same named
+ // inherited getter. To avoid misbehavior we temporary remove
+ // `__proto__` so that `__lookupGetter__` will return getter only
+ // if it's owned by an object.
+ var prototype = object.__proto__;
+ object.__proto__ = prototypeOfObject;
+
+ var getter = lookupGetter(object, property);
+ var setter = lookupSetter(object, property);
+
+ // Once we have getter and setter we can put values back.
+ object.__proto__ = prototype;
+
+ if (getter || setter) {
+ if (getter) descriptor.get = getter;
+ if (setter) descriptor.set = setter;
+
+ // If it was accessor property we're done and return here
+ // in order to avoid adding `value` to the descriptor.
+ return descriptor;
+ }
+ }
+
+ // If we got this far we know that object has an own property that is
+ // not an accessor so we set it as a value and return descriptor.
+ descriptor.value = object[property];
+ return descriptor;
+ };
+}
+
+// ES5 15.2.3.4
+// http://es5.github.com/#x15.2.3.4
+if (!Object.getOwnPropertyNames) {
+ Object.getOwnPropertyNames = function getOwnPropertyNames(object) {
+ return Object.keys(object);
+ };
+}
+
+// ES5 15.2.3.5
+// http://es5.github.com/#x15.2.3.5
+if (!Object.create) {
+ Object.create = function create(prototype, properties) {
+ var object;
+ if (prototype === null) {
+ object = { "__proto__": null };
+ } else {
+ if (typeof prototype != "object")
+ throw new TypeError("typeof prototype["+(typeof prototype)+"] != 'object'");
+ var Type = function () {};
+ Type.prototype = prototype;
+ object = new Type();
+ // IE has no built-in implementation of `Object.getPrototypeOf`
+ // neither `__proto__`, but this manually setting `__proto__` will
+ // guarantee that `Object.getPrototypeOf` will work as expected with
+ // objects created using `Object.create`
+ object.__proto__ = prototype;
+ }
+ if (properties !== void 0)
+ Object.defineProperties(object, properties);
+ return object;
+ };
+}
+
+// ES5 15.2.3.6
+// http://es5.github.com/#x15.2.3.6
+
+// Patch for WebKit and IE8 standard mode
+// Designed by hax <hax.github.com>
+// related issue: https://github.com/kriskowal/es5-shim/issues#issue/5
+// IE8 Reference:
+// http://msdn.microsoft.com/en-us/library/dd282900.aspx
+// http://msdn.microsoft.com/en-us/library/dd229916.aspx
+// WebKit Bugs:
+// https://bugs.webkit.org/show_bug.cgi?id=36423
+
+function doesDefinePropertyWork(object) {
+ try {
+ Object.defineProperty(object, "sentinel", {});
+ return "sentinel" in object;
+ } catch (exception) {
+ // returns falsy
+ }
+}
+
+// check whether defineProperty works if it's given. Otherwise,
+// shim partially.
+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);
+
+ // make a valiant attempt to use the real defineProperty
+ // for I8's DOM elements.
+ if (definePropertyFallback) {
+ try {
+ return definePropertyFallback.call(Object, object, property, descriptor);
+ } catch (exception) {
+ // try the shim if the real one doesn't work
+ }
+ }
+
+ // If it's a data property.
+ if (owns(descriptor, "value")) {
+ // fail silently if "writable", "enumerable", or "configurable"
+ // are requested but not supported
+ /*
+ // alternate approach:
+ if ( // can't implement these features; allow false but not true
+ !(owns(descriptor, "writable") ? descriptor.writable : true) ||
+ !(owns(descriptor, "enumerable") ? descriptor.enumerable : true) ||
+ !(owns(descriptor, "configurable") ? descriptor.configurable : true)
+ )
+ throw new RangeError(
+ "This implementation of Object.defineProperty does not " +
+ "support configurable, enumerable, or writable."
+ );
+ */
+
+ if (supportsAccessors && (lookupGetter(object, property) ||
+ lookupSetter(object, property)))
+ {
+ // As accessors are supported only on engines implementing
+ // `__proto__` we can safely override `__proto__` while defining
+ // a property to make sure that we don't hit an inherited
+ // accessor.
+ var prototype = object.__proto__;
+ object.__proto__ = prototypeOfObject;
+ // Deleting a property anyway since getter / setter may be
+ // defined on object itself.
+ delete object[property];
+ object[property] = descriptor.value;
+ // Setting original `__proto__` back now.
+ object.__proto__ = prototype;
+ } else {
+ object[property] = descriptor.value;
+ }
+ } else {
+ if (!supportsAccessors)
+ throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED);
+ // If we got that far then getters and setters can be defined !!
+ if (owns(descriptor, "get"))
+ defineGetter(object, property, descriptor.get);
+ if (owns(descriptor, "set"))
+ defineSetter(object, property, descriptor.set);
+ }
+
+ return object;
+ };
+}
+
+// ES5 15.2.3.7
+// http://es5.github.com/#x15.2.3.7
+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;
+ };
+}
+
+// ES5 15.2.3.8
+// http://es5.github.com/#x15.2.3.8
+if (!Object.seal) {
+ Object.seal = function seal(object) {
+ // this is misleading and breaks feature-detection, but
+ // allows "securable" code to "gracefully" degrade to working
+ // but insecure code.
+ return object;
+ };
+}
+
+// ES5 15.2.3.9
+// http://es5.github.com/#x15.2.3.9
+if (!Object.freeze) {
+ Object.freeze = function freeze(object) {
+ // this is misleading and breaks feature-detection, but
+ // allows "securable" code to "gracefully" degrade to working
+ // but insecure code.
+ return object;
+ };
+}
+
+// detect a Rhino bug and patch it
+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);
+}
+
+// ES5 15.2.3.10
+// http://es5.github.com/#x15.2.3.10
+if (!Object.preventExtensions) {
+ Object.preventExtensions = function preventExtensions(object) {
+ // this is misleading and breaks feature-detection, but
+ // allows "securable" code to "gracefully" degrade to working
+ // but insecure code.
+ return object;
+ };
+}
+
+// ES5 15.2.3.11
+// http://es5.github.com/#x15.2.3.11
+if (!Object.isSealed) {
+ Object.isSealed = function isSealed(object) {
+ return false;
+ };
+}
+
+// ES5 15.2.3.12
+// http://es5.github.com/#x15.2.3.12
+if (!Object.isFrozen) {
+ Object.isFrozen = function isFrozen(object) {
+ return false;
+ };
+}
+
+// ES5 15.2.3.13
+// http://es5.github.com/#x15.2.3.13
+if (!Object.isExtensible) {
+ Object.isExtensible = function isExtensible(object) {
+ // 1. If Type(O) is not Object throw a TypeError exception.
+ if (Object(object) === object) {
+ throw new TypeError(); // TODO message
+ }
+ // 2. Return the Boolean value of the [[Extensible]] internal property of O.
+ var name = '';
+ while (owns(object, name)) {
+ name += '?';
+ }
+ object[name] = true;
+ var returnValue = owns(object, name);
+ delete object[name];
+ return returnValue;
+ };
+}
+
+// ES5 15.2.3.14
+// http://es5.github.com/#x15.2.3.14
+if (!Object.keys) {
+ // http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation
+ 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;
+ };
+
+}
+
+//
+// Date
+// ====
+//
+
+// ES5 15.9.5.43
+// http://es5.github.com/#x15.9.5.43
+// This function returns a String value represent the instance in time
+// represented by this Date object. The format of the String is the Date Time
+// string format defined in 15.9.1.15. All fields are present in the String.
+// The time zone is always UTC, denoted by the suffix Z. If the time value of
+// this object is not a finite Number a RangeError exception is thrown.
+if (!Date.prototype.toISOString || (new Date(-62198755200000).toISOString().indexOf('-000001') === -1)) {
+ Date.prototype.toISOString = function toISOString() {
+ var result, length, value, year;
+ if (!isFinite(this))
+ throw new RangeError;
+
+ // the date time string format is specified in 15.9.1.15.
+ result = [this.getUTCMonth() + 1, this.getUTCDate(),
+ this.getUTCHours(), this.getUTCMinutes(), this.getUTCSeconds()];
+ year = this.getUTCFullYear();
+ year = (year < 0 ? '-' : (year > 9999 ? '+' : '')) + ('00000' + Math.abs(year)).slice(0 <= year && year <= 9999 ? -4 : -6);
+
+ length = result.length;
+ while (length--) {
+ value = result[length];
+ // pad months, days, hours, minutes, and seconds to have two digits.
+ if (value < 10)
+ result[length] = "0" + value;
+ }
+ // pad milliseconds to have three digits.
+ return year + "-" + result.slice(0, 2).join("-") + "T" + result.slice(2).join(":") + "." +
+ ("000" + this.getUTCMilliseconds()).slice(-3) + "Z";
+ }
+}
+
+// ES5 15.9.4.4
+// http://es5.github.com/#x15.9.4.4
+if (!Date.now) {
+ Date.now = function now() {
+ return new Date().getTime();
+ };
+}
+
+// ES5 15.9.5.44
+// http://es5.github.com/#x15.9.5.44
+// This function provides a String representation of a Date object for use by
+// JSON.stringify (15.12.3).
+if (!Date.prototype.toJSON) {
+ Date.prototype.toJSON = function toJSON(key) {
+ // When the toJSON method is called with argument key, the following
+ // steps are taken:
+
+ // 1. Let O be the result of calling ToObject, giving it the this
+ // value as its argument.
+ // 2. Let tv be ToPrimitive(O, hint Number).
+ // 3. If tv is a Number and is not finite, return null.
+ // XXX
+ // 4. Let toISO be the result of calling the [[Get]] internal method of
+ // O with argument "toISOString".
+ // 5. If IsCallable(toISO) is false, throw a TypeError exception.
+ if (typeof this.toISOString != "function")
+ throw new TypeError(); // TODO message
+ // 6. Return the result of calling the [[Call]] internal method of
+ // toISO with O as the this value and an empty argument list.
+ return this.toISOString();
+
+ // NOTE 1 The argument is ignored.
+
+ // NOTE 2 The toJSON function is intentionally generic; it does not
+ // require that its this value be a Date object. Therefore, it can be
+ // transferred to other kinds of objects for use as a method. However,
+ // it does require that any such object have a toISOString method. An
+ // object is free to use the argument key to filter its
+ // stringification.
+ };
+}
+
+// ES5 15.9.4.2
+// http://es5.github.com/#x15.9.4.2
+// based on work shared by Daniel Friesen (dantman)
+// http://gist.github.com/303249
+if (Date.parse("+275760-09-13T00:00:00.000Z") !== 8.64e15) {
+ // XXX global assignment won't work in embeddings that use
+ // an alternate object for the context.
+ Date = (function(NativeDate) {
+
+ // Date.length === 7
+ var Date = function Date(Y, M, D, h, m, s, ms) {
+ var length = arguments.length;
+ if (this instanceof NativeDate) {
+ var date = length == 1 && String(Y) === Y ? // isString(Y)
+ // We explicitly pass it through parse:
+ new NativeDate(Date.parse(Y)) :
+ // We have to manually make calls depending on argument
+ // length here
+ length >= 7 ? new NativeDate(Y, M, D, h, m, s, ms) :
+ length >= 6 ? new NativeDate(Y, M, D, h, m, s) :
+ length >= 5 ? new NativeDate(Y, M, D, h, m) :
+ length >= 4 ? new NativeDate(Y, M, D, h) :
+ length >= 3 ? new NativeDate(Y, M, D) :
+ length >= 2 ? new NativeDate(Y, M) :
+ length >= 1 ? new NativeDate(Y) :
+ new NativeDate();
+ // Prevent mixups with unfixed Date object
+ date.constructor = Date;
+ return date;
+ }
+ return NativeDate.apply(this, arguments);
+ };
+
+ // 15.9.1.15 Date Time String Format.
+ var isoDateExpression = new RegExp("^" +
+ "(\\d{4}|[\+\-]\\d{6})" + // four-digit year capture or sign + 6-digit extended year
+ "(?:-(\\d{2})" + // optional month capture
+ "(?:-(\\d{2})" + // optional day capture
+ "(?:" + // capture hours:minutes:seconds.milliseconds
+ "T(\\d{2})" + // hours capture
+ ":(\\d{2})" + // minutes capture
+ "(?:" + // optional :seconds.milliseconds
+ ":(\\d{2})" + // seconds capture
+ "(?:\\.(\\d{3}))?" + // milliseconds capture
+ ")?" +
+ "(?:" + // capture UTC offset component
+ "Z|" + // UTC capture
+ "(?:" + // offset specifier +/-hours:minutes
+ "([-+])" + // sign capture
+ "(\\d{2})" + // hours offset capture
+ ":(\\d{2})" + // minutes offset capture
+ ")" +
+ ")?)?)?)?" +
+ "$");
+
+ // Copy any custom methods a 3rd party library may have added
+ for (var key in NativeDate)
+ Date[key] = NativeDate[key];
+
+ // Copy "native" methods explicitly; they may be non-enumerable
+ Date.now = NativeDate.now;
+ Date.UTC = NativeDate.UTC;
+ Date.prototype = NativeDate.prototype;
+ Date.prototype.constructor = Date;
+
+ // Upgrade Date.parse to handle simplified ISO 8601 strings
+ Date.parse = function parse(string) {
+ var match = isoDateExpression.exec(string);
+ if (match) {
+ match.shift(); // kill match[0], the full match
+ // parse months, days, hours, minutes, seconds, and milliseconds
+ for (var i = 1; i < 7; i++) {
+ // provide default values if necessary
+ match[i] = +(match[i] || (i < 3 ? 1 : 0));
+ // match[1] is the month. Months are 0-11 in JavaScript
+ // `Date` objects, but 1-12 in ISO notation, so we
+ // decrement.
+ if (i == 1)
+ match[i]--;
+ }
+
+ // parse the UTC offset component
+ var minuteOffset = +match.pop(), hourOffset = +match.pop(), sign = match.pop();
+
+ // compute the explicit time zone offset if specified
+ var offset = 0;
+ if (sign) {
+ // detect invalid offsets and return early
+ if (hourOffset > 23 || minuteOffset > 59)
+ return NaN;
+
+ // express the provided time zone offset in minutes. The offset is
+ // negative for time zones west of UTC; positive otherwise.
+ offset = (hourOffset * 60 + minuteOffset) * 6e4 * (sign == "+" ? -1 : 1);
+ }
+
+ // Date.UTC for years between 0 and 99 converts year to 1900 + year
+ // The Gregorian calendar has a 400-year cycle, so
+ // to Date.UTC(year + 400, .... ) - 12622780800000 == Date.UTC(year, ...),
+ // where 12622780800000 - number of milliseconds in Gregorian calendar 400 years
+ var year = +match[0];
+ if (0 <= year && year <= 99) {
+ match[0] = year + 400;
+ return NativeDate.UTC.apply(this, match) + offset - 12622780800000;
+ }
+
+ // compute a new UTC date value, accounting for the optional offset
+ return NativeDate.UTC.apply(this, match) + offset;
+ }
+ return NativeDate.parse.apply(this, arguments);
+ };
+
+ return Date;
+ })(Date);
+}
+
+//
+// String
+// ======
+//
+
+// ES5 15.5.4.20
+// http://es5.github.com/#x15.5.4.20
+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()) {
+ // http://blog.stevenlevithan.com/archives/faster-trim-javascript
+ // http://perfectionkills.com/whitespace-deviations/
+ ws = "[" + ws + "]";
+ var trimBeginRegexp = new RegExp("^" + ws + ws + "*"),
+ trimEndRegexp = new RegExp(ws + ws + "*$");
+ String.prototype.trim = function trim() {
+ return String(this).replace(trimBeginRegexp, "").replace(trimEndRegexp, "");
+ };
+}
+
+//
+// Util
+// ======
+//
+
+// ES5 9.4
+// http://es5.github.com/#x9.4
+// http://jsperf.com/to-integer
+var toInteger = function (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;
+};
+
+var prepareString = "a"[0] != "a",
+ // ES5 9.9
+ // http://es5.github.com/#x9.9
+ toObject = function (o) {
+ if (o == null) { // this matches both null and undefined
+ throw new TypeError(); // TODO message
+ }
+ // If the implementation doesn't support by-index access of
+ // string characters (ex. IE < 7), split the string
+ if (prepareString && typeof o == "string" && o) {
+ return o.split("");
+ }
+ 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<listeners.length; i++) {
+ listeners[i](e);
+ if (e.propagationStopped)
+ break;
+ }
+
+ if (defaultHandler && !e.defaultPrevented)
+ return defaultHandler(e);
+};
+
+EventEmitter.setDefaultHandler = function(eventName, callback) {
+ this._defaultHandlers = this._defaultHandlers || {};
+
+ if (this._defaultHandlers[eventName])
+ throw new Error("The default handler for '" + eventName + "' is already set");
+
+ this._defaultHandlers[eventName] = callback;
+};
+
+EventEmitter.on =
+EventEmitter.addEventListener = function(eventName, callback) {
+ this._eventRegistry = this._eventRegistry || {};
+
+ var listeners = this._eventRegistry[eventName];
+ if (!listeners)
+ listeners = this._eventRegistry[eventName] = [];
+
+ if (listeners.indexOf(callback) == -1)
+ listeners.push(callback);
+};
+
+EventEmitter.removeListener =
+EventEmitter.removeEventListener = function(eventName, callback) {
+ this._eventRegistry = this._eventRegistry || {};
+
+ var listeners = this._eventRegistry[eventName];
+ if (!listeners)
+ return;
+
+ var index = listeners.indexOf(callback);
+ if (index !== -1)
+ listeners.splice(index, 1);
+};
+
+EventEmitter.removeAllListeners = function(eventName) {
+ if (this._eventRegistry) this._eventRegistry[eventName] = [];
+};
+
+exports.EventEmitter = EventEmitter;
+
+});
+
+define('ace/lib/oop', ['require', 'exports', 'module' ], function(require, exports, module) {
+
+
+exports.inherits = (function() {
+ var tempCtor = function() {};
+ return function(ctor, superCtor) {
+ tempCtor.prototype = superCtor.prototype;
+ ctor.super_ = superCtor.prototype;
+ ctor.prototype = new tempCtor();
+ ctor.prototype.constructor = ctor;
+ };
+}());
+
+exports.mixin = function(obj, mixin) {
+ for (var key in mixin) {
+ obj[key] = mixin[key];
+ }
+};
+
+exports.implement = function(proto, mixin) {
+ exports.mixin(proto, mixin);
+};
+
+});
+
+define('ace/mode/javascript_worker', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/worker/mirror', 'ace/worker/jshint', 'ace/narcissus/parser'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var Mirror = require("../worker/mirror").Mirror;
+var lint = require("../worker/jshint").JSHINT;
+var parser = require("../narcissus/parser");
+
+var JavaScriptWorker = exports.JavaScriptWorker = function(sender) {
+ Mirror.call(this, sender);
+ this.setTimeout(500);
+};
+
+oop.inherits(JavaScriptWorker, Mirror);
+
+(function() {
+
+ this.onUpdate = function() {
+ var value = this.doc.getValue();
+ value = value.replace(/^#!.*\n/, "\n");
+
+// var start = new Date();
+ try {
+ parser.parse(value);
+ } catch(e) {
+// console.log("narcissus")
+// console.log(e);
+ var chunks = e.message.split(":")
+ var message = chunks.pop().trim();
+ var lineNumber = parseInt(chunks.pop().trim()) - 1;
+ this.sender.emit("narcissus", {
+ row: lineNumber,
+ column: null, // TODO convert e.cursor
+ text: message,
+ type: "error"
+ });
+ return;
+ } finally {
+// console.log("parse time: " + (new Date() - start));
+ }
+
+// var start = new Date();
+// console.log("jslint")
+ lint(value, {undef: false, onevar: false, passfail: false});
+ this.sender.emit("jslint", lint.errors);
+// console.log("lint time: " + (new Date() - start));
+ }
+
+}).call(JavaScriptWorker.prototype);
+
+});
+define('ace/worker/mirror', ['require', 'exports', 'module' , 'ace/document', 'ace/lib/lang'], function(require, exports, module) {
+
+
+var Document = require("../document").Document;
+var lang = require("../lib/lang");
+
+var Mirror = exports.Mirror = function(sender) {
+ this.sender = sender;
+ var doc = this.doc = new Document("");
+
+ var deferredUpdate = this.deferredUpdate = lang.deferredCall(this.onUpdate.bind(this));
+
+ var _self = this;
+ sender.on("change", function(e) {
+ doc.applyDeltas([e.data]);
+ deferredUpdate.schedule(_self.$timeout);
+ });
+};
+
+(function() {
+
+ this.$timeout = 500;
+
+ this.setTimeout = function(timeout) {
+ this.$timeout = timeout;
+ };
+
+ this.setValue = function(value) {
+ this.doc.setValue(value);
+ this.deferredUpdate.schedule(this.$timeout);
+ };
+
+ this.getValue = function(callbackId) {
+ this.sender.callback(this.doc.getValue(), callbackId);
+ };
+
+ this.onUpdate = function() {
+ // abstract method
+ };
+
+}).call(Mirror.prototype);
+
+});
+
+define('ace/document', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/event_emitter', 'ace/range', 'ace/anchor'], function(require, exports, module) {
+
+
+var oop = require("./lib/oop");
+var EventEmitter = require("./lib/event_emitter").EventEmitter;
+var Range = require("./range").Range;
+var Anchor = require("./anchor").Anchor;
+
+ /**
+ * new Document([text])
+ * - text (String | Array): The starting text
+ *
+ * Creates a new `Document`. If `text` is included, the `Document` contains those strings; otherwise, it's empty.
+ *
+ **/
+
+var Document = function(text) {
+ this.$lines = [];
+
+ // There has to be one line at least in the document. If you pass an empty
+ // string to the insert function, nothing will happen. Workaround.
+ if (text.length == 0) {
+ this.$lines = [""];
+ } else if (Array.isArray(text)) {
+ this.insertLines(0, text);
+ } else {
+ this.insert({row: 0, column:0}, text);
+ }
+};
+
+(function() {
+
+ oop.implement(this, EventEmitter);
+ this.setValue = function(text) {
+ var len = this.getLength();
+ this.remove(new Range(0, 0, len, this.getLine(len-1).length));
+ this.insert({row: 0, column:0}, text);
+ };
+ this.getValue = function() {
+ return this.getAllLines().join(this.getNewLineCharacter());
+ };
+ this.createAnchor = function(row, column) {
+ return new Anchor(this, row, column);
+ };
+
+ // check for IE split bug
+ if ("aaa".split(/a/).length == 0)
+ this.$split = function(text) {
+ return text.replace(/\r\n|\r/g, "\n").split("\n");
+ }
+ else
+ this.$split = function(text) {
+ return text.split(/\r\n|\r|\n/);
+ };
+ this.$detectNewLine = function(text) {
+ var match = text.match(/^.*?(\r\n|\r|\n)/m);
+ if (match) {
+ this.$autoNewLine = match[1];
+ } else {
+ this.$autoNewLine = "\n";
+ }
+ };
+ this.getNewLineCharacter = function() {
+ switch (this.$newLineMode) {
+ case "windows":
+ return "\r\n";
+
+ case "unix":
+ return "\n";
+
+ case "auto":
+ return this.$autoNewLine;
+ }
+ };
+
+ this.$autoNewLine = "\n";
+ this.$newLineMode = "auto";
+ this.setNewLineMode = function(newLineMode) {
+ if (this.$newLineMode === newLineMode)
+ return;
+
+ this.$newLineMode = newLineMode;
+ };
+ this.getNewLineMode = function() {
+ return this.$newLineMode;
+ };
+ this.isNewLine = function(text) {
+ return (text == "\r\n" || text == "\r" || text == "\n");
+ };
+ this.getLine = function(row) {
+ return this.$lines[row] || "";
+ };
+ this.getLines = function(firstRow, lastRow) {
+ return this.$lines.slice(firstRow, lastRow + 1);
+ };
+ this.getAllLines = function() {
+ return this.getLines(0, this.getLength());
+ };
+ this.getLength = function() {
+ return this.$lines.length;
+ };
+ this.getTextRange = function(range) {
+ if (range.start.row == range.end.row) {
+ return this.$lines[range.start.row].substring(range.start.column,
+ range.end.column);
+ }
+ else {
+ var lines = this.getLines(range.start.row+1, range.end.row-1);
+ lines.unshift((this.$lines[range.start.row] || "").substring(range.start.column));
+ lines.push((this.$lines[range.end.row] || "").substring(0, range.end.column));
+ return lines.join(this.getNewLineCharacter());
+ }
+ };
+ this.$clipPosition = function(position) {
+ var length = this.getLength();
+ if (position.row >= 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);
+
+ // only detect new lines if the document has no line break yet
+ 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;
+ };
+ /**
+ * Document@change(e)
+ * - e (Object): Contains at least one property called `"action"`. `"action"` indicates the action that triggered the change. Each action also has a set of additional properties.
+ *
+ * Fires whenever the document changes.
+ *
+ * Several methods trigger different `"change"` events. Below is a list of each action type, followed by each property that's also available:
+ *
+ * * `"insertLines"` (emitted by [[Document.insertLines]])
+ * * `range`: the [[Range]] of the change within the document
+ * * `lines`: the lines in the document that are changing
+ * * `"insertText"` (emitted by [[Document.insertNewLine]])
+ * * `range`: the [[Range]] of the change within the document
+ * * `text`: the text that's being added
+ * * `"removeLines"` (emitted by [[Document.insertLines]])
+ * * `range`: the [[Range]] of the change within the document
+ * * `lines`: the lines in the document that were removed
+ * * `nl`: the new line character (as defined by [[Document.getNewLineCharacter]])
+ * * `"removeText"` (emitted by [[Document.removeInLine]] and [[Document.removeNewLine]])
+ * * `range`: the [[Range]] of the change within the document
+ * * `text`: the text that's being removed
+ *
+ **/
+ this.insertLines = function(row, lines) {
+ if (lines.length == 0)
+ return {row: row, column: 0};
+
+ // apply doesn't work for big arrays (smallest threshold is on safari 0xFFFF)
+ // to circumvent that we have to break huge inserts into smaller chunks here
+ 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) {
+ // clip to document
+ 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;
+
+ // Shortcut: If the text we want to insert is the same as it is already
+ // in the document, we don't have to replace anything.
+ 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<deltas.length; i++) {
+ var delta = deltas[i];
+ var range = Range.fromPoints(delta.range.start, delta.range.end);
+
+ if (delta.action == "insertLines")
+ this.insertLines(range.start.row, delta.lines);
+ else if (delta.action == "insertText")
+ this.insert(range.start, delta.text);
+ else if (delta.action == "removeLines")
+ this.removeLines(range.start.row, range.end.row - 1);
+ else if (delta.action == "removeText")
+ this.remove(range);
+ }
+ };
+ this.revertDeltas = function(deltas) {
+ for (var i=deltas.length-1; 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);
+ }
+ };
+
+}).call(Document.prototype);
+
+exports.Document = Document;
+});
+
+define('ace/range', ['require', 'exports', 'module' ], function(require, exports, module) {
+
+
+/**
+ * class Range
+ *
+ * This object is used in various places to indicate a region within the editor. To better visualize how this works, imagine a rectangle. Each quadrant of the rectangle is analogus to a range, as ranges contain a starting row and starting column, and an ending row, and ending column.
+ *
+ **/
+
+/**
+ * new Range(startRow, startColumn, endRow, endColumn)
+ * - startRow (Number): The starting row
+ * - startColumn (Number): The starting column
+ * - endRow (Number): The ending row
+ * - endColumn (Number): The ending column
+ *
+ * Creates a new `Range` object with the given starting and ending row and column points.
+ *
+ **/
+var Range = function(startRow, startColumn, endRow, endColumn) {
+ this.start = {
+ row: startRow,
+ column: startColumn
+ };
+
+ this.end = {
+ row: endRow,
+ column: endColumn
+ };
+};
+
+(function() {
+ /**
+ * Range.isEqual(range) -> Boolean
+ * - range (Range): A range to check against
+ *
+ * Returns `true` if and only if the starting row and column, and ending tow and column, are equivalent to those given by `range`.
+ *
+ **/
+ 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;
+ }
+ }
+ }
+
+ /** related to: Range.compare
+ * Range.comparePoint(p) -> Number
+ * - p (Range): A point to compare with
+ * + (Number): This method returns one of the following numbers:<br/>
+ * * `0` if the two points are exactly equal<br/>
+ * * `-1` if `p.row` is less then the calling range<br/>
+ * * `1` if `p.row` is greater than the calling range<br/>
+ * <br/>
+ * If the starting row of the calling range is equal to `p.row`, and:<br/>
+ * * `p.column` is greater than or equal to the calling range's starting column, this returns `0`<br/>
+ * * Otherwise, it returns -1<br/>
+ *<br/>
+ * If the ending row of the calling range is equal to `p.row`, and:<br/>
+ * * `p.column` is less than or equal to the calling range's ending column, this returns `0`<br/>
+ * * Otherwise, it returns 1<br/>
+ *
+ * Checks the row and column points of `p` with the row and column points of the calling range.
+ *
+ *
+ *
+ **/
+ this.comparePoint = function(p) {
+ return this.compare(p.row, p.column);
+ }
+
+ /** related to: Range.comparePoint
+ * Range.containsRange(range) -> Boolean
+ * - range (Range): A range to compare with
+ *
+ * Checks the start and end points of `range` and compares them to the calling range. Returns `true` if the `range` is contained within the caller's range.
+ *
+ **/
+ this.containsRange = function(range) {
+ return this.comparePoint(range.start) == 0 && this.comparePoint(range.end) == 0;
+ }
+
+ /**
+ * Range.intersects(range) -> Boolean
+ * - range (Range): A range to compare with
+ *
+ * Returns `true` if passed in `range` intersects with the one calling this method.
+ *
+ **/
+ this.intersects = function(range) {
+ var cmp = this.compareRange(range);
+ return (cmp == -1 || cmp == 0 || cmp == 1);
+ }
+
+ /**
+ * Range.isEnd(row, column) -> Boolean
+ * - row (Number): A row point to compare with
+ * - column (Number): A column point to compare with
+ *
+ * Returns `true` if the caller's ending row point is the same as `row`, and if the caller's ending column is the same as `column`.
+ *
+ **/
+ this.isEnd = function(row, column) {
+ return this.end.row == row && this.end.column == column;
+ }
+
+ /**
+ * Range.isStart(row, column) -> Boolean
+ * - row (Number): A row point to compare with
+ * - column (Number): A column point to compare with
+ *
+ * Returns `true` if the caller's starting row point is the same as `row`, and if the caller's starting column is the same as `column`.
+ *
+ **/
+ this.isStart = function(row, column) {
+ return this.start.row == row && this.start.column == column;
+ }
+
+ /**
+ * Range.setStart(row, column)
+ * - row (Number): A row point to set
+ * - column (Number): A column point to set
+ *
+ * Sets the starting row and column for the range.
+ *
+ **/
+ 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;
+ }
+ }
+
+ /**
+ * Range.setEnd(row, column)
+ * - row (Number): A row point to set
+ * - column (Number): A column point to set
+ *
+ * Sets the starting row and column for the range.
+ *
+ **/
+ 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;
+ }
+ }
+
+ /** related to: Range.compare
+ * Range.inside(row, column) -> Boolean
+ * - row (Number): A row point to compare with
+ * - column (Number): A column point to compare with
+ *
+ * Returns `true` if the `row` and `column` are within the given range.
+ *
+ **/
+ 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;
+ }
+
+ /** related to: Range.compare
+ * Range.insideStart(row, column) -> Boolean
+ * - row (Number): A row point to compare with
+ * - column (Number): A column point to compare with
+ *
+ * Returns `true` if the `row` and `column` are within the given range's starting points.
+ *
+ **/
+ this.insideStart = function(row, column) {
+ if (this.compare(row, column) == 0) {
+ if (this.isEnd(row, column)) {
+ return false;
+ } else {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /** related to: Range.compare
+ * Range.insideEnd(row, column) -> Boolean
+ * - row (Number): A row point to compare with
+ * - column (Number): A column point to compare with
+ *
+ * Returns `true` if the `row` and `column` are within the given range's ending points.
+ *
+ **/
+ this.insideEnd = function(row, column) {
+ if (this.compare(row, column) == 0) {
+ if (this.isStart(row, column)) {
+ return false;
+ } else {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Range.compare(row, column) -> Number
+ * - row (Number): A row point to compare with
+ * - column (Number): A column point to compare with
+ * + (Number): This method returns one of the following numbers:<br/>
+ * * `0` if the two points are exactly equal <br/>
+ * * `-1` if `p.row` is less then the calling range <br/>
+ * * `1` if `p.row` is greater than the calling range <br/>
+ * <br/>
+ * If the starting row of the calling range is equal to `p.row`, and: <br/>
+ * * `p.column` is greater than or equal to the calling range's starting column, this returns `0`<br/>
+ * * Otherwise, it returns -1<br/>
+ * <br/>
+ * If the ending row of the calling range is equal to `p.row`, and: <br/>
+ * * `p.column` is less than or equal to the calling range's ending column, this returns `0` <br/>
+ * * Otherwise, it returns 1
+ *
+ * Checks the row and column points with the row and column points of the calling range.
+ *
+ *
+ **/
+ 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);
+ }
+ }
+
+ /**
+ * Range.compareEnd(row, column) -> Number
+ * - row (Number): A row point to compare with
+ * - column (Number): A column point to compare with
+ * + (Number): This method returns one of the following numbers:<br/>
+ * * `0` if the two points are exactly equal<br/>
+ * * `-1` if `p.row` is less then the calling range<br/>
+ * * `1` if `p.row` is greater than the calling range, or if `isEnd` is `true.<br/>
+ * <br/>
+ * If the starting row of the calling range is equal to `p.row`, and:<br/>
+ * * `p.column` is greater than or equal to the calling range's starting column, this returns `0`<br/>
+ * * Otherwise, it returns -1<br/>
+ *<br/>
+ * If the ending row of the calling range is equal to `p.row`, and:<br/>
+ * * `p.column` is less than or equal to the calling range's ending column, this returns `0`<br/>
+ * * Otherwise, it returns 1
+ *
+ * Checks the row and column points with the row and column points of the calling range.
+ *
+ *
+ **/
+ this.compareEnd = function(row, column) {
+ if (this.end.row == row && this.end.column == column) {
+ return 1;
+ } else {
+ return this.compare(row, column);
+ }
+ }
+
+ /**
+ * Range.compareInside(row, column) -> Number
+ * - row (Number): A row point to compare with
+ * - column (Number): A column point to compare with
+ * + (Number): This method returns one of the following numbers:<br/>
+ * * `1` if the ending row of the calling range is equal to `row`, and the ending column of the calling range is equal to `column`<br/>
+ * * `-1` if the starting row of the calling range is equal to `row`, and the starting column of the calling range is equal to `column`<br/>
+ * <br/>
+ * Otherwise, it returns the value after calling [[Range.compare `compare()`]].
+ *
+ * Checks the row and column points with the row and column points of the calling range.
+ *
+ *
+ *
+ **/
+ 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);
+ }
+ }
+
+ /**
+ * Range.clipRows(firstRow, lastRow) -> Range
+ * - firstRow (Number): The starting row
+ * - lastRow (Number): The ending row
+ *
+ * Returns the part of the current `Range` that occurs within the boundaries of `firstRow` and `lastRow` as a new `Range` object.
+ *
+ **/
+ 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;
+
+/**
+ * new Anchor(doc, row, column)
+ * - doc (Document): The document to associate with the anchor
+ * - row (Number): The starting row position
+ * - column (Number): The starting column position
+ *
+ * Creates a new `Anchor` and associates it with a document.
+ *
+ **/
+
+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) {
+ return new Array(count + 1).join(string);
+};
+
+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<l; i++) {
+ if (array[i] && typeof array[i] == "object")
+ copy[i] = this.copyObject( array[i] );
+ else
+ copy[i] = array[i];
+ }
+ return copy;
+};
+
+exports.deepCopy = function (obj) {
+ if (typeof obj != "object") {
+ return obj;
+ }
+
+ var copy = obj.constructor();
+ for (var key in obj) {
+ if (typeof obj[key] == "object") {
+ copy[key] = this.deepCopy(obj[key]);
+ } else {
+ copy[key] = obj[key];
+ }
+ }
+ return copy;
+};
+
+exports.arrayToMap = function(arr) {
+ var map = {};
+ for (var i=0; i<arr.length; i++) {
+ map[arr[i]] = 1;
+ }
+ return map;
+
+};
+
+exports.createMap = function(props) {
+ var map = Object.create(null);
+ for (var i in props) {
+ map[i] = props[i];
+ }
+ return map;
+};
+exports.arrayRemove = function(array, value) {
+ for (var i = 0; i <= array.length; i++) {
+ if (value === array[i]) {
+ array.splice(i, 1);
+ }
+ }
+};
+
+exports.escapeRegExp = function(str) {
+ return str.replace(/([.*+?^${}()|[\]\/\\])/g, '\\$1');
+};
+
+exports.getMatchOffsets = function(string, regExp) {
+ var matches = [];
+
+ string.replace(regExp, function(str) {
+ matches.push({
+ offset: arguments[arguments.length-2],
+ length: str.length
+ });
+ });
+
+ return matches;
+};
+
+
+exports.deferredCall = function(fcn) {
+
+ var timer = null;
+ var callback = function() {
+ timer = null;
+ fcn();
+ };
+
+ var deferred = function(timeout) {
+ deferred.cancel();
+ timer = setTimeout(callback, timeout || 0);
+ return deferred;
+ };
+
+ deferred.schedule = deferred;
+
+ deferred.call = function() {
+ this.cancel();
+ fcn();
+ return deferred;
+ };
+
+ deferred.cancel = function() {
+ clearTimeout(timer);
+ timer = null;
+ return deferred;
+ };
+
+ return deferred;
+};
+
+});
+define('ace/worker/jshint', ['require', 'exports', 'module' ], function(require, exports, module) {
+/*!
+ * JSHint, by JSHint Community.
+ *
+ * Licensed under the same slightly modified MIT license that JSLint is.
+ * It stops evil-doers everywhere.
+ *
+ * JSHint is a derivative work of JSLint:
+ *
+ * Copyright (c) 2002 Douglas Crockford (www.JSLint.com)
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * The Software shall be used for Good, not Evil.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * JSHint was forked from 2010-12-16 edition of JSLint.
+ *
+ */
+
+/*
+ JSHINT is a global function. It takes two parameters.
+
+ var myResult = JSHINT(source, option);
+
+ The first parameter is either a string or an array of strings. If it is a
+ string, it will be split on '\n' or '\r'. If it is an array of strings, it
+ is assumed that each string represents one line. The source can be a
+ JavaScript text or a JSON text.
+
+ The second parameter is an optional object of options which control the
+ operation of JSHINT. Most of the options are booleans: They are all
+ optional and have a default value of false. One of the options, predef,
+ can be an array of names, which will be used to declare global variables,
+ or an object whose keys are used as global names, with a boolean value
+ that determines if they are assignable.
+
+ If it checks out, JSHINT returns true. Otherwise, it returns false.
+
+ If false, you can inspect JSHINT.errors to find out the problems.
+ JSHINT.errors is an array of objects containing these members:
+
+ {
+ line : The line (relative to 0) at which the lint was found
+ character : The character (relative to 0) at which the lint was found
+ reason : The problem
+ evidence : The text line in which the problem occurred
+ raw : The raw message before the details were inserted
+ a : The first detail
+ b : The second detail
+ c : The third detail
+ d : The fourth detail
+ }
+
+ If a fatal error was found, a null will be the last element of the
+ JSHINT.errors array.
+
+ You can request a Function Report, which shows all of the functions
+ and the parameters and vars that they use. This can be used to find
+ implied global variables and other problems. The report is in HTML and
+ can be inserted in an HTML <body>.
+
+ var myReport = JSHINT.report(limited);
+
+ If limited is true, then the report will be limited to only errors.
+
+ You can request a data structure which contains JSHint's results.
+
+ var myData = JSHINT.data();
+
+ It returns a structure with this form:
+
+ {
+ errors: [
+ {
+ line: NUMBER,
+ character: NUMBER,
+ reason: STRING,
+ evidence: STRING
+ }
+ ],
+ functions: [
+ name: STRING,
+ line: NUMBER,
+ last: NUMBER,
+ param: [
+ STRING
+ ],
+ closure: [
+ STRING
+ ],
+ var: [
+ STRING
+ ],
+ exception: [
+ STRING
+ ],
+ outer: [
+ STRING
+ ],
+ unused: [
+ STRING
+ ],
+ global: [
+ STRING
+ ],
+ label: [
+ STRING
+ ]
+ ],
+ globals: [
+ STRING
+ ],
+ member: {
+ STRING: NUMBER
+ },
+ unused: [
+ {
+ name: STRING,
+ line: NUMBER
+ }
+ ],
+ implieds: [
+ {
+ name: STRING,
+ line: NUMBER
+ }
+ ],
+ urls: [
+ STRING
+ ],
+ json: BOOLEAN
+ }
+
+ Empty arrays will not be included.
+
+*/
+
+/*jshint
+ evil: true, nomen: false, onevar: false, regexp: false, strict: true, boss: true,
+ undef: true, maxlen: 100, indent:4
+*/
+
+/*members "\b", "\t", "\n", "\f", "\r", "!=", "!==", "\"", "%", "(begin)",
+ "(breakage)", "(context)", "(error)", "(global)", "(identifier)", "(last)",
+ "(line)", "(loopage)", "(name)", "(onevar)", "(params)", "(scope)",
+ "(statement)", "(verb)", "*", "+", "++", "-", "--", "\/", "<", "<=", "==",
+ "===", ">", ">=", $, $$, $A, $F, $H, $R, $break, $continue, $w, Abstract, Ajax,
+ __filename, __dirname, ActiveXObject, Array, ArrayBuffer, ArrayBufferView, Audio,
+ Autocompleter, Assets, Boolean, Builder, Buffer, Browser, COM, CScript, Canvas,
+ CustomAnimation, Class, Control, Chain, Color, Cookie, Core, DataView, Date,
+ Debug, Draggable, Draggables, Droppables, Document, DomReady, DOMReady, DOMParser, Drag,
+ E, Enumerator, Enumerable, Element, Elements, Error, Effect, EvalError, Event,
+ Events, FadeAnimation, Field, Flash, Float32Array, Float64Array, Form,
+ FormField, Frame, FormData, Function, Fx, GetObject, Group, Hash, HotKey,
+ HTMLElement, HTMLAnchorElement, HTMLBaseElement, HTMLBlockquoteElement,
+ HTMLBodyElement, HTMLBRElement, HTMLButtonElement, HTMLCanvasElement, HTMLDirectoryElement,
+ HTMLDivElement, HTMLDListElement, HTMLFieldSetElement,
+ HTMLFontElement, HTMLFormElement, HTMLFrameElement, HTMLFrameSetElement,
+ HTMLHeadElement, HTMLHeadingElement, HTMLHRElement, HTMLHtmlElement,
+ HTMLIFrameElement, HTMLImageElement, HTMLInputElement, HTMLIsIndexElement,
+ HTMLLabelElement, HTMLLayerElement, HTMLLegendElement, HTMLLIElement,
+ HTMLLinkElement, HTMLMapElement, HTMLMenuElement, HTMLMetaElement,
+ HTMLModElement, HTMLObjectElement, HTMLOListElement, HTMLOptGroupElement,
+ HTMLOptionElement, HTMLParagraphElement, HTMLParamElement, HTMLPreElement,
+ HTMLQuoteElement, HTMLScriptElement, HTMLSelectElement, HTMLStyleElement,
+ HtmlTable, HTMLTableCaptionElement, HTMLTableCellElement, HTMLTableColElement,
+ HTMLTableElement, HTMLTableRowElement, HTMLTableSectionElement,
+ HTMLTextAreaElement, HTMLTitleElement, HTMLUListElement, HTMLVideoElement,
+ Iframe, IframeShim, Image, Int16Array, Int32Array, Int8Array,
+ Insertion, InputValidator, JSON, Keyboard, Locale, LN10, LN2, LOG10E, LOG2E,
+ MAX_VALUE, MIN_VALUE, Mask, Math, MenuItem, MessageChannel, MessageEvent, MessagePort,
+ MoveAnimation, MooTools, Native, NEGATIVE_INFINITY, Number, Object, ObjectRange, Option,
+ Options, OverText, PI, POSITIVE_INFINITY, PeriodicalExecuter, Point, Position, Prototype,
+ RangeError, Rectangle, ReferenceError, RegExp, ResizeAnimation, Request, RotateAnimation,
+ SQRT1_2, SQRT2, ScrollBar, ScriptEngine, ScriptEngineBuildVersion,
+ ScriptEngineMajorVersion, ScriptEngineMinorVersion, Scriptaculous, Scroller,
+ Slick, Slider, Selector, SharedWorker, String, Style, SyntaxError, Sortable, Sortables,
+ SortableObserver, Sound, Spinner, System, Swiff, Text, TextArea, Template,
+ Timer, Tips, Type, TypeError, Toggle, Try, "use strict", unescape, URI, URIError, URL,
+ VBArray, WSH, WScript, XDomainRequest, Web, Window, XMLDOM, XMLHttpRequest, XMLSerializer,
+ XPathEvaluator, XPathException, XPathExpression, XPathNamespace, XPathNSResolver, XPathResult,
+ "\\", a, addEventListener, address, alert, apply, applicationCache, arguments, arity, asi, atob,
+ b, basic, basicToken, bitwise, block, blur, boolOptions, boss, browser, btoa, c, call, callee,
+ caller, cases, charAt, charCodeAt, character, clearInterval, clearTimeout,
+ close, closed, closure, comment, condition, confirm, console, constructor,
+ content, couch, create, css, curly, d, data, datalist, dd, debug, decodeURI,
+ decodeURIComponent, defaultStatus, defineClass, deserialize, devel, document,
+ dojo, dijit, dojox, define, else, emit, encodeURI, encodeURIComponent,
+ entityify, eqeqeq, eqnull, errors, es5, escape, esnext, eval, event, evidence, evil,
+ ex, exception, exec, exps, expr, exports, FileReader, first, floor, focus,
+ forin, fragment, frames, from, fromCharCode, fud, funcscope, funct, function, functions,
+ g, gc, getComputedStyle, getRow, getter, getterToken, GLOBAL, global, globals, globalstrict,
+ hasOwnProperty, help, history, i, id, identifier, immed, implieds, importPackage, include,
+ indent, indexOf, init, ins, instanceOf, isAlpha, isApplicationRunning, isArray,
+ isDigit, isFinite, isNaN, iterator, java, join, jshint,
+ JSHINT, json, jquery, jQuery, keys, label, labelled, last, lastsemic, laxbreak, laxcomma,
+ latedef, lbp, led, left, length, line, load, loadClass, localStorage, location,
+ log, loopfunc, m, match, maxerr, maxlen, member,message, meta, module, moveBy,
+ moveTo, mootools, multistr, name, navigator, new, newcap, noarg, node, noempty, nomen,
+ nonew, nonstandard, nud, onbeforeunload, onblur, onerror, onevar, onecase, onfocus,
+ onload, onresize, onunload, open, openDatabase, openURL, opener, opera, options, outer, param,
+ parent, parseFloat, parseInt, passfail, plusplus, predef, print, process, prompt,
+ proto, prototype, prototypejs, provides, push, quit, range, raw, reach, reason, regexp,
+ readFile, readUrl, regexdash, removeEventListener, replace, report, require,
+ reserved, resizeBy, resizeTo, resolvePath, resumeUpdates, respond, rhino, right,
+ runCommand, scroll, screen, scripturl, scrollBy, scrollTo, scrollbar, search, seal,
+ send, serialize, sessionStorage, setInterval, setTimeout, setter, setterToken, shift, slice,
+ smarttabs, sort, spawn, split, stack, status, start, strict, sub, substr, supernew, shadow,
+ supplant, sum, sync, test, toLowerCase, toString, toUpperCase, toint32, token, top, trailing,
+ type, typeOf, Uint16Array, Uint32Array, Uint8Array, undef, undefs, unused, urls, validthis,
+ value, valueOf, var, version, WebSocket, withstmt, white, window, Worker, wsh*/
+
+/*global exports: false */
+
+// We build the application inside a function so that we produce only a single
+// global variable. That function will be invoked immediately, and its return
+// value is the JSHINT function itself.
+
+var JSHINT = (function () {
+
+
+ var anonname, // The guessed name for anonymous functions.
+
+// These are operators that should not be used with the ! operator.
+
+ bang = {
+ '<' : true,
+ '<=' : true,
+ '==' : true,
+ '===': true,
+ '!==': true,
+ '!=' : true,
+ '>' : true,
+ '>=' : true,
+ '+' : true,
+ '-' : true,
+ '*' : true,
+ '/' : true,
+ '%' : true
+ },
+
+ // These are the JSHint boolean options.
+ boolOptions = {
+ asi : true, // if automatic semicolon insertion should be tolerated
+ bitwise : true, // if bitwise operators should not be allowed
+ boss : true, // if advanced usage of assignments should be allowed
+ browser : true, // if the standard browser globals should be predefined
+ couch : true, // if CouchDB globals should be predefined
+ curly : true, // if curly braces around all blocks should be required
+ debug : true, // if debugger statements should be allowed
+ devel : true, // if logging globals should be predefined (console,
+ // alert, etc.)
+ dojo : true, // if Dojo Toolkit globals should be predefined
+ eqeqeq : true, // if === should be required
+ eqnull : true, // if == null comparisons should be tolerated
+ es5 : true, // if ES5 syntax should be allowed
+ esnext : true, // if es.next specific syntax should be allowed
+ evil : true, // if eval should be allowed
+ expr : true, // if ExpressionStatement should be allowed as Programs
+ forin : true, // if for in statements must filter
+ funcscope : true, // if only function scope should be used for scope tests
+ globalstrict: true, // if global should be allowed (also
+ // enables 'strict')
+ immed : true, // if immediate invocations must be wrapped in parens
+ iterator : true, // if the `__iterator__` property should be allowed
+ jquery : true, // if jQuery globals should be predefined
+ lastsemic : true, // if semicolons may be ommitted for the trailing
+ // statements inside of a one-line blocks.
+ latedef : true, // if the use before definition should not be tolerated
+ laxbreak : true, // if line breaks should not be checked
+ laxcomma : true, // if line breaks should not be checked around commas
+ loopfunc : true, // if functions should be allowed to be defined within
+ // loops
+ mootools : true, // if MooTools globals should be predefined
+ multistr : true, // allow multiline strings
+ newcap : true, // if constructor names must be capitalized
+ noarg : true, // if arguments.caller and arguments.callee should be
+ // disallowed
+ node : true, // if the Node.js environment globals should be
+ // predefined
+ noempty : true, // if empty blocks should be disallowed
+ nonew : true, // if using `new` for side-effects should be disallowed
+ nonstandard : true, // if non-standard (but widely adopted) globals should
+ // be predefined
+ nomen : true, // if names should be checked
+ onevar : true, // if only one var statement per function should be
+ // allowed
+ onecase : true, // if one case switch statements should be allowed
+ passfail : true, // if the scan should stop on first error
+ plusplus : true, // if increment/decrement should not be allowed
+ proto : true, // if the `__proto__` property should be allowed
+ prototypejs : true, // if Prototype and Scriptaculous globals should be
+ // predefined
+ regexdash : true, // if unescaped first/last dash (-) inside brackets
+ // should be tolerated
+ regexp : true, // if the . should not be allowed in regexp literals
+ rhino : true, // if the Rhino environment globals should be predefined
+ undef : true, // if variables should be declared before used
+ scripturl : true, // if script-targeted URLs should be tolerated
+ shadow : true, // if variable shadowing should be tolerated
+ smarttabs : true, // if smarttabs should be tolerated
+ // (http://www.emacswiki.org/emacs/SmartTabs)
+ strict : true, // require the pragma
+ sub : true, // if all forms of subscript notation are tolerated
+ supernew : true, // if `new function () { ... };` and `new Object;`
+ // should be tolerated
+ trailing : true, // if trailing whitespace rules apply
+ validthis : true, // if 'this' inside a non-constructor function is valid.
+ // This is a function scoped option only.
+ withstmt : true, // if with statements should be allowed
+ white : true, // if strict whitespace rules apply
+ wsh : true // if the Windows Scripting Host environment globals
+ // should be predefined
+ },
+
+ // These are the JSHint options that can take any value
+ // (we use this object to detect invalid options)
+ valOptions = {
+ maxlen: false,
+ indent: false,
+ maxerr: false,
+ predef: false
+ },
+
+
+ // browser contains a set of global names which are commonly provided by a
+ // web browser environment.
+ browser = {
+ ArrayBuffer : false,
+ ArrayBufferView : false,
+ Audio : false,
+ addEventListener : false,
+ applicationCache : false,
+ atob : false,
+ blur : false,
+ btoa : false,
+ clearInterval : false,
+ clearTimeout : false,
+ close : false,
+ closed : false,
+ DataView : false,
+ DOMParser : false,
+ defaultStatus : false,
+ document : false,
+ event : false,
+ FileReader : false,
+ Float32Array : false,
+ Float64Array : false,
+ FormData : false,
+ focus : false,
+ frames : false,
+ getComputedStyle : false,
+ HTMLElement : false,
+ HTMLAnchorElement : false,
+ HTMLBaseElement : false,
+ HTMLBlockquoteElement : false,
+ HTMLBodyElement : false,
+ HTMLBRElement : false,
+ HTMLButtonElement : false,
+ HTMLCanvasElement : false,
+ HTMLDirectoryElement : false,
+ HTMLDivElement : false,
+ HTMLDListElement : false,
+ HTMLFieldSetElement : false,
+ HTMLFontElement : false,
+ HTMLFormElement : false,
+ HTMLFrameElement : false,
+ HTMLFrameSetElement : false,
+ HTMLHeadElement : false,
+ HTMLHeadingElement : false,
+ HTMLHRElement : false,
+ HTMLHtmlElement : false,
+ HTMLIFrameElement : false,
+ HTMLImageElement : false,
+ HTMLInputElement : false,
+ HTMLIsIndexElement : false,
+ HTMLLabelElement : false,
+ HTMLLayerElement : false,
+ HTMLLegendElement : false,
+ HTMLLIElement : false,
+ HTMLLinkElement : false,
+ HTMLMapElement : false,
+ HTMLMenuElement : false,
+ HTMLMetaElement : false,
+ HTMLModElement : false,
+ HTMLObjectElement : false,
+ HTMLOListElement : false,
+ HTMLOptGroupElement : false,
+ HTMLOptionElement : false,
+ HTMLParagraphElement : false,
+ HTMLParamElement : false,
+ HTMLPreElement : false,
+ HTMLQuoteElement : false,
+ HTMLScriptElement : false,
+ HTMLSelectElement : false,
+ HTMLStyleElement : false,
+ HTMLTableCaptionElement : false,
+ HTMLTableCellElement : false,
+ HTMLTableColElement : false,
+ HTMLTableElement : false,
+ HTMLTableRowElement : false,
+ HTMLTableSectionElement : false,
+ HTMLTextAreaElement : false,
+ HTMLTitleElement : false,
+ HTMLUListElement : false,
+ HTMLVideoElement : false,
+ history : false,
+ Int16Array : false,
+ Int32Array : false,
+ Int8Array : false,
+ Image : false,
+ length : false,
+ localStorage : false,
+ location : false,
+ MessageChannel : false,
+ MessageEvent : false,
+ MessagePort : false,
+ moveBy : false,
+ moveTo : false,
+ name : false,
+ navigator : false,
+ onbeforeunload : true,
+ onblur : true,
+ onerror : true,
+ onfocus : true,
+ onload : true,
+ onresize : true,
+ onunload : true,
+ open : false,
+ openDatabase : false,
+ opener : false,
+ Option : false,
+ parent : false,
+ print : false,
+ removeEventListener : false,
+ resizeBy : false,
+ resizeTo : false,
+ screen : false,
+ scroll : false,
+ scrollBy : false,
+ scrollTo : false,
+ sessionStorage : false,
+ setInterval : false,
+ setTimeout : false,
+ SharedWorker : false,
+ status : false,
+ top : false,
+ Uint16Array : false,
+ Uint32Array : false,
+ Uint8Array : false,
+ WebSocket : false,
+ window : false,
+ Worker : false,
+ XMLHttpRequest : false,
+ XMLSerializer : false,
+ XPathEvaluator : false,
+ XPathException : false,
+ XPathExpression : false,
+ XPathNamespace : false,
+ XPathNSResolver : false,
+ XPathResult : false
+ },
+
+ couch = {
+ "require" : false,
+ respond : false,
+ getRow : false,
+ emit : false,
+ send : false,
+ start : false,
+ sum : false,
+ log : false,
+ exports : false,
+ module : false,
+ provides : false
+ },
+
+ devel = {
+ alert : false,
+ confirm : false,
+ console : false,
+ Debug : false,
+ opera : false,
+ prompt : false
+ },
+
+ dojo = {
+ dojo : false,
+ dijit : false,
+ dojox : false,
+ define : false,
+ "require" : false
+ },
+
+ escapes = {
+ '\b': '\\b',
+ '\t': '\\t',
+ '\n': '\\n',
+ '\f': '\\f',
+ '\r': '\\r',
+ '"' : '\\"',
+ '/' : '\\/',
+ '\\': '\\\\'
+ },
+
+ funct, // The current function
+
+ functionicity = [
+ 'closure', 'exception', 'global', 'label',
+ 'outer', 'unused', 'var'
+ ],
+
+ functions, // All of the functions
+
+ global, // The global scope
+ implied, // Implied globals
+ inblock,
+ indent,
+ jsonmode,
+
+ jquery = {
+ '$' : false,
+ jQuery : false
+ },
+
+ lines,
+ lookahead,
+ member,
+ membersOnly,
+
+ mootools = {
+ '$' : false,
+ '$$' : false,
+ Assets : false,
+ Browser : false,
+ Chain : false,
+ Class : false,
+ Color : false,
+ Cookie : false,
+ Core : false,
+ Document : false,
+ DomReady : false,
+ DOMReady : false,
+ Drag : false,
+ Element : false,
+ Elements : false,
+ Event : false,
+ Events : false,
+ Fx : false,
+ Group : false,
+ Hash : false,
+ HtmlTable : false,
+ Iframe : false,
+ IframeShim : false,
+ InputValidator : false,
+ instanceOf : false,
+ Keyboard : false,
+ Locale : false,
+ Mask : false,
+ MooTools : false,
+ Native : false,
+ Options : false,
+ OverText : false,
+ Request : false,
+ Scroller : false,
+ Slick : false,
+ Slider : false,
+ Sortables : false,
+ Spinner : false,
+ Swiff : false,
+ Tips : false,
+ Type : false,
+ typeOf : false,
+ URI : false,
+ Window : false
+ },
+
+ nexttoken,
+
+ node = {
+ __filename : false,
+ __dirname : false,
+ Buffer : false,
+ console : false,
+ exports : false,
+ GLOBAL : false,
+ global : false,
+ module : false,
+ process : false,
+ require : false,
+ setTimeout : false,
+ clearTimeout : false,
+ setInterval : false,
+ clearInterval : false
+ },
+
+ noreach,
+ option,
+ predefined, // Global variables defined by option
+ prereg,
+ prevtoken,
+
+ prototypejs = {
+ '$' : false,
+ '$$' : false,
+ '$A' : false,
+ '$F' : false,
+ '$H' : false,
+ '$R' : false,
+ '$break' : false,
+ '$continue' : false,
+ '$w' : false,
+ Abstract : false,
+ Ajax : false,
+ Class : false,
+ Enumerable : false,
+ Element : false,
+ Event : false,
+ Field : false,
+ Form : false,
+ Hash : false,
+ Insertion : false,
+ ObjectRange : false,
+ PeriodicalExecuter: false,
+ Position : false,
+ Prototype : false,
+ Selector : false,
+ Template : false,
+ Toggle : false,
+ Try : false,
+ Autocompleter : false,
+ Builder : false,
+ Control : false,
+ Draggable : false,
+ Draggables : false,
+ Droppables : false,
+ Effect : false,
+ Sortable : false,
+ SortableObserver : false,
+ Sound : false,
+ Scriptaculous : false
+ },
+
+ rhino = {
+ defineClass : false,
+ deserialize : false,
+ gc : false,
+ help : false,
+ importPackage: false,
+ "java" : false,
+ load : false,
+ loadClass : false,
+ print : false,
+ quit : false,
+ readFile : false,
+ readUrl : false,
+ runCommand : false,
+ seal : false,
+ serialize : false,
+ spawn : false,
+ sync : false,
+ toint32 : false,
+ version : false
+ },
+
+ scope, // The current scope
+ stack,
+
+ // standard contains the global names that are provided by the
+ // ECMAScript standard.
+ standard = {
+ Array : false,
+ Boolean : false,
+ Date : false,
+ decodeURI : false,
+ decodeURIComponent : false,
+ encodeURI : false,
+ encodeURIComponent : false,
+ Error : false,
+ 'eval' : false,
+ EvalError : false,
+ Function : false,
+ hasOwnProperty : false,
+ isFinite : false,
+ isNaN : false,
+ JSON : false,
+ Math : false,
+ Number : false,
+ Object : false,
+ parseInt : false,
+ parseFloat : false,
+ RangeError : false,
+ ReferenceError : false,
+ RegExp : false,
+ String : false,
+ SyntaxError : false,
+ TypeError : false,
+ URIError : false
+ },
+
+ // widely adopted global names that are not part of ECMAScript standard
+ nonstandard = {
+ escape : false,
+ unescape : false
+ },
+
+ standard_member = {
+ E : true,
+ LN2 : true,
+ LN10 : true,
+ LOG2E : true,
+ LOG10E : true,
+ MAX_VALUE : true,
+ MIN_VALUE : true,
+ NEGATIVE_INFINITY : true,
+ PI : true,
+ POSITIVE_INFINITY : true,
+ SQRT1_2 : true,
+ SQRT2 : true
+ },
+
+ directive,
+ syntax = {},
+ tab,
+ token,
+ urls,
+ useESNextSyntax,
+ warnings,
+
+ wsh = {
+ ActiveXObject : true,
+ Enumerator : true,
+ GetObject : true,
+ ScriptEngine : true,
+ ScriptEngineBuildVersion : true,
+ ScriptEngineMajorVersion : true,
+ ScriptEngineMinorVersion : true,
+ VBArray : true,
+ WSH : true,
+ WScript : true,
+ XDomainRequest : true
+ };
+
+ // Regular expressions. Some of these are stupidly long.
+ var ax, cx, tx, nx, nxg, lx, ix, jx, ft;
+ (function () {
+ /*jshint maxlen:300 */
+
+ // unsafe comment or string
+ ax = /@cc|<\/?|script|\]\s*\]|<\s*!|&lt/i;
+
+ // unsafe characters that are silently deleted by one or more browsers
+ cx = /[\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/;
+
+ // token
+ tx = /^\s*([(){}\[.,:;'"~\?\]#@]|==?=?|\/(\*(jshint|jslint|members?|global)?|=|\/)?|\*[\/=]?|\+(?:=|\++)?|-(?:=|-+)?|%=?|&[&=]?|\|[|=]?|>>?>?=?|<([\/=!]|\!(\[|--)?|<=?)?|\^=?|\!=?=?|[a-zA-Z_$][a-zA-Z0-9_$]*|[0-9]+([xX][0-9a-fA-F]+|\.[0-9]*)?([eE][+\-]?[0-9]+)?)/;
+
+ // characters in strings that need escapement
+ nx = /[\u0000-\u001f&<"\/\\\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/;
+ nxg = /[\u0000-\u001f&<"\/\\\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
+
+ // star slash
+ lx = /\*\/|\/\*/;
+
+ // identifier
+ ix = /^([a-zA-Z_$][a-zA-Z0-9_$]*)$/;
+
+ // javascript url
+ jx = /^(?:javascript|jscript|ecmascript|vbscript|mocha|livescript)\s*:/i;
+
+ // catches /* falls through */ comments
+ ft = /^\s*\/\*\s*falls\sthrough\s*\*\/\s*$/;
+ }());
+
+ function F() {} // Used by Object.create
+
+ function is_own(object, name) {
+
+// The object.hasOwnProperty method fails when the property under consideration
+// is named 'hasOwnProperty'. So we have to use this more convoluted form.
+
+ return Object.prototype.hasOwnProperty.call(object, name);
+ }
+
+ function checkOption(name, t) {
+ if (valOptions[name] === undefined && boolOptions[name] === undefined) {
+ warning("Bad option: '" + name + "'.", t);
+ }
+ }
+
+// Provide critical ES5 functions to ES3.
+
+ if (typeof Array.isArray !== 'function') {
+ Array.isArray = function (o) {
+ return Object.prototype.toString.apply(o) === '[object Array]';
+ };
+ }
+
+ if (typeof Object.create !== 'function') {
+ Object.create = function (o) {
+ F.prototype = o;
+ return new F();
+ };
+ }
+
+ if (typeof Object.keys !== 'function') {
+ Object.keys = function (o) {
+ var a = [], k;
+ for (k in o) {
+ if (is_own(o, k)) {
+ a.push(k);
+ }
+ }
+ return a;
+ };
+ }
+
+// Non standard methods
+
+ if (typeof String.prototype.entityify !== 'function') {
+ String.prototype.entityify = function () {
+ return this
+ .replace(/&/g, '&amp;')
+ .replace(/</g, '&lt;')
+ .replace(/>/g, '&gt;');
+ };
+ }
+
+ if (typeof String.prototype.isAlpha !== 'function') {
+ String.prototype.isAlpha = function () {
+ return (this >= 'a' && this <= 'z\uffff') ||
+ (this >= 'A' && this <= 'Z\uffff');
+ };
+ }
+
+ if (typeof String.prototype.isDigit !== 'function') {
+ String.prototype.isDigit = function () {
+ return (this >= '0' && this <= '9');
+ };
+ }
+
+ if (typeof String.prototype.supplant !== 'function') {
+ String.prototype.supplant = function (o) {
+ return this.replace(/\{([^{}]*)\}/g, function (a, b) {
+ var r = o[b];
+ return typeof r === 'string' || typeof r === 'number' ? r : a;
+ });
+ };
+ }
+
+ if (typeof String.prototype.name !== 'function') {
+ String.prototype.name = function () {
+
+// If the string looks like an identifier, then we can return it as is.
+// If the string contains no control characters, no quote characters, and no
+// backslash characters, then we can simply slap some quotes around it.
+// Otherwise we must also replace the offending characters with safe
+// sequences.
+
+ if (ix.test(this)) {
+ return this;
+ }
+ if (nx.test(this)) {
+ return '"' + this.replace(nxg, function (a) {
+ var c = escapes[a];
+ if (c) {
+ return c;
+ }
+ return '\\u' + ('0000' + a.charCodeAt().toString(16)).slice(-4);
+ }) + '"';
+ }
+ return '"' + this + '"';
+ };
+ }
+
+
+ function combine(t, o) {
+ var n;
+ for (n in o) {
+ if (is_own(o, n)) {
+ t[n] = o[n];
+ }
+ }
+ }
+
+ function assume() {
+ if (option.couch) {
+ combine(predefined, couch);
+ }
+
+ if (option.rhino) {
+ combine(predefined, rhino);
+ }
+
+ if (option.prototypejs) {
+ combine(predefined, prototypejs);
+ }
+
+ if (option.node) {
+ combine(predefined, node);
+ option.globalstrict = true;
+ }
+
+ if (option.devel) {
+ combine(predefined, devel);
+ }
+
+ if (option.dojo) {
+ combine(predefined, dojo);
+ }
+
+ if (option.browser) {
+ combine(predefined, browser);
+ }
+
+ if (option.nonstandard) {
+ combine(predefined, nonstandard);
+ }
+
+ if (option.jquery) {
+ combine(predefined, jquery);
+ }
+
+ if (option.mootools) {
+ combine(predefined, mootools);
+ }
+
+ if (option.wsh) {
+ combine(predefined, wsh);
+ }
+
+ if (option.esnext) {
+ useESNextSyntax();
+ }
+
+ if (option.globalstrict && option.strict !== false) {
+ option.strict = true;
+ }
+ }
+
+
+ // Produce an error warning.
+ function quit(message, line, chr) {
+ var percentage = Math.floor((line / lines.length) * 100);
+
+ throw {
+ name: 'JSHintError',
+ line: line,
+ character: chr,
+ message: message + " (" + percentage + "% scanned).",
+ raw: message
+ };
+ }
+
+ function isundef(scope, m, t, a) {
+ return JSHINT.undefs.push([scope, m, t, a]);
+ }
+
+ function warning(m, t, a, b, c, d) {
+ var ch, l, w;
+ t = t || nexttoken;
+ if (t.id === '(end)') { // `~
+ t = token;
+ }
+ l = t.line || 0;
+ ch = t.from || 0;
+ w = {
+ id: '(error)',
+ raw: m,
+ evidence: lines[l - 1] || '',
+ line: l,
+ character: ch,
+ a: a,
+ b: b,
+ c: c,
+ d: d
+ };
+ w.reason = m.supplant(w);
+ JSHINT.errors.push(w);
+ if (option.passfail) {
+ quit('Stopping. ', l, ch);
+ }
+ warnings += 1;
+ if (warnings >= option.maxerr) {
+ quit("Too many errors.", l, ch);
+ }
+ return w;
+ }
+
+ function warningAt(m, l, ch, a, b, c, d) {
+ return warning(m, {
+ line: l,
+ from: ch
+ }, a, b, c, d);
+ }
+
+ function error(m, t, a, b, c, d) {
+ var w = warning(m, t, a, b, c, d);
+ }
+
+ function errorAt(m, l, ch, a, b, c, d) {
+ return error(m, {
+ line: l,
+ from: ch
+ }, a, b, c, d);
+ }
+
+
+
+// lexical analysis and token construction
+
+ var lex = (function lex() {
+ var character, from, line, s;
+
+// Private lex methods
+
+ function nextLine() {
+ var at,
+ tw; // trailing whitespace check
+
+ if (line >= lines.length)
+ return false;
+
+ character = 1;
+ s = lines[line];
+ line += 1;
+
+ // If smarttabs option is used check for spaces followed by tabs only.
+ // Otherwise check for any occurence of mixed tabs and spaces.
+ if (option.smarttabs)
+ at = s.search(/ \t/);
+ else
+ at = s.search(/ \t|\t /);
+
+ if (at >= 0)
+ warningAt("Mixed spaces and tabs.", line, at + 1);
+
+ s = s.replace(/\t/g, tab);
+ at = s.search(cx);
+
+ if (at >= 0)
+ warningAt("Unsafe character.", line, at);
+
+ if (option.maxlen && option.maxlen < s.length)
+ warningAt("Line too long.", line, s.length);
+
+ // Check for trailing whitespaces
+ tw = option.trailing && s.match(/^(.*?)\s+$/);
+ if (tw && !/^\s+$/.test(s)) {
+ warningAt("Trailing whitespace.", line, tw[1].length + 1);
+ }
+ return true;
+ }
+
+// Produce a token object. The token inherits from a syntax symbol.
+
+ function it(type, value) {
+ var i, t;
+ if (type === '(color)' || type === '(range)') {
+ t = {type: type};
+ } else if (type === '(punctuator)' ||
+ (type === '(identifier)' && is_own(syntax, value))) {
+ t = syntax[value] || syntax['(error)'];
+ } else {
+ t = syntax[type];
+ }
+ t = Object.create(t);
+ if (type === '(string)' || type === '(range)') {
+ if (!option.scripturl && jx.test(value)) {
+ warningAt("Script URL.", line, from);
+ }
+ }
+ if (type === '(identifier)') {
+ t.identifier = true;
+ if (value === '__proto__' && !option.proto) {
+ warningAt("The '{a}' property is deprecated.",
+ line, from, value);
+ } else if (value === '__iterator__' && !option.iterator) {
+ warningAt("'{a}' is only available in JavaScript 1.7.",
+ line, from, value);
+ } else if (option.nomen && (value.charAt(0) === '_' ||
+ value.charAt(value.length - 1) === '_')) {
+ if (!option.node || token.id === '.' ||
+ (value !== '__dirname' && value !== '__filename')) {
+ warningAt("Unexpected {a} in '{b}'.", line, from, "dangling '_'", value);
+ }
+ }
+ }
+ t.value = value;
+ t.line = line;
+ t.character = character;
+ t.from = from;
+ i = t.id;
+ if (i !== '(endline)') {
+ prereg = i &&
+ (('(,=:[!&|?{};'.indexOf(i.charAt(i.length - 1)) >= 0) ||
+ i === 'return' ||
+ i === 'case');
+ }
+ return t;
+ }
+
+ // Public lex methods
+ return {
+ init: function (source) {
+ if (typeof source === 'string') {
+ lines = source
+ .replace(/\r\n/g, '\n')
+ .replace(/\r/g, '\n')
+ .split('\n');
+ } else {
+ lines = source;
+ }
+
+ // If the first line is a shebang (#!), make it a blank and move on.
+ // Shebangs are used by Node scripts.
+ if (lines[0] && lines[0].substr(0, 2) === '#!')
+ lines[0] = '';
+
+ line = 0;
+ nextLine();
+ from = 1;
+ },
+
+ range: function (begin, end) {
+ var c, value = '';
+ from = character;
+ if (s.charAt(0) !== begin) {
+ errorAt("Expected '{a}' and instead saw '{b}'.",
+ line, character, begin, s.charAt(0));
+ }
+ for (;;) {
+ s = s.slice(1);
+ character += 1;
+ c = s.charAt(0);
+ switch (c) {
+ case '':
+ errorAt("Missing '{a}'.", line, character, c);
+ break;
+ case end:
+ s = s.slice(1);
+ character += 1;
+ return it('(range)', value);
+ case '\\':
+ warningAt("Unexpected '{a}'.", line, character, c);
+ }
+ value += c;
+ }
+
+ },
+
+
+ // token -- this is called by advance to get the next token
+ token: function () {
+ var b, c, captures, d, depth, high, i, l, low, q, t, isLiteral, isInRange, n;
+
+ function match(x) {
+ var r = x.exec(s), r1;
+ if (r) {
+ l = r[0].length;
+ r1 = r[1];
+ c = r1.charAt(0);
+ s = s.substr(l);
+ from = character + l - r1.length;
+ character += l;
+ return r1;
+ }
+ }
+
+ function string(x) {
+ var c, j, r = '', allowNewLine = false;
+
+ if (jsonmode && x !== '"') {
+ warningAt("Strings must use doublequote.",
+ line, character);
+ }
+
+ function esc(n) {
+ var i = parseInt(s.substr(j + 1, n), 16);
+ j += n;
+ if (i >= 32 && i <= 126 &&
+ i !== 34 && i !== 92 && i !== 39) {
+ warningAt("Unnecessary escapement.", line, character);
+ }
+ character += n;
+ c = String.fromCharCode(i);
+ }
+ j = 0;
+unclosedString: for (;;) {
+ while (j >= s.length) {
+ j = 0;
+
+ var cl = line, cf = from;
+ if (!nextLine()) {
+ errorAt("Unclosed string.", cl, cf);
+ break unclosedString;
+ }
+
+ if (allowNewLine) {
+ allowNewLine = false;
+ } else {
+ warningAt("Unclosed string.", cl, cf);
+ }
+ }
+ c = s.charAt(j);
+ if (c === x) {
+ character += 1;
+ s = s.substr(j + 1);
+ return it('(string)', r, x);
+ }
+ if (c < ' ') {
+ if (c === '\n' || c === '\r') {
+ break;
+ }
+ warningAt("Control character in string: {a}.",
+ line, character + j, s.slice(0, j));
+ } else if (c === '\\') {
+ j += 1;
+ character += 1;
+ c = s.charAt(j);
+ n = s.charAt(j + 1);
+ switch (c) {
+ case '\\':
+ case '"':
+ case '/':
+ break;
+ case '\'':
+ if (jsonmode) {
+ warningAt("Avoid \\'.", line, character);
+ }
+ break;
+ case 'b':
+ c = '\b';
+ break;
+ case 'f':
+ c = '\f';
+ break;
+ case 'n':
+ c = '\n';
+ break;
+ case 'r':
+ c = '\r';
+ break;
+ case 't':
+ c = '\t';
+ break;
+ case '0':
+ c = '\0';
+ // Octal literals fail in strict mode
+ // check if the number is between 00 and 07
+ // where 'n' is the token next to 'c'
+ if (n >= 0 && n <= 7 && directive["use strict"]) {
+ warningAt(
+ "Octal literals are not allowed in strict mode.",
+ line, character);
+ }
+ break;
+ case 'u':
+ esc(4);
+ break;
+ case 'v':
+ if (jsonmode) {
+ warningAt("Avoid \\v.", line, character);
+ }
+ c = '\v';
+ break;
+ case 'x':
+ if (jsonmode) {
+ warningAt("Avoid \\x-.", line, character);
+ }
+ esc(2);
+ break;
+ case '':
+ // last character is escape character
+ // always allow new line if escaped, but show
+ // warning if option is not set
+ allowNewLine = true;
+ if (option.multistr) {
+ if (jsonmode) {
+ warningAt("Avoid EOL escapement.", line, character);
+ }
+ c = '';
+ character -= 1;
+ break;
+ }
+ warningAt("Bad escapement of EOL. Use option multistr if needed.",
+ line, character);
+ break;
+ default:
+ warningAt("Bad escapement.", line, character);
+ }
+ }
+ r += c;
+ character += 1;
+ j += 1;
+ }
+ }
+
+ for (;;) {
+ if (!s) {
+ return it(nextLine() ? '(endline)' : '(end)', '');
+ }
+ t = match(tx);
+ if (!t) {
+ t = '';
+ c = '';
+ while (s && s < '!') {
+ s = s.substr(1);
+ }
+ if (s) {
+ errorAt("Unexpected '{a}'.", line, character, s.substr(0, 1));
+ s = '';
+ }
+ } else {
+
+ // identifier
+
+ if (c.isAlpha() || c === '_' || c === '$') {
+ return it('(identifier)', t);
+ }
+
+ // number
+
+ if (c.isDigit()) {
+ if (!isFinite(Number(t))) {
+ warningAt("Bad number '{a}'.",
+ line, character, t);
+ }
+ if (s.substr(0, 1).isAlpha()) {
+ warningAt("Missing space after '{a}'.",
+ line, character, t);
+ }
+ if (c === '0') {
+ d = t.substr(1, 1);
+ if (d.isDigit()) {
+ if (token.id !== '.') {
+ warningAt("Don't use extra leading zeros '{a}'.",
+ line, character, t);
+ }
+ } else if (jsonmode && (d === 'x' || d === 'X')) {
+ warningAt("Avoid 0x-. '{a}'.",
+ line, character, t);
+ }
+ }
+ if (t.substr(t.length - 1) === '.') {
+ warningAt(
+"A trailing decimal point can be confused with a dot '{a}'.", line, character, t);
+ }
+ return it('(number)', t);
+ }
+ switch (t) {
+
+ // string
+
+ case '"':
+ case "'":
+ return string(t);
+
+ // // comment
+
+ case '//':
+ s = '';
+ token.comment = true;
+ break;
+
+ // /* comment
+
+ case '/*':
+ for (;;) {
+ i = s.search(lx);
+ if (i >= 0) {
+ break;
+ }
+ if (!nextLine()) {
+ errorAt("Unclosed comment.", line, character);
+ }
+ }
+ character += i + 2;
+ if (s.substr(i, 1) === '/') {
+ errorAt("Nested comment.", line, character);
+ }
+ s = s.substr(i + 2);
+ token.comment = true;
+ break;
+
+ // /*members /*jshint /*global
+
+ case '/*members':
+ case '/*member':
+ case '/*jshint':
+ case '/*jslint':
+ case '/*global':
+ case '*/':
+ return {
+ value: t,
+ type: 'special',
+ line: line,
+ character: character,
+ from: from
+ };
+
+ case '':
+ break;
+ // /
+ case '/':
+ if (token.id === '/=') {
+ errorAt("A regular expression literal can be confused with '/='.",
+ line, from);
+ }
+ if (prereg) {
+ depth = 0;
+ captures = 0;
+ l = 0;
+ for (;;) {
+ b = true;
+ c = s.charAt(l);
+ l += 1;
+ switch (c) {
+ case '':
+ errorAt("Unclosed regular expression.", line, from);
+ return quit('Stopping.', line, from);
+ case '/':
+ if (depth > 0) {
+ warningAt("{a} unterminated regular expression " +
+ "group(s).", line, from + l, depth);
+ }
+ c = s.substr(0, l - 1);
+ q = {
+ g: true,
+ i: true,
+ m: true
+ };
+ while (q[s.charAt(l)] === true) {
+ q[s.charAt(l)] = false;
+ l += 1;
+ }
+ character += l;
+ s = s.substr(l);
+ q = s.charAt(0);
+ if (q === '/' || q === '*') {
+ errorAt("Confusing regular expression.",
+ line, from);
+ }
+ return it('(regexp)', c);
+ case '\\':
+ c = s.charAt(l);
+ if (c < ' ') {
+ warningAt(
+"Unexpected control character in regular expression.", line, from + l);
+ } else if (c === '<') {
+ warningAt(
+"Unexpected escaped character '{a}' in regular expression.", line, from + l, c);
+ }
+ l += 1;
+ break;
+ case '(':
+ depth += 1;
+ b = false;
+ if (s.charAt(l) === '?') {
+ l += 1;
+ switch (s.charAt(l)) {
+ case ':':
+ case '=':
+ case '!':
+ l += 1;
+ break;
+ default:
+ warningAt(
+"Expected '{a}' and instead saw '{b}'.", line, from + l, ':', s.charAt(l));
+ }
+ } else {
+ captures += 1;
+ }
+ break;
+ case '|':
+ b = false;
+ break;
+ case ')':
+ if (depth === 0) {
+ warningAt("Unescaped '{a}'.",
+ line, from + l, ')');
+ } else {
+ depth -= 1;
+ }
+ break;
+ case ' ':
+ q = 1;
+ while (s.charAt(l) === ' ') {
+ l += 1;
+ q += 1;
+ }
+ if (q > 1) {
+ warningAt(
+"Spaces are hard to count. Use {{a}}.", line, from + l, q);
+ }
+ break;
+ case '[':
+ c = s.charAt(l);
+ if (c === '^') {
+ l += 1;
+ if (option.regexp) {
+ warningAt("Insecure '{a}'.",
+ line, from + l, c);
+ } else if (s.charAt(l) === ']') {
+ errorAt("Unescaped '{a}'.",
+ line, from + l, '^');
+ }
+ }
+ if (c === ']') {
+ warningAt("Empty class.", line,
+ from + l - 1);
+ }
+ isLiteral = false;
+ isInRange = false;
+klass: do {
+ c = s.charAt(l);
+ l += 1;
+ switch (c) {
+ case '[':
+ case '^':
+ warningAt("Unescaped '{a}'.",
+ line, from + l, c);
+ if (isInRange) {
+ isInRange = false;
+ } else {
+ isLiteral = true;
+ }
+ break;
+ case '-':
+ if (isLiteral && !isInRange) {
+ isLiteral = false;
+ isInRange = true;
+ } else if (isInRange) {
+ isInRange = false;
+ } else if (s.charAt(l) === ']') {
+ isInRange = true;
+ } else {
+ if (option.regexdash !== (l === 2 || (l === 3 &&
+ s.charAt(1) === '^'))) {
+ warningAt("Unescaped '{a}'.",
+ line, from + l - 1, '-');
+ }
+ isLiteral = true;
+ }
+ break;
+ case ']':
+ if (isInRange && !option.regexdash) {
+ warningAt("Unescaped '{a}'.",
+ line, from + l - 1, '-');
+ }
+ break klass;
+ case '\\':
+ c = s.charAt(l);
+ if (c < ' ') {
+ warningAt(
+"Unexpected control character in regular expression.", line, from + l);
+ } else if (c === '<') {
+ warningAt(
+"Unexpected escaped character '{a}' in regular expression.", line, from + l, c);
+ }
+ l += 1;
+
+ // \w, \s and \d are never part of a character range
+ if (/[wsd]/i.test(c)) {
+ if (isInRange) {
+ warningAt("Unescaped '{a}'.",
+ line, from + l, '-');
+ isInRange = false;
+ }
+ isLiteral = false;
+ } else if (isInRange) {
+ isInRange = false;
+ } else {
+ isLiteral = true;
+ }
+ break;
+ case '/':
+ warningAt("Unescaped '{a}'.",
+ line, from + l - 1, '/');
+
+ if (isInRange) {
+ isInRange = false;
+ } else {
+ isLiteral = true;
+ }
+ break;
+ case '<':
+ if (isInRange) {
+ isInRange = false;
+ } else {
+ isLiteral = true;
+ }
+ break;
+ default:
+ if (isInRange) {
+ isInRange = false;
+ } else {
+ isLiteral = true;
+ }
+ }
+ } while (c);
+ break;
+ case '.':
+ if (option.regexp) {
+ warningAt("Insecure '{a}'.", line,
+ from + l, c);
+ }
+ break;
+ case ']':
+ case '?':
+ case '{':
+ case '}':
+ case '+':
+ case '*':
+ warningAt("Unescaped '{a}'.", line,
+ from + l, c);
+ }
+ if (b) {
+ switch (s.charAt(l)) {
+ case '?':
+ case '+':
+ case '*':
+ l += 1;
+ if (s.charAt(l) === '?') {
+ l += 1;
+ }
+ break;
+ case '{':
+ l += 1;
+ c = s.charAt(l);
+ if (c < '0' || c > '9') {
+ warningAt(
+"Expected a number and instead saw '{a}'.", line, from + l, c);
+ }
+ l += 1;
+ low = +c;
+ for (;;) {
+ c = s.charAt(l);
+ if (c < '0' || c > '9') {
+ break;
+ }
+ l += 1;
+ low = +c + (low * 10);
+ }
+ high = low;
+ if (c === ',') {
+ l += 1;
+ high = Infinity;
+ c = s.charAt(l);
+ if (c >= '0' && c <= '9') {
+ l += 1;
+ high = +c;
+ for (;;) {
+ c = s.charAt(l);
+ if (c < '0' || c > '9') {
+ break;
+ }
+ l += 1;
+ high = +c + (high * 10);
+ }
+ }
+ }
+ if (s.charAt(l) !== '}') {
+ warningAt(
+"Expected '{a}' and instead saw '{b}'.", line, from + l, '}', c);
+ } else {
+ l += 1;
+ }
+ if (s.charAt(l) === '?') {
+ l += 1;
+ }
+ if (low > high) {
+ warningAt(
+"'{a}' should not be greater than '{b}'.", line, from + l, low, high);
+ }
+ }
+ }
+ }
+ c = s.substr(0, l - 1);
+ character += l;
+ s = s.substr(l);
+ return it('(regexp)', c);
+ }
+ return it('(punctuator)', t);
+
+ // punctuator
+
+ case '#':
+ return it('(punctuator)', t);
+ default:
+ return it('(punctuator)', t);
+ }
+ }
+ }
+ }
+ };
+ }());
+
+
+ function addlabel(t, type) {
+
+ if (t === 'hasOwnProperty') {
+ warning("'hasOwnProperty' is a really bad name.");
+ }
+
+// Define t in the current function in the current scope.
+ if (is_own(funct, t) && !funct['(global)']) {
+ if (funct[t] === true) {
+ if (option.latedef)
+ warning("'{a}' was used before it was defined.", nexttoken, t);
+ } else {
+ if (!option.shadow && type !== "exception")
+ warning("'{a}' is already defined.", nexttoken, t);
+ }
+ }
+
+ funct[t] = type;
+ if (funct['(global)']) {
+ global[t] = funct;
+ if (is_own(implied, t)) {
+ if (option.latedef)
+ warning("'{a}' was used before it was defined.", nexttoken, t);
+ delete implied[t];
+ }
+ } else {
+ scope[t] = funct;
+ }
+ }
+
+
+ function doOption() {
+ var b, obj, filter, o = nexttoken.value, t, v;
+
+ switch (o) {
+ case '*/':
+ error("Unbegun comment.");
+ break;
+ case '/*members':
+ case '/*member':
+ o = '/*members';
+ if (!membersOnly) {
+ membersOnly = {};
+ }
+ obj = membersOnly;
+ break;
+ case '/*jshint':
+ case '/*jslint':
+ obj = option;
+ filter = boolOptions;
+ break;
+ case '/*global':
+ obj = predefined;
+ break;
+ default:
+ error("What?");
+ }
+
+ t = lex.token();
+loop: for (;;) {
+ for (;;) {
+ if (t.type === 'special' && t.value === '*/') {
+ break loop;
+ }
+ if (t.id !== '(endline)' && t.id !== ',') {
+ break;
+ }
+ t = lex.token();
+ }
+ if (t.type !== '(string)' && t.type !== '(identifier)' &&
+ o !== '/*members') {
+ error("Bad option.", t);
+ }
+
+ v = lex.token();
+ if (v.id === ':') {
+ v = lex.token();
+
+ if (obj === membersOnly) {
+ error("Expected '{a}' and instead saw '{b}'.",
+ t, '*/', ':');
+ }
+
+ if (o === '/*jshint') {
+ checkOption(t.value, t);
+ }
+
+ if (t.value === 'indent' && (o === '/*jshint' || o === '/*jslint')) {
+ b = +v.value;
+ if (typeof b !== 'number' || !isFinite(b) || b <= 0 ||
+ Math.floor(b) !== b) {
+ error("Expected a small integer and instead saw '{a}'.",
+ v, v.value);
+ }
+ obj.white = true;
+ obj.indent = b;
+ } else if (t.value === 'maxerr' && (o === '/*jshint' || o === '/*jslint')) {
+ b = +v.value;
+ if (typeof b !== 'number' || !isFinite(b) || b <= 0 ||
+ Math.floor(b) !== b) {
+ error("Expected a small integer and instead saw '{a}'.",
+ v, v.value);
+ }
+ obj.maxerr = b;
+ } else if (t.value === 'maxlen' && (o === '/*jshint' || o === '/*jslint')) {
+ b = +v.value;
+ if (typeof b !== 'number' || !isFinite(b) || b <= 0 ||
+ Math.floor(b) !== b) {
+ error("Expected a small integer and instead saw '{a}'.",
+ v, v.value);
+ }
+ obj.maxlen = b;
+ } else if (t.value === 'validthis') {
+ if (funct['(global)']) {
+ error("Option 'validthis' can't be used in a global scope.");
+ } else {
+ if (v.value === 'true' || v.value === 'false')
+ obj[t.value] = v.value === 'true';
+ else
+ error("Bad option value.", v);
+ }
+ } else if (v.value === 'true') {
+ obj[t.value] = true;
+ } else if (v.value === 'false') {
+ obj[t.value] = false;
+ } else {
+ error("Bad option value.", v);
+ }
+ t = lex.token();
+ } else {
+ if (o === '/*jshint' || o === '/*jslint') {
+ error("Missing option value.", t);
+ }
+ obj[t.value] = false;
+ t = v;
+ }
+ }
+ if (filter) {
+ assume();
+ }
+ }
+
+
+// We need a peek function. If it has an argument, it peeks that much farther
+// ahead. It is used to distinguish
+// for ( var i in ...
+// from
+// for ( var i = ...
+
+ function peek(p) {
+ var i = p || 0, j = 0, t;
+
+ while (j <= i) {
+ t = lookahead[j];
+ if (!t) {
+ t = lookahead[j] = lex.token();
+ }
+ j += 1;
+ }
+ return t;
+ }
+
+
+
+// Produce the next token. It looks for programming errors.
+
+ function advance(id, t) {
+ switch (token.id) {
+ case '(number)':
+ if (nexttoken.id === '.') {
+ warning("A dot following a number can be confused with a decimal point.", token);
+ }
+ break;
+ case '-':
+ if (nexttoken.id === '-' || nexttoken.id === '--') {
+ warning("Confusing minusses.");
+ }
+ break;
+ case '+':
+ if (nexttoken.id === '+' || nexttoken.id === '++') {
+ warning("Confusing plusses.");
+ }
+ break;
+ }
+
+ if (token.type === '(string)' || token.identifier) {
+ anonname = token.value;
+ }
+
+ if (id && nexttoken.id !== id) {
+ if (t) {
+ if (nexttoken.id === '(end)') {
+ warning("Unmatched '{a}'.", t, t.id);
+ } else {
+ warning("Expected '{a}' to match '{b}' from line {c} and instead saw '{d}'.",
+ nexttoken, id, t.id, t.line, nexttoken.value);
+ }
+ } else if (nexttoken.type !== '(identifier)' ||
+ nexttoken.value !== id) {
+ warning("Expected '{a}' and instead saw '{b}'.",
+ nexttoken, id, nexttoken.value);
+ }
+ }
+
+ prevtoken = token;
+ token = nexttoken;
+ for (;;) {
+ nexttoken = lookahead.shift() || lex.token();
+ if (nexttoken.id === '(end)' || nexttoken.id === '(error)') {
+ return;
+ }
+ if (nexttoken.type === 'special') {
+ doOption();
+ } else {
+ if (nexttoken.id !== '(endline)') {
+ break;
+ }
+ }
+ }
+ }
+
+
+// This is the heart of JSHINT, the Pratt parser. In addition to parsing, it
+// is looking for ad hoc lint patterns. We add .fud to Pratt's model, which is
+// like .nud except that it is only used on the first token of a statement.
+// Having .fud makes it much easier to define statement-oriented languages like
+// JavaScript. I retained Pratt's nomenclature.
+
+// .nud Null denotation
+// .fud First null denotation
+// .led Left denotation
+// lbp Left binding power
+// rbp Right binding power
+
+// They are elements of the parsing method called Top Down Operator Precedence.
+
+ function expression(rbp, initial) {
+ var left, isArray = false, isObject = false;
+
+ if (nexttoken.id === '(end)')
+ error("Unexpected early end of program.", token);
+
+ advance();
+ if (initial) {
+ anonname = 'anonymous';
+ funct['(verb)'] = token.value;
+ }
+ if (initial === true && token.fud) {
+ left = token.fud();
+ } else {
+ if (token.nud) {
+ left = token.nud();
+ } else {
+ if (nexttoken.type === '(number)' && token.id === '.') {
+ warning("A leading decimal point can be confused with a dot: '.{a}'.",
+ token, nexttoken.value);
+ advance();
+ return token;
+ } else {
+ error("Expected an identifier and instead saw '{a}'.",
+ token, token.id);
+ }
+ }
+ while (rbp < nexttoken.lbp) {
+ isArray = token.value === 'Array';
+ isObject = token.value === 'Object';
+ advance();
+ if (isArray && token.id === '(' && nexttoken.id === ')')
+ warning("Use the array literal notation [].", token);
+ if (isObject && token.id === '(' && nexttoken.id === ')')
+ warning("Use the object literal notation {}.", token);
+ if (token.led) {
+ left = token.led(left);
+ } else {
+ error("Expected an operator and instead saw '{a}'.",
+ token, token.id);
+ }
+ }
+ }
+ return left;
+ }
+
+
+// Functions for conformance of style.
+
+ function adjacent(left, right) {
+ left = left || token;
+ right = right || nexttoken;
+ if (option.white) {
+ if (left.character !== right.from && left.line === right.line) {
+ left.from += (left.character - left.from);
+ warning("Unexpected space after '{a}'.", left, left.value);
+ }
+ }
+ }
+
+ function nobreak(left, right) {
+ left = left || token;
+ right = right || nexttoken;
+ if (option.white && (left.character !== right.from || left.line !== right.line)) {
+ warning("Unexpected space before '{a}'.", right, right.value);
+ }
+ }
+
+ function nospace(left, right) {
+ left = left || token;
+ right = right || nexttoken;
+ if (option.white && !left.comment) {
+ if (left.line === right.line) {
+ adjacent(left, right);
+ }
+ }
+ }
+
+ function nonadjacent(left, right) {
+ if (option.white) {
+ left = left || token;
+ right = right || nexttoken;
+ if (left.line === right.line && left.character === right.from) {
+ left.from += (left.character - left.from);
+ warning("Missing space after '{a}'.",
+ left, left.value);
+ }
+ }
+ }
+
+ function nobreaknonadjacent(left, right) {
+ left = left || token;
+ right = right || nexttoken;
+ if (!option.laxbreak && left.line !== right.line) {
+ warning("Bad line breaking before '{a}'.", right, right.id);
+ } else if (option.white) {
+ left = left || token;
+ right = right || nexttoken;
+ if (left.character === right.from) {
+ left.from += (left.character - left.from);
+ warning("Missing space after '{a}'.",
+ left, left.value);
+ }
+ }
+ }
+
+ function indentation(bias) {
+ var i;
+ if (option.white && nexttoken.id !== '(end)') {
+ i = indent + (bias || 0);
+ if (nexttoken.from !== i) {
+ warning(
+"Expected '{a}' to have an indentation at {b} instead at {c}.",
+ nexttoken, nexttoken.value, i, nexttoken.from);
+ }
+ }
+ }
+
+ function nolinebreak(t) {
+ t = t || token;
+ if (t.line !== nexttoken.line) {
+ warning("Line breaking error '{a}'.", t, t.value);
+ }
+ }
+
+
+ function comma() {
+ if (token.line !== nexttoken.line) {
+ if (!option.laxcomma) {
+ if (comma.first) {
+ warning("Comma warnings can be turned off with 'laxcomma'");
+ comma.first = false;
+ }
+ warning("Bad line breaking before '{a}'.", token, nexttoken.id);
+ }
+ } else if (!token.comment && token.character !== nexttoken.from && option.white) {
+ token.from += (token.character - token.from);
+ warning("Unexpected space after '{a}'.", token, token.value);
+ }
+ advance(',');
+ nonadjacent(token, nexttoken);
+ }
+
+
+// Functional constructors for making the symbols that will be inherited by
+// tokens.
+
+ function symbol(s, p) {
+ var x = syntax[s];
+ if (!x || typeof x !== 'object') {
+ syntax[s] = x = {
+ id: s,
+ lbp: p,
+ value: s
+ };
+ }
+ return x;
+ }
+
+
+ function delim(s) {
+ return symbol(s, 0);
+ }
+
+
+ function stmt(s, f) {
+ var x = delim(s);
+ x.identifier = x.reserved = true;
+ x.fud = f;
+ return x;
+ }
+
+
+ function blockstmt(s, f) {
+ var x = stmt(s, f);
+ x.block = true;
+ return x;
+ }
+
+
+ function reserveName(x) {
+ var c = x.id.charAt(0);
+ if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) {
+ x.identifier = x.reserved = true;
+ }
+ return x;
+ }
+
+
+ function prefix(s, f) {
+ var x = symbol(s, 150);
+ reserveName(x);
+ x.nud = (typeof f === 'function') ? f : function () {
+ this.right = expression(150);
+ this.arity = 'unary';
+ if (this.id === '++' || this.id === '--') {
+ if (option.plusplus) {
+ warning("Unexpected use of '{a}'.", this, this.id);
+ } else if ((!this.right.identifier || this.right.reserved) &&
+ this.right.id !== '.' && this.right.id !== '[') {
+ warning("Bad operand.", this);
+ }
+ }
+ return this;
+ };
+ return x;
+ }
+
+
+ function type(s, f) {
+ var x = delim(s);
+ x.type = s;
+ x.nud = f;
+ return x;
+ }
+
+
+ function reserve(s, f) {
+ var x = type(s, f);
+ x.identifier = x.reserved = true;
+ return x;
+ }
+
+
+ function reservevar(s, v) {
+ return reserve(s, function () {
+ if (typeof v === 'function') {
+ v(this);
+ }
+ return this;
+ });
+ }
+
+
+ function infix(s, f, p, w) {
+ var x = symbol(s, p);
+ reserveName(x);
+ x.led = function (left) {
+ if (!w) {
+ nobreaknonadjacent(prevtoken, token);
+ nonadjacent(token, nexttoken);
+ }
+ if (s === "in" && left.id === "!") {
+ warning("Confusing use of '{a}'.", left, '!');
+ }
+ if (typeof f === 'function') {
+ return f(left, this);
+ } else {
+ this.left = left;
+ this.right = expression(p);
+ return this;
+ }
+ };
+ return x;
+ }
+
+
+ function relation(s, f) {
+ var x = symbol(s, 100);
+ x.led = function (left) {
+ nobreaknonadjacent(prevtoken, token);
+ nonadjacent(token, nexttoken);
+ var right = expression(100);
+ if ((left && left.id === 'NaN') || (right && right.id === 'NaN')) {
+ warning("Use the isNaN function to compare with NaN.", this);
+ } else if (f) {
+ f.apply(this, [left, right]);
+ }
+ if (left.id === '!') {
+ warning("Confusing use of '{a}'.", left, '!');
+ }
+ if (right.id === '!') {
+ warning("Confusing use of '{a}'.", right, '!');
+ }
+ this.left = left;
+ this.right = right;
+ return this;
+ };
+ return x;
+ }
+
+
+ function isPoorRelation(node) {
+ return node &&
+ ((node.type === '(number)' && +node.value === 0) ||
+ (node.type === '(string)' && node.value === '') ||
+ (node.type === 'null' && !option.eqnull) ||
+ node.type === 'true' ||
+ node.type === 'false' ||
+ node.type === 'undefined');
+ }
+
+
+ function assignop(s, f) {
+ symbol(s, 20).exps = true;
+ return infix(s, function (left, that) {
+ var l;
+ that.left = left;
+ if (predefined[left.value] === false &&
+ scope[left.value]['(global)'] === true) {
+ warning("Read only.", left);
+ } else if (left['function']) {
+ warning("'{a}' is a function.", left, left.value);
+ }
+ if (left) {
+ if (option.esnext && funct[left.value] === 'const') {
+ warning("Attempting to override '{a}' which is a constant", left, left.value);
+ }
+ if (left.id === '.' || left.id === '[') {
+ if (!left.left || left.left.value === 'arguments') {
+ warning('Bad assignment.', that);
+ }
+ that.right = expression(19);
+ return that;
+ } else if (left.identifier && !left.reserved) {
+ if (funct[left.value] === 'exception') {
+ warning("Do not assign to the exception parameter.", left);
+ }
+ that.right = expression(19);
+ return that;
+ }
+ if (left === syntax['function']) {
+ warning(
+"Expected an identifier in an assignment and instead saw a function invocation.",
+ token);
+ }
+ }
+ error("Bad assignment.", that);
+ }, 20);
+ }
+
+
+ function bitwise(s, f, p) {
+ var x = symbol(s, p);
+ reserveName(x);
+ x.led = (typeof f === 'function') ? f : function (left) {
+ if (option.bitwise) {
+ warning("Unexpected use of '{a}'.", this, this.id);
+ }
+ this.left = left;
+ this.right = expression(p);
+ return this;
+ };
+ return x;
+ }
+
+
+ function bitwiseassignop(s) {
+ symbol(s, 20).exps = true;
+ return infix(s, function (left, that) {
+ if (option.bitwise) {
+ warning("Unexpected use of '{a}'.", that, that.id);
+ }
+ nonadjacent(prevtoken, token);
+ nonadjacent(token, nexttoken);
+ if (left) {
+ if (left.id === '.' || left.id === '[' ||
+ (left.identifier && !left.reserved)) {
+ expression(19);
+ return that;
+ }
+ if (left === syntax['function']) {
+ warning(
+"Expected an identifier in an assignment, and instead saw a function invocation.",
+ token);
+ }
+ return that;
+ }
+ error("Bad assignment.", that);
+ }, 20);
+ }
+
+
+ function suffix(s, f) {
+ var x = symbol(s, 150);
+ x.led = function (left) {
+ if (option.plusplus) {
+ warning("Unexpected use of '{a}'.", this, this.id);
+ } else if ((!left.identifier || left.reserved) &&
+ left.id !== '.' && left.id !== '[') {
+ warning("Bad operand.", this);
+ }
+ this.left = left;
+ return this;
+ };
+ return x;
+ }
+
+
+ // fnparam means that this identifier is being defined as a function
+ // argument (see identifier())
+ function optionalidentifier(fnparam) {
+ if (nexttoken.identifier) {
+ advance();
+ if (token.reserved && !option.es5) {
+ // `undefined` as a function param is a common pattern to protect
+ // against the case when somebody does `undefined = true` and
+ // help with minification. More info: https://gist.github.com/315916
+ if (!fnparam || token.value !== 'undefined') {
+ warning("Expected an identifier and instead saw '{a}' (a reserved word).",
+ token, token.id);
+ }
+ }
+ return token.value;
+ }
+ }
+
+ // fnparam means that this identifier is being defined as a function
+ // argument
+ function identifier(fnparam) {
+ var i = optionalidentifier(fnparam);
+ if (i) {
+ return i;
+ }
+ if (token.id === 'function' && nexttoken.id === '(') {
+ warning("Missing name in function declaration.");
+ } else {
+ error("Expected an identifier and instead saw '{a}'.",
+ nexttoken, nexttoken.value);
+ }
+ }
+
+
+ function reachable(s) {
+ var i = 0, t;
+ if (nexttoken.id !== ';' || noreach) {
+ return;
+ }
+ for (;;) {
+ t = peek(i);
+ if (t.reach) {
+ return;
+ }
+ if (t.id !== '(endline)') {
+ if (t.id === 'function') {
+ if (!option.latedef) {
+ break;
+ }
+ warning(
+"Inner functions should be listed at the top of the outer function.", t);
+ break;
+ }
+ warning("Unreachable '{a}' after '{b}'.", t, t.value, s);
+ break;
+ }
+ i += 1;
+ }
+ }
+
+
+ function statement(noindent) {
+ var i = indent, r, s = scope, t = nexttoken;
+
+ if (t.id === ";") {
+ advance(";");
+ return;
+ }
+
+// Is this a labelled statement?
+
+ if (t.identifier && !t.reserved && peek().id === ':') {
+ advance();
+ advance(':');
+ scope = Object.create(s);
+ addlabel(t.value, 'label');
+ if (!nexttoken.labelled) {
+ warning("Label '{a}' on {b} statement.",
+ nexttoken, t.value, nexttoken.value);
+ }
+ if (jx.test(t.value + ':')) {
+ warning("Label '{a}' looks like a javascript url.",
+ t, t.value);
+ }
+ nexttoken.label = t.value;
+ t = nexttoken;
+ }
+
+// Parse the statement.
+
+ if (!noindent) {
+ indentation();
+ }
+ r = expression(0, true);
+
+ // Look for the final semicolon.
+ if (!t.block) {
+ if (!option.expr && (!r || !r.exps)) {
+ warning("Expected an assignment or function call and instead saw an expression.",
+ token);
+ } else if (option.nonew && r.id === '(' && r.left.id === 'new') {
+ warning("Do not use 'new' for side effects.");
+ }
+
+ if (nexttoken.id === ',') {
+ return comma();
+ }
+
+ if (nexttoken.id !== ';') {
+ if (!option.asi) {
+ // If this is the last statement in a block that ends on
+ // the same line *and* option lastsemic is on, ignore the warning.
+ // Otherwise, complain about missing semicolon.
+ if (!option.lastsemic || nexttoken.id !== '}' ||
+ nexttoken.line !== token.line) {
+ warningAt("Missing semicolon.", token.line, token.character);
+ }
+ }
+ } else {
+ adjacent(token, nexttoken);
+ advance(';');
+ nonadjacent(token, nexttoken);
+ }
+ }
+
+// Restore the indentation.
+
+ indent = i;
+ scope = s;
+ return r;
+ }
+
+
+ function statements(startLine) {
+ var a = [], f, p;
+
+ while (!nexttoken.reach && nexttoken.id !== '(end)') {
+ if (nexttoken.id === ';') {
+ p = peek();
+ if (!p || p.id !== "(") {
+ warning("Unnecessary semicolon.");
+ }
+ advance(';');
+ } else {
+ a.push(statement(startLine === nexttoken.line));
+ }
+ }
+ return a;
+ }
+
+
+ /*
+ * read all directives
+ * recognizes a simple form of asi, but always
+ * warns, if it is used
+ */
+ function directives() {
+ var i, p, pn;
+
+ for (;;) {
+ if (nexttoken.id === "(string)") {
+ p = peek(0);
+ if (p.id === "(endline)") {
+ i = 1;
+ do {
+ pn = peek(i);
+ i = i + 1;
+ } while (pn.id === "(endline)");
+
+ if (pn.id !== ";") {
+ if (pn.id !== "(string)" && pn.id !== "(number)" &&
+ pn.id !== "(regexp)" && pn.identifier !== true &&
+ pn.id !== "}") {
+ break;
+ }
+ warning("Missing semicolon.", nexttoken);
+ } else {
+ p = pn;
+ }
+ } else if (p.id === "}") {
+ // directive with no other statements, warn about missing semicolon
+ warning("Missing semicolon.", p);
+ } else if (p.id !== ";") {
+ break;
+ }
+
+ indentation();
+ advance();
+ if (directive[token.value]) {
+ warning("Unnecessary directive \"{a}\".", token, token.value);
+ }
+
+ if (token.value === "use strict") {
+ option.newcap = true;
+ option.undef = true;
+ }
+
+ // there's no directive negation, so always set to true
+ directive[token.value] = true;
+
+ if (p.id === ";") {
+ advance(";");
+ }
+ continue;
+ }
+ break;
+ }
+ }
+
+
+ /*
+ * Parses a single block. A block is a sequence of statements wrapped in
+ * braces.
+ *
+ * ordinary - true for everything but function bodies and try blocks.
+ * stmt - true if block can be a single statement (e.g. in if/for/while).
+ * isfunc - true if block is a function body
+ */
+ function block(ordinary, stmt, isfunc) {
+ var a,
+ b = inblock,
+ old_indent = indent,
+ m,
+ s = scope,
+ t,
+ line,
+ d;
+
+ inblock = ordinary;
+ if (!ordinary || !option.funcscope) scope = Object.create(scope);
+ nonadjacent(token, nexttoken);
+ t = nexttoken;
+
+ if (nexttoken.id === '{') {
+ advance('{');
+ line = token.line;
+ if (nexttoken.id !== '}') {
+ indent += option.indent;
+ while (!ordinary && nexttoken.from > indent) {
+ indent += option.indent;
+ }
+
+ if (isfunc) {
+ m = {};
+ for (d in directive) {
+ if (is_own(directive, d)) {
+ m[d] = directive[d];
+ }
+ }
+ directives();
+
+ if (option.strict && funct['(context)']['(global)']) {
+ if (!m["use strict"] && !directive["use strict"]) {
+ warning("Missing \"use strict\" statement.");
+ }
+ }
+ }
+
+ a = statements(line);
+
+ if (isfunc) {
+ directive = m;
+ }
+
+ indent -= option.indent;
+ if (line !== nexttoken.line) {
+ indentation();
+ }
+ } else if (line !== nexttoken.line) {
+ indentation();
+ }
+ advance('}', t);
+ indent = old_indent;
+ } else if (!ordinary) {
+ error("Expected '{a}' and instead saw '{b}'.",
+ nexttoken, '{', nexttoken.value);
+ } else {
+ if (!stmt || option.curly)
+ warning("Expected '{a}' and instead saw '{b}'.",
+ nexttoken, '{', nexttoken.value);
+
+ noreach = true;
+ indent += option.indent;
+ // test indentation only if statement is in new line
+ a = [statement(nexttoken.line === token.line)];
+ indent -= option.indent;
+ noreach = false;
+ }
+ funct['(verb)'] = null;
+ if (!ordinary || !option.funcscope) scope = s;
+ inblock = b;
+ if (ordinary && option.noempty && (!a || a.length === 0)) {
+ warning("Empty block.");
+ }
+ return a;
+ }
+
+
+ function countMember(m) {
+ if (membersOnly && typeof membersOnly[m] !== 'boolean') {
+ warning("Unexpected /*member '{a}'.", token, m);
+ }
+ if (typeof member[m] === 'number') {
+ member[m] += 1;
+ } else {
+ member[m] = 1;
+ }
+ }
+
+
+ function note_implied(token) {
+ var name = token.value, line = token.line, a = implied[name];
+ if (typeof a === 'function') {
+ a = false;
+ }
+
+ if (!a) {
+ a = [line];
+ implied[name] = a;
+ } else if (a[a.length - 1] !== line) {
+ a.push(line);
+ }
+ }
+
+
+ // Build the syntax table by declaring the syntactic elements of the language.
+
+ type('(number)', function () {
+ return this;
+ });
+
+ type('(string)', function () {
+ return this;
+ });
+
+ syntax['(identifier)'] = {
+ type: '(identifier)',
+ lbp: 0,
+ identifier: true,
+ nud: function () {
+ var v = this.value,
+ s = scope[v],
+ f;
+
+ if (typeof s === 'function') {
+ // Protection against accidental inheritance.
+ s = undefined;
+ } else if (typeof s === 'boolean') {
+ f = funct;
+ funct = functions[0];
+ addlabel(v, 'var');
+ s = funct;
+ funct = f;
+ }
+
+ // The name is in scope and defined in the current function.
+ if (funct === s) {
+ // Change 'unused' to 'var', and reject labels.
+ switch (funct[v]) {
+ case 'unused':
+ funct[v] = 'var';
+ break;
+ case 'unction':
+ funct[v] = 'function';
+ this['function'] = true;
+ break;
+ case 'function':
+ this['function'] = true;
+ break;
+ case 'label':
+ warning("'{a}' is a statement label.", token, v);
+ break;
+ }
+ } else if (funct['(global)']) {
+ // The name is not defined in the function. If we are in the global
+ // scope, then we have an undefined variable.
+ //
+ // Operators typeof and delete do not raise runtime errors even if
+ // the base object of a reference is null so no need to display warning
+ // if we're inside of typeof or delete.
+
+ if (option.undef && typeof predefined[v] !== 'boolean') {
+ // Attempting to subscript a null reference will throw an
+ // error, even within the typeof and delete operators
+ if (!(anonname === 'typeof' || anonname === 'delete') ||
+ (nexttoken && (nexttoken.value === '.' || nexttoken.value === '['))) {
+
+ isundef(funct, "'{a}' is not defined.", token, v);
+ }
+ }
+ note_implied(token);
+ } else {
+ // If the name is already defined in the current
+ // function, but not as outer, then there is a scope error.
+
+ switch (funct[v]) {
+ case 'closure':
+ case 'function':
+ case 'var':
+ case 'unused':
+ warning("'{a}' used out of scope.", token, v);
+ break;
+ case 'label':
+ warning("'{a}' is a statement label.", token, v);
+ break;
+ case 'outer':
+ case 'global':
+ break;
+ default:
+ // If the name is defined in an outer function, make an outer entry,
+ // and if it was unused, make it var.
+ if (s === true) {
+ funct[v] = true;
+ } else if (s === null) {
+ warning("'{a}' is not allowed.", token, v);
+ note_implied(token);
+ } else if (typeof s !== 'object') {
+ // Operators typeof and delete do not raise runtime errors even
+ // if the base object of a reference is null so no need to
+ // display warning if we're inside of typeof or delete.
+ if (option.undef) {
+ // Attempting to subscript a null reference will throw an
+ // error, even within the typeof and delete operators
+ if (!(anonname === 'typeof' || anonname === 'delete') ||
+ (nexttoken &&
+ (nexttoken.value === '.' || nexttoken.value === '['))) {
+
+ isundef(funct, "'{a}' is not defined.", token, v);
+ }
+ }
+ funct[v] = true;
+ note_implied(token);
+ } else {
+ switch (s[v]) {
+ case 'function':
+ case 'unction':
+ this['function'] = true;
+ s[v] = 'closure';
+ funct[v] = s['(global)'] ? 'global' : 'outer';
+ break;
+ case 'var':
+ case 'unused':
+ s[v] = 'closure';
+ funct[v] = s['(global)'] ? 'global' : 'outer';
+ break;
+ case 'closure':
+ case 'parameter':
+ funct[v] = s['(global)'] ? 'global' : 'outer';
+ break;
+ case 'label':
+ warning("'{a}' is a statement label.", token, v);
+ }
+ }
+ }
+ }
+ return this;
+ },
+ led: function () {
+ error("Expected an operator and instead saw '{a}'.",
+ nexttoken, nexttoken.value);
+ }
+ };
+
+ type('(regexp)', function () {
+ return this;
+ });
+
+
+// ECMAScript parser
+
+ delim('(endline)');
+ delim('(begin)');
+ delim('(end)').reach = true;
+ delim('</').reach = true;
+ delim('<!');
+ delim('<!--');
+ delim('-->');
+ delim('(error)').reach = true;
+ delim('}').reach = true;
+ delim(')');
+ delim(']');
+ delim('"').reach = true;
+ delim("'").reach = true;
+ delim(';');
+ delim(':').reach = true;
+ delim(',');
+ delim('#');
+ delim('@');
+ reserve('else');
+ reserve('case').reach = true;
+ reserve('catch');
+ reserve('default').reach = true;
+ reserve('finally');
+ reservevar('arguments', function (x) {
+ if (directive['use strict'] && funct['(global)']) {
+ warning("Strict violation.", x);
+ }
+ });
+ reservevar('eval');
+ reservevar('false');
+ reservevar('Infinity');
+ reservevar('NaN');
+ reservevar('null');
+ reservevar('this', function (x) {
+ if (directive['use strict'] && !option.validthis && ((funct['(statement)'] &&
+ funct['(name)'].charAt(0) > 'Z') || funct['(global)'])) {
+ warning("Possible strict violation.", x);
+ }
+ });
+ reservevar('true');
+ reservevar('undefined');
+ assignop('=', 'assign', 20);
+ assignop('+=', 'assignadd', 20);
+ assignop('-=', 'assignsub', 20);
+ assignop('*=', 'assignmult', 20);
+ assignop('/=', 'assigndiv', 20).nud = function () {
+ error("A regular expression literal can be confused with '/='.");
+ };
+ assignop('%=', 'assignmod', 20);
+ bitwiseassignop('&=', 'assignbitand', 20);
+ bitwiseassignop('|=', 'assignbitor', 20);
+ bitwiseassignop('^=', 'assignbitxor', 20);
+ bitwiseassignop('<<=', 'assignshiftleft', 20);
+ bitwiseassignop('>>=', 'assignshiftright', 20);
+ bitwiseassignop('>>>=', 'assignshiftrightunsigned', 20);
+ infix('?', function (left, that) {
+ that.left = left;
+ that.right = expression(10);
+ advance(':');
+ that['else'] = expression(10);
+ return that;
+ }, 30);
+
+ infix('||', 'or', 40);
+ infix('&&', 'and', 50);
+ bitwise('|', 'bitor', 70);
+ bitwise('^', 'bitxor', 80);
+ bitwise('&', 'bitand', 90);
+ relation('==', function (left, right) {
+ var eqnull = option.eqnull && (left.value === 'null' || right.value === 'null');
+
+ if (!eqnull && option.eqeqeq)
+ warning("Expected '{a}' and instead saw '{b}'.", this, '===', '==');
+ else if (isPoorRelation(left))
+ warning("Use '{a}' to compare with '{b}'.", this, '===', left.value);
+ else if (isPoorRelation(right))
+ warning("Use '{a}' to compare with '{b}'.", this, '===', right.value);
+
+ return this;
+ });
+ relation('===');
+ relation('!=', function (left, right) {
+ var eqnull = option.eqnull &&
+ (left.value === 'null' || right.value === 'null');
+
+ if (!eqnull && option.eqeqeq) {
+ warning("Expected '{a}' and instead saw '{b}'.",
+ this, '!==', '!=');
+ } else if (isPoorRelation(left)) {
+ warning("Use '{a}' to compare with '{b}'.",
+ this, '!==', left.value);
+ } else if (isPoorRelation(right)) {
+ warning("Use '{a}' to compare with '{b}'.",
+ this, '!==', right.value);
+ }
+ return this;
+ });
+ relation('!==');
+ relation('<');
+ relation('>');
+ relation('<=');
+ relation('>=');
+ bitwise('<<', 'shiftleft', 120);
+ bitwise('>>', 'shiftright', 120);
+ bitwise('>>>', 'shiftrightunsigned', 120);
+ infix('in', 'in', 120);
+ infix('instanceof', 'instanceof', 120);
+ infix('+', function (left, that) {
+ var right = expression(130);
+ if (left && right && left.id === '(string)' && right.id === '(string)') {
+ left.value += right.value;
+ left.character = right.character;
+ if (!option.scripturl && jx.test(left.value)) {
+ warning("JavaScript URL.", left);
+ }
+ return left;
+ }
+ that.left = left;
+ that.right = right;
+ return that;
+ }, 130);
+ prefix('+', 'num');
+ prefix('+++', function () {
+ warning("Confusing pluses.");
+ this.right = expression(150);
+ this.arity = 'unary';
+ return this;
+ });
+ infix('+++', function (left) {
+ warning("Confusing pluses.");
+ this.left = left;
+ this.right = expression(130);
+ return this;
+ }, 130);
+ infix('-', 'sub', 130);
+ prefix('-', 'neg');
+ prefix('---', function () {
+ warning("Confusing minuses.");
+ this.right = expression(150);
+ this.arity = 'unary';
+ return this;
+ });
+ infix('---', function (left) {
+ warning("Confusing minuses.");
+ this.left = left;
+ this.right = expression(130);
+ return this;
+ }, 130);
+ infix('*', 'mult', 140);
+ infix('/', 'div', 140);
+ infix('%', 'mod', 140);
+
+ suffix('++', 'postinc');
+ prefix('++', 'preinc');
+ syntax['++'].exps = true;
+
+ suffix('--', 'postdec');
+ prefix('--', 'predec');
+ syntax['--'].exps = true;
+ prefix('delete', function () {
+ var p = expression(0);
+ if (!p || (p.id !== '.' && p.id !== '[')) {
+ warning("Variables should not be deleted.");
+ }
+ this.first = p;
+ return this;
+ }).exps = true;
+
+ prefix('~', function () {
+ if (option.bitwise) {
+ warning("Unexpected '{a}'.", this, '~');
+ }
+ expression(150);
+ return this;
+ });
+
+ prefix('!', function () {
+ this.right = expression(150);
+ this.arity = 'unary';
+ if (bang[this.right.id] === true) {
+ warning("Confusing use of '{a}'.", this, '!');
+ }
+ return this;
+ });
+ prefix('typeof', 'typeof');
+ prefix('new', function () {
+ var c = expression(155), i;
+ if (c && c.id !== 'function') {
+ if (c.identifier) {
+ c['new'] = true;
+ switch (c.value) {
+ case 'Number':
+ case 'String':
+ case 'Boolean':
+ case 'Math':
+ case 'JSON':
+ warning("Do not use {a} as a constructor.", token, c.value);
+ break;
+ case 'Function':
+ if (!option.evil) {
+ warning("The Function constructor is eval.");
+ }
+ break;
+ case 'Date':
+ case 'RegExp':
+ break;
+ default:
+ if (c.id !== 'function') {
+ i = c.value.substr(0, 1);
+ if (option.newcap && (i < 'A' || i > 'Z')) {
+ warning("A constructor name should start with an uppercase letter.",
+ token);
+ }
+ }
+ }
+ } else {
+ if (c.id !== '.' && c.id !== '[' && c.id !== '(') {
+ warning("Bad constructor.", token);
+ }
+ }
+ } else {
+ if (!option.supernew)
+ warning("Weird construction. Delete 'new'.", this);
+ }
+ adjacent(token, nexttoken);
+ if (nexttoken.id !== '(' && !option.supernew) {
+ warning("Missing '()' invoking a constructor.");
+ }
+ this.first = c;
+ return this;
+ });
+ syntax['new'].exps = true;
+
+ prefix('void').exps = true;
+
+ infix('.', function (left, that) {
+ adjacent(prevtoken, token);
+ nobreak();
+ var m = identifier();
+ if (typeof m === 'string') {
+ countMember(m);
+ }
+ that.left = left;
+ that.right = m;
+ if (left && left.value === 'arguments' && (m === 'callee' || m === 'caller')) {
+ if (option.noarg)
+ warning("Avoid arguments.{a}.", left, m);
+ else if (directive['use strict'])
+ error('Strict violation.');
+ } else if (!option.evil && left && left.value === 'document' &&
+ (m === 'write' || m === 'writeln')) {
+ warning("document.write can be a form of eval.", left);
+ }
+ if (!option.evil && (m === 'eval' || m === 'execScript')) {
+ warning('eval is evil.');
+ }
+ return that;
+ }, 160, true);
+
+ infix('(', function (left, that) {
+ if (prevtoken.id !== '}' && prevtoken.id !== ')') {
+ nobreak(prevtoken, token);
+ }
+ nospace();
+ if (option.immed && !left.immed && left.id === 'function') {
+ warning("Wrap an immediate function invocation in parentheses " +
+ "to assist the reader in understanding that the expression " +
+ "is the result of a function, and not the function itself.");
+ }
+ var n = 0,
+ p = [];
+ if (left) {
+ if (left.type === '(identifier)') {
+ if (left.value.match(/^[A-Z]([A-Z0-9_$]*[a-z][A-Za-z0-9_$]*)?$/)) {
+ if (left.value !== 'Number' && left.value !== 'String' &&
+ left.value !== 'Boolean' &&
+ left.value !== 'Date') {
+ if (left.value === 'Math') {
+ warning("Math is not a function.", left);
+ } else if (option.newcap) {
+ warning(
+"Missing 'new' prefix when invoking a constructor.", left);
+ }
+ }
+ }
+ }
+ }
+ if (nexttoken.id !== ')') {
+ for (;;) {
+ p[p.length] = expression(10);
+ n += 1;
+ if (nexttoken.id !== ',') {
+ break;
+ }
+ comma();
+ }
+ }
+ advance(')');
+ nospace(prevtoken, token);
+ if (typeof left === 'object') {
+ if (left.value === 'parseInt' && n === 1) {
+ warning("Missing radix parameter.", left);
+ }
+ if (!option.evil) {
+ if (left.value === 'eval' || left.value === 'Function' ||
+ left.value === 'execScript') {
+ warning("eval is evil.", left);
+ } else if (p[0] && p[0].id === '(string)' &&
+ (left.value === 'setTimeout' ||
+ left.value === 'setInterval')) {
+ warning(
+ "Implied eval is evil. Pass a function instead of a string.", left);
+ }
+ }
+ if (!left.identifier && left.id !== '.' && left.id !== '[' &&
+ left.id !== '(' && left.id !== '&&' && left.id !== '||' &&
+ left.id !== '?') {
+ warning("Bad invocation.", left);
+ }
+ }
+ that.left = left;
+ return that;
+ }, 155, true).exps = true;
+
+ prefix('(', function () {
+ nospace();
+ if (nexttoken.id === 'function') {
+ nexttoken.immed = true;
+ }
+ var v = expression(0);
+ advance(')', this);
+ nospace(prevtoken, token);
+ if (option.immed && v.id === 'function') {
+ if (nexttoken.id === '(' ||
+ (nexttoken.id === '.' && (peek().value === 'call' || peek().value === 'apply'))) {
+ warning(
+"Move the invocation into the parens that contain the function.", nexttoken);
+ } else {
+ warning(
+"Do not wrap function literals in parens unless they are to be immediately invoked.",
+ this);
+ }
+ }
+ return v;
+ });
+
+ infix('[', function (left, that) {
+ nobreak(prevtoken, token);
+ nospace();
+ var e = expression(0), s;
+ if (e && e.type === '(string)') {
+ if (!option.evil && (e.value === 'eval' || e.value === 'execScript')) {
+ warning("eval is evil.", that);
+ }
+ countMember(e.value);
+ if (!option.sub && ix.test(e.value)) {
+ s = syntax[e.value];
+ if (!s || !s.reserved) {
+ warning("['{a}'] is better written in dot notation.",
+ e, e.value);
+ }
+ }
+ }
+ advance(']', that);
+ nospace(prevtoken, token);
+ that.left = left;
+ that.right = e;
+ return that;
+ }, 160, true);
+
+ prefix('[', function () {
+ var b = token.line !== nexttoken.line;
+ this.first = [];
+ if (b) {
+ indent += option.indent;
+ if (nexttoken.from === indent + option.indent) {
+ indent += option.indent;
+ }
+ }
+ while (nexttoken.id !== '(end)') {
+ while (nexttoken.id === ',') {
+ warning("Extra comma.");
+ advance(',');
+ }
+ if (nexttoken.id === ']') {
+ break;
+ }
+ if (b && token.line !== nexttoken.line) {
+ indentation();
+ }
+ this.first.push(expression(10));
+ if (nexttoken.id === ',') {
+ comma();
+ if (nexttoken.id === ']' && !option.es5) {
+ warning("Extra comma.", token);
+ break;
+ }
+ } else {
+ break;
+ }
+ }
+ if (b) {
+ indent -= option.indent;
+ indentation();
+ }
+ advance(']', this);
+ return this;
+ }, 160);
+
+
+ function property_name() {
+ var id = optionalidentifier(true);
+ if (!id) {
+ if (nexttoken.id === '(string)') {
+ id = nexttoken.value;
+ advance();
+ } else if (nexttoken.id === '(number)') {
+ id = nexttoken.value.toString();
+ advance();
+ }
+ }
+ return id;
+ }
+
+
+ function functionparams() {
+ var i, t = nexttoken, p = [];
+ advance('(');
+ nospace();
+ if (nexttoken.id === ')') {
+ advance(')');
+ return;
+ }
+ for (;;) {
+ i = identifier(true);
+ p.push(i);
+ addlabel(i, 'parameter');
+ if (nexttoken.id === ',') {
+ comma();
+ } else {
+ advance(')', t);
+ nospace(prevtoken, token);
+ return p;
+ }
+ }
+ }
+
+
+ function doFunction(i, statement) {
+ var f,
+ oldOption = option,
+ oldScope = scope;
+
+ option = Object.create(option);
+ scope = Object.create(scope);
+
+ funct = {
+ '(name)' : i || '"' + anonname + '"',
+ '(line)' : nexttoken.line,
+ '(context)' : funct,
+ '(breakage)' : 0,
+ '(loopage)' : 0,
+ '(scope)' : scope,
+ '(statement)': statement
+ };
+ f = funct;
+ token.funct = funct;
+ functions.push(funct);
+ if (i) {
+ addlabel(i, 'function');
+ }
+ funct['(params)'] = functionparams();
+
+ block(false, false, true);
+ scope = oldScope;
+ option = oldOption;
+ funct['(last)'] = token.line;
+ funct = funct['(context)'];
+ return f;
+ }
+
+
+ (function (x) {
+ x.nud = function () {
+ var b, f, i, j, p, t;
+ var props = {}; // All properties, including accessors
+
+ function saveProperty(name, token) {
+ if (props[name] && is_own(props, name))
+ warning("Duplicate member '{a}'.", nexttoken, i);
+ else
+ props[name] = {};
+
+ props[name].basic = true;
+ props[name].basicToken = token;
+ }
+
+ function saveSetter(name, token) {
+ if (props[name] && is_own(props, name)) {
+ if (props[name].basic || props[name].setter)
+ warning("Duplicate member '{a}'.", nexttoken, i);
+ } else {
+ props[name] = {};
+ }
+
+ props[name].setter = true;
+ props[name].setterToken = token;
+ }
+
+ function saveGetter(name) {
+ if (props[name] && is_own(props, name)) {
+ if (props[name].basic || props[name].getter)
+ warning("Duplicate member '{a}'.", nexttoken, i);
+ } else {
+ props[name] = {};
+ }
+
+ props[name].getter = true;
+ props[name].getterToken = token;
+ }
+
+ b = token.line !== nexttoken.line;
+ if (b) {
+ indent += option.indent;
+ if (nexttoken.from === indent + option.indent) {
+ indent += option.indent;
+ }
+ }
+ for (;;) {
+ if (nexttoken.id === '}') {
+ break;
+ }
+ if (b) {
+ indentation();
+ }
+ if (nexttoken.value === 'get' && peek().id !== ':') {
+ advance('get');
+ if (!option.es5) {
+ error("get/set are ES5 features.");
+ }
+ i = property_name();
+ if (!i) {
+ error("Missing property name.");
+ }
+ saveGetter(i);
+ t = nexttoken;
+ adjacent(token, nexttoken);
+ f = doFunction();
+ p = f['(params)'];
+ if (p) {
+ warning("Unexpected parameter '{a}' in get {b} function.", t, p[0], i);
+ }
+ adjacent(token, nexttoken);
+ } else if (nexttoken.value === 'set' && peek().id !== ':') {
+ advance('set');
+ if (!option.es5) {
+ error("get/set are ES5 features.");
+ }
+ i = property_name();
+ if (!i) {
+ error("Missing property name.");
+ }
+ saveSetter(i, nexttoken);
+ t = nexttoken;
+ adjacent(token, nexttoken);
+ f = doFunction();
+ p = f['(params)'];
+ if (!p || p.length !== 1) {
+ warning("Expected a single parameter in set {a} function.", t, i);
+ }
+ } else {
+ i = property_name();
+ saveProperty(i, nexttoken);
+ if (typeof i !== 'string') {
+ break;
+ }
+ advance(':');
+ nonadjacent(token, nexttoken);
+ expression(10);
+ }
+
+ countMember(i);
+ if (nexttoken.id === ',') {
+ comma();
+ if (nexttoken.id === ',') {
+ warning("Extra comma.", token);
+ } else if (nexttoken.id === '}' && !option.es5) {
+ warning("Extra comma.", token);
+ }
+ } else {
+ break;
+ }
+ }
+ if (b) {
+ indent -= option.indent;
+ indentation();
+ }
+ advance('}', this);
+
+ // Check for lonely setters if in the ES5 mode.
+ if (option.es5) {
+ for (var name in props) {
+ if (is_own(props, name) && props[name].setter && !props[name].getter) {
+ warning("Setter is defined without getter.", props[name].setterToken);
+ }
+ }
+ }
+ return this;
+ };
+ x.fud = function () {
+ error("Expected to see a statement and instead saw a block.", token);
+ };
+ }(delim('{')));
+
+// This Function is called when esnext option is set to true
+// it adds the `const` statement to JSHINT
+
+ useESNextSyntax = function () {
+ var conststatement = stmt('const', function (prefix) {
+ var id, name, value;
+
+ this.first = [];
+ for (;;) {
+ nonadjacent(token, nexttoken);
+ id = identifier();
+ if (funct[id] === "const") {
+ warning("const '" + id + "' has already been declared");
+ }
+ if (funct['(global)'] && predefined[id] === false) {
+ warning("Redefinition of '{a}'.", token, id);
+ }
+ addlabel(id, 'const');
+ if (prefix) {
+ break;
+ }
+ name = token;
+ this.first.push(token);
+
+ if (nexttoken.id !== "=") {
+ warning("const " +
+ "'{a}' is initialized to 'undefined'.", token, id);
+ }
+
+ if (nexttoken.id === '=') {
+ nonadjacent(token, nexttoken);
+ advance('=');
+ nonadjacent(token, nexttoken);
+ if (nexttoken.id === 'undefined') {
+ warning("It is not necessary to initialize " +
+ "'{a}' to 'undefined'.", token, id);
+ }
+ if (peek(0).id === '=' && nexttoken.identifier) {
+ error("Constant {a} was not declared correctly.",
+ nexttoken, nexttoken.value);
+ }
+ value = expression(0);
+ name.first = value;
+ }
+
+ if (nexttoken.id !== ',') {
+ break;
+ }
+ comma();
+ }
+ return this;
+ });
+ conststatement.exps = true;
+ };
+
+ var varstatement = stmt('var', function (prefix) {
+ // JavaScript does not have block scope. It only has function scope. So,
+ // declaring a variable in a block can have unexpected consequences.
+ var id, name, value;
+
+ if (funct['(onevar)'] && option.onevar) {
+ warning("Too many var statements.");
+ } else if (!funct['(global)']) {
+ funct['(onevar)'] = true;
+ }
+ this.first = [];
+ for (;;) {
+ nonadjacent(token, nexttoken);
+ id = identifier();
+ if (option.esnext && funct[id] === "const") {
+ warning("const '" + id + "' has already been declared");
+ }
+ if (funct['(global)'] && predefined[id] === false) {
+ warning("Redefinition of '{a}'.", token, id);
+ }
+ addlabel(id, 'unused');
+ if (prefix) {
+ break;
+ }
+ name = token;
+ this.first.push(token);
+ if (nexttoken.id === '=') {
+ nonadjacent(token, nexttoken);
+ advance('=');
+ nonadjacent(token, nexttoken);
+ if (nexttoken.id === 'undefined') {
+ warning("It is not necessary to initialize '{a}' to 'undefined'.", token, id);
+ }
+ if (peek(0).id === '=' && nexttoken.identifier) {
+ error("Variable {a} was not declared correctly.",
+ nexttoken, nexttoken.value);
+ }
+ value = expression(0);
+ name.first = value;
+ }
+ if (nexttoken.id !== ',') {
+ break;
+ }
+ comma();
+ }
+ return this;
+ });
+ varstatement.exps = true;
+
+ blockstmt('function', function () {
+ if (inblock) {
+ warning("Function declarations should not be placed in blocks. " +
+ "Use a function expression or move the statement to the top of " +
+ "the outer function.", token);
+
+ }
+ var i = identifier();
+ if (option.esnext && funct[i] === "const") {
+ warning("const '" + i + "' has already been declared");
+ }
+ adjacent(token, nexttoken);
+ addlabel(i, 'unction');
+ doFunction(i, true);
+ if (nexttoken.id === '(' && nexttoken.line === token.line) {
+ error(
+"Function declarations are not invocable. Wrap the whole function invocation in parens.");
+ }
+ return this;
+ });
+
+ prefix('function', function () {
+ var i = optionalidentifier();
+ if (i) {
+ adjacent(token, nexttoken);
+ } else {
+ nonadjacent(token, nexttoken);
+ }
+ doFunction(i);
+ if (!option.loopfunc && funct['(loopage)']) {
+ warning("Don't make functions within a loop.");
+ }
+ return this;
+ });
+
+ blockstmt('if', function () {
+ var t = nexttoken;
+ advance('(');
+ nonadjacent(this, t);
+ nospace();
+ expression(20);
+ if (nexttoken.id === '=') {
+ if (!option.boss)
+ warning("Expected a conditional expression and instead saw an assignment.");
+ advance('=');
+ expression(20);
+ }
+ advance(')', t);
+ nospace(prevtoken, token);
+ block(true, true);
+ if (nexttoken.id === 'else') {
+ nonadjacent(token, nexttoken);
+ advance('else');
+ if (nexttoken.id === 'if' || nexttoken.id === 'switch') {
+ statement(true);
+ } else {
+ block(true, true);
+ }
+ }
+ return this;
+ });
+
+ blockstmt('try', function () {
+ var b, e, s;
+
+ block(false);
+ if (nexttoken.id === 'catch') {
+ advance('catch');
+ nonadjacent(token, nexttoken);
+ advance('(');
+ s = scope;
+ scope = Object.create(s);
+ e = nexttoken.value;
+ if (nexttoken.type !== '(identifier)') {
+ warning("Expected an identifier and instead saw '{a}'.",
+ nexttoken, e);
+ } else {
+ addlabel(e, 'exception');
+ }
+ advance();
+ advance(')');
+ block(false);
+ b = true;
+ scope = s;
+ }
+ if (nexttoken.id === 'finally') {
+ advance('finally');
+ block(false);
+ return;
+ } else if (!b) {
+ error("Expected '{a}' and instead saw '{b}'.",
+ nexttoken, 'catch', nexttoken.value);
+ }
+ return this;
+ });
+
+ blockstmt('while', function () {
+ var t = nexttoken;
+ funct['(breakage)'] += 1;
+ funct['(loopage)'] += 1;
+ advance('(');
+ nonadjacent(this, t);
+ nospace();
+ expression(20);
+ if (nexttoken.id === '=') {
+ if (!option.boss)
+ warning("Expected a conditional expression and instead saw an assignment.");
+ advance('=');
+ expression(20);
+ }
+ advance(')', t);
+ nospace(prevtoken, token);
+ block(true, true);
+ funct['(breakage)'] -= 1;
+ funct['(loopage)'] -= 1;
+ return this;
+ }).labelled = true;
+
+ blockstmt('with', function () {
+ var t = nexttoken;
+ if (directive['use strict']) {
+ error("'with' is not allowed in strict mode.", token);
+ } else if (!option.withstmt) {
+ warning("Don't use 'with'.", token);
+ }
+
+ advance('(');
+ nonadjacent(this, t);
+ nospace();
+ expression(0);
+ advance(')', t);
+ nospace(prevtoken, token);
+ block(true, true);
+
+ return this;
+ });
+
+ blockstmt('switch', function () {
+ var t = nexttoken,
+ g = false;
+ funct['(breakage)'] += 1;
+ advance('(');
+ nonadjacent(this, t);
+ nospace();
+ this.condition = expression(20);
+ advance(')', t);
+ nospace(prevtoken, token);
+ nonadjacent(token, nexttoken);
+ t = nexttoken;
+ advance('{');
+ nonadjacent(token, nexttoken);
+ indent += option.indent;
+ this.cases = [];
+ for (;;) {
+ switch (nexttoken.id) {
+ case 'case':
+ switch (funct['(verb)']) {
+ case 'break':
+ case 'case':
+ case 'continue':
+ case 'return':
+ case 'switch':
+ case 'throw':
+ break;
+ default:
+ // You can tell JSHint that you don't use break intentionally by
+ // adding a comment /* falls through */ on a line just before
+ // the next `case`.
+ if (!ft.test(lines[nexttoken.line - 2])) {
+ warning(
+ "Expected a 'break' statement before 'case'.",
+ token);
+ }
+ }
+ indentation(-option.indent);
+ advance('case');
+ this.cases.push(expression(20));
+ g = true;
+ advance(':');
+ funct['(verb)'] = 'case';
+ break;
+ case 'default':
+ switch (funct['(verb)']) {
+ case 'break':
+ case 'continue':
+ case 'return':
+ case 'throw':
+ break;
+ default:
+ if (!ft.test(lines[nexttoken.line - 2])) {
+ warning(
+ "Expected a 'break' statement before 'default'.",
+ token);
+ }
+ }
+ indentation(-option.indent);
+ advance('default');
+ g = true;
+ advance(':');
+ break;
+ case '}':
+ indent -= option.indent;
+ indentation();
+ advance('}', t);
+ if (this.cases.length === 1 || this.condition.id === 'true' ||
+ this.condition.id === 'false') {
+ if (!option.onecase)
+ warning("This 'switch' should be an 'if'.", this);
+ }
+ funct['(breakage)'] -= 1;
+ funct['(verb)'] = undefined;
+ return;
+ case '(end)':
+ error("Missing '{a}'.", nexttoken, '}');
+ return;
+ default:
+ if (g) {
+ switch (token.id) {
+ case ',':
+ error("Each value should have its own case label.");
+ return;
+ case ':':
+ g = false;
+ statements();
+ break;
+ default:
+ error("Missing ':' on a case clause.", token);
+ return;
+ }
+ } else {
+ if (token.id === ':') {
+ advance(':');
+ error("Unexpected '{a}'.", token, ':');
+ statements();
+ } else {
+ error("Expected '{a}' and instead saw '{b}'.",
+ nexttoken, 'case', nexttoken.value);
+ return;
+ }
+ }
+ }
+ }
+ }).labelled = true;
+
+ stmt('debugger', function () {
+ if (!option.debug) {
+ warning("All 'debugger' statements should be removed.");
+ }
+ return this;
+ }).exps = true;
+
+ (function () {
+ var x = stmt('do', function () {
+ funct['(breakage)'] += 1;
+ funct['(loopage)'] += 1;
+ this.first = block(true);
+ advance('while');
+ var t = nexttoken;
+ nonadjacent(token, t);
+ advance('(');
+ nospace();
+ expression(20);
+ if (nexttoken.id === '=') {
+ if (!option.boss)
+ warning("Expected a conditional expression and instead saw an assignment.");
+ advance('=');
+ expression(20);
+ }
+ advance(')', t);
+ nospace(prevtoken, token);
+ funct['(breakage)'] -= 1;
+ funct['(loopage)'] -= 1;
+ return this;
+ });
+ x.labelled = true;
+ x.exps = true;
+ }());
+
+ blockstmt('for', function () {
+ var s, t = nexttoken;
+ funct['(breakage)'] += 1;
+ funct['(loopage)'] += 1;
+ advance('(');
+ nonadjacent(this, t);
+ nospace();
+ if (peek(nexttoken.id === 'var' ? 1 : 0).id === 'in') {
+ if (nexttoken.id === 'var') {
+ advance('var');
+ varstatement.fud.call(varstatement, true);
+ } else {
+ switch (funct[nexttoken.value]) {
+ case 'unused':
+ funct[nexttoken.value] = 'var';
+ break;
+ case 'var':
+ break;
+ default:
+ warning("Bad for in variable '{a}'.",
+ nexttoken, nexttoken.value);
+ }
+ advance();
+ }
+ advance('in');
+ expression(20);
+ advance(')', t);
+ s = block(true, true);
+ if (option.forin && s && (s.length > 1 || typeof s[0] !== 'object' ||
+ s[0].value !== 'if')) {
+ warning("The body of a for in should be wrapped in an if statement to filter " +
+ "unwanted properties from the prototype.", this);
+ }
+ funct['(breakage)'] -= 1;
+ funct['(loopage)'] -= 1;
+ return this;
+ } else {
+ if (nexttoken.id !== ';') {
+ if (nexttoken.id === 'var') {
+ advance('var');
+ varstatement.fud.call(varstatement);
+ } else {
+ for (;;) {
+ expression(0, 'for');
+ if (nexttoken.id !== ',') {
+ break;
+ }
+ comma();
+ }
+ }
+ }
+ nolinebreak(token);
+ advance(';');
+ if (nexttoken.id !== ';') {
+ expression(20);
+ if (nexttoken.id === '=') {
+ if (!option.boss)
+ warning("Expected a conditional expression and instead saw an assignment.");
+ advance('=');
+ expression(20);
+ }
+ }
+ nolinebreak(token);
+ advance(';');
+ if (nexttoken.id === ';') {
+ error("Expected '{a}' and instead saw '{b}'.",
+ nexttoken, ')', ';');
+ }
+ if (nexttoken.id !== ')') {
+ for (;;) {
+ expression(0, 'for');
+ if (nexttoken.id !== ',') {
+ break;
+ }
+ comma();
+ }
+ }
+ advance(')', t);
+ nospace(prevtoken, token);
+ block(true, true);
+ funct['(breakage)'] -= 1;
+ funct['(loopage)'] -= 1;
+ return this;
+ }
+ }).labelled = true;
+
+
+ stmt('break', function () {
+ var v = nexttoken.value;
+
+ if (funct['(breakage)'] === 0)
+ warning("Unexpected '{a}'.", nexttoken, this.value);
+
+ if (!option.asi)
+ nolinebreak(this);
+
+ if (nexttoken.id !== ';') {
+ if (token.line === nexttoken.line) {
+ if (funct[v] !== 'label') {
+ warning("'{a}' is not a statement label.", nexttoken, v);
+ } else if (scope[v] !== funct) {
+ warning("'{a}' is out of scope.", nexttoken, v);
+ }
+ this.first = nexttoken;
+ advance();
+ }
+ }
+ reachable('break');
+ return this;
+ }).exps = true;
+
+
+ stmt('continue', function () {
+ var v = nexttoken.value;
+
+ if (funct['(breakage)'] === 0)
+ warning("Unexpected '{a}'.", nexttoken, this.value);
+
+ if (!option.asi)
+ nolinebreak(this);
+
+ if (nexttoken.id !== ';') {
+ if (token.line === nexttoken.line) {
+ if (funct[v] !== 'label') {
+ warning("'{a}' is not a statement label.", nexttoken, v);
+ } else if (scope[v] !== funct) {
+ warning("'{a}' is out of scope.", nexttoken, v);
+ }
+ this.first = nexttoken;
+ advance();
+ }
+ } else if (!funct['(loopage)']) {
+ warning("Unexpected '{a}'.", nexttoken, this.value);
+ }
+ reachable('continue');
+ return this;
+ }).exps = true;
+
+
+ stmt('return', function () {
+ if (this.line === nexttoken.line) {
+ if (nexttoken.id === '(regexp)')
+ warning("Wrap the /regexp/ literal in parens to disambiguate the slash operator.");
+
+ if (nexttoken.id !== ';' && !nexttoken.reach) {
+ nonadjacent(token, nexttoken);
+ if (peek().value === "=" && !option.boss) {
+ warningAt("Did you mean to return a conditional instead of an assignment?",
+ token.line, token.character + 1);
+ }
+ this.first = expression(0);
+ }
+ } else if (!option.asi) {
+ nolinebreak(this); // always warn (Line breaking error)
+ }
+ reachable('return');
+ return this;
+ }).exps = true;
+
+
+ stmt('throw', function () {
+ nolinebreak(this);
+ nonadjacent(token, nexttoken);
+ this.first = expression(20);
+ reachable('throw');
+ return this;
+ }).exps = true;
+
+// Superfluous reserved words
+
+ reserve('class');
+ reserve('const');
+ reserve('enum');
+ reserve('export');
+ reserve('extends');
+ reserve('import');
+ reserve('super');
+
+ reserve('let');
+ reserve('yield');
+ reserve('implements');
+ reserve('interface');
+ reserve('package');
+ reserve('private');
+ reserve('protected');
+ reserve('public');
+ reserve('static');
+
+
+// Parse JSON
+
+ function jsonValue() {
+
+ function jsonObject() {
+ var o = {}, t = nexttoken;
+ advance('{');
+ if (nexttoken.id !== '}') {
+ for (;;) {
+ if (nexttoken.id === '(end)') {
+ error("Missing '}' to match '{' from line {a}.",
+ nexttoken, t.line);
+ } else if (nexttoken.id === '}') {
+ warning("Unexpected comma.", token);
+ break;
+ } else if (nexttoken.id === ',') {
+ error("Unexpected comma.", nexttoken);
+ } else if (nexttoken.id !== '(string)') {
+ warning("Expected a string and instead saw {a}.",
+ nexttoken, nexttoken.value);
+ }
+ if (o[nexttoken.value] === true) {
+ warning("Duplicate key '{a}'.",
+ nexttoken, nexttoken.value);
+ } else if ((nexttoken.value === '__proto__' &&
+ !option.proto) || (nexttoken.value === '__iterator__' &&
+ !option.iterator)) {
+ warning("The '{a}' key may produce unexpected results.",
+ nexttoken, nexttoken.value);
+ } else {
+ o[nexttoken.value] = true;
+ }
+ advance();
+ advance(':');
+ jsonValue();
+ if (nexttoken.id !== ',') {
+ break;
+ }
+ advance(',');
+ }
+ }
+ advance('}');
+ }
+
+ function jsonArray() {
+ var t = nexttoken;
+ advance('[');
+ if (nexttoken.id !== ']') {
+ for (;;) {
+ if (nexttoken.id === '(end)') {
+ error("Missing ']' to match '[' from line {a}.",
+ nexttoken, t.line);
+ } else if (nexttoken.id === ']') {
+ warning("Unexpected comma.", token);
+ break;
+ } else if (nexttoken.id === ',') {
+ error("Unexpected comma.", nexttoken);
+ }
+ jsonValue();
+ if (nexttoken.id !== ',') {
+ break;
+ }
+ advance(',');
+ }
+ }
+ advance(']');
+ }
+
+ switch (nexttoken.id) {
+ case '{':
+ jsonObject();
+ break;
+ case '[':
+ jsonArray();
+ break;
+ case 'true':
+ case 'false':
+ case 'null':
+ case '(number)':
+ case '(string)':
+ advance();
+ break;
+ case '-':
+ advance('-');
+ if (token.character !== nexttoken.from) {
+ warning("Unexpected space after '-'.", token);
+ }
+ adjacent(token, nexttoken);
+ advance('(number)');
+ break;
+ default:
+ error("Expected a JSON value.", nexttoken);
+ }
+ }
+
+
+// The actual JSHINT function itself.
+
+ var itself = function (s, o, g) {
+ var a, i, k;
+ JSHINT.errors = [];
+ JSHINT.undefs = [];
+ predefined = Object.create(standard);
+ combine(predefined, g || {});
+ if (o) {
+ a = o.predef;
+ if (a) {
+ if (Array.isArray(a)) {
+ for (i = 0; i < a.length; i += 1) {
+ predefined[a[i]] = true;
+ }
+ } else if (typeof a === 'object') {
+ k = Object.keys(a);
+ for (i = 0; i < k.length; i += 1) {
+ predefined[k[i]] = !!a[k[i]];
+ }
+ }
+ }
+ option = o;
+ } else {
+ option = {};
+ }
+ option.indent = option.indent || 4;
+ option.maxerr = option.maxerr || 50;
+
+ tab = '';
+ for (i = 0; i < option.indent; i += 1) {
+ tab += ' ';
+ }
+ indent = 1;
+ global = Object.create(predefined);
+ scope = global;
+ funct = {
+ '(global)': true,
+ '(name)': '(global)',
+ '(scope)': scope,
+ '(breakage)': 0,
+ '(loopage)': 0
+ };
+ functions = [funct];
+ urls = [];
+ stack = null;
+ member = {};
+ membersOnly = null;
+ implied = {};
+ inblock = false;
+ lookahead = [];
+ jsonmode = false;
+ warnings = 0;
+ lex.init(s);
+ prereg = true;
+ directive = {};
+
+ prevtoken = token = nexttoken = syntax['(begin)'];
+
+ // Check options
+ for (var name in o) {
+ if (is_own(o, name)) {
+ checkOption(name, token);
+ }
+ }
+
+ assume();
+
+ // combine the passed globals after we've assumed all our options
+ combine(predefined, g || {});
+
+ //reset values
+ comma.first = true;
+
+ try {
+ advance();
+ switch (nexttoken.id) {
+ case '{':
+ case '[':
+ option.laxbreak = true;
+ jsonmode = true;
+ jsonValue();
+ break;
+ default:
+ directives();
+ if (directive["use strict"] && !option.globalstrict) {
+ warning("Use the function form of \"use strict\".", prevtoken);
+ }
+
+ statements();
+ }
+ advance('(end)');
+
+ var markDefined = function (name, context) {
+ do {
+ if (typeof context[name] === 'string') {
+ // JSHINT marks unused variables as 'unused' and
+ // unused function declaration as 'unction'. This
+ // code changes such instances back 'var' and
+ // 'closure' so that the code in JSHINT.data()
+ // doesn't think they're unused.
+
+ if (context[name] === 'unused')
+ context[name] = 'var';
+ else if (context[name] === 'unction')
+ context[name] = 'closure';
+
+ return true;
+ }
+
+ context = context['(context)'];
+ } while (context);
+
+ return false;
+ };
+
+ var clearImplied = function (name, line) {
+ if (!implied[name])
+ return;
+
+ var newImplied = [];
+ for (var i = 0; i < implied[name].length; i += 1) {
+ if (implied[name][i] !== line)
+ newImplied.push(implied[name][i]);
+ }
+
+ if (newImplied.length === 0)
+ delete implied[name];
+ else
+ implied[name] = newImplied;
+ };
+
+ // Check queued 'x is not defined' instances to see if they're still undefined.
+ for (i = 0; i < JSHINT.undefs.length; i += 1) {
+ k = JSHINT.undefs[i].slice(0);
+
+ if (markDefined(k[2].value, k[0])) {
+ clearImplied(k[2].value, k[2].line);
+ } else {
+ warning.apply(warning, k.slice(1));
+ }
+ }
+ } catch (e) {
+ if (e) {
+ var nt = nexttoken || {};
+ JSHINT.errors.push({
+ raw : e.raw,
+ reason : e.message,
+ line : e.line || nt.line,
+ character : e.character || nt.from
+ }, null);
+ }
+ }
+
+ return JSHINT.errors.length === 0;
+ };
+
+ // Data summary.
+ itself.data = function () {
+
+ var data = { functions: [], options: option }, fu, globals, implieds = [], f, i, j,
+ members = [], n, unused = [], v;
+ if (itself.errors.length) {
+ data.errors = itself.errors;
+ }
+
+ if (jsonmode) {
+ data.json = true;
+ }
+
+ for (n in implied) {
+ if (is_own(implied, n)) {
+ implieds.push({
+ name: n,
+ line: implied[n]
+ });
+ }
+ }
+ if (implieds.length > 0) {
+ data.implieds = implieds;
+ }
+
+ if (urls.length > 0) {
+ data.urls = urls;
+ }
+
+ globals = Object.keys(scope);
+ if (globals.length > 0) {
+ data.globals = globals;
+ }
+ for (i = 1; i < functions.length; i += 1) {
+ f = functions[i];
+ fu = {};
+ for (j = 0; j < functionicity.length; j += 1) {
+ fu[functionicity[j]] = [];
+ }
+ for (n in f) {
+ if (is_own(f, n) && n.charAt(0) !== '(') {
+ v = f[n];
+ if (v === 'unction') {
+ v = 'unused';
+ }
+ if (Array.isArray(fu[v])) {
+ fu[v].push(n);
+ if (v === 'unused') {
+ unused.push({
+ name: n,
+ line: f['(line)'],
+ 'function': f['(name)']
+ });
+ }
+ }
+ }
+ }
+ for (j = 0; j < functionicity.length; j += 1) {
+ if (fu[functionicity[j]].length === 0) {
+ delete fu[functionicity[j]];
+ }
+ }
+ fu.name = f['(name)'];
+ fu.param = f['(params)'];
+ fu.line = f['(line)'];
+ fu.last = f['(last)'];
+ data.functions.push(fu);
+ }
+
+ if (unused.length > 0) {
+ data.unused = unused;
+ }
+
+ members = [];
+ for (n in member) {
+ if (typeof member[n] === 'number') {
+ data.member = member;
+ break;
+ }
+ }
+
+ return data;
+ };
+
+ itself.report = function (option) {
+ var data = itself.data();
+
+ var a = [], c, e, err, f, i, k, l, m = '', n, o = [], s;
+
+ function detail(h, array) {
+ var b, i, singularity;
+ if (array) {
+ o.push('<div><i>' + h + '</i> ');
+ array = array.sort();
+ for (i = 0; i < array.length; i += 1) {
+ if (array[i] !== singularity) {
+ singularity = array[i];
+ o.push((b ? ', ' : '') + singularity);
+ b = true;
+ }
+ }
+ o.push('</div>');
+ }
+ }
+
+
+ if (data.errors || data.implieds || data.unused) {
+ err = true;
+ o.push('<div id=errors><i>Error:</i>');
+ if (data.errors) {
+ for (i = 0; i < data.errors.length; i += 1) {
+ c = data.errors[i];
+ if (c) {
+ e = c.evidence || '';
+ o.push('<p>Problem' + (isFinite(c.line) ? ' at line ' +
+ c.line + ' character ' + c.character : '') +
+ ': ' + c.reason.entityify() +
+ '</p><p class=evidence>' +
+ (e && (e.length > 80 ? e.slice(0, 77) + '...' :
+ e).entityify()) + '</p>');
+ }
+ }
+ }
+
+ if (data.implieds) {
+ s = [];
+ for (i = 0; i < data.implieds.length; i += 1) {
+ s[i] = '<code>' + data.implieds[i].name + '</code>&nbsp;<i>' +
+ data.implieds[i].line + '</i>';
+ }
+ o.push('<p><i>Implied global:</i> ' + s.join(', ') + '</p>');
+ }
+
+ if (data.unused) {
+ s = [];
+ for (i = 0; i < data.unused.length; i += 1) {
+ s[i] = '<code><u>' + data.unused[i].name + '</u></code>&nbsp;<i>' +
+ data.unused[i].line + '</i> <code>' +
+ data.unused[i]['function'] + '</code>';
+ }
+ o.push('<p><i>Unused variable:</i> ' + s.join(', ') + '</p>');
+ }
+ if (data.json) {
+ o.push('<p>JSON: bad.</p>');
+ }
+ o.push('</div>');
+ }
+
+ if (!option) {
+
+ o.push('<br><div id=functions>');
+
+ if (data.urls) {
+ detail("URLs<br>", data.urls, '<br>');
+ }
+
+ if (data.json && !err) {
+ o.push('<p>JSON: good.</p>');
+ } else if (data.globals) {
+ o.push('<div><i>Global</i> ' +
+ data.globals.sort().join(', ') + '</div>');
+ } else {
+ o.push('<div><i>No new global variables introduced.</i></div>');
+ }
+
+ for (i = 0; i < data.functions.length; i += 1) {
+ f = data.functions[i];
+
+ o.push('<br><div class=function><i>' + f.line + '-' +
+ f.last + '</i> ' + (f.name || '') + '(' +
+ (f.param ? f.param.join(', ') : '') + ')</div>');
+ detail('<big><b>Unused</b></big>', f.unused);
+ detail('Closure', f.closure);
+ detail('Variable', f['var']);
+ detail('Exception', f.exception);
+ detail('Outer', f.outer);
+ detail('Global', f.global);
+ detail('Label', f.label);
+ }
+
+ if (data.member) {
+ a = Object.keys(data.member);
+ if (a.length) {
+ a = a.sort();
+ m = '<br><pre id=members>/*members ';
+ l = 10;
+ for (i = 0; i < a.length; i += 1) {
+ k = a[i];
+ n = k.name();
+ if (l + n.length > 72) {
+ o.push(m + '<br>');
+ m = ' ';
+ l = 1;
+ }
+ l += n.length + 2;
+ if (data.member[k] === 1) {
+ n = '<i>' + n + '</i>';
+ }
+ if (i < a.length - 1) {
+ n += ', ';
+ }
+ m += n;
+ }
+ o.push(m + '<br>*/</pre>');
+ }
+ o.push('</div>');
+ }
+ }
+ return o.join('');
+ };
+
+ itself.jshint = itself;
+
+ return itself;
+}());
+
+// Make JSHINT a Node module, if possible.
+if (typeof exports === 'object' && exports)
+ exports.JSHINT = JSHINT;
+
+});
+
+/*
+ * Narcissus - JS implemented in JS.
+ *
+ * Parser.
+ */
+
+define('ace/narcissus/parser', ['require', 'exports', 'module' , 'ace/narcissus/lexer', 'ace/narcissus/definitions', 'ace/narcissus/options'], function(require, exports, module) {
+
+var lexer = require('./lexer');
+var definitions = require('./definitions');
+var options = require('./options');
+var Tokenizer = lexer.Tokenizer;
+
+var Dict = definitions.Dict;
+var Stack = definitions.Stack;
+
+// Set constants in the local scope.
+eval(definitions.consts);
+function pushDestructuringVarDecls(n, s) {
+ for (var i in n) {
+ var sub = n[i];
+ if (sub.type === IDENTIFIER) {
+ s.varDecls.push(sub);
+ } else {
+ pushDestructuringVarDecls(sub, s);
+ }
+ }
+}
+
+function Parser(tokenizer) {
+ tokenizer.parser = this;
+ this.t = tokenizer;
+ this.x = null;
+ this.unexpectedEOF = false;
+ options.mozillaMode && (this.mozillaMode = true);
+ options.parenFreeMode && (this.parenFreeMode = true);
+}
+
+function StaticContext(parentScript, parentBlock, inModule, inFunction, strictMode) {
+ this.parentScript = parentScript;
+ this.parentBlock = parentBlock || parentScript;
+ this.inModule = inModule || false;
+ this.inFunction = inFunction || false;
+ this.inForLoopInit = false;
+ this.topLevel = true;
+ this.allLabels = new Stack();
+ this.currentLabels = new Stack();
+ this.labeledTargets = new Stack();
+ this.defaultLoopTarget = null;
+ this.defaultTarget = null;
+ this.strictMode = strictMode;
+}
+
+StaticContext.prototype = {
+ // non-destructive update via prototype extension
+ update: function(ext) {
+ var desc = {};
+ for (var key in ext) {
+ desc[key] = {
+ value: ext[key],
+ writable: true,
+ enumerable: true,
+ configurable: true
+ }
+ }
+ return Object.create(this, desc);
+ },
+ pushLabel: function(label) {
+ return this.update({ currentLabels: this.currentLabels.push(label),
+ allLabels: this.allLabels.push(label) });
+ },
+ pushTarget: function(target) {
+ var isDefaultLoopTarget = target.isLoop;
+ var isDefaultTarget = isDefaultLoopTarget || target.type === SWITCH;
+
+ if (this.currentLabels.isEmpty()) {
+ if (isDefaultLoopTarget) this.update({ defaultLoopTarget: target });
+ if (isDefaultTarget) this.update({ defaultTarget: target });
+ return this;
+ }
+
+ target.labels = new Dict();
+ this.currentLabels.forEach(function(label) {
+ target.labels.set(label, true);
+ });
+ return this.update({ currentLabels: new Stack(),
+ labeledTargets: this.labeledTargets.push(target),
+ defaultLoopTarget: isDefaultLoopTarget
+ ? target
+ : this.defaultLoopTarget,
+ defaultTarget: isDefaultTarget
+ ? target
+ : this.defaultTarget });
+ },
+ nest: function() {
+ return this.topLevel ? this.update({ topLevel: false }) : this;
+ },
+ canImport: function() {
+ return this.topLevel && !this.inFunction;
+ },
+ canExport: function() {
+ return this.inModule && this.topLevel && !this.inFunction;
+ },
+ banWith: function() {
+ return this.strictMode || this.inModule;
+ },
+ modulesAllowed: function() {
+ return this.topLevel && !this.inFunction;
+ }
+};
+
+var Pp = Parser.prototype;
+
+Pp.mozillaMode = false;
+
+Pp.parenFreeMode = false;
+
+Pp.withContext = function(x, f) {
+ var x0 = this.x;
+ this.x = x;
+ var result = f.call(this);
+ // NB: we don't bother with finally, since exceptions trash the parser
+ this.x = x0;
+ return result;
+};
+
+Pp.newNode = function newNode(opts) {
+ return new Node(this.t, opts);
+};
+
+Pp.fail = function fail(msg) {
+ throw this.t.newSyntaxError(msg);
+};
+
+Pp.match = function match(tt, scanOperand, keywordIsName) {
+ return this.t.match(tt, scanOperand, keywordIsName);
+};
+
+Pp.mustMatch = function mustMatch(tt, keywordIsName) {
+ return this.t.mustMatch(tt, keywordIsName);
+};
+
+Pp.peek = function peek(scanOperand) {
+ return this.t.peek(scanOperand);
+};
+
+Pp.peekOnSameLine = function peekOnSameLine(scanOperand) {
+ return this.t.peekOnSameLine(scanOperand);
+};
+
+Pp.done = function done() {
+ return this.t.done;
+};
+Pp.Script = function Script(inModule, inFunction, expectEnd) {
+ var node = this.newNode(scriptInit());
+ var x2 = new StaticContext(node, node, inModule, inFunction);
+ this.withContext(x2, function() {
+ this.Statements(node, true);
+ });
+ if (expectEnd && !this.done())
+ this.fail("expected end of input");
+ return node;
+};
+function Pragma(n) {
+ if (n.type === SEMICOLON) {
+ var e = n.expression;
+ if (e.type === STRING && e.value === "use strict") {
+ n.pragma = "strict";
+ return true;
+ }
+ }
+ return false;
+}
+
+/*
+ * Node :: (tokenizer, optional init object) -> node
+ */
+function Node(t, init) {
+ var token = t.token;
+ if (token) {
+ // If init.type exists it will override token.type.
+ this.type = token.type;
+ this.value = token.value;
+ this.lineno = token.lineno;
+
+ // Start and end are file positions for error handling.
+ this.start = token.start;
+ this.end = token.end;
+ } else {
+ this.lineno = t.lineno;
+ }
+
+ this.filename = t.filename;
+ this.children = [];
+
+ for (var prop in init)
+ this[prop] = init[prop];
+}
+
+/*
+ * SyntheticNode :: (optional init object) -> node
+ */
+function SyntheticNode(init) {
+ this.children = [];
+ for (var prop in init)
+ this[prop] = init[prop];
+ this.synthetic = true;
+}
+
+var Np = Node.prototype = SyntheticNode.prototype = {};
+Np.constructor = Node;
+
+var TO_SOURCE_SKIP = {
+ type: true,
+ value: true,
+ lineno: true,
+ start: true,
+ end: true,
+ tokenizer: true,
+ assignOp: true
+};
+function unevalableConst(code) {
+ var token = definitions.tokens[code];
+ var constName = definitions.opTypeNames.hasOwnProperty(token)
+ ? definitions.opTypeNames[token]
+ : token in definitions.keywords
+ ? token.toUpperCase()
+ : token;
+ return { toSource: function() { return constName } };
+}
+Np.toSource = function toSource() {
+ var mock = {};
+ var self = this;
+ mock.type = unevalableConst(this.type);
+ // avoid infinite recursion in case of back-links
+ if (this.generatingSource)
+ return mock.toSource();
+ this.generatingSource = true;
+ if ("value" in this)
+ mock.value = this.value;
+ if ("lineno" in this)
+ mock.lineno = this.lineno;
+ if ("start" in this)
+ mock.start = this.start;
+ if ("end" in this)
+ mock.end = this.end;
+ if (this.assignOp)
+ mock.assignOp = unevalableConst(this.assignOp);
+ for (var key in this) {
+ if (this.hasOwnProperty(key) && !(key in TO_SOURCE_SKIP))
+ mock[key] = this[key];
+ }
+ try {
+ return mock.toSource();
+ } finally {
+ delete this.generatingSource;
+ }
+};
+
+// Always use push to add operands to an expression, to update start and end.
+Np.push = function (kid) {
+ // kid can be null e.g. [1, , 2].
+ if (kid !== null) {
+ if (kid.start < this.start)
+ this.start = kid.start;
+ if (this.end < kid.end)
+ this.end = kid.end;
+ }
+ return this.children.push(kid);
+}
+
+Node.indentLevel = 0;
+
+function tokenString(tt) {
+ var t = definitions.tokens[tt];
+ return /^\W/.test(t) ? definitions.opTypeNames[t] : t.toUpperCase();
+}
+
+Np.toString = function () {
+ var a = [];
+ for (var i in this) {
+ if (this.hasOwnProperty(i) && i !== 'type' && i !== 'target')
+ a.push({id: i, value: this[i]});
+ }
+ a.sort(function (a,b) { return (a.id < b.id) ? -1 : 1; });
+ var INDENTATION = " ";
+ var n = ++Node.indentLevel;
+ var s = "{\n" + INDENTATION.repeat(n) + "type: " + tokenString(this.type);
+ for (i = 0; i < a.length; i++)
+ s += ",\n" + INDENTATION.repeat(n) + a[i].id + ": " + a[i].value;
+ n = --Node.indentLevel;
+ s += "\n" + INDENTATION.repeat(n) + "}";
+ return s;
+}
+
+Np.synth = function(init) {
+ var node = new SyntheticNode(init);
+ node.filename = this.filename;
+ node.lineno = this.lineno;
+ node.start = this.start;
+ node.end = this.end;
+ return node;
+};
+
+var LOOP_INIT = { isLoop: true };
+
+function blockInit() {
+ return { type: BLOCK, varDecls: [] };
+}
+
+function scriptInit() {
+ return { type: SCRIPT,
+ funDecls: [],
+ varDecls: [],
+ modDefns: new Dict(),
+ modAssns: new Dict(),
+ modDecls: new Dict(),
+ modLoads: new Dict(),
+ impDecls: [],
+ expDecls: [],
+ exports: new Dict(),
+ hasEmptyReturn: false,
+ hasReturnWithValue: false,
+ hasYield: false };
+}
+
+definitions.defineGetter(Np, "length",
+ function() {
+ throw new Error("Node.prototype.length is gone; " +
+ "use n.children.length instead");
+ });
+
+definitions.defineProperty(String.prototype, "repeat",
+ function(n) {
+ var s = "", t = this + s;
+ while (--n >= 0)
+ s += t;
+ return s;
+ }, false, false, true);
+
+Pp.MaybeLeftParen = function MaybeLeftParen() {
+ if (this.parenFreeMode)
+ return this.match(LEFT_PAREN) ? LEFT_PAREN : END;
+ return this.mustMatch(LEFT_PAREN).type;
+};
+
+Pp.MaybeRightParen = function MaybeRightParen(p) {
+ if (p === LEFT_PAREN)
+ this.mustMatch(RIGHT_PAREN);
+}
+
+/*
+ * Statements :: (node[, boolean]) -> void
+ *
+ * Parses a sequence of Statements.
+ */
+Pp.Statements = function Statements(n, topLevel) {
+ var prologue = !!topLevel;
+ try {
+ while (!this.done() && this.peek(true) !== RIGHT_CURLY) {
+ var n2 = this.Statement();
+ n.push(n2);
+ if (prologue && Pragma(n2)) {
+ this.x.strictMode = true;
+ n.strict = true;
+ } else {
+ prologue = false;
+ }
+ }
+ } catch (e) {
+ try {
+ if (this.done())
+ this.unexpectedEOF = true;
+ } catch(e) {}
+ throw e;
+ }
+}
+
+Pp.Block = function Block() {
+ this.mustMatch(LEFT_CURLY);
+ var n = this.newNode(blockInit());
+ var x2 = this.x.update({ parentBlock: n }).pushTarget(n);
+ this.withContext(x2, function() {
+ this.Statements(n);
+ });
+ this.mustMatch(RIGHT_CURLY);
+ return n;
+}
+
+var DECLARED_FORM = 0, EXPRESSED_FORM = 1, STATEMENT_FORM = 2;
+function Export(node, isDefinition) {
+ this.node = node; // the AST node declaring this individual export
+ this.isDefinition = isDefinition; // is the node an 'export'-annotated definition?
+ this.resolved = null; // resolved pointer to the target of this export
+}
+
+/*
+ * registerExport :: (Dict, EXPORT node) -> void
+ */
+function registerExport(exports, decl) {
+ function register(name, exp) {
+ if (exports.has(name))
+ throw new SyntaxError("multiple exports of " + name);
+ exports.set(name, exp);
+ }
+
+ switch (decl.type) {
+ case MODULE:
+ case FUNCTION:
+ register(decl.name, new Export(decl, true));
+ break;
+
+ case VAR:
+ for (var i = 0; i < decl.children.length; i++)
+ register(decl.children[i].name, new Export(decl.children[i], true));
+ break;
+
+ case LET:
+ case CONST:
+ throw new Error("NYI: " + definitions.tokens[decl.type]);
+
+ case EXPORT:
+ for (var i = 0; i < decl.pathList.length; i++) {
+ var path = decl.pathList[i];
+ switch (path.type) {
+ case OBJECT_INIT:
+ for (var j = 0; j < path.children.length; j++) {
+ // init :: IDENTIFIER | PROPERTY_INIT
+ var init = path.children[j];
+ if (init.type === IDENTIFIER)
+ register(init.value, new Export(init, false));
+ else
+ register(init.children[0].value, new Export(init.children[1], false));
+ }
+ break;
+
+ case DOT:
+ register(path.children[1].value, new Export(path, false));
+ break;
+
+ case IDENTIFIER:
+ register(path.value, new Export(path, false));
+ break;
+
+ default:
+ throw new Error("unexpected export path: " + definitions.tokens[path.type]);
+ }
+ }
+ break;
+
+ default:
+ throw new Error("unexpected export decl: " + definitions.tokens[exp.type]);
+ }
+}
+
+/*
+ * Module :: (node) -> Module
+ *
+ * Static semantic representation of a module.
+ */
+function Module(node) {
+ var exports = node.body.exports;
+ var modDefns = node.body.modDefns;
+
+ var exportedModules = new Dict();
+
+ exports.forEach(function(name, exp) {
+ var node = exp.node;
+ if (node.type === MODULE) {
+ exportedModules.set(name, node);
+ } else if (!exp.isDefinition && node.type === IDENTIFIER && modDefns.has(node.value)) {
+ var mod = modDefns.get(node.value);
+ exportedModules.set(name, mod);
+ }
+ });
+
+ this.node = node;
+ this.exports = exports;
+ this.exportedModules = exportedModules;
+}
+
+/*
+ * Statement :: () -> node
+ *
+ * Parses a Statement.
+ */
+Pp.Statement = function Statement() {
+ var i, label, n, n2, p, c, ss, tt = this.t.get(true), tt2, x0, x2, x3;
+
+ var comments = this.t.blockComments;
+
+ // Cases for statements ending in a right curly return early, avoiding the
+ // common semicolon insertion magic after this switch.
+ switch (tt) {
+ case IMPORT:
+ if (!this.x.canImport())
+ this.fail("illegal context for import statement");
+ n = this.newNode();
+ n.pathList = this.ImportPathList();
+ this.x.parentScript.impDecls.push(n);
+ break;
+
+ case EXPORT:
+ if (!this.x.canExport())
+ this.fail("export statement not in module top level");
+ switch (this.peek()) {
+ case MODULE:
+ case FUNCTION:
+ case LET:
+ case VAR:
+ case CONST:
+ n = this.Statement();
+ n.blockComments = comments;
+ n.exported = true;
+ this.x.parentScript.expDecls.push(n);
+ registerExport(this.x.parentScript.exports, n);
+ return n;
+ }
+ n = this.newNode();
+ n.pathList = this.ExportPathList();
+ this.x.parentScript.expDecls.push(n);
+ registerExport(this.x.parentScript.exports, n);
+ break;
+
+ case FUNCTION:
+ // DECLARED_FORM extends funDecls of x, STATEMENT_FORM doesn't.
+ return this.FunctionDefinition(true, this.x.topLevel ? DECLARED_FORM : STATEMENT_FORM, comments);
+
+ case LEFT_CURLY:
+ n = this.newNode(blockInit());
+ x2 = this.x.update({ parentBlock: n }).pushTarget(n).nest();
+ this.withContext(x2, function() {
+ this.Statements(n);
+ });
+ this.mustMatch(RIGHT_CURLY);
+ return n;
+
+ case IF:
+ n = this.newNode();
+ n.condition = this.HeadExpression();
+ x2 = this.x.pushTarget(n).nest();
+ this.withContext(x2, function() {
+ n.thenPart = this.Statement();
+ n.elsePart = this.match(ELSE, true) ? this.Statement() : null;
+ });
+ return n;
+
+ case SWITCH:
+ // This allows CASEs after a DEFAULT, which is in the standard.
+ n = this.newNode({ cases: [], defaultIndex: -1 });
+ n.discriminant = this.HeadExpression();
+ x2 = this.x.pushTarget(n).nest();
+ this.withContext(x2, function() {
+ this.mustMatch(LEFT_CURLY);
+ while ((tt = this.t.get()) !== RIGHT_CURLY) {
+ switch (tt) {
+ case DEFAULT:
+ if (n.defaultIndex >= 0)
+ this.fail("More than one switch default");
+ // FALL THROUGH
+ case CASE:
+ n2 = this.newNode();
+ if (tt === DEFAULT)
+ n.defaultIndex = n.cases.length;
+ else
+ n2.caseLabel = this.Expression(COLON);
+ break;
+
+ default:
+ this.fail("Invalid switch case");
+ }
+ this.mustMatch(COLON);
+ n2.statements = this.newNode(blockInit());
+ while ((tt=this.peek(true)) !== CASE && tt !== DEFAULT &&
+ tt !== RIGHT_CURLY)
+ n2.statements.push(this.Statement());
+ n.cases.push(n2);
+ }
+ });
+ return n;
+
+ case FOR:
+ n = this.newNode(LOOP_INIT);
+ n.blockComments = comments;
+ if (this.match(IDENTIFIER)) {
+ if (this.t.token.value === "each")
+ n.isEach = true;
+ else
+ this.t.unget();
+ }
+ if (!this.parenFreeMode)
+ this.mustMatch(LEFT_PAREN);
+ x2 = this.x.pushTarget(n).nest();
+ x3 = this.x.update({ inForLoopInit: true });
+ n2 = null;
+ if ((tt = this.peek(true)) !== SEMICOLON) {
+ this.withContext(x3, function() {
+ if (tt === VAR || tt === CONST) {
+ this.t.get();
+ n2 = this.Variables();
+ } else if (tt === LET) {
+ this.t.get();
+ if (this.peek() === LEFT_PAREN) {
+ n2 = this.LetBlock(false);
+ } else {
+ // Let in for head, we need to add an implicit block
+ // around the rest of the for.
+ this.x.parentBlock = n;
+ n.varDecls = [];
+ n2 = this.Variables();
+ }
+ } else {
+ n2 = this.Expression();
+ }
+ });
+ }
+ if (n2 && this.match(IN)) {
+ n.type = FOR_IN;
+ this.withContext(x3, function() {
+ n.object = this.Expression();
+ if (n2.type === VAR || n2.type === LET) {
+ c = n2.children;
+
+ // Destructuring turns one decl into multiples, so either
+ // there must be only one destructuring or only one
+ // decl.
+ if (c.length !== 1 && n2.destructurings.length !== 1) {
+ // FIXME: this.fail ?
+ throw new SyntaxError("Invalid for..in left-hand side",
+ this.filename, n2.lineno);
+ }
+ if (n2.destructurings.length > 0) {
+ n.iterator = n2.destructurings[0];
+ } else {
+ n.iterator = c[0];
+ }
+ n.varDecl = n2;
+ } else {
+ if (n2.type === ARRAY_INIT || n2.type === OBJECT_INIT) {
+ n2.destructuredNames = this.checkDestructuring(n2);
+ }
+ n.iterator = n2;
+ }
+ });
+ } else {
+ x3.inForLoopInit = false;
+ n.setup = n2;
+ this.mustMatch(SEMICOLON);
+ if (n.isEach)
+ this.fail("Invalid for each..in loop");
+ this.withContext(x3, function() {
+ n.condition = (this.peek(true) === SEMICOLON)
+ ? null
+ : this.Expression();
+ this.mustMatch(SEMICOLON);
+ tt2 = this.peek(true);
+ n.update = (this.parenFreeMode
+ ? tt2 === LEFT_CURLY || definitions.isStatementStartCode[tt2]
+ : tt2 === RIGHT_PAREN)
+ ? null
+ : this.Expression();
+ });
+ }
+ if (!this.parenFreeMode)
+ this.mustMatch(RIGHT_PAREN);
+ this.withContext(x2, function() {
+ n.body = this.Statement();
+ });
+ return n;
+
+ case WHILE:
+ n = this.newNode({ isLoop: true });
+ n.blockComments = comments;
+ n.condition = this.HeadExpression();
+ x2 = this.x.pushTarget(n).nest();
+ this.withContext(x2, function() {
+ n.body = this.Statement();
+ });
+ return n;
+
+ case DO:
+ n = this.newNode({ isLoop: true });
+ n.blockComments = comments;
+ x2 = this.x.pushTarget(n).next();
+ this.withContext(x2, function() {
+ n.body = this.Statement();
+ });
+ this.mustMatch(WHILE);
+ n.condition = this.HeadExpression();
+ // <script language="JavaScript"> (without version hints) may need
+ // automatic semicolon insertion without a newline after do-while.
+ // See http://bugzilla.mozilla.org/show_bug.cgi?id=238945.
+ this.match(SEMICOLON);
+ return n;
+
+ case BREAK:
+ case CONTINUE:
+ n = this.newNode();
+ n.blockComments = comments;
+
+ // handle the |foo: break foo;| corner case
+ x2 = this.x.pushTarget(n);
+
+ if (this.peekOnSameLine() === IDENTIFIER) {
+ this.t.get();
+ n.label = this.t.token.value;
+ }
+
+ if (n.label) {
+ n.target = x2.labeledTargets.find(function(target) {
+ return target.labels.has(n.label)
+ });
+ } else if (tt === CONTINUE) {
+ n.target = x2.defaultLoopTarget;
+ } else {
+ n.target = x2.defaultTarget;
+ }
+
+ if (!n.target)
+ this.fail("Invalid " + ((tt === BREAK) ? "break" : "continue"));
+ if (!n.target.isLoop && tt === CONTINUE)
+ this.fail("Invalid continue");
+
+ break;
+
+ case TRY:
+ n = this.newNode({ catchClauses: [] });
+ n.blockComments = comments;
+ n.tryBlock = this.Block();
+ while (this.match(CATCH)) {
+ n2 = this.newNode();
+ p = this.MaybeLeftParen();
+ switch (this.t.get()) {
+ case LEFT_BRACKET:
+ case LEFT_CURLY:
+ // Destructured catch identifiers.
+ this.t.unget();
+ n2.varName = this.DestructuringExpression(true);
+ break;
+ case IDENTIFIER:
+ n2.varName = this.t.token.value;
+ break;
+ default:
+ this.fail("missing identifier in catch");
+ break;
+ }
+ if (this.match(IF)) {
+ if (!this.mozillaMode)
+ this.fail("Illegal catch guard");
+ if (n.catchClauses.length && !n.catchClauses.top().guard)
+ this.fail("Guarded catch after unguarded");
+ n2.guard = this.Expression();
+ }
+ this.MaybeRightParen(p);
+ n2.block = this.Block();
+ n.catchClauses.push(n2);
+ }
+ if (this.match(FINALLY))
+ n.finallyBlock = this.Block();
+ if (!n.catchClauses.length && !n.finallyBlock)
+ this.fail("Invalid try statement");
+ return n;
+
+ case CATCH:
+ case FINALLY:
+ this.fail(definitions.tokens[tt] + " without preceding try");
+
+ case THROW:
+ n = this.newNode();
+ n.exception = this.Expression();
+ break;
+
+ case RETURN:
+ n = this.ReturnOrYield();
+ break;
+
+ case WITH:
+ if (this.x.banWith())
+ this.fail("with statements not allowed in strict code or modules");
+ n = this.newNode();
+ n.blockComments = comments;
+ n.object = this.HeadExpression();
+ x2 = this.x.pushTarget(n).next();
+ this.withContext(x2, function() {
+ n.body = this.Statement();
+ });
+ return n;
+
+ case VAR:
+ case CONST:
+ n = this.Variables();
+ break;
+
+ case LET:
+ if (this.peek() === LEFT_PAREN) {
+ n = this.LetBlock(true);
+ return n;
+ }
+ n = this.Variables();
+ break;
+
+ case DEBUGGER:
+ n = this.newNode();
+ break;
+
+ case NEWLINE:
+ case SEMICOLON:
+ n = this.newNode({ type: SEMICOLON });
+ n.blockComments = comments;
+ n.expression = null;
+ return n;
+
+ case IDENTIFIER:
+ case USE:
+ case MODULE:
+ switch (this.t.token.value) {
+ case "use":
+ if (!isPragmaToken(this.peekOnSameLine())) {
+ this.t.unget();
+ break;
+ }
+ return this.newNode({ type: USE, params: this.Pragmas() });
+
+ case "module":
+ if (!this.x.modulesAllowed())
+ this.fail("module declaration not at top level");
+ this.x.parentScript.hasModules = true;
+ tt = this.peekOnSameLine();
+ if (tt !== IDENTIFIER && tt !== LEFT_CURLY) {
+ this.t.unget();
+ break;
+ }
+ n = this.newNode({ type: MODULE });
+ n.blockComments = comments;
+ this.mustMatch(IDENTIFIER);
+ label = this.t.token.value;
+
+ if (this.match(LEFT_CURLY)) {
+ n.name = label;
+ n.body = this.Script(true, false);
+ n.module = new Module(n);
+ this.mustMatch(RIGHT_CURLY);
+ this.x.parentScript.modDefns.set(n.name, n);
+ return n;
+ }
+
+ this.t.unget();
+ this.ModuleVariables(n);
+ return n;
+
+ default:
+ tt = this.peek();
+ // Labeled statement.
+ if (tt === COLON) {
+ label = this.t.token.value;
+ if (this.x.allLabels.has(label))
+ this.fail("Duplicate label: " + label);
+ this.t.get();
+ n = this.newNode({ type: LABEL, label: label });
+ n.blockComments = comments;
+ x2 = this.x.pushLabel(label).nest();
+ this.withContext(x2, function() {
+ n.statement = this.Statement();
+ });
+ n.target = (n.statement.type === LABEL) ? n.statement.target : n.statement;
+ return n;
+ }
+ // FALL THROUGH
+ }
+ // FALL THROUGH
+
+ default:
+ // Expression statement.
+ // We unget the current token to parse the expression as a whole.
+ n = this.newNode({ type: SEMICOLON });
+ this.t.unget();
+ n.blockComments = comments;
+ n.expression = this.Expression();
+ n.end = n.expression.end;
+ break;
+ }
+
+ n.blockComments = comments;
+ this.MagicalSemicolon();
+ return n;
+}
+
+/*
+ * isPragmaToken :: (number) -> boolean
+ */
+function isPragmaToken(tt) {
+ switch (tt) {
+ case IDENTIFIER:
+ case STRING:
+ case NUMBER:
+ case NULL:
+ case TRUE:
+ case FALSE:
+ return true;
+ }
+ return false;
+}
+
+/*
+ * Pragmas :: () -> Array[Array[token]]
+ */
+Pp.Pragmas = function Pragmas() {
+ var pragmas = [];
+ do {
+ pragmas.push(this.Pragma());
+ } while (this.match(COMMA));
+ this.MagicalSemicolon();
+ return pragmas;
+}
+
+/*
+ * Pragmas :: () -> Array[token]
+ */
+Pp.Pragma = function Pragma() {
+ var items = [];
+ var tt;
+ do {
+ tt = this.t.get(true);
+ items.push(this.t.token);
+ } while (isPragmaToken(this.peek()));
+ return items;
+}
+
+/*
+ * MagicalSemicolon :: () -> void
+ */
+Pp.MagicalSemicolon = function MagicalSemicolon() {
+ var tt;
+ if (this.t.lineno === this.t.token.lineno) {
+ tt = this.peekOnSameLine();
+ if (tt !== END && tt !== NEWLINE && tt !== SEMICOLON && tt !== RIGHT_CURLY)
+ this.fail("missing ; before statement");
+ }
+ this.match(SEMICOLON);
+}
+
+/*
+ * ReturnOrYield :: () -> (RETURN | YIELD) node
+ */
+Pp.ReturnOrYield = function ReturnOrYield() {
+ var n, b, tt = this.t.token.type, tt2;
+
+ var parentScript = this.x.parentScript;
+
+ if (tt === RETURN) {
+ if (!this.x.inFunction)
+ this.fail("Return not in function");
+ } else /* if (tt === YIELD) */ {
+ if (!this.x.inFunction)
+ this.fail("Yield not in function");
+ parentScript.hasYield = true;
+ }
+ n = this.newNode({ value: undefined });
+
+ tt2 = (tt === RETURN) ? this.peekOnSameLine(true) : this.peek(true);
+ if (tt2 !== END && tt2 !== NEWLINE &&
+ tt2 !== SEMICOLON && tt2 !== RIGHT_CURLY
+ && (tt !== YIELD ||
+ (tt2 !== tt && tt2 !== RIGHT_BRACKET && tt2 !== RIGHT_PAREN &&
+ tt2 !== COLON && tt2 !== COMMA))) {
+ if (tt === RETURN) {
+ n.value = this.Expression();
+ parentScript.hasReturnWithValue = true;
+ } else {
+ n.value = this.AssignExpression();
+ }
+ } else if (tt === RETURN) {
+ parentScript.hasEmptyReturn = true;
+ }
+
+ return n;
+}
+
+/*
+ * ModuleExpression :: () -> (STRING | IDENTIFIER | DOT) node
+ */
+Pp.ModuleExpression = function ModuleExpression() {
+ return this.match(STRING) ? this.newNode() : this.QualifiedPath();
+}
+
+/*
+ * ImportPathList :: () -> Array[DOT node]
+ */
+Pp.ImportPathList = function ImportPathList() {
+ var a = [];
+ do {
+ a.push(this.ImportPath());
+ } while (this.match(COMMA));
+ return a;
+}
+
+/*
+ * ImportPath :: () -> DOT node
+ */
+Pp.ImportPath = function ImportPath() {
+ var n = this.QualifiedPath();
+ if (!this.match(DOT)) {
+ if (n.type === IDENTIFIER)
+ this.fail("cannot import local variable");
+ return n;
+ }
+
+ var n2 = this.newNode();
+ n2.push(n);
+ n2.push(this.ImportSpecifierSet());
+ return n2;
+}
+
+/*
+ * ExplicitSpecifierSet :: (() -> node) -> OBJECT_INIT node
+ */
+Pp.ExplicitSpecifierSet = function ExplicitSpecifierSet(SpecifierRHS) {
+ var n, n2, id, tt;
+
+ n = this.newNode({ type: OBJECT_INIT });
+ this.mustMatch(LEFT_CURLY);
+
+ if (!this.match(RIGHT_CURLY)) {
+ do {
+ id = this.Identifier();
+ if (this.match(COLON)) {
+ n2 = this.newNode({ type: PROPERTY_INIT });
+ n2.push(id);
+ n2.push(SpecifierRHS());
+ n.push(n2);
+ } else {
+ n.push(id);
+ }
+ } while (!this.match(RIGHT_CURLY) && this.mustMatch(COMMA));
+ }
+
+ return n;
+}
+
+/*
+ * ImportSpecifierSet :: () -> (IDENTIFIER | OBJECT_INIT) node
+ */
+Pp.ImportSpecifierSet = function ImportSpecifierSet() {
+ var self = this;
+ return this.match(MUL)
+ ? this.newNode({ type: IDENTIFIER, name: "*" })
+ : ExplicitSpecifierSet(function() { return self.Identifier() });
+}
+
+/*
+ * Identifier :: () -> IDENTIFIER node
+ */
+Pp.Identifier = function Identifier() {
+ this.mustMatch(IDENTIFIER);
+ return this.newNode({ type: IDENTIFIER });
+}
+
+/*
+ * IdentifierName :: () -> IDENTIFIER node
+ */
+Pp.IdentifierName = function IdentifierName() {
+ this.mustMatch(IDENTIFIER, true);
+ return this.newNode({ type: IDENTIFIER });
+}
+
+/*
+ * QualifiedPath :: () -> (IDENTIFIER | DOT) node
+ */
+Pp.QualifiedPath = function QualifiedPath() {
+ var n, n2;
+
+ n = this.Identifier();
+
+ while (this.match(DOT)) {
+ if (this.peek() !== IDENTIFIER) {
+ // Unget the '.' token, which isn't part of the QualifiedPath.
+ this.t.unget();
+ break;
+ }
+ n2 = this.newNode();
+ n2.push(n);
+ n2.push(this.Identifier());
+ n = n2;
+ }
+
+ return n;
+}
+
+/*
+ * ExportPath :: () -> (IDENTIFIER | DOT | OBJECT_INIT) node
+ */
+Pp.ExportPath = function ExportPath() {
+ var self = this;
+ if (this.peek() === LEFT_CURLY)
+ return this.ExplicitSpecifierSet(function() { return self.QualifiedPath() });
+ return this.QualifiedPath();
+}
+
+/*
+ * ExportPathList :: () -> Array[(IDENTIFIER | DOT | OBJECT_INIT) node]
+ */
+Pp.ExportPathList = function ExportPathList() {
+ var a = [];
+ do {
+ a.push(this.ExportPath());
+ } while (this.match(COMMA));
+ return a;
+}
+
+/*
+ * FunctionDefinition :: (boolean,
+ * DECLARED_FORM or EXPRESSED_FORM or STATEMENT_FORM,
+ * [string] or null or undefined)
+ * -> node
+ */
+Pp.FunctionDefinition = function FunctionDefinition(requireName, functionForm, comments) {
+ var tt;
+ var f = this.newNode({ params: [], paramComments: [] });
+ if (typeof comments === "undefined")
+ comments = null;
+ f.blockComments = comments;
+ if (f.type !== FUNCTION)
+ f.type = (f.value === "get") ? GETTER : SETTER;
+ if (this.match(MUL))
+ f.isExplicitGenerator = true;
+ if (this.match(IDENTIFIER, false, true))
+ f.name = this.t.token.value;
+ else if (requireName)
+ this.fail("missing function identifier");
+
+ var inModule = this.x.inModule;
+ x2 = new StaticContext(null, null, inModule, true, this.x.strictMode);
+ this.withContext(x2, function() {
+ this.mustMatch(LEFT_PAREN);
+ if (!this.match(RIGHT_PAREN)) {
+ do {
+ tt = this.t.get();
+ f.paramComments.push(this.t.lastBlockComment());
+ switch (tt) {
+ case LEFT_BRACKET:
+ case LEFT_CURLY:
+ // Destructured formal parameters.
+ this.t.unget();
+ f.params.push(this.DestructuringExpression());
+ break;
+ case IDENTIFIER:
+ f.params.push(this.t.token.value);
+ break;
+ default:
+ this.fail("missing formal parameter");
+ }
+ } while (this.match(COMMA));
+ this.mustMatch(RIGHT_PAREN);
+ }
+
+ // Do we have an expression closure or a normal body?
+ tt = this.t.get(true);
+ if (tt !== LEFT_CURLY)
+ this.t.unget();
+
+ if (tt !== LEFT_CURLY) {
+ f.body = this.AssignExpression();
+ } else {
+ f.body = this.Script(inModule, true);
+ }
+ });
+
+ if (tt === LEFT_CURLY)
+ this.mustMatch(RIGHT_CURLY);
+
+ f.end = this.t.token.end;
+ f.functionForm = functionForm;
+ if (functionForm === DECLARED_FORM)
+ this.x.parentScript.funDecls.push(f);
+
+ if (this.x.inModule && !f.isExplicitGenerator && f.body.hasYield)
+ this.fail("yield in non-generator function");
+
+ if (f.isExplicitGenerator || f.body.hasYield)
+ f.body = this.newNode({ type: GENERATOR, body: f.body });
+
+ return f;
+}
+
+/*
+ * ModuleVariables :: (MODULE node) -> void
+ *
+ * Parses a comma-separated list of module declarations (and maybe
+ * initializations).
+ */
+Pp.ModuleVariables = function ModuleVariables(n) {
+ var n1, n2;
+ do {
+ n1 = this.Identifier();
+ if (this.match(ASSIGN)) {
+ n2 = this.ModuleExpression();
+ n1.initializer = n2;
+ if (n2.type === STRING)
+ this.x.parentScript.modLoads.set(n1.value, n2.value);
+ else
+ this.x.parentScript.modAssns.set(n1.value, n1);
+ }
+ n.push(n1);
+ } while (this.match(COMMA));
+}
+
+/*
+ * Variables :: () -> node
+ *
+ * Parses a comma-separated list of var declarations (and maybe
+ * initializations).
+ */
+Pp.Variables = function Variables(letBlock) {
+ var n, n2, ss, i, s, tt;
+
+ tt = this.t.token.type;
+ switch (tt) {
+ case VAR:
+ case CONST:
+ s = this.x.parentScript;
+ break;
+ case LET:
+ s = this.x.parentBlock;
+ break;
+ case LEFT_PAREN:
+ tt = LET;
+ s = letBlock;
+ break;
+ }
+
+ n = this.newNode({ type: tt, destructurings: [] });
+
+ do {
+ tt = this.t.get();
+ if (tt === LEFT_BRACKET || tt === LEFT_CURLY) {
+ // Need to unget to parse the full destructured expression.
+ this.t.unget();
+
+ var dexp = this.DestructuringExpression(true);
+
+ n2 = this.newNode({ type: IDENTIFIER,
+ name: dexp,
+ readOnly: n.type === CONST });
+ n.push(n2);
+ pushDestructuringVarDecls(n2.name.destructuredNames, s);
+ n.destructurings.push({ exp: dexp, decl: n2 });
+
+ if (this.x.inForLoopInit && this.peek() === IN) {
+ continue;
+ }
+
+ this.mustMatch(ASSIGN);
+ if (this.t.token.assignOp)
+ this.fail("Invalid variable initialization");
+
+ n2.blockComment = this.t.lastBlockComment();
+ n2.initializer = this.AssignExpression();
+
+ continue;
+ }
+
+ if (tt !== IDENTIFIER)
+ this.fail("missing variable name");
+
+ n2 = this.newNode({ type: IDENTIFIER,
+ name: this.t.token.value,
+ readOnly: n.type === CONST });
+ n.push(n2);
+ s.varDecls.push(n2);
+
+ if (this.match(ASSIGN)) {
+ var comment = this.t.lastBlockComment();
+ if (this.t.token.assignOp)
+ this.fail("Invalid variable initialization");
+
+ n2.initializer = this.AssignExpression();
+ } else {
+ var comment = this.t.lastBlockComment();
+ }
+ n2.blockComment = comment;
+ } while (this.match(COMMA));
+
+ return n;
+}
+
+/*
+ * LetBlock :: (boolean) -> node
+ *
+ * Does not handle let inside of for loop init.
+ */
+Pp.LetBlock = function LetBlock(isStatement) {
+ var n, n2;
+
+ // t.token.type must be LET
+ n = this.newNode({ type: LET_BLOCK, varDecls: [] });
+ this.mustMatch(LEFT_PAREN);
+ n.variables = this.Variables(n);
+ this.mustMatch(RIGHT_PAREN);
+
+ if (isStatement && this.peek() !== LEFT_CURLY) {
+ /*
+ * If this is really an expression in let statement guise, then we
+ * need to wrap the LET_BLOCK node in a SEMICOLON node so that we pop
+ * the return value of the expression.
+ */
+ n2 = this.newNode({ type: SEMICOLON, expression: n });
+ isStatement = false;
+ }
+
+ if (isStatement)
+ n.block = this.Block();
+ else
+ n.expression = this.AssignExpression();
+
+ return n;
+}
+
+Pp.checkDestructuring = function checkDestructuring(n, simpleNamesOnly) {
+ if (n.type === ARRAY_COMP)
+ this.fail("Invalid array comprehension left-hand side");
+ if (n.type !== ARRAY_INIT && n.type !== OBJECT_INIT)
+ return;
+
+ var lhss = {};
+ var nn, n2, idx, sub, cc, c = n.children;
+ for (var i = 0, j = c.length; i < j; i++) {
+ if (!(nn = c[i]))
+ continue;
+ if (nn.type === PROPERTY_INIT) {
+ cc = nn.children;
+ sub = cc[1];
+ idx = cc[0].value;
+ } else if (n.type === OBJECT_INIT) {
+ // Do we have destructuring shorthand {foo, bar}?
+ sub = nn;
+ idx = nn.value;
+ } else {
+ sub = nn;
+ idx = i;
+ }
+
+ if (sub.type === ARRAY_INIT || sub.type === OBJECT_INIT) {
+ lhss[idx] = this.checkDestructuring(sub, simpleNamesOnly);
+ } else {
+ if (simpleNamesOnly && sub.type !== IDENTIFIER) {
+ // In declarations, lhs must be simple names
+ this.fail("missing name in pattern");
+ }
+
+ lhss[idx] = sub;
+ }
+ }
+
+ return lhss;
+}
+
+Pp.DestructuringExpression = function DestructuringExpression(simpleNamesOnly) {
+ var n = this.PrimaryExpression();
+ // Keep the list of lefthand sides for varDecls
+ n.destructuredNames = this.checkDestructuring(n, simpleNamesOnly);
+ return n;
+}
+
+Pp.GeneratorExpression = function GeneratorExpression(e) {
+ return this.newNode({ type: GENERATOR,
+ expression: e,
+ tail: this.ComprehensionTail() });
+}
+
+Pp.ComprehensionTail = function ComprehensionTail() {
+ var body, n, n2, n3, p;
+
+ // t.token.type must be FOR
+ body = this.newNode({ type: COMP_TAIL });
+
+ do {
+ // Comprehension tails are always for..in loops.
+ n = this.newNode({ type: FOR_IN, isLoop: true });
+ if (this.match(IDENTIFIER)) {
+ // But sometimes they're for each..in.
+ if (this.mozillaMode && this.t.token.value === "each")
+ n.isEach = true;
+ else
+ this.t.unget();
+ }
+ p = this.MaybeLeftParen();
+ switch(this.t.get()) {
+ case LEFT_BRACKET:
+ case LEFT_CURLY:
+ this.t.unget();
+ // Destructured left side of for in comprehension tails.
+ n.iterator = this.DestructuringExpression();
+ break;
+
+ case IDENTIFIER:
+ n.iterator = n3 = this.newNode({ type: IDENTIFIER });
+ n3.name = n3.value;
+ n.varDecl = n2 = this.newNode({ type: VAR });
+ n2.push(n3);
+ this.x.parentScript.varDecls.push(n3);
+ // Don't add to varDecls since the semantics of comprehensions is
+ // such that the variables are in their own function when
+ // desugared.
+ break;
+
+ default:
+ this.fail("missing identifier");
+ }
+ this.mustMatch(IN);
+ n.object = this.Expression();
+ this.MaybeRightParen(p);
+ body.push(n);
+ } while (this.match(FOR));
+
+ // Optional guard.
+ if (this.match(IF))
+ body.guard = this.HeadExpression();
+
+ return body;
+}
+
+Pp.HeadExpression = function HeadExpression() {
+ var p = this.MaybeLeftParen();
+ var n = this.ParenExpression();
+ this.MaybeRightParen(p);
+ if (p === END && !n.parenthesized) {
+ var tt = this.peek();
+ if (tt !== LEFT_CURLY && !definitions.isStatementStartCode[tt])
+ this.fail("Unparenthesized head followed by unbraced body");
+ }
+ return n;
+}
+
+Pp.ParenExpression = function ParenExpression() {
+ // Always accept the 'in' operator in a parenthesized expression,
+ // where it's unambiguous, even if we might be parsing the init of a
+ // for statement.
+ var x2 = this.x.update({
+ inForLoopInit: this.x.inForLoopInit && (this.t.token.type === LEFT_PAREN)
+ });
+ var n = this.withContext(x2, function() {
+ return this.Expression();
+ });
+ if (this.match(FOR)) {
+ if (n.type === YIELD && !n.parenthesized)
+ this.fail("Yield expression must be parenthesized");
+ if (n.type === COMMA && !n.parenthesized)
+ this.fail("Generator expression must be parenthesized");
+ n = this.GeneratorExpression(n);
+ }
+
+ return n;
+}
+
+/*
+ * Expression :: () -> node
+ *
+ * Top-down expression parser matched against SpiderMonkey.
+ */
+Pp.Expression = function Expression() {
+ var n, n2;
+
+ n = this.AssignExpression();
+ if (this.match(COMMA)) {
+ n2 = this.newNode({ type: COMMA });
+ n2.push(n);
+ n = n2;
+ do {
+ n2 = n.children[n.children.length-1];
+ if (n2.type === YIELD && !n2.parenthesized)
+ this.fail("Yield expression must be parenthesized");
+ n.push(this.AssignExpression());
+ } while (this.match(COMMA));
+ }
+
+ return n;
+}
+
+Pp.AssignExpression = function AssignExpression() {
+ var n, lhs;
+
+ // Have to treat yield like an operand because it could be the leftmost
+ // operand of the expression.
+ if (this.match(YIELD, true))
+ return this.ReturnOrYield();
+
+ n = this.newNode({ type: ASSIGN });
+ lhs = this.ConditionalExpression();
+
+ if (!this.match(ASSIGN)) {
+ return lhs;
+ }
+
+ n.blockComment = this.t.lastBlockComment();
+
+ switch (lhs.type) {
+ case OBJECT_INIT:
+ case ARRAY_INIT:
+ lhs.destructuredNames = this.checkDestructuring(lhs);
+ // FALL THROUGH
+ case IDENTIFIER: case DOT: case INDEX: case CALL:
+ break;
+ default:
+ this.fail("Bad left-hand side of assignment");
+ break;
+ }
+
+ n.assignOp = lhs.assignOp = this.t.token.assignOp;
+ n.push(lhs);
+ n.push(this.AssignExpression());
+
+ return n;
+}
+
+Pp.ConditionalExpression = function ConditionalExpression() {
+ var n, n2;
+
+ n = this.OrExpression();
+ if (this.match(HOOK)) {
+ n2 = n;
+ n = this.newNode({ type: HOOK });
+ n.push(n2);
+ var x2 = this.x.update({ inForLoopInit: false });
+ this.withContext(x2, function() {
+ n.push(this.AssignExpression());
+ });
+ if (!this.match(COLON))
+ this.fail("missing : after ?");
+ n.push(this.AssignExpression());
+ }
+
+ return n;
+}
+
+Pp.OrExpression = function OrExpression() {
+ var n, n2;
+
+ n = this.AndExpression();
+ while (this.match(OR)) {
+ n2 = this.newNode();
+ n2.push(n);
+ n2.push(this.AndExpression());
+ n = n2;
+ }
+
+ return n;
+}
+
+Pp.AndExpression = function AndExpression() {
+ var n, n2;
+
+ n = this.BitwiseOrExpression();
+ while (this.match(AND)) {
+ n2 = this.newNode();
+ n2.push(n);
+ n2.push(this.BitwiseOrExpression());
+ n = n2;
+ }
+
+ return n;
+}
+
+Pp.BitwiseOrExpression = function BitwiseOrExpression() {
+ var n, n2;
+
+ n = this.BitwiseXorExpression();
+ while (this.match(BITWISE_OR)) {
+ n2 = this.newNode();
+ n2.push(n);
+ n2.push(this.BitwiseXorExpression());
+ n = n2;
+ }
+
+ return n;
+}
+
+Pp.BitwiseXorExpression = function BitwiseXorExpression() {
+ var n, n2;
+
+ n = this.BitwiseAndExpression();
+ while (this.match(BITWISE_XOR)) {
+ n2 = this.newNode();
+ n2.push(n);
+ n2.push(this.BitwiseAndExpression());
+ n = n2;
+ }
+
+ return n;
+}
+
+Pp.BitwiseAndExpression = function BitwiseAndExpression() {
+ var n, n2;
+
+ n = this.EqualityExpression();
+ while (this.match(BITWISE_AND)) {
+ n2 = this.newNode();
+ n2.push(n);
+ n2.push(this.EqualityExpression());
+ n = n2;
+ }
+
+ return n;
+}
+
+Pp.EqualityExpression = function EqualityExpression() {
+ var n, n2;
+
+ n = this.RelationalExpression();
+ while (this.match(EQ) || this.match(NE) ||
+ this.match(STRICT_EQ) || this.match(STRICT_NE)) {
+ n2 = this.newNode();
+ n2.push(n);
+ n2.push(this.RelationalExpression());
+ n = n2;
+ }
+
+ return n;
+}
+
+Pp.RelationalExpression = function RelationalExpression() {
+ var n, n2;
+ var x2 = this.x.update({ inForLoopInit: false });
+ this.withContext(x2, function() {
+ n = this.ShiftExpression();
+ while ((this.match(LT) || this.match(LE) || this.match(GE) || this.match(GT) ||
+ (!this.x.inForLoopInit && this.match(IN)) ||
+ this.match(INSTANCEOF))) {
+ n2 = this.newNode();
+ n2.push(n);
+ n2.push(this.ShiftExpression());
+ n = n2;
+ }
+ });
+
+ return n;
+}
+
+Pp.ShiftExpression = function ShiftExpression() {
+ var n, n2;
+
+ n = this.AddExpression();
+ while (this.match(LSH) || this.match(RSH) || this.match(URSH)) {
+ n2 = this.newNode();
+ n2.push(n);
+ n2.push(this.AddExpression());
+ n = n2;
+ }
+
+ return n;
+}
+
+Pp.AddExpression = function AddExpression() {
+ var n, n2;
+
+ n = this.MultiplyExpression();
+ while (this.match(PLUS) || this.match(MINUS)) {
+ n2 = this.newNode();
+ n2.push(n);
+ n2.push(this.MultiplyExpression());
+ n = n2;
+ }
+
+ return n;
+}
+
+Pp.MultiplyExpression = function MultiplyExpression() {
+ var n, n2;
+
+ n = this.UnaryExpression();
+ while (this.match(MUL) || this.match(DIV) || this.match(MOD)) {
+ n2 = this.newNode();
+ n2.push(n);
+ n2.push(this.UnaryExpression());
+ n = n2;
+ }
+
+ return n;
+}
+
+Pp.UnaryExpression = function UnaryExpression() {
+ var n, n2, tt;
+
+ switch (tt = this.t.get(true)) {
+ case DELETE: case VOID: case TYPEOF:
+ case NOT: case BITWISE_NOT: case PLUS: case MINUS:
+ if (tt === PLUS)
+ n = this.newNode({ type: UNARY_PLUS });
+ else if (tt === MINUS)
+ n = this.newNode({ type: UNARY_MINUS });
+ else
+ n = this.newNode();
+ n.push(this.UnaryExpression());
+ break;
+
+ case INCREMENT:
+ case DECREMENT:
+ // Prefix increment/decrement.
+ n = this.newNode();
+ n.push(this.MemberExpression(true));
+ break;
+
+ default:
+ this.t.unget();
+ n = this.MemberExpression(true);
+
+ // Don't look across a newline boundary for a postfix {in,de}crement.
+ if (this.t.tokens[(this.t.tokenIndex + this.t.lookahead - 1) & 3].lineno ===
+ this.t.lineno) {
+ if (this.match(INCREMENT) || this.match(DECREMENT)) {
+ n2 = this.newNode({ postfix: true });
+ n2.push(n);
+ n = n2;
+ }
+ }
+ break;
+ }
+
+ return n;
+}
+
+Pp.MemberExpression = function MemberExpression(allowCallSyntax) {
+ var n, n2, name, tt;
+
+ if (this.match(NEW)) {
+ n = this.newNode();
+ n.push(this.MemberExpression(false));
+ if (this.match(LEFT_PAREN)) {
+ n.type = NEW_WITH_ARGS;
+ n.push(this.ArgumentList());
+ }
+ } else {
+ n = this.PrimaryExpression();
+ }
+
+ while ((tt = this.t.get()) !== END) {
+ switch (tt) {
+ case DOT:
+ n2 = this.newNode();
+ n2.push(n);
+ n2.push(this.IdentifierName());
+ break;
+
+ case LEFT_BRACKET:
+ n2 = this.newNode({ type: INDEX });
+ n2.push(n);
+ n2.push(this.Expression());
+ this.mustMatch(RIGHT_BRACKET);
+ break;
+
+ case LEFT_PAREN:
+ if (allowCallSyntax) {
+ n2 = this.newNode({ type: CALL });
+ n2.push(n);
+ n2.push(this.ArgumentList());
+ break;
+ }
+
+ // FALL THROUGH
+ default:
+ this.t.unget();
+ return n;
+ }
+
+ n = n2;
+ }
+
+ return n;
+}
+
+Pp.ArgumentList = function ArgumentList() {
+ var n, n2;
+
+ n = this.newNode({ type: LIST });
+ if (this.match(RIGHT_PAREN, true))
+ return n;
+ do {
+ n2 = this.AssignExpression();
+ if (n2.type === YIELD && !n2.parenthesized && this.peek() === COMMA)
+ this.fail("Yield expression must be parenthesized");
+ if (this.match(FOR)) {
+ n2 = this.GeneratorExpression(n2);
+ if (n.children.length > 1 || this.peek(true) === COMMA)
+ this.fail("Generator expression must be parenthesized");
+ }
+ n.push(n2);
+ } while (this.match(COMMA));
+ this.mustMatch(RIGHT_PAREN);
+
+ return n;
+}
+
+Pp.PrimaryExpression = function PrimaryExpression() {
+ var n, n2, tt = this.t.get(true);
+
+ switch (tt) {
+ case FUNCTION:
+ n = this.FunctionDefinition(false, EXPRESSED_FORM);
+ break;
+
+ case LEFT_BRACKET:
+ n = this.newNode({ type: ARRAY_INIT });
+ while ((tt = this.peek(true)) !== RIGHT_BRACKET) {
+ if (tt === COMMA) {
+ this.t.get();
+ n.push(null);
+ continue;
+ }
+ n.push(this.AssignExpression());
+ if (tt !== COMMA && !this.match(COMMA))
+ break;
+ }
+
+ // If we matched exactly one element and got a FOR, we have an
+ // array comprehension.
+ if (n.children.length === 1 && this.match(FOR)) {
+ n2 = this.newNode({ type: ARRAY_COMP,
+ expression: n.children[0],
+ tail: this.ComprehensionTail() });
+ n = n2;
+ }
+ this.mustMatch(RIGHT_BRACKET);
+ break;
+
+ case LEFT_CURLY:
+ var id, fd;
+ n = this.newNode({ type: OBJECT_INIT });
+
+ object_init:
+ if (!this.match(RIGHT_CURLY)) {
+ do {
+ tt = this.t.get();
+ if ((this.t.token.value === "get" || this.t.token.value === "set") &&
+ this.peek() === IDENTIFIER) {
+ n.push(this.FunctionDefinition(true, EXPRESSED_FORM));
+ } else {
+ var comments = this.t.blockComments;
+ switch (tt) {
+ case IDENTIFIER: case NUMBER: case STRING:
+ id = this.newNode({ type: IDENTIFIER });
+ break;
+ case RIGHT_CURLY:
+ break object_init;
+ default:
+ if (this.t.token.value in definitions.keywords) {
+ id = this.newNode({ type: IDENTIFIER });
+ break;
+ }
+ this.fail("Invalid property name");
+ }
+ if (this.match(COLON)) {
+ n2 = this.newNode({ type: PROPERTY_INIT });
+ n2.push(id);
+ n2.push(this.AssignExpression());
+ n2.blockComments = comments;
+ n.push(n2);
+ } else {
+ // Support, e.g., |var {x, y} = o| as destructuring shorthand
+ // for |var {x: x, y: y} = o|, per proposed JS2/ES4 for JS1.8.
+ if (this.peek() !== COMMA && this.peek() !== RIGHT_CURLY)
+ this.fail("missing : after property");
+ n.push(id);
+ }
+ }
+ } while (this.match(COMMA));
+ this.mustMatch(RIGHT_CURLY);
+ }
+ break;
+
+ case LEFT_PAREN:
+ n = this.ParenExpression();
+ this.mustMatch(RIGHT_PAREN);
+ n.parenthesized = true;
+ break;
+
+ case LET:
+ n = this.LetBlock(false);
+ break;
+
+ case NULL: case THIS: case TRUE: case FALSE:
+ case IDENTIFIER: case NUMBER: case STRING: case REGEXP:
+ n = this.newNode();
+ break;
+
+ default:
+ this.fail("missing operand; found " + definitions.tokens[tt]);
+ break;
+ }
+
+ return n;
+}
+
+/*
+ * parse :: (source, filename, line number) -> node
+ */
+function parse(s, f, l) {
+ var t = new Tokenizer(s, f, l, options.allowHTMLComments);
+ var p = new Parser(t);
+ return p.Script(false, false, true);
+}
+
+/*
+ * parseFunction :: (source, boolean,
+ * DECLARED_FORM or EXPRESSED_FORM or STATEMENT_FORM,
+ * filename, line number)
+ * -> node
+ */
+function parseFunction(s, requireName, form, f, l) {
+ var t = new Tokenizer(s, f, l);
+ var p = new Parser(t);
+ p.x = new StaticContext(null, null, false, false, false);
+ return p.FunctionDefinition(requireName, form);
+}
+
+/*
+ * parseStdin :: (source, {line number}, string, (string) -> boolean) -> program node
+ */
+function parseStdin(s, ln, prefix, isCommand) {
+ // the special .begin command is only recognized at the beginning
+ if (s.match(/^[\s]*\.begin[\s]*$/)) {
+ ++ln.value;
+ return parseMultiline(ln, prefix);
+ }
+
+ // commands at the beginning are treated as the entire input
+ if (isCommand(s.trim()))
+ s = "";
+
+ for (;;) {
+ try {
+ var t = new Tokenizer(s, "stdin", ln.value, false);
+ var p = new Parser(t);
+ var n = p.Script(false, false);
+ ln.value = t.lineno;
+ return n;
+ } catch (e) {
+ if (!p.unexpectedEOF)
+ throw e;
+
+ // commands in the middle are not treated as part of the input
+ var more;
+ do {
+ if (prefix)
+ putstr(prefix);
+ more = readline();
+ if (!more)
+ throw e;
+ } while (isCommand(more.trim()));
+
+ s += "\n" + more;
+ }
+ }
+}
+
+/*
+ * parseMultiline :: ({line number}, string | null) -> program node
+ */
+function parseMultiline(ln, prefix) {
+ var s = "";
+ for (;;) {
+ if (prefix)
+ putstr(prefix);
+ var more = readline();
+ if (more === null)
+ return null;
+ // the only command recognized in multiline mode is .end
+ if (more.match(/^[\s]*\.end[\s]*$/))
+ break;
+ s += "\n" + more;
+ }
+ var t = new Tokenizer(s, "stdin", ln.value, false);
+ var p = new Parser(t);
+ var n = p.Script(false, false);
+ ln.value = t.lineno;
+ return n;
+}
+
+exports.parse = parse;
+exports.parseStdin = parseStdin;
+exports.parseFunction = parseFunction;
+exports.Node = Node;
+exports.DECLARED_FORM = DECLARED_FORM;
+exports.EXPRESSED_FORM = EXPRESSED_FORM;
+exports.STATEMENT_FORM = STATEMENT_FORM;
+exports.Tokenizer = Tokenizer;
+exports.Parser = Parser;
+exports.Module = Module;
+exports.Export = Export;
+
+});
+
+/*
+ * Narcissus - JS implemented in JS.
+ *
+ * Lexical scanner.
+ */
+
+ define('ace/narcissus/lexer', ['require', 'exports', 'module' , 'ace/narcissus/definitions'], function(require, exports, module) {
+
+var definitions = require('./definitions');
+
+// Set constants in the local scope.
+eval(definitions.consts);
+
+// Build up a trie of operator tokens.
+var opTokens = {};
+for (var op in definitions.opTypeNames) {
+ if (op === '\n' || op === '.')
+ continue;
+
+ var node = opTokens;
+ for (var i = 0; i < op.length; i++) {
+ var ch = op[i];
+ if (!(ch in node))
+ node[ch] = {};
+ node = node[ch];
+ node.op = op;
+ }
+}
+
+/*
+ * Since JavaScript provides no convenient way to determine if a
+ * character is in a particular Unicode category, we use
+ * metacircularity to accomplish this (oh yeaaaah!)
+ */
+function isValidIdentifierChar(ch, first) {
+ // check directly for ASCII
+ if (ch <= "\u007F") {
+ if ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || ch === '$' || ch === '_' ||
+ (!first && (ch >= '0' && ch <= '9'))) {
+ return true;
+ }
+ return false;
+ }
+
+ // create an object to test this in
+ var x = {};
+ x["x"+ch] = true;
+ x[ch] = true;
+
+ // then use eval to determine if it's a valid character
+ var valid = false;
+ try {
+ valid = (Function("x", "return (x." + (first?"":"x") + ch + ");")(x) === true);
+ } catch (ex) {}
+
+ return valid;
+}
+
+function isIdentifier(str) {
+ if (typeof str !== "string")
+ return false;
+
+ if (str.length === 0)
+ return false;
+
+ if (!isValidIdentifierChar(str[0], true))
+ return false;
+
+ for (var i = 1; i < str.length; i++) {
+ if (!isValidIdentifierChar(str[i], false))
+ return false;
+ }
+
+ return true;
+}
+
+/*
+ * Tokenizer :: (source, filename, line number, boolean) -> Tokenizer
+ */
+function Tokenizer(s, f, l, allowHTMLComments) {
+ this.cursor = 0;
+ this.source = String(s);
+ this.tokens = [];
+ this.tokenIndex = 0;
+ this.lookahead = 0;
+ this.scanNewlines = false;
+ this.filename = f || "";
+ this.lineno = l || 1;
+ this.allowHTMLComments = allowHTMLComments;
+ this.blockComments = null;
+}
+
+Tokenizer.prototype = {
+ get done() {
+ // We need to set scanOperand to true here because the first thing
+ // might be a regexp.
+ return this.peek(true) === END;
+ },
+
+ get token() {
+ return this.tokens[this.tokenIndex];
+ },
+
+ match: function (tt, scanOperand, keywordIsName) {
+ return this.get(scanOperand, keywordIsName) === tt || this.unget();
+ },
+
+ mustMatch: function (tt, keywordIsName) {
+ if (!this.match(tt, false, keywordIsName)) {
+ throw this.newSyntaxError("Missing " +
+ definitions.tokens[tt].toLowerCase());
+ }
+ return this.token;
+ },
+
+ peek: function (scanOperand) {
+ var tt, next;
+ if (this.lookahead) {
+ next = this.tokens[(this.tokenIndex + this.lookahead) & 3];
+ tt = (this.scanNewlines && next.lineno !== this.lineno)
+ ? NEWLINE
+ : next.type;
+ } else {
+ tt = this.get(scanOperand);
+ this.unget();
+ }
+ return tt;
+ },
+
+ peekOnSameLine: function (scanOperand) {
+ this.scanNewlines = true;
+ var tt = this.peek(scanOperand);
+ this.scanNewlines = false;
+ return tt;
+ },
+
+ lastBlockComment: function() {
+ var length = this.blockComments.length;
+ return length ? this.blockComments[length - 1] : null;
+ },
+
+ // Eat comments and whitespace.
+ skip: function () {
+ var input = this.source;
+ this.blockComments = [];
+ for (;;) {
+ var ch = input[this.cursor++];
+ var next = input[this.cursor];
+ // handle \r, \r\n and (always preferable) \n
+ if (ch === '\r') {
+ // if the next character is \n, we don't care about this at all
+ if (next === '\n') continue;
+
+ // otherwise, we want to consider this as a newline
+ ch = '\n';
+ }
+
+ if (ch === '\n' && !this.scanNewlines) {
+ this.lineno++;
+ } else if (ch === '/' && next === '*') {
+ var commentStart = ++this.cursor;
+ for (;;) {
+ ch = input[this.cursor++];
+ if (ch === undefined)
+ throw this.newSyntaxError("Unterminated comment");
+
+ if (ch === '*') {
+ next = input[this.cursor];
+ if (next === '/') {
+ var commentEnd = this.cursor - 1;
+ this.cursor++;
+ break;
+ }
+ } else if (ch === '\n') {
+ this.lineno++;
+ }
+ }
+ this.blockComments.push(input.substring(commentStart, commentEnd));
+ } else if ((ch === '/' && next === '/') ||
+ (this.allowHTMLComments && ch === '<' && next === '!' &&
+ input[this.cursor + 1] === '-' && input[this.cursor + 2] === '-' &&
+ (this.cursor += 2))) {
+ this.cursor++;
+ for (;;) {
+ ch = input[this.cursor++];
+ next = input[this.cursor];
+ if (ch === undefined)
+ return;
+
+ if (ch === '\r') {
+ // check for \r\n
+ if (next !== '\n') ch = '\n';
+ }
+
+ if (ch === '\n') {
+ if (this.scanNewlines) {
+ this.cursor--;
+ } else {
+ this.lineno++;
+ }
+ break;
+ }
+ }
+ } else if (!(ch in definitions.whitespace)) {
+ this.cursor--;
+ return;
+ }
+ }
+ },
+
+ // Lex the exponential part of a number, if present. Return true iff an
+ // exponential part was found.
+ lexExponent: function() {
+ var input = this.source;
+ var next = input[this.cursor];
+ if (next === 'e' || next === 'E') {
+ this.cursor++;
+ ch = input[this.cursor++];
+ if (ch === '+' || ch === '-')
+ ch = input[this.cursor++];
+
+ if (ch < '0' || ch > '9')
+ throw this.newSyntaxError("Missing exponent");
+
+ do {
+ ch = input[this.cursor++];
+ } while (ch >= '0' && ch <= '9');
+ this.cursor--;
+
+ return true;
+ }
+
+ return false;
+ },
+
+ lexZeroNumber: function (ch) {
+ var token = this.token, input = this.source;
+ token.type = NUMBER;
+
+ ch = input[this.cursor++];
+ if (ch === '.') {
+ do {
+ ch = input[this.cursor++];
+ } while (ch >= '0' && ch <= '9');
+ this.cursor--;
+
+ this.lexExponent();
+ token.value = parseFloat(
+ input.substring(token.start, this.cursor));
+ } else if (ch === 'x' || ch === 'X') {
+ do {
+ ch = input[this.cursor++];
+ } while ((ch >= '0' && ch <= '9') || (ch >= 'a' && ch <= 'f') ||
+ (ch >= 'A' && ch <= 'F'));
+ this.cursor--;
+
+ token.value = parseInt(input.substring(token.start, this.cursor));
+ } else if (ch >= '0' && ch <= '7') {
+ do {
+ ch = input[this.cursor++];
+ } while (ch >= '0' && ch <= '7');
+ this.cursor--;
+
+ token.value = parseInt(input.substring(token.start, this.cursor));
+ } else {
+ this.cursor--;
+ this.lexExponent(); // 0E1, &c.
+ token.value = 0;
+ }
+ },
+
+ lexNumber: function (ch) {
+ var token = this.token, input = this.source;
+ token.type = NUMBER;
+
+ var floating = false;
+ do {
+ ch = input[this.cursor++];
+ if (ch === '.' && !floating) {
+ floating = true;
+ ch = input[this.cursor++];
+ }
+ } while (ch >= '0' && ch <= '9');
+
+ this.cursor--;
+
+ var exponent = this.lexExponent();
+ floating = floating || exponent;
+
+ var str = input.substring(token.start, this.cursor);
+ token.value = floating ? parseFloat(str) : parseInt(str);
+ },
+
+ lexDot: function (ch) {
+ var token = this.token, input = this.source;
+ var next = input[this.cursor];
+ if (next >= '0' && next <= '9') {
+ do {
+ ch = input[this.cursor++];
+ } while (ch >= '0' && ch <= '9');
+ this.cursor--;
+
+ this.lexExponent();
+
+ token.type = NUMBER;
+ token.value = parseFloat(
+ input.substring(token.start, this.cursor));
+ } else {
+ token.type = DOT;
+ token.assignOp = null;
+ token.value = '.';
+ }
+ },
+
+ lexString: function (ch) {
+ var token = this.token, input = this.source;
+ token.type = STRING;
+
+ var hasEscapes = false;
+ var delim = ch;
+ if (input.length <= this.cursor)
+ throw this.newSyntaxError("Unterminated string literal");
+ while ((ch = input[this.cursor++]) !== delim) {
+ if (ch == '\n' || ch == '\r')
+ throw this.newSyntaxError("Unterminated string literal");
+ if (this.cursor == input.length)
+ throw this.newSyntaxError("Unterminated string literal");
+ if (ch === '\\') {
+ hasEscapes = true;
+ if (++this.cursor == input.length)
+ throw this.newSyntaxError("Unterminated string literal");
+ }
+ }
+
+ token.value = hasEscapes
+ ? eval(input.substring(token.start, this.cursor))
+ : input.substring(token.start + 1, this.cursor - 1);
+ },
+
+ lexRegExp: function (ch) {
+ var token = this.token, input = this.source;
+ token.type = REGEXP;
+
+ do {
+ ch = input[this.cursor++];
+ if (ch === '\\') {
+ this.cursor++;
+ } else if (ch === '[') {
+ do {
+ if (ch === undefined)
+ throw this.newSyntaxError("Unterminated character class");
+
+ if (ch === '\\')
+ this.cursor++;
+
+ ch = input[this.cursor++];
+ } while (ch !== ']');
+ } else if (ch === undefined) {
+ throw this.newSyntaxError("Unterminated regex");
+ }
+ } while (ch !== '/');
+
+ do {
+ ch = input[this.cursor++];
+ } while (ch >= 'a' && ch <= 'z');
+
+ this.cursor--;
+
+ token.value = eval(input.substring(token.start, this.cursor));
+ },
+
+ lexOp: function (ch) {
+ var token = this.token, input = this.source;
+
+ // A bit ugly, but it seems wasteful to write a trie lookup routine
+ // for only 3 characters...
+ var node = opTokens[ch];
+ var next = input[this.cursor];
+ if (next in node) {
+ node = node[next];
+ this.cursor++;
+ next = input[this.cursor];
+ if (next in node) {
+ node = node[next];
+ this.cursor++;
+ next = input[this.cursor];
+ }
+ }
+
+ var op = node.op;
+ if (definitions.assignOps[op] && input[this.cursor] === '=') {
+ this.cursor++;
+ token.type = ASSIGN;
+ token.assignOp = definitions.tokenIds[definitions.opTypeNames[op]];
+ op += '=';
+ } else {
+ token.type = definitions.tokenIds[definitions.opTypeNames[op]];
+ token.assignOp = null;
+ }
+
+ token.value = op;
+ },
+
+ // FIXME: Unicode escape sequences
+ lexIdent: function (ch, keywordIsName) {
+ var token = this.token;
+ var id = ch;
+
+ while ((ch = this.getValidIdentifierChar(false)) !== null) {
+ id += ch;
+ }
+
+ token.type = IDENTIFIER;
+ token.value = id;
+
+ if (keywordIsName)
+ return;
+
+ var kw;
+
+ if (this.parser.mozillaMode) {
+ kw = definitions.mozillaKeywords[id];
+ if (kw) {
+ token.type = kw;
+ return;
+ }
+ }
+
+ if (this.parser.x.strictMode) {
+ kw = definitions.strictKeywords[id];
+ if (kw) {
+ token.type = kw;
+ return;
+ }
+ }
+
+ kw = definitions.keywords[id];
+ if (kw)
+ token.type = kw;
+ },
+
+ /*
+ * Tokenizer.get :: ([boolean[, boolean]]) -> token type
+ *
+ * Consume input *only* if there is no lookahead.
+ * Dispatch to the appropriate lexing function depending on the input.
+ */
+ get: function (scanOperand, keywordIsName) {
+ var token;
+ while (this.lookahead) {
+ --this.lookahead;
+ this.tokenIndex = (this.tokenIndex + 1) & 3;
+ token = this.tokens[this.tokenIndex];
+ if (token.type !== NEWLINE || this.scanNewlines)
+ return token.type;
+ }
+
+ this.skip();
+
+ this.tokenIndex = (this.tokenIndex + 1) & 3;
+ token = this.tokens[this.tokenIndex];
+ if (!token)
+ this.tokens[this.tokenIndex] = token = {};
+
+ var input = this.source;
+ if (this.cursor >= input.length)
+ return token.type = END;
+
+ token.start = this.cursor;
+ token.lineno = this.lineno;
+
+ var ich = this.getValidIdentifierChar(true);
+ var ch = (ich === null) ? input[this.cursor++] : null;
+ if (ich !== null) {
+ this.lexIdent(ich, keywordIsName);
+ } else if (scanOperand && ch === '/') {
+ this.lexRegExp(ch);
+ } else if (ch in opTokens) {
+ this.lexOp(ch);
+ } else if (ch === '.') {
+ this.lexDot(ch);
+ } else if (ch >= '1' && ch <= '9') {
+ this.lexNumber(ch);
+ } else if (ch === '0') {
+ this.lexZeroNumber(ch);
+ } else if (ch === '"' || ch === "'") {
+ this.lexString(ch);
+ } else if (this.scanNewlines && (ch === '\n' || ch === '\r')) {
+ // if this was a \r, look for \r\n
+ if (ch === '\r' && input[this.cursor] === '\n') this.cursor++;
+ token.type = NEWLINE;
+ token.value = '\n';
+ this.lineno++;
+ } else {
+ throw this.newSyntaxError("Illegal token");
+ }
+
+ token.end = this.cursor;
+ return token.type;
+ },
+
+ /*
+ * Tokenizer.unget :: void -> undefined
+ *
+ * Match depends on unget returning undefined.
+ */
+ unget: function () {
+ if (++this.lookahead === 4) throw "PANIC: too much lookahead!";
+ this.tokenIndex = (this.tokenIndex - 1) & 3;
+ },
+
+ newSyntaxError: function (m) {
+ m = (this.filename ? this.filename + ":" : "") + this.lineno + ": " + m;
+ var e = new SyntaxError(m, this.filename, this.lineno);
+ e.source = this.source;
+ e.cursor = this.lookahead
+ ? this.tokens[(this.tokenIndex + this.lookahead) & 3].start
+ : this.cursor;
+ return e;
+ },
+
+
+ /* Gets a single valid identifier char from the input stream, or null
+ * if there is none.
+ */
+ getValidIdentifierChar: function(first) {
+ var input = this.source;
+ if (this.cursor >= input.length) return null;
+ var ch = input[this.cursor];
+
+ // first check for \u escapes
+ if (ch === '\\' && input[this.cursor+1] === 'u') {
+ // get the character value
+ try {
+ ch = String.fromCharCode(parseInt(
+ input.substring(this.cursor + 2, this.cursor + 6),
+ 16));
+ } catch (ex) {
+ return null;
+ }
+ this.cursor += 5;
+ }
+
+ var valid = isValidIdentifierChar(ch, first);
+ if (valid) this.cursor++;
+ return (valid ? ch : null);
+ },
+};
+
+
+exports.isIdentifier = isIdentifier;
+exports.Tokenizer = Tokenizer;
+
+});
+
+/*
+ * Narcissus - JS implemented in JS.
+ *
+ * Well-known constants and lookup tables. Many consts are generated from the
+ * tokens table via eval to minimize redundancy, so consumers must be compiled
+ * separately to take advantage of the simple switch-case constant propagation
+ * done by SpiderMonkey.
+ */
+
+define('ace/narcissus/definitions', ['require', 'exports', 'module' ], function(require, exports, module) {
+
+var tokens = [
+ // End of source.
+ "END",
+
+ // Operators and punctuators. Some pair-wise order matters, e.g. (+, -)
+ // and (UNARY_PLUS, UNARY_MINUS).
+ "\n", ";",
+ ",",
+ "=",
+ "?", ":", "CONDITIONAL",
+ "||",
+ "&&",
+ "|",
+ "^",
+ "&",
+ "==", "!=", "===", "!==",
+ "<", "<=", ">=", ">",
+ "<<", ">>", ">>>",
+ "+", "-",
+ "*", "/", "%",
+ "!", "~", "UNARY_PLUS", "UNARY_MINUS",
+ "++", "--",
+ ".",
+ "[", "]",
+ "{", "}",
+ "(", ")",
+
+ // Nonterminal tree node type codes.
+ "SCRIPT", "BLOCK", "LABEL", "FOR_IN", "CALL", "NEW_WITH_ARGS", "INDEX",
+ "ARRAY_INIT", "OBJECT_INIT", "PROPERTY_INIT", "GETTER", "SETTER",
+ "GROUP", "LIST", "LET_BLOCK", "ARRAY_COMP", "GENERATOR", "COMP_TAIL",
+
+ // Contextual keywords.
+ "IMPLEMENTS", "INTERFACE", "LET", "MODULE", "PACKAGE", "PRIVATE",
+ "PROTECTED", "PUBLIC", "STATIC", "USE", "YIELD",
+
+ // Terminals.
+ "IDENTIFIER", "NUMBER", "STRING", "REGEXP",
+
+ // Keywords.
+ "break",
+ "case", "catch", "const", "continue",
+ "debugger", "default", "delete", "do",
+ "else", "export",
+ "false", "finally", "for", "function",
+ "if", "import", "in", "instanceof",
+ "new", "null",
+ "return",
+ "switch",
+ "this", "throw", "true", "try", "typeof",
+ "var", "void",
+ "while", "with",
+];
+
+var strictKeywords = {
+ __proto__: null,
+ "implements": true,
+ "interface": true,
+ "let": true,
+ //"module": true,
+ "package": true,
+ "private": true,
+ "protected": true,
+ "public": true,
+ "static": true,
+ "use": true,
+ "yield": true
+};
+
+var statementStartTokens = [
+ "break",
+ "const", "continue",
+ "debugger", "do",
+ "for",
+ "if",
+ "let",
+ "return",
+ "switch",
+ "throw", "try",
+ "var",
+ "yield",
+ "while", "with",
+];
+
+// Whitespace characters (see ECMA-262 7.2)
+var whitespaceChars = [
+ // normal whitespace:
+ "\u0009", "\u000B", "\u000C", "\u0020", "\u00A0", "\uFEFF",
+
+ // high-Unicode whitespace:
+ "\u1680", "\u180E",
+ "\u2000", "\u2001", "\u2002", "\u2003", "\u2004", "\u2005", "\u2006",
+ "\u2007", "\u2008", "\u2009", "\u200A",
+ "\u202F", "\u205F", "\u3000"
+];
+
+var whitespace = {};
+for (var i = 0; i < whitespaceChars.length; i++) {
+ whitespace[whitespaceChars[i]] = true;
+}
+
+// Operator and punctuator mapping from token to tree node type name.
+// NB: because the lexer doesn't backtrack, all token prefixes must themselves
+// be valid tokens (e.g. !== is acceptable because its prefixes are the valid
+// tokens != and !).
+var opTypeNames = {
+ '\n': "NEWLINE",
+ ';': "SEMICOLON",
+ ',': "COMMA",
+ '?': "HOOK",
+ ':': "COLON",
+ '||': "OR",
+ '&&': "AND",
+ '|': "BITWISE_OR",
+ '^': "BITWISE_XOR",
+ '&': "BITWISE_AND",
+ '===': "STRICT_EQ",
+ '==': "EQ",
+ '=': "ASSIGN",
+ '!==': "STRICT_NE",
+ '!=': "NE",
+ '<<': "LSH",
+ '<=': "LE",
+ '<': "LT",
+ '>>>': "URSH",
+ '>>': "RSH",
+ '>=': "GE",
+ '>': "GT",
+ '++': "INCREMENT",
+ '--': "DECREMENT",
+ '+': "PLUS",
+ '-': "MINUS",
+ '*': "MUL",
+ '/': "DIV",
+ '%': "MOD",
+ '!': "NOT",
+ '~': "BITWISE_NOT",
+ '.': "DOT",
+ '[': "LEFT_BRACKET",
+ ']': "RIGHT_BRACKET",
+ '{': "LEFT_CURLY",
+ '}': "RIGHT_CURLY",
+ '(': "LEFT_PAREN",
+ ')': "RIGHT_PAREN"
+};
+
+// Hash of keyword identifier to tokens index. NB: we must null __proto__ to
+// avoid toString, etc. namespace pollution.
+var keywords = {__proto__: null};
+var mozillaKeywords = {__proto__: null};
+
+// Define const END, etc., based on the token names. Also map name to index.
+var tokenIds = {};
+
+var hostSupportsEvalConst = (function() {
+ try {
+ return eval("(function(s) { eval(s); return x })('const x = true;')");
+ } catch (e) {
+ return false;
+ }
+})();
+
+// Building up a string to be eval'd in different contexts.
+var consts = hostSupportsEvalConst ? "const " : "var ";
+for (var i = 0, j = tokens.length; i < j; i++) {
+ if (i > 0)
+ consts += ", ";
+ var t = tokens[i];
+ var name;
+ if (/^[a-z]/.test(t)) {
+ name = t.toUpperCase();
+ if (name === "LET" || name === "YIELD")
+ mozillaKeywords[name] = i;
+ if (strictKeywords[name])
+ strictKeywords[name] = i;
+ keywords[t] = i;
+ } else {
+ name = (/^\W/.test(t) ? opTypeNames[t] : t);
+ }
+ consts += name + " = " + i;
+ tokenIds[name] = i;
+ tokens[t] = i;
+}
+consts += ";";
+
+var isStatementStartCode = {__proto__: null};
+for (i = 0, j = statementStartTokens.length; i < j; i++)
+ isStatementStartCode[keywords[statementStartTokens[i]]] = true;
+
+// Map assignment operators to their indexes in the tokens array.
+var assignOps = ['|', '^', '&', '<<', '>>', '>>>', '+', '-', '*', '/', '%'];
+
+for (i = 0, j = assignOps.length; i < j; i++) {
+ t = assignOps[i];
+ assignOps[t] = tokens[t];
+}
+
+function defineGetter(obj, prop, fn, dontDelete, dontEnum) {
+ Object.defineProperty(obj, prop,
+ { get: fn, configurable: !dontDelete, enumerable: !dontEnum });
+}
+
+function defineGetterSetter(obj, prop, getter, setter, dontDelete, dontEnum) {
+ Object.defineProperty(obj, prop, {
+ get: getter,
+ set: setter,
+ configurable: !dontDelete,
+ enumerable: !dontEnum
+ });
+}
+
+function defineMemoGetter(obj, prop, fn, dontDelete, dontEnum) {
+ Object.defineProperty(obj, prop, {
+ get: function() {
+ var val = fn();
+ defineProperty(obj, prop, val, dontDelete, true, dontEnum);
+ return val;
+ },
+ configurable: true,
+ enumerable: !dontEnum
+ });
+}
+
+function defineProperty(obj, prop, val, dontDelete, readOnly, dontEnum) {
+ Object.defineProperty(obj, prop,
+ { value: val, writable: !readOnly, configurable: !dontDelete,
+ enumerable: !dontEnum });
+}
+
+// Returns true if fn is a native function. (Note: SpiderMonkey specific.)
+function isNativeCode(fn) {
+ // Relies on the toString method to identify native code.
+ return ((typeof fn) === "function") && fn.toString().match(/\[native code\]/);
+}
+
+var Fpapply = Function.prototype.apply;
+
+function apply(f, o, a) {
+ return Fpapply.call(f, [o].concat(a));
+}
+
+var applyNew;
+
+// ES5's bind is a simpler way to implement applyNew
+if (Function.prototype.bind) {
+ applyNew = function applyNew(f, a) {
+ return new (f.bind.apply(f, [,].concat(Array.prototype.slice.call(a))))();
+ };
+} else {
+ applyNew = function applyNew(f, a) {
+ switch (a.length) {
+ case 0:
+ return new f();
+ case 1:
+ return new f(a[0]);
+ case 2:
+ return new f(a[0], a[1]);
+ case 3:
+ return new f(a[0], a[1], a[2]);
+ default:
+ var argStr = "a[0]";
+ for (var i = 1, n = a.length; i < n; i++)
+ argStr += ",a[" + i + "]";
+ return eval("new f(" + argStr + ")");
+ }
+ };
+}
+
+function getPropertyDescriptor(obj, name) {
+ while (obj) {
+ if (({}).hasOwnProperty.call(obj, name))
+ return Object.getOwnPropertyDescriptor(obj, name);
+ obj = Object.getPrototypeOf(obj);
+ }
+}
+
+function getPropertyNames(obj) {
+ var table = Object.create(null, {});
+ while (obj) {
+ var names = Object.getOwnPropertyNames(obj);
+ for (var i = 0, n = names.length; i < n; i++)
+ table[names[i]] = true;
+ obj = Object.getPrototypeOf(obj);
+ }
+ return Object.keys(table);
+}
+
+function getOwnProperties(obj) {
+ var map = {};
+ for (var name in Object.getOwnPropertyNames(obj))
+ map[name] = Object.getOwnPropertyDescriptor(obj, name);
+ return map;
+}
+
+function blacklistHandler(target, blacklist) {
+ var mask = Object.create(null, {});
+ var redirect = Dict.create(blacklist).mapObject(function(name) { return mask; });
+ return mixinHandler(redirect, target);
+}
+
+function whitelistHandler(target, whitelist) {
+ var catchall = Object.create(null, {});
+ var redirect = Dict.create(whitelist).mapObject(function(name) { return target; });
+ return mixinHandler(redirect, catchall);
+}
+
+/*
+ * Mixin proxies break the single-inheritance model of prototypes, so
+ * the handler treats all properties as own-properties:
+ *
+ * X
+ * |
+ * +------------+------------+
+ * | O |
+ * | | |
+ * | O O O |
+ * | | | | |
+ * | O O O O |
+ * | | | | | |
+ * | O O O O O |
+ * | | | | | | |
+ * +-(*)--(w)--(x)--(y)--(z)-+
+ */
+
+function mixinHandler(redirect, catchall) {
+ function targetFor(name) {
+ return hasOwn(redirect, name) ? redirect[name] : catchall;
+ }
+
+ function getMuxPropertyDescriptor(name) {
+ var desc = getPropertyDescriptor(targetFor(name), name);
+ if (desc)
+ desc.configurable = true;
+ return desc;
+ }
+
+ function getMuxPropertyNames() {
+ var names1 = Object.getOwnPropertyNames(redirect).filter(function(name) {
+ return name in redirect[name];
+ });
+ var names2 = getPropertyNames(catchall).filter(function(name) {
+ return !hasOwn(redirect, name);
+ });
+ return names1.concat(names2);
+ }
+
+ function enumerateMux() {
+ var result = Object.getOwnPropertyNames(redirect).filter(function(name) {
+ return name in redirect[name];
+ });
+ for (name in catchall) {
+ if (!hasOwn(redirect, name))
+ result.push(name);
+ };
+ return result;
+ }
+
+ function hasMux(name) {
+ return name in targetFor(name);
+ }
+
+ return {
+ getOwnPropertyDescriptor: getMuxPropertyDescriptor,
+ getPropertyDescriptor: getMuxPropertyDescriptor,
+ getOwnPropertyNames: getMuxPropertyNames,
+ defineProperty: function(name, desc) {
+ Object.defineProperty(targetFor(name), name, desc);
+ },
+ "delete": function(name) {
+ var target = targetFor(name);
+ return delete target[name];
+ },
+ // FIXME: ha ha ha
+ fix: function() { },
+ has: hasMux,
+ hasOwn: hasMux,
+ get: function(receiver, name) {
+ var target = targetFor(name);
+ return target[name];
+ },
+ set: function(receiver, name, val) {
+ var target = targetFor(name);
+ target[name] = val;
+ return true;
+ },
+ enumerate: enumerateMux,
+ keys: enumerateMux
+ };
+}
+
+function makePassthruHandler(obj) {
+ // Handler copied from
+ // http://wiki.ecmascript.org/doku.php?id=harmony:proxies&s=proxy%20object#examplea_no-op_forwarding_proxy
+ return {
+ getOwnPropertyDescriptor: function(name) {
+ var desc = Object.getOwnPropertyDescriptor(obj, name);
+
+ // a trapping proxy's properties must always be configurable
+ desc.configurable = true;
+ return desc;
+ },
+ getPropertyDescriptor: function(name) {
+ var desc = getPropertyDescriptor(obj, name);
+
+ // a trapping proxy's properties must always be configurable
+ desc.configurable = true;
+ return desc;
+ },
+ getOwnPropertyNames: function() {
+ return Object.getOwnPropertyNames(obj);
+ },
+ defineProperty: function(name, desc) {
+ Object.defineProperty(obj, name, desc);
+ },
+ "delete": function(name) { return delete obj[name]; },
+ fix: function() {
+ if (Object.isFrozen(obj)) {
+ return getOwnProperties(obj);
+ }
+
+ // As long as obj is not frozen, the proxy won't allow itself to be fixed.
+ return undefined; // will cause a TypeError to be thrown
+ },
+
+ has: function(name) { return name in obj; },
+ hasOwn: function(name) { return ({}).hasOwnProperty.call(obj, name); },
+ get: function(receiver, name) { return obj[name]; },
+
+ // bad behavior when set fails in non-strict mode
+ set: function(receiver, name, val) { obj[name] = val; return true; },
+ enumerate: function() {
+ var result = [];
+ for (name in obj) { result.push(name); };
+ return result;
+ },
+ keys: function() { return Object.keys(obj); }
+ };
+}
+
+var hasOwnProperty = ({}).hasOwnProperty;
+
+function hasOwn(obj, name) {
+ return hasOwnProperty.call(obj, name);
+}
+
+function Dict(table, size) {
+ this.table = table || Object.create(null, {});
+ this.size = size || 0;
+}
+
+Dict.create = function(table) {
+ var init = Object.create(null, {});
+ var size = 0;
+ var names = Object.getOwnPropertyNames(table);
+ for (var i = 0, n = names.length; i < n; i++) {
+ var name = names[i];
+ init[name] = table[name];
+ size++;
+ }
+ return new Dict(init, size);
+};
+
+Dict.prototype = {
+ has: function(x) { return hasOwnProperty.call(this.table, x); },
+ set: function(x, v) {
+ if (!hasOwnProperty.call(this.table, x))
+ this.size++;
+ this.table[x] = v;
+ },
+ get: function(x) { return this.table[x]; },
+ getDef: function(x, thunk) {
+ if (!hasOwnProperty.call(this.table, x)) {
+ this.size++;
+ this.table[x] = thunk();
+ }
+ return this.table[x];
+ },
+ forEach: function(f) {
+ var table = this.table;
+ for (var key in table)
+ f.call(this, key, table[key]);
+ },
+ map: function(f) {
+ var table1 = this.table;
+ var table2 = Object.create(null, {});
+ this.forEach(function(key, val) {
+ table2[key] = f.call(this, val, key);
+ });
+ return new Dict(table2, this.size);
+ },
+ mapObject: function(f) {
+ var table1 = this.table;
+ var table2 = Object.create(null, {});
+ this.forEach(function(key, val) {
+ table2[key] = f.call(this, val, key);
+ });
+ return table2;
+ },
+ toObject: function() {
+ return this.mapObject(function(val) { return val; });
+ },
+ choose: function() {
+ return Object.getOwnPropertyNames(this.table)[0];
+ },
+ remove: function(x) {
+ if (hasOwnProperty.call(this.table, x)) {
+ this.size--;
+ delete this.table[x];
+ }
+ },
+ copy: function() {
+ var table = Object.create(null, {});
+ for (var key in this.table)
+ table[key] = this.table[key];
+ return new Dict(table, this.size);
+ },
+ keys: function() {
+ return Object.keys(this.table);
+ },
+ toString: function() { return "[object Dict]" }
+};
+
+var _WeakMap = typeof WeakMap === "function" ? WeakMap : (function() {
+ // shim for ES6 WeakMap with poor asymptotics
+ function WeakMap(array) {
+ this.array = array || [];
+ }
+
+ function searchMap(map, key, found, notFound) {
+ var a = map.array;
+ for (var i = 0, n = a.length; i < n; i++) {
+ var pair = a[i];
+ if (pair.key === key)
+ return found(pair, i);
+ }
+ return notFound();
+ }
+
+ WeakMap.prototype = {
+ has: function(x) {
+ return searchMap(this, x, function() { return true }, function() { return false });
+ },
+ set: function(x, v) {
+ var a = this.array;
+ searchMap(this, x,
+ function(pair) { pair.value = v },
+ function() { a.push({ key: x, value: v }) });
+ },
+ get: function(x) {
+ return searchMap(this, x,
+ function(pair) { return pair.value },
+ function() { return null });
+ },
+ "delete": function(x) {
+ var a = this.array;
+ searchMap(this, x,
+ function(pair, i) { a.splice(i, 1) },
+ function() { });
+ },
+ toString: function() { return "[object WeakMap]" }
+ };
+
+ return WeakMap;
+})();
+
+// non-destructive stack
+function Stack(elts) {
+ this.elts = elts || null;
+}
+
+Stack.prototype = {
+ push: function(x) {
+ return new Stack({ top: x, rest: this.elts });
+ },
+ top: function() {
+ if (!this.elts)
+ throw new Error("empty stack");
+ return this.elts.top;
+ },
+ isEmpty: function() {
+ return this.top === null;
+ },
+ find: function(test) {
+ for (var elts = this.elts; elts; elts = elts.rest) {
+ if (test(elts.top))
+ return elts.top;
+ }
+ return null;
+ },
+ has: function(x) {
+ return Boolean(this.find(function(elt) { return elt === x }));
+ },
+ forEach: function(f) {
+ for (var elts = this.elts; elts; elts = elts.rest) {
+ f(elts.top);
+ }
+ }
+};
+
+if (!Array.prototype.copy) {
+ defineProperty(Array.prototype, "copy",
+ function() {
+ var result = [];
+ for (var i = 0, n = this.length; i < n; i++)
+ result[i] = this[i];
+ return result;
+ }, false, false, true);
+}
+
+if (!Array.prototype.top) {
+ defineProperty(Array.prototype, "top",
+ function() {
+ return this.length && this[this.length-1];
+ }, false, false, true);
+}
+
+exports.tokens = tokens;
+exports.whitespace = whitespace;
+exports.opTypeNames = opTypeNames;
+exports.keywords = keywords;
+exports.mozillaKeywords = mozillaKeywords;
+exports.strictKeywords = strictKeywords;
+exports.isStatementStartCode = isStatementStartCode;
+exports.tokenIds = tokenIds;
+exports.consts = consts;
+exports.assignOps = assignOps;
+exports.defineGetter = defineGetter;
+exports.defineGetterSetter = defineGetterSetter;
+exports.defineMemoGetter = defineMemoGetter;
+exports.defineProperty = defineProperty;
+exports.isNativeCode = isNativeCode;
+exports.apply = apply;
+exports.applyNew = applyNew;
+exports.mixinHandler = mixinHandler;
+exports.whitelistHandler = whitelistHandler;
+exports.blacklistHandler = blacklistHandler;
+exports.makePassthruHandler = makePassthruHandler;
+exports.Dict = Dict;
+exports.WeakMap = _WeakMap;
+exports.Stack = Stack;
+
+});
+
+define('ace/narcissus/options', ['require', 'exports', 'module' ], function(require, exports, module) {
+
+// Global variables to hide from the interpreter
+exports.hiddenHostGlobals = { Narcissus: true };
+
+// Desugar SpiderMonkey language extensions?
+exports.desugarExtensions = false;
+
+// Allow HTML comments?
+exports.allowHTMLComments = false;
+
+// Allow non-standard Mozilla extensions?
+exports.mozillaMode = true;
+
+// Allow experimental paren-free mode?
+exports.parenFreeMode = false;
+
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/worker-json.js b/vendor/assets/javascripts/ace-src-noconflict/worker-json.js
new file mode 100644
index 00000000000..8a619ff1474
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/worker-json.js
@@ -0,0 +1,2946 @@
+"no use strict";
+
+var console = {
+ log: function(msgs) {
+ postMessage({type: "log", data: arguments.join(" ")});
+ }
+};
+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("/");
+ var moduleName = base + "/" + moduleName;
+
+ while(moduleName.indexOf(".") !== -1 && previous != moduleName) {
+ var previous = moduleName;
+ var 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");
+
+ var 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) {
+ main[msg.command].apply(main, msg.args);
+ }
+ 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:
+// -- kriskowal Kris Kowal Copyright (C) 2009-2010 MIT License
+// -- tlrobinson Tom Robinson Copyright (C) 2009-2010 MIT License (Narwhal Project)
+// -- dantman Daniel Friesen Copyright(C) 2010 XXX No License Specified
+// -- fschaefer Florian Schäfer Copyright (C) 2010 MIT License
+// -- Irakli Gozalishvili Copyright (C) 2010 MIT License
+
+/*!
+ Copyright (c) 2009, 280 North Inc. http://280north.com/
+ MIT License. http://github.com/280north/narwhal/blob/master/README.md
+*/
+
+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) {
+
+
+ //---------------------------------
+ // Private variables
+ //---------------------------------
+
+ 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;
+
+ //---------------------------------
+ // Overriden native methods
+ //---------------------------------
+
+ // Adds named capture support (with backreferences returned as `result.name`), and fixes two
+ // cross-browser issues per ES3:
+ // - Captured values for nonparticipating capturing groups should be returned as `undefined`,
+ // rather than the empty string.
+ // - `lastIndex` should not be incremented after zero-length matches.
+ RegExp.prototype.exec = function (str) {
+ var match = real.exec.apply(this, arguments),
+ name, r2;
+ if ( typeof(str) == 'string' && match) {
+ // Fix browsers whose `exec` methods don't consistently return `undefined` for
+ // nonparticipating capturing groups
+ if (!compliantExecNpcg && match.length > 1 && indexOf(match, "") > -1) {
+ r2 = RegExp(this.source, real.replace.call(getNativeFlags(this), "g", ""));
+ // Using `str.slice(match.index)` rather than `match[0]` in case lookahead allowed
+ // matching due to characters outside the match
+ 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;
+ }
+ });
+ }
+ // Attach named capture properties
+ 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];
+ }
+ }
+ // Fix browsers that increment `lastIndex` after zero-length matches
+ if (!compliantLastIndexIncrement && this.global && !match[0].length && (this.lastIndex > match.index))
+ this.lastIndex--;
+ }
+ return match;
+ };
+
+ // Don't override `test` if it won't change anything
+ if (!compliantLastIndexIncrement) {
+ // Fix browser bug in native method
+ RegExp.prototype.test = function (str) {
+ // Use the native `exec` to skip some processing overhead, even though the overriden
+ // `exec` would take care of the `lastIndex` fix
+ var match = real.exec.call(this, str);
+ // Fix browsers that increment `lastIndex` after zero-length matches
+ if (match && this.global && !match[0].length && (this.lastIndex > match.index))
+ this.lastIndex--;
+ return !!match;
+ };
+ }
+
+ //---------------------------------
+ // Private helper functions
+ //---------------------------------
+
+ 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;
+ }
+
+});
+// vim: ts=4 sts=4 sw=4 expandtab
+// -- kriskowal Kris Kowal Copyright (C) 2009-2011 MIT License
+// -- tlrobinson Tom Robinson Copyright (C) 2009-2010 MIT License (Narwhal Project)
+// -- dantman Daniel Friesen Copyright (C) 2010 XXX TODO License or CLA
+// -- fschaefer Florian Schäfer Copyright (C) 2010 MIT License
+// -- Gozala Irakli Gozalishvili Copyright (C) 2010 MIT License
+// -- kitcambridge Kit Cambridge Copyright (C) 2011 MIT License
+// -- kossnocorp Sasha Koss XXX TODO License or CLA
+// -- bryanforbes Bryan Forbes XXX TODO License or CLA
+// -- killdream Quildreen Motta Copyright (C) 2011 MIT Licence
+// -- michaelficarra Michael Ficarra Copyright (C) 2011 3-clause BSD License
+// -- sharkbrainguy Gerard Paapu Copyright (C) 2011 MIT License
+// -- bbqsrc Brendan Molloy (C) 2011 Creative Commons Zero (public domain)
+// -- iwyg XXX TODO License or CLA
+// -- DomenicDenicola Domenic Denicola Copyright (C) 2011 MIT License
+// -- xavierm02 Montillet Xavier XXX TODO License or CLA
+// -- Raynos Raynos XXX TODO License or CLA
+// -- samsonjs Sami Samhuri Copyright (C) 2010 MIT License
+// -- rwldrn Rick Waldron Copyright (C) 2011 MIT License
+// -- lexer Alexey Zakharov XXX TODO License or CLA
+
+/*!
+ Copyright (c) 2009, 280 North Inc. http://280north.com/
+ MIT License. http://github.com/280north/narwhal/blob/master/README.md
+*/
+
+define('ace/lib/es5-shim', ['require', 'exports', 'module' ], function(require, exports, module) {
+
+/*
+ * Brings an environment as close to ECMAScript 5 compliance
+ * as is possible with the facilities of erstwhile engines.
+ *
+ * Annotated ES5: http://es5.github.com/ (specific links below)
+ * ES5 Spec: http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf
+ *
+ * @module
+ */
+
+/*whatsupdoc*/
+
+//
+// Function
+// ========
+//
+
+// ES-5 15.3.4.5
+// http://es5.github.com/#x15.3.4.5
+
+if (!Function.prototype.bind) {
+ Function.prototype.bind = function bind(that) { // .length is 1
+ // 1. Let Target be the this value.
+ var target = this;
+ // 2. If IsCallable(Target) is false, throw a TypeError exception.
+ if (typeof target != "function")
+ throw new TypeError(); // TODO message
+ // 3. Let A be a new (possibly empty) internal list of all of the
+ // argument values provided after thisArg (arg1, arg2 etc), in order.
+ // XXX slicedArgs will stand in for "A" if used
+ var args = slice.call(arguments, 1); // for normal call
+ // 4. Let F be a new native ECMAScript object.
+ // 11. Set the [[Prototype]] internal property of F to the standard
+ // built-in Function prototype object as specified in 15.3.3.1.
+ // 12. Set the [[Call]] internal property of F as described in
+ // 15.3.4.5.1.
+ // 13. Set the [[Construct]] internal property of F as described in
+ // 15.3.4.5.2.
+ // 14. Set the [[HasInstance]] internal property of F as described in
+ // 15.3.4.5.3.
+ var bound = function () {
+
+ if (this instanceof bound) {
+ // 15.3.4.5.2 [[Construct]]
+ // When the [[Construct]] internal method of a function object,
+ // F that was created using the bind function is called with a
+ // list of arguments ExtraArgs, the following steps are taken:
+ // 1. Let target be the value of F's [[TargetFunction]]
+ // internal property.
+ // 2. If target has no [[Construct]] internal method, a
+ // TypeError exception is thrown.
+ // 3. Let boundArgs be the value of F's [[BoundArgs]] internal
+ // property.
+ // 4. Let args be a new list containing the same values as the
+ // list boundArgs in the same order followed by the same
+ // values as the list ExtraArgs in the same order.
+ // 5. Return the result of calling the [[Construct]] internal
+ // method of target providing args as the arguments.
+
+ var F = function(){};
+ F.prototype = target.prototype;
+ var self = new F;
+
+ var result = target.apply(
+ self,
+ args.concat(slice.call(arguments))
+ );
+ if (result !== null && Object(result) === result)
+ return result;
+ return self;
+
+ } else {
+ // 15.3.4.5.1 [[Call]]
+ // When the [[Call]] internal method of a function object, F,
+ // which was created using the bind function is called with a
+ // this value and a list of arguments ExtraArgs, the following
+ // steps are taken:
+ // 1. Let boundArgs be the value of F's [[BoundArgs]] internal
+ // property.
+ // 2. Let boundThis be the value of F's [[BoundThis]] internal
+ // property.
+ // 3. Let target be the value of F's [[TargetFunction]] internal
+ // property.
+ // 4. Let args be a new list containing the same values as the
+ // list boundArgs in the same order followed by the same
+ // values as the list ExtraArgs in the same order.
+ // 5. Return the result of calling the [[Call]] internal method
+ // of target providing boundThis as the this value and
+ // providing args as the arguments.
+
+ // equiv: target.call(this, ...boundArgs, ...args)
+ return target.apply(
+ that,
+ args.concat(slice.call(arguments))
+ );
+
+ }
+
+ };
+ // XXX bound.length is never writable, so don't even try
+ //
+ // 15. If the [[Class]] internal property of Target is "Function", then
+ // a. Let L be the length property of Target minus the length of A.
+ // b. Set the length own property of F to either 0 or L, whichever is
+ // larger.
+ // 16. Else set the length own property of F to 0.
+ // 17. Set the attributes of the length own property of F to the values
+ // specified in 15.3.5.1.
+
+ // TODO
+ // 18. Set the [[Extensible]] internal property of F to true.
+
+ // TODO
+ // 19. Let thrower be the [[ThrowTypeError]] function Object (13.2.3).
+ // 20. Call the [[DefineOwnProperty]] internal method of F with
+ // arguments "caller", PropertyDescriptor {[[Get]]: thrower, [[Set]]:
+ // thrower, [[Enumerable]]: false, [[Configurable]]: false}, and
+ // false.
+ // 21. Call the [[DefineOwnProperty]] internal method of F with
+ // arguments "arguments", PropertyDescriptor {[[Get]]: thrower,
+ // [[Set]]: thrower, [[Enumerable]]: false, [[Configurable]]: false},
+ // and false.
+
+ // TODO
+ // NOTE Function objects created using Function.prototype.bind do not
+ // have a prototype property or the [[Code]], [[FormalParameters]], and
+ // [[Scope]] internal properties.
+ // XXX can't delete prototype in pure-js.
+
+ // 22. Return F.
+ return bound;
+ };
+}
+
+// Shortcut to an often accessed properties, in order to avoid multiple
+// dereference that costs universally.
+// _Please note: Shortcuts are defined after `Function.prototype.bind` as we
+// us it in defining shortcuts.
+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);
+
+// If JS engine supports accessors creating shortcuts.
+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__);
+}
+
+//
+// Array
+// =====
+//
+
+// ES5 15.4.3.2
+// http://es5.github.com/#x15.4.3.2
+// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/isArray
+if (!Array.isArray) {
+ Array.isArray = function isArray(obj) {
+ return toString(obj) == "[object Array]";
+ };
+}
+
+// The IsCallable() check in the Array functions
+// has been replaced with a strict check on the
+// internal class of the object to trap cases where
+// the provided function was actually a regular
+// expression literal, which in V8 and
+// JavaScriptCore is a typeof "function". Only in
+// V8 are regular expression literals permitted as
+// reduce parameters, so it is desirable in the
+// general case for the shim to match the more
+// strict and common behavior of rejecting regular
+// expressions.
+
+// ES5 15.4.4.18
+// http://es5.github.com/#x15.4.4.18
+// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/array/forEach
+if (!Array.prototype.forEach) {
+ Array.prototype.forEach = function forEach(fun /*, thisp*/) {
+ var self = toObject(this),
+ thisp = arguments[1],
+ i = 0,
+ length = self.length >>> 0;
+
+ // If no callback function or if callback is not a callable function
+ if (toString(fun) != "[object Function]") {
+ throw new TypeError(); // TODO message
+ }
+
+ while (i < length) {
+ if (i in self) {
+ // Invoke the callback function with call, passing arguments:
+ // context, property value, property key, thisArg object context
+ fun.call(thisp, self[i], i, self);
+ }
+ i++;
+ }
+ };
+}
+
+// ES5 15.4.4.19
+// http://es5.github.com/#x15.4.4.19
+// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/map
+if (!Array.prototype.map) {
+ Array.prototype.map = function map(fun /*, thisp*/) {
+ var self = toObject(this),
+ length = self.length >>> 0,
+ result = Array(length),
+ thisp = arguments[1];
+
+ // If no callback function or if callback is not a callable function
+ if (toString(fun) != "[object Function]") {
+ throw new TypeError(); // TODO message
+ }
+
+ for (var i = 0; i < length; i++) {
+ if (i in self)
+ result[i] = fun.call(thisp, self[i], i, self);
+ }
+ return result;
+ };
+}
+
+// ES5 15.4.4.20
+// http://es5.github.com/#x15.4.4.20
+// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/filter
+if (!Array.prototype.filter) {
+ Array.prototype.filter = function filter(fun /*, thisp */) {
+ var self = toObject(this),
+ length = self.length >>> 0,
+ result = [],
+ thisp = arguments[1];
+
+ // If no callback function or if callback is not a callable function
+ if (toString(fun) != "[object Function]") {
+ throw new TypeError(); // TODO message
+ }
+
+ for (var i = 0; i < length; i++) {
+ if (i in self && fun.call(thisp, self[i], i, self))
+ result.push(self[i]);
+ }
+ return result;
+ };
+}
+
+// ES5 15.4.4.16
+// http://es5.github.com/#x15.4.4.16
+// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/every
+if (!Array.prototype.every) {
+ Array.prototype.every = function every(fun /*, thisp */) {
+ var self = toObject(this),
+ length = self.length >>> 0,
+ thisp = arguments[1];
+
+ // If no callback function or if callback is not a callable function
+ if (toString(fun) != "[object Function]") {
+ throw new TypeError(); // TODO message
+ }
+
+ for (var i = 0; i < length; i++) {
+ if (i in self && !fun.call(thisp, self[i], i, self))
+ return false;
+ }
+ return true;
+ };
+}
+
+// ES5 15.4.4.17
+// http://es5.github.com/#x15.4.4.17
+// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/some
+if (!Array.prototype.some) {
+ Array.prototype.some = function some(fun /*, thisp */) {
+ var self = toObject(this),
+ length = self.length >>> 0,
+ thisp = arguments[1];
+
+ // If no callback function or if callback is not a callable function
+ if (toString(fun) != "[object Function]") {
+ throw new TypeError(); // TODO message
+ }
+
+ for (var i = 0; i < length; i++) {
+ if (i in self && fun.call(thisp, self[i], i, self))
+ return true;
+ }
+ return false;
+ };
+}
+
+// ES5 15.4.4.21
+// http://es5.github.com/#x15.4.4.21
+// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/reduce
+if (!Array.prototype.reduce) {
+ Array.prototype.reduce = function reduce(fun /*, initial*/) {
+ var self = toObject(this),
+ length = self.length >>> 0;
+
+ // If no callback function or if callback is not a callable function
+ if (toString(fun) != "[object Function]") {
+ throw new TypeError(); // TODO message
+ }
+
+ // no value to return if no initial value and an empty array
+ if (!length && arguments.length == 1)
+ throw new TypeError(); // TODO message
+
+ var i = 0;
+ var result;
+ if (arguments.length >= 2) {
+ result = arguments[1];
+ } else {
+ do {
+ if (i in self) {
+ result = self[i++];
+ break;
+ }
+
+ // if array contains no values, no initial value to return
+ if (++i >= length)
+ throw new TypeError(); // TODO message
+ } while (true);
+ }
+
+ for (; i < length; i++) {
+ if (i in self)
+ result = fun.call(void 0, result, self[i], i, self);
+ }
+
+ return result;
+ };
+}
+
+// ES5 15.4.4.22
+// http://es5.github.com/#x15.4.4.22
+// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/reduceRight
+if (!Array.prototype.reduceRight) {
+ Array.prototype.reduceRight = function reduceRight(fun /*, initial*/) {
+ var self = toObject(this),
+ length = self.length >>> 0;
+
+ // If no callback function or if callback is not a callable function
+ if (toString(fun) != "[object Function]") {
+ throw new TypeError(); // TODO message
+ }
+
+ // no value to return if no initial value, empty array
+ if (!length && arguments.length == 1)
+ throw new TypeError(); // TODO message
+
+ var result, i = length - 1;
+ if (arguments.length >= 2) {
+ result = arguments[1];
+ } else {
+ do {
+ if (i in self) {
+ result = self[i--];
+ break;
+ }
+
+ // if array contains no values, no initial value to return
+ if (--i < 0)
+ throw new TypeError(); // TODO message
+ } while (true);
+ }
+
+ do {
+ if (i in this)
+ result = fun.call(void 0, result, self[i], i, self);
+ } while (i--);
+
+ return result;
+ };
+}
+
+// ES5 15.4.4.14
+// http://es5.github.com/#x15.4.4.14
+// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/indexOf
+if (!Array.prototype.indexOf) {
+ Array.prototype.indexOf = function indexOf(sought /*, fromIndex */ ) {
+ var self = toObject(this),
+ length = self.length >>> 0;
+
+ if (!length)
+ return -1;
+
+ var i = 0;
+ if (arguments.length > 1)
+ i = toInteger(arguments[1]);
+
+ // handle negative indices
+ i = i >= 0 ? i : Math.max(0, length + i);
+ for (; i < length; i++) {
+ if (i in self && self[i] === sought) {
+ return i;
+ }
+ }
+ return -1;
+ };
+}
+
+// ES5 15.4.4.15
+// http://es5.github.com/#x15.4.4.15
+// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/lastIndexOf
+if (!Array.prototype.lastIndexOf) {
+ Array.prototype.lastIndexOf = function lastIndexOf(sought /*, fromIndex */) {
+ var self = 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]));
+ // handle negative indices
+ i = i >= 0 ? i : length - Math.abs(i);
+ for (; i >= 0; i--) {
+ if (i in self && sought === self[i])
+ return i;
+ }
+ return -1;
+ };
+}
+
+//
+// Object
+// ======
+//
+
+// ES5 15.2.3.2
+// http://es5.github.com/#x15.2.3.2
+if (!Object.getPrototypeOf) {
+ // https://github.com/kriskowal/es5-shim/issues#issue/2
+ // http://ejohn.org/blog/objectgetprototypeof/
+ // recommended by fschaefer on github
+ Object.getPrototypeOf = function getPrototypeOf(object) {
+ return object.__proto__ || (
+ object.constructor ?
+ object.constructor.prototype :
+ prototypeOfObject
+ );
+ };
+}
+
+// ES5 15.2.3.3
+// http://es5.github.com/#x15.2.3.3
+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 object does not owns property return undefined immediately.
+ if (!owns(object, property))
+ return;
+
+ var descriptor, getter, setter;
+
+ // If object has a property then it's for sure both `enumerable` and
+ // `configurable`.
+ descriptor = { enumerable: true, configurable: true };
+
+ // If JS engine supports accessor properties then property may be a
+ // getter or setter.
+ if (supportsAccessors) {
+ // Unfortunately `__lookupGetter__` will return a getter even
+ // if object has own non getter property along with a same named
+ // inherited getter. To avoid misbehavior we temporary remove
+ // `__proto__` so that `__lookupGetter__` will return getter only
+ // if it's owned by an object.
+ var prototype = object.__proto__;
+ object.__proto__ = prototypeOfObject;
+
+ var getter = lookupGetter(object, property);
+ var setter = lookupSetter(object, property);
+
+ // Once we have getter and setter we can put values back.
+ object.__proto__ = prototype;
+
+ if (getter || setter) {
+ if (getter) descriptor.get = getter;
+ if (setter) descriptor.set = setter;
+
+ // If it was accessor property we're done and return here
+ // in order to avoid adding `value` to the descriptor.
+ return descriptor;
+ }
+ }
+
+ // If we got this far we know that object has an own property that is
+ // not an accessor so we set it as a value and return descriptor.
+ descriptor.value = object[property];
+ return descriptor;
+ };
+}
+
+// ES5 15.2.3.4
+// http://es5.github.com/#x15.2.3.4
+if (!Object.getOwnPropertyNames) {
+ Object.getOwnPropertyNames = function getOwnPropertyNames(object) {
+ return Object.keys(object);
+ };
+}
+
+// ES5 15.2.3.5
+// http://es5.github.com/#x15.2.3.5
+if (!Object.create) {
+ Object.create = function create(prototype, properties) {
+ var object;
+ if (prototype === null) {
+ object = { "__proto__": null };
+ } else {
+ if (typeof prototype != "object")
+ throw new TypeError("typeof prototype["+(typeof prototype)+"] != 'object'");
+ var Type = function () {};
+ Type.prototype = prototype;
+ object = new Type();
+ // IE has no built-in implementation of `Object.getPrototypeOf`
+ // neither `__proto__`, but this manually setting `__proto__` will
+ // guarantee that `Object.getPrototypeOf` will work as expected with
+ // objects created using `Object.create`
+ object.__proto__ = prototype;
+ }
+ if (properties !== void 0)
+ Object.defineProperties(object, properties);
+ return object;
+ };
+}
+
+// ES5 15.2.3.6
+// http://es5.github.com/#x15.2.3.6
+
+// Patch for WebKit and IE8 standard mode
+// Designed by hax <hax.github.com>
+// related issue: https://github.com/kriskowal/es5-shim/issues#issue/5
+// IE8 Reference:
+// http://msdn.microsoft.com/en-us/library/dd282900.aspx
+// http://msdn.microsoft.com/en-us/library/dd229916.aspx
+// WebKit Bugs:
+// https://bugs.webkit.org/show_bug.cgi?id=36423
+
+function doesDefinePropertyWork(object) {
+ try {
+ Object.defineProperty(object, "sentinel", {});
+ return "sentinel" in object;
+ } catch (exception) {
+ // returns falsy
+ }
+}
+
+// check whether defineProperty works if it's given. Otherwise,
+// shim partially.
+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);
+
+ // make a valiant attempt to use the real defineProperty
+ // for I8's DOM elements.
+ if (definePropertyFallback) {
+ try {
+ return definePropertyFallback.call(Object, object, property, descriptor);
+ } catch (exception) {
+ // try the shim if the real one doesn't work
+ }
+ }
+
+ // If it's a data property.
+ if (owns(descriptor, "value")) {
+ // fail silently if "writable", "enumerable", or "configurable"
+ // are requested but not supported
+ /*
+ // alternate approach:
+ if ( // can't implement these features; allow false but not true
+ !(owns(descriptor, "writable") ? descriptor.writable : true) ||
+ !(owns(descriptor, "enumerable") ? descriptor.enumerable : true) ||
+ !(owns(descriptor, "configurable") ? descriptor.configurable : true)
+ )
+ throw new RangeError(
+ "This implementation of Object.defineProperty does not " +
+ "support configurable, enumerable, or writable."
+ );
+ */
+
+ if (supportsAccessors && (lookupGetter(object, property) ||
+ lookupSetter(object, property)))
+ {
+ // As accessors are supported only on engines implementing
+ // `__proto__` we can safely override `__proto__` while defining
+ // a property to make sure that we don't hit an inherited
+ // accessor.
+ var prototype = object.__proto__;
+ object.__proto__ = prototypeOfObject;
+ // Deleting a property anyway since getter / setter may be
+ // defined on object itself.
+ delete object[property];
+ object[property] = descriptor.value;
+ // Setting original `__proto__` back now.
+ object.__proto__ = prototype;
+ } else {
+ object[property] = descriptor.value;
+ }
+ } else {
+ if (!supportsAccessors)
+ throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED);
+ // If we got that far then getters and setters can be defined !!
+ if (owns(descriptor, "get"))
+ defineGetter(object, property, descriptor.get);
+ if (owns(descriptor, "set"))
+ defineSetter(object, property, descriptor.set);
+ }
+
+ return object;
+ };
+}
+
+// ES5 15.2.3.7
+// http://es5.github.com/#x15.2.3.7
+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;
+ };
+}
+
+// ES5 15.2.3.8
+// http://es5.github.com/#x15.2.3.8
+if (!Object.seal) {
+ Object.seal = function seal(object) {
+ // this is misleading and breaks feature-detection, but
+ // allows "securable" code to "gracefully" degrade to working
+ // but insecure code.
+ return object;
+ };
+}
+
+// ES5 15.2.3.9
+// http://es5.github.com/#x15.2.3.9
+if (!Object.freeze) {
+ Object.freeze = function freeze(object) {
+ // this is misleading and breaks feature-detection, but
+ // allows "securable" code to "gracefully" degrade to working
+ // but insecure code.
+ return object;
+ };
+}
+
+// detect a Rhino bug and patch it
+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);
+}
+
+// ES5 15.2.3.10
+// http://es5.github.com/#x15.2.3.10
+if (!Object.preventExtensions) {
+ Object.preventExtensions = function preventExtensions(object) {
+ // this is misleading and breaks feature-detection, but
+ // allows "securable" code to "gracefully" degrade to working
+ // but insecure code.
+ return object;
+ };
+}
+
+// ES5 15.2.3.11
+// http://es5.github.com/#x15.2.3.11
+if (!Object.isSealed) {
+ Object.isSealed = function isSealed(object) {
+ return false;
+ };
+}
+
+// ES5 15.2.3.12
+// http://es5.github.com/#x15.2.3.12
+if (!Object.isFrozen) {
+ Object.isFrozen = function isFrozen(object) {
+ return false;
+ };
+}
+
+// ES5 15.2.3.13
+// http://es5.github.com/#x15.2.3.13
+if (!Object.isExtensible) {
+ Object.isExtensible = function isExtensible(object) {
+ // 1. If Type(O) is not Object throw a TypeError exception.
+ if (Object(object) === object) {
+ throw new TypeError(); // TODO message
+ }
+ // 2. Return the Boolean value of the [[Extensible]] internal property of O.
+ var name = '';
+ while (owns(object, name)) {
+ name += '?';
+ }
+ object[name] = true;
+ var returnValue = owns(object, name);
+ delete object[name];
+ return returnValue;
+ };
+}
+
+// ES5 15.2.3.14
+// http://es5.github.com/#x15.2.3.14
+if (!Object.keys) {
+ // http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation
+ 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;
+ };
+
+}
+
+//
+// Date
+// ====
+//
+
+// ES5 15.9.5.43
+// http://es5.github.com/#x15.9.5.43
+// This function returns a String value represent the instance in time
+// represented by this Date object. The format of the String is the Date Time
+// string format defined in 15.9.1.15. All fields are present in the String.
+// The time zone is always UTC, denoted by the suffix Z. If the time value of
+// this object is not a finite Number a RangeError exception is thrown.
+if (!Date.prototype.toISOString || (new Date(-62198755200000).toISOString().indexOf('-000001') === -1)) {
+ Date.prototype.toISOString = function toISOString() {
+ var result, length, value, year;
+ if (!isFinite(this))
+ throw new RangeError;
+
+ // the date time string format is specified in 15.9.1.15.
+ result = [this.getUTCMonth() + 1, this.getUTCDate(),
+ this.getUTCHours(), this.getUTCMinutes(), this.getUTCSeconds()];
+ year = this.getUTCFullYear();
+ year = (year < 0 ? '-' : (year > 9999 ? '+' : '')) + ('00000' + Math.abs(year)).slice(0 <= year && year <= 9999 ? -4 : -6);
+
+ length = result.length;
+ while (length--) {
+ value = result[length];
+ // pad months, days, hours, minutes, and seconds to have two digits.
+ if (value < 10)
+ result[length] = "0" + value;
+ }
+ // pad milliseconds to have three digits.
+ return year + "-" + result.slice(0, 2).join("-") + "T" + result.slice(2).join(":") + "." +
+ ("000" + this.getUTCMilliseconds()).slice(-3) + "Z";
+ }
+}
+
+// ES5 15.9.4.4
+// http://es5.github.com/#x15.9.4.4
+if (!Date.now) {
+ Date.now = function now() {
+ return new Date().getTime();
+ };
+}
+
+// ES5 15.9.5.44
+// http://es5.github.com/#x15.9.5.44
+// This function provides a String representation of a Date object for use by
+// JSON.stringify (15.12.3).
+if (!Date.prototype.toJSON) {
+ Date.prototype.toJSON = function toJSON(key) {
+ // When the toJSON method is called with argument key, the following
+ // steps are taken:
+
+ // 1. Let O be the result of calling ToObject, giving it the this
+ // value as its argument.
+ // 2. Let tv be ToPrimitive(O, hint Number).
+ // 3. If tv is a Number and is not finite, return null.
+ // XXX
+ // 4. Let toISO be the result of calling the [[Get]] internal method of
+ // O with argument "toISOString".
+ // 5. If IsCallable(toISO) is false, throw a TypeError exception.
+ if (typeof this.toISOString != "function")
+ throw new TypeError(); // TODO message
+ // 6. Return the result of calling the [[Call]] internal method of
+ // toISO with O as the this value and an empty argument list.
+ return this.toISOString();
+
+ // NOTE 1 The argument is ignored.
+
+ // NOTE 2 The toJSON function is intentionally generic; it does not
+ // require that its this value be a Date object. Therefore, it can be
+ // transferred to other kinds of objects for use as a method. However,
+ // it does require that any such object have a toISOString method. An
+ // object is free to use the argument key to filter its
+ // stringification.
+ };
+}
+
+// ES5 15.9.4.2
+// http://es5.github.com/#x15.9.4.2
+// based on work shared by Daniel Friesen (dantman)
+// http://gist.github.com/303249
+if (Date.parse("+275760-09-13T00:00:00.000Z") !== 8.64e15) {
+ // XXX global assignment won't work in embeddings that use
+ // an alternate object for the context.
+ Date = (function(NativeDate) {
+
+ // Date.length === 7
+ var Date = function Date(Y, M, D, h, m, s, ms) {
+ var length = arguments.length;
+ if (this instanceof NativeDate) {
+ var date = length == 1 && String(Y) === Y ? // isString(Y)
+ // We explicitly pass it through parse:
+ new NativeDate(Date.parse(Y)) :
+ // We have to manually make calls depending on argument
+ // length here
+ length >= 7 ? new NativeDate(Y, M, D, h, m, s, ms) :
+ length >= 6 ? new NativeDate(Y, M, D, h, m, s) :
+ length >= 5 ? new NativeDate(Y, M, D, h, m) :
+ length >= 4 ? new NativeDate(Y, M, D, h) :
+ length >= 3 ? new NativeDate(Y, M, D) :
+ length >= 2 ? new NativeDate(Y, M) :
+ length >= 1 ? new NativeDate(Y) :
+ new NativeDate();
+ // Prevent mixups with unfixed Date object
+ date.constructor = Date;
+ return date;
+ }
+ return NativeDate.apply(this, arguments);
+ };
+
+ // 15.9.1.15 Date Time String Format.
+ var isoDateExpression = new RegExp("^" +
+ "(\\d{4}|[\+\-]\\d{6})" + // four-digit year capture or sign + 6-digit extended year
+ "(?:-(\\d{2})" + // optional month capture
+ "(?:-(\\d{2})" + // optional day capture
+ "(?:" + // capture hours:minutes:seconds.milliseconds
+ "T(\\d{2})" + // hours capture
+ ":(\\d{2})" + // minutes capture
+ "(?:" + // optional :seconds.milliseconds
+ ":(\\d{2})" + // seconds capture
+ "(?:\\.(\\d{3}))?" + // milliseconds capture
+ ")?" +
+ "(?:" + // capture UTC offset component
+ "Z|" + // UTC capture
+ "(?:" + // offset specifier +/-hours:minutes
+ "([-+])" + // sign capture
+ "(\\d{2})" + // hours offset capture
+ ":(\\d{2})" + // minutes offset capture
+ ")" +
+ ")?)?)?)?" +
+ "$");
+
+ // Copy any custom methods a 3rd party library may have added
+ for (var key in NativeDate)
+ Date[key] = NativeDate[key];
+
+ // Copy "native" methods explicitly; they may be non-enumerable
+ Date.now = NativeDate.now;
+ Date.UTC = NativeDate.UTC;
+ Date.prototype = NativeDate.prototype;
+ Date.prototype.constructor = Date;
+
+ // Upgrade Date.parse to handle simplified ISO 8601 strings
+ Date.parse = function parse(string) {
+ var match = isoDateExpression.exec(string);
+ if (match) {
+ match.shift(); // kill match[0], the full match
+ // parse months, days, hours, minutes, seconds, and milliseconds
+ for (var i = 1; i < 7; i++) {
+ // provide default values if necessary
+ match[i] = +(match[i] || (i < 3 ? 1 : 0));
+ // match[1] is the month. Months are 0-11 in JavaScript
+ // `Date` objects, but 1-12 in ISO notation, so we
+ // decrement.
+ if (i == 1)
+ match[i]--;
+ }
+
+ // parse the UTC offset component
+ var minuteOffset = +match.pop(), hourOffset = +match.pop(), sign = match.pop();
+
+ // compute the explicit time zone offset if specified
+ var offset = 0;
+ if (sign) {
+ // detect invalid offsets and return early
+ if (hourOffset > 23 || minuteOffset > 59)
+ return NaN;
+
+ // express the provided time zone offset in minutes. The offset is
+ // negative for time zones west of UTC; positive otherwise.
+ offset = (hourOffset * 60 + minuteOffset) * 6e4 * (sign == "+" ? -1 : 1);
+ }
+
+ // Date.UTC for years between 0 and 99 converts year to 1900 + year
+ // The Gregorian calendar has a 400-year cycle, so
+ // to Date.UTC(year + 400, .... ) - 12622780800000 == Date.UTC(year, ...),
+ // where 12622780800000 - number of milliseconds in Gregorian calendar 400 years
+ var year = +match[0];
+ if (0 <= year && year <= 99) {
+ match[0] = year + 400;
+ return NativeDate.UTC.apply(this, match) + offset - 12622780800000;
+ }
+
+ // compute a new UTC date value, accounting for the optional offset
+ return NativeDate.UTC.apply(this, match) + offset;
+ }
+ return NativeDate.parse.apply(this, arguments);
+ };
+
+ return Date;
+ })(Date);
+}
+
+//
+// String
+// ======
+//
+
+// ES5 15.5.4.20
+// http://es5.github.com/#x15.5.4.20
+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()) {
+ // http://blog.stevenlevithan.com/archives/faster-trim-javascript
+ // http://perfectionkills.com/whitespace-deviations/
+ ws = "[" + ws + "]";
+ var trimBeginRegexp = new RegExp("^" + ws + ws + "*"),
+ trimEndRegexp = new RegExp(ws + ws + "*$");
+ String.prototype.trim = function trim() {
+ return String(this).replace(trimBeginRegexp, "").replace(trimEndRegexp, "");
+ };
+}
+
+//
+// Util
+// ======
+//
+
+// ES5 9.4
+// http://es5.github.com/#x9.4
+// http://jsperf.com/to-integer
+var toInteger = function (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;
+};
+
+var prepareString = "a"[0] != "a",
+ // ES5 9.9
+ // http://es5.github.com/#x9.9
+ toObject = function (o) {
+ if (o == null) { // this matches both null and undefined
+ throw new TypeError(); // TODO message
+ }
+ // If the implementation doesn't support by-index access of
+ // string characters (ex. IE < 7), split the string
+ if (prepareString && typeof o == "string" && o) {
+ return o.split("");
+ }
+ 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<listeners.length; i++) {
+ listeners[i](e);
+ if (e.propagationStopped)
+ break;
+ }
+
+ if (defaultHandler && !e.defaultPrevented)
+ return defaultHandler(e);
+};
+
+EventEmitter.setDefaultHandler = function(eventName, callback) {
+ this._defaultHandlers = this._defaultHandlers || {};
+
+ if (this._defaultHandlers[eventName])
+ throw new Error("The default handler for '" + eventName + "' is already set");
+
+ this._defaultHandlers[eventName] = callback;
+};
+
+EventEmitter.on =
+EventEmitter.addEventListener = function(eventName, callback) {
+ this._eventRegistry = this._eventRegistry || {};
+
+ var listeners = this._eventRegistry[eventName];
+ if (!listeners)
+ listeners = this._eventRegistry[eventName] = [];
+
+ if (listeners.indexOf(callback) == -1)
+ listeners.push(callback);
+};
+
+EventEmitter.removeListener =
+EventEmitter.removeEventListener = function(eventName, callback) {
+ this._eventRegistry = this._eventRegistry || {};
+
+ var listeners = this._eventRegistry[eventName];
+ if (!listeners)
+ return;
+
+ var index = listeners.indexOf(callback);
+ if (index !== -1)
+ listeners.splice(index, 1);
+};
+
+EventEmitter.removeAllListeners = function(eventName) {
+ if (this._eventRegistry) this._eventRegistry[eventName] = [];
+};
+
+exports.EventEmitter = EventEmitter;
+
+});
+
+define('ace/lib/oop', ['require', 'exports', 'module' ], function(require, exports, module) {
+
+
+exports.inherits = (function() {
+ var tempCtor = function() {};
+ return function(ctor, superCtor) {
+ tempCtor.prototype = superCtor.prototype;
+ ctor.super_ = superCtor.prototype;
+ ctor.prototype = new tempCtor();
+ ctor.prototype.constructor = ctor;
+ };
+}());
+
+exports.mixin = function(obj, mixin) {
+ for (var key in mixin) {
+ obj[key] = mixin[key];
+ }
+};
+
+exports.implement = function(proto, mixin) {
+ exports.mixin(proto, mixin);
+};
+
+});
+
+define('ace/mode/json_worker', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/worker/mirror', 'ace/mode/json/json_parse'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var Mirror = require("../worker/mirror").Mirror;
+var parse = require("./json/json_parse");
+
+var JsonWorker = exports.JsonWorker = function(sender) {
+ Mirror.call(this, sender);
+ this.setTimeout(200);
+};
+
+oop.inherits(JsonWorker, Mirror);
+
+(function() {
+
+ this.onUpdate = function() {
+ var value = this.doc.getValue();
+
+ try {
+ var result = parse(value);
+ } catch (e) {
+ var pos = this.charToDocumentPosition(e.at-1);
+ this.sender.emit("error", {
+ row: pos.row,
+ column: pos.column,
+ text: e.message,
+ type: "error"
+ });
+ return;
+ }
+ this.sender.emit("ok");
+ };
+
+ this.charToDocumentPosition = function(charPos) {
+ var i = 0;
+ var len = this.doc.getLength();
+ var nl = this.doc.getNewLineCharacter().length;
+
+ if (!len) {
+ return { row: 0, column: 0};
+ }
+
+ var lineStart = 0;
+ while (i < len) {
+ var line = this.doc.getLine(i);
+ var lineLength = line.length + nl;
+ if (lineStart + lineLength > charPos)
+ return {
+ row: i,
+ column: charPos - lineStart
+ };
+
+ lineStart += lineLength;
+ i += 1;
+ }
+
+ return {
+ row: i-1,
+ column: line.length
+ };
+ };
+
+}).call(JsonWorker.prototype);
+
+});
+define('ace/worker/mirror', ['require', 'exports', 'module' , 'ace/document', 'ace/lib/lang'], function(require, exports, module) {
+
+
+var Document = require("../document").Document;
+var lang = require("../lib/lang");
+
+var Mirror = exports.Mirror = function(sender) {
+ this.sender = sender;
+ var doc = this.doc = new Document("");
+
+ var deferredUpdate = this.deferredUpdate = lang.deferredCall(this.onUpdate.bind(this));
+
+ var _self = this;
+ sender.on("change", function(e) {
+ doc.applyDeltas([e.data]);
+ deferredUpdate.schedule(_self.$timeout);
+ });
+};
+
+(function() {
+
+ this.$timeout = 500;
+
+ this.setTimeout = function(timeout) {
+ this.$timeout = timeout;
+ };
+
+ this.setValue = function(value) {
+ this.doc.setValue(value);
+ this.deferredUpdate.schedule(this.$timeout);
+ };
+
+ this.getValue = function(callbackId) {
+ this.sender.callback(this.doc.getValue(), callbackId);
+ };
+
+ this.onUpdate = function() {
+ // abstract method
+ };
+
+}).call(Mirror.prototype);
+
+});
+
+define('ace/document', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/event_emitter', 'ace/range', 'ace/anchor'], function(require, exports, module) {
+
+
+var oop = require("./lib/oop");
+var EventEmitter = require("./lib/event_emitter").EventEmitter;
+var Range = require("./range").Range;
+var Anchor = require("./anchor").Anchor;
+
+ /**
+ * new Document([text])
+ * - text (String | Array): The starting text
+ *
+ * Creates a new `Document`. If `text` is included, the `Document` contains those strings; otherwise, it's empty.
+ *
+ **/
+
+var Document = function(text) {
+ this.$lines = [];
+
+ // There has to be one line at least in the document. If you pass an empty
+ // string to the insert function, nothing will happen. Workaround.
+ if (text.length == 0) {
+ this.$lines = [""];
+ } else if (Array.isArray(text)) {
+ this.insertLines(0, text);
+ } else {
+ this.insert({row: 0, column:0}, text);
+ }
+};
+
+(function() {
+
+ oop.implement(this, EventEmitter);
+ this.setValue = function(text) {
+ var len = this.getLength();
+ this.remove(new Range(0, 0, len, this.getLine(len-1).length));
+ this.insert({row: 0, column:0}, text);
+ };
+ this.getValue = function() {
+ return this.getAllLines().join(this.getNewLineCharacter());
+ };
+ this.createAnchor = function(row, column) {
+ return new Anchor(this, row, column);
+ };
+
+ // check for IE split bug
+ if ("aaa".split(/a/).length == 0)
+ this.$split = function(text) {
+ return text.replace(/\r\n|\r/g, "\n").split("\n");
+ }
+ else
+ this.$split = function(text) {
+ return text.split(/\r\n|\r|\n/);
+ };
+ this.$detectNewLine = function(text) {
+ var match = text.match(/^.*?(\r\n|\r|\n)/m);
+ if (match) {
+ this.$autoNewLine = match[1];
+ } else {
+ this.$autoNewLine = "\n";
+ }
+ };
+ this.getNewLineCharacter = function() {
+ switch (this.$newLineMode) {
+ case "windows":
+ return "\r\n";
+
+ case "unix":
+ return "\n";
+
+ case "auto":
+ return this.$autoNewLine;
+ }
+ };
+
+ this.$autoNewLine = "\n";
+ this.$newLineMode = "auto";
+ this.setNewLineMode = function(newLineMode) {
+ if (this.$newLineMode === newLineMode)
+ return;
+
+ this.$newLineMode = newLineMode;
+ };
+ this.getNewLineMode = function() {
+ return this.$newLineMode;
+ };
+ this.isNewLine = function(text) {
+ return (text == "\r\n" || text == "\r" || text == "\n");
+ };
+ this.getLine = function(row) {
+ return this.$lines[row] || "";
+ };
+ this.getLines = function(firstRow, lastRow) {
+ return this.$lines.slice(firstRow, lastRow + 1);
+ };
+ this.getAllLines = function() {
+ return this.getLines(0, this.getLength());
+ };
+ this.getLength = function() {
+ return this.$lines.length;
+ };
+ this.getTextRange = function(range) {
+ if (range.start.row == range.end.row) {
+ return this.$lines[range.start.row].substring(range.start.column,
+ range.end.column);
+ }
+ else {
+ var lines = this.getLines(range.start.row+1, range.end.row-1);
+ lines.unshift((this.$lines[range.start.row] || "").substring(range.start.column));
+ lines.push((this.$lines[range.end.row] || "").substring(0, range.end.column));
+ return lines.join(this.getNewLineCharacter());
+ }
+ };
+ this.$clipPosition = function(position) {
+ var length = this.getLength();
+ if (position.row >= 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);
+
+ // only detect new lines if the document has no line break yet
+ 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;
+ };
+ /**
+ * Document@change(e)
+ * - e (Object): Contains at least one property called `"action"`. `"action"` indicates the action that triggered the change. Each action also has a set of additional properties.
+ *
+ * Fires whenever the document changes.
+ *
+ * Several methods trigger different `"change"` events. Below is a list of each action type, followed by each property that's also available:
+ *
+ * * `"insertLines"` (emitted by [[Document.insertLines]])
+ * * `range`: the [[Range]] of the change within the document
+ * * `lines`: the lines in the document that are changing
+ * * `"insertText"` (emitted by [[Document.insertNewLine]])
+ * * `range`: the [[Range]] of the change within the document
+ * * `text`: the text that's being added
+ * * `"removeLines"` (emitted by [[Document.insertLines]])
+ * * `range`: the [[Range]] of the change within the document
+ * * `lines`: the lines in the document that were removed
+ * * `nl`: the new line character (as defined by [[Document.getNewLineCharacter]])
+ * * `"removeText"` (emitted by [[Document.removeInLine]] and [[Document.removeNewLine]])
+ * * `range`: the [[Range]] of the change within the document
+ * * `text`: the text that's being removed
+ *
+ **/
+ this.insertLines = function(row, lines) {
+ if (lines.length == 0)
+ return {row: row, column: 0};
+
+ // apply doesn't work for big arrays (smallest threshold is on safari 0xFFFF)
+ // to circumvent that we have to break huge inserts into smaller chunks here
+ 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) {
+ // clip to document
+ 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;
+
+ // Shortcut: If the text we want to insert is the same as it is already
+ // in the document, we don't have to replace anything.
+ 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<deltas.length; i++) {
+ var delta = deltas[i];
+ var range = Range.fromPoints(delta.range.start, delta.range.end);
+
+ if (delta.action == "insertLines")
+ this.insertLines(range.start.row, delta.lines);
+ else if (delta.action == "insertText")
+ this.insert(range.start, delta.text);
+ else if (delta.action == "removeLines")
+ this.removeLines(range.start.row, range.end.row - 1);
+ else if (delta.action == "removeText")
+ this.remove(range);
+ }
+ };
+ this.revertDeltas = function(deltas) {
+ for (var i=deltas.length-1; 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);
+ }
+ };
+
+}).call(Document.prototype);
+
+exports.Document = Document;
+});
+
+define('ace/range', ['require', 'exports', 'module' ], function(require, exports, module) {
+
+
+/**
+ * class Range
+ *
+ * This object is used in various places to indicate a region within the editor. To better visualize how this works, imagine a rectangle. Each quadrant of the rectangle is analogus to a range, as ranges contain a starting row and starting column, and an ending row, and ending column.
+ *
+ **/
+
+/**
+ * new Range(startRow, startColumn, endRow, endColumn)
+ * - startRow (Number): The starting row
+ * - startColumn (Number): The starting column
+ * - endRow (Number): The ending row
+ * - endColumn (Number): The ending column
+ *
+ * Creates a new `Range` object with the given starting and ending row and column points.
+ *
+ **/
+var Range = function(startRow, startColumn, endRow, endColumn) {
+ this.start = {
+ row: startRow,
+ column: startColumn
+ };
+
+ this.end = {
+ row: endRow,
+ column: endColumn
+ };
+};
+
+(function() {
+ /**
+ * Range.isEqual(range) -> Boolean
+ * - range (Range): A range to check against
+ *
+ * Returns `true` if and only if the starting row and column, and ending tow and column, are equivalent to those given by `range`.
+ *
+ **/
+ 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;
+ }
+ }
+ }
+
+ /** related to: Range.compare
+ * Range.comparePoint(p) -> Number
+ * - p (Range): A point to compare with
+ * + (Number): This method returns one of the following numbers:<br/>
+ * * `0` if the two points are exactly equal<br/>
+ * * `-1` if `p.row` is less then the calling range<br/>
+ * * `1` if `p.row` is greater than the calling range<br/>
+ * <br/>
+ * If the starting row of the calling range is equal to `p.row`, and:<br/>
+ * * `p.column` is greater than or equal to the calling range's starting column, this returns `0`<br/>
+ * * Otherwise, it returns -1<br/>
+ *<br/>
+ * If the ending row of the calling range is equal to `p.row`, and:<br/>
+ * * `p.column` is less than or equal to the calling range's ending column, this returns `0`<br/>
+ * * Otherwise, it returns 1<br/>
+ *
+ * Checks the row and column points of `p` with the row and column points of the calling range.
+ *
+ *
+ *
+ **/
+ this.comparePoint = function(p) {
+ return this.compare(p.row, p.column);
+ }
+
+ /** related to: Range.comparePoint
+ * Range.containsRange(range) -> Boolean
+ * - range (Range): A range to compare with
+ *
+ * Checks the start and end points of `range` and compares them to the calling range. Returns `true` if the `range` is contained within the caller's range.
+ *
+ **/
+ this.containsRange = function(range) {
+ return this.comparePoint(range.start) == 0 && this.comparePoint(range.end) == 0;
+ }
+
+ /**
+ * Range.intersects(range) -> Boolean
+ * - range (Range): A range to compare with
+ *
+ * Returns `true` if passed in `range` intersects with the one calling this method.
+ *
+ **/
+ this.intersects = function(range) {
+ var cmp = this.compareRange(range);
+ return (cmp == -1 || cmp == 0 || cmp == 1);
+ }
+
+ /**
+ * Range.isEnd(row, column) -> Boolean
+ * - row (Number): A row point to compare with
+ * - column (Number): A column point to compare with
+ *
+ * Returns `true` if the caller's ending row point is the same as `row`, and if the caller's ending column is the same as `column`.
+ *
+ **/
+ this.isEnd = function(row, column) {
+ return this.end.row == row && this.end.column == column;
+ }
+
+ /**
+ * Range.isStart(row, column) -> Boolean
+ * - row (Number): A row point to compare with
+ * - column (Number): A column point to compare with
+ *
+ * Returns `true` if the caller's starting row point is the same as `row`, and if the caller's starting column is the same as `column`.
+ *
+ **/
+ this.isStart = function(row, column) {
+ return this.start.row == row && this.start.column == column;
+ }
+
+ /**
+ * Range.setStart(row, column)
+ * - row (Number): A row point to set
+ * - column (Number): A column point to set
+ *
+ * Sets the starting row and column for the range.
+ *
+ **/
+ 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;
+ }
+ }
+
+ /**
+ * Range.setEnd(row, column)
+ * - row (Number): A row point to set
+ * - column (Number): A column point to set
+ *
+ * Sets the starting row and column for the range.
+ *
+ **/
+ 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;
+ }
+ }
+
+ /** related to: Range.compare
+ * Range.inside(row, column) -> Boolean
+ * - row (Number): A row point to compare with
+ * - column (Number): A column point to compare with
+ *
+ * Returns `true` if the `row` and `column` are within the given range.
+ *
+ **/
+ 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;
+ }
+
+ /** related to: Range.compare
+ * Range.insideStart(row, column) -> Boolean
+ * - row (Number): A row point to compare with
+ * - column (Number): A column point to compare with
+ *
+ * Returns `true` if the `row` and `column` are within the given range's starting points.
+ *
+ **/
+ this.insideStart = function(row, column) {
+ if (this.compare(row, column) == 0) {
+ if (this.isEnd(row, column)) {
+ return false;
+ } else {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /** related to: Range.compare
+ * Range.insideEnd(row, column) -> Boolean
+ * - row (Number): A row point to compare with
+ * - column (Number): A column point to compare with
+ *
+ * Returns `true` if the `row` and `column` are within the given range's ending points.
+ *
+ **/
+ this.insideEnd = function(row, column) {
+ if (this.compare(row, column) == 0) {
+ if (this.isStart(row, column)) {
+ return false;
+ } else {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Range.compare(row, column) -> Number
+ * - row (Number): A row point to compare with
+ * - column (Number): A column point to compare with
+ * + (Number): This method returns one of the following numbers:<br/>
+ * * `0` if the two points are exactly equal <br/>
+ * * `-1` if `p.row` is less then the calling range <br/>
+ * * `1` if `p.row` is greater than the calling range <br/>
+ * <br/>
+ * If the starting row of the calling range is equal to `p.row`, and: <br/>
+ * * `p.column` is greater than or equal to the calling range's starting column, this returns `0`<br/>
+ * * Otherwise, it returns -1<br/>
+ * <br/>
+ * If the ending row of the calling range is equal to `p.row`, and: <br/>
+ * * `p.column` is less than or equal to the calling range's ending column, this returns `0` <br/>
+ * * Otherwise, it returns 1
+ *
+ * Checks the row and column points with the row and column points of the calling range.
+ *
+ *
+ **/
+ 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);
+ }
+ }
+
+ /**
+ * Range.compareEnd(row, column) -> Number
+ * - row (Number): A row point to compare with
+ * - column (Number): A column point to compare with
+ * + (Number): This method returns one of the following numbers:<br/>
+ * * `0` if the two points are exactly equal<br/>
+ * * `-1` if `p.row` is less then the calling range<br/>
+ * * `1` if `p.row` is greater than the calling range, or if `isEnd` is `true.<br/>
+ * <br/>
+ * If the starting row of the calling range is equal to `p.row`, and:<br/>
+ * * `p.column` is greater than or equal to the calling range's starting column, this returns `0`<br/>
+ * * Otherwise, it returns -1<br/>
+ *<br/>
+ * If the ending row of the calling range is equal to `p.row`, and:<br/>
+ * * `p.column` is less than or equal to the calling range's ending column, this returns `0`<br/>
+ * * Otherwise, it returns 1
+ *
+ * Checks the row and column points with the row and column points of the calling range.
+ *
+ *
+ **/
+ this.compareEnd = function(row, column) {
+ if (this.end.row == row && this.end.column == column) {
+ return 1;
+ } else {
+ return this.compare(row, column);
+ }
+ }
+
+ /**
+ * Range.compareInside(row, column) -> Number
+ * - row (Number): A row point to compare with
+ * - column (Number): A column point to compare with
+ * + (Number): This method returns one of the following numbers:<br/>
+ * * `1` if the ending row of the calling range is equal to `row`, and the ending column of the calling range is equal to `column`<br/>
+ * * `-1` if the starting row of the calling range is equal to `row`, and the starting column of the calling range is equal to `column`<br/>
+ * <br/>
+ * Otherwise, it returns the value after calling [[Range.compare `compare()`]].
+ *
+ * Checks the row and column points with the row and column points of the calling range.
+ *
+ *
+ *
+ **/
+ 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);
+ }
+ }
+
+ /**
+ * Range.clipRows(firstRow, lastRow) -> Range
+ * - firstRow (Number): The starting row
+ * - lastRow (Number): The ending row
+ *
+ * Returns the part of the current `Range` that occurs within the boundaries of `firstRow` and `lastRow` as a new `Range` object.
+ *
+ **/
+ 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;
+
+/**
+ * new Anchor(doc, row, column)
+ * - doc (Document): The document to associate with the anchor
+ * - row (Number): The starting row position
+ * - column (Number): The starting column position
+ *
+ * Creates a new `Anchor` and associates it with a document.
+ *
+ **/
+
+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) {
+ return new Array(count + 1).join(string);
+};
+
+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<l; i++) {
+ if (array[i] && typeof array[i] == "object")
+ copy[i] = this.copyObject( array[i] );
+ else
+ copy[i] = array[i];
+ }
+ return copy;
+};
+
+exports.deepCopy = function (obj) {
+ if (typeof obj != "object") {
+ return obj;
+ }
+
+ var copy = obj.constructor();
+ for (var key in obj) {
+ if (typeof obj[key] == "object") {
+ copy[key] = this.deepCopy(obj[key]);
+ } else {
+ copy[key] = obj[key];
+ }
+ }
+ return copy;
+};
+
+exports.arrayToMap = function(arr) {
+ var map = {};
+ for (var i=0; i<arr.length; i++) {
+ map[arr[i]] = 1;
+ }
+ return map;
+
+};
+
+exports.createMap = function(props) {
+ var map = Object.create(null);
+ for (var i in props) {
+ map[i] = props[i];
+ }
+ return map;
+};
+exports.arrayRemove = function(array, value) {
+ for (var i = 0; i <= array.length; i++) {
+ if (value === array[i]) {
+ array.splice(i, 1);
+ }
+ }
+};
+
+exports.escapeRegExp = function(str) {
+ return str.replace(/([.*+?^${}()|[\]\/\\])/g, '\\$1');
+};
+
+exports.getMatchOffsets = function(string, regExp) {
+ var matches = [];
+
+ string.replace(regExp, function(str) {
+ matches.push({
+ offset: arguments[arguments.length-2],
+ length: str.length
+ });
+ });
+
+ return matches;
+};
+
+
+exports.deferredCall = function(fcn) {
+
+ var timer = null;
+ var callback = function() {
+ timer = null;
+ fcn();
+ };
+
+ var deferred = function(timeout) {
+ deferred.cancel();
+ timer = setTimeout(callback, timeout || 0);
+ return deferred;
+ };
+
+ deferred.schedule = deferred;
+
+ deferred.call = function() {
+ this.cancel();
+ fcn();
+ return deferred;
+ };
+
+ deferred.cancel = function() {
+ clearTimeout(timer);
+ timer = null;
+ return deferred;
+ };
+
+ return deferred;
+};
+
+});
+
+/*members "", "\"", "\/", "\\", at, b, call, charAt, f, fromCharCode,
+ hasOwnProperty, message, n, name, push, r, t, text
+*/
+
+define('ace/mode/json/json_parse', ['require', 'exports', 'module' ], function(require, exports, module) {
+
+
+// This is a function that can parse a JSON text, producing a JavaScript
+// data structure. It is a simple, recursive descent parser. It does not use
+// eval or regular expressions, so it can be used as a model for implementing
+// a JSON parser in other languages.
+
+// We are defining the function inside of another function to avoid creating
+// global variables.
+
+ var at, // The index of the current character
+ ch, // The current character
+ escapee = {
+ '"': '"',
+ '\\': '\\',
+ '/': '/',
+ b: '\b',
+ f: '\f',
+ n: '\n',
+ r: '\r',
+ t: '\t'
+ },
+ text,
+
+ error = function (m) {
+
+// Call error when something is wrong.
+
+ throw {
+ name: 'SyntaxError',
+ message: m,
+ at: at,
+ text: text
+ };
+ },
+
+ next = function (c) {
+
+// If a c parameter is provided, verify that it matches the current character.
+
+ if (c && c !== ch) {
+ error("Expected '" + c + "' instead of '" + ch + "'");
+ }
+
+// Get the next character. When there are no more characters,
+// return the empty string.
+
+ ch = text.charAt(at);
+ at += 1;
+ return ch;
+ },
+
+ number = function () {
+
+// Parse a number value.
+
+ var number,
+ string = '';
+
+ if (ch === '-') {
+ string = '-';
+ next('-');
+ }
+ while (ch >= '0' && ch <= '9') {
+ string += ch;
+ next();
+ }
+ if (ch === '.') {
+ string += '.';
+ while (next() && ch >= '0' && ch <= '9') {
+ string += ch;
+ }
+ }
+ if (ch === 'e' || ch === 'E') {
+ string += ch;
+ next();
+ if (ch === '-' || ch === '+') {
+ string += ch;
+ next();
+ }
+ while (ch >= '0' && ch <= '9') {
+ string += ch;
+ next();
+ }
+ }
+ number = +string;
+ if (isNaN(number)) {
+ error("Bad number");
+ } else {
+ return number;
+ }
+ },
+
+ string = function () {
+
+// Parse a string value.
+
+ var hex,
+ i,
+ string = '',
+ uffff;
+
+// When parsing for string values, we must look for " and \ characters.
+
+ if (ch === '"') {
+ while (next()) {
+ if (ch === '"') {
+ next();
+ return string;
+ } else if (ch === '\\') {
+ next();
+ if (ch === 'u') {
+ uffff = 0;
+ for (i = 0; i < 4; i += 1) {
+ hex = parseInt(next(), 16);
+ if (!isFinite(hex)) {
+ break;
+ }
+ uffff = uffff * 16 + hex;
+ }
+ string += String.fromCharCode(uffff);
+ } else if (typeof escapee[ch] === 'string') {
+ string += escapee[ch];
+ } else {
+ break;
+ }
+ } else {
+ string += ch;
+ }
+ }
+ }
+ error("Bad string");
+ },
+
+ white = function () {
+
+// Skip whitespace.
+
+ while (ch && ch <= ' ') {
+ next();
+ }
+ },
+
+ word = function () {
+
+// true, false, or null.
+
+ switch (ch) {
+ case 't':
+ next('t');
+ next('r');
+ next('u');
+ next('e');
+ return true;
+ case 'f':
+ next('f');
+ next('a');
+ next('l');
+ next('s');
+ next('e');
+ return false;
+ case 'n':
+ next('n');
+ next('u');
+ next('l');
+ next('l');
+ return null;
+ }
+ error("Unexpected '" + ch + "'");
+ },
+
+ value, // Place holder for the value function.
+
+ array = function () {
+
+// Parse an array value.
+
+ var array = [];
+
+ if (ch === '[') {
+ next('[');
+ white();
+ if (ch === ']') {
+ next(']');
+ return array; // empty array
+ }
+ while (ch) {
+ array.push(value());
+ white();
+ if (ch === ']') {
+ next(']');
+ return array;
+ }
+ next(',');
+ white();
+ }
+ }
+ error("Bad array");
+ },
+
+ object = function () {
+
+// Parse an object value.
+
+ var key,
+ object = {};
+
+ if (ch === '{') {
+ next('{');
+ white();
+ if (ch === '}') {
+ next('}');
+ return object; // empty object
+ }
+ while (ch) {
+ key = string();
+ white();
+ next(':');
+ if (Object.hasOwnProperty.call(object, key)) {
+ error('Duplicate key "' + key + '"');
+ }
+ object[key] = value();
+ white();
+ if (ch === '}') {
+ next('}');
+ return object;
+ }
+ next(',');
+ white();
+ }
+ }
+ error("Bad object");
+ };
+
+ value = function () {
+
+// Parse a JSON value. It could be an object, an array, a string, a number,
+// or a word.
+
+ white();
+ switch (ch) {
+ case '{':
+ return object();
+ case '[':
+ return array();
+ case '"':
+ return string();
+ case '-':
+ return number();
+ default:
+ return ch >= '0' && ch <= '9' ? number() : word();
+ }
+ };
+
+// Return the json_parse function. It will have access to all of the above
+// functions and variables.
+
+ return function (source, reviver) {
+ var result;
+
+ text = source;
+ at = 0;
+ ch = ' ';
+ result = value();
+ white();
+ if (ch) {
+ error("Syntax error");
+ }
+
+// If there is a reviver function, we recursively walk the new structure,
+// passing each name/value pair to the reviver function for possible
+// transformation, starting with a temporary root object that holds the result
+// in an empty key. If there is not a reviver function, we simply return the
+// result.
+
+ return typeof reviver === 'function' ? function walk(holder, key) {
+ var k, v, value = holder[key];
+ if (value && typeof value === 'object') {
+ for (k in value) {
+ if (Object.hasOwnProperty.call(value, k)) {
+ v = walk(value, k);
+ if (v !== undefined) {
+ value[k] = v;
+ } else {
+ delete value[k];
+ }
+ }
+ }
+ }
+ return reviver.call(holder, key, value);
+ }({'': result}, '') : result;
+ };
+});
diff --git a/vendor/assets/javascripts/ace-src-noconflict/worker-xquery.js b/vendor/assets/javascripts/ace-src-noconflict/worker-xquery.js
new file mode 100644
index 00000000000..494066fd73f
--- /dev/null
+++ b/vendor/assets/javascripts/ace-src-noconflict/worker-xquery.js
@@ -0,0 +1,69021 @@
+"no use strict";
+
+var console = {
+ log: function(msgs) {
+ postMessage({type: "log", data: arguments.join(" ")});
+ }
+};
+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("/");
+ var moduleName = base + "/" + moduleName;
+
+ while(moduleName.indexOf(".") !== -1 && previous != moduleName) {
+ var previous = moduleName;
+ var 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");
+
+ var 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) {
+ main[msg.command].apply(main, msg.args);
+ }
+ 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:
+// -- kriskowal Kris Kowal Copyright (C) 2009-2010 MIT License
+// -- tlrobinson Tom Robinson Copyright (C) 2009-2010 MIT License (Narwhal Project)
+// -- dantman Daniel Friesen Copyright(C) 2010 XXX No License Specified
+// -- fschaefer Florian Schäfer Copyright (C) 2010 MIT License
+// -- Irakli Gozalishvili Copyright (C) 2010 MIT License
+
+/*!
+ Copyright (c) 2009, 280 North Inc. http://280north.com/
+ MIT License. http://github.com/280north/narwhal/blob/master/README.md
+*/
+
+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) {
+
+
+ //---------------------------------
+ // Private variables
+ //---------------------------------
+
+ 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;
+
+ //---------------------------------
+ // Overriden native methods
+ //---------------------------------
+
+ // Adds named capture support (with backreferences returned as `result.name`), and fixes two
+ // cross-browser issues per ES3:
+ // - Captured values for nonparticipating capturing groups should be returned as `undefined`,
+ // rather than the empty string.
+ // - `lastIndex` should not be incremented after zero-length matches.
+ RegExp.prototype.exec = function (str) {
+ var match = real.exec.apply(this, arguments),
+ name, r2;
+ if ( typeof(str) == 'string' && match) {
+ // Fix browsers whose `exec` methods don't consistently return `undefined` for
+ // nonparticipating capturing groups
+ if (!compliantExecNpcg && match.length > 1 && indexOf(match, "") > -1) {
+ r2 = RegExp(this.source, real.replace.call(getNativeFlags(this), "g", ""));
+ // Using `str.slice(match.index)` rather than `match[0]` in case lookahead allowed
+ // matching due to characters outside the match
+ 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;
+ }
+ });
+ }
+ // Attach named capture properties
+ 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];
+ }
+ }
+ // Fix browsers that increment `lastIndex` after zero-length matches
+ if (!compliantLastIndexIncrement && this.global && !match[0].length && (this.lastIndex > match.index))
+ this.lastIndex--;
+ }
+ return match;
+ };
+
+ // Don't override `test` if it won't change anything
+ if (!compliantLastIndexIncrement) {
+ // Fix browser bug in native method
+ RegExp.prototype.test = function (str) {
+ // Use the native `exec` to skip some processing overhead, even though the overriden
+ // `exec` would take care of the `lastIndex` fix
+ var match = real.exec.call(this, str);
+ // Fix browsers that increment `lastIndex` after zero-length matches
+ if (match && this.global && !match[0].length && (this.lastIndex > match.index))
+ this.lastIndex--;
+ return !!match;
+ };
+ }
+
+ //---------------------------------
+ // Private helper functions
+ //---------------------------------
+
+ 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;
+ }
+
+});
+// vim: ts=4 sts=4 sw=4 expandtab
+// -- kriskowal Kris Kowal Copyright (C) 2009-2011 MIT License
+// -- tlrobinson Tom Robinson Copyright (C) 2009-2010 MIT License (Narwhal Project)
+// -- dantman Daniel Friesen Copyright (C) 2010 XXX TODO License or CLA
+// -- fschaefer Florian Schäfer Copyright (C) 2010 MIT License
+// -- Gozala Irakli Gozalishvili Copyright (C) 2010 MIT License
+// -- kitcambridge Kit Cambridge Copyright (C) 2011 MIT License
+// -- kossnocorp Sasha Koss XXX TODO License or CLA
+// -- bryanforbes Bryan Forbes XXX TODO License or CLA
+// -- killdream Quildreen Motta Copyright (C) 2011 MIT Licence
+// -- michaelficarra Michael Ficarra Copyright (C) 2011 3-clause BSD License
+// -- sharkbrainguy Gerard Paapu Copyright (C) 2011 MIT License
+// -- bbqsrc Brendan Molloy (C) 2011 Creative Commons Zero (public domain)
+// -- iwyg XXX TODO License or CLA
+// -- DomenicDenicola Domenic Denicola Copyright (C) 2011 MIT License
+// -- xavierm02 Montillet Xavier XXX TODO License or CLA
+// -- Raynos Raynos XXX TODO License or CLA
+// -- samsonjs Sami Samhuri Copyright (C) 2010 MIT License
+// -- rwldrn Rick Waldron Copyright (C) 2011 MIT License
+// -- lexer Alexey Zakharov XXX TODO License or CLA
+
+/*!
+ Copyright (c) 2009, 280 North Inc. http://280north.com/
+ MIT License. http://github.com/280north/narwhal/blob/master/README.md
+*/
+
+define('ace/lib/es5-shim', ['require', 'exports', 'module' ], function(require, exports, module) {
+
+/*
+ * Brings an environment as close to ECMAScript 5 compliance
+ * as is possible with the facilities of erstwhile engines.
+ *
+ * Annotated ES5: http://es5.github.com/ (specific links below)
+ * ES5 Spec: http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf
+ *
+ * @module
+ */
+
+/*whatsupdoc*/
+
+//
+// Function
+// ========
+//
+
+// ES-5 15.3.4.5
+// http://es5.github.com/#x15.3.4.5
+
+if (!Function.prototype.bind) {
+ Function.prototype.bind = function bind(that) { // .length is 1
+ // 1. Let Target be the this value.
+ var target = this;
+ // 2. If IsCallable(Target) is false, throw a TypeError exception.
+ if (typeof target != "function")
+ throw new TypeError(); // TODO message
+ // 3. Let A be a new (possibly empty) internal list of all of the
+ // argument values provided after thisArg (arg1, arg2 etc), in order.
+ // XXX slicedArgs will stand in for "A" if used
+ var args = slice.call(arguments, 1); // for normal call
+ // 4. Let F be a new native ECMAScript object.
+ // 11. Set the [[Prototype]] internal property of F to the standard
+ // built-in Function prototype object as specified in 15.3.3.1.
+ // 12. Set the [[Call]] internal property of F as described in
+ // 15.3.4.5.1.
+ // 13. Set the [[Construct]] internal property of F as described in
+ // 15.3.4.5.2.
+ // 14. Set the [[HasInstance]] internal property of F as described in
+ // 15.3.4.5.3.
+ var bound = function () {
+
+ if (this instanceof bound) {
+ // 15.3.4.5.2 [[Construct]]
+ // When the [[Construct]] internal method of a function object,
+ // F that was created using the bind function is called with a
+ // list of arguments ExtraArgs, the following steps are taken:
+ // 1. Let target be the value of F's [[TargetFunction]]
+ // internal property.
+ // 2. If target has no [[Construct]] internal method, a
+ // TypeError exception is thrown.
+ // 3. Let boundArgs be the value of F's [[BoundArgs]] internal
+ // property.
+ // 4. Let args be a new list containing the same values as the
+ // list boundArgs in the same order followed by the same
+ // values as the list ExtraArgs in the same order.
+ // 5. Return the result of calling the [[Construct]] internal
+ // method of target providing args as the arguments.
+
+ var F = function(){};
+ F.prototype = target.prototype;
+ var self = new F;
+
+ var result = target.apply(
+ self,
+ args.concat(slice.call(arguments))
+ );
+ if (result !== null && Object(result) === result)
+ return result;
+ return self;
+
+ } else {
+ // 15.3.4.5.1 [[Call]]
+ // When the [[Call]] internal method of a function object, F,
+ // which was created using the bind function is called with a
+ // this value and a list of arguments ExtraArgs, the following
+ // steps are taken:
+ // 1. Let boundArgs be the value of F's [[BoundArgs]] internal
+ // property.
+ // 2. Let boundThis be the value of F's [[BoundThis]] internal
+ // property.
+ // 3. Let target be the value of F's [[TargetFunction]] internal
+ // property.
+ // 4. Let args be a new list containing the same values as the
+ // list boundArgs in the same order followed by the same
+ // values as the list ExtraArgs in the same order.
+ // 5. Return the result of calling the [[Call]] internal method
+ // of target providing boundThis as the this value and
+ // providing args as the arguments.
+
+ // equiv: target.call(this, ...boundArgs, ...args)
+ return target.apply(
+ that,
+ args.concat(slice.call(arguments))
+ );
+
+ }
+
+ };
+ // XXX bound.length is never writable, so don't even try
+ //
+ // 15. If the [[Class]] internal property of Target is "Function", then
+ // a. Let L be the length property of Target minus the length of A.
+ // b. Set the length own property of F to either 0 or L, whichever is
+ // larger.
+ // 16. Else set the length own property of F to 0.
+ // 17. Set the attributes of the length own property of F to the values
+ // specified in 15.3.5.1.
+
+ // TODO
+ // 18. Set the [[Extensible]] internal property of F to true.
+
+ // TODO
+ // 19. Let thrower be the [[ThrowTypeError]] function Object (13.2.3).
+ // 20. Call the [[DefineOwnProperty]] internal method of F with
+ // arguments "caller", PropertyDescriptor {[[Get]]: thrower, [[Set]]:
+ // thrower, [[Enumerable]]: false, [[Configurable]]: false}, and
+ // false.
+ // 21. Call the [[DefineOwnProperty]] internal method of F with
+ // arguments "arguments", PropertyDescriptor {[[Get]]: thrower,
+ // [[Set]]: thrower, [[Enumerable]]: false, [[Configurable]]: false},
+ // and false.
+
+ // TODO
+ // NOTE Function objects created using Function.prototype.bind do not
+ // have a prototype property or the [[Code]], [[FormalParameters]], and
+ // [[Scope]] internal properties.
+ // XXX can't delete prototype in pure-js.
+
+ // 22. Return F.
+ return bound;
+ };
+}
+
+// Shortcut to an often accessed properties, in order to avoid multiple
+// dereference that costs universally.
+// _Please note: Shortcuts are defined after `Function.prototype.bind` as we
+// us it in defining shortcuts.
+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);
+
+// If JS engine supports accessors creating shortcuts.
+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__);
+}
+
+//
+// Array
+// =====
+//
+
+// ES5 15.4.3.2
+// http://es5.github.com/#x15.4.3.2
+// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/isArray
+if (!Array.isArray) {
+ Array.isArray = function isArray(obj) {
+ return toString(obj) == "[object Array]";
+ };
+}
+
+// The IsCallable() check in the Array functions
+// has been replaced with a strict check on the
+// internal class of the object to trap cases where
+// the provided function was actually a regular
+// expression literal, which in V8 and
+// JavaScriptCore is a typeof "function". Only in
+// V8 are regular expression literals permitted as
+// reduce parameters, so it is desirable in the
+// general case for the shim to match the more
+// strict and common behavior of rejecting regular
+// expressions.
+
+// ES5 15.4.4.18
+// http://es5.github.com/#x15.4.4.18
+// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/array/forEach
+if (!Array.prototype.forEach) {
+ Array.prototype.forEach = function forEach(fun /*, thisp*/) {
+ var self = toObject(this),
+ thisp = arguments[1],
+ i = 0,
+ length = self.length >>> 0;
+
+ // If no callback function or if callback is not a callable function
+ if (toString(fun) != "[object Function]") {
+ throw new TypeError(); // TODO message
+ }
+
+ while (i < length) {
+ if (i in self) {
+ // Invoke the callback function with call, passing arguments:
+ // context, property value, property key, thisArg object context
+ fun.call(thisp, self[i], i, self);
+ }
+ i++;
+ }
+ };
+}
+
+// ES5 15.4.4.19
+// http://es5.github.com/#x15.4.4.19
+// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/map
+if (!Array.prototype.map) {
+ Array.prototype.map = function map(fun /*, thisp*/) {
+ var self = toObject(this),
+ length = self.length >>> 0,
+ result = Array(length),
+ thisp = arguments[1];
+
+ // If no callback function or if callback is not a callable function
+ if (toString(fun) != "[object Function]") {
+ throw new TypeError(); // TODO message
+ }
+
+ for (var i = 0; i < length; i++) {
+ if (i in self)
+ result[i] = fun.call(thisp, self[i], i, self);
+ }
+ return result;
+ };
+}
+
+// ES5 15.4.4.20
+// http://es5.github.com/#x15.4.4.20
+// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/filter
+if (!Array.prototype.filter) {
+ Array.prototype.filter = function filter(fun /*, thisp */) {
+ var self = toObject(this),
+ length = self.length >>> 0,
+ result = [],
+ thisp = arguments[1];
+
+ // If no callback function or if callback is not a callable function
+ if (toString(fun) != "[object Function]") {
+ throw new TypeError(); // TODO message
+ }
+
+ for (var i = 0; i < length; i++) {
+ if (i in self && fun.call(thisp, self[i], i, self))
+ result.push(self[i]);
+ }
+ return result;
+ };
+}
+
+// ES5 15.4.4.16
+// http://es5.github.com/#x15.4.4.16
+// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/every
+if (!Array.prototype.every) {
+ Array.prototype.every = function every(fun /*, thisp */) {
+ var self = toObject(this),
+ length = self.length >>> 0,
+ thisp = arguments[1];
+
+ // If no callback function or if callback is not a callable function
+ if (toString(fun) != "[object Function]") {
+ throw new TypeError(); // TODO message
+ }
+
+ for (var i = 0; i < length; i++) {
+ if (i in self && !fun.call(thisp, self[i], i, self))
+ return false;
+ }
+ return true;
+ };
+}
+
+// ES5 15.4.4.17
+// http://es5.github.com/#x15.4.4.17
+// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/some
+if (!Array.prototype.some) {
+ Array.prototype.some = function some(fun /*, thisp */) {
+ var self = toObject(this),
+ length = self.length >>> 0,
+ thisp = arguments[1];
+
+ // If no callback function or if callback is not a callable function
+ if (toString(fun) != "[object Function]") {
+ throw new TypeError(); // TODO message
+ }
+
+ for (var i = 0; i < length; i++) {
+ if (i in self && fun.call(thisp, self[i], i, self))
+ return true;
+ }
+ return false;
+ };
+}
+
+// ES5 15.4.4.21
+// http://es5.github.com/#x15.4.4.21
+// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/reduce
+if (!Array.prototype.reduce) {
+ Array.prototype.reduce = function reduce(fun /*, initial*/) {
+ var self = toObject(this),
+ length = self.length >>> 0;
+
+ // If no callback function or if callback is not a callable function
+ if (toString(fun) != "[object Function]") {
+ throw new TypeError(); // TODO message
+ }
+
+ // no value to return if no initial value and an empty array
+ if (!length && arguments.length == 1)
+ throw new TypeError(); // TODO message
+
+ var i = 0;
+ var result;
+ if (arguments.length >= 2) {
+ result = arguments[1];
+ } else {
+ do {
+ if (i in self) {
+ result = self[i++];
+ break;
+ }
+
+ // if array contains no values, no initial value to return
+ if (++i >= length)
+ throw new TypeError(); // TODO message
+ } while (true);
+ }
+
+ for (; i < length; i++) {
+ if (i in self)
+ result = fun.call(void 0, result, self[i], i, self);
+ }
+
+ return result;
+ };
+}
+
+// ES5 15.4.4.22
+// http://es5.github.com/#x15.4.4.22
+// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/reduceRight
+if (!Array.prototype.reduceRight) {
+ Array.prototype.reduceRight = function reduceRight(fun /*, initial*/) {
+ var self = toObject(this),
+ length = self.length >>> 0;
+
+ // If no callback function or if callback is not a callable function
+ if (toString(fun) != "[object Function]") {
+ throw new TypeError(); // TODO message
+ }
+
+ // no value to return if no initial value, empty array
+ if (!length && arguments.length == 1)
+ throw new TypeError(); // TODO message
+
+ var result, i = length - 1;
+ if (arguments.length >= 2) {
+ result = arguments[1];
+ } else {
+ do {
+ if (i in self) {
+ result = self[i--];
+ break;
+ }
+
+ // if array contains no values, no initial value to return
+ if (--i < 0)
+ throw new TypeError(); // TODO message
+ } while (true);
+ }
+
+ do {
+ if (i in this)
+ result = fun.call(void 0, result, self[i], i, self);
+ } while (i--);
+
+ return result;
+ };
+}
+
+// ES5 15.4.4.14
+// http://es5.github.com/#x15.4.4.14
+// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/indexOf
+if (!Array.prototype.indexOf) {
+ Array.prototype.indexOf = function indexOf(sought /*, fromIndex */ ) {
+ var self = toObject(this),
+ length = self.length >>> 0;
+
+ if (!length)
+ return -1;
+
+ var i = 0;
+ if (arguments.length > 1)
+ i = toInteger(arguments[1]);
+
+ // handle negative indices
+ i = i >= 0 ? i : Math.max(0, length + i);
+ for (; i < length; i++) {
+ if (i in self && self[i] === sought) {
+ return i;
+ }
+ }
+ return -1;
+ };
+}
+
+// ES5 15.4.4.15
+// http://es5.github.com/#x15.4.4.15
+// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/lastIndexOf
+if (!Array.prototype.lastIndexOf) {
+ Array.prototype.lastIndexOf = function lastIndexOf(sought /*, fromIndex */) {
+ var self = 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]));
+ // handle negative indices
+ i = i >= 0 ? i : length - Math.abs(i);
+ for (; i >= 0; i--) {
+ if (i in self && sought === self[i])
+ return i;
+ }
+ return -1;
+ };
+}
+
+//
+// Object
+// ======
+//
+
+// ES5 15.2.3.2
+// http://es5.github.com/#x15.2.3.2
+if (!Object.getPrototypeOf) {
+ // https://github.com/kriskowal/es5-shim/issues#issue/2
+ // http://ejohn.org/blog/objectgetprototypeof/
+ // recommended by fschaefer on github
+ Object.getPrototypeOf = function getPrototypeOf(object) {
+ return object.__proto__ || (
+ object.constructor ?
+ object.constructor.prototype :
+ prototypeOfObject
+ );
+ };
+}
+
+// ES5 15.2.3.3
+// http://es5.github.com/#x15.2.3.3
+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 object does not owns property return undefined immediately.
+ if (!owns(object, property))
+ return;
+
+ var descriptor, getter, setter;
+
+ // If object has a property then it's for sure both `enumerable` and
+ // `configurable`.
+ descriptor = { enumerable: true, configurable: true };
+
+ // If JS engine supports accessor properties then property may be a
+ // getter or setter.
+ if (supportsAccessors) {
+ // Unfortunately `__lookupGetter__` will return a getter even
+ // if object has own non getter property along with a same named
+ // inherited getter. To avoid misbehavior we temporary remove
+ // `__proto__` so that `__lookupGetter__` will return getter only
+ // if it's owned by an object.
+ var prototype = object.__proto__;
+ object.__proto__ = prototypeOfObject;
+
+ var getter = lookupGetter(object, property);
+ var setter = lookupSetter(object, property);
+
+ // Once we have getter and setter we can put values back.
+ object.__proto__ = prototype;
+
+ if (getter || setter) {
+ if (getter) descriptor.get = getter;
+ if (setter) descriptor.set = setter;
+
+ // If it was accessor property we're done and return here
+ // in order to avoid adding `value` to the descriptor.
+ return descriptor;
+ }
+ }
+
+ // If we got this far we know that object has an own property that is
+ // not an accessor so we set it as a value and return descriptor.
+ descriptor.value = object[property];
+ return descriptor;
+ };
+}
+
+// ES5 15.2.3.4
+// http://es5.github.com/#x15.2.3.4
+if (!Object.getOwnPropertyNames) {
+ Object.getOwnPropertyNames = function getOwnPropertyNames(object) {
+ return Object.keys(object);
+ };
+}
+
+// ES5 15.2.3.5
+// http://es5.github.com/#x15.2.3.5
+if (!Object.create) {
+ Object.create = function create(prototype, properties) {
+ var object;
+ if (prototype === null) {
+ object = { "__proto__": null };
+ } else {
+ if (typeof prototype != "object")
+ throw new TypeError("typeof prototype["+(typeof prototype)+"] != 'object'");
+ var Type = function () {};
+ Type.prototype = prototype;
+ object = new Type();
+ // IE has no built-in implementation of `Object.getPrototypeOf`
+ // neither `__proto__`, but this manually setting `__proto__` will
+ // guarantee that `Object.getPrototypeOf` will work as expected with
+ // objects created using `Object.create`
+ object.__proto__ = prototype;
+ }
+ if (properties !== void 0)
+ Object.defineProperties(object, properties);
+ return object;
+ };
+}
+
+// ES5 15.2.3.6
+// http://es5.github.com/#x15.2.3.6
+
+// Patch for WebKit and IE8 standard mode
+// Designed by hax <hax.github.com>
+// related issue: https://github.com/kriskowal/es5-shim/issues#issue/5
+// IE8 Reference:
+// http://msdn.microsoft.com/en-us/library/dd282900.aspx
+// http://msdn.microsoft.com/en-us/library/dd229916.aspx
+// WebKit Bugs:
+// https://bugs.webkit.org/show_bug.cgi?id=36423
+
+function doesDefinePropertyWork(object) {
+ try {
+ Object.defineProperty(object, "sentinel", {});
+ return "sentinel" in object;
+ } catch (exception) {
+ // returns falsy
+ }
+}
+
+// check whether defineProperty works if it's given. Otherwise,
+// shim partially.
+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);
+
+ // make a valiant attempt to use the real defineProperty
+ // for I8's DOM elements.
+ if (definePropertyFallback) {
+ try {
+ return definePropertyFallback.call(Object, object, property, descriptor);
+ } catch (exception) {
+ // try the shim if the real one doesn't work
+ }
+ }
+
+ // If it's a data property.
+ if (owns(descriptor, "value")) {
+ // fail silently if "writable", "enumerable", or "configurable"
+ // are requested but not supported
+ /*
+ // alternate approach:
+ if ( // can't implement these features; allow false but not true
+ !(owns(descriptor, "writable") ? descriptor.writable : true) ||
+ !(owns(descriptor, "enumerable") ? descriptor.enumerable : true) ||
+ !(owns(descriptor, "configurable") ? descriptor.configurable : true)
+ )
+ throw new RangeError(
+ "This implementation of Object.defineProperty does not " +
+ "support configurable, enumerable, or writable."
+ );
+ */
+
+ if (supportsAccessors && (lookupGetter(object, property) ||
+ lookupSetter(object, property)))
+ {
+ // As accessors are supported only on engines implementing
+ // `__proto__` we can safely override `__proto__` while defining
+ // a property to make sure that we don't hit an inherited
+ // accessor.
+ var prototype = object.__proto__;
+ object.__proto__ = prototypeOfObject;
+ // Deleting a property anyway since getter / setter may be
+ // defined on object itself.
+ delete object[property];
+ object[property] = descriptor.value;
+ // Setting original `__proto__` back now.
+ object.__proto__ = prototype;
+ } else {
+ object[property] = descriptor.value;
+ }
+ } else {
+ if (!supportsAccessors)
+ throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED);
+ // If we got that far then getters and setters can be defined !!
+ if (owns(descriptor, "get"))
+ defineGetter(object, property, descriptor.get);
+ if (owns(descriptor, "set"))
+ defineSetter(object, property, descriptor.set);
+ }
+
+ return object;
+ };
+}
+
+// ES5 15.2.3.7
+// http://es5.github.com/#x15.2.3.7
+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;
+ };
+}
+
+// ES5 15.2.3.8
+// http://es5.github.com/#x15.2.3.8
+if (!Object.seal) {
+ Object.seal = function seal(object) {
+ // this is misleading and breaks feature-detection, but
+ // allows "securable" code to "gracefully" degrade to working
+ // but insecure code.
+ return object;
+ };
+}
+
+// ES5 15.2.3.9
+// http://es5.github.com/#x15.2.3.9
+if (!Object.freeze) {
+ Object.freeze = function freeze(object) {
+ // this is misleading and breaks feature-detection, but
+ // allows "securable" code to "gracefully" degrade to working
+ // but insecure code.
+ return object;
+ };
+}
+
+// detect a Rhino bug and patch it
+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);
+}
+
+// ES5 15.2.3.10
+// http://es5.github.com/#x15.2.3.10
+if (!Object.preventExtensions) {
+ Object.preventExtensions = function preventExtensions(object) {
+ // this is misleading and breaks feature-detection, but
+ // allows "securable" code to "gracefully" degrade to working
+ // but insecure code.
+ return object;
+ };
+}
+
+// ES5 15.2.3.11
+// http://es5.github.com/#x15.2.3.11
+if (!Object.isSealed) {
+ Object.isSealed = function isSealed(object) {
+ return false;
+ };
+}
+
+// ES5 15.2.3.12
+// http://es5.github.com/#x15.2.3.12
+if (!Object.isFrozen) {
+ Object.isFrozen = function isFrozen(object) {
+ return false;
+ };
+}
+
+// ES5 15.2.3.13
+// http://es5.github.com/#x15.2.3.13
+if (!Object.isExtensible) {
+ Object.isExtensible = function isExtensible(object) {
+ // 1. If Type(O) is not Object throw a TypeError exception.
+ if (Object(object) === object) {
+ throw new TypeError(); // TODO message
+ }
+ // 2. Return the Boolean value of the [[Extensible]] internal property of O.
+ var name = '';
+ while (owns(object, name)) {
+ name += '?';
+ }
+ object[name] = true;
+ var returnValue = owns(object, name);
+ delete object[name];
+ return returnValue;
+ };
+}
+
+// ES5 15.2.3.14
+// http://es5.github.com/#x15.2.3.14
+if (!Object.keys) {
+ // http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation
+ 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;
+ };
+
+}
+
+//
+// Date
+// ====
+//
+
+// ES5 15.9.5.43
+// http://es5.github.com/#x15.9.5.43
+// This function returns a String value represent the instance in time
+// represented by this Date object. The format of the String is the Date Time
+// string format defined in 15.9.1.15. All fields are present in the String.
+// The time zone is always UTC, denoted by the suffix Z. If the time value of
+// this object is not a finite Number a RangeError exception is thrown.
+if (!Date.prototype.toISOString || (new Date(-62198755200000).toISOString().indexOf('-000001') === -1)) {
+ Date.prototype.toISOString = function toISOString() {
+ var result, length, value, year;
+ if (!isFinite(this))
+ throw new RangeError;
+
+ // the date time string format is specified in 15.9.1.15.
+ result = [this.getUTCMonth() + 1, this.getUTCDate(),
+ this.getUTCHours(), this.getUTCMinutes(), this.getUTCSeconds()];
+ year = this.getUTCFullYear();
+ year = (year < 0 ? '-' : (year > 9999 ? '+' : '')) + ('00000' + Math.abs(year)).slice(0 <= year && year <= 9999 ? -4 : -6);
+
+ length = result.length;
+ while (length--) {
+ value = result[length];
+ // pad months, days, hours, minutes, and seconds to have two digits.
+ if (value < 10)
+ result[length] = "0" + value;
+ }
+ // pad milliseconds to have three digits.
+ return year + "-" + result.slice(0, 2).join("-") + "T" + result.slice(2).join(":") + "." +
+ ("000" + this.getUTCMilliseconds()).slice(-3) + "Z";
+ }
+}
+
+// ES5 15.9.4.4
+// http://es5.github.com/#x15.9.4.4
+if (!Date.now) {
+ Date.now = function now() {
+ return new Date().getTime();
+ };
+}
+
+// ES5 15.9.5.44
+// http://es5.github.com/#x15.9.5.44
+// This function provides a String representation of a Date object for use by
+// JSON.stringify (15.12.3).
+if (!Date.prototype.toJSON) {
+ Date.prototype.toJSON = function toJSON(key) {
+ // When the toJSON method is called with argument key, the following
+ // steps are taken:
+
+ // 1. Let O be the result of calling ToObject, giving it the this
+ // value as its argument.
+ // 2. Let tv be ToPrimitive(O, hint Number).
+ // 3. If tv is a Number and is not finite, return null.
+ // XXX
+ // 4. Let toISO be the result of calling the [[Get]] internal method of
+ // O with argument "toISOString".
+ // 5. If IsCallable(toISO) is false, throw a TypeError exception.
+ if (typeof this.toISOString != "function")
+ throw new TypeError(); // TODO message
+ // 6. Return the result of calling the [[Call]] internal method of
+ // toISO with O as the this value and an empty argument list.
+ return this.toISOString();
+
+ // NOTE 1 The argument is ignored.
+
+ // NOTE 2 The toJSON function is intentionally generic; it does not
+ // require that its this value be a Date object. Therefore, it can be
+ // transferred to other kinds of objects for use as a method. However,
+ // it does require that any such object have a toISOString method. An
+ // object is free to use the argument key to filter its
+ // stringification.
+ };
+}
+
+// ES5 15.9.4.2
+// http://es5.github.com/#x15.9.4.2
+// based on work shared by Daniel Friesen (dantman)
+// http://gist.github.com/303249
+if (Date.parse("+275760-09-13T00:00:00.000Z") !== 8.64e15) {
+ // XXX global assignment won't work in embeddings that use
+ // an alternate object for the context.
+ Date = (function(NativeDate) {
+
+ // Date.length === 7
+ var Date = function Date(Y, M, D, h, m, s, ms) {
+ var length = arguments.length;
+ if (this instanceof NativeDate) {
+ var date = length == 1 && String(Y) === Y ? // isString(Y)
+ // We explicitly pass it through parse:
+ new NativeDate(Date.parse(Y)) :
+ // We have to manually make calls depending on argument
+ // length here
+ length >= 7 ? new NativeDate(Y, M, D, h, m, s, ms) :
+ length >= 6 ? new NativeDate(Y, M, D, h, m, s) :
+ length >= 5 ? new NativeDate(Y, M, D, h, m) :
+ length >= 4 ? new NativeDate(Y, M, D, h) :
+ length >= 3 ? new NativeDate(Y, M, D) :
+ length >= 2 ? new NativeDate(Y, M) :
+ length >= 1 ? new NativeDate(Y) :
+ new NativeDate();
+ // Prevent mixups with unfixed Date object
+ date.constructor = Date;
+ return date;
+ }
+ return NativeDate.apply(this, arguments);
+ };
+
+ // 15.9.1.15 Date Time String Format.
+ var isoDateExpression = new RegExp("^" +
+ "(\\d{4}|[\+\-]\\d{6})" + // four-digit year capture or sign + 6-digit extended year
+ "(?:-(\\d{2})" + // optional month capture
+ "(?:-(\\d{2})" + // optional day capture
+ "(?:" + // capture hours:minutes:seconds.milliseconds
+ "T(\\d{2})" + // hours capture
+ ":(\\d{2})" + // minutes capture
+ "(?:" + // optional :seconds.milliseconds
+ ":(\\d{2})" + // seconds capture
+ "(?:\\.(\\d{3}))?" + // milliseconds capture
+ ")?" +
+ "(?:" + // capture UTC offset component
+ "Z|" + // UTC capture
+ "(?:" + // offset specifier +/-hours:minutes
+ "([-+])" + // sign capture
+ "(\\d{2})" + // hours offset capture
+ ":(\\d{2})" + // minutes offset capture
+ ")" +
+ ")?)?)?)?" +
+ "$");
+
+ // Copy any custom methods a 3rd party library may have added
+ for (var key in NativeDate)
+ Date[key] = NativeDate[key];
+
+ // Copy "native" methods explicitly; they may be non-enumerable
+ Date.now = NativeDate.now;
+ Date.UTC = NativeDate.UTC;
+ Date.prototype = NativeDate.prototype;
+ Date.prototype.constructor = Date;
+
+ // Upgrade Date.parse to handle simplified ISO 8601 strings
+ Date.parse = function parse(string) {
+ var match = isoDateExpression.exec(string);
+ if (match) {
+ match.shift(); // kill match[0], the full match
+ // parse months, days, hours, minutes, seconds, and milliseconds
+ for (var i = 1; i < 7; i++) {
+ // provide default values if necessary
+ match[i] = +(match[i] || (i < 3 ? 1 : 0));
+ // match[1] is the month. Months are 0-11 in JavaScript
+ // `Date` objects, but 1-12 in ISO notation, so we
+ // decrement.
+ if (i == 1)
+ match[i]--;
+ }
+
+ // parse the UTC offset component
+ var minuteOffset = +match.pop(), hourOffset = +match.pop(), sign = match.pop();
+
+ // compute the explicit time zone offset if specified
+ var offset = 0;
+ if (sign) {
+ // detect invalid offsets and return early
+ if (hourOffset > 23 || minuteOffset > 59)
+ return NaN;
+
+ // express the provided time zone offset in minutes. The offset is
+ // negative for time zones west of UTC; positive otherwise.
+ offset = (hourOffset * 60 + minuteOffset) * 6e4 * (sign == "+" ? -1 : 1);
+ }
+
+ // Date.UTC for years between 0 and 99 converts year to 1900 + year
+ // The Gregorian calendar has a 400-year cycle, so
+ // to Date.UTC(year + 400, .... ) - 12622780800000 == Date.UTC(year, ...),
+ // where 12622780800000 - number of milliseconds in Gregorian calendar 400 years
+ var year = +match[0];
+ if (0 <= year && year <= 99) {
+ match[0] = year + 400;
+ return NativeDate.UTC.apply(this, match) + offset - 12622780800000;
+ }
+
+ // compute a new UTC date value, accounting for the optional offset
+ return NativeDate.UTC.apply(this, match) + offset;
+ }
+ return NativeDate.parse.apply(this, arguments);
+ };
+
+ return Date;
+ })(Date);
+}
+
+//
+// String
+// ======
+//
+
+// ES5 15.5.4.20
+// http://es5.github.com/#x15.5.4.20
+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()) {
+ // http://blog.stevenlevithan.com/archives/faster-trim-javascript
+ // http://perfectionkills.com/whitespace-deviations/
+ ws = "[" + ws + "]";
+ var trimBeginRegexp = new RegExp("^" + ws + ws + "*"),
+ trimEndRegexp = new RegExp(ws + ws + "*$");
+ String.prototype.trim = function trim() {
+ return String(this).replace(trimBeginRegexp, "").replace(trimEndRegexp, "");
+ };
+}
+
+//
+// Util
+// ======
+//
+
+// ES5 9.4
+// http://es5.github.com/#x9.4
+// http://jsperf.com/to-integer
+var toInteger = function (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;
+};
+
+var prepareString = "a"[0] != "a",
+ // ES5 9.9
+ // http://es5.github.com/#x9.9
+ toObject = function (o) {
+ if (o == null) { // this matches both null and undefined
+ throw new TypeError(); // TODO message
+ }
+ // If the implementation doesn't support by-index access of
+ // string characters (ex. IE < 7), split the string
+ if (prepareString && typeof o == "string" && o) {
+ return o.split("");
+ }
+ 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<listeners.length; i++) {
+ listeners[i](e);
+ if (e.propagationStopped)
+ break;
+ }
+
+ if (defaultHandler && !e.defaultPrevented)
+ return defaultHandler(e);
+};
+
+EventEmitter.setDefaultHandler = function(eventName, callback) {
+ this._defaultHandlers = this._defaultHandlers || {};
+
+ if (this._defaultHandlers[eventName])
+ throw new Error("The default handler for '" + eventName + "' is already set");
+
+ this._defaultHandlers[eventName] = callback;
+};
+
+EventEmitter.on =
+EventEmitter.addEventListener = function(eventName, callback) {
+ this._eventRegistry = this._eventRegistry || {};
+
+ var listeners = this._eventRegistry[eventName];
+ if (!listeners)
+ listeners = this._eventRegistry[eventName] = [];
+
+ if (listeners.indexOf(callback) == -1)
+ listeners.push(callback);
+};
+
+EventEmitter.removeListener =
+EventEmitter.removeEventListener = function(eventName, callback) {
+ this._eventRegistry = this._eventRegistry || {};
+
+ var listeners = this._eventRegistry[eventName];
+ if (!listeners)
+ return;
+
+ var index = listeners.indexOf(callback);
+ if (index !== -1)
+ listeners.splice(index, 1);
+};
+
+EventEmitter.removeAllListeners = function(eventName) {
+ if (this._eventRegistry) this._eventRegistry[eventName] = [];
+};
+
+exports.EventEmitter = EventEmitter;
+
+});
+
+define('ace/lib/oop', ['require', 'exports', 'module' ], function(require, exports, module) {
+
+
+exports.inherits = (function() {
+ var tempCtor = function() {};
+ return function(ctor, superCtor) {
+ tempCtor.prototype = superCtor.prototype;
+ ctor.super_ = superCtor.prototype;
+ ctor.prototype = new tempCtor();
+ ctor.prototype.constructor = ctor;
+ };
+}());
+
+exports.mixin = function(obj, mixin) {
+ for (var key in mixin) {
+ obj[key] = mixin[key];
+ }
+};
+
+exports.implement = function(proto, mixin) {
+ exports.mixin(proto, mixin);
+};
+
+});
+
+define('ace/mode/xquery_worker', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/worker/mirror', 'ace/mode/xquery/xquery', 'ace/tokenizer', 'ace/mode/xquery_highlight_rules'], function(require, exports, module) {
+
+
+var oop = require("../lib/oop");
+var Mirror = require("../worker/mirror").Mirror;
+var xquery = require("../mode/xquery/xquery");
+var Tokenizer = require("../tokenizer").Tokenizer;
+var XQueryHighlightRules = require("./xquery_highlight_rules").XQueryHighlightRules;
+
+window.addEventListener = function() {};
+
+
+var XQueryWorker = exports.XQueryWorker = function(sender) {
+ Mirror.call(this, sender);
+ this.setTimeout(200);
+};
+
+oop.inherits(XQueryWorker, Mirror);
+
+(function() {
+
+ this.onUpdate = function() {
+ this.sender.emit("start");
+ var value = this.doc.getValue();
+ var parser = xquery.getParser(value);
+ var ast = parser.p_Module();
+ if(parser.hasErrors()) {
+ var errors = parser.getErrors();
+ var i = 0;
+ for(i in errors) {
+ var error = errors[i];
+ this.sender.emit("error", {
+ row: error.line,
+ column: error.column,
+ text: error.message,
+ type: "error"
+ });
+ }
+ } else {
+ this.sender.emit("ok");
+ }
+ parser.highlighter.tokenizer = new Tokenizer(new XQueryHighlightRules().getRules());
+ var tokens = parser.highlighter.getTokens();
+ this.sender.emit("highlight", tokens);
+ };
+
+}).call(XQueryWorker.prototype);
+
+});
+define('ace/worker/mirror', ['require', 'exports', 'module' , 'ace/document', 'ace/lib/lang'], function(require, exports, module) {
+
+
+var Document = require("../document").Document;
+var lang = require("../lib/lang");
+
+var Mirror = exports.Mirror = function(sender) {
+ this.sender = sender;
+ var doc = this.doc = new Document("");
+
+ var deferredUpdate = this.deferredUpdate = lang.deferredCall(this.onUpdate.bind(this));
+
+ var _self = this;
+ sender.on("change", function(e) {
+ doc.applyDeltas([e.data]);
+ deferredUpdate.schedule(_self.$timeout);
+ });
+};
+
+(function() {
+
+ this.$timeout = 500;
+
+ this.setTimeout = function(timeout) {
+ this.$timeout = timeout;
+ };
+
+ this.setValue = function(value) {
+ this.doc.setValue(value);
+ this.deferredUpdate.schedule(this.$timeout);
+ };
+
+ this.getValue = function(callbackId) {
+ this.sender.callback(this.doc.getValue(), callbackId);
+ };
+
+ this.onUpdate = function() {
+ // abstract method
+ };
+
+}).call(Mirror.prototype);
+
+});
+
+define('ace/document', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/event_emitter', 'ace/range', 'ace/anchor'], function(require, exports, module) {
+
+
+var oop = require("./lib/oop");
+var EventEmitter = require("./lib/event_emitter").EventEmitter;
+var Range = require("./range").Range;
+var Anchor = require("./anchor").Anchor;
+
+ /**
+ * new Document([text])
+ * - text (String | Array): The starting text
+ *
+ * Creates a new `Document`. If `text` is included, the `Document` contains those strings; otherwise, it's empty.
+ *
+ **/
+
+var Document = function(text) {
+ this.$lines = [];
+
+ // There has to be one line at least in the document. If you pass an empty
+ // string to the insert function, nothing will happen. Workaround.
+ if (text.length == 0) {
+ this.$lines = [""];
+ } else if (Array.isArray(text)) {
+ this.insertLines(0, text);
+ } else {
+ this.insert({row: 0, column:0}, text);
+ }
+};
+
+(function() {
+
+ oop.implement(this, EventEmitter);
+ this.setValue = function(text) {
+ var len = this.getLength();
+ this.remove(new Range(0, 0, len, this.getLine(len-1).length));
+ this.insert({row: 0, column:0}, text);
+ };
+ this.getValue = function() {
+ return this.getAllLines().join(this.getNewLineCharacter());
+ };
+ this.createAnchor = function(row, column) {
+ return new Anchor(this, row, column);
+ };
+
+ // check for IE split bug
+ if ("aaa".split(/a/).length == 0)
+ this.$split = function(text) {
+ return text.replace(/\r\n|\r/g, "\n").split("\n");
+ }
+ else
+ this.$split = function(text) {
+ return text.split(/\r\n|\r|\n/);
+ };
+ this.$detectNewLine = function(text) {
+ var match = text.match(/^.*?(\r\n|\r|\n)/m);
+ if (match) {
+ this.$autoNewLine = match[1];
+ } else {
+ this.$autoNewLine = "\n";
+ }
+ };
+ this.getNewLineCharacter = function() {
+ switch (this.$newLineMode) {
+ case "windows":
+ return "\r\n";
+
+ case "unix":
+ return "\n";
+
+ case "auto":
+ return this.$autoNewLine;
+ }
+ };
+
+ this.$autoNewLine = "\n";
+ this.$newLineMode = "auto";
+ this.setNewLineMode = function(newLineMode) {
+ if (this.$newLineMode === newLineMode)
+ return;
+
+ this.$newLineMode = newLineMode;
+ };
+ this.getNewLineMode = function() {
+ return this.$newLineMode;
+ };
+ this.isNewLine = function(text) {
+ return (text == "\r\n" || text == "\r" || text == "\n");
+ };
+ this.getLine = function(row) {
+ return this.$lines[row] || "";
+ };
+ this.getLines = function(firstRow, lastRow) {
+ return this.$lines.slice(firstRow, lastRow + 1);
+ };
+ this.getAllLines = function() {
+ return this.getLines(0, this.getLength());
+ };
+ this.getLength = function() {
+ return this.$lines.length;
+ };
+ this.getTextRange = function(range) {
+ if (range.start.row == range.end.row) {
+ return this.$lines[range.start.row].substring(range.start.column,
+ range.end.column);
+ }
+ else {
+ var lines = this.getLines(range.start.row+1, range.end.row-1);
+ lines.unshift((this.$lines[range.start.row] || "").substring(range.start.column));
+ lines.push((this.$lines[range.end.row] || "").substring(0, range.end.column));
+ return lines.join(this.getNewLineCharacter());
+ }
+ };
+ this.$clipPosition = function(position) {
+ var length = this.getLength();
+ if (position.row >= 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);
+
+ // only detect new lines if the document has no line break yet
+ 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;
+ };
+ /**
+ * Document@change(e)
+ * - e (Object): Contains at least one property called `"action"`. `"action"` indicates the action that triggered the change. Each action also has a set of additional properties.
+ *
+ * Fires whenever the document changes.
+ *
+ * Several methods trigger different `"change"` events. Below is a list of each action type, followed by each property that's also available:
+ *
+ * * `"insertLines"` (emitted by [[Document.insertLines]])
+ * * `range`: the [[Range]] of the change within the document
+ * * `lines`: the lines in the document that are changing
+ * * `"insertText"` (emitted by [[Document.insertNewLine]])
+ * * `range`: the [[Range]] of the change within the document
+ * * `text`: the text that's being added
+ * * `"removeLines"` (emitted by [[Document.insertLines]])
+ * * `range`: the [[Range]] of the change within the document
+ * * `lines`: the lines in the document that were removed
+ * * `nl`: the new line character (as defined by [[Document.getNewLineCharacter]])
+ * * `"removeText"` (emitted by [[Document.removeInLine]] and [[Document.removeNewLine]])
+ * * `range`: the [[Range]] of the change within the document
+ * * `text`: the text that's being removed
+ *
+ **/
+ this.insertLines = function(row, lines) {
+ if (lines.length == 0)
+ return {row: row, column: 0};
+
+ // apply doesn't work for big arrays (smallest threshold is on safari 0xFFFF)
+ // to circumvent that we have to break huge inserts into smaller chunks here
+ 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) {
+ // clip to document
+ 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;
+
+ // Shortcut: If the text we want to insert is the same as it is already
+ // in the document, we don't have to replace anything.
+ 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<deltas.length; i++) {
+ var delta = deltas[i];
+ var range = Range.fromPoints(delta.range.start, delta.range.end);
+
+ if (delta.action == "insertLines")
+ this.insertLines(range.start.row, delta.lines);
+ else if (delta.action == "insertText")
+ this.insert(range.start, delta.text);
+ else if (delta.action == "removeLines")
+ this.removeLines(range.start.row, range.end.row - 1);
+ else if (delta.action == "removeText")
+ this.remove(range);
+ }
+ };
+ this.revertDeltas = function(deltas) {
+ for (var i=deltas.length-1; 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);
+ }
+ };
+
+}).call(Document.prototype);
+
+exports.Document = Document;
+});
+
+define('ace/range', ['require', 'exports', 'module' ], function(require, exports, module) {
+
+
+/**
+ * class Range
+ *
+ * This object is used in various places to indicate a region within the editor. To better visualize how this works, imagine a rectangle. Each quadrant of the rectangle is analogus to a range, as ranges contain a starting row and starting column, and an ending row, and ending column.
+ *
+ **/
+
+/**
+ * new Range(startRow, startColumn, endRow, endColumn)
+ * - startRow (Number): The starting row
+ * - startColumn (Number): The starting column
+ * - endRow (Number): The ending row
+ * - endColumn (Number): The ending column
+ *
+ * Creates a new `Range` object with the given starting and ending row and column points.
+ *
+ **/
+var Range = function(startRow, startColumn, endRow, endColumn) {
+ this.start = {
+ row: startRow,
+ column: startColumn
+ };
+
+ this.end = {
+ row: endRow,
+ column: endColumn
+ };
+};
+
+(function() {
+ /**
+ * Range.isEqual(range) -> Boolean
+ * - range (Range): A range to check against
+ *
+ * Returns `true` if and only if the starting row and column, and ending tow and column, are equivalent to those given by `range`.
+ *
+ **/
+ 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;
+ }
+ }
+ }
+
+ /** related to: Range.compare
+ * Range.comparePoint(p) -> Number
+ * - p (Range): A point to compare with
+ * + (Number): This method returns one of the following numbers:<br/>
+ * * `0` if the two points are exactly equal<br/>
+ * * `-1` if `p.row` is less then the calling range<br/>
+ * * `1` if `p.row` is greater than the calling range<br/>
+ * <br/>
+ * If the starting row of the calling range is equal to `p.row`, and:<br/>
+ * * `p.column` is greater than or equal to the calling range's starting column, this returns `0`<br/>
+ * * Otherwise, it returns -1<br/>
+ *<br/>
+ * If the ending row of the calling range is equal to `p.row`, and:<br/>
+ * * `p.column` is less than or equal to the calling range's ending column, this returns `0`<br/>
+ * * Otherwise, it returns 1<br/>
+ *
+ * Checks the row and column points of `p` with the row and column points of the calling range.
+ *
+ *
+ *
+ **/
+ this.comparePoint = function(p) {
+ return this.compare(p.row, p.column);
+ }
+
+ /** related to: Range.comparePoint
+ * Range.containsRange(range) -> Boolean
+ * - range (Range): A range to compare with
+ *
+ * Checks the start and end points of `range` and compares them to the calling range. Returns `true` if the `range` is contained within the caller's range.
+ *
+ **/
+ this.containsRange = function(range) {
+ return this.comparePoint(range.start) == 0 && this.comparePoint(range.end) == 0;
+ }
+
+ /**
+ * Range.intersects(range) -> Boolean
+ * - range (Range): A range to compare with
+ *
+ * Returns `true` if passed in `range` intersects with the one calling this method.
+ *
+ **/
+ this.intersects = function(range) {
+ var cmp = this.compareRange(range);
+ return (cmp == -1 || cmp == 0 || cmp == 1);
+ }
+
+ /**
+ * Range.isEnd(row, column) -> Boolean
+ * - row (Number): A row point to compare with
+ * - column (Number): A column point to compare with
+ *
+ * Returns `true` if the caller's ending row point is the same as `row`, and if the caller's ending column is the same as `column`.
+ *
+ **/
+ this.isEnd = function(row, column) {
+ return this.end.row == row && this.end.column == column;
+ }
+
+ /**
+ * Range.isStart(row, column) -> Boolean
+ * - row (Number): A row point to compare with
+ * - column (Number): A column point to compare with
+ *
+ * Returns `true` if the caller's starting row point is the same as `row`, and if the caller's starting column is the same as `column`.
+ *
+ **/
+ this.isStart = function(row, column) {
+ return this.start.row == row && this.start.column == column;
+ }
+
+ /**
+ * Range.setStart(row, column)
+ * - row (Number): A row point to set
+ * - column (Number): A column point to set
+ *
+ * Sets the starting row and column for the range.
+ *
+ **/
+ 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;
+ }
+ }
+
+ /**
+ * Range.setEnd(row, column)
+ * - row (Number): A row point to set
+ * - column (Number): A column point to set
+ *
+ * Sets the starting row and column for the range.
+ *
+ **/
+ 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;
+ }
+ }
+
+ /** related to: Range.compare
+ * Range.inside(row, column) -> Boolean
+ * - row (Number): A row point to compare with
+ * - column (Number): A column point to compare with
+ *
+ * Returns `true` if the `row` and `column` are within the given range.
+ *
+ **/
+ 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;
+ }
+
+ /** related to: Range.compare
+ * Range.insideStart(row, column) -> Boolean
+ * - row (Number): A row point to compare with
+ * - column (Number): A column point to compare with
+ *
+ * Returns `true` if the `row` and `column` are within the given range's starting points.
+ *
+ **/
+ this.insideStart = function(row, column) {
+ if (this.compare(row, column) == 0) {
+ if (this.isEnd(row, column)) {
+ return false;
+ } else {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /** related to: Range.compare
+ * Range.insideEnd(row, column) -> Boolean
+ * - row (Number): A row point to compare with
+ * - column (Number): A column point to compare with
+ *
+ * Returns `true` if the `row` and `column` are within the given range's ending points.
+ *
+ **/
+ this.insideEnd = function(row, column) {
+ if (this.compare(row, column) == 0) {
+ if (this.isStart(row, column)) {
+ return false;
+ } else {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Range.compare(row, column) -> Number
+ * - row (Number): A row point to compare with
+ * - column (Number): A column point to compare with
+ * + (Number): This method returns one of the following numbers:<br/>
+ * * `0` if the two points are exactly equal <br/>
+ * * `-1` if `p.row` is less then the calling range <br/>
+ * * `1` if `p.row` is greater than the calling range <br/>
+ * <br/>
+ * If the starting row of the calling range is equal to `p.row`, and: <br/>
+ * * `p.column` is greater than or equal to the calling range's starting column, this returns `0`<br/>
+ * * Otherwise, it returns -1<br/>
+ * <br/>
+ * If the ending row of the calling range is equal to `p.row`, and: <br/>
+ * * `p.column` is less than or equal to the calling range's ending column, this returns `0` <br/>
+ * * Otherwise, it returns 1
+ *
+ * Checks the row and column points with the row and column points of the calling range.
+ *
+ *
+ **/
+ 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);
+ }
+ }
+
+ /**
+ * Range.compareEnd(row, column) -> Number
+ * - row (Number): A row point to compare with
+ * - column (Number): A column point to compare with
+ * + (Number): This method returns one of the following numbers:<br/>
+ * * `0` if the two points are exactly equal<br/>
+ * * `-1` if `p.row` is less then the calling range<br/>
+ * * `1` if `p.row` is greater than the calling range, or if `isEnd` is `true.<br/>
+ * <br/>
+ * If the starting row of the calling range is equal to `p.row`, and:<br/>
+ * * `p.column` is greater than or equal to the calling range's starting column, this returns `0`<br/>
+ * * Otherwise, it returns -1<br/>
+ *<br/>
+ * If the ending row of the calling range is equal to `p.row`, and:<br/>
+ * * `p.column` is less than or equal to the calling range's ending column, this returns `0`<br/>
+ * * Otherwise, it returns 1
+ *
+ * Checks the row and column points with the row and column points of the calling range.
+ *
+ *
+ **/
+ this.compareEnd = function(row, column) {
+ if (this.end.row == row && this.end.column == column) {
+ return 1;
+ } else {
+ return this.compare(row, column);
+ }
+ }
+
+ /**
+ * Range.compareInside(row, column) -> Number
+ * - row (Number): A row point to compare with
+ * - column (Number): A column point to compare with
+ * + (Number): This method returns one of the following numbers:<br/>
+ * * `1` if the ending row of the calling range is equal to `row`, and the ending column of the calling range is equal to `column`<br/>
+ * * `-1` if the starting row of the calling range is equal to `row`, and the starting column of the calling range is equal to `column`<br/>
+ * <br/>
+ * Otherwise, it returns the value after calling [[Range.compare `compare()`]].
+ *
+ * Checks the row and column points with the row and column points of the calling range.
+ *
+ *
+ *
+ **/
+ 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);
+ }
+ }
+
+ /**
+ * Range.clipRows(firstRow, lastRow) -> Range
+ * - firstRow (Number): The starting row
+ * - lastRow (Number): The ending row
+ *
+ * Returns the part of the current `Range` that occurs within the boundaries of `firstRow` and `lastRow` as a new `Range` object.
+ *
+ **/
+ 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;
+
+/**
+ * new Anchor(doc, row, column)
+ * - doc (Document): The document to associate with the anchor
+ * - row (Number): The starting row position
+ * - column (Number): The starting column position
+ *
+ * Creates a new `Anchor` and associates it with a document.
+ *
+ **/
+
+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) {
+ return new Array(count + 1).join(string);
+};
+
+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<l; i++) {
+ if (array[i] && typeof array[i] == "object")
+ copy[i] = this.copyObject( array[i] );
+ else
+ copy[i] = array[i];
+ }
+ return copy;
+};
+
+exports.deepCopy = function (obj) {
+ if (typeof obj != "object") {
+ return obj;
+ }
+
+ var copy = obj.constructor();
+ for (var key in obj) {
+ if (typeof obj[key] == "object") {
+ copy[key] = this.deepCopy(obj[key]);
+ } else {
+ copy[key] = obj[key];
+ }
+ }
+ return copy;
+};
+
+exports.arrayToMap = function(arr) {
+ var map = {};
+ for (var i=0; i<arr.length; i++) {
+ map[arr[i]] = 1;
+ }
+ return map;
+
+};
+
+exports.createMap = function(props) {
+ var map = Object.create(null);
+ for (var i in props) {
+ map[i] = props[i];
+ }
+ return map;
+};
+exports.arrayRemove = function(array, value) {
+ for (var i = 0; i <= array.length; i++) {
+ if (value === array[i]) {
+ array.splice(i, 1);
+ }
+ }
+};
+
+exports.escapeRegExp = function(str) {
+ return str.replace(/([.*+?^${}()|[\]\/\\])/g, '\\$1');
+};
+
+exports.getMatchOffsets = function(string, regExp) {
+ var matches = [];
+
+ string.replace(regExp, function(str) {
+ matches.push({
+ offset: arguments[arguments.length-2],
+ length: str.length
+ });
+ });
+
+ return matches;
+};
+
+
+exports.deferredCall = function(fcn) {
+
+ var timer = null;
+ var callback = function() {
+ timer = null;
+ fcn();
+ };
+
+ var deferred = function(timeout) {
+ deferred.cancel();
+ timer = setTimeout(callback, timeout || 0);
+ return deferred;
+ };
+
+ deferred.schedule = deferred;
+
+ deferred.call = function() {
+ this.cancel();
+ fcn();
+ return deferred;
+ };
+
+ deferred.cancel = function() {
+ clearTimeout(timer);
+ timer = null;
+ return deferred;
+ };
+
+ return deferred;
+};
+
+});
+
+define('ace/mode/xquery/xquery', ['require', 'exports', 'module' , 'ace/mode/xquery/antlr3-all', 'ace/mode/xquery/XQueryLexer', 'ace/mode/xquery/XQueryParser'], function(require, exports, module) {
+
+ var antlr = require("./antlr3-all");
+ var org = antlr.org;
+ var NewLazyTokenStream = antlr.NewLazyTokenStream;
+ var XQueryLexer = require("./XQueryLexer").XQueryLexer;
+ var XQueryParser = require("./XQueryParser").XQueryParser;
+
+ exports.getParser = function(code) {
+ var cstream = new org.antlr.runtime.ANTLRStringStream(code);
+ var lexer = new XQueryLexer(cstream);
+ var tstream = new NewLazyTokenStream(lexer);
+ tstream.jumpToFirstValidToken();
+ var parser = new XQueryParser(tstream);
+ parser.setSource(cstream);
+ return parser;
+ };
+});
+/*
+Some portions:
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.1
+*/
+define('ace/mode/xquery/antlr3-all', ['require', 'exports', 'module' ], function(require, exports, module) {
+var NewLazyTokenStream = exports.NewLazyTokenStream = function(tokenSource) {
+
+ this.tokenSource = tokenSource;
+ this.tokens = [];
+ this.isWsExplicit = false;
+ this.p = 0;
+ this.channel = org.antlr.runtime.Token.DEFAULT_CHANNEL;
+
+ this.LT = function(k) {
+ if (k == 0)
+ return null;
+ if (k < 0)
+ return this.readReverseNthGoodToken(-k);
+
+ return this.readNthGoodToken(k);
+ };
+
+ this.get = function(i) {
+ if (i >= this.tokens.length)
+ return org.antlr.runtime.Token.EOF_TOKEN;
+ else
+ return this.tokens[i];
+ };
+
+ this.getTokenSource = function() {
+ return this.tokenSource;
+ };
+
+ this.toString = function(start, stop) {
+ if(start == undefined) {
+ return this.toString(0, this.tokens.length - 1);
+ } else
+ if(start instanceof org.antlr.runtime.Token) {
+ return this.toString(start.getTokenIndex(), stop.getTokenIndex());
+ } else {
+ if (start < 0)
+ start = 0;
+ if (this.p <= stop) {
+ this.readNTokens(stop - this.p + 1);
+ }
+
+ var sb = "";
+ for (var i = start; i <= stop && i < this.tokens.length; i++) {
+ sb += this.tokens[i].getText();
+ }
+ return sb;
+ }
+ };
+
+ this.LA = function(i) {
+ return this.LT(i).getType();
+ };
+
+ this.done = false;
+
+ this.consume = function() {
+ if (this.done) {
+ return;
+ }
+ this.p++;
+ if (!this.isWsExplicit) {
+ this.jumpToFirstValidToken();
+ }
+ };
+
+ this.getSourceName = function() {
+ return this.getTokenSource().getSourceName();
+ };
+
+ this.index = function() {
+ return this.p;
+ };
+
+ this.mark = function() {
+ this.lastMarker = this.index();
+ return this.lastMarker;
+ };
+
+ this.release = function(marker) {
+ };
+
+ this.rewind = function(marker) {
+ if(arguments.length == 1) {
+ this.seek(marker);
+ } else {
+ this.seek(this.lastMarker);
+ }
+ };
+
+ this.seek = function(index) {
+ this.p = index;
+ this.done = false;
+ };
+
+ this.size = function() {
+ return this.tokens.length;
+ };
+
+ this.setTokenSource = function(source) {
+ this.tokenSource = source;
+ this.setWsExplicit(source.isWsExplicit);
+ // un-read the unused tokens
+ // they are different for the new source
+ if (this.p < this.tokens.length) {
+ var rIndex = this.p > 0 ? this.tokens[this.p - 1].getStopIndex() : 0;
+ this.tokenSource.rewindToIndex(rIndex + 1);
+ for (var i = this.tokens.length - 1; i >= this.p; i--) {
+ this.tokens.splice(i, 1);
+ }
+ }
+
+ // if we ignore WS, jump to next token
+ if (!this.isWsExplicit) {
+ this.jumpToFirstValidToken();
+ }
+ };
+
+ this.setWsExplicit = function(explicit) {
+ this.isWsExplicit = explicit;
+ if (!explicit) {
+ this.jumpToFirstValidToken();
+ }
+ };
+
+ this.readNthGoodToken = function(n) {
+ var count = this.tokens.length;
+ // number of buffered tokens available
+ var avt = count - this.p;
+ // i counts good tokens, j counts all tokens
+ var i = 1, j = 0;
+ var t = null;
+ while (i <= n) {
+ if (j < avt) // read from buffer
+ t = this.tokens[this.p + j];
+ else { // read from source
+ t = this.tokenSource.nextToken();
+ if (t == org.antlr.runtime.Token.EOF_TOKEN) {
+ return t;
+ }
+ t.setTokenIndex(count++);
+ this.tokens.push(t);
+ }
+ if (this.isWsExplicit || t.getChannel() == this.channel) {
+ i++;
+ }
+ j++;
+ }
+ return t;
+ };
+
+ this.readReverseNthGoodToken = function(n) {
+ if (n == 0 || (this.p - n) < 0)
+ return null;
+
+ // i counts good tokens, j counts all tokens
+ var i = 1, j = 0;
+ var t = null;
+ while (this.p - 1 - j >= 0) {
+ t = this.get(this.p - 1 - j);
+
+ if (this.isWsExplicit || t.getChannel() == this.channel) {
+ if (i++ == n)
+ return t;
+ }
+ j++;
+ }
+ return null;
+ };
+
+ this.readNTokens = function(n) {
+ var t = null;
+ for (var i = 0; i < n; i++) {
+ if (this.tokens.length > this.p + i)
+ continue;
+
+ t = this.tokenSource.nextToken();
+ if (t == org.antlr.runtime.Token.EOF_TOKEN)
+ return;
+
+ t.setTokenIndex(this.p + i);
+ this.tokens.push(t);
+ }
+ };
+
+ this.jumpToFirstValidToken = function() {
+ var t = this.LT(1);
+ if (t != org.antlr.runtime.Token.EOF_TOKEN) {
+ this.done = false;
+ this.p = t.getTokenIndex();
+ }
+ };
+};
+
+// create org.antlr module
+if (typeof org == "undefined" || !org) {
+ var org = {};
+}
+if (typeof org.antlr == "undefined" || !org.antlr) {
+ /**
+ * The org.antlr global namespace object. If antlr is already defined, the
+ * existing antlr object will not be overwritten so that defined
+ * namespaces are preserved.
+ * @namespace org.antlr
+ */
+ org.antlr = {};
+}
+
+/**
+ * The global JavaScript object.
+ */
+org.antlr.global = (function() {
+ return this;
+}).call(null);
+org.antlr.namespace = function() {
+ var a=arguments, o=null, i, j, d;
+ for (i=0; i<a.length; i=i+1) {
+ d=a[i].split(".");
+ o=org.antlr.global;
+
+ // ANTLR is implied, so it is ignored if it is included
+ for (j=0; j<d.length; j=j+1) {
+ o[d[j]]=o[d[j]] || {};
+ o=o[d[j]];
+ }
+ }
+
+ return o;
+};
+org.antlr.env = org.antlr.env || {};
+/**
+ * JavaScript runtime library tree parser code.
+ * @name org.antlr.runtime.tree
+ * @namespace
+ */
+org.antlr.namespace("org.antlr.runtime.tree");
+org.antlr.lang = org.antlr.lang || /** @lends org.antlr.lang */ {
+ /**
+ * Determines whether or not the provided object is an array.
+ * Testing typeof/instanceof/constructor of arrays across frame
+ * boundaries isn't possible in Safari unless you have a reference
+ * to the other frame to test against its Array prototype. To
+ * handle this case, we test well-known array properties instead.
+ * properties.
+ * @param {any} o The object being testing
+ * @return {boolean} the result
+ */
+ isArray: function(o) {
+ if (o) {
+ var l = org.antlr.lang;
+ return l.isNumber(o.length) && l.isFunction(o.splice);
+ }
+ return false;
+ },
+
+ /**
+ * Determines whether or not the provided object is a boolean
+ * @param {any} o The object being testing
+ * @return {boolean} the result
+ */
+ isBoolean: function(o) {
+ return typeof o === 'boolean';
+ },
+
+ /**
+ * Determines whether or not the provided object is a function
+ * @param {any} o The object being testing
+ * @return {boolean} the result
+ */
+ isFunction: function(o) {
+ return typeof o === 'function';
+ },
+
+ /**
+ * Determines whether or not the provided object is null
+ * @param {any} o The object being testing
+ * @return {boolean} the result
+ */
+ isNull: function(o) {
+ return o === null;
+ },
+
+ /**
+ * Determines whether or not the provided object is a legal number
+ * @param {any} o The object being testing
+ * @return {boolean} the result
+ */
+ isNumber: function(o) {
+ return typeof o === 'number' && isFinite(o);
+ },
+
+ /**
+ * Determines whether or not the provided object is of type object
+ * or function
+ * @param {any} o The object being testing
+ * @return {boolean} the result
+ */
+ isObject: function(o) {
+return (o && (typeof o === 'object' || org.antlr.lang.isFunction(o))) || false;
+ },
+
+ /**
+ * Determines whether or not the provided object is a string
+ * @param {any} o The object being testing
+ * @return {boolean} the result
+ */
+ isString: function(o) {
+ return typeof o === 'string';
+ },
+
+ /**
+ * Determines whether or not the provided object is undefined
+ * @param {any} o The object being testing
+ * @return {boolean} the result
+ */
+ isUndefined: function(o) {
+ return typeof o === 'undefined';
+ },
+
+ /**
+ * IE will not enumerate native functions in a derived object even if the
+ * function was overridden. This is a workaround for specific functions
+ * we care about on the Object prototype.
+ * @param {Function} r the object to receive the augmentation
+ * @param {Function} s the object that supplies the properties to augment
+ * @private
+ */
+ _IEEnumFix: function(r, s) {
+ if (false) {
+ var add=["toString", "valueOf"], i;
+ for (i=0;i<add.length;i=i+1) {
+ var fname=add[i],f=s[fname];
+ if (org.antlr.lang.isFunction(f) && f!=Object.prototype[fname]) {
+ r[fname]=f;
+ }
+ }
+ }
+ },
+
+ /**
+ * Utility to set up the prototype, constructor and superclass properties to
+ * support an inheritance strategy that can chain constructors and methods.
+ * Static members will not be inherited.
+ *
+ * @method extend
+ * @static
+ * @param {Function} subc the object to modify
+ * @param {Function} superc the object to inherit
+ * @param {Object} [overrides] additional properties/methods to add to the
+ * subclass prototype. These will override the
+ * matching items obtained from the superclass
+ * if present.
+ */
+ extend: function(subc, superc, overrides) {
+ if (!superc||!subc) {
+ throw new Error("org.antlr.lang.extend failed, please check that " +
+ "all dependencies are included.");
+ }
+ var F = function() {};
+ F.prototype=superc.prototype;
+ subc.prototype=new F();
+ subc.prototype.constructor=subc;
+ subc.superclass=superc.prototype;
+ if (superc.prototype.constructor == Object.prototype.constructor) {
+ superc.prototype.constructor=superc;
+ }
+
+ if (overrides) {
+ for (var i in overrides) {
+ subc.prototype[i]=overrides[i];
+ }
+
+ org.antlr.lang._IEEnumFix(subc.prototype, overrides);
+ }
+ },
+
+ /**
+ * Applies all properties in the supplier to the receiver if the
+ * receiver does not have these properties yet. Optionally, one or
+ * more methods/properties can be specified (as additional
+ * parameters). This option will overwrite the property if receiver
+ * has it already. If true is passed as the third parameter, all
+ * properties will be applied and _will_ overwrite properties in
+ * the receiver.
+ *
+ * @param {Function} r the object to receive the augmentation
+ * @param {Function} s the object that supplies the properties to augment
+ * @param {String*|boolean} [arguments] zero or more properties methods
+ * to augment the receiver with. If none specified, everything
+ * in the supplier will be used unless it would
+ * overwrite an existing property in the receiver. If true
+ * is specified as the third parameter, all properties will
+ * be applied and will overwrite an existing property in
+ * the receiver
+ */
+ augmentObject: function(r, s) {
+ if (!s||!r) {
+ throw new Error("Absorb failed, verify dependencies.");
+ }
+ var a=arguments, i, p, override=a[2];
+ if (override && override!==true) { // only absorb the specified properties
+ for (i=2; i<a.length; i=i+1) {
+ r[a[i]] = s[a[i]];
+ }
+ } else { // take everything, overwriting only if the third parameter is true
+ for (p in s) {
+ if (override || !r[p]) {
+ r[p] = s[p];
+ }
+ }
+
+ org.antlr.lang._IEEnumFix(r, s);
+ }
+ },
+
+ /**
+ * Same as org.antlr.lang.augmentObject, except it only applies prototype properties
+ * @see org.antlr.lang.augmentObject
+ * @param {Function} r the object to receive the augmentation
+ * @param {Function} s the object that supplies the properties to augment
+ * @param {String*|boolean} [arguments] zero or more properties methods
+ * to augment the receiver with. If none specified, everything
+ * in the supplier will be used unless it would overwrite an existing
+ * property in the receiver. if true is specified as the third
+ * parameter, all properties will be applied and will overwrite an
+ * existing property in the receiver
+ */
+ augmentProto: function(r, s) {
+ if (!s||!r) {
+ throw new Error("Augment failed, verify dependencies.");
+ }
+ //var a=[].concat(arguments);
+ var a=[r.prototype,s.prototype];
+ for (var i=2;i<arguments.length;i=i+1) {
+ a.push(arguments[i]);
+ }
+ org.antlr.lang.augmentObject.apply(this, a);
+ },
+
+ /**
+ * Returns a new object containing all of the properties of
+ * all the supplied objects. The properties from later objects
+ * will overwrite those in earlier objects.
+ * @param arguments {Object*} the objects to merge
+ * @return the new merged object
+ */
+ merge: function() {
+ var o={}, a=arguments;
+ for (var i=0, l=a.length; i<l; i=i+1) {
+ org.antlr.lang.augmentObject(o, a[i], true);
+ }
+ return o;
+ },
+
+ /**
+ * A convenience method for detecting a legitimate non-null value.
+ * Returns false for null/undefined/NaN, true for other values,
+ * including 0/false/''
+ * @param o {any} the item to test
+ * @return {boolean} true if it is not null/undefined/NaN || false
+ */
+ isValue: function(o) {
+ var l = org.antlr.lang;
+return (l.isObject(o) || l.isString(o) || l.isNumber(o) || l.isBoolean(o));
+ },
+
+ /** @namespace org.antlr.lang.array Array convenience methods. */
+ array: /** @lends org.antlr.lang.array */ {
+ /**
+ * Retrieve the last element of an array. Throws an error if a is not
+ * an array or empty.
+ * @param a {Array} the array stack to peek in
+ * @return the last element of the array
+ */
+ peek: function(a) {
+ if (!org.antlr.lang.isArray(a)) {
+ throw new Error("org.antlr.lang.array.peek: a is not an array.");
+ }
+ var l = a.length;
+ if (l<=0) {
+ throw new Error("org.antlr.lang.array.peek: a is empty.");
+ }
+ return a[l-1];
+ }
+ }
+};
+org.antlr.runtime = {};
+org.antlr.runtime.RecognizerSharedState = function() {
+ /** Track the set of token types that can follow any rule invocation.
+ * Stack grows upwards. When it hits the max, it grows 2x in size
+ * and keeps going.
+ */
+ this.following = [];
+
+ this._fsp = -1;
+ this.errorRecovery = false;
+ this.lastErrorIndex = -1;
+ this.failed = false;
+ this.syntaxErrors = 0;
+ this.backtracking = 0;
+ this.ruleMemo = null;
+
+
+ // LEXER FIELDS (must be in same state object to avoid casting
+ // constantly in generated code and Lexer object) :(
+
+
+ /** The goal of all lexer rules/methods is to create a token object.
+ * This is an instance variable as multiple rules may collaborate to
+ * create a single token. nextToken will return this object after
+ * matching lexer rule(s). If you subclass to allow multiple token
+ * emissions, then set this to the last token to be matched or
+ * something nonnull so that the auto token emit mechanism will not
+ * emit another token.
+ */
+ this.token = null;
+ this.tokenStartCharIndex = -1;
+ // this.tokenStartLine;
+ // this.tokenStartCharPositionInLine;
+ // this.channel;
+ // this.type;
+ this.text = null;
+};
+org.antlr.runtime.IndexOutOfBoundsException = function(m) {
+ org.antlr.runtime.IndexOutOfBoundsException.superclass.constructor.call(this, m);
+};
+
+org.antlr.lang.extend(org.antlr.runtime.IndexOutOfBoundsException, Error, {
+ name: "org.antlr.runtime.IndexOutOfBoundsException"
+});
+org.antlr.runtime.RecognitionException = function(input) {
+ org.antlr.runtime.RecognitionException.superclass.constructor.call(this);
+ this.input = input;
+ this.index = input.index();
+ if ( input instanceof NewLazyTokenStream ) {//org.antlr.runtime.CommonTokenStream ) {
+ this.token = input.LT(1);
+ this.line = this.token.getLine();
+ this.charPositionInLine = this.token.getCharPositionInLine();
+ }
+ if ( input instanceof org.antlr.runtime.tree.TreeNodeStream ) {
+ this.extractInformationFromTreeNodeStream(input);
+ }
+ else if ( input instanceof org.antlr.runtime.ANTLRStringStream ) {
+ // Note: removed CharStream from hierarchy in JS port so checking for
+ // StringStream instead
+ this.c = input.LA(1);
+ this.line = input.getLine();
+ this.charPositionInLine = input.getCharPositionInLine();
+ }
+ else {
+ this.c = input.LA(1);
+ }
+
+ this.message = this.toString();
+};
+
+org.antlr.lang.extend(org.antlr.runtime.RecognitionException, Error,
+/** @lends org.antlr.runtime.RecognitionException.prototype */
+{
+ /**
+ * What input stream did the error occur in?
+ */
+ input: null,
+
+ /** What is index of token/char were we looking at when the error occurred?
+ * @type Number
+ */
+ index: null,
+
+ /** The current Token when an error occurred. Since not all streams
+ * can retrieve the ith Token, we have to track the Token object.
+ * For parsers. Even when it's a tree parser, token might be set.
+ * @type org.antlr.runtime.CommonToken
+ */
+ token: null,
+
+ /** If this is a tree parser exception, node is set to the node with
+ * the problem.
+ * @type Object
+ */
+ node: null,
+
+ /** The current char when an error occurred. For lexers.
+ * @type Number
+ */
+ c: null,
+
+ /** Track the line at which the error occurred in case this is
+ * generated from a lexer. We need to track this since the
+ * unexpected char doesn't carry the line info.
+ * @type Number
+ */
+ line: null,
+
+ /** The exception's class name.
+ * @type String
+ */
+ name: "org.antlr.runtime.RecognitionException",
+
+ /** Position in the line where exception occurred.
+ * @type Number
+ */
+ charPositionInLine: null,
+
+ /** If you are parsing a tree node stream, you will encounter som
+ * imaginary nodes w/o line/col info. We now search backwards looking
+ * for most recent token with line/col info, but notify getErrorHeader()
+ * that info is approximate.
+ * @type Boolean
+ */
+ approximateLineInfo: null,
+
+ /** Gather exception information from input stream.
+ * @param {org.antlr.runtime.CommonTokenStream|org.antlr.runtime.tree.TreeNodeStream|org.antlr.runtime.ANTLRStringStream} input input stream that has an exception.
+ */
+ extractInformationFromTreeNodeStream: function(input) {
+ var nodes = input,
+ priorNode,
+ priorPayLoad,
+ type,
+ text,
+ i;
+
+ this.node = nodes.LT(1);
+ var adaptor = nodes.getTreeAdaptor(),
+ payload = adaptor.getToken(this.node);
+ if ( payload ) {
+ this.token = payload;
+ if ( payload.getLine()<= 0 ) {
+ // imaginary node; no line/pos info; scan backwards
+ i = -1;
+ priorNode = nodes.LT(i);
+ while ( priorNode ) {
+ priorPayload = adaptor.getToken(priorNode);
+ if ( priorPayload && priorPayload.getLine()>0 ) {
+ // we found the most recent real line / pos info
+ this.line = priorPayload.getLine();
+ this.charPositionInLine = priorPayload.getCharPositionInLine();
+ this.approximateLineInfo = true;
+ break;
+ }
+ --i;
+ priorNode = nodes.LT(i);
+ }
+ }
+ else { // node created from real token
+ this.line = payload.getLine();
+ this.charPositionInLine = payload.getCharPositionInLine();
+ }
+ }
+ else if ( this.node instanceof org.antlr.runtime.tree.CommonTree) {
+ this.line = this.node.getLine();
+ this.charPositionInLine = this.node.getCharPositionInLine();
+ if ( this.node instanceof org.antlr.runtime.tree.CommonTree) {
+ this.token = this.node.token;
+ }
+ }
+ else {
+ type = adaptor.getType(this.node);
+ text = adaptor.getText(this.node);
+ this.token = new org.antlr.runtime.CommonToken(type, text);
+ }
+ },
+
+ /** Return the token type or char of the unexpected input element
+ * @return {Number} type of the unexpected input element.
+ */
+ getUnexpectedType: function() {
+ if ( this.input instanceof NewLazyTokenStream) {//org.antlr.runtime.CommonTokenStream ) {
+ return this.token.getType();
+ }
+ else if ( this.input instanceof org.antlr.runtime.tree.TreeNodeStream ) {
+ var nodes = this.input;
+ var adaptor = nodes.getTreeAdaptor();
+ return adaptor.getType(this.node);
+ }
+ else {
+ return this.c;
+ }
+ }
+});
+org.antlr.runtime.MismatchedTokenException = function(expecting, input) {
+ if (arguments.length===0) {
+ this.expecting = org.antlr.runtime.Token.INVALID_TOKEN_TYPE;
+ } else {
+ org.antlr.runtime.MismatchedTokenException.superclass.constructor.call(
+ this, input);
+ this.expecting = expecting;
+ }
+};
+
+org.antlr.lang.extend(
+ org.antlr.runtime.MismatchedTokenException,
+ org.antlr.runtime.RecognitionException, {
+ toString: function() {
+ return "MismatchedTokenException(" +
+ this.getUnexpectedType() + "!=" + this.expecting + ")";
+ },
+ name: "org.antlr.runtime.MismatchedTokenException"
+});
+org.antlr.runtime.UnwantedTokenException = function(expecting, input) {
+ if (arguments.length>0) {
+ org.antlr.runtime.UnwantedTokenException.superclass.constructor.call(
+ this, expecting, input);
+ }
+};
+
+org.antlr.lang.extend(
+ org.antlr.runtime.UnwantedTokenException,
+ org.antlr.runtime.MismatchedTokenException, {
+ getUnexpectedToken: function() {
+ return this.token;
+ },
+ toString: function() {
+ var exp = ", expected "+this.expecting;
+ if ( this.expecting===org.antlr.runtime.Token.INVALID_TOKEN_TYPE ) {
+ exp = "";
+ }
+ if ( !org.antlr.lang.isValue(this.token) ) {
+ return "UnwantedTokenException(found="+exp+")";
+ }
+ return "UnwantedTokenException(found="+this.token.getText()+exp+")";
+ },
+ name: "org.antlr.runtime.UnwantedTokenException"
+});
+org.antlr.runtime.MissingTokenException = function(expecting, input, inserted) {
+ if (arguments.length>0) {
+ org.antlr.runtime.MissingTokenException.superclass.constructor.call(
+ this, expecting, input);
+ this.inserted = inserted;
+ }
+};
+
+org.antlr.lang.extend(
+ org.antlr.runtime.MissingTokenException,
+ org.antlr.runtime.MismatchedTokenException, {
+ getMissingType: function() {
+ return this.expecting;
+ },
+
+ toString: function() {
+ if (org.antlr.lang.isValue(this.inserted) &&
+ org.antlr.lang.isValue(this.token))
+ {
+ return "MissingTokenException(inserted "+this.inserted+" at "+this.token.getText()+")";
+ }
+ if ( org.antlr.lang.isValue(this.token) ) {
+ return "MissingTokenException(at "+this.token.getText()+")";
+ }
+ return "MissingTokenException";
+ },
+ name: "org.antlr.runtime.MissingTokenException"
+});
+org.antlr.runtime.NoViableAltException = function(grammarDecisionDescription,
+ decisionNumber,
+ stateNumber,
+ input)
+{
+ org.antlr.runtime.NoViableAltException.superclass.constructor.call(this, input);
+ this.grammarDecisionDescription = grammarDecisionDescription;
+ this.decisionNumber = decisionNumber;
+ this.stateNumber = stateNumber;
+};
+
+org.antlr.lang.extend(
+ org.antlr.runtime.NoViableAltException,
+ org.antlr.runtime.RecognitionException, {
+ toString: function() {
+ if ( this.input instanceof org.antlr.runtime.ANTLRStringStream ) {
+ return "NoViableAltException('"+this.getUnexpectedType()+"'@["+this.grammarDecisionDescription+"])";
+ }
+ else {
+ return "NoViableAltException("+this.getUnexpectedType()+"@["+this.grammarDecisionDescription+"])";
+ }
+ },
+ name: "org.antlr.runtime.NoViableAltException"
+});
+org.antlr.runtime.EarlyExitException = function(decisionNumber, input) {
+ org.antlr.runtime.EarlyExitException.superclass.constructor.call(
+ this, input);
+ this.decisionNumber = decisionNumber;
+};
+
+org.antlr.lang.extend(
+ org.antlr.runtime.EarlyExitException,
+ org.antlr.runtime.RecognitionException,
+/** @lends org.antlr.runtime.EarlyExitException.prototype */
+{
+ /** Name of this class.
+ * @type String
+ */
+ name: "org.antlr.runtime.EarlyExitException"
+});
+org.antlr.runtime.MismatchedSetException = function(expecting, input) {
+ org.antlr.runtime.MismatchedSetException.superclass.constructor.call(
+ this, input);
+ this.expecting = expecting;
+};
+
+org.antlr.lang.extend(
+ org.antlr.runtime.MismatchedSetException,
+ org.antlr.runtime.RecognitionException, {
+ toString: function() {
+ return "MismatchedSetException(" +
+ this.getUnexpectedType() + "!=" + this.expecting + ")";
+ },
+ name: "org.antlr.runtime.MismatchedSetException"
+});
+org.antlr.runtime.MismatchedNotSetException = function(expecting, input) {
+ org.antlr.runtime.MismatchedNotSetException.superclass.constructor.call(this, expecting, input);
+};
+
+org.antlr.lang.extend(
+ org.antlr.runtime.MismatchedNotSetException,
+ org.antlr.runtime.MismatchedSetException, {
+ toString: function() {
+ return "MismatchedNotSetException(" +
+ this.getUnexpectedType() + "!=" + this.expecting + ")";
+ },
+ name: "org.antlr.runtime.MismatchedNotSetException"
+});
+org.antlr.runtime.MismatchedRangeException = function(a, b, input) {
+ if (arguments.length===0) {
+ return this;
+ }
+
+ org.antlr.runtime.MismatchedRangeException.superclass.constructor.call(
+ this, input);
+ this.a = a;
+ this.b = b;
+};
+
+org.antlr.lang.extend(
+ org.antlr.runtime.MismatchedRangeException,
+ org.antlr.runtime.RecognitionException, {
+ toString: function() {
+ return "MismatchedRangeException(" +
+ this.getUnexpectedType()+" not in ["+this.a+","+this.b+"])";
+ },
+ name: "org.antlr.runtime.MismatchedRangeException"
+});
+org.antlr.runtime.FailedPredicateException = function(input, ruleName, predicateText){
+ org.antlr.runtime.FailedPredicateException.superclass.constructor.call(this, input);
+ this.ruleName = ruleName;
+ this.predicateText = predicateText;
+};
+
+org.antlr.lang.extend(
+ org.antlr.runtime.FailedPredicateException,
+ org.antlr.runtime.RecognitionException,
+/** @lends org.antlr.runtime.FailedPredicateException.prototype */
+{
+ /** Create a string representation of this exception.
+ * @returns {String}
+ */
+ toString: function() {
+ return "FailedPredicateException("+this.ruleName+",{"+this.predicateText+"}?)";
+ },
+
+ /** Name of this class.
+ * @type String
+ */
+ name: "org.antlr.runtime.FailedPredicateException"
+});
+org.antlr.runtime.BitSet = function(bits) {
+ if (!bits) {
+ bits = org.antlr.runtime.BitSet.BITS;
+ }
+
+ if (org.antlr.lang.isArray(bits)) {
+ /**
+ * An array of Numbers representing the BitSet.
+ * @type Array
+ */
+ this.bits = bits;
+ } else if(org.antlr.lang.isNumber(bits)) {
+ this.bits = [];
+ }
+};
+
+org.antlr.lang.augmentObject(org.antlr.runtime.BitSet, {
+ /**
+ * Number of bits in each number.
+ * @constant
+ * @memberOf org.antlr.runtime.BitSet
+ */
+ BITS: 32,
+
+ /**
+ * Log (base 2) of the number of bits in each number.
+ * @constant
+ * @memberOf org.antlr.runtime.BitSet
+ */
+ LOG_BITS: 5, // 2^5 == 32
+
+ /**
+ * We will often need to do a mod operator (i mod nbits). Its
+ * turns out that, for powers of two, this mod operation is
+ * same as (i & (nbits-1)). Since mod is slow, we use a
+ * precomputed mod mask to do the mod instead.
+ * @constant
+ * @memberOf org.antlr.runtime.BitSet
+ */
+ MOD_MASK: 31, // BITS - 1
+
+ /**
+ * Create mask for bit modded to fit in a single word.
+ * @example
+ * bitmask(35) => 00000000000000000000000000000100
+ * bitmask(3) => 00000000000000000000000000000100
+ * @param {Number} bitNumber the bit to create a mask for.
+ * @returns {Number} the bitmask.
+ * @memberOf org.antlr.runtime.BitSet
+ * @private
+ */
+ bitMask: function(bitNumber) {
+ var bitPosition = bitNumber & org.antlr.runtime.BitSet.MOD_MASK;
+ return 1 << bitPosition;
+ },
+
+ /**
+ * Calculate the minimum number of bits needed to represent el.
+ * @param {Number} el a number to be included in the BitSet.
+ * @returns {Number} the number of bits need to create a BitSet with member
+ * el.
+ * @memberOf org.antlr.runtime.BitSet
+ * @private
+ */
+ numWordsToHold: function(el) {
+ return (el >> org.antlr.runtime.BitSet.LOG_BITS) + 1;
+ },
+
+ /**
+ * @param {Number} bit a number to be included in the BitSet
+ * @returns {Number} the index of the word in the field bits that would
+ * hold bit.
+ * @memberOf org.antlr.runtime.BitSet
+ * @private
+ */
+ wordNumber: function(bit) {
+ return bit >> org.antlr.runtime.BitSet.LOG_BITS; // bit / BITS
+ },
+
+ /**
+ * BitSet factory method.
+ *
+ * <p>Operates in a number of modes:
+ * <ul>
+ * <li>If el is a number create the BitSet containing that number.</li>
+ * <li>If el is an array create the BitSet containing each number in the
+ * array.</li>
+ * <li>If el is a BitSet return el.</li>
+ * <li>If el is an Object create the BitSet containing each numeric value
+ * in el.</li>
+ * <li>If el is a number and el2 is a number return a BitSet containing
+ * the numbers between el and el2 (inclusive).</li>
+ * </ul>
+ * </p>
+ * @param {Number|Array|org.antlr.runtime.BitSet|Object} el
+ * @param {Number} el2
+ * @returns {org.antlr.runtime.BitSet}
+ * @memberOf org.antlr.runtime.BitSet
+ */
+ of: function(el, el2) {
+ var i, n, s, keys;
+
+ if (org.antlr.lang.isNumber(el)) {
+ if (org.antlr.lang.isNumber(el2)) {
+ s = new org.antlr.runtime.BitSet(el2 + 1);
+ for (i = el; i <= el2; i++) {
+ n = org.antlr.runtime.BitSet.wordNumber(i);
+ s.bits[n] |= org.antlr.runtime.BitSet.bitMask(i);
+ }
+ return s;
+ } else {
+ s = new org.antlr.runtime.BitSet(el + 1);
+ s.add(el);
+ return s;
+ }
+ } else if(org.antlr.lang.isArray(el)) {
+ s = new org.antlr.runtime.BitSet();
+ for (i=el.length-1; i>=0; i--) {
+ s.add(el[i]);
+ }
+ return s;
+ } else if (el instanceof org.antlr.runtime.BitSet) {
+ if (!el) {
+ return null;
+ }
+ return el;
+ } else if (el instanceof org.antlr.runtime.IntervalSet) {
+ if (!el) {
+ return null;
+ }
+ s = new org.antlr.runtime.BitSet();
+ s.addAll(el);
+ return s;
+ } else if (org.antlr.lang.isObject(el)) {
+ keys = [];
+ for (i in el) {
+ if (org.antlr.lang.isNumber(i)) {
+ keys.push(i);
+ }
+ }
+ return org.antlr.runtime.BitSet.of(keys);
+ }
+ }
+});
+
+
+
+org.antlr.runtime.BitSet.prototype = {
+ /**
+ * Add el into this set.
+ * @param {Number} el the number to add to the set.
+ */
+ add: function(el) {
+ var n = org.antlr.runtime.BitSet.wordNumber(el);
+ if (n >= this.bits.length) {
+ this.growToInclude(el);
+ }
+ this.bits[n] |= org.antlr.runtime.BitSet.bitMask(el);
+ },
+
+ /**
+ * Add multiple elements into this set.
+ * @param {Array|org.antlr.runtime.BitSet} elements the elements to be added to
+ * this set.
+ */
+ addAll: function(elements) {
+ var other,
+ i,
+ e;
+
+ if ( elements instanceof org.antlr.runtime.BitSet ) {
+ this.orInPlace(elements);
+ }
+ else if ( elements instanceof org.antlr.runtime.IntervalSet ) {
+ other = elements;
+ // walk set and add each interval
+ /* @todo after implementing intervalset
+ for (Iterator iter = other.intervals.iterator(); iter.hasNext();) {
+ Interval I = (Interval) iter.next();
+ this.orInPlace(BitSet.range(I.a,I.b));
+ }*/
+ } else if (org.antlr.lang.isArray(elements)) {
+ for (i = 0; i < elements.length; i++) {
+ e = elements[i];
+ this.add(e);
+ }
+ } else {
+ return;
+ }
+ },
+
+ /**
+ * Clone this BitSet and then {@link #andInPlace} with a.
+ * @param {org.antlr.runtime.BitSet} a a bit set.
+ * @returns {org.antlr.runtime.BitSet}
+ */
+ and: function(a) {
+ var s = this.clone();
+ s.andInPlace(a);
+ return s;
+ },
+
+ /**
+ * Perform a logical AND of this target BitSet with the argument BitSet.
+ *
+ * This bit set is modified so that each bit in it has the value true if
+ * and only if it both initially had the value true and the corresponding
+ * bit in the bit set argument also had the value true.
+ * @param {org.antlr.runtime.BitSet} a a bit set.
+ * @returns {org.antlr.runtime.BitSet}
+ */
+ andInPlace: function(a) {
+ var min = Math.min(this.bits.length, a.bits.length),
+ i;
+ for (i = min - 1; i >= 0; i--) {
+ this.bits[i] &= a.bits[i];
+ }
+ // clear all bits in this not present in a (if this bigger than a).
+ for (i = min; i < this.bits.length; i++) {
+ this.bits[i] = 0;
+ }
+ },
+
+ /**
+ * Clear all bits or a specific bit.
+ *
+ * If no arguments given, sets all of the bits in this BitSet to false.
+ * If one argument given, sets the bit specified by the index to false.
+ * @param {Number} [el] the index of the bit to be cleared.
+ */
+ clear: function(el) {
+ if (arguments.length===0) {
+ var i;
+ for (i = this.bits.length - 1; i >= 0; i--) {
+ this.bits[i] = 0;
+ }
+ return;
+ }
+
+ var n = org.antlr.runtime.BitSet.wordNumber(el);
+ if (n >= this.bits.length) { // grow as necessary to accommodate
+ this.growToInclude(el);
+ }
+ this.bits[n] &= ~org.antlr.runtime.BitSet.bitMask(el);
+ },
+
+ /**
+ * Cloning this BitSet produces a new BitSet that is equal to it.
+ *
+ * The clone of the bit set is another bit set that has exactly the same
+ * bit set to true as this bit set.
+ * @returns {org.antlr.runtime.BitSet} a clone of this BitSet.
+ */
+ clone: function() {
+ var i, len, b=[];
+ for (i=0, len=this.bits.length; i<len; i++) {
+ b[i] = this.bits[i];
+ }
+ return new org.antlr.runtime.BitSet(b);
+ },
+
+ /**
+ * Returns the number of bits of space actually in use by this BitSet to
+ * represent bit values.
+ *
+ * The maximum element in the set is the size - 1st element.
+ * @returns {Number} the number of bits currently in this bit set.
+ */
+ size: function() {
+ var deg = 0, i, word, bit;
+ for (i = this.bits.length - 1; i >= 0; i--) {
+ word = this.bits[i];
+ if (word !== 0) {
+ for (bit = org.antlr.runtime.BitSet.BITS - 1; bit >= 0; bit--) {
+ if ((word & (1 << bit)) !== 0) {
+ deg++;
+ }
+ }
+ }
+ }
+ return deg;
+ },
+
+ /**
+ * Compares this object against the specified object.
+ *
+ * The result is true if and only if the argument is not null and is a
+ * BitSet object that has exactly the same set of bits set to true as
+ * this bit set. That is, for every nonnegative int index k,
+ * <pre><code>
+ * ((BitSet)obj).get(k) == this.get(k)
+ * </code></pre>
+ * must be true. The current sizes of the two bit sets are not compared.
+ * @param {Object} other the object to compare with.
+ * @returns {Boolean} if the objects are the same; false otherwise.
+ */
+ equals: function(other) {
+ if ( !other || !(other instanceof org.antlr.runtime.BitSet) ) {
+ return false;
+ }
+
+ var otherSet = other,
+ i,
+ n = Math.min(this.bits.length, otherSet.bits.length);
+
+ // for any bits in common, compare
+ for (i=0; i<n; i++) {
+ if (this.bits[i] != otherSet.bits[i]) {
+ return false;
+ }
+ }
+
+ // make sure any extra bits are off
+
+ if (this.bits.length > n) {
+ for (i = n+1; i<this.bits.length; i++) {
+ if (this.bits[i] !== 0) {
+ return false;
+ }
+ }
+ }
+ else if (otherSet.bits.length > n) {
+ for (i = n+1; i<otherSet.bits.length; i++) {
+ if (otherSet.bits[i] !== 0) {
+ return false;
+ }
+ }
+ }
+
+ return true;
+ },
+
+ /**
+ * Grows the set to a larger number of bits.
+ * @param {Number} bit element that must fit in set
+ * @private
+ */
+ growToInclude: function(bit) {
+ var newSize = Math.max(this.bits.length << 1, org.antlr.runtime.BitSet.numWordsToHold(bit)),
+ newbits = [], //new Array(newSize),
+ i;
+ for (i=0, len=this.bits.length; i<len; i++) {
+ newbits[i] = this.bits[i];
+ }
+ this.bits = newbits;
+ },
+
+ /**
+ * Returns the value of the bit with the specified index.
+ *
+ * The value is true if the bit with the index el is currently set
+ * in this BitSet; otherwise, the result is false.
+ * @param {Number} el the bit index.
+ * @returns {Boolean} the value of the bit with the specified index.
+ */
+ member: function(el) {
+ var n = org.antlr.runtime.BitSet.wordNumber(el);
+ if (n >= this.bits.length) { return false; }
+ return (this.bits[n] & org.antlr.runtime.BitSet.bitMask(el)) !== 0;
+ },
+
+ /**
+ * Returns the index of the first bit that is set to true.
+ * If no such bit exists then -1 is returned.
+ * @returns {Number} the index of the next set bit.
+ */
+ getSingleElement: function() {
+ var i;
+ for (i = 0; i < (this.bits.length << org.antlr.runtime.BitSet.LOG_BITS); i++) {
+ if (this.member(i)) {
+ return i;
+ }
+ }
+ return -1; //Label.INVALID;
+ },
+
+ /**
+ * Returns true if this BitSet contains no bits that are set to true.
+ * @returns {Boolean} boolean indicating whether this BitSet is empty.
+ */
+ isNil: function() {
+ var i;
+ for (i = this.bits.length - 1; i >= 0; i--) {
+ if (this.bits[i] !== 0) {
+ return false;
+ }
+ }
+ return true;
+ },
+
+ /**
+ * If a bit set argument is passed performs a {@link #subtract} of this bit
+ * set with the argument bit set. If no argument is passed, clone this bit
+ * set and {@link #notInPlace}.
+ * @param {org.antlr.runtime.BitSet} [set]
+ * @returns {org.antlr.runtime.BitSet}
+ */
+ complement: function(set) {
+ if (set) {
+ return set.subtract(this);
+ } else {
+ var s = this.clone();
+ s.notInPlace();
+ return s;
+ }
+ },
+
+ /**
+ * If no arguments are passed sets all bits to the complement of their
+ * current values. If one argument is passed sets each bit from the
+ * beginning of the bit set to index1 (inclusive) to the complement of its
+ * current value. If two arguments are passed sets each bit from the
+ * specified index1 (inclusive) to the sepcified index2 (inclusive) to the
+ * complement of its current value.
+ * @param {Number} index1
+ * @param {Number} index2
+ */
+ notInPlace: function() {
+ var minBit, maxBit, i, n;
+ if (arguments.length===0) {
+ for (i = this.bits.length - 1; i >= 0; i--) {
+ this.bits[i] = ~this.bits[i];
+ }
+ } else {
+ if (arguments.length===1) {
+ minBit = 0;
+ maxBit = arguments[0];
+ } else {
+ minBit = arguments[0];
+ maxBit = arguments[1];
+ }
+ // make sure that we have room for maxBit
+ this.growToInclude(maxBit);
+ for (i = minBit; i <= maxBit; i++) {
+ n = org.antlr.runtime.BitSet.wordNumber(i);
+ this.bits[n] ^= org.antlr.runtime.BitSet.bitMask(i);
+ }
+ }
+
+ },
+
+ /**
+ * Performs a logical OR of this bit set with the bit set argument.
+ * If no argument is passed, return this bit set. Otherwise a clone of
+ * this bit set is modified so that a bit in it has the value true if and
+ * only if it either already had the value true or the corresponding bit
+ * in the bit set argument has the value true.
+ * @param {org.antlr.runtime.BitSet} [a] a bit set.
+ * @returns {org.antlr.runtime.BitSet}
+ */
+ or: function(a) {
+ if ( !a ) {
+ return this;
+ }
+ var s = this.clone();
+ s.orInPlace(a);
+ return s;
+ },
+
+ /**
+ * Performs a logical {@link #or} in place.
+ * @param {org.antlr.runtime.BitSet} [a]
+ * @returns {org.antlr.runtime.BitSet}
+ */
+ orInPlace: function(a) {
+ if ( !a ) {
+ return;
+ }
+ // If this is smaller than a, grow this first
+ if (a.bits.length > this.bits.length) {
+ this.setSize(a.bits.length);
+ }
+ var min = Math.min(this.bits.length, a.bits.length),
+ i;
+ for (i = min - 1; i >= 0; i--) {
+ this.bits[i] |= a.bits[i];
+ }
+ },
+
+ /**
+ * Sets the bit specified by the index to false.
+ * @param {Number} bitIndex the index of the bit to be cleared.
+ */
+ remove: function(el) {
+ var n = org.antlr.runtime.BitSet.wordNumber(el);
+ if (n >= this.bits.length) {
+ this.growToInclude(el);
+ }
+ this.bits[n] &= ~org.antlr.runtime.BitSet.bitMask(el);
+ },
+
+ /**
+ * Grows the internal bits array to include at least nwords numbers.
+ * @private
+ * @param {Number} nwords how many words the new set should be
+ * @private
+ */
+ setSize: function(nwords) {
+ var n = nwords - this.bits.length;
+ while (n>=0) {
+ this.bits.push(0);
+ n--;
+ }
+ },
+
+ /**
+ * Returns the number of bits capable of being represented by this bit set
+ * given its current size.
+ * @returns {Number} the maximum number of bits that can be represented at
+ * the moment.
+ * @private
+ */
+ numBits: function() {
+ return this.bits.length << org.antlr.runtime.BitSet.LOG_BITS; // num words * bits per word
+ },
+
+ /**
+ * Return how much space is being used by the bits array not
+ * how many actually have member bits on.
+ * @returns {Number} the length of the internal bits array.
+ * @private
+ */
+ lengthInLongWords: function() {
+ return this.bits.length;
+ },
+
+ /**
+ * Is this bit set contained within a?
+ * @param {org.antlr.runtime.BitSet} a bit set
+ * @returns {Boolean} true if and only if a is a subset of this bit set.
+ */
+ subset: function(a) {
+ if (!a) { return false; }
+ return this.and(a).equals(this);
+ },
+
+ /**
+ * Subtract the elements of the argument bit set from this bit set in place.
+ * That is, for each set bit in the argument bit set, set the corresponding
+ * bit in this bit set to false.
+ * @param {org.antlr.runtime.BitSet} a bit set.
+ */
+ subtractInPlace: function(a) {
+ if (!a) { return; }
+ // for all words of 'a', turn off corresponding bits of 'this'
+ var i;
+ for (i = 0; i < this.bits.length && i < a.bits.length; i++) {
+ this.bits[i] &= ~a.bits[i];
+ }
+ },
+
+ /**
+ * Perform a {@link #subtractInPlace} on a clone of this bit set.
+ * @param {org.antlr.runtime.BitSet} a bit set.
+ * @returns {org.antlr.runtime.BitSet} the new bit set.
+ */
+ subtract: function(a) {
+ if (!a || !(a instanceof org.antlr.runtime.BitSet)) { return null; }
+
+ var s = this.clone();
+ s.subtractInPlace(a);
+ return s;
+ },
+
+ /* antlr-java needs this to make its class hierarchy happy . . .
+ toList: function() {
+ throw new Error("BitSet.toList() unimplemented");
+ },
+ */
+
+ /**
+ * Creates an array of the indexes of each bit set in this bit set.
+ * @returns {Array}
+ */
+ toArray: function() {
+ var elems = [], //new Array(this.size()),
+ i,
+ en = 0;
+ for (i = 0; i < (this.bits.length << org.antlr.runtime.BitSet.LOG_BITS); i++) {
+ if (this.member(i)) {
+ elems[en++] = i;
+ }
+ }
+ return elems;
+ },
+
+ /**
+ * Returns the internal representation of this bit set.
+ * This representation is an array of numbers, each representing 32 bits.
+ * @returns {Array}
+ */
+ toPackedArray: function() {
+ return this.bits;
+ },
+
+ /**
+ * Returns a string representation of this bit set.
+ * <p>For every index for which this BitSet contains a bit in the set state,
+ * the decimal representation of that index is included in the result.
+ * Such indices are listed in order from lowest to highest, separated by
+ * ", " (a comma and a space) and surrounded by braces, resulting in the
+ * usual mathematical notation for a set of integers.</p>
+ *
+ * <p>If a grammar g is passed, print g.getTokenDisplayName(i) for each set
+ * index instead of the numerical index.</p>
+ *
+ * <>If two arguments are passed, the first will be used as a custom
+ * separator string. The second argument is an array whose i-th element
+ * will be added if the corresponding bit is set.</p>
+ *
+ * @param {Object|String} [arg1] an Object with function property
+ * getTokenDispalyName or a String that will be used as a list
+ * separator.
+ * @param {Array} [vocabulary] array from which the i-th value will be
+ * drawn if the corresponding bit is set. Must pass a string as the
+ * first argument if using this option.
+ * @return A commma-separated list of values
+ */
+ toString: function() {
+ if (arguments.length===0) {
+ return this.toString1(null);
+ } else {
+ if (org.antlr.lang.isString(arguments[0])) {
+ if (!org.antlr.lang.isValue(arguments[1])) {
+ return this.toString1(null);
+ } else {
+ return this.toString2(arguments[0], arguments[1]);
+ }
+ } else {
+ return this.toString1(arguments[0]);
+ }
+ }
+ },
+
+ /**
+ * Transform a bit set into a string by formatting each element as an
+ * integer separator The string to put in between elements
+ * @private
+ * @return A commma-separated list of values
+ */
+ toString1: function(g) {
+ var buf = "{",
+ separator = ",",
+ i,
+ havePrintedAnElement = false;
+
+ for (i = 0; i < (this.bits.length << org.antlr.runtime.BitSet.LOG_BITS); i++) {
+ if (this.member(i)) {
+ if (i > 0 && havePrintedAnElement ) {
+ buf += separator;
+ }
+ if ( g ) {
+ buf += g.getTokenDisplayName(i);
+ }
+ else {
+ buf += i.toString();
+ }
+ havePrintedAnElement = true;
+ }
+ }
+ return buf + "}";
+ },
+
+ /**
+ * Create a string representation where instead of integer elements, the
+ * ith element of vocabulary is displayed instead. Vocabulary is a Vector
+ * of Strings.
+ * separator The string to put in between elements
+ * @private
+ * @return A commma-separated list of character constants.
+ */
+ toString2: function(separator, vocabulary) {
+ var str = "",
+ i;
+ for (i = 0; i < (this.bits.length << org.antlr.runtime.BitSet.LOG_BITS); i++) {
+ if (this.member(i)) {
+ if (str.length > 0) {
+ str += separator;
+ }
+ if (i >= vocabulary.size()) {
+ str += "'" + i + "'";
+ }
+ else if (!org.antlr.lang.isValue(vocabulary.get(i))) {
+ str += "'" + i + "'";
+ }
+ else {
+ str += vocabulary.get(i);
+ }
+ }
+ }
+ return str;
+ }
+
+ /*
+ * Dump a comma-separated list of the words making up the bit set.
+ * Split each 32 bit number into two more manageable 16 bit numbers.
+ * @returns {String} comma separated list view of the this.bits property.
+ *
+ toStringOfHalfWords: function() {
+ var s = "",
+ tmp,
+ i;
+ for (i = 0; i < this.bits.length; i++) {
+ if (i !== 0) {
+ s+=", ";
+ }
+ tmp = this.bits[i];
+ tmp &= 0xFFFF;
+ s += tmp + "UL, ";
+ tmp = this.bits[i] >> 16;
+ tmp &= 0xFFFF;
+ s += tmp+"UL";
+ }
+ return s;
+ },
+ */
+
+ /*
+ * Dump a comma-separated list of the words making up the bit set.
+ * This generates a comma-separated list of Java-like long int constants.
+ *
+ toStringOfWords: function() {
+ var s="",
+ i;
+ for (i = 0; i < this.bits.length; i++) {
+ if (i !== 0) {
+ s+=", ";
+ }
+ s += this.bits[i]+"L";
+ }
+ return s;
+ },
+
+ toStringWithRanges: function() {
+ return this.toString();
+ }
+ */
+};
+org.antlr.runtime.CharStream = {
+ EOF: -1
+};
+org.antlr.runtime.CommonToken = function() {
+ var oldToken;
+
+ this.charPositionInLine = -1; // set to invalid position
+ this.channel = 0; // org.antlr.runtime.CommonToken.DEFAULT_CHANNEL
+ this.index = -1;
+
+ if (arguments.length == 1) {
+ if (org.antlr.lang.isNumber(arguments[0])) {
+ this.type = arguments[0];
+ } else {
+ oldToken = arguments[0];
+ this.text = oldToken.getText();
+ this.type = oldToken.getType();
+ this.line = oldToken.getLine();
+ this.index = oldToken.getTokenIndex();
+ this.charPositionInLine = oldToken.getCharPositionInLine();
+ this.channel = oldToken.getChannel();
+ if ( oldToken instanceof org.antlr.runtime.CommonToken ) {
+ this.start = oldToken.start;
+ this.stop = oldToken.stop;
+ }
+ }
+ } else if (arguments.length == 2) {
+ this.type = arguments[0];
+ this.text = arguments[1];
+ this.channel = 0; // org.antlr.runtime.CommonToken.DEFAULT_CHANNEL
+ } else if (arguments.length == 5) {
+ this.input = arguments[0];
+ this.type = arguments[1];
+ this.channel = arguments[2];
+ this.start = arguments[3];
+ this.stop = arguments[4];
+ }
+};
+
+org.antlr.runtime.CommonToken.prototype = {
+ getType: function() {
+ return this.type;
+ },
+
+ setLine: function(line) {
+ this.line = line;
+ },
+
+ getText: function() {
+ if ( org.antlr.lang.isString(this.text) ) {
+ return this.text;
+ }
+ if ( !this.input ) {
+ return null;
+ }
+ this.text = this.input.substring(this.start,this.stop);
+ return this.text;
+ },
+
+ /** Override the text for this token. getText() will return this text
+ * rather than pulling from the buffer. Note that this does not mean
+ * that start/stop indexes are not valid. It means that that input
+ * was converted to a new string in the token object.
+ */
+ setText: function(text) {
+ this.text = text;
+ },
+
+ getLine: function() {
+ return this.line;
+ },
+
+ getCharPositionInLine: function() {
+ return this.charPositionInLine;
+ },
+
+ setCharPositionInLine: function(charPositionInLine) {
+ this.charPositionInLine = charPositionInLine;
+ },
+
+ getChannel: function() {
+ return this.channel;
+ },
+
+ setChannel: function(channel) {
+ this.channel = channel;
+ },
+
+ setType: function(type) {
+ this.type = type;
+ },
+
+ getStartIndex: function() {
+ return this.start;
+ },
+
+ setStartIndex: function(start) {
+ this.start = start;
+ },
+
+ getStopIndex: function() {
+ return this.stop;
+ },
+
+ setStopIndex: function(stop) {
+ this.stop = stop;
+ },
+
+ getTokenIndex: function() {
+ return this.index;
+ },
+
+ setTokenIndex: function(index) {
+ this.index = index;
+ },
+
+ getInputStream: function() {
+ return this.input;
+ },
+
+ setInputStream: function(input) {
+ this.input = input;
+ },
+
+ toString: function() {
+ var channelStr = "";
+ if ( this.channel>0 ) {
+ channelStr=",channel="+this.channel;
+ }
+ var txt = this.getText();
+ if ( !org.antlr.lang.isNull(txt) ) {
+ txt = txt.replace(/\n/g,"\\\\n");
+ txt = txt.replace(/\r/g,"\\\\r");
+ txt = txt.replace(/\t/g,"\\\\t");
+ }
+ else {
+ txt = "<no text>";
+ }
+ return "[@"+this.getTokenIndex()+","+this.start+":"+this.stop+"='"+txt+"',<"+this.type+">"+channelStr+","+this.line+":"+this.getCharPositionInLine()+"]";
+ }
+};
+// NB: Because Token has static members of type CommonToken, the Token dummy
+// constructor is defined in CommonToken. All methods and vars of Token are
+// defined here. Token is an interface, not a subclass in the Java runtime.
+
+/**
+ * @class Abstract base class of all token types.
+ * @name Token
+ * @memberOf org.antlr.runtime
+ */
+org.antlr.runtime.Token = function() {};
+org.antlr.lang.augmentObject(org.antlr.runtime.Token, /** @lends Token */ {
+ EOR_TOKEN_TYPE: 1,
+
+ /** imaginary tree navigation type; traverse "get child" link */
+ DOWN: 2,
+ /** imaginary tree navigation type; finish with a child list */
+ UP: 3,
+
+ MIN_TOKEN_TYPE: 4, // UP+1,
+
+ EOF: org.antlr.runtime.CharStream.EOF,
+ EOF_TOKEN: new org.antlr.runtime.CommonToken(org.antlr.runtime.CharStream.EOF),
+
+ INVALID_TOKEN_TYPE: 0,
+ INVALID_TOKEN: new org.antlr.runtime.CommonToken(0),
+
+ /** In an action, a lexer rule can set token to this SKIP_TOKEN and ANTLR
+ * will avoid creating a token for this symbol and try to fetch another.
+ */
+ SKIP_TOKEN: new org.antlr.runtime.CommonToken(0),
+
+ /** All tokens go to the parser (unless skip() is called in that rule)
+ * on a particular "channel". The parser tunes to a particular channel
+ * so that whitespace etc... can go to the parser on a "hidden" channel.
+ */
+ DEFAULT_CHANNEL: 0,
+
+ /** Anything on different channel than DEFAULT_CHANNEL is not parsed
+ * by parser.
+ */
+ HIDDEN_CHANNEL: 99
+});
+
+org.antlr.lang.augmentObject(org.antlr.runtime.CommonToken, org.antlr.runtime.Token);
+org.antlr.runtime.tree = {};
+org.antlr.runtime.tree.RewriteCardinalityException = function(elementDescription) {
+ this.elementDescription = elementDescription;
+};
+org.antlr.lang.extend(org.antlr.runtime.tree.RewriteCardinalityException, Error, {
+ getMessage: function() {
+ if ( org.antlr.lang.isString(this.elementDescription) ) {
+ return this.elementDescription;
+ }
+ return null;
+ },
+ name: function() {
+ return "org.antlr.runtime.tree.RewriteCardinalityException";
+ }
+});
+org.antlr.runtime.tree.RewriteEmptyStreamException = function(elementDescription) {
+ var sup = org.antlr.runtime.tree.RewriteEmptyStreamException.superclass;
+ sup.constructor.call(this, elementDescription);
+};
+
+org.antlr.lang.extend(org.antlr.runtime.tree.RewriteEmptyStreamException,
+ org.antlr.runtime.tree.RewriteCardinalityException, {
+ name: function() {
+ return "org.antlr.runtime.tree.RewriteEmptyStreamException";
+ }
+});
+org.antlr.runtime.tree.RewriteEarlyExitException = function(elementDescription) {
+ var sup = org.antlr.runtime.tree.RewriteEarlyExitException.superclass;
+ if (org.antlr.lang.isUndefined(elementDescription)) {
+ elementDescription = null;
+ }
+ sup.constructor.call(this, elementDescription);
+};
+
+org.antlr.lang.extend(org.antlr.runtime.tree.RewriteEarlyExitException,
+ org.antlr.runtime.tree.RewriteCardinalityException, {
+ name: function() {
+ return "org.antlr.runtime.tree.RewriteEarlyExitException";
+ }
+});
+org.antlr.runtime.MismatchedTreeNodeException = function(expecting, input) {
+ if (expecting && input) {
+ org.antlr.runtime.MismatchedTreeNodeException.superclass.constructor.call(
+ this, input);
+ this.expecting = expecting;
+ }
+};
+
+org.antlr.lang.extend(
+ org.antlr.runtime.MismatchedTreeNodeException,
+ org.antlr.runtime.RecognitionException, {
+ toString: function() {
+ return "MismatchedTreeNodeException(" +
+ this.getUnexpectedType() + "!=" + this.expecting + ")";
+ },
+ name: "org.antlr.runtime.MismatchedTreeNodeException"
+});
+org.antlr.runtime.tree.BaseTree = function() {};
+
+org.antlr.runtime.tree.BaseTree.prototype = {
+ getChild: function(i) {
+ if ( !this.children || i>=this.children.length ) {
+ return null;
+ }
+ return this.children[i];
+ },
+
+ /** Get the children internal List; note that if you directly mess with
+ * the list, do so at your own risk.
+ */
+ getChildren: function() {
+ return this.children;
+ },
+
+ getFirstChildWithType: function(type) {
+ var i, t;
+ for (i = 0; this.children && i < this.children.length; i++) {
+ t = this.children[i];
+ if ( t.getType()===type ) {
+ return t;
+ }
+ }
+ return null;
+ },
+
+ getChildCount: function() {
+ if ( !this.children ) {
+ return 0;
+ }
+ return this.children.length;
+ },
+
+ /** Add t as child of this node.
+ *
+ * Warning: if t has no children, but child does
+ * and child isNil then this routine moves children to t via
+ * t.children = child.children; i.e., without copying the array.
+ */
+ addChild: function(t) {
+ if ( !org.antlr.lang.isValue(t) ) {
+ return; // do nothing upon addChild(null)
+ }
+ var childTree = t, n, i, c;
+ if ( childTree.isNil() ) { // t is an empty node possibly with children
+ if ( this.children && this.children == childTree.children ) {
+ throw new Error("attempt to add child list to itself");
+ }
+ // just add all of childTree's children to this
+ if ( childTree.children ) {
+ if ( this.children ) { // must copy, this has children already
+ n = childTree.children.length;
+ for (i = 0; i < n; i++) {
+ c = childTree.children[i];
+ this.children.push(c);
+ // handle double-link stuff for each child of nil root
+ c.setParent(this);
+ c.setChildIndex(this.children.length-1);
+ }
+ }
+ else {
+ // no children for this but t has children; just set pointer
+ // call general freshener routine
+ this.children = childTree.children;
+ this.freshenParentAndChildIndexes();
+ }
+ }
+ }
+ else { // child is not nil (don't care about children)
+ if ( !this.children ) {
+ this.children = this.createChildrenList(); // create children list on demand
+ }
+ this.children.push(t);
+ childTree.setParent(this);
+ childTree.setChildIndex(this.children.length-1);
+ }
+ },
+
+ /** Add all elements of kids list as children of this node */
+ addChildren: function(kids) {
+ var i, t;
+ for (i = 0; i < kids.length; i++) {
+ t = kids[i];
+ this.addChild(t);
+ }
+ },
+
+ setChild: function(i, t) {
+ if ( !t ) {
+ return;
+ }
+ if ( t.isNil() ) {
+ throw new Error("Can't set single child to a list");
+ }
+ if ( !this.children ) {
+ this.children = this.createChildrenList();
+ }
+ this.children[i] = t;
+ t.setParent(this);
+ t.setChildIndex(i);
+ },
+
+ deleteChild: function(i) {
+ if ( !this.children ) {
+ return null;
+ }
+ if (i<0 || i>=this.children.length) {
+ throw new Error("Index out of bounds.");
+ }
+ var killed = this.children.splice(i, 1)[0];
+ // walk rest and decrement their child indexes
+ this.freshenParentAndChildIndexes(i);
+ return killed;
+ },
+
+ /** Delete children from start to stop and replace with t even if t is
+ * a list (nil-root tree). num of children can increase or decrease.
+ * For huge child lists, inserting children can force walking rest of
+ * children to set their childindex; could be slow.
+ */
+ replaceChildren: function(startChildIndex, stopChildIndex, t) {
+ if ( !this.children ) {
+ throw new Error("indexes invalid; no children in list");
+ }
+ var replacingHowMany = stopChildIndex - startChildIndex + 1;
+ var replacingWithHowMany;
+ var newTree = t;
+ var newChildren = null;
+ // normalize to a list of children to add: newChildren
+ if ( newTree.isNil() ) {
+ newChildren = newTree.children;
+ }
+ else {
+ newChildren = [];
+ newChildren.push(newTree);
+ }
+ replacingWithHowMany = newChildren.length;
+ var numNewChildren = newChildren.length;
+ var delta = replacingHowMany - replacingWithHowMany;
+ var j, i, child, indexToDelete, c, killed, numToInsert;
+ // if same number of nodes, do direct replace
+ if ( delta === 0 ) {
+ j = 0; // index into new children
+ for (i=startChildIndex; i<=stopChildIndex; i++) {
+ child = newChildren[j];
+ this.children[i] = child;
+ child.setParent(this);
+ child.setChildIndex(i);
+ j++;
+ }
+ }
+ else if ( delta > 0 ) { // fewer new nodes than there were
+ // set children and then delete extra
+ for (j=0; j<numNewChildren; j++) {
+ this.children[startChildIndex+j] = newChildren[j];
+ }
+ indexToDelete = startChildIndex+numNewChildren;
+ for (c=indexToDelete; c<=stopChildIndex; c++) {
+ // delete same index, shifting everybody down each time
+ killed = this.children.splice(indexToDelete, 1)[0];
+ }
+ this.freshenParentAndChildIndexes(startChildIndex);
+ }
+ else { // more new nodes than were there before
+ // fill in as many children as we can (replacingHowMany) w/o moving data
+ for (j=0; j<replacingHowMany; j++) {
+ this.children[startChildIndex+j] = newChildren[j];
+ }
+ numToInsert = replacingWithHowMany-replacingHowMany;
+ for (j=replacingHowMany; j<replacingWithHowMany; j++) {
+ this.children.splice(startChildIndex+j, 0, newChildren[j]);
+ }
+ this.freshenParentAndChildIndexes(startChildIndex);
+ }
+ },
+
+ /** Override in a subclass to change the impl of children list */
+ createChildrenList: function() {
+ return [];
+ },
+
+ isNil: function() {
+ return false;
+ },
+
+ freshenParentAndChildIndexes: function(offset) {
+ if (!org.antlr.lang.isNumber(offset)) {
+ offset = 0;
+ }
+ var n = this.getChildCount(),
+ c,
+ child;
+ for (c = offset; c < n; c++) {
+ child = this.getChild(c);
+ child.setChildIndex(c);
+ child.setParent(this);
+ }
+ },
+
+ sanityCheckParentAndChildIndexes: function(parent, i) {
+ if (arguments.length===0) {
+ parent = null;
+ i = -1;
+ }
+
+ if ( parent!==this.getParent() ) {
+ throw new Error("parents don't match; expected "+parent+" found "+this.getParent());
+ }
+ if ( i!==this.getChildIndex() ) {
+ throw new Error("child indexes don't match; expected "+i+" found "+this.getChildIndex());
+ }
+ var n = this.getChildCount(),
+ c,
+ child;
+ for (c = 0; c < n; c++) {
+ child = this.getChild(c);
+ child.sanityCheckParentAndChildIndexes(this, c);
+ }
+ },
+
+ /** BaseTree doesn't track child indexes. */
+ getChildIndex: function() {
+ return 0;
+ },
+ setChildIndex: function(index) {
+ },
+
+ /** BaseTree doesn't track parent pointers. */
+ getParent: function() {
+ return null;
+ },
+ setParent: function(t) {
+ },
+
+ getTree: function() {
+ return this;
+ },
+
+ /** Print out a whole tree not just a node */
+ toStringTree: function() {
+ if ( !this.children || this.children.length===0 ) {
+ return this.toString();
+ }
+ var buf = "",
+ i,
+ t;
+ if ( !this.isNil() ) {
+ buf += "(";
+ buf += this.toString();
+ buf += ' ';
+ }
+ for (i = 0; this.children && i < this.children.length; i++) {
+ t = this.children[i];
+ if ( i>0 ) {
+ buf += ' ';
+ }
+ buf += t.toStringTree();
+ }
+ if ( !this.isNil() ) {
+ buf += ")";
+ }
+ return buf;
+ },
+
+ getLine: function() {
+ return 0;
+ },
+
+ getCharPositionInLine: function() {
+ return 0;
+ }
+};
+org.antlr.runtime.tree.CommonTree = function(node) {
+ /** What token indexes bracket all tokens associated with this node
+ * and below?
+ */
+ this.startIndex = -1;
+ this.stopIndex = -1;
+ this.childIndex = -1;
+ this.parent = null;
+ this.token = null;
+
+ if (node instanceof org.antlr.runtime.tree.CommonTree) {
+ org.antlr.runtime.tree.CommonTree.superclass.constructor.call(this, node);
+ this.token = node.token;
+ this.startIndex = node.startIndex;
+ this.stopIndex = node.stopIndex;
+ } else if (node instanceof org.antlr.runtime.CommonToken) {
+ this.token = node;
+ }
+};
+org.antlr.lang.extend(org.antlr.runtime.tree.CommonTree, org.antlr.runtime.tree.BaseTree, {
+ getToken: function() {
+ return this.token;
+ },
+
+ dupNode: function() {
+ return new org.antlr.runtime.tree.CommonTree(this);
+ },
+
+ isNil: function() {
+ return !this.token;
+ },
+
+ getType: function() {
+ if ( !this.token ) {
+ return org.antlr.runtime.Token.INVALID_TOKEN_TYPE;
+ }
+ return this.token.getType();
+ },
+
+ getText: function() {
+ if ( !this.token ) {
+ return null;
+ }
+ return this.token.getText();
+ },
+
+ getLine: function() {
+ if ( !this.token || this.token.getLine()===0 ) {
+ if ( this.getChildCount()>0 ) {
+ return this.getChild(0).getLine();
+ }
+ return 0;
+ }
+ return this.token.getLine();
+ },
+
+ getCharPositionInLine: function() {
+ if ( !this.token || this.token.getCharPositionInLine()===-1 ) {
+ if ( this.getChildCount()>0 ) {
+ return this.getChild(0).getCharPositionInLine();
+ }
+ return 0;
+ }
+ return this.token.getCharPositionInLine();
+ },
+
+ getTokenStartIndex: function() {
+ if ( this.token ) {
+ return this.token.getTokenIndex();
+ }
+ return this.startIndex;
+ },
+
+ setTokenStartIndex: function(index) {
+ this.startIndex = index;
+ },
+
+ getTokenStopIndex: function() {
+ if ( this.token ) {
+ return this.token.getTokenIndex();
+ }
+ return this.stopIndex;
+ },
+
+ setTokenStopIndex: function(index) {
+ this.stopIndex = index;
+ },
+
+ getChildIndex: function() {
+ return this.childIndex;
+ },
+
+ getParent: function() {
+ return this.parent;
+ },
+
+ setParent: function(t) {
+ this.parent = t;
+ },
+
+ setChildIndex: function(index) {
+ this.childIndex = index;
+ },
+
+ toString: function() {
+ if ( this.isNil() ) {
+ return "nil";
+ }
+ if ( this.getType()===org.antlr.runtime.Token.INVALID_TOKEN_TYPE ) {
+ return "<errornode>";
+ }
+ if ( !this.token ) {
+ return null;
+ }
+ return this.token.getText();
+ }
+});
+org.antlr.runtime.tree.Tree = {
+ INVALID_NODE: new org.antlr.runtime.tree.CommonTree(org.antlr.runtime.Token.INVALID_TOKEN)
+};
+org.antlr.runtime.tree.CommonErrorNode = function(input, start, stop, e) {
+ if ( !stop ||
+ (stop.getTokenIndex() < start.getTokenIndex() &&
+ stop.getType()!=org.antlr.runtime.Token.EOF) )
+ {
+ // sometimes resync does not consume a token (when LT(1) is
+ // in follow set. So, stop will be 1 to left to start. adjust.
+ // Also handle case where start is the first token and no token
+ // is consumed during recovery; LT(-1) will return null.
+ stop = start;
+ }
+ this.input = input;
+ this.start = start;
+ this.stop = stop;
+ this.trappedException = e;
+};
+
+org.antlr.lang.extend(org.antlr.runtime.tree.CommonErrorNode, org.antlr.runtime.tree.CommonTree, {
+ isNil: function() {
+ return false;
+ },
+
+ getType: function() {
+ return org.antlr.runtime.Token.INVALID_TOKEN_TYPE;
+ },
+
+ getText: function() {
+ var badText = null;
+ if ( this.start instanceof org.antlr.runtime.CommonToken ) {
+ var i = this.start.getTokenIndex();
+ var j = this.stop.getTokenIndex();
+ if ( this.stop.getType() === org.antlr.runtime.Token.EOF ) {
+ j = this.input.size();
+ }
+ badText = this.input.toString(i, j);
+ }
+ else if ( this.start instanceof org.antlr.runtime.tree.CommonTree ) {
+ badText = this.input.toString(this.start, this.stop);
+ }
+ else {
+ // people should subclass if they alter the tree type so this
+ // next one is for sure correct.
+ badText = "<unknown>";
+ }
+ return badText;
+ },
+
+ toString: function() {
+ if ( this.trappedException instanceof org.antlr.runtime.MissingTokenException ) {
+ return "<missing type: "+
+ this.trappedException.getMissingType()+
+ ">";
+ }
+ else if ( this.trappedException instanceof org.antlr.runtime.UnwantedTokenException ) {
+ return "<extraneous: "+
+ this.trappedException.getUnexpectedToken()+
+ ", resync="+this.getText()+">";
+ }
+ else if ( this.trappedException instanceof org.antlr.runtime.MismatchedTokenException ) {
+ return "<mismatched token: "+this.trappedException.token+", resync="+this.getText()+">";
+ }
+ else if ( this.trappedException instanceof org.antlr.runtime.NoViableAltException ) {
+ return "<unexpected: "+this.trappedException.token+
+ ", resync="+this.getText()+">";
+ }
+ return "<error: "+this.getText()+">";
+ }
+});
+org.antlr.runtime.tree.BaseTreeAdaptor = function() {
+ this.uniqueNodeID = 1;
+};
+
+org.antlr.runtime.tree.BaseTreeAdaptor.prototype = {
+ nil: function() {
+ return this.create(null);
+ },
+
+ /** create tree node that holds the start and stop tokens associated
+ * with an error.
+ *
+ * If you specify your own kind of tree nodes, you will likely have to
+ * override this method. CommonTree returns Token.INVALID_TOKEN_TYPE
+ * if no token payload but you might have to set token type for diff
+ * node type.
+ */
+ errorNode: function(input, start, stop, e) {
+ var t = new org.antlr.runtime.tree.CommonErrorNode(input, start, stop, e);
+ return t;
+ },
+
+ isNil: function(tree) {
+ return tree.isNil();
+ },
+
+ /** This is generic in the sense that it will work with any kind of
+ * tree (not just Tree interface). It invokes the adaptor routines
+ * not the tree node routines to do the construction.
+ */
+ dupTree: function(t, parent) {
+ if (arguments.length===1) {
+ parent = null;
+ }
+ if ( !t ) {
+ return null;
+ }
+ var newTree = this.dupNode(t);
+ // ensure new subtree root has parent/child index set
+ this.setChildIndex(newTree, this.getChildIndex(t)); // same index in new tree
+ this.setParent(newTree, parent);
+ var n = this.getChildCount(t),
+ i, child, newSubTree;
+ for (i = 0; i < n; i++) {
+ child = this.getChild(t, i);
+ newSubTree = this.dupTree(child, t);
+ this.addChild(newTree, newSubTree);
+ }
+ return newTree;
+ },
+
+ /** Add a child to the tree t. If child is a flat tree (a list), make all
+ * in list children of t. Warning: if t has no children, but child does
+ * and child isNil then you can decide it is ok to move children to t via
+ * t.children = child.children; i.e., without copying the array. Just
+ * make sure that this is consistent with have the user will build
+ * ASTs.
+ */
+ addChild: function(t, child) {
+ if ( t && org.antlr.lang.isValue(child) ) {
+ t.addChild(child);
+ }
+ },
+
+ /** If oldRoot is a nil root, just copy or move the children to newRoot.
+ * If not a nil root, make oldRoot a child of newRoot.
+ *
+ * old=^(nil a b c), new=r yields ^(r a b c)
+ * old=^(a b c), new=r yields ^(r ^(a b c))
+ *
+ * If newRoot is a nil-rooted single child tree, use the single
+ * child as the new root node.
+ *
+ * old=^(nil a b c), new=^(nil r) yields ^(r a b c)
+ * old=^(a b c), new=^(nil r) yields ^(r ^(a b c))
+ *
+ * If oldRoot was null, it's ok, just return newRoot (even if isNil).
+ *
+ * old=null, new=r yields r
+ * old=null, new=^(nil r) yields ^(nil r)
+ *
+ * Return newRoot. Throw an exception if newRoot is not a
+ * simple node or nil root with a single child node--it must be a root
+ * node. If newRoot is ^(nil x) return x as newRoot.
+ *
+ * Be advised that it's ok for newRoot to point at oldRoot's
+ * children; i.e., you don't have to copy the list. We are
+ * constructing these nodes so we should have this control for
+ * efficiency.
+ */
+ becomeRoot: function(newRoot, oldRoot) {
+ if (newRoot instanceof org.antlr.runtime.CommonToken || !newRoot) {
+ newRoot = this.create(newRoot);
+ }
+
+ var newRootTree = newRoot,
+ oldRootTree = oldRoot;
+ if ( !oldRoot ) {
+ return newRoot;
+ }
+ // handle ^(nil real-node)
+ if ( newRootTree.isNil() ) {
+ if ( newRootTree.getChildCount()>1 ) {
+ // TODO: make tree run time exceptions hierarchy
+ throw new Error("more than one node as root (TODO: make exception hierarchy)");
+ }
+ newRootTree = newRootTree.getChild(0);
+ }
+ // add oldRoot to newRoot; addChild takes care of case where oldRoot
+ // is a flat list (i.e., nil-rooted tree). All children of oldRoot
+ // are added to newRoot.
+ newRootTree.addChild(oldRootTree);
+ return newRootTree;
+ },
+
+ /** Transform ^(nil x) to x */
+ rulePostProcessing: function(root) {
+ var r = root;
+ if ( r && r.isNil() ) {
+ if ( r.getChildCount()===0 ) {
+ r = null;
+ }
+ else if ( r.getChildCount()===1 ) {
+ r = r.getChild(0);
+ // whoever invokes rule will set parent and child index
+ r.setParent(null);
+ r.setChildIndex(-1);
+ }
+ }
+ return r;
+ },
+
+ create: function(tokenType, fromToken) {
+ var text, t;
+ if (arguments.length===2) {
+ if (org.antlr.lang.isString(arguments[1])) {
+ text = arguments[1];
+ fromToken = this.createToken(tokenType, text);
+ t = this.create(fromToken);
+ return t;
+ } else {
+ fromToken = this.createToken(fromToken);
+ fromToken.setType(tokenType);
+ t = this.create(fromToken);
+ return t;
+ }
+ } else if (arguments.length===3) {
+ text = arguments[2];
+ fromToken = this.createToken(fromToken);
+ fromToken.setType(tokenType);
+ fromToken.setText(text);
+ t = this.create(fromToken);
+ return t;
+ }
+ },
+
+ getType: function(t) {
+ t.getType();
+ return 0;
+ },
+
+ setType: function(t, type) {
+ throw new Error("don't know enough about Tree node");
+ },
+
+ getText: function(t) {
+ return t.getText();
+ },
+
+ setText: function(t, text) {
+ throw new Error("don't know enough about Tree node");
+ },
+
+ getChild: function(t, i) {
+ return t.getChild(i);
+ },
+
+ setChild: function(t, i, child) {
+ t.setChild(i, child);
+ },
+
+ deleteChild: function(t, i) {
+ return t.deleteChild(i);
+ },
+
+ getChildCount: function(t) {
+ return t.getChildCount();
+ },
+
+ getUniqueID: function(node) {
+ if ( !this.treeToUniqueIDMap ) {
+ this.treeToUniqueIDMap = {};
+ }
+ var prevID = this.treeToUniqueIDMap[node];
+ if ( org.antlr.lang.isValue(prevID) ) {
+ return prevID;
+ }
+ var ID = this.uniqueNodeID;
+ this.treeToUniqueIDMap[node] = ID;
+ this.uniqueNodeID++;
+ return ID;
+ // GC makes these nonunique:
+ // return System.identityHashCode(node);
+ }
+};
+org.antlr.runtime.tree.CommonTreeAdaptor = function() {};
+
+org.antlr.lang.extend(org.antlr.runtime.tree.CommonTreeAdaptor,
+ org.antlr.runtime.tree.BaseTreeAdaptor, {
+ /** Duplicate a node. This is part of the factory;
+ * override if you want another kind of node to be built.
+ *
+ * I could use reflection to prevent having to override this
+ * but reflection is slow.
+ */
+ dupNode: function(t) {
+ if ( !org.antlr.lang.isValue(t) ) {
+ return null;
+ }
+ return t.dupNode();
+ },
+
+ create: function(payload) {
+ if (arguments.length>1) {
+ return org.antlr.runtime.tree.CommonTreeAdaptor.superclass.create.apply(this, arguments);
+ }
+ return new org.antlr.runtime.tree.CommonTree(payload);
+ },
+
+ /** Tell me how to create a token for use with imaginary token nodes.
+ * For example, there is probably no input symbol associated with imaginary
+ * token DECL, but you need to create it as a payload or whatever for
+ * the DECL node as in ^(DECL type ID).
+ *
+ * If you care what the token payload objects' type is, you should
+ * override this method and any other createToken variant.
+ *
+ * Tell me how to create a token for use with imaginary token nodes.
+ * For example, there is probably no input symbol associated with imaginary
+ * token DECL, but you need to create it as a payload or whatever for
+ * the DECL node as in ^(DECL type ID).
+ *
+ * This is a variant of createToken where the new token is derived from
+ * an actual real input token. Typically this is for converting '{'
+ * tokens to BLOCK etc... You'll see
+ *
+ * r : lc='{' ID+ '}' -> ^(BLOCK[$lc] ID+) ;
+ *
+ * If you care what the token payload objects' type is, you should
+ * override this method and any other createToken variant.
+ */
+ createToken: function(fromToken) {
+ if (arguments.length===2) {
+ return new org.antlr.runtime.CommonToken(arguments[0], arguments[1]);
+ } else {
+ return new org.antlr.runtime.CommonToken(arguments[0]);
+ }
+ },
+
+ /** Track start/stop token for subtree root created for a rule.
+ * Only works with Tree nodes. For rules that match nothing,
+ * seems like this will yield start=i and stop=i-1 in a nil node.
+ * Might be useful info so I'll not force to be i..i.
+ */
+ setTokenBoundaries: function(t, startToken, stopToken) {
+ if ( !org.antlr.lang.isValue(t) ) {
+ return;
+ }
+ var start = 0,
+ stop = 0;
+ if ( org.antlr.lang.isValue(startToken) ) {
+ if (startToken.getTokenIndex) {
+ start = startToken.getTokenIndex();
+ } else if (startToken.getStartIndex) {
+ start = startToken.getStartIndex();
+ } else {
+ start = startToken.getTokenStartIndex();
+ }
+ }
+ if ( org.antlr.lang.isValue(stopToken) ) {
+ if (stop.getTokenIndex) {
+ stop = stopToken.getTokenIndex();
+ } else if (stopToken.getStopIndex) {
+ stop = stopToken.getStopIndex();
+ } else {
+ stop = stopToken.getTokenStopIndex();
+ }
+ }
+ t.setTokenStartIndex(start);
+ t.setTokenStopIndex(stop);
+ },
+
+ getTokenStartIndex: function(t) {
+ if (!t) {
+ return -1;
+ }
+ return t.getTokenStartIndex();
+ },
+
+ getTokenStopIndex: function(t) {
+ if (!t) {
+ return -1;
+ }
+ return t.getTokenStopIndex();
+ },
+
+ getText: function(t) {
+ if (!t) {
+ return null;
+ }
+ return t.getText();
+ },
+
+ getType: function(t) {
+ if (!t) {
+ return org.antlr.runtime.Token.INVALID_TOKEN_TYPE;
+ }
+ return t.getType();
+ },
+
+ /** What is the Token associated with this node? If
+ * you are not using CommonTree, then you must
+ * override this in your own adaptor.
+ */
+ getToken: function(t) {
+ if ( t instanceof org.antlr.runtime.tree.CommonTree ) {
+ return t.getToken();
+ }
+ return null; // no idea what to do
+ },
+
+ getChild: function(t, i) {
+ if (!t) {
+ return null;
+ }
+ return t.getChild(i);
+ },
+
+ getChildCount: function(t) {
+ if (!t) {
+ return 0;
+ }
+ return t.getChildCount();
+ },
+
+ getParent: function(t) {
+ return t.getParent();
+ },
+
+ setParent: function(t, parent) {
+ t.setParent(parent);
+ },
+
+ getChildIndex: function(t) {
+ return t.getChildIndex();
+ },
+
+ setChildIndex: function(t, index) {
+ t.setChildIndex(index);
+ },
+
+ replaceChildren: function(parent, startChildIndex, stopChildIndex, t) {
+ if ( parent ) {
+ parent.replaceChildren(startChildIndex, stopChildIndex, t);
+ }
+ }
+});
+org.antlr.runtime.ANTLRStringStream = function(data) {
+ /**
+ * Location in the stream.
+ * Ranges from 0 to (stream length - 1).
+ * @private
+ * @type Number
+ */
+ this.p = 0;
+ this.line = 1;
+ this.charPositionInLine = 0;
+ this.markDepth = 0;
+ this.markers = null;
+ this.lastMarker = null;
+ this.data = data;
+ this.n = data.length;
+};
+
+org.antlr.runtime.ANTLRStringStream.prototype = {
+ /**
+ * Reset the stream so that it's in the same state it was
+ * when the object was created *except* the data array is not
+ * touched.
+ */
+ reset: function() {
+ this.p = 0;
+ this.line = 1;
+ this.charPositionInLine = 0;
+ this.markDepth = 0;
+ },
+
+ /**
+ * Consume the next character of data in the stream.
+ */
+ consume: function() {
+ //console.log("prev p="+ this.p +", c="+ this.data.charAt(this.p));
+ if ( this.p < this.n ) {
+ this.charPositionInLine++;
+ if ( this.data.charAt(this.p)==="\n" ) {
+ this.line++;
+ this.charPositionInLine=0;
+ }
+ this.p++;
+ //console.log("p moves to " + this.p + " (c='"+ this.data.charAt(this.p) +"')");
+ }
+ },
+
+ /**
+ * Get character at current input pointer + i ahead where i=1 is next int.
+ * Negative indexes are allowed. LA(-1) is previous token (token
+ * just matched). LA(-i) where i is before first token should
+ * yield -1, invalid char / EOF.
+ * @param {Number} i non-zero amount of lookahead or lookback
+ * @returns {String|Number} The charcter at the specified position or -1 if
+ * you fell off either end of the stream.
+ */
+ LA: function(i) {
+ if ( i<0 ) {
+ i++; // e.g., translate LA(-1) to use offset i=0; then data[p+0-1]
+ }
+
+ var new_pos = this.p+i-1;
+ if (new_pos>=this.n || new_pos<0) {
+ return org.antlr.runtime.CharStream.EOF;
+ }
+ return this.data.charAt(new_pos);
+ },
+
+
+ /**
+ * Return the current input symbol index 0..n where n indicates the
+ * last symbol has been read. The index is the index of char to
+ * be returned from LA(1) (i.e. the one about to be consumed).
+ * @returns {Number} the index of the current input symbol
+ */
+ index: function() {
+ return this.p;
+ },
+
+ /**
+ * The length of this stream.
+ * @returns {Number} the length of this stream.
+ */
+ size: function() {
+ return this.n;
+ },
+
+ /**
+ * Tell the stream to start buffering if it hasn't already. Return
+ * current input position, index(), or some other marker so that
+ * when passed to rewind() you get back to the same spot.
+ * rewind(mark()) should not affect the input cursor. The Lexer
+ * tracks line/col info as well as input index so its markers are
+ * not pure input indexes. Same for tree node streams.
+ *
+ * <p>Marking is a mechanism for storing the current position of a stream
+ * in a stack. This corresponds with the predictive look-ahead mechanism
+ * used in Lexers.</p>
+ * @returns {Number} the current size of the mark stack.
+ */
+ mark: function() {
+ if ( !this.markers ) {
+ this.markers = [];
+ this.markers.push(null); // depth 0 means no backtracking, leave blank
+ }
+ this.markDepth++;
+ var state = null;
+ if ( this.markDepth>=this.markers.length ) {
+ state = {};
+ this.markers.push(state);
+ }
+ else {
+ state = this.markers[this.markDepth];
+ }
+ state.p = this.p;
+ state.line = this.line;
+ state.charPositionInLine = this.charPositionInLine;
+ this.lastMarker = this.markDepth;
+ return this.markDepth;
+ },
+
+ /**
+ * Rewind to the input position of the last marker.
+ * Used currently only after a cyclic DFA and just
+ * before starting a sem/syn predicate to get the
+ * input position back to the start of the decision.
+ * Do not "pop" the marker off the state. mark(i)
+ * and rewind(i) should balance still. It is
+ * like invoking rewind(last marker) but it should not "pop"
+ * the marker off. It's like seek(last marker's input position).
+ * @param {Number} [m] the index in the mark stack to load instead of the
+ * last.
+ */
+ rewind: function(m) {
+ if (!org.antlr.lang.isNumber(m)) {
+ m = this.lastMarker;
+ }
+
+ var state = this.markers[m];
+ // restore stream state
+ this.seek(state.p);
+ this.line = state.line;
+ this.charPositionInLine = state.charPositionInLine;
+ this.release(m);
+ },
+
+ /**
+ * You may want to commit to a backtrack but don't want to force the
+ * stream to keep bookkeeping objects around for a marker that is
+ * no longer necessary. This will have the same behavior as
+ * rewind() except it releases resources without the backward seek.
+ * This must throw away resources for all markers back to the marker
+ * argument. So if you're nested 5 levels of mark(), and then release(2)
+ * you have to release resources for depths 2..5.
+ * @param {Number} marker the mark depth above which all mark states will
+ * be released.
+ */
+ release: function(marker) {
+ // unwind any other markers made after m and release m
+ this.markDepth = marker;
+ // release this marker
+ this.markDepth--;
+ },
+
+ /**
+ * Set the input cursor to the position indicated by index. This is
+ * normally used to seek ahead in the input stream. No buffering is
+ * required to do this unless you know your stream will use seek to
+ * move backwards such as when backtracking.
+ *
+ * <p>This is different from rewind in its multi-directional
+ * requirement and in that its argument is strictly an input cursor
+ * (index).</p>
+ *
+ * <p>For char streams, seeking forward must update the stream state such
+ * as line number. For seeking backwards, you will be presumably
+ * backtracking using the mark/rewind mechanism that restores state and
+ * so this method does not need to update state when seeking backwards.</p>
+ *
+ * <p>Currently, this method is only used for efficient backtracking using
+ * memoization, but in the future it may be used for incremental
+ * parsing.</p>
+ *
+ * <p>The index is 0..n-1. A seek to position i means that LA(1) will
+ * return the ith symbol. So, seeking to 0 means LA(1) will return the
+ * first element in the stream.</p>
+ *
+ * <p>Esentially this method method moves the input position,
+ * {@link #consume}-ing data if necessary.</p>
+ *
+ * @param {Number} index the position to seek to.
+ */
+ seek: function(index) {
+ if ( index<=this.p ) {
+ this.p = index; // just jump; don't update stream state (line, ...)
+ return;
+ }
+ // seek forward, consume until p hits index
+ while ( this.p<index ) {
+ this.consume();
+ }
+ },
+
+ /**
+ * Retrieve a substring from this stream.
+ * @param {Number} start the starting index of the substring (inclusive).
+ * @param {Number} stop the last index of the substring (inclusive).
+ * @returns {String}
+ */
+ substring: function(start, stop) {
+ return this.data.substr(start,stop-start+1);
+ },
+
+ /**
+ * Return the current line position in the stream.
+ * @returns {Number} the current line position in the stream (1..numlines).
+ */
+ getLine: function() {
+ return this.line;
+ },
+
+ /**
+ * Get the index of the character relative to the beginning of the line.
+ * Ranges from 0 to (length of line - 1).
+ * @returns {Number}
+ */
+ getCharPositionInLine: function() {
+ return this.charPositionInLine;
+ },
+
+ /**
+ * Set the current line in the input stream.
+ * This is used internally when performing rewinds.
+ * @param {Number} line
+ * @private
+ */
+ setLine: function(line) {
+ this.line = line;
+ },
+
+ /**
+ * Set the index of the character relative to the beginning of the line.
+ * Ranges from 0 to (length of line - 1).
+ * @param {Number} pos
+ * @private
+ */
+ setCharPositionInLine: function(pos) {
+ this.charPositionInLine = pos;
+ },
+
+ /** Where are you getting symbols from? Normally, implementations will
+ * pass the buck all the way to the lexer who can ask its input stream
+ * for the file name or whatever.
+ */
+ getSourceName: function() {
+ return null;
+ }
+};
+org.antlr.runtime.ANTLRStringStream.LT = org.antlr.runtime.ANTLRStringStream.LA;
+org.antlr.runtime.CommonTokenStream = function(tokenSource, channel) {
+ this.p = -1;
+ this.channel = org.antlr.runtime.Token.DEFAULT_CHANNEL;
+ this.v_discardOffChannelTokens = false;
+
+ this.tokens = [];
+ if (arguments.length >= 2) {
+ this.channel = channel;
+ } else if (arguments.length === 1) {
+ this.tokenSource = tokenSource;
+ }
+};
+
+org.antlr.runtime.CommonTokenStream.prototype = {
+ /** Reset this token stream by setting its token source. */
+ setTokenSource: function(tokenSource) {
+ this.tokenSource = tokenSource;
+ this.tokens = [];
+ this.p = -1;
+ this.channel = org.antlr.runtime.Token.DEFAULT_CHANNEL;
+ },
+
+ /** Load all tokens from the token source and put in tokens.
+ * This is done upon first LT request because you might want to
+ * set some token type / channel overrides before filling buffer.
+ */
+ fillBuffer: function() {
+ var index = 0,
+ t = this.tokenSource.nextToken(),
+ discard,
+ channelI;
+ while ( org.antlr.lang.isValue(t) &&
+ t.getType()!=org.antlr.runtime.CharStream.EOF )
+ {
+ discard = false;
+ // is there a channel override for token type?
+ if ( this.channelOverrideMap ) {
+ channelI = this.channelOverrideMap[t.getType()];
+ if ( org.antlr.lang.isValue(channelI) ) {
+ t.setChannel(channelI);
+ }
+ }
+ if ( this.discardSet && this.discardSet[t.getType()] )
+ {
+ discard = true;
+ }
+ else if ( this.v_discardOffChannelTokens &&
+ t.getChannel()!=this.channel )
+ {
+ discard = true;
+ }
+ if ( !discard ) {
+ t.setTokenIndex(index);
+ this.tokens.push(t);
+ index++;
+ }
+ t = this.tokenSource.nextToken();
+ }
+ // leave p pointing at first token on channel
+ this.p = 0;
+ this.p = this.skipOffTokenChannels(this.p);
+ },
+
+ /** Move the input pointer to the next incoming token. The stream
+ * must become active with LT(1) available. consume() simply
+ * moves the input pointer so that LT(1) points at the next
+ * input symbol. Consume at least one token.
+ *
+ * Walk past any token not on the channel the parser is listening to.
+ */
+ consume: function() {
+ if ( this.p<this.tokens.length ) {
+ this.p++;
+ this.p = this.skipOffTokenChannels(this.p); // leave p on valid token
+ }
+ },
+
+ /** Given a starting index, return the index of the first on-channel
+ * token.
+ */
+ skipOffTokenChannels: function(i) {
+ var n = this.tokens.length;
+ while ( i<n && (this.tokens[i]).getChannel()!=this.channel ) {
+ i++;
+ }
+ return i;
+ },
+
+ skipOffTokenChannelsReverse: function(i) {
+ while ( i>=0 && (this.tokens[i]).getChannel()!=this.channel ) {
+ i--;
+ }
+ return i;
+ },
+
+ /** A simple filter mechanism whereby you can tell this token stream
+ * to force all tokens of type ttype to be on channel. For example,
+ * when interpreting, we cannot exec actions so we need to tell
+ * the stream to force all WS and NEWLINE to be a different, ignored
+ * channel.
+ */
+ setTokenTypeChannel: function(ttype, channel) {
+ if ( !this.channelOverrideMap ) {
+ this.channelOverrideMap = {};
+ }
+ this.channelOverrideMap[ttype] = channel;
+ },
+
+ discardTokenType: function(ttype) {
+ if ( !this.discardSet ) {
+ this.discardSet = {};
+ }
+ this.discardSet[ttype] = true;
+ },
+
+ discardOffChannelTokens: function(b) {
+ this.v_discardOffChannelTokens = b;
+ },
+
+ /** Given a start and stop index, return a List of all tokens in
+ * the token type BitSet. Return null if no tokens were found. This
+ * method looks at both on and off channel tokens.
+ */
+ getTokens: function(start, stop, types) {
+ if ( this.p === -1 ) {
+ this.fillBuffer();
+ }
+
+ if (arguments.length===0) {
+ return this.tokens;
+ }
+
+ if (org.antlr.lang.isArray(types)) {
+ types = new org.antlr.runtime.BitSet(types);
+ } else if (org.antlr.lang.isNumber(types)) {
+ types = org.antlr.runtime.BitSet.of(types);
+ }
+
+ if ( stop>=this.tokens.length ) {
+ stop=this.tokens.length-1;
+ }
+ if ( start<0 ) {
+ start=0;
+ }
+ if ( start>stop ) {
+ return null;
+ }
+
+ // list = tokens[start:stop]:{Token t, t.getType() in types}
+ var filteredTokens = [],
+ i,
+ t;
+ for (i=start; i<=stop; i++) {
+ t = this.tokens[i];
+ if ( !this.types || types.member(t.getType()) ) {
+ filteredTokens.push(t);
+ }
+ }
+ if ( filteredTokens.length===0 ) {
+ filteredTokens = null;
+ }
+ return filteredTokens;
+ },
+
+ /** Get the ith token from the current position 1..n where k=1 is the
+ * first symbol of lookahead.
+ */
+ LT: function(k) {
+ if ( this.p === -1 ) {
+ this.fillBuffer();
+ }
+ if ( k===0 ) {
+ return null;
+ }
+ if ( k<0 ) {
+ return this.LB(-1*k);
+ }
+ if ( (this.p+k-1) >= this.tokens.length ) {
+ return org.antlr.runtime.Token.EOF_TOKEN;
+ }
+ var i = this.p,
+ n = 1;
+ // find k good tokens
+ while ( n<k ) {
+ // skip off-channel tokens
+ i = this.skipOffTokenChannels(i+1); // leave p on valid token
+ n++;
+ }
+ if ( i>=this.tokens.length ) {
+ return org.antlr.runtime.Token.EOF_TOKEN;
+ }
+ return this.tokens[i];
+ },
+
+ /** Look backwards k tokens on-channel tokens */
+ LB: function(k) {
+ if ( this.p === -1 ) {
+ this.fillBuffer();
+ }
+ if ( k===0 ) {
+ return null;
+ }
+ if ( (this.p-k)<0 ) {
+ return null;
+ }
+
+ var i = this.p,
+ n = 1;
+ // find k good tokens looking backwards
+ while ( n<=k ) {
+ // skip off-channel tokens
+ i = this.skipOffTokenChannelsReverse(i-1); // leave p on valid token
+ n++;
+ }
+ if ( i<0 ) {
+ return null;
+ }
+ return this.tokens[i];
+ },
+
+ /** Return absolute token i; ignore which channel the tokens are on;
+ * that is, count all tokens not just on-channel tokens.
+ */
+ get: function(i) {
+ return this.tokens[i];
+ },
+
+ LA: function(i) {
+ return this.LT(i).getType();
+ },
+
+ mark: function() {
+ if ( this.p === -1 ) {
+ this.fillBuffer();
+ }
+ this.lastMarker = this.index();
+ return this.lastMarker;
+ },
+
+ release: function(marker) {
+ // no resources to release
+ },
+
+ size: function() {
+ return this.tokens.length;
+ },
+
+ index: function() {
+ return this.p;
+ },
+
+ rewind: function(marker) {
+ if (!org.antlr.lang.isNumber(marker)) {
+ marker = this.lastMarker;
+ }
+ this.seek(marker);
+ },
+
+ reset: function() {
+ this.p = -1;
+ this.lastMarker = 0;
+ },
+
+ seek: function(index) {
+ this.p = index;
+ },
+
+ getTokenSource: function() {
+ return this.tokenSource;
+ },
+
+ getSourceName: function() {
+ return this.getTokenSource().getSourceName();
+ },
+
+ toString: function(start, stop) {
+ if (arguments.length===0) {
+ if ( this.p === -1 ) {
+ this.fillBuffer();
+ }
+ start = 0;
+ stop = this.tokens.length-1;
+ }
+
+ if (!org.antlr.lang.isNumber(start) && !org.antlr.lang.isNumber(stop)) {
+ if ( org.antlr.lang.isValue(start) && org.antlr.lang.isValue(stop) ) {
+ start = start.getTokenIndex();
+ stop = stop.getTokenIndex();
+ } else {
+ return null;
+ }
+ }
+
+ var buf = "",
+ i;
+
+ if ( start<0 || stop<0 ) {
+ return null;
+ }
+ if ( this.p == -1 ) {
+ this.fillBuffer();
+ }
+ if ( stop>=this.tokens.length ) {
+ stop = this.tokens.length-1;
+ }
+ for (i = start; i <= stop; i++) {
+ t = this.tokens[i];
+ buf = buf + this.tokens[i].getText();
+ }
+ return buf;
+ }
+};
+
+org.antlr.runtime.TokenRewriteStream = function() {
+ var sup = org.antlr.runtime.TokenRewriteStream.superclass;
+ this.programs = null;
+ this.lastRewriteTokenIndexes = null;
+
+
+ if (arguments.length===0) {
+ this.init();
+ } else {
+ sup.constructor.apply(this, arguments);
+ this.init();
+ }
+};
+
+(function(){
+var trs = org.antlr.runtime.TokenRewriteStream;
+
+org.antlr.lang.augmentObject(trs, {
+ DEFAULT_PROGRAM_NAME: "default",
+ PROGRAM_INIT_SIZE: 100,
+ MIN_TOKEN_INDEX: 0
+});
+
+//
+// Define the rewrite operation hierarchy
+//
+
+trs.RewriteOperation = function(index, text) {
+ this.index = index;
+ this.text = text;
+};
+trs.RewriteOperation.prototype = {
+ execute: function(buf) {
+ return this.index;
+ },
+ toString: function() {
+ /*String opName = getClass().getName();
+ int $index = opName.indexOf('$');
+ opName = opName.substring($index+1, opName.length());
+ return opName+"@"+index+'"'+text+'"';*/
+ return this.text;
+ }
+};
+
+trs.InsertBeforeOp = function(index, text) {
+ trs.InsertBeforeOp.superclass.constructor.call(this, index, text);
+};
+org.antlr.lang.extend(trs.InsertBeforeOp, trs.RewriteOperation, {
+ execute: function(buf) {
+ buf.push(this.text);
+ return this.index;
+ }
+});
+trs.ReplaceOp = function(from, to, text) {
+ trs.ReplaceOp.superclass.constructor.call(this, from, text);
+ this.lastIndex = to;
+};
+org.antlr.lang.extend(trs.ReplaceOp, trs.RewriteOperation, {
+ execute: function(buf) {
+ if (org.antlr.lang.isValue(this.text)) {
+ buf.push(this.text);
+ }
+ return this.lastIndex+1;
+ }
+});
+
+trs.DeleteOp = function(from, to) {
+ trs.DeleteOp.superclass.constructor.call(this, from, to);
+};
+org.antlr.lang.extend(trs.DeleteOp, trs.ReplaceOp);
+
+org.antlr.lang.extend(trs, org.antlr.runtime.CommonTokenStream, {
+ init: function() {
+ this.programs = {};
+ this.programs[trs.DEFAULT_PROGRAM_NAME] = [];
+ this.lastRewriteTokenIndexes = {};
+ },
+
+ /** Rollback the instruction stream for a program so that
+ * the indicated instruction (via instructionIndex) is no
+ * longer in the stream. UNTESTED!
+ */
+ rollback: function() {
+ var programName,
+ instructionIndex;
+
+ if (arguments.length===1) {
+ programName = trs.DEFAULT_PROGRAM_NAME;
+ instructionIndex = arguments[0];
+ } else if (arguments.length===2) {
+ programName = arguments[0];
+ instructionIndex = arguments[1];
+ }
+ var is = this.programs[programName];
+ if (is) {
+ programs[programName] = is.slice(trs.MIN_TOKEN_INDEX, this.instructionIndex);
+ }
+ },
+
+ /** Reset the program so that no instructions exist */
+ deleteProgram: function(programName) {
+ programName = programName || trs.DEFAULT_PROGRAM_NAME;
+ this.rollback(programName, trs.MIN_TOKEN_INDEX);
+ },
+
+ /** Add an instruction to the rewrite instruction list ordered by
+ * the instruction number (use a binary search for efficiency).
+ * The list is ordered so that toString() can be done efficiently.
+ *
+ * When there are multiple instructions at the same index, the instructions
+ * must be ordered to ensure proper behavior. For example, a delete at
+ * index i must kill any replace operation at i. Insert-before operations
+ * must come before any replace / delete instructions. If there are
+ * multiple insert instructions for a single index, they are done in
+ * reverse insertion order so that "insert foo" then "insert bar" yields
+ * "foobar" in front rather than "barfoo". This is convenient because
+ * I can insert new InsertOp instructions at the index returned by
+ * the binary search. A ReplaceOp kills any previous replace op. Since
+ * delete is the same as replace with null text, i can check for
+ * ReplaceOp and cover DeleteOp at same time. :)
+ */
+ addToSortedRewriteList: function() {
+ var programName,
+ op;
+ if (arguments.length===1) {
+ programName = trs.DEFAULT_PROGRAM_NAME;
+ op = arguments[0];
+ } else if (arguments.length===2) {
+ programName = arguments[0];
+ op = arguments[1];
+ }
+
+ var rewrites = this.getProgram(programName);
+ var len, pos, searchOp, replaced, prevOp, i;
+ for (pos=0, len=rewrites.length; pos<len; pos++) {
+ searchOp = rewrites[pos];
+ if (searchOp.index===op.index) {
+ // now pos is the index in rewrites of first op with op.index
+
+ // an instruction operating already on that index was found;
+ // make this one happen after all the others
+ if (op instanceof trs.ReplaceOp) {
+ replaced = false;
+ // look for an existing replace
+ for (i=pos; i<rewrites.length; i++) {
+ prevOp = rewrites[pos];
+ if (prevOp.index!==op.index) {
+ break;
+ }
+ if (prevOp instanceof trs.ReplaceOp) {
+ rewrites[pos] = op; // replace old with new
+ replaced=true;
+ break;
+ }
+ // keep going; must be an insert
+ }
+ if ( !replaced ) {
+ // add replace op to the end of all the inserts
+ rewrites.splice(i, 0, op);
+ }
+ } else {
+ // inserts are added in front of existing inserts
+ rewrites.splice(pos, 0, op);
+ }
+ break;
+ } else if (searchOp.index > op.index) {
+ rewrites.splice(pos, 0, op);
+ break;
+ }
+ }
+ if (pos===len) {
+ rewrites.push(op);
+ }
+ },
+
+ insertAfter: function() {
+ var index, programName, text;
+ if (arguments.length===2) {
+ programName = trs.DEFAULT_PROGRAM_NAME;
+ index = arguments[0];
+ text = arguments[1];
+ } else if (arguments.length===3) {
+ programName = arguments[0];
+ index = arguments[1];
+ text = arguments[2];
+ }
+
+ if (index instanceof org.antlr.runtime.CommonToken) {
+ // index is a Token, grab it's stream index
+ index = index.index; // that's ugly
+ }
+
+ // insert after is the same as insert before the next index
+ this.insertBefore(programName, index+1, text);
+ },
+
+ insertBefore: function() {
+ var index, programName, text;
+ if (arguments.length===2) {
+ programName = trs.DEFAULT_PROGRAM_NAME;
+ index = arguments[0];
+ text = arguments[1];
+ } else if (arguments.length===3) {
+ programName = arguments[0];
+ index = arguments[1];
+ text = arguments[2];
+ }
+
+ if (index instanceof org.antlr.runtime.CommonToken) {
+ // index is a Token, grab it's stream index
+ index = index.index; // that's ugly
+ }
+
+ this.addToSortedRewriteList(
+ programName,
+ new trs.InsertBeforeOp(index,text)
+ );
+ },
+
+ replace: function() {
+ var programName, first, last, text;
+ if (arguments.length===2) {
+ programName = trs.DEFAULT_PROGRAM_NAME;
+ first = arguments[0];
+ last = arguments[0];
+ text = arguments[1];
+ } else if (arguments.length===3) {
+ programName = trs.DEFAULT_PROGRAM_NAME;
+ first = arguments[0];
+ last = arguments[1];
+ text = arguments[2];
+ } if (arguments.length===4) {
+ programName = arguments[0];
+ first = arguments[1];
+ last = arguments[2];
+ text = arguments[3];
+ }
+
+ if (first instanceof org.antlr.runtime.CommonToken) {
+ first = first.index;
+ }
+
+ if (last instanceof org.antlr.runtime.CommonToken) {
+ last = last.index; // that's ugly
+ }
+
+ if ( first > last || last<0 || first<0 ) {
+ return;
+ }
+ this.addToSortedRewriteList(
+ programName,
+ new trs.ReplaceOp(first, last, text));
+ },
+
+ // !!! API Break: delete is a JS keyword, so using remove instead.
+ remove: function() {
+ // convert arguments to a real array
+ var args=[], i=arguments.length-1;
+ while (i>=0) {
+ args[i] = arguments[i];
+ i--;
+ }
+
+ args.push("");
+ this.replace.apply(this, args);
+ },
+
+ getLastRewriteTokenIndex: function(programName) {
+ programName = programName || trs.DEFAULT_PROGRAM_NAME;
+ return this.lastRewriteTokenIndexes[programName] || -1;
+ },
+
+ setLastRewriteTokenIndex: function(programName, i) {
+ this.lastRewriteTokenIndexes[programName] = i;
+ },
+
+ getProgram: function(name) {
+ var is = this.programs[name];
+ if ( !is ) {
+ is = this.initializeProgram(name);
+ }
+ return is;
+ },
+
+ initializeProgram: function(name) {
+ var is = [];
+ this.programs[name] = is;
+ return is;
+ },
+
+ toOriginalString: function(start, end) {
+ if (!org.antlr.lang.isNumber(start)) {
+ start = trs.MIN_TOKEN_INDEX;
+ }
+ if (!org.antlr.lang.isNumber(end)) {
+ end = this.size()-1;
+ }
+
+ var buf = [], i;
+ for (i=start; i>=trs.MIN_TOKEN_INDEX && i<=end && i<this.tokens.length; i++) {
+ buf.push(this.get(i).getText());
+ }
+ return buf.join("");
+ },
+
+ toString: function() {
+ var programName, start, end;
+ if (arguments.length===0) {
+ programName = trs.DEFAULT_PROGRAM_NAME;
+ start = trs.MIN_TOKEN_INDEX;
+ end = this.size() - 1;
+ } else if (arguments.length===1) {
+ programName = arguments[0];
+ start = trs.MIN_TOKEN_INDEX;
+ end = this.size() - 1;
+ } else if (arguments.length===2) {
+ programName = trs.DEFAULT_PROGRAM_NAME;
+ start = arguments[0];
+ end = arguments[1];
+ }
+
+ var rewrites = this.programs[programName];
+ if ( !rewrites || rewrites.length===0 ) {
+ return this.toOriginalString(start,end);
+ }
+
+ /// Index of first rewrite we have not done
+ var rewriteOpIndex = 0,
+ tokenCursor=start,
+ buf = [],
+ op;
+ while ( tokenCursor>=trs.MIN_TOKEN_INDEX &&
+ tokenCursor<=end &&
+ tokenCursor<this.tokens.length )
+ {
+ // execute instructions associated with this token index
+ if ( rewriteOpIndex<rewrites.length ) {
+ op = rewrites[rewriteOpIndex];
+
+ // skip all ops at lower index
+ while (op.index<tokenCursor && rewriteOpIndex<rewrites.length) {
+ rewriteOpIndex++;
+ if ( rewriteOpIndex<rewrites.length ) {
+ op = rewrites[rewriteOpIndex];
+ }
+ }
+
+ // while we have ops for this token index, exec them
+ while (tokenCursor===op.index && rewriteOpIndex<rewrites.length) {
+ //System.out.println("execute "+op+" at instruction "+rewriteOpIndex);
+ tokenCursor = op.execute(buf);
+ //System.out.println("after execute tokenCursor = "+tokenCursor);
+ rewriteOpIndex++;
+ if ( rewriteOpIndex<rewrites.length ) {
+ op = rewrites[rewriteOpIndex];
+ }
+ }
+ }
+ // dump the token at this index
+ if ( tokenCursor<=end ) {
+ buf.push(this.get(tokenCursor).getText());
+ tokenCursor++;
+ }
+ }
+ // now see if there are operations (append) beyond last token index
+ var opi;
+ for (opi=rewriteOpIndex; opi<rewrites.length; opi++) {
+ op = rewrites[opi];
+ if ( op.index>=this.size() ) {
+ op.execute(buf); // must be insertions if after last token
+ }
+ }
+
+ return buf.join("");
+ },
+
+ toDebugString: function(start, end) {
+ if (!org.antlr.lang.isNumber(start)) {
+ start = trs.MIN_TOKEN_INDEX;
+ }
+ if (!org.antlr.lang.isNumber(end)) {
+ end = this.size()-1;
+ }
+
+ var buf = [],
+ i;
+ for (i=start; i>=trs.MIN_TOKEN_INDEX && i<=end && i<this.tokens.length; i++) {
+ buf.push(this.get(i));
+ }
+ return buf.join("");
+ }
+});
+
+})();
+org.antlr.runtime.tree.TreeNodeStream = function() {};
+org.antlr.runtime.tree.CommonTreeNodeStream = function(adaptor,
+ tree,
+ initialBufferSize)
+{
+ if (arguments.length===1) {
+ tree = adaptor;
+ adaptor = new org.antlr.runtime.tree.CommonTreeAdaptor();
+ }
+ if (arguments.length <= 2) {
+ initialBufferSize =
+ org.antlr.runtime.tree.CommonTreeNodeStream.DEFAULT_INITIAL_BUFFER_SIZE;
+ }
+
+ /** Reuse same DOWN, UP navigation nodes unless this is true */
+ this.uniqueNavigationNodes = false;
+ this.p = -1;
+
+ var Token = org.antlr.runtime.Token;
+ this.root = tree;
+ this.adaptor = adaptor;
+ this.nodes = []; //new ArrayList(initialBufferSize);
+ this.down = this.adaptor.create(Token.DOWN, "DOWN");
+ this.up = this.adaptor.create(Token.UP, "UP");
+ this.eof = this.adaptor.create(Token.EOF, "EOF");
+};
+
+org.antlr.lang.augmentObject(org.antlr.runtime.tree.CommonTreeNodeStream, {
+ DEFAULT_INITIAL_BUFFER_SIZE: 100,
+ INITIAL_CALL_STACK_SIZE: 10
+});
+
+org.antlr.lang.extend(org.antlr.runtime.tree.CommonTreeNodeStream,
+ org.antlr.runtime.tree.TreeNodeStream,
+{
+ StreamIterator: function() {
+ var i = 0,
+ nodes = this.nodes,
+ eof = this.eof;
+
+ return {
+ hasNext: function() {
+ return i<nodes.length;
+ },
+
+ next: function() {
+ var current = i;
+ i++;
+ if ( current < nodes.length ) {
+ return nodes[current];
+ }
+ return eof;
+ },
+
+ remove: function() {
+ throw new Error("cannot remove nodes from stream");
+ }
+ };
+ },
+
+ /** Walk tree with depth-first-search and fill nodes buffer.
+ * Don't do DOWN, UP nodes if its a list (t is isNil).
+ */
+ fillBuffer: function(t) {
+ var reset_p = false;
+ if (org.antlr.lang.isUndefined(t)) {
+ t = this.root;
+ reset_p = true;
+ }
+
+ var nil = this.adaptor.isNil(t);
+ if ( !nil ) {
+ this.nodes.push(t); // add this node
+ }
+ // add DOWN node if t has children
+ var n = this.adaptor.getChildCount(t);
+ if ( !nil && n>0 ) {
+ this.addNavigationNode(org.antlr.runtime.Token.DOWN);
+ }
+ // and now add all its children
+ var c, child;
+ for (c=0; c<n; c++) {
+ child = this.adaptor.getChild(t,c);
+ this.fillBuffer(child);
+ }
+ // add UP node if t has children
+ if ( !nil && n>0 ) {
+ this.addNavigationNode(org.antlr.runtime.Token.UP);
+ }
+
+ if (reset_p) {
+ this.p = 0; // buffer of nodes intialized now
+ }
+ },
+
+ getNodeIndex: function(node) {
+ if ( this.p==-1 ) {
+ this.fillBuffer();
+ }
+ var i, t;
+ for (i=0; i<this.nodes.length; i++) {
+ t = this.nodes[i];
+ if ( t===node ) {
+ return i;
+ }
+ }
+ return -1;
+ },
+
+ /** As we flatten the tree, we use UP, DOWN nodes to represent
+ * the tree structure. When debugging we need unique nodes
+ * so instantiate new ones when uniqueNavigationNodes is true.
+ */
+ addNavigationNode: function(ttype) {
+ var navNode = null;
+ if ( ttype===org.antlr.runtime.Token.DOWN ) {
+ if ( this.hasUniqueNavigationNodes() ) {
+ navNode = this.adaptor.create(org.antlr.runtime.Token.DOWN, "DOWN");
+ }
+ else {
+ navNode = this.down;
+ }
+ }
+ else {
+ if ( this.hasUniqueNavigationNodes() ) {
+ navNode = this.adaptor.create(org.antlr.runtime.Token.UP, "UP");
+ }
+ else {
+ navNode = this.up;
+ }
+ }
+ this.nodes.push(navNode);
+ },
+
+ get: function(i) {
+ if ( this.p===-1 ) {
+ this.fillBuffer();
+ }
+ return this.nodes[i];
+ },
+
+ LT: function(k) {
+ if ( this.p===-1 ) {
+ this.fillBuffer();
+ }
+ if ( k===0 ) {
+ return null;
+ }
+ if ( k<0 ) {
+ return this.LB(-1*k);
+ }
+ if ( (this.p+k-1) >= this.nodes.length ) {
+ return this.eof;
+ }
+ return this.nodes[this.p+k-1];
+ },
+
+ getCurrentSymbol: function() { return this.LT(1); },
+
+ /** Look backwards k nodes */
+ LB: function(k) {
+ if ( k===0 ) {
+ return null;
+ }
+ if ( (this.p-k)<0 ) {
+ return null;
+ }
+ return this.nodes[this.p-k];
+ },
+
+ getTreeSource: function() {
+ return this.root;
+ },
+
+ getSourceName: function() {
+ return this.getTokenStream().getSourceName();
+ },
+
+ getTokenStream: function() {
+ return this.tokens;
+ },
+
+ setTokenStream: function(tokens) {
+ this.tokens = tokens;
+ },
+
+ getTreeAdaptor: function() {
+ return this.adaptor;
+ },
+
+ setTreeAdaptor: function(adaptor) {
+ this.adaptor = adaptor;
+ },
+
+ hasUniqueNavigationNodes: function() {
+ return this.uniqueNavigationNodes;
+ },
+
+ setUniqueNavigationNodes: function(uniqueNavigationNodes) {
+ this.uniqueNavigationNodes = uniqueNavigationNodes;
+ },
+
+ consume: function() {
+ if ( this.p===-1 ) {
+ this.fillBuffer();
+ }
+ this.p++;
+ },
+
+ LA: function(i) {
+ return this.adaptor.getType(this.LT(i));
+ },
+
+ mark: function() {
+ if ( this.p===-1 ) {
+ this.fillBuffer();
+ }
+ this.lastMarker = this.index();
+ return this.lastMarker;
+ },
+
+ release: function(marker) {
+ // no resources to release
+ },
+
+ index: function() {
+ return this.p;
+ },
+
+ rewind: function(marker) {
+ if (!org.antlr.lang.isNumber(marker)) {
+ marker = this.lastMarker;
+ }
+ this.seek(marker);
+ },
+
+ seek: function(index) {
+ if ( this.p===-1 ) {
+ this.fillBuffer();
+ }
+ this.p = index;
+ },
+
+ /** Make stream jump to a new location, saving old location.
+ * Switch back with pop().
+ */
+ push: function(index) {
+ if ( !this.calls ) {
+ this.calls = [];
+ }
+ this.calls.push(this.p); // save current index
+ this.seek(index);
+ },
+
+ /** Seek back to previous index saved during last push() call.
+ * Return top of stack (return index).
+ */
+ pop: function() {
+ var ret = this.calls.pop();
+ this.seek(ret);
+ return ret;
+ },
+
+ reset: function() {
+ this.p = -1;
+ this.lastMarker = 0;
+ if (this.calls) {
+ this.calls = [];
+ }
+ },
+
+ size: function() {
+ if ( this.p===-1 ) {
+ this.fillBuffer();
+ }
+ return this.nodes.length;
+ },
+
+ iterator: function() {
+ if ( this.p===-1 ) {
+ this.fillBuffer();
+ }
+ return this.StreamIterator();
+ },
+
+ replaceChildren: function(parent, startChildIndex, stopChildIndex, t) {
+ if ( parent ) {
+ this.adaptor.replaceChildren(parent, startChildIndex, stopChildIndex, t);
+ }
+ },
+
+ /** Debugging */
+ toTokenString: function(start, stop) {
+ if ( this.p===-1 ) {
+ this.fillBuffer();
+ }
+ var buf='', i, t;
+ for (i = start; i < this.nodes.length && i <= stop; i++) {
+ t = this.nodes[i];
+ buf += " "+this.adaptor.getToken(t);
+ }
+ return buf;
+ },
+
+ /** Used for testing, just return the token type stream */
+ toString: function(start, stop) {
+ var buf = "",
+ text,
+ t,
+ i;
+ if (arguments.length===0) {
+ if ( this.p===-1 ) {
+ this.fillBuffer();
+ }
+ for (i = 0; i < this.nodes.length; i++) {
+ t = this.nodes[i];
+ buf += " ";
+ buf += this.adaptor.getType(t);
+ }
+ return buf;
+ } else {
+ if ( !org.antlr.lang.isNumber(start) || !org.antlr.lang.isNumber(stop) ) {
+ return null;
+ }
+ if ( this.p===-1 ) {
+ this.fillBuffer();
+ }
+ //System.out.println("stop: "+stop);
+ if ( start instanceof org.antlr.runtime.tree.CommonTree ) {
+ //System.out.print("toString: "+((CommonTree)start).getToken()+", ");
+ } else {
+ //System.out.println(start);
+ }
+ if ( stop instanceof org.antlr.runtime.tree.CommonTree ) {
+ //System.out.println(((CommonTree)stop).getToken());
+ } else {
+ //System.out.println(stop);
+ }
+ // if we have the token stream, use that to dump text in order
+ var beginTokenIndex,
+ endTokenIndex;
+ if ( this.tokens ) {
+ beginTokenIndex = this.adaptor.getTokenStartIndex(start);
+ endTokenIndex = this.adaptor.getTokenStopIndex(stop);
+ // if it's a tree, use start/stop index from start node
+ // else use token range from start/stop nodes
+ if ( this.adaptor.getType(stop)===org.antlr.runtime.Token.UP ) {
+ endTokenIndex = this.adaptor.getTokenStopIndex(start);
+ }
+ else if ( this.adaptor.getType(stop)==org.antlr.runtime.Token.EOF )
+ {
+ endTokenIndex = this.size()-2; // don't use EOF
+ }
+ return this.tokens.toString(beginTokenIndex, endTokenIndex);
+ }
+ // walk nodes looking for start
+ t = null;
+ i = 0;
+ for (; i < this.nodes.length; i++) {
+ t = this.nodes[i];
+ if ( t===start ) {
+ break;
+ }
+ }
+ // now walk until we see stop, filling string buffer with text
+ buf = text = "";
+ t = this.nodes[i];
+ while ( t!==stop ) {
+ text = this.adaptor.getText(t);
+ if ( !org.antlr.lang.isString(text) ) {
+ text = " "+this.adaptor.getType(t).toString();
+ }
+ buf += text;
+ i++;
+ t = nodes[i];
+ }
+ // include stop node too
+ text = this.adaptor.getText(stop);
+ if ( !org.antlr.lang.isString(text) ) {
+ text = " "+this.adaptor.getType(stop).toString();
+ }
+ buf += text;
+ return buf;
+ }
+ }
+});
+org.antlr.runtime.tree.RewriteRuleElementStream = function(adaptor, elementDescription, el) {
+ /** Cursor 0..n-1. If singleElement!=null, cursor is 0 until you next(),
+ * which bumps it to 1 meaning no more elements.
+ */
+ this.cursor = 0;
+ this.dirty = false;
+
+ this.elementDescription = elementDescription;
+ this.adaptor = adaptor;
+ if (el) {
+ if (org.antlr.lang.isArray(el)) {
+ this.singleElement = null;
+ this.elements = el;
+ } else {
+ this.add(el);
+ }
+ }
+};
+
+org.antlr.runtime.tree.RewriteRuleElementStream.prototype = {
+ /** Reset the condition of this stream so that it appears we have
+ * not consumed any of its elements. Elements themselves are untouched.
+ * Once we reset the stream, any future use will need duplicates. Set
+ * the dirty bit.
+ */
+ reset: function() {
+ this.cursor = 0;
+ this.dirty = true;
+ },
+
+ add: function(el) {
+ if ( !org.antlr.lang.isValue(el) ) {
+ return;
+ }
+ if ( this.elements ) { // if in list, just add
+ this.elements.push(el);
+ return;
+ }
+ if ( !org.antlr.lang.isValue(this.singleElement) ) { // no elements yet, track w/o list
+ this.singleElement = el;
+ return;
+ }
+ // adding 2nd element, move to list
+ this.elements = [];
+ this.elements.push(this.singleElement);
+ this.singleElement = null;
+ this.elements.push(el);
+ },
+
+ /** Return the next element in the stream. If out of elements, throw
+ * an exception unless size()==1. If size is 1, then return elements[0].
+ * Return a duplicate node/subtree if stream is out of elements and
+ * size==1. If we've already used the element, dup (dirty bit set).
+ */
+ nextTree: function() {
+ var n = this.size(),
+ el;
+ if ( this.dirty || (this.cursor>=n && n==1) ) {
+ // if out of elements and size is 1, dup
+ el = this._next();
+ return this.dup(el);
+ }
+ // test size above then fetch
+ el = this._next();
+ return el;
+ },
+
+ /** do the work of getting the next element, making sure that it's
+ * a tree node or subtree. Deal with the optimization of single-
+ * element list versus list of size > 1. Throw an exception
+ * if the stream is empty or we're out of elements and size>1.
+ * protected so you can override in a subclass if necessary.
+ */
+ _next: function() {
+ var n = this.size();
+ if (n===0) {
+ throw new org.antlr.runtime.tree.RewriteEmptyStreamException(this.elementDescription);
+ }
+ if ( this.cursor>= n) { // out of elements?
+ if ( n===1 ) { // if size is 1, it's ok; return and we'll dup
+ return this.toTree(this.singleElement);
+ }
+ // out of elements and size was not 1, so we can't dup
+ throw new org.antlr.runtime.tree.RewriteCardinalityException(this.elementDescription);
+ }
+ // we have elements
+ if ( org.antlr.lang.isValue(this.singleElement) ) {
+ this.cursor++; // move cursor even for single element list
+ return this.toTree(this.singleElement);
+ }
+ // must have more than one in list, pull from elements
+ var o = this.toTree(this.elements[this.cursor]);
+ this.cursor++;
+ return o;
+ },
+
+ /** Ensure stream emits trees; tokens must be converted to AST nodes.
+ * AST nodes can be passed through unmolested.
+ */
+ toTree: function(el) {
+ if (el && el.getTree) {
+ return el.getTree();
+ }
+ return el;
+ },
+
+ hasNext: function() {
+ return (org.antlr.lang.isValue(this.singleElement) && this.cursor < 1) ||
+ (this.elements && this.cursor < this.elements.length);
+ },
+
+ size: function() {
+ var n = 0;
+ if ( org.antlr.lang.isValue(this.singleElement) ) {
+ n = 1;
+ }
+ if ( this.elements ) {
+ return this.elements.length;
+ }
+ return n;
+ },
+
+ getDescription: function() {
+ return this.elementDescription;
+ }
+};
+org.antlr.runtime.tree.RewriteRuleNodeStream = function(adaptor, elementDescription, el) {
+ org.antlr.runtime.tree.RewriteRuleNodeStream.superclass.constructor.apply(this, arguments);
+};
+
+org.antlr.lang.extend(org.antlr.runtime.tree.RewriteRuleNodeStream,
+ org.antlr.runtime.tree.RewriteRuleElementStream,
+{
+ nextNode: function() {
+ return this._next();
+ },
+
+ toTree: function(el) {
+ return this.adaptor.dupNode(el);
+ },
+
+ dup: function() {
+ // we dup every node, so don't have to worry about calling dup; short-
+ // circuited next() so it doesn't call.
+ throw new Error("dup can't be called for a node stream.");
+ }
+});
+org.antlr.runtime.tree.RewriteRuleTokenStream = function(adaptor, elementDescription, el) {
+ var sup = org.antlr.runtime.tree.RewriteRuleTokenStream.superclass;
+ sup.constructor.apply(this, arguments);
+};
+
+org.antlr.lang.extend(org.antlr.runtime.tree.RewriteRuleTokenStream,
+ org.antlr.runtime.tree.RewriteRuleElementStream, {
+ /** Get next token from stream and make a node for it */
+ nextNode: function() {
+ var t = this._next();
+ return this.adaptor.create(t);
+ },
+
+ nextToken: function() {
+ return this._next();
+ },
+
+ /** Don't convert to a tree unless they explicitly call nextTree.
+ * This way we can do hetero tree nodes in rewrite.
+ */
+ toTree: function(el) {
+ return el;
+ },
+
+ dup: function(el) {
+ throw new Error("dup can't be called for a token stream.");
+ }
+});
+org.antlr.runtime.tree.RewriteRuleSubtreeStream = function() {
+ var sup = org.antlr.runtime.tree.RewriteRuleSubtreeStream.superclass;
+ sup.constructor.apply(this, arguments);
+};
+
+org.antlr.lang.extend(org.antlr.runtime.tree.RewriteRuleSubtreeStream,
+ org.antlr.runtime.tree.RewriteRuleElementStream, {
+ /** Treat next element as a single node even if it's a subtree.
+ * This is used instead of next() when the result has to be a
+ * tree root node. Also prevents us from duplicating recently-added
+ * children; e.g., ^(type ID)+ adds ID to type and then 2nd iteration
+ * must dup the type node, but ID has been added.
+ *
+ * Referencing a rule result twice is ok; dup entire tree as
+ * we can't be adding trees as root; e.g., expr expr.
+ *
+ * Hideous code duplication here with super.next(). Can't think of
+ * a proper way to refactor. This needs to always call dup node
+ * and super.next() doesn't know which to call: dup node or dup tree.
+ */
+ nextNode: function() {
+ var n = this.size(),
+ el;
+ if ( this.dirty || (this.cursor>=n && n===1) ) {
+ // if out of elements and size is 1, dup (at most a single node
+ // since this is for making root nodes).
+ el = this._next();
+ return this.adaptor.dupNode(el);
+ }
+ // test size above then fetch
+ el = this._next();
+ return el;
+ },
+
+ dup: function(el) {
+ return this.adaptor.dupTree(el);
+ }
+});
+org.antlr.runtime.BaseRecognizer = function(state) {
+ /** State of a lexer, parser, or tree parser are collected into a state
+ * object so the state can be shared. This sharing is needed to
+ * have one grammar import others and share same error variables
+ * and other state variables. It's a kind of explicit multiple
+ * inheritance via delegation of methods and shared state.
+ */
+ this.state = state || new org.antlr.runtime.RecognizerSharedState();
+};
+org.antlr.lang.augmentObject(org.antlr.runtime.BaseRecognizer, {
+ MEMO_RULE_FAILED: -2,
+ MEMO_RULE_UNKNOWN: -1,
+ INITIAL_FOLLOW_STACK_SIZE: 100,
+ MEMO_RULE_FAILED_I: -2,
+ DEFAULT_TOKEN_CHANNEL: org.antlr.runtime.Token.DEFAULT_CHANNEL,
+ HIDDEN: org.antlr.runtime.Token.HIDDEN_CHANNEL,
+ NEXT_TOKEN_RULE_NAME: "nextToken"
+});
+
+org.antlr.runtime.BaseRecognizer.prototype = {
+ /** Reset the parser's state. Subclasses must rewinds the input stream */
+ reset: function() {
+ var i, len;
+
+ // wack everything related to error recovery
+ if (!this.state) {
+ return; // no shared state work to do
+ }
+ this.state._fsp = -1;
+ this.state.errorRecovery = false;
+ this.state.lastErrorIndex = -1;
+ this.state.failed = false;
+ this.state.syntaxErrors = 0;
+ // wack everything related to backtracking and memoization
+ this.state.backtracking = 0;
+ // wipe cache
+ if (this.state.ruleMemo) {
+ for (i=0, len=this.state.ruleMemo.length; i<len; i++) {
+ this.state.ruleMemo[i] = null;
+ }
+ }
+ },
+
+ /** Match current input symbol against ttype. Attempt
+ * single token insertion or deletion error recovery. If
+ * that fails, throw {@link org.antlr.runtime.MismatchedTokenException}.
+ *
+ * <p>To turn off single token insertion or deletion error
+ * recovery, override {@link #mismatchRecover} and have it call
+ * plain {@link #mismatch}, which does not recover. Then any error
+ * in a rule will cause an exception and immediate exit from
+ * rule. Rule would recover by resynchronizing to the set of
+ * symbols that can follow rule ref.</p>
+ *
+ * @param {org.antlr.runtime.IntStream} input input stream to match against.
+ * @param {Number} ttype input type to match.
+ * @param {org.antlr.runtime.BitSet} [follow] set of tokens that can follow the
+ * matched token.
+ * @returns {Object} the matched symbol
+ */
+ match: function(input, ttype, follow) {
+ var matchedSymbol = this.getCurrentInputSymbol(input);
+ if ( input.LA(1)===ttype ) {
+ input.consume();
+ this.state.errorRecovery = false;
+ this.state.failed = false;
+ return matchedSymbol;
+ }
+ if ( this.state.backtracking>0 ) {
+ this.state.failed = true;
+ return matchedSymbol;
+ }
+ matchedSymbol = this.recoverFromMismatchedToken(input, ttype, follow);
+ return matchedSymbol;
+ },
+
+ /**
+ * Match any token.
+ * @param {org.antlr.runtime.IntStream} input input stream to match against.
+ */
+ matchAny: function(input) {
+ this.state.errorRecovery = false;
+ this.state.failed = false;
+ input.consume();
+ },
+
+ /**
+ * Is the following token (LA(2)) the unwanted type (ttype)?
+ * @param {org.antlr.runtime.IntStream} input input stream to match against.
+ * @param {Number} ttype the undesired token type.
+ * @returns {Boolean} true if and only if the following token is the
+ * unwanted type.
+ */
+ mismatchIsUnwantedToken: function(input, ttype) {
+ return input.LA(2)===ttype;
+ },
+
+ /**
+ * Does the stream appear to be missing a single token?
+ * @param {org.antlr.runtime.IntStream} input input stream to match against.
+ * @param {org.antlr.runtime.BitSet} [follow] set of tokens that can follow the
+ * matched token.
+ * @returns {Boolean} true if and only if it appears that the stream is
+ * missing a single token.
+ */
+ mismatchIsMissingToken: function(input, follow) {
+ if ( !follow ) {
+ // we have no information about the follow; we can only consume
+ // a single token and hope for the best
+ return false;
+ }
+ // compute what can follow this grammar element reference
+ if ( follow.member(org.antlr.runtime.Token.EOR_TOKEN_TYPE) ) {
+ if ( this.state._fsp>=0 ) { // remove EOR if we're not the start symbol
+ follow.remove(org.antlr.runtime.Token.EOR_TOKEN_TYPE);
+ }
+ var viableTokensFollowingThisRule = this.computeContextSensitiveRuleFOLLOW();
+ follow = follow.or(this.viableTokensFollowingThisRule);
+ }
+ // if current token is consistent with what could come after set
+ // then we know we're missing a token; error recovery is free to
+ // "insert" the missing token
+
+ // BitSet cannot handle negative numbers like -1 (EOF) so I leave EOR
+ // in follow set to indicate that the fall of the start symbol is
+ // in the set (EOF can follow).
+ if ( follow.member(input.LA(1)) ||
+ follow.member(org.antlr.runtime.Token.EOR_TOKEN_TYPE) )
+ {
+ return true;
+ }
+ return false;
+ },
+
+ /** Factor out what to do upon token mismatch so tree parsers can behave
+ * differently. Override and call {@link #mismatchRecover}
+ * to get single token insertion and deletion.
+ *
+ * @param {org.antlr.runtime.IntStream} input input stream to match against.
+ * @param {Number} ttype input type to match.
+ * @param {org.antlr.runtime.BitSet} [follow] set of tokens that can follow the
+ * matched token.
+ */
+ mismatch: function(input, ttype, follow) {
+ if ( this.mismatchIsUnwantedToken(input, ttype) ) {
+ throw new org.antlr.runtime.UnwantedTokenException(ttype, input);
+ } else if ( this.mismatchIsMissingToken(input, follow) ) {
+ throw new org.antlr.runtime.MissingTokenException(ttype, input, null);
+ }
+ throw new org.antlr.runtime.MismatchedTokenException(ttype, input);
+ },
+
+ /** Report a recognition problem.
+ *
+ * <p>This method sets errorRecovery to indicate the parser is recovering
+ * not parsing. Once in recovery mode, no errors are generated.
+ * To get out of recovery mode, the parser must successfully match
+ * a token (after a resync). So it will go:</p>
+ * <ol>
+ * <li>error occurs</li>
+ * <li>enter recovery mode, report error</li>
+ * <li>consume until token found in resynch set</li>
+ * <li>try to resume parsing</li>
+ * <li>next match() will reset errorRecovery mode</li>
+ * </ol>
+ *
+ * <p>If you override, make sure to update this.state.syntaxErrors if you
+ * care about that.</p>
+ * @param {org.antlr.runtime.RecognitionException} e the error to be reported.
+ */
+ reportError: function(e) {
+ if(this.input.size() != 0) {
+ var token = this.input.get(e.index);
+ var errorMessage = "";
+ var column = 0;
+ var line = 0;
+ if(token.getType() == -1) {
+ token = this.input.get(this.input.size() - 1);
+ }
+ errorMessage = this.getErrorMessage(e, this.getTokenNames());
+ column = token.getStartIndex();
+ line = token.getLine() - 1;
+
+ var error = {
+ line: line,
+ message: errorMessage,
+ column: column
+ };
+ this.addError(error);
+ }
+ // if we've already reported an error and have not matched a token
+ // yet successfully, don't report any errors.
+ if ( this.state.errorRecovery ) {
+ return;
+ }
+ this.state.syntaxErrors++;
+ this.state.errorRecovery = true;
+
+ this.displayRecognitionError(this.getTokenNames(), e);
+ },
+
+ /**
+ * Assemble recognition error message.
+ * @param {Array} tokenNames array of token names (strings).
+ * @param {org.antlr.runtime.RecognitionException} e the error to be reported.
+ */
+ displayRecognitionError: function(tokenNames, e) {
+ var hdr = this.getErrorHeader(e),
+ msg = this.getErrorMessage(e, tokenNames);
+ this.emitErrorMessage(hdr+" "+msg);
+ },
+
+ /**
+ * Create error header message. Format is <q>line
+ * lineNumber:positionInLine</q>.
+ * @param {org.antlr.runtime.RecognitionException} e the error to be reported.
+ * @returns {String} The error header.
+ */
+ getErrorHeader: function(e) {
+ /* handle null input */
+ if (!org.antlr.lang.isNumber(e.line)) {
+ e.line = 0;
+ }
+ return "line "+e.line+":"+e.charPositionInLine;
+ },
+
+ /**
+ * Override this method to change where error messages go.
+ * Defaults to "alert"-ing the error in browsers and "print"-ing the error
+ * in other environments (e.g. Rhino, SpiderMonkey).
+ * @param {String} msg the error message to be displayed.
+ */
+ emitErrorMessage: function(msg) {
+ //throw msg;
+ console.log(msg);
+ },
+
+ /** What error message should be generated for the various
+ * exception types?
+ *
+ * <p>Not very object-oriented code, but I like having all error message
+ * generation within one method rather than spread among all of the
+ * exception classes. This also makes it much easier for the exception
+ * handling because the exception classes do not have to have pointers back
+ * to this object to access utility routines and so on. Also, changing
+ * the message for an exception type would be difficult because you
+ * would have to be subclassing exceptions, but then somehow get ANTLR
+ * to make those kinds of exception objects instead of the default.</p>
+ *
+ * <p>For grammar debugging, you will want to override this to add
+ * more information such as the stack frame and no viable alts.</p>
+ *
+ * <p>Override this to change the message generated for one or more
+ * exception types.</p>
+ *
+ * @param {Array} tokenNames array of token names (strings).
+ * @param {org.antlr.runtime.RecognitionException} e the error to be reported.
+ * @returns {String} the error message to be emitted.
+ */
+ getErrorMessage: function(e, tokenNames) {
+ var msg = (e && e.getMessage) ? e.getMessage() : null,
+ mte,
+ tokenName;
+ if ( e instanceof org.antlr.runtime.UnwantedTokenException ) {
+ var ute = e;
+ tokenName="<unknown>";
+ if ( ute.expecting== org.antlr.runtime.Token.EOF ) {
+ tokenName = "EOF";
+ } else {
+ tokenName = tokenNames[ute.expecting];
+ }
+ msg = "extraneous input "+this.getTokenErrorDisplay(ute.getUnexpectedToken())+
+ " expecting "+tokenName;
+ }
+ else if ( e instanceof org.antlr.runtime.MissingTokenException ) {
+ mte = e;
+ tokenName="<unknown>";
+ if ( mte.expecting== org.antlr.runtime.Token.EOF ) {
+ tokenName = "EOF";
+ } else {
+ tokenName = tokenNames[mte.expecting];
+ }
+ msg = "missing "+tokenName+" at "+this.getTokenErrorDisplay(e.token);
+ }
+ else if ( e instanceof org.antlr.runtime.MismatchedTokenException ) {
+ mte = e;
+ tokenName="<unknown>";
+ if ( mte.expecting== org.antlr.runtime.Token.EOF ) {
+ tokenName = "EOF";
+ }
+ else {
+ tokenName = tokenNames[mte.expecting];
+ }
+ msg = "mismatched input "+this.getTokenErrorDisplay(e.token)+
+ " expecting "+tokenName;
+ }
+ else if ( e instanceof org.antlr.runtime.NoViableAltException ) {
+ msg = "no viable alternative at input "+this.getTokenErrorDisplay(e.token);
+ }
+ else if ( e instanceof org.antlr.runtime.EarlyExitException ) {
+ msg = "required (...)+ loop did not match anything at input "+
+ this.getTokenErrorDisplay(e.token);
+ }
+ else if ( e instanceof org.antlr.runtime.MismatchedSetException ) {
+ msg = "mismatched input "+this.getTokenErrorDisplay(e.token)+
+ " expecting set "+e.expecting;
+ }
+ else if ( e instanceof org.antlr.runtime.MismatchedNotSetException ) {
+ msg = "mismatched input "+this.getTokenErrorDisplay(e.token)+
+ " expecting set "+e.expecting;
+ }
+ else if ( e instanceof org.antlr.runtime.FailedPredicateException ) {
+ msg = "rule "+e.ruleName+" failed predicate: {"+
+ e.predicateText+"}?";
+ }
+ return msg;
+ },
+
+ /** Get number of recognition errors (lexer, parser, tree parser). Each
+ * recognizer tracks its own number. So parser and lexer each have
+ * separate count. Does not count the spurious errors found between
+ * an error and next valid token match
+ *
+ * See also reportError()
+ */
+ getNumberOfSyntaxErrors: function() {
+ return this.state.syntaxErrors;
+ },
+
+ /** How should a token be displayed in an error message? The default
+ * is to display just the text, but during development you might
+ * want to have a lot of information spit out. Override in that case
+ * to use t.toString() (which, for CommonToken, dumps everything about
+ * the token). This is better than forcing you to override a method in
+ * your token objects because you don't have to go modify your lexer
+ * so that it creates a new Java type.
+ */
+ getTokenErrorDisplay: function(t) {
+ var s = t.getText();
+ if ( !org.antlr.lang.isValue(s) ) {
+ if ( t.getType()==org.antlr.runtime.Token.EOF ) {
+ s = "<EOF>";
+ }
+ else {
+ s = "<"+t.getType()+">";
+ }
+ }
+ s = s.replace(/\n/g,"\\n");
+ s = s.replace(/\r/g,"\\r");
+ s = s.replace(/\t/g,"\\t");
+ return "'"+s+"'";
+ },
+
+ /** Recover from an error found on the input stream. This is
+ * for NoViableAlt and mismatched symbol exceptions. If you enable
+ * single token insertion and deletion, this will usually not
+ * handle mismatched symbol exceptions but there could be a mismatched
+ * token that the match() routine could not recover from.
+ */
+ recover: function(input, re) {
+ if ( this.state.lastErrorIndex==input.index() ) {
+ // uh oh, another error at same token index; must be a case
+ // where LT(1) is in the recovery token set so nothing is
+ // consumed; consume a single token so at least to prevent
+ // an infinite loop; this is a failsafe.
+ input.consume();
+ }
+ this.state.lastErrorIndex = input.index();
+ var followSet = this.computeErrorRecoverySet();
+ this.beginResync();
+ this.consumeUntil(input, followSet);
+ this.endResync();
+ },
+
+ /** A hook to listen in on the token consumption during error recovery.
+ * The DebugParser subclasses this to fire events to the listenter.
+ */
+ beginResync: function() {
+ },
+
+ endResync: function() {
+ },
+
+ /* Compute the error recovery set for the current rule. During
+ * rule invocation, the parser pushes the set of tokens that can
+ * follow that rule reference on the stack; this amounts to
+ * computing FIRST of what follows the rule reference in the
+ * enclosing rule. This local follow set only includes tokens
+ * from within the rule; i.e., the FIRST computation done by
+ * ANTLR stops at the end of a rule.
+ *
+ * EXAMPLE
+ *
+ * When you find a "no viable alt exception", the input is not
+ * consistent with any of the alternatives for rule r. The best
+ * thing to do is to consume tokens until you see something that
+ * can legally follow a call to r *or* any rule that called r.
+ * You don't want the exact set of viable next tokens because the
+ * input might just be missing a token--you might consume the
+ * rest of the input looking for one of the missing tokens.
+ *
+ * Consider grammar:
+ *
+ * a : '[' b ']'
+ * | '(' b ')'
+ * ;
+ * b : c '^' INT ;
+ * c : ID
+ * | INT
+ * ;
+ *
+ * At each rule invocation, the set of tokens that could follow
+ * that rule is pushed on a stack. Here are the various "local"
+ * follow sets:
+ *
+ * FOLLOW(b1_in_a) = FIRST(']') = ']'
+ * FOLLOW(b2_in_a) = FIRST(')') = ')'
+ * FOLLOW(c_in_b) = FIRST('^') = '^'
+ *
+ * Upon erroneous input "[]", the call chain is
+ *
+ * a -> b -> c
+ *
+ * and, hence, the follow context stack is:
+ *
+ * depth local follow set after call to rule
+ * 0 <EOF> a (from main())
+ * 1 ']' b
+ * 3 '^' c
+ *
+ * Notice that ')' is not included, because b would have to have
+ * been called from a different context in rule a for ')' to be
+ * included.
+ *
+ * For error recovery, we cannot consider FOLLOW(c)
+ * (context-sensitive or otherwise). We need the combined set of
+ * all context-sensitive FOLLOW sets--the set of all tokens that
+ * could follow any reference in the call chain. We need to
+ * resync to one of those tokens. Note that FOLLOW(c)='^' and if
+ * we resync'd to that token, we'd consume until EOF. We need to
+ * sync to context-sensitive FOLLOWs for a, b, and c: {']','^'}.
+ * In this case, for input "[]", LA(1) is in this set so we would
+ * not consume anything and after printing an error rule c would
+ * return normally. It would not find the required '^' though.
+ * At this point, it gets a mismatched token error and throws an
+ * exception (since LA(1) is not in the viable following token
+ * set). The rule exception handler tries to recover, but finds
+ * the same recovery set and doesn't consume anything. Rule b
+ * exits normally returning to rule a. Now it finds the ']' (and
+ * with the successful match exits errorRecovery mode).
+ *
+ * So, you cna see that the parser walks up call chain looking
+ * for the token that was a member of the recovery set.
+ *
+ * Errors are not generated in errorRecovery mode.
+ *
+ * ANTLR's error recovery mechanism is based upon original ideas:
+ *
+ * "Algorithms + Data Structures = Programs" by Niklaus Wirth
+ *
+ * and
+ *
+ * "A note on error recovery in recursive descent parsers":
+ * http://portal.acm.org/citation.cfm?id=947902.947905
+ *
+ * Later, Josef Grosch had some good ideas:
+ *
+ * "Efficient and Comfortable Error Recovery in Recursive Descent
+ * Parsers":
+ * ftp://www.cocolab.com/products/cocktail/doca4.ps/ell.ps.zip
+ *
+ * Like Grosch I implemented local FOLLOW sets that are combined
+ * at run-time upon error to avoid overhead during parsing.
+ */
+ computeErrorRecoverySet: function() {
+ return this.combineFollows(false);
+ },
+
+
+ /** Compute the context-sensitive FOLLOW set for current rule.
+ * This is set of token types that can follow a specific rule
+ * reference given a specific call chain. You get the set of
+ * viable tokens that can possibly come next (lookahead depth 1)
+ * given the current call chain. Contrast this with the
+ * definition of plain FOLLOW for rule r:
+ *
+ * FOLLOW(r)={x | S=>*alpha r beta in G and x in FIRST(beta)}
+ *
+ * where x in T* and alpha, beta in V*; T is set of terminals and
+ * V is the set of terminals and nonterminals. In other words,
+ * FOLLOW(r) is the set of all tokens that can possibly follow
+ * references to r in *any* sentential form (context). At
+ * runtime, however, we know precisely which context applies as
+ * we have the call chain. We may compute the exact (rather
+ * than covering superset) set of following tokens.
+ *
+ * For example, consider grammar:
+ *
+ * stat : ID '=' expr ';' // FOLLOW(stat)=={EOF}
+ * | "return" expr '.'
+ * ;
+ * expr : atom ('+' atom)* ; // FOLLOW(expr)=={';','.',')'}
+ * atom : INT // FOLLOW(atom)=={'+',')',';','.'}
+ * | '(' expr ')'
+ * ;
+ *
+ * The FOLLOW sets are all inclusive whereas context-sensitive
+ * FOLLOW sets are precisely what could follow a rule reference.
+ * For input input "i=(3);", here is the derivation:
+ *
+ * stat => ID '=' expr ';'
+ * => ID '=' atom ('+' atom)* ';'
+ * => ID '=' '(' expr ')' ('+' atom)* ';'
+ * => ID '=' '(' atom ')' ('+' atom)* ';'
+ * => ID '=' '(' INT ')' ('+' atom)* ';'
+ * => ID '=' '(' INT ')' ';'
+ *
+ * At the "3" token, you'd have a call chain of
+ *
+ * stat -> expr -> atom -> expr -> atom
+ *
+ * What can follow that specific nested ref to atom? Exactly ')'
+ * as you can see by looking at the derivation of this specific
+ * input. Contrast this with the FOLLOW(atom)={'+',')',';','.'}.
+ *
+ * You want the exact viable token set when recovering from a
+ * token mismatch. Upon token mismatch, if LA(1) is member of
+ * the viable next token set, then you know there is most likely
+ * a missing token in the input stream. "Insert" one by just not
+ * throwing an exception.
+ */
+ computeContextSensitiveRuleFOLLOW: function() {
+ return this.combineFollows(true);
+ },
+
+ combineFollows: function(exact) {
+ var top = this.state._fsp,
+ i,
+ localFollowSet,
+ followSet = new org.antlr.runtime.BitSet();
+ for (i=top; i>=0; i--) {
+ localFollowSet = this.state.following[i];
+ followSet.orInPlace(localFollowSet);
+ if ( exact ) {
+ // can we see end of rule?
+ if ( localFollowSet.member(org.antlr.runtime.Token.EOR_TOKEN_TYPE) )
+ {
+ // Only leave EOR in set if at top (start rule); this lets
+ // us know if have to include follow(start rule); i.e., EOF
+ if ( i>0 ) {
+ followSet.remove(org.antlr.runtime.Token.EOR_TOKEN_TYPE);
+ }
+ }
+ else { // can't see end of rule, quit
+ break;
+ }
+ }
+ }
+ return followSet;
+ },
+
+ /** Attempt to recover from a single missing or extra token.
+ *
+ * EXTRA TOKEN
+ *
+ * LA(1) is not what we are looking for. If LA(2) has the right token,
+ * however, then assume LA(1) is some extra spurious token. Delete it
+ * and LA(2) as if we were doing a normal match(), which advances the
+ * input.
+ *
+ * MISSING TOKEN
+ *
+ * If current token is consistent with what could come after
+ * ttype then it is ok to "insert" the missing token, else throw
+ * exception For example, Input "i=(3;" is clearly missing the
+ * ')'. When the parser returns from the nested call to expr, it
+ * will have call chain:
+ *
+ * stat -> expr -> atom
+ *
+ * and it will be trying to match the ')' at this point in the
+ * derivation:
+ *
+ * => ID '=' '(' INT ')' ('+' atom)* ';'
+ * ^
+ * match() will see that ';' doesn't match ')' and report a
+ * mismatched token error. To recover, it sees that LA(1)==';'
+ * is in the set of tokens that can follow the ')' token
+ * reference in rule atom. It can assume that you forgot the ')'.
+ */
+ recoverFromMismatchedToken: function(input,
+ ttype,
+ follow)
+ {
+ var e = null;
+ // if next token is what we are looking for then "delete" this token
+ if ( this.mismatchIsUnwantedToken(input, ttype) ) {
+ e = new org.antlr.runtime.UnwantedTokenException(ttype, input);
+ this.beginResync();
+ input.consume(); // simply delete extra token
+ this.endResync();
+ this.reportError(e); // report after consuming so AW sees the token in the exception
+ // we want to return the token we're actually matching
+ var matchedSymbol = this.getCurrentInputSymbol(input);
+ input.consume(); // move past ttype token as if all were ok
+ return matchedSymbol;
+ }
+ // can't recover with single token deletion, try insertion
+ if ( this.mismatchIsMissingToken(input, follow) ) {
+ var inserted = this.getMissingSymbol(input, e, ttype, follow);
+ e = new org.antlr.runtime.MissingTokenException(ttype, input, inserted);
+ this.reportError(e); // report after inserting so AW sees the token in the exception
+ return inserted;
+ }
+ // even that didn't work; must throw the exception
+ e = new org.antlr.runtime.MismatchedTokenException(ttype, input);
+ throw e;
+ },
+
+ recoverFromMismatchedSet: function(input,
+ e,
+ follow)
+ {
+ if ( this.mismatchIsMissingToken(input, follow) ) {
+ // System.out.println("missing token");
+ this.reportError(e);
+ // we don't know how to conjure up a token for sets yet
+ return this.getMissingSymbol(input, e, org.antlr.runtime.Token.INVALID_TOKEN_TYPE, follow);
+ }
+ throw e;
+ },
+
+ /** Match needs to return the current input symbol, which gets put
+ * into the label for the associated token ref; e.g., x=ID. Token
+ * and tree parsers need to return different objects. Rather than test
+ * for input stream type or change the IntStream interface, I use
+ * a simple method to ask the recognizer to tell me what the current
+ * input symbol is.
+ *
+ * This is ignored for lexers.
+ */
+ getCurrentInputSymbol: function(input) { return null; },
+
+ /** Conjure up a missing token during error recovery.
+ *
+ * The recognizer attempts to recover from single missing
+ * symbols. But, actions might refer to that missing symbol.
+ * For example, x=ID {f($x);}. The action clearly assumes
+ * that there has been an identifier matched previously and that
+ * $x points at that token. If that token is missing, but
+ * the next token in the stream is what we want we assume that
+ * this token is missing and we keep going. Because we
+ * have to return some token to replace the missing token,
+ * we have to conjure one up. This method gives the user control
+ * over the tokens returned for missing tokens. Mostly,
+ * you will want to create something special for identifier
+ * tokens. For literals such as '{' and ',', the default
+ * action in the parser or tree parser works. It simply creates
+ * a CommonToken of the appropriate type. The text will be the token.
+ * If you change what tokens must be created by the lexer,
+ * override this method to create the appropriate tokens.
+ */
+ getMissingSymbol: function(input,
+ e,
+ expectedTokenType,
+ follow)
+ {
+ return null;
+ },
+
+
+ /** Consume tokens until one matches the given token set */
+ consumeUntil: function(input, set) {
+ var ttype = input.LA(1);
+ while (ttype != org.antlr.runtime.Token.EOF && !set.member(ttype) ) {
+ input.consume();
+ ttype = input.LA(1);
+ }
+ },
+
+ /** Push a rule's follow set using our own hardcoded stack */
+ pushFollow: function(fset) {
+ if ( (this.state._fsp +1)>=this.state.following.length ) {
+ var f = [];
+ var i;
+ for (i=this.state.following.length-1; i>=0; i--) {
+ f[i] = this.state.following[i];
+ }
+ this.state.following = f;
+ }
+ this.state._fsp++;
+ this.state.following[this.state._fsp] = fset;
+ },
+
+ /** Return List<String> of the rules in your parser instance
+ * leading up to a call to this method. You could override if
+ * you want more details such as the file/line info of where
+ * in the parser java code a rule is invoked.
+ *
+ * This is very useful for error messages and for context-sensitive
+ * error recovery.
+ *
+ * A more general version of getRuleInvocationStack where you can
+ * pass in, for example, a RecognitionException to get it's rule
+ * stack trace. This routine is shared with all recognizers, hence,
+ * static.
+ *
+ * TODO: move to a utility class or something; weird having lexer call this
+ *
+ * Most JS interpreters can't do real stack reflection. See this
+ * spidermonkey bug, for example:
+ * https://bugzilla.mozilla.org/show_bug.cgi?id=332104
+ *
+ * JS is supposed to get real stack traces in v4, at which time it would
+ * be easy to implement this function.
+ *
+ * Until then I'll leave this unimplemented. If there is enough clamor
+ * it would be possible to keep track of the invocation stack using an
+ * auxillary array, but that will definitely be a performance hit.
+ */
+ getRuleInvocationStack: function(e, recognizerClassName)
+ {
+ throw new Error("Not implemented.");
+ },
+
+ getBacktrackingLevel: function() {
+ return this.state.backtracking;
+ },
+
+ /** Used to print out token names like ID during debugging and
+ * error reporting. The generated parsers implement a method
+ * that overrides this to point to their String[] tokenNames.
+ */
+ getTokenNames: function() {
+ return null;
+ },
+
+ /** For debugging and other purposes, might want the grammar name.
+ * Have ANTLR generate an implementation for this method.
+ */
+ getGrammarFileName: function() {
+ return null;
+ },
+
+ /** A convenience method for use most often with template rewrites.
+ * Convert a List<Token> to List<String>
+ */
+ toStrings: function(tokens) {
+ if ( !tokens ) {
+ return null;
+ }
+ var strings = [];
+ var i;
+ for (i=0; i<tokens.length; i++) {
+ strings.push(tokens[i].getText());
+ }
+ return strings;
+ },
+
+ /** Given a rule number and a start token index number, return
+ * MEMO_RULE_UNKNOWN if the rule has not parsed input starting from
+ * start index. If this rule has parsed input starting from the
+ * start index before, then return where the rule stopped parsing.
+ * It returns the index of the last token matched by the rule.
+ *
+ * For now we use a hashtable and just the slow Object-based one.
+ * Later, we can make a special one for ints and also one that
+ * tosses out data after we commit past input position i.
+ */
+ getRuleMemoization: function(ruleIndex, ruleStartIndex) {
+ if ( !this.state.ruleMemo[ruleIndex] ) {
+ this.state.ruleMemo[ruleIndex] = {};
+ }
+ var stopIndexI =
+ this.state.ruleMemo[ruleIndex][ruleStartIndex];
+ if ( !org.antlr.lang.isNumber(stopIndexI) ) {
+ return org.antlr.runtime.BaseRecognizer.MEMO_RULE_UNKNOWN;
+ }
+ return stopIndexI;
+ },
+
+ /** Has this rule already parsed input at the current index in the
+ * input stream? Return the stop token index or MEMO_RULE_UNKNOWN.
+ * If we attempted but failed to parse properly before, return
+ * MEMO_RULE_FAILED.
+ *
+ * This method has a side-effect: if we have seen this input for
+ * this rule and successfully parsed before, then seek ahead to
+ * 1 past the stop token matched for this rule last time.
+ */
+ alreadyParsedRule: function(input, ruleIndex) {
+ var stopIndex = this.getRuleMemoization(ruleIndex, input.index());
+ if ( stopIndex==org.antlr.runtime.BaseRecognizer.MEMO_RULE_UNKNOWN ) {
+ return false;
+ }
+ if ( stopIndex==org.antlr.runtime.BaseRecognizer.MEMO_RULE_FAILED ) {
+ //System.out.println("rule "+ruleIndex+" will never succeed");
+ this.state.failed=true;
+ }
+ else {
+ input.seek(stopIndex+1); // jump to one past stop token
+ }
+ return true;
+ },
+
+ /** Record whether or not this rule parsed the input at this position
+ * successfully. Use a standard java hashtable for now.
+ */
+ memoize: function(input,
+ ruleIndex,
+ ruleStartIndex)
+ {
+ var stopTokenIndex = this.state.failed ?
+ org.antlr.runtime.BaseRecognizer.MEMO_RULE_FAILED : input.index()-1;
+ if ( !org.antlr.lang.isValue(this.state.ruleMemo) ) {
+ throw new Error("!!!!!!!!! memo array is null for "+ this.getGrammarFileName());
+ }
+ if ( ruleIndex >= this.state.ruleMemo.length ) {
+ throw new Error("!!!!!!!!! memo size is "+this.state.ruleMemo.length+", but rule index is "+ruleIndex);
+ }
+ if ( org.antlr.lang.isValue(this.state.ruleMemo[ruleIndex]) ) {
+ this.state.ruleMemo[ruleIndex][ruleStartIndex] = stopTokenIndex;
+ }
+ },
+
+ /** return how many rule/input-index pairs there are in total.
+ * TODO: this includes synpreds.
+ */
+ getRuleMemoizationCacheSize: function() {
+ var n = 0, i;
+ for (i = 0; this.state.ruleMemo && i < this.state.ruleMemo.length; i++) {
+ var ruleMap = this.state.ruleMemo[i];
+ if ( ruleMap ) {
+ // @todo need to get size of rulemap?
+ n += ruleMap.length; // how many input indexes are recorded?
+ }
+ }
+ return n;
+ },
+
+ traceIn: function(ruleName, ruleIndex, inputSymbol) {
+ this.emitErrorMessage("enter "+ruleName+" "+inputSymbol);
+ if ( this.state.failed ) {
+ this.emitErrorMessage(" failed="+this.failed);
+ }
+ if ( this.state.backtracking>0 ) {
+ this.emitErrorMessage(" backtracking="+this.state.backtracking);
+ }
+ // System.out.println();
+ },
+
+ traceOut: function(ruleName, ruleIndex, inputSymbol) {
+ this.emitErrorMessage("exit "+ruleName+" "+inputSymbol);
+ if ( this.state.failed ) {
+ this.emitErrorMessage(" failed="+this.state.failed);
+ }
+ if ( this.state.backtracking>0 ) {
+ this.emitErrorMessage(" backtracking="+this.state.backtracking);
+ }
+ }
+};
+org.antlr.runtime.Lexer = function(input, state) {
+ if (state) {
+ org.antlr.runtime.Lexer.superclass.constructor.call(this, state);
+ }
+ if (input) {
+ this.input = input;
+ }
+};
+
+org.antlr.lang.extend(org.antlr.runtime.Lexer, org.antlr.runtime.BaseRecognizer, {
+ reset: function() {
+ // reset all recognizer state variables
+ org.antlr.runtime.Lexer.superclass.reset.call(this);
+ if ( org.antlr.lang.isValue(this.input) ) {
+ this.input.seek(0); // rewind the input
+ }
+ if ( !org.antlr.lang.isValue(this.state) ) {
+ return; // no shared state work to do
+ }
+ this.state.token = null;
+ this.state.type = org.antlr.runtime.Token.INVALID_TOKEN_TYPE;
+ this.state.channel = org.antlr.runtime.Token.DEFAULT_CHANNEL;
+ this.state.tokenStartCharIndex = -1;
+ this.state.tokenStartCharPositionInLine = -1;
+ this.state.tokenStartLine = -1;
+ this.state.text = null;
+ },
+
+ /** Return a token from this source; i.e., match a token on the char
+ * stream.
+ */
+ nextToken: function() {
+ while (true) {
+ this.state.token = null;
+ this.state.channel = org.antlr.runtime.Token.DEFAULT_CHANNEL;
+ this.state.tokenStartCharIndex = this.input.index();
+ this.state.tokenStartCharPositionInLine = this.input.getCharPositionInLine();
+ this.state.tokenStartLine = this.input.getLine();
+ this.state.text = null;
+ if ( this.input.LA(1)===org.antlr.runtime.CharStream.EOF ) {
+ return org.antlr.runtime.Token.EOF_TOKEN;
+ }
+ try {
+ this.mTokens();
+ if ( !org.antlr.lang.isValue(this.state.token) ) {
+ this.emit();
+ }
+ else if ( this.state.token==org.antlr.runtime.Token.SKIP_TOKEN ) {
+ continue;
+ }
+ return this.state.token;
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.NoViableAltException) {
+ this.reportError(re);
+ this.recover(re);
+ } else if ( re instanceof org.antlr.runtime.RecognitionException ) {
+ this.reportError(re);
+ } else {
+ throw re;
+ }
+ }
+ }
+ },
+
+ /** Instruct the lexer to skip creating a token for current lexer rule
+ * and look for another token. nextToken() knows to keep looking when
+ * a lexer rule finishes with token set to SKIP_TOKEN. Recall that
+ * if token==null at end of any token rule, it creates one for you
+ * and emits it.
+ */
+ skip: function() {
+ this.state.token = org.antlr.runtime.Token.SKIP_TOKEN;
+ },
+
+ /** Set the char stream and reset the lexer */
+ setCharStream: function(input) {
+ this.input = null;
+ this.reset();
+ this.input = input;
+ },
+
+ getCharStream: function() {
+ return this.input;
+ },
+
+ getSourceName: function() {
+ return this.input.getSourceName();
+ },
+
+ /** Currently does not support multiple emits per nextToken invocation
+ * for efficiency reasons. Subclass and override this method and
+ * nextToken (to push tokens into a list and pull from that list rather
+ * than a single variable as this implementation does).
+ *
+ * The standard method called to automatically emit a token at the
+ * outermost lexical rule. The token object should point into the
+ * char buffer start..stop. If there is a text override in 'text',
+ * use that to set the token's text. Override this method to emit
+ * custom Token objects.
+ *
+ * If you are building trees, then you should also override
+ * Parser or TreeParser.getMissingSymbol().
+ */
+ emit: function() {
+ if (arguments.length===0) {
+ var t = new org.antlr.runtime.CommonToken(this.input, this.state.type, this.state.channel, this.state.tokenStartCharIndex, this.getCharIndex()-1);
+ t.setLine(this.state.tokenStartLine);
+ t.setText(this.state.text);
+ t.setCharPositionInLine(this.state.tokenStartCharPositionInLine);
+ this.state.token = t;
+ return t;
+ } else {
+ this.state.token = arguments[0];
+ }
+ },
+
+ match: function(s) {
+ var i = 0,
+ mte;
+
+ if (org.antlr.lang.isString(s)) {
+ while ( i<s.length ) {
+ if ( this.input.LA(1)!=s.charAt(i) ) {
+ if ( this.state.backtracking>0 ) {
+ this.state.failed = true;
+ return;
+ }
+ mte = new org.antlr.runtime.MismatchedTokenException(s.charAt(i), this.input);
+ this.recover(mte);
+ throw mte;
+ }
+ i++;
+ this.input.consume();
+ this.state.failed = false;
+ }
+ } else if (org.antlr.lang.isNumber(s)) {
+ if ( this.input.LA(1)!=s ) {
+ if ( this.state.backtracking>0 ) {
+ this.state.failed = true;
+ return;
+ }
+ mte = new org.antlr.runtime.MismatchedTokenException(s, this.input);
+ this.recover(mte);
+ throw mte;
+ }
+ this.input.consume();
+ this.state.failed = false;
+ }
+ },
+
+ matchAny: function() {
+ this.input.consume();
+ },
+
+ matchRange: function(a, b) {
+ if ( this.input.LA(1)<a || this.input.LA(1)>b ) {
+ if ( this.state.backtracking>0 ) {
+ this.state.failed = true;
+ return;
+ }
+ mre = new org.antlr.runtime.MismatchedRangeException(a,b,this.input);
+ this.recover(mre);
+ throw mre;
+ }
+ this.input.consume();
+ this.state.failed = false;
+ },
+
+ getLine: function() {
+ return this.input.getLine();
+ },
+
+ getCharPositionInLine: function() {
+ return this.input.getCharPositionInLine();
+ },
+
+ /** What is the index of the current character of lookahead? */
+ getCharIndex: function() {
+ return this.input.index();
+ },
+
+ /** Return the text matched so far for the current token or any
+ * text override.
+ */
+ getText: function() {
+ if ( org.antlr.lang.isString(this.state.text) ) {
+ return this.state.text;
+ }
+ return this.input.substring(this.state.tokenStartCharIndex,this.getCharIndex()-1);
+ },
+
+ /** Set the complete text of this token; it wipes any previous
+ * changes to the text.
+ */
+ setText: function(text) {
+ this.state.text = text;
+ },
+
+ reportError: function(e) {
+ /** TODO: not thought about recovery in lexer yet.
+ *
+ // if we've already reported an error and have not matched a token
+ // yet successfully, don't report any errors.
+ if ( errorRecovery ) {
+ //System.err.print("[SPURIOUS] ");
+ return;
+ }
+ errorRecovery = true;
+ */
+
+ this.displayRecognitionError(this.getTokenNames(), e);
+ },
+
+ getErrorMessage: function(e, tokenNames) {
+ var msg = null;
+ if ( e instanceof org.antlr.runtime.MismatchedTokenException ) {
+ msg = "mismatched character "+this.getCharErrorDisplay(e.c)+" expecting "+this.getCharErrorDisplay(e.expecting);
+ }
+ else if ( e instanceof org.antlr.runtime.NoViableAltException ) {
+ msg = "no viable alternative at character "+this.getCharErrorDisplay(e.c);
+ }
+ else if ( e instanceof org.antlr.runtime.EarlyExitException ) {
+ msg = "required (...)+ loop did not match anything at character "+this.getCharErrorDisplay(e.c);
+ }
+ else if ( e instanceof org.antlr.runtime.MismatchedNotSetException ) {
+ msg = "mismatched character "+this.getCharErrorDisplay(e.c)+" expecting set "+e.expecting;
+ }
+ else if ( e instanceof org.antlr.runtime.MismatchedSetException ) {
+ msg = "mismatched character "+this.getCharErrorDisplay(e.c)+" expecting set "+e.expecting;
+ }
+ else if ( e instanceof org.antlr.runtime.MismatchedRangeException ) {
+ msg = "mismatched character "+this.getCharErrorDisplay(e.c)+" expecting set "+
+ this.getCharErrorDisplay(e.a)+".."+this.getCharErrorDisplay(e.b);
+ }
+ else {
+ msg = org.antlr.runtime.Lexer.superclass.getErrorMessage.call(this, e, tokenNames);
+ }
+ return msg;
+ },
+
+ getCharErrorDisplay: function(c) {
+ var s = c; //String.fromCharCode(c);
+ switch ( s ) {
+ case org.antlr.runtime.Token.EOF :
+ s = "<EOF>";
+ break;
+ case "\n" :
+ s = "\\n";
+ break;
+ case "\t" :
+ s = "\\t";
+ break;
+ case "\r" :
+ s = "\\r";
+ break;
+ }
+ return "'"+s+"'";
+ },
+
+ /** Lexers can normally match any char in it's vocabulary after matching
+ * a token, so do the easy thing and just kill a character and hope
+ * it all works out. You can instead use the rule invocation stack
+ * to do sophisticated error recovery if you are in a fragment rule.
+ */
+ recover: function(re) {
+ this.input.consume();
+ },
+
+ traceIn: function(ruleName, ruleIndex) {
+ var inputSymbol = String.fromCharCode(this.input.LT(1))+" line="+this.getLine()+":"+this.getCharPositionInLine();
+ org.antlr.runtime.Lexer.superclass.traceIn.call(this, ruleName, ruleIndex, inputSymbol);
+ },
+
+ traceOut: function(ruleName, ruleIndex) {
+ var inputSymbol = String.fromCharCode(this.input.LT(1))+" line="+this.getLine()+":"+this.getCharPositionInLine();
+ org.antlr.runtime.Lexer.superclass.traceOut.call(this, ruleName, ruleIndex, inputSymbol);
+ }
+});
+org.antlr.runtime.ParserRuleReturnScope = function() {};
+
+org.antlr.runtime.ParserRuleReturnScope.prototype = {
+ getStart: function() { return this.start; },
+ getStop: function() { return this.stop; }
+};
+org.antlr.runtime.tree.TreeRuleReturnScope = function(){};
+
+org.antlr.runtime.tree.TreeRuleReturnScope.prototype = {
+ getStart: function() { return this.start; }
+};
+org.antlr.runtime.Parser = function(input, state) {
+ org.antlr.runtime.Parser.superclass.constructor.call(this, state);
+ this.setTokenStream(input);
+};
+
+org.antlr.lang.extend(org.antlr.runtime.Parser, org.antlr.runtime.BaseRecognizer, {
+ reset: function() {
+ // reset all recognizer state variables
+ org.antlr.runtime.Parser.superclass.reset.call(this);
+ if ( org.antlr.lang.isValue(this.input) ) {
+ this.input.seek(0); // rewind the input
+ }
+ },
+
+ getCurrentInputSymbol: function(input) {
+ return input.LT(1);
+ },
+
+ getMissingSymbol: function(input,
+ e,
+ expectedTokenType,
+ follow)
+ {
+ var tokenText =
+ "<missing "+this.getTokenNames()[expectedTokenType]+">";
+ var t = new org.antlr.runtime.CommonToken(expectedTokenType, tokenText);
+ var current = input.LT(1);
+ var old_current;
+ if ( current.getType() === org.antlr.runtime.Token.EOF ) {
+ old_current = current;
+ current = input.LT(-1);
+ // handle edge case where there are no good tokens in the stream
+ if (!current) {
+ current = old_current;
+ }
+ }
+ t.line = current.getLine();
+ t.charPositionInLine = current.getCharPositionInLine();
+ t.channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ return t;
+ },
+
+
+ /** Set the token stream and reset the parser */
+ setTokenStream: function(input) {
+ this.input = null;
+ this.reset();
+ this.input = input;
+ },
+
+ getTokenStream: function() {
+ return this.input;
+ },
+
+ getSourceName: function() {
+ return this.input.getSourceName();
+ },
+
+ traceIn: function(ruleName, ruleIndex) {
+ org.antlr.runtime.Parser.superclass.traceIn.call(
+ this, ruleName, ruleIndex, this.input.LT(1));
+ },
+
+ traceOut: function(ruleName, ruleIndex) {
+ org.antlr.runtime.Parser.superclass.traceOut.call(
+ this, ruleName, ruleIndex, this.input.LT(1));
+ }
+});
+org.antlr.runtime.DFA = function() {};
+
+org.antlr.runtime.DFA.prototype = {
+ /** From the input stream, predict what alternative will succeed
+ * using this DFA (representing the covering regular approximation
+ * to the underlying CFL). Return an alternative number 1..n. Throw
+ * an exception upon error.
+ */
+ predict: function(input) {
+ var mark = input.mark(), // remember where decision started in input
+ s = 0, // we always start at s0
+ specialState,
+ c,
+ snext;
+
+ try {
+ while ( true ) {
+ specialState = this.special[s];
+ if ( specialState>=0 ) {
+ s = this.specialStateTransition(specialState,input);
+ if (s===-1) {
+ this.noViableAlt(s, input);
+ return 0;
+ }
+ input.consume();
+ continue;
+ }
+ if ( this.accept[s] >= 1 ) {
+ return this.accept[s];
+ }
+ // look for a normal char transition
+ c = input.LA(1); // -1 == \uFFFF, all tokens fit in 65000 space
+
+ if (c===org.antlr.runtime.Token.EOF) {
+ c = -1;
+ } else if (org.antlr.lang.isString(c)) {
+ c = c.charCodeAt(0);
+ }
+
+ if (c>=this.min[s] && c<=this.max[s]) {
+ snext = this.transition[s][c-this.min[s]]; // move to next state
+ if ( snext < 0 ) {
+ // was in range but not a normal transition
+ // must check EOT, which is like the else clause.
+ // eot[s]>=0 indicates that an EOT edge goes to another
+ // state.
+ if ( this.eot[s]>=0 ) { // EOT Transition to accept state?
+ s = this.eot[s];
+ input.consume();
+ // TODO: I had this as return accept[eot[s]]
+ // which assumed here that the EOT edge always
+ // went to an accept...faster to do this, but
+ // what about predicated edges coming from EOT
+ // target?
+ continue;
+ }
+ this.noViableAlt(s,input);
+ return 0;
+ }
+ s = snext;
+ input.consume();
+ continue;
+ }
+ if ( this.eot[s]>=0 ) { // EOT Transition?
+ s = this.eot[s];
+ input.consume();
+ continue;
+ }
+ if ( c==org.antlr.runtime.Token.EOF && this.eof[s]>=0 ) { // EOF Transition to accept state?
+ return this.accept[this.eof[s]];
+ }
+ // not in range and not EOF/EOT, must be invalid symbol
+ this.noViableAlt(s,input);
+ return 0;
+ }
+ }
+ finally {
+ input.rewind(mark);
+ }
+ },
+
+ noViableAlt: function(s, input) {
+ if (this.recognizer.state.backtracking>0) {
+ this.recognizer.state.failed=true;
+ return;
+ }
+ var nvae =
+ new org.antlr.runtime.NoViableAltException(this.getDescription(),
+ this.decisionNumber,
+ s,
+ input);
+ this.error(nvae);
+ throw nvae;
+ },
+
+ /** A hook for debugging interface */
+ error: function(nvae) { },
+
+ specialStateTransition: function(s, input) {
+ return -1;
+ },
+
+ getDescription: function() {
+ return "n/a";
+ }
+};
+
+org.antlr.lang.augmentObject(org.antlr.runtime.DFA, {
+ /** Given a String that has a run-length-encoding of some unsigned shorts
+ * like "\1\2\3\9", convert to short[] {2,9,9,9}.
+ */
+ unpackEncodedString: function(encodedString) {
+ // walk first to find how big it is.
+ var i,
+ data = [],
+ di = 0,
+ n,
+ v,
+ j;
+ for (i=0; i<encodedString.length; i+=2) {
+ n = encodedString.charCodeAt(i);
+ v = encodedString.charCodeAt(i+1);
+ if (v===0xffff) {
+ v = -1; // overflow at 16 bits
+ }
+ // add v n times to data
+ for (j=1; j<=n; j++) {
+ data[di++] = v;
+ }
+ }
+ return data;
+ },
+
+ // alias
+ unpackEncodedStringToUnsignedChars: function(encodedString) {
+ return org.antlr.runtime.DFA.unpackEncodedString(encodedString);
+ }
+});
+org.antlr.runtime.tree.TreeParser = function(input) {
+ org.antlr.runtime.tree.TreeParser.superclass.constructor.call(this, arguments[1]);
+ this.setTreeNodeStream(input);
+};
+
+(function(){
+var TP = org.antlr.runtime.tree.TreeParser;
+
+org.antlr.lang.augmentObject(TP, {
+ DOWN: org.antlr.runtime.Token.DOWN,
+ UP: org.antlr.runtime.Token.UP
+});
+
+org.antlr.lang.extend(TP, org.antlr.runtime.BaseRecognizer, {
+ reset: function() {
+ TP.superclass.reset.call(this); // reset all recognizer state variables
+ if ( this.input ) {
+ this.input.seek(0); // rewind the input
+ }
+ },
+
+ /** Set the input stream */
+ setTreeNodeStream: function(input) {
+ this.input = input;
+ },
+
+ getTreeNodeStream: function() {
+ return this.input;
+ },
+
+ getSourceName: function() {
+ return this.input.getSourceName();
+ },
+
+ getCurrentInputSymbol: function(input) {
+ return input.LT(1);
+ },
+
+ getMissingSymbol: function(input, e, expectedTokenType, follow) {
+ var tokenText =
+ "<missing "+this.getTokenNames()[expectedTokenType]+">";
+ return new org.antlr.runtime.tree.CommonTree(new org.antlr.runtime.CommonToken(expectedTokenType, tokenText));
+ },
+
+ /** Match '.' in tree parser has special meaning. Skip node or
+ * entire tree if node has children. If children, scan until
+ * corresponding UP node.
+ */
+ matchAny: function(ignore) { // ignore stream, copy of this.input
+ this.state.errorRecovery = false;
+ this.state.failed = false;
+ var look = this.input.LT(1);
+ if ( this.input.getTreeAdaptor().getChildCount(look)===0 ) {
+ this.input.consume(); // not subtree, consume 1 node and return
+ return;
+ }
+ // current node is a subtree, skip to corresponding UP.
+ // must count nesting level to get right UP
+ var level=0,
+ tokenType = this.input.getTreeAdaptor().getType(look);
+ while ( tokenType!==org.antlr.runtime.Token.EOF &&
+ !(tokenType===TP.UP && level===0) )
+ {
+ this.input.consume();
+ look = this.input.LT(1);
+ tokenType = this.input.getTreeAdaptor().getType(look);
+ if ( tokenType === TP.DOWN ) {
+ level++;
+ }
+ else if ( tokenType === TP.UP ) {
+ level--;
+ }
+ }
+ this.input.consume(); // consume UP
+ },
+
+ /** We have DOWN/UP nodes in the stream that have no line info; override.
+ * plus we want to alter the exception type. Don't try to recover
+ * * from tree parser errors inline...
+ */
+ mismatch: function(input, ttype, follow) {
+ throw new org.antlr.runtime.MismatchedTreeNodeException(ttype, input);
+ },
+
+ /** Prefix error message with the grammar name because message is
+ * always intended for the programmer because the parser built
+ * the input tree not the user.
+ */
+ getErrorHeader: function(e) {
+ return this.getGrammarFileName()+": node from "+
+ (e.approximateLineInfo?"after ":"")+"line "+e.line+":"+e.charPositionInLine;
+ },
+
+ /** Tree parsers parse nodes they usually have a token object as
+ * payload. Set the exception token and do the default behavior.
+ */
+ getErrorMessage: function(e, tokenNames) {
+ var adaptor;
+ if ( this instanceof TP ) {
+ adaptor = e.input.getTreeAdaptor();
+ e.token = adaptor.getToken(e.node);
+ if ( !org.antlr.lang.isValue(e.token) ) { // could be an UP/DOWN node
+ e.token = new org.antlr.runtime.CommonToken(
+ adaptor.getType(e.node),
+ adaptor.getText(e.node));
+ }
+ }
+ return TP.superclass.getErrorMessage.call(this, e, tokenNames);
+ },
+
+ traceIn: function(ruleName, ruleIndex) {
+ TP.superclass.traceIn.call(this, ruleName, ruleIndex, this.input.LT(1));
+ },
+
+ traceOut: function(ruleName, ruleIndex) {
+ TP.superclass.traceOut.call(this, ruleName, ruleIndex, this.input.LT(1));
+ }
+});
+
+})();
+
+exports.org = org;
+
+});
+define('ace/mode/xquery/XQueryLexer', ['require', 'exports', 'module' , 'ace/mode/xquery/antlr3-all', 'ace/mode/xquery/XQDTLexer'], function(require, exports, module) {// $ANTLR 3.3 Nov 30, 2010 12:50:56 /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g 2012-09-05 10:41:37
+
+/* ***** 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 ***** */
+var org = require("./antlr3-all").org;
+var XQDTLexer = require("./XQDTLexer").XQDTLexer;
+
+
+var XQueryLexer = function(input, state) {
+// alternate constructor @todo
+// public XQueryLexer(CharStream input)
+// public XQueryLexer(CharStream input, RecognizerSharedState state) {
+ if (!state) {
+ state = new org.antlr.runtime.RecognizerSharedState();
+ }
+
+ (function(){
+
+
+ this.inStr = false;
+
+ // dummy list for warning elimination
+ //List<Stack<Object>> dummy = new ArrayList<Stack<Object>>();
+
+ // when we start, the '<' has already been eaten by the other lexer
+ //boolean inStr = false;
+ //
+ //public boolean isInString()
+ //{
+ // return inStr;
+ //}
+
+
+ }).call(this);
+
+ this.dfa19 = new XQueryLexer.DFA19(this);
+ XQueryLexer.superclass.constructor.call(this, input, state);
+
+
+};
+
+org.antlr.lang.augmentObject(XQueryLexer, {
+ EOF: -1,
+ L_QuotAttrContentChar: 4,
+ L_AposAttrContentChar: 5,
+ L_ElementContentChar: 6,
+ L_CDataSection: 7,
+ L_PredefinedEntityRef: 8,
+ L_CharRef: 9,
+ ESCAPE_LBRACKET: 10,
+ ESCAPE_RBRACKET: 11,
+ ESCAPE_APOS: 12,
+ ESCAPE_QUOT: 13,
+ CDATA_START: 14,
+ CDATA_END: 15,
+ ANCESTOR: 16,
+ ANCESTOR_OR_SELF: 17,
+ AND: 18,
+ AS: 19,
+ ASCENDING: 20,
+ AT: 21,
+ ATTRIBUTE: 22,
+ BASE_URI: 23,
+ BOUNDARY_SPACE: 24,
+ BY: 25,
+ CASE: 26,
+ CAST: 27,
+ CASTABLE: 28,
+ CHILD: 29,
+ COLLATION: 30,
+ COMMENT: 31,
+ CONSTRUCTION: 32,
+ COPY_NAMESPACES: 33,
+ DECLARE: 34,
+ DEFAULT: 35,
+ DESCENDANT: 36,
+ DESCENDANT_OR_SELF: 37,
+ DESCENDING: 38,
+ DIV: 39,
+ DOCUMENT: 40,
+ DOCUMENT_NODE: 41,
+ ELEMENT: 42,
+ ELSE: 43,
+ EMPTY: 44,
+ EMPTY_SEQUENCE: 45,
+ ENCODING: 46,
+ EQ: 47,
+ EVERY: 48,
+ EXCEPT: 49,
+ EXTERNAL: 50,
+ FOLLOWING: 51,
+ FOLLOWING_SIBLING: 52,
+ FOR: 53,
+ FUNCTION: 54,
+ GE: 55,
+ GREATEST: 56,
+ GT: 57,
+ IDIV: 58,
+ IF: 59,
+ IMPORT: 60,
+ IN: 61,
+ INHERIT: 62,
+ INSTANCE: 63,
+ INTERSECT: 64,
+ IS: 65,
+ ITEM: 66,
+ LAX: 67,
+ LE: 68,
+ LEAST: 69,
+ LET: 70,
+ LT: 71,
+ MOD: 72,
+ MODULE: 73,
+ NAMESPACE: 74,
+ NE: 75,
+ NO_INHERIT: 76,
+ NO_PRESERVE: 77,
+ NODE: 78,
+ JSON: 79,
+ OF: 80,
+ OPTION: 81,
+ OR: 82,
+ ORDER: 83,
+ ORDERED: 84,
+ ORDERING: 85,
+ PARENT: 86,
+ PRECEDING: 87,
+ PRECEDING_SIBLING: 88,
+ PRESERVE: 89,
+ PROCESSING_INSTRUCTION: 90,
+ STRUCTURED_ITEM: 91,
+ JSON_ITEM: 92,
+ OBJECT: 93,
+ ARRAY: 94,
+ RETURN: 95,
+ SATISFIES: 96,
+ SCHEMA: 97,
+ SCHEMA_ATTRIBUTE: 98,
+ SCHEMA_ELEMENT: 99,
+ SELF: 100,
+ SOME: 101,
+ STABLE: 102,
+ STRICT: 103,
+ STRIP: 104,
+ TEXT: 105,
+ THEN: 106,
+ TO: 107,
+ TREAT: 108,
+ TYPESWITCH: 109,
+ UNION: 110,
+ UNORDERED: 111,
+ VALIDATE: 112,
+ VARIABLE: 113,
+ VERSION: 114,
+ WHERE: 115,
+ XQUERY: 116,
+ ALLOWING: 117,
+ CATCH: 118,
+ CONTEXT: 119,
+ COUNT: 120,
+ DECIMAL_FORMAT: 121,
+ DECIMAL_SEPARATOR: 122,
+ DIGIT: 123,
+ END: 124,
+ GROUP: 125,
+ GROUPING_SEPARATOR: 126,
+ INFINITY: 127,
+ MINUS_SIGN: 128,
+ NAMESPACE_NODE: 129,
+ NAN: 130,
+ NEXT: 131,
+ ONLY: 132,
+ PATTERN_SEPARATOR: 133,
+ PERCENT: 134,
+ PER_MILLE: 135,
+ PREVIOUS: 136,
+ SLIDING: 137,
+ START: 138,
+ SWITCH: 139,
+ TRY: 140,
+ TUMBLING: 141,
+ TYPE: 142,
+ WHEN: 143,
+ WINDOW: 144,
+ ZERO_DIGIT: 145,
+ AFTER: 146,
+ BEFORE: 147,
+ COPY: 148,
+ DELETE: 149,
+ FIRST: 150,
+ INSERT: 151,
+ INTO: 152,
+ POSITION: 153,
+ APPEND: 154,
+ LAST: 155,
+ MODIFY: 156,
+ NODES: 157,
+ RENAME: 158,
+ REPLACE: 159,
+ REVALIDATION: 160,
+ SKIP: 161,
+ UPDATING: 162,
+ VALUE: 163,
+ WITH: 164,
+ ALL: 165,
+ ANY: 166,
+ CONTAINS: 167,
+ CONTENT: 168,
+ DIACRITICS: 169,
+ DIFFERENT: 170,
+ DISTANCE: 171,
+ ENTIRE: 172,
+ EXACTLY: 173,
+ FROM: 174,
+ FT_OPTION: 175,
+ FTAND: 176,
+ FTNOT: 177,
+ FTOR: 178,
+ INSENSITIVE: 179,
+ LANGUAGE: 180,
+ LEVELS: 181,
+ LOWERCASE: 182,
+ MOST: 183,
+ NO: 184,
+ NOT: 185,
+ OCCURS: 186,
+ PARAGRAPH: 187,
+ PARAGRAPHS: 188,
+ PHRASE: 189,
+ RELATIONSHIP: 190,
+ SAME: 191,
+ SCORE: 192,
+ SENSITIVE: 193,
+ SENTENCE: 194,
+ SENTENCES: 195,
+ STEMMING: 196,
+ STOP: 197,
+ THESAURUS: 198,
+ TIMES: 199,
+ UPPERCASE: 200,
+ USING: 201,
+ WEIGHT: 202,
+ WILDCARDS: 203,
+ WITHOUT: 204,
+ WORD: 205,
+ WORDS: 206,
+ BREAK: 207,
+ CONTINUE: 208,
+ EXIT: 209,
+ LOOP: 210,
+ RETURNING: 211,
+ WHILE: 212,
+ CHECK: 213,
+ COLLECTION: 214,
+ CONSTRAINT: 215,
+ FOREACH: 216,
+ FOREIGN: 217,
+ INDEX: 218,
+ INTEGRITY: 219,
+ KEY: 220,
+ ON: 221,
+ UNIQUE: 222,
+ AMP_ER: 223,
+ APOS_ER: 224,
+ QUOT_ER: 225,
+ CONCAT: 226,
+ LPAREN: 227,
+ RPAREN: 228,
+ DOLLAR: 229,
+ L_UNION_BRACKET: 230,
+ R_UNION_BRACKET: 231,
+ LBRACKET: 232,
+ RBRACKET: 233,
+ LSQUARE: 234,
+ RSQUARE: 235,
+ EQUAL: 236,
+ BIND: 237,
+ NOTEQUAL: 238,
+ ANN_PERCENT: 239,
+ HASH: 240,
+ AMP: 241,
+ COMMA: 242,
+ QUESTION: 243,
+ STAR: 244,
+ PLUS: 245,
+ MINUS: 246,
+ SMALLER: 247,
+ GREATER: 248,
+ SMALLEREQ: 249,
+ GREATEREQ: 250,
+ SMALLER_SMALLER: 251,
+ GREATER_GREATER: 252,
+ SLASH: 253,
+ SLASH_SLASH: 254,
+ BANG: 255,
+ DOT: 256,
+ DOT_DOT: 257,
+ COLON: 258,
+ COLON_COLON: 259,
+ EMPTY_CLOSE_TAG: 260,
+ CLOSE_TAG: 261,
+ SEMICOLON: 262,
+ VBAR: 263,
+ PRAGMA_START: 264,
+ PRAGMA_END: 265,
+ XML_COMMENT_START: 266,
+ XML_COMMENT_END: 267,
+ PI_START: 268,
+ PI_END: 269,
+ ATTR_SIGN: 270,
+ Q: 271,
+ CHARREF_DEC: 272,
+ CHARREF_HEX: 273,
+ APOS: 274,
+ QUOT: 275,
+ NCNameStartChar: 276,
+ NCNameChar: 277,
+ L_NCName: 278,
+ Letter: 279,
+ HexLetter: 280,
+ Digit: 281,
+ Digits: 282,
+ S: 283,
+ SU: 284,
+ L_Pragma: 285,
+ L_DirCommentConstructor: 286,
+ L_DirPIConstructor: 287,
+ L_IntegerLiteral: 288,
+ L_DecimalLiteral: 289,
+ L_DoubleLiteral: 290,
+ L_Comment: 291,
+ L_AnyChar: 292
+});
+
+(function(){
+var HIDDEN = org.antlr.runtime.Token.HIDDEN_CHANNEL,
+ EOF = org.antlr.runtime.Token.EOF;
+org.antlr.lang.extend(XQueryLexer, XQDTLexer, {
+ EOF : -1,
+ L_QuotAttrContentChar : 4,
+ L_AposAttrContentChar : 5,
+ L_ElementContentChar : 6,
+ L_CDataSection : 7,
+ L_PredefinedEntityRef : 8,
+ L_CharRef : 9,
+ ESCAPE_LBRACKET : 10,
+ ESCAPE_RBRACKET : 11,
+ ESCAPE_APOS : 12,
+ ESCAPE_QUOT : 13,
+ CDATA_START : 14,
+ CDATA_END : 15,
+ ANCESTOR : 16,
+ ANCESTOR_OR_SELF : 17,
+ AND : 18,
+ AS : 19,
+ ASCENDING : 20,
+ AT : 21,
+ ATTRIBUTE : 22,
+ BASE_URI : 23,
+ BOUNDARY_SPACE : 24,
+ BY : 25,
+ CASE : 26,
+ CAST : 27,
+ CASTABLE : 28,
+ CHILD : 29,
+ COLLATION : 30,
+ COMMENT : 31,
+ CONSTRUCTION : 32,
+ COPY_NAMESPACES : 33,
+ DECLARE : 34,
+ DEFAULT : 35,
+ DESCENDANT : 36,
+ DESCENDANT_OR_SELF : 37,
+ DESCENDING : 38,
+ DIV : 39,
+ DOCUMENT : 40,
+ DOCUMENT_NODE : 41,
+ ELEMENT : 42,
+ ELSE : 43,
+ EMPTY : 44,
+ EMPTY_SEQUENCE : 45,
+ ENCODING : 46,
+ EQ : 47,
+ EVERY : 48,
+ EXCEPT : 49,
+ EXTERNAL : 50,
+ FOLLOWING : 51,
+ FOLLOWING_SIBLING : 52,
+ FOR : 53,
+ FUNCTION : 54,
+ GE : 55,
+ GREATEST : 56,
+ GT : 57,
+ IDIV : 58,
+ IF : 59,
+ IMPORT : 60,
+ IN : 61,
+ INHERIT : 62,
+ INSTANCE : 63,
+ INTERSECT : 64,
+ IS : 65,
+ ITEM : 66,
+ LAX : 67,
+ LE : 68,
+ LEAST : 69,
+ LET : 70,
+ LT : 71,
+ MOD : 72,
+ MODULE : 73,
+ NAMESPACE : 74,
+ NE : 75,
+ NO_INHERIT : 76,
+ NO_PRESERVE : 77,
+ NODE : 78,
+ JSON : 79,
+ OF : 80,
+ OPTION : 81,
+ OR : 82,
+ ORDER : 83,
+ ORDERED : 84,
+ ORDERING : 85,
+ PARENT : 86,
+ PRECEDING : 87,
+ PRECEDING_SIBLING : 88,
+ PRESERVE : 89,
+ PROCESSING_INSTRUCTION : 90,
+ STRUCTURED_ITEM : 91,
+ JSON_ITEM : 92,
+ OBJECT : 93,
+ ARRAY : 94,
+ RETURN : 95,
+ SATISFIES : 96,
+ SCHEMA : 97,
+ SCHEMA_ATTRIBUTE : 98,
+ SCHEMA_ELEMENT : 99,
+ SELF : 100,
+ SOME : 101,
+ STABLE : 102,
+ STRICT : 103,
+ STRIP : 104,
+ TEXT : 105,
+ THEN : 106,
+ TO : 107,
+ TREAT : 108,
+ TYPESWITCH : 109,
+ UNION : 110,
+ UNORDERED : 111,
+ VALIDATE : 112,
+ VARIABLE : 113,
+ VERSION : 114,
+ WHERE : 115,
+ XQUERY : 116,
+ ALLOWING : 117,
+ CATCH : 118,
+ CONTEXT : 119,
+ COUNT : 120,
+ DECIMAL_FORMAT : 121,
+ DECIMAL_SEPARATOR : 122,
+ DIGIT : 123,
+ END : 124,
+ GROUP : 125,
+ GROUPING_SEPARATOR : 126,
+ INFINITY : 127,
+ MINUS_SIGN : 128,
+ NAMESPACE_NODE : 129,
+ NAN : 130,
+ NEXT : 131,
+ ONLY : 132,
+ PATTERN_SEPARATOR : 133,
+ PERCENT : 134,
+ PER_MILLE : 135,
+ PREVIOUS : 136,
+ SLIDING : 137,
+ START : 138,
+ SWITCH : 139,
+ TRY : 140,
+ TUMBLING : 141,
+ TYPE : 142,
+ WHEN : 143,
+ WINDOW : 144,
+ ZERO_DIGIT : 145,
+ AFTER : 146,
+ BEFORE : 147,
+ COPY : 148,
+ DELETE : 149,
+ FIRST : 150,
+ INSERT : 151,
+ INTO : 152,
+ POSITION : 153,
+ APPEND : 154,
+ LAST : 155,
+ MODIFY : 156,
+ NODES : 157,
+ RENAME : 158,
+ REPLACE : 159,
+ REVALIDATION : 160,
+ SKIP : 161,
+ UPDATING : 162,
+ VALUE : 163,
+ WITH : 164,
+ ALL : 165,
+ ANY : 166,
+ CONTAINS : 167,
+ CONTENT : 168,
+ DIACRITICS : 169,
+ DIFFERENT : 170,
+ DISTANCE : 171,
+ ENTIRE : 172,
+ EXACTLY : 173,
+ FROM : 174,
+ FT_OPTION : 175,
+ FTAND : 176,
+ FTNOT : 177,
+ FTOR : 178,
+ INSENSITIVE : 179,
+ LANGUAGE : 180,
+ LEVELS : 181,
+ LOWERCASE : 182,
+ MOST : 183,
+ NO : 184,
+ NOT : 185,
+ OCCURS : 186,
+ PARAGRAPH : 187,
+ PARAGRAPHS : 188,
+ PHRASE : 189,
+ RELATIONSHIP : 190,
+ SAME : 191,
+ SCORE : 192,
+ SENSITIVE : 193,
+ SENTENCE : 194,
+ SENTENCES : 195,
+ STEMMING : 196,
+ STOP : 197,
+ THESAURUS : 198,
+ TIMES : 199,
+ UPPERCASE : 200,
+ USING : 201,
+ WEIGHT : 202,
+ WILDCARDS : 203,
+ WITHOUT : 204,
+ WORD : 205,
+ WORDS : 206,
+ BREAK : 207,
+ CONTINUE : 208,
+ EXIT : 209,
+ LOOP : 210,
+ RETURNING : 211,
+ WHILE : 212,
+ CHECK : 213,
+ COLLECTION : 214,
+ CONSTRAINT : 215,
+ FOREACH : 216,
+ FOREIGN : 217,
+ INDEX : 218,
+ INTEGRITY : 219,
+ KEY : 220,
+ ON : 221,
+ UNIQUE : 222,
+ AMP_ER : 223,
+ APOS_ER : 224,
+ QUOT_ER : 225,
+ CONCAT : 226,
+ LPAREN : 227,
+ RPAREN : 228,
+ DOLLAR : 229,
+ L_UNION_BRACKET : 230,
+ R_UNION_BRACKET : 231,
+ LBRACKET : 232,
+ RBRACKET : 233,
+ LSQUARE : 234,
+ RSQUARE : 235,
+ EQUAL : 236,
+ BIND : 237,
+ NOTEQUAL : 238,
+ ANN_PERCENT : 239,
+ HASH : 240,
+ AMP : 241,
+ COMMA : 242,
+ QUESTION : 243,
+ STAR : 244,
+ PLUS : 245,
+ MINUS : 246,
+ SMALLER : 247,
+ GREATER : 248,
+ SMALLEREQ : 249,
+ GREATEREQ : 250,
+ SMALLER_SMALLER : 251,
+ GREATER_GREATER : 252,
+ SLASH : 253,
+ SLASH_SLASH : 254,
+ BANG : 255,
+ DOT : 256,
+ DOT_DOT : 257,
+ COLON : 258,
+ COLON_COLON : 259,
+ EMPTY_CLOSE_TAG : 260,
+ CLOSE_TAG : 261,
+ SEMICOLON : 262,
+ VBAR : 263,
+ PRAGMA_START : 264,
+ PRAGMA_END : 265,
+ XML_COMMENT_START : 266,
+ XML_COMMENT_END : 267,
+ PI_START : 268,
+ PI_END : 269,
+ ATTR_SIGN : 270,
+ Q : 271,
+ CHARREF_DEC : 272,
+ CHARREF_HEX : 273,
+ APOS : 274,
+ QUOT : 275,
+ NCNameStartChar : 276,
+ NCNameChar : 277,
+ L_NCName : 278,
+ Letter : 279,
+ HexLetter : 280,
+ Digit : 281,
+ Digits : 282,
+ S : 283,
+ SU : 284,
+ L_Pragma : 285,
+ L_DirCommentConstructor : 286,
+ L_DirPIConstructor : 287,
+ L_IntegerLiteral : 288,
+ L_DecimalLiteral : 289,
+ L_DoubleLiteral : 290,
+ L_Comment : 291,
+ L_AnyChar : 292,
+ getGrammarFileName: function() { return "/Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g"; }
+});
+org.antlr.lang.augmentObject(XQueryLexer.prototype, {
+ // $ANTLR start ANCESTOR
+ mANCESTOR: function() {
+ try {
+ var _type = this.ANCESTOR;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:85:29: ( 'ancestor' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:85:31: 'ancestor'
+ this.match("ancestor");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "ANCESTOR",
+
+ // $ANTLR start ANCESTOR_OR_SELF
+ mANCESTOR_OR_SELF: function() {
+ try {
+ var _type = this.ANCESTOR_OR_SELF;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:86:29: ( 'ancestor-or-self' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:86:31: 'ancestor-or-self'
+ this.match("ancestor-or-self");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "ANCESTOR_OR_SELF",
+
+ // $ANTLR start AND
+ mAND: function() {
+ try {
+ var _type = this.AND;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:87:29: ( 'and' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:87:31: 'and'
+ this.match("and");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "AND",
+
+ // $ANTLR start AS
+ mAS: function() {
+ try {
+ var _type = this.AS;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:88:29: ( 'as' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:88:31: 'as'
+ this.match("as");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "AS",
+
+ // $ANTLR start ASCENDING
+ mASCENDING: function() {
+ try {
+ var _type = this.ASCENDING;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:89:29: ( 'ascending' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:89:31: 'ascending'
+ this.match("ascending");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "ASCENDING",
+
+ // $ANTLR start AT
+ mAT: function() {
+ try {
+ var _type = this.AT;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:90:29: ( 'at' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:90:31: 'at'
+ this.match("at");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "AT",
+
+ // $ANTLR start ATTRIBUTE
+ mATTRIBUTE: function() {
+ try {
+ var _type = this.ATTRIBUTE;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:91:29: ( 'attribute' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:91:31: 'attribute'
+ this.match("attribute");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "ATTRIBUTE",
+
+ // $ANTLR start BASE_URI
+ mBASE_URI: function() {
+ try {
+ var _type = this.BASE_URI;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:92:29: ( 'base-uri' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:92:31: 'base-uri'
+ this.match("base-uri");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "BASE_URI",
+
+ // $ANTLR start BOUNDARY_SPACE
+ mBOUNDARY_SPACE: function() {
+ try {
+ var _type = this.BOUNDARY_SPACE;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:93:29: ( 'boundary-space' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:93:31: 'boundary-space'
+ this.match("boundary-space");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "BOUNDARY_SPACE",
+
+ // $ANTLR start BY
+ mBY: function() {
+ try {
+ var _type = this.BY;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:94:29: ( 'by' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:94:31: 'by'
+ this.match("by");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "BY",
+
+ // $ANTLR start CASE
+ mCASE: function() {
+ try {
+ var _type = this.CASE;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:95:29: ( 'case' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:95:31: 'case'
+ this.match("case");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "CASE",
+
+ // $ANTLR start CAST
+ mCAST: function() {
+ try {
+ var _type = this.CAST;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:96:29: ( 'cast' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:96:31: 'cast'
+ this.match("cast");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "CAST",
+
+ // $ANTLR start CASTABLE
+ mCASTABLE: function() {
+ try {
+ var _type = this.CASTABLE;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:97:29: ( 'castable' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:97:31: 'castable'
+ this.match("castable");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "CASTABLE",
+
+ // $ANTLR start CHILD
+ mCHILD: function() {
+ try {
+ var _type = this.CHILD;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:98:29: ( 'child' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:98:31: 'child'
+ this.match("child");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "CHILD",
+
+ // $ANTLR start COLLATION
+ mCOLLATION: function() {
+ try {
+ var _type = this.COLLATION;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:99:29: ( 'collation' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:99:31: 'collation'
+ this.match("collation");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "COLLATION",
+
+ // $ANTLR start COMMENT
+ mCOMMENT: function() {
+ try {
+ var _type = this.COMMENT;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:100:29: ( 'comment' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:100:31: 'comment'
+ this.match("comment");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "COMMENT",
+
+ // $ANTLR start CONSTRUCTION
+ mCONSTRUCTION: function() {
+ try {
+ var _type = this.CONSTRUCTION;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:101:29: ( 'construction' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:101:31: 'construction'
+ this.match("construction");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "CONSTRUCTION",
+
+ // $ANTLR start COPY_NAMESPACES
+ mCOPY_NAMESPACES: function() {
+ try {
+ var _type = this.COPY_NAMESPACES;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:102:29: ( 'copy-namespaces' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:102:31: 'copy-namespaces'
+ this.match("copy-namespaces");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "COPY_NAMESPACES",
+
+ // $ANTLR start DECLARE
+ mDECLARE: function() {
+ try {
+ var _type = this.DECLARE;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:103:29: ( 'declare' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:103:31: 'declare'
+ this.match("declare");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "DECLARE",
+
+ // $ANTLR start DEFAULT
+ mDEFAULT: function() {
+ try {
+ var _type = this.DEFAULT;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:104:29: ( 'default' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:104:31: 'default'
+ this.match("default");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "DEFAULT",
+
+ // $ANTLR start DESCENDANT
+ mDESCENDANT: function() {
+ try {
+ var _type = this.DESCENDANT;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:105:29: ( 'descendant' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:105:31: 'descendant'
+ this.match("descendant");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "DESCENDANT",
+
+ // $ANTLR start DESCENDANT_OR_SELF
+ mDESCENDANT_OR_SELF: function() {
+ try {
+ var _type = this.DESCENDANT_OR_SELF;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:106:29: ( 'descendant-or-self' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:106:31: 'descendant-or-self'
+ this.match("descendant-or-self");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "DESCENDANT_OR_SELF",
+
+ // $ANTLR start DESCENDING
+ mDESCENDING: function() {
+ try {
+ var _type = this.DESCENDING;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:107:29: ( 'descending' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:107:31: 'descending'
+ this.match("descending");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "DESCENDING",
+
+ // $ANTLR start DIV
+ mDIV: function() {
+ try {
+ var _type = this.DIV;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:108:29: ( 'div' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:108:31: 'div'
+ this.match("div");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "DIV",
+
+ // $ANTLR start DOCUMENT
+ mDOCUMENT: function() {
+ try {
+ var _type = this.DOCUMENT;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:109:29: ( 'document' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:109:31: 'document'
+ this.match("document");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "DOCUMENT",
+
+ // $ANTLR start DOCUMENT_NODE
+ mDOCUMENT_NODE: function() {
+ try {
+ var _type = this.DOCUMENT_NODE;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:110:29: ( 'document-node' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:110:31: 'document-node'
+ this.match("document-node");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "DOCUMENT_NODE",
+
+ // $ANTLR start ELEMENT
+ mELEMENT: function() {
+ try {
+ var _type = this.ELEMENT;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:111:29: ( 'element' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:111:31: 'element'
+ this.match("element");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "ELEMENT",
+
+ // $ANTLR start ELSE
+ mELSE: function() {
+ try {
+ var _type = this.ELSE;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:112:29: ( 'else' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:112:31: 'else'
+ this.match("else");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "ELSE",
+
+ // $ANTLR start EMPTY
+ mEMPTY: function() {
+ try {
+ var _type = this.EMPTY;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:113:29: ( 'empty' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:113:31: 'empty'
+ this.match("empty");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "EMPTY",
+
+ // $ANTLR start EMPTY_SEQUENCE
+ mEMPTY_SEQUENCE: function() {
+ try {
+ var _type = this.EMPTY_SEQUENCE;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:114:29: ( 'empty-sequence' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:114:31: 'empty-sequence'
+ this.match("empty-sequence");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "EMPTY_SEQUENCE",
+
+ // $ANTLR start ENCODING
+ mENCODING: function() {
+ try {
+ var _type = this.ENCODING;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:115:29: ( 'encoding' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:115:31: 'encoding'
+ this.match("encoding");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "ENCODING",
+
+ // $ANTLR start EQ
+ mEQ: function() {
+ try {
+ var _type = this.EQ;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:116:29: ( 'eq' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:116:31: 'eq'
+ this.match("eq");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "EQ",
+
+ // $ANTLR start EVERY
+ mEVERY: function() {
+ try {
+ var _type = this.EVERY;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:117:29: ( 'every' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:117:31: 'every'
+ this.match("every");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "EVERY",
+
+ // $ANTLR start EXCEPT
+ mEXCEPT: function() {
+ try {
+ var _type = this.EXCEPT;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:118:29: ( 'except' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:118:31: 'except'
+ this.match("except");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "EXCEPT",
+
+ // $ANTLR start EXTERNAL
+ mEXTERNAL: function() {
+ try {
+ var _type = this.EXTERNAL;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:119:29: ( 'external' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:119:31: 'external'
+ this.match("external");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "EXTERNAL",
+
+ // $ANTLR start FOLLOWING
+ mFOLLOWING: function() {
+ try {
+ var _type = this.FOLLOWING;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:120:29: ( 'following' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:120:31: 'following'
+ this.match("following");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "FOLLOWING",
+
+ // $ANTLR start FOLLOWING_SIBLING
+ mFOLLOWING_SIBLING: function() {
+ try {
+ var _type = this.FOLLOWING_SIBLING;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:121:29: ( 'following-sibling' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:121:31: 'following-sibling'
+ this.match("following-sibling");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "FOLLOWING_SIBLING",
+
+ // $ANTLR start FOR
+ mFOR: function() {
+ try {
+ var _type = this.FOR;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:122:29: ( 'for' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:122:31: 'for'
+ this.match("for");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "FOR",
+
+ // $ANTLR start FUNCTION
+ mFUNCTION: function() {
+ try {
+ var _type = this.FUNCTION;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:123:29: ( 'function' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:123:31: 'function'
+ this.match("function");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "FUNCTION",
+
+ // $ANTLR start GE
+ mGE: function() {
+ try {
+ var _type = this.GE;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:124:29: ( 'ge' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:124:31: 'ge'
+ this.match("ge");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "GE",
+
+ // $ANTLR start GREATEST
+ mGREATEST: function() {
+ try {
+ var _type = this.GREATEST;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:125:29: ( 'greatest' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:125:31: 'greatest'
+ this.match("greatest");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "GREATEST",
+
+ // $ANTLR start GT
+ mGT: function() {
+ try {
+ var _type = this.GT;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:126:29: ( 'gt' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:126:31: 'gt'
+ this.match("gt");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "GT",
+
+ // $ANTLR start IDIV
+ mIDIV: function() {
+ try {
+ var _type = this.IDIV;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:127:29: ( 'idiv' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:127:31: 'idiv'
+ this.match("idiv");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "IDIV",
+
+ // $ANTLR start IF
+ mIF: function() {
+ try {
+ var _type = this.IF;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:128:29: ( 'if' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:128:31: 'if'
+ this.match("if");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "IF",
+
+ // $ANTLR start IMPORT
+ mIMPORT: function() {
+ try {
+ var _type = this.IMPORT;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:129:29: ( 'import' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:129:31: 'import'
+ this.match("import");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "IMPORT",
+
+ // $ANTLR start IN
+ mIN: function() {
+ try {
+ var _type = this.IN;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:130:29: ( 'in' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:130:31: 'in'
+ this.match("in");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "IN",
+
+ // $ANTLR start INHERIT
+ mINHERIT: function() {
+ try {
+ var _type = this.INHERIT;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:131:29: ( 'inherit' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:131:31: 'inherit'
+ this.match("inherit");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "INHERIT",
+
+ // $ANTLR start INSTANCE
+ mINSTANCE: function() {
+ try {
+ var _type = this.INSTANCE;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:132:29: ( 'instance' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:132:31: 'instance'
+ this.match("instance");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "INSTANCE",
+
+ // $ANTLR start INTERSECT
+ mINTERSECT: function() {
+ try {
+ var _type = this.INTERSECT;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:133:29: ( 'intersect' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:133:31: 'intersect'
+ this.match("intersect");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "INTERSECT",
+
+ // $ANTLR start IS
+ mIS: function() {
+ try {
+ var _type = this.IS;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:134:29: ( 'is' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:134:31: 'is'
+ this.match("is");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "IS",
+
+ // $ANTLR start ITEM
+ mITEM: function() {
+ try {
+ var _type = this.ITEM;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:135:29: ( 'item' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:135:31: 'item'
+ this.match("item");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "ITEM",
+
+ // $ANTLR start LAX
+ mLAX: function() {
+ try {
+ var _type = this.LAX;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:136:29: ( 'lax' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:136:31: 'lax'
+ this.match("lax");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "LAX",
+
+ // $ANTLR start LE
+ mLE: function() {
+ try {
+ var _type = this.LE;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:137:29: ( 'le' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:137:31: 'le'
+ this.match("le");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "LE",
+
+ // $ANTLR start LEAST
+ mLEAST: function() {
+ try {
+ var _type = this.LEAST;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:138:29: ( 'least' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:138:31: 'least'
+ this.match("least");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "LEAST",
+
+ // $ANTLR start LET
+ mLET: function() {
+ try {
+ var _type = this.LET;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:139:29: ( 'let' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:139:31: 'let'
+ this.match("let");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "LET",
+
+ // $ANTLR start LT
+ mLT: function() {
+ try {
+ var _type = this.LT;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:140:29: ( 'lt' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:140:31: 'lt'
+ this.match("lt");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "LT",
+
+ // $ANTLR start MOD
+ mMOD: function() {
+ try {
+ var _type = this.MOD;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:141:29: ( 'mod' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:141:31: 'mod'
+ this.match("mod");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "MOD",
+
+ // $ANTLR start MODULE
+ mMODULE: function() {
+ try {
+ var _type = this.MODULE;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:142:29: ( 'module' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:142:31: 'module'
+ this.match("module");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "MODULE",
+
+ // $ANTLR start NAMESPACE
+ mNAMESPACE: function() {
+ try {
+ var _type = this.NAMESPACE;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:143:29: ( 'namespace' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:143:31: 'namespace'
+ this.match("namespace");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "NAMESPACE",
+
+ // $ANTLR start NE
+ mNE: function() {
+ try {
+ var _type = this.NE;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:144:29: ( 'ne' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:144:31: 'ne'
+ this.match("ne");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "NE",
+
+ // $ANTLR start NO_INHERIT
+ mNO_INHERIT: function() {
+ try {
+ var _type = this.NO_INHERIT;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:145:29: ( 'no-inherit' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:145:31: 'no-inherit'
+ this.match("no-inherit");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "NO_INHERIT",
+
+ // $ANTLR start NO_PRESERVE
+ mNO_PRESERVE: function() {
+ try {
+ var _type = this.NO_PRESERVE;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:146:29: ( 'no-preserve' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:146:31: 'no-preserve'
+ this.match("no-preserve");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "NO_PRESERVE",
+
+ // $ANTLR start NODE
+ mNODE: function() {
+ try {
+ var _type = this.NODE;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:147:29: ( 'node' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:147:31: 'node'
+ this.match("node");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "NODE",
+
+ // $ANTLR start JSON
+ mJSON: function() {
+ try {
+ var _type = this.JSON;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:148:29: ( 'json' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:148:31: 'json'
+ this.match("json");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "JSON",
+
+ // $ANTLR start OF
+ mOF: function() {
+ try {
+ var _type = this.OF;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:149:29: ( 'of' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:149:31: 'of'
+ this.match("of");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "OF",
+
+ // $ANTLR start OPTION
+ mOPTION: function() {
+ try {
+ var _type = this.OPTION;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:150:29: ( 'option' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:150:31: 'option'
+ this.match("option");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "OPTION",
+
+ // $ANTLR start OR
+ mOR: function() {
+ try {
+ var _type = this.OR;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:151:29: ( 'or' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:151:31: 'or'
+ this.match("or");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "OR",
+
+ // $ANTLR start ORDER
+ mORDER: function() {
+ try {
+ var _type = this.ORDER;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:152:29: ( 'order' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:152:31: 'order'
+ this.match("order");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "ORDER",
+
+ // $ANTLR start ORDERED
+ mORDERED: function() {
+ try {
+ var _type = this.ORDERED;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:153:29: ( 'ordered' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:153:31: 'ordered'
+ this.match("ordered");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "ORDERED",
+
+ // $ANTLR start ORDERING
+ mORDERING: function() {
+ try {
+ var _type = this.ORDERING;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:154:29: ( 'ordering' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:154:31: 'ordering'
+ this.match("ordering");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "ORDERING",
+
+ // $ANTLR start PARENT
+ mPARENT: function() {
+ try {
+ var _type = this.PARENT;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:155:29: ( 'parent' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:155:31: 'parent'
+ this.match("parent");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "PARENT",
+
+ // $ANTLR start PRECEDING
+ mPRECEDING: function() {
+ try {
+ var _type = this.PRECEDING;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:156:29: ( 'preceding' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:156:31: 'preceding'
+ this.match("preceding");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "PRECEDING",
+
+ // $ANTLR start PRECEDING_SIBLING
+ mPRECEDING_SIBLING: function() {
+ try {
+ var _type = this.PRECEDING_SIBLING;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:157:29: ( 'preceding-sibling' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:157:31: 'preceding-sibling'
+ this.match("preceding-sibling");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "PRECEDING_SIBLING",
+
+ // $ANTLR start PRESERVE
+ mPRESERVE: function() {
+ try {
+ var _type = this.PRESERVE;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:158:29: ( 'preserve' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:158:31: 'preserve'
+ this.match("preserve");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "PRESERVE",
+
+ // $ANTLR start PROCESSING_INSTRUCTION
+ mPROCESSING_INSTRUCTION: function() {
+ try {
+ var _type = this.PROCESSING_INSTRUCTION;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:159:29: ( 'processing-instruction' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:159:31: 'processing-instruction'
+ this.match("processing-instruction");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "PROCESSING_INSTRUCTION",
+
+ // $ANTLR start STRUCTURED_ITEM
+ mSTRUCTURED_ITEM: function() {
+ try {
+ var _type = this.STRUCTURED_ITEM;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:160:29: ( 'structured-item' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:160:31: 'structured-item'
+ this.match("structured-item");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "STRUCTURED_ITEM",
+
+ // $ANTLR start JSON_ITEM
+ mJSON_ITEM: function() {
+ try {
+ var _type = this.JSON_ITEM;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:161:29: ( 'json-item' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:161:31: 'json-item'
+ this.match("json-item");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "JSON_ITEM",
+
+ // $ANTLR start OBJECT
+ mOBJECT: function() {
+ try {
+ var _type = this.OBJECT;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:162:29: ( 'object' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:162:31: 'object'
+ this.match("object");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "OBJECT",
+
+ // $ANTLR start ARRAY
+ mARRAY: function() {
+ try {
+ var _type = this.ARRAY;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:163:29: ( 'array' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:163:31: 'array'
+ this.match("array");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "ARRAY",
+
+ // $ANTLR start RETURN
+ mRETURN: function() {
+ try {
+ var _type = this.RETURN;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:164:29: ( 'return' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:164:31: 'return'
+ this.match("return");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "RETURN",
+
+ // $ANTLR start SATISFIES
+ mSATISFIES: function() {
+ try {
+ var _type = this.SATISFIES;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:165:29: ( 'satisfies' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:165:31: 'satisfies'
+ this.match("satisfies");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "SATISFIES",
+
+ // $ANTLR start SCHEMA
+ mSCHEMA: function() {
+ try {
+ var _type = this.SCHEMA;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:166:29: ( 'schema' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:166:31: 'schema'
+ this.match("schema");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "SCHEMA",
+
+ // $ANTLR start SCHEMA_ATTRIBUTE
+ mSCHEMA_ATTRIBUTE: function() {
+ try {
+ var _type = this.SCHEMA_ATTRIBUTE;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:167:29: ( 'schema-attribute' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:167:31: 'schema-attribute'
+ this.match("schema-attribute");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "SCHEMA_ATTRIBUTE",
+
+ // $ANTLR start SCHEMA_ELEMENT
+ mSCHEMA_ELEMENT: function() {
+ try {
+ var _type = this.SCHEMA_ELEMENT;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:168:29: ( 'schema-element' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:168:31: 'schema-element'
+ this.match("schema-element");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "SCHEMA_ELEMENT",
+
+ // $ANTLR start SELF
+ mSELF: function() {
+ try {
+ var _type = this.SELF;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:169:29: ( 'self' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:169:31: 'self'
+ this.match("self");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "SELF",
+
+ // $ANTLR start SOME
+ mSOME: function() {
+ try {
+ var _type = this.SOME;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:170:29: ( 'some' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:170:31: 'some'
+ this.match("some");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "SOME",
+
+ // $ANTLR start STABLE
+ mSTABLE: function() {
+ try {
+ var _type = this.STABLE;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:171:29: ( 'stable' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:171:31: 'stable'
+ this.match("stable");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "STABLE",
+
+ // $ANTLR start STRICT
+ mSTRICT: function() {
+ try {
+ var _type = this.STRICT;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:172:29: ( 'strict' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:172:31: 'strict'
+ this.match("strict");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "STRICT",
+
+ // $ANTLR start STRIP
+ mSTRIP: function() {
+ try {
+ var _type = this.STRIP;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:173:29: ( 'strip' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:173:31: 'strip'
+ this.match("strip");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "STRIP",
+
+ // $ANTLR start TEXT
+ mTEXT: function() {
+ try {
+ var _type = this.TEXT;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:174:29: ( 'text' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:174:31: 'text'
+ this.match("text");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "TEXT",
+
+ // $ANTLR start THEN
+ mTHEN: function() {
+ try {
+ var _type = this.THEN;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:175:29: ( 'then' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:175:31: 'then'
+ this.match("then");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "THEN",
+
+ // $ANTLR start TO
+ mTO: function() {
+ try {
+ var _type = this.TO;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:176:29: ( 'to' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:176:31: 'to'
+ this.match("to");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "TO",
+
+ // $ANTLR start TREAT
+ mTREAT: function() {
+ try {
+ var _type = this.TREAT;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:177:29: ( 'treat' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:177:31: 'treat'
+ this.match("treat");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "TREAT",
+
+ // $ANTLR start TYPESWITCH
+ mTYPESWITCH: function() {
+ try {
+ var _type = this.TYPESWITCH;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:178:29: ( 'typeswitch' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:178:31: 'typeswitch'
+ this.match("typeswitch");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "TYPESWITCH",
+
+ // $ANTLR start UNION
+ mUNION: function() {
+ try {
+ var _type = this.UNION;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:179:29: ( 'union' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:179:31: 'union'
+ this.match("union");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "UNION",
+
+ // $ANTLR start UNORDERED
+ mUNORDERED: function() {
+ try {
+ var _type = this.UNORDERED;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:180:29: ( 'unordered' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:180:31: 'unordered'
+ this.match("unordered");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "UNORDERED",
+
+ // $ANTLR start VALIDATE
+ mVALIDATE: function() {
+ try {
+ var _type = this.VALIDATE;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:181:29: ( 'validate' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:181:31: 'validate'
+ this.match("validate");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "VALIDATE",
+
+ // $ANTLR start VARIABLE
+ mVARIABLE: function() {
+ try {
+ var _type = this.VARIABLE;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:182:29: ( 'variable' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:182:31: 'variable'
+ this.match("variable");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "VARIABLE",
+
+ // $ANTLR start VERSION
+ mVERSION: function() {
+ try {
+ var _type = this.VERSION;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:183:29: ( 'version' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:183:31: 'version'
+ this.match("version");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "VERSION",
+
+ // $ANTLR start WHERE
+ mWHERE: function() {
+ try {
+ var _type = this.WHERE;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:184:29: ( 'where' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:184:31: 'where'
+ this.match("where");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "WHERE",
+
+ // $ANTLR start XQUERY
+ mXQUERY: function() {
+ try {
+ var _type = this.XQUERY;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:185:29: ( 'xquery' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:185:31: 'xquery'
+ this.match("xquery");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "XQUERY",
+
+ // $ANTLR start ALLOWING
+ mALLOWING: function() {
+ try {
+ var _type = this.ALLOWING;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:187:29: ( 'allowing' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:187:31: 'allowing'
+ this.match("allowing");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "ALLOWING",
+
+ // $ANTLR start CATCH
+ mCATCH: function() {
+ try {
+ var _type = this.CATCH;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:188:29: ( 'catch' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:188:31: 'catch'
+ this.match("catch");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "CATCH",
+
+ // $ANTLR start CONTEXT
+ mCONTEXT: function() {
+ try {
+ var _type = this.CONTEXT;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:189:29: ( 'context' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:189:31: 'context'
+ this.match("context");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "CONTEXT",
+
+ // $ANTLR start COUNT
+ mCOUNT: function() {
+ try {
+ var _type = this.COUNT;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:190:29: ( 'count' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:190:31: 'count'
+ this.match("count");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "COUNT",
+
+ // $ANTLR start DECIMAL_FORMAT
+ mDECIMAL_FORMAT: function() {
+ try {
+ var _type = this.DECIMAL_FORMAT;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:191:29: ( 'decimal-format' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:191:31: 'decimal-format'
+ this.match("decimal-format");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "DECIMAL_FORMAT",
+
+ // $ANTLR start DECIMAL_SEPARATOR
+ mDECIMAL_SEPARATOR: function() {
+ try {
+ var _type = this.DECIMAL_SEPARATOR;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:192:29: ( 'decimal-separator' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:192:31: 'decimal-separator'
+ this.match("decimal-separator");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "DECIMAL_SEPARATOR",
+
+ // $ANTLR start DIGIT
+ mDIGIT: function() {
+ try {
+ var _type = this.DIGIT;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:193:29: ( 'digit' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:193:31: 'digit'
+ this.match("digit");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "DIGIT",
+
+ // $ANTLR start END
+ mEND: function() {
+ try {
+ var _type = this.END;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:194:29: ( 'end' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:194:31: 'end'
+ this.match("end");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "END",
+
+ // $ANTLR start GROUP
+ mGROUP: function() {
+ try {
+ var _type = this.GROUP;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:195:29: ( 'group' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:195:31: 'group'
+ this.match("group");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "GROUP",
+
+ // $ANTLR start GROUPING_SEPARATOR
+ mGROUPING_SEPARATOR: function() {
+ try {
+ var _type = this.GROUPING_SEPARATOR;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:196:29: ( 'grouping-separator' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:196:31: 'grouping-separator'
+ this.match("grouping-separator");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "GROUPING_SEPARATOR",
+
+ // $ANTLR start INFINITY
+ mINFINITY: function() {
+ try {
+ var _type = this.INFINITY;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:197:29: ( 'infinity' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:197:31: 'infinity'
+ this.match("infinity");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "INFINITY",
+
+ // $ANTLR start MINUS_SIGN
+ mMINUS_SIGN: function() {
+ try {
+ var _type = this.MINUS_SIGN;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:198:29: ( 'minus-sign' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:198:31: 'minus-sign'
+ this.match("minus-sign");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "MINUS_SIGN",
+
+ // $ANTLR start NAMESPACE_NODE
+ mNAMESPACE_NODE: function() {
+ try {
+ var _type = this.NAMESPACE_NODE;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:199:29: ( 'namespace-node' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:199:31: 'namespace-node'
+ this.match("namespace-node");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "NAMESPACE_NODE",
+
+ // $ANTLR start NAN
+ mNAN: function() {
+ try {
+ var _type = this.NAN;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:200:29: ( 'NaN' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:200:31: 'NaN'
+ this.match("NaN");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "NAN",
+
+ // $ANTLR start NEXT
+ mNEXT: function() {
+ try {
+ var _type = this.NEXT;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:201:29: ( 'next' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:201:31: 'next'
+ this.match("next");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "NEXT",
+
+ // $ANTLR start ONLY
+ mONLY: function() {
+ try {
+ var _type = this.ONLY;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:202:29: ( 'only' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:202:31: 'only'
+ this.match("only");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "ONLY",
+
+ // $ANTLR start PATTERN_SEPARATOR
+ mPATTERN_SEPARATOR: function() {
+ try {
+ var _type = this.PATTERN_SEPARATOR;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:203:29: ( 'pattern-separator' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:203:31: 'pattern-separator'
+ this.match("pattern-separator");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "PATTERN_SEPARATOR",
+
+ // $ANTLR start PERCENT
+ mPERCENT: function() {
+ try {
+ var _type = this.PERCENT;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:204:29: ( 'percent' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:204:31: 'percent'
+ this.match("percent");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "PERCENT",
+
+ // $ANTLR start PER_MILLE
+ mPER_MILLE: function() {
+ try {
+ var _type = this.PER_MILLE;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:205:29: ( 'per-mille' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:205:31: 'per-mille'
+ this.match("per-mille");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "PER_MILLE",
+
+ // $ANTLR start PREVIOUS
+ mPREVIOUS: function() {
+ try {
+ var _type = this.PREVIOUS;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:206:29: ( 'previous' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:206:31: 'previous'
+ this.match("previous");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "PREVIOUS",
+
+ // $ANTLR start SLIDING
+ mSLIDING: function() {
+ try {
+ var _type = this.SLIDING;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:207:29: ( 'sliding' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:207:31: 'sliding'
+ this.match("sliding");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "SLIDING",
+
+ // $ANTLR start START
+ mSTART: function() {
+ try {
+ var _type = this.START;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:208:29: ( 'start' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:208:31: 'start'
+ this.match("start");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "START",
+
+ // $ANTLR start SWITCH
+ mSWITCH: function() {
+ try {
+ var _type = this.SWITCH;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:209:29: ( 'switch' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:209:31: 'switch'
+ this.match("switch");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "SWITCH",
+
+ // $ANTLR start TRY
+ mTRY: function() {
+ try {
+ var _type = this.TRY;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:210:29: ( 'try' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:210:31: 'try'
+ this.match("try");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "TRY",
+
+ // $ANTLR start TUMBLING
+ mTUMBLING: function() {
+ try {
+ var _type = this.TUMBLING;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:211:29: ( 'tumbling' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:211:31: 'tumbling'
+ this.match("tumbling");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "TUMBLING",
+
+ // $ANTLR start TYPE
+ mTYPE: function() {
+ try {
+ var _type = this.TYPE;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:212:29: ( 'type' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:212:31: 'type'
+ this.match("type");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "TYPE",
+
+ // $ANTLR start WHEN
+ mWHEN: function() {
+ try {
+ var _type = this.WHEN;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:213:29: ( 'when' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:213:31: 'when'
+ this.match("when");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "WHEN",
+
+ // $ANTLR start WINDOW
+ mWINDOW: function() {
+ try {
+ var _type = this.WINDOW;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:214:29: ( 'window' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:214:31: 'window'
+ this.match("window");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "WINDOW",
+
+ // $ANTLR start ZERO_DIGIT
+ mZERO_DIGIT: function() {
+ try {
+ var _type = this.ZERO_DIGIT;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:215:29: ( 'zero-digit' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:215:31: 'zero-digit'
+ this.match("zero-digit");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "ZERO_DIGIT",
+
+ // $ANTLR start AFTER
+ mAFTER: function() {
+ try {
+ var _type = this.AFTER;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:217:29: ( 'after' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:217:31: 'after'
+ this.match("after");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "AFTER",
+
+ // $ANTLR start BEFORE
+ mBEFORE: function() {
+ try {
+ var _type = this.BEFORE;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:218:29: ( 'before' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:218:31: 'before'
+ this.match("before");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "BEFORE",
+
+ // $ANTLR start COPY
+ mCOPY: function() {
+ try {
+ var _type = this.COPY;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:219:29: ( 'copy' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:219:31: 'copy'
+ this.match("copy");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "COPY",
+
+ // $ANTLR start DELETE
+ mDELETE: function() {
+ try {
+ var _type = this.DELETE;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:220:29: ( 'delete' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:220:31: 'delete'
+ this.match("delete");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "DELETE",
+
+ // $ANTLR start FIRST
+ mFIRST: function() {
+ try {
+ var _type = this.FIRST;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:221:29: ( 'first' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:221:31: 'first'
+ this.match("first");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "FIRST",
+
+ // $ANTLR start INSERT
+ mINSERT: function() {
+ try {
+ var _type = this.INSERT;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:222:29: ( 'insert' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:222:31: 'insert'
+ this.match("insert");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "INSERT",
+
+ // $ANTLR start INTO
+ mINTO: function() {
+ try {
+ var _type = this.INTO;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:223:29: ( 'into' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:223:31: 'into'
+ this.match("into");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "INTO",
+
+ // $ANTLR start POSITION
+ mPOSITION: function() {
+ try {
+ var _type = this.POSITION;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:224:29: ( 'position' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:224:31: 'position'
+ this.match("position");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "POSITION",
+
+ // $ANTLR start APPEND
+ mAPPEND: function() {
+ try {
+ var _type = this.APPEND;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:225:29: ( 'append' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:225:31: 'append'
+ this.match("append");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "APPEND",
+
+ // $ANTLR start LAST
+ mLAST: function() {
+ try {
+ var _type = this.LAST;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:226:29: ( 'last' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:226:31: 'last'
+ this.match("last");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "LAST",
+
+ // $ANTLR start MODIFY
+ mMODIFY: function() {
+ try {
+ var _type = this.MODIFY;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:227:29: ( 'modify' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:227:31: 'modify'
+ this.match("modify");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "MODIFY",
+
+ // $ANTLR start NODES
+ mNODES: function() {
+ try {
+ var _type = this.NODES;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:228:29: ( 'nodes' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:228:31: 'nodes'
+ this.match("nodes");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "NODES",
+
+ // $ANTLR start RENAME
+ mRENAME: function() {
+ try {
+ var _type = this.RENAME;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:229:29: ( 'rename' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:229:31: 'rename'
+ this.match("rename");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "RENAME",
+
+ // $ANTLR start REPLACE
+ mREPLACE: function() {
+ try {
+ var _type = this.REPLACE;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:230:29: ( 'replace' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:230:31: 'replace'
+ this.match("replace");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "REPLACE",
+
+ // $ANTLR start REVALIDATION
+ mREVALIDATION: function() {
+ try {
+ var _type = this.REVALIDATION;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:231:29: ( 'revalidation' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:231:31: 'revalidation'
+ this.match("revalidation");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "REVALIDATION",
+
+ // $ANTLR start SKIP
+ mSKIP: function() {
+ try {
+ var _type = this.SKIP;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:232:29: ( 'skip' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:232:31: 'skip'
+ this.match("skip");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "SKIP",
+
+ // $ANTLR start UPDATING
+ mUPDATING: function() {
+ try {
+ var _type = this.UPDATING;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:233:29: ( 'updating' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:233:31: 'updating'
+ this.match("updating");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "UPDATING",
+
+ // $ANTLR start VALUE
+ mVALUE: function() {
+ try {
+ var _type = this.VALUE;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:234:29: ( 'value' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:234:31: 'value'
+ this.match("value");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "VALUE",
+
+ // $ANTLR start WITH
+ mWITH: function() {
+ try {
+ var _type = this.WITH;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:235:29: ( 'with' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:235:31: 'with'
+ this.match("with");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "WITH",
+
+ // $ANTLR start ALL
+ mALL: function() {
+ try {
+ var _type = this.ALL;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:237:29: ( 'all' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:237:31: 'all'
+ this.match("all");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "ALL",
+
+ // $ANTLR start ANY
+ mANY: function() {
+ try {
+ var _type = this.ANY;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:238:29: ( 'any' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:238:31: 'any'
+ this.match("any");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "ANY",
+
+ // $ANTLR start CONTAINS
+ mCONTAINS: function() {
+ try {
+ var _type = this.CONTAINS;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:239:29: ( 'contains' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:239:31: 'contains'
+ this.match("contains");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "CONTAINS",
+
+ // $ANTLR start CONTENT
+ mCONTENT: function() {
+ try {
+ var _type = this.CONTENT;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:240:29: ( 'content' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:240:31: 'content'
+ this.match("content");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "CONTENT",
+
+ // $ANTLR start DIACRITICS
+ mDIACRITICS: function() {
+ try {
+ var _type = this.DIACRITICS;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:241:29: ( 'diacritics' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:241:31: 'diacritics'
+ this.match("diacritics");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "DIACRITICS",
+
+ // $ANTLR start DIFFERENT
+ mDIFFERENT: function() {
+ try {
+ var _type = this.DIFFERENT;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:242:29: ( 'different' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:242:31: 'different'
+ this.match("different");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "DIFFERENT",
+
+ // $ANTLR start DISTANCE
+ mDISTANCE: function() {
+ try {
+ var _type = this.DISTANCE;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:243:29: ( 'distance' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:243:31: 'distance'
+ this.match("distance");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "DISTANCE",
+
+ // $ANTLR start ENTIRE
+ mENTIRE: function() {
+ try {
+ var _type = this.ENTIRE;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:244:29: ( 'entire' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:244:31: 'entire'
+ this.match("entire");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "ENTIRE",
+
+ // $ANTLR start EXACTLY
+ mEXACTLY: function() {
+ try {
+ var _type = this.EXACTLY;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:245:29: ( 'exactly' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:245:31: 'exactly'
+ this.match("exactly");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "EXACTLY",
+
+ // $ANTLR start FROM
+ mFROM: function() {
+ try {
+ var _type = this.FROM;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:246:29: ( 'from' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:246:31: 'from'
+ this.match("from");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "FROM",
+
+ // $ANTLR start FT_OPTION
+ mFT_OPTION: function() {
+ try {
+ var _type = this.FT_OPTION;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:247:29: ( 'ft-option' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:247:31: 'ft-option'
+ this.match("ft-option");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "FT_OPTION",
+
+ // $ANTLR start FTAND
+ mFTAND: function() {
+ try {
+ var _type = this.FTAND;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:248:29: ( 'ftand' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:248:31: 'ftand'
+ this.match("ftand");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "FTAND",
+
+ // $ANTLR start FTNOT
+ mFTNOT: function() {
+ try {
+ var _type = this.FTNOT;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:249:29: ( 'ftnot' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:249:31: 'ftnot'
+ this.match("ftnot");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "FTNOT",
+
+ // $ANTLR start FTOR
+ mFTOR: function() {
+ try {
+ var _type = this.FTOR;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:250:29: ( 'ftor' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:250:31: 'ftor'
+ this.match("ftor");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "FTOR",
+
+ // $ANTLR start INSENSITIVE
+ mINSENSITIVE: function() {
+ try {
+ var _type = this.INSENSITIVE;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:251:29: ( 'insensitive' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:251:31: 'insensitive'
+ this.match("insensitive");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "INSENSITIVE",
+
+ // $ANTLR start LANGUAGE
+ mLANGUAGE: function() {
+ try {
+ var _type = this.LANGUAGE;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:252:29: ( 'language' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:252:31: 'language'
+ this.match("language");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "LANGUAGE",
+
+ // $ANTLR start LEVELS
+ mLEVELS: function() {
+ try {
+ var _type = this.LEVELS;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:253:29: ( 'levels' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:253:31: 'levels'
+ this.match("levels");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "LEVELS",
+
+ // $ANTLR start LOWERCASE
+ mLOWERCASE: function() {
+ try {
+ var _type = this.LOWERCASE;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:254:29: ( 'lowercase' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:254:31: 'lowercase'
+ this.match("lowercase");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "LOWERCASE",
+
+ // $ANTLR start MOST
+ mMOST: function() {
+ try {
+ var _type = this.MOST;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:255:29: ( 'most' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:255:31: 'most'
+ this.match("most");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "MOST",
+
+ // $ANTLR start NO
+ mNO: function() {
+ try {
+ var _type = this.NO;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:256:29: ( 'no' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:256:31: 'no'
+ this.match("no");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "NO",
+
+ // $ANTLR start NOT
+ mNOT: function() {
+ try {
+ var _type = this.NOT;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:257:29: ( 'not' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:257:31: 'not'
+ this.match("not");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "NOT",
+
+ // $ANTLR start OCCURS
+ mOCCURS: function() {
+ try {
+ var _type = this.OCCURS;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:258:29: ( 'occurs' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:258:31: 'occurs'
+ this.match("occurs");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "OCCURS",
+
+ // $ANTLR start PARAGRAPH
+ mPARAGRAPH: function() {
+ try {
+ var _type = this.PARAGRAPH;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:259:29: ( 'paragraph' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:259:31: 'paragraph'
+ this.match("paragraph");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "PARAGRAPH",
+
+ // $ANTLR start PARAGRAPHS
+ mPARAGRAPHS: function() {
+ try {
+ var _type = this.PARAGRAPHS;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:260:29: ( 'paragraphs' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:260:31: 'paragraphs'
+ this.match("paragraphs");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "PARAGRAPHS",
+
+ // $ANTLR start PHRASE
+ mPHRASE: function() {
+ try {
+ var _type = this.PHRASE;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:261:29: ( 'phrase' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:261:31: 'phrase'
+ this.match("phrase");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "PHRASE",
+
+ // $ANTLR start RELATIONSHIP
+ mRELATIONSHIP: function() {
+ try {
+ var _type = this.RELATIONSHIP;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:262:29: ( 'relationship' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:262:31: 'relationship'
+ this.match("relationship");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "RELATIONSHIP",
+
+ // $ANTLR start SAME
+ mSAME: function() {
+ try {
+ var _type = this.SAME;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:263:29: ( 'same' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:263:31: 'same'
+ this.match("same");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "SAME",
+
+ // $ANTLR start SCORE
+ mSCORE: function() {
+ try {
+ var _type = this.SCORE;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:264:29: ( 'score' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:264:31: 'score'
+ this.match("score");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "SCORE",
+
+ // $ANTLR start SENSITIVE
+ mSENSITIVE: function() {
+ try {
+ var _type = this.SENSITIVE;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:265:29: ( 'sensitive' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:265:31: 'sensitive'
+ this.match("sensitive");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "SENSITIVE",
+
+ // $ANTLR start SENTENCE
+ mSENTENCE: function() {
+ try {
+ var _type = this.SENTENCE;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:266:29: ( 'sentence' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:266:31: 'sentence'
+ this.match("sentence");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "SENTENCE",
+
+ // $ANTLR start SENTENCES
+ mSENTENCES: function() {
+ try {
+ var _type = this.SENTENCES;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:267:29: ( 'sentences' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:267:31: 'sentences'
+ this.match("sentences");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "SENTENCES",
+
+ // $ANTLR start STEMMING
+ mSTEMMING: function() {
+ try {
+ var _type = this.STEMMING;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:268:29: ( 'stemming' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:268:31: 'stemming'
+ this.match("stemming");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "STEMMING",
+
+ // $ANTLR start STOP
+ mSTOP: function() {
+ try {
+ var _type = this.STOP;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:269:29: ( 'stop' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:269:31: 'stop'
+ this.match("stop");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "STOP",
+
+ // $ANTLR start THESAURUS
+ mTHESAURUS: function() {
+ try {
+ var _type = this.THESAURUS;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:270:29: ( 'thesaurus' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:270:31: 'thesaurus'
+ this.match("thesaurus");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "THESAURUS",
+
+ // $ANTLR start TIMES
+ mTIMES: function() {
+ try {
+ var _type = this.TIMES;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:271:29: ( 'times' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:271:31: 'times'
+ this.match("times");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "TIMES",
+
+ // $ANTLR start UPPERCASE
+ mUPPERCASE: function() {
+ try {
+ var _type = this.UPPERCASE;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:272:29: ( 'uppercase' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:272:31: 'uppercase'
+ this.match("uppercase");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "UPPERCASE",
+
+ // $ANTLR start USING
+ mUSING: function() {
+ try {
+ var _type = this.USING;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:273:29: ( 'using' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:273:31: 'using'
+ this.match("using");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "USING",
+
+ // $ANTLR start WEIGHT
+ mWEIGHT: function() {
+ try {
+ var _type = this.WEIGHT;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:274:29: ( 'weight' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:274:31: 'weight'
+ this.match("weight");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "WEIGHT",
+
+ // $ANTLR start WILDCARDS
+ mWILDCARDS: function() {
+ try {
+ var _type = this.WILDCARDS;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:275:29: ( 'wildcards' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:275:31: 'wildcards'
+ this.match("wildcards");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "WILDCARDS",
+
+ // $ANTLR start WITHOUT
+ mWITHOUT: function() {
+ try {
+ var _type = this.WITHOUT;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:276:29: ( 'without' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:276:31: 'without'
+ this.match("without");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "WITHOUT",
+
+ // $ANTLR start WORD
+ mWORD: function() {
+ try {
+ var _type = this.WORD;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:277:29: ( 'word' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:277:31: 'word'
+ this.match("word");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "WORD",
+
+ // $ANTLR start WORDS
+ mWORDS: function() {
+ try {
+ var _type = this.WORDS;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:278:29: ( 'words' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:278:31: 'words'
+ this.match("words");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "WORDS",
+
+ // $ANTLR start BREAK
+ mBREAK: function() {
+ try {
+ var _type = this.BREAK;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:280:29: ( 'break' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:280:31: 'break'
+ this.match("break");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "BREAK",
+
+ // $ANTLR start CONTINUE
+ mCONTINUE: function() {
+ try {
+ var _type = this.CONTINUE;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:281:29: ( 'continue' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:281:31: 'continue'
+ this.match("continue");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "CONTINUE",
+
+ // $ANTLR start EXIT
+ mEXIT: function() {
+ try {
+ var _type = this.EXIT;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:282:29: ( 'exit' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:282:31: 'exit'
+ this.match("exit");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "EXIT",
+
+ // $ANTLR start LOOP
+ mLOOP: function() {
+ try {
+ var _type = this.LOOP;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:283:29: ( 'loop' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:283:31: 'loop'
+ this.match("loop");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "LOOP",
+
+ // $ANTLR start RETURNING
+ mRETURNING: function() {
+ try {
+ var _type = this.RETURNING;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:284:29: ( 'returning' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:284:31: 'returning'
+ this.match("returning");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "RETURNING",
+
+ // $ANTLR start WHILE
+ mWHILE: function() {
+ try {
+ var _type = this.WHILE;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:285:29: ( 'while' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:285:31: 'while'
+ this.match("while");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "WHILE",
+
+ // $ANTLR start CHECK
+ mCHECK: function() {
+ try {
+ var _type = this.CHECK;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:287:29: ( 'check' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:287:31: 'check'
+ this.match("check");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "CHECK",
+
+ // $ANTLR start COLLECTION
+ mCOLLECTION: function() {
+ try {
+ var _type = this.COLLECTION;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:288:29: ( 'collection' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:288:31: 'collection'
+ this.match("collection");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "COLLECTION",
+
+ // $ANTLR start CONSTRAINT
+ mCONSTRAINT: function() {
+ try {
+ var _type = this.CONSTRAINT;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:289:29: ( 'constraint' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:289:31: 'constraint'
+ this.match("constraint");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "CONSTRAINT",
+
+ // $ANTLR start FOREACH
+ mFOREACH: function() {
+ try {
+ var _type = this.FOREACH;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:290:29: ( 'foreach' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:290:31: 'foreach'
+ this.match("foreach");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "FOREACH",
+
+ // $ANTLR start FOREIGN
+ mFOREIGN: function() {
+ try {
+ var _type = this.FOREIGN;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:291:29: ( 'foreign' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:291:31: 'foreign'
+ this.match("foreign");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "FOREIGN",
+
+ // $ANTLR start INDEX
+ mINDEX: function() {
+ try {
+ var _type = this.INDEX;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:292:29: ( 'index' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:292:31: 'index'
+ this.match("index");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "INDEX",
+
+ // $ANTLR start INTEGRITY
+ mINTEGRITY: function() {
+ try {
+ var _type = this.INTEGRITY;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:293:29: ( 'integrity' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:293:31: 'integrity'
+ this.match("integrity");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "INTEGRITY",
+
+ // $ANTLR start KEY
+ mKEY: function() {
+ try {
+ var _type = this.KEY;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:294:29: ( 'key' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:294:31: 'key'
+ this.match("key");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "KEY",
+
+ // $ANTLR start ON
+ mON: function() {
+ try {
+ var _type = this.ON;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:295:29: ( 'on' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:295:31: 'on'
+ this.match("on");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "ON",
+
+ // $ANTLR start UNIQUE
+ mUNIQUE: function() {
+ try {
+ var _type = this.UNIQUE;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:296:29: ( 'unique' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:296:31: 'unique'
+ this.match("unique");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "UNIQUE",
+
+ // $ANTLR start AMP_ER
+ mAMP_ER: function() {
+ try {
+ var _type = this.AMP_ER;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:299:9: ( 'amp' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:299:11: 'amp'
+ this.match("amp");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "AMP_ER",
+
+ // $ANTLR start APOS_ER
+ mAPOS_ER: function() {
+ try {
+ var _type = this.APOS_ER;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:300:9: ( 'apos' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:300:11: 'apos'
+ this.match("apos");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "APOS_ER",
+
+ // $ANTLR start QUOT_ER
+ mQUOT_ER: function() {
+ try {
+ var _type = this.QUOT_ER;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:301:9: ( 'quot' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:301:11: 'quot'
+ this.match("quot");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "QUOT_ER",
+
+ // $ANTLR start CONCAT
+ mCONCAT: function() {
+ try {
+ var _type = this.CONCAT;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:308:25: ( '||' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:308:27: '||'
+ this.match("||");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "CONCAT",
+
+ // $ANTLR start LPAREN
+ mLPAREN: function() {
+ try {
+ var _type = this.LPAREN;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:309:25: ( '(' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:309:27: '('
+ this.match('(');
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "LPAREN",
+
+ // $ANTLR start RPAREN
+ mRPAREN: function() {
+ try {
+ var _type = this.RPAREN;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:310:25: ( ')' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:310:27: ')'
+ this.match(')');
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "RPAREN",
+
+ // $ANTLR start DOLLAR
+ mDOLLAR: function() {
+ try {
+ var _type = this.DOLLAR;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:311:25: ( '$' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:311:27: '$'
+ this.match('$');
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "DOLLAR",
+
+ // $ANTLR start L_UNION_BRACKET
+ mL_UNION_BRACKET: function() {
+ try {
+ var _type = this.L_UNION_BRACKET;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:312:25: ( '{|' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:312:27: '{|'
+ this.match("{|");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "L_UNION_BRACKET",
+
+ // $ANTLR start R_UNION_BRACKET
+ mR_UNION_BRACKET: function() {
+ try {
+ var _type = this.R_UNION_BRACKET;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:313:25: ( '|}' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:313:27: '|}'
+ this.match("|}");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "R_UNION_BRACKET",
+
+ // $ANTLR start LBRACKET
+ mLBRACKET: function() {
+ try {
+ var _type = this.LBRACKET;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:316:25: ( '{' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:316:27: '{'
+ this.match('{');
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "LBRACKET",
+
+ // $ANTLR start RBRACKET
+ mRBRACKET: function() {
+ try {
+ var _type = this.RBRACKET;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:317:25: ( '}' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:317:27: '}'
+ this.match('}');
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "RBRACKET",
+
+ // $ANTLR start LSQUARE
+ mLSQUARE: function() {
+ try {
+ var _type = this.LSQUARE;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:318:25: ( '[' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:318:27: '['
+ this.match('[');
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "LSQUARE",
+
+ // $ANTLR start RSQUARE
+ mRSQUARE: function() {
+ try {
+ var _type = this.RSQUARE;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:319:25: ( ']' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:319:27: ']'
+ this.match(']');
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "RSQUARE",
+
+ // $ANTLR start EQUAL
+ mEQUAL: function() {
+ try {
+ var _type = this.EQUAL;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:320:25: ( '=' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:320:27: '='
+ this.match('=');
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "EQUAL",
+
+ // $ANTLR start BIND
+ mBIND: function() {
+ try {
+ var _type = this.BIND;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:321:25: ( ':=' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:321:27: ':='
+ this.match(":=");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "BIND",
+
+ // $ANTLR start NOTEQUAL
+ mNOTEQUAL: function() {
+ try {
+ var _type = this.NOTEQUAL;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:322:25: ( '!=' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:322:27: '!='
+ this.match("!=");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "NOTEQUAL",
+
+ // $ANTLR start ANN_PERCENT
+ mANN_PERCENT: function() {
+ try {
+ var _type = this.ANN_PERCENT;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:323:25: ( '%' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:323:27: '%'
+ this.match('%');
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "ANN_PERCENT",
+
+ // $ANTLR start HASH
+ mHASH: function() {
+ try {
+ var _type = this.HASH;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:324:25: ( '#' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:324:27: '#'
+ this.match('#');
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "HASH",
+
+ // $ANTLR start AMP
+ mAMP: function() {
+ try {
+ var _type = this.AMP;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:325:25: ( '&' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:325:27: '&'
+ this.match('&');
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "AMP",
+
+ // $ANTLR start COMMA
+ mCOMMA: function() {
+ try {
+ var _type = this.COMMA;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:326:25: ( ',' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:326:27: ','
+ this.match(',');
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "COMMA",
+
+ // $ANTLR start QUESTION
+ mQUESTION: function() {
+ try {
+ var _type = this.QUESTION;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:327:25: ( '?' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:327:27: '?'
+ this.match('?');
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "QUESTION",
+
+ // $ANTLR start STAR
+ mSTAR: function() {
+ try {
+ var _type = this.STAR;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:328:25: ( '*' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:328:27: '*'
+ this.match('*');
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "STAR",
+
+ // $ANTLR start PLUS
+ mPLUS: function() {
+ try {
+ var _type = this.PLUS;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:329:25: ( '+' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:329:27: '+'
+ this.match('+');
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "PLUS",
+
+ // $ANTLR start MINUS
+ mMINUS: function() {
+ try {
+ var _type = this.MINUS;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:330:25: ( '-' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:330:27: '-'
+ this.match('-');
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "MINUS",
+
+ // $ANTLR start SMALLER
+ mSMALLER: function() {
+ try {
+ var _type = this.SMALLER;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:331:25: ( '<' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:331:27: '<'
+ this.match('<');
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "SMALLER",
+
+ // $ANTLR start GREATER
+ mGREATER: function() {
+ try {
+ var _type = this.GREATER;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:332:25: ( '>' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:332:27: '>'
+ this.match('>');
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "GREATER",
+
+ // $ANTLR start SMALLEREQ
+ mSMALLEREQ: function() {
+ try {
+ var _type = this.SMALLEREQ;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:333:25: ( '<=' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:333:27: '<='
+ this.match("<=");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "SMALLEREQ",
+
+ // $ANTLR start GREATEREQ
+ mGREATEREQ: function() {
+ try {
+ var _type = this.GREATEREQ;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:334:25: ( '>=' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:334:27: '>='
+ this.match(">=");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "GREATEREQ",
+
+ // $ANTLR start SMALLER_SMALLER
+ mSMALLER_SMALLER: function() {
+ try {
+ var _type = this.SMALLER_SMALLER;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:335:25: ( '<<' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:335:27: '<<'
+ this.match("<<");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "SMALLER_SMALLER",
+
+ // $ANTLR start GREATER_GREATER
+ mGREATER_GREATER: function() {
+ try {
+ var _type = this.GREATER_GREATER;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:336:25: ( '>>' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:336:27: '>>'
+ this.match(">>");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "GREATER_GREATER",
+
+ // $ANTLR start SLASH
+ mSLASH: function() {
+ try {
+ var _type = this.SLASH;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:337:25: ( '/' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:337:27: '/'
+ this.match('/');
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "SLASH",
+
+ // $ANTLR start SLASH_SLASH
+ mSLASH_SLASH: function() {
+ try {
+ var _type = this.SLASH_SLASH;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:338:25: ( '//' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:338:27: '//'
+ this.match("//");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "SLASH_SLASH",
+
+ // $ANTLR start BANG
+ mBANG: function() {
+ try {
+ var _type = this.BANG;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:339:25: ( '!' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:339:27: '!'
+ this.match('!');
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "BANG",
+
+ // $ANTLR start DOT
+ mDOT: function() {
+ try {
+ var _type = this.DOT;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:340:25: ( '.' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:340:27: '.'
+ this.match('.');
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "DOT",
+
+ // $ANTLR start DOT_DOT
+ mDOT_DOT: function() {
+ try {
+ var _type = this.DOT_DOT;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:341:25: ( '..' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:341:27: '..'
+ this.match("..");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "DOT_DOT",
+
+ // $ANTLR start COLON
+ mCOLON: function() {
+ try {
+ var _type = this.COLON;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:342:25: ( ':' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:342:27: ':'
+ this.match(':');
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "COLON",
+
+ // $ANTLR start COLON_COLON
+ mCOLON_COLON: function() {
+ try {
+ var _type = this.COLON_COLON;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:343:25: ( '::' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:343:27: '::'
+ this.match("::");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "COLON_COLON",
+
+ // $ANTLR start EMPTY_CLOSE_TAG
+ mEMPTY_CLOSE_TAG: function() {
+ try {
+ var _type = this.EMPTY_CLOSE_TAG;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:344:25: ( '/>' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:344:27: '/>'
+ this.match("/>");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "EMPTY_CLOSE_TAG",
+
+ // $ANTLR start CLOSE_TAG
+ mCLOSE_TAG: function() {
+ try {
+ var _type = this.CLOSE_TAG;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:345:25: ( '</' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:345:27: '</'
+ this.match("</");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "CLOSE_TAG",
+
+ // $ANTLR start SEMICOLON
+ mSEMICOLON: function() {
+ try {
+ var _type = this.SEMICOLON;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:346:25: ( ';' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:346:27: ';'
+ this.match(';');
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "SEMICOLON",
+
+ // $ANTLR start VBAR
+ mVBAR: function() {
+ try {
+ var _type = this.VBAR;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:347:25: ( '|' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:347:27: '|'
+ this.match('|');
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "VBAR",
+
+ // $ANTLR start PRAGMA_START
+ mPRAGMA_START: function() {
+ try {
+ var _type = this.PRAGMA_START;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:348:25: ( '(#' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:348:27: '(#'
+ this.match("(#");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "PRAGMA_START",
+
+ // $ANTLR start PRAGMA_END
+ mPRAGMA_END: function() {
+ try {
+ var _type = this.PRAGMA_END;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:349:25: ( '#)' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:349:27: '#)'
+ this.match("#)");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "PRAGMA_END",
+
+ // $ANTLR start XML_COMMENT_START
+ mXML_COMMENT_START: function() {
+ try {
+ var _type = this.XML_COMMENT_START;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:350:25: ( '<!--' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:350:27: '<!--'
+ this.match("<!--");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "XML_COMMENT_START",
+
+ // $ANTLR start XML_COMMENT_END
+ mXML_COMMENT_END: function() {
+ try {
+ var _type = this.XML_COMMENT_END;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:351:25: ( '-->' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:351:27: '-->'
+ this.match("-->");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "XML_COMMENT_END",
+
+ // $ANTLR start PI_START
+ mPI_START: function() {
+ try {
+ var _type = this.PI_START;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:352:25: ( '<?' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:352:27: '<?'
+ this.match("<?");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "PI_START",
+
+ // $ANTLR start PI_END
+ mPI_END: function() {
+ try {
+ var _type = this.PI_END;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:353:25: ( '?>' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:353:27: '?>'
+ this.match("?>");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "PI_END",
+
+ // $ANTLR start ATTR_SIGN
+ mATTR_SIGN: function() {
+ try {
+ var _type = this.ATTR_SIGN;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:354:25: ( '@' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:354:27: '@'
+ this.match('@');
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "ATTR_SIGN",
+
+ // $ANTLR start Q
+ mQ: function() {
+ try {
+ var _type = this.Q;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:355:25: ( 'Q' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:355:27: 'Q'
+ this.match('Q');
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "Q",
+
+ // $ANTLR start CHARREF_DEC
+ mCHARREF_DEC: function() {
+ try {
+ var _type = this.CHARREF_DEC;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:356:25: ( '&#' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:356:27: '&#'
+ this.match("&#");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "CHARREF_DEC",
+
+ // $ANTLR start CHARREF_HEX
+ mCHARREF_HEX: function() {
+ try {
+ var _type = this.CHARREF_HEX;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:357:25: ( '&#x' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:357:27: '&#x'
+ this.match("&#x");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "CHARREF_HEX",
+
+ // $ANTLR start APOS
+ mAPOS: function() {
+ try {
+ var _type = this.APOS;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:358:25: ( '\\'' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:358:27: '\\''
+ this.match('\'');
+ if (!this.inStr) this.inStr = true;
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "APOS",
+
+ // $ANTLR start QUOT
+ mQUOT: function() {
+ try {
+ var _type = this.QUOT;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:359:25: ( '\"' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:359:27: '\"'
+ this.match('\"');
+ if (!this.inStr) this.inStr = true;
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "QUOT",
+
+ // $ANTLR start L_NCName
+ mL_NCName: function() {
+ try {
+ var _type = this.L_NCName;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:363:9: ( NCNameStartChar ( NCNameChar )* )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:363:13: NCNameStartChar ( NCNameChar )*
+ this.mNCNameStartChar();
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:363:29: ( NCNameChar )*
+ loop1:
+ do {
+ var alt1=2;
+ var LA1_0 = this.input.LA(1);
+
+ if ( ((LA1_0>='-' && LA1_0<='.')||(LA1_0>='0' && LA1_0<='9')||(LA1_0>='A' && LA1_0<='Z')||LA1_0=='_'||(LA1_0>='a' && LA1_0<='z')) ) {
+ alt1=1;
+ }
+
+
+ switch (alt1) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:363:29: NCNameChar
+ this.mNCNameChar();
+
+
+ break;
+
+ default :
+ break loop1;
+ }
+ } while (true);
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "L_NCName",
+
+ // $ANTLR start Letter
+ mLetter: function() {
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:366:29: ( 'a' .. 'z' | 'A' .. 'Z' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:
+ if ( (this.input.LA(1)>='A' && this.input.LA(1)<='Z')||(this.input.LA(1)>='a' && this.input.LA(1)<='z') ) {
+ this.input.consume();
+
+ }
+ else {
+ var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
+ this.recover(mse);
+ throw mse;}
+
+
+
+
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "Letter",
+
+ // $ANTLR start HexLetter
+ mHexLetter: function() {
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:367:29: ( 'a' .. 'f' | 'A' .. 'F' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:
+ if ( (this.input.LA(1)>='A' && this.input.LA(1)<='F')||(this.input.LA(1)>='a' && this.input.LA(1)<='f') ) {
+ this.input.consume();
+
+ }
+ else {
+ var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
+ this.recover(mse);
+ throw mse;}
+
+
+
+
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "HexLetter",
+
+ // $ANTLR start Digit
+ mDigit: function() {
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:368:29: ( '0' .. '9' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:368:31: '0' .. '9'
+ this.matchRange('0','9');
+
+
+
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "Digit",
+
+ // $ANTLR start Digits
+ mDigits: function() {
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:369:29: ( ( Digit )+ )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:369:31: ( Digit )+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:369:31: ( Digit )+
+ var cnt2=0;
+ loop2:
+ do {
+ var alt2=2;
+ var LA2_0 = this.input.LA(1);
+
+ if ( ((LA2_0>='0' && LA2_0<='9')) ) {
+ alt2=1;
+ }
+
+
+ switch (alt2) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:369:31: Digit
+ this.mDigit();
+
+
+ break;
+
+ default :
+ if ( cnt2 >= 1 ) {
+ break loop2;
+ }
+ var eee = new org.antlr.runtime.EarlyExitException(2, this.input);
+ throw eee;
+ }
+ cnt2++;
+ } while (true);
+
+
+
+
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "Digits",
+
+ // $ANTLR start NCNameStartChar
+ mNCNameStartChar: function() {
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:371:29: ( Letter | '_' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:
+ if ( (this.input.LA(1)>='A' && this.input.LA(1)<='Z')||this.input.LA(1)=='_'||(this.input.LA(1)>='a' && this.input.LA(1)<='z') ) {
+ this.input.consume();
+
+ }
+ else {
+ var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
+ this.recover(mse);
+ throw mse;}
+
+
+
+
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "NCNameStartChar",
+
+ // $ANTLR start NCNameChar
+ mNCNameChar: function() {
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:372:29: ( Letter | Digit | '.' | '-' | '_' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:
+ if ( (this.input.LA(1)>='-' && this.input.LA(1)<='.')||(this.input.LA(1)>='0' && this.input.LA(1)<='9')||(this.input.LA(1)>='A' && this.input.LA(1)<='Z')||this.input.LA(1)=='_'||(this.input.LA(1)>='a' && this.input.LA(1)<='z') ) {
+ this.input.consume();
+
+ }
+ else {
+ var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
+ this.recover(mse);
+ throw mse;}
+
+
+
+
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "NCNameChar",
+
+ // $ANTLR start S
+ mS: function() {
+ try {
+ var _type = this.S;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:375:9: ( ( '\\t' | ' ' | '\\n' | '\\r' )+ )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:375:11: ( '\\t' | ' ' | '\\n' | '\\r' )+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:375:11: ( '\\t' | ' ' | '\\n' | '\\r' )+
+ var cnt3=0;
+ loop3:
+ do {
+ var alt3=2;
+ var LA3_0 = this.input.LA(1);
+
+ if ( ((LA3_0>='\t' && LA3_0<='\n')||LA3_0=='\r'||LA3_0==' ') ) {
+ alt3=1;
+ }
+
+
+ switch (alt3) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:
+ if ( (this.input.LA(1)>='\t' && this.input.LA(1)<='\n')||this.input.LA(1)=='\r'||this.input.LA(1)==' ' ) {
+ this.input.consume();
+
+ }
+ else {
+ var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
+ this.recover(mse);
+ throw mse;}
+
+
+
+ break;
+
+ default :
+ if ( cnt3 >= 1 ) {
+ break loop3;
+ }
+ var eee = new org.antlr.runtime.EarlyExitException(3, this.input);
+ throw eee;
+ }
+ cnt3++;
+ } while (true);
+
+ _channel = HIDDEN;
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "S",
+
+ // $ANTLR start SU
+ mSU: function() {
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:378:9: ( ( '\\t' | ' ' | '\\n' | '\\r' )+ )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:378:11: ( '\\t' | ' ' | '\\n' | '\\r' )+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:378:11: ( '\\t' | ' ' | '\\n' | '\\r' )+
+ var cnt4=0;
+ loop4:
+ do {
+ var alt4=2;
+ var LA4_0 = this.input.LA(1);
+
+ if ( ((LA4_0>='\t' && LA4_0<='\n')||LA4_0=='\r'||LA4_0==' ') ) {
+ alt4=1;
+ }
+
+
+ switch (alt4) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:
+ if ( (this.input.LA(1)>='\t' && this.input.LA(1)<='\n')||this.input.LA(1)=='\r'||this.input.LA(1)==' ' ) {
+ this.input.consume();
+
+ }
+ else {
+ var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
+ this.recover(mse);
+ throw mse;}
+
+
+
+ break;
+
+ default :
+ if ( cnt4 >= 1 ) {
+ break loop4;
+ }
+ var eee = new org.antlr.runtime.EarlyExitException(4, this.input);
+ throw eee;
+ }
+ cnt4++;
+ } while (true);
+
+
+
+
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "SU",
+
+ // $ANTLR start L_Pragma
+ mL_Pragma: function() {
+ try {
+ var _type = this.L_Pragma;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:389:9: ( PRAGMA_START ( SU )? L_NCName COLON L_NCName ( SU ( options {greedy=false; } : . )* )? PRAGMA_END )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:389:11: PRAGMA_START ( SU )? L_NCName COLON L_NCName ( SU ( options {greedy=false; } : . )* )? PRAGMA_END
+ this.mPRAGMA_START();
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:389:24: ( SU )?
+ var alt5=2;
+ var LA5_0 = this.input.LA(1);
+
+ if ( ((LA5_0>='\t' && LA5_0<='\n')||LA5_0=='\r'||LA5_0==' ') ) {
+ alt5=1;
+ }
+ switch (alt5) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:389:24: SU
+ this.mSU();
+
+
+ break;
+
+ }
+
+ this.mL_NCName();
+ this.mCOLON();
+ this.mL_NCName();
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:389:52: ( SU ( options {greedy=false; } : . )* )?
+ var alt7=2;
+ var LA7_0 = this.input.LA(1);
+
+ if ( ((LA7_0>='\t' && LA7_0<='\n')||LA7_0=='\r'||LA7_0==' ') ) {
+ alt7=1;
+ }
+ switch (alt7) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:389:53: SU ( options {greedy=false; } : . )*
+ this.mSU();
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:389:56: ( options {greedy=false; } : . )*
+ loop6:
+ do {
+ var alt6=2;
+ var LA6_0 = this.input.LA(1);
+
+ if ( (LA6_0=='#') ) {
+ var LA6_1 = this.input.LA(2);
+
+ if ( (LA6_1==')') ) {
+ alt6=2;
+ }
+ else if ( ((LA6_1>='\u0000' && LA6_1<='(')||(LA6_1>='*' && LA6_1<='\uFFFF')) ) {
+ alt6=1;
+ }
+
+
+ }
+ else if ( ((LA6_0>='\u0000' && LA6_0<='\"')||(LA6_0>='$' && LA6_0<='\uFFFF')) ) {
+ alt6=1;
+ }
+
+
+ switch (alt6) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:389:83: .
+ this.matchAny();
+
+
+ break;
+
+ default :
+ break loop6;
+ }
+ } while (true);
+
+
+
+ break;
+
+ }
+
+ this.mPRAGMA_END();
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "L_Pragma",
+
+ // $ANTLR start L_DirCommentConstructor
+ mL_DirCommentConstructor: function() {
+ try {
+ var _type = this.L_DirCommentConstructor;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:399:9: ( XML_COMMENT_START ( options {greedy=false; } : ( . )* ) XML_COMMENT_END )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:399:11: XML_COMMENT_START ( options {greedy=false; } : ( . )* ) XML_COMMENT_END
+ this.mXML_COMMENT_START();
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:399:29: ( options {greedy=false; } : ( . )* )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:399:56: ( . )*
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:399:56: ( . )*
+ loop8:
+ do {
+ var alt8=2;
+ var LA8_0 = this.input.LA(1);
+
+ if ( (LA8_0=='-') ) {
+ var LA8_1 = this.input.LA(2);
+
+ if ( (LA8_1=='-') ) {
+ var LA8_3 = this.input.LA(3);
+
+ if ( (LA8_3=='>') ) {
+ alt8=2;
+ }
+ else if ( ((LA8_3>='\u0000' && LA8_3<='=')||(LA8_3>='?' && LA8_3<='\uFFFF')) ) {
+ alt8=1;
+ }
+
+
+ }
+ else if ( ((LA8_1>='\u0000' && LA8_1<=',')||(LA8_1>='.' && LA8_1<='\uFFFF')) ) {
+ alt8=1;
+ }
+
+
+ }
+ else if ( ((LA8_0>='\u0000' && LA8_0<=',')||(LA8_0>='.' && LA8_0<='\uFFFF')) ) {
+ alt8=1;
+ }
+
+
+ switch (alt8) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:399:56: .
+ this.matchAny();
+
+
+ break;
+
+ default :
+ break loop8;
+ }
+ } while (true);
+
+
+
+
+ this.mXML_COMMENT_END();
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "L_DirCommentConstructor",
+
+ // $ANTLR start L_DirPIConstructor
+ mL_DirPIConstructor: function() {
+ try {
+ var _type = this.L_DirPIConstructor;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:408:9: ( PI_START ( SU )? L_NCName ( SU ( options {greedy=false; } : ( . )* ) )? PI_END )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:408:11: PI_START ( SU )? L_NCName ( SU ( options {greedy=false; } : ( . )* ) )? PI_END
+ this.mPI_START();
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:408:20: ( SU )?
+ var alt9=2;
+ var LA9_0 = this.input.LA(1);
+
+ if ( ((LA9_0>='\t' && LA9_0<='\n')||LA9_0=='\r'||LA9_0==' ') ) {
+ alt9=1;
+ }
+ switch (alt9) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:408:20: SU
+ this.mSU();
+
+
+ break;
+
+ }
+
+ this.mL_NCName();
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:408:33: ( SU ( options {greedy=false; } : ( . )* ) )?
+ var alt11=2;
+ var LA11_0 = this.input.LA(1);
+
+ if ( ((LA11_0>='\t' && LA11_0<='\n')||LA11_0=='\r'||LA11_0==' ') ) {
+ alt11=1;
+ }
+ switch (alt11) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:408:34: SU ( options {greedy=false; } : ( . )* )
+ this.mSU();
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:408:36: ( options {greedy=false; } : ( . )* )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:408:63: ( . )*
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:408:63: ( . )*
+ loop10:
+ do {
+ var alt10=2;
+ var LA10_0 = this.input.LA(1);
+
+ if ( (LA10_0=='?') ) {
+ var LA10_1 = this.input.LA(2);
+
+ if ( (LA10_1=='>') ) {
+ alt10=2;
+ }
+ else if ( ((LA10_1>='\u0000' && LA10_1<='=')||(LA10_1>='?' && LA10_1<='\uFFFF')) ) {
+ alt10=1;
+ }
+
+
+ }
+ else if ( ((LA10_0>='\u0000' && LA10_0<='>')||(LA10_0>='@' && LA10_0<='\uFFFF')) ) {
+ alt10=1;
+ }
+
+
+ switch (alt10) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:408:63: .
+ this.matchAny();
+
+
+ break;
+
+ default :
+ break loop10;
+ }
+ } while (true);
+
+
+
+
+
+
+ break;
+
+ }
+
+ this.mPI_END();
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "L_DirPIConstructor",
+
+ // $ANTLR start L_IntegerLiteral
+ mL_IntegerLiteral: function() {
+ try {
+ var _type = this.L_IntegerLiteral;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:416:9: ( Digits )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:416:13: Digits
+ this.mDigits();
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "L_IntegerLiteral",
+
+ // $ANTLR start L_DecimalLiteral
+ mL_DecimalLiteral: function() {
+ try {
+ var _type = this.L_DecimalLiteral;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:421:9: ( ( '.' Digits ) | ( Digits '.' ( Digit )* ) )
+ var alt13=2;
+ var LA13_0 = this.input.LA(1);
+
+ if ( (LA13_0=='.') ) {
+ alt13=1;
+ }
+ else if ( ((LA13_0>='0' && LA13_0<='9')) ) {
+ alt13=2;
+ }
+ else {
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 13, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt13) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:421:11: ( '.' Digits )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:421:11: ( '.' Digits )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:421:12: '.' Digits
+ this.match('.');
+ this.mDigits();
+
+
+
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:421:26: ( Digits '.' ( Digit )* )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:421:26: ( Digits '.' ( Digit )* )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:421:27: Digits '.' ( Digit )*
+ this.mDigits();
+ this.match('.');
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:421:38: ( Digit )*
+ loop12:
+ do {
+ var alt12=2;
+ var LA12_0 = this.input.LA(1);
+
+ if ( ((LA12_0>='0' && LA12_0<='9')) ) {
+ alt12=1;
+ }
+
+
+ switch (alt12) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:421:38: Digit
+ this.mDigit();
+
+
+ break;
+
+ default :
+ break loop12;
+ }
+ } while (true);
+
+
+
+
+
+
+ break;
+
+ }
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "L_DecimalLiteral",
+
+ // $ANTLR start L_DoubleLiteral
+ mL_DoubleLiteral: function() {
+ try {
+ var _type = this.L_DoubleLiteral;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:426:9: ( ( ( '.' Digits ) | ( Digits ( '.' ( Digit )* )? ) ) ( 'e' | 'E' ) ( '+' | '-' )? Digits )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:426:11: ( ( '.' Digits ) | ( Digits ( '.' ( Digit )* )? ) ) ( 'e' | 'E' ) ( '+' | '-' )? Digits
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:426:11: ( ( '.' Digits ) | ( Digits ( '.' ( Digit )* )? ) )
+ var alt16=2;
+ var LA16_0 = this.input.LA(1);
+
+ if ( (LA16_0=='.') ) {
+ alt16=1;
+ }
+ else if ( ((LA16_0>='0' && LA16_0<='9')) ) {
+ alt16=2;
+ }
+ else {
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 16, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt16) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:426:12: ( '.' Digits )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:426:12: ( '.' Digits )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:426:13: '.' Digits
+ this.match('.');
+ this.mDigits();
+
+
+
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:426:27: ( Digits ( '.' ( Digit )* )? )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:426:27: ( Digits ( '.' ( Digit )* )? )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:426:28: Digits ( '.' ( Digit )* )?
+ this.mDigits();
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:426:35: ( '.' ( Digit )* )?
+ var alt15=2;
+ var LA15_0 = this.input.LA(1);
+
+ if ( (LA15_0=='.') ) {
+ alt15=1;
+ }
+ switch (alt15) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:426:36: '.' ( Digit )*
+ this.match('.');
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:426:40: ( Digit )*
+ loop14:
+ do {
+ var alt14=2;
+ var LA14_0 = this.input.LA(1);
+
+ if ( ((LA14_0>='0' && LA14_0<='9')) ) {
+ alt14=1;
+ }
+
+
+ switch (alt14) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:426:40: Digit
+ this.mDigit();
+
+
+ break;
+
+ default :
+ break loop14;
+ }
+ } while (true);
+
+
+
+ break;
+
+ }
+
+
+
+
+
+
+ break;
+
+ }
+
+ if ( this.input.LA(1)=='E'||this.input.LA(1)=='e' ) {
+ this.input.consume();
+
+ }
+ else {
+ var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
+ this.recover(mse);
+ throw mse;}
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:426:63: ( '+' | '-' )?
+ var alt17=2;
+ var LA17_0 = this.input.LA(1);
+
+ if ( (LA17_0=='+'||LA17_0=='-') ) {
+ alt17=1;
+ }
+ switch (alt17) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:
+ if ( this.input.LA(1)=='+'||this.input.LA(1)=='-' ) {
+ this.input.consume();
+
+ }
+ else {
+ var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
+ this.recover(mse);
+ throw mse;}
+
+
+
+ break;
+
+ }
+
+ this.mDigits();
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "L_DoubleLiteral",
+
+ // $ANTLR start L_Comment
+ mL_Comment: function() {
+ try {
+ var _type = this.L_Comment;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:431:9: ({...}? => '(:' ( options {greedy=false; } : L_Comment | . )* ':)' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:431:11: {...}? => '(:' ( options {greedy=false; } : L_Comment | . )* ':)'
+ if ( !((!this.inStr)) ) {
+ throw new org.antlr.runtime.FailedPredicateException(this.input, "L_Comment", "!this.inStr");
+ }
+ this.match("(:");
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:431:33: ( options {greedy=false; } : L_Comment | . )*
+ loop18:
+ do {
+ var alt18=3;
+ var LA18_0 = this.input.LA(1);
+
+ if ( (LA18_0==':') ) {
+ var LA18_1 = this.input.LA(2);
+
+ if ( (LA18_1==')') ) {
+ alt18=3;
+ }
+ else if ( ((LA18_1>='\u0000' && LA18_1<='(')||(LA18_1>='*' && LA18_1<='\uFFFF')) ) {
+ alt18=2;
+ }
+
+
+ }
+ else if ( (LA18_0=='(') ) {
+ var LA18_2 = this.input.LA(2);
+
+ if ( (LA18_2==':') ) {
+ var LA18_5 = this.input.LA(3);
+
+ if ( ((!this.inStr)) ) {
+ alt18=1;
+ }
+ else if ( (true) ) {
+ alt18=2;
+ }
+
+
+ }
+ else if ( ((LA18_2>='\u0000' && LA18_2<='9')||(LA18_2>=';' && LA18_2<='\uFFFF')) ) {
+ alt18=2;
+ }
+
+
+ }
+ else if ( ((LA18_0>='\u0000' && LA18_0<='\'')||(LA18_0>=')' && LA18_0<='9')||(LA18_0>=';' && LA18_0<='\uFFFF')) ) {
+ alt18=2;
+ }
+
+
+ switch (alt18) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:431:59: L_Comment
+ this.mL_Comment();
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:431:71: .
+ this.matchAny();
+
+
+ break;
+
+ default :
+ break loop18;
+ }
+ } while (true);
+
+ this.match(":)");
+
+ _channel = HIDDEN; this.addComment(this.state.tokenStartCharIndex, (this.getCharIndex()-1));
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "L_Comment",
+
+ // $ANTLR start L_AnyChar
+ mL_AnyChar: function() {
+ try {
+ var _type = this.L_AnyChar;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:434:11: ( . )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:434:13: .
+ this.matchAny();
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "L_AnyChar",
+
+ mTokens: function() {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:8: ( ANCESTOR | ANCESTOR_OR_SELF | AND | AS | ASCENDING | AT | ATTRIBUTE | BASE_URI | BOUNDARY_SPACE | BY | CASE | CAST | CASTABLE | CHILD | COLLATION | COMMENT | CONSTRUCTION | COPY_NAMESPACES | DECLARE | DEFAULT | DESCENDANT | DESCENDANT_OR_SELF | DESCENDING | DIV | DOCUMENT | DOCUMENT_NODE | ELEMENT | ELSE | EMPTY | EMPTY_SEQUENCE | ENCODING | EQ | EVERY | EXCEPT | EXTERNAL | FOLLOWING | FOLLOWING_SIBLING | FOR | FUNCTION | GE | GREATEST | GT | IDIV | IF | IMPORT | IN | INHERIT | INSTANCE | INTERSECT | IS | ITEM | LAX | LE | LEAST | LET | LT | MOD | MODULE | NAMESPACE | NE | NO_INHERIT | NO_PRESERVE | NODE | JSON | OF | OPTION | OR | ORDER | ORDERED | ORDERING | PARENT | PRECEDING | PRECEDING_SIBLING | PRESERVE | PROCESSING_INSTRUCTION | STRUCTURED_ITEM | JSON_ITEM | OBJECT | ARRAY | RETURN | SATISFIES | SCHEMA | SCHEMA_ATTRIBUTE | SCHEMA_ELEMENT | SELF | SOME | STABLE | STRICT | STRIP | TEXT | THEN | TO | TREAT | TYPESWITCH | UNION | UNORDERED | VALIDATE | VARIABLE | VERSION | WHERE | XQUERY | ALLOWING | CATCH | CONTEXT | COUNT | DECIMAL_FORMAT | DECIMAL_SEPARATOR | DIGIT | END | GROUP | GROUPING_SEPARATOR | INFINITY | MINUS_SIGN | NAMESPACE_NODE | NAN | NEXT | ONLY | PATTERN_SEPARATOR | PERCENT | PER_MILLE | PREVIOUS | SLIDING | START | SWITCH | TRY | TUMBLING | TYPE | WHEN | WINDOW | ZERO_DIGIT | AFTER | BEFORE | COPY | DELETE | FIRST | INSERT | INTO | POSITION | APPEND | LAST | MODIFY | NODES | RENAME | REPLACE | REVALIDATION | SKIP | UPDATING | VALUE | WITH | ALL | ANY | CONTAINS | CONTENT | DIACRITICS | DIFFERENT | DISTANCE | ENTIRE | EXACTLY | FROM | FT_OPTION | FTAND | FTNOT | FTOR | INSENSITIVE | LANGUAGE | LEVELS | LOWERCASE | MOST | NO | NOT | OCCURS | PARAGRAPH | PARAGRAPHS | PHRASE | RELATIONSHIP | SAME | SCORE | SENSITIVE | SENTENCE | SENTENCES | STEMMING | STOP | THESAURUS | TIMES | UPPERCASE | USING | WEIGHT | WILDCARDS | WITHOUT | WORD | WORDS | BREAK | CONTINUE | EXIT | LOOP | RETURNING | WHILE | CHECK | COLLECTION | CONSTRAINT | FOREACH | FOREIGN | INDEX | INTEGRITY | KEY | ON | UNIQUE | AMP_ER | APOS_ER | QUOT_ER | CONCAT | LPAREN | RPAREN | DOLLAR | L_UNION_BRACKET | R_UNION_BRACKET | LBRACKET | RBRACKET | LSQUARE | RSQUARE | EQUAL | BIND | NOTEQUAL | ANN_PERCENT | HASH | AMP | COMMA | QUESTION | STAR | PLUS | MINUS | SMALLER | GREATER | SMALLEREQ | GREATEREQ | SMALLER_SMALLER | GREATER_GREATER | SLASH | SLASH_SLASH | BANG | DOT | DOT_DOT | COLON | COLON_COLON | EMPTY_CLOSE_TAG | CLOSE_TAG | SEMICOLON | VBAR | PRAGMA_START | PRAGMA_END | XML_COMMENT_START | XML_COMMENT_END | PI_START | PI_END | ATTR_SIGN | Q | CHARREF_DEC | CHARREF_HEX | APOS | QUOT | L_NCName | S | L_Pragma | L_DirCommentConstructor | L_DirPIConstructor | L_IntegerLiteral | L_DecimalLiteral | L_DoubleLiteral | L_Comment | L_AnyChar )
+ var alt19=270;
+ alt19 = this.dfa19.predict(this.input);
+ switch (alt19) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:10: ANCESTOR
+ this.mANCESTOR();
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:19: ANCESTOR_OR_SELF
+ this.mANCESTOR_OR_SELF();
+
+
+ break;
+ case 3 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:36: AND
+ this.mAND();
+
+
+ break;
+ case 4 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:40: AS
+ this.mAS();
+
+
+ break;
+ case 5 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:43: ASCENDING
+ this.mASCENDING();
+
+
+ break;
+ case 6 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:53: AT
+ this.mAT();
+
+
+ break;
+ case 7 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:56: ATTRIBUTE
+ this.mATTRIBUTE();
+
+
+ break;
+ case 8 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:66: BASE_URI
+ this.mBASE_URI();
+
+
+ break;
+ case 9 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:75: BOUNDARY_SPACE
+ this.mBOUNDARY_SPACE();
+
+
+ break;
+ case 10 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:90: BY
+ this.mBY();
+
+
+ break;
+ case 11 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:93: CASE
+ this.mCASE();
+
+
+ break;
+ case 12 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:98: CAST
+ this.mCAST();
+
+
+ break;
+ case 13 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:103: CASTABLE
+ this.mCASTABLE();
+
+
+ break;
+ case 14 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:112: CHILD
+ this.mCHILD();
+
+
+ break;
+ case 15 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:118: COLLATION
+ this.mCOLLATION();
+
+
+ break;
+ case 16 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:128: COMMENT
+ this.mCOMMENT();
+
+
+ break;
+ case 17 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:136: CONSTRUCTION
+ this.mCONSTRUCTION();
+
+
+ break;
+ case 18 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:149: COPY_NAMESPACES
+ this.mCOPY_NAMESPACES();
+
+
+ break;
+ case 19 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:165: DECLARE
+ this.mDECLARE();
+
+
+ break;
+ case 20 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:173: DEFAULT
+ this.mDEFAULT();
+
+
+ break;
+ case 21 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:181: DESCENDANT
+ this.mDESCENDANT();
+
+
+ break;
+ case 22 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:192: DESCENDANT_OR_SELF
+ this.mDESCENDANT_OR_SELF();
+
+
+ break;
+ case 23 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:211: DESCENDING
+ this.mDESCENDING();
+
+
+ break;
+ case 24 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:222: DIV
+ this.mDIV();
+
+
+ break;
+ case 25 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:226: DOCUMENT
+ this.mDOCUMENT();
+
+
+ break;
+ case 26 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:235: DOCUMENT_NODE
+ this.mDOCUMENT_NODE();
+
+
+ break;
+ case 27 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:249: ELEMENT
+ this.mELEMENT();
+
+
+ break;
+ case 28 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:257: ELSE
+ this.mELSE();
+
+
+ break;
+ case 29 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:262: EMPTY
+ this.mEMPTY();
+
+
+ break;
+ case 30 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:268: EMPTY_SEQUENCE
+ this.mEMPTY_SEQUENCE();
+
+
+ break;
+ case 31 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:283: ENCODING
+ this.mENCODING();
+
+
+ break;
+ case 32 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:292: EQ
+ this.mEQ();
+
+
+ break;
+ case 33 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:295: EVERY
+ this.mEVERY();
+
+
+ break;
+ case 34 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:301: EXCEPT
+ this.mEXCEPT();
+
+
+ break;
+ case 35 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:308: EXTERNAL
+ this.mEXTERNAL();
+
+
+ break;
+ case 36 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:317: FOLLOWING
+ this.mFOLLOWING();
+
+
+ break;
+ case 37 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:327: FOLLOWING_SIBLING
+ this.mFOLLOWING_SIBLING();
+
+
+ break;
+ case 38 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:345: FOR
+ this.mFOR();
+
+
+ break;
+ case 39 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:349: FUNCTION
+ this.mFUNCTION();
+
+
+ break;
+ case 40 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:358: GE
+ this.mGE();
+
+
+ break;
+ case 41 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:361: GREATEST
+ this.mGREATEST();
+
+
+ break;
+ case 42 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:370: GT
+ this.mGT();
+
+
+ break;
+ case 43 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:373: IDIV
+ this.mIDIV();
+
+
+ break;
+ case 44 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:378: IF
+ this.mIF();
+
+
+ break;
+ case 45 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:381: IMPORT
+ this.mIMPORT();
+
+
+ break;
+ case 46 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:388: IN
+ this.mIN();
+
+
+ break;
+ case 47 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:391: INHERIT
+ this.mINHERIT();
+
+
+ break;
+ case 48 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:399: INSTANCE
+ this.mINSTANCE();
+
+
+ break;
+ case 49 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:408: INTERSECT
+ this.mINTERSECT();
+
+
+ break;
+ case 50 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:418: IS
+ this.mIS();
+
+
+ break;
+ case 51 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:421: ITEM
+ this.mITEM();
+
+
+ break;
+ case 52 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:426: LAX
+ this.mLAX();
+
+
+ break;
+ case 53 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:430: LE
+ this.mLE();
+
+
+ break;
+ case 54 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:433: LEAST
+ this.mLEAST();
+
+
+ break;
+ case 55 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:439: LET
+ this.mLET();
+
+
+ break;
+ case 56 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:443: LT
+ this.mLT();
+
+
+ break;
+ case 57 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:446: MOD
+ this.mMOD();
+
+
+ break;
+ case 58 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:450: MODULE
+ this.mMODULE();
+
+
+ break;
+ case 59 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:457: NAMESPACE
+ this.mNAMESPACE();
+
+
+ break;
+ case 60 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:467: NE
+ this.mNE();
+
+
+ break;
+ case 61 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:470: NO_INHERIT
+ this.mNO_INHERIT();
+
+
+ break;
+ case 62 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:481: NO_PRESERVE
+ this.mNO_PRESERVE();
+
+
+ break;
+ case 63 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:493: NODE
+ this.mNODE();
+
+
+ break;
+ case 64 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:498: JSON
+ this.mJSON();
+
+
+ break;
+ case 65 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:503: OF
+ this.mOF();
+
+
+ break;
+ case 66 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:506: OPTION
+ this.mOPTION();
+
+
+ break;
+ case 67 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:513: OR
+ this.mOR();
+
+
+ break;
+ case 68 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:516: ORDER
+ this.mORDER();
+
+
+ break;
+ case 69 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:522: ORDERED
+ this.mORDERED();
+
+
+ break;
+ case 70 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:530: ORDERING
+ this.mORDERING();
+
+
+ break;
+ case 71 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:539: PARENT
+ this.mPARENT();
+
+
+ break;
+ case 72 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:546: PRECEDING
+ this.mPRECEDING();
+
+
+ break;
+ case 73 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:556: PRECEDING_SIBLING
+ this.mPRECEDING_SIBLING();
+
+
+ break;
+ case 74 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:574: PRESERVE
+ this.mPRESERVE();
+
+
+ break;
+ case 75 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:583: PROCESSING_INSTRUCTION
+ this.mPROCESSING_INSTRUCTION();
+
+
+ break;
+ case 76 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:606: STRUCTURED_ITEM
+ this.mSTRUCTURED_ITEM();
+
+
+ break;
+ case 77 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:622: JSON_ITEM
+ this.mJSON_ITEM();
+
+
+ break;
+ case 78 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:632: OBJECT
+ this.mOBJECT();
+
+
+ break;
+ case 79 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:639: ARRAY
+ this.mARRAY();
+
+
+ break;
+ case 80 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:645: RETURN
+ this.mRETURN();
+
+
+ break;
+ case 81 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:652: SATISFIES
+ this.mSATISFIES();
+
+
+ break;
+ case 82 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:662: SCHEMA
+ this.mSCHEMA();
+
+
+ break;
+ case 83 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:669: SCHEMA_ATTRIBUTE
+ this.mSCHEMA_ATTRIBUTE();
+
+
+ break;
+ case 84 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:686: SCHEMA_ELEMENT
+ this.mSCHEMA_ELEMENT();
+
+
+ break;
+ case 85 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:701: SELF
+ this.mSELF();
+
+
+ break;
+ case 86 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:706: SOME
+ this.mSOME();
+
+
+ break;
+ case 87 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:711: STABLE
+ this.mSTABLE();
+
+
+ break;
+ case 88 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:718: STRICT
+ this.mSTRICT();
+
+
+ break;
+ case 89 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:725: STRIP
+ this.mSTRIP();
+
+
+ break;
+ case 90 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:731: TEXT
+ this.mTEXT();
+
+
+ break;
+ case 91 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:736: THEN
+ this.mTHEN();
+
+
+ break;
+ case 92 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:741: TO
+ this.mTO();
+
+
+ break;
+ case 93 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:744: TREAT
+ this.mTREAT();
+
+
+ break;
+ case 94 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:750: TYPESWITCH
+ this.mTYPESWITCH();
+
+
+ break;
+ case 95 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:761: UNION
+ this.mUNION();
+
+
+ break;
+ case 96 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:767: UNORDERED
+ this.mUNORDERED();
+
+
+ break;
+ case 97 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:777: VALIDATE
+ this.mVALIDATE();
+
+
+ break;
+ case 98 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:786: VARIABLE
+ this.mVARIABLE();
+
+
+ break;
+ case 99 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:795: VERSION
+ this.mVERSION();
+
+
+ break;
+ case 100 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:803: WHERE
+ this.mWHERE();
+
+
+ break;
+ case 101 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:809: XQUERY
+ this.mXQUERY();
+
+
+ break;
+ case 102 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:816: ALLOWING
+ this.mALLOWING();
+
+
+ break;
+ case 103 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:825: CATCH
+ this.mCATCH();
+
+
+ break;
+ case 104 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:831: CONTEXT
+ this.mCONTEXT();
+
+
+ break;
+ case 105 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:839: COUNT
+ this.mCOUNT();
+
+
+ break;
+ case 106 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:845: DECIMAL_FORMAT
+ this.mDECIMAL_FORMAT();
+
+
+ break;
+ case 107 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:860: DECIMAL_SEPARATOR
+ this.mDECIMAL_SEPARATOR();
+
+
+ break;
+ case 108 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:878: DIGIT
+ this.mDIGIT();
+
+
+ break;
+ case 109 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:884: END
+ this.mEND();
+
+
+ break;
+ case 110 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:888: GROUP
+ this.mGROUP();
+
+
+ break;
+ case 111 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:894: GROUPING_SEPARATOR
+ this.mGROUPING_SEPARATOR();
+
+
+ break;
+ case 112 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:913: INFINITY
+ this.mINFINITY();
+
+
+ break;
+ case 113 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:922: MINUS_SIGN
+ this.mMINUS_SIGN();
+
+
+ break;
+ case 114 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:933: NAMESPACE_NODE
+ this.mNAMESPACE_NODE();
+
+
+ break;
+ case 115 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:948: NAN
+ this.mNAN();
+
+
+ break;
+ case 116 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:952: NEXT
+ this.mNEXT();
+
+
+ break;
+ case 117 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:957: ONLY
+ this.mONLY();
+
+
+ break;
+ case 118 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:962: PATTERN_SEPARATOR
+ this.mPATTERN_SEPARATOR();
+
+
+ break;
+ case 119 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:980: PERCENT
+ this.mPERCENT();
+
+
+ break;
+ case 120 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:988: PER_MILLE
+ this.mPER_MILLE();
+
+
+ break;
+ case 121 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:998: PREVIOUS
+ this.mPREVIOUS();
+
+
+ break;
+ case 122 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1007: SLIDING
+ this.mSLIDING();
+
+
+ break;
+ case 123 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1015: START
+ this.mSTART();
+
+
+ break;
+ case 124 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1021: SWITCH
+ this.mSWITCH();
+
+
+ break;
+ case 125 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1028: TRY
+ this.mTRY();
+
+
+ break;
+ case 126 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1032: TUMBLING
+ this.mTUMBLING();
+
+
+ break;
+ case 127 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1041: TYPE
+ this.mTYPE();
+
+
+ break;
+ case 128 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1046: WHEN
+ this.mWHEN();
+
+
+ break;
+ case 129 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1051: WINDOW
+ this.mWINDOW();
+
+
+ break;
+ case 130 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1058: ZERO_DIGIT
+ this.mZERO_DIGIT();
+
+
+ break;
+ case 131 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1069: AFTER
+ this.mAFTER();
+
+
+ break;
+ case 132 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1075: BEFORE
+ this.mBEFORE();
+
+
+ break;
+ case 133 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1082: COPY
+ this.mCOPY();
+
+
+ break;
+ case 134 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1087: DELETE
+ this.mDELETE();
+
+
+ break;
+ case 135 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1094: FIRST
+ this.mFIRST();
+
+
+ break;
+ case 136 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1100: INSERT
+ this.mINSERT();
+
+
+ break;
+ case 137 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1107: INTO
+ this.mINTO();
+
+
+ break;
+ case 138 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1112: POSITION
+ this.mPOSITION();
+
+
+ break;
+ case 139 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1121: APPEND
+ this.mAPPEND();
+
+
+ break;
+ case 140 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1128: LAST
+ this.mLAST();
+
+
+ break;
+ case 141 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1133: MODIFY
+ this.mMODIFY();
+
+
+ break;
+ case 142 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1140: NODES
+ this.mNODES();
+
+
+ break;
+ case 143 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1146: RENAME
+ this.mRENAME();
+
+
+ break;
+ case 144 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1153: REPLACE
+ this.mREPLACE();
+
+
+ break;
+ case 145 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1161: REVALIDATION
+ this.mREVALIDATION();
+
+
+ break;
+ case 146 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1174: SKIP
+ this.mSKIP();
+
+
+ break;
+ case 147 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1179: UPDATING
+ this.mUPDATING();
+
+
+ break;
+ case 148 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1188: VALUE
+ this.mVALUE();
+
+
+ break;
+ case 149 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1194: WITH
+ this.mWITH();
+
+
+ break;
+ case 150 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1199: ALL
+ this.mALL();
+
+
+ break;
+ case 151 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1203: ANY
+ this.mANY();
+
+
+ break;
+ case 152 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1207: CONTAINS
+ this.mCONTAINS();
+
+
+ break;
+ case 153 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1216: CONTENT
+ this.mCONTENT();
+
+
+ break;
+ case 154 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1224: DIACRITICS
+ this.mDIACRITICS();
+
+
+ break;
+ case 155 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1235: DIFFERENT
+ this.mDIFFERENT();
+
+
+ break;
+ case 156 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1245: DISTANCE
+ this.mDISTANCE();
+
+
+ break;
+ case 157 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1254: ENTIRE
+ this.mENTIRE();
+
+
+ break;
+ case 158 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1261: EXACTLY
+ this.mEXACTLY();
+
+
+ break;
+ case 159 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1269: FROM
+ this.mFROM();
+
+
+ break;
+ case 160 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1274: FT_OPTION
+ this.mFT_OPTION();
+
+
+ break;
+ case 161 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1284: FTAND
+ this.mFTAND();
+
+
+ break;
+ case 162 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1290: FTNOT
+ this.mFTNOT();
+
+
+ break;
+ case 163 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1296: FTOR
+ this.mFTOR();
+
+
+ break;
+ case 164 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1301: INSENSITIVE
+ this.mINSENSITIVE();
+
+
+ break;
+ case 165 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1313: LANGUAGE
+ this.mLANGUAGE();
+
+
+ break;
+ case 166 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1322: LEVELS
+ this.mLEVELS();
+
+
+ break;
+ case 167 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1329: LOWERCASE
+ this.mLOWERCASE();
+
+
+ break;
+ case 168 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1339: MOST
+ this.mMOST();
+
+
+ break;
+ case 169 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1344: NO
+ this.mNO();
+
+
+ break;
+ case 170 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1347: NOT
+ this.mNOT();
+
+
+ break;
+ case 171 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1351: OCCURS
+ this.mOCCURS();
+
+
+ break;
+ case 172 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1358: PARAGRAPH
+ this.mPARAGRAPH();
+
+
+ break;
+ case 173 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1368: PARAGRAPHS
+ this.mPARAGRAPHS();
+
+
+ break;
+ case 174 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1379: PHRASE
+ this.mPHRASE();
+
+
+ break;
+ case 175 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1386: RELATIONSHIP
+ this.mRELATIONSHIP();
+
+
+ break;
+ case 176 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1399: SAME
+ this.mSAME();
+
+
+ break;
+ case 177 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1404: SCORE
+ this.mSCORE();
+
+
+ break;
+ case 178 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1410: SENSITIVE
+ this.mSENSITIVE();
+
+
+ break;
+ case 179 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1420: SENTENCE
+ this.mSENTENCE();
+
+
+ break;
+ case 180 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1429: SENTENCES
+ this.mSENTENCES();
+
+
+ break;
+ case 181 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1439: STEMMING
+ this.mSTEMMING();
+
+
+ break;
+ case 182 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1448: STOP
+ this.mSTOP();
+
+
+ break;
+ case 183 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1453: THESAURUS
+ this.mTHESAURUS();
+
+
+ break;
+ case 184 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1463: TIMES
+ this.mTIMES();
+
+
+ break;
+ case 185 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1469: UPPERCASE
+ this.mUPPERCASE();
+
+
+ break;
+ case 186 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1479: USING
+ this.mUSING();
+
+
+ break;
+ case 187 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1485: WEIGHT
+ this.mWEIGHT();
+
+
+ break;
+ case 188 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1492: WILDCARDS
+ this.mWILDCARDS();
+
+
+ break;
+ case 189 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1502: WITHOUT
+ this.mWITHOUT();
+
+
+ break;
+ case 190 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1510: WORD
+ this.mWORD();
+
+
+ break;
+ case 191 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1515: WORDS
+ this.mWORDS();
+
+
+ break;
+ case 192 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1521: BREAK
+ this.mBREAK();
+
+
+ break;
+ case 193 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1527: CONTINUE
+ this.mCONTINUE();
+
+
+ break;
+ case 194 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1536: EXIT
+ this.mEXIT();
+
+
+ break;
+ case 195 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1541: LOOP
+ this.mLOOP();
+
+
+ break;
+ case 196 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1546: RETURNING
+ this.mRETURNING();
+
+
+ break;
+ case 197 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1556: WHILE
+ this.mWHILE();
+
+
+ break;
+ case 198 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1562: CHECK
+ this.mCHECK();
+
+
+ break;
+ case 199 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1568: COLLECTION
+ this.mCOLLECTION();
+
+
+ break;
+ case 200 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1579: CONSTRAINT
+ this.mCONSTRAINT();
+
+
+ break;
+ case 201 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1590: FOREACH
+ this.mFOREACH();
+
+
+ break;
+ case 202 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1598: FOREIGN
+ this.mFOREIGN();
+
+
+ break;
+ case 203 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1606: INDEX
+ this.mINDEX();
+
+
+ break;
+ case 204 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1612: INTEGRITY
+ this.mINTEGRITY();
+
+
+ break;
+ case 205 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1622: KEY
+ this.mKEY();
+
+
+ break;
+ case 206 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1626: ON
+ this.mON();
+
+
+ break;
+ case 207 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1629: UNIQUE
+ this.mUNIQUE();
+
+
+ break;
+ case 208 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1636: AMP_ER
+ this.mAMP_ER();
+
+
+ break;
+ case 209 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1643: APOS_ER
+ this.mAPOS_ER();
+
+
+ break;
+ case 210 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1651: QUOT_ER
+ this.mQUOT_ER();
+
+
+ break;
+ case 211 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1659: CONCAT
+ this.mCONCAT();
+
+
+ break;
+ case 212 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1666: LPAREN
+ this.mLPAREN();
+
+
+ break;
+ case 213 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1673: RPAREN
+ this.mRPAREN();
+
+
+ break;
+ case 214 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1680: DOLLAR
+ this.mDOLLAR();
+
+
+ break;
+ case 215 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1687: L_UNION_BRACKET
+ this.mL_UNION_BRACKET();
+
+
+ break;
+ case 216 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1703: R_UNION_BRACKET
+ this.mR_UNION_BRACKET();
+
+
+ break;
+ case 217 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1719: LBRACKET
+ this.mLBRACKET();
+
+
+ break;
+ case 218 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1728: RBRACKET
+ this.mRBRACKET();
+
+
+ break;
+ case 219 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1737: LSQUARE
+ this.mLSQUARE();
+
+
+ break;
+ case 220 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1745: RSQUARE
+ this.mRSQUARE();
+
+
+ break;
+ case 221 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1753: EQUAL
+ this.mEQUAL();
+
+
+ break;
+ case 222 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1759: BIND
+ this.mBIND();
+
+
+ break;
+ case 223 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1764: NOTEQUAL
+ this.mNOTEQUAL();
+
+
+ break;
+ case 224 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1773: ANN_PERCENT
+ this.mANN_PERCENT();
+
+
+ break;
+ case 225 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1785: HASH
+ this.mHASH();
+
+
+ break;
+ case 226 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1790: AMP
+ this.mAMP();
+
+
+ break;
+ case 227 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1794: COMMA
+ this.mCOMMA();
+
+
+ break;
+ case 228 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1800: QUESTION
+ this.mQUESTION();
+
+
+ break;
+ case 229 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1809: STAR
+ this.mSTAR();
+
+
+ break;
+ case 230 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1814: PLUS
+ this.mPLUS();
+
+
+ break;
+ case 231 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1819: MINUS
+ this.mMINUS();
+
+
+ break;
+ case 232 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1825: SMALLER
+ this.mSMALLER();
+
+
+ break;
+ case 233 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1833: GREATER
+ this.mGREATER();
+
+
+ break;
+ case 234 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1841: SMALLEREQ
+ this.mSMALLEREQ();
+
+
+ break;
+ case 235 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1851: GREATEREQ
+ this.mGREATEREQ();
+
+
+ break;
+ case 236 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1861: SMALLER_SMALLER
+ this.mSMALLER_SMALLER();
+
+
+ break;
+ case 237 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1877: GREATER_GREATER
+ this.mGREATER_GREATER();
+
+
+ break;
+ case 238 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1893: SLASH
+ this.mSLASH();
+
+
+ break;
+ case 239 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1899: SLASH_SLASH
+ this.mSLASH_SLASH();
+
+
+ break;
+ case 240 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1911: BANG
+ this.mBANG();
+
+
+ break;
+ case 241 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1916: DOT
+ this.mDOT();
+
+
+ break;
+ case 242 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1920: DOT_DOT
+ this.mDOT_DOT();
+
+
+ break;
+ case 243 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1928: COLON
+ this.mCOLON();
+
+
+ break;
+ case 244 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1934: COLON_COLON
+ this.mCOLON_COLON();
+
+
+ break;
+ case 245 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1946: EMPTY_CLOSE_TAG
+ this.mEMPTY_CLOSE_TAG();
+
+
+ break;
+ case 246 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1962: CLOSE_TAG
+ this.mCLOSE_TAG();
+
+
+ break;
+ case 247 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1972: SEMICOLON
+ this.mSEMICOLON();
+
+
+ break;
+ case 248 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1982: VBAR
+ this.mVBAR();
+
+
+ break;
+ case 249 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:1987: PRAGMA_START
+ this.mPRAGMA_START();
+
+
+ break;
+ case 250 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:2000: PRAGMA_END
+ this.mPRAGMA_END();
+
+
+ break;
+ case 251 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:2011: XML_COMMENT_START
+ this.mXML_COMMENT_START();
+
+
+ break;
+ case 252 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:2029: XML_COMMENT_END
+ this.mXML_COMMENT_END();
+
+
+ break;
+ case 253 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:2045: PI_START
+ this.mPI_START();
+
+
+ break;
+ case 254 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:2054: PI_END
+ this.mPI_END();
+
+
+ break;
+ case 255 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:2061: ATTR_SIGN
+ this.mATTR_SIGN();
+
+
+ break;
+ case 256 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:2071: Q
+ this.mQ();
+
+
+ break;
+ case 257 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:2073: CHARREF_DEC
+ this.mCHARREF_DEC();
+
+
+ break;
+ case 258 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:2085: CHARREF_HEX
+ this.mCHARREF_HEX();
+
+
+ break;
+ case 259 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:2097: APOS
+ this.mAPOS();
+
+
+ break;
+ case 260 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:2102: QUOT
+ this.mQUOT();
+
+
+ break;
+ case 261 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:2107: L_NCName
+ this.mL_NCName();
+
+
+ break;
+ case 262 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:2116: S
+ this.mS();
+
+
+ break;
+ case 263 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:2118: L_Pragma
+ this.mL_Pragma();
+
+
+ break;
+ case 264 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:2127: L_DirCommentConstructor
+ this.mL_DirCommentConstructor();
+
+
+ break;
+ case 265 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:2151: L_DirPIConstructor
+ this.mL_DirPIConstructor();
+
+
+ break;
+ case 266 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:2170: L_IntegerLiteral
+ this.mL_IntegerLiteral();
+
+
+ break;
+ case 267 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:2187: L_DecimalLiteral
+ this.mL_DecimalLiteral();
+
+
+ break;
+ case 268 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:2204: L_DoubleLiteral
+ this.mL_DoubleLiteral();
+
+
+ break;
+ case 269 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:2220: L_Comment
+ this.mL_Comment();
+
+
+ break;
+ case 270 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryLexer.g:1:2230: L_AnyChar
+ this.mL_AnyChar();
+
+
+ break;
+
+ }
+
+ }
+
+}, true); // important to pass true to overwrite default implementations
+
+org.antlr.lang.augmentObject(XQueryLexer, {
+ DFA19_eotS:
+ "\u0001\uffff\u0019\u0042\u0001\u0097\u0001\u009a\u0002\uffff\u0001"+
+ "\u009e\u0004\uffff\u0001\u00a5\u0001\u00a7\u0001\uffff\u0001\u00aa\u0001"+
+ "\u00ac\u0001\uffff\u0001\u00af\u0002\uffff\u0001\u00b3\u0001\u00b9\u0001"+
+ "\u00bc\u0001\u00bf\u0001\u00c1\u0002\uffff\u0001\u00c5\u0004\uffff\u0001"+
+ "\u00c9\u0001\uffff\u0001\u0042\u0001\u00d1\u0001\u00d3\u0005\u0042\u0001"+
+ "\uffff\u0002\u0042\u0001\u00dc\u000b\u0042\u0001\u00f8\u0007\u0042\u0001"+
+ "\u0107\u0001\u0042\u0001\u010a\u0001\u0042\u0001\u010c\u0001\u0042\u0001"+
+ "\u0113\u0001\u0114\u0002\u0042\u0001\u011c\u0001\u011d\u0004\u0042\u0001"+
+ "\u0125\u0001\u0129\u0001\u0042\u0001\u012b\u0001\u0042\u0001\u012e\u0001"+
+ "\u0042\u0001\u0131\u0011\u0042\u0001\u014f\u0012\u0042\u0003\uffff\u0001"+
+ "\u0169\u0012\uffff\u0001\u016c\u000c\uffff\u0001\u016e\u0009\uffff\u0001"+
+ "\u0170\u0007\uffff\u0001\u00c9\u0001\u0170\u0001\uffff\u0001\u0042\u0001"+
+ "\u0173\u0001\u0174\u0001\u0042\u0001\uffff\u0001\u0042\u0001\uffff\u0001"+
+ "\u0042\u0001\u0179\u0003\u0042\u0001\u017d\u0002\u0042\u0001\uffff\u000f"+
+ "\u0042\u0001\u0192\u0009\u0042\u0001\u019c\u0001\u0042\u0001\uffff\u0006"+
+ "\u0042\u0001\u01a5\u0007\u0042\u0001\uffff\u0002\u0042\u0001\uffff\u0001"+
+ "\u0042\u0001\uffff\u0006\u0042\u0002\uffff\u0001\u0042\u0001\u01b9\u0003"+
+ "\u0042\u0001\u01bd\u0001\u0042\u0002\uffff\u0002\u0042\u0001\u01c3\u0004"+
+ "\u0042\u0001\uffff\u0002\u0042\u0001\u01cb\u0001\uffff\u0001\u0042\u0001"+
+ "\uffff\u0002\u0042\u0001\uffff\u0002\u0042\u0001\uffff\u001d\u0042\u0001"+
+ "\uffff\u0001\u0042\u0001\u01f7\u0013\u0042\u0001\u020e\u0001\u0042\u0001"+
+ "\u0210\u0001\u0042\u0008\uffff\u0001\u0170\u0001\u0042\u0002\uffff\u0004"+
+ "\u0042\u0001\uffff\u0002\u0042\u0001\u021a\u0001\uffff\u0004\u0042\u0001"+
+ "\u021f\u0001\u0221\u0007\u0042\u0001\u022d\u0006\u0042\u0001\uffff\u0006"+
+ "\u0042\u0001\u023a\u0002\u0042\u0001\uffff\u0005\u0042\u0001\u0242\u0002"+
+ "\u0042\u0001\uffff\u0002\u0042\u0001\u0248\u0003\u0042\u0001\u024c\u0002"+
+ "\u0042\u0001\u024f\u0005\u0042\u0001\u0257\u0002\u0042\u0001\u025a\u0001"+
+ "\uffff\u0001\u025b\u0002\u0042\u0001\uffff\u0002\u0042\u0001\u0260\u0002"+
+ "\u0042\u0001\uffff\u0001\u0263\u0002\u0042\u0001\u0266\u0002\u0042\u0001"+
+ "\u026a\u0001\uffff\u0001\u026c\u0003\u0042\u0001\u0270\u0011\u0042\u0001"+
+ "\u0283\u0001\u0042\u0001\u0285\u0002\u0042\u0001\u0288\u0002\u0042\u0001"+
+ "\u028b\u0002\u0042\u0001\u028e\u0005\u0042\u0001\u0294\u0001\u0295\u0002"+
+ "\u0042\u0001\uffff\u0001\u0299\u000d\u0042\u0001\u02a7\u0002\u0042\u0001"+
+ "\u02ab\u0002\u0042\u0001\u02af\u0001\u0042\u0001\uffff\u0001\u0042\u0001"+
+ "\uffff\u0001\u02b2\u0001\u02b3\u0003\u0042\u0001\u02b8\u0001\u0042\u0001"+
+ "\u02ba\u0001\u0042\u0001\uffff\u0003\u0042\u0001\u02bf\u0001\uffff\u0001"+
+ "\u0042\u0001\uffff\u0001\u02c1\u0001\u02c2\u0001\u02c3\u0008\u0042\u0001"+
+ "\uffff\u0001\u02cd\u0005\u0042\u0001\u02d3\u0005\u0042\u0001\uffff\u0001"+
+ "\u02da\u0002\u0042\u0001\u02dd\u0003\u0042\u0001\uffff\u0004\u0042\u0001"+
+ "\u02e5\u0001\uffff\u0001\u0042\u0001\u02e7\u0001\u02e8\u0001\uffff\u0001"+
+ "\u0042\u0001\u02eb\u0001\uffff\u0007\u0042\u0001\uffff\u0001\u0042\u0001"+
+ "\u02f4\u0002\uffff\u0001\u0042\u0001\u02f6\u0002\u0042\u0001\uffff\u0002"+
+ "\u0042\u0001\uffff\u0002\u0042\u0001\uffff\u0002\u0042\u0001\u02ff\u0001"+
+ "\uffff\u0001\u0042\u0001\uffff\u0001\u0042\u0001\u0304\u0001\u0042\u0001"+
+ "\uffff\u000e\u0042\u0001\u0314\u0001\u0042\u0001\u0316\u0001\u0042\u0001"+
+ "\uffff\u0001\u0042\u0001\uffff\u0001\u0042\u0001\u031a\u0001\uffff\u0002"+
+ "\u0042\u0001\uffff\u0002\u0042\u0001\uffff\u0005\u0042\u0002\uffff\u0001"+
+ "\u0042\u0001\u0325\u0001\u0042\u0001\uffff\u0001\u0042\u0001\u0328\u0001"+
+ "\u0329\u0004\u0042\u0001\u032e\u0001\u0042\u0001\u0330\u0002\u0042\u0001"+
+ "\u0333\u0001\uffff\u0001\u0334\u0002\u0042\u0001\uffff\u0002\u0042\u0001"+
+ "\u0339\u0001\uffff\u0002\u0042\u0003\uffff\u0003\u0042\u0001\uffff\u0001"+
+ "\u0042\u0001\uffff\u0001\u0340\u0002\u0042\u0001\u0343\u0001\uffff\u0001"+
+ "\u0042\u0003\uffff\u0009\u0042\u0001\uffff\u0004\u0042\u0001\u0353\u0001"+
+ "\uffff\u0006\u0042\u0001\uffff\u0001\u0042\u0001\u035b\u0001\uffff\u0001"+
+ "\u035c\u0006\u0042\u0001\uffff\u0001\u0042\u0002\uffff\u0002\u0042\u0001"+
+ "\uffff\u0001\u0366\u0002\u0042\u0001\u0369\u0004\u0042\u0001\uffff\u0001"+
+ "\u0042\u0001\uffff\u0001\u036f\u0001\u0042\u0001\u0371\u0001\u0372\u0004"+
+ "\u0042\u0001\uffff\u0001\u0042\u0001\u0378\u0002\u0042\u0001\uffff\u0001"+
+ "\u037b\u0001\u037c\u0001\u037d\u0009\u0042\u0001\u0387\u0001\u0042\u0001"+
+ "\u0389\u0001\uffff\u0001\u038a\u0001\uffff\u0002\u0042\u0001\u038e\u0001"+
+ "\uffff\u0003\u0042\u0001\u0392\u0001\u0394\u0001\u0395\u0004\u0042\u0001"+
+ "\uffff\u0002\u0042\u0002\uffff\u0001\u039c\u0003\u0042\u0001\uffff\u0001"+
+ "\u0042\u0001\uffff\u0002\u0042\u0002\uffff\u0001\u03a3\u0002\u0042\u0001"+
+ "\u03a6\u0001\uffff\u0001\u03a7\u0005\u0042\u0001\uffff\u0002\u0042\u0001"+
+ "\uffff\u0003\u0042\u0001\u03b2\u0002\u0042\u0001\u03b5\u0001\u03b6\u0003"+
+ "\u0042\u0001\u03ba\u0001\u0042\u0001\u03bc\u0001\u0042\u0001\uffff\u0004"+
+ "\u0042\u0001\u03c3\u0002\u0042\u0002\uffff\u0001\u0042\u0001\u03c7\u0001"+
+ "\u0042\u0001\u03c9\u0001\u03ca\u0004\u0042\u0001\uffff\u0001\u03cf\u0001"+
+ "\u0042\u0001\uffff\u0005\u0042\u0001\uffff\u0001\u0042\u0002\uffff\u0005"+
+ "\u0042\u0001\uffff\u0001\u03dc\u0001\u0042\u0003\uffff\u0006\u0042\u0001"+
+ "\u03e4\u0002\u0042\u0001\uffff\u0001\u0042\u0002\uffff\u0003\u0042\u0001"+
+ "\uffff\u0002\u0042\u0001\u03ee\u0001\uffff\u0001\u0042\u0002\uffff\u0001"+
+ "\u03f0\u0005\u0042\u0001\uffff\u0005\u0042\u0001\u03fb\u0001\uffff\u0001"+
+ "\u03fc\u0001\u0042\u0002\uffff\u0001\u0042\u0001\u0400\u0002\u0042\u0001"+
+ "\u0403\u0001\u0404\u0001\u0042\u0001\u0406\u0002\u0042\u0001\uffff\u0002"+
+ "\u0042\u0002\uffff\u0001\u040b\u0001\u040c\u0001\u0042\u0001\uffff\u0001"+
+ "\u0042\u0001\uffff\u0004\u0042\u0001\u0414\u0001\u0416\u0001\uffff\u0001"+
+ "\u0042\u0001\u0418\u0001\u0419\u0001\uffff\u0001\u0042\u0002\uffff\u0001"+
+ "\u041b\u0001\u0042\u0001\u041d\u0001\u0042\u0001\uffff\u0001\u041f\u0003"+
+ "\u0042\u0001\u0423\u0001\u0424\u0006\u0042\u0001\uffff\u0001\u042b\u0003"+
+ "\u0042\u0001\u042f\u0001\u0430\u0001\u0042\u0001\uffff\u0001\u0042\u0001"+
+ "\u0433\u0001\u0042\u0001\u0435\u0004\u0042\u0001\u043b\u0001\uffff\u0001"+
+ "\u0042\u0001\uffff\u0004\u0042\u0001\u0441\u0001\u0042\u0001\u0443\u0001"+
+ "\u0042\u0001\u0445\u0001\u0446\u0002\uffff\u0003\u0042\u0001\uffff\u0001"+
+ "\u044a\u0001\u044b\u0002\uffff\u0001\u0042\u0001\uffff\u0001\u044d\u0003"+
+ "\u0042\u0002\uffff\u0006\u0042\u0001\u0457\u0001\uffff\u0001\u0042\u0001"+
+ "\uffff\u0001\u0042\u0002\uffff\u0001\u045b\u0001\uffff\u0001\u045c\u0001"+
+ "\uffff\u0001\u0042\u0001\uffff\u0001\u0042\u0001\u045f\u0001\u0460\u0002"+
+ "\uffff\u0001\u0461\u0001\u0042\u0001\u0464\u0002\u0042\u0001\u0467\u0001"+
+ "\uffff\u0001\u0469\u0001\u0042\u0001\u046c\u0002\uffff\u0001\u0042\u0001"+
+ "\u046e\u0001\uffff\u0001\u0042\u0001\uffff\u0001\u0470\u0002\u0042\u0001"+
+ "\u0473\u0001\u0474\u0001\uffff\u0001\u0475\u0002\u0042\u0001\u0478\u0001"+
+ "\u0042\u0001\uffff\u0001\u047a\u0001\uffff\u0001\u047b\u0002\uffff\u0001"+
+ "\u047c\u0002\u0042\u0002\uffff\u0001\u0042\u0001\uffff\u0001\u0480\u0001"+
+ "\u0042\u0001\u0482\u0003\u0042\u0001\u0487\u0001\u0488\u0001\u0489\u0001"+
+ "\uffff\u0003\u0042\u0002\uffff\u0002\u0042\u0003\uffff\u0001\u048f\u0001"+
+ "\u0042\u0001\uffff\u0001\u0491\u0001\u0042\u0001\uffff\u0001\u0493\u0001"+
+ "\uffff\u0002\u0042\u0001\uffff\u0001\u0042\u0001\uffff\u0001\u0042\u0001"+
+ "\uffff\u0002\u0042\u0003\uffff\u0002\u0042\u0001\uffff\u0001\u049c\u0003"+
+ "\uffff\u0001\u049d\u0002\u0042\u0001\uffff\u0001\u0042\u0001\uffff\u0004"+
+ "\u0042\u0003\uffff\u0004\u0042\u0001\u04a9\u0001\uffff\u0001\u0042\u0001"+
+ "\uffff\u0001\u04ab\u0001\uffff\u0008\u0042\u0002\uffff\u0002\u0042\u0001"+
+ "\u04b6\u0008\u0042\u0001\uffff\u0001\u0042\u0001\uffff\u0006\u0042\u0001"+
+ "\u04c6\u0001\u04c7\u0002\u0042\u0001\uffff\u0004\u0042\u0001\u04ce\u000a"+
+ "\u0042\u0002\uffff\u0001\u0042\u0001\u04da\u0001\u0042\u0001\u04dc\u0002"+
+ "\u0042\u0001\uffff\u0001\u04df\u0002\u0042\u0001\u04e2\u0005\u0042\u0001"+
+ "\u04e8\u0001\u0042\u0001\uffff\u0001\u04ea\u0001\uffff\u0002\u0042\u0001"+
+ "\uffff\u0002\u0042\u0001\uffff\u0003\u0042\u0001\u04f2\u0001\u0042\u0001"+
+ "\uffff\u0001\u04f4\u0001\uffff\u0007\u0042\u0001\uffff\u0001\u04fc\u0001"+
+ "\uffff\u0001\u04fd\u0001\u0042\u0001\u04ff\u0001\u0042\u0001\u0501\u0001"+
+ "\u0502\u0001\u0042\u0002\uffff\u0001\u0504\u0001\uffff\u0001\u0505\u0002"+
+ "\uffff\u0001\u0042\u0002\uffff\u0003\u0042\u0001\u050a\u0001\uffff",
+ DFA19_eofS:
+ "\u050b\uffff",
+ DFA19_minS:
+ "\u0001\u0000\u0001\u0066\u0002\u0061\u0001\u0065\u0001\u006c\u0001"+
+ "\u0069\u0001\u0065\u0001\u0064\u0001\u0061\u0001\u0069\u0001\u0061\u0001"+
+ "\u0073\u0001\u0062\u0002\u0061\u0002\u0065\u0001\u006e\u0001\u0061\u0001"+
+ "\u0065\u0001\u0071\u0001\u0061\u0002\u0065\u0001\u0075\u0001\u007c\u0001"+
+ "\u0023\u0002\uffff\u0001\u007c\u0004\uffff\u0001\u003a\u0001\u003d\u0001"+
+ "\uffff\u0001\u0029\u0001\u0023\u0001\uffff\u0001\u003e\u0002\uffff\u0001"+
+ "\u002d\u0001\u0021\u0001\u003d\u0001\u002f\u0001\u002e\u0002\uffff\u0001"+
+ "\u002d\u0004\uffff\u0001\u002e\u0001\uffff\u0001\u0063\u0002\u002d\u0001"+
+ "\u0072\u0001\u006c\u0001\u0074\u0001\u006f\u0001\u0070\u0001\uffff\u0001"+
+ "\u0073\u0001\u0075\u0001\u002d\u0001\u0066\u0001\u0065\u0001\u0073\u0001"+
+ "\u0065\u0001\u006c\u0001\u0063\u0001\u0061\u0001\u0063\u0001\u0065\u0001"+
+ "\u0070\u0001\u0063\u0001\u002d\u0001\u0065\u0001\u0061\u0001\u006c\u0001"+
+ "\u006e\u0001\u0072\u0001\u006f\u0002\u002d\u0001\u0065\u0001\u002d\u0001"+
+ "\u0069\u0001\u002d\u0001\u0070\u0002\u002d\u0001\u0065\u0001\u006e\u0002"+
+ "\u002d\u0001\u006f\u0001\u0064\u0001\u006e\u0001\u006d\u0002\u002d\u0001"+
+ "\u006f\u0001\u002d\u0001\u0074\u0001\u002d\u0001\u006a\u0001\u002d\u0001"+
+ "\u0063\u0001\u0072\u0001\u0065\u0001\u0072\u0001\u0073\u0001\u0072\u0001"+
+ "\u0061\u0001\u006d\u0001\u0068\u0001\u006c\u0001\u006d\u0003\u0069\u0001"+
+ "\u006c\u0001\u0078\u0001\u0065\u0001\u002d\u0001\u0065\u0001\u0070\u0002"+
+ "\u006d\u0001\u0069\u0001\u0064\u0001\u0069\u0001\u006c\u0001\u0072\u0001"+
+ "\u0065\u0001\u006c\u0001\u0069\u0001\u0072\u0001\u0075\u0001\u004e\u0001"+
+ "\u0072\u0001\u0079\u0001\u006f\u0003\uffff\u0001\u0009\u0012\uffff\u0001"+
+ "\u0078\u000b\uffff\u0001\u002d\u0001\u0009\u0009\uffff\u0001\u0030\u0007"+
+ "\uffff\u0001\u002e\u0001\u0030\u0001\uffff\u0001\u0065\u0002\u002d\u0001"+
+ "\u0065\u0001\uffff\u0001\u0072\u0001\uffff\u0001\u0061\u0001\u002d\u0002"+
+ "\u0065\u0001\u0073\u0001\u002d\u0001\u0065\u0001\u006e\u0001\uffff\u0001"+
+ "\u006f\u0001\u0061\u0001\u0065\u0001\u0063\u0001\u006c\u0001\u0063\u0001"+
+ "\u006c\u0001\u006d\u0001\u0073\u0001\u0079\u0001\u006e\u0001\u0069\u0001"+
+ "\u0061\u0001\u0063\u0001\u0065\u0001\u002d\u0001\u0069\u0001\u0063\u0001"+
+ "\u0066\u0001\u0074\u0001\u0075\u0001\u006d\u0001\u0065\u0001\u0074\u0001"+
+ "\u006f\u0001\u002d\u0001\u0069\u0001\uffff\u0001\u0072\u0002\u0065\u0001"+
+ "\u0063\u0001\u0074\u0001\u006c\u0001\u002d\u0001\u0063\u0001\u0073\u0001"+
+ "\u006d\u0001\u006f\u0001\u006e\u0001\u006f\u0001\u0072\u0001\uffff\u0001"+
+ "\u0061\u0001\u0075\u0001\uffff\u0001\u0076\u0001\uffff\u0001\u006f\u0003"+
+ "\u0065\u0001\u0069\u0001\u0065\u0002\uffff\u0001\u006d\u0001\u002d\u0001"+
+ "\u0074\u0001\u0067\u0001\u0073\u0001\u002d\u0001\u0065\u0002\uffff\u0001"+
+ "\u0065\u0001\u0070\u0001\u002d\u0001\u0074\u0001\u0075\u0001\u0065\u0001"+
+ "\u0074\u0001\uffff\u0001\u0069\u0001\u0065\u0001\u002d\u0001\uffff\u0001"+
+ "\u006e\u0001\uffff\u0001\u0069\u0001\u0065\u0001\uffff\u0001\u0065\u0001"+
+ "\u0079\u0001\uffff\u0001\u0075\u0001\u0061\u0001\u0074\u0002\u0063\u0001"+
+ "\u002d\u0001\u0069\u0001\u0061\u0001\u0069\u0001\u0062\u0001\u006d\u0001"+
+ "\u0070\u0001\u0069\u0002\u0065\u0001\u0072\u0001\u0066\u0001\u0073\u0001"+
+ "\u0065\u0001\u0064\u0001\u0074\u0001\u0070\u0001\u0075\u0001\u0061\u0001"+
+ "\u006c\u0002\u0061\u0001\u0074\u0001\u006e\u0001\uffff\u0001\u0061\u0001"+
+ "\u002d\u0001\u0065\u0001\u0062\u0001\u0065\u0001\u006f\u0001\u0072\u0001"+
+ "\u0061\u0001\u0065\u0001\u006e\u0002\u0069\u0001\u0073\u0001\u006e\u0001"+
+ "\u006c\u0001\u0064\u0001\u0068\u0001\u0064\u0001\u0067\u0001\u0064\u0001"+
+ "\u0065\u0001\u002d\u0001\u006f\u0001\u002d\u0001\u0074\u0004\uffff\u0001"+
+ "\u002d\u0003\uffff\u0001\u0030\u0001\u0073\u0002\uffff\u0001\u006e\u0001"+
+ "\u0069\u0001\u0079\u0001\u0077\u0001\uffff\u0001\u0072\u0001\u006e\u0001"+
+ "\u002d\u0001\uffff\u0001\u002d\u0001\u0064\u0001\u0072\u0001\u006b\u0002"+
+ "\u002d\u0001\u0068\u0001\u0064\u0001\u006b\u0001\u0061\u0001\u0065\u0001"+
+ "\u0074\u0001\u0061\u0001\u002d\u0001\u0074\u0001\u0061\u0001\u006d\u0001"+
+ "\u0075\u0001\u0065\u0001\u0074\u0001\uffff\u0001\u0074\u0001\u0072\u0001"+
+ "\u0065\u0001\u0061\u0001\u006d\u0001\u0065\u0001\u002d\u0001\u0079\u0001"+
+ "\u0064\u0001\uffff\u0001\u0072\u0001\u0079\u0001\u0070\u0001\u0072\u0001"+
+ "\u0074\u0001\u002d\u0001\u006f\u0001\u0061\u0001\uffff\u0002\u0074\u0001"+
+ "\u002d\u0001\u0070\u0001\u0064\u0001\u0074\u0001\u002d\u0001\u0074\u0001"+
+ "\u0070\u0001\u002d\u0002\u0072\u0001\u0061\u0001\u006e\u0001\u0067\u0001"+
+ "\u002d\u0001\u006e\u0001\u0078\u0001\u002d\u0001\uffff\u0001\u002d\u0001"+
+ "\u0075\u0001\u0074\u0001\uffff\u0001\u006c\u0001\u0072\u0001\u002d\u0001"+
+ "\u006c\u0001\u0066\u0001\uffff\u0001\u002d\u0002\u0073\u0001\u002d\u0001"+
+ "\u006e\u0001\u0072\u0001\u002d\u0001\uffff\u0001\u002d\u0001\u006f\u0001"+
+ "\u0072\u0001\u0063\u0001\u002d\u0001\u0072\u0001\u006e\u0001\u0067\u0003"+
+ "\u0065\u0001\u0069\u0002\u0065\u0001\u006d\u0001\u0074\u0001\u0073\u0002"+
+ "\u0063\u0001\u006c\u0001\u0074\u0001\u006d\u0001\u002d\u0001\u0073\u0001"+
+ "\u002d\u0001\u006d\u0001\u0065\u0001\u002d\u0001\u0069\u0001\u0065\u0001"+
+ "\u002d\u0001\u0069\u0001\u0063\u0001\u002d\u0001\u0072\u0001\u006d\u0001"+
+ "\u0061\u0001\u006c\u0001\u0074\u0002\u002d\u0001\u0061\u0001\u0074\u0001"+
+ "\uffff\u0001\u002d\u0001\u006c\u0001\u0073\u0001\u006e\u0001\u0075\u0001"+
+ "\u0064\u0001\u0074\u0001\u0072\u0001\u0067\u0001\u0064\u0001\u0065\u0001"+
+ "\u0061\u0001\u0069\u0001\u0065\u0001\u002d\u0001\u0065\u0001\u006f\u0001"+
+ "\u002d\u0001\u0063\u0001\u0068\u0001\u002d\u0001\u0072\u0001\uffff\u0001"+
+ "\u002d\u0001\uffff\u0001\u002d\u0001\u0000\u0001\u0074\u0001\u0064\u0001"+
+ "\u0062\u0001\u002d\u0001\u0069\u0001\u002d\u0001\u0064\u0001\uffff\u0001"+
+ "\u0075\u0001\u0061\u0001\u0065\u0001\u002d\u0001\uffff\u0001\u0062\u0001"+
+ "\uffff\u0003\u002d\u0001\u0074\u0001\u0063\u0001\u006e\u0001\u0072\u0001"+
+ "\u006e\u0001\u0069\u0002\u006e\u0001\uffff\u0001\u002d\u0001\u0072\u0001"+
+ "\u0061\u0001\u006c\u0001\u006e\u0001\u0065\u0001\u002d\u0001\u0069\u0001"+
+ "\u0072\u0001\u006e\u0001\u0065\u0001\u006e\u0001\uffff\u0001\u002d\u0001"+
+ "\u0069\u0001\u0065\u0001\u002d\u0001\u0074\u0001\u006e\u0001\u006c\u0001"+
+ "\uffff\u0001\u0077\u0001\u0063\u0001\u0067\u0001\u0069\u0001\u002d\u0001"+
+ "\uffff\u0001\u0074\u0002\u002d\u0001\uffff\u0001\u0065\u0001\u002d\u0001"+
+ "\uffff\u0001\u0074\u0001\u0069\u0001\u006e\u0001\u0074\u0002\u0073\u0001"+
+ "\u0072\u0001\uffff\u0001\u0069\u0001\u002d\u0002\uffff\u0001\u0061\u0001"+
+ "\u002d\u0001\u0073\u0001\u0063\u0001\uffff\u0001\u0065\u0001\u0079\u0001"+
+ "\uffff\u0001\u002d\u0001\u0070\u0001\uffff\u0001\u0068\u0001\u0065\u0001"+
+ "\u002d\u0001\uffff\u0001\u0069\u0001\uffff\u0001\u006e\u0001\u002d\u0001"+
+ "\u0074\u0001\uffff\u0001\u0073\u0001\u0074\u0002\u0072\u0001\u0064\u0001"+
+ "\u0072\u0001\u006f\u0001\u0073\u0001\u006e\u0002\u0069\u0001\u0065\u0002"+
+ "\u0074\u0001\u002d\u0001\u0065\u0001\u002d\u0001\u0069\u0001\uffff\u0001"+
+ "\u0066\u0001\uffff\u0001\u0061\u0001\u002d\u0001\uffff\u0001\u0074\u0001"+
+ "\u006e\u0001\uffff\u0001\u006e\u0001\u0068\u0001\uffff\u0001\u006e\u0001"+
+ "\u0065\u0001\u0063\u0002\u0069\u0002\uffff\u0001\u0075\u0001\u002d\u0001"+
+ "\u0077\u0001\uffff\u0001\u0069\u0002\u002d\u0002\u0065\u0001\u0069\u0001"+
+ "\u0063\u0001\u002d\u0001\u0061\u0001\u002d\u0001\u0062\u0001\u006f\u0001"+
+ "\u002d\u0001\uffff\u0001\u002d\u0001\u0077\u0001\u0075\u0001\uffff\u0001"+
+ "\u0061\u0001\u0074\u0001\u002d\u0001\uffff\u0001\u0079\u0001\u0064\u0003"+
+ "\uffff\u0001\u006f\u0001\u0069\u0001\u0075\u0001\uffff\u0001\u006e\u0001"+
+ "\uffff\u0001\u002d\u0002\u0072\u0001\u002d\u0001\uffff\u0001\u006c\u0003"+
+ "\uffff\u0001\u0069\u0002\u0074\u0001\u0061\u0002\u0074\u0001\u006e\u0001"+
+ "\u0075\u0001\u0061\u0001\uffff\u0001\u0065\u0001\u006c\u0001\u0074\u0001"+
+ "\u0064\u0001\u002d\u0001\uffff\u0001\u0074\u0001\u0065\u0001\u0063\u0001"+
+ "\u006e\u0001\u0074\u0001\u0073\u0001\uffff\u0001\u006e\u0001\u002d\u0001"+
+ "\uffff\u0001\u002d\u0001\u0061\u0001\u0079\u0001\u0069\u0001\u0068\u0001"+
+ "\u006e\u0001\u006f\u0001\uffff\u0001\u0069\u0002\uffff\u0001\u0073\u0001"+
+ "\u006e\u0001\uffff\u0001\u002d\u0001\u0074\u0001\u0063\u0001\u002d\u0001"+
+ "\u0069\u0001\u0065\u0001\u0069\u0001\u0074\u0001\uffff\u0001\u0067\u0001"+
+ "\uffff\u0001\u002d\u0001\u0061\u0002\u002d\u0001\u0073\u0001\u0061\u0001"+
+ "\u0065\u0001\u0073\u0001\uffff\u0001\u0074\u0001\u002d\u0001\u0064\u0001"+
+ "\u006e\u0001\uffff\u0003\u002d\u0001\u0061\u0001\u006e\u0001\u0069\u0001"+
+ "\u0076\u0001\u0075\u0001\u0073\u0001\u0074\u0001\u006c\u0001\u006f\u0001"+
+ "\u002d\u0001\u0075\u0001\u002d\u0001\uffff\u0001\u002d\u0001\uffff\u0001"+
+ "\u006e\u0001\u0069\u0001\u002d\u0001\uffff\u0001\u0069\u0001\u0063\u0001"+
+ "\u0067\u0003\u002d\u0001\u0065\u0001\u0064\u0001\u006f\u0001\u0072\u0001"+
+ "\uffff\u0001\u0069\u0001\u006e\u0002\uffff\u0001\u002d\u0001\u0072\u0001"+
+ "\u006e\u0001\u0061\u0001\uffff\u0001\u0074\u0001\uffff\u0001\u006c\u0001"+
+ "\u006e\u0002\uffff\u0001\u002d\u0001\u0074\u0001\u0072\u0001\u002d\u0001"+
+ "\uffff\u0001\u002d\u0001\u0069\u0001\u0072\u0001\u006e\u0001\u0074\u0001"+
+ "\u0067\u0001\uffff\u0001\u0069\u0001\u0079\u0001\uffff\u0001\u0065\u0001"+
+ "\u006f\u0001\u0069\u0001\u002d\u0001\u0063\u0001\u0069\u0002\u002d\u0001"+
+ "\u0073\u0001\u0065\u0001\u006d\u0003\u002d\u0001\u0061\u0001\uffff\u0001"+
+ "\u0069\u0001\u006e\u0001\u0065\u0001\u0074\u0001\u002d\u0001\u0065\u0001"+
+ "\u0067\u0002\uffff\u0001\u006c\u0001\u002d\u0001\u006e\u0002\u002d\u0001"+
+ "\u006e\u0001\u006f\u0001\u0074\u0001\u0067\u0001\uffff\u0001\u002d\u0001"+
+ "\u0065\u0001\uffff\u0001\u0074\u0001\u0063\u0001\u0074\u0001\u0079\u0001"+
+ "\u0065\u0001\uffff\u0001\u0073\u0002\uffff\u0001\u0069\u0001\u0063\u0001"+
+ "\u0072\u0002\u0065\u0001\uffff\u0001\u002d\u0001\u0067\u0003\uffff\u0001"+
+ "\u0070\u0001\u002d\u0001\u006e\u0001\u0065\u0001\u0073\u0001\u0069\u0001"+
+ "\u002d\u0001\u006c\u0001\u006e\u0001\uffff\u0001\u0072\u0002\uffff\u0001"+
+ "\u0067\u0001\u0065\u0001\u0061\u0001\uffff\u0001\u0076\u0001\u0065\u0001"+
+ "\u002d\u0001\uffff\u0001\u006e\u0002\uffff\u0001\u002d\u0001\u0061\u0001"+
+ "\u006e\u0001\u0075\u0001\u0074\u0001\u0067\u0001\uffff\u0001\u0065\u0001"+
+ "\u0067\u0001\u0073\u0002\u0065\u0001\u002d\u0001\uffff\u0001\u002d\u0001"+
+ "\u0064\u0002\uffff\u0001\u0067\u0001\u002d\u0001\u0067\u0001\u0065\u0004"+
+ "\u002d\u0001\u006e\u0001\u006f\u0001\uffff\u0001\u0074\u0001\u006e\u0002"+
+ "\uffff\u0002\u002d\u0001\u0065\u0001\uffff\u0001\u0066\u0001\uffff\u0002"+
+ "\u006e\u0001\u0063\u0001\u0074\u0002\u002d\u0001\uffff\u0001\u0071\u0002"+
+ "\u002d\u0001\uffff\u0001\u0067\u0002\uffff\u0001\u002d\u0001\u006e\u0002"+
+ "\u002d\u0001\uffff\u0001\u002d\u0001\u0069\u0001\u0074\u0001\u0079\u0002"+
+ "\u002d\u0001\u0065\u0001\u0067\u0001\u0065\u0001\u0069\u0001\u0072\u0001"+
+ "\u006d\u0001\uffff\u0001\u002d\u0001\u0068\u0001\u0073\u0001\u0067\u0002"+
+ "\u002d\u0001\u006e\u0001\uffff\u0001\u0065\u0001\u002d\u0001\u0065\u0001"+
+ "\u002d\u0001\u0073\u0001\u0074\u0001\u006c\u0001\u0065\u0001\u002d\u0001"+
+ "\uffff\u0001\u0067\u0001\uffff\u0001\u0074\u0002\u0073\u0001\u0063\u0001"+
+ "\u002d\u0001\u0064\u0001\u002d\u0001\u0065\u0002\u002d\u0002\uffff\u0001"+
+ "\u0073\u0001\u0069\u0001\u006f\u0001\uffff\u0002\u002d\u0002\uffff\u0001"+
+ "\u0073\u0001\uffff\u0001\u002d\u0001\u006e\u0001\u0069\u0001\u0074\u0002"+
+ "\uffff\u0001\u0073\u0001\u006f\u0001\u0065\u0001\u0074\u0001\u0067\u0001"+
+ "\u0073\u0001\u002d\u0001\uffff\u0001\u006e\u0001\uffff\u0001\u0075\u0002"+
+ "\uffff\u0001\u002d\u0001\uffff\u0001\u002d\u0001\uffff\u0001\u0073\u0001"+
+ "\uffff\u0001\u0076\u0002\u002d\u0002\uffff\u0001\u002d\u0001\u006e\u0001"+
+ "\u002d\u0001\u0074\u0001\u0076\u0001\u002d\u0001\uffff\u0001\u002d\u0001"+
+ "\u0065\u0001\u002d\u0002\uffff\u0001\u0067\u0001\u002d\u0001\uffff\u0001"+
+ "\u0064\u0001\uffff\u0001\u002d\u0001\u0074\u0001\u0065\u0002\u002d\u0001"+
+ "\uffff\u0001\u002d\u0001\u0069\u0001\u0068\u0001\u002d\u0001\u0068\u0001"+
+ "\uffff\u0001\u002d\u0001\uffff\u0001\u002d\u0002\uffff\u0001\u002d\u0001"+
+ "\u0074\u0001\u0072\u0002\uffff\u0001\u0070\u0001\uffff\u0001\u002d\u0001"+
+ "\u006f\u0001\u002d\u0001\u0070\u0001\u0072\u0001\u0070\u0003\u002d\u0001"+
+ "\uffff\u0001\u006f\u0001\u0065\u0001\u0073\u0002\uffff\u0002\u0065\u0003"+
+ "\uffff\u0001\u002d\u0001\u006e\u0001\uffff\u0001\u002d\u0001\u0065\u0001"+
+ "\uffff\u0001\u002d\u0001\uffff\u0001\u0070\u0001\u0073\u0001\uffff\u0001"+
+ "\u002d\u0001\uffff\u0001\u002d\u0001\uffff\u0001\u0072\u0001\u006d\u0003"+
+ "\uffff\u0001\u006f\u0001\u0069\u0001\uffff\u0001\u002d\u0003\uffff\u0002"+
+ "\u002d\u0001\u0061\u0001\uffff\u0001\u006e\u0001\uffff\u0001\u0061\u0001"+
+ "\u006d\u0001\u0061\u0001\u006f\u0003\uffff\u0001\u0064\u0001\u006e\u0001"+
+ "\u0069\u0001\u0070\u0001\u002d\u0001\uffff\u0001\u006f\u0001\uffff\u0001"+
+ "\u002d\u0001\uffff\u0001\u0061\u0004\u0069\u0001\u0065\u0001\u006e\u0001"+
+ "\u0070\u0002\uffff\u0001\u0073\u0001\u0063\u0001\u002d\u0001\u0063\u0001"+
+ "\u0061\u0002\u0072\u0001\u0065\u0001\u0063\u0001\u0062\u0001\u0061\u0001"+
+ "\uffff\u0001\u0064\u0001\uffff\u0001\u0072\u0001\u0062\u0001\u006e\u0001"+
+ "\u0074\u0001\u0062\u0001\u006e\u0002\u002d\u0002\u0065\u0001\uffff\u0001"+
+ "\u0065\u0001\u0074\u0001\u0061\u0002\u002d\u0001\u0065\u0001\u006c\u0001"+
+ "\u0072\u0001\u0065\u0001\u0061\u0001\u006c\u0001\u0073\u0001\u0065\u0001"+
+ "\u0075\u0001\u0074\u0002\uffff\u0001\u006c\u0001\u002d\u0001\u0073\u0001"+
+ "\u002d\u0001\u0074\u0001\u0073\u0001\uffff\u0001\u002d\u0001\u0069\u0001"+
+ "\u0061\u0001\u002d\u0001\u0074\u0001\u0069\u0001\u0074\u0001\u006d\u0001"+
+ "\u0074\u0001\u002d\u0001\u0066\u0001\uffff\u0001\u002d\u0001\uffff\u0001"+
+ "\u006f\u0001\u0065\u0001\uffff\u0001\u006e\u0001\u0074\u0001\uffff\u0001"+
+ "\u006f\u0001\u006e\u0001\u0072\u0001\u002d\u0001\u0065\u0001\uffff\u0001"+
+ "\u002d\u0001\uffff\u0001\u0072\u0001\u006c\u0001\u0067\u0001\u006f\u0001"+
+ "\u0072\u0001\u0067\u0001\u0075\u0001\uffff\u0001\u002d\u0001\uffff\u0001"+
+ "\u002d\u0001\u0066\u0001\u002d\u0001\u0072\u0002\u002d\u0001\u0063\u0002"+
+ "\uffff\u0001\u002d\u0001\uffff\u0001\u002d\u0002\uffff\u0001\u0074\u0002"+
+ "\uffff\u0001\u0069\u0001\u006f\u0001\u006e\u0001\u002d\u0001\uffff",
+ DFA19_maxS:
+ "\u0001\uffff\u0001\u0074\u0001\u0079\u0002\u006f\u0001\u0078\u0001"+
+ "\u0075\u0003\u0074\u0002\u006f\u0001\u0073\u0002\u0072\u0001\u0077\u0001"+
+ "\u0065\u0001\u0079\u0001\u0073\u0001\u0065\u0001\u006f\u0001\u0071\u0001"+
+ "\u0061\u0002\u0065\u0001\u0075\u0001\u007d\u0001\u003a\u0002\uffff\u0001"+
+ "\u007c\u0004\uffff\u0002\u003d\u0001\uffff\u0001\u0029\u0001\u0023\u0001"+
+ "\uffff\u0001\u003e\u0002\uffff\u0001\u002d\u0001\u003f\u0002\u003e\u0001"+
+ "\u0039\u0002\uffff\u0001\u007a\u0004\uffff\u0001\u0065\u0001\uffff\u0001"+
+ "\u0079\u0002\u007a\u0001\u0072\u0001\u006c\u0001\u0074\u0002\u0070\u0001"+
+ "\uffff\u0001\u0073\u0001\u0075\u0001\u007a\u0001\u0066\u0001\u0065\u0001"+
+ "\u0074\u0001\u0069\u0001\u0075\u0001\u0073\u0001\u0076\u0001\u0063\u0001"+
+ "\u0073\u0001\u0070\u0001\u0074\u0001\u007a\u0001\u0065\u0001\u0074\u0001"+
+ "\u0072\u0001\u006e\u0001\u0072\u0002\u006f\u0001\u007a\u0001\u006f\u0001"+
+ "\u007a\u0001\u0069\u0001\u007a\u0001\u0070\u0002\u007a\u0001\u0065\u0001"+
+ "\u0078\u0002\u007a\u0001\u0077\u0001\u0073\u0001\u006e\u0001\u006d\u0002"+
+ "\u007a\u0001\u006f\u0001\u007a\u0001\u0074\u0001\u007a\u0001\u006a\u0001"+
+ "\u007a\u0001\u0063\u0001\u0074\u0001\u006f\u0001\u0072\u0001\u0073\u0002"+
+ "\u0072\u0001\u0074\u0001\u006f\u0001\u006e\u0001\u006d\u0003\u0069\u0001"+
+ "\u0076\u0001\u0078\u0001\u0065\u0001\u007a\u0001\u0079\u0001\u0070\u0002"+
+ "\u006d\u0001\u006f\u0001\u0070\u0001\u0069\u0002\u0072\u0001\u0069\u0001"+
+ "\u0074\u0001\u0069\u0001\u0072\u0001\u0075\u0001\u004e\u0001\u0072\u0001"+
+ "\u0079\u0001\u006f\u0003\uffff\u0001\u007a\u0012\uffff\u0001\u0078\u000b"+
+ "\uffff\u0001\u002d\u0001\u007a\u0009\uffff\u0001\u0065\u0007\uffff\u0002"+
+ "\u0065\u0001\uffff\u0001\u0065\u0002\u007a\u0001\u0065\u0001\uffff\u0001"+
+ "\u0072\u0001\uffff\u0001\u0061\u0001\u007a\u0002\u0065\u0001\u0073\u0001"+
+ "\u007a\u0001\u0065\u0001\u006e\u0001\uffff\u0001\u006f\u0001\u0061\u0001"+
+ "\u0074\u0001\u0063\u0001\u006c\u0001\u0063\u0001\u006c\u0001\u006d\u0001"+
+ "\u0074\u0001\u0079\u0001\u006e\u0001\u006c\u0001\u0061\u0001\u0063\u0001"+
+ "\u0065\u0001\u007a\u0001\u0069\u0001\u0063\u0001\u0066\u0001\u0074\u0001"+
+ "\u0075\u0001\u006d\u0001\u0065\u0001\u0074\u0001\u006f\u0001\u007a\u0001"+
+ "\u0069\u0001\uffff\u0001\u0072\u0002\u0065\u0001\u0063\u0001\u0074\u0001"+
+ "\u006c\u0001\u007a\u0001\u0063\u0001\u0073\u0001\u006d\u0001\u006f\u0001"+
+ "\u006e\u0001\u006f\u0001\u0072\u0001\uffff\u0001\u0061\u0001\u0075\u0001"+
+ "\uffff\u0001\u0076\u0001\uffff\u0001\u006f\u0001\u0065\u0001\u0074\u0001"+
+ "\u006f\u0001\u0069\u0001\u0065\u0002\uffff\u0001\u006d\u0001\u007a\u0001"+
+ "\u0074\u0001\u0067\u0001\u0073\u0001\u007a\u0001\u0065\u0002\uffff\u0001"+
+ "\u0065\u0001\u0070\u0001\u007a\u0001\u0074\u0001\u0075\u0001\u0065\u0001"+
+ "\u0074\u0001\uffff\u0001\u0070\u0001\u0065\u0001\u007a\u0001\uffff\u0001"+
+ "\u006e\u0001\uffff\u0001\u0069\u0001\u0065\u0001\uffff\u0001\u0065\u0001"+
+ "\u0079\u0001\uffff\u0001\u0075\u0001\u0065\u0001\u0074\u0001\u0076\u0002"+
+ "\u0063\u0001\u0069\u0001\u0061\u0001\u0075\u0001\u0072\u0001\u006d\u0001"+
+ "\u0070\u0001\u0069\u0002\u0065\u0001\u0072\u0001\u0066\u0001\u0074\u0001"+
+ "\u0065\u0001\u0064\u0001\u0074\u0001\u0070\u0001\u0075\u0001\u0061\u0001"+
+ "\u006c\u0002\u0061\u0001\u0074\u0001\u0073\u0001\uffff\u0001\u0061\u0001"+
+ "\u007a\u0001\u0065\u0001\u0062\u0001\u0065\u0001\u0071\u0001\u0072\u0001"+
+ "\u0061\u0001\u0065\u0001\u006e\u0001\u0075\u0001\u0069\u0001\u0073\u0001"+
+ "\u0072\u0001\u006c\u0001\u0064\u0001\u0068\u0001\u0064\u0001\u0067\u0001"+
+ "\u0064\u0001\u0065\u0001\u007a\u0001\u006f\u0001\u007a\u0001\u0074\u0004"+
+ "\uffff\u0001\u002d\u0003\uffff\u0001\u0065\u0001\u0073\u0002\uffff\u0001"+
+ "\u006e\u0001\u0069\u0001\u0079\u0001\u0077\u0001\uffff\u0001\u0072\u0001"+
+ "\u006e\u0001\u007a\u0001\uffff\u0001\u002d\u0001\u0064\u0001\u0072\u0001"+
+ "\u006b\u0002\u007a\u0001\u0068\u0001\u0064\u0001\u006b\u0002\u0065\u0001"+
+ "\u0074\u0001\u0069\u0001\u007a\u0001\u0074\u0001\u0061\u0001\u006d\u0001"+
+ "\u0075\u0001\u0065\u0001\u0074\u0001\uffff\u0001\u0074\u0001\u0072\u0001"+
+ "\u0065\u0001\u0061\u0001\u006d\u0001\u0065\u0001\u007a\u0001\u0079\u0001"+
+ "\u0064\u0001\uffff\u0001\u0072\u0001\u0079\u0001\u0070\u0001\u0072\u0001"+
+ "\u0074\u0001\u007a\u0001\u006f\u0001\u0069\u0001\uffff\u0002\u0074\u0001"+
+ "\u007a\u0001\u0070\u0001\u0064\u0001\u0074\u0001\u007a\u0001\u0074\u0001"+
+ "\u0070\u0001\u007a\u0002\u0072\u0001\u0061\u0002\u0072\u0001\u007a\u0001"+
+ "\u006e\u0001\u0078\u0001\u007a\u0001\uffff\u0001\u007a\u0001\u0075\u0001"+
+ "\u0074\u0001\uffff\u0001\u006c\u0001\u0072\u0001\u007a\u0001\u006c\u0001"+
+ "\u0066\u0001\uffff\u0001\u007a\u0002\u0073\u0001\u007a\u0001\u006e\u0001"+
+ "\u0072\u0001\u007a\u0001\uffff\u0001\u007a\u0001\u006f\u0001\u0072\u0001"+
+ "\u0063\u0001\u007a\u0001\u0072\u0001\u006e\u0001\u0067\u0003\u0065\u0001"+
+ "\u0069\u0002\u0065\u0001\u006d\u0001\u0074\u0001\u0073\u0001\u0063\u0001"+
+ "\u0070\u0001\u006c\u0001\u0074\u0001\u006d\u0001\u007a\u0001\u0073\u0001"+
+ "\u007a\u0001\u006d\u0001\u0065\u0001\u007a\u0001\u0069\u0001\u0065\u0001"+
+ "\u007a\u0001\u0069\u0001\u0063\u0001\u007a\u0001\u0072\u0001\u006d\u0001"+
+ "\u0061\u0001\u006c\u0001\u0074\u0002\u007a\u0001\u0061\u0001\u0074\u0001"+
+ "\uffff\u0001\u007a\u0001\u006c\u0001\u0073\u0001\u006e\u0001\u0075\u0001"+
+ "\u0064\u0001\u0074\u0001\u0072\u0001\u0067\u0001\u0064\u0001\u0065\u0001"+
+ "\u0061\u0001\u0069\u0001\u0065\u0001\u007a\u0001\u0065\u0001\u006f\u0001"+
+ "\u007a\u0001\u0063\u0001\u0068\u0001\u007a\u0001\u0072\u0001\uffff\u0001"+
+ "\u002d\u0001\uffff\u0001\u007a\u0001\uffff\u0001\u0074\u0001\u0064\u0001"+
+ "\u0062\u0001\u007a\u0001\u0069\u0001\u007a\u0001\u0064\u0001\uffff\u0001"+
+ "\u0075\u0001\u0061\u0001\u0065\u0001\u007a\u0001\uffff\u0001\u0062\u0001"+
+ "\uffff\u0003\u007a\u0001\u0074\u0001\u0063\u0001\u006e\u0001\u0072\u0001"+
+ "\u0078\u0001\u0069\u0002\u006e\u0001\uffff\u0001\u007a\u0001\u0072\u0001"+
+ "\u0061\u0001\u006c\u0001\u006e\u0001\u0065\u0001\u007a\u0001\u0069\u0001"+
+ "\u0072\u0001\u006e\u0001\u0065\u0001\u006e\u0001\uffff\u0001\u007a\u0001"+
+ "\u0069\u0001\u0065\u0001\u007a\u0001\u0074\u0001\u006e\u0001\u006c\u0001"+
+ "\uffff\u0001\u0077\u0001\u0063\u0001\u0067\u0001\u0069\u0001\u007a\u0001"+
+ "\uffff\u0001\u0074\u0002\u007a\u0001\uffff\u0001\u0065\u0001\u007a\u0001"+
+ "\uffff\u0001\u0074\u0001\u0069\u0001\u006e\u0001\u0074\u0002\u0073\u0001"+
+ "\u0072\u0001\uffff\u0001\u0069\u0001\u007a\u0002\uffff\u0001\u0061\u0001"+
+ "\u007a\u0001\u0073\u0001\u0063\u0001\uffff\u0001\u0065\u0001\u0079\u0001"+
+ "\uffff\u0001\u002d\u0001\u0070\u0001\uffff\u0001\u0068\u0001\u0065\u0001"+
+ "\u007a\u0001\uffff\u0001\u0069\u0001\uffff\u0001\u006e\u0001\u007a\u0001"+
+ "\u0074\u0001\uffff\u0001\u0073\u0001\u0074\u0002\u0072\u0001\u0064\u0001"+
+ "\u0072\u0001\u006f\u0001\u0073\u0001\u006e\u0002\u0069\u0001\u0065\u0002"+
+ "\u0074\u0001\u007a\u0001\u0065\u0001\u007a\u0001\u0069\u0001\uffff\u0001"+
+ "\u0066\u0001\uffff\u0001\u0061\u0001\u007a\u0001\uffff\u0001\u0074\u0001"+
+ "\u006e\u0001\uffff\u0001\u006e\u0001\u0068\u0001\uffff\u0001\u006e\u0001"+
+ "\u0065\u0001\u0063\u0002\u0069\u0002\uffff\u0001\u0075\u0001\u007a\u0001"+
+ "\u0077\u0001\uffff\u0001\u0069\u0002\u007a\u0002\u0065\u0001\u0069\u0001"+
+ "\u0063\u0001\u007a\u0001\u0061\u0001\u007a\u0001\u0062\u0001\u006f\u0001"+
+ "\u007a\u0001\uffff\u0001\u007a\u0001\u0077\u0001\u0075\u0001\uffff\u0001"+
+ "\u0061\u0001\u0074\u0001\u007a\u0001\uffff\u0001\u0079\u0001\u0064\u0003"+
+ "\uffff\u0001\u006f\u0001\u0069\u0001\u0075\u0001\uffff\u0001\u006e\u0001"+
+ "\uffff\u0001\u007a\u0002\u0072\u0001\u007a\u0001\uffff\u0001\u006c\u0003"+
+ "\uffff\u0001\u0069\u0002\u0074\u0001\u0075\u0002\u0074\u0001\u006e\u0001"+
+ "\u0075\u0001\u0061\u0001\uffff\u0001\u0065\u0001\u006c\u0001\u0074\u0001"+
+ "\u0064\u0001\u007a\u0001\uffff\u0001\u0074\u0001\u0065\u0001\u0063\u0001"+
+ "\u006e\u0001\u0074\u0001\u0073\u0001\uffff\u0001\u006e\u0001\u007a\u0001"+
+ "\uffff\u0001\u007a\u0001\u0061\u0001\u0079\u0001\u0069\u0001\u0068\u0001"+
+ "\u006e\u0001\u006f\u0001\uffff\u0001\u0069\u0002\uffff\u0001\u0073\u0001"+
+ "\u006e\u0001\uffff\u0001\u007a\u0001\u0074\u0001\u0063\u0001\u007a\u0001"+
+ "\u0069\u0001\u0065\u0001\u0069\u0001\u0074\u0001\uffff\u0001\u0067\u0001"+
+ "\uffff\u0001\u007a\u0001\u0061\u0002\u007a\u0001\u0073\u0001\u0061\u0001"+
+ "\u0065\u0001\u0073\u0001\uffff\u0001\u0074\u0001\u007a\u0001\u0064\u0001"+
+ "\u006e\u0001\uffff\u0003\u007a\u0001\u0061\u0001\u006e\u0001\u0069\u0001"+
+ "\u0076\u0001\u0075\u0001\u0073\u0001\u0074\u0001\u006c\u0001\u006f\u0001"+
+ "\u007a\u0001\u0075\u0001\u007a\u0001\uffff\u0001\u007a\u0001\uffff\u0001"+
+ "\u006e\u0001\u0069\u0001\u007a\u0001\uffff\u0001\u0069\u0001\u0063\u0001"+
+ "\u0067\u0003\u007a\u0001\u0065\u0001\u0064\u0001\u006f\u0001\u0072\u0001"+
+ "\uffff\u0001\u0069\u0001\u006e\u0002\uffff\u0001\u007a\u0001\u0072\u0001"+
+ "\u006e\u0001\u0061\u0001\uffff\u0001\u0074\u0001\uffff\u0001\u006c\u0001"+
+ "\u006e\u0002\uffff\u0001\u007a\u0001\u0074\u0001\u0072\u0001\u007a\u0001"+
+ "\uffff\u0001\u007a\u0001\u0069\u0001\u0072\u0001\u006e\u0001\u0074\u0001"+
+ "\u0067\u0001\uffff\u0001\u0069\u0001\u0079\u0001\uffff\u0001\u0065\u0001"+
+ "\u006f\u0001\u0069\u0001\u007a\u0001\u0063\u0001\u0069\u0002\u007a\u0001"+
+ "\u0073\u0001\u0065\u0001\u006d\u0001\u007a\u0001\u002d\u0001\u007a\u0001"+
+ "\u0069\u0001\uffff\u0001\u0069\u0001\u006e\u0001\u0065\u0001\u0074\u0001"+
+ "\u007a\u0001\u0065\u0001\u0067\u0002\uffff\u0001\u006c\u0001\u007a\u0001"+
+ "\u006e\u0002\u007a\u0001\u006e\u0001\u006f\u0001\u0074\u0001\u0067\u0001"+
+ "\uffff\u0001\u007a\u0001\u0065\u0001\uffff\u0001\u0074\u0001\u0063\u0001"+
+ "\u0074\u0001\u0079\u0001\u0065\u0001\uffff\u0001\u0073\u0002\uffff\u0001"+
+ "\u0069\u0001\u0063\u0001\u0072\u0002\u0065\u0001\uffff\u0001\u007a\u0001"+
+ "\u0067\u0003\uffff\u0001\u0070\u0001\u002d\u0001\u006e\u0001\u0065\u0001"+
+ "\u0073\u0001\u0069\u0001\u007a\u0001\u006c\u0001\u006e\u0001\uffff\u0001"+
+ "\u0072\u0002\uffff\u0001\u0067\u0002\u0065\u0001\uffff\u0001\u0076\u0001"+
+ "\u0065\u0001\u007a\u0001\uffff\u0001\u006e\u0002\uffff\u0001\u007a\u0001"+
+ "\u0061\u0001\u006e\u0001\u0075\u0001\u0074\u0001\u0067\u0001\uffff\u0001"+
+ "\u0065\u0001\u0067\u0001\u0073\u0002\u0065\u0001\u007a\u0001\uffff\u0001"+
+ "\u007a\u0001\u0064\u0002\uffff\u0001\u0067\u0001\u007a\u0001\u0067\u0001"+
+ "\u0065\u0002\u007a\u0001\u002d\u0001\u007a\u0001\u006e\u0001\u006f\u0001"+
+ "\uffff\u0001\u0074\u0001\u006e\u0002\uffff\u0002\u007a\u0001\u0065\u0001"+
+ "\uffff\u0001\u0073\u0001\uffff\u0002\u006e\u0001\u0063\u0001\u0074\u0002"+
+ "\u007a\u0001\uffff\u0001\u0071\u0002\u007a\u0001\uffff\u0001\u0067\u0002"+
+ "\uffff\u0001\u007a\u0001\u006e\u0001\u007a\u0001\u002d\u0001\uffff\u0001"+
+ "\u007a\u0001\u0069\u0001\u0074\u0001\u0079\u0002\u007a\u0001\u0065\u0001"+
+ "\u0067\u0001\u0065\u0001\u0069\u0001\u0072\u0001\u006d\u0001\uffff\u0001"+
+ "\u007a\u0001\u0068\u0001\u0073\u0001\u0067\u0002\u007a\u0001\u006e\u0001"+
+ "\uffff\u0001\u0065\u0001\u007a\u0001\u0065\u0001\u007a\u0001\u0073\u0001"+
+ "\u0074\u0001\u006c\u0001\u0065\u0001\u007a\u0001\uffff\u0001\u0067\u0001"+
+ "\uffff\u0001\u0074\u0002\u0073\u0001\u0063\u0001\u007a\u0001\u0064\u0001"+
+ "\u007a\u0001\u0065\u0002\u007a\u0002\uffff\u0001\u0073\u0001\u0069\u0001"+
+ "\u006f\u0001\uffff\u0002\u007a\u0002\uffff\u0001\u0073\u0001\uffff\u0001"+
+ "\u007a\u0001\u006e\u0001\u0069\u0001\u0074\u0002\uffff\u0001\u0073\u0001"+
+ "\u006f\u0001\u0065\u0001\u0074\u0001\u0067\u0001\u0073\u0001\u007a\u0001"+
+ "\uffff\u0001\u006e\u0001\uffff\u0001\u0075\u0002\uffff\u0001\u007a\u0001"+
+ "\uffff\u0001\u007a\u0001\uffff\u0001\u0073\u0001\uffff\u0001\u0076\u0002"+
+ "\u007a\u0002\uffff\u0001\u007a\u0001\u006e\u0001\u007a\u0001\u0074\u0001"+
+ "\u0076\u0001\u007a\u0001\uffff\u0001\u007a\u0001\u0065\u0001\u007a\u0002"+
+ "\uffff\u0001\u0067\u0001\u007a\u0001\uffff\u0001\u0064\u0001\uffff\u0001"+
+ "\u007a\u0001\u0074\u0001\u0065\u0002\u007a\u0001\uffff\u0001\u007a\u0001"+
+ "\u0069\u0001\u0068\u0001\u007a\u0001\u0068\u0001\uffff\u0001\u007a\u0001"+
+ "\uffff\u0001\u007a\u0002\uffff\u0001\u007a\u0001\u0074\u0001\u0072\u0002"+
+ "\uffff\u0001\u0070\u0001\uffff\u0001\u007a\u0001\u006f\u0001\u007a\u0001"+
+ "\u0070\u0001\u0072\u0001\u0070\u0003\u007a\u0001\uffff\u0001\u006f\u0001"+
+ "\u0065\u0001\u0073\u0002\uffff\u0002\u0065\u0003\uffff\u0001\u007a\u0001"+
+ "\u006e\u0001\uffff\u0001\u007a\u0001\u0065\u0001\uffff\u0001\u007a\u0001"+
+ "\uffff\u0001\u0070\u0001\u0073\u0001\uffff\u0001\u002d\u0001\uffff\u0001"+
+ "\u002d\u0001\uffff\u0001\u0072\u0001\u006d\u0003\uffff\u0001\u006f\u0001"+
+ "\u0069\u0001\uffff\u0001\u007a\u0003\uffff\u0001\u007a\u0001\u002d\u0001"+
+ "\u0061\u0001\uffff\u0001\u006e\u0001\uffff\u0001\u0061\u0001\u006d\u0001"+
+ "\u0061\u0001\u006f\u0003\uffff\u0001\u0064\u0001\u006e\u0001\u0069\u0001"+
+ "\u0070\u0001\u007a\u0001\uffff\u0001\u006f\u0001\uffff\u0001\u007a\u0001"+
+ "\uffff\u0001\u0061\u0004\u0069\u0001\u0065\u0001\u006e\u0001\u0070\u0002"+
+ "\uffff\u0001\u0073\u0001\u0063\u0001\u007a\u0001\u0063\u0001\u0061\u0002"+
+ "\u0072\u0001\u0065\u0001\u0063\u0001\u0062\u0001\u0061\u0001\uffff\u0001"+
+ "\u0064\u0001\uffff\u0001\u0072\u0001\u0062\u0001\u006e\u0001\u0074\u0001"+
+ "\u0062\u0001\u006e\u0002\u007a\u0002\u0065\u0001\uffff\u0001\u0065\u0001"+
+ "\u0074\u0001\u0061\u0001\u002d\u0001\u007a\u0001\u0065\u0001\u006c\u0001"+
+ "\u0072\u0001\u0065\u0001\u0061\u0001\u006c\u0001\u0073\u0001\u0065\u0001"+
+ "\u0075\u0001\u0074\u0002\uffff\u0001\u006c\u0001\u007a\u0001\u0073\u0001"+
+ "\u007a\u0001\u0074\u0001\u0073\u0001\uffff\u0001\u007a\u0001\u0069\u0001"+
+ "\u0061\u0001\u007a\u0001\u0074\u0001\u0069\u0001\u0074\u0001\u006d\u0001"+
+ "\u0074\u0001\u007a\u0001\u0066\u0001\uffff\u0001\u007a\u0001\uffff\u0001"+
+ "\u006f\u0001\u0065\u0001\uffff\u0001\u006e\u0001\u0074\u0001\uffff\u0001"+
+ "\u006f\u0001\u006e\u0001\u0072\u0001\u007a\u0001\u0065\u0001\uffff\u0001"+
+ "\u007a\u0001\uffff\u0001\u0072\u0001\u006c\u0001\u0067\u0001\u006f\u0001"+
+ "\u0072\u0001\u0067\u0001\u0075\u0001\uffff\u0001\u007a\u0001\uffff\u0001"+
+ "\u007a\u0001\u0066\u0001\u007a\u0001\u0072\u0002\u007a\u0001\u0063\u0002"+
+ "\uffff\u0001\u007a\u0001\uffff\u0001\u007a\u0002\uffff\u0001\u0074\u0002"+
+ "\uffff\u0001\u0069\u0001\u006f\u0001\u006e\u0001\u007a\u0001\uffff",
+ DFA19_acceptS:
+ "\u001c\uffff\u0001\u00d5\u0001\u00d6\u0001\uffff\u0001\u00da\u0001"+
+ "\u00db\u0001\u00dc\u0001\u00dd\u0002\uffff\u0001\u00e0\u0002\uffff\u0001"+
+ "\u00e3\u0001\uffff\u0001\u00e5\u0001\u00e6\u0005\uffff\u0001\u00f7\u0001"+
+ "\u00ff\u0001\uffff\u0001\u0103\u0001\u0104\u0001\u0105\u0001\u0106\u0001"+
+ "\uffff\u0001\u010e\u0008\uffff\u0001\u0105\u0052\uffff\u0001\u00d3\u0001"+
+ "\u00d8\u0001\u00f8\u0001\uffff\u0001\u010d\u0001\u00d4\u0001\u00d5\u0001"+
+ "\u00d6\u0001\u00d7\u0001\u00d9\u0001\u00da\u0001\u00db\u0001\u00dc\u0001"+
+ "\u00dd\u0001\u00de\u0001\u00f4\u0001\u00f3\u0001\u00df\u0001\u00f0\u0001"+
+ "\u00e0\u0001\u00fa\u0001\u00e1\u0001\uffff\u0001\u00e2\u0001\u00e3\u0001"+
+ "\u00fe\u0001\u00e4\u0001\u00e5\u0001\u00e6\u0001\u00fc\u0001\u00e7\u0001"+
+ "\u00ea\u0001\u00ec\u0001\u00f6\u0002\uffff\u0001\u00e8\u0001\u00eb\u0001"+
+ "\u00ed\u0001\u00e9\u0001\u00ef\u0001\u00f5\u0001\u00ee\u0001\u00f2\u0001"+
+ "\u00f1\u0001\uffff\u0001\u00f7\u0001\u00ff\u0001\u0100\u0001\u0103\u0001"+
+ "\u0104\u0001\u0106\u0001\u010a\u0002\uffff\u0001\u010c\u0004\uffff\u0001"+
+ "\u0004\u0001\uffff\u0001\u0006\u0008\uffff\u0001\u000a\u001b\uffff\u0001"+
+ "\u0020\u000e\uffff\u0001\u0028\u0002\uffff\u0001\u002a\u0001\uffff\u0001"+
+ "\u002c\u0006\uffff\u0001\u002e\u0001\u0032\u0007\uffff\u0001\u0035\u0001"+
+ "\u0038\u0007\uffff\u0001\u003c\u0003\uffff\u0001\u00a9\u0001\uffff\u0001"+
+ "\u0041\u0002\uffff\u0001\u0043\u0002\uffff\u0001\u00ce\u001d\uffff\u0001"+
+ "\u005c\u0019\uffff\u0001\u00f9\u0001\u0107\u0001\u0102\u0001\u0101\u0001"+
+ "\uffff\u0001\u00fd\u0001\u0109\u0001\u010b\u0002\uffff\u0001\u0003\u0001"+
+ "\u0097\u0004\uffff\u0001\u0096\u0003\uffff\u0001\u00d0\u0014\uffff\u0001"+
+ "\u0018\u0009\uffff\u0001\u006d\u0008\uffff\u0001\u0026\u0013\uffff\u0001"+
+ "\u0034\u0003\uffff\u0001\u0037\u0005\uffff\u0001\u0039\u0007\uffff\u0001"+
+ "\u00aa\u002b\uffff\u0001\u007d\u0016\uffff\u0001\u0073\u0001\uffff\u0001"+
+ "\u00cd\u0009\uffff\u0001\u00d1\u0004\uffff\u0001\u000b\u0001\uffff\u0001"+
+ "\u000c\u000b\uffff\u0001\u0085\u000c\uffff\u0001\u001c\u0007\uffff\u0001"+
+ "\u00c2\u0005\uffff\u0001\u009f\u0003\uffff\u0001\u00a3\u0002\uffff\u0001"+
+ "\u002b\u0007\uffff\u0001\u0089\u0002\uffff\u0001\u0033\u0001\u008c\u0004"+
+ "\uffff\u0001\u00c3\u0002\uffff\u0001\u00a8\u0002\uffff\u0001\u0074\u0003"+
+ "\uffff\u0001\u003f\u0001\uffff\u0001\u0040\u0003\uffff\u0001\u0075\u0012"+
+ "\uffff\u0001\u00b6\u0001\uffff\u0001\u00b0\u0002\uffff\u0001\u0055\u0002"+
+ "\uffff\u0001\u0056\u0002\uffff\u0001\u0092\u0005\uffff\u0001\u005a\u0001"+
+ "\u005b\u0003\uffff\u0001\u007f\u000d\uffff\u0001\u0080\u0003\uffff\u0001"+
+ "\u0095\u0003\uffff\u0001\u00be\u0002\uffff\u0001\u00d2\u0001\u00fb\u0001"+
+ "\u0108\u0003\uffff\u0001\u004f\u0001\uffff\u0001\u0083\u0004\uffff\u0001"+
+ "\u00c0\u0001\uffff\u0001\u0067\u0001\u000e\u0001\u00c6\u0009\uffff\u0001"+
+ "\u0069\u0005\uffff\u0001\u006c\u0006\uffff\u0001\u001d\u0002\uffff\u0001"+
+ "\u0021\u0007\uffff\u0001\u0087\u0001\uffff\u0001\u00a1\u0001\u00a2\u0002"+
+ "\uffff\u0001\u006e\u0008\uffff\u0001\u00cb\u0001\uffff\u0001\u0036\u0008"+
+ "\uffff\u0001\u008e\u0004\uffff\u0001\u0044\u000f\uffff\u0001\u0059\u0001"+
+ "\uffff\u0001\u007b\u0003\uffff\u0001\u00b1\u000a\uffff\u0001\u005d\u0002"+
+ "\uffff\u0001\u00b8\u0001\u005f\u0004\uffff\u0001\u00ba\u0001\uffff\u0001"+
+ "\u0094\u0002\uffff\u0001\u0064\u0001\u00c5\u0004\uffff\u0001\u00bf\u0006"+
+ "\uffff\u0001\u008b\u0002\uffff\u0001\u0084\u000f\uffff\u0001\u0086\u0007"+
+ "\uffff\u0001\u009d\u0001\u0022\u0009\uffff\u0001\u002d\u0002\uffff\u0001"+
+ "\u0088\u0005\uffff\u0001\u00a6\u0001\uffff\u0001\u003a\u0001\u008d\u0005"+
+ "\uffff\u0001\u0042\u0002\uffff\u0001\u004e\u0001\u00ab\u0001\u0047\u0009"+
+ "\uffff\u0001\u00ae\u0001\uffff\u0001\u0058\u0001\u0057\u0003\uffff\u0001"+
+ "\u0052\u0003\uffff\u0001\u007c\u0001\uffff\u0001\u0050\u0001\u008f\u0006"+
+ "\uffff\u0001\u00cf\u0006\uffff\u0001\u0081\u0002\uffff\u0001\u00bb\u0001"+
+ "\u0065\u000a\uffff\u0001\u0010\u0002\uffff\u0001\u0068\u0001\u0099\u0003"+
+ "\uffff\u0001\u0013\u0001\uffff\u0001\u0014\u0006\uffff\u0001\u001b\u0003"+
+ "\uffff\u0001\u009e\u0001\uffff\u0001\u00c9\u0001\u00ca\u0004\uffff\u0001"+
+ "\u002f\u000c\uffff\u0001\u0045\u0007\uffff\u0001\u0077\u0009\uffff\u0001"+
+ "\u007a\u0001\uffff\u0001\u0090\u000a\uffff\u0001\u0063\u0001\u00bd\u0003"+
+ "\uffff\u0001\u0001\u0002\uffff\u0001\u0066\u0001\u0008\u0001\uffff\u0001"+
+ "\u000d\u0004\uffff\u0001\u0098\u0001\u00c1\u0007\uffff\u0001\u009c\u0001"+
+ "\uffff\u0001\u0019\u0001\uffff\u0001\u001f\u0001\u0023\u0001\uffff\u0001"+
+ "\u0027\u0001\uffff\u0001\u0029\u0001\uffff\u0001\u0030\u0003\uffff\u0001"+
+ "\u0070\u0001\u00a5\u0006\uffff\u0001\u0046\u0003\uffff\u0001\u004a\u0001"+
+ "\u0079\u0002\uffff\u0001\u008a\u0001\uffff\u0001\u00b5\u0005\uffff\u0001"+
+ "\u00b3\u0005\uffff\u0001\u007e\u0001\uffff\u0001\u0093\u0001\uffff\u0001"+
+ "\u0061\u0001\u0062\u0003\uffff\u0001\u0005\u0001\u0007\u0001\uffff\u0001"+
+ "\u000f\u0009\uffff\u0001\u009b\u0003\uffff\u0001\u0024\u0001\u00a0\u0002"+
+ "\uffff\u0001\u0031\u0001\u00cc\u0001\u00a7\u0002\uffff\u0001\u003b\u0002"+
+ "\uffff\u0001\u004d\u0001\uffff\u0001\u00ac\u0002\uffff\u0001\u0048\u0001"+
+ "\uffff\u0001\u0078\u0001\uffff\u0001\u0051\u0002\uffff\u0001\u00b2\u0001"+
+ "\u00b4\u0001\u00c4\u0002\uffff\u0001\u00b7\u0001\uffff\u0001\u0060\u0001"+
+ "\u00b9\u0001\u00bc\u0003\uffff\u0001\u00c7\u0001\uffff\u0001\u00c8\u0004"+
+ "\uffff\u0001\u0015\u0001\u0017\u0001\u009a\u0005\uffff\u0001\u0071\u0001"+
+ "\uffff\u0001\u003d\u0001\uffff\u0001\u00ad\u0008\uffff\u0001\u005e\u0001"+
+ "\u0082\u000b\uffff\u0001\u00a4\u0001\uffff\u0001\u003e\u000a\uffff\u0001"+
+ "\u0011\u000f\uffff\u0001\u0091\u0001\u00af\u0006\uffff\u0001\u001a\u000b"+
+ "\uffff\u0001\u0009\u0001\uffff\u0001\u006a\u0002\uffff\u0001\u001e\u0002"+
+ "\uffff\u0001\u0072\u0005\uffff\u0001\u0054\u0001\uffff\u0001\u0012\u0007"+
+ "\uffff\u0001\u004c\u0001\uffff\u0001\u0002\u0007\uffff\u0001\u0053\u0001"+
+ "\u006b\u0001\uffff\u0001\u0025\u0001\uffff\u0001\u0076\u0001\u0049\u0001"+
+ "\uffff\u0001\u0016\u0001\u006f\u0004\uffff\u0001\u004b",
+ DFA19_specialS:
+ "\u0001\u0001\u001a\uffff\u0001\u0002\u01f6\uffff\u0001\u0000\u02f8"+
+ "\uffff}>",
+ DFA19_transitionS: [
+ "\u0009\u0039\u0002\u0037\u0002\u0039\u0001\u0037\u0012\u0039"+
+ "\u0001\u0037\u0001\u0024\u0001\u0035\u0001\u0026\u0001\u001d"+
+ "\u0001\u0025\u0001\u0027\u0001\u0034\u0001\u001b\u0001\u001c"+
+ "\u0001\u002a\u0001\u002b\u0001\u0028\u0001\u002c\u0001\u0030"+
+ "\u0001\u002f\u000a\u0038\u0001\u0023\u0001\u0031\u0001\u002d"+
+ "\u0001\u0022\u0001\u002e\u0001\u0029\u0001\u0032\u000d\u0036"+
+ "\u0001\u0016\u0002\u0036\u0001\u0033\u0009\u0036\u0001\u0020"+
+ "\u0001\u0039\u0001\u0021\u0001\u0039\u0001\u0036\u0001\u0039"+
+ "\u0001\u0001\u0001\u0002\u0001\u0003\u0001\u0004\u0001\u0005"+
+ "\u0001\u0006\u0001\u0007\u0001\u0036\u0001\u0008\u0001\u000c"+
+ "\u0001\u0018\u0001\u0009\u0001\u000a\u0001\u000b\u0001\u000d"+
+ "\u0001\u000e\u0001\u0019\u0001\u0010\u0001\u000f\u0001\u0011"+
+ "\u0001\u0012\u0001\u0013\u0001\u0014\u0001\u0015\u0001\u0036"+
+ "\u0001\u0017\u0001\u001e\u0001\u001a\u0001\u001f\uff82\u0039",
+ "\u0001\u003f\u0005\uffff\u0001\u003e\u0001\u0041\u0001\u003a"+
+ "\u0001\uffff\u0001\u0040\u0001\uffff\u0001\u003d\u0001\u003b"+
+ "\u0001\u003c",
+ "\u0001\u0043\u0003\uffff\u0001\u0046\u0009\uffff\u0001\u0044"+
+ "\u0002\uffff\u0001\u0047\u0006\uffff\u0001\u0045",
+ "\u0001\u0048\u0006\uffff\u0001\u0049\u0006\uffff\u0001\u004a",
+ "\u0001\u004b\u0003\uffff\u0001\u004c\u0005\uffff\u0001\u004d",
+ "\u0001\u004e\u0001\u004f\u0001\u0050\u0002\uffff\u0001\u0051"+
+ "\u0004\uffff\u0001\u0052\u0001\uffff\u0001\u0053",
+ "\u0001\u0056\u0005\uffff\u0001\u0054\u0002\uffff\u0001\u0057"+
+ "\u0001\uffff\u0001\u0058\u0001\u0055",
+ "\u0001\u0059\u000c\uffff\u0001\u005a\u0001\uffff\u0001\u005b",
+ "\u0001\u005c\u0001\uffff\u0001\u005d\u0006\uffff\u0001\u005e"+
+ "\u0001\u005f\u0004\uffff\u0001\u0060\u0001\u0061",
+ "\u0001\u0062\u0003\uffff\u0001\u0063\u0009\uffff\u0001\u0065"+
+ "\u0004\uffff\u0001\u0064",
+ "\u0001\u0067\u0005\uffff\u0001\u0066",
+ "\u0001\u0068\u0003\uffff\u0001\u0069\u0009\uffff\u0001\u006a",
+ "\u0001\u006b",
+ "\u0001\u006f\u0001\u0071\u0002\uffff\u0001\u006c\u0007\uffff"+
+ "\u0001\u0070\u0001\uffff\u0001\u006d\u0001\uffff\u0001\u006e",
+ "\u0001\u0072\u0003\uffff\u0001\u0074\u0002\uffff\u0001\u0076"+
+ "\u0006\uffff\u0001\u0075\u0002\uffff\u0001\u0073",
+ "\u0001\u0078\u0001\uffff\u0001\u0079\u0001\uffff\u0001\u007a"+
+ "\u0005\uffff\u0001\u007e\u0001\u007c\u0002\uffff\u0001\u007b"+
+ "\u0004\uffff\u0001\u0077\u0002\uffff\u0001\u007d",
+ "\u0001\u007f",
+ "\u0001\u0080\u0002\uffff\u0001\u0081\u0001\u0086\u0005\uffff"+
+ "\u0001\u0082\u0002\uffff\u0001\u0083\u0002\uffff\u0001\u0085"+
+ "\u0003\uffff\u0001\u0084",
+ "\u0001\u0087\u0001\uffff\u0001\u0088\u0002\uffff\u0001\u0089",
+ "\u0001\u008a\u0003\uffff\u0001\u008b",
+ "\u0001\u008e\u0002\uffff\u0001\u008c\u0001\u008d\u0005\uffff"+
+ "\u0001\u008f",
+ "\u0001\u0090",
+ "\u0001\u0091",
+ "\u0001\u0092",
+ "\u0001\u0093",
+ "\u0001\u0094",
+ "\u0001\u0095\u0001\u0096",
+ "\u0001\u0098\u0016\uffff\u0001\u0099",
+ "",
+ "",
+ "\u0001\u009d",
+ "",
+ "",
+ "",
+ "",
+ "\u0001\u00a4\u0002\uffff\u0001\u00a3",
+ "\u0001\u00a6",
+ "",
+ "\u0001\u00a9",
+ "\u0001\u00ab",
+ "",
+ "\u0001\u00ae",
+ "",
+ "",
+ "\u0001\u00b2",
+ "\u0001\u00b7\u000d\uffff\u0001\u00b6\u000c\uffff\u0001\u00b5"+
+ "\u0001\u00b4\u0001\uffff\u0001\u00b8",
+ "\u0001\u00ba\u0001\u00bb",
+ "\u0001\u00bd\u000e\uffff\u0001\u00be",
+ "\u0001\u00c0\u0001\uffff\u000a\u00c2",
+ "",
+ "",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "",
+ "",
+ "",
+ "",
+ "\u0001\u00cb\u0001\uffff\u000a\u00ca\u000b\uffff\u0001\u00cc"+
+ "\u001f\uffff\u0001\u00cc",
+ "",
+ "\u0001\u00cd\u0001\u00ce\u0014\uffff\u0001\u00cf",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u0002\u0042\u0001\u00d0"+
+ "\u0017\u0042",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u0013\u0042\u0001\u00d2"+
+ "\u0006\u0042",
+ "\u0001\u00d4",
+ "\u0001\u00d5",
+ "\u0001\u00d6",
+ "\u0001\u00d8\u0001\u00d7",
+ "\u0001\u00d9",
+ "",
+ "\u0001\u00da",
+ "\u0001\u00db",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u00dd",
+ "\u0001\u00de",
+ "\u0001\u00df\u0001\u00e0",
+ "\u0001\u00e2\u0003\uffff\u0001\u00e1",
+ "\u0001\u00e3\u0001\u00e4\u0001\u00e5\u0001\uffff\u0001\u00e6"+
+ "\u0004\uffff\u0001\u00e7",
+ "\u0001\u00e8\u0002\uffff\u0001\u00e9\u0005\uffff\u0001\u00eb"+
+ "\u0006\uffff\u0001\u00ea",
+ "\u0001\u00ee\u0004\uffff\u0001\u00ef\u0001\u00ed\u000b\uffff"+
+ "\u0001\u00f0\u0002\uffff\u0001\u00ec",
+ "\u0001\u00f1",
+ "\u0001\u00f2\u000d\uffff\u0001\u00f3",
+ "\u0001\u00f4",
+ "\u0001\u00f5\u0001\u00f6\u000f\uffff\u0001\u00f7",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u00f9",
+ "\u0001\u00fc\u0001\uffff\u0001\u00fa\u0005\uffff\u0001\u00fd"+
+ "\u000a\uffff\u0001\u00fb",
+ "\u0001\u00fe\u0005\uffff\u0001\u00ff",
+ "\u0001\u0100",
+ "\u0001\u0101",
+ "\u0001\u0102",
+ "\u0001\u0103\u0033\uffff\u0001\u0104\u000c\uffff\u0001\u0105"+
+ "\u0001\u0106",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u0108\u0009\uffff\u0001\u0109",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u010b",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u010d",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u0003\u0042\u0001\u0112"+
+ "\u0001\u0042\u0001\u0111\u0001\u0042\u0001\u010e\u000a\u0042"+
+ "\u0001\u010f\u0001\u0110\u0006\u0042",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u0115",
+ "\u0001\u0118\u0004\uffff\u0001\u0117\u0004\uffff\u0001\u0116",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u0001\u0119\u0012\u0042"+
+ "\u0001\u011a\u0001\u0042\u0001\u011b\u0004\u0042",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u011f\u0007\uffff\u0001\u011e",
+ "\u0001\u0120\u000e\uffff\u0001\u0121",
+ "\u0001\u0122",
+ "\u0001\u0123",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u0017\u0042\u0001\u0124"+
+ "\u0002\u0042",
+ "\u0001\u0126\u0001\u0042\u0001\uffff\u000a\u0042\u0007\uffff"+
+ "\u001a\u0042\u0004\uffff\u0001\u0042\u0001\uffff\u0003\u0042"+
+ "\u0001\u0127\u000f\u0042\u0001\u0128\u0006\u0042",
+ "\u0001\u012a",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u012c",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u0003\u0042\u0001\u012d"+
+ "\u0016\u0042",
+ "\u0001\u012f",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u000b\u0042\u0001\u0130"+
+ "\u000e\u0042",
+ "\u0001\u0132",
+ "\u0001\u0133\u0001\uffff\u0001\u0134",
+ "\u0001\u0135\u0009\uffff\u0001\u0136",
+ "\u0001\u0137",
+ "\u0001\u0138",
+ "\u0001\u0139",
+ "\u0001\u013b\u0003\uffff\u0001\u013c\u0009\uffff\u0001\u013d"+
+ "\u0002\uffff\u0001\u013a",
+ "\u0001\u013f\u0006\uffff\u0001\u013e",
+ "\u0001\u0140\u0006\uffff\u0001\u0141",
+ "\u0001\u0142\u0001\uffff\u0001\u0143",
+ "\u0001\u0144",
+ "\u0001\u0145",
+ "\u0001\u0146",
+ "\u0001\u0147",
+ "\u0001\u014c\u0001\uffff\u0001\u0149\u0001\uffff\u0001\u014a"+
+ "\u0003\uffff\u0001\u0148\u0001\uffff\u0001\u014b",
+ "\u0001\u014d",
+ "\u0001\u014e",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u0150\u0013\uffff\u0001\u0151",
+ "\u0001\u0152",
+ "\u0001\u0153",
+ "\u0001\u0154",
+ "\u0001\u0155\u0005\uffff\u0001\u0156",
+ "\u0001\u0157\u000b\uffff\u0001\u0158",
+ "\u0001\u0159",
+ "\u0001\u015a\u0005\uffff\u0001\u015b",
+ "\u0001\u015c",
+ "\u0001\u015d\u0003\uffff\u0001\u015e",
+ "\u0001\u0161\u0001\uffff\u0001\u015f\u0005\uffff\u0001\u0160",
+ "\u0001\u0162",
+ "\u0001\u0163",
+ "\u0001\u0164",
+ "\u0001\u0165",
+ "\u0001\u0166",
+ "\u0001\u0167",
+ "\u0001\u0168",
+ "",
+ "",
+ "",
+ "\u0002\u016a\u0002\uffff\u0001\u016a\u0012\uffff\u0001\u016a"+
+ "\u0020\uffff\u001a\u016a\u0004\uffff\u0001\u016a\u0001\uffff"+
+ "\u001a\u016a",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\u0001\u016b",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\u0001\u016d",
+ "\u0002\u016f\u0002\uffff\u0001\u016f\u0012\uffff\u0001\u016f"+
+ "\u0020\uffff\u001a\u016f\u0004\uffff\u0001\u016f\u0001\uffff"+
+ "\u001a\u016f",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\u000a\u00c2\u000b\uffff\u0001\u00cc\u001f\uffff\u0001\u00cc",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\u0001\u00cb\u0001\uffff\u000a\u00ca\u000b\uffff\u0001\u00cc"+
+ "\u001f\uffff\u0001\u00cc",
+ "\u000a\u0171\u000b\uffff\u0001\u00cc\u001f\uffff\u0001\u00cc",
+ "",
+ "\u0001\u0172",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u0175",
+ "",
+ "\u0001\u0176",
+ "",
+ "\u0001\u0177",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u000e\u0042\u0001\u0178"+
+ "\u000b\u0042",
+ "\u0001\u017a",
+ "\u0001\u017b",
+ "\u0001\u017c",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u017e",
+ "\u0001\u017f",
+ "",
+ "\u0001\u0180",
+ "\u0001\u0181",
+ "\u0001\u0182\u000e\uffff\u0001\u0183",
+ "\u0001\u0184",
+ "\u0001\u0185",
+ "\u0001\u0186",
+ "\u0001\u0187",
+ "\u0001\u0188",
+ "\u0001\u0189\u0001\u018a",
+ "\u0001\u018b",
+ "\u0001\u018c",
+ "\u0001\u018e\u0002\uffff\u0001\u018d",
+ "\u0001\u018f",
+ "\u0001\u0190",
+ "\u0001\u0191",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u0193",
+ "\u0001\u0194",
+ "\u0001\u0195",
+ "\u0001\u0196",
+ "\u0001\u0197",
+ "\u0001\u0198",
+ "\u0001\u0199",
+ "\u0001\u019a",
+ "\u0001\u019b",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u019d",
+ "",
+ "\u0001\u019e",
+ "\u0001\u019f",
+ "\u0001\u01a0",
+ "\u0001\u01a1",
+ "\u0001\u01a2",
+ "\u0001\u01a3",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u0004\u0042\u0001\u01a4"+
+ "\u0015\u0042",
+ "\u0001\u01a6",
+ "\u0001\u01a7",
+ "\u0001\u01a8",
+ "\u0001\u01a9",
+ "\u0001\u01aa",
+ "\u0001\u01ab",
+ "\u0001\u01ac",
+ "",
+ "\u0001\u01ad",
+ "\u0001\u01ae",
+ "",
+ "\u0001\u01af",
+ "",
+ "\u0001\u01b0",
+ "\u0001\u01b1",
+ "\u0001\u01b3\u000e\uffff\u0001\u01b2",
+ "\u0001\u01b4\u0009\uffff\u0001\u01b5",
+ "\u0001\u01b6",
+ "\u0001\u01b7",
+ "",
+ "",
+ "\u0001\u01b8",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u01ba",
+ "\u0001\u01bb",
+ "\u0001\u01bc",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u01be",
+ "",
+ "",
+ "\u0001\u01bf",
+ "\u0001\u01c0",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u0008\u0042\u0001\u01c2"+
+ "\u000b\u0042\u0001\u01c1\u0005\u0042",
+ "\u0001\u01c4",
+ "\u0001\u01c5",
+ "\u0001\u01c6",
+ "\u0001\u01c7",
+ "",
+ "\u0001\u01c8\u0006\uffff\u0001\u01c9",
+ "\u0001\u01ca",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "",
+ "\u0001\u01cc",
+ "",
+ "\u0001\u01cd",
+ "\u0001\u01ce",
+ "",
+ "\u0001\u01cf",
+ "\u0001\u01d0",
+ "",
+ "\u0001\u01d1",
+ "\u0001\u01d3\u0003\uffff\u0001\u01d2",
+ "\u0001\u01d4",
+ "\u0001\u01d5\u000f\uffff\u0001\u01d6\u0002\uffff\u0001\u01d7",
+ "\u0001\u01d8",
+ "\u0001\u01da\u0035\uffff\u0001\u01d9",
+ "\u0001\u01db",
+ "\u0001\u01dc",
+ "\u0001\u01de\u000b\uffff\u0001\u01dd",
+ "\u0001\u01df\u000f\uffff\u0001\u01e0",
+ "\u0001\u01e1",
+ "\u0001\u01e2",
+ "\u0001\u01e3",
+ "\u0001\u01e4",
+ "\u0001\u01e5",
+ "\u0001\u01e6",
+ "\u0001\u01e7",
+ "\u0001\u01e8\u0001\u01e9",
+ "\u0001\u01ea",
+ "\u0001\u01eb",
+ "\u0001\u01ec",
+ "\u0001\u01ed",
+ "\u0001\u01ee",
+ "\u0001\u01ef",
+ "\u0001\u01f0",
+ "\u0001\u01f1",
+ "\u0001\u01f2",
+ "\u0001\u01f3",
+ "\u0001\u01f4\u0004\uffff\u0001\u01f5",
+ "",
+ "\u0001\u01f6",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u01f8",
+ "\u0001\u01f9",
+ "\u0001\u01fa",
+ "\u0001\u01fb\u0001\uffff\u0001\u01fc",
+ "\u0001\u01fd",
+ "\u0001\u01fe",
+ "\u0001\u01ff",
+ "\u0001\u0200",
+ "\u0001\u0201\u000b\uffff\u0001\u0202",
+ "\u0001\u0203",
+ "\u0001\u0204",
+ "\u0001\u0206\u0003\uffff\u0001\u0205",
+ "\u0001\u0207",
+ "\u0001\u0208",
+ "\u0001\u0209",
+ "\u0001\u020a",
+ "\u0001\u020b",
+ "\u0001\u020c",
+ "\u0001\u020d",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u020f",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u0211",
+ "",
+ "",
+ "",
+ "",
+ "\u0001\u0212",
+ "",
+ "",
+ "",
+ "\u000a\u0171\u000b\uffff\u0001\u00cc\u001f\uffff\u0001\u00cc",
+ "\u0001\u0213",
+ "",
+ "",
+ "\u0001\u0214",
+ "\u0001\u0215",
+ "\u0001\u0216",
+ "\u0001\u0217",
+ "",
+ "\u0001\u0218",
+ "\u0001\u0219",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "",
+ "\u0001\u021b",
+ "\u0001\u021c",
+ "\u0001\u021d",
+ "\u0001\u021e",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u0001\u0220\u0019\u0042",
+ "\u0001\u0222",
+ "\u0001\u0223",
+ "\u0001\u0224",
+ "\u0001\u0225\u0003\uffff\u0001\u0226",
+ "\u0001\u0227",
+ "\u0001\u0228",
+ "\u0001\u022a\u0003\uffff\u0001\u0229\u0003\uffff\u0001\u022b",
+ "\u0001\u022c\u0001\u0042\u0001\uffff\u000a\u0042\u0007\uffff"+
+ "\u001a\u0042\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u022e",
+ "\u0001\u022f",
+ "\u0001\u0230",
+ "\u0001\u0231",
+ "\u0001\u0232",
+ "\u0001\u0233",
+ "",
+ "\u0001\u0234",
+ "\u0001\u0235",
+ "\u0001\u0236",
+ "\u0001\u0237",
+ "\u0001\u0238",
+ "\u0001\u0239",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u023b",
+ "\u0001\u023c",
+ "",
+ "\u0001\u023d",
+ "\u0001\u023e",
+ "\u0001\u023f",
+ "\u0001\u0240",
+ "\u0001\u0241",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u0243",
+ "\u0001\u0244\u0007\uffff\u0001\u0245",
+ "",
+ "\u0001\u0246",
+ "\u0001\u0247",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u0249",
+ "\u0001\u024a",
+ "\u0001\u024b",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u024d",
+ "\u0001\u024e",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u0250",
+ "\u0001\u0251",
+ "\u0001\u0252",
+ "\u0001\u0254\u0003\uffff\u0001\u0253",
+ "\u0001\u0256\u000a\uffff\u0001\u0255",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u0258",
+ "\u0001\u0259",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u025c",
+ "\u0001\u025d",
+ "",
+ "\u0001\u025e",
+ "\u0001\u025f",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u0261",
+ "\u0001\u0262",
+ "",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u0264",
+ "\u0001\u0265",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u0267",
+ "\u0001\u0268",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u0012\u0042\u0001\u0269"+
+ "\u0007\u0042",
+ "",
+ "\u0001\u026b\u0001\u0042\u0001\uffff\u000a\u0042\u0007\uffff"+
+ "\u001a\u0042\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u026d",
+ "\u0001\u026e",
+ "\u0001\u026f",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u0271",
+ "\u0001\u0272",
+ "\u0001\u0273",
+ "\u0001\u0274",
+ "\u0001\u0275",
+ "\u0001\u0276",
+ "\u0001\u0277",
+ "\u0001\u0278",
+ "\u0001\u0279",
+ "\u0001\u027a",
+ "\u0001\u027b",
+ "\u0001\u027c",
+ "\u0001\u027d",
+ "\u0001\u027e\u000c\uffff\u0001\u027f",
+ "\u0001\u0280",
+ "\u0001\u0281",
+ "\u0001\u0282",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u0284",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u0286",
+ "\u0001\u0287",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u0289",
+ "\u0001\u028a",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u028c",
+ "\u0001\u028d",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u028f",
+ "\u0001\u0290",
+ "\u0001\u0291",
+ "\u0001\u0292",
+ "\u0001\u0293",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u0296",
+ "\u0001\u0297",
+ "",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u0012\u0042\u0001\u0298"+
+ "\u0007\u0042",
+ "\u0001\u029a",
+ "\u0001\u029b",
+ "\u0001\u029c",
+ "\u0001\u029d",
+ "\u0001\u029e",
+ "\u0001\u029f",
+ "\u0001\u02a0",
+ "\u0001\u02a1",
+ "\u0001\u02a2",
+ "\u0001\u02a3",
+ "\u0001\u02a4",
+ "\u0001\u02a5",
+ "\u0001\u02a6",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u02a8",
+ "\u0001\u02a9",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u000e\u0042\u0001\u02aa"+
+ "\u000b\u0042",
+ "\u0001\u02ac",
+ "\u0001\u02ad",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u0012\u0042\u0001\u02ae"+
+ "\u0007\u0042",
+ "\u0001\u02b0",
+ "",
+ "\u0001\u02b1",
+ "",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0000\u02b4",
+ "\u0001\u02b5",
+ "\u0001\u02b6",
+ "\u0001\u02b7",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u02b9",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u02bb",
+ "",
+ "\u0001\u02bc",
+ "\u0001\u02bd",
+ "\u0001\u02be",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "",
+ "\u0001\u02c0",
+ "",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u02c4",
+ "\u0001\u02c5",
+ "\u0001\u02c6",
+ "\u0001\u02c7",
+ "\u0001\u02c9\u0009\uffff\u0001\u02c8",
+ "\u0001\u02ca",
+ "\u0001\u02cb",
+ "\u0001\u02cc",
+ "",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u02ce",
+ "\u0001\u02cf",
+ "\u0001\u02d0",
+ "\u0001\u02d1",
+ "\u0001\u02d2",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u02d4",
+ "\u0001\u02d5",
+ "\u0001\u02d6",
+ "\u0001\u02d7",
+ "\u0001\u02d8",
+ "",
+ "\u0001\u02d9\u0001\u0042\u0001\uffff\u000a\u0042\u0007\uffff"+
+ "\u001a\u0042\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u02db",
+ "\u0001\u02dc",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u02de",
+ "\u0001\u02df",
+ "\u0001\u02e0",
+ "",
+ "\u0001\u02e1",
+ "\u0001\u02e2",
+ "\u0001\u02e3",
+ "\u0001\u02e4",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "",
+ "\u0001\u02e6",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "",
+ "\u0001\u02e9",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u0008\u0042\u0001\u02ea"+
+ "\u0011\u0042",
+ "",
+ "\u0001\u02ec",
+ "\u0001\u02ed",
+ "\u0001\u02ee",
+ "\u0001\u02ef",
+ "\u0001\u02f0",
+ "\u0001\u02f1",
+ "\u0001\u02f2",
+ "",
+ "\u0001\u02f3",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "",
+ "",
+ "\u0001\u02f5",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u02f7",
+ "\u0001\u02f8",
+ "",
+ "\u0001\u02f9",
+ "\u0001\u02fa",
+ "",
+ "\u0001\u02fb",
+ "\u0001\u02fc",
+ "",
+ "\u0001\u02fd",
+ "\u0001\u02fe",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "",
+ "\u0001\u0300",
+ "",
+ "\u0001\u0301",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u0004\u0042\u0001\u0302"+
+ "\u0003\u0042\u0001\u0303\u0011\u0042",
+ "\u0001\u0305",
+ "",
+ "\u0001\u0306",
+ "\u0001\u0307",
+ "\u0001\u0308",
+ "\u0001\u0309",
+ "\u0001\u030a",
+ "\u0001\u030b",
+ "\u0001\u030c",
+ "\u0001\u030d",
+ "\u0001\u030e",
+ "\u0001\u030f",
+ "\u0001\u0310",
+ "\u0001\u0311",
+ "\u0001\u0312",
+ "\u0001\u0313",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u0315",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u0317",
+ "",
+ "\u0001\u0318",
+ "",
+ "\u0001\u0319",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "",
+ "\u0001\u031b",
+ "\u0001\u031c",
+ "",
+ "\u0001\u031d",
+ "\u0001\u031e",
+ "",
+ "\u0001\u031f",
+ "\u0001\u0320",
+ "\u0001\u0321",
+ "\u0001\u0322",
+ "\u0001\u0323",
+ "",
+ "",
+ "\u0001\u0324",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u0326",
+ "",
+ "\u0001\u0327",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u032a",
+ "\u0001\u032b",
+ "\u0001\u032c",
+ "\u0001\u032d",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u032f",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u0331",
+ "\u0001\u0332",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u0335",
+ "\u0001\u0336",
+ "",
+ "\u0001\u0337",
+ "\u0001\u0338",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "",
+ "\u0001\u033a",
+ "\u0001\u033b",
+ "",
+ "",
+ "",
+ "\u0001\u033c",
+ "\u0001\u033d",
+ "\u0001\u033e",
+ "",
+ "\u0001\u033f",
+ "",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u0341",
+ "\u0001\u0342",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "",
+ "\u0001\u0344",
+ "",
+ "",
+ "",
+ "\u0001\u0345",
+ "\u0001\u0346",
+ "\u0001\u0347",
+ "\u0001\u0349\u0013\uffff\u0001\u0348",
+ "\u0001\u034a",
+ "\u0001\u034b",
+ "\u0001\u034c",
+ "\u0001\u034d",
+ "\u0001\u034e",
+ "",
+ "\u0001\u034f",
+ "\u0001\u0350",
+ "\u0001\u0351",
+ "\u0001\u0352",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "",
+ "\u0001\u0354",
+ "\u0001\u0355",
+ "\u0001\u0356",
+ "\u0001\u0357",
+ "\u0001\u0358",
+ "\u0001\u0359",
+ "",
+ "\u0001\u035a",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u035d",
+ "\u0001\u035e",
+ "\u0001\u035f",
+ "\u0001\u0360",
+ "\u0001\u0361",
+ "\u0001\u0362",
+ "",
+ "\u0001\u0363",
+ "",
+ "",
+ "\u0001\u0364",
+ "\u0001\u0365",
+ "",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u0367",
+ "\u0001\u0368",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u036a",
+ "\u0001\u036b",
+ "\u0001\u036c",
+ "\u0001\u036d",
+ "",
+ "\u0001\u036e",
+ "",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u0370",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u0373",
+ "\u0001\u0374",
+ "\u0001\u0375",
+ "\u0001\u0376",
+ "",
+ "\u0001\u0377",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u0379",
+ "\u0001\u037a",
+ "",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u037e",
+ "\u0001\u037f",
+ "\u0001\u0380",
+ "\u0001\u0381",
+ "\u0001\u0382",
+ "\u0001\u0383",
+ "\u0001\u0384",
+ "\u0001\u0385",
+ "\u0001\u0386",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u0388",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "",
+ "\u0001\u038b",
+ "\u0001\u038c",
+ "\u0001\u038d\u0001\u0042\u0001\uffff\u000a\u0042\u0007\uffff"+
+ "\u001a\u0042\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "",
+ "\u0001\u038f",
+ "\u0001\u0390",
+ "\u0001\u0391",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u0008\u0042\u0001\u0393"+
+ "\u0011\u0042",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u0396",
+ "\u0001\u0397",
+ "\u0001\u0398",
+ "\u0001\u0399",
+ "",
+ "\u0001\u039a",
+ "\u0001\u039b",
+ "",
+ "",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u039d",
+ "\u0001\u039e",
+ "\u0001\u039f",
+ "",
+ "\u0001\u03a0",
+ "",
+ "\u0001\u03a1",
+ "\u0001\u03a2",
+ "",
+ "",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u03a4",
+ "\u0001\u03a5",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u03a8",
+ "\u0001\u03a9",
+ "\u0001\u03aa",
+ "\u0001\u03ab",
+ "\u0001\u03ac",
+ "",
+ "\u0001\u03ad",
+ "\u0001\u03ae",
+ "",
+ "\u0001\u03af",
+ "\u0001\u03b0",
+ "\u0001\u03b1",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u03b3",
+ "\u0001\u03b4",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u03b7",
+ "\u0001\u03b8",
+ "\u0001\u03b9",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u03bb",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u03bd\u0007\uffff\u0001\u03be",
+ "",
+ "\u0001\u03bf",
+ "\u0001\u03c0",
+ "\u0001\u03c1",
+ "\u0001\u03c2",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u03c4",
+ "\u0001\u03c5",
+ "",
+ "",
+ "\u0001\u03c6",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u03c8",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u03cb",
+ "\u0001\u03cc",
+ "\u0001\u03cd",
+ "\u0001\u03ce",
+ "",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u03d0",
+ "",
+ "\u0001\u03d1",
+ "\u0001\u03d2",
+ "\u0001\u03d3",
+ "\u0001\u03d4",
+ "\u0001\u03d5",
+ "",
+ "\u0001\u03d6",
+ "",
+ "",
+ "\u0001\u03d7",
+ "\u0001\u03d8",
+ "\u0001\u03d9",
+ "\u0001\u03da",
+ "\u0001\u03db",
+ "",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u03dd",
+ "",
+ "",
+ "",
+ "\u0001\u03de",
+ "\u0001\u03df",
+ "\u0001\u03e0",
+ "\u0001\u03e1",
+ "\u0001\u03e2",
+ "\u0001\u03e3",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u03e5",
+ "\u0001\u03e6",
+ "",
+ "\u0001\u03e7",
+ "",
+ "",
+ "\u0001\u03e8",
+ "\u0001\u03e9",
+ "\u0001\u03ea\u0003\uffff\u0001\u03eb",
+ "",
+ "\u0001\u03ec",
+ "\u0001\u03ed",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "",
+ "\u0001\u03ef",
+ "",
+ "",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u03f1",
+ "\u0001\u03f2",
+ "\u0001\u03f3",
+ "\u0001\u03f4",
+ "\u0001\u03f5",
+ "",
+ "\u0001\u03f6",
+ "\u0001\u03f7",
+ "\u0001\u03f8",
+ "\u0001\u03f9",
+ "\u0001\u03fa",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u03fd",
+ "",
+ "",
+ "\u0001\u03fe",
+ "\u0001\u03ff\u0001\u0042\u0001\uffff\u000a\u0042\u0007\uffff"+
+ "\u001a\u0042\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u0401",
+ "\u0001\u0402",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u0405",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u0407",
+ "\u0001\u0408",
+ "",
+ "\u0001\u0409",
+ "\u0001\u040a",
+ "",
+ "",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u040d",
+ "",
+ "\u0001\u040e\u000c\uffff\u0001\u040f",
+ "",
+ "\u0001\u0410",
+ "\u0001\u0411",
+ "\u0001\u0412",
+ "\u0001\u0413",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u0415\u0001\u0042\u0001\uffff\u000a\u0042\u0007\uffff"+
+ "\u001a\u0042\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "",
+ "\u0001\u0417",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "",
+ "\u0001\u041a",
+ "",
+ "",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u041c",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u041e",
+ "",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u0420",
+ "\u0001\u0421",
+ "\u0001\u0422",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u0425",
+ "\u0001\u0426",
+ "\u0001\u0427",
+ "\u0001\u0428",
+ "\u0001\u0429",
+ "\u0001\u042a",
+ "",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u042c",
+ "\u0001\u042d",
+ "\u0001\u042e",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u0431",
+ "",
+ "\u0001\u0432",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u0434",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u0436",
+ "\u0001\u0437",
+ "\u0001\u0438",
+ "\u0001\u0439",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u0012\u0042\u0001\u043a"+
+ "\u0007\u0042",
+ "",
+ "\u0001\u043c",
+ "",
+ "\u0001\u043d",
+ "\u0001\u043e",
+ "\u0001\u043f",
+ "\u0001\u0440",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u0442",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u0444",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "",
+ "",
+ "\u0001\u0447",
+ "\u0001\u0448",
+ "\u0001\u0449",
+ "",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "",
+ "",
+ "\u0001\u044c",
+ "",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u044e",
+ "\u0001\u044f",
+ "\u0001\u0450",
+ "",
+ "",
+ "\u0001\u0451",
+ "\u0001\u0452",
+ "\u0001\u0453",
+ "\u0001\u0454",
+ "\u0001\u0455",
+ "\u0001\u0456",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "",
+ "\u0001\u0458",
+ "",
+ "\u0001\u0459",
+ "",
+ "",
+ "\u0001\u045a\u0001\u0042\u0001\uffff\u000a\u0042\u0007\uffff"+
+ "\u001a\u0042\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "",
+ "\u0001\u045d",
+ "",
+ "\u0001\u045e",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "",
+ "",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u0462",
+ "\u0001\u0463\u0001\u0042\u0001\uffff\u000a\u0042\u0007\uffff"+
+ "\u001a\u0042\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u0465",
+ "\u0001\u0466",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u0012\u0042\u0001\u0468"+
+ "\u0007\u0042",
+ "\u0001\u046a",
+ "\u0001\u046b\u0001\u0042\u0001\uffff\u000a\u0042\u0007\uffff"+
+ "\u001a\u0042\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "",
+ "",
+ "\u0001\u046d",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "",
+ "\u0001\u046f",
+ "",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u0471",
+ "\u0001\u0472",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u0476",
+ "\u0001\u0477",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u0479",
+ "",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "",
+ "",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u047d",
+ "\u0001\u047e",
+ "",
+ "",
+ "\u0001\u047f",
+ "",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u0481",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u0483",
+ "\u0001\u0484",
+ "\u0001\u0485",
+ "\u0001\u0486\u0001\u0042\u0001\uffff\u000a\u0042\u0007\uffff"+
+ "\u001a\u0042\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "",
+ "\u0001\u048a",
+ "\u0001\u048b",
+ "\u0001\u048c",
+ "",
+ "",
+ "\u0001\u048d",
+ "\u0001\u048e",
+ "",
+ "",
+ "",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u0490",
+ "",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u0492",
+ "",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "",
+ "\u0001\u0494",
+ "\u0001\u0495",
+ "",
+ "\u0001\u0496",
+ "",
+ "\u0001\u0497",
+ "",
+ "\u0001\u0498",
+ "\u0001\u0499",
+ "",
+ "",
+ "",
+ "\u0001\u049a",
+ "\u0001\u049b",
+ "",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "",
+ "",
+ "",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u049e",
+ "\u0001\u049f",
+ "",
+ "\u0001\u04a0",
+ "",
+ "\u0001\u04a1",
+ "\u0001\u04a2",
+ "\u0001\u04a3",
+ "\u0001\u04a4",
+ "",
+ "",
+ "",
+ "\u0001\u04a5",
+ "\u0001\u04a6",
+ "\u0001\u04a7",
+ "\u0001\u04a8",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "",
+ "\u0001\u04aa",
+ "",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "",
+ "\u0001\u04ac",
+ "\u0001\u04ad",
+ "\u0001\u04ae",
+ "\u0001\u04af",
+ "\u0001\u04b0",
+ "\u0001\u04b1",
+ "\u0001\u04b2",
+ "\u0001\u04b3",
+ "",
+ "",
+ "\u0001\u04b4",
+ "\u0001\u04b5",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u04b7",
+ "\u0001\u04b8",
+ "\u0001\u04b9",
+ "\u0001\u04ba",
+ "\u0001\u04bb",
+ "\u0001\u04bc",
+ "\u0001\u04bd",
+ "\u0001\u04be",
+ "",
+ "\u0001\u04bf",
+ "",
+ "\u0001\u04c0",
+ "\u0001\u04c1",
+ "\u0001\u04c2",
+ "\u0001\u04c3",
+ "\u0001\u04c4",
+ "\u0001\u04c5",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u04c8",
+ "\u0001\u04c9",
+ "",
+ "\u0001\u04ca",
+ "\u0001\u04cb",
+ "\u0001\u04cc",
+ "\u0001\u04cd",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u04cf",
+ "\u0001\u04d0",
+ "\u0001\u04d1",
+ "\u0001\u04d2",
+ "\u0001\u04d3",
+ "\u0001\u04d4",
+ "\u0001\u04d5",
+ "\u0001\u04d6",
+ "\u0001\u04d7",
+ "\u0001\u04d8",
+ "",
+ "",
+ "\u0001\u04d9",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u04db",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u04dd",
+ "\u0001\u04de",
+ "",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u04e0",
+ "\u0001\u04e1",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u04e3",
+ "\u0001\u04e4",
+ "\u0001\u04e5",
+ "\u0001\u04e6",
+ "\u0001\u04e7",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u04e9",
+ "",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "",
+ "\u0001\u04eb",
+ "\u0001\u04ec",
+ "",
+ "\u0001\u04ed",
+ "\u0001\u04ee",
+ "",
+ "\u0001\u04ef",
+ "\u0001\u04f0",
+ "\u0001\u04f1",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u04f3",
+ "",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "",
+ "\u0001\u04f5",
+ "\u0001\u04f6",
+ "\u0001\u04f7",
+ "\u0001\u04f8",
+ "\u0001\u04f9",
+ "\u0001\u04fa",
+ "\u0001\u04fb",
+ "",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u04fe",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u0500",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "\u0001\u0503",
+ "",
+ "",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ "",
+ "",
+ "\u0001\u0506",
+ "",
+ "",
+ "\u0001\u0507",
+ "\u0001\u0508",
+ "\u0001\u0509",
+ "\u0002\u0042\u0001\uffff\u000a\u0042\u0007\uffff\u001a\u0042"+
+ "\u0004\uffff\u0001\u0042\u0001\uffff\u001a\u0042",
+ ""
+ ]
+});
+
+org.antlr.lang.augmentObject(XQueryLexer, {
+ DFA19_eot:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryLexer.DFA19_eotS),
+ DFA19_eof:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryLexer.DFA19_eofS),
+ DFA19_min:
+ org.antlr.runtime.DFA.unpackEncodedStringToUnsignedChars(XQueryLexer.DFA19_minS),
+ DFA19_max:
+ org.antlr.runtime.DFA.unpackEncodedStringToUnsignedChars(XQueryLexer.DFA19_maxS),
+ DFA19_accept:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryLexer.DFA19_acceptS),
+ DFA19_special:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryLexer.DFA19_specialS),
+ DFA19_transition: (function() {
+ var a = [],
+ i,
+ numStates = XQueryLexer.DFA19_transitionS.length;
+ for (i=0; i<numStates; i++) {
+ a.push(org.antlr.runtime.DFA.unpackEncodedString(XQueryLexer.DFA19_transitionS[i]));
+ }
+ return a;
+ })()
+});
+
+XQueryLexer.DFA19 = function(recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 19;
+ this.eot = XQueryLexer.DFA19_eot;
+ this.eof = XQueryLexer.DFA19_eof;
+ this.min = XQueryLexer.DFA19_min;
+ this.max = XQueryLexer.DFA19_max;
+ this.accept = XQueryLexer.DFA19_accept;
+ this.special = XQueryLexer.DFA19_special;
+ this.transition = XQueryLexer.DFA19_transition;
+};
+
+org.antlr.lang.extend(XQueryLexer.DFA19, org.antlr.runtime.DFA, {
+ getDescription: function() {
+ return "1:1: Tokens : ( ANCESTOR | ANCESTOR_OR_SELF | AND | AS | ASCENDING | AT | ATTRIBUTE | BASE_URI | BOUNDARY_SPACE | BY | CASE | CAST | CASTABLE | CHILD | COLLATION | COMMENT | CONSTRUCTION | COPY_NAMESPACES | DECLARE | DEFAULT | DESCENDANT | DESCENDANT_OR_SELF | DESCENDING | DIV | DOCUMENT | DOCUMENT_NODE | ELEMENT | ELSE | EMPTY | EMPTY_SEQUENCE | ENCODING | EQ | EVERY | EXCEPT | EXTERNAL | FOLLOWING | FOLLOWING_SIBLING | FOR | FUNCTION | GE | GREATEST | GT | IDIV | IF | IMPORT | IN | INHERIT | INSTANCE | INTERSECT | IS | ITEM | LAX | LE | LEAST | LET | LT | MOD | MODULE | NAMESPACE | NE | NO_INHERIT | NO_PRESERVE | NODE | JSON | OF | OPTION | OR | ORDER | ORDERED | ORDERING | PARENT | PRECEDING | PRECEDING_SIBLING | PRESERVE | PROCESSING_INSTRUCTION | STRUCTURED_ITEM | JSON_ITEM | OBJECT | ARRAY | RETURN | SATISFIES | SCHEMA | SCHEMA_ATTRIBUTE | SCHEMA_ELEMENT | SELF | SOME | STABLE | STRICT | STRIP | TEXT | THEN | TO | TREAT | TYPESWITCH | UNION | UNORDERED | VALIDATE | VARIABLE | VERSION | WHERE | XQUERY | ALLOWING | CATCH | CONTEXT | COUNT | DECIMAL_FORMAT | DECIMAL_SEPARATOR | DIGIT | END | GROUP | GROUPING_SEPARATOR | INFINITY | MINUS_SIGN | NAMESPACE_NODE | NAN | NEXT | ONLY | PATTERN_SEPARATOR | PERCENT | PER_MILLE | PREVIOUS | SLIDING | START | SWITCH | TRY | TUMBLING | TYPE | WHEN | WINDOW | ZERO_DIGIT | AFTER | BEFORE | COPY | DELETE | FIRST | INSERT | INTO | POSITION | APPEND | LAST | MODIFY | NODES | RENAME | REPLACE | REVALIDATION | SKIP | UPDATING | VALUE | WITH | ALL | ANY | CONTAINS | CONTENT | DIACRITICS | DIFFERENT | DISTANCE | ENTIRE | EXACTLY | FROM | FT_OPTION | FTAND | FTNOT | FTOR | INSENSITIVE | LANGUAGE | LEVELS | LOWERCASE | MOST | NO | NOT | OCCURS | PARAGRAPH | PARAGRAPHS | PHRASE | RELATIONSHIP | SAME | SCORE | SENSITIVE | SENTENCE | SENTENCES | STEMMING | STOP | THESAURUS | TIMES | UPPERCASE | USING | WEIGHT | WILDCARDS | WITHOUT | WORD | WORDS | BREAK | CONTINUE | EXIT | LOOP | RETURNING | WHILE | CHECK | COLLECTION | CONSTRAINT | FOREACH | FOREIGN | INDEX | INTEGRITY | KEY | ON | UNIQUE | AMP_ER | APOS_ER | QUOT_ER | CONCAT | LPAREN | RPAREN | DOLLAR | L_UNION_BRACKET | R_UNION_BRACKET | LBRACKET | RBRACKET | LSQUARE | RSQUARE | EQUAL | BIND | NOTEQUAL | ANN_PERCENT | HASH | AMP | COMMA | QUESTION | STAR | PLUS | MINUS | SMALLER | GREATER | SMALLEREQ | GREATEREQ | SMALLER_SMALLER | GREATER_GREATER | SLASH | SLASH_SLASH | BANG | DOT | DOT_DOT | COLON | COLON_COLON | EMPTY_CLOSE_TAG | CLOSE_TAG | SEMICOLON | VBAR | PRAGMA_START | PRAGMA_END | XML_COMMENT_START | XML_COMMENT_END | PI_START | PI_END | ATTR_SIGN | Q | CHARREF_DEC | CHARREF_HEX | APOS | QUOT | L_NCName | S | L_Pragma | L_DirCommentConstructor | L_DirPIConstructor | L_IntegerLiteral | L_DecimalLiteral | L_DoubleLiteral | L_Comment | L_AnyChar );";
+ },
+ specialStateTransition: function(s, input) {
+ var _s = s;
+ var retval = (function(s, input) {
+ switch ( s ) {
+ case 0 :
+ var LA19_530 = input.LA(1);
+
+ s = -1;
+ if ( ((LA19_530>='\u0000' && LA19_530<='\uFFFF')) ) {s = 692;}
+
+ else s = 691;
+
+ if ( s>=0 ) return s;
+ break;
+ case 1 :
+ var LA19_0 = input.LA(1);
+
+ s = -1;
+ if ( (LA19_0=='a') ) {s = 1;}
+
+ else if ( (LA19_0=='b') ) {s = 2;}
+
+ else if ( (LA19_0=='c') ) {s = 3;}
+
+ else if ( (LA19_0=='d') ) {s = 4;}
+
+ else if ( (LA19_0=='e') ) {s = 5;}
+
+ else if ( (LA19_0=='f') ) {s = 6;}
+
+ else if ( (LA19_0=='g') ) {s = 7;}
+
+ else if ( (LA19_0=='i') ) {s = 8;}
+
+ else if ( (LA19_0=='l') ) {s = 9;}
+
+ else if ( (LA19_0=='m') ) {s = 10;}
+
+ else if ( (LA19_0=='n') ) {s = 11;}
+
+ else if ( (LA19_0=='j') ) {s = 12;}
+
+ else if ( (LA19_0=='o') ) {s = 13;}
+
+ else if ( (LA19_0=='p') ) {s = 14;}
+
+ else if ( (LA19_0=='s') ) {s = 15;}
+
+ else if ( (LA19_0=='r') ) {s = 16;}
+
+ else if ( (LA19_0=='t') ) {s = 17;}
+
+ else if ( (LA19_0=='u') ) {s = 18;}
+
+ else if ( (LA19_0=='v') ) {s = 19;}
+
+ else if ( (LA19_0=='w') ) {s = 20;}
+
+ else if ( (LA19_0=='x') ) {s = 21;}
+
+ else if ( (LA19_0=='N') ) {s = 22;}
+
+ else if ( (LA19_0=='z') ) {s = 23;}
+
+ else if ( (LA19_0=='k') ) {s = 24;}
+
+ else if ( (LA19_0=='q') ) {s = 25;}
+
+ else if ( (LA19_0=='|') ) {s = 26;}
+
+ else if ( (LA19_0=='(') ) {s = 27;}
+
+ else if ( (LA19_0==')') ) {s = 28;}
+
+ else if ( (LA19_0=='$') ) {s = 29;}
+
+ else if ( (LA19_0=='{') ) {s = 30;}
+
+ else if ( (LA19_0=='}') ) {s = 31;}
+
+ else if ( (LA19_0=='[') ) {s = 32;}
+
+ else if ( (LA19_0==']') ) {s = 33;}
+
+ else if ( (LA19_0=='=') ) {s = 34;}
+
+ else if ( (LA19_0==':') ) {s = 35;}
+
+ else if ( (LA19_0=='!') ) {s = 36;}
+
+ else if ( (LA19_0=='%') ) {s = 37;}
+
+ else if ( (LA19_0=='#') ) {s = 38;}
+
+ else if ( (LA19_0=='&') ) {s = 39;}
+
+ else if ( (LA19_0==',') ) {s = 40;}
+
+ else if ( (LA19_0=='?') ) {s = 41;}
+
+ else if ( (LA19_0=='*') ) {s = 42;}
+
+ else if ( (LA19_0=='+') ) {s = 43;}
+
+ else if ( (LA19_0=='-') ) {s = 44;}
+
+ else if ( (LA19_0=='<') ) {s = 45;}
+
+ else if ( (LA19_0=='>') ) {s = 46;}
+
+ else if ( (LA19_0=='/') ) {s = 47;}
+
+ else if ( (LA19_0=='.') ) {s = 48;}
+
+ else if ( (LA19_0==';') ) {s = 49;}
+
+ else if ( (LA19_0=='@') ) {s = 50;}
+
+ else if ( (LA19_0=='Q') ) {s = 51;}
+
+ else if ( (LA19_0=='\'') ) {s = 52;}
+
+ else if ( (LA19_0=='\"') ) {s = 53;}
+
+ else if ( ((LA19_0>='A' && LA19_0<='M')||(LA19_0>='O' && LA19_0<='P')||(LA19_0>='R' && LA19_0<='Z')||LA19_0=='_'||LA19_0=='h'||LA19_0=='y') ) {s = 54;}
+
+ else if ( ((LA19_0>='\t' && LA19_0<='\n')||LA19_0=='\r'||LA19_0==' ') ) {s = 55;}
+
+ else if ( ((LA19_0>='0' && LA19_0<='9')) ) {s = 56;}
+
+ else if ( ((LA19_0>='\u0000' && LA19_0<='\b')||(LA19_0>='\u000B' && LA19_0<='\f')||(LA19_0>='\u000E' && LA19_0<='\u001F')||LA19_0=='\\'||LA19_0=='^'||LA19_0=='`'||(LA19_0>='~' && LA19_0<='\uFFFF')) ) {s = 57;}
+
+ if ( s>=0 ) return s;
+ break;
+ case 2 :
+ var LA19_27 = input.LA(1);
+
+
+ var index19_27 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (LA19_27=='#') ) {s = 152;}
+
+ else if ( (LA19_27==':') && ((!this.inStr))) {s = 153;}
+
+ else s = 154;
+
+
+ input.seek(index19_27);
+ if ( s>=0 ) return s;
+ break;
+ }
+ }).call(this.recognizer, s, input);
+ if (!org.antlr.lang.isUndefined(retval)) {
+ return retval;
+ }
+ var nvae =
+ new org.antlr.runtime.NoViableAltException(this.getDescription(), 19, _s, input);
+ this.error(nvae);
+ throw nvae;
+ },
+ dummy: null
+});
+
+})();
+exports.XQueryLexer = XQueryLexer; });
+define('ace/mode/xquery/XQDTLexer', ['require', 'exports', 'module' , 'ace/mode/xquery/antlr3-all'], function(require, exports, module) {
+
+var org = require("./antlr3-all").org;
+
+var XQDTLexer = exports.XQDTLexer = function(input, state)
+{
+ XQDTLexer.superclass.constructor.call(this, input, state);
+};
+
+org.antlr.lang.extend(XQDTLexer, org.antlr.runtime.Lexer, {
+
+ comments: [],
+
+ addComment: function(start, stop){ this.comments.push({ start: start, stop: stop }); },
+
+ isWsExplicit: false,
+
+ setIsWsExplicit: function (wsExplicit) {
+ //console.log("A WS: " + wsExplicit);
+ this.isWsExplicit = wsExplicit;
+ //console.log("B WS: " + wsExplicit);
+ },
+
+ addToStack: function (stack) {
+ stack.push(this);
+ },
+
+ rewindToIndex: function(index) {
+ var stream = this.input;
+ stream.seek(index);
+ }
+});
+
+});
+define('ace/mode/xquery/XQueryParser', ['require', 'exports', 'module' , 'ace/mode/xquery/antlr3-all', 'ace/mode/xquery/StringLexer', 'ace/mode/xquery/XMLLexer', 'ace/mode/xquery/XQueryLexer', 'ace/mode/xquery/XQDTParser', 'ace/mode/xquery/Position'], function(require, exports, module) {// $ANTLR 3.3 Nov 30, 2010 12:50:56 /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g 2012-09-05 10:41:46
+
+/* ***** 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 ***** */
+var org = require("./antlr3-all").org;
+var StringLexer = require("./StringLexer").StringLexer;
+var XMLLexer = require("./XMLLexer").XMLLexer;
+var XQueryLexer = require("./XQueryLexer").XQueryLexer;
+var XQDTParser = require("./XQDTParser").XQDTParser;
+var Position = require("./Position").Position;
+var Exception = function(){};
+
+var XQS = true;
+var XQU = true;
+var ZORBA = true;
+
+
+
+var XQueryParser = function(input, state) {
+ if (!state) {
+ state = new org.antlr.runtime.RecognizerSharedState();
+ }
+
+ (function(){
+
+
+ this.isInAttr = false;
+
+ this.errors = [];
+
+ this.hasErrors = function(){
+ return this.errors.length > 0;
+ };
+
+ this.addError = function(error){
+ this.errors.push(error);
+ };
+
+ this.getErrors = function(){
+ return this.errors;
+ };
+
+ this.source = null;
+ this.setSource = function(s){
+ this.source = s;
+ this.highlighter.setSource(s);
+ };
+
+ this.lexerStack = new Array();
+
+ this.lc = function(b){ return b; };
+ this.popLexer = function (){
+ //console.log("popLexer");
+ if(this.lexerStack.length == 0) return;
+ this.getTokenStream().mark();
+ var oldLexer = this.getTokenStream().getTokenSource();
+ var newLexer = this.lexerStack.pop();
+ if(oldLexer instanceof StringLexer && newLexer instanceof XQueryLexer) {
+ newLexer.inStr = false;
+ }
+ this.getTokenStream().setTokenSource(newLexer);
+ };
+
+ this.pushXQueryLexer = function() {
+ xqueryLexer = new XQueryLexer(this.source);
+ this.pushLexer(xqueryLexer);
+ };
+
+ this.pushStringLexer = function(isAposStr){
+ //console.log("pushStringLexer");
+ var stringLexer = new StringLexer(this.source);
+ stringLexer.inAposStr = isAposStr;
+ stringLexer.inQuotStr = !isAposStr;
+ stringLexer.setIsWsExplicit(true);
+ this.pushLexer(stringLexer);
+ };
+
+ this.pushXMLLexer = function(){
+ //console.log("pushXMLLexer");
+ var xmlLexer = new XMLLexer(this.source);
+ xmlLexer.setIsWsExplicit(true);
+ this.pushLexer(xmlLexer);
+ };
+
+ this.pushLexer = function(lexer){
+ var oldLexer = this.getTokenStream().getTokenSource();
+ oldLexer.addToStack(this.lexerStack);
+ this.getTokenStream().setTokenSource(lexer);
+ };
+
+ this.setWsExplicit = function(isExplicit){
+ this.getTokenStream().setWsExplicit(isExplicit);
+ };
+
+ this.ap = function(token)
+ {
+ this.addToken(token, "xml_pe");
+ };
+
+ this.ax = function(start, stop)
+ {
+ this.highlighter.addToken(start.getStartIndex(), stop.getStopIndex(), "xml_pe");
+ };
+
+ this.at = function(start, stop)
+ {
+ this.highlighter.addToken(start.getStartIndex(), stop.getStopIndex(), "meta.tag");
+ };
+
+ this.av = function(start, stop)
+ {
+ this.highlighter.addToken(start.getStartIndex(), stop.getStopIndex(), "variable");
+ };
+
+ this.af = function(start, stop)
+ {
+ this.highlighter.addToken(start.getStartIndex(), stop.getStopIndex(), "support.function");
+ };
+
+ this.ao = function(t)
+ {
+ this.addToken(t, "keyword.operator");
+ };
+
+ this.ak = function(t)
+ {
+ this.addToken(t, "keyword");
+ };
+
+ this.ad = function(t)
+ {
+ this.addToken(t, "constant");
+ };
+
+ this.addString = function(start, stop)
+ {
+ if(stop == undefined) {
+ this.addToken(start, "string");
+ } else {
+ this.highlighter.addToken(start.getStartIndex(), stop.getStopIndex(), "string");
+ }
+ };
+
+ this.ac = function(t)
+ {
+ this.addToken(t, "comment");
+ };
+
+ this.addToken = function(k, type){
+ if(org.antlr.lang.isArray(k)){
+ for(i in k)
+ {
+ this.highlighter.addToken(k[i].getStartIndex(), k[i].getStopIndex(), type);
+ }
+ } else if(k != null ) {
+ this.highlighter.addToken(k.getStartIndex(), k.getStopIndex(), type);
+ }
+ };
+
+
+ }).call(this);
+
+ XQueryParser.superclass.constructor.call(this, input, state);
+
+ this.dfa1 = new XQueryParser.DFA1(this);
+ this.dfa2 = new XQueryParser.DFA2(this);
+ this.dfa6 = new XQueryParser.DFA6(this);
+ this.dfa9 = new XQueryParser.DFA9(this);
+ this.dfa44 = new XQueryParser.DFA44(this);
+ this.dfa46 = new XQueryParser.DFA46(this);
+ this.dfa119 = new XQueryParser.DFA119(this);
+ this.dfa121 = new XQueryParser.DFA121(this);
+ this.dfa123 = new XQueryParser.DFA123(this);
+ this.dfa128 = new XQueryParser.DFA128(this);
+ this.dfa129 = new XQueryParser.DFA129(this);
+ this.dfa136 = new XQueryParser.DFA136(this);
+ this.dfa172 = new XQueryParser.DFA172(this);
+ this.dfa195 = new XQueryParser.DFA195(this);
+ this.dfa230 = new XQueryParser.DFA230(this);
+ this.dfa249 = new XQueryParser.DFA249(this);
+ this.dfa265 = new XQueryParser.DFA265(this);
+ this.adaptor = new org.antlr.runtime.tree.CommonTreeAdaptor();
+
+};
+
+org.antlr.lang.augmentObject(XQueryParser, {
+ EOF: -1,
+ L_QuotAttrContentChar: 4,
+ L_AposAttrContentChar: 5,
+ L_ElementContentChar: 6,
+ L_CDataSection: 7,
+ L_PredefinedEntityRef: 8,
+ L_CharRef: 9,
+ ESCAPE_LBRACKET: 10,
+ ESCAPE_RBRACKET: 11,
+ ESCAPE_APOS: 12,
+ ESCAPE_QUOT: 13,
+ CDATA_START: 14,
+ CDATA_END: 15,
+ ANCESTOR: 16,
+ ANCESTOR_OR_SELF: 17,
+ AND: 18,
+ AS: 19,
+ ASCENDING: 20,
+ AT: 21,
+ ATTRIBUTE: 22,
+ BASE_URI: 23,
+ BOUNDARY_SPACE: 24,
+ BY: 25,
+ CASE: 26,
+ CAST: 27,
+ CASTABLE: 28,
+ CHILD: 29,
+ COLLATION: 30,
+ COMMENT: 31,
+ CONSTRUCTION: 32,
+ COPY_NAMESPACES: 33,
+ DECLARE: 34,
+ DEFAULT: 35,
+ DESCENDANT: 36,
+ DESCENDANT_OR_SELF: 37,
+ DESCENDING: 38,
+ DIV: 39,
+ DOCUMENT: 40,
+ DOCUMENT_NODE: 41,
+ ELEMENT: 42,
+ ELSE: 43,
+ EMPTY: 44,
+ EMPTY_SEQUENCE: 45,
+ ENCODING: 46,
+ EQ: 47,
+ EVERY: 48,
+ EXCEPT: 49,
+ EXTERNAL: 50,
+ FOLLOWING: 51,
+ FOLLOWING_SIBLING: 52,
+ FOR: 53,
+ FUNCTION: 54,
+ GE: 55,
+ GREATEST: 56,
+ GT: 57,
+ IDIV: 58,
+ IF: 59,
+ IMPORT: 60,
+ IN: 61,
+ INHERIT: 62,
+ INSTANCE: 63,
+ INTERSECT: 64,
+ IS: 65,
+ ITEM: 66,
+ LAX: 67,
+ LE: 68,
+ LEAST: 69,
+ LET: 70,
+ LT: 71,
+ MOD: 72,
+ MODULE: 73,
+ NAMESPACE: 74,
+ NE: 75,
+ NO_INHERIT: 76,
+ NO_PRESERVE: 77,
+ NODE: 78,
+ JSON: 79,
+ OF: 80,
+ OPTION: 81,
+ OR: 82,
+ ORDER: 83,
+ ORDERED: 84,
+ ORDERING: 85,
+ PARENT: 86,
+ PRECEDING: 87,
+ PRECEDING_SIBLING: 88,
+ PRESERVE: 89,
+ PROCESSING_INSTRUCTION: 90,
+ STRUCTURED_ITEM: 91,
+ JSON_ITEM: 92,
+ OBJECT: 93,
+ ARRAY: 94,
+ RETURN: 95,
+ SATISFIES: 96,
+ SCHEMA: 97,
+ SCHEMA_ATTRIBUTE: 98,
+ SCHEMA_ELEMENT: 99,
+ SELF: 100,
+ SOME: 101,
+ STABLE: 102,
+ STRICT: 103,
+ STRIP: 104,
+ TEXT: 105,
+ THEN: 106,
+ TO: 107,
+ TREAT: 108,
+ TYPESWITCH: 109,
+ UNION: 110,
+ UNORDERED: 111,
+ VALIDATE: 112,
+ VARIABLE: 113,
+ VERSION: 114,
+ WHERE: 115,
+ XQUERY: 116,
+ ALLOWING: 117,
+ CATCH: 118,
+ CONTEXT: 119,
+ COUNT: 120,
+ DECIMAL_FORMAT: 121,
+ DECIMAL_SEPARATOR: 122,
+ DIGIT: 123,
+ END: 124,
+ GROUP: 125,
+ GROUPING_SEPARATOR: 126,
+ INFINITY: 127,
+ MINUS_SIGN: 128,
+ NAMESPACE_NODE: 129,
+ NAN: 130,
+ NEXT: 131,
+ ONLY: 132,
+ PATTERN_SEPARATOR: 133,
+ PERCENT: 134,
+ PER_MILLE: 135,
+ PREVIOUS: 136,
+ SLIDING: 137,
+ START: 138,
+ SWITCH: 139,
+ TRY: 140,
+ TUMBLING: 141,
+ TYPE: 142,
+ WHEN: 143,
+ WINDOW: 144,
+ ZERO_DIGIT: 145,
+ AFTER: 146,
+ BEFORE: 147,
+ COPY: 148,
+ DELETE: 149,
+ FIRST: 150,
+ INSERT: 151,
+ INTO: 152,
+ POSITION: 153,
+ APPEND: 154,
+ LAST: 155,
+ MODIFY: 156,
+ NODES: 157,
+ RENAME: 158,
+ REPLACE: 159,
+ REVALIDATION: 160,
+ SKIP: 161,
+ UPDATING: 162,
+ VALUE: 163,
+ WITH: 164,
+ ALL: 165,
+ ANY: 166,
+ CONTAINS: 167,
+ CONTENT: 168,
+ DIACRITICS: 169,
+ DIFFERENT: 170,
+ DISTANCE: 171,
+ ENTIRE: 172,
+ EXACTLY: 173,
+ FROM: 174,
+ FT_OPTION: 175,
+ FTAND: 176,
+ FTNOT: 177,
+ FTOR: 178,
+ INSENSITIVE: 179,
+ LANGUAGE: 180,
+ LEVELS: 181,
+ LOWERCASE: 182,
+ MOST: 183,
+ NO: 184,
+ NOT: 185,
+ OCCURS: 186,
+ PARAGRAPH: 187,
+ PARAGRAPHS: 188,
+ PHRASE: 189,
+ RELATIONSHIP: 190,
+ SAME: 191,
+ SCORE: 192,
+ SENSITIVE: 193,
+ SENTENCE: 194,
+ SENTENCES: 195,
+ STEMMING: 196,
+ STOP: 197,
+ THESAURUS: 198,
+ TIMES: 199,
+ UPPERCASE: 200,
+ USING: 201,
+ WEIGHT: 202,
+ WILDCARDS: 203,
+ WITHOUT: 204,
+ WORD: 205,
+ WORDS: 206,
+ BREAK: 207,
+ CONTINUE: 208,
+ EXIT: 209,
+ LOOP: 210,
+ RETURNING: 211,
+ WHILE: 212,
+ CHECK: 213,
+ COLLECTION: 214,
+ CONSTRAINT: 215,
+ FOREACH: 216,
+ FOREIGN: 217,
+ INDEX: 218,
+ INTEGRITY: 219,
+ KEY: 220,
+ ON: 221,
+ UNIQUE: 222,
+ AMP_ER: 223,
+ APOS_ER: 224,
+ QUOT_ER: 225,
+ CONCAT: 226,
+ LPAREN: 227,
+ RPAREN: 228,
+ DOLLAR: 229,
+ L_UNION_BRACKET: 230,
+ R_UNION_BRACKET: 231,
+ LBRACKET: 232,
+ RBRACKET: 233,
+ LSQUARE: 234,
+ RSQUARE: 235,
+ EQUAL: 236,
+ BIND: 237,
+ NOTEQUAL: 238,
+ ANN_PERCENT: 239,
+ HASH: 240,
+ AMP: 241,
+ COMMA: 242,
+ QUESTION: 243,
+ STAR: 244,
+ PLUS: 245,
+ MINUS: 246,
+ SMALLER: 247,
+ GREATER: 248,
+ SMALLEREQ: 249,
+ GREATEREQ: 250,
+ SMALLER_SMALLER: 251,
+ GREATER_GREATER: 252,
+ SLASH: 253,
+ SLASH_SLASH: 254,
+ BANG: 255,
+ DOT: 256,
+ DOT_DOT: 257,
+ COLON: 258,
+ COLON_COLON: 259,
+ EMPTY_CLOSE_TAG: 260,
+ CLOSE_TAG: 261,
+ SEMICOLON: 262,
+ VBAR: 263,
+ PRAGMA_START: 264,
+ PRAGMA_END: 265,
+ XML_COMMENT_START: 266,
+ XML_COMMENT_END: 267,
+ PI_START: 268,
+ PI_END: 269,
+ ATTR_SIGN: 270,
+ Q: 271,
+ CHARREF_DEC: 272,
+ CHARREF_HEX: 273,
+ APOS: 274,
+ QUOT: 275,
+ NCNameStartChar: 276,
+ NCNameChar: 277,
+ L_NCName: 278,
+ Letter: 279,
+ HexLetter: 280,
+ Digit: 281,
+ Digits: 282,
+ S: 283,
+ SU: 284,
+ L_Pragma: 285,
+ L_DirCommentConstructor: 286,
+ L_DirPIConstructor: 287,
+ L_IntegerLiteral: 288,
+ L_DecimalLiteral: 289,
+ L_DoubleLiteral: 290,
+ L_Comment: 291,
+ L_AnyChar: 292,
+ L_QuotStringLiteralChar: 293,
+ L_AposStringLiteralChar: 294,
+ LibraryModule: 295,
+ MainModule: 296,
+ VersionDecl: 297,
+ VersionDeclEncoding: 298,
+ VersionDeclVersion: 299,
+ ModuleDecl: 300,
+ Prolog: 301,
+ DefaultNamespaceDecls: 302,
+ DefaultNamespaceDecl: 303,
+ Setters: 304,
+ Setter: 305,
+ NamespaceDecls: 306,
+ NamespaceDecl: 307,
+ Imports: 308,
+ FTOptionDecls: 309,
+ SchemaImport: 310,
+ SchemaPrefix: 311,
+ NamespaceName: 312,
+ DefaultElementNamespace: 313,
+ AtHints: 314,
+ ModuleImport: 315,
+ BaseURIDecl: 316,
+ OrderedDecls: 317,
+ VarDecl: 318,
+ VarType: 319,
+ VarValue: 320,
+ VarDefaultValue: 321,
+ VarVariableDecl: 322,
+ FunctionDecl: 323,
+ ParamList: 324,
+ ReturnType: 325,
+ OptionDecl: 326,
+ TypeDeclaration: 327,
+ Param: 328,
+ EnclosedExpr: 329,
+ QueryBody: 330,
+ UnaryExpr: 331,
+ DirElemConstructor: 332,
+ DirAttributeList: 333,
+ DirAttributeValue: 334,
+ DirElemContent: 335,
+ CommonContent: 336,
+ SequenceType: 337,
+ EmptySequenceTest: 338,
+ KindTest: 339,
+ ItemTest: 340,
+ FunctionTest: 341,
+ AtomicType: 342,
+ AtomicOrUnionType: 343,
+ StringLiteral: 344,
+ ElementContentChar: 345,
+ AttributeValueChar: 346,
+ QName: 347,
+ BlockExpr: 348
+});
+
+(function(){
+// public class variables
+var EOF= -1,
+ L_QuotAttrContentChar= 4,
+ L_AposAttrContentChar= 5,
+ L_ElementContentChar= 6,
+ L_CDataSection= 7,
+ L_PredefinedEntityRef= 8,
+ L_CharRef= 9,
+ ESCAPE_LBRACKET= 10,
+ ESCAPE_RBRACKET= 11,
+ ESCAPE_APOS= 12,
+ ESCAPE_QUOT= 13,
+ CDATA_START= 14,
+ CDATA_END= 15,
+ ANCESTOR= 16,
+ ANCESTOR_OR_SELF= 17,
+ AND= 18,
+ AS= 19,
+ ASCENDING= 20,
+ AT= 21,
+ ATTRIBUTE= 22,
+ BASE_URI= 23,
+ BOUNDARY_SPACE= 24,
+ BY= 25,
+ CASE= 26,
+ CAST= 27,
+ CASTABLE= 28,
+ CHILD= 29,
+ COLLATION= 30,
+ COMMENT= 31,
+ CONSTRUCTION= 32,
+ COPY_NAMESPACES= 33,
+ DECLARE= 34,
+ DEFAULT= 35,
+ DESCENDANT= 36,
+ DESCENDANT_OR_SELF= 37,
+ DESCENDING= 38,
+ DIV= 39,
+ DOCUMENT= 40,
+ DOCUMENT_NODE= 41,
+ ELEMENT= 42,
+ ELSE= 43,
+ EMPTY= 44,
+ EMPTY_SEQUENCE= 45,
+ ENCODING= 46,
+ EQ= 47,
+ EVERY= 48,
+ EXCEPT= 49,
+ EXTERNAL= 50,
+ FOLLOWING= 51,
+ FOLLOWING_SIBLING= 52,
+ FOR= 53,
+ FUNCTION= 54,
+ GE= 55,
+ GREATEST= 56,
+ GT= 57,
+ IDIV= 58,
+ IF= 59,
+ IMPORT= 60,
+ IN= 61,
+ INHERIT= 62,
+ INSTANCE= 63,
+ INTERSECT= 64,
+ IS= 65,
+ ITEM= 66,
+ LAX= 67,
+ LE= 68,
+ LEAST= 69,
+ LET= 70,
+ LT= 71,
+ MOD= 72,
+ MODULE= 73,
+ NAMESPACE= 74,
+ NE= 75,
+ NO_INHERIT= 76,
+ NO_PRESERVE= 77,
+ NODE= 78,
+ JSON= 79,
+ OF= 80,
+ OPTION= 81,
+ OR= 82,
+ ORDER= 83,
+ ORDERED= 84,
+ ORDERING= 85,
+ PARENT= 86,
+ PRECEDING= 87,
+ PRECEDING_SIBLING= 88,
+ PRESERVE= 89,
+ PROCESSING_INSTRUCTION= 90,
+ STRUCTURED_ITEM= 91,
+ JSON_ITEM= 92,
+ OBJECT= 93,
+ ARRAY= 94,
+ RETURN= 95,
+ SATISFIES= 96,
+ SCHEMA= 97,
+ SCHEMA_ATTRIBUTE= 98,
+ SCHEMA_ELEMENT= 99,
+ SELF= 100,
+ SOME= 101,
+ STABLE= 102,
+ STRICT= 103,
+ STRIP= 104,
+ TEXT= 105,
+ THEN= 106,
+ TO= 107,
+ TREAT= 108,
+ TYPESWITCH= 109,
+ UNION= 110,
+ UNORDERED= 111,
+ VALIDATE= 112,
+ VARIABLE= 113,
+ VERSION= 114,
+ WHERE= 115,
+ XQUERY= 116,
+ ALLOWING= 117,
+ CATCH= 118,
+ CONTEXT= 119,
+ COUNT= 120,
+ DECIMAL_FORMAT= 121,
+ DECIMAL_SEPARATOR= 122,
+ DIGIT= 123,
+ END= 124,
+ GROUP= 125,
+ GROUPING_SEPARATOR= 126,
+ INFINITY= 127,
+ MINUS_SIGN= 128,
+ NAMESPACE_NODE= 129,
+ NAN= 130,
+ NEXT= 131,
+ ONLY= 132,
+ PATTERN_SEPARATOR= 133,
+ PERCENT= 134,
+ PER_MILLE= 135,
+ PREVIOUS= 136,
+ SLIDING= 137,
+ START= 138,
+ SWITCH= 139,
+ TRY= 140,
+ TUMBLING= 141,
+ TYPE= 142,
+ WHEN= 143,
+ WINDOW= 144,
+ ZERO_DIGIT= 145,
+ AFTER= 146,
+ BEFORE= 147,
+ COPY= 148,
+ DELETE= 149,
+ FIRST= 150,
+ INSERT= 151,
+ INTO= 152,
+ POSITION= 153,
+ APPEND= 154,
+ LAST= 155,
+ MODIFY= 156,
+ NODES= 157,
+ RENAME= 158,
+ REPLACE= 159,
+ REVALIDATION= 160,
+ SKIP= 161,
+ UPDATING= 162,
+ VALUE= 163,
+ WITH= 164,
+ ALL= 165,
+ ANY= 166,
+ CONTAINS= 167,
+ CONTENT= 168,
+ DIACRITICS= 169,
+ DIFFERENT= 170,
+ DISTANCE= 171,
+ ENTIRE= 172,
+ EXACTLY= 173,
+ FROM= 174,
+ FT_OPTION= 175,
+ FTAND= 176,
+ FTNOT= 177,
+ FTOR= 178,
+ INSENSITIVE= 179,
+ LANGUAGE= 180,
+ LEVELS= 181,
+ LOWERCASE= 182,
+ MOST= 183,
+ NO= 184,
+ NOT= 185,
+ OCCURS= 186,
+ PARAGRAPH= 187,
+ PARAGRAPHS= 188,
+ PHRASE= 189,
+ RELATIONSHIP= 190,
+ SAME= 191,
+ SCORE= 192,
+ SENSITIVE= 193,
+ SENTENCE= 194,
+ SENTENCES= 195,
+ STEMMING= 196,
+ STOP= 197,
+ THESAURUS= 198,
+ TIMES= 199,
+ UPPERCASE= 200,
+ USING= 201,
+ WEIGHT= 202,
+ WILDCARDS= 203,
+ WITHOUT= 204,
+ WORD= 205,
+ WORDS= 206,
+ BREAK= 207,
+ CONTINUE= 208,
+ EXIT= 209,
+ LOOP= 210,
+ RETURNING= 211,
+ WHILE= 212,
+ CHECK= 213,
+ COLLECTION= 214,
+ CONSTRAINT= 215,
+ FOREACH= 216,
+ FOREIGN= 217,
+ INDEX= 218,
+ INTEGRITY= 219,
+ KEY= 220,
+ ON= 221,
+ UNIQUE= 222,
+ AMP_ER= 223,
+ APOS_ER= 224,
+ QUOT_ER= 225,
+ CONCAT= 226,
+ LPAREN= 227,
+ RPAREN= 228,
+ DOLLAR= 229,
+ L_UNION_BRACKET= 230,
+ R_UNION_BRACKET= 231,
+ LBRACKET= 232,
+ RBRACKET= 233,
+ LSQUARE= 234,
+ RSQUARE= 235,
+ EQUAL= 236,
+ BIND= 237,
+ NOTEQUAL= 238,
+ ANN_PERCENT= 239,
+ HASH= 240,
+ AMP= 241,
+ COMMA= 242,
+ QUESTION= 243,
+ STAR= 244,
+ PLUS= 245,
+ MINUS= 246,
+ SMALLER= 247,
+ GREATER= 248,
+ SMALLEREQ= 249,
+ GREATEREQ= 250,
+ SMALLER_SMALLER= 251,
+ GREATER_GREATER= 252,
+ SLASH= 253,
+ SLASH_SLASH= 254,
+ BANG= 255,
+ DOT= 256,
+ DOT_DOT= 257,
+ COLON= 258,
+ COLON_COLON= 259,
+ EMPTY_CLOSE_TAG= 260,
+ CLOSE_TAG= 261,
+ SEMICOLON= 262,
+ VBAR= 263,
+ PRAGMA_START= 264,
+ PRAGMA_END= 265,
+ XML_COMMENT_START= 266,
+ XML_COMMENT_END= 267,
+ PI_START= 268,
+ PI_END= 269,
+ ATTR_SIGN= 270,
+ Q= 271,
+ CHARREF_DEC= 272,
+ CHARREF_HEX= 273,
+ APOS= 274,
+ QUOT= 275,
+ NCNameStartChar= 276,
+ NCNameChar= 277,
+ L_NCName= 278,
+ Letter= 279,
+ HexLetter= 280,
+ Digit= 281,
+ Digits= 282,
+ S= 283,
+ SU= 284,
+ L_Pragma= 285,
+ L_DirCommentConstructor= 286,
+ L_DirPIConstructor= 287,
+ L_IntegerLiteral= 288,
+ L_DecimalLiteral= 289,
+ L_DoubleLiteral= 290,
+ L_Comment= 291,
+ L_AnyChar= 292,
+ L_QuotStringLiteralChar= 293,
+ L_AposStringLiteralChar= 294,
+ LibraryModule= 295,
+ MainModule= 296,
+ VersionDecl= 297,
+ VersionDeclEncoding= 298,
+ VersionDeclVersion= 299,
+ ModuleDecl= 300,
+ Prolog= 301,
+ DefaultNamespaceDecls= 302,
+ DefaultNamespaceDecl= 303,
+ Setters= 304,
+ Setter= 305,
+ NamespaceDecls= 306,
+ NamespaceDecl= 307,
+ Imports= 308,
+ FTOptionDecls= 309,
+ SchemaImport= 310,
+ SchemaPrefix= 311,
+ NamespaceName= 312,
+ DefaultElementNamespace= 313,
+ AtHints= 314,
+ ModuleImport= 315,
+ BaseURIDecl= 316,
+ OrderedDecls= 317,
+ VarDecl= 318,
+ VarType= 319,
+ VarValue= 320,
+ VarDefaultValue= 321,
+ VarVariableDecl= 322,
+ FunctionDecl= 323,
+ ParamList= 324,
+ ReturnType= 325,
+ OptionDecl= 326,
+ TypeDeclaration= 327,
+ Param= 328,
+ EnclosedExpr= 329,
+ QueryBody= 330,
+ UnaryExpr= 331,
+ DirElemConstructor= 332,
+ DirAttributeList= 333,
+ DirAttributeValue= 334,
+ DirElemContent= 335,
+ CommonContent= 336,
+ SequenceType= 337,
+ EmptySequenceTest= 338,
+ KindTest= 339,
+ ItemTest= 340,
+ FunctionTest= 341,
+ AtomicType= 342,
+ AtomicOrUnionType= 343,
+ StringLiteral= 344,
+ ElementContentChar= 345,
+ AttributeValueChar= 346,
+ QName= 347,
+ BlockExpr= 348;
+
+// public instance methods/vars
+org.antlr.lang.extend(XQueryParser, XQDTParser, {
+
+ setTreeAdaptor: function(adaptor) {
+ this.adaptor = adaptor;
+ },
+ getTreeAdaptor: function() {
+ return this.adaptor;
+ },
+
+ getTokenNames: function() { return XQueryParser.tokenNames; },
+ getGrammarFileName: function() { return "/Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g"; }
+});
+org.antlr.lang.augmentObject(XQueryParser.prototype, {
+
+ // inline static return class
+ p_Module_return: (function() {
+ XQueryParser.p_Module_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_Module_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:292:1: p_Module : (vd= p_VersionDecl )? (lm= p_LibraryModule[$vd.tree] -> | mm= p_MainModule[$vd.tree] ->) EOF ;
+ // $ANTLR start "p_Module"
+ p_Module: function() {
+ var retval = new XQueryParser.p_Module_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var EOF1 = null;
+ var vd = null;
+ var lm = null;
+ var mm = null;
+
+ var EOF1_tree=null;
+ var stream_EOF=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token EOF");
+ var stream_p_VersionDecl=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"rule p_VersionDecl");
+ var stream_p_LibraryModule=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"rule p_LibraryModule");
+ var stream_p_MainModule=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"rule p_MainModule");
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:293:9: ( (vd= p_VersionDecl )? (lm= p_LibraryModule[$vd.tree] -> | mm= p_MainModule[$vd.tree] ->) EOF )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:293:11: (vd= p_VersionDecl )? (lm= p_LibraryModule[$vd.tree] -> | mm= p_MainModule[$vd.tree] ->) EOF
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:293:13: (vd= p_VersionDecl )?
+ var alt1=2;
+ alt1 = this.dfa1.predict(this.input);
+ switch (alt1) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:293:13: vd= p_VersionDecl
+ this.pushFollow(XQueryParser.FOLLOW_p_VersionDecl_in_p_Module503);
+ vd=this.p_VersionDecl();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_p_VersionDecl.add(vd.getTree());
+
+
+ break;
+
+ }
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:294:13: (lm= p_LibraryModule[$vd.tree] -> | mm= p_MainModule[$vd.tree] ->)
+ var alt2=2;
+ alt2 = this.dfa2.predict(this.input);
+ switch (alt2) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:295:15: lm= p_LibraryModule[$vd.tree]
+ this.pushFollow(XQueryParser.FOLLOW_p_LibraryModule_in_p_Module536);
+ lm=this.p_LibraryModule((vd?vd.tree:null));
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_p_LibraryModule.add(lm.getTree());
+
+
+ // AST REWRITE
+ // elements:
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( this.state.backtracking===0 ) {
+ retval.tree = root_0;
+ var stream_retval=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = this.adaptor.nil();
+ // 295:44: ->
+ {
+ this.adaptor.addChild(root_0, (lm?lm.tree:null));
+
+ }
+
+ retval.tree = root_0;}
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:296:15: mm= p_MainModule[$vd.tree]
+ this.pushFollow(XQueryParser.FOLLOW_p_MainModule_in_p_Module559);
+ mm=this.p_MainModule((vd?vd.tree:null));
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_p_MainModule.add(mm.getTree());
+
+
+ // AST REWRITE
+ // elements:
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( this.state.backtracking===0 ) {
+ retval.tree = root_0;
+ var stream_retval=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = this.adaptor.nil();
+ // 296:44: ->
+ {
+ this.adaptor.addChild(root_0, (mm?mm.tree:null));
+
+ }
+
+ retval.tree = root_0;}
+
+ break;
+
+ }
+
+ EOF1=this.match(this.input,EOF,XQueryParser.FOLLOW_EOF_in_p_Module583); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_EOF.add(EOF1);
+
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_VersionDecl_return: (function() {
+ XQueryParser.p_VersionDecl_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_VersionDecl_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:301:1: p_VersionDecl : k= XQUERY ( (k= ENCODING enc= p_StringLiteral ) | (k= VERSION ver= p_StringLiteral (k= ENCODING enc= p_StringLiteral )? ) ) SEMICOLON -> ^( VersionDecl ^( VersionDeclVersion ( $ver)? ) ^( VersionDeclEncoding ( $enc)? ) ) ;
+ // $ANTLR start "p_VersionDecl"
+ p_VersionDecl: function() {
+ var retval = new XQueryParser.p_VersionDecl_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var SEMICOLON2 = null;
+ var enc = null;
+ var ver = null;
+
+ var k_tree=null;
+ var SEMICOLON2_tree=null;
+ var stream_ENCODING=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token ENCODING");
+ var stream_VERSION=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token VERSION");
+ var stream_SEMICOLON=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token SEMICOLON");
+ var stream_XQUERY=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token XQUERY");
+ var stream_p_StringLiteral=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"rule p_StringLiteral");
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:302:9: (k= XQUERY ( (k= ENCODING enc= p_StringLiteral ) | (k= VERSION ver= p_StringLiteral (k= ENCODING enc= p_StringLiteral )? ) ) SEMICOLON -> ^( VersionDecl ^( VersionDeclVersion ( $ver)? ) ^( VersionDeclEncoding ( $enc)? ) ) )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:302:11: k= XQUERY ( (k= ENCODING enc= p_StringLiteral ) | (k= VERSION ver= p_StringLiteral (k= ENCODING enc= p_StringLiteral )? ) ) SEMICOLON
+ k=this.match(this.input,XQUERY,XQueryParser.FOLLOW_XQUERY_in_p_VersionDecl611); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_XQUERY.add(k);
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:302:35: ( (k= ENCODING enc= p_StringLiteral ) | (k= VERSION ver= p_StringLiteral (k= ENCODING enc= p_StringLiteral )? ) )
+ var alt4=2;
+ var LA4_0 = this.input.LA(1);
+
+ if ( (LA4_0==ENCODING) ) {
+ alt4=1;
+ }
+ else if ( (LA4_0==VERSION) ) {
+ alt4=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 4, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt4) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:302:36: (k= ENCODING enc= p_StringLiteral )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:302:36: (k= ENCODING enc= p_StringLiteral )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:302:37: k= ENCODING enc= p_StringLiteral
+ k=this.match(this.input,ENCODING,XQueryParser.FOLLOW_ENCODING_in_p_VersionDecl619); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_ENCODING.add(k);
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_StringLiteral_in_p_VersionDecl625);
+ enc=this.p_StringLiteral();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_p_StringLiteral.add(enc.getTree());
+
+
+
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:303:13: (k= VERSION ver= p_StringLiteral (k= ENCODING enc= p_StringLiteral )? )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:303:13: (k= VERSION ver= p_StringLiteral (k= ENCODING enc= p_StringLiteral )? )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:303:14: k= VERSION ver= p_StringLiteral (k= ENCODING enc= p_StringLiteral )?
+ k=this.match(this.input,VERSION,XQueryParser.FOLLOW_VERSION_in_p_VersionDecl646); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_VERSION.add(k);
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_StringLiteral_in_p_VersionDecl652);
+ ver=this.p_StringLiteral();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_p_StringLiteral.add(ver.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:303:59: (k= ENCODING enc= p_StringLiteral )?
+ var alt3=2;
+ var LA3_0 = this.input.LA(1);
+
+ if ( (LA3_0==ENCODING) ) {
+ alt3=1;
+ }
+ switch (alt3) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:303:60: k= ENCODING enc= p_StringLiteral
+ k=this.match(this.input,ENCODING,XQueryParser.FOLLOW_ENCODING_in_p_VersionDecl657); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_ENCODING.add(k);
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_StringLiteral_in_p_VersionDecl663);
+ enc=this.p_StringLiteral();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_p_StringLiteral.add(enc.getTree());
+
+
+ break;
+
+ }
+
+
+
+
+
+
+ break;
+
+ }
+
+ SEMICOLON2=this.match(this.input,SEMICOLON,XQueryParser.FOLLOW_SEMICOLON_in_p_VersionDecl669); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_SEMICOLON.add(SEMICOLON2);
+
+
+
+ // AST REWRITE
+ // elements: ver, enc
+ // token labels:
+ // rule labels: retval, ver, enc
+ // token list labels:
+ // rule list labels:
+ if ( this.state.backtracking===0 ) {
+ retval.tree = root_0;
+ var stream_retval=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token retval",retval!=null?retval.tree:null);
+ var stream_ver=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token ver",ver!=null?ver.tree:null);
+ var stream_enc=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token enc",enc!=null?enc.tree:null);
+
+ root_0 = this.adaptor.nil();
+ // 304:17: -> ^( VersionDecl ^( VersionDeclVersion ( $ver)? ) ^( VersionDeclEncoding ( $enc)? ) )
+ {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:304:20: ^( VersionDecl ^( VersionDeclVersion ( $ver)? ) ^( VersionDeclEncoding ( $enc)? ) )
+ {
+ var root_1 = this.adaptor.nil();
+ root_1 = this.adaptor.becomeRoot(this.adaptor.create(VersionDecl, "VersionDecl"), root_1);
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:304:34: ^( VersionDeclVersion ( $ver)? )
+ {
+ var root_2 = this.adaptor.nil();
+ root_2 = this.adaptor.becomeRoot(this.adaptor.create(VersionDeclVersion, "VersionDeclVersion"), root_2);
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:304:55: ( $ver)?
+ if ( stream_ver.hasNext() ) {
+ this.adaptor.addChild(root_2, stream_ver.nextTree());
+
+ }
+ stream_ver.reset();
+
+ this.adaptor.addChild(root_1, root_2);
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:304:62: ^( VersionDeclEncoding ( $enc)? )
+ {
+ var root_2 = this.adaptor.nil();
+ root_2 = this.adaptor.becomeRoot(this.adaptor.create(VersionDeclEncoding, "VersionDeclEncoding"), root_2);
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:304:84: ( $enc)?
+ if ( stream_enc.hasNext() ) {
+ this.adaptor.addChild(root_2, stream_enc.nextTree());
+
+ }
+ stream_enc.reset();
+
+ this.adaptor.addChild(root_1, root_2);
+ }
+
+ this.adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;}
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_MainModule_return: (function() {
+ XQueryParser.p_MainModule_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_MainModule_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:308:1: p_MainModule[vd] : pm_Prolog pm_QueryBody -> ^( MainModule pm_Prolog ) ;
+ // $ANTLR start "p_MainModule"
+ p_MainModule: function(vd) {
+ var retval = new XQueryParser.p_MainModule_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var pm_Prolog3 = null;
+ var pm_QueryBody4 = null;
+
+ var stream_pm_QueryBody=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"rule pm_QueryBody");
+ var stream_pm_Prolog=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"rule pm_Prolog");
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:309:9: ( pm_Prolog pm_QueryBody -> ^( MainModule pm_Prolog ) )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:309:11: pm_Prolog pm_QueryBody
+ this.pushFollow(XQueryParser.FOLLOW_pm_Prolog_in_p_MainModule735);
+ pm_Prolog3=this.pm_Prolog();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_pm_Prolog.add(pm_Prolog3.getTree());
+ this.pushFollow(XQueryParser.FOLLOW_pm_QueryBody_in_p_MainModule737);
+ pm_QueryBody4=this.pm_QueryBody();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_pm_QueryBody.add(pm_QueryBody4.getTree());
+
+
+ // AST REWRITE
+ // elements: pm_Prolog
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( this.state.backtracking===0 ) {
+ retval.tree = root_0;
+ var stream_retval=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = this.adaptor.nil();
+ // 310:17: -> ^( MainModule pm_Prolog )
+ {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:310:20: ^( MainModule pm_Prolog )
+ {
+ var root_1 = this.adaptor.nil();
+ root_1 = this.adaptor.becomeRoot(this.adaptor.create(MainModule, "MainModule"), root_1);
+
+ this.adaptor.addChild(root_1, vd);
+ this.adaptor.addChild(root_1, stream_pm_Prolog.nextTree());
+
+ this.adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;}
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_LibraryModule_return: (function() {
+ XQueryParser.p_LibraryModule_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_LibraryModule_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:314:1: p_LibraryModule[vd] : p_ModuleDecl pm_Prolog -> ^( LibraryModule p_ModuleDecl pm_Prolog ) ;
+ // $ANTLR start "p_LibraryModule"
+ p_LibraryModule: function(vd) {
+ var retval = new XQueryParser.p_LibraryModule_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_ModuleDecl5 = null;
+ var pm_Prolog6 = null;
+
+ var stream_pm_Prolog=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"rule pm_Prolog");
+ var stream_p_ModuleDecl=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"rule p_ModuleDecl");
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:315:9: ( p_ModuleDecl pm_Prolog -> ^( LibraryModule p_ModuleDecl pm_Prolog ) )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:315:11: p_ModuleDecl pm_Prolog
+ this.pushFollow(XQueryParser.FOLLOW_p_ModuleDecl_in_p_LibraryModule793);
+ p_ModuleDecl5=this.p_ModuleDecl();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_p_ModuleDecl.add(p_ModuleDecl5.getTree());
+ this.pushFollow(XQueryParser.FOLLOW_pm_Prolog_in_p_LibraryModule795);
+ pm_Prolog6=this.pm_Prolog();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_pm_Prolog.add(pm_Prolog6.getTree());
+
+
+ // AST REWRITE
+ // elements: pm_Prolog, p_ModuleDecl
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( this.state.backtracking===0 ) {
+ retval.tree = root_0;
+ var stream_retval=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = this.adaptor.nil();
+ // 316:17: -> ^( LibraryModule p_ModuleDecl pm_Prolog )
+ {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:316:20: ^( LibraryModule p_ModuleDecl pm_Prolog )
+ {
+ var root_1 = this.adaptor.nil();
+ root_1 = this.adaptor.becomeRoot(this.adaptor.create(LibraryModule, "LibraryModule"), root_1);
+
+ this.adaptor.addChild(root_1, vd);
+ this.adaptor.addChild(root_1, stream_p_ModuleDecl.nextTree());
+ this.adaptor.addChild(root_1, stream_pm_Prolog.nextTree());
+
+ this.adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;}
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_ModuleDecl_return: (function() {
+ XQueryParser.p_ModuleDecl_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_ModuleDecl_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:320:1: p_ModuleDecl : k+= MODULE k+= NAMESPACE p_NCName EQUAL p_StringLiteral SEMICOLON -> ^( ModuleDecl p_NCName p_StringLiteral ) ;
+ // $ANTLR start "p_ModuleDecl"
+ p_ModuleDecl: function() {
+ var retval = new XQueryParser.p_ModuleDecl_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var EQUAL8 = null;
+ var SEMICOLON10 = null;
+ var k = null;
+ var list_k=null;
+ var p_NCName7 = null;
+ var p_StringLiteral9 = null;
+
+ var EQUAL8_tree=null;
+ var SEMICOLON10_tree=null;
+ var k_tree=null;
+ var stream_SEMICOLON=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token SEMICOLON");
+ var stream_MODULE=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token MODULE");
+ var stream_NAMESPACE=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token NAMESPACE");
+ var stream_EQUAL=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token EQUAL");
+ var stream_p_NCName=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"rule p_NCName");
+ var stream_p_StringLiteral=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"rule p_StringLiteral");
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:321:9: (k+= MODULE k+= NAMESPACE p_NCName EQUAL p_StringLiteral SEMICOLON -> ^( ModuleDecl p_NCName p_StringLiteral ) )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:321:11: k+= MODULE k+= NAMESPACE p_NCName EQUAL p_StringLiteral SEMICOLON
+ k=this.match(this.input,MODULE,XQueryParser.FOLLOW_MODULE_in_p_ModuleDecl851); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_MODULE.add(k);
+
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ k=this.match(this.input,NAMESPACE,XQueryParser.FOLLOW_NAMESPACE_in_p_ModuleDecl855); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_NAMESPACE.add(k);
+
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(list_k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_NCName_in_p_ModuleDecl859);
+ p_NCName7=this.p_NCName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_p_NCName.add(p_NCName7.getTree());
+ EQUAL8=this.match(this.input,EQUAL,XQueryParser.FOLLOW_EQUAL_in_p_ModuleDecl861); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_EQUAL.add(EQUAL8);
+
+ this.pushFollow(XQueryParser.FOLLOW_p_StringLiteral_in_p_ModuleDecl863);
+ p_StringLiteral9=this.p_StringLiteral();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_p_StringLiteral.add(p_StringLiteral9.getTree());
+ SEMICOLON10=this.match(this.input,SEMICOLON,XQueryParser.FOLLOW_SEMICOLON_in_p_ModuleDecl865); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_SEMICOLON.add(SEMICOLON10);
+
+
+
+ // AST REWRITE
+ // elements: p_NCName, p_StringLiteral
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( this.state.backtracking===0 ) {
+ retval.tree = root_0;
+ var stream_retval=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = this.adaptor.nil();
+ // 322:17: -> ^( ModuleDecl p_NCName p_StringLiteral )
+ {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:322:21: ^( ModuleDecl p_NCName p_StringLiteral )
+ {
+ var root_1 = this.adaptor.nil();
+ root_1 = this.adaptor.becomeRoot(this.adaptor.create(ModuleDecl, "ModuleDecl"), root_1);
+
+ this.adaptor.addChild(root_1, stream_p_NCName.nextTree());
+ this.adaptor.addChild(root_1, stream_p_StringLiteral.nextTree());
+
+ this.adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;}
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ pm_Prolog_return: (function() {
+ XQueryParser.pm_Prolog_return = function(){};
+ org.antlr.lang.extend(XQueryParser.pm_Prolog_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:328:1: pm_Prolog : ( (dnd+= pm_DefaultNamespaceDecl | s+= p_Setter | nd+= pm_NamespaceDecl | i+= p_Import | fto+= pm_FTOptionDecl ) )* (od+= pg_OrderedDecl )* -> ^( Prolog ^( DefaultNamespaceDecls ( $dnd)* ) ^( Setters ( $s)* ) ^( NamespaceDecls ( $nd)* ) ^( Imports ( $i)* ) ^( FTOptionDecls ( $fto)* ) ^( OrderedDecls ( $od)* ) ) ;
+ // $ANTLR start "pm_Prolog"
+ pm_Prolog: function() {
+ var retval = new XQueryParser.pm_Prolog_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var list_dnd=null;
+ var list_s=null;
+ var list_nd=null;
+ var list_i=null;
+ var list_fto=null;
+ var list_od=null;
+ var dnd = null;
+ var s = null;
+ var nd = null;
+ var i = null;
+ var fto = null;
+ var od = null;
+ var stream_pm_NamespaceDecl=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"rule pm_NamespaceDecl");
+ var stream_p_Import=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"rule p_Import");
+ var stream_p_Setter=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"rule p_Setter");
+ var stream_pm_DefaultNamespaceDecl=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"rule pm_DefaultNamespaceDecl");
+ var stream_pg_OrderedDecl=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"rule pg_OrderedDecl");
+ var stream_pm_FTOptionDecl=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"rule pm_FTOptionDecl");
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:329:9: ( ( (dnd+= pm_DefaultNamespaceDecl | s+= p_Setter | nd+= pm_NamespaceDecl | i+= p_Import | fto+= pm_FTOptionDecl ) )* (od+= pg_OrderedDecl )* -> ^( Prolog ^( DefaultNamespaceDecls ( $dnd)* ) ^( Setters ( $s)* ) ^( NamespaceDecls ( $nd)* ) ^( Imports ( $i)* ) ^( FTOptionDecls ( $fto)* ) ^( OrderedDecls ( $od)* ) ) )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:329:11: ( (dnd+= pm_DefaultNamespaceDecl | s+= p_Setter | nd+= pm_NamespaceDecl | i+= p_Import | fto+= pm_FTOptionDecl ) )* (od+= pg_OrderedDecl )*
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:329:11: ( (dnd+= pm_DefaultNamespaceDecl | s+= p_Setter | nd+= pm_NamespaceDecl | i+= p_Import | fto+= pm_FTOptionDecl ) )*
+ loop6:
+ do {
+ var alt6=2;
+ alt6 = this.dfa6.predict(this.input);
+ switch (alt6) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:329:12: (dnd+= pm_DefaultNamespaceDecl | s+= p_Setter | nd+= pm_NamespaceDecl | i+= p_Import | fto+= pm_FTOptionDecl )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:329:12: (dnd+= pm_DefaultNamespaceDecl | s+= p_Setter | nd+= pm_NamespaceDecl | i+= p_Import | fto+= pm_FTOptionDecl )
+ var alt5=5;
+ var LA5_0 = this.input.LA(1);
+
+ if ( (LA5_0==DECLARE) ) {
+ var LA5_1 = this.input.LA(2);
+
+ if ( (LA5_1==REVALIDATION) && ((this.lc(XQU)))) {
+ alt5=2;
+ }
+ else if ( (LA5_1==FT_OPTION) ) {
+ alt5=5;
+ }
+ else if ( (LA5_1==DEFAULT) ) {
+ var LA5_5 = this.input.LA(3);
+
+ if ( (LA5_5==ELEMENT||LA5_5==FUNCTION) ) {
+ alt5=1;
+ }
+ else if ( (LA5_5==COLLATION||LA5_5==ORDER||LA5_5==DECIMAL_FORMAT) ) {
+ alt5=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 5, 5, this.input);
+
+ throw nvae;
+ }
+ }
+ else if ( ((LA5_1>=BASE_URI && LA5_1<=BOUNDARY_SPACE)||(LA5_1>=CONSTRUCTION && LA5_1<=COPY_NAMESPACES)||LA5_1==ORDERING||LA5_1==DECIMAL_FORMAT) ) {
+ alt5=2;
+ }
+ else if ( (LA5_1==NAMESPACE) ) {
+ alt5=3;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 5, 1, this.input);
+
+ throw nvae;
+ }
+ }
+ else if ( (LA5_0==IMPORT) ) {
+ alt5=4;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 5, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt5) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:329:13: dnd+= pm_DefaultNamespaceDecl
+ this.pushFollow(XQueryParser.FOLLOW_pm_DefaultNamespaceDecl_in_pm_Prolog924);
+ dnd=this.pm_DefaultNamespaceDecl();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_pm_DefaultNamespaceDecl.add(dnd.getTree());
+ if (org.antlr.lang.isNull(list_dnd)) list_dnd = [];
+ list_dnd.push(dnd.getTree());
+
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:329:44: s+= p_Setter
+ this.pushFollow(XQueryParser.FOLLOW_p_Setter_in_pm_Prolog930);
+ s=this.p_Setter();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_p_Setter.add(s.getTree());
+ if (org.antlr.lang.isNull(list_s)) list_s = [];
+ list_s.push(s.getTree());
+
+
+
+ break;
+ case 3 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:329:58: nd+= pm_NamespaceDecl
+ this.pushFollow(XQueryParser.FOLLOW_pm_NamespaceDecl_in_pm_Prolog936);
+ nd=this.pm_NamespaceDecl();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_pm_NamespaceDecl.add(nd.getTree());
+ if (org.antlr.lang.isNull(list_nd)) list_nd = [];
+ list_nd.push(nd.getTree());
+
+
+
+ break;
+ case 4 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:329:81: i+= p_Import
+ this.pushFollow(XQueryParser.FOLLOW_p_Import_in_pm_Prolog942);
+ i=this.p_Import();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_p_Import.add(i.getTree());
+ if (org.antlr.lang.isNull(list_i)) list_i = [];
+ list_i.push(i.getTree());
+
+
+
+ break;
+ case 5 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:329:95: fto+= pm_FTOptionDecl
+ this.pushFollow(XQueryParser.FOLLOW_pm_FTOptionDecl_in_pm_Prolog948);
+ fto=this.pm_FTOptionDecl();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_pm_FTOptionDecl.add(fto.getTree());
+ if (org.antlr.lang.isNull(list_fto)) list_fto = [];
+ list_fto.push(fto.getTree());
+
+
+
+ break;
+
+ }
+
+
+
+ break;
+
+ default :
+ break loop6;
+ }
+ } while (true);
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:329:121: (od+= pg_OrderedDecl )*
+ loop7:
+ do {
+ var alt7=2;
+ var LA7_0 = this.input.LA(1);
+
+ if ( (LA7_0==DECLARE) ) {
+ var LA7_3 = this.input.LA(2);
+
+ if ( (LA7_3==FUNCTION||LA7_3==OPTION||LA7_3==VARIABLE||LA7_3==CONTEXT||LA7_3==UPDATING||LA7_3==COLLECTION||(LA7_3>=INDEX && LA7_3<=INTEGRITY)||LA7_3==ANN_PERCENT) ) {
+ alt7=1;
+ }
+
+
+ }
+
+
+ switch (alt7) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:329:121: od+= pg_OrderedDecl
+ this.pushFollow(XQueryParser.FOLLOW_pg_OrderedDecl_in_pm_Prolog955);
+ od=this.pg_OrderedDecl();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_pg_OrderedDecl.add(od.getTree());
+ if (org.antlr.lang.isNull(list_od)) list_od = [];
+ list_od.push(od.getTree());
+
+
+
+ break;
+
+ default :
+ break loop7;
+ }
+ } while (true);
+
+
+
+ // AST REWRITE
+ // elements: fto, od, dnd, nd, i, s
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels: od, s, fto, nd, dnd, i
+ if ( this.state.backtracking===0 ) {
+ retval.tree = root_0;
+ var stream_retval=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token retval",retval!=null?retval.tree:null);
+ var stream_od=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token od",list_od);
+ var stream_s=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token s",list_s);
+ var stream_fto=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token fto",list_fto);
+ var stream_nd=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token nd",list_nd);
+ var stream_dnd=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token dnd",list_dnd);
+ var stream_i=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token i",list_i);
+ root_0 = this.adaptor.nil();
+ // 330:17: -> ^( Prolog ^( DefaultNamespaceDecls ( $dnd)* ) ^( Setters ( $s)* ) ^( NamespaceDecls ( $nd)* ) ^( Imports ( $i)* ) ^( FTOptionDecls ( $fto)* ) ^( OrderedDecls ( $od)* ) )
+ {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:330:21: ^( Prolog ^( DefaultNamespaceDecls ( $dnd)* ) ^( Setters ( $s)* ) ^( NamespaceDecls ( $nd)* ) ^( Imports ( $i)* ) ^( FTOptionDecls ( $fto)* ) ^( OrderedDecls ( $od)* ) )
+ {
+ var root_1 = this.adaptor.nil();
+ root_1 = this.adaptor.becomeRoot(this.adaptor.create(Prolog, "Prolog"), root_1);
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:331:33: ^( DefaultNamespaceDecls ( $dnd)* )
+ {
+ var root_2 = this.adaptor.nil();
+ root_2 = this.adaptor.becomeRoot(this.adaptor.create(DefaultNamespaceDecls, "DefaultNamespaceDecls"), root_2);
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:331:57: ( $dnd)*
+ while ( stream_dnd.hasNext() ) {
+ this.adaptor.addChild(root_2, stream_dnd.nextTree());
+
+ }
+ stream_dnd.reset();
+
+ this.adaptor.addChild(root_1, root_2);
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:332:33: ^( Setters ( $s)* )
+ {
+ var root_2 = this.adaptor.nil();
+ root_2 = this.adaptor.becomeRoot(this.adaptor.create(Setters, "Setters"), root_2);
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:332:43: ( $s)*
+ while ( stream_s.hasNext() ) {
+ this.adaptor.addChild(root_2, stream_s.nextTree());
+
+ }
+ stream_s.reset();
+
+ this.adaptor.addChild(root_1, root_2);
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:333:33: ^( NamespaceDecls ( $nd)* )
+ {
+ var root_2 = this.adaptor.nil();
+ root_2 = this.adaptor.becomeRoot(this.adaptor.create(NamespaceDecls, "NamespaceDecls"), root_2);
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:333:50: ( $nd)*
+ while ( stream_nd.hasNext() ) {
+ this.adaptor.addChild(root_2, stream_nd.nextTree());
+
+ }
+ stream_nd.reset();
+
+ this.adaptor.addChild(root_1, root_2);
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:334:33: ^( Imports ( $i)* )
+ {
+ var root_2 = this.adaptor.nil();
+ root_2 = this.adaptor.becomeRoot(this.adaptor.create(Imports, "Imports"), root_2);
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:334:43: ( $i)*
+ while ( stream_i.hasNext() ) {
+ this.adaptor.addChild(root_2, stream_i.nextTree());
+
+ }
+ stream_i.reset();
+
+ this.adaptor.addChild(root_1, root_2);
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:335:33: ^( FTOptionDecls ( $fto)* )
+ {
+ var root_2 = this.adaptor.nil();
+ root_2 = this.adaptor.becomeRoot(this.adaptor.create(FTOptionDecls, "FTOptionDecls"), root_2);
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:335:49: ( $fto)*
+ while ( stream_fto.hasNext() ) {
+ this.adaptor.addChild(root_2, stream_fto.nextTree());
+
+ }
+ stream_fto.reset();
+
+ this.adaptor.addChild(root_1, root_2);
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:336:33: ^( OrderedDecls ( $od)* )
+ {
+ var root_2 = this.adaptor.nil();
+ root_2 = this.adaptor.becomeRoot(this.adaptor.create(OrderedDecls, "OrderedDecls"), root_2);
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:336:48: ( $od)*
+ while ( stream_od.hasNext() ) {
+ this.adaptor.addChild(root_2, stream_od.nextTree());
+
+ }
+ stream_od.reset();
+
+ this.adaptor.addChild(root_1, root_2);
+ }
+
+ this.adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;}
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ pg_OrderedDecl_return: (function() {
+ XQueryParser.pg_OrderedDecl_return = function(){};
+ org.antlr.lang.extend(XQueryParser.pg_OrderedDecl_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:344:1: pg_OrderedDecl : ( pm_ContextItemDecl | pm_AnnotatedDecl | pm_OptionDecl );
+ // $ANTLR start "pg_OrderedDecl"
+ pg_OrderedDecl: function() {
+ var retval = new XQueryParser.pg_OrderedDecl_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var pm_ContextItemDecl11 = null;
+ var pm_AnnotatedDecl12 = null;
+ var pm_OptionDecl13 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:345:9: ( pm_ContextItemDecl | pm_AnnotatedDecl | pm_OptionDecl )
+ var alt8=3;
+ var LA8_0 = this.input.LA(1);
+
+ if ( (LA8_0==DECLARE) ) {
+ switch ( this.input.LA(2) ) {
+ case CONTEXT:
+ alt8=1;
+ break;
+ case FUNCTION:
+ case VARIABLE:
+ case UPDATING:
+ case COLLECTION:
+ case INDEX:
+ case INTEGRITY:
+ case ANN_PERCENT:
+ alt8=2;
+ break;
+ case OPTION:
+ alt8=3;
+ break;
+ default:
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 8, 1, this.input);
+
+ throw nvae;
+ }
+
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 8, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt8) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:345:11: pm_ContextItemDecl
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_pm_ContextItemDecl_in_pg_OrderedDecl1270);
+ pm_ContextItemDecl11=this.pm_ContextItemDecl();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, pm_ContextItemDecl11.getTree());
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:346:11: pm_AnnotatedDecl
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_pm_AnnotatedDecl_in_pg_OrderedDecl1282);
+ pm_AnnotatedDecl12=this.pm_AnnotatedDecl();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, pm_AnnotatedDecl12.getTree());
+
+
+ break;
+ case 3 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:347:11: pm_OptionDecl
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_pm_OptionDecl_in_pg_OrderedDecl1294);
+ pm_OptionDecl13=this.pm_OptionDecl();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, pm_OptionDecl13.getTree());
+
+
+ break;
+
+ }
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_Setter_return: (function() {
+ XQueryParser.p_Setter_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_Setter_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:355:1: p_Setter : ( pm_BoundarySpaceDecl | pm_DefaultCollationDecl | pm_BaseURIDecl | pm_ConstructionDecl | pm_OrderingModeDecl | pm_EmptyOrderDecl | {...}? => pm_RevalidationDecl | pm_CopyNamespacesDecl | pm_DecimalFormatDecl );
+ // $ANTLR start "p_Setter"
+ p_Setter: function() {
+ var retval = new XQueryParser.p_Setter_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var pm_BoundarySpaceDecl14 = null;
+ var pm_DefaultCollationDecl15 = null;
+ var pm_BaseURIDecl16 = null;
+ var pm_ConstructionDecl17 = null;
+ var pm_OrderingModeDecl18 = null;
+ var pm_EmptyOrderDecl19 = null;
+ var pm_RevalidationDecl20 = null;
+ var pm_CopyNamespacesDecl21 = null;
+ var pm_DecimalFormatDecl22 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:356:9: ( pm_BoundarySpaceDecl | pm_DefaultCollationDecl | pm_BaseURIDecl | pm_ConstructionDecl | pm_OrderingModeDecl | pm_EmptyOrderDecl | {...}? => pm_RevalidationDecl | pm_CopyNamespacesDecl | pm_DecimalFormatDecl )
+ var alt9=9;
+ alt9 = this.dfa9.predict(this.input);
+ switch (alt9) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:356:11: pm_BoundarySpaceDecl
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_pm_BoundarySpaceDecl_in_p_Setter1324);
+ pm_BoundarySpaceDecl14=this.pm_BoundarySpaceDecl();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, pm_BoundarySpaceDecl14.getTree());
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:357:11: pm_DefaultCollationDecl
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_pm_DefaultCollationDecl_in_p_Setter1336);
+ pm_DefaultCollationDecl15=this.pm_DefaultCollationDecl();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, pm_DefaultCollationDecl15.getTree());
+
+
+ break;
+ case 3 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:358:11: pm_BaseURIDecl
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_pm_BaseURIDecl_in_p_Setter1348);
+ pm_BaseURIDecl16=this.pm_BaseURIDecl();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, pm_BaseURIDecl16.getTree());
+
+
+ break;
+ case 4 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:359:11: pm_ConstructionDecl
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_pm_ConstructionDecl_in_p_Setter1360);
+ pm_ConstructionDecl17=this.pm_ConstructionDecl();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, pm_ConstructionDecl17.getTree());
+
+
+ break;
+ case 5 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:360:11: pm_OrderingModeDecl
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_pm_OrderingModeDecl_in_p_Setter1372);
+ pm_OrderingModeDecl18=this.pm_OrderingModeDecl();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, pm_OrderingModeDecl18.getTree());
+
+
+ break;
+ case 6 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:361:11: pm_EmptyOrderDecl
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_pm_EmptyOrderDecl_in_p_Setter1384);
+ pm_EmptyOrderDecl19=this.pm_EmptyOrderDecl();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, pm_EmptyOrderDecl19.getTree());
+
+
+ break;
+ case 7 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:362:11: {...}? => pm_RevalidationDecl
+ root_0 = this.adaptor.nil();
+
+ if ( !((this.lc(XQU))) ) {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ throw new org.antlr.runtime.FailedPredicateException(this.input, "p_Setter", "this.lc(XQU)");
+ }
+ this.pushFollow(XQueryParser.FOLLOW_pm_RevalidationDecl_in_p_Setter1399);
+ pm_RevalidationDecl20=this.pm_RevalidationDecl();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, pm_RevalidationDecl20.getTree());
+
+
+ break;
+ case 8 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:363:11: pm_CopyNamespacesDecl
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_pm_CopyNamespacesDecl_in_p_Setter1411);
+ pm_CopyNamespacesDecl21=this.pm_CopyNamespacesDecl();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, pm_CopyNamespacesDecl21.getTree());
+
+
+ break;
+ case 9 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:364:11: pm_DecimalFormatDecl
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_pm_DecimalFormatDecl_in_p_Setter1423);
+ pm_DecimalFormatDecl22=this.pm_DecimalFormatDecl();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, pm_DecimalFormatDecl22.getTree());
+
+
+ break;
+
+ }
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ pm_BoundarySpaceDecl_return: (function() {
+ XQueryParser.pm_BoundarySpaceDecl_return = function(){};
+ org.antlr.lang.extend(XQueryParser.pm_BoundarySpaceDecl_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:368:1: pm_BoundarySpaceDecl : k= DECLARE k= BOUNDARY_SPACE ( (k= PRESERVE ) | (k= STRIP ) ) SEMICOLON ;
+ // $ANTLR start "pm_BoundarySpaceDecl"
+ pm_BoundarySpaceDecl: function() {
+ var retval = new XQueryParser.pm_BoundarySpaceDecl_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var SEMICOLON23 = null;
+
+ var k_tree=null;
+ var SEMICOLON23_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:369:9: (k= DECLARE k= BOUNDARY_SPACE ( (k= PRESERVE ) | (k= STRIP ) ) SEMICOLON )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:369:11: k= DECLARE k= BOUNDARY_SPACE ( (k= PRESERVE ) | (k= STRIP ) ) SEMICOLON
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,DECLARE,XQueryParser.FOLLOW_DECLARE_in_pm_BoundarySpaceDecl1455); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ k=this.match(this.input,BOUNDARY_SPACE,XQueryParser.FOLLOW_BOUNDARY_SPACE_in_pm_BoundarySpaceDecl1461); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:369:68: ( (k= PRESERVE ) | (k= STRIP ) )
+ var alt10=2;
+ var LA10_0 = this.input.LA(1);
+
+ if ( (LA10_0==PRESERVE) ) {
+ alt10=1;
+ }
+ else if ( (LA10_0==STRIP) ) {
+ alt10=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 10, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt10) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:369:70: (k= PRESERVE )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:369:70: (k= PRESERVE )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:369:71: k= PRESERVE
+ k=this.match(this.input,PRESERVE,XQueryParser.FOLLOW_PRESERVE_in_pm_BoundarySpaceDecl1470); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+
+
+
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:369:100: (k= STRIP )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:369:100: (k= STRIP )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:369:101: k= STRIP
+ k=this.match(this.input,STRIP,XQueryParser.FOLLOW_STRIP_in_pm_BoundarySpaceDecl1480); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+
+
+
+
+
+ break;
+
+ }
+
+ SEMICOLON23=this.match(this.input,SEMICOLON,XQueryParser.FOLLOW_SEMICOLON_in_pm_BoundarySpaceDecl1487); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ SEMICOLON23_tree = this.adaptor.create(SEMICOLON23);
+ this.adaptor.addChild(root_0, SEMICOLON23_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ pm_DefaultCollationDecl_return: (function() {
+ XQueryParser.pm_DefaultCollationDecl_return = function(){};
+ org.antlr.lang.extend(XQueryParser.pm_DefaultCollationDecl_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:373:1: pm_DefaultCollationDecl : k= DECLARE k= DEFAULT k= COLLATION p_StringLiteral SEMICOLON ;
+ // $ANTLR start "pm_DefaultCollationDecl"
+ pm_DefaultCollationDecl: function() {
+ var retval = new XQueryParser.pm_DefaultCollationDecl_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var SEMICOLON25 = null;
+ var p_StringLiteral24 = null;
+
+ var k_tree=null;
+ var SEMICOLON25_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:374:9: (k= DECLARE k= DEFAULT k= COLLATION p_StringLiteral SEMICOLON )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:374:11: k= DECLARE k= DEFAULT k= COLLATION p_StringLiteral SEMICOLON
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,DECLARE,XQueryParser.FOLLOW_DECLARE_in_pm_DefaultCollationDecl1515); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ k=this.match(this.input,DEFAULT,XQueryParser.FOLLOW_DEFAULT_in_pm_DefaultCollationDecl1521); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ k=this.match(this.input,COLLATION,XQueryParser.FOLLOW_COLLATION_in_pm_DefaultCollationDecl1527); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_StringLiteral_in_pm_DefaultCollationDecl1531);
+ p_StringLiteral24=this.p_StringLiteral();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_StringLiteral24.getTree());
+ SEMICOLON25=this.match(this.input,SEMICOLON,XQueryParser.FOLLOW_SEMICOLON_in_pm_DefaultCollationDecl1533); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ SEMICOLON25_tree = this.adaptor.create(SEMICOLON25);
+ this.adaptor.addChild(root_0, SEMICOLON25_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ pm_BaseURIDecl_return: (function() {
+ XQueryParser.pm_BaseURIDecl_return = function(){};
+ org.antlr.lang.extend(XQueryParser.pm_BaseURIDecl_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:378:1: pm_BaseURIDecl : k= DECLARE k= BASE_URI sl= p_StringLiteral SEMICOLON -> ^( BaseURIDecl $sl) ;
+ // $ANTLR start "pm_BaseURIDecl"
+ pm_BaseURIDecl: function() {
+ var retval = new XQueryParser.pm_BaseURIDecl_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var SEMICOLON26 = null;
+ var sl = null;
+
+ var k_tree=null;
+ var SEMICOLON26_tree=null;
+ var stream_DECLARE=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token DECLARE");
+ var stream_SEMICOLON=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token SEMICOLON");
+ var stream_BASE_URI=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token BASE_URI");
+ var stream_p_StringLiteral=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"rule p_StringLiteral");
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:379:9: (k= DECLARE k= BASE_URI sl= p_StringLiteral SEMICOLON -> ^( BaseURIDecl $sl) )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:379:11: k= DECLARE k= BASE_URI sl= p_StringLiteral SEMICOLON
+ k=this.match(this.input,DECLARE,XQueryParser.FOLLOW_DECLARE_in_pm_BaseURIDecl1569); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_DECLARE.add(k);
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ k=this.match(this.input,BASE_URI,XQueryParser.FOLLOW_BASE_URI_in_pm_BaseURIDecl1575); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_BASE_URI.add(k);
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_StringLiteral_in_pm_BaseURIDecl1581);
+ sl=this.p_StringLiteral();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_p_StringLiteral.add(sl.getTree());
+ SEMICOLON26=this.match(this.input,SEMICOLON,XQueryParser.FOLLOW_SEMICOLON_in_pm_BaseURIDecl1583); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_SEMICOLON.add(SEMICOLON26);
+
+
+
+ // AST REWRITE
+ // elements: sl
+ // token labels:
+ // rule labels: sl, retval
+ // token list labels:
+ // rule list labels:
+ if ( this.state.backtracking===0 ) {
+ retval.tree = root_0;
+ var stream_sl=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token sl",sl!=null?sl.tree:null);
+ var stream_retval=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = this.adaptor.nil();
+ // 380:17: -> ^( BaseURIDecl $sl)
+ {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:380:20: ^( BaseURIDecl $sl)
+ {
+ var root_1 = this.adaptor.nil();
+ root_1 = this.adaptor.becomeRoot(this.adaptor.create(BaseURIDecl, "BaseURIDecl"), root_1);
+
+ this.adaptor.addChild(root_1, stream_sl.nextTree());
+
+ this.adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;}
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ pm_ConstructionDecl_return: (function() {
+ XQueryParser.pm_ConstructionDecl_return = function(){};
+ org.antlr.lang.extend(XQueryParser.pm_ConstructionDecl_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:384:1: pm_ConstructionDecl : k= DECLARE k= CONSTRUCTION ( (k= STRIP | k= PRESERVE ) ) SEMICOLON ;
+ // $ANTLR start "pm_ConstructionDecl"
+ pm_ConstructionDecl: function() {
+ var retval = new XQueryParser.pm_ConstructionDecl_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var SEMICOLON27 = null;
+
+ var k_tree=null;
+ var SEMICOLON27_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:385:9: (k= DECLARE k= CONSTRUCTION ( (k= STRIP | k= PRESERVE ) ) SEMICOLON )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:385:11: k= DECLARE k= CONSTRUCTION ( (k= STRIP | k= PRESERVE ) ) SEMICOLON
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,DECLARE,XQueryParser.FOLLOW_DECLARE_in_pm_ConstructionDecl1636); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ k=this.match(this.input,CONSTRUCTION,XQueryParser.FOLLOW_CONSTRUCTION_in_pm_ConstructionDecl1642); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:385:66: ( (k= STRIP | k= PRESERVE ) )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:385:68: (k= STRIP | k= PRESERVE )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:385:68: (k= STRIP | k= PRESERVE )
+ var alt11=2;
+ var LA11_0 = this.input.LA(1);
+
+ if ( (LA11_0==STRIP) ) {
+ alt11=1;
+ }
+ else if ( (LA11_0==PRESERVE) ) {
+ alt11=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 11, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt11) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:385:69: k= STRIP
+ k=this.match(this.input,STRIP,XQueryParser.FOLLOW_STRIP_in_pm_ConstructionDecl1651); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:385:79: k= PRESERVE
+ k=this.match(this.input,PRESERVE,XQueryParser.FOLLOW_PRESERVE_in_pm_ConstructionDecl1657); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+
+
+ break;
+
+ }
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+
+
+
+ SEMICOLON27=this.match(this.input,SEMICOLON,XQueryParser.FOLLOW_SEMICOLON_in_pm_ConstructionDecl1664); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ SEMICOLON27_tree = this.adaptor.create(SEMICOLON27);
+ this.adaptor.addChild(root_0, SEMICOLON27_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ pm_OrderingModeDecl_return: (function() {
+ XQueryParser.pm_OrderingModeDecl_return = function(){};
+ org.antlr.lang.extend(XQueryParser.pm_OrderingModeDecl_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:389:1: pm_OrderingModeDecl : k= DECLARE k= ORDERING ( (k= ORDERED | k= UNORDERED ) ) SEMICOLON ;
+ // $ANTLR start "pm_OrderingModeDecl"
+ pm_OrderingModeDecl: function() {
+ var retval = new XQueryParser.pm_OrderingModeDecl_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var SEMICOLON28 = null;
+
+ var k_tree=null;
+ var SEMICOLON28_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:390:9: (k= DECLARE k= ORDERING ( (k= ORDERED | k= UNORDERED ) ) SEMICOLON )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:390:11: k= DECLARE k= ORDERING ( (k= ORDERED | k= UNORDERED ) ) SEMICOLON
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,DECLARE,XQueryParser.FOLLOW_DECLARE_in_pm_OrderingModeDecl1692); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ k=this.match(this.input,ORDERING,XQueryParser.FOLLOW_ORDERING_in_pm_OrderingModeDecl1698); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:390:62: ( (k= ORDERED | k= UNORDERED ) )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:390:64: (k= ORDERED | k= UNORDERED )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:390:64: (k= ORDERED | k= UNORDERED )
+ var alt12=2;
+ var LA12_0 = this.input.LA(1);
+
+ if ( (LA12_0==ORDERED) ) {
+ alt12=1;
+ }
+ else if ( (LA12_0==UNORDERED) ) {
+ alt12=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 12, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt12) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:390:65: k= ORDERED
+ k=this.match(this.input,ORDERED,XQueryParser.FOLLOW_ORDERED_in_pm_OrderingModeDecl1707); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:390:77: k= UNORDERED
+ k=this.match(this.input,UNORDERED,XQueryParser.FOLLOW_UNORDERED_in_pm_OrderingModeDecl1713); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+
+
+ break;
+
+ }
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+
+
+
+ SEMICOLON28=this.match(this.input,SEMICOLON,XQueryParser.FOLLOW_SEMICOLON_in_pm_OrderingModeDecl1720); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ SEMICOLON28_tree = this.adaptor.create(SEMICOLON28);
+ this.adaptor.addChild(root_0, SEMICOLON28_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ pm_EmptyOrderDecl_return: (function() {
+ XQueryParser.pm_EmptyOrderDecl_return = function(){};
+ org.antlr.lang.extend(XQueryParser.pm_EmptyOrderDecl_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:394:1: pm_EmptyOrderDecl : k= DECLARE k= DEFAULT k= ORDER k= EMPTY ( (k= GREATEST | k= LEAST ) ) SEMICOLON ;
+ // $ANTLR start "pm_EmptyOrderDecl"
+ pm_EmptyOrderDecl: function() {
+ var retval = new XQueryParser.pm_EmptyOrderDecl_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var SEMICOLON29 = null;
+
+ var k_tree=null;
+ var SEMICOLON29_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:395:9: (k= DECLARE k= DEFAULT k= ORDER k= EMPTY ( (k= GREATEST | k= LEAST ) ) SEMICOLON )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:395:11: k= DECLARE k= DEFAULT k= ORDER k= EMPTY ( (k= GREATEST | k= LEAST ) ) SEMICOLON
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,DECLARE,XQueryParser.FOLLOW_DECLARE_in_pm_EmptyOrderDecl1748); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ k=this.match(this.input,DEFAULT,XQueryParser.FOLLOW_DEFAULT_in_pm_EmptyOrderDecl1754); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ k=this.match(this.input,ORDER,XQueryParser.FOLLOW_ORDER_in_pm_EmptyOrderDecl1760); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ k=this.match(this.input,EMPTY,XQueryParser.FOLLOW_EMPTY_in_pm_EmptyOrderDecl1766); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:395:107: ( (k= GREATEST | k= LEAST ) )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:395:109: (k= GREATEST | k= LEAST )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:395:109: (k= GREATEST | k= LEAST )
+ var alt13=2;
+ var LA13_0 = this.input.LA(1);
+
+ if ( (LA13_0==GREATEST) ) {
+ alt13=1;
+ }
+ else if ( (LA13_0==LEAST) ) {
+ alt13=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 13, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt13) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:395:110: k= GREATEST
+ k=this.match(this.input,GREATEST,XQueryParser.FOLLOW_GREATEST_in_pm_EmptyOrderDecl1775); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:395:123: k= LEAST
+ k=this.match(this.input,LEAST,XQueryParser.FOLLOW_LEAST_in_pm_EmptyOrderDecl1781); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+
+
+ break;
+
+ }
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+
+
+
+ SEMICOLON29=this.match(this.input,SEMICOLON,XQueryParser.FOLLOW_SEMICOLON_in_pm_EmptyOrderDecl1788); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ SEMICOLON29_tree = this.adaptor.create(SEMICOLON29);
+ this.adaptor.addChild(root_0, SEMICOLON29_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ pm_CopyNamespacesDecl_return: (function() {
+ XQueryParser.pm_CopyNamespacesDecl_return = function(){};
+ org.antlr.lang.extend(XQueryParser.pm_CopyNamespacesDecl_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:399:1: pm_CopyNamespacesDecl : k= DECLARE k= COPY_NAMESPACES p_PreserveMode COMMA p_InheritMode SEMICOLON ;
+ // $ANTLR start "pm_CopyNamespacesDecl"
+ pm_CopyNamespacesDecl: function() {
+ var retval = new XQueryParser.pm_CopyNamespacesDecl_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var COMMA31 = null;
+ var SEMICOLON33 = null;
+ var p_PreserveMode30 = null;
+ var p_InheritMode32 = null;
+
+ var k_tree=null;
+ var COMMA31_tree=null;
+ var SEMICOLON33_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:400:9: (k= DECLARE k= COPY_NAMESPACES p_PreserveMode COMMA p_InheritMode SEMICOLON )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:400:11: k= DECLARE k= COPY_NAMESPACES p_PreserveMode COMMA p_InheritMode SEMICOLON
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,DECLARE,XQueryParser.FOLLOW_DECLARE_in_pm_CopyNamespacesDecl1816); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ k=this.match(this.input,COPY_NAMESPACES,XQueryParser.FOLLOW_COPY_NAMESPACES_in_pm_CopyNamespacesDecl1822); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_PreserveMode_in_pm_CopyNamespacesDecl1826);
+ p_PreserveMode30=this.p_PreserveMode();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_PreserveMode30.getTree());
+ COMMA31=this.match(this.input,COMMA,XQueryParser.FOLLOW_COMMA_in_pm_CopyNamespacesDecl1828); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ COMMA31_tree = this.adaptor.create(COMMA31);
+ this.adaptor.addChild(root_0, COMMA31_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_InheritMode_in_pm_CopyNamespacesDecl1830);
+ p_InheritMode32=this.p_InheritMode();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_InheritMode32.getTree());
+ SEMICOLON33=this.match(this.input,SEMICOLON,XQueryParser.FOLLOW_SEMICOLON_in_pm_CopyNamespacesDecl1832); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ SEMICOLON33_tree = this.adaptor.create(SEMICOLON33);
+ this.adaptor.addChild(root_0, SEMICOLON33_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_PreserveMode_return: (function() {
+ XQueryParser.p_PreserveMode_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_PreserveMode_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:404:1: p_PreserveMode : (k+= PRESERVE | k+= NO_PRESERVE ) ;
+ // $ANTLR start "p_PreserveMode"
+ p_PreserveMode: function() {
+ var retval = new XQueryParser.p_PreserveMode_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var list_k=null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:405:9: ( (k+= PRESERVE | k+= NO_PRESERVE ) )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:405:11: (k+= PRESERVE | k+= NO_PRESERVE )
+ root_0 = this.adaptor.nil();
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:405:11: (k+= PRESERVE | k+= NO_PRESERVE )
+ var alt14=2;
+ var LA14_0 = this.input.LA(1);
+
+ if ( (LA14_0==PRESERVE) ) {
+ alt14=1;
+ }
+ else if ( (LA14_0==NO_PRESERVE) ) {
+ alt14=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 14, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt14) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:405:12: k+= PRESERVE
+ k=this.match(this.input,PRESERVE,XQueryParser.FOLLOW_PRESERVE_in_p_PreserveMode1861); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:405:26: k+= NO_PRESERVE
+ k=this.match(this.input,NO_PRESERVE,XQueryParser.FOLLOW_NO_PRESERVE_in_p_PreserveMode1867); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+
+
+ break;
+
+ }
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(list_k);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_InheritMode_return: (function() {
+ XQueryParser.p_InheritMode_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_InheritMode_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:409:1: p_InheritMode : (k+= INHERIT | k+= NO_INHERIT ) ;
+ // $ANTLR start "p_InheritMode"
+ p_InheritMode: function() {
+ var retval = new XQueryParser.p_InheritMode_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var list_k=null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:410:9: ( (k+= INHERIT | k+= NO_INHERIT ) )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:410:11: (k+= INHERIT | k+= NO_INHERIT )
+ root_0 = this.adaptor.nil();
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:410:11: (k+= INHERIT | k+= NO_INHERIT )
+ var alt15=2;
+ var LA15_0 = this.input.LA(1);
+
+ if ( (LA15_0==INHERIT) ) {
+ alt15=1;
+ }
+ else if ( (LA15_0==NO_INHERIT) ) {
+ alt15=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 15, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt15) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:410:12: k+= INHERIT
+ k=this.match(this.input,INHERIT,XQueryParser.FOLLOW_INHERIT_in_p_InheritMode1899); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:410:25: k+= NO_INHERIT
+ k=this.match(this.input,NO_INHERIT,XQueryParser.FOLLOW_NO_INHERIT_in_p_InheritMode1905); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+
+
+ break;
+
+ }
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(list_k);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ pm_DecimalFormatDecl_return: (function() {
+ XQueryParser.pm_DecimalFormatDecl_return = function(){};
+ org.antlr.lang.extend(XQueryParser.pm_DecimalFormatDecl_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:414:1: pm_DecimalFormatDecl : k= DECLARE ( (k= DECIMAL_FORMAT p_EQName ) | (k= DEFAULT k= DECIMAL_FORMAT ) ) ( p_DFPropertyName EQUAL p_StringLiteral )* SEMICOLON ;
+ // $ANTLR start "pm_DecimalFormatDecl"
+ pm_DecimalFormatDecl: function() {
+ var retval = new XQueryParser.pm_DecimalFormatDecl_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var EQUAL36 = null;
+ var SEMICOLON38 = null;
+ var p_EQName34 = null;
+ var p_DFPropertyName35 = null;
+ var p_StringLiteral37 = null;
+
+ var k_tree=null;
+ var EQUAL36_tree=null;
+ var SEMICOLON38_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:415:9: (k= DECLARE ( (k= DECIMAL_FORMAT p_EQName ) | (k= DEFAULT k= DECIMAL_FORMAT ) ) ( p_DFPropertyName EQUAL p_StringLiteral )* SEMICOLON )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:415:11: k= DECLARE ( (k= DECIMAL_FORMAT p_EQName ) | (k= DEFAULT k= DECIMAL_FORMAT ) ) ( p_DFPropertyName EQUAL p_StringLiteral )* SEMICOLON
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,DECLARE,XQueryParser.FOLLOW_DECLARE_in_pm_DecimalFormatDecl1944); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:415:36: ( (k= DECIMAL_FORMAT p_EQName ) | (k= DEFAULT k= DECIMAL_FORMAT ) )
+ var alt16=2;
+ var LA16_0 = this.input.LA(1);
+
+ if ( (LA16_0==DECIMAL_FORMAT) ) {
+ alt16=1;
+ }
+ else if ( (LA16_0==DEFAULT) ) {
+ alt16=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 16, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt16) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:415:37: (k= DECIMAL_FORMAT p_EQName )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:415:37: (k= DECIMAL_FORMAT p_EQName )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:415:38: k= DECIMAL_FORMAT p_EQName
+ k=this.match(this.input,DECIMAL_FORMAT,XQueryParser.FOLLOW_DECIMAL_FORMAT_in_pm_DecimalFormatDecl1952); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_EQName_in_pm_DecimalFormatDecl1956);
+ p_EQName34=this.p_EQName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_EQName34.getTree());
+
+
+
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:415:82: (k= DEFAULT k= DECIMAL_FORMAT )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:415:82: (k= DEFAULT k= DECIMAL_FORMAT )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:415:83: k= DEFAULT k= DECIMAL_FORMAT
+ k=this.match(this.input,DEFAULT,XQueryParser.FOLLOW_DEFAULT_in_pm_DecimalFormatDecl1964); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ k=this.match(this.input,DECIMAL_FORMAT,XQueryParser.FOLLOW_DECIMAL_FORMAT_in_pm_DecimalFormatDecl1970); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+
+
+
+
+
+ break;
+
+ }
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:415:142: ( p_DFPropertyName EQUAL p_StringLiteral )*
+ loop17:
+ do {
+ var alt17=2;
+ var LA17_0 = this.input.LA(1);
+
+ if ( ((LA17_0>=DECIMAL_SEPARATOR && LA17_0<=DIGIT)||(LA17_0>=GROUPING_SEPARATOR && LA17_0<=MINUS_SIGN)||LA17_0==NAN||(LA17_0>=PATTERN_SEPARATOR && LA17_0<=PER_MILLE)||LA17_0==ZERO_DIGIT) ) {
+ alt17=1;
+ }
+
+
+ switch (alt17) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:415:143: p_DFPropertyName EQUAL p_StringLiteral
+ this.pushFollow(XQueryParser.FOLLOW_p_DFPropertyName_in_pm_DecimalFormatDecl1977);
+ p_DFPropertyName35=this.p_DFPropertyName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_DFPropertyName35.getTree());
+ EQUAL36=this.match(this.input,EQUAL,XQueryParser.FOLLOW_EQUAL_in_pm_DecimalFormatDecl1979); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ EQUAL36_tree = this.adaptor.create(EQUAL36);
+ this.adaptor.addChild(root_0, EQUAL36_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_StringLiteral_in_pm_DecimalFormatDecl1981);
+ p_StringLiteral37=this.p_StringLiteral();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_StringLiteral37.getTree());
+
+
+ break;
+
+ default :
+ break loop17;
+ }
+ } while (true);
+
+ SEMICOLON38=this.match(this.input,SEMICOLON,XQueryParser.FOLLOW_SEMICOLON_in_pm_DecimalFormatDecl1985); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ SEMICOLON38_tree = this.adaptor.create(SEMICOLON38);
+ this.adaptor.addChild(root_0, SEMICOLON38_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_DFPropertyName_return: (function() {
+ XQueryParser.p_DFPropertyName_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_DFPropertyName_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:419:1: p_DFPropertyName : (k= DECIMAL_SEPARATOR | k= GROUPING_SEPARATOR | k= INFINITY | k= MINUS_SIGN | k= NAN | k= PERCENT | k= PER_MILLE | k= ZERO_DIGIT | k= DIGIT | k= PATTERN_SEPARATOR ) ;
+ // $ANTLR start "p_DFPropertyName"
+ p_DFPropertyName: function() {
+ var retval = new XQueryParser.p_DFPropertyName_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:420:9: ( (k= DECIMAL_SEPARATOR | k= GROUPING_SEPARATOR | k= INFINITY | k= MINUS_SIGN | k= NAN | k= PERCENT | k= PER_MILLE | k= ZERO_DIGIT | k= DIGIT | k= PATTERN_SEPARATOR ) )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:420:11: (k= DECIMAL_SEPARATOR | k= GROUPING_SEPARATOR | k= INFINITY | k= MINUS_SIGN | k= NAN | k= PERCENT | k= PER_MILLE | k= ZERO_DIGIT | k= DIGIT | k= PATTERN_SEPARATOR )
+ root_0 = this.adaptor.nil();
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:420:11: (k= DECIMAL_SEPARATOR | k= GROUPING_SEPARATOR | k= INFINITY | k= MINUS_SIGN | k= NAN | k= PERCENT | k= PER_MILLE | k= ZERO_DIGIT | k= DIGIT | k= PATTERN_SEPARATOR )
+ var alt18=10;
+ switch ( this.input.LA(1) ) {
+ case DECIMAL_SEPARATOR:
+ alt18=1;
+ break;
+ case GROUPING_SEPARATOR:
+ alt18=2;
+ break;
+ case INFINITY:
+ alt18=3;
+ break;
+ case MINUS_SIGN:
+ alt18=4;
+ break;
+ case NAN:
+ alt18=5;
+ break;
+ case PERCENT:
+ alt18=6;
+ break;
+ case PER_MILLE:
+ alt18=7;
+ break;
+ case ZERO_DIGIT:
+ alt18=8;
+ break;
+ case DIGIT:
+ alt18=9;
+ break;
+ case PATTERN_SEPARATOR:
+ alt18=10;
+ break;
+ default:
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 18, 0, this.input);
+
+ throw nvae;
+ }
+
+ switch (alt18) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:420:12: k= DECIMAL_SEPARATOR
+ k=this.match(this.input,DECIMAL_SEPARATOR,XQueryParser.FOLLOW_DECIMAL_SEPARATOR_in_p_DFPropertyName2014); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:420:34: k= GROUPING_SEPARATOR
+ k=this.match(this.input,GROUPING_SEPARATOR,XQueryParser.FOLLOW_GROUPING_SEPARATOR_in_p_DFPropertyName2020); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+
+
+ break;
+ case 3 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:420:57: k= INFINITY
+ k=this.match(this.input,INFINITY,XQueryParser.FOLLOW_INFINITY_in_p_DFPropertyName2026); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+
+
+ break;
+ case 4 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:420:70: k= MINUS_SIGN
+ k=this.match(this.input,MINUS_SIGN,XQueryParser.FOLLOW_MINUS_SIGN_in_p_DFPropertyName2032); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+
+
+ break;
+ case 5 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:420:85: k= NAN
+ k=this.match(this.input,NAN,XQueryParser.FOLLOW_NAN_in_p_DFPropertyName2038); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+
+
+ break;
+ case 6 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:420:93: k= PERCENT
+ k=this.match(this.input,PERCENT,XQueryParser.FOLLOW_PERCENT_in_p_DFPropertyName2044); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+
+
+ break;
+ case 7 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:420:105: k= PER_MILLE
+ k=this.match(this.input,PER_MILLE,XQueryParser.FOLLOW_PER_MILLE_in_p_DFPropertyName2050); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+
+
+ break;
+ case 8 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:420:119: k= ZERO_DIGIT
+ k=this.match(this.input,ZERO_DIGIT,XQueryParser.FOLLOW_ZERO_DIGIT_in_p_DFPropertyName2056); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+
+
+ break;
+ case 9 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:420:134: k= DIGIT
+ k=this.match(this.input,DIGIT,XQueryParser.FOLLOW_DIGIT_in_p_DFPropertyName2062); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+
+
+ break;
+ case 10 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:420:144: k= PATTERN_SEPARATOR
+ k=this.match(this.input,PATTERN_SEPARATOR,XQueryParser.FOLLOW_PATTERN_SEPARATOR_in_p_DFPropertyName2068); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+
+
+ break;
+
+ }
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_Import_return: (function() {
+ XQueryParser.p_Import_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_Import_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:424:1: p_Import : ( pm_SchemaImport | pm_ModuleImport );
+ // $ANTLR start "p_Import"
+ p_Import: function() {
+ var retval = new XQueryParser.p_Import_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var pm_SchemaImport39 = null;
+ var pm_ModuleImport40 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:425:9: ( pm_SchemaImport | pm_ModuleImport )
+ var alt19=2;
+ var LA19_0 = this.input.LA(1);
+
+ if ( (LA19_0==IMPORT) ) {
+ var LA19_1 = this.input.LA(2);
+
+ if ( (LA19_1==SCHEMA) ) {
+ alt19=1;
+ }
+ else if ( (LA19_1==MODULE) ) {
+ alt19=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 19, 1, this.input);
+
+ throw nvae;
+ }
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 19, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt19) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:425:11: pm_SchemaImport
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_pm_SchemaImport_in_p_Import2097);
+ pm_SchemaImport39=this.pm_SchemaImport();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, pm_SchemaImport39.getTree());
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:425:29: pm_ModuleImport
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_pm_ModuleImport_in_p_Import2101);
+ pm_ModuleImport40=this.pm_ModuleImport();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, pm_ModuleImport40.getTree());
+
+
+ break;
+
+ }
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ pm_SchemaImport_return: (function() {
+ XQueryParser.pm_SchemaImport_return = function(){};
+ org.antlr.lang.extend(XQueryParser.pm_SchemaImport_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:429:1: pm_SchemaImport : k= IMPORT k= SCHEMA (sp= p_SchemaPrefix )? us= p_StringLiteral (k= AT ah+= p_StringLiteral ( COMMA ah+= p_StringLiteral )* )? SEMICOLON -> ^( SchemaImport ^( SchemaPrefix ( $sp)? ) $us ^( AtHints ( $ah)* ) ) ;
+ // $ANTLR start "pm_SchemaImport"
+ pm_SchemaImport: function() {
+ var retval = new XQueryParser.pm_SchemaImport_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var COMMA41 = null;
+ var SEMICOLON42 = null;
+ var list_ah=null;
+ var sp = null;
+ var us = null;
+ var ah = null;
+ var k_tree=null;
+ var COMMA41_tree=null;
+ var SEMICOLON42_tree=null;
+ var stream_AT=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token AT");
+ var stream_IMPORT=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token IMPORT");
+ var stream_SCHEMA=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token SCHEMA");
+ var stream_SEMICOLON=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token SEMICOLON");
+ var stream_COMMA=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token COMMA");
+ var stream_p_SchemaPrefix=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"rule p_SchemaPrefix");
+ var stream_p_StringLiteral=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"rule p_StringLiteral");
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:430:9: (k= IMPORT k= SCHEMA (sp= p_SchemaPrefix )? us= p_StringLiteral (k= AT ah+= p_StringLiteral ( COMMA ah+= p_StringLiteral )* )? SEMICOLON -> ^( SchemaImport ^( SchemaPrefix ( $sp)? ) $us ^( AtHints ( $ah)* ) ) )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:430:11: k= IMPORT k= SCHEMA (sp= p_SchemaPrefix )? us= p_StringLiteral (k= AT ah+= p_StringLiteral ( COMMA ah+= p_StringLiteral )* )? SEMICOLON
+ k=this.match(this.input,IMPORT,XQueryParser.FOLLOW_IMPORT_in_pm_SchemaImport2137); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_IMPORT.add(k);
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ k=this.match(this.input,SCHEMA,XQueryParser.FOLLOW_SCHEMA_in_pm_SchemaImport2143); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_SCHEMA.add(k);
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:430:61: (sp= p_SchemaPrefix )?
+ var alt20=2;
+ var LA20_0 = this.input.LA(1);
+
+ if ( (LA20_0==DEFAULT||LA20_0==NAMESPACE) ) {
+ alt20=1;
+ }
+ switch (alt20) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:430:61: sp= p_SchemaPrefix
+ this.pushFollow(XQueryParser.FOLLOW_p_SchemaPrefix_in_pm_SchemaImport2149);
+ sp=this.p_SchemaPrefix();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_p_SchemaPrefix.add(sp.getTree());
+
+
+ break;
+
+ }
+
+ this.pushFollow(XQueryParser.FOLLOW_p_StringLiteral_in_pm_SchemaImport2154);
+ us=this.p_StringLiteral();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_p_StringLiteral.add(us.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:430:97: (k= AT ah+= p_StringLiteral ( COMMA ah+= p_StringLiteral )* )?
+ var alt22=2;
+ var LA22_0 = this.input.LA(1);
+
+ if ( (LA22_0==AT) ) {
+ alt22=1;
+ }
+ switch (alt22) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:430:98: k= AT ah+= p_StringLiteral ( COMMA ah+= p_StringLiteral )*
+ k=this.match(this.input,AT,XQueryParser.FOLLOW_AT_in_pm_SchemaImport2159); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_AT.add(k);
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_StringLiteral_in_pm_SchemaImport2165);
+ ah=this.p_StringLiteral();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_p_StringLiteral.add(ah.getTree());
+ if (org.antlr.lang.isNull(list_ah)) list_ah = [];
+ list_ah.push(ah.getTree());
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:430:138: ( COMMA ah+= p_StringLiteral )*
+ loop21:
+ do {
+ var alt21=2;
+ var LA21_0 = this.input.LA(1);
+
+ if ( (LA21_0==COMMA) ) {
+ alt21=1;
+ }
+
+
+ switch (alt21) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:430:139: COMMA ah+= p_StringLiteral
+ COMMA41=this.match(this.input,COMMA,XQueryParser.FOLLOW_COMMA_in_pm_SchemaImport2168); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_COMMA.add(COMMA41);
+
+ this.pushFollow(XQueryParser.FOLLOW_p_StringLiteral_in_pm_SchemaImport2172);
+ ah=this.p_StringLiteral();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_p_StringLiteral.add(ah.getTree());
+ if (org.antlr.lang.isNull(list_ah)) list_ah = [];
+ list_ah.push(ah.getTree());
+
+
+
+ break;
+
+ default :
+ break loop21;
+ }
+ } while (true);
+
+
+
+ break;
+
+ }
+
+ SEMICOLON42=this.match(this.input,SEMICOLON,XQueryParser.FOLLOW_SEMICOLON_in_pm_SchemaImport2178); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_SEMICOLON.add(SEMICOLON42);
+
+
+
+ // AST REWRITE
+ // elements: us, ah, sp
+ // token labels:
+ // rule labels: retval, sp, us
+ // token list labels:
+ // rule list labels: ah
+ if ( this.state.backtracking===0 ) {
+ retval.tree = root_0;
+ var stream_retval=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token retval",retval!=null?retval.tree:null);
+ var stream_sp=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token sp",sp!=null?sp.tree:null);
+ var stream_us=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token us",us!=null?us.tree:null);
+ var stream_ah=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token ah",list_ah);
+ root_0 = this.adaptor.nil();
+ // 431:17: -> ^( SchemaImport ^( SchemaPrefix ( $sp)? ) $us ^( AtHints ( $ah)* ) )
+ {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:431:20: ^( SchemaImport ^( SchemaPrefix ( $sp)? ) $us ^( AtHints ( $ah)* ) )
+ {
+ var root_1 = this.adaptor.nil();
+ root_1 = this.adaptor.becomeRoot(this.adaptor.create(SchemaImport, "SchemaImport"), root_1);
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:431:35: ^( SchemaPrefix ( $sp)? )
+ {
+ var root_2 = this.adaptor.nil();
+ root_2 = this.adaptor.becomeRoot(this.adaptor.create(SchemaPrefix, "SchemaPrefix"), root_2);
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:431:50: ( $sp)?
+ if ( stream_sp.hasNext() ) {
+ this.adaptor.addChild(root_2, stream_sp.nextTree());
+
+ }
+ stream_sp.reset();
+
+ this.adaptor.addChild(root_1, root_2);
+ }
+ this.adaptor.addChild(root_1, stream_us.nextTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:431:60: ^( AtHints ( $ah)* )
+ {
+ var root_2 = this.adaptor.nil();
+ root_2 = this.adaptor.becomeRoot(this.adaptor.create(AtHints, "AtHints"), root_2);
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:431:70: ( $ah)*
+ while ( stream_ah.hasNext() ) {
+ this.adaptor.addChild(root_2, stream_ah.nextTree());
+
+ }
+ stream_ah.reset();
+
+ this.adaptor.addChild(root_1, root_2);
+ }
+
+ this.adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;}
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_SchemaPrefix_return: (function() {
+ XQueryParser.p_SchemaPrefix_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_SchemaPrefix_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:435:1: p_SchemaPrefix : (k= NAMESPACE nn= p_NCName EQUAL -> ^( NamespaceName $nn) | k= DEFAULT k= ELEMENT k= NAMESPACE -> DefaultElementNamespace );
+ // $ANTLR start "p_SchemaPrefix"
+ p_SchemaPrefix: function() {
+ var retval = new XQueryParser.p_SchemaPrefix_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var EQUAL43 = null;
+ var nn = null;
+
+ var k_tree=null;
+ var EQUAL43_tree=null;
+ var stream_ELEMENT=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token ELEMENT");
+ var stream_NAMESPACE=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token NAMESPACE");
+ var stream_EQUAL=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token EQUAL");
+ var stream_DEFAULT=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token DEFAULT");
+ var stream_p_NCName=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"rule p_NCName");
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:436:9: (k= NAMESPACE nn= p_NCName EQUAL -> ^( NamespaceName $nn) | k= DEFAULT k= ELEMENT k= NAMESPACE -> DefaultElementNamespace )
+ var alt23=2;
+ var LA23_0 = this.input.LA(1);
+
+ if ( (LA23_0==NAMESPACE) ) {
+ alt23=1;
+ }
+ else if ( (LA23_0==DEFAULT) ) {
+ alt23=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 23, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt23) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:436:11: k= NAMESPACE nn= p_NCName EQUAL
+ k=this.match(this.input,NAMESPACE,XQueryParser.FOLLOW_NAMESPACE_in_p_SchemaPrefix2248); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_NAMESPACE.add(k);
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_NCName_in_p_SchemaPrefix2254);
+ nn=this.p_NCName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_p_NCName.add(nn.getTree());
+ EQUAL43=this.match(this.input,EQUAL,XQueryParser.FOLLOW_EQUAL_in_p_SchemaPrefix2256); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_EQUAL.add(EQUAL43);
+
+
+
+ // AST REWRITE
+ // elements: nn
+ // token labels:
+ // rule labels: retval, nn
+ // token list labels:
+ // rule list labels:
+ if ( this.state.backtracking===0 ) {
+ retval.tree = root_0;
+ var stream_retval=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token retval",retval!=null?retval.tree:null);
+ var stream_nn=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token nn",nn!=null?nn.tree:null);
+
+ root_0 = this.adaptor.nil();
+ // 437:17: -> ^( NamespaceName $nn)
+ {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:437:20: ^( NamespaceName $nn)
+ {
+ var root_1 = this.adaptor.nil();
+ root_1 = this.adaptor.becomeRoot(this.adaptor.create(NamespaceName, "NamespaceName"), root_1);
+
+ this.adaptor.addChild(root_1, stream_nn.nextTree());
+
+ this.adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;}
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:438:11: k= DEFAULT k= ELEMENT k= NAMESPACE
+ k=this.match(this.input,DEFAULT,XQueryParser.FOLLOW_DEFAULT_in_p_SchemaPrefix2295); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_DEFAULT.add(k);
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ k=this.match(this.input,ELEMENT,XQueryParser.FOLLOW_ELEMENT_in_p_SchemaPrefix2301); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_ELEMENT.add(k);
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ k=this.match(this.input,NAMESPACE,XQueryParser.FOLLOW_NAMESPACE_in_p_SchemaPrefix2307); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_NAMESPACE.add(k);
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+
+
+ // AST REWRITE
+ // elements:
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( this.state.backtracking===0 ) {
+ retval.tree = root_0;
+ var stream_retval=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = this.adaptor.nil();
+ // 439:17: -> DefaultElementNamespace
+ {
+ this.adaptor.addChild(root_0, this.adaptor.create(DefaultElementNamespace, "DefaultElementNamespace"));
+
+ }
+
+ retval.tree = root_0;}
+
+ break;
+
+ }
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ pm_ModuleImport_return: (function() {
+ XQueryParser.pm_ModuleImport_return = function(){};
+ org.antlr.lang.extend(XQueryParser.pm_ModuleImport_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:443:1: pm_ModuleImport : k= IMPORT k= MODULE (k= NAMESPACE nn= p_NCName EQUAL )? us= p_StringLiteral (k= AT ah+= p_StringLiteral ( COMMA ah+= p_StringLiteral )* )? SEMICOLON -> ^( ModuleImport ^( NamespaceName ( $nn)? ) $us ^( AtHints ( $ah)* ) ) ;
+ // $ANTLR start "pm_ModuleImport"
+ pm_ModuleImport: function() {
+ var retval = new XQueryParser.pm_ModuleImport_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var EQUAL44 = null;
+ var COMMA45 = null;
+ var SEMICOLON46 = null;
+ var list_ah=null;
+ var nn = null;
+ var us = null;
+ var ah = null;
+ var k_tree=null;
+ var EQUAL44_tree=null;
+ var COMMA45_tree=null;
+ var SEMICOLON46_tree=null;
+ var stream_AT=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token AT");
+ var stream_IMPORT=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token IMPORT");
+ var stream_SEMICOLON=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token SEMICOLON");
+ var stream_MODULE=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token MODULE");
+ var stream_COMMA=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token COMMA");
+ var stream_NAMESPACE=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token NAMESPACE");
+ var stream_EQUAL=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token EQUAL");
+ var stream_p_NCName=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"rule p_NCName");
+ var stream_p_StringLiteral=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"rule p_StringLiteral");
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:444:9: (k= IMPORT k= MODULE (k= NAMESPACE nn= p_NCName EQUAL )? us= p_StringLiteral (k= AT ah+= p_StringLiteral ( COMMA ah+= p_StringLiteral )* )? SEMICOLON -> ^( ModuleImport ^( NamespaceName ( $nn)? ) $us ^( AtHints ( $ah)* ) ) )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:444:11: k= IMPORT k= MODULE (k= NAMESPACE nn= p_NCName EQUAL )? us= p_StringLiteral (k= AT ah+= p_StringLiteral ( COMMA ah+= p_StringLiteral )* )? SEMICOLON
+ k=this.match(this.input,IMPORT,XQueryParser.FOLLOW_IMPORT_in_pm_ModuleImport2357); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_IMPORT.add(k);
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ k=this.match(this.input,MODULE,XQueryParser.FOLLOW_MODULE_in_pm_ModuleImport2363); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_MODULE.add(k);
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:444:59: (k= NAMESPACE nn= p_NCName EQUAL )?
+ var alt24=2;
+ var LA24_0 = this.input.LA(1);
+
+ if ( (LA24_0==NAMESPACE) ) {
+ alt24=1;
+ }
+ switch (alt24) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:444:60: k= NAMESPACE nn= p_NCName EQUAL
+ k=this.match(this.input,NAMESPACE,XQueryParser.FOLLOW_NAMESPACE_in_pm_ModuleImport2370); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_NAMESPACE.add(k);
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_NCName_in_pm_ModuleImport2376);
+ nn=this.p_NCName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_p_NCName.add(nn.getTree());
+ EQUAL44=this.match(this.input,EQUAL,XQueryParser.FOLLOW_EQUAL_in_pm_ModuleImport2378); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_EQUAL.add(EQUAL44);
+
+
+
+ break;
+
+ }
+
+ this.pushFollow(XQueryParser.FOLLOW_p_StringLiteral_in_pm_ModuleImport2384);
+ us=this.p_StringLiteral();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_p_StringLiteral.add(us.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:444:126: (k= AT ah+= p_StringLiteral ( COMMA ah+= p_StringLiteral )* )?
+ var alt26=2;
+ var LA26_0 = this.input.LA(1);
+
+ if ( (LA26_0==AT) ) {
+ alt26=1;
+ }
+ switch (alt26) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:444:127: k= AT ah+= p_StringLiteral ( COMMA ah+= p_StringLiteral )*
+ k=this.match(this.input,AT,XQueryParser.FOLLOW_AT_in_pm_ModuleImport2389); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_AT.add(k);
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_StringLiteral_in_pm_ModuleImport2395);
+ ah=this.p_StringLiteral();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_p_StringLiteral.add(ah.getTree());
+ if (org.antlr.lang.isNull(list_ah)) list_ah = [];
+ list_ah.push(ah.getTree());
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:444:167: ( COMMA ah+= p_StringLiteral )*
+ loop25:
+ do {
+ var alt25=2;
+ var LA25_0 = this.input.LA(1);
+
+ if ( (LA25_0==COMMA) ) {
+ alt25=1;
+ }
+
+
+ switch (alt25) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:444:168: COMMA ah+= p_StringLiteral
+ COMMA45=this.match(this.input,COMMA,XQueryParser.FOLLOW_COMMA_in_pm_ModuleImport2398); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_COMMA.add(COMMA45);
+
+ this.pushFollow(XQueryParser.FOLLOW_p_StringLiteral_in_pm_ModuleImport2402);
+ ah=this.p_StringLiteral();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_p_StringLiteral.add(ah.getTree());
+ if (org.antlr.lang.isNull(list_ah)) list_ah = [];
+ list_ah.push(ah.getTree());
+
+
+
+ break;
+
+ default :
+ break loop25;
+ }
+ } while (true);
+
+
+
+ break;
+
+ }
+
+ SEMICOLON46=this.match(this.input,SEMICOLON,XQueryParser.FOLLOW_SEMICOLON_in_pm_ModuleImport2408); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_SEMICOLON.add(SEMICOLON46);
+
+
+
+ // AST REWRITE
+ // elements: nn, us, ah
+ // token labels:
+ // rule labels: retval, nn, us
+ // token list labels:
+ // rule list labels: ah
+ if ( this.state.backtracking===0 ) {
+ retval.tree = root_0;
+ var stream_retval=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token retval",retval!=null?retval.tree:null);
+ var stream_nn=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token nn",nn!=null?nn.tree:null);
+ var stream_us=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token us",us!=null?us.tree:null);
+ var stream_ah=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token ah",list_ah);
+ root_0 = this.adaptor.nil();
+ // 445:17: -> ^( ModuleImport ^( NamespaceName ( $nn)? ) $us ^( AtHints ( $ah)* ) )
+ {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:445:20: ^( ModuleImport ^( NamespaceName ( $nn)? ) $us ^( AtHints ( $ah)* ) )
+ {
+ var root_1 = this.adaptor.nil();
+ root_1 = this.adaptor.becomeRoot(this.adaptor.create(ModuleImport, "ModuleImport"), root_1);
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:445:35: ^( NamespaceName ( $nn)? )
+ {
+ var root_2 = this.adaptor.nil();
+ root_2 = this.adaptor.becomeRoot(this.adaptor.create(NamespaceName, "NamespaceName"), root_2);
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:445:51: ( $nn)?
+ if ( stream_nn.hasNext() ) {
+ this.adaptor.addChild(root_2, stream_nn.nextTree());
+
+ }
+ stream_nn.reset();
+
+ this.adaptor.addChild(root_1, root_2);
+ }
+ this.adaptor.addChild(root_1, stream_us.nextTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:445:61: ^( AtHints ( $ah)* )
+ {
+ var root_2 = this.adaptor.nil();
+ root_2 = this.adaptor.becomeRoot(this.adaptor.create(AtHints, "AtHints"), root_2);
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:445:71: ( $ah)*
+ while ( stream_ah.hasNext() ) {
+ this.adaptor.addChild(root_2, stream_ah.nextTree());
+
+ }
+ stream_ah.reset();
+
+ this.adaptor.addChild(root_1, root_2);
+ }
+
+ this.adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;}
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ pm_NamespaceDecl_return: (function() {
+ XQueryParser.pm_NamespaceDecl_return = function(){};
+ org.antlr.lang.extend(XQueryParser.pm_NamespaceDecl_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:449:1: pm_NamespaceDecl : k= DECLARE k= NAMESPACE nn= p_NCName EQUAL us= p_StringLiteral SEMICOLON -> ^( NamespaceDecl $nn $us) ;
+ // $ANTLR start "pm_NamespaceDecl"
+ pm_NamespaceDecl: function() {
+ var retval = new XQueryParser.pm_NamespaceDecl_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var EQUAL47 = null;
+ var SEMICOLON48 = null;
+ var nn = null;
+ var us = null;
+
+ var k_tree=null;
+ var EQUAL47_tree=null;
+ var SEMICOLON48_tree=null;
+ var stream_DECLARE=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token DECLARE");
+ var stream_SEMICOLON=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token SEMICOLON");
+ var stream_NAMESPACE=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token NAMESPACE");
+ var stream_EQUAL=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token EQUAL");
+ var stream_p_NCName=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"rule p_NCName");
+ var stream_p_StringLiteral=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"rule p_StringLiteral");
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:450:9: (k= DECLARE k= NAMESPACE nn= p_NCName EQUAL us= p_StringLiteral SEMICOLON -> ^( NamespaceDecl $nn $us) )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:450:11: k= DECLARE k= NAMESPACE nn= p_NCName EQUAL us= p_StringLiteral SEMICOLON
+ k=this.match(this.input,DECLARE,XQueryParser.FOLLOW_DECLARE_in_pm_NamespaceDecl2477); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_DECLARE.add(k);
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ k=this.match(this.input,NAMESPACE,XQueryParser.FOLLOW_NAMESPACE_in_pm_NamespaceDecl2483); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_NAMESPACE.add(k);
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_NCName_in_pm_NamespaceDecl2489);
+ nn=this.p_NCName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_p_NCName.add(nn.getTree());
+ EQUAL47=this.match(this.input,EQUAL,XQueryParser.FOLLOW_EQUAL_in_pm_NamespaceDecl2491); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_EQUAL.add(EQUAL47);
+
+ this.pushFollow(XQueryParser.FOLLOW_p_StringLiteral_in_pm_NamespaceDecl2495);
+ us=this.p_StringLiteral();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_p_StringLiteral.add(us.getTree());
+ SEMICOLON48=this.match(this.input,SEMICOLON,XQueryParser.FOLLOW_SEMICOLON_in_pm_NamespaceDecl2497); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_SEMICOLON.add(SEMICOLON48);
+
+
+
+ // AST REWRITE
+ // elements: nn, us
+ // token labels:
+ // rule labels: retval, nn, us
+ // token list labels:
+ // rule list labels:
+ if ( this.state.backtracking===0 ) {
+ retval.tree = root_0;
+ var stream_retval=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token retval",retval!=null?retval.tree:null);
+ var stream_nn=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token nn",nn!=null?nn.tree:null);
+ var stream_us=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token us",us!=null?us.tree:null);
+
+ root_0 = this.adaptor.nil();
+ // 451:17: -> ^( NamespaceDecl $nn $us)
+ {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:451:20: ^( NamespaceDecl $nn $us)
+ {
+ var root_1 = this.adaptor.nil();
+ root_1 = this.adaptor.becomeRoot(this.adaptor.create(NamespaceDecl, "NamespaceDecl"), root_1);
+
+ this.adaptor.addChild(root_1, stream_nn.nextTree());
+ this.adaptor.addChild(root_1, stream_us.nextTree());
+
+ this.adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;}
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ pm_DefaultNamespaceDecl_return: (function() {
+ XQueryParser.pm_DefaultNamespaceDecl_return = function(){};
+ org.antlr.lang.extend(XQueryParser.pm_DefaultNamespaceDecl_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:455:1: pm_DefaultNamespaceDecl : k= DECLARE k= DEFAULT (k= ELEMENT | k= FUNCTION ) k= NAMESPACE p_StringLiteral SEMICOLON ;
+ // $ANTLR start "pm_DefaultNamespaceDecl"
+ pm_DefaultNamespaceDecl: function() {
+ var retval = new XQueryParser.pm_DefaultNamespaceDecl_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var SEMICOLON50 = null;
+ var p_StringLiteral49 = null;
+
+ var k_tree=null;
+ var SEMICOLON50_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:456:9: (k= DECLARE k= DEFAULT (k= ELEMENT | k= FUNCTION ) k= NAMESPACE p_StringLiteral SEMICOLON )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:456:11: k= DECLARE k= DEFAULT (k= ELEMENT | k= FUNCTION ) k= NAMESPACE p_StringLiteral SEMICOLON
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,DECLARE,XQueryParser.FOLLOW_DECLARE_in_pm_DefaultNamespaceDecl2554); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ k=this.match(this.input,DEFAULT,XQueryParser.FOLLOW_DEFAULT_in_pm_DefaultNamespaceDecl2560); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:456:61: (k= ELEMENT | k= FUNCTION )
+ var alt27=2;
+ var LA27_0 = this.input.LA(1);
+
+ if ( (LA27_0==ELEMENT) ) {
+ alt27=1;
+ }
+ else if ( (LA27_0==FUNCTION) ) {
+ alt27=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 27, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt27) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:456:62: k= ELEMENT
+ k=this.match(this.input,ELEMENT,XQueryParser.FOLLOW_ELEMENT_in_pm_DefaultNamespaceDecl2567); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:456:74: k= FUNCTION
+ k=this.match(this.input,FUNCTION,XQueryParser.FOLLOW_FUNCTION_in_pm_DefaultNamespaceDecl2573); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+
+
+ break;
+
+ }
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ k=this.match(this.input,NAMESPACE,XQueryParser.FOLLOW_NAMESPACE_in_pm_DefaultNamespaceDecl2580); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_StringLiteral_in_pm_DefaultNamespaceDecl2584);
+ p_StringLiteral49=this.p_StringLiteral();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_StringLiteral49.getTree());
+ SEMICOLON50=this.match(this.input,SEMICOLON,XQueryParser.FOLLOW_SEMICOLON_in_pm_DefaultNamespaceDecl2586); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ SEMICOLON50_tree = this.adaptor.create(SEMICOLON50);
+ this.adaptor.addChild(root_0, SEMICOLON50_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ pm_AnnotatedDecl_return: (function() {
+ XQueryParser.pm_AnnotatedDecl_return = function(){};
+ org.antlr.lang.extend(XQueryParser.pm_AnnotatedDecl_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:460:1: pm_AnnotatedDecl : k= DECLARE ( p_Annotation )* pg_AnnotatedDecl SEMICOLON ;
+ // $ANTLR start "pm_AnnotatedDecl"
+ pm_AnnotatedDecl: function() {
+ var retval = new XQueryParser.pm_AnnotatedDecl_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var SEMICOLON53 = null;
+ var p_Annotation51 = null;
+ var pg_AnnotatedDecl52 = null;
+
+ var k_tree=null;
+ var SEMICOLON53_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:461:9: (k= DECLARE ( p_Annotation )* pg_AnnotatedDecl SEMICOLON )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:461:11: k= DECLARE ( p_Annotation )* pg_AnnotatedDecl SEMICOLON
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,DECLARE,XQueryParser.FOLLOW_DECLARE_in_pm_AnnotatedDecl2614); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:461:36: ( p_Annotation )*
+ loop28:
+ do {
+ var alt28=2;
+ var LA28_0 = this.input.LA(1);
+
+ if ( (LA28_0==ANN_PERCENT) ) {
+ alt28=1;
+ }
+
+
+ switch (alt28) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:461:36: p_Annotation
+ this.pushFollow(XQueryParser.FOLLOW_p_Annotation_in_pm_AnnotatedDecl2618);
+ p_Annotation51=this.p_Annotation();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Annotation51.getTree());
+
+
+ break;
+
+ default :
+ break loop28;
+ }
+ } while (true);
+
+ this.pushFollow(XQueryParser.FOLLOW_pg_AnnotatedDecl_in_pm_AnnotatedDecl2621);
+ pg_AnnotatedDecl52=this.pg_AnnotatedDecl();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, pg_AnnotatedDecl52.getTree());
+ SEMICOLON53=this.match(this.input,SEMICOLON,XQueryParser.FOLLOW_SEMICOLON_in_pm_AnnotatedDecl2623); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ SEMICOLON53_tree = this.adaptor.create(SEMICOLON53);
+ this.adaptor.addChild(root_0, SEMICOLON53_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ pg_AnnotatedDecl_return: (function() {
+ XQueryParser.pg_AnnotatedDecl_return = function(){};
+ org.antlr.lang.extend(XQueryParser.pg_AnnotatedDecl_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:463:1: pg_AnnotatedDecl : ( p_VarDecl | pm_FunctionDecl | {...}? => p_CollectionDecl | {...}? => p_IndexDecl | {...}? => p_ICDecl );
+ // $ANTLR start "pg_AnnotatedDecl"
+ pg_AnnotatedDecl: function() {
+ var retval = new XQueryParser.pg_AnnotatedDecl_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_VarDecl54 = null;
+ var pm_FunctionDecl55 = null;
+ var p_CollectionDecl56 = null;
+ var p_IndexDecl57 = null;
+ var p_ICDecl58 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:464:9: ( p_VarDecl | pm_FunctionDecl | {...}? => p_CollectionDecl | {...}? => p_IndexDecl | {...}? => p_ICDecl )
+ var alt29=5;
+ var LA29_0 = this.input.LA(1);
+
+ if ( (LA29_0==VARIABLE) ) {
+ alt29=1;
+ }
+ else if ( (LA29_0==UPDATING) && ((this.lc(XQU)))) {
+ alt29=2;
+ }
+ else if ( (LA29_0==FUNCTION) ) {
+ alt29=2;
+ }
+ else if ( (LA29_0==COLLECTION) && ((this.lc(ZORBA)))) {
+ alt29=3;
+ }
+ else if ( (LA29_0==INDEX) && ((this.lc(ZORBA)))) {
+ alt29=4;
+ }
+ else if ( (LA29_0==INTEGRITY) && ((this.lc(ZORBA)))) {
+ alt29=5;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 29, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt29) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:464:11: p_VarDecl
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_VarDecl_in_pg_AnnotatedDecl2647);
+ p_VarDecl54=this.p_VarDecl();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_VarDecl54.getTree());
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:465:11: pm_FunctionDecl
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_pm_FunctionDecl_in_pg_AnnotatedDecl2659);
+ pm_FunctionDecl55=this.pm_FunctionDecl();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, pm_FunctionDecl55.getTree());
+
+
+ break;
+ case 3 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:466:11: {...}? => p_CollectionDecl
+ root_0 = this.adaptor.nil();
+
+ if ( !((this.lc(ZORBA))) ) {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ throw new org.antlr.runtime.FailedPredicateException(this.input, "pg_AnnotatedDecl", "this.lc(ZORBA)");
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_CollectionDecl_in_pg_AnnotatedDecl2674);
+ p_CollectionDecl56=this.p_CollectionDecl();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_CollectionDecl56.getTree());
+
+
+ break;
+ case 4 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:467:11: {...}? => p_IndexDecl
+ root_0 = this.adaptor.nil();
+
+ if ( !((this.lc(ZORBA))) ) {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ throw new org.antlr.runtime.FailedPredicateException(this.input, "pg_AnnotatedDecl", "this.lc(ZORBA)");
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_IndexDecl_in_pg_AnnotatedDecl2689);
+ p_IndexDecl57=this.p_IndexDecl();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_IndexDecl57.getTree());
+
+
+ break;
+ case 5 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:468:11: {...}? => p_ICDecl
+ root_0 = this.adaptor.nil();
+
+ if ( !((this.lc(ZORBA))) ) {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ throw new org.antlr.runtime.FailedPredicateException(this.input, "pg_AnnotatedDecl", "this.lc(ZORBA)");
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_ICDecl_in_pg_AnnotatedDecl2704);
+ p_ICDecl58=this.p_ICDecl();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ICDecl58.getTree());
+
+
+ break;
+
+ }
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_Annotation_return: (function() {
+ XQueryParser.p_Annotation_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_Annotation_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:472:1: p_Annotation : ANN_PERCENT p_EQName ( LPAREN p_Literal ( COMMA p_Literal )* RPAREN )? ;
+ // $ANTLR start "p_Annotation"
+ p_Annotation: function() {
+ var retval = new XQueryParser.p_Annotation_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var ANN_PERCENT59 = null;
+ var LPAREN61 = null;
+ var COMMA63 = null;
+ var RPAREN65 = null;
+ var p_EQName60 = null;
+ var p_Literal62 = null;
+ var p_Literal64 = null;
+
+ var ANN_PERCENT59_tree=null;
+ var LPAREN61_tree=null;
+ var COMMA63_tree=null;
+ var RPAREN65_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:473:9: ( ANN_PERCENT p_EQName ( LPAREN p_Literal ( COMMA p_Literal )* RPAREN )? )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:473:11: ANN_PERCENT p_EQName ( LPAREN p_Literal ( COMMA p_Literal )* RPAREN )?
+ root_0 = this.adaptor.nil();
+
+ ANN_PERCENT59=this.match(this.input,ANN_PERCENT,XQueryParser.FOLLOW_ANN_PERCENT_in_p_Annotation2730); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ ANN_PERCENT59_tree = this.adaptor.create(ANN_PERCENT59);
+ this.adaptor.addChild(root_0, ANN_PERCENT59_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_EQName_in_p_Annotation2732);
+ p_EQName60=this.p_EQName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_EQName60.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:473:32: ( LPAREN p_Literal ( COMMA p_Literal )* RPAREN )?
+ var alt31=2;
+ var LA31_0 = this.input.LA(1);
+
+ if ( (LA31_0==LPAREN) ) {
+ alt31=1;
+ }
+ switch (alt31) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:473:33: LPAREN p_Literal ( COMMA p_Literal )* RPAREN
+ LPAREN61=this.match(this.input,LPAREN,XQueryParser.FOLLOW_LPAREN_in_p_Annotation2735); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LPAREN61_tree = this.adaptor.create(LPAREN61);
+ this.adaptor.addChild(root_0, LPAREN61_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_Literal_in_p_Annotation2737);
+ p_Literal62=this.p_Literal();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Literal62.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:473:50: ( COMMA p_Literal )*
+ loop30:
+ do {
+ var alt30=2;
+ var LA30_0 = this.input.LA(1);
+
+ if ( (LA30_0==COMMA) ) {
+ alt30=1;
+ }
+
+
+ switch (alt30) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:473:51: COMMA p_Literal
+ COMMA63=this.match(this.input,COMMA,XQueryParser.FOLLOW_COMMA_in_p_Annotation2740); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ COMMA63_tree = this.adaptor.create(COMMA63);
+ this.adaptor.addChild(root_0, COMMA63_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_Literal_in_p_Annotation2742);
+ p_Literal64=this.p_Literal();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Literal64.getTree());
+
+
+ break;
+
+ default :
+ break loop30;
+ }
+ } while (true);
+
+ RPAREN65=this.match(this.input,RPAREN,XQueryParser.FOLLOW_RPAREN_in_p_Annotation2746); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RPAREN65_tree = this.adaptor.create(RPAREN65);
+ this.adaptor.addChild(root_0, RPAREN65_tree);
+ }
+
+
+ break;
+
+ }
+
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_VarDecl_return: (function() {
+ XQueryParser.p_VarDecl_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_VarDecl_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:477:1: p_VarDecl : k= VARIABLE d= DOLLAR qn= p_EQName (td= p_TypeDeclaration )? ( ( BIND vv= p_VarValue ) | (k= EXTERNAL ( BIND vdv= p_VarDefaultValue )? ) ) -> ^( VarDecl $qn ^( VarType ( $td)? ) ^( VarValue ( $vv)? ^( VarDefaultValue ( $vdv)? ) ) ) ;
+ // $ANTLR start "p_VarDecl"
+ p_VarDecl: function() {
+ var retval = new XQueryParser.p_VarDecl_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var d = null;
+ var BIND66 = null;
+ var BIND67 = null;
+ var qn = null;
+ var td = null;
+ var vv = null;
+ var vdv = null;
+
+ var k_tree=null;
+ var d_tree=null;
+ var BIND66_tree=null;
+ var BIND67_tree=null;
+ var stream_DOLLAR=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token DOLLAR");
+ var stream_EXTERNAL=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token EXTERNAL");
+ var stream_VARIABLE=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token VARIABLE");
+ var stream_BIND=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token BIND");
+ var stream_p_TypeDeclaration=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"rule p_TypeDeclaration");
+ var stream_p_VarDefaultValue=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"rule p_VarDefaultValue");
+ var stream_p_VarValue=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"rule p_VarValue");
+ var stream_p_EQName=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"rule p_EQName");
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:478:9: (k= VARIABLE d= DOLLAR qn= p_EQName (td= p_TypeDeclaration )? ( ( BIND vv= p_VarValue ) | (k= EXTERNAL ( BIND vdv= p_VarDefaultValue )? ) ) -> ^( VarDecl $qn ^( VarType ( $td)? ) ^( VarValue ( $vv)? ^( VarDefaultValue ( $vdv)? ) ) ) )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:478:11: k= VARIABLE d= DOLLAR qn= p_EQName (td= p_TypeDeclaration )? ( ( BIND vv= p_VarValue ) | (k= EXTERNAL ( BIND vdv= p_VarDefaultValue )? ) )
+ k=this.match(this.input,VARIABLE,XQueryParser.FOLLOW_VARIABLE_in_p_VarDecl2776); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_VARIABLE.add(k);
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ d=this.match(this.input,DOLLAR,XQueryParser.FOLLOW_DOLLAR_in_p_VarDecl2782); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_DOLLAR.add(d);
+
+ this.pushFollow(XQueryParser.FOLLOW_p_EQName_in_p_VarDecl2786);
+ qn=this.p_EQName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_p_EQName.add(qn.getTree());
+ if ( this.state.backtracking===0 ) {
+ this.av(d, (qn?qn.stop:null));
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:478:87: (td= p_TypeDeclaration )?
+ var alt32=2;
+ var LA32_0 = this.input.LA(1);
+
+ if ( (LA32_0==AS) ) {
+ alt32=1;
+ }
+ switch (alt32) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:478:87: td= p_TypeDeclaration
+ this.pushFollow(XQueryParser.FOLLOW_p_TypeDeclaration_in_p_VarDecl2792);
+ td=this.p_TypeDeclaration();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_p_TypeDeclaration.add(td.getTree());
+
+
+ break;
+
+ }
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:478:107: ( ( BIND vv= p_VarValue ) | (k= EXTERNAL ( BIND vdv= p_VarDefaultValue )? ) )
+ var alt34=2;
+ var LA34_0 = this.input.LA(1);
+
+ if ( (LA34_0==BIND) ) {
+ alt34=1;
+ }
+ else if ( (LA34_0==EXTERNAL) ) {
+ alt34=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 34, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt34) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:478:108: ( BIND vv= p_VarValue )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:478:108: ( BIND vv= p_VarValue )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:478:109: BIND vv= p_VarValue
+ BIND66=this.match(this.input,BIND,XQueryParser.FOLLOW_BIND_in_p_VarDecl2797); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_BIND.add(BIND66);
+
+ this.pushFollow(XQueryParser.FOLLOW_p_VarValue_in_p_VarDecl2801);
+ vv=this.p_VarValue();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_p_VarValue.add(vv.getTree());
+
+
+
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:478:131: (k= EXTERNAL ( BIND vdv= p_VarDefaultValue )? )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:478:131: (k= EXTERNAL ( BIND vdv= p_VarDefaultValue )? )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:478:132: k= EXTERNAL ( BIND vdv= p_VarDefaultValue )?
+ k=this.match(this.input,EXTERNAL,XQueryParser.FOLLOW_EXTERNAL_in_p_VarDecl2809); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_EXTERNAL.add(k);
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:478:158: ( BIND vdv= p_VarDefaultValue )?
+ var alt33=2;
+ var LA33_0 = this.input.LA(1);
+
+ if ( (LA33_0==BIND) ) {
+ alt33=1;
+ }
+ switch (alt33) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:478:159: BIND vdv= p_VarDefaultValue
+ BIND67=this.match(this.input,BIND,XQueryParser.FOLLOW_BIND_in_p_VarDecl2814); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_BIND.add(BIND67);
+
+ this.pushFollow(XQueryParser.FOLLOW_p_VarDefaultValue_in_p_VarDecl2818);
+ vdv=this.p_VarDefaultValue();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_p_VarDefaultValue.add(vdv.getTree());
+
+
+ break;
+
+ }
+
+
+
+
+
+
+ break;
+
+ }
+
+
+
+ // AST REWRITE
+ // elements: vv, qn, td, vdv
+ // token labels:
+ // rule labels: qn, vv, retval, vdv, td
+ // token list labels:
+ // rule list labels:
+ if ( this.state.backtracking===0 ) {
+ retval.tree = root_0;
+ var stream_qn=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token qn",qn!=null?qn.tree:null);
+ var stream_vv=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token vv",vv!=null?vv.tree:null);
+ var stream_retval=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token retval",retval!=null?retval.tree:null);
+ var stream_vdv=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token vdv",vdv!=null?vdv.tree:null);
+ var stream_td=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token td",td!=null?td.tree:null);
+
+ root_0 = this.adaptor.nil();
+ // 479:17: -> ^( VarDecl $qn ^( VarType ( $td)? ) ^( VarValue ( $vv)? ^( VarDefaultValue ( $vdv)? ) ) )
+ {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:479:20: ^( VarDecl $qn ^( VarType ( $td)? ) ^( VarValue ( $vv)? ^( VarDefaultValue ( $vdv)? ) ) )
+ {
+ var root_1 = this.adaptor.nil();
+ root_1 = this.adaptor.becomeRoot(this.adaptor.create(VarDecl, "VarDecl"), root_1);
+
+ this.adaptor.addChild(root_1, stream_qn.nextTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:479:34: ^( VarType ( $td)? )
+ {
+ var root_2 = this.adaptor.nil();
+ root_2 = this.adaptor.becomeRoot(this.adaptor.create(VarType, "VarType"), root_2);
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:479:44: ( $td)?
+ if ( stream_td.hasNext() ) {
+ this.adaptor.addChild(root_2, stream_td.nextTree());
+
+ }
+ stream_td.reset();
+
+ this.adaptor.addChild(root_1, root_2);
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:479:50: ^( VarValue ( $vv)? ^( VarDefaultValue ( $vdv)? ) )
+ {
+ var root_2 = this.adaptor.nil();
+ root_2 = this.adaptor.becomeRoot(this.adaptor.create(VarValue, "VarValue"), root_2);
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:479:61: ( $vv)?
+ if ( stream_vv.hasNext() ) {
+ this.adaptor.addChild(root_2, stream_vv.nextTree());
+
+ }
+ stream_vv.reset();
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:479:66: ^( VarDefaultValue ( $vdv)? )
+ {
+ var root_3 = this.adaptor.nil();
+ root_3 = this.adaptor.becomeRoot(this.adaptor.create(VarDefaultValue, "VarDefaultValue"), root_3);
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:479:84: ( $vdv)?
+ if ( stream_vdv.hasNext() ) {
+ this.adaptor.addChild(root_3, stream_vdv.nextTree());
+
+ }
+ stream_vdv.reset();
+
+ this.adaptor.addChild(root_2, root_3);
+ }
+
+ this.adaptor.addChild(root_1, root_2);
+ }
+
+ this.adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;}
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_VarValue_return: (function() {
+ XQueryParser.p_VarValue_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_VarValue_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:483:1: p_VarValue : p_ExprSingle[true] ;
+ // $ANTLR start "p_VarValue"
+ p_VarValue: function() {
+ var retval = new XQueryParser.p_VarValue_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_ExprSingle68 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:484:9: ( p_ExprSingle[true] )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:484:11: p_ExprSingle[true]
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_ExprSingle_in_p_VarValue2897);
+ p_ExprSingle68=this.p_ExprSingle(true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ExprSingle68.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_VarDefaultValue_return: (function() {
+ XQueryParser.p_VarDefaultValue_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_VarDefaultValue_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:488:1: p_VarDefaultValue : p_ExprSingle[true] ;
+ // $ANTLR start "p_VarDefaultValue"
+ p_VarDefaultValue: function() {
+ var retval = new XQueryParser.p_VarDefaultValue_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_ExprSingle69 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:489:9: ( p_ExprSingle[true] )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:489:11: p_ExprSingle[true]
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_ExprSingle_in_p_VarDefaultValue2924);
+ p_ExprSingle69=this.p_ExprSingle(true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ExprSingle69.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ pm_ContextItemDecl_return: (function() {
+ XQueryParser.pm_ContextItemDecl_return = function(){};
+ org.antlr.lang.extend(XQueryParser.pm_ContextItemDecl_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:493:1: pm_ContextItemDecl : k= DECLARE k= CONTEXT k= ITEM (k= AS p_ItemType )? ( ( BIND p_VarValue ) | (k= EXTERNAL ( BIND p_VarDefaultValue )? ) ) SEMICOLON ;
+ // $ANTLR start "pm_ContextItemDecl"
+ pm_ContextItemDecl: function() {
+ var retval = new XQueryParser.pm_ContextItemDecl_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var BIND71 = null;
+ var BIND73 = null;
+ var SEMICOLON75 = null;
+ var p_ItemType70 = null;
+ var p_VarValue72 = null;
+ var p_VarDefaultValue74 = null;
+
+ var k_tree=null;
+ var BIND71_tree=null;
+ var BIND73_tree=null;
+ var SEMICOLON75_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:494:9: (k= DECLARE k= CONTEXT k= ITEM (k= AS p_ItemType )? ( ( BIND p_VarValue ) | (k= EXTERNAL ( BIND p_VarDefaultValue )? ) ) SEMICOLON )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:494:11: k= DECLARE k= CONTEXT k= ITEM (k= AS p_ItemType )? ( ( BIND p_VarValue ) | (k= EXTERNAL ( BIND p_VarDefaultValue )? ) ) SEMICOLON
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,DECLARE,XQueryParser.FOLLOW_DECLARE_in_pm_ContextItemDecl2953); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ k=this.match(this.input,CONTEXT,XQueryParser.FOLLOW_CONTEXT_in_pm_ContextItemDecl2959); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ k=this.match(this.input,ITEM,XQueryParser.FOLLOW_ITEM_in_pm_ContextItemDecl2965); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:494:83: (k= AS p_ItemType )?
+ var alt35=2;
+ var LA35_0 = this.input.LA(1);
+
+ if ( (LA35_0==AS) ) {
+ alt35=1;
+ }
+ switch (alt35) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:494:84: k= AS p_ItemType
+ k=this.match(this.input,AS,XQueryParser.FOLLOW_AS_in_pm_ContextItemDecl2972); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_ItemType_in_pm_ContextItemDecl2976);
+ p_ItemType70=this.p_ItemType();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ItemType70.getTree());
+
+
+ break;
+
+ }
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:494:117: ( ( BIND p_VarValue ) | (k= EXTERNAL ( BIND p_VarDefaultValue )? ) )
+ var alt37=2;
+ var LA37_0 = this.input.LA(1);
+
+ if ( (LA37_0==BIND) ) {
+ alt37=1;
+ }
+ else if ( (LA37_0==EXTERNAL) ) {
+ alt37=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 37, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt37) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:494:118: ( BIND p_VarValue )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:494:118: ( BIND p_VarValue )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:494:119: BIND p_VarValue
+ BIND71=this.match(this.input,BIND,XQueryParser.FOLLOW_BIND_in_pm_ContextItemDecl2982); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ BIND71_tree = this.adaptor.create(BIND71);
+ this.adaptor.addChild(root_0, BIND71_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_VarValue_in_pm_ContextItemDecl2984);
+ p_VarValue72=this.p_VarValue();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_VarValue72.getTree());
+
+
+
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:494:138: (k= EXTERNAL ( BIND p_VarDefaultValue )? )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:494:138: (k= EXTERNAL ( BIND p_VarDefaultValue )? )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:494:139: k= EXTERNAL ( BIND p_VarDefaultValue )?
+ k=this.match(this.input,EXTERNAL,XQueryParser.FOLLOW_EXTERNAL_in_pm_ContextItemDecl2992); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:494:165: ( BIND p_VarDefaultValue )?
+ var alt36=2;
+ var LA36_0 = this.input.LA(1);
+
+ if ( (LA36_0==BIND) ) {
+ alt36=1;
+ }
+ switch (alt36) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:494:166: BIND p_VarDefaultValue
+ BIND73=this.match(this.input,BIND,XQueryParser.FOLLOW_BIND_in_pm_ContextItemDecl2997); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ BIND73_tree = this.adaptor.create(BIND73);
+ this.adaptor.addChild(root_0, BIND73_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_VarDefaultValue_in_pm_ContextItemDecl2999);
+ p_VarDefaultValue74=this.p_VarDefaultValue();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_VarDefaultValue74.getTree());
+
+
+ break;
+
+ }
+
+
+
+
+
+
+ break;
+
+ }
+
+ SEMICOLON75=this.match(this.input,SEMICOLON,XQueryParser.FOLLOW_SEMICOLON_in_pm_ContextItemDecl3005); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ SEMICOLON75_tree = this.adaptor.create(SEMICOLON75);
+ this.adaptor.addChild(root_0, SEMICOLON75_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ pm_FunctionDecl_return: (function() {
+ XQueryParser.pm_FunctionDecl_return = function(){};
+ org.antlr.lang.extend(XQueryParser.pm_FunctionDecl_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:499:1: pm_FunctionDecl : ({...}? =>k= UPDATING )? k= FUNCTION qn= pg_FQName LPAREN (pl= p_ParamList )? RPAREN (k= AS st= p_SequenceType )? ( LBRACKET soe= p_StatementsAndOptionalExpr RBRACKET | k= EXTERNAL ) -> ^( FunctionDecl $qn ^( ParamList ( $pl)? ) ^( ReturnType ( $st)? ) ( $soe)? ) ;
+ // $ANTLR start "pm_FunctionDecl"
+ pm_FunctionDecl: function() {
+ var retval = new XQueryParser.pm_FunctionDecl_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var LPAREN76 = null;
+ var RPAREN77 = null;
+ var LBRACKET78 = null;
+ var RBRACKET79 = null;
+ var qn = null;
+ var pl = null;
+ var st = null;
+ var soe = null;
+
+ var k_tree=null;
+ var LPAREN76_tree=null;
+ var RPAREN77_tree=null;
+ var LBRACKET78_tree=null;
+ var RBRACKET79_tree=null;
+ var stream_FUNCTION=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token FUNCTION");
+ var stream_LBRACKET=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token LBRACKET");
+ var stream_AS=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token AS");
+ var stream_RPAREN=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token RPAREN");
+ var stream_EXTERNAL=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token EXTERNAL");
+ var stream_RBRACKET=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token RBRACKET");
+ var stream_LPAREN=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token LPAREN");
+ var stream_UPDATING=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token UPDATING");
+ var stream_p_StatementsAndOptionalExpr=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"rule p_StatementsAndOptionalExpr");
+ var stream_p_ParamList=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"rule p_ParamList");
+ var stream_pg_FQName=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"rule pg_FQName");
+ var stream_p_SequenceType=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"rule p_SequenceType");
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:500:9: ( ({...}? =>k= UPDATING )? k= FUNCTION qn= pg_FQName LPAREN (pl= p_ParamList )? RPAREN (k= AS st= p_SequenceType )? ( LBRACKET soe= p_StatementsAndOptionalExpr RBRACKET | k= EXTERNAL ) -> ^( FunctionDecl $qn ^( ParamList ( $pl)? ) ^( ReturnType ( $st)? ) ( $soe)? ) )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:500:11: ({...}? =>k= UPDATING )? k= FUNCTION qn= pg_FQName LPAREN (pl= p_ParamList )? RPAREN (k= AS st= p_SequenceType )? ( LBRACKET soe= p_StatementsAndOptionalExpr RBRACKET | k= EXTERNAL )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:500:11: ({...}? =>k= UPDATING )?
+ var alt38=2;
+ var LA38_0 = this.input.LA(1);
+
+ if ( (LA38_0==UPDATING) && ((this.lc(XQU)))) {
+ alt38=1;
+ }
+ switch (alt38) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:500:12: {...}? =>k= UPDATING
+ if ( !((this.lc(XQU))) ) {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ throw new org.antlr.runtime.FailedPredicateException(this.input, "pm_FunctionDecl", "this.lc(XQU)");
+ }
+ k=this.match(this.input,UPDATING,XQueryParser.FOLLOW_UPDATING_in_pm_FunctionDecl3038); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_UPDATING.add(k);
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+
+
+ break;
+
+ }
+
+ k=this.match(this.input,FUNCTION,XQueryParser.FOLLOW_FUNCTION_in_pm_FunctionDecl3046); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_FUNCTION.add(k);
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_pg_FQName_in_pm_FunctionDecl3052);
+ qn=this.pg_FQName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_pg_FQName.add(qn.getTree());
+ LPAREN76=this.match(this.input,LPAREN,XQueryParser.FOLLOW_LPAREN_in_pm_FunctionDecl3054); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_LPAREN.add(LPAREN76);
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:500:106: (pl= p_ParamList )?
+ var alt39=2;
+ var LA39_0 = this.input.LA(1);
+
+ if ( (LA39_0==DOLLAR) ) {
+ alt39=1;
+ }
+ switch (alt39) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:500:106: pl= p_ParamList
+ this.pushFollow(XQueryParser.FOLLOW_p_ParamList_in_pm_FunctionDecl3058);
+ pl=this.p_ParamList();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_p_ParamList.add(pl.getTree());
+
+
+ break;
+
+ }
+
+ RPAREN77=this.match(this.input,RPAREN,XQueryParser.FOLLOW_RPAREN_in_pm_FunctionDecl3061); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_RPAREN.add(RPAREN77);
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:500:127: (k= AS st= p_SequenceType )?
+ var alt40=2;
+ var LA40_0 = this.input.LA(1);
+
+ if ( (LA40_0==AS) ) {
+ alt40=1;
+ }
+ switch (alt40) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:500:128: k= AS st= p_SequenceType
+ k=this.match(this.input,AS,XQueryParser.FOLLOW_AS_in_pm_FunctionDecl3066); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_AS.add(k);
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_SequenceType_in_pm_FunctionDecl3072);
+ st=this.p_SequenceType();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_p_SequenceType.add(st.getTree());
+
+
+ break;
+
+ }
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:500:168: ( LBRACKET soe= p_StatementsAndOptionalExpr RBRACKET | k= EXTERNAL )
+ var alt41=2;
+ var LA41_0 = this.input.LA(1);
+
+ if ( (LA41_0==LBRACKET) ) {
+ alt41=1;
+ }
+ else if ( (LA41_0==EXTERNAL) ) {
+ alt41=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 41, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt41) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:500:169: LBRACKET soe= p_StatementsAndOptionalExpr RBRACKET
+ LBRACKET78=this.match(this.input,LBRACKET,XQueryParser.FOLLOW_LBRACKET_in_pm_FunctionDecl3077); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_LBRACKET.add(LBRACKET78);
+
+ this.pushFollow(XQueryParser.FOLLOW_p_StatementsAndOptionalExpr_in_pm_FunctionDecl3081);
+ soe=this.p_StatementsAndOptionalExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_p_StatementsAndOptionalExpr.add(soe.getTree());
+ RBRACKET79=this.match(this.input,RBRACKET,XQueryParser.FOLLOW_RBRACKET_in_pm_FunctionDecl3083); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_RBRACKET.add(RBRACKET79);
+
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:500:221: k= EXTERNAL
+ k=this.match(this.input,EXTERNAL,XQueryParser.FOLLOW_EXTERNAL_in_pm_FunctionDecl3089); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_EXTERNAL.add(k);
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+
+
+ break;
+
+ }
+
+
+
+ // AST REWRITE
+ // elements: soe, pl, st, qn
+ // token labels:
+ // rule labels: qn, soe, retval, pl, st
+ // token list labels:
+ // rule list labels:
+ if ( this.state.backtracking===0 ) {
+ retval.tree = root_0;
+ var stream_qn=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token qn",qn!=null?qn.tree:null);
+ var stream_soe=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token soe",soe!=null?soe.tree:null);
+ var stream_retval=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token retval",retval!=null?retval.tree:null);
+ var stream_pl=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token pl",pl!=null?pl.tree:null);
+ var stream_st=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token st",st!=null?st.tree:null);
+
+ root_0 = this.adaptor.nil();
+ // 501:17: -> ^( FunctionDecl $qn ^( ParamList ( $pl)? ) ^( ReturnType ( $st)? ) ( $soe)? )
+ {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:501:20: ^( FunctionDecl $qn ^( ParamList ( $pl)? ) ^( ReturnType ( $st)? ) ( $soe)? )
+ {
+ var root_1 = this.adaptor.nil();
+ root_1 = this.adaptor.becomeRoot(this.adaptor.create(FunctionDecl, "FunctionDecl"), root_1);
+
+ this.adaptor.addChild(root_1, stream_qn.nextTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:501:39: ^( ParamList ( $pl)? )
+ {
+ var root_2 = this.adaptor.nil();
+ root_2 = this.adaptor.becomeRoot(this.adaptor.create(ParamList, "ParamList"), root_2);
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:501:51: ( $pl)?
+ if ( stream_pl.hasNext() ) {
+ this.adaptor.addChild(root_2, stream_pl.nextTree());
+
+ }
+ stream_pl.reset();
+
+ this.adaptor.addChild(root_1, root_2);
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:501:57: ^( ReturnType ( $st)? )
+ {
+ var root_2 = this.adaptor.nil();
+ root_2 = this.adaptor.becomeRoot(this.adaptor.create(ReturnType, "ReturnType"), root_2);
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:501:70: ( $st)?
+ if ( stream_st.hasNext() ) {
+ this.adaptor.addChild(root_2, stream_st.nextTree());
+
+ }
+ stream_st.reset();
+
+ this.adaptor.addChild(root_1, root_2);
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:501:76: ( $soe)?
+ if ( stream_soe.hasNext() ) {
+ this.adaptor.addChild(root_1, stream_soe.nextTree());
+
+ }
+ stream_soe.reset();
+
+ this.adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;}
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_ParamList_return: (function() {
+ XQueryParser.p_ParamList_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_ParamList_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:505:1: p_ParamList : p+= p_Param ( COMMA p+= p_Param )* -> ( $p)+ ;
+ // $ANTLR start "p_ParamList"
+ p_ParamList: function() {
+ var retval = new XQueryParser.p_ParamList_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var COMMA80 = null;
+ var list_p=null;
+ var p = null;
+ var COMMA80_tree=null;
+ var stream_COMMA=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token COMMA");
+ var stream_p_Param=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"rule p_Param");
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:506:9: (p+= p_Param ( COMMA p+= p_Param )* -> ( $p)+ )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:506:11: p+= p_Param ( COMMA p+= p_Param )*
+ this.pushFollow(XQueryParser.FOLLOW_p_Param_in_p_ParamList3166);
+ p=this.p_Param();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_p_Param.add(p.getTree());
+ if (org.antlr.lang.isNull(list_p)) list_p = [];
+ list_p.push(p.getTree());
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:506:22: ( COMMA p+= p_Param )*
+ loop42:
+ do {
+ var alt42=2;
+ var LA42_0 = this.input.LA(1);
+
+ if ( (LA42_0==COMMA) ) {
+ alt42=1;
+ }
+
+
+ switch (alt42) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:506:23: COMMA p+= p_Param
+ COMMA80=this.match(this.input,COMMA,XQueryParser.FOLLOW_COMMA_in_p_ParamList3169); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_COMMA.add(COMMA80);
+
+ this.pushFollow(XQueryParser.FOLLOW_p_Param_in_p_ParamList3173);
+ p=this.p_Param();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_p_Param.add(p.getTree());
+ if (org.antlr.lang.isNull(list_p)) list_p = [];
+ list_p.push(p.getTree());
+
+
+
+ break;
+
+ default :
+ break loop42;
+ }
+ } while (true);
+
+
+
+ // AST REWRITE
+ // elements: p
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels: p
+ if ( this.state.backtracking===0 ) {
+ retval.tree = root_0;
+ var stream_retval=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token retval",retval!=null?retval.tree:null);
+ var stream_p=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token p",list_p);
+ root_0 = this.adaptor.nil();
+ // 507:17: -> ( $p)+
+ {
+ if ( !(stream_p.hasNext()) ) {
+ throw new org.antlr.runtime.tree.RewriteEarlyExitException();
+ }
+ while ( stream_p.hasNext() ) {
+ this.adaptor.addChild(root_0, stream_p.nextTree());
+
+ }
+ stream_p.reset();
+
+ }
+
+ retval.tree = root_0;}
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_Param_return: (function() {
+ XQueryParser.p_Param_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_Param_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:511:1: p_Param : d= DOLLAR qn= p_EQName (td= p_TypeDeclaration )? -> ^( Param $qn ( $td)? ) ;
+ // $ANTLR start "p_Param"
+ p_Param: function() {
+ var retval = new XQueryParser.p_Param_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var d = null;
+ var qn = null;
+ var td = null;
+
+ var d_tree=null;
+ var stream_DOLLAR=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token DOLLAR");
+ var stream_p_TypeDeclaration=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"rule p_TypeDeclaration");
+ var stream_p_EQName=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"rule p_EQName");
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:512:9: (d= DOLLAR qn= p_EQName (td= p_TypeDeclaration )? -> ^( Param $qn ( $td)? ) )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:512:11: d= DOLLAR qn= p_EQName (td= p_TypeDeclaration )?
+ d=this.match(this.input,DOLLAR,XQueryParser.FOLLOW_DOLLAR_in_p_Param3233); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_DOLLAR.add(d);
+
+ this.pushFollow(XQueryParser.FOLLOW_p_EQName_in_p_Param3237);
+ qn=this.p_EQName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_p_EQName.add(qn.getTree());
+ if ( this.state.backtracking===0 ) {
+ this.av(d, (qn?qn.stop:null));
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:512:61: (td= p_TypeDeclaration )?
+ var alt43=2;
+ var LA43_0 = this.input.LA(1);
+
+ if ( (LA43_0==AS) ) {
+ alt43=1;
+ }
+ switch (alt43) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:512:61: td= p_TypeDeclaration
+ this.pushFollow(XQueryParser.FOLLOW_p_TypeDeclaration_in_p_Param3243);
+ td=this.p_TypeDeclaration();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_p_TypeDeclaration.add(td.getTree());
+
+
+ break;
+
+ }
+
+
+
+ // AST REWRITE
+ // elements: qn, td
+ // token labels:
+ // rule labels: qn, retval, td
+ // token list labels:
+ // rule list labels:
+ if ( this.state.backtracking===0 ) {
+ retval.tree = root_0;
+ var stream_qn=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token qn",qn!=null?qn.tree:null);
+ var stream_retval=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token retval",retval!=null?retval.tree:null);
+ var stream_td=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token td",td!=null?td.tree:null);
+
+ root_0 = this.adaptor.nil();
+ // 513:17: -> ^( Param $qn ( $td)? )
+ {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:513:20: ^( Param $qn ( $td)? )
+ {
+ var root_1 = this.adaptor.nil();
+ root_1 = this.adaptor.becomeRoot(this.adaptor.create(Param, "Param"), root_1);
+
+ this.adaptor.addChild(root_1, stream_qn.nextTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:513:32: ( $td)?
+ if ( stream_td.hasNext() ) {
+ this.adaptor.addChild(root_1, stream_td.nextTree());
+
+ }
+ stream_td.reset();
+
+ this.adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;}
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ pm_FunctionBody_return: (function() {
+ XQueryParser.pm_FunctionBody_return = function(){};
+ org.antlr.lang.extend(XQueryParser.pm_FunctionBody_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:517:1: pm_FunctionBody : p_EnclosedExpr ;
+ // $ANTLR start "pm_FunctionBody"
+ pm_FunctionBody: function() {
+ var retval = new XQueryParser.pm_FunctionBody_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_EnclosedExpr81 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:518:9: ( p_EnclosedExpr )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:518:11: p_EnclosedExpr
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_EnclosedExpr_in_pm_FunctionBody3299);
+ p_EnclosedExpr81=this.p_EnclosedExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_EnclosedExpr81.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_EnclosedExpr_return: (function() {
+ XQueryParser.p_EnclosedExpr_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_EnclosedExpr_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:523:1: p_EnclosedExpr : LBRACKET p_Expr[true,true] RBRACKET -> ^( EnclosedExpr p_Expr ) ;
+ // $ANTLR start "p_EnclosedExpr"
+ p_EnclosedExpr: function() {
+ var retval = new XQueryParser.p_EnclosedExpr_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var LBRACKET82 = null;
+ var RBRACKET84 = null;
+ var p_Expr83 = null;
+
+ var LBRACKET82_tree=null;
+ var RBRACKET84_tree=null;
+ var stream_LBRACKET=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token LBRACKET");
+ var stream_RBRACKET=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token RBRACKET");
+ var stream_p_Expr=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"rule p_Expr");
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:524:9: ( LBRACKET p_Expr[true,true] RBRACKET -> ^( EnclosedExpr p_Expr ) )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:524:11: LBRACKET p_Expr[true,true] RBRACKET
+ LBRACKET82=this.match(this.input,LBRACKET,XQueryParser.FOLLOW_LBRACKET_in_p_EnclosedExpr3326); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_LBRACKET.add(LBRACKET82);
+
+ this.pushFollow(XQueryParser.FOLLOW_p_Expr_in_p_EnclosedExpr3328);
+ p_Expr83=this.p_Expr(true, true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_p_Expr.add(p_Expr83.getTree());
+ RBRACKET84=this.match(this.input,RBRACKET,XQueryParser.FOLLOW_RBRACKET_in_p_EnclosedExpr3331); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_RBRACKET.add(RBRACKET84);
+
+
+
+ // AST REWRITE
+ // elements: p_Expr
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( this.state.backtracking===0 ) {
+ retval.tree = root_0;
+ var stream_retval=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = this.adaptor.nil();
+ // 525:17: -> ^( EnclosedExpr p_Expr )
+ {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:525:20: ^( EnclosedExpr p_Expr )
+ {
+ var root_1 = this.adaptor.nil();
+ root_1 = this.adaptor.becomeRoot(this.adaptor.create(EnclosedExpr, "EnclosedExpr"), root_1);
+
+ this.adaptor.addChild(root_1, stream_p_Expr.nextTree());
+
+ this.adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;}
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ pm_OptionDecl_return: (function() {
+ XQueryParser.pm_OptionDecl_return = function(){};
+ org.antlr.lang.extend(XQueryParser.pm_OptionDecl_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:529:1: pm_OptionDecl : k= DECLARE k= OPTION p_EQName p_StringLiteral SEMICOLON ;
+ // $ANTLR start "pm_OptionDecl"
+ pm_OptionDecl: function() {
+ var retval = new XQueryParser.pm_OptionDecl_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var SEMICOLON87 = null;
+ var p_EQName85 = null;
+ var p_StringLiteral86 = null;
+
+ var k_tree=null;
+ var SEMICOLON87_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:530:9: (k= DECLARE k= OPTION p_EQName p_StringLiteral SEMICOLON )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:530:11: k= DECLARE k= OPTION p_EQName p_StringLiteral SEMICOLON
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,DECLARE,XQueryParser.FOLLOW_DECLARE_in_pm_OptionDecl3383); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ k=this.match(this.input,OPTION,XQueryParser.FOLLOW_OPTION_in_pm_OptionDecl3389); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_EQName_in_pm_OptionDecl3393);
+ p_EQName85=this.p_EQName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_EQName85.getTree());
+ this.pushFollow(XQueryParser.FOLLOW_p_StringLiteral_in_pm_OptionDecl3395);
+ p_StringLiteral86=this.p_StringLiteral();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_StringLiteral86.getTree());
+ SEMICOLON87=this.match(this.input,SEMICOLON,XQueryParser.FOLLOW_SEMICOLON_in_pm_OptionDecl3397); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ SEMICOLON87_tree = this.adaptor.create(SEMICOLON87);
+ this.adaptor.addChild(root_0, SEMICOLON87_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ pm_QueryBody_return: (function() {
+ XQueryParser.pm_QueryBody_return = function(){};
+ org.antlr.lang.extend(XQueryParser.pm_QueryBody_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:534:1: pm_QueryBody : ({...}? => p_Program | p_Expr[true,true] );
+ // $ANTLR start "pm_QueryBody"
+ pm_QueryBody: function() {
+ var retval = new XQueryParser.pm_QueryBody_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_Program88 = null;
+ var p_Expr89 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:535:9: ({...}? => p_Program | p_Expr[true,true] )
+ var alt44=2;
+ alt44 = this.dfa44.predict(this.input);
+ switch (alt44) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:535:11: {...}? => p_Program
+ root_0 = this.adaptor.nil();
+
+ if ( !((this.lc(XQS))) ) {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ throw new org.antlr.runtime.FailedPredicateException(this.input, "pm_QueryBody", "this.lc(XQS)");
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_Program_in_pm_QueryBody3426);
+ p_Program88=this.p_Program();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Program88.getTree());
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:536:11: p_Expr[true,true]
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_Expr_in_pm_QueryBody3438);
+ p_Expr89=this.p_Expr(true, true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Expr89.getTree());
+
+
+ break;
+
+ }
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_Expr_return: (function() {
+ XQueryParser.p_Expr_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_Expr_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:546:1: p_Expr[strict, allowConcat] : es= p_ExprSingle[$strict] ( COMMA p_ExprSingle[$strict] )* ;
+ // $ANTLR start "p_Expr"
+ p_Expr: function(strict, allowConcat) {
+ var retval = new XQueryParser.p_Expr_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var COMMA90 = null;
+ var es = null;
+ var p_ExprSingle91 = null;
+
+ var COMMA90_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:547:9: (es= p_ExprSingle[$strict] ( COMMA p_ExprSingle[$strict] )* )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:547:11: es= p_ExprSingle[$strict] ( COMMA p_ExprSingle[$strict] )*
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_ExprSingle_in_p_Expr3474);
+ es=this.p_ExprSingle(strict);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, es.getTree());
+ if ( this.state.backtracking===0 ) {
+ if (!allowConcat) throw new Exception();
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:548:11: ( COMMA p_ExprSingle[$strict] )*
+ loop45:
+ do {
+ var alt45=2;
+ var LA45_0 = this.input.LA(1);
+
+ if ( (LA45_0==COMMA) ) {
+ alt45=1;
+ }
+
+
+ switch (alt45) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:548:12: COMMA p_ExprSingle[$strict]
+ COMMA90=this.match(this.input,COMMA,XQueryParser.FOLLOW_COMMA_in_p_Expr3490); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ COMMA90_tree = this.adaptor.create(COMMA90);
+ this.adaptor.addChild(root_0, COMMA90_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_ExprSingle_in_p_Expr3492);
+ p_ExprSingle91=this.p_ExprSingle(strict);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ExprSingle91.getTree());
+
+
+ break;
+
+ default :
+ break loop45;
+ }
+ } while (true);
+
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (e) {
+
+ if(e instanceof org.antlr.runtime.RecognitionException) {
+ //console.log("catch1");
+ reportError(e);
+ recover(this.input, e);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), e);
+ } else if(e instanceof Exception) {
+ //console.log("catch2");
+ root_0 = this.adaptor.nil();
+ this.adaptor.addChild(root_0, es.getTree());
+ retval.stop = this.input.LT(-1);
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ } else {
+ throw e;
+ }
+
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_ExprSingle_return: (function() {
+ XQueryParser.p_ExprSingle_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_ExprSingle_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:570:1: p_ExprSingle[strict] : ( ( ( ( FOR | LET ) DOLLAR ) | ( FOR ( TUMBLING | SLIDING ) ) )=> p_FLWORHybrid[$strict] | ( IF LPAREN )=> p_IfHybrid[$strict] | ( SWITCH LPAREN )=> p_SwitchHybrid[$strict] | ( TYPESWITCH LPAREN )=> p_TypeswitchHybrid[$strict] | ( TRY LBRACKET )=> p_TryCatchHybrid[$strict] | p_ExprSimple );
+ // $ANTLR start "p_ExprSingle"
+ p_ExprSingle: function(strict) {
+ var retval = new XQueryParser.p_ExprSingle_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_FLWORHybrid92 = null;
+ var p_IfHybrid93 = null;
+ var p_SwitchHybrid94 = null;
+ var p_TypeswitchHybrid95 = null;
+ var p_TryCatchHybrid96 = null;
+ var p_ExprSimple97 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:571:9: ( ( ( ( FOR | LET ) DOLLAR ) | ( FOR ( TUMBLING | SLIDING ) ) )=> p_FLWORHybrid[$strict] | ( IF LPAREN )=> p_IfHybrid[$strict] | ( SWITCH LPAREN )=> p_SwitchHybrid[$strict] | ( TYPESWITCH LPAREN )=> p_TypeswitchHybrid[$strict] | ( TRY LBRACKET )=> p_TryCatchHybrid[$strict] | p_ExprSimple )
+ var alt46=6;
+ alt46 = this.dfa46.predict(this.input);
+ switch (alt46) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:571:11: ( ( ( FOR | LET ) DOLLAR ) | ( FOR ( TUMBLING | SLIDING ) ) )=> p_FLWORHybrid[$strict]
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_FLWORHybrid_in_p_ExprSingle3559);
+ p_FLWORHybrid92=this.p_FLWORHybrid(strict);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_FLWORHybrid92.getTree());
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:572:11: ( IF LPAREN )=> p_IfHybrid[$strict]
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_IfHybrid_in_p_ExprSingle3589);
+ p_IfHybrid93=this.p_IfHybrid(strict);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_IfHybrid93.getTree());
+
+
+ break;
+ case 3 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:573:11: ( SWITCH LPAREN )=> p_SwitchHybrid[$strict]
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_SwitchHybrid_in_p_ExprSingle3615);
+ p_SwitchHybrid94=this.p_SwitchHybrid(strict);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_SwitchHybrid94.getTree());
+
+
+ break;
+ case 4 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:574:11: ( TYPESWITCH LPAREN )=> p_TypeswitchHybrid[$strict]
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_TypeswitchHybrid_in_p_ExprSingle3637);
+ p_TypeswitchHybrid95=this.p_TypeswitchHybrid(strict);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_TypeswitchHybrid95.getTree());
+
+
+ break;
+ case 5 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:575:11: ( TRY LBRACKET )=> p_TryCatchHybrid[$strict]
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_TryCatchHybrid_in_p_ExprSingle3664);
+ p_TryCatchHybrid96=this.p_TryCatchHybrid(strict);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_TryCatchHybrid96.getTree());
+
+
+ break;
+ case 6 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:576:11: p_ExprSimple
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_ExprSimple_in_p_ExprSingle3677);
+ p_ExprSimple97=this.p_ExprSimple();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ExprSimple97.getTree());
+
+
+ break;
+
+ }
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_FLWORHybrid_return: (function() {
+ XQueryParser.p_FLWORHybrid_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_FLWORHybrid_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:580:1: p_FLWORHybrid[strict] : p_InitialClause ( p_IntermediateClause )* p_ReturnHybrid[$strict] ;
+ // $ANTLR start "p_FLWORHybrid"
+ p_FLWORHybrid: function(strict) {
+ var retval = new XQueryParser.p_FLWORHybrid_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_InitialClause98 = null;
+ var p_IntermediateClause99 = null;
+ var p_ReturnHybrid100 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:581:9: ( p_InitialClause ( p_IntermediateClause )* p_ReturnHybrid[$strict] )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:581:11: p_InitialClause ( p_IntermediateClause )* p_ReturnHybrid[$strict]
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_InitialClause_in_p_FLWORHybrid3704);
+ p_InitialClause98=this.p_InitialClause();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_InitialClause98.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:581:27: ( p_IntermediateClause )*
+ loop47:
+ do {
+ var alt47=2;
+ var LA47_0 = this.input.LA(1);
+
+ if ( (LA47_0==FOR||LA47_0==LET||LA47_0==ORDER||LA47_0==STABLE||LA47_0==WHERE||LA47_0==COUNT||LA47_0==GROUP) ) {
+ alt47=1;
+ }
+
+
+ switch (alt47) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:581:27: p_IntermediateClause
+ this.pushFollow(XQueryParser.FOLLOW_p_IntermediateClause_in_p_FLWORHybrid3706);
+ p_IntermediateClause99=this.p_IntermediateClause();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_IntermediateClause99.getTree());
+
+
+ break;
+
+ default :
+ break loop47;
+ }
+ } while (true);
+
+ this.pushFollow(XQueryParser.FOLLOW_p_ReturnHybrid_in_p_FLWORHybrid3709);
+ p_ReturnHybrid100=this.p_ReturnHybrid(strict);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ReturnHybrid100.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_InitialClause_return: (function() {
+ XQueryParser.p_InitialClause_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_InitialClause_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:585:1: p_InitialClause : ( p_ForClause | p_LetClause | p_WindowClause );
+ // $ANTLR start "p_InitialClause"
+ p_InitialClause: function() {
+ var retval = new XQueryParser.p_InitialClause_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_ForClause101 = null;
+ var p_LetClause102 = null;
+ var p_WindowClause103 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:586:9: ( p_ForClause | p_LetClause | p_WindowClause )
+ var alt48=3;
+ var LA48_0 = this.input.LA(1);
+
+ if ( (LA48_0==FOR) ) {
+ var LA48_1 = this.input.LA(2);
+
+ if ( (LA48_1==DOLLAR) ) {
+ alt48=1;
+ }
+ else if ( (LA48_1==SLIDING||LA48_1==TUMBLING) ) {
+ alt48=3;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 48, 1, this.input);
+
+ throw nvae;
+ }
+ }
+ else if ( (LA48_0==LET) ) {
+ alt48=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 48, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt48) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:586:11: p_ForClause
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_ForClause_in_p_InitialClause3736);
+ p_ForClause101=this.p_ForClause();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ForClause101.getTree());
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:586:25: p_LetClause
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_LetClause_in_p_InitialClause3740);
+ p_LetClause102=this.p_LetClause();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_LetClause102.getTree());
+
+
+ break;
+ case 3 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:586:39: p_WindowClause
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_WindowClause_in_p_InitialClause3744);
+ p_WindowClause103=this.p_WindowClause();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_WindowClause103.getTree());
+
+
+ break;
+
+ }
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_IntermediateClause_return: (function() {
+ XQueryParser.p_IntermediateClause_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_IntermediateClause_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:590:1: p_IntermediateClause : ( p_InitialClause | p_WhereClause | p_GroupByClause | p_OrderByClause | p_CountClause );
+ // $ANTLR start "p_IntermediateClause"
+ p_IntermediateClause: function() {
+ var retval = new XQueryParser.p_IntermediateClause_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_InitialClause104 = null;
+ var p_WhereClause105 = null;
+ var p_GroupByClause106 = null;
+ var p_OrderByClause107 = null;
+ var p_CountClause108 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:591:9: ( p_InitialClause | p_WhereClause | p_GroupByClause | p_OrderByClause | p_CountClause )
+ var alt49=5;
+ switch ( this.input.LA(1) ) {
+ case FOR:
+ case LET:
+ alt49=1;
+ break;
+ case WHERE:
+ alt49=2;
+ break;
+ case GROUP:
+ alt49=3;
+ break;
+ case ORDER:
+ case STABLE:
+ alt49=4;
+ break;
+ case COUNT:
+ alt49=5;
+ break;
+ default:
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 49, 0, this.input);
+
+ throw nvae;
+ }
+
+ switch (alt49) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:591:11: p_InitialClause
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_InitialClause_in_p_IntermediateClause3770);
+ p_InitialClause104=this.p_InitialClause();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_InitialClause104.getTree());
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:591:29: p_WhereClause
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_WhereClause_in_p_IntermediateClause3774);
+ p_WhereClause105=this.p_WhereClause();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_WhereClause105.getTree());
+
+
+ break;
+ case 3 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:591:45: p_GroupByClause
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_GroupByClause_in_p_IntermediateClause3778);
+ p_GroupByClause106=this.p_GroupByClause();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_GroupByClause106.getTree());
+
+
+ break;
+ case 4 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:591:63: p_OrderByClause
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_OrderByClause_in_p_IntermediateClause3782);
+ p_OrderByClause107=this.p_OrderByClause();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_OrderByClause107.getTree());
+
+
+ break;
+ case 5 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:591:81: p_CountClause
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_CountClause_in_p_IntermediateClause3786);
+ p_CountClause108=this.p_CountClause();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_CountClause108.getTree());
+
+
+ break;
+
+ }
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_StringConcatExpr_return: (function() {
+ XQueryParser.p_StringConcatExpr_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_StringConcatExpr_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:595:1: p_StringConcatExpr : p_RangeExpr (o= CONCAT p_RangeExpr )* ;
+ // $ANTLR start "p_StringConcatExpr"
+ p_StringConcatExpr: function() {
+ var retval = new XQueryParser.p_StringConcatExpr_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var o = null;
+ var p_RangeExpr109 = null;
+ var p_RangeExpr110 = null;
+
+ var o_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:596:4: ( p_RangeExpr (o= CONCAT p_RangeExpr )* )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:596:6: p_RangeExpr (o= CONCAT p_RangeExpr )*
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_RangeExpr_in_p_StringConcatExpr3807);
+ p_RangeExpr109=this.p_RangeExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_RangeExpr109.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:596:18: (o= CONCAT p_RangeExpr )*
+ loop50:
+ do {
+ var alt50=2;
+ var LA50_0 = this.input.LA(1);
+
+ if ( (LA50_0==CONCAT) ) {
+ alt50=1;
+ }
+
+
+ switch (alt50) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:596:20: o= CONCAT p_RangeExpr
+ o=this.match(this.input,CONCAT,XQueryParser.FOLLOW_CONCAT_in_p_StringConcatExpr3813); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ o_tree = this.adaptor.create(o);
+ this.adaptor.addChild(root_0, o_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ao(o);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_RangeExpr_in_p_StringConcatExpr3817);
+ p_RangeExpr110=this.p_RangeExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_RangeExpr110.getTree());
+
+
+ break;
+
+ default :
+ break loop50;
+ }
+ } while (true);
+
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_ForClause_return: (function() {
+ XQueryParser.p_ForClause_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_ForClause_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:601:1: p_ForClause : k= FOR p_ForBinding ( COMMA p_ForBinding )* ;
+ // $ANTLR start "p_ForClause"
+ p_ForClause: function() {
+ var retval = new XQueryParser.p_ForClause_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var COMMA112 = null;
+ var p_ForBinding111 = null;
+ var p_ForBinding113 = null;
+
+ var k_tree=null;
+ var COMMA112_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:602:9: (k= FOR p_ForBinding ( COMMA p_ForBinding )* )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:602:11: k= FOR p_ForBinding ( COMMA p_ForBinding )*
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,FOR,XQueryParser.FOLLOW_FOR_in_p_ForClause3844); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_ForBinding_in_p_ForClause3848);
+ p_ForBinding111=this.p_ForBinding();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ForBinding111.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:602:45: ( COMMA p_ForBinding )*
+ loop51:
+ do {
+ var alt51=2;
+ var LA51_0 = this.input.LA(1);
+
+ if ( (LA51_0==COMMA) ) {
+ alt51=1;
+ }
+
+
+ switch (alt51) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:602:46: COMMA p_ForBinding
+ COMMA112=this.match(this.input,COMMA,XQueryParser.FOLLOW_COMMA_in_p_ForClause3851); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ COMMA112_tree = this.adaptor.create(COMMA112);
+ this.adaptor.addChild(root_0, COMMA112_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_ForBinding_in_p_ForClause3853);
+ p_ForBinding113=this.p_ForBinding();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ForBinding113.getTree());
+
+
+ break;
+
+ default :
+ break loop51;
+ }
+ } while (true);
+
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_ForBinding_return: (function() {
+ XQueryParser.p_ForBinding_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_ForBinding_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:606:1: p_ForBinding : s= DOLLAR v= p_VarName ( p_TypeDeclaration )? ( p_AllowingEmpty )? ( p_PositionalVar )? ( p_FTScoreVar )? k= IN p_ExprSingle[true] ;
+ // $ANTLR start "p_ForBinding"
+ p_ForBinding: function() {
+ var retval = new XQueryParser.p_ForBinding_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var s = null;
+ var k = null;
+ var v = null;
+ var p_TypeDeclaration114 = null;
+ var p_AllowingEmpty115 = null;
+ var p_PositionalVar116 = null;
+ var p_FTScoreVar117 = null;
+ var p_ExprSingle118 = null;
+
+ var s_tree=null;
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:607:9: (s= DOLLAR v= p_VarName ( p_TypeDeclaration )? ( p_AllowingEmpty )? ( p_PositionalVar )? ( p_FTScoreVar )? k= IN p_ExprSingle[true] )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:607:11: s= DOLLAR v= p_VarName ( p_TypeDeclaration )? ( p_AllowingEmpty )? ( p_PositionalVar )? ( p_FTScoreVar )? k= IN p_ExprSingle[true]
+ root_0 = this.adaptor.nil();
+
+ s=this.match(this.input,DOLLAR,XQueryParser.FOLLOW_DOLLAR_in_p_ForBinding3883); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ s_tree = this.adaptor.create(s);
+ this.adaptor.addChild(root_0, s_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_VarName_in_p_ForBinding3887);
+ v=this.p_VarName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, v.getTree());
+ if ( this.state.backtracking===0 ) {
+ this.av(s, (v?v.stop:null));
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:607:58: ( p_TypeDeclaration )?
+ var alt52=2;
+ var LA52_0 = this.input.LA(1);
+
+ if ( (LA52_0==AS) ) {
+ alt52=1;
+ }
+ switch (alt52) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:607:58: p_TypeDeclaration
+ this.pushFollow(XQueryParser.FOLLOW_p_TypeDeclaration_in_p_ForBinding3891);
+ p_TypeDeclaration114=this.p_TypeDeclaration();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_TypeDeclaration114.getTree());
+
+
+ break;
+
+ }
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:607:77: ( p_AllowingEmpty )?
+ var alt53=2;
+ var LA53_0 = this.input.LA(1);
+
+ if ( (LA53_0==ALLOWING) ) {
+ alt53=1;
+ }
+ switch (alt53) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:607:77: p_AllowingEmpty
+ this.pushFollow(XQueryParser.FOLLOW_p_AllowingEmpty_in_p_ForBinding3894);
+ p_AllowingEmpty115=this.p_AllowingEmpty();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_AllowingEmpty115.getTree());
+
+
+ break;
+
+ }
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:607:94: ( p_PositionalVar )?
+ var alt54=2;
+ var LA54_0 = this.input.LA(1);
+
+ if ( (LA54_0==AT) ) {
+ alt54=1;
+ }
+ switch (alt54) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:607:94: p_PositionalVar
+ this.pushFollow(XQueryParser.FOLLOW_p_PositionalVar_in_p_ForBinding3897);
+ p_PositionalVar116=this.p_PositionalVar();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_PositionalVar116.getTree());
+
+
+ break;
+
+ }
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:607:111: ( p_FTScoreVar )?
+ var alt55=2;
+ var LA55_0 = this.input.LA(1);
+
+ if ( (LA55_0==SCORE) ) {
+ alt55=1;
+ }
+ switch (alt55) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:607:111: p_FTScoreVar
+ this.pushFollow(XQueryParser.FOLLOW_p_FTScoreVar_in_p_ForBinding3900);
+ p_FTScoreVar117=this.p_FTScoreVar();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_FTScoreVar117.getTree());
+
+
+ break;
+
+ }
+
+ k=this.match(this.input,IN,XQueryParser.FOLLOW_IN_in_p_ForBinding3905); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_ExprSingle_in_p_ForBinding3909);
+ p_ExprSingle118=this.p_ExprSingle(true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ExprSingle118.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_AllowingEmpty_return: (function() {
+ XQueryParser.p_AllowingEmpty_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_AllowingEmpty_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:611:1: p_AllowingEmpty : k= ALLOWING k= EMPTY ;
+ // $ANTLR start "p_AllowingEmpty"
+ p_AllowingEmpty: function() {
+ var retval = new XQueryParser.p_AllowingEmpty_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:612:9: (k= ALLOWING k= EMPTY )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:612:11: k= ALLOWING k= EMPTY
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,ALLOWING,XQueryParser.FOLLOW_ALLOWING_in_p_AllowingEmpty3938); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ k=this.match(this.input,EMPTY,XQueryParser.FOLLOW_EMPTY_in_p_AllowingEmpty3944); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_PositionalVar_return: (function() {
+ XQueryParser.p_PositionalVar_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_PositionalVar_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:616:1: p_PositionalVar : k= AT d= DOLLAR v= p_VarName ;
+ // $ANTLR start "p_PositionalVar"
+ p_PositionalVar: function() {
+ var retval = new XQueryParser.p_PositionalVar_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var d = null;
+ var v = null;
+
+ var k_tree=null;
+ var d_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:617:9: (k= AT d= DOLLAR v= p_VarName )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:617:11: k= AT d= DOLLAR v= p_VarName
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,AT,XQueryParser.FOLLOW_AT_in_p_PositionalVar3974); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ d=this.match(this.input,DOLLAR,XQueryParser.FOLLOW_DOLLAR_in_p_PositionalVar3980); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ d_tree = this.adaptor.create(d);
+ this.adaptor.addChild(root_0, d_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_VarName_in_p_PositionalVar3984);
+ v=this.p_VarName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, v.getTree());
+ if ( this.state.backtracking===0 ) {
+ this.av(d, (v?v.stop:null));
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_LetClause_return: (function() {
+ XQueryParser.p_LetClause_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_LetClause_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:621:1: p_LetClause : k= LET p_LetBinding ( COMMA p_LetBinding )* ;
+ // $ANTLR start "p_LetClause"
+ p_LetClause: function() {
+ var retval = new XQueryParser.p_LetClause_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var COMMA120 = null;
+ var p_LetBinding119 = null;
+ var p_LetBinding121 = null;
+
+ var k_tree=null;
+ var COMMA120_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:622:9: (k= LET p_LetBinding ( COMMA p_LetBinding )* )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:622:11: k= LET p_LetBinding ( COMMA p_LetBinding )*
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,LET,XQueryParser.FOLLOW_LET_in_p_LetClause4014); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_LetBinding_in_p_LetClause4018);
+ p_LetBinding119=this.p_LetBinding();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_LetBinding119.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:622:45: ( COMMA p_LetBinding )*
+ loop56:
+ do {
+ var alt56=2;
+ var LA56_0 = this.input.LA(1);
+
+ if ( (LA56_0==COMMA) ) {
+ alt56=1;
+ }
+
+
+ switch (alt56) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:622:46: COMMA p_LetBinding
+ COMMA120=this.match(this.input,COMMA,XQueryParser.FOLLOW_COMMA_in_p_LetClause4021); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ COMMA120_tree = this.adaptor.create(COMMA120);
+ this.adaptor.addChild(root_0, COMMA120_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_LetBinding_in_p_LetClause4023);
+ p_LetBinding121=this.p_LetBinding();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_LetBinding121.getTree());
+
+
+ break;
+
+ default :
+ break loop56;
+ }
+ } while (true);
+
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_LetBinding_return: (function() {
+ XQueryParser.p_LetBinding_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_LetBinding_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:627:1: p_LetBinding : ( (d= DOLLAR v= p_VarName ( p_TypeDeclaration )? ) | p_FTScoreVar ) BIND p_ExprSingle[true] ;
+ // $ANTLR start "p_LetBinding"
+ p_LetBinding: function() {
+ var retval = new XQueryParser.p_LetBinding_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var d = null;
+ var BIND124 = null;
+ var v = null;
+ var p_TypeDeclaration122 = null;
+ var p_FTScoreVar123 = null;
+ var p_ExprSingle125 = null;
+
+ var d_tree=null;
+ var BIND124_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:628:9: ( ( (d= DOLLAR v= p_VarName ( p_TypeDeclaration )? ) | p_FTScoreVar ) BIND p_ExprSingle[true] )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:628:11: ( (d= DOLLAR v= p_VarName ( p_TypeDeclaration )? ) | p_FTScoreVar ) BIND p_ExprSingle[true]
+ root_0 = this.adaptor.nil();
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:628:11: ( (d= DOLLAR v= p_VarName ( p_TypeDeclaration )? ) | p_FTScoreVar )
+ var alt58=2;
+ var LA58_0 = this.input.LA(1);
+
+ if ( (LA58_0==DOLLAR) ) {
+ alt58=1;
+ }
+ else if ( (LA58_0==SCORE) ) {
+ alt58=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 58, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt58) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:628:13: (d= DOLLAR v= p_VarName ( p_TypeDeclaration )? )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:628:13: (d= DOLLAR v= p_VarName ( p_TypeDeclaration )? )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:628:14: d= DOLLAR v= p_VarName ( p_TypeDeclaration )?
+ d=this.match(this.input,DOLLAR,XQueryParser.FOLLOW_DOLLAR_in_p_LetBinding4057); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ d_tree = this.adaptor.create(d);
+ this.adaptor.addChild(root_0, d_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_VarName_in_p_LetBinding4061);
+ v=this.p_VarName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, v.getTree());
+ if ( this.state.backtracking===0 ) {
+ this.av(d, (v?v.stop:null));
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:628:59: ( p_TypeDeclaration )?
+ var alt57=2;
+ var LA57_0 = this.input.LA(1);
+
+ if ( (LA57_0==AS) ) {
+ alt57=1;
+ }
+ switch (alt57) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:628:59: p_TypeDeclaration
+ this.pushFollow(XQueryParser.FOLLOW_p_TypeDeclaration_in_p_LetBinding4065);
+ p_TypeDeclaration122=this.p_TypeDeclaration();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_TypeDeclaration122.getTree());
+
+
+ break;
+
+ }
+
+
+
+
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:628:81: p_FTScoreVar
+ this.pushFollow(XQueryParser.FOLLOW_p_FTScoreVar_in_p_LetBinding4071);
+ p_FTScoreVar123=this.p_FTScoreVar();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_FTScoreVar123.getTree());
+
+
+ break;
+
+ }
+
+ BIND124=this.match(this.input,BIND,XQueryParser.FOLLOW_BIND_in_p_LetBinding4075); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ BIND124_tree = this.adaptor.create(BIND124);
+ this.adaptor.addChild(root_0, BIND124_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_ExprSingle_in_p_LetBinding4077);
+ p_ExprSingle125=this.p_ExprSingle(true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ExprSingle125.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_WindowClause_return: (function() {
+ XQueryParser.p_WindowClause_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_WindowClause_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:632:1: p_WindowClause : k= FOR ( p_TumblingWindowClause | p_SlidingWindowClause ) ;
+ // $ANTLR start "p_WindowClause"
+ p_WindowClause: function() {
+ var retval = new XQueryParser.p_WindowClause_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var p_TumblingWindowClause126 = null;
+ var p_SlidingWindowClause127 = null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:633:9: (k= FOR ( p_TumblingWindowClause | p_SlidingWindowClause ) )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:633:11: k= FOR ( p_TumblingWindowClause | p_SlidingWindowClause )
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,FOR,XQueryParser.FOLLOW_FOR_in_p_WindowClause4106); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:633:32: ( p_TumblingWindowClause | p_SlidingWindowClause )
+ var alt59=2;
+ var LA59_0 = this.input.LA(1);
+
+ if ( (LA59_0==TUMBLING) ) {
+ alt59=1;
+ }
+ else if ( (LA59_0==SLIDING) ) {
+ alt59=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 59, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt59) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:633:33: p_TumblingWindowClause
+ this.pushFollow(XQueryParser.FOLLOW_p_TumblingWindowClause_in_p_WindowClause4111);
+ p_TumblingWindowClause126=this.p_TumblingWindowClause();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_TumblingWindowClause126.getTree());
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:633:58: p_SlidingWindowClause
+ this.pushFollow(XQueryParser.FOLLOW_p_SlidingWindowClause_in_p_WindowClause4115);
+ p_SlidingWindowClause127=this.p_SlidingWindowClause();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_SlidingWindowClause127.getTree());
+
+
+ break;
+
+ }
+
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_TumblingWindowClause_return: (function() {
+ XQueryParser.p_TumblingWindowClause_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_TumblingWindowClause_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:637:1: p_TumblingWindowClause : k= TUMBLING k= WINDOW d= DOLLAR v= p_VarName ( p_TypeDeclaration )? k= IN p_ExprSingle[true] p_WindowStartCondition ( p_WindowEndCondition )? ;
+ // $ANTLR start "p_TumblingWindowClause"
+ p_TumblingWindowClause: function() {
+ var retval = new XQueryParser.p_TumblingWindowClause_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var d = null;
+ var v = null;
+ var p_TypeDeclaration128 = null;
+ var p_ExprSingle129 = null;
+ var p_WindowStartCondition130 = null;
+ var p_WindowEndCondition131 = null;
+
+ var k_tree=null;
+ var d_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:638:9: (k= TUMBLING k= WINDOW d= DOLLAR v= p_VarName ( p_TypeDeclaration )? k= IN p_ExprSingle[true] p_WindowStartCondition ( p_WindowEndCondition )? )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:638:11: k= TUMBLING k= WINDOW d= DOLLAR v= p_VarName ( p_TypeDeclaration )? k= IN p_ExprSingle[true] p_WindowStartCondition ( p_WindowEndCondition )?
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,TUMBLING,XQueryParser.FOLLOW_TUMBLING_in_p_TumblingWindowClause4152); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ k=this.match(this.input,WINDOW,XQueryParser.FOLLOW_WINDOW_in_p_TumblingWindowClause4158); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ d=this.match(this.input,DOLLAR,XQueryParser.FOLLOW_DOLLAR_in_p_TumblingWindowClause4164); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ d_tree = this.adaptor.create(d);
+ this.adaptor.addChild(root_0, d_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_VarName_in_p_TumblingWindowClause4168);
+ v=this.p_VarName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, v.getTree());
+ if ( this.state.backtracking===0 ) {
+ this.av(d, (v?v.stop:null));
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:638:106: ( p_TypeDeclaration )?
+ var alt60=2;
+ var LA60_0 = this.input.LA(1);
+
+ if ( (LA60_0==AS) ) {
+ alt60=1;
+ }
+ switch (alt60) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:638:106: p_TypeDeclaration
+ this.pushFollow(XQueryParser.FOLLOW_p_TypeDeclaration_in_p_TumblingWindowClause4172);
+ p_TypeDeclaration128=this.p_TypeDeclaration();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_TypeDeclaration128.getTree());
+
+
+ break;
+
+ }
+
+ k=this.match(this.input,IN,XQueryParser.FOLLOW_IN_in_p_TumblingWindowClause4177); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_ExprSingle_in_p_TumblingWindowClause4181);
+ p_ExprSingle129=this.p_ExprSingle(true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ExprSingle129.getTree());
+ this.pushFollow(XQueryParser.FOLLOW_p_WindowStartCondition_in_p_TumblingWindowClause4184);
+ p_WindowStartCondition130=this.p_WindowStartCondition();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_WindowStartCondition130.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:638:187: ( p_WindowEndCondition )?
+ var alt61=2;
+ var LA61_0 = this.input.LA(1);
+
+ if ( (LA61_0==END||LA61_0==ONLY) ) {
+ alt61=1;
+ }
+ switch (alt61) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:638:187: p_WindowEndCondition
+ this.pushFollow(XQueryParser.FOLLOW_p_WindowEndCondition_in_p_TumblingWindowClause4186);
+ p_WindowEndCondition131=this.p_WindowEndCondition();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_WindowEndCondition131.getTree());
+
+
+ break;
+
+ }
+
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_SlidingWindowClause_return: (function() {
+ XQueryParser.p_SlidingWindowClause_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_SlidingWindowClause_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:642:1: p_SlidingWindowClause : k= SLIDING k= WINDOW d= DOLLAR v= p_VarName ( p_TypeDeclaration )? k= IN p_ExprSingle[true] p_WindowStartCondition ( p_WindowEndCondition )? ;
+ // $ANTLR start "p_SlidingWindowClause"
+ p_SlidingWindowClause: function() {
+ var retval = new XQueryParser.p_SlidingWindowClause_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var d = null;
+ var v = null;
+ var p_TypeDeclaration132 = null;
+ var p_ExprSingle133 = null;
+ var p_WindowStartCondition134 = null;
+ var p_WindowEndCondition135 = null;
+
+ var k_tree=null;
+ var d_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:643:9: (k= SLIDING k= WINDOW d= DOLLAR v= p_VarName ( p_TypeDeclaration )? k= IN p_ExprSingle[true] p_WindowStartCondition ( p_WindowEndCondition )? )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:643:11: k= SLIDING k= WINDOW d= DOLLAR v= p_VarName ( p_TypeDeclaration )? k= IN p_ExprSingle[true] p_WindowStartCondition ( p_WindowEndCondition )?
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,SLIDING,XQueryParser.FOLLOW_SLIDING_in_p_SlidingWindowClause4215); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ k=this.match(this.input,WINDOW,XQueryParser.FOLLOW_WINDOW_in_p_SlidingWindowClause4221); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ d=this.match(this.input,DOLLAR,XQueryParser.FOLLOW_DOLLAR_in_p_SlidingWindowClause4227); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ d_tree = this.adaptor.create(d);
+ this.adaptor.addChild(root_0, d_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_VarName_in_p_SlidingWindowClause4231);
+ v=this.p_VarName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, v.getTree());
+ if ( this.state.backtracking===0 ) {
+ this.av(d, (v?v.stop:null));
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:643:107: ( p_TypeDeclaration )?
+ var alt62=2;
+ var LA62_0 = this.input.LA(1);
+
+ if ( (LA62_0==AS) ) {
+ alt62=1;
+ }
+ switch (alt62) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:643:107: p_TypeDeclaration
+ this.pushFollow(XQueryParser.FOLLOW_p_TypeDeclaration_in_p_SlidingWindowClause4235);
+ p_TypeDeclaration132=this.p_TypeDeclaration();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_TypeDeclaration132.getTree());
+
+
+ break;
+
+ }
+
+ k=this.match(this.input,IN,XQueryParser.FOLLOW_IN_in_p_SlidingWindowClause4240); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_ExprSingle_in_p_SlidingWindowClause4244);
+ p_ExprSingle133=this.p_ExprSingle(true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ExprSingle133.getTree());
+ this.pushFollow(XQueryParser.FOLLOW_p_WindowStartCondition_in_p_SlidingWindowClause4247);
+ p_WindowStartCondition134=this.p_WindowStartCondition();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_WindowStartCondition134.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:643:188: ( p_WindowEndCondition )?
+ var alt63=2;
+ var LA63_0 = this.input.LA(1);
+
+ if ( (LA63_0==END||LA63_0==ONLY) ) {
+ alt63=1;
+ }
+ switch (alt63) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:643:188: p_WindowEndCondition
+ this.pushFollow(XQueryParser.FOLLOW_p_WindowEndCondition_in_p_SlidingWindowClause4249);
+ p_WindowEndCondition135=this.p_WindowEndCondition();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_WindowEndCondition135.getTree());
+
+
+ break;
+
+ }
+
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_WindowStartCondition_return: (function() {
+ XQueryParser.p_WindowStartCondition_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_WindowStartCondition_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:647:1: p_WindowStartCondition : k= START p_WindowVars k= WHEN p_ExprSingle[true] ;
+ // $ANTLR start "p_WindowStartCondition"
+ p_WindowStartCondition: function() {
+ var retval = new XQueryParser.p_WindowStartCondition_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var p_WindowVars136 = null;
+ var p_ExprSingle137 = null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:648:9: (k= START p_WindowVars k= WHEN p_ExprSingle[true] )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:648:11: k= START p_WindowVars k= WHEN p_ExprSingle[true]
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,START,XQueryParser.FOLLOW_START_in_p_WindowStartCondition4278); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_WindowVars_in_p_WindowStartCondition4282);
+ p_WindowVars136=this.p_WindowVars();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_WindowVars136.getTree());
+ k=this.match(this.input,WHEN,XQueryParser.FOLLOW_WHEN_in_p_WindowStartCondition4286); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_ExprSingle_in_p_WindowStartCondition4290);
+ p_ExprSingle137=this.p_ExprSingle(true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ExprSingle137.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_WindowEndCondition_return: (function() {
+ XQueryParser.p_WindowEndCondition_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_WindowEndCondition_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:652:1: p_WindowEndCondition : (k= ONLY )? k= END p_WindowVars k= WHEN p_ExprSingle[true] ;
+ // $ANTLR start "p_WindowEndCondition"
+ p_WindowEndCondition: function() {
+ var retval = new XQueryParser.p_WindowEndCondition_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var p_WindowVars138 = null;
+ var p_ExprSingle139 = null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:653:9: ( (k= ONLY )? k= END p_WindowVars k= WHEN p_ExprSingle[true] )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:653:11: (k= ONLY )? k= END p_WindowVars k= WHEN p_ExprSingle[true]
+ root_0 = this.adaptor.nil();
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:653:11: (k= ONLY )?
+ var alt64=2;
+ var LA64_0 = this.input.LA(1);
+
+ if ( (LA64_0==ONLY) ) {
+ alt64=1;
+ }
+ switch (alt64) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:653:12: k= ONLY
+ k=this.match(this.input,ONLY,XQueryParser.FOLLOW_ONLY_in_p_WindowEndCondition4320); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+
+
+ break;
+
+ }
+
+ k=this.match(this.input,END,XQueryParser.FOLLOW_END_in_p_WindowEndCondition4328); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_WindowVars_in_p_WindowEndCondition4332);
+ p_WindowVars138=this.p_WindowVars();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_WindowVars138.getTree());
+ k=this.match(this.input,WHEN,XQueryParser.FOLLOW_WHEN_in_p_WindowEndCondition4336); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_ExprSingle_in_p_WindowEndCondition4340);
+ p_ExprSingle139=this.p_ExprSingle(true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ExprSingle139.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_WindowVars_return: (function() {
+ XQueryParser.p_WindowVars_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_WindowVars_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:657:1: p_WindowVars : (d= DOLLAR v= p_CurrentItem )? ( p_PositionalVar )? (k= PREVIOUS DOLLAR p_PreviousItem )? (k= NEXT DOLLAR p_NextItem )? ;
+ // $ANTLR start "p_WindowVars"
+ p_WindowVars: function() {
+ var retval = new XQueryParser.p_WindowVars_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var d = null;
+ var k = null;
+ var DOLLAR141 = null;
+ var DOLLAR143 = null;
+ var v = null;
+ var p_PositionalVar140 = null;
+ var p_PreviousItem142 = null;
+ var p_NextItem144 = null;
+
+ var d_tree=null;
+ var k_tree=null;
+ var DOLLAR141_tree=null;
+ var DOLLAR143_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:658:9: ( (d= DOLLAR v= p_CurrentItem )? ( p_PositionalVar )? (k= PREVIOUS DOLLAR p_PreviousItem )? (k= NEXT DOLLAR p_NextItem )? )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:658:11: (d= DOLLAR v= p_CurrentItem )? ( p_PositionalVar )? (k= PREVIOUS DOLLAR p_PreviousItem )? (k= NEXT DOLLAR p_NextItem )?
+ root_0 = this.adaptor.nil();
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:658:11: (d= DOLLAR v= p_CurrentItem )?
+ var alt65=2;
+ var LA65_0 = this.input.LA(1);
+
+ if ( (LA65_0==DOLLAR) ) {
+ alt65=1;
+ }
+ switch (alt65) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:658:12: d= DOLLAR v= p_CurrentItem
+ d=this.match(this.input,DOLLAR,XQueryParser.FOLLOW_DOLLAR_in_p_WindowVars4370); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ d_tree = this.adaptor.create(d);
+ this.adaptor.addChild(root_0, d_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_CurrentItem_in_p_WindowVars4374);
+ v=this.p_CurrentItem();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, v.getTree());
+ if ( this.state.backtracking===0 ) {
+ this.av(d, (v?v.stop:null));
+ }
+
+
+ break;
+
+ }
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:658:65: ( p_PositionalVar )?
+ var alt66=2;
+ var LA66_0 = this.input.LA(1);
+
+ if ( (LA66_0==AT) ) {
+ alt66=1;
+ }
+ switch (alt66) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:658:65: p_PositionalVar
+ this.pushFollow(XQueryParser.FOLLOW_p_PositionalVar_in_p_WindowVars4380);
+ p_PositionalVar140=this.p_PositionalVar();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_PositionalVar140.getTree());
+
+
+ break;
+
+ }
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:658:82: (k= PREVIOUS DOLLAR p_PreviousItem )?
+ var alt67=2;
+ var LA67_0 = this.input.LA(1);
+
+ if ( (LA67_0==PREVIOUS) ) {
+ alt67=1;
+ }
+ switch (alt67) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:658:83: k= PREVIOUS DOLLAR p_PreviousItem
+ k=this.match(this.input,PREVIOUS,XQueryParser.FOLLOW_PREVIOUS_in_p_WindowVars4386); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ DOLLAR141=this.match(this.input,DOLLAR,XQueryParser.FOLLOW_DOLLAR_in_p_WindowVars4390); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ DOLLAR141_tree = this.adaptor.create(DOLLAR141);
+ this.adaptor.addChild(root_0, DOLLAR141_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_PreviousItem_in_p_WindowVars4392);
+ p_PreviousItem142=this.p_PreviousItem();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_PreviousItem142.getTree());
+
+
+ break;
+
+ }
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:658:133: (k= NEXT DOLLAR p_NextItem )?
+ var alt68=2;
+ var LA68_0 = this.input.LA(1);
+
+ if ( (LA68_0==NEXT) ) {
+ alt68=1;
+ }
+ switch (alt68) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:658:134: k= NEXT DOLLAR p_NextItem
+ k=this.match(this.input,NEXT,XQueryParser.FOLLOW_NEXT_in_p_WindowVars4399); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ DOLLAR143=this.match(this.input,DOLLAR,XQueryParser.FOLLOW_DOLLAR_in_p_WindowVars4403); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ DOLLAR143_tree = this.adaptor.create(DOLLAR143);
+ this.adaptor.addChild(root_0, DOLLAR143_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_NextItem_in_p_WindowVars4405);
+ p_NextItem144=this.p_NextItem();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_NextItem144.getTree());
+
+
+ break;
+
+ }
+
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_CurrentItem_return: (function() {
+ XQueryParser.p_CurrentItem_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_CurrentItem_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:662:1: p_CurrentItem : p_EQName ;
+ // $ANTLR start "p_CurrentItem"
+ p_CurrentItem: function() {
+ var retval = new XQueryParser.p_CurrentItem_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_EQName145 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:663:9: ( p_EQName )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:663:11: p_EQName
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_EQName_in_p_CurrentItem4433);
+ p_EQName145=this.p_EQName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_EQName145.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_PreviousItem_return: (function() {
+ XQueryParser.p_PreviousItem_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_PreviousItem_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:667:1: p_PreviousItem : p_EQName ;
+ // $ANTLR start "p_PreviousItem"
+ p_PreviousItem: function() {
+ var retval = new XQueryParser.p_PreviousItem_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_EQName146 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:668:9: ( p_EQName )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:668:11: p_EQName
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_EQName_in_p_PreviousItem4459);
+ p_EQName146=this.p_EQName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_EQName146.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_NextItem_return: (function() {
+ XQueryParser.p_NextItem_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_NextItem_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:672:1: p_NextItem : p_EQName ;
+ // $ANTLR start "p_NextItem"
+ p_NextItem: function() {
+ var retval = new XQueryParser.p_NextItem_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_EQName147 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:673:9: ( p_EQName )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:673:11: p_EQName
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_EQName_in_p_NextItem4485);
+ p_EQName147=this.p_EQName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_EQName147.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_CountClause_return: (function() {
+ XQueryParser.p_CountClause_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_CountClause_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:677:1: p_CountClause : k= COUNT d= DOLLAR v= p_VarName ;
+ // $ANTLR start "p_CountClause"
+ p_CountClause: function() {
+ var retval = new XQueryParser.p_CountClause_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var d = null;
+ var v = null;
+
+ var k_tree=null;
+ var d_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:678:9: (k= COUNT d= DOLLAR v= p_VarName )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:678:11: k= COUNT d= DOLLAR v= p_VarName
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,COUNT,XQueryParser.FOLLOW_COUNT_in_p_CountClause4513); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ d=this.match(this.input,DOLLAR,XQueryParser.FOLLOW_DOLLAR_in_p_CountClause4519); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ d_tree = this.adaptor.create(d);
+ this.adaptor.addChild(root_0, d_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_VarName_in_p_CountClause4523);
+ v=this.p_VarName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, v.getTree());
+ if ( this.state.backtracking===0 ) {
+ this.av(d, (v?v.stop:null));
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_WhereClause_return: (function() {
+ XQueryParser.p_WhereClause_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_WhereClause_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:682:1: p_WhereClause : k= WHERE p_ExprSingle[true] ;
+ // $ANTLR start "p_WhereClause"
+ p_WhereClause: function() {
+ var retval = new XQueryParser.p_WhereClause_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var p_ExprSingle148 = null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:683:9: (k= WHERE p_ExprSingle[true] )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:683:11: k= WHERE p_ExprSingle[true]
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,WHERE,XQueryParser.FOLLOW_WHERE_in_p_WhereClause4561); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_ExprSingle_in_p_WhereClause4565);
+ p_ExprSingle148=this.p_ExprSingle(true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ExprSingle148.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_GroupByClause_return: (function() {
+ XQueryParser.p_GroupByClause_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_GroupByClause_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:687:1: p_GroupByClause : k= GROUP k= BY p_GroupingSpecList ;
+ // $ANTLR start "p_GroupByClause"
+ p_GroupByClause: function() {
+ var retval = new XQueryParser.p_GroupByClause_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var p_GroupingSpecList149 = null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:688:9: (k= GROUP k= BY p_GroupingSpecList )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:688:11: k= GROUP k= BY p_GroupingSpecList
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,GROUP,XQueryParser.FOLLOW_GROUP_in_p_GroupByClause4594); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ k=this.match(this.input,BY,XQueryParser.FOLLOW_BY_in_p_GroupByClause4600); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_GroupingSpecList_in_p_GroupByClause4604);
+ p_GroupingSpecList149=this.p_GroupingSpecList();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_GroupingSpecList149.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_GroupingSpecList_return: (function() {
+ XQueryParser.p_GroupingSpecList_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_GroupingSpecList_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:692:1: p_GroupingSpecList : p_GroupingSpec ( COMMA p_GroupingSpec )* ;
+ // $ANTLR start "p_GroupingSpecList"
+ p_GroupingSpecList: function() {
+ var retval = new XQueryParser.p_GroupingSpecList_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var COMMA151 = null;
+ var p_GroupingSpec150 = null;
+ var p_GroupingSpec152 = null;
+
+ var COMMA151_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:693:9: ( p_GroupingSpec ( COMMA p_GroupingSpec )* )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:693:11: p_GroupingSpec ( COMMA p_GroupingSpec )*
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_GroupingSpec_in_p_GroupingSpecList4630);
+ p_GroupingSpec150=this.p_GroupingSpec();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_GroupingSpec150.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:693:26: ( COMMA p_GroupingSpec )*
+ loop69:
+ do {
+ var alt69=2;
+ var LA69_0 = this.input.LA(1);
+
+ if ( (LA69_0==COMMA) ) {
+ alt69=1;
+ }
+
+
+ switch (alt69) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:693:27: COMMA p_GroupingSpec
+ COMMA151=this.match(this.input,COMMA,XQueryParser.FOLLOW_COMMA_in_p_GroupingSpecList4633); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ COMMA151_tree = this.adaptor.create(COMMA151);
+ this.adaptor.addChild(root_0, COMMA151_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_GroupingSpec_in_p_GroupingSpecList4635);
+ p_GroupingSpec152=this.p_GroupingSpec();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_GroupingSpec152.getTree());
+
+
+ break;
+
+ default :
+ break loop69;
+ }
+ } while (true);
+
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_GroupingSpec_return: (function() {
+ XQueryParser.p_GroupingSpec_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_GroupingSpec_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:697:1: p_GroupingSpec : p_GroupingVariable ( ( p_TypeDeclaration )? BIND p_ExprSingle[true] )? (k= COLLATION p_StringLiteral )? ;
+ // $ANTLR start "p_GroupingSpec"
+ p_GroupingSpec: function() {
+ var retval = new XQueryParser.p_GroupingSpec_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var BIND155 = null;
+ var p_GroupingVariable153 = null;
+ var p_TypeDeclaration154 = null;
+ var p_ExprSingle156 = null;
+ var p_StringLiteral157 = null;
+
+ var k_tree=null;
+ var BIND155_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:698:9: ( p_GroupingVariable ( ( p_TypeDeclaration )? BIND p_ExprSingle[true] )? (k= COLLATION p_StringLiteral )? )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:698:11: p_GroupingVariable ( ( p_TypeDeclaration )? BIND p_ExprSingle[true] )? (k= COLLATION p_StringLiteral )?
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_GroupingVariable_in_p_GroupingSpec4663);
+ p_GroupingVariable153=this.p_GroupingVariable();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_GroupingVariable153.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:698:30: ( ( p_TypeDeclaration )? BIND p_ExprSingle[true] )?
+ var alt71=2;
+ var LA71_0 = this.input.LA(1);
+
+ if ( (LA71_0==AS||LA71_0==BIND) ) {
+ alt71=1;
+ }
+ switch (alt71) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:698:31: ( p_TypeDeclaration )? BIND p_ExprSingle[true]
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:698:31: ( p_TypeDeclaration )?
+ var alt70=2;
+ var LA70_0 = this.input.LA(1);
+
+ if ( (LA70_0==AS) ) {
+ alt70=1;
+ }
+ switch (alt70) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:698:31: p_TypeDeclaration
+ this.pushFollow(XQueryParser.FOLLOW_p_TypeDeclaration_in_p_GroupingSpec4666);
+ p_TypeDeclaration154=this.p_TypeDeclaration();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_TypeDeclaration154.getTree());
+
+
+ break;
+
+ }
+
+ BIND155=this.match(this.input,BIND,XQueryParser.FOLLOW_BIND_in_p_GroupingSpec4669); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ BIND155_tree = this.adaptor.create(BIND155);
+ this.adaptor.addChild(root_0, BIND155_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_ExprSingle_in_p_GroupingSpec4671);
+ p_ExprSingle156=this.p_ExprSingle(true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ExprSingle156.getTree());
+
+
+ break;
+
+ }
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:698:76: (k= COLLATION p_StringLiteral )?
+ var alt72=2;
+ var LA72_0 = this.input.LA(1);
+
+ if ( (LA72_0==COLLATION) ) {
+ alt72=1;
+ }
+ switch (alt72) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:698:77: k= COLLATION p_StringLiteral
+ k=this.match(this.input,COLLATION,XQueryParser.FOLLOW_COLLATION_in_p_GroupingSpec4679); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_StringLiteral_in_p_GroupingSpec4683);
+ p_StringLiteral157=this.p_StringLiteral();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_StringLiteral157.getTree());
+
+
+ break;
+
+ }
+
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_GroupingVariable_return: (function() {
+ XQueryParser.p_GroupingVariable_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_GroupingVariable_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:701:1: p_GroupingVariable : d= DOLLAR v= p_VarName ;
+ // $ANTLR start "p_GroupingVariable"
+ p_GroupingVariable: function() {
+ var retval = new XQueryParser.p_GroupingVariable_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var d = null;
+ var v = null;
+
+ var d_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:702:9: (d= DOLLAR v= p_VarName )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:702:11: d= DOLLAR v= p_VarName
+ root_0 = this.adaptor.nil();
+
+ d=this.match(this.input,DOLLAR,XQueryParser.FOLLOW_DOLLAR_in_p_GroupingVariable4712); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ d_tree = this.adaptor.create(d);
+ this.adaptor.addChild(root_0, d_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_VarName_in_p_GroupingVariable4716);
+ v=this.p_VarName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, v.getTree());
+ if ( this.state.backtracking===0 ) {
+ this.av(d, (v?v.stop:null));
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_OrderByClause_return: (function() {
+ XQueryParser.p_OrderByClause_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_OrderByClause_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:706:1: p_OrderByClause : ( (k+= ORDER k+= BY ) | (k+= STABLE k+= ORDER k+= BY ) ) p_OrderSpecList ;
+ // $ANTLR start "p_OrderByClause"
+ p_OrderByClause: function() {
+ var retval = new XQueryParser.p_OrderByClause_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var list_k=null;
+ var p_OrderSpecList158 = null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:707:9: ( ( (k+= ORDER k+= BY ) | (k+= STABLE k+= ORDER k+= BY ) ) p_OrderSpecList )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:707:11: ( (k+= ORDER k+= BY ) | (k+= STABLE k+= ORDER k+= BY ) ) p_OrderSpecList
+ root_0 = this.adaptor.nil();
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:707:11: ( (k+= ORDER k+= BY ) | (k+= STABLE k+= ORDER k+= BY ) )
+ var alt73=2;
+ var LA73_0 = this.input.LA(1);
+
+ if ( (LA73_0==ORDER) ) {
+ alt73=1;
+ }
+ else if ( (LA73_0==STABLE) ) {
+ alt73=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 73, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt73) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:707:12: (k+= ORDER k+= BY )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:707:12: (k+= ORDER k+= BY )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:707:13: k+= ORDER k+= BY
+ k=this.match(this.input,ORDER,XQueryParser.FOLLOW_ORDER_in_p_OrderByClause4748); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ k=this.match(this.input,BY,XQueryParser.FOLLOW_BY_in_p_OrderByClause4752); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+
+
+
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:707:31: (k+= STABLE k+= ORDER k+= BY )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:707:31: (k+= STABLE k+= ORDER k+= BY )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:707:32: k+= STABLE k+= ORDER k+= BY
+ k=this.match(this.input,STABLE,XQueryParser.FOLLOW_STABLE_in_p_OrderByClause4760); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ k=this.match(this.input,ORDER,XQueryParser.FOLLOW_ORDER_in_p_OrderByClause4764); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ k=this.match(this.input,BY,XQueryParser.FOLLOW_BY_in_p_OrderByClause4768); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+
+
+
+
+
+ break;
+
+ }
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(list_k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_OrderSpecList_in_p_OrderByClause4774);
+ p_OrderSpecList158=this.p_OrderSpecList();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_OrderSpecList158.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_OrderSpecList_return: (function() {
+ XQueryParser.p_OrderSpecList_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_OrderSpecList_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:711:1: p_OrderSpecList : p_OrderSpec ( COMMA p_OrderSpec )* ;
+ // $ANTLR start "p_OrderSpecList"
+ p_OrderSpecList: function() {
+ var retval = new XQueryParser.p_OrderSpecList_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var COMMA160 = null;
+ var p_OrderSpec159 = null;
+ var p_OrderSpec161 = null;
+
+ var COMMA160_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:712:9: ( p_OrderSpec ( COMMA p_OrderSpec )* )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:712:11: p_OrderSpec ( COMMA p_OrderSpec )*
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_OrderSpec_in_p_OrderSpecList4800);
+ p_OrderSpec159=this.p_OrderSpec();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_OrderSpec159.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:712:23: ( COMMA p_OrderSpec )*
+ loop74:
+ do {
+ var alt74=2;
+ var LA74_0 = this.input.LA(1);
+
+ if ( (LA74_0==COMMA) ) {
+ alt74=1;
+ }
+
+
+ switch (alt74) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:712:24: COMMA p_OrderSpec
+ COMMA160=this.match(this.input,COMMA,XQueryParser.FOLLOW_COMMA_in_p_OrderSpecList4803); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ COMMA160_tree = this.adaptor.create(COMMA160);
+ this.adaptor.addChild(root_0, COMMA160_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_OrderSpec_in_p_OrderSpecList4805);
+ p_OrderSpec161=this.p_OrderSpec();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_OrderSpec161.getTree());
+
+
+ break;
+
+ default :
+ break loop74;
+ }
+ } while (true);
+
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_OrderSpec_return: (function() {
+ XQueryParser.p_OrderSpec_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_OrderSpec_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:716:1: p_OrderSpec : p_ExprSingle[true] p_OrderModifier ;
+ // $ANTLR start "p_OrderSpec"
+ p_OrderSpec: function() {
+ var retval = new XQueryParser.p_OrderSpec_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_ExprSingle162 = null;
+ var p_OrderModifier163 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:717:9: ( p_ExprSingle[true] p_OrderModifier )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:717:11: p_ExprSingle[true] p_OrderModifier
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_ExprSingle_in_p_OrderSpec4833);
+ p_ExprSingle162=this.p_ExprSingle(true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ExprSingle162.getTree());
+ this.pushFollow(XQueryParser.FOLLOW_p_OrderModifier_in_p_OrderSpec4836);
+ p_OrderModifier163=this.p_OrderModifier();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_OrderModifier163.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_OrderModifier_return: (function() {
+ XQueryParser.p_OrderModifier_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_OrderModifier_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:721:1: p_OrderModifier : (k+= ASCENDING | k+= DESCENDING )? (k+= EMPTY (k+= GREATEST | k+= LEAST ) )? (k+= COLLATION p_StringLiteral )? ;
+ // $ANTLR start "p_OrderModifier"
+ p_OrderModifier: function() {
+ var retval = new XQueryParser.p_OrderModifier_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var list_k=null;
+ var p_StringLiteral164 = null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:722:9: ( (k+= ASCENDING | k+= DESCENDING )? (k+= EMPTY (k+= GREATEST | k+= LEAST ) )? (k+= COLLATION p_StringLiteral )? )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:722:11: (k+= ASCENDING | k+= DESCENDING )? (k+= EMPTY (k+= GREATEST | k+= LEAST ) )? (k+= COLLATION p_StringLiteral )?
+ root_0 = this.adaptor.nil();
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:722:11: (k+= ASCENDING | k+= DESCENDING )?
+ var alt75=3;
+ var LA75_0 = this.input.LA(1);
+
+ if ( (LA75_0==ASCENDING) ) {
+ alt75=1;
+ }
+ else if ( (LA75_0==DESCENDING) ) {
+ alt75=2;
+ }
+ switch (alt75) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:722:12: k+= ASCENDING
+ k=this.match(this.input,ASCENDING,XQueryParser.FOLLOW_ASCENDING_in_p_OrderModifier4865); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:722:27: k+= DESCENDING
+ k=this.match(this.input,DESCENDING,XQueryParser.FOLLOW_DESCENDING_in_p_OrderModifier4871); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+
+
+ break;
+
+ }
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:722:43: (k+= EMPTY (k+= GREATEST | k+= LEAST ) )?
+ var alt77=2;
+ var LA77_0 = this.input.LA(1);
+
+ if ( (LA77_0==EMPTY) ) {
+ alt77=1;
+ }
+ switch (alt77) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:722:44: k+= EMPTY (k+= GREATEST | k+= LEAST )
+ k=this.match(this.input,EMPTY,XQueryParser.FOLLOW_EMPTY_in_p_OrderModifier4878); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:722:53: (k+= GREATEST | k+= LEAST )
+ var alt76=2;
+ var LA76_0 = this.input.LA(1);
+
+ if ( (LA76_0==GREATEST) ) {
+ alt76=1;
+ }
+ else if ( (LA76_0==LEAST) ) {
+ alt76=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 76, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt76) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:722:54: k+= GREATEST
+ k=this.match(this.input,GREATEST,XQueryParser.FOLLOW_GREATEST_in_p_OrderModifier4883); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:722:68: k+= LEAST
+ k=this.match(this.input,LEAST,XQueryParser.FOLLOW_LEAST_in_p_OrderModifier4889); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+
+
+ break;
+
+ }
+
+
+
+ break;
+
+ }
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:722:80: (k+= COLLATION p_StringLiteral )?
+ var alt78=2;
+ var LA78_0 = this.input.LA(1);
+
+ if ( (LA78_0==COLLATION) ) {
+ alt78=1;
+ }
+ switch (alt78) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:722:81: k+= COLLATION p_StringLiteral
+ k=this.match(this.input,COLLATION,XQueryParser.FOLLOW_COLLATION_in_p_OrderModifier4897); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ this.pushFollow(XQueryParser.FOLLOW_p_StringLiteral_in_p_OrderModifier4899);
+ p_StringLiteral164=this.p_StringLiteral();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_StringLiteral164.getTree());
+
+
+ break;
+
+ }
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(list_k);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_ReturnHybrid_return: (function() {
+ XQueryParser.p_ReturnHybrid_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_ReturnHybrid_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:726:1: p_ReturnHybrid[strict] : k= RETURN p_Hybrid[$strict,false] ;
+ // $ANTLR start "p_ReturnHybrid"
+ p_ReturnHybrid: function(strict) {
+ var retval = new XQueryParser.p_ReturnHybrid_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var p_Hybrid165 = null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:727:9: (k= RETURN p_Hybrid[$strict,false] )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:727:11: k= RETURN p_Hybrid[$strict,false]
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,RETURN,XQueryParser.FOLLOW_RETURN_in_p_ReturnHybrid4932); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_Hybrid_in_p_ReturnHybrid4936);
+ p_Hybrid165=this.p_Hybrid(strict, false);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Hybrid165.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_QuantifiedExpr_return: (function() {
+ XQueryParser.p_QuantifiedExpr_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_QuantifiedExpr_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:731:1: p_QuantifiedExpr : (k= SOME | k= EVERY ) d= DOLLAR v= p_VarName ( p_TypeDeclaration )? k= IN p_ExprSingle[true] ( COMMA e= DOLLAR w= p_EQName ( p_TypeDeclaration )? k= IN p_ExprSingle[true] )* k= SATISFIES p_ExprSingle[true] ;
+ // $ANTLR start "p_QuantifiedExpr"
+ p_QuantifiedExpr: function() {
+ var retval = new XQueryParser.p_QuantifiedExpr_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var d = null;
+ var e = null;
+ var COMMA168 = null;
+ var v = null;
+ var w = null;
+ var p_TypeDeclaration166 = null;
+ var p_ExprSingle167 = null;
+ var p_TypeDeclaration169 = null;
+ var p_ExprSingle170 = null;
+ var p_ExprSingle171 = null;
+
+ var k_tree=null;
+ var d_tree=null;
+ var e_tree=null;
+ var COMMA168_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:732:9: ( (k= SOME | k= EVERY ) d= DOLLAR v= p_VarName ( p_TypeDeclaration )? k= IN p_ExprSingle[true] ( COMMA e= DOLLAR w= p_EQName ( p_TypeDeclaration )? k= IN p_ExprSingle[true] )* k= SATISFIES p_ExprSingle[true] )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:732:11: (k= SOME | k= EVERY ) d= DOLLAR v= p_VarName ( p_TypeDeclaration )? k= IN p_ExprSingle[true] ( COMMA e= DOLLAR w= p_EQName ( p_TypeDeclaration )? k= IN p_ExprSingle[true] )* k= SATISFIES p_ExprSingle[true]
+ root_0 = this.adaptor.nil();
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:732:11: (k= SOME | k= EVERY )
+ var alt79=2;
+ var LA79_0 = this.input.LA(1);
+
+ if ( (LA79_0==SOME) ) {
+ alt79=1;
+ }
+ else if ( (LA79_0==EVERY) ) {
+ alt79=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 79, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt79) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:732:12: k= SOME
+ k=this.match(this.input,SOME,XQueryParser.FOLLOW_SOME_in_p_QuantifiedExpr4966); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:732:21: k= EVERY
+ k=this.match(this.input,EVERY,XQueryParser.FOLLOW_EVERY_in_p_QuantifiedExpr4972); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+
+
+ break;
+
+ }
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ d=this.match(this.input,DOLLAR,XQueryParser.FOLLOW_DOLLAR_in_p_QuantifiedExpr4979); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ d_tree = this.adaptor.create(d);
+ this.adaptor.addChild(root_0, d_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_VarName_in_p_QuantifiedExpr4983);
+ v=this.p_VarName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, v.getTree());
+ if ( this.state.backtracking===0 ) {
+ this.av(d, (v?v.stop:null));
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:732:92: ( p_TypeDeclaration )?
+ var alt80=2;
+ var LA80_0 = this.input.LA(1);
+
+ if ( (LA80_0==AS) ) {
+ alt80=1;
+ }
+ switch (alt80) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:732:92: p_TypeDeclaration
+ this.pushFollow(XQueryParser.FOLLOW_p_TypeDeclaration_in_p_QuantifiedExpr4987);
+ p_TypeDeclaration166=this.p_TypeDeclaration();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_TypeDeclaration166.getTree());
+
+
+ break;
+
+ }
+
+ k=this.match(this.input,IN,XQueryParser.FOLLOW_IN_in_p_QuantifiedExpr4992); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_ExprSingle_in_p_QuantifiedExpr4996);
+ p_ExprSingle167=this.p_ExprSingle(true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ExprSingle167.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:732:150: ( COMMA e= DOLLAR w= p_EQName ( p_TypeDeclaration )? k= IN p_ExprSingle[true] )*
+ loop82:
+ do {
+ var alt82=2;
+ var LA82_0 = this.input.LA(1);
+
+ if ( (LA82_0==COMMA) ) {
+ alt82=1;
+ }
+
+
+ switch (alt82) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:732:151: COMMA e= DOLLAR w= p_EQName ( p_TypeDeclaration )? k= IN p_ExprSingle[true]
+ COMMA168=this.match(this.input,COMMA,XQueryParser.FOLLOW_COMMA_in_p_QuantifiedExpr5000); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ COMMA168_tree = this.adaptor.create(COMMA168);
+ this.adaptor.addChild(root_0, COMMA168_tree);
+ }
+ e=this.match(this.input,DOLLAR,XQueryParser.FOLLOW_DOLLAR_in_p_QuantifiedExpr5004); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ e_tree = this.adaptor.create(e);
+ this.adaptor.addChild(root_0, e_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_EQName_in_p_QuantifiedExpr5008);
+ w=this.p_EQName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, w.getTree());
+ if ( this.state.backtracking===0 ) {
+ this.av(e, (w?w.stop:null));
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:732:201: ( p_TypeDeclaration )?
+ var alt81=2;
+ var LA81_0 = this.input.LA(1);
+
+ if ( (LA81_0==AS) ) {
+ alt81=1;
+ }
+ switch (alt81) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:732:201: p_TypeDeclaration
+ this.pushFollow(XQueryParser.FOLLOW_p_TypeDeclaration_in_p_QuantifiedExpr5012);
+ p_TypeDeclaration169=this.p_TypeDeclaration();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_TypeDeclaration169.getTree());
+
+
+ break;
+
+ }
+
+ k=this.match(this.input,IN,XQueryParser.FOLLOW_IN_in_p_QuantifiedExpr5017); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_ExprSingle_in_p_QuantifiedExpr5021);
+ p_ExprSingle170=this.p_ExprSingle(true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ExprSingle170.getTree());
+
+
+ break;
+
+ default :
+ break loop82;
+ }
+ } while (true);
+
+ k=this.match(this.input,SATISFIES,XQueryParser.FOLLOW_SATISFIES_in_p_QuantifiedExpr5028); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_ExprSingle_in_p_QuantifiedExpr5032);
+ p_ExprSingle171=this.p_ExprSingle(true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ExprSingle171.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_SwitchHybrid_return: (function() {
+ XQueryParser.p_SwitchHybrid_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_SwitchHybrid_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:736:1: p_SwitchHybrid[strict] : k= SWITCH LPAREN p_Expr[true,true] RPAREN ( p_SwitchCaseHybrid[$strict] )+ k= DEFAULT k= RETURN p_Hybrid[$strict,false] ;
+ // $ANTLR start "p_SwitchHybrid"
+ p_SwitchHybrid: function(strict) {
+ var retval = new XQueryParser.p_SwitchHybrid_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var LPAREN172 = null;
+ var RPAREN174 = null;
+ var p_Expr173 = null;
+ var p_SwitchCaseHybrid175 = null;
+ var p_Hybrid176 = null;
+
+ var k_tree=null;
+ var LPAREN172_tree=null;
+ var RPAREN174_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:737:9: (k= SWITCH LPAREN p_Expr[true,true] RPAREN ( p_SwitchCaseHybrid[$strict] )+ k= DEFAULT k= RETURN p_Hybrid[$strict,false] )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:737:11: k= SWITCH LPAREN p_Expr[true,true] RPAREN ( p_SwitchCaseHybrid[$strict] )+ k= DEFAULT k= RETURN p_Hybrid[$strict,false]
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,SWITCH,XQueryParser.FOLLOW_SWITCH_in_p_SwitchHybrid5062); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ LPAREN172=this.match(this.input,LPAREN,XQueryParser.FOLLOW_LPAREN_in_p_SwitchHybrid5066); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LPAREN172_tree = this.adaptor.create(LPAREN172);
+ this.adaptor.addChild(root_0, LPAREN172_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_Expr_in_p_SwitchHybrid5068);
+ p_Expr173=this.p_Expr(true, true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Expr173.getTree());
+ RPAREN174=this.match(this.input,RPAREN,XQueryParser.FOLLOW_RPAREN_in_p_SwitchHybrid5071); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RPAREN174_tree = this.adaptor.create(RPAREN174);
+ this.adaptor.addChild(root_0, RPAREN174_tree);
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:737:67: ( p_SwitchCaseHybrid[$strict] )+
+ var cnt83=0;
+ loop83:
+ do {
+ var alt83=2;
+ var LA83_0 = this.input.LA(1);
+
+ if ( (LA83_0==CASE) ) {
+ alt83=1;
+ }
+
+
+ switch (alt83) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:737:67: p_SwitchCaseHybrid[$strict]
+ this.pushFollow(XQueryParser.FOLLOW_p_SwitchCaseHybrid_in_p_SwitchHybrid5073);
+ p_SwitchCaseHybrid175=this.p_SwitchCaseHybrid(strict);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_SwitchCaseHybrid175.getTree());
+
+
+ break;
+
+ default :
+ if ( cnt83 >= 1 ) {
+ break loop83;
+ }
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var eee = new org.antlr.runtime.EarlyExitException(83, this.input);
+ throw eee;
+ }
+ cnt83++;
+ } while (true);
+
+ k=this.match(this.input,DEFAULT,XQueryParser.FOLLOW_DEFAULT_in_p_SwitchHybrid5079); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ k=this.match(this.input,RETURN,XQueryParser.FOLLOW_RETURN_in_p_SwitchHybrid5085); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_Hybrid_in_p_SwitchHybrid5089);
+ p_Hybrid176=this.p_Hybrid(strict, false);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Hybrid176.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_SwitchCaseHybrid_return: (function() {
+ XQueryParser.p_SwitchCaseHybrid_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_SwitchCaseHybrid_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:741:1: p_SwitchCaseHybrid[strict] : (k= CASE p_SwitchCaseOperand )+ k= RETURN p_Hybrid[$strict,false] ;
+ // $ANTLR start "p_SwitchCaseHybrid"
+ p_SwitchCaseHybrid: function(strict) {
+ var retval = new XQueryParser.p_SwitchCaseHybrid_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var p_SwitchCaseOperand177 = null;
+ var p_Hybrid178 = null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:742:9: ( (k= CASE p_SwitchCaseOperand )+ k= RETURN p_Hybrid[$strict,false] )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:742:11: (k= CASE p_SwitchCaseOperand )+ k= RETURN p_Hybrid[$strict,false]
+ root_0 = this.adaptor.nil();
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:742:11: (k= CASE p_SwitchCaseOperand )+
+ var cnt84=0;
+ loop84:
+ do {
+ var alt84=2;
+ var LA84_0 = this.input.LA(1);
+
+ if ( (LA84_0==CASE) ) {
+ alt84=1;
+ }
+
+
+ switch (alt84) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:742:12: k= CASE p_SwitchCaseOperand
+ k=this.match(this.input,CASE,XQueryParser.FOLLOW_CASE_in_p_SwitchCaseHybrid5120); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_SwitchCaseOperand_in_p_SwitchCaseHybrid5124);
+ p_SwitchCaseOperand177=this.p_SwitchCaseOperand();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_SwitchCaseOperand177.getTree());
+
+
+ break;
+
+ default :
+ if ( cnt84 >= 1 ) {
+ break loop84;
+ }
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var eee = new org.antlr.runtime.EarlyExitException(84, this.input);
+ throw eee;
+ }
+ cnt84++;
+ } while (true);
+
+ k=this.match(this.input,RETURN,XQueryParser.FOLLOW_RETURN_in_p_SwitchCaseHybrid5130); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_Hybrid_in_p_SwitchCaseHybrid5134);
+ p_Hybrid178=this.p_Hybrid(strict, false);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Hybrid178.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_SwitchCaseOperand_return: (function() {
+ XQueryParser.p_SwitchCaseOperand_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_SwitchCaseOperand_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:746:1: p_SwitchCaseOperand : p_ExprSingle[true] ;
+ // $ANTLR start "p_SwitchCaseOperand"
+ p_SwitchCaseOperand: function() {
+ var retval = new XQueryParser.p_SwitchCaseOperand_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_ExprSingle179 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:747:9: ( p_ExprSingle[true] )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:747:11: p_ExprSingle[true]
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_ExprSingle_in_p_SwitchCaseOperand5161);
+ p_ExprSingle179=this.p_ExprSingle(true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ExprSingle179.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_TypeswitchHybrid_return: (function() {
+ XQueryParser.p_TypeswitchHybrid_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_TypeswitchHybrid_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:751:1: p_TypeswitchHybrid[strict] : k= TYPESWITCH LPAREN p_Expr[true,true] RPAREN ( p_CaseHybrid[$strict] )+ k= DEFAULT (d= DOLLAR v= p_VarName )? k= RETURN p_Hybrid[$strict,false] ;
+ // $ANTLR start "p_TypeswitchHybrid"
+ p_TypeswitchHybrid: function(strict) {
+ var retval = new XQueryParser.p_TypeswitchHybrid_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var d = null;
+ var LPAREN180 = null;
+ var RPAREN182 = null;
+ var v = null;
+ var p_Expr181 = null;
+ var p_CaseHybrid183 = null;
+ var p_Hybrid184 = null;
+
+ var k_tree=null;
+ var d_tree=null;
+ var LPAREN180_tree=null;
+ var RPAREN182_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:752:9: (k= TYPESWITCH LPAREN p_Expr[true,true] RPAREN ( p_CaseHybrid[$strict] )+ k= DEFAULT (d= DOLLAR v= p_VarName )? k= RETURN p_Hybrid[$strict,false] )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:752:11: k= TYPESWITCH LPAREN p_Expr[true,true] RPAREN ( p_CaseHybrid[$strict] )+ k= DEFAULT (d= DOLLAR v= p_VarName )? k= RETURN p_Hybrid[$strict,false]
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,TYPESWITCH,XQueryParser.FOLLOW_TYPESWITCH_in_p_TypeswitchHybrid5191); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ LPAREN180=this.match(this.input,LPAREN,XQueryParser.FOLLOW_LPAREN_in_p_TypeswitchHybrid5195); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LPAREN180_tree = this.adaptor.create(LPAREN180);
+ this.adaptor.addChild(root_0, LPAREN180_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_Expr_in_p_TypeswitchHybrid5197);
+ p_Expr181=this.p_Expr(true, true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Expr181.getTree());
+ RPAREN182=this.match(this.input,RPAREN,XQueryParser.FOLLOW_RPAREN_in_p_TypeswitchHybrid5200); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RPAREN182_tree = this.adaptor.create(RPAREN182);
+ this.adaptor.addChild(root_0, RPAREN182_tree);
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:752:71: ( p_CaseHybrid[$strict] )+
+ var cnt85=0;
+ loop85:
+ do {
+ var alt85=2;
+ var LA85_0 = this.input.LA(1);
+
+ if ( (LA85_0==CASE) ) {
+ alt85=1;
+ }
+
+
+ switch (alt85) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:752:71: p_CaseHybrid[$strict]
+ this.pushFollow(XQueryParser.FOLLOW_p_CaseHybrid_in_p_TypeswitchHybrid5202);
+ p_CaseHybrid183=this.p_CaseHybrid(strict);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_CaseHybrid183.getTree());
+
+
+ break;
+
+ default :
+ if ( cnt85 >= 1 ) {
+ break loop85;
+ }
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var eee = new org.antlr.runtime.EarlyExitException(85, this.input);
+ throw eee;
+ }
+ cnt85++;
+ } while (true);
+
+ k=this.match(this.input,DEFAULT,XQueryParser.FOLLOW_DEFAULT_in_p_TypeswitchHybrid5208); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:752:119: (d= DOLLAR v= p_VarName )?
+ var alt86=2;
+ var LA86_0 = this.input.LA(1);
+
+ if ( (LA86_0==DOLLAR) ) {
+ alt86=1;
+ }
+ switch (alt86) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:752:120: d= DOLLAR v= p_VarName
+ d=this.match(this.input,DOLLAR,XQueryParser.FOLLOW_DOLLAR_in_p_TypeswitchHybrid5215); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ d_tree = this.adaptor.create(d);
+ this.adaptor.addChild(root_0, d_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_VarName_in_p_TypeswitchHybrid5219);
+ v=this.p_VarName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, v.getTree());
+ if ( this.state.backtracking===0 ) {
+ this.av(d, (v?v.stop:null));
+ }
+
+
+ break;
+
+ }
+
+ k=this.match(this.input,RETURN,XQueryParser.FOLLOW_RETURN_in_p_TypeswitchHybrid5227); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_Hybrid_in_p_TypeswitchHybrid5231);
+ p_Hybrid184=this.p_Hybrid(strict, false);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Hybrid184.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_CaseHybrid_return: (function() {
+ XQueryParser.p_CaseHybrid_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_CaseHybrid_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:756:1: p_CaseHybrid[strict] : k= CASE (d= DOLLAR v= p_VarName k= AS )? p_SequenceTypeUnion k= RETURN p_ExprSingle[false] ;
+ // $ANTLR start "p_CaseHybrid"
+ p_CaseHybrid: function(strict) {
+ var retval = new XQueryParser.p_CaseHybrid_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var d = null;
+ var v = null;
+ var p_SequenceTypeUnion185 = null;
+ var p_ExprSingle186 = null;
+
+ var k_tree=null;
+ var d_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:757:9: (k= CASE (d= DOLLAR v= p_VarName k= AS )? p_SequenceTypeUnion k= RETURN p_ExprSingle[false] )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:757:11: k= CASE (d= DOLLAR v= p_VarName k= AS )? p_SequenceTypeUnion k= RETURN p_ExprSingle[false]
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,CASE,XQueryParser.FOLLOW_CASE_in_p_CaseHybrid5261); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:757:33: (d= DOLLAR v= p_VarName k= AS )?
+ var alt87=2;
+ var LA87_0 = this.input.LA(1);
+
+ if ( (LA87_0==DOLLAR) ) {
+ alt87=1;
+ }
+ switch (alt87) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:757:34: d= DOLLAR v= p_VarName k= AS
+ d=this.match(this.input,DOLLAR,XQueryParser.FOLLOW_DOLLAR_in_p_CaseHybrid5268); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ d_tree = this.adaptor.create(d);
+ this.adaptor.addChild(root_0, d_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_VarName_in_p_CaseHybrid5272);
+ v=this.p_VarName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, v.getTree());
+ if ( this.state.backtracking===0 ) {
+ this.av(d, (v?v.stop:null));
+ }
+ k=this.match(this.input,AS,XQueryParser.FOLLOW_AS_in_p_CaseHybrid5278); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+
+
+ break;
+
+ }
+
+ this.pushFollow(XQueryParser.FOLLOW_p_SequenceTypeUnion_in_p_CaseHybrid5284);
+ p_SequenceTypeUnion185=this.p_SequenceTypeUnion();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_SequenceTypeUnion185.getTree());
+ k=this.match(this.input,RETURN,XQueryParser.FOLLOW_RETURN_in_p_CaseHybrid5288); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_ExprSingle_in_p_CaseHybrid5292);
+ p_ExprSingle186=this.p_ExprSingle(false);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ExprSingle186.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_SequenceTypeUnion_return: (function() {
+ XQueryParser.p_SequenceTypeUnion_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_SequenceTypeUnion_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:761:1: p_SequenceTypeUnion : p_SequenceType ( VBAR p_SequenceType )* ;
+ // $ANTLR start "p_SequenceTypeUnion"
+ p_SequenceTypeUnion: function() {
+ var retval = new XQueryParser.p_SequenceTypeUnion_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var VBAR188 = null;
+ var p_SequenceType187 = null;
+ var p_SequenceType189 = null;
+
+ var VBAR188_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:762:9: ( p_SequenceType ( VBAR p_SequenceType )* )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:762:11: p_SequenceType ( VBAR p_SequenceType )*
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_SequenceType_in_p_SequenceTypeUnion5319);
+ p_SequenceType187=this.p_SequenceType();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_SequenceType187.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:762:26: ( VBAR p_SequenceType )*
+ loop88:
+ do {
+ var alt88=2;
+ var LA88_0 = this.input.LA(1);
+
+ if ( (LA88_0==VBAR) ) {
+ alt88=1;
+ }
+
+
+ switch (alt88) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:762:27: VBAR p_SequenceType
+ VBAR188=this.match(this.input,VBAR,XQueryParser.FOLLOW_VBAR_in_p_SequenceTypeUnion5322); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ VBAR188_tree = this.adaptor.create(VBAR188);
+ this.adaptor.addChild(root_0, VBAR188_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_SequenceType_in_p_SequenceTypeUnion5324);
+ p_SequenceType189=this.p_SequenceType();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_SequenceType189.getTree());
+
+
+ break;
+
+ default :
+ break loop88;
+ }
+ } while (true);
+
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_IfHybrid_return: (function() {
+ XQueryParser.p_IfHybrid_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_IfHybrid_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:766:1: p_IfHybrid[strict] : k= IF LPAREN p_Expr[true,true] RPAREN k= THEN p_Hybrid[$strict,false] k= ELSE p_Hybrid[$strict,false] ;
+ // $ANTLR start "p_IfHybrid"
+ p_IfHybrid: function(strict) {
+ var retval = new XQueryParser.p_IfHybrid_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var LPAREN190 = null;
+ var RPAREN192 = null;
+ var p_Expr191 = null;
+ var p_Hybrid193 = null;
+ var p_Hybrid194 = null;
+
+ var k_tree=null;
+ var LPAREN190_tree=null;
+ var RPAREN192_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:767:9: (k= IF LPAREN p_Expr[true,true] RPAREN k= THEN p_Hybrid[$strict,false] k= ELSE p_Hybrid[$strict,false] )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:767:11: k= IF LPAREN p_Expr[true,true] RPAREN k= THEN p_Hybrid[$strict,false] k= ELSE p_Hybrid[$strict,false]
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,IF,XQueryParser.FOLLOW_IF_in_p_IfHybrid5355); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ LPAREN190=this.match(this.input,LPAREN,XQueryParser.FOLLOW_LPAREN_in_p_IfHybrid5359); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LPAREN190_tree = this.adaptor.create(LPAREN190);
+ this.adaptor.addChild(root_0, LPAREN190_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_Expr_in_p_IfHybrid5361);
+ p_Expr191=this.p_Expr(true, true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Expr191.getTree());
+ RPAREN192=this.match(this.input,RPAREN,XQueryParser.FOLLOW_RPAREN_in_p_IfHybrid5364); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RPAREN192_tree = this.adaptor.create(RPAREN192);
+ this.adaptor.addChild(root_0, RPAREN192_tree);
+ }
+ k=this.match(this.input,THEN,XQueryParser.FOLLOW_THEN_in_p_IfHybrid5368); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_Hybrid_in_p_IfHybrid5372);
+ p_Hybrid193=this.p_Hybrid(strict, false);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Hybrid193.getTree());
+ k=this.match(this.input,ELSE,XQueryParser.FOLLOW_ELSE_in_p_IfHybrid5377); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_Hybrid_in_p_IfHybrid5381);
+ p_Hybrid194=this.p_Hybrid(strict, false);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Hybrid194.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_TryCatchExpr_return: (function() {
+ XQueryParser.p_TryCatchExpr_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_TryCatchExpr_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:771:1: p_TryCatchExpr : p_TryClause ( p_CatchClause )+ ;
+ // $ANTLR start "p_TryCatchExpr"
+ p_TryCatchExpr: function() {
+ var retval = new XQueryParser.p_TryCatchExpr_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_TryClause195 = null;
+ var p_CatchClause196 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:772:9: ( p_TryClause ( p_CatchClause )+ )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:772:11: p_TryClause ( p_CatchClause )+
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_TryClause_in_p_TryCatchExpr5408);
+ p_TryClause195=this.p_TryClause();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_TryClause195.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:772:23: ( p_CatchClause )+
+ var cnt89=0;
+ loop89:
+ do {
+ var alt89=2;
+ var LA89_0 = this.input.LA(1);
+
+ if ( (LA89_0==CATCH) ) {
+ alt89=1;
+ }
+
+
+ switch (alt89) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:772:23: p_CatchClause
+ this.pushFollow(XQueryParser.FOLLOW_p_CatchClause_in_p_TryCatchExpr5410);
+ p_CatchClause196=this.p_CatchClause();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_CatchClause196.getTree());
+
+
+ break;
+
+ default :
+ if ( cnt89 >= 1 ) {
+ break loop89;
+ }
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var eee = new org.antlr.runtime.EarlyExitException(89, this.input);
+ throw eee;
+ }
+ cnt89++;
+ } while (true);
+
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_TryClause_return: (function() {
+ XQueryParser.p_TryClause_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_TryClause_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:776:1: p_TryClause : k= TRY LBRACKET p_TryTargetExpr RBRACKET ;
+ // $ANTLR start "p_TryClause"
+ p_TryClause: function() {
+ var retval = new XQueryParser.p_TryClause_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var LBRACKET197 = null;
+ var RBRACKET199 = null;
+ var p_TryTargetExpr198 = null;
+
+ var k_tree=null;
+ var LBRACKET197_tree=null;
+ var RBRACKET199_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:777:9: (k= TRY LBRACKET p_TryTargetExpr RBRACKET )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:777:11: k= TRY LBRACKET p_TryTargetExpr RBRACKET
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,TRY,XQueryParser.FOLLOW_TRY_in_p_TryClause5439); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ LBRACKET197=this.match(this.input,LBRACKET,XQueryParser.FOLLOW_LBRACKET_in_p_TryClause5443); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LBRACKET197_tree = this.adaptor.create(LBRACKET197);
+ this.adaptor.addChild(root_0, LBRACKET197_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_TryTargetExpr_in_p_TryClause5445);
+ p_TryTargetExpr198=this.p_TryTargetExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_TryTargetExpr198.getTree());
+ RBRACKET199=this.match(this.input,RBRACKET,XQueryParser.FOLLOW_RBRACKET_in_p_TryClause5447); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RBRACKET199_tree = this.adaptor.create(RBRACKET199);
+ this.adaptor.addChild(root_0, RBRACKET199_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_TryTargetExpr_return: (function() {
+ XQueryParser.p_TryTargetExpr_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_TryTargetExpr_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:781:1: p_TryTargetExpr : p_Expr[false,false] ;
+ // $ANTLR start "p_TryTargetExpr"
+ p_TryTargetExpr: function() {
+ var retval = new XQueryParser.p_TryTargetExpr_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_Expr200 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:782:9: ( p_Expr[false,false] )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:782:11: p_Expr[false,false]
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_Expr_in_p_TryTargetExpr5473);
+ p_Expr200=this.p_Expr(false, false);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Expr200.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_CatchClause_return: (function() {
+ XQueryParser.p_CatchClause_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_CatchClause_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:786:1: p_CatchClause : k= CATCH p_CatchErrorList LBRACKET p_Expr[false,false] RBRACKET ;
+ // $ANTLR start "p_CatchClause"
+ p_CatchClause: function() {
+ var retval = new XQueryParser.p_CatchClause_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var LBRACKET202 = null;
+ var RBRACKET204 = null;
+ var p_CatchErrorList201 = null;
+ var p_Expr203 = null;
+
+ var k_tree=null;
+ var LBRACKET202_tree=null;
+ var RBRACKET204_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:787:9: (k= CATCH p_CatchErrorList LBRACKET p_Expr[false,false] RBRACKET )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:787:11: k= CATCH p_CatchErrorList LBRACKET p_Expr[false,false] RBRACKET
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,CATCH,XQueryParser.FOLLOW_CATCH_in_p_CatchClause5502); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_CatchErrorList_in_p_CatchClause5506);
+ p_CatchErrorList201=this.p_CatchErrorList();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_CatchErrorList201.getTree());
+ LBRACKET202=this.match(this.input,LBRACKET,XQueryParser.FOLLOW_LBRACKET_in_p_CatchClause5508); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LBRACKET202_tree = this.adaptor.create(LBRACKET202);
+ this.adaptor.addChild(root_0, LBRACKET202_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_Expr_in_p_CatchClause5510);
+ p_Expr203=this.p_Expr(false, false);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Expr203.getTree());
+ RBRACKET204=this.match(this.input,RBRACKET,XQueryParser.FOLLOW_RBRACKET_in_p_CatchClause5513); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RBRACKET204_tree = this.adaptor.create(RBRACKET204);
+ this.adaptor.addChild(root_0, RBRACKET204_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_CatchErrorList_return: (function() {
+ XQueryParser.p_CatchErrorList_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_CatchErrorList_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:791:1: p_CatchErrorList : p_NameTest ( VBAR p_NameTest )* ;
+ // $ANTLR start "p_CatchErrorList"
+ p_CatchErrorList: function() {
+ var retval = new XQueryParser.p_CatchErrorList_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var VBAR206 = null;
+ var p_NameTest205 = null;
+ var p_NameTest207 = null;
+
+ var VBAR206_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:792:9: ( p_NameTest ( VBAR p_NameTest )* )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:792:11: p_NameTest ( VBAR p_NameTest )*
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_NameTest_in_p_CatchErrorList5539);
+ p_NameTest205=this.p_NameTest();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_NameTest205.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:792:22: ( VBAR p_NameTest )*
+ loop90:
+ do {
+ var alt90=2;
+ var LA90_0 = this.input.LA(1);
+
+ if ( (LA90_0==VBAR) ) {
+ alt90=1;
+ }
+
+
+ switch (alt90) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:792:23: VBAR p_NameTest
+ VBAR206=this.match(this.input,VBAR,XQueryParser.FOLLOW_VBAR_in_p_CatchErrorList5542); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ VBAR206_tree = this.adaptor.create(VBAR206);
+ this.adaptor.addChild(root_0, VBAR206_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_NameTest_in_p_CatchErrorList5544);
+ p_NameTest207=this.p_NameTest();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_NameTest207.getTree());
+
+
+ break;
+
+ default :
+ break loop90;
+ }
+ } while (true);
+
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_OrExpr_return: (function() {
+ XQueryParser.p_OrExpr_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_OrExpr_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:796:1: p_OrExpr : p_AndExpr (k= OR p_AndExpr )* ;
+ // $ANTLR start "p_OrExpr"
+ p_OrExpr: function() {
+ var retval = new XQueryParser.p_OrExpr_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var p_AndExpr208 = null;
+ var p_AndExpr209 = null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:797:9: ( p_AndExpr (k= OR p_AndExpr )* )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:797:11: p_AndExpr (k= OR p_AndExpr )*
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_AndExpr_in_p_OrExpr5572);
+ p_AndExpr208=this.p_AndExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_AndExpr208.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:797:21: (k= OR p_AndExpr )*
+ loop91:
+ do {
+ var alt91=2;
+ var LA91_0 = this.input.LA(1);
+
+ if ( (LA91_0==OR) ) {
+ alt91=1;
+ }
+
+
+ switch (alt91) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:797:23: k= OR p_AndExpr
+ k=this.match(this.input,OR,XQueryParser.FOLLOW_OR_in_p_OrExpr5578); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_AndExpr_in_p_OrExpr5582);
+ p_AndExpr209=this.p_AndExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_AndExpr209.getTree());
+
+
+ break;
+
+ default :
+ break loop91;
+ }
+ } while (true);
+
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_AndExpr_return: (function() {
+ XQueryParser.p_AndExpr_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_AndExpr_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:801:1: p_AndExpr : p_ComparisonExpr (k= AND p_ComparisonExpr )* ;
+ // $ANTLR start "p_AndExpr"
+ p_AndExpr: function() {
+ var retval = new XQueryParser.p_AndExpr_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var p_ComparisonExpr210 = null;
+ var p_ComparisonExpr211 = null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:802:9: ( p_ComparisonExpr (k= AND p_ComparisonExpr )* )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:802:11: p_ComparisonExpr (k= AND p_ComparisonExpr )*
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_ComparisonExpr_in_p_AndExpr5611);
+ p_ComparisonExpr210=this.p_ComparisonExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ComparisonExpr210.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:802:28: (k= AND p_ComparisonExpr )*
+ loop92:
+ do {
+ var alt92=2;
+ var LA92_0 = this.input.LA(1);
+
+ if ( (LA92_0==AND) ) {
+ alt92=1;
+ }
+
+
+ switch (alt92) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:802:30: k= AND p_ComparisonExpr
+ k=this.match(this.input,AND,XQueryParser.FOLLOW_AND_in_p_AndExpr5617); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_ComparisonExpr_in_p_AndExpr5621);
+ p_ComparisonExpr211=this.p_ComparisonExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ComparisonExpr211.getTree());
+
+
+ break;
+
+ default :
+ break loop92;
+ }
+ } while (true);
+
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_ComparisonExpr_return: (function() {
+ XQueryParser.p_ComparisonExpr_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_ComparisonExpr_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:807:1: p_ComparisonExpr : p_FTContainsExpr ( ( p_ValueComp | p_GeneralComp | p_NodeComp ) p_FTContainsExpr )? ;
+ // $ANTLR start "p_ComparisonExpr"
+ p_ComparisonExpr: function() {
+ var retval = new XQueryParser.p_ComparisonExpr_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_FTContainsExpr212 = null;
+ var p_ValueComp213 = null;
+ var p_GeneralComp214 = null;
+ var p_NodeComp215 = null;
+ var p_FTContainsExpr216 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:808:9: ( p_FTContainsExpr ( ( p_ValueComp | p_GeneralComp | p_NodeComp ) p_FTContainsExpr )? )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:808:11: p_FTContainsExpr ( ( p_ValueComp | p_GeneralComp | p_NodeComp ) p_FTContainsExpr )?
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_FTContainsExpr_in_p_ComparisonExpr5651);
+ p_FTContainsExpr212=this.p_FTContainsExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_FTContainsExpr212.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:808:28: ( ( p_ValueComp | p_GeneralComp | p_NodeComp ) p_FTContainsExpr )?
+ var alt94=2;
+ var LA94_0 = this.input.LA(1);
+
+ if ( (LA94_0==EQ||LA94_0==GE||LA94_0==GT||LA94_0==IS||LA94_0==LE||LA94_0==LT||LA94_0==NE||LA94_0==EQUAL||LA94_0==NOTEQUAL||(LA94_0>=SMALLER && LA94_0<=GREATER_GREATER)) ) {
+ alt94=1;
+ }
+ switch (alt94) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:808:30: ( p_ValueComp | p_GeneralComp | p_NodeComp ) p_FTContainsExpr
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:808:30: ( p_ValueComp | p_GeneralComp | p_NodeComp )
+ var alt93=3;
+ switch ( this.input.LA(1) ) {
+ case EQ:
+ case GE:
+ case GT:
+ case LE:
+ case LT:
+ case NE:
+ alt93=1;
+ break;
+ case EQUAL:
+ case NOTEQUAL:
+ case SMALLER:
+ case GREATER:
+ case SMALLEREQ:
+ case GREATEREQ:
+ alt93=2;
+ break;
+ case IS:
+ case SMALLER_SMALLER:
+ case GREATER_GREATER:
+ alt93=3;
+ break;
+ default:
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 93, 0, this.input);
+
+ throw nvae;
+ }
+
+ switch (alt93) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:808:31: p_ValueComp
+ this.pushFollow(XQueryParser.FOLLOW_p_ValueComp_in_p_ComparisonExpr5656);
+ p_ValueComp213=this.p_ValueComp();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ValueComp213.getTree());
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:808:45: p_GeneralComp
+ this.pushFollow(XQueryParser.FOLLOW_p_GeneralComp_in_p_ComparisonExpr5660);
+ p_GeneralComp214=this.p_GeneralComp();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_GeneralComp214.getTree());
+
+
+ break;
+ case 3 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:808:61: p_NodeComp
+ this.pushFollow(XQueryParser.FOLLOW_p_NodeComp_in_p_ComparisonExpr5664);
+ p_NodeComp215=this.p_NodeComp();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_NodeComp215.getTree());
+
+
+ break;
+
+ }
+
+ this.pushFollow(XQueryParser.FOLLOW_p_FTContainsExpr_in_p_ComparisonExpr5667);
+ p_FTContainsExpr216=this.p_FTContainsExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_FTContainsExpr216.getTree());
+
+
+ break;
+
+ }
+
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_RangeExpr_return: (function() {
+ XQueryParser.p_RangeExpr_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_RangeExpr_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:812:1: p_RangeExpr : p_AdditiveExpr (k= TO p_AdditiveExpr )? ;
+ // $ANTLR start "p_RangeExpr"
+ p_RangeExpr: function() {
+ var retval = new XQueryParser.p_RangeExpr_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var p_AdditiveExpr217 = null;
+ var p_AdditiveExpr218 = null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:813:9: ( p_AdditiveExpr (k= TO p_AdditiveExpr )? )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:813:11: p_AdditiveExpr (k= TO p_AdditiveExpr )?
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_AdditiveExpr_in_p_RangeExpr5696);
+ p_AdditiveExpr217=this.p_AdditiveExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_AdditiveExpr217.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:813:26: (k= TO p_AdditiveExpr )?
+ var alt95=2;
+ var LA95_0 = this.input.LA(1);
+
+ if ( (LA95_0==TO) ) {
+ alt95=1;
+ }
+ switch (alt95) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:813:28: k= TO p_AdditiveExpr
+ k=this.match(this.input,TO,XQueryParser.FOLLOW_TO_in_p_RangeExpr5702); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_AdditiveExpr_in_p_RangeExpr5706);
+ p_AdditiveExpr218=this.p_AdditiveExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_AdditiveExpr218.getTree());
+
+
+ break;
+
+ }
+
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_AdditiveExpr_return: (function() {
+ XQueryParser.p_AdditiveExpr_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_AdditiveExpr_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:817:1: p_AdditiveExpr : p_MultiplicativeExpr ( (o= PLUS | o= MINUS ) p_MultiplicativeExpr )* ;
+ // $ANTLR start "p_AdditiveExpr"
+ p_AdditiveExpr: function() {
+ var retval = new XQueryParser.p_AdditiveExpr_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var o = null;
+ var p_MultiplicativeExpr219 = null;
+ var p_MultiplicativeExpr220 = null;
+
+ var o_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:818:9: ( p_MultiplicativeExpr ( (o= PLUS | o= MINUS ) p_MultiplicativeExpr )* )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:818:11: p_MultiplicativeExpr ( (o= PLUS | o= MINUS ) p_MultiplicativeExpr )*
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_MultiplicativeExpr_in_p_AdditiveExpr5735);
+ p_MultiplicativeExpr219=this.p_MultiplicativeExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_MultiplicativeExpr219.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:818:32: ( (o= PLUS | o= MINUS ) p_MultiplicativeExpr )*
+ loop97:
+ do {
+ var alt97=2;
+ var LA97_0 = this.input.LA(1);
+
+ if ( ((LA97_0>=PLUS && LA97_0<=MINUS)) ) {
+ alt97=1;
+ }
+
+
+ switch (alt97) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:818:34: (o= PLUS | o= MINUS ) p_MultiplicativeExpr
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:818:34: (o= PLUS | o= MINUS )
+ var alt96=2;
+ var LA96_0 = this.input.LA(1);
+
+ if ( (LA96_0==PLUS) ) {
+ alt96=1;
+ }
+ else if ( (LA96_0==MINUS) ) {
+ alt96=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 96, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt96) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:818:35: o= PLUS
+ o=this.match(this.input,PLUS,XQueryParser.FOLLOW_PLUS_in_p_AdditiveExpr5742); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ o_tree = this.adaptor.create(o);
+ this.adaptor.addChild(root_0, o_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ao(o);
+ }
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:818:59: o= MINUS
+ o=this.match(this.input,MINUS,XQueryParser.FOLLOW_MINUS_in_p_AdditiveExpr5750); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ o_tree = this.adaptor.create(o);
+ this.adaptor.addChild(root_0, o_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ao(o);
+ }
+
+
+ break;
+
+ }
+
+ this.pushFollow(XQueryParser.FOLLOW_p_MultiplicativeExpr_in_p_AdditiveExpr5755);
+ p_MultiplicativeExpr220=this.p_MultiplicativeExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_MultiplicativeExpr220.getTree());
+
+
+ break;
+
+ default :
+ break loop97;
+ }
+ } while (true);
+
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_MultiplicativeExpr_return: (function() {
+ XQueryParser.p_MultiplicativeExpr_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_MultiplicativeExpr_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:822:1: p_MultiplicativeExpr : p_UnionExpr ( (o= STAR | (k= DIV | k= IDIV | k= MOD ) ) p_UnionExpr )* ;
+ // $ANTLR start "p_MultiplicativeExpr"
+ p_MultiplicativeExpr: function() {
+ var retval = new XQueryParser.p_MultiplicativeExpr_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var o = null;
+ var k = null;
+ var p_UnionExpr221 = null;
+ var p_UnionExpr222 = null;
+
+ var o_tree=null;
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:823:9: ( p_UnionExpr ( (o= STAR | (k= DIV | k= IDIV | k= MOD ) ) p_UnionExpr )* )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:823:11: p_UnionExpr ( (o= STAR | (k= DIV | k= IDIV | k= MOD ) ) p_UnionExpr )*
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_UnionExpr_in_p_MultiplicativeExpr5784);
+ p_UnionExpr221=this.p_UnionExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_UnionExpr221.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:823:23: ( (o= STAR | (k= DIV | k= IDIV | k= MOD ) ) p_UnionExpr )*
+ loop100:
+ do {
+ var alt100=2;
+ var LA100_0 = this.input.LA(1);
+
+ if ( (LA100_0==DIV||LA100_0==IDIV||LA100_0==MOD||LA100_0==STAR) ) {
+ alt100=1;
+ }
+
+
+ switch (alt100) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:823:25: (o= STAR | (k= DIV | k= IDIV | k= MOD ) ) p_UnionExpr
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:823:25: (o= STAR | (k= DIV | k= IDIV | k= MOD ) )
+ var alt99=2;
+ var LA99_0 = this.input.LA(1);
+
+ if ( (LA99_0==STAR) ) {
+ alt99=1;
+ }
+ else if ( (LA99_0==DIV||LA99_0==IDIV||LA99_0==MOD) ) {
+ alt99=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 99, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt99) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:823:26: o= STAR
+ o=this.match(this.input,STAR,XQueryParser.FOLLOW_STAR_in_p_MultiplicativeExpr5791); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ o_tree = this.adaptor.create(o);
+ this.adaptor.addChild(root_0, o_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ao(o);
+ }
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:823:50: (k= DIV | k= IDIV | k= MOD )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:823:50: (k= DIV | k= IDIV | k= MOD )
+ var alt98=3;
+ switch ( this.input.LA(1) ) {
+ case DIV:
+ alt98=1;
+ break;
+ case IDIV:
+ alt98=2;
+ break;
+ case MOD:
+ alt98=3;
+ break;
+ default:
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 98, 0, this.input);
+
+ throw nvae;
+ }
+
+ switch (alt98) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:823:51: k= DIV
+ k=this.match(this.input,DIV,XQueryParser.FOLLOW_DIV_in_p_MultiplicativeExpr5800); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:823:59: k= IDIV
+ k=this.match(this.input,IDIV,XQueryParser.FOLLOW_IDIV_in_p_MultiplicativeExpr5806); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+
+
+ break;
+ case 3 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:823:68: k= MOD
+ k=this.match(this.input,MOD,XQueryParser.FOLLOW_MOD_in_p_MultiplicativeExpr5812); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+
+
+ break;
+
+ }
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+
+
+ break;
+
+ }
+
+ this.pushFollow(XQueryParser.FOLLOW_p_UnionExpr_in_p_MultiplicativeExpr5818);
+ p_UnionExpr222=this.p_UnionExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_UnionExpr222.getTree());
+
+
+ break;
+
+ default :
+ break loop100;
+ }
+ } while (true);
+
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_UnionExpr_return: (function() {
+ XQueryParser.p_UnionExpr_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_UnionExpr_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:827:1: p_UnionExpr : p_IntersectExceptExpr ( (k= UNION | VBAR ) p_IntersectExceptExpr )* ;
+ // $ANTLR start "p_UnionExpr"
+ p_UnionExpr: function() {
+ var retval = new XQueryParser.p_UnionExpr_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var VBAR224 = null;
+ var p_IntersectExceptExpr223 = null;
+ var p_IntersectExceptExpr225 = null;
+
+ var k_tree=null;
+ var VBAR224_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:828:9: ( p_IntersectExceptExpr ( (k= UNION | VBAR ) p_IntersectExceptExpr )* )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:828:11: p_IntersectExceptExpr ( (k= UNION | VBAR ) p_IntersectExceptExpr )*
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_IntersectExceptExpr_in_p_UnionExpr5847);
+ p_IntersectExceptExpr223=this.p_IntersectExceptExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_IntersectExceptExpr223.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:828:33: ( (k= UNION | VBAR ) p_IntersectExceptExpr )*
+ loop102:
+ do {
+ var alt102=2;
+ var LA102_0 = this.input.LA(1);
+
+ if ( (LA102_0==UNION||LA102_0==VBAR) ) {
+ alt102=1;
+ }
+
+
+ switch (alt102) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:828:35: (k= UNION | VBAR ) p_IntersectExceptExpr
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:828:35: (k= UNION | VBAR )
+ var alt101=2;
+ var LA101_0 = this.input.LA(1);
+
+ if ( (LA101_0==UNION) ) {
+ alt101=1;
+ }
+ else if ( (LA101_0==VBAR) ) {
+ alt101=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 101, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt101) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:828:36: k= UNION
+ k=this.match(this.input,UNION,XQueryParser.FOLLOW_UNION_in_p_UnionExpr5854); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:828:61: VBAR
+ VBAR224=this.match(this.input,VBAR,XQueryParser.FOLLOW_VBAR_in_p_UnionExpr5860); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ VBAR224_tree = this.adaptor.create(VBAR224);
+ this.adaptor.addChild(root_0, VBAR224_tree);
+ }
+
+
+ break;
+
+ }
+
+ this.pushFollow(XQueryParser.FOLLOW_p_IntersectExceptExpr_in_p_UnionExpr5863);
+ p_IntersectExceptExpr225=this.p_IntersectExceptExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_IntersectExceptExpr225.getTree());
+
+
+ break;
+
+ default :
+ break loop102;
+ }
+ } while (true);
+
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_IntersectExceptExpr_return: (function() {
+ XQueryParser.p_IntersectExceptExpr_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_IntersectExceptExpr_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:832:1: p_IntersectExceptExpr : p_InstanceofExpr ( (k= INTERSECT | k= EXCEPT ) p_InstanceofExpr )* ;
+ // $ANTLR start "p_IntersectExceptExpr"
+ p_IntersectExceptExpr: function() {
+ var retval = new XQueryParser.p_IntersectExceptExpr_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var p_InstanceofExpr226 = null;
+ var p_InstanceofExpr227 = null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:833:9: ( p_InstanceofExpr ( (k= INTERSECT | k= EXCEPT ) p_InstanceofExpr )* )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:833:11: p_InstanceofExpr ( (k= INTERSECT | k= EXCEPT ) p_InstanceofExpr )*
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_InstanceofExpr_in_p_IntersectExceptExpr5892);
+ p_InstanceofExpr226=this.p_InstanceofExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_InstanceofExpr226.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:833:28: ( (k= INTERSECT | k= EXCEPT ) p_InstanceofExpr )*
+ loop104:
+ do {
+ var alt104=2;
+ var LA104_0 = this.input.LA(1);
+
+ if ( (LA104_0==EXCEPT||LA104_0==INTERSECT) ) {
+ alt104=1;
+ }
+
+
+ switch (alt104) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:833:30: (k= INTERSECT | k= EXCEPT ) p_InstanceofExpr
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:833:30: (k= INTERSECT | k= EXCEPT )
+ var alt103=2;
+ var LA103_0 = this.input.LA(1);
+
+ if ( (LA103_0==INTERSECT) ) {
+ alt103=1;
+ }
+ else if ( (LA103_0==EXCEPT) ) {
+ alt103=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 103, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt103) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:833:31: k= INTERSECT
+ k=this.match(this.input,INTERSECT,XQueryParser.FOLLOW_INTERSECT_in_p_IntersectExceptExpr5899); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:833:45: k= EXCEPT
+ k=this.match(this.input,EXCEPT,XQueryParser.FOLLOW_EXCEPT_in_p_IntersectExceptExpr5905); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+
+
+ break;
+
+ }
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_InstanceofExpr_in_p_IntersectExceptExpr5910);
+ p_InstanceofExpr227=this.p_InstanceofExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_InstanceofExpr227.getTree());
+
+
+ break;
+
+ default :
+ break loop104;
+ }
+ } while (true);
+
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_InstanceofExpr_return: (function() {
+ XQueryParser.p_InstanceofExpr_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_InstanceofExpr_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:837:1: p_InstanceofExpr : p_TreatExpr (k= INSTANCE k= OF p_SequenceType )? ;
+ // $ANTLR start "p_InstanceofExpr"
+ p_InstanceofExpr: function() {
+ var retval = new XQueryParser.p_InstanceofExpr_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var p_TreatExpr228 = null;
+ var p_SequenceType229 = null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:838:9: ( p_TreatExpr (k= INSTANCE k= OF p_SequenceType )? )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:838:11: p_TreatExpr (k= INSTANCE k= OF p_SequenceType )?
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_TreatExpr_in_p_InstanceofExpr5939);
+ p_TreatExpr228=this.p_TreatExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_TreatExpr228.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:838:23: (k= INSTANCE k= OF p_SequenceType )?
+ var alt105=2;
+ var LA105_0 = this.input.LA(1);
+
+ if ( (LA105_0==INSTANCE) ) {
+ alt105=1;
+ }
+ switch (alt105) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:838:25: k= INSTANCE k= OF p_SequenceType
+ k=this.match(this.input,INSTANCE,XQueryParser.FOLLOW_INSTANCE_in_p_InstanceofExpr5945); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ k=this.match(this.input,OF,XQueryParser.FOLLOW_OF_in_p_InstanceofExpr5951); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_SequenceType_in_p_InstanceofExpr5955);
+ p_SequenceType229=this.p_SequenceType();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_SequenceType229.getTree());
+
+
+ break;
+
+ }
+
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_TreatExpr_return: (function() {
+ XQueryParser.p_TreatExpr_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_TreatExpr_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:842:1: p_TreatExpr : p_CastableExpr (k= TREAT k= AS p_SequenceType )? ;
+ // $ANTLR start "p_TreatExpr"
+ p_TreatExpr: function() {
+ var retval = new XQueryParser.p_TreatExpr_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var p_CastableExpr230 = null;
+ var p_SequenceType231 = null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:843:9: ( p_CastableExpr (k= TREAT k= AS p_SequenceType )? )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:843:11: p_CastableExpr (k= TREAT k= AS p_SequenceType )?
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_CastableExpr_in_p_TreatExpr5983);
+ p_CastableExpr230=this.p_CastableExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_CastableExpr230.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:843:26: (k= TREAT k= AS p_SequenceType )?
+ var alt106=2;
+ var LA106_0 = this.input.LA(1);
+
+ if ( (LA106_0==TREAT) ) {
+ alt106=1;
+ }
+ switch (alt106) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:843:28: k= TREAT k= AS p_SequenceType
+ k=this.match(this.input,TREAT,XQueryParser.FOLLOW_TREAT_in_p_TreatExpr5989); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ k=this.match(this.input,AS,XQueryParser.FOLLOW_AS_in_p_TreatExpr5995); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_SequenceType_in_p_TreatExpr5999);
+ p_SequenceType231=this.p_SequenceType();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_SequenceType231.getTree());
+
+
+ break;
+
+ }
+
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_CastableExpr_return: (function() {
+ XQueryParser.p_CastableExpr_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_CastableExpr_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:847:1: p_CastableExpr : p_CastExpr (k= CASTABLE k= AS p_SingleType )? ;
+ // $ANTLR start "p_CastableExpr"
+ p_CastableExpr: function() {
+ var retval = new XQueryParser.p_CastableExpr_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var p_CastExpr232 = null;
+ var p_SingleType233 = null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:848:9: ( p_CastExpr (k= CASTABLE k= AS p_SingleType )? )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:848:11: p_CastExpr (k= CASTABLE k= AS p_SingleType )?
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_CastExpr_in_p_CastableExpr6036);
+ p_CastExpr232=this.p_CastExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_CastExpr232.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:848:22: (k= CASTABLE k= AS p_SingleType )?
+ var alt107=2;
+ var LA107_0 = this.input.LA(1);
+
+ if ( (LA107_0==CASTABLE) ) {
+ alt107=1;
+ }
+ switch (alt107) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:848:24: k= CASTABLE k= AS p_SingleType
+ k=this.match(this.input,CASTABLE,XQueryParser.FOLLOW_CASTABLE_in_p_CastableExpr6042); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ k=this.match(this.input,AS,XQueryParser.FOLLOW_AS_in_p_CastableExpr6048); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_SingleType_in_p_CastableExpr6052);
+ p_SingleType233=this.p_SingleType();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_SingleType233.getTree());
+
+
+ break;
+
+ }
+
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_CastExpr_return: (function() {
+ XQueryParser.p_CastExpr_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_CastExpr_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:852:1: p_CastExpr : p_UnaryExpr (k= CAST k= AS p_SingleType )? ;
+ // $ANTLR start "p_CastExpr"
+ p_CastExpr: function() {
+ var retval = new XQueryParser.p_CastExpr_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var p_UnaryExpr234 = null;
+ var p_SingleType235 = null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:853:9: ( p_UnaryExpr (k= CAST k= AS p_SingleType )? )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:853:11: p_UnaryExpr (k= CAST k= AS p_SingleType )?
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_UnaryExpr_in_p_CastExpr6089);
+ p_UnaryExpr234=this.p_UnaryExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_UnaryExpr234.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:853:23: (k= CAST k= AS p_SingleType )?
+ var alt108=2;
+ var LA108_0 = this.input.LA(1);
+
+ if ( (LA108_0==CAST) ) {
+ alt108=1;
+ }
+ switch (alt108) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:853:25: k= CAST k= AS p_SingleType
+ k=this.match(this.input,CAST,XQueryParser.FOLLOW_CAST_in_p_CastExpr6095); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ k=this.match(this.input,AS,XQueryParser.FOLLOW_AS_in_p_CastExpr6101); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_SingleType_in_p_CastExpr6105);
+ p_SingleType235=this.p_SingleType();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_SingleType235.getTree());
+
+
+ break;
+
+ }
+
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_UnaryExpr_return: (function() {
+ XQueryParser.p_UnaryExpr_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_UnaryExpr_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:857:1: p_UnaryExpr : (o= PLUS | o= MINUS )* p_ValueExpr -> ^( UnaryExpr ( PLUS )* p_ValueExpr ) ;
+ // $ANTLR start "p_UnaryExpr"
+ p_UnaryExpr: function() {
+ var retval = new XQueryParser.p_UnaryExpr_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var o = null;
+ var p_ValueExpr236 = null;
+
+ var o_tree=null;
+ var stream_PLUS=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token PLUS");
+ var stream_MINUS=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token MINUS");
+ var stream_p_ValueExpr=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"rule p_ValueExpr");
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:858:9: ( (o= PLUS | o= MINUS )* p_ValueExpr -> ^( UnaryExpr ( PLUS )* p_ValueExpr ) )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:858:11: (o= PLUS | o= MINUS )* p_ValueExpr
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:858:11: (o= PLUS | o= MINUS )*
+ loop109:
+ do {
+ var alt109=3;
+ var LA109_0 = this.input.LA(1);
+
+ if ( (LA109_0==PLUS) ) {
+ alt109=1;
+ }
+ else if ( (LA109_0==MINUS) ) {
+ alt109=2;
+ }
+
+
+ switch (alt109) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:858:12: o= PLUS
+ o=this.match(this.input,PLUS,XQueryParser.FOLLOW_PLUS_in_p_UnaryExpr6137); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_PLUS.add(o);
+
+ if ( this.state.backtracking===0 ) {
+ this.ao(o);
+ }
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:858:36: o= MINUS
+ o=this.match(this.input,MINUS,XQueryParser.FOLLOW_MINUS_in_p_UnaryExpr6145); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_MINUS.add(o);
+
+ if ( this.state.backtracking===0 ) {
+ this.ao(o);
+ }
+
+
+ break;
+
+ default :
+ break loop109;
+ }
+ } while (true);
+
+ this.pushFollow(XQueryParser.FOLLOW_p_ValueExpr_in_p_UnaryExpr6150);
+ p_ValueExpr236=this.p_ValueExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_p_ValueExpr.add(p_ValueExpr236.getTree());
+
+
+ // AST REWRITE
+ // elements: p_ValueExpr, PLUS
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( this.state.backtracking===0 ) {
+ retval.tree = root_0;
+ var stream_retval=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = this.adaptor.nil();
+ // 859:17: -> ^( UnaryExpr ( PLUS )* p_ValueExpr )
+ {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:859:20: ^( UnaryExpr ( PLUS )* p_ValueExpr )
+ {
+ var root_1 = this.adaptor.nil();
+ root_1 = this.adaptor.becomeRoot(this.adaptor.create(UnaryExpr, "UnaryExpr"), root_1);
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:859:32: ( PLUS )*
+ while ( stream_PLUS.hasNext() ) {
+ this.adaptor.addChild(root_1, stream_PLUS.nextNode());
+
+ }
+ stream_PLUS.reset();
+ this.adaptor.addChild(root_1, stream_p_ValueExpr.nextTree());
+
+ this.adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;}
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_ValueExpr_return: (function() {
+ XQueryParser.p_ValueExpr_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_ValueExpr_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:863:1: p_ValueExpr : ( ( VALIDATE ( p_ValidationMode | TYPE )? )=> p_ValidateExpr | p_SimpleMapExpr | p_ExtensionExpr );
+ // $ANTLR start "p_ValueExpr"
+ p_ValueExpr: function() {
+ var retval = new XQueryParser.p_ValueExpr_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_ValidateExpr237 = null;
+ var p_SimpleMapExpr238 = null;
+ var p_ExtensionExpr239 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:864:9: ( ( VALIDATE ( p_ValidationMode | TYPE )? )=> p_ValidateExpr | p_SimpleMapExpr | p_ExtensionExpr )
+ var alt110=3;
+ switch ( this.input.LA(1) ) {
+ case VALIDATE:
+ var LA110_1 = this.input.LA(2);
+
+ if ( (LA110_1==LAX) && (this.synpred6_XQueryParser())) {
+ alt110=1;
+ }
+ else if ( (LA110_1==STRICT) && (this.synpred6_XQueryParser())) {
+ alt110=1;
+ }
+ else if ( (LA110_1==TYPE) && (this.synpred6_XQueryParser())) {
+ alt110=1;
+ }
+ else if ( (LA110_1==LBRACKET) && (this.synpred6_XQueryParser())) {
+ alt110=1;
+ }
+ else if ( (LA110_1==EOF||(LA110_1>=AND && LA110_1<=AT)||(LA110_1>=CASE && LA110_1<=CASTABLE)||LA110_1==COLLATION||LA110_1==DEFAULT||(LA110_1>=DESCENDING && LA110_1<=DIV)||LA110_1==EMPTY||LA110_1==EQ||LA110_1==EXCEPT||LA110_1==FOR||LA110_1==GE||(LA110_1>=GT && LA110_1<=IDIV)||(LA110_1>=INSTANCE && LA110_1<=IS)||LA110_1==LE||(LA110_1>=LET && LA110_1<=MOD)||LA110_1==NE||(LA110_1>=OR && LA110_1<=ORDER)||(LA110_1>=RETURN && LA110_1<=SATISFIES)||LA110_1==STABLE||(LA110_1>=TO && LA110_1<=TREAT)||LA110_1==UNION||LA110_1==WHERE||LA110_1==COUNT||(LA110_1>=END && LA110_1<=GROUP)||LA110_1==ONLY||LA110_1==START||(LA110_1>=AFTER && LA110_1<=BEFORE)||LA110_1==INTO||LA110_1==MODIFY||LA110_1==WITH||LA110_1==CONTAINS||LA110_1==PARAGRAPHS||LA110_1==SENTENCES||LA110_1==TIMES||LA110_1==WORDS||(LA110_1>=CONCAT && LA110_1<=RPAREN)||LA110_1==R_UNION_BRACKET||(LA110_1>=RBRACKET && LA110_1<=EQUAL)||LA110_1==NOTEQUAL||LA110_1==HASH||LA110_1==COMMA||(LA110_1>=STAR && LA110_1<=BANG)||LA110_1==COLON||(LA110_1>=SEMICOLON && LA110_1<=VBAR)) ) {
+ alt110=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 110, 1, this.input);
+
+ throw nvae;
+ }
+ break;
+ case ANCESTOR:
+ case ANCESTOR_OR_SELF:
+ case AND:
+ case AS:
+ case ASCENDING:
+ case AT:
+ case ATTRIBUTE:
+ case BASE_URI:
+ case BOUNDARY_SPACE:
+ case BY:
+ case CASE:
+ case CAST:
+ case CASTABLE:
+ case CHILD:
+ case COLLATION:
+ case COMMENT:
+ case CONSTRUCTION:
+ case COPY_NAMESPACES:
+ case DECLARE:
+ case DEFAULT:
+ case DESCENDANT:
+ case DESCENDANT_OR_SELF:
+ case DESCENDING:
+ case DIV:
+ case DOCUMENT:
+ case DOCUMENT_NODE:
+ case ELEMENT:
+ case ELSE:
+ case EMPTY:
+ case EMPTY_SEQUENCE:
+ case ENCODING:
+ case EQ:
+ case EVERY:
+ case EXCEPT:
+ case EXTERNAL:
+ case FOLLOWING:
+ case FOLLOWING_SIBLING:
+ case FOR:
+ case FUNCTION:
+ case GE:
+ case GREATEST:
+ case GT:
+ case IDIV:
+ case IF:
+ case IMPORT:
+ case IN:
+ case INHERIT:
+ case INSTANCE:
+ case INTERSECT:
+ case IS:
+ case ITEM:
+ case LAX:
+ case LE:
+ case LEAST:
+ case LET:
+ case LT:
+ case MOD:
+ case MODULE:
+ case NAMESPACE:
+ case NE:
+ case NO_INHERIT:
+ case NO_PRESERVE:
+ case NODE:
+ case JSON:
+ case OF:
+ case OPTION:
+ case OR:
+ case ORDER:
+ case ORDERED:
+ case ORDERING:
+ case PARENT:
+ case PRECEDING:
+ case PRECEDING_SIBLING:
+ case PRESERVE:
+ case PROCESSING_INSTRUCTION:
+ case STRUCTURED_ITEM:
+ case JSON_ITEM:
+ case OBJECT:
+ case ARRAY:
+ case RETURN:
+ case SATISFIES:
+ case SCHEMA:
+ case SCHEMA_ATTRIBUTE:
+ case SCHEMA_ELEMENT:
+ case SELF:
+ case SOME:
+ case STABLE:
+ case STRICT:
+ case STRIP:
+ case TEXT:
+ case THEN:
+ case TO:
+ case TREAT:
+ case TYPESWITCH:
+ case UNION:
+ case UNORDERED:
+ case VARIABLE:
+ case VERSION:
+ case WHERE:
+ case XQUERY:
+ case ALLOWING:
+ case CATCH:
+ case CONTEXT:
+ case COUNT:
+ case DECIMAL_FORMAT:
+ case DECIMAL_SEPARATOR:
+ case DIGIT:
+ case END:
+ case GROUP:
+ case GROUPING_SEPARATOR:
+ case INFINITY:
+ case MINUS_SIGN:
+ case NAMESPACE_NODE:
+ case NAN:
+ case NEXT:
+ case ONLY:
+ case PATTERN_SEPARATOR:
+ case PERCENT:
+ case PER_MILLE:
+ case PREVIOUS:
+ case SLIDING:
+ case START:
+ case SWITCH:
+ case TRY:
+ case TUMBLING:
+ case TYPE:
+ case WHEN:
+ case WINDOW:
+ case ZERO_DIGIT:
+ case AFTER:
+ case BEFORE:
+ case COPY:
+ case DELETE:
+ case FIRST:
+ case INSERT:
+ case INTO:
+ case POSITION:
+ case APPEND:
+ case LAST:
+ case MODIFY:
+ case NODES:
+ case RENAME:
+ case REPLACE:
+ case REVALIDATION:
+ case SKIP:
+ case UPDATING:
+ case VALUE:
+ case WITH:
+ case ALL:
+ case ANY:
+ case CONTAINS:
+ case CONTENT:
+ case DIACRITICS:
+ case DIFFERENT:
+ case DISTANCE:
+ case ENTIRE:
+ case EXACTLY:
+ case FROM:
+ case FT_OPTION:
+ case FTAND:
+ case FTNOT:
+ case FTOR:
+ case INSENSITIVE:
+ case LANGUAGE:
+ case LEVELS:
+ case LOWERCASE:
+ case MOST:
+ case NO:
+ case NOT:
+ case OCCURS:
+ case PARAGRAPH:
+ case PARAGRAPHS:
+ case PHRASE:
+ case RELATIONSHIP:
+ case SAME:
+ case SCORE:
+ case SENSITIVE:
+ case SENTENCE:
+ case SENTENCES:
+ case STEMMING:
+ case STOP:
+ case THESAURUS:
+ case TIMES:
+ case UPPERCASE:
+ case USING:
+ case WEIGHT:
+ case WILDCARDS:
+ case WITHOUT:
+ case WORD:
+ case WORDS:
+ case BREAK:
+ case CONTINUE:
+ case EXIT:
+ case LOOP:
+ case RETURNING:
+ case WHILE:
+ case CHECK:
+ case COLLECTION:
+ case CONSTRAINT:
+ case FOREACH:
+ case FOREIGN:
+ case INDEX:
+ case INTEGRITY:
+ case KEY:
+ case ON:
+ case UNIQUE:
+ case AMP_ER:
+ case APOS_ER:
+ case QUOT_ER:
+ case LPAREN:
+ case DOLLAR:
+ case L_UNION_BRACKET:
+ case LBRACKET:
+ case LSQUARE:
+ case STAR:
+ case SMALLER:
+ case SLASH:
+ case SLASH_SLASH:
+ case DOT:
+ case DOT_DOT:
+ case ATTR_SIGN:
+ case Q:
+ case APOS:
+ case QUOT:
+ case L_NCName:
+ case L_DirCommentConstructor:
+ case L_DirPIConstructor:
+ case L_IntegerLiteral:
+ case L_DecimalLiteral:
+ case L_DoubleLiteral:
+ alt110=2;
+ break;
+ case L_Pragma:
+ alt110=3;
+ break;
+ default:
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 110, 0, this.input);
+
+ throw nvae;
+ }
+
+ switch (alt110) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:864:11: ( VALIDATE ( p_ValidationMode | TYPE )? )=> p_ValidateExpr
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_ValidateExpr_in_p_ValueExpr6220);
+ p_ValidateExpr237=this.p_ValidateExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ValidateExpr237.getTree());
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:865:11: p_SimpleMapExpr
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_SimpleMapExpr_in_p_ValueExpr6232);
+ p_SimpleMapExpr238=this.p_SimpleMapExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_SimpleMapExpr238.getTree());
+
+
+ break;
+ case 3 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:866:11: p_ExtensionExpr
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_ExtensionExpr_in_p_ValueExpr6244);
+ p_ExtensionExpr239=this.p_ExtensionExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ExtensionExpr239.getTree());
+
+
+ break;
+
+ }
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_SimpleMapExpr_return: (function() {
+ XQueryParser.p_SimpleMapExpr_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_SimpleMapExpr_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:869:1: p_SimpleMapExpr : p_PathExpr ( BANG p_PathExpr )* ;
+ // $ANTLR start "p_SimpleMapExpr"
+ p_SimpleMapExpr: function() {
+ var retval = new XQueryParser.p_SimpleMapExpr_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var BANG241 = null;
+ var p_PathExpr240 = null;
+ var p_PathExpr242 = null;
+
+ var BANG241_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:870:9: ( p_PathExpr ( BANG p_PathExpr )* )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:870:11: p_PathExpr ( BANG p_PathExpr )*
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_PathExpr_in_p_SimpleMapExpr6269);
+ p_PathExpr240=this.p_PathExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_PathExpr240.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:870:22: ( BANG p_PathExpr )*
+ loop111:
+ do {
+ var alt111=2;
+ var LA111_0 = this.input.LA(1);
+
+ if ( (LA111_0==BANG) ) {
+ alt111=1;
+ }
+
+
+ switch (alt111) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:870:23: BANG p_PathExpr
+ BANG241=this.match(this.input,BANG,XQueryParser.FOLLOW_BANG_in_p_SimpleMapExpr6272); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ BANG241_tree = this.adaptor.create(BANG241);
+ this.adaptor.addChild(root_0, BANG241_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_PathExpr_in_p_SimpleMapExpr6274);
+ p_PathExpr242=this.p_PathExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_PathExpr242.getTree());
+
+
+ break;
+
+ default :
+ break loop111;
+ }
+ } while (true);
+
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_GeneralComp_return: (function() {
+ XQueryParser.p_GeneralComp_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_GeneralComp_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:874:1: p_GeneralComp : (o= EQUAL | o= NOTEQUAL | o= SMALLER | o= SMALLEREQ | o= GREATER | o= GREATEREQ ) ;
+ // $ANTLR start "p_GeneralComp"
+ p_GeneralComp: function() {
+ var retval = new XQueryParser.p_GeneralComp_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var o = null;
+
+ var o_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:875:9: ( (o= EQUAL | o= NOTEQUAL | o= SMALLER | o= SMALLEREQ | o= GREATER | o= GREATEREQ ) )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:875:11: (o= EQUAL | o= NOTEQUAL | o= SMALLER | o= SMALLEREQ | o= GREATER | o= GREATEREQ )
+ root_0 = this.adaptor.nil();
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:875:11: (o= EQUAL | o= NOTEQUAL | o= SMALLER | o= SMALLEREQ | o= GREATER | o= GREATEREQ )
+ var alt112=6;
+ switch ( this.input.LA(1) ) {
+ case EQUAL:
+ alt112=1;
+ break;
+ case NOTEQUAL:
+ alt112=2;
+ break;
+ case SMALLER:
+ alt112=3;
+ break;
+ case SMALLEREQ:
+ alt112=4;
+ break;
+ case GREATER:
+ alt112=5;
+ break;
+ case GREATEREQ:
+ alt112=6;
+ break;
+ default:
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 112, 0, this.input);
+
+ throw nvae;
+ }
+
+ switch (alt112) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:875:12: o= EQUAL
+ o=this.match(this.input,EQUAL,XQueryParser.FOLLOW_EQUAL_in_p_GeneralComp6305); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ o_tree = this.adaptor.create(o);
+ this.adaptor.addChild(root_0, o_tree);
+ }
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:875:22: o= NOTEQUAL
+ o=this.match(this.input,NOTEQUAL,XQueryParser.FOLLOW_NOTEQUAL_in_p_GeneralComp6311); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ o_tree = this.adaptor.create(o);
+ this.adaptor.addChild(root_0, o_tree);
+ }
+
+
+ break;
+ case 3 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:875:35: o= SMALLER
+ o=this.match(this.input,SMALLER,XQueryParser.FOLLOW_SMALLER_in_p_GeneralComp6317); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ o_tree = this.adaptor.create(o);
+ this.adaptor.addChild(root_0, o_tree);
+ }
+
+
+ break;
+ case 4 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:875:47: o= SMALLEREQ
+ o=this.match(this.input,SMALLEREQ,XQueryParser.FOLLOW_SMALLEREQ_in_p_GeneralComp6323); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ o_tree = this.adaptor.create(o);
+ this.adaptor.addChild(root_0, o_tree);
+ }
+
+
+ break;
+ case 5 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:875:61: o= GREATER
+ o=this.match(this.input,GREATER,XQueryParser.FOLLOW_GREATER_in_p_GeneralComp6329); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ o_tree = this.adaptor.create(o);
+ this.adaptor.addChild(root_0, o_tree);
+ }
+
+
+ break;
+ case 6 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:875:73: o= GREATEREQ
+ o=this.match(this.input,GREATEREQ,XQueryParser.FOLLOW_GREATEREQ_in_p_GeneralComp6335); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ o_tree = this.adaptor.create(o);
+ this.adaptor.addChild(root_0, o_tree);
+ }
+
+
+ break;
+
+ }
+
+ if ( this.state.backtracking===0 ) {
+ this.ao(o);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_ValueComp_return: (function() {
+ XQueryParser.p_ValueComp_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_ValueComp_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:879:1: p_ValueComp : (k= EQ | k= NE | k= LT | k= LE | k= GT | k= GE ) ;
+ // $ANTLR start "p_ValueComp"
+ p_ValueComp: function() {
+ var retval = new XQueryParser.p_ValueComp_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:880:9: ( (k= EQ | k= NE | k= LT | k= LE | k= GT | k= GE ) )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:880:11: (k= EQ | k= NE | k= LT | k= LE | k= GT | k= GE )
+ root_0 = this.adaptor.nil();
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:880:11: (k= EQ | k= NE | k= LT | k= LE | k= GT | k= GE )
+ var alt113=6;
+ switch ( this.input.LA(1) ) {
+ case EQ:
+ alt113=1;
+ break;
+ case NE:
+ alt113=2;
+ break;
+ case LT:
+ alt113=3;
+ break;
+ case LE:
+ alt113=4;
+ break;
+ case GT:
+ alt113=5;
+ break;
+ case GE:
+ alt113=6;
+ break;
+ default:
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 113, 0, this.input);
+
+ throw nvae;
+ }
+
+ switch (alt113) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:880:12: k= EQ
+ k=this.match(this.input,EQ,XQueryParser.FOLLOW_EQ_in_p_ValueComp6367); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:880:19: k= NE
+ k=this.match(this.input,NE,XQueryParser.FOLLOW_NE_in_p_ValueComp6373); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+
+
+ break;
+ case 3 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:880:26: k= LT
+ k=this.match(this.input,LT,XQueryParser.FOLLOW_LT_in_p_ValueComp6379); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+
+
+ break;
+ case 4 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:880:33: k= LE
+ k=this.match(this.input,LE,XQueryParser.FOLLOW_LE_in_p_ValueComp6385); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+
+
+ break;
+ case 5 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:880:40: k= GT
+ k=this.match(this.input,GT,XQueryParser.FOLLOW_GT_in_p_ValueComp6391); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+
+
+ break;
+ case 6 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:880:47: k= GE
+ k=this.match(this.input,GE,XQueryParser.FOLLOW_GE_in_p_ValueComp6397); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+
+
+ break;
+
+ }
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_NodeComp_return: (function() {
+ XQueryParser.p_NodeComp_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_NodeComp_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:884:1: p_NodeComp : (k= IS | SMALLER_SMALLER | GREATER_GREATER );
+ // $ANTLR start "p_NodeComp"
+ p_NodeComp: function() {
+ var retval = new XQueryParser.p_NodeComp_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var SMALLER_SMALLER243 = null;
+ var GREATER_GREATER244 = null;
+
+ var k_tree=null;
+ var SMALLER_SMALLER243_tree=null;
+ var GREATER_GREATER244_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:885:9: (k= IS | SMALLER_SMALLER | GREATER_GREATER )
+ var alt114=3;
+ switch ( this.input.LA(1) ) {
+ case IS:
+ alt114=1;
+ break;
+ case SMALLER_SMALLER:
+ alt114=2;
+ break;
+ case GREATER_GREATER:
+ alt114=3;
+ break;
+ default:
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 114, 0, this.input);
+
+ throw nvae;
+ }
+
+ switch (alt114) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:885:11: k= IS
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,IS,XQueryParser.FOLLOW_IS_in_p_NodeComp6428); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:885:33: SMALLER_SMALLER
+ root_0 = this.adaptor.nil();
+
+ SMALLER_SMALLER243=this.match(this.input,SMALLER_SMALLER,XQueryParser.FOLLOW_SMALLER_SMALLER_in_p_NodeComp6434); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ SMALLER_SMALLER243_tree = this.adaptor.create(SMALLER_SMALLER243);
+ this.adaptor.addChild(root_0, SMALLER_SMALLER243_tree);
+ }
+
+
+ break;
+ case 3 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:885:51: GREATER_GREATER
+ root_0 = this.adaptor.nil();
+
+ GREATER_GREATER244=this.match(this.input,GREATER_GREATER,XQueryParser.FOLLOW_GREATER_GREATER_in_p_NodeComp6438); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ GREATER_GREATER244_tree = this.adaptor.create(GREATER_GREATER244);
+ this.adaptor.addChild(root_0, GREATER_GREATER244_tree);
+ }
+
+
+ break;
+
+ }
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_ValidateExpr_return: (function() {
+ XQueryParser.p_ValidateExpr_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_ValidateExpr_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:889:1: p_ValidateExpr : k= VALIDATE ( p_ValidationMode | k= TYPE p_TypeName )? LBRACKET p_Expr[true,true] RBRACKET ;
+ // $ANTLR start "p_ValidateExpr"
+ p_ValidateExpr: function() {
+ var retval = new XQueryParser.p_ValidateExpr_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var LBRACKET247 = null;
+ var RBRACKET249 = null;
+ var p_ValidationMode245 = null;
+ var p_TypeName246 = null;
+ var p_Expr248 = null;
+
+ var k_tree=null;
+ var LBRACKET247_tree=null;
+ var RBRACKET249_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:890:9: (k= VALIDATE ( p_ValidationMode | k= TYPE p_TypeName )? LBRACKET p_Expr[true,true] RBRACKET )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:890:11: k= VALIDATE ( p_ValidationMode | k= TYPE p_TypeName )? LBRACKET p_Expr[true,true] RBRACKET
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,VALIDATE,XQueryParser.FOLLOW_VALIDATE_in_p_ValidateExpr6466); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:890:37: ( p_ValidationMode | k= TYPE p_TypeName )?
+ var alt115=3;
+ var LA115_0 = this.input.LA(1);
+
+ if ( (LA115_0==LAX||LA115_0==STRICT) ) {
+ alt115=1;
+ }
+ else if ( (LA115_0==TYPE) ) {
+ alt115=2;
+ }
+ switch (alt115) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:890:39: p_ValidationMode
+ this.pushFollow(XQueryParser.FOLLOW_p_ValidationMode_in_p_ValidateExpr6472);
+ p_ValidationMode245=this.p_ValidationMode();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ValidationMode245.getTree());
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:890:58: k= TYPE p_TypeName
+ k=this.match(this.input,TYPE,XQueryParser.FOLLOW_TYPE_in_p_ValidateExpr6478); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_TypeName_in_p_ValidateExpr6482);
+ p_TypeName246=this.p_TypeName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_TypeName246.getTree());
+
+
+ break;
+
+ }
+
+ LBRACKET247=this.match(this.input,LBRACKET,XQueryParser.FOLLOW_LBRACKET_in_p_ValidateExpr6487); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LBRACKET247_tree = this.adaptor.create(LBRACKET247);
+ this.adaptor.addChild(root_0, LBRACKET247_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_Expr_in_p_ValidateExpr6489);
+ p_Expr248=this.p_Expr(true, true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Expr248.getTree());
+ RBRACKET249=this.match(this.input,RBRACKET,XQueryParser.FOLLOW_RBRACKET_in_p_ValidateExpr6492); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RBRACKET249_tree = this.adaptor.create(RBRACKET249);
+ this.adaptor.addChild(root_0, RBRACKET249_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_ValidationMode_return: (function() {
+ XQueryParser.p_ValidationMode_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_ValidationMode_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:894:1: p_ValidationMode : (k= LAX | k= STRICT ) ;
+ // $ANTLR start "p_ValidationMode"
+ p_ValidationMode: function() {
+ var retval = new XQueryParser.p_ValidationMode_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:895:9: ( (k= LAX | k= STRICT ) )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:895:11: (k= LAX | k= STRICT )
+ root_0 = this.adaptor.nil();
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:895:11: (k= LAX | k= STRICT )
+ var alt116=2;
+ var LA116_0 = this.input.LA(1);
+
+ if ( (LA116_0==LAX) ) {
+ alt116=1;
+ }
+ else if ( (LA116_0==STRICT) ) {
+ alt116=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 116, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt116) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:895:12: k= LAX
+ k=this.match(this.input,LAX,XQueryParser.FOLLOW_LAX_in_p_ValidationMode6521); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:895:20: k= STRICT
+ k=this.match(this.input,STRICT,XQueryParser.FOLLOW_STRICT_in_p_ValidationMode6527); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+
+
+ break;
+
+ }
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_ExtensionExpr_return: (function() {
+ XQueryParser.p_ExtensionExpr_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_ExtensionExpr_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:899:1: p_ExtensionExpr : ( L_Pragma )+ LBRACKET ( p_Expr[true,true] )? RBRACKET ;
+ // $ANTLR start "p_ExtensionExpr"
+ p_ExtensionExpr: function() {
+ var retval = new XQueryParser.p_ExtensionExpr_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var L_Pragma250 = null;
+ var LBRACKET251 = null;
+ var RBRACKET253 = null;
+ var p_Expr252 = null;
+
+ var L_Pragma250_tree=null;
+ var LBRACKET251_tree=null;
+ var RBRACKET253_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:900:9: ( ( L_Pragma )+ LBRACKET ( p_Expr[true,true] )? RBRACKET )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:900:11: ( L_Pragma )+ LBRACKET ( p_Expr[true,true] )? RBRACKET
+ root_0 = this.adaptor.nil();
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:900:11: ( L_Pragma )+
+ var cnt117=0;
+ loop117:
+ do {
+ var alt117=2;
+ var LA117_0 = this.input.LA(1);
+
+ if ( (LA117_0==L_Pragma) ) {
+ alt117=1;
+ }
+
+
+ switch (alt117) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:900:11: L_Pragma
+ L_Pragma250=this.match(this.input,L_Pragma,XQueryParser.FOLLOW_L_Pragma_in_p_ExtensionExpr6556); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ L_Pragma250_tree = this.adaptor.create(L_Pragma250);
+ this.adaptor.addChild(root_0, L_Pragma250_tree);
+ }
+
+
+ break;
+
+ default :
+ if ( cnt117 >= 1 ) {
+ break loop117;
+ }
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var eee = new org.antlr.runtime.EarlyExitException(117, this.input);
+ throw eee;
+ }
+ cnt117++;
+ } while (true);
+
+ LBRACKET251=this.match(this.input,LBRACKET,XQueryParser.FOLLOW_LBRACKET_in_p_ExtensionExpr6559); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LBRACKET251_tree = this.adaptor.create(LBRACKET251);
+ this.adaptor.addChild(root_0, LBRACKET251_tree);
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:900:30: ( p_Expr[true,true] )?
+ var alt118=2;
+ var LA118_0 = this.input.LA(1);
+
+ if ( ((LA118_0>=ANCESTOR && LA118_0<=QUOT_ER)||LA118_0==LPAREN||(LA118_0>=DOLLAR && LA118_0<=L_UNION_BRACKET)||LA118_0==LBRACKET||LA118_0==LSQUARE||(LA118_0>=STAR && LA118_0<=SMALLER)||(LA118_0>=SLASH && LA118_0<=SLASH_SLASH)||(LA118_0>=DOT && LA118_0<=DOT_DOT)||(LA118_0>=ATTR_SIGN && LA118_0<=Q)||(LA118_0>=APOS && LA118_0<=QUOT)||LA118_0==L_NCName||(LA118_0>=L_Pragma && LA118_0<=L_DoubleLiteral)) ) {
+ alt118=1;
+ }
+ switch (alt118) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:900:30: p_Expr[true,true]
+ this.pushFollow(XQueryParser.FOLLOW_p_Expr_in_p_ExtensionExpr6561);
+ p_Expr252=this.p_Expr(true, true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Expr252.getTree());
+
+
+ break;
+
+ }
+
+ RBRACKET253=this.match(this.input,RBRACKET,XQueryParser.FOLLOW_RBRACKET_in_p_ExtensionExpr6565); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RBRACKET253_tree = this.adaptor.create(RBRACKET253);
+ this.adaptor.addChild(root_0, RBRACKET253_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_PathExpr_return: (function() {
+ XQueryParser.p_PathExpr_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_PathExpr_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:912:1: p_PathExpr : ( ( SLASH p_RelativePathExpr )=> ( SLASH p_RelativePathExpr ) | SLASH | SLASH_SLASH p_RelativePathExpr | p_RelativePathExpr );
+ // $ANTLR start "p_PathExpr"
+ p_PathExpr: function() {
+ var retval = new XQueryParser.p_PathExpr_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var SLASH254 = null;
+ var SLASH256 = null;
+ var SLASH_SLASH257 = null;
+ var p_RelativePathExpr255 = null;
+ var p_RelativePathExpr258 = null;
+ var p_RelativePathExpr259 = null;
+
+ var SLASH254_tree=null;
+ var SLASH256_tree=null;
+ var SLASH_SLASH257_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:913:9: ( ( SLASH p_RelativePathExpr )=> ( SLASH p_RelativePathExpr ) | SLASH | SLASH_SLASH p_RelativePathExpr | p_RelativePathExpr )
+ var alt119=4;
+ alt119 = this.dfa119.predict(this.input);
+ switch (alt119) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:913:11: ( SLASH p_RelativePathExpr )=> ( SLASH p_RelativePathExpr )
+ root_0 = this.adaptor.nil();
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:913:41: ( SLASH p_RelativePathExpr )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:913:42: SLASH p_RelativePathExpr
+ SLASH254=this.match(this.input,SLASH,XQueryParser.FOLLOW_SLASH_in_p_PathExpr6608); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ SLASH254_tree = this.adaptor.create(SLASH254);
+ this.adaptor.addChild(root_0, SLASH254_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_RelativePathExpr_in_p_PathExpr6610);
+ p_RelativePathExpr255=this.p_RelativePathExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_RelativePathExpr255.getTree());
+
+
+
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:914:11: SLASH
+ root_0 = this.adaptor.nil();
+
+ SLASH256=this.match(this.input,SLASH,XQueryParser.FOLLOW_SLASH_in_p_PathExpr6623); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ SLASH256_tree = this.adaptor.create(SLASH256);
+ this.adaptor.addChild(root_0, SLASH256_tree);
+ }
+
+
+ break;
+ case 3 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:915:11: SLASH_SLASH p_RelativePathExpr
+ root_0 = this.adaptor.nil();
+
+ SLASH_SLASH257=this.match(this.input,SLASH_SLASH,XQueryParser.FOLLOW_SLASH_SLASH_in_p_PathExpr6635); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ SLASH_SLASH257_tree = this.adaptor.create(SLASH_SLASH257);
+ this.adaptor.addChild(root_0, SLASH_SLASH257_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_RelativePathExpr_in_p_PathExpr6637);
+ p_RelativePathExpr258=this.p_RelativePathExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_RelativePathExpr258.getTree());
+
+
+ break;
+ case 4 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:916:11: p_RelativePathExpr
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_RelativePathExpr_in_p_PathExpr6649);
+ p_RelativePathExpr259=this.p_RelativePathExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_RelativePathExpr259.getTree());
+
+
+ break;
+
+ }
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_RelativePathExpr_return: (function() {
+ XQueryParser.p_RelativePathExpr_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_RelativePathExpr_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:920:1: p_RelativePathExpr : p_StepExpr ( ( SLASH | SLASH_SLASH ) p_StepExpr )* ;
+ // $ANTLR start "p_RelativePathExpr"
+ p_RelativePathExpr: function() {
+ var retval = new XQueryParser.p_RelativePathExpr_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var set261 = null;
+ var p_StepExpr260 = null;
+ var p_StepExpr262 = null;
+
+ var set261_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:921:9: ( p_StepExpr ( ( SLASH | SLASH_SLASH ) p_StepExpr )* )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:921:11: p_StepExpr ( ( SLASH | SLASH_SLASH ) p_StepExpr )*
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_StepExpr_in_p_RelativePathExpr6677);
+ p_StepExpr260=this.p_StepExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_StepExpr260.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:921:22: ( ( SLASH | SLASH_SLASH ) p_StepExpr )*
+ loop120:
+ do {
+ var alt120=2;
+ var LA120_0 = this.input.LA(1);
+
+ if ( ((LA120_0>=SLASH && LA120_0<=SLASH_SLASH)) ) {
+ alt120=1;
+ }
+
+
+ switch (alt120) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:921:23: ( SLASH | SLASH_SLASH ) p_StepExpr
+ set261=this.input.LT(1);
+ if ( (this.input.LA(1)>=SLASH && this.input.LA(1)<=SLASH_SLASH) ) {
+ this.input.consume();
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, this.adaptor.create(set261));
+ this.state.errorRecovery=false;this.state.failed=false;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
+ throw mse;
+ }
+
+ this.pushFollow(XQueryParser.FOLLOW_p_StepExpr_in_p_RelativePathExpr6688);
+ p_StepExpr262=this.p_StepExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_StepExpr262.getTree());
+
+
+ break;
+
+ default :
+ break loop120;
+ }
+ } while (true);
+
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_StepExpr_return: (function() {
+ XQueryParser.p_StepExpr_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_StepExpr_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:925:1: p_StepExpr : ( ( LBRACKET | LPAREN | SMALLER | QUOT | APOS | DOLLAR )=> p_PostfixExpr | ( ( ( ELEMENT | ATTRIBUTE ) ( p_EQName )? LBRACKET ) | ( ( NAMESPACE | PROCESSING_INSTRUCTION ) ( p_NCName )? LBRACKET ) | ( ( DOCUMENT | TEXT | COMMENT ) LBRACKET ) )=> p_PostfixExpr | ( p_KindTest )=> p_AxisStep | ( p_EQName LPAREN )=> p_PostfixExpr | ( p_PrimaryExpr )=> p_PostfixExpr | p_AxisStep );
+ // $ANTLR start "p_StepExpr"
+ p_StepExpr: function() {
+ var retval = new XQueryParser.p_StepExpr_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_PostfixExpr263 = null;
+ var p_PostfixExpr264 = null;
+ var p_AxisStep265 = null;
+ var p_PostfixExpr266 = null;
+ var p_PostfixExpr267 = null;
+ var p_AxisStep268 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:926:9: ( ( LBRACKET | LPAREN | SMALLER | QUOT | APOS | DOLLAR )=> p_PostfixExpr | ( ( ( ELEMENT | ATTRIBUTE ) ( p_EQName )? LBRACKET ) | ( ( NAMESPACE | PROCESSING_INSTRUCTION ) ( p_NCName )? LBRACKET ) | ( ( DOCUMENT | TEXT | COMMENT ) LBRACKET ) )=> p_PostfixExpr | ( p_KindTest )=> p_AxisStep | ( p_EQName LPAREN )=> p_PostfixExpr | ( p_PrimaryExpr )=> p_PostfixExpr | p_AxisStep )
+ var alt121=6;
+ alt121 = this.dfa121.predict(this.input);
+ switch (alt121) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:926:11: ( LBRACKET | LPAREN | SMALLER | QUOT | APOS | DOLLAR )=> p_PostfixExpr
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_PostfixExpr_in_p_StepExpr6742);
+ p_PostfixExpr263=this.p_PostfixExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_PostfixExpr263.getTree());
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:927:11: ( ( ( ELEMENT | ATTRIBUTE ) ( p_EQName )? LBRACKET ) | ( ( NAMESPACE | PROCESSING_INSTRUCTION ) ( p_NCName )? LBRACKET ) | ( ( DOCUMENT | TEXT | COMMENT ) LBRACKET ) )=> p_PostfixExpr
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_PostfixExpr_in_p_StepExpr6856);
+ p_PostfixExpr264=this.p_PostfixExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_PostfixExpr264.getTree());
+
+
+ break;
+ case 3 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:932:11: ( p_KindTest )=> p_AxisStep
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_AxisStep_in_p_StepExpr6874);
+ p_AxisStep265=this.p_AxisStep();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_AxisStep265.getTree());
+
+
+ break;
+ case 4 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:933:11: ( p_EQName LPAREN )=> p_PostfixExpr
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_PostfixExpr_in_p_StepExpr6895);
+ p_PostfixExpr266=this.p_PostfixExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_PostfixExpr266.getTree());
+
+
+ break;
+ case 5 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:934:11: ( p_PrimaryExpr )=> p_PostfixExpr
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_PostfixExpr_in_p_StepExpr6913);
+ p_PostfixExpr267=this.p_PostfixExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_PostfixExpr267.getTree());
+
+
+ break;
+ case 6 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:935:11: p_AxisStep
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_AxisStep_in_p_StepExpr6925);
+ p_AxisStep268=this.p_AxisStep();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_AxisStep268.getTree());
+
+
+ break;
+
+ }
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_AxisStep_return: (function() {
+ XQueryParser.p_AxisStep_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_AxisStep_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:939:1: p_AxisStep : ( p_ReverseStep | p_ForwardStep ) p_PredicateList ;
+ // $ANTLR start "p_AxisStep"
+ p_AxisStep: function() {
+ var retval = new XQueryParser.p_AxisStep_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_ReverseStep269 = null;
+ var p_ForwardStep270 = null;
+ var p_PredicateList271 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:940:9: ( ( p_ReverseStep | p_ForwardStep ) p_PredicateList )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:940:11: ( p_ReverseStep | p_ForwardStep ) p_PredicateList
+ root_0 = this.adaptor.nil();
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:940:11: ( p_ReverseStep | p_ForwardStep )
+ var alt122=2;
+ switch ( this.input.LA(1) ) {
+ case PARENT:
+ var LA122_1 = this.input.LA(2);
+
+ if ( (LA122_1==COLON_COLON) ) {
+ alt122=1;
+ }
+ else if ( (LA122_1==EOF||(LA122_1>=AND && LA122_1<=AT)||(LA122_1>=BY && LA122_1<=CASTABLE)||LA122_1==COLLATION||LA122_1==DEFAULT||(LA122_1>=DESCENDING && LA122_1<=DIV)||LA122_1==EMPTY||LA122_1==EQ||LA122_1==EXCEPT||LA122_1==FOR||LA122_1==GE||(LA122_1>=GT && LA122_1<=IDIV)||(LA122_1>=INSTANCE && LA122_1<=IS)||LA122_1==LE||(LA122_1>=LET && LA122_1<=MOD)||LA122_1==NE||(LA122_1>=OR && LA122_1<=ORDER)||(LA122_1>=RETURN && LA122_1<=SATISFIES)||LA122_1==STABLE||(LA122_1>=TO && LA122_1<=TREAT)||LA122_1==UNION||LA122_1==WHERE||LA122_1==COUNT||(LA122_1>=END && LA122_1<=GROUP)||LA122_1==ONLY||LA122_1==START||(LA122_1>=AFTER && LA122_1<=BEFORE)||LA122_1==INTO||LA122_1==MODIFY||LA122_1==WITH||LA122_1==CONTAINS||LA122_1==PARAGRAPHS||LA122_1==SENTENCES||LA122_1==TIMES||LA122_1==WORDS||LA122_1==CONCAT||LA122_1==RPAREN||LA122_1==R_UNION_BRACKET||(LA122_1>=RBRACKET && LA122_1<=EQUAL)||LA122_1==NOTEQUAL||LA122_1==COMMA||(LA122_1>=STAR && LA122_1<=BANG)||LA122_1==COLON||(LA122_1>=SEMICOLON && LA122_1<=VBAR)) ) {
+ alt122=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 122, 1, this.input);
+
+ throw nvae;
+ }
+ break;
+ case ANCESTOR:
+ var LA122_2 = this.input.LA(2);
+
+ if ( (LA122_2==COLON_COLON) ) {
+ alt122=1;
+ }
+ else if ( (LA122_2==EOF||(LA122_2>=AND && LA122_2<=AT)||(LA122_2>=BY && LA122_2<=CASTABLE)||LA122_2==COLLATION||LA122_2==DEFAULT||(LA122_2>=DESCENDING && LA122_2<=DIV)||LA122_2==EMPTY||LA122_2==EQ||LA122_2==EXCEPT||LA122_2==FOR||LA122_2==GE||(LA122_2>=GT && LA122_2<=IDIV)||(LA122_2>=INSTANCE && LA122_2<=IS)||LA122_2==LE||(LA122_2>=LET && LA122_2<=MOD)||LA122_2==NE||(LA122_2>=OR && LA122_2<=ORDER)||(LA122_2>=RETURN && LA122_2<=SATISFIES)||LA122_2==STABLE||(LA122_2>=TO && LA122_2<=TREAT)||LA122_2==UNION||LA122_2==WHERE||LA122_2==COUNT||(LA122_2>=END && LA122_2<=GROUP)||LA122_2==ONLY||LA122_2==START||(LA122_2>=AFTER && LA122_2<=BEFORE)||LA122_2==INTO||LA122_2==MODIFY||LA122_2==WITH||LA122_2==CONTAINS||LA122_2==PARAGRAPHS||LA122_2==SENTENCES||LA122_2==TIMES||LA122_2==WORDS||LA122_2==CONCAT||LA122_2==RPAREN||LA122_2==R_UNION_BRACKET||(LA122_2>=RBRACKET && LA122_2<=EQUAL)||LA122_2==NOTEQUAL||LA122_2==COMMA||(LA122_2>=STAR && LA122_2<=BANG)||LA122_2==COLON||(LA122_2>=SEMICOLON && LA122_2<=VBAR)) ) {
+ alt122=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 122, 2, this.input);
+
+ throw nvae;
+ }
+ break;
+ case PRECEDING_SIBLING:
+ var LA122_3 = this.input.LA(2);
+
+ if ( (LA122_3==COLON_COLON) ) {
+ alt122=1;
+ }
+ else if ( (LA122_3==EOF||(LA122_3>=AND && LA122_3<=AT)||(LA122_3>=BY && LA122_3<=CASTABLE)||LA122_3==COLLATION||LA122_3==DEFAULT||(LA122_3>=DESCENDING && LA122_3<=DIV)||LA122_3==EMPTY||LA122_3==EQ||LA122_3==EXCEPT||LA122_3==FOR||LA122_3==GE||(LA122_3>=GT && LA122_3<=IDIV)||(LA122_3>=INSTANCE && LA122_3<=IS)||LA122_3==LE||(LA122_3>=LET && LA122_3<=MOD)||LA122_3==NE||(LA122_3>=OR && LA122_3<=ORDER)||(LA122_3>=RETURN && LA122_3<=SATISFIES)||LA122_3==STABLE||(LA122_3>=TO && LA122_3<=TREAT)||LA122_3==UNION||LA122_3==WHERE||LA122_3==COUNT||(LA122_3>=END && LA122_3<=GROUP)||LA122_3==ONLY||LA122_3==START||(LA122_3>=AFTER && LA122_3<=BEFORE)||LA122_3==INTO||LA122_3==MODIFY||LA122_3==WITH||LA122_3==CONTAINS||LA122_3==PARAGRAPHS||LA122_3==SENTENCES||LA122_3==TIMES||LA122_3==WORDS||LA122_3==CONCAT||LA122_3==RPAREN||LA122_3==R_UNION_BRACKET||(LA122_3>=RBRACKET && LA122_3<=EQUAL)||LA122_3==NOTEQUAL||LA122_3==COMMA||(LA122_3>=STAR && LA122_3<=BANG)||LA122_3==COLON||(LA122_3>=SEMICOLON && LA122_3<=VBAR)) ) {
+ alt122=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 122, 3, this.input);
+
+ throw nvae;
+ }
+ break;
+ case PRECEDING:
+ var LA122_4 = this.input.LA(2);
+
+ if ( (LA122_4==COLON_COLON) ) {
+ alt122=1;
+ }
+ else if ( (LA122_4==EOF||(LA122_4>=AND && LA122_4<=AT)||(LA122_4>=BY && LA122_4<=CASTABLE)||LA122_4==COLLATION||LA122_4==DEFAULT||(LA122_4>=DESCENDING && LA122_4<=DIV)||LA122_4==EMPTY||LA122_4==EQ||LA122_4==EXCEPT||LA122_4==FOR||LA122_4==GE||(LA122_4>=GT && LA122_4<=IDIV)||(LA122_4>=INSTANCE && LA122_4<=IS)||LA122_4==LE||(LA122_4>=LET && LA122_4<=MOD)||LA122_4==NE||(LA122_4>=OR && LA122_4<=ORDER)||(LA122_4>=RETURN && LA122_4<=SATISFIES)||LA122_4==STABLE||(LA122_4>=TO && LA122_4<=TREAT)||LA122_4==UNION||LA122_4==WHERE||LA122_4==COUNT||(LA122_4>=END && LA122_4<=GROUP)||LA122_4==ONLY||LA122_4==START||(LA122_4>=AFTER && LA122_4<=BEFORE)||LA122_4==INTO||LA122_4==MODIFY||LA122_4==WITH||LA122_4==CONTAINS||LA122_4==PARAGRAPHS||LA122_4==SENTENCES||LA122_4==TIMES||LA122_4==WORDS||LA122_4==CONCAT||LA122_4==RPAREN||LA122_4==R_UNION_BRACKET||(LA122_4>=RBRACKET && LA122_4<=EQUAL)||LA122_4==NOTEQUAL||LA122_4==COMMA||(LA122_4>=STAR && LA122_4<=BANG)||LA122_4==COLON||(LA122_4>=SEMICOLON && LA122_4<=VBAR)) ) {
+ alt122=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 122, 4, this.input);
+
+ throw nvae;
+ }
+ break;
+ case ANCESTOR_OR_SELF:
+ var LA122_5 = this.input.LA(2);
+
+ if ( (LA122_5==COLON_COLON) ) {
+ alt122=1;
+ }
+ else if ( (LA122_5==EOF||(LA122_5>=AND && LA122_5<=AT)||(LA122_5>=BY && LA122_5<=CASTABLE)||LA122_5==COLLATION||LA122_5==DEFAULT||(LA122_5>=DESCENDING && LA122_5<=DIV)||LA122_5==EMPTY||LA122_5==EQ||LA122_5==EXCEPT||LA122_5==FOR||LA122_5==GE||(LA122_5>=GT && LA122_5<=IDIV)||(LA122_5>=INSTANCE && LA122_5<=IS)||LA122_5==LE||(LA122_5>=LET && LA122_5<=MOD)||LA122_5==NE||(LA122_5>=OR && LA122_5<=ORDER)||(LA122_5>=RETURN && LA122_5<=SATISFIES)||LA122_5==STABLE||(LA122_5>=TO && LA122_5<=TREAT)||LA122_5==UNION||LA122_5==WHERE||LA122_5==COUNT||(LA122_5>=END && LA122_5<=GROUP)||LA122_5==ONLY||LA122_5==START||(LA122_5>=AFTER && LA122_5<=BEFORE)||LA122_5==INTO||LA122_5==MODIFY||LA122_5==WITH||LA122_5==CONTAINS||LA122_5==PARAGRAPHS||LA122_5==SENTENCES||LA122_5==TIMES||LA122_5==WORDS||LA122_5==CONCAT||LA122_5==RPAREN||LA122_5==R_UNION_BRACKET||(LA122_5>=RBRACKET && LA122_5<=EQUAL)||LA122_5==NOTEQUAL||LA122_5==COMMA||(LA122_5>=STAR && LA122_5<=BANG)||LA122_5==COLON||(LA122_5>=SEMICOLON && LA122_5<=VBAR)) ) {
+ alt122=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 122, 5, this.input);
+
+ throw nvae;
+ }
+ break;
+ case DOT_DOT:
+ alt122=1;
+ break;
+ case AND:
+ case AS:
+ case ASCENDING:
+ case AT:
+ case ATTRIBUTE:
+ case BASE_URI:
+ case BOUNDARY_SPACE:
+ case BY:
+ case CASE:
+ case CAST:
+ case CASTABLE:
+ case CHILD:
+ case COLLATION:
+ case COMMENT:
+ case CONSTRUCTION:
+ case COPY_NAMESPACES:
+ case DECLARE:
+ case DEFAULT:
+ case DESCENDANT:
+ case DESCENDANT_OR_SELF:
+ case DESCENDING:
+ case DIV:
+ case DOCUMENT:
+ case DOCUMENT_NODE:
+ case ELEMENT:
+ case ELSE:
+ case EMPTY:
+ case EMPTY_SEQUENCE:
+ case ENCODING:
+ case EQ:
+ case EVERY:
+ case EXCEPT:
+ case EXTERNAL:
+ case FOLLOWING:
+ case FOLLOWING_SIBLING:
+ case FOR:
+ case FUNCTION:
+ case GE:
+ case GREATEST:
+ case GT:
+ case IDIV:
+ case IF:
+ case IMPORT:
+ case IN:
+ case INHERIT:
+ case INSTANCE:
+ case INTERSECT:
+ case IS:
+ case ITEM:
+ case LAX:
+ case LE:
+ case LEAST:
+ case LET:
+ case LT:
+ case MOD:
+ case MODULE:
+ case NAMESPACE:
+ case NE:
+ case NO_INHERIT:
+ case NO_PRESERVE:
+ case NODE:
+ case JSON:
+ case OF:
+ case OPTION:
+ case OR:
+ case ORDER:
+ case ORDERED:
+ case ORDERING:
+ case PRESERVE:
+ case PROCESSING_INSTRUCTION:
+ case STRUCTURED_ITEM:
+ case JSON_ITEM:
+ case OBJECT:
+ case ARRAY:
+ case RETURN:
+ case SATISFIES:
+ case SCHEMA:
+ case SCHEMA_ATTRIBUTE:
+ case SCHEMA_ELEMENT:
+ case SELF:
+ case SOME:
+ case STABLE:
+ case STRICT:
+ case STRIP:
+ case TEXT:
+ case THEN:
+ case TO:
+ case TREAT:
+ case TYPESWITCH:
+ case UNION:
+ case UNORDERED:
+ case VALIDATE:
+ case VARIABLE:
+ case VERSION:
+ case WHERE:
+ case XQUERY:
+ case ALLOWING:
+ case CATCH:
+ case CONTEXT:
+ case COUNT:
+ case DECIMAL_FORMAT:
+ case DECIMAL_SEPARATOR:
+ case DIGIT:
+ case END:
+ case GROUP:
+ case GROUPING_SEPARATOR:
+ case INFINITY:
+ case MINUS_SIGN:
+ case NAMESPACE_NODE:
+ case NAN:
+ case NEXT:
+ case ONLY:
+ case PATTERN_SEPARATOR:
+ case PERCENT:
+ case PER_MILLE:
+ case PREVIOUS:
+ case SLIDING:
+ case START:
+ case SWITCH:
+ case TRY:
+ case TUMBLING:
+ case TYPE:
+ case WHEN:
+ case WINDOW:
+ case ZERO_DIGIT:
+ case AFTER:
+ case BEFORE:
+ case COPY:
+ case DELETE:
+ case FIRST:
+ case INSERT:
+ case INTO:
+ case POSITION:
+ case APPEND:
+ case LAST:
+ case MODIFY:
+ case NODES:
+ case RENAME:
+ case REPLACE:
+ case REVALIDATION:
+ case SKIP:
+ case VALUE:
+ case WITH:
+ case ALL:
+ case ANY:
+ case CONTAINS:
+ case CONTENT:
+ case DIACRITICS:
+ case DIFFERENT:
+ case DISTANCE:
+ case ENTIRE:
+ case EXACTLY:
+ case FROM:
+ case FT_OPTION:
+ case FTAND:
+ case FTNOT:
+ case FTOR:
+ case INSENSITIVE:
+ case LANGUAGE:
+ case LEVELS:
+ case LOWERCASE:
+ case MOST:
+ case NO:
+ case NOT:
+ case OCCURS:
+ case PARAGRAPH:
+ case PARAGRAPHS:
+ case PHRASE:
+ case RELATIONSHIP:
+ case SAME:
+ case SCORE:
+ case SENSITIVE:
+ case SENTENCE:
+ case SENTENCES:
+ case STEMMING:
+ case STOP:
+ case THESAURUS:
+ case TIMES:
+ case UPPERCASE:
+ case USING:
+ case WEIGHT:
+ case WILDCARDS:
+ case WITHOUT:
+ case WORD:
+ case WORDS:
+ case BREAK:
+ case CONTINUE:
+ case EXIT:
+ case LOOP:
+ case RETURNING:
+ case WHILE:
+ case CHECK:
+ case COLLECTION:
+ case CONSTRAINT:
+ case FOREACH:
+ case FOREIGN:
+ case INDEX:
+ case INTEGRITY:
+ case KEY:
+ case ON:
+ case UNIQUE:
+ case AMP_ER:
+ case APOS_ER:
+ case QUOT_ER:
+ case STAR:
+ case ATTR_SIGN:
+ case Q:
+ case L_NCName:
+ alt122=2;
+ break;
+ default:
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 122, 0, this.input);
+
+ throw nvae;
+ }
+
+ switch (alt122) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:940:12: p_ReverseStep
+ this.pushFollow(XQueryParser.FOLLOW_p_ReverseStep_in_p_AxisStep6952);
+ p_ReverseStep269=this.p_ReverseStep();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ReverseStep269.getTree());
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:940:28: p_ForwardStep
+ this.pushFollow(XQueryParser.FOLLOW_p_ForwardStep_in_p_AxisStep6956);
+ p_ForwardStep270=this.p_ForwardStep();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ForwardStep270.getTree());
+
+
+ break;
+
+ }
+
+ this.pushFollow(XQueryParser.FOLLOW_p_PredicateList_in_p_AxisStep6959);
+ p_PredicateList271=this.p_PredicateList();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_PredicateList271.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_ForwardStep_return: (function() {
+ XQueryParser.p_ForwardStep_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_ForwardStep_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:944:1: p_ForwardStep : ( p_ForwardAxis p_NodeTest | p_AbbrevForwardStep );
+ // $ANTLR start "p_ForwardStep"
+ p_ForwardStep: function() {
+ var retval = new XQueryParser.p_ForwardStep_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_ForwardAxis272 = null;
+ var p_NodeTest273 = null;
+ var p_AbbrevForwardStep274 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:945:9: ( p_ForwardAxis p_NodeTest | p_AbbrevForwardStep )
+ var alt123=2;
+ alt123 = this.dfa123.predict(this.input);
+ switch (alt123) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:945:11: p_ForwardAxis p_NodeTest
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_ForwardAxis_in_p_ForwardStep6985);
+ p_ForwardAxis272=this.p_ForwardAxis();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ForwardAxis272.getTree());
+ this.pushFollow(XQueryParser.FOLLOW_p_NodeTest_in_p_ForwardStep6987);
+ p_NodeTest273=this.p_NodeTest();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_NodeTest273.getTree());
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:946:11: p_AbbrevForwardStep
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_AbbrevForwardStep_in_p_ForwardStep6999);
+ p_AbbrevForwardStep274=this.p_AbbrevForwardStep();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_AbbrevForwardStep274.getTree());
+
+
+ break;
+
+ }
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_ForwardAxis_return: (function() {
+ XQueryParser.p_ForwardAxis_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_ForwardAxis_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:950:1: p_ForwardAxis : ( CHILD COLON_COLON | DESCENDANT COLON_COLON | ATTRIBUTE COLON_COLON | SELF COLON_COLON | DESCENDANT_OR_SELF COLON_COLON | FOLLOWING_SIBLING COLON_COLON | FOLLOWING COLON_COLON );
+ // $ANTLR start "p_ForwardAxis"
+ p_ForwardAxis: function() {
+ var retval = new XQueryParser.p_ForwardAxis_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var CHILD275 = null;
+ var COLON_COLON276 = null;
+ var DESCENDANT277 = null;
+ var COLON_COLON278 = null;
+ var ATTRIBUTE279 = null;
+ var COLON_COLON280 = null;
+ var SELF281 = null;
+ var COLON_COLON282 = null;
+ var DESCENDANT_OR_SELF283 = null;
+ var COLON_COLON284 = null;
+ var FOLLOWING_SIBLING285 = null;
+ var COLON_COLON286 = null;
+ var FOLLOWING287 = null;
+ var COLON_COLON288 = null;
+
+ var CHILD275_tree=null;
+ var COLON_COLON276_tree=null;
+ var DESCENDANT277_tree=null;
+ var COLON_COLON278_tree=null;
+ var ATTRIBUTE279_tree=null;
+ var COLON_COLON280_tree=null;
+ var SELF281_tree=null;
+ var COLON_COLON282_tree=null;
+ var DESCENDANT_OR_SELF283_tree=null;
+ var COLON_COLON284_tree=null;
+ var FOLLOWING_SIBLING285_tree=null;
+ var COLON_COLON286_tree=null;
+ var FOLLOWING287_tree=null;
+ var COLON_COLON288_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:951:9: ( CHILD COLON_COLON | DESCENDANT COLON_COLON | ATTRIBUTE COLON_COLON | SELF COLON_COLON | DESCENDANT_OR_SELF COLON_COLON | FOLLOWING_SIBLING COLON_COLON | FOLLOWING COLON_COLON )
+ var alt124=7;
+ switch ( this.input.LA(1) ) {
+ case CHILD:
+ alt124=1;
+ break;
+ case DESCENDANT:
+ alt124=2;
+ break;
+ case ATTRIBUTE:
+ alt124=3;
+ break;
+ case SELF:
+ alt124=4;
+ break;
+ case DESCENDANT_OR_SELF:
+ alt124=5;
+ break;
+ case FOLLOWING_SIBLING:
+ alt124=6;
+ break;
+ case FOLLOWING:
+ alt124=7;
+ break;
+ default:
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 124, 0, this.input);
+
+ throw nvae;
+ }
+
+ switch (alt124) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:951:11: CHILD COLON_COLON
+ root_0 = this.adaptor.nil();
+
+ CHILD275=this.match(this.input,CHILD,XQueryParser.FOLLOW_CHILD_in_p_ForwardAxis7025); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ CHILD275_tree = this.adaptor.create(CHILD275);
+ this.adaptor.addChild(root_0, CHILD275_tree);
+ }
+ COLON_COLON276=this.match(this.input,COLON_COLON,XQueryParser.FOLLOW_COLON_COLON_in_p_ForwardAxis7027); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ COLON_COLON276_tree = this.adaptor.create(COLON_COLON276);
+ this.adaptor.addChild(root_0, COLON_COLON276_tree);
+ }
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:952:11: DESCENDANT COLON_COLON
+ root_0 = this.adaptor.nil();
+
+ DESCENDANT277=this.match(this.input,DESCENDANT,XQueryParser.FOLLOW_DESCENDANT_in_p_ForwardAxis7039); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ DESCENDANT277_tree = this.adaptor.create(DESCENDANT277);
+ this.adaptor.addChild(root_0, DESCENDANT277_tree);
+ }
+ COLON_COLON278=this.match(this.input,COLON_COLON,XQueryParser.FOLLOW_COLON_COLON_in_p_ForwardAxis7041); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ COLON_COLON278_tree = this.adaptor.create(COLON_COLON278);
+ this.adaptor.addChild(root_0, COLON_COLON278_tree);
+ }
+
+
+ break;
+ case 3 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:953:11: ATTRIBUTE COLON_COLON
+ root_0 = this.adaptor.nil();
+
+ ATTRIBUTE279=this.match(this.input,ATTRIBUTE,XQueryParser.FOLLOW_ATTRIBUTE_in_p_ForwardAxis7053); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ ATTRIBUTE279_tree = this.adaptor.create(ATTRIBUTE279);
+ this.adaptor.addChild(root_0, ATTRIBUTE279_tree);
+ }
+ COLON_COLON280=this.match(this.input,COLON_COLON,XQueryParser.FOLLOW_COLON_COLON_in_p_ForwardAxis7055); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ COLON_COLON280_tree = this.adaptor.create(COLON_COLON280);
+ this.adaptor.addChild(root_0, COLON_COLON280_tree);
+ }
+
+
+ break;
+ case 4 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:954:11: SELF COLON_COLON
+ root_0 = this.adaptor.nil();
+
+ SELF281=this.match(this.input,SELF,XQueryParser.FOLLOW_SELF_in_p_ForwardAxis7067); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ SELF281_tree = this.adaptor.create(SELF281);
+ this.adaptor.addChild(root_0, SELF281_tree);
+ }
+ COLON_COLON282=this.match(this.input,COLON_COLON,XQueryParser.FOLLOW_COLON_COLON_in_p_ForwardAxis7069); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ COLON_COLON282_tree = this.adaptor.create(COLON_COLON282);
+ this.adaptor.addChild(root_0, COLON_COLON282_tree);
+ }
+
+
+ break;
+ case 5 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:955:11: DESCENDANT_OR_SELF COLON_COLON
+ root_0 = this.adaptor.nil();
+
+ DESCENDANT_OR_SELF283=this.match(this.input,DESCENDANT_OR_SELF,XQueryParser.FOLLOW_DESCENDANT_OR_SELF_in_p_ForwardAxis7081); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ DESCENDANT_OR_SELF283_tree = this.adaptor.create(DESCENDANT_OR_SELF283);
+ this.adaptor.addChild(root_0, DESCENDANT_OR_SELF283_tree);
+ }
+ COLON_COLON284=this.match(this.input,COLON_COLON,XQueryParser.FOLLOW_COLON_COLON_in_p_ForwardAxis7083); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ COLON_COLON284_tree = this.adaptor.create(COLON_COLON284);
+ this.adaptor.addChild(root_0, COLON_COLON284_tree);
+ }
+
+
+ break;
+ case 6 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:956:11: FOLLOWING_SIBLING COLON_COLON
+ root_0 = this.adaptor.nil();
+
+ FOLLOWING_SIBLING285=this.match(this.input,FOLLOWING_SIBLING,XQueryParser.FOLLOW_FOLLOWING_SIBLING_in_p_ForwardAxis7095); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ FOLLOWING_SIBLING285_tree = this.adaptor.create(FOLLOWING_SIBLING285);
+ this.adaptor.addChild(root_0, FOLLOWING_SIBLING285_tree);
+ }
+ COLON_COLON286=this.match(this.input,COLON_COLON,XQueryParser.FOLLOW_COLON_COLON_in_p_ForwardAxis7097); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ COLON_COLON286_tree = this.adaptor.create(COLON_COLON286);
+ this.adaptor.addChild(root_0, COLON_COLON286_tree);
+ }
+
+
+ break;
+ case 7 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:957:11: FOLLOWING COLON_COLON
+ root_0 = this.adaptor.nil();
+
+ FOLLOWING287=this.match(this.input,FOLLOWING,XQueryParser.FOLLOW_FOLLOWING_in_p_ForwardAxis7109); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ FOLLOWING287_tree = this.adaptor.create(FOLLOWING287);
+ this.adaptor.addChild(root_0, FOLLOWING287_tree);
+ }
+ COLON_COLON288=this.match(this.input,COLON_COLON,XQueryParser.FOLLOW_COLON_COLON_in_p_ForwardAxis7111); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ COLON_COLON288_tree = this.adaptor.create(COLON_COLON288);
+ this.adaptor.addChild(root_0, COLON_COLON288_tree);
+ }
+
+
+ break;
+
+ }
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_AbbrevForwardStep_return: (function() {
+ XQueryParser.p_AbbrevForwardStep_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_AbbrevForwardStep_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:961:1: p_AbbrevForwardStep : ( ATTR_SIGN )? p_NodeTest ;
+ // $ANTLR start "p_AbbrevForwardStep"
+ p_AbbrevForwardStep: function() {
+ var retval = new XQueryParser.p_AbbrevForwardStep_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var ATTR_SIGN289 = null;
+ var p_NodeTest290 = null;
+
+ var ATTR_SIGN289_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:962:9: ( ( ATTR_SIGN )? p_NodeTest )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:962:11: ( ATTR_SIGN )? p_NodeTest
+ root_0 = this.adaptor.nil();
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:962:11: ( ATTR_SIGN )?
+ var alt125=2;
+ var LA125_0 = this.input.LA(1);
+
+ if ( (LA125_0==ATTR_SIGN) ) {
+ alt125=1;
+ }
+ switch (alt125) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:962:11: ATTR_SIGN
+ ATTR_SIGN289=this.match(this.input,ATTR_SIGN,XQueryParser.FOLLOW_ATTR_SIGN_in_p_AbbrevForwardStep7137); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ ATTR_SIGN289_tree = this.adaptor.create(ATTR_SIGN289);
+ this.adaptor.addChild(root_0, ATTR_SIGN289_tree);
+ }
+
+
+ break;
+
+ }
+
+ this.pushFollow(XQueryParser.FOLLOW_p_NodeTest_in_p_AbbrevForwardStep7140);
+ p_NodeTest290=this.p_NodeTest();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_NodeTest290.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_ReverseStep_return: (function() {
+ XQueryParser.p_ReverseStep_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_ReverseStep_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:966:1: p_ReverseStep : ( p_ReverseAxis p_NodeTest | p_AbbrevReverseStep );
+ // $ANTLR start "p_ReverseStep"
+ p_ReverseStep: function() {
+ var retval = new XQueryParser.p_ReverseStep_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_ReverseAxis291 = null;
+ var p_NodeTest292 = null;
+ var p_AbbrevReverseStep293 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:967:9: ( p_ReverseAxis p_NodeTest | p_AbbrevReverseStep )
+ var alt126=2;
+ var LA126_0 = this.input.LA(1);
+
+ if ( ((LA126_0>=ANCESTOR && LA126_0<=ANCESTOR_OR_SELF)||(LA126_0>=PARENT && LA126_0<=PRECEDING_SIBLING)) ) {
+ alt126=1;
+ }
+ else if ( (LA126_0==DOT_DOT) ) {
+ alt126=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 126, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt126) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:967:11: p_ReverseAxis p_NodeTest
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_ReverseAxis_in_p_ReverseStep7166);
+ p_ReverseAxis291=this.p_ReverseAxis();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ReverseAxis291.getTree());
+ this.pushFollow(XQueryParser.FOLLOW_p_NodeTest_in_p_ReverseStep7168);
+ p_NodeTest292=this.p_NodeTest();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_NodeTest292.getTree());
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:968:11: p_AbbrevReverseStep
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_AbbrevReverseStep_in_p_ReverseStep7180);
+ p_AbbrevReverseStep293=this.p_AbbrevReverseStep();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_AbbrevReverseStep293.getTree());
+
+
+ break;
+
+ }
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_ReverseAxis_return: (function() {
+ XQueryParser.p_ReverseAxis_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_ReverseAxis_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:972:1: p_ReverseAxis : ( PARENT COLON_COLON | ANCESTOR COLON_COLON | PRECEDING_SIBLING COLON_COLON | PRECEDING COLON_COLON | ANCESTOR_OR_SELF COLON_COLON );
+ // $ANTLR start "p_ReverseAxis"
+ p_ReverseAxis: function() {
+ var retval = new XQueryParser.p_ReverseAxis_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var PARENT294 = null;
+ var COLON_COLON295 = null;
+ var ANCESTOR296 = null;
+ var COLON_COLON297 = null;
+ var PRECEDING_SIBLING298 = null;
+ var COLON_COLON299 = null;
+ var PRECEDING300 = null;
+ var COLON_COLON301 = null;
+ var ANCESTOR_OR_SELF302 = null;
+ var COLON_COLON303 = null;
+
+ var PARENT294_tree=null;
+ var COLON_COLON295_tree=null;
+ var ANCESTOR296_tree=null;
+ var COLON_COLON297_tree=null;
+ var PRECEDING_SIBLING298_tree=null;
+ var COLON_COLON299_tree=null;
+ var PRECEDING300_tree=null;
+ var COLON_COLON301_tree=null;
+ var ANCESTOR_OR_SELF302_tree=null;
+ var COLON_COLON303_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:973:9: ( PARENT COLON_COLON | ANCESTOR COLON_COLON | PRECEDING_SIBLING COLON_COLON | PRECEDING COLON_COLON | ANCESTOR_OR_SELF COLON_COLON )
+ var alt127=5;
+ switch ( this.input.LA(1) ) {
+ case PARENT:
+ alt127=1;
+ break;
+ case ANCESTOR:
+ alt127=2;
+ break;
+ case PRECEDING_SIBLING:
+ alt127=3;
+ break;
+ case PRECEDING:
+ alt127=4;
+ break;
+ case ANCESTOR_OR_SELF:
+ alt127=5;
+ break;
+ default:
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 127, 0, this.input);
+
+ throw nvae;
+ }
+
+ switch (alt127) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:973:11: PARENT COLON_COLON
+ root_0 = this.adaptor.nil();
+
+ PARENT294=this.match(this.input,PARENT,XQueryParser.FOLLOW_PARENT_in_p_ReverseAxis7206); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ PARENT294_tree = this.adaptor.create(PARENT294);
+ this.adaptor.addChild(root_0, PARENT294_tree);
+ }
+ COLON_COLON295=this.match(this.input,COLON_COLON,XQueryParser.FOLLOW_COLON_COLON_in_p_ReverseAxis7208); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ COLON_COLON295_tree = this.adaptor.create(COLON_COLON295);
+ this.adaptor.addChild(root_0, COLON_COLON295_tree);
+ }
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:974:11: ANCESTOR COLON_COLON
+ root_0 = this.adaptor.nil();
+
+ ANCESTOR296=this.match(this.input,ANCESTOR,XQueryParser.FOLLOW_ANCESTOR_in_p_ReverseAxis7220); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ ANCESTOR296_tree = this.adaptor.create(ANCESTOR296);
+ this.adaptor.addChild(root_0, ANCESTOR296_tree);
+ }
+ COLON_COLON297=this.match(this.input,COLON_COLON,XQueryParser.FOLLOW_COLON_COLON_in_p_ReverseAxis7222); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ COLON_COLON297_tree = this.adaptor.create(COLON_COLON297);
+ this.adaptor.addChild(root_0, COLON_COLON297_tree);
+ }
+
+
+ break;
+ case 3 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:975:11: PRECEDING_SIBLING COLON_COLON
+ root_0 = this.adaptor.nil();
+
+ PRECEDING_SIBLING298=this.match(this.input,PRECEDING_SIBLING,XQueryParser.FOLLOW_PRECEDING_SIBLING_in_p_ReverseAxis7234); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ PRECEDING_SIBLING298_tree = this.adaptor.create(PRECEDING_SIBLING298);
+ this.adaptor.addChild(root_0, PRECEDING_SIBLING298_tree);
+ }
+ COLON_COLON299=this.match(this.input,COLON_COLON,XQueryParser.FOLLOW_COLON_COLON_in_p_ReverseAxis7236); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ COLON_COLON299_tree = this.adaptor.create(COLON_COLON299);
+ this.adaptor.addChild(root_0, COLON_COLON299_tree);
+ }
+
+
+ break;
+ case 4 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:976:11: PRECEDING COLON_COLON
+ root_0 = this.adaptor.nil();
+
+ PRECEDING300=this.match(this.input,PRECEDING,XQueryParser.FOLLOW_PRECEDING_in_p_ReverseAxis7248); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ PRECEDING300_tree = this.adaptor.create(PRECEDING300);
+ this.adaptor.addChild(root_0, PRECEDING300_tree);
+ }
+ COLON_COLON301=this.match(this.input,COLON_COLON,XQueryParser.FOLLOW_COLON_COLON_in_p_ReverseAxis7250); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ COLON_COLON301_tree = this.adaptor.create(COLON_COLON301);
+ this.adaptor.addChild(root_0, COLON_COLON301_tree);
+ }
+
+
+ break;
+ case 5 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:977:11: ANCESTOR_OR_SELF COLON_COLON
+ root_0 = this.adaptor.nil();
+
+ ANCESTOR_OR_SELF302=this.match(this.input,ANCESTOR_OR_SELF,XQueryParser.FOLLOW_ANCESTOR_OR_SELF_in_p_ReverseAxis7262); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ ANCESTOR_OR_SELF302_tree = this.adaptor.create(ANCESTOR_OR_SELF302);
+ this.adaptor.addChild(root_0, ANCESTOR_OR_SELF302_tree);
+ }
+ COLON_COLON303=this.match(this.input,COLON_COLON,XQueryParser.FOLLOW_COLON_COLON_in_p_ReverseAxis7264); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ COLON_COLON303_tree = this.adaptor.create(COLON_COLON303);
+ this.adaptor.addChild(root_0, COLON_COLON303_tree);
+ }
+
+
+ break;
+
+ }
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_AbbrevReverseStep_return: (function() {
+ XQueryParser.p_AbbrevReverseStep_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_AbbrevReverseStep_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:981:1: p_AbbrevReverseStep : DOT_DOT ;
+ // $ANTLR start "p_AbbrevReverseStep"
+ p_AbbrevReverseStep: function() {
+ var retval = new XQueryParser.p_AbbrevReverseStep_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var DOT_DOT304 = null;
+
+ var DOT_DOT304_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:982:9: ( DOT_DOT )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:982:11: DOT_DOT
+ root_0 = this.adaptor.nil();
+
+ DOT_DOT304=this.match(this.input,DOT_DOT,XQueryParser.FOLLOW_DOT_DOT_in_p_AbbrevReverseStep7290); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ DOT_DOT304_tree = this.adaptor.create(DOT_DOT304);
+ this.adaptor.addChild(root_0, DOT_DOT304_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_NodeTest_return: (function() {
+ XQueryParser.p_NodeTest_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_NodeTest_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:986:1: p_NodeTest : ( p_KindTest | p_NameTest );
+ // $ANTLR start "p_NodeTest"
+ p_NodeTest: function() {
+ var retval = new XQueryParser.p_NodeTest_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_KindTest305 = null;
+ var p_NameTest306 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:987:9: ( p_KindTest | p_NameTest )
+ var alt128=2;
+ alt128 = this.dfa128.predict(this.input);
+ switch (alt128) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:987:11: p_KindTest
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_KindTest_in_p_NodeTest7316);
+ p_KindTest305=this.p_KindTest();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_KindTest305.getTree());
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:987:24: p_NameTest
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_NameTest_in_p_NodeTest7320);
+ p_NameTest306=this.p_NameTest();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_NameTest306.getTree());
+
+
+ break;
+
+ }
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_NameTest_return: (function() {
+ XQueryParser.p_NameTest_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_NameTest_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:991:1: p_NameTest : ( p_EQName | p_Wildcard );
+ // $ANTLR start "p_NameTest"
+ p_NameTest: function() {
+ var retval = new XQueryParser.p_NameTest_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_EQName307 = null;
+ var p_Wildcard308 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:992:9: ( p_EQName | p_Wildcard )
+ var alt129=2;
+ alt129 = this.dfa129.predict(this.input);
+ switch (alt129) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:992:11: p_EQName
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_EQName_in_p_NameTest7346);
+ p_EQName307=this.p_EQName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_EQName307.getTree());
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:992:22: p_Wildcard
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_Wildcard_in_p_NameTest7350);
+ p_Wildcard308=this.p_Wildcard();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Wildcard308.getTree());
+
+
+ break;
+
+ }
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_Wildcard_return: (function() {
+ XQueryParser.p_Wildcard_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_Wildcard_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:999:1: p_Wildcard : ( STAR ( COLON p_NCName )? | p_NCName COLON STAR | p_BracedURILiteral STAR );
+ // $ANTLR start "p_Wildcard"
+ p_Wildcard: function() {
+ var retval = new XQueryParser.p_Wildcard_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var STAR309 = null;
+ var COLON310 = null;
+ var COLON313 = null;
+ var STAR314 = null;
+ var STAR316 = null;
+ var p_NCName311 = null;
+ var p_NCName312 = null;
+ var p_BracedURILiteral315 = null;
+
+ var STAR309_tree=null;
+ var COLON310_tree=null;
+ var COLON313_tree=null;
+ var STAR314_tree=null;
+ var STAR316_tree=null;
+
+ this.setWsExplicit(true);
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1000:9: ( STAR ( COLON p_NCName )? | p_NCName COLON STAR | p_BracedURILiteral STAR )
+ var alt131=3;
+ switch ( this.input.LA(1) ) {
+ case STAR:
+ alt131=1;
+ break;
+ case ANCESTOR:
+ case ANCESTOR_OR_SELF:
+ case AND:
+ case AS:
+ case ASCENDING:
+ case AT:
+ case ATTRIBUTE:
+ case BASE_URI:
+ case BOUNDARY_SPACE:
+ case BY:
+ case CASE:
+ case CAST:
+ case CASTABLE:
+ case CHILD:
+ case COLLATION:
+ case COMMENT:
+ case CONSTRUCTION:
+ case COPY_NAMESPACES:
+ case DECLARE:
+ case DEFAULT:
+ case DESCENDANT:
+ case DESCENDANT_OR_SELF:
+ case DESCENDING:
+ case DIV:
+ case DOCUMENT:
+ case DOCUMENT_NODE:
+ case ELEMENT:
+ case ELSE:
+ case EMPTY:
+ case EMPTY_SEQUENCE:
+ case ENCODING:
+ case EQ:
+ case EVERY:
+ case EXCEPT:
+ case EXTERNAL:
+ case FOLLOWING:
+ case FOLLOWING_SIBLING:
+ case FOR:
+ case FUNCTION:
+ case GE:
+ case GREATEST:
+ case GT:
+ case IDIV:
+ case IF:
+ case IMPORT:
+ case IN:
+ case INHERIT:
+ case INSTANCE:
+ case INTERSECT:
+ case IS:
+ case ITEM:
+ case LAX:
+ case LE:
+ case LEAST:
+ case LET:
+ case LT:
+ case MOD:
+ case MODULE:
+ case NAMESPACE:
+ case NE:
+ case NO_INHERIT:
+ case NO_PRESERVE:
+ case NODE:
+ case JSON:
+ case OF:
+ case OPTION:
+ case OR:
+ case ORDER:
+ case ORDERED:
+ case ORDERING:
+ case PARENT:
+ case PRECEDING:
+ case PRECEDING_SIBLING:
+ case PRESERVE:
+ case PROCESSING_INSTRUCTION:
+ case STRUCTURED_ITEM:
+ case JSON_ITEM:
+ case OBJECT:
+ case ARRAY:
+ case RETURN:
+ case SATISFIES:
+ case SCHEMA:
+ case SCHEMA_ATTRIBUTE:
+ case SCHEMA_ELEMENT:
+ case SELF:
+ case SOME:
+ case STABLE:
+ case STRICT:
+ case STRIP:
+ case TEXT:
+ case THEN:
+ case TO:
+ case TREAT:
+ case TYPESWITCH:
+ case UNION:
+ case UNORDERED:
+ case VALIDATE:
+ case VARIABLE:
+ case VERSION:
+ case WHERE:
+ case XQUERY:
+ case ALLOWING:
+ case CATCH:
+ case CONTEXT:
+ case COUNT:
+ case DECIMAL_FORMAT:
+ case DECIMAL_SEPARATOR:
+ case DIGIT:
+ case END:
+ case GROUP:
+ case GROUPING_SEPARATOR:
+ case INFINITY:
+ case MINUS_SIGN:
+ case NAMESPACE_NODE:
+ case NAN:
+ case NEXT:
+ case ONLY:
+ case PATTERN_SEPARATOR:
+ case PERCENT:
+ case PER_MILLE:
+ case PREVIOUS:
+ case SLIDING:
+ case START:
+ case SWITCH:
+ case TRY:
+ case TUMBLING:
+ case TYPE:
+ case WHEN:
+ case WINDOW:
+ case ZERO_DIGIT:
+ case AFTER:
+ case BEFORE:
+ case COPY:
+ case DELETE:
+ case FIRST:
+ case INSERT:
+ case INTO:
+ case POSITION:
+ case APPEND:
+ case LAST:
+ case MODIFY:
+ case NODES:
+ case RENAME:
+ case REPLACE:
+ case REVALIDATION:
+ case SKIP:
+ case VALUE:
+ case WITH:
+ case ALL:
+ case ANY:
+ case CONTAINS:
+ case CONTENT:
+ case DIACRITICS:
+ case DIFFERENT:
+ case DISTANCE:
+ case ENTIRE:
+ case EXACTLY:
+ case FROM:
+ case FT_OPTION:
+ case FTAND:
+ case FTNOT:
+ case FTOR:
+ case INSENSITIVE:
+ case LANGUAGE:
+ case LEVELS:
+ case LOWERCASE:
+ case MOST:
+ case NO:
+ case NOT:
+ case OCCURS:
+ case PARAGRAPH:
+ case PARAGRAPHS:
+ case PHRASE:
+ case RELATIONSHIP:
+ case SAME:
+ case SCORE:
+ case SENSITIVE:
+ case SENTENCE:
+ case SENTENCES:
+ case STEMMING:
+ case STOP:
+ case THESAURUS:
+ case TIMES:
+ case UPPERCASE:
+ case USING:
+ case WEIGHT:
+ case WILDCARDS:
+ case WITHOUT:
+ case WORD:
+ case WORDS:
+ case BREAK:
+ case CONTINUE:
+ case EXIT:
+ case LOOP:
+ case RETURNING:
+ case WHILE:
+ case CHECK:
+ case COLLECTION:
+ case CONSTRAINT:
+ case FOREACH:
+ case FOREIGN:
+ case INDEX:
+ case INTEGRITY:
+ case KEY:
+ case ON:
+ case UNIQUE:
+ case AMP_ER:
+ case APOS_ER:
+ case QUOT_ER:
+ case L_NCName:
+ alt131=2;
+ break;
+ case Q:
+ alt131=3;
+ break;
+ default:
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 131, 0, this.input);
+
+ throw nvae;
+ }
+
+ switch (alt131) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1000:11: STAR ( COLON p_NCName )?
+ root_0 = this.adaptor.nil();
+
+ STAR309=this.match(this.input,STAR,XQueryParser.FOLLOW_STAR_in_p_Wildcard7383); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ STAR309_tree = this.adaptor.create(STAR309);
+ this.adaptor.addChild(root_0, STAR309_tree);
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1000:16: ( COLON p_NCName )?
+ var alt130=2;
+ var LA130_0 = this.input.LA(1);
+
+ if ( (LA130_0==COLON) ) {
+ alt130=1;
+ }
+ switch (alt130) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1000:17: COLON p_NCName
+ COLON310=this.match(this.input,COLON,XQueryParser.FOLLOW_COLON_in_p_Wildcard7386); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ COLON310_tree = this.adaptor.create(COLON310);
+ this.adaptor.addChild(root_0, COLON310_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_NCName_in_p_Wildcard7388);
+ p_NCName311=this.p_NCName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_NCName311.getTree());
+
+
+ break;
+
+ }
+
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1001:11: p_NCName COLON STAR
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_NCName_in_p_Wildcard7402);
+ p_NCName312=this.p_NCName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_NCName312.getTree());
+ COLON313=this.match(this.input,COLON,XQueryParser.FOLLOW_COLON_in_p_Wildcard7404); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ COLON313_tree = this.adaptor.create(COLON313);
+ this.adaptor.addChild(root_0, COLON313_tree);
+ }
+ STAR314=this.match(this.input,STAR,XQueryParser.FOLLOW_STAR_in_p_Wildcard7406); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ STAR314_tree = this.adaptor.create(STAR314);
+ this.adaptor.addChild(root_0, STAR314_tree);
+ }
+
+
+ break;
+ case 3 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1002:11: p_BracedURILiteral STAR
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_BracedURILiteral_in_p_Wildcard7418);
+ p_BracedURILiteral315=this.p_BracedURILiteral();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_BracedURILiteral315.getTree());
+ STAR316=this.match(this.input,STAR,XQueryParser.FOLLOW_STAR_in_p_Wildcard7420); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ STAR316_tree = this.adaptor.create(STAR316);
+ this.adaptor.addChild(root_0, STAR316_tree);
+ }
+
+
+ break;
+
+ }
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ this.setWsExplicit(false);
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_PostfixExpr_return: (function() {
+ XQueryParser.p_PostfixExpr_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_PostfixExpr_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1007:1: p_PostfixExpr : p_PrimaryExpr ( p_Predicate | p_ArgumentList )* ;
+ // $ANTLR start "p_PostfixExpr"
+ p_PostfixExpr: function() {
+ var retval = new XQueryParser.p_PostfixExpr_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_PrimaryExpr317 = null;
+ var p_Predicate318 = null;
+ var p_ArgumentList319 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1008:9: ( p_PrimaryExpr ( p_Predicate | p_ArgumentList )* )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1008:11: p_PrimaryExpr ( p_Predicate | p_ArgumentList )*
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_PrimaryExpr_in_p_PostfixExpr7458);
+ p_PrimaryExpr317=this.p_PrimaryExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_PrimaryExpr317.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1008:25: ( p_Predicate | p_ArgumentList )*
+ loop132:
+ do {
+ var alt132=3;
+ var LA132_0 = this.input.LA(1);
+
+ if ( (LA132_0==LSQUARE) ) {
+ alt132=1;
+ }
+ else if ( (LA132_0==LPAREN) ) {
+ alt132=2;
+ }
+
+
+ switch (alt132) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1008:26: p_Predicate
+ this.pushFollow(XQueryParser.FOLLOW_p_Predicate_in_p_PostfixExpr7461);
+ p_Predicate318=this.p_Predicate();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Predicate318.getTree());
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1008:40: p_ArgumentList
+ this.pushFollow(XQueryParser.FOLLOW_p_ArgumentList_in_p_PostfixExpr7465);
+ p_ArgumentList319=this.p_ArgumentList();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ArgumentList319.getTree());
+
+
+ break;
+
+ default :
+ break loop132;
+ }
+ } while (true);
+
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_ArgumentList_return: (function() {
+ XQueryParser.p_ArgumentList_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_ArgumentList_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1012:1: p_ArgumentList : LPAREN ( p_Argument ( COMMA p_Argument )* )? RPAREN ;
+ // $ANTLR start "p_ArgumentList"
+ p_ArgumentList: function() {
+ var retval = new XQueryParser.p_ArgumentList_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var LPAREN320 = null;
+ var COMMA322 = null;
+ var RPAREN324 = null;
+ var p_Argument321 = null;
+ var p_Argument323 = null;
+
+ var LPAREN320_tree=null;
+ var COMMA322_tree=null;
+ var RPAREN324_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1013:9: ( LPAREN ( p_Argument ( COMMA p_Argument )* )? RPAREN )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1013:11: LPAREN ( p_Argument ( COMMA p_Argument )* )? RPAREN
+ root_0 = this.adaptor.nil();
+
+ LPAREN320=this.match(this.input,LPAREN,XQueryParser.FOLLOW_LPAREN_in_p_ArgumentList7493); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LPAREN320_tree = this.adaptor.create(LPAREN320);
+ this.adaptor.addChild(root_0, LPAREN320_tree);
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1013:18: ( p_Argument ( COMMA p_Argument )* )?
+ var alt134=2;
+ var LA134_0 = this.input.LA(1);
+
+ if ( ((LA134_0>=ANCESTOR && LA134_0<=QUOT_ER)||LA134_0==LPAREN||(LA134_0>=DOLLAR && LA134_0<=L_UNION_BRACKET)||LA134_0==LBRACKET||LA134_0==LSQUARE||(LA134_0>=QUESTION && LA134_0<=SMALLER)||(LA134_0>=SLASH && LA134_0<=SLASH_SLASH)||(LA134_0>=DOT && LA134_0<=DOT_DOT)||(LA134_0>=ATTR_SIGN && LA134_0<=Q)||(LA134_0>=APOS && LA134_0<=QUOT)||LA134_0==L_NCName||(LA134_0>=L_Pragma && LA134_0<=L_DoubleLiteral)) ) {
+ alt134=1;
+ }
+ switch (alt134) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1013:19: p_Argument ( COMMA p_Argument )*
+ this.pushFollow(XQueryParser.FOLLOW_p_Argument_in_p_ArgumentList7496);
+ p_Argument321=this.p_Argument();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Argument321.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1013:30: ( COMMA p_Argument )*
+ loop133:
+ do {
+ var alt133=2;
+ var LA133_0 = this.input.LA(1);
+
+ if ( (LA133_0==COMMA) ) {
+ alt133=1;
+ }
+
+
+ switch (alt133) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1013:31: COMMA p_Argument
+ COMMA322=this.match(this.input,COMMA,XQueryParser.FOLLOW_COMMA_in_p_ArgumentList7499); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ COMMA322_tree = this.adaptor.create(COMMA322);
+ this.adaptor.addChild(root_0, COMMA322_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_Argument_in_p_ArgumentList7501);
+ p_Argument323=this.p_Argument();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Argument323.getTree());
+
+
+ break;
+
+ default :
+ break loop133;
+ }
+ } while (true);
+
+
+
+ break;
+
+ }
+
+ RPAREN324=this.match(this.input,RPAREN,XQueryParser.FOLLOW_RPAREN_in_p_ArgumentList7507); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RPAREN324_tree = this.adaptor.create(RPAREN324);
+ this.adaptor.addChild(root_0, RPAREN324_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_PredicateList_return: (function() {
+ XQueryParser.p_PredicateList_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_PredicateList_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1017:1: p_PredicateList : ( p_Predicate )* ;
+ // $ANTLR start "p_PredicateList"
+ p_PredicateList: function() {
+ var retval = new XQueryParser.p_PredicateList_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_Predicate325 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1018:9: ( ( p_Predicate )* )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1018:11: ( p_Predicate )*
+ root_0 = this.adaptor.nil();
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1018:11: ( p_Predicate )*
+ loop135:
+ do {
+ var alt135=2;
+ var LA135_0 = this.input.LA(1);
+
+ if ( (LA135_0==LSQUARE) ) {
+ alt135=1;
+ }
+
+
+ switch (alt135) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1018:11: p_Predicate
+ this.pushFollow(XQueryParser.FOLLOW_p_Predicate_in_p_PredicateList7533);
+ p_Predicate325=this.p_Predicate();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Predicate325.getTree());
+
+
+ break;
+
+ default :
+ break loop135;
+ }
+ } while (true);
+
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_Predicate_return: (function() {
+ XQueryParser.p_Predicate_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_Predicate_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1022:1: p_Predicate : LSQUARE p_Expr[true,true] RSQUARE ;
+ // $ANTLR start "p_Predicate"
+ p_Predicate: function() {
+ var retval = new XQueryParser.p_Predicate_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var LSQUARE326 = null;
+ var RSQUARE328 = null;
+ var p_Expr327 = null;
+
+ var LSQUARE326_tree=null;
+ var RSQUARE328_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1023:9: ( LSQUARE p_Expr[true,true] RSQUARE )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1023:11: LSQUARE p_Expr[true,true] RSQUARE
+ root_0 = this.adaptor.nil();
+
+ LSQUARE326=this.match(this.input,LSQUARE,XQueryParser.FOLLOW_LSQUARE_in_p_Predicate7560); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LSQUARE326_tree = this.adaptor.create(LSQUARE326);
+ this.adaptor.addChild(root_0, LSQUARE326_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_Expr_in_p_Predicate7562);
+ p_Expr327=this.p_Expr(true, true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Expr327.getTree());
+ RSQUARE328=this.match(this.input,RSQUARE,XQueryParser.FOLLOW_RSQUARE_in_p_Predicate7565); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RSQUARE328_tree = this.adaptor.create(RSQUARE328);
+ this.adaptor.addChild(root_0, RSQUARE328_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_PrimaryExpr_return: (function() {
+ XQueryParser.p_PrimaryExpr_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_PrimaryExpr_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1028:1: p_PrimaryExpr : ( ( LPAREN )=> p_ParenthesizedExpr | p_Literal | p_VarRef | p_ContextItemExpr | p_FunctionCall | p_OrderedExpr | p_UnorderedExpr | p_Constructor | p_BlockExpr | p_FunctionItemExpr | p_ArrayConstructor | p_SimpleObjectUnion );
+ // $ANTLR start "p_PrimaryExpr"
+ p_PrimaryExpr: function() {
+ var retval = new XQueryParser.p_PrimaryExpr_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_ParenthesizedExpr329 = null;
+ var p_Literal330 = null;
+ var p_VarRef331 = null;
+ var p_ContextItemExpr332 = null;
+ var p_FunctionCall333 = null;
+ var p_OrderedExpr334 = null;
+ var p_UnorderedExpr335 = null;
+ var p_Constructor336 = null;
+ var p_BlockExpr337 = null;
+ var p_FunctionItemExpr338 = null;
+ var p_ArrayConstructor339 = null;
+ var p_SimpleObjectUnion340 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1029:9: ( ( LPAREN )=> p_ParenthesizedExpr | p_Literal | p_VarRef | p_ContextItemExpr | p_FunctionCall | p_OrderedExpr | p_UnorderedExpr | p_Constructor | p_BlockExpr | p_FunctionItemExpr | p_ArrayConstructor | p_SimpleObjectUnion )
+ var alt136=12;
+ alt136 = this.dfa136.predict(this.input);
+ switch (alt136) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1029:11: ( LPAREN )=> p_ParenthesizedExpr
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_ParenthesizedExpr_in_p_PrimaryExpr7598);
+ p_ParenthesizedExpr329=this.p_ParenthesizedExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ParenthesizedExpr329.getTree());
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1030:11: p_Literal
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_Literal_in_p_PrimaryExpr7610);
+ p_Literal330=this.p_Literal();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Literal330.getTree());
+
+
+ break;
+ case 3 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1031:11: p_VarRef
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_VarRef_in_p_PrimaryExpr7622);
+ p_VarRef331=this.p_VarRef();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_VarRef331.getTree());
+
+
+ break;
+ case 4 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1032:11: p_ContextItemExpr
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_ContextItemExpr_in_p_PrimaryExpr7634);
+ p_ContextItemExpr332=this.p_ContextItemExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ContextItemExpr332.getTree());
+
+
+ break;
+ case 5 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1033:11: p_FunctionCall
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_FunctionCall_in_p_PrimaryExpr7646);
+ p_FunctionCall333=this.p_FunctionCall();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_FunctionCall333.getTree());
+
+
+ break;
+ case 6 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1034:11: p_OrderedExpr
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_OrderedExpr_in_p_PrimaryExpr7659);
+ p_OrderedExpr334=this.p_OrderedExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_OrderedExpr334.getTree());
+
+
+ break;
+ case 7 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1035:11: p_UnorderedExpr
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_UnorderedExpr_in_p_PrimaryExpr7671);
+ p_UnorderedExpr335=this.p_UnorderedExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_UnorderedExpr335.getTree());
+
+
+ break;
+ case 8 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1036:11: p_Constructor
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_Constructor_in_p_PrimaryExpr7683);
+ p_Constructor336=this.p_Constructor();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Constructor336.getTree());
+
+
+ break;
+ case 9 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1037:11: p_BlockExpr
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_BlockExpr_in_p_PrimaryExpr7696);
+ p_BlockExpr337=this.p_BlockExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_BlockExpr337.getTree());
+
+
+ break;
+ case 10 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1038:11: p_FunctionItemExpr
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_FunctionItemExpr_in_p_PrimaryExpr7708);
+ p_FunctionItemExpr338=this.p_FunctionItemExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_FunctionItemExpr338.getTree());
+
+
+ break;
+ case 11 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1039:11: p_ArrayConstructor
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_ArrayConstructor_in_p_PrimaryExpr7721);
+ p_ArrayConstructor339=this.p_ArrayConstructor();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ArrayConstructor339.getTree());
+
+
+ break;
+ case 12 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1040:11: p_SimpleObjectUnion
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_SimpleObjectUnion_in_p_PrimaryExpr7733);
+ p_SimpleObjectUnion340=this.p_SimpleObjectUnion();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_SimpleObjectUnion340.getTree());
+
+
+ break;
+
+ }
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_SimpleObjectUnion_return: (function() {
+ XQueryParser.p_SimpleObjectUnion_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_SimpleObjectUnion_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1044:1: p_SimpleObjectUnion : L_UNION_BRACKET ( p_Expr[true, true] )? R_UNION_BRACKET ;
+ // $ANTLR start "p_SimpleObjectUnion"
+ p_SimpleObjectUnion: function() {
+ var retval = new XQueryParser.p_SimpleObjectUnion_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var L_UNION_BRACKET341 = null;
+ var R_UNION_BRACKET343 = null;
+ var p_Expr342 = null;
+
+ var L_UNION_BRACKET341_tree=null;
+ var R_UNION_BRACKET343_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1045:11: ( L_UNION_BRACKET ( p_Expr[true, true] )? R_UNION_BRACKET )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1045:13: L_UNION_BRACKET ( p_Expr[true, true] )? R_UNION_BRACKET
+ root_0 = this.adaptor.nil();
+
+ L_UNION_BRACKET341=this.match(this.input,L_UNION_BRACKET,XQueryParser.FOLLOW_L_UNION_BRACKET_in_p_SimpleObjectUnion7769); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ L_UNION_BRACKET341_tree = this.adaptor.create(L_UNION_BRACKET341);
+ this.adaptor.addChild(root_0, L_UNION_BRACKET341_tree);
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1045:29: ( p_Expr[true, true] )?
+ var alt137=2;
+ var LA137_0 = this.input.LA(1);
+
+ if ( ((LA137_0>=ANCESTOR && LA137_0<=QUOT_ER)||LA137_0==LPAREN||(LA137_0>=DOLLAR && LA137_0<=L_UNION_BRACKET)||LA137_0==LBRACKET||LA137_0==LSQUARE||(LA137_0>=STAR && LA137_0<=SMALLER)||(LA137_0>=SLASH && LA137_0<=SLASH_SLASH)||(LA137_0>=DOT && LA137_0<=DOT_DOT)||(LA137_0>=ATTR_SIGN && LA137_0<=Q)||(LA137_0>=APOS && LA137_0<=QUOT)||LA137_0==L_NCName||(LA137_0>=L_Pragma && LA137_0<=L_DoubleLiteral)) ) {
+ alt137=1;
+ }
+ switch (alt137) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1045:29: p_Expr[true, true]
+ this.pushFollow(XQueryParser.FOLLOW_p_Expr_in_p_SimpleObjectUnion7771);
+ p_Expr342=this.p_Expr(true, true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Expr342.getTree());
+
+
+ break;
+
+ }
+
+ R_UNION_BRACKET343=this.match(this.input,R_UNION_BRACKET,XQueryParser.FOLLOW_R_UNION_BRACKET_in_p_SimpleObjectUnion7775); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ R_UNION_BRACKET343_tree = this.adaptor.create(R_UNION_BRACKET343);
+ this.adaptor.addChild(root_0, R_UNION_BRACKET343_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_PairConstructor_return: (function() {
+ XQueryParser.p_PairConstructor_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_PairConstructor_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1060:1: p_PairConstructor : COLON p_ExprSingle[true] ( COMMA p_Hybrid[true, false] )* ;
+ // $ANTLR start "p_PairConstructor"
+ p_PairConstructor: function() {
+ var retval = new XQueryParser.p_PairConstructor_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var COLON344 = null;
+ var COMMA346 = null;
+ var p_ExprSingle345 = null;
+ var p_Hybrid347 = null;
+
+ var COLON344_tree=null;
+ var COMMA346_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1061:11: ( COLON p_ExprSingle[true] ( COMMA p_Hybrid[true, false] )* )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1061:13: COLON p_ExprSingle[true] ( COMMA p_Hybrid[true, false] )*
+ root_0 = this.adaptor.nil();
+
+ COLON344=this.match(this.input,COLON,XQueryParser.FOLLOW_COLON_in_p_PairConstructor7817); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ COLON344_tree = this.adaptor.create(COLON344);
+ this.adaptor.addChild(root_0, COLON344_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_ExprSingle_in_p_PairConstructor7819);
+ p_ExprSingle345=this.p_ExprSingle(true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ExprSingle345.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1061:38: ( COMMA p_Hybrid[true, false] )*
+ loop138:
+ do {
+ var alt138=2;
+ var LA138_0 = this.input.LA(1);
+
+ if ( (LA138_0==COMMA) ) {
+ alt138=1;
+ }
+
+
+ switch (alt138) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1061:39: COMMA p_Hybrid[true, false]
+ COMMA346=this.match(this.input,COMMA,XQueryParser.FOLLOW_COMMA_in_p_PairConstructor7823); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ COMMA346_tree = this.adaptor.create(COMMA346);
+ this.adaptor.addChild(root_0, COMMA346_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_Hybrid_in_p_PairConstructor7825);
+ p_Hybrid347=this.p_Hybrid(true, false);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Hybrid347.getTree());
+
+
+ break;
+
+ default :
+ break loop138;
+ }
+ } while (true);
+
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_ArrayConstructor_return: (function() {
+ XQueryParser.p_ArrayConstructor_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_ArrayConstructor_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1064:1: p_ArrayConstructor : LSQUARE ( p_Expr[true, true] )? RSQUARE ;
+ // $ANTLR start "p_ArrayConstructor"
+ p_ArrayConstructor: function() {
+ var retval = new XQueryParser.p_ArrayConstructor_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var LSQUARE348 = null;
+ var RSQUARE350 = null;
+ var p_Expr349 = null;
+
+ var LSQUARE348_tree=null;
+ var RSQUARE350_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1065:9: ( LSQUARE ( p_Expr[true, true] )? RSQUARE )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1065:12: LSQUARE ( p_Expr[true, true] )? RSQUARE
+ root_0 = this.adaptor.nil();
+
+ LSQUARE348=this.match(this.input,LSQUARE,XQueryParser.FOLLOW_LSQUARE_in_p_ArrayConstructor7856); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LSQUARE348_tree = this.adaptor.create(LSQUARE348);
+ this.adaptor.addChild(root_0, LSQUARE348_tree);
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1065:20: ( p_Expr[true, true] )?
+ var alt139=2;
+ var LA139_0 = this.input.LA(1);
+
+ if ( ((LA139_0>=ANCESTOR && LA139_0<=QUOT_ER)||LA139_0==LPAREN||(LA139_0>=DOLLAR && LA139_0<=L_UNION_BRACKET)||LA139_0==LBRACKET||LA139_0==LSQUARE||(LA139_0>=STAR && LA139_0<=SMALLER)||(LA139_0>=SLASH && LA139_0<=SLASH_SLASH)||(LA139_0>=DOT && LA139_0<=DOT_DOT)||(LA139_0>=ATTR_SIGN && LA139_0<=Q)||(LA139_0>=APOS && LA139_0<=QUOT)||LA139_0==L_NCName||(LA139_0>=L_Pragma && LA139_0<=L_DoubleLiteral)) ) {
+ alt139=1;
+ }
+ switch (alt139) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1065:20: p_Expr[true, true]
+ this.pushFollow(XQueryParser.FOLLOW_p_Expr_in_p_ArrayConstructor7858);
+ p_Expr349=this.p_Expr(true, true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Expr349.getTree());
+
+
+ break;
+
+ }
+
+ RSQUARE350=this.match(this.input,RSQUARE,XQueryParser.FOLLOW_RSQUARE_in_p_ArrayConstructor7862); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RSQUARE350_tree = this.adaptor.create(RSQUARE350);
+ this.adaptor.addChild(root_0, RSQUARE350_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_Literal_return: (function() {
+ XQueryParser.p_Literal_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_Literal_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1069:1: p_Literal : ( p_NumericLiteral | p_StringLiteral );
+ // $ANTLR start "p_Literal"
+ p_Literal: function() {
+ var retval = new XQueryParser.p_Literal_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_NumericLiteral351 = null;
+ var p_StringLiteral352 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1070:9: ( p_NumericLiteral | p_StringLiteral )
+ var alt140=2;
+ var LA140_0 = this.input.LA(1);
+
+ if ( ((LA140_0>=L_IntegerLiteral && LA140_0<=L_DoubleLiteral)) ) {
+ alt140=1;
+ }
+ else if ( ((LA140_0>=APOS && LA140_0<=QUOT)) ) {
+ alt140=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 140, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt140) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1070:11: p_NumericLiteral
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_NumericLiteral_in_p_Literal7888);
+ p_NumericLiteral351=this.p_NumericLiteral();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_NumericLiteral351.getTree());
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1070:30: p_StringLiteral
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_StringLiteral_in_p_Literal7892);
+ p_StringLiteral352=this.p_StringLiteral();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_StringLiteral352.getTree());
+
+
+ break;
+
+ }
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_NumericLiteral_return: (function() {
+ XQueryParser.p_NumericLiteral_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_NumericLiteral_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1074:1: p_NumericLiteral : (d+= L_IntegerLiteral | d+= L_DecimalLiteral | d+= L_DoubleLiteral );
+ // $ANTLR start "p_NumericLiteral"
+ p_NumericLiteral: function() {
+ var retval = new XQueryParser.p_NumericLiteral_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var d = null;
+ var list_d=null;
+
+ var d_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1075:9: (d+= L_IntegerLiteral | d+= L_DecimalLiteral | d+= L_DoubleLiteral )
+ var alt141=3;
+ switch ( this.input.LA(1) ) {
+ case L_IntegerLiteral:
+ alt141=1;
+ break;
+ case L_DecimalLiteral:
+ alt141=2;
+ break;
+ case L_DoubleLiteral:
+ alt141=3;
+ break;
+ default:
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 141, 0, this.input);
+
+ throw nvae;
+ }
+
+ switch (alt141) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1075:11: d+= L_IntegerLiteral
+ root_0 = this.adaptor.nil();
+
+ d=this.match(this.input,L_IntegerLiteral,XQueryParser.FOLLOW_L_IntegerLiteral_in_p_NumericLiteral7920); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ d_tree = this.adaptor.create(d);
+ this.adaptor.addChild(root_0, d_tree);
+ }
+ if (org.antlr.lang.isNull(list_d)) list_d = [];
+ list_d.push(d);
+
+ if ( this.state.backtracking===0 ) {
+ this.ad(list_d);
+ }
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1075:48: d+= L_DecimalLiteral
+ root_0 = this.adaptor.nil();
+
+ d=this.match(this.input,L_DecimalLiteral,XQueryParser.FOLLOW_L_DecimalLiteral_in_p_NumericLiteral7928); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ d_tree = this.adaptor.create(d);
+ this.adaptor.addChild(root_0, d_tree);
+ }
+ if (org.antlr.lang.isNull(list_d)) list_d = [];
+ list_d.push(d);
+
+ if ( this.state.backtracking===0 ) {
+ this.ad(list_d);
+ }
+
+
+ break;
+ case 3 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1075:85: d+= L_DoubleLiteral
+ root_0 = this.adaptor.nil();
+
+ d=this.match(this.input,L_DoubleLiteral,XQueryParser.FOLLOW_L_DoubleLiteral_in_p_NumericLiteral7936); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ d_tree = this.adaptor.create(d);
+ this.adaptor.addChild(root_0, d_tree);
+ }
+ if (org.antlr.lang.isNull(list_d)) list_d = [];
+ list_d.push(d);
+
+ if ( this.state.backtracking===0 ) {
+ this.ad(list_d);
+ }
+
+
+ break;
+
+ }
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_VarRef_return: (function() {
+ XQueryParser.p_VarRef_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_VarRef_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1079:1: p_VarRef : d= DOLLAR v= p_VarName ;
+ // $ANTLR start "p_VarRef"
+ p_VarRef: function() {
+ var retval = new XQueryParser.p_VarRef_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var d = null;
+ var v = null;
+
+ var d_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1080:9: (d= DOLLAR v= p_VarName )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1080:11: d= DOLLAR v= p_VarName
+ root_0 = this.adaptor.nil();
+
+ d=this.match(this.input,DOLLAR,XQueryParser.FOLLOW_DOLLAR_in_p_VarRef7974); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ d_tree = this.adaptor.create(d);
+ this.adaptor.addChild(root_0, d_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_VarName_in_p_VarRef7978);
+ v=this.p_VarName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, v.getTree());
+ if ( this.state.backtracking===0 ) {
+ this.av(d, (v?v.stop:null));
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_VarName_return: (function() {
+ XQueryParser.p_VarName_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_VarName_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1084:1: p_VarName : p_EQName ;
+ // $ANTLR start "p_VarName"
+ p_VarName: function() {
+ var retval = new XQueryParser.p_VarName_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_EQName353 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1085:9: ( p_EQName )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1085:11: p_EQName
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_EQName_in_p_VarName8006);
+ p_EQName353=this.p_EQName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_EQName353.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_ParenthesizedExpr_return: (function() {
+ XQueryParser.p_ParenthesizedExpr_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_ParenthesizedExpr_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1089:1: p_ParenthesizedExpr : LPAREN ( p_Expr[true,true] )? RPAREN ;
+ // $ANTLR start "p_ParenthesizedExpr"
+ p_ParenthesizedExpr: function() {
+ var retval = new XQueryParser.p_ParenthesizedExpr_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var LPAREN354 = null;
+ var RPAREN356 = null;
+ var p_Expr355 = null;
+
+ var LPAREN354_tree=null;
+ var RPAREN356_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1090:9: ( LPAREN ( p_Expr[true,true] )? RPAREN )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1090:11: LPAREN ( p_Expr[true,true] )? RPAREN
+ root_0 = this.adaptor.nil();
+
+ LPAREN354=this.match(this.input,LPAREN,XQueryParser.FOLLOW_LPAREN_in_p_ParenthesizedExpr8032); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LPAREN354_tree = this.adaptor.create(LPAREN354);
+ this.adaptor.addChild(root_0, LPAREN354_tree);
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1090:18: ( p_Expr[true,true] )?
+ var alt142=2;
+ var LA142_0 = this.input.LA(1);
+
+ if ( ((LA142_0>=ANCESTOR && LA142_0<=QUOT_ER)||LA142_0==LPAREN||(LA142_0>=DOLLAR && LA142_0<=L_UNION_BRACKET)||LA142_0==LBRACKET||LA142_0==LSQUARE||(LA142_0>=STAR && LA142_0<=SMALLER)||(LA142_0>=SLASH && LA142_0<=SLASH_SLASH)||(LA142_0>=DOT && LA142_0<=DOT_DOT)||(LA142_0>=ATTR_SIGN && LA142_0<=Q)||(LA142_0>=APOS && LA142_0<=QUOT)||LA142_0==L_NCName||(LA142_0>=L_Pragma && LA142_0<=L_DoubleLiteral)) ) {
+ alt142=1;
+ }
+ switch (alt142) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1090:18: p_Expr[true,true]
+ this.pushFollow(XQueryParser.FOLLOW_p_Expr_in_p_ParenthesizedExpr8034);
+ p_Expr355=this.p_Expr(true, true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Expr355.getTree());
+
+
+ break;
+
+ }
+
+ RPAREN356=this.match(this.input,RPAREN,XQueryParser.FOLLOW_RPAREN_in_p_ParenthesizedExpr8038); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RPAREN356_tree = this.adaptor.create(RPAREN356);
+ this.adaptor.addChild(root_0, RPAREN356_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_ContextItemExpr_return: (function() {
+ XQueryParser.p_ContextItemExpr_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_ContextItemExpr_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1094:1: p_ContextItemExpr : DOT ;
+ // $ANTLR start "p_ContextItemExpr"
+ p_ContextItemExpr: function() {
+ var retval = new XQueryParser.p_ContextItemExpr_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var DOT357 = null;
+
+ var DOT357_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1095:9: ( DOT )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1095:11: DOT
+ root_0 = this.adaptor.nil();
+
+ DOT357=this.match(this.input,DOT,XQueryParser.FOLLOW_DOT_in_p_ContextItemExpr8064); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ DOT357_tree = this.adaptor.create(DOT357);
+ this.adaptor.addChild(root_0, DOT357_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_OrderedExpr_return: (function() {
+ XQueryParser.p_OrderedExpr_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_OrderedExpr_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1099:1: p_OrderedExpr : k= ORDERED LBRACKET p_Expr[true,true] RBRACKET ;
+ // $ANTLR start "p_OrderedExpr"
+ p_OrderedExpr: function() {
+ var retval = new XQueryParser.p_OrderedExpr_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var LBRACKET358 = null;
+ var RBRACKET360 = null;
+ var p_Expr359 = null;
+
+ var k_tree=null;
+ var LBRACKET358_tree=null;
+ var RBRACKET360_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1100:9: (k= ORDERED LBRACKET p_Expr[true,true] RBRACKET )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1100:11: k= ORDERED LBRACKET p_Expr[true,true] RBRACKET
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,ORDERED,XQueryParser.FOLLOW_ORDERED_in_p_OrderedExpr8092); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ LBRACKET358=this.match(this.input,LBRACKET,XQueryParser.FOLLOW_LBRACKET_in_p_OrderedExpr8096); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LBRACKET358_tree = this.adaptor.create(LBRACKET358);
+ this.adaptor.addChild(root_0, LBRACKET358_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_Expr_in_p_OrderedExpr8098);
+ p_Expr359=this.p_Expr(true, true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Expr359.getTree());
+ RBRACKET360=this.match(this.input,RBRACKET,XQueryParser.FOLLOW_RBRACKET_in_p_OrderedExpr8101); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RBRACKET360_tree = this.adaptor.create(RBRACKET360);
+ this.adaptor.addChild(root_0, RBRACKET360_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_UnorderedExpr_return: (function() {
+ XQueryParser.p_UnorderedExpr_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_UnorderedExpr_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1104:1: p_UnorderedExpr : k= UNORDERED LBRACKET p_Expr[true,true] RBRACKET ;
+ // $ANTLR start "p_UnorderedExpr"
+ p_UnorderedExpr: function() {
+ var retval = new XQueryParser.p_UnorderedExpr_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var LBRACKET361 = null;
+ var RBRACKET363 = null;
+ var p_Expr362 = null;
+
+ var k_tree=null;
+ var LBRACKET361_tree=null;
+ var RBRACKET363_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1105:9: (k= UNORDERED LBRACKET p_Expr[true,true] RBRACKET )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1105:11: k= UNORDERED LBRACKET p_Expr[true,true] RBRACKET
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,UNORDERED,XQueryParser.FOLLOW_UNORDERED_in_p_UnorderedExpr8129); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ LBRACKET361=this.match(this.input,LBRACKET,XQueryParser.FOLLOW_LBRACKET_in_p_UnorderedExpr8133); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LBRACKET361_tree = this.adaptor.create(LBRACKET361);
+ this.adaptor.addChild(root_0, LBRACKET361_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_Expr_in_p_UnorderedExpr8135);
+ p_Expr362=this.p_Expr(true, true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Expr362.getTree());
+ RBRACKET363=this.match(this.input,RBRACKET,XQueryParser.FOLLOW_RBRACKET_in_p_UnorderedExpr8138); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RBRACKET363_tree = this.adaptor.create(RBRACKET363);
+ this.adaptor.addChild(root_0, RBRACKET363_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_FunctionCall_return: (function() {
+ XQueryParser.p_FunctionCall_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_FunctionCall_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1110:1: p_FunctionCall : f= pg_FQName p_ArgumentList ;
+ // $ANTLR start "p_FunctionCall"
+ p_FunctionCall: function() {
+ var retval = new XQueryParser.p_FunctionCall_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var f = null;
+ var p_ArgumentList364 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1111:9: (f= pg_FQName p_ArgumentList )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1111:11: f= pg_FQName p_ArgumentList
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_pg_FQName_in_p_FunctionCall8167);
+ f=this.pg_FQName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, f.getTree());
+ if ( this.state.backtracking===0 ) {
+ this.af((f?f.start:null), (f?f.stop:null));
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_ArgumentList_in_p_FunctionCall8172);
+ p_ArgumentList364=this.p_ArgumentList();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ArgumentList364.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_Argument_return: (function() {
+ XQueryParser.p_Argument_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_Argument_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1115:1: p_Argument : ( p_ExprSingle[true] | p_ArgumentPlaceholder );
+ // $ANTLR start "p_Argument"
+ p_Argument: function() {
+ var retval = new XQueryParser.p_Argument_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_ExprSingle365 = null;
+ var p_ArgumentPlaceholder366 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1116:9: ( p_ExprSingle[true] | p_ArgumentPlaceholder )
+ var alt143=2;
+ var LA143_0 = this.input.LA(1);
+
+ if ( ((LA143_0>=ANCESTOR && LA143_0<=QUOT_ER)||LA143_0==LPAREN||(LA143_0>=DOLLAR && LA143_0<=L_UNION_BRACKET)||LA143_0==LBRACKET||LA143_0==LSQUARE||(LA143_0>=STAR && LA143_0<=SMALLER)||(LA143_0>=SLASH && LA143_0<=SLASH_SLASH)||(LA143_0>=DOT && LA143_0<=DOT_DOT)||(LA143_0>=ATTR_SIGN && LA143_0<=Q)||(LA143_0>=APOS && LA143_0<=QUOT)||LA143_0==L_NCName||(LA143_0>=L_Pragma && LA143_0<=L_DoubleLiteral)) ) {
+ alt143=1;
+ }
+ else if ( (LA143_0==QUESTION) ) {
+ alt143=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 143, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt143) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1116:11: p_ExprSingle[true]
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_ExprSingle_in_p_Argument8198);
+ p_ExprSingle365=this.p_ExprSingle(true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ExprSingle365.getTree());
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1116:32: p_ArgumentPlaceholder
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_ArgumentPlaceholder_in_p_Argument8203);
+ p_ArgumentPlaceholder366=this.p_ArgumentPlaceholder();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ArgumentPlaceholder366.getTree());
+
+
+ break;
+
+ }
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_ArgumentPlaceholder_return: (function() {
+ XQueryParser.p_ArgumentPlaceholder_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_ArgumentPlaceholder_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1120:1: p_ArgumentPlaceholder : QUESTION ;
+ // $ANTLR start "p_ArgumentPlaceholder"
+ p_ArgumentPlaceholder: function() {
+ var retval = new XQueryParser.p_ArgumentPlaceholder_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var QUESTION367 = null;
+
+ var QUESTION367_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1121:9: ( QUESTION )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1121:11: QUESTION
+ root_0 = this.adaptor.nil();
+
+ QUESTION367=this.match(this.input,QUESTION,XQueryParser.FOLLOW_QUESTION_in_p_ArgumentPlaceholder8229); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ QUESTION367_tree = this.adaptor.create(QUESTION367);
+ this.adaptor.addChild(root_0, QUESTION367_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_Constructor_return: (function() {
+ XQueryParser.p_Constructor_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_Constructor_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1125:1: p_Constructor : ( p_DirectConstructor | p_ComputedConstructor );
+ // $ANTLR start "p_Constructor"
+ p_Constructor: function() {
+ var retval = new XQueryParser.p_Constructor_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_DirectConstructor368 = null;
+ var p_ComputedConstructor369 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1126:9: ( p_DirectConstructor | p_ComputedConstructor )
+ var alt144=2;
+ var LA144_0 = this.input.LA(1);
+
+ if ( (LA144_0==SMALLER||(LA144_0>=L_DirCommentConstructor && LA144_0<=L_DirPIConstructor)) ) {
+ alt144=1;
+ }
+ else if ( (LA144_0==ATTRIBUTE||LA144_0==COMMENT||LA144_0==DOCUMENT||LA144_0==ELEMENT||LA144_0==NAMESPACE||LA144_0==PROCESSING_INSTRUCTION||LA144_0==TEXT) ) {
+ alt144=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 144, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt144) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1126:11: p_DirectConstructor
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_DirectConstructor_in_p_Constructor8255);
+ p_DirectConstructor368=this.p_DirectConstructor();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_DirectConstructor368.getTree());
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1127:11: p_ComputedConstructor
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_ComputedConstructor_in_p_Constructor8267);
+ p_ComputedConstructor369=this.p_ComputedConstructor();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ComputedConstructor369.getTree());
+
+
+ break;
+
+ }
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_DirectConstructor_return: (function() {
+ XQueryParser.p_DirectConstructor_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_DirectConstructor_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1131:1: p_DirectConstructor : ( p_DirElemConstructor | p_DirCommentConstructor | p_DirPIConstructor );
+ // $ANTLR start "p_DirectConstructor"
+ p_DirectConstructor: function() {
+ var retval = new XQueryParser.p_DirectConstructor_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_DirElemConstructor370 = null;
+ var p_DirCommentConstructor371 = null;
+ var p_DirPIConstructor372 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1132:9: ( p_DirElemConstructor | p_DirCommentConstructor | p_DirPIConstructor )
+ var alt145=3;
+ switch ( this.input.LA(1) ) {
+ case SMALLER:
+ alt145=1;
+ break;
+ case L_DirCommentConstructor:
+ alt145=2;
+ break;
+ case L_DirPIConstructor:
+ alt145=3;
+ break;
+ default:
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 145, 0, this.input);
+
+ throw nvae;
+ }
+
+ switch (alt145) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1132:11: p_DirElemConstructor
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_DirElemConstructor_in_p_DirectConstructor8293);
+ p_DirElemConstructor370=this.p_DirElemConstructor();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_DirElemConstructor370.getTree());
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1133:11: p_DirCommentConstructor
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_DirCommentConstructor_in_p_DirectConstructor8305);
+ p_DirCommentConstructor371=this.p_DirCommentConstructor();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_DirCommentConstructor371.getTree());
+
+
+ break;
+ case 3 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1134:11: p_DirPIConstructor
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_DirPIConstructor_in_p_DirectConstructor8317);
+ p_DirPIConstructor372=this.p_DirPIConstructor();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_DirPIConstructor372.getTree());
+
+
+ break;
+
+ }
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_DirElemConstructor_return: (function() {
+ XQueryParser.p_DirElemConstructor_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_DirElemConstructor_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1138:1: p_DirElemConstructor : SMALLER ts= p_QName p_DirAttributeList ( EMPTY_CLOSE_TAG | ( GREATER ( pm_DirElemContent )* CLOSE_TAG te= p_QName ( S )? GREATER ) ) -> ^( DirElemConstructor ^( DirAttributeList ( p_DirAttributeList )* ) ^( DirElemContent ( pm_DirElemContent )* ) ) ;
+ // $ANTLR start "p_DirElemConstructor"
+ p_DirElemConstructor: function() {
+ var retval = new XQueryParser.p_DirElemConstructor_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var SMALLER373 = null;
+ var EMPTY_CLOSE_TAG375 = null;
+ var GREATER376 = null;
+ var CLOSE_TAG378 = null;
+ var S379 = null;
+ var GREATER380 = null;
+ var ts = null;
+ var te = null;
+ var p_DirAttributeList374 = null;
+ var pm_DirElemContent377 = null;
+
+ var SMALLER373_tree=null;
+ var EMPTY_CLOSE_TAG375_tree=null;
+ var GREATER376_tree=null;
+ var CLOSE_TAG378_tree=null;
+ var S379_tree=null;
+ var GREATER380_tree=null;
+ var stream_CLOSE_TAG=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token CLOSE_TAG");
+ var stream_GREATER=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token GREATER");
+ var stream_S=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token S");
+ var stream_EMPTY_CLOSE_TAG=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token EMPTY_CLOSE_TAG");
+ var stream_SMALLER=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token SMALLER");
+ var stream_p_DirAttributeList=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"rule p_DirAttributeList");
+ var stream_pm_DirElemContent=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"rule pm_DirElemContent");
+ var stream_p_QName=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"rule p_QName");
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1139:9: ( SMALLER ts= p_QName p_DirAttributeList ( EMPTY_CLOSE_TAG | ( GREATER ( pm_DirElemContent )* CLOSE_TAG te= p_QName ( S )? GREATER ) ) -> ^( DirElemConstructor ^( DirAttributeList ( p_DirAttributeList )* ) ^( DirElemContent ( pm_DirElemContent )* ) ) )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1139:11: SMALLER ts= p_QName p_DirAttributeList ( EMPTY_CLOSE_TAG | ( GREATER ( pm_DirElemContent )* CLOSE_TAG te= p_QName ( S )? GREATER ) )
+ SMALLER373=this.match(this.input,SMALLER,XQueryParser.FOLLOW_SMALLER_in_p_DirElemConstructor8344); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_SMALLER.add(SMALLER373);
+
+ if ( this.state.backtracking===0 ) {
+ this.pushXMLLexer();
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_QName_in_p_DirElemConstructor8360);
+ ts=this.p_QName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_p_QName.add(ts.getTree());
+ if ( this.state.backtracking===0 ) {
+ this.at((ts?ts.start:null), (ts?ts.stop:null));
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_DirAttributeList_in_p_DirElemConstructor8365);
+ p_DirAttributeList374=this.p_DirAttributeList();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_p_DirAttributeList.add(p_DirAttributeList374.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1141:11: ( EMPTY_CLOSE_TAG | ( GREATER ( pm_DirElemContent )* CLOSE_TAG te= p_QName ( S )? GREATER ) )
+ var alt148=2;
+ var LA148_0 = this.input.LA(1);
+
+ if ( (LA148_0==EMPTY_CLOSE_TAG) ) {
+ alt148=1;
+ }
+ else if ( (LA148_0==GREATER) ) {
+ alt148=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 148, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt148) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1141:12: EMPTY_CLOSE_TAG
+ EMPTY_CLOSE_TAG375=this.match(this.input,EMPTY_CLOSE_TAG,XQueryParser.FOLLOW_EMPTY_CLOSE_TAG_in_p_DirElemConstructor8379); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_EMPTY_CLOSE_TAG.add(EMPTY_CLOSE_TAG375);
+
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1141:30: ( GREATER ( pm_DirElemContent )* CLOSE_TAG te= p_QName ( S )? GREATER )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1141:30: ( GREATER ( pm_DirElemContent )* CLOSE_TAG te= p_QName ( S )? GREATER )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1141:31: GREATER ( pm_DirElemContent )* CLOSE_TAG te= p_QName ( S )? GREATER
+ GREATER376=this.match(this.input,GREATER,XQueryParser.FOLLOW_GREATER_in_p_DirElemConstructor8384); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_GREATER.add(GREATER376);
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1141:39: ( pm_DirElemContent )*
+ loop146:
+ do {
+ var alt146=2;
+ var LA146_0 = this.input.LA(1);
+
+ if ( ((LA146_0>=L_ElementContentChar && LA146_0<=ESCAPE_RBRACKET)||LA146_0==LBRACKET||LA146_0==SMALLER||(LA146_0>=L_DirCommentConstructor && LA146_0<=L_DirPIConstructor)) ) {
+ alt146=1;
+ }
+
+
+ switch (alt146) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1141:39: pm_DirElemContent
+ this.pushFollow(XQueryParser.FOLLOW_pm_DirElemContent_in_p_DirElemConstructor8386);
+ pm_DirElemContent377=this.pm_DirElemContent();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_pm_DirElemContent.add(pm_DirElemContent377.getTree());
+
+
+ break;
+
+ default :
+ break loop146;
+ }
+ } while (true);
+
+ CLOSE_TAG378=this.match(this.input,CLOSE_TAG,XQueryParser.FOLLOW_CLOSE_TAG_in_p_DirElemConstructor8389); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_CLOSE_TAG.add(CLOSE_TAG378);
+
+ this.pushFollow(XQueryParser.FOLLOW_p_QName_in_p_DirElemConstructor8393);
+ te=this.p_QName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_p_QName.add(te.getTree());
+ if ( this.state.backtracking===0 ) {
+ this.at((te?te.start:null), (te?te.stop:null));
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1141:111: ( S )?
+ var alt147=2;
+ var LA147_0 = this.input.LA(1);
+
+ if ( (LA147_0==S) ) {
+ alt147=1;
+ }
+ switch (alt147) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1141:111: S
+ S379=this.match(this.input,S,XQueryParser.FOLLOW_S_in_p_DirElemConstructor8397); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_S.add(S379);
+
+
+
+ break;
+
+ }
+
+ GREATER380=this.match(this.input,GREATER,XQueryParser.FOLLOW_GREATER_in_p_DirElemConstructor8400); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_GREATER.add(GREATER380);
+
+
+
+
+
+
+ break;
+
+ }
+
+
+
+ // AST REWRITE
+ // elements: pm_DirElemContent, p_DirAttributeList
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( this.state.backtracking===0 ) {
+ retval.tree = root_0;
+ var stream_retval=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = this.adaptor.nil();
+ // 1142:17: -> ^( DirElemConstructor ^( DirAttributeList ( p_DirAttributeList )* ) ^( DirElemContent ( pm_DirElemContent )* ) )
+ {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1142:20: ^( DirElemConstructor ^( DirAttributeList ( p_DirAttributeList )* ) ^( DirElemContent ( pm_DirElemContent )* ) )
+ {
+ var root_1 = this.adaptor.nil();
+ root_1 = this.adaptor.becomeRoot(this.adaptor.create(DirElemConstructor, "DirElemConstructor"), root_1);
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1142:41: ^( DirAttributeList ( p_DirAttributeList )* )
+ {
+ var root_2 = this.adaptor.nil();
+ root_2 = this.adaptor.becomeRoot(this.adaptor.create(DirAttributeList, "DirAttributeList"), root_2);
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1142:60: ( p_DirAttributeList )*
+ while ( stream_p_DirAttributeList.hasNext() ) {
+ this.adaptor.addChild(root_2, stream_p_DirAttributeList.nextTree());
+
+ }
+ stream_p_DirAttributeList.reset();
+
+ this.adaptor.addChild(root_1, root_2);
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1142:81: ^( DirElemContent ( pm_DirElemContent )* )
+ {
+ var root_2 = this.adaptor.nil();
+ root_2 = this.adaptor.becomeRoot(this.adaptor.create(DirElemContent, "DirElemContent"), root_2);
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1142:98: ( pm_DirElemContent )*
+ while ( stream_pm_DirElemContent.hasNext() ) {
+ this.adaptor.addChild(root_2, stream_pm_DirElemContent.nextTree());
+
+ }
+ stream_pm_DirElemContent.reset();
+
+ this.adaptor.addChild(root_1, root_2);
+ }
+
+ this.adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;}
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ this.popLexer();
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_DirAttributeList_return: (function() {
+ XQueryParser.p_DirAttributeList_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_DirAttributeList_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1147:1: p_DirAttributeList : ( S (t= p_QName ( S )? EQUAL ( S )? v= p_DirAttributeValue )? )* ;
+ // $ANTLR start "p_DirAttributeList"
+ p_DirAttributeList: function() {
+ var retval = new XQueryParser.p_DirAttributeList_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var S381 = null;
+ var S382 = null;
+ var EQUAL383 = null;
+ var S384 = null;
+ var t = null;
+ var v = null;
+
+ var S381_tree=null;
+ var S382_tree=null;
+ var EQUAL383_tree=null;
+ var S384_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1148:9: ( ( S (t= p_QName ( S )? EQUAL ( S )? v= p_DirAttributeValue )? )* )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1148:11: ( S (t= p_QName ( S )? EQUAL ( S )? v= p_DirAttributeValue )? )*
+ root_0 = this.adaptor.nil();
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1148:11: ( S (t= p_QName ( S )? EQUAL ( S )? v= p_DirAttributeValue )? )*
+ loop152:
+ do {
+ var alt152=2;
+ var LA152_0 = this.input.LA(1);
+
+ if ( (LA152_0==S) ) {
+ alt152=1;
+ }
+
+
+ switch (alt152) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1148:12: S (t= p_QName ( S )? EQUAL ( S )? v= p_DirAttributeValue )?
+ S381=this.match(this.input,S,XQueryParser.FOLLOW_S_in_p_DirAttributeList8477); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ S381_tree = this.adaptor.create(S381);
+ this.adaptor.addChild(root_0, S381_tree);
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1148:14: (t= p_QName ( S )? EQUAL ( S )? v= p_DirAttributeValue )?
+ var alt151=2;
+ var LA151_0 = this.input.LA(1);
+
+ if ( ((LA151_0>=ANCESTOR && LA151_0<=SKIP)||(LA151_0>=VALUE && LA151_0<=QUOT_ER)||LA151_0==L_NCName) ) {
+ alt151=1;
+ }
+ switch (alt151) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1148:15: t= p_QName ( S )? EQUAL ( S )? v= p_DirAttributeValue
+ this.pushFollow(XQueryParser.FOLLOW_p_QName_in_p_DirAttributeList8482);
+ t=this.p_QName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, t.getTree());
+ if ( this.state.backtracking===0 ) {
+ this.at((t?t.start:null), (t?t.stop:null));
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1148:55: ( S )?
+ var alt149=2;
+ var LA149_0 = this.input.LA(1);
+
+ if ( (LA149_0==S) ) {
+ alt149=1;
+ }
+ switch (alt149) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1148:55: S
+ S382=this.match(this.input,S,XQueryParser.FOLLOW_S_in_p_DirAttributeList8486); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ S382_tree = this.adaptor.create(S382);
+ this.adaptor.addChild(root_0, S382_tree);
+ }
+
+
+ break;
+
+ }
+
+ EQUAL383=this.match(this.input,EQUAL,XQueryParser.FOLLOW_EQUAL_in_p_DirAttributeList8489); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ EQUAL383_tree = this.adaptor.create(EQUAL383);
+ this.adaptor.addChild(root_0, EQUAL383_tree);
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1148:64: ( S )?
+ var alt150=2;
+ var LA150_0 = this.input.LA(1);
+
+ if ( (LA150_0==S) ) {
+ alt150=1;
+ }
+ switch (alt150) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1148:64: S
+ S384=this.match(this.input,S,XQueryParser.FOLLOW_S_in_p_DirAttributeList8491); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ S384_tree = this.adaptor.create(S384);
+ this.adaptor.addChild(root_0, S384_tree);
+ }
+
+
+ break;
+
+ }
+
+ this.pushFollow(XQueryParser.FOLLOW_p_DirAttributeValue_in_p_DirAttributeList8496);
+ v=this.p_DirAttributeValue();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, v.getTree());
+
+
+ break;
+
+ }
+
+
+
+ break;
+
+ default :
+ break loop152;
+ }
+ } while (true);
+
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_DirAttributeValue_return: (function() {
+ XQueryParser.p_DirAttributeValue_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_DirAttributeValue_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1152:1: p_DirAttributeValue : ( (s+= QUOT (s+= ESCAPE_QUOT | s+= APOS | p_QuotAttrValueContent )* s+= QUOT ) -> ^( DirAttributeValue ( p_QuotAttrValueContent )* ) | (s+= APOS (s+= ESCAPE_APOS | s+= QUOT | p_AposAttrValueContent )* s+= APOS ) -> ^( DirAttributeValue ( p_AposAttrValueContent )* ) );
+ // $ANTLR start "p_DirAttributeValue"
+ p_DirAttributeValue: function() {
+ var retval = new XQueryParser.p_DirAttributeValue_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var s = null;
+ var list_s=null;
+ var p_QuotAttrValueContent385 = null;
+ var p_AposAttrValueContent386 = null;
+
+ var s_tree=null;
+ var stream_ESCAPE_QUOT=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token ESCAPE_QUOT");
+ var stream_APOS=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token APOS");
+ var stream_ESCAPE_APOS=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token ESCAPE_APOS");
+ var stream_QUOT=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token QUOT");
+ var stream_p_QuotAttrValueContent=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"rule p_QuotAttrValueContent");
+ var stream_p_AposAttrValueContent=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"rule p_AposAttrValueContent");
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1153:9: ( (s+= QUOT (s+= ESCAPE_QUOT | s+= APOS | p_QuotAttrValueContent )* s+= QUOT ) -> ^( DirAttributeValue ( p_QuotAttrValueContent )* ) | (s+= APOS (s+= ESCAPE_APOS | s+= QUOT | p_AposAttrValueContent )* s+= APOS ) -> ^( DirAttributeValue ( p_AposAttrValueContent )* ) )
+ var alt155=2;
+ var LA155_0 = this.input.LA(1);
+
+ if ( (LA155_0==QUOT) ) {
+ alt155=1;
+ }
+ else if ( (LA155_0==APOS) ) {
+ alt155=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 155, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt155) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1153:11: (s+= QUOT (s+= ESCAPE_QUOT | s+= APOS | p_QuotAttrValueContent )* s+= QUOT )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1153:11: (s+= QUOT (s+= ESCAPE_QUOT | s+= APOS | p_QuotAttrValueContent )* s+= QUOT )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1153:12: s+= QUOT (s+= ESCAPE_QUOT | s+= APOS | p_QuotAttrValueContent )* s+= QUOT
+ s=this.match(this.input,QUOT,XQueryParser.FOLLOW_QUOT_in_p_DirAttributeValue8530); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_QUOT.add(s);
+
+ if (org.antlr.lang.isNull(list_s)) list_s = [];
+ list_s.push(s);
+
+ if ( this.state.backtracking===0 ) {
+ this.isInAttr = true;
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1153:45: (s+= ESCAPE_QUOT | s+= APOS | p_QuotAttrValueContent )*
+ loop153:
+ do {
+ var alt153=4;
+ switch ( this.input.LA(1) ) {
+ case ESCAPE_QUOT:
+ alt153=1;
+ break;
+ case APOS:
+ alt153=2;
+ break;
+ case L_QuotAttrContentChar:
+ case L_PredefinedEntityRef:
+ case L_CharRef:
+ case ESCAPE_LBRACKET:
+ case ESCAPE_RBRACKET:
+ case LBRACKET:
+ alt153=3;
+ break;
+
+ }
+
+ switch (alt153) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1153:46: s+= ESCAPE_QUOT
+ s=this.match(this.input,ESCAPE_QUOT,XQueryParser.FOLLOW_ESCAPE_QUOT_in_p_DirAttributeValue8537); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_ESCAPE_QUOT.add(s);
+
+ if (org.antlr.lang.isNull(list_s)) list_s = [];
+ list_s.push(s);
+
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1153:63: s+= APOS
+ s=this.match(this.input,APOS,XQueryParser.FOLLOW_APOS_in_p_DirAttributeValue8543); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_APOS.add(s);
+
+ if (org.antlr.lang.isNull(list_s)) list_s = [];
+ list_s.push(s);
+
+
+
+ break;
+ case 3 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1153:73: p_QuotAttrValueContent
+ this.pushFollow(XQueryParser.FOLLOW_p_QuotAttrValueContent_in_p_DirAttributeValue8547);
+ p_QuotAttrValueContent385=this.p_QuotAttrValueContent();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_p_QuotAttrValueContent.add(p_QuotAttrValueContent385.getTree());
+
+
+ break;
+
+ default :
+ break loop153;
+ }
+ } while (true);
+
+ s=this.match(this.input,QUOT,XQueryParser.FOLLOW_QUOT_in_p_DirAttributeValue8553); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_QUOT.add(s);
+
+ if (org.antlr.lang.isNull(list_s)) list_s = [];
+ list_s.push(s);
+
+ if ( this.state.backtracking===0 ) {
+ this.isInAttr = false;
+ }
+
+
+
+ if ( this.state.backtracking===0 ) {
+ this.addToken(list_s, "string");
+ }
+
+
+ // AST REWRITE
+ // elements: p_QuotAttrValueContent
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( this.state.backtracking===0 ) {
+ retval.tree = root_0;
+ var stream_retval=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = this.adaptor.nil();
+ // 1154:17: -> ^( DirAttributeValue ( p_QuotAttrValueContent )* )
+ {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1154:20: ^( DirAttributeValue ( p_QuotAttrValueContent )* )
+ {
+ var root_1 = this.adaptor.nil();
+ root_1 = this.adaptor.becomeRoot(this.adaptor.create(DirAttributeValue, "DirAttributeValue"), root_1);
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1154:40: ( p_QuotAttrValueContent )*
+ while ( stream_p_QuotAttrValueContent.hasNext() ) {
+ this.adaptor.addChild(root_1, stream_p_QuotAttrValueContent.nextTree());
+
+ }
+ stream_p_QuotAttrValueContent.reset();
+
+ this.adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;}
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1155:11: (s+= APOS (s+= ESCAPE_APOS | s+= QUOT | p_AposAttrValueContent )* s+= APOS )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1155:11: (s+= APOS (s+= ESCAPE_APOS | s+= QUOT | p_AposAttrValueContent )* s+= APOS )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1155:12: s+= APOS (s+= ESCAPE_APOS | s+= QUOT | p_AposAttrValueContent )* s+= APOS
+ s=this.match(this.input,APOS,XQueryParser.FOLLOW_APOS_in_p_DirAttributeValue8598); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_APOS.add(s);
+
+ if (org.antlr.lang.isNull(list_s)) list_s = [];
+ list_s.push(s);
+
+ if ( this.state.backtracking===0 ) {
+ this.isInAttr = true;
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1155:46: (s+= ESCAPE_APOS | s+= QUOT | p_AposAttrValueContent )*
+ loop154:
+ do {
+ var alt154=4;
+ switch ( this.input.LA(1) ) {
+ case ESCAPE_APOS:
+ alt154=1;
+ break;
+ case QUOT:
+ alt154=2;
+ break;
+ case L_AposAttrContentChar:
+ case L_PredefinedEntityRef:
+ case L_CharRef:
+ case ESCAPE_LBRACKET:
+ case ESCAPE_RBRACKET:
+ case LBRACKET:
+ alt154=3;
+ break;
+
+ }
+
+ switch (alt154) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1155:47: s+= ESCAPE_APOS
+ s=this.match(this.input,ESCAPE_APOS,XQueryParser.FOLLOW_ESCAPE_APOS_in_p_DirAttributeValue8605); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_ESCAPE_APOS.add(s);
+
+ if (org.antlr.lang.isNull(list_s)) list_s = [];
+ list_s.push(s);
+
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1155:64: s+= QUOT
+ s=this.match(this.input,QUOT,XQueryParser.FOLLOW_QUOT_in_p_DirAttributeValue8611); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_QUOT.add(s);
+
+ if (org.antlr.lang.isNull(list_s)) list_s = [];
+ list_s.push(s);
+
+
+
+ break;
+ case 3 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1155:74: p_AposAttrValueContent
+ this.pushFollow(XQueryParser.FOLLOW_p_AposAttrValueContent_in_p_DirAttributeValue8615);
+ p_AposAttrValueContent386=this.p_AposAttrValueContent();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_p_AposAttrValueContent.add(p_AposAttrValueContent386.getTree());
+
+
+ break;
+
+ default :
+ break loop154;
+ }
+ } while (true);
+
+ s=this.match(this.input,APOS,XQueryParser.FOLLOW_APOS_in_p_DirAttributeValue8621); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_APOS.add(s);
+
+ if (org.antlr.lang.isNull(list_s)) list_s = [];
+ list_s.push(s);
+
+ if ( this.state.backtracking===0 ) {
+ this.isInAttr = false;
+ }
+
+
+
+ if ( this.state.backtracking===0 ) {
+ this.addToken(list_s, "string");
+ }
+
+
+ // AST REWRITE
+ // elements: p_AposAttrValueContent
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( this.state.backtracking===0 ) {
+ retval.tree = root_0;
+ var stream_retval=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = this.adaptor.nil();
+ // 1156:17: -> ^( DirAttributeValue ( p_AposAttrValueContent )* )
+ {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1156:20: ^( DirAttributeValue ( p_AposAttrValueContent )* )
+ {
+ var root_1 = this.adaptor.nil();
+ root_1 = this.adaptor.becomeRoot(this.adaptor.create(DirAttributeValue, "DirAttributeValue"), root_1);
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1156:40: ( p_AposAttrValueContent )*
+ while ( stream_p_AposAttrValueContent.hasNext() ) {
+ this.adaptor.addChild(root_1, stream_p_AposAttrValueContent.nextTree());
+
+ }
+ stream_p_AposAttrValueContent.reset();
+
+ this.adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;}
+
+ break;
+
+ }
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_QuotAttrValueContent_return: (function() {
+ XQueryParser.p_QuotAttrValueContent_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_QuotAttrValueContent_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1160:1: p_QuotAttrValueContent : (s= p_QuotAttrContentChar | pm_CommonContent );
+ // $ANTLR start "p_QuotAttrValueContent"
+ p_QuotAttrValueContent: function() {
+ var retval = new XQueryParser.p_QuotAttrValueContent_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var s = null;
+ var pm_CommonContent387 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1161:9: (s= p_QuotAttrContentChar | pm_CommonContent )
+ var alt156=2;
+ var LA156_0 = this.input.LA(1);
+
+ if ( (LA156_0==L_QuotAttrContentChar) ) {
+ alt156=1;
+ }
+ else if ( ((LA156_0>=L_PredefinedEntityRef && LA156_0<=ESCAPE_RBRACKET)||LA156_0==LBRACKET) ) {
+ alt156=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 156, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt156) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1161:11: s= p_QuotAttrContentChar
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_QuotAttrContentChar_in_p_QuotAttrValueContent8679);
+ s=this.p_QuotAttrContentChar();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, s.getTree());
+ if ( this.state.backtracking===0 ) {
+ this.addString((s?s.start:null), (s?s.stop:null));
+ }
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1161:76: pm_CommonContent
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_pm_CommonContent_in_p_QuotAttrValueContent8685);
+ pm_CommonContent387=this.pm_CommonContent();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, pm_CommonContent387.getTree());
+
+
+ break;
+
+ }
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_AposAttrValueContent_return: (function() {
+ XQueryParser.p_AposAttrValueContent_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_AposAttrValueContent_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1165:1: p_AposAttrValueContent : (s= p_AposAttrContentChar | pm_CommonContent );
+ // $ANTLR start "p_AposAttrValueContent"
+ p_AposAttrValueContent: function() {
+ var retval = new XQueryParser.p_AposAttrValueContent_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var s = null;
+ var pm_CommonContent388 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1166:9: (s= p_AposAttrContentChar | pm_CommonContent )
+ var alt157=2;
+ var LA157_0 = this.input.LA(1);
+
+ if ( (LA157_0==L_AposAttrContentChar) ) {
+ alt157=1;
+ }
+ else if ( ((LA157_0>=L_PredefinedEntityRef && LA157_0<=ESCAPE_RBRACKET)||LA157_0==LBRACKET) ) {
+ alt157=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 157, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt157) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1166:11: s= p_AposAttrContentChar
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_AposAttrContentChar_in_p_AposAttrValueContent8713);
+ s=this.p_AposAttrContentChar();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, s.getTree());
+ if ( this.state.backtracking===0 ) {
+ this.addString((s?s.start:null), (s?s.stop:null));
+ }
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1166:76: pm_CommonContent
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_pm_CommonContent_in_p_AposAttrValueContent8719);
+ pm_CommonContent388=this.pm_CommonContent();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, pm_CommonContent388.getTree());
+
+
+ break;
+
+ }
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ pm_DirElemContent_return: (function() {
+ XQueryParser.pm_DirElemContent_return = function(){};
+ org.antlr.lang.extend(XQueryParser.pm_DirElemContent_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1170:1: pm_DirElemContent : ( p_DirectConstructor | p_CDataSection | pm_CommonContent | p_ElementContentChar );
+ // $ANTLR start "pm_DirElemContent"
+ pm_DirElemContent: function() {
+ var retval = new XQueryParser.pm_DirElemContent_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_DirectConstructor389 = null;
+ var p_CDataSection390 = null;
+ var pm_CommonContent391 = null;
+ var p_ElementContentChar392 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1171:9: ( p_DirectConstructor | p_CDataSection | pm_CommonContent | p_ElementContentChar )
+ var alt158=4;
+ switch ( this.input.LA(1) ) {
+ case SMALLER:
+ case L_DirCommentConstructor:
+ case L_DirPIConstructor:
+ alt158=1;
+ break;
+ case L_CDataSection:
+ alt158=2;
+ break;
+ case L_PredefinedEntityRef:
+ case L_CharRef:
+ case ESCAPE_LBRACKET:
+ case ESCAPE_RBRACKET:
+ case LBRACKET:
+ alt158=3;
+ break;
+ case L_ElementContentChar:
+ alt158=4;
+ break;
+ default:
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 158, 0, this.input);
+
+ throw nvae;
+ }
+
+ switch (alt158) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1171:11: p_DirectConstructor
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_DirectConstructor_in_pm_DirElemContent8745);
+ p_DirectConstructor389=this.p_DirectConstructor();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_DirectConstructor389.getTree());
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1172:11: p_CDataSection
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_CDataSection_in_pm_DirElemContent8757);
+ p_CDataSection390=this.p_CDataSection();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_CDataSection390.getTree());
+
+
+ break;
+ case 3 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1173:11: pm_CommonContent
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_pm_CommonContent_in_pm_DirElemContent8769);
+ pm_CommonContent391=this.pm_CommonContent();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, pm_CommonContent391.getTree());
+
+
+ break;
+ case 4 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1174:11: p_ElementContentChar
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_ElementContentChar_in_pm_DirElemContent8781);
+ p_ElementContentChar392=this.p_ElementContentChar();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ElementContentChar392.getTree());
+
+
+ break;
+
+ }
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ pm_CommonContent_return: (function() {
+ XQueryParser.pm_CommonContent_return = function(){};
+ org.antlr.lang.extend(XQueryParser.pm_CommonContent_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1180:1: pm_CommonContent : ( L_PredefinedEntityRef | L_CharRef | s= ESCAPE_LBRACKET | s= ESCAPE_RBRACKET | pg_EnclosedExprXml );
+ // $ANTLR start "pm_CommonContent"
+ pm_CommonContent: function() {
+ var retval = new XQueryParser.pm_CommonContent_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var s = null;
+ var L_PredefinedEntityRef393 = null;
+ var L_CharRef394 = null;
+ var pg_EnclosedExprXml395 = null;
+
+ var s_tree=null;
+ var L_PredefinedEntityRef393_tree=null;
+ var L_CharRef394_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1181:9: ( L_PredefinedEntityRef | L_CharRef | s= ESCAPE_LBRACKET | s= ESCAPE_RBRACKET | pg_EnclosedExprXml )
+ var alt159=5;
+ switch ( this.input.LA(1) ) {
+ case L_PredefinedEntityRef:
+ alt159=1;
+ break;
+ case L_CharRef:
+ alt159=2;
+ break;
+ case ESCAPE_LBRACKET:
+ alt159=3;
+ break;
+ case ESCAPE_RBRACKET:
+ alt159=4;
+ break;
+ case LBRACKET:
+ alt159=5;
+ break;
+ default:
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 159, 0, this.input);
+
+ throw nvae;
+ }
+
+ switch (alt159) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1181:11: L_PredefinedEntityRef
+ root_0 = this.adaptor.nil();
+
+ L_PredefinedEntityRef393=this.match(this.input,L_PredefinedEntityRef,XQueryParser.FOLLOW_L_PredefinedEntityRef_in_pm_CommonContent8809); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ L_PredefinedEntityRef393_tree = this.adaptor.create(L_PredefinedEntityRef393);
+ this.adaptor.addChild(root_0, L_PredefinedEntityRef393_tree);
+ }
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1182:11: L_CharRef
+ root_0 = this.adaptor.nil();
+
+ L_CharRef394=this.match(this.input,L_CharRef,XQueryParser.FOLLOW_L_CharRef_in_pm_CommonContent8821); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ L_CharRef394_tree = this.adaptor.create(L_CharRef394);
+ this.adaptor.addChild(root_0, L_CharRef394_tree);
+ }
+
+
+ break;
+ case 3 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1183:11: s= ESCAPE_LBRACKET
+ root_0 = this.adaptor.nil();
+
+ s=this.match(this.input,ESCAPE_LBRACKET,XQueryParser.FOLLOW_ESCAPE_LBRACKET_in_pm_CommonContent8835); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ s_tree = this.adaptor.create(s);
+ this.adaptor.addChild(root_0, s_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ if(this.isInAttr) { this.addToken(s, "string"); }
+ }
+
+
+ break;
+ case 4 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1184:11: s= ESCAPE_RBRACKET
+ root_0 = this.adaptor.nil();
+
+ s=this.match(this.input,ESCAPE_RBRACKET,XQueryParser.FOLLOW_ESCAPE_RBRACKET_in_pm_CommonContent8851); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ s_tree = this.adaptor.create(s);
+ this.adaptor.addChild(root_0, s_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ if(this.isInAttr) { this.addToken(s, "string"); }
+ }
+
+
+ break;
+ case 5 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1185:11: pg_EnclosedExprXml
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_pg_EnclosedExprXml_in_pm_CommonContent8865);
+ pg_EnclosedExprXml395=this.pg_EnclosedExprXml();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, pg_EnclosedExprXml395.getTree());
+
+
+ break;
+
+ }
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ pg_EnclosedExprXml_return: (function() {
+ XQueryParser.pg_EnclosedExprXml_return = function(){};
+ org.antlr.lang.extend(XQueryParser.pg_EnclosedExprXml_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1193:1: pg_EnclosedExprXml : LBRACKET p_StatementsAndOptionalExpr RBRACKET ;
+ // $ANTLR start "pg_EnclosedExprXml"
+ pg_EnclosedExprXml: function() {
+ var retval = new XQueryParser.pg_EnclosedExprXml_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var LBRACKET396 = null;
+ var RBRACKET398 = null;
+ var p_StatementsAndOptionalExpr397 = null;
+
+ var LBRACKET396_tree=null;
+ var RBRACKET398_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1194:9: ( LBRACKET p_StatementsAndOptionalExpr RBRACKET )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1194:13: LBRACKET p_StatementsAndOptionalExpr RBRACKET
+ root_0 = this.adaptor.nil();
+
+ LBRACKET396=this.match(this.input,LBRACKET,XQueryParser.FOLLOW_LBRACKET_in_pg_EnclosedExprXml8897); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LBRACKET396_tree = this.adaptor.create(LBRACKET396);
+ this.adaptor.addChild(root_0, LBRACKET396_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.pushXQueryLexer();
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_StatementsAndOptionalExpr_in_pg_EnclosedExprXml8913);
+ p_StatementsAndOptionalExpr397=this.p_StatementsAndOptionalExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_StatementsAndOptionalExpr397.getTree());
+ RBRACKET398=this.match(this.input,RBRACKET,XQueryParser.FOLLOW_RBRACKET_in_pg_EnclosedExprXml8927); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RBRACKET398_tree = this.adaptor.create(RBRACKET398);
+ this.adaptor.addChild(root_0, RBRACKET398_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.popLexer();
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_DirCommentConstructor_return: (function() {
+ XQueryParser.p_DirCommentConstructor_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_DirCommentConstructor_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1201:1: p_DirCommentConstructor : c= L_DirCommentConstructor ;
+ // $ANTLR start "p_DirCommentConstructor"
+ p_DirCommentConstructor: function() {
+ var retval = new XQueryParser.p_DirCommentConstructor_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var c = null;
+
+ var c_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1202:9: (c= L_DirCommentConstructor )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1202:11: c= L_DirCommentConstructor
+ root_0 = this.adaptor.nil();
+
+ c=this.match(this.input,L_DirCommentConstructor,XQueryParser.FOLLOW_L_DirCommentConstructor_in_p_DirCommentConstructor8958); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ c_tree = this.adaptor.create(c);
+ this.adaptor.addChild(root_0, c_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ac(c);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_DirPIConstructor_return: (function() {
+ XQueryParser.p_DirPIConstructor_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_DirPIConstructor_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1209:1: p_DirPIConstructor : p= L_DirPIConstructor ;
+ // $ANTLR start "p_DirPIConstructor"
+ p_DirPIConstructor: function() {
+ var retval = new XQueryParser.p_DirPIConstructor_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p = null;
+
+ var p_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1210:9: (p= L_DirPIConstructor )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1210:11: p= L_DirPIConstructor
+ root_0 = this.adaptor.nil();
+
+ p=this.match(this.input,L_DirPIConstructor,XQueryParser.FOLLOW_L_DirPIConstructor_in_p_DirPIConstructor8994); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ p_tree = this.adaptor.create(p);
+ this.adaptor.addChild(root_0, p_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ap(p);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_CDataSection_return: (function() {
+ XQueryParser.p_CDataSection_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_CDataSection_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1217:1: p_CDataSection : c= L_CDataSection ;
+ // $ANTLR start "p_CDataSection"
+ p_CDataSection: function() {
+ var retval = new XQueryParser.p_CDataSection_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var c = null;
+
+ var c_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1218:9: (c= L_CDataSection )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1218:11: c= L_CDataSection
+ root_0 = this.adaptor.nil();
+
+ c=this.match(this.input,L_CDataSection,XQueryParser.FOLLOW_L_CDataSection_in_p_CDataSection9031); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ c_tree = this.adaptor.create(c);
+ this.adaptor.addChild(root_0, c_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ac(c);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_ComputedConstructor_return: (function() {
+ XQueryParser.p_ComputedConstructor_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_ComputedConstructor_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1225:1: p_ComputedConstructor : ( pm_CompDocConstructor | pm_CompElemConstructor | pm_CompAttrConstructor | p_CompNamespaceConstructor | p_CompTextConstructor | pm_CompCommentConstructor | pm_CompPIConstructor );
+ // $ANTLR start "p_ComputedConstructor"
+ p_ComputedConstructor: function() {
+ var retval = new XQueryParser.p_ComputedConstructor_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var pm_CompDocConstructor399 = null;
+ var pm_CompElemConstructor400 = null;
+ var pm_CompAttrConstructor401 = null;
+ var p_CompNamespaceConstructor402 = null;
+ var p_CompTextConstructor403 = null;
+ var pm_CompCommentConstructor404 = null;
+ var pm_CompPIConstructor405 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1226:9: ( pm_CompDocConstructor | pm_CompElemConstructor | pm_CompAttrConstructor | p_CompNamespaceConstructor | p_CompTextConstructor | pm_CompCommentConstructor | pm_CompPIConstructor )
+ var alt160=7;
+ switch ( this.input.LA(1) ) {
+ case DOCUMENT:
+ alt160=1;
+ break;
+ case ELEMENT:
+ alt160=2;
+ break;
+ case ATTRIBUTE:
+ alt160=3;
+ break;
+ case NAMESPACE:
+ alt160=4;
+ break;
+ case TEXT:
+ alt160=5;
+ break;
+ case COMMENT:
+ alt160=6;
+ break;
+ case PROCESSING_INSTRUCTION:
+ alt160=7;
+ break;
+ default:
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 160, 0, this.input);
+
+ throw nvae;
+ }
+
+ switch (alt160) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1226:11: pm_CompDocConstructor
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_pm_CompDocConstructor_in_p_ComputedConstructor9065);
+ pm_CompDocConstructor399=this.pm_CompDocConstructor();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, pm_CompDocConstructor399.getTree());
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1227:11: pm_CompElemConstructor
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_pm_CompElemConstructor_in_p_ComputedConstructor9077);
+ pm_CompElemConstructor400=this.pm_CompElemConstructor();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, pm_CompElemConstructor400.getTree());
+
+
+ break;
+ case 3 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1228:11: pm_CompAttrConstructor
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_pm_CompAttrConstructor_in_p_ComputedConstructor9089);
+ pm_CompAttrConstructor401=this.pm_CompAttrConstructor();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, pm_CompAttrConstructor401.getTree());
+
+
+ break;
+ case 4 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1229:11: p_CompNamespaceConstructor
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_CompNamespaceConstructor_in_p_ComputedConstructor9101);
+ p_CompNamespaceConstructor402=this.p_CompNamespaceConstructor();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_CompNamespaceConstructor402.getTree());
+
+
+ break;
+ case 5 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1230:11: p_CompTextConstructor
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_CompTextConstructor_in_p_ComputedConstructor9113);
+ p_CompTextConstructor403=this.p_CompTextConstructor();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_CompTextConstructor403.getTree());
+
+
+ break;
+ case 6 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1231:11: pm_CompCommentConstructor
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_pm_CompCommentConstructor_in_p_ComputedConstructor9125);
+ pm_CompCommentConstructor404=this.pm_CompCommentConstructor();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, pm_CompCommentConstructor404.getTree());
+
+
+ break;
+ case 7 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1232:11: pm_CompPIConstructor
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_pm_CompPIConstructor_in_p_ComputedConstructor9137);
+ pm_CompPIConstructor405=this.pm_CompPIConstructor();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, pm_CompPIConstructor405.getTree());
+
+
+ break;
+
+ }
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ pm_CompDocConstructor_return: (function() {
+ XQueryParser.pm_CompDocConstructor_return = function(){};
+ org.antlr.lang.extend(XQueryParser.pm_CompDocConstructor_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1237:1: pm_CompDocConstructor : k= DOCUMENT LBRACKET p_StatementsAndOptionalExpr RBRACKET ;
+ // $ANTLR start "pm_CompDocConstructor"
+ pm_CompDocConstructor: function() {
+ var retval = new XQueryParser.pm_CompDocConstructor_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var LBRACKET406 = null;
+ var RBRACKET408 = null;
+ var p_StatementsAndOptionalExpr407 = null;
+
+ var k_tree=null;
+ var LBRACKET406_tree=null;
+ var RBRACKET408_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1238:9: (k= DOCUMENT LBRACKET p_StatementsAndOptionalExpr RBRACKET )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1238:11: k= DOCUMENT LBRACKET p_StatementsAndOptionalExpr RBRACKET
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,DOCUMENT,XQueryParser.FOLLOW_DOCUMENT_in_pm_CompDocConstructor9166); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ LBRACKET406=this.match(this.input,LBRACKET,XQueryParser.FOLLOW_LBRACKET_in_pm_CompDocConstructor9170); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LBRACKET406_tree = this.adaptor.create(LBRACKET406);
+ this.adaptor.addChild(root_0, LBRACKET406_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_StatementsAndOptionalExpr_in_pm_CompDocConstructor9172);
+ p_StatementsAndOptionalExpr407=this.p_StatementsAndOptionalExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_StatementsAndOptionalExpr407.getTree());
+ RBRACKET408=this.match(this.input,RBRACKET,XQueryParser.FOLLOW_RBRACKET_in_pm_CompDocConstructor9174); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RBRACKET408_tree = this.adaptor.create(RBRACKET408);
+ this.adaptor.addChild(root_0, RBRACKET408_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ pm_CompElemConstructor_return: (function() {
+ XQueryParser.pm_CompElemConstructor_return = function(){};
+ org.antlr.lang.extend(XQueryParser.pm_CompElemConstructor_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1242:1: pm_CompElemConstructor : k= ELEMENT ( p_EQName | ( LBRACKET p_Expr[true,true] RBRACKET ) ) LBRACKET pm_ContentExpr RBRACKET ;
+ // $ANTLR start "pm_CompElemConstructor"
+ pm_CompElemConstructor: function() {
+ var retval = new XQueryParser.pm_CompElemConstructor_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var LBRACKET410 = null;
+ var RBRACKET412 = null;
+ var LBRACKET413 = null;
+ var RBRACKET415 = null;
+ var p_EQName409 = null;
+ var p_Expr411 = null;
+ var pm_ContentExpr414 = null;
+
+ var k_tree=null;
+ var LBRACKET410_tree=null;
+ var RBRACKET412_tree=null;
+ var LBRACKET413_tree=null;
+ var RBRACKET415_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1243:9: (k= ELEMENT ( p_EQName | ( LBRACKET p_Expr[true,true] RBRACKET ) ) LBRACKET pm_ContentExpr RBRACKET )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1243:11: k= ELEMENT ( p_EQName | ( LBRACKET p_Expr[true,true] RBRACKET ) ) LBRACKET pm_ContentExpr RBRACKET
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,ELEMENT,XQueryParser.FOLLOW_ELEMENT_in_pm_CompElemConstructor9210); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1243:36: ( p_EQName | ( LBRACKET p_Expr[true,true] RBRACKET ) )
+ var alt161=2;
+ var LA161_0 = this.input.LA(1);
+
+ if ( ((LA161_0>=ANCESTOR && LA161_0<=SKIP)||(LA161_0>=VALUE && LA161_0<=QUOT_ER)||LA161_0==Q||LA161_0==L_NCName) ) {
+ alt161=1;
+ }
+ else if ( (LA161_0==LBRACKET) ) {
+ alt161=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 161, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt161) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1243:37: p_EQName
+ this.pushFollow(XQueryParser.FOLLOW_p_EQName_in_pm_CompElemConstructor9215);
+ p_EQName409=this.p_EQName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_EQName409.getTree());
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1243:48: ( LBRACKET p_Expr[true,true] RBRACKET )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1243:48: ( LBRACKET p_Expr[true,true] RBRACKET )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1243:49: LBRACKET p_Expr[true,true] RBRACKET
+ LBRACKET410=this.match(this.input,LBRACKET,XQueryParser.FOLLOW_LBRACKET_in_pm_CompElemConstructor9220); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LBRACKET410_tree = this.adaptor.create(LBRACKET410);
+ this.adaptor.addChild(root_0, LBRACKET410_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_Expr_in_pm_CompElemConstructor9222);
+ p_Expr411=this.p_Expr(true, true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Expr411.getTree());
+ RBRACKET412=this.match(this.input,RBRACKET,XQueryParser.FOLLOW_RBRACKET_in_pm_CompElemConstructor9225); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RBRACKET412_tree = this.adaptor.create(RBRACKET412);
+ this.adaptor.addChild(root_0, RBRACKET412_tree);
+ }
+
+
+
+
+
+ break;
+
+ }
+
+ LBRACKET413=this.match(this.input,LBRACKET,XQueryParser.FOLLOW_LBRACKET_in_pm_CompElemConstructor9229); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LBRACKET413_tree = this.adaptor.create(LBRACKET413);
+ this.adaptor.addChild(root_0, LBRACKET413_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_pm_ContentExpr_in_pm_CompElemConstructor9231);
+ pm_ContentExpr414=this.pm_ContentExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, pm_ContentExpr414.getTree());
+ RBRACKET415=this.match(this.input,RBRACKET,XQueryParser.FOLLOW_RBRACKET_in_pm_CompElemConstructor9233); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RBRACKET415_tree = this.adaptor.create(RBRACKET415);
+ this.adaptor.addChild(root_0, RBRACKET415_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ pm_ContentExpr_return: (function() {
+ XQueryParser.pm_ContentExpr_return = function(){};
+ org.antlr.lang.extend(XQueryParser.pm_ContentExpr_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1248:1: pm_ContentExpr : p_StatementsAndOptionalExpr ;
+ // $ANTLR start "pm_ContentExpr"
+ pm_ContentExpr: function() {
+ var retval = new XQueryParser.pm_ContentExpr_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_StatementsAndOptionalExpr416 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1249:9: ( p_StatementsAndOptionalExpr )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1249:11: p_StatementsAndOptionalExpr
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_StatementsAndOptionalExpr_in_pm_ContentExpr9260);
+ p_StatementsAndOptionalExpr416=this.p_StatementsAndOptionalExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_StatementsAndOptionalExpr416.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ pm_CompAttrConstructor_return: (function() {
+ XQueryParser.pm_CompAttrConstructor_return = function(){};
+ org.antlr.lang.extend(XQueryParser.pm_CompAttrConstructor_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1254:1: pm_CompAttrConstructor : k= ATTRIBUTE ( p_EQName | ( LBRACKET p_Expr[true,true] RBRACKET ) ) LBRACKET p_StatementsAndOptionalExpr RBRACKET ;
+ // $ANTLR start "pm_CompAttrConstructor"
+ pm_CompAttrConstructor: function() {
+ var retval = new XQueryParser.pm_CompAttrConstructor_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var LBRACKET418 = null;
+ var RBRACKET420 = null;
+ var LBRACKET421 = null;
+ var RBRACKET423 = null;
+ var p_EQName417 = null;
+ var p_Expr419 = null;
+ var p_StatementsAndOptionalExpr422 = null;
+
+ var k_tree=null;
+ var LBRACKET418_tree=null;
+ var RBRACKET420_tree=null;
+ var LBRACKET421_tree=null;
+ var RBRACKET423_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1255:9: (k= ATTRIBUTE ( p_EQName | ( LBRACKET p_Expr[true,true] RBRACKET ) ) LBRACKET p_StatementsAndOptionalExpr RBRACKET )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1255:11: k= ATTRIBUTE ( p_EQName | ( LBRACKET p_Expr[true,true] RBRACKET ) ) LBRACKET p_StatementsAndOptionalExpr RBRACKET
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,ATTRIBUTE,XQueryParser.FOLLOW_ATTRIBUTE_in_pm_CompAttrConstructor9289); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1255:38: ( p_EQName | ( LBRACKET p_Expr[true,true] RBRACKET ) )
+ var alt162=2;
+ var LA162_0 = this.input.LA(1);
+
+ if ( ((LA162_0>=ANCESTOR && LA162_0<=SKIP)||(LA162_0>=VALUE && LA162_0<=QUOT_ER)||LA162_0==Q||LA162_0==L_NCName) ) {
+ alt162=1;
+ }
+ else if ( (LA162_0==LBRACKET) ) {
+ alt162=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 162, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt162) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1255:39: p_EQName
+ this.pushFollow(XQueryParser.FOLLOW_p_EQName_in_pm_CompAttrConstructor9294);
+ p_EQName417=this.p_EQName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_EQName417.getTree());
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1255:50: ( LBRACKET p_Expr[true,true] RBRACKET )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1255:50: ( LBRACKET p_Expr[true,true] RBRACKET )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1255:51: LBRACKET p_Expr[true,true] RBRACKET
+ LBRACKET418=this.match(this.input,LBRACKET,XQueryParser.FOLLOW_LBRACKET_in_pm_CompAttrConstructor9299); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LBRACKET418_tree = this.adaptor.create(LBRACKET418);
+ this.adaptor.addChild(root_0, LBRACKET418_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_Expr_in_pm_CompAttrConstructor9301);
+ p_Expr419=this.p_Expr(true, true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Expr419.getTree());
+ RBRACKET420=this.match(this.input,RBRACKET,XQueryParser.FOLLOW_RBRACKET_in_pm_CompAttrConstructor9304); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RBRACKET420_tree = this.adaptor.create(RBRACKET420);
+ this.adaptor.addChild(root_0, RBRACKET420_tree);
+ }
+
+
+
+
+
+ break;
+
+ }
+
+ LBRACKET421=this.match(this.input,LBRACKET,XQueryParser.FOLLOW_LBRACKET_in_pm_CompAttrConstructor9308); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LBRACKET421_tree = this.adaptor.create(LBRACKET421);
+ this.adaptor.addChild(root_0, LBRACKET421_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_StatementsAndOptionalExpr_in_pm_CompAttrConstructor9310);
+ p_StatementsAndOptionalExpr422=this.p_StatementsAndOptionalExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_StatementsAndOptionalExpr422.getTree());
+ RBRACKET423=this.match(this.input,RBRACKET,XQueryParser.FOLLOW_RBRACKET_in_pm_CompAttrConstructor9312); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RBRACKET423_tree = this.adaptor.create(RBRACKET423);
+ this.adaptor.addChild(root_0, RBRACKET423_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_CompNamespaceConstructor_return: (function() {
+ XQueryParser.p_CompNamespaceConstructor_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_CompNamespaceConstructor_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1259:1: p_CompNamespaceConstructor : k= NAMESPACE ( p_Prefix | ( LBRACKET p_PrefixExpr RBRACKET ) ) LBRACKET ( p_URIExpr )? RBRACKET ;
+ // $ANTLR start "p_CompNamespaceConstructor"
+ p_CompNamespaceConstructor: function() {
+ var retval = new XQueryParser.p_CompNamespaceConstructor_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var LBRACKET425 = null;
+ var RBRACKET427 = null;
+ var LBRACKET428 = null;
+ var RBRACKET430 = null;
+ var p_Prefix424 = null;
+ var p_PrefixExpr426 = null;
+ var p_URIExpr429 = null;
+
+ var k_tree=null;
+ var LBRACKET425_tree=null;
+ var RBRACKET427_tree=null;
+ var LBRACKET428_tree=null;
+ var RBRACKET430_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1260:9: (k= NAMESPACE ( p_Prefix | ( LBRACKET p_PrefixExpr RBRACKET ) ) LBRACKET ( p_URIExpr )? RBRACKET )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1260:11: k= NAMESPACE ( p_Prefix | ( LBRACKET p_PrefixExpr RBRACKET ) ) LBRACKET ( p_URIExpr )? RBRACKET
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,NAMESPACE,XQueryParser.FOLLOW_NAMESPACE_in_p_CompNamespaceConstructor9340); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1260:38: ( p_Prefix | ( LBRACKET p_PrefixExpr RBRACKET ) )
+ var alt163=2;
+ var LA163_0 = this.input.LA(1);
+
+ if ( ((LA163_0>=ANCESTOR && LA163_0<=SKIP)||(LA163_0>=VALUE && LA163_0<=QUOT_ER)||LA163_0==L_NCName) ) {
+ alt163=1;
+ }
+ else if ( (LA163_0==LBRACKET) ) {
+ alt163=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 163, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt163) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1260:39: p_Prefix
+ this.pushFollow(XQueryParser.FOLLOW_p_Prefix_in_p_CompNamespaceConstructor9345);
+ p_Prefix424=this.p_Prefix();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Prefix424.getTree());
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1260:50: ( LBRACKET p_PrefixExpr RBRACKET )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1260:50: ( LBRACKET p_PrefixExpr RBRACKET )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1260:51: LBRACKET p_PrefixExpr RBRACKET
+ LBRACKET425=this.match(this.input,LBRACKET,XQueryParser.FOLLOW_LBRACKET_in_p_CompNamespaceConstructor9350); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LBRACKET425_tree = this.adaptor.create(LBRACKET425);
+ this.adaptor.addChild(root_0, LBRACKET425_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_PrefixExpr_in_p_CompNamespaceConstructor9352);
+ p_PrefixExpr426=this.p_PrefixExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_PrefixExpr426.getTree());
+ RBRACKET427=this.match(this.input,RBRACKET,XQueryParser.FOLLOW_RBRACKET_in_p_CompNamespaceConstructor9354); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RBRACKET427_tree = this.adaptor.create(RBRACKET427);
+ this.adaptor.addChild(root_0, RBRACKET427_tree);
+ }
+
+
+
+
+
+ break;
+
+ }
+
+ LBRACKET428=this.match(this.input,LBRACKET,XQueryParser.FOLLOW_LBRACKET_in_p_CompNamespaceConstructor9358); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LBRACKET428_tree = this.adaptor.create(LBRACKET428);
+ this.adaptor.addChild(root_0, LBRACKET428_tree);
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1260:93: ( p_URIExpr )?
+ var alt164=2;
+ var LA164_0 = this.input.LA(1);
+
+ if ( ((LA164_0>=ANCESTOR && LA164_0<=QUOT_ER)||LA164_0==LPAREN||(LA164_0>=DOLLAR && LA164_0<=L_UNION_BRACKET)||LA164_0==LBRACKET||LA164_0==LSQUARE||(LA164_0>=STAR && LA164_0<=SMALLER)||(LA164_0>=SLASH && LA164_0<=SLASH_SLASH)||(LA164_0>=DOT && LA164_0<=DOT_DOT)||(LA164_0>=ATTR_SIGN && LA164_0<=Q)||(LA164_0>=APOS && LA164_0<=QUOT)||LA164_0==L_NCName||(LA164_0>=L_Pragma && LA164_0<=L_DoubleLiteral)) ) {
+ alt164=1;
+ }
+ switch (alt164) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1260:93: p_URIExpr
+ this.pushFollow(XQueryParser.FOLLOW_p_URIExpr_in_p_CompNamespaceConstructor9360);
+ p_URIExpr429=this.p_URIExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_URIExpr429.getTree());
+
+
+ break;
+
+ }
+
+ RBRACKET430=this.match(this.input,RBRACKET,XQueryParser.FOLLOW_RBRACKET_in_p_CompNamespaceConstructor9363); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RBRACKET430_tree = this.adaptor.create(RBRACKET430);
+ this.adaptor.addChild(root_0, RBRACKET430_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_Prefix_return: (function() {
+ XQueryParser.p_Prefix_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_Prefix_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1264:1: p_Prefix : p_NCName ;
+ // $ANTLR start "p_Prefix"
+ p_Prefix: function() {
+ var retval = new XQueryParser.p_Prefix_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_NCName431 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1265:9: ( p_NCName )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1265:11: p_NCName
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_NCName_in_p_Prefix9389);
+ p_NCName431=this.p_NCName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_NCName431.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_PrefixExpr_return: (function() {
+ XQueryParser.p_PrefixExpr_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_PrefixExpr_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1269:1: p_PrefixExpr : p_Expr[true,true] ;
+ // $ANTLR start "p_PrefixExpr"
+ p_PrefixExpr: function() {
+ var retval = new XQueryParser.p_PrefixExpr_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_Expr432 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1270:9: ( p_Expr[true,true] )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1270:11: p_Expr[true,true]
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_Expr_in_p_PrefixExpr9415);
+ p_Expr432=this.p_Expr(true, true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Expr432.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_URIExpr_return: (function() {
+ XQueryParser.p_URIExpr_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_URIExpr_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1274:1: p_URIExpr : p_Expr[true,true] ;
+ // $ANTLR start "p_URIExpr"
+ p_URIExpr: function() {
+ var retval = new XQueryParser.p_URIExpr_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_Expr433 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1275:9: ( p_Expr[true,true] )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1275:11: p_Expr[true,true]
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_Expr_in_p_URIExpr9442);
+ p_Expr433=this.p_Expr(true, true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Expr433.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_CompTextConstructor_return: (function() {
+ XQueryParser.p_CompTextConstructor_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_CompTextConstructor_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1279:1: p_CompTextConstructor : k= TEXT LBRACKET p_Expr[true,true] RBRACKET ;
+ // $ANTLR start "p_CompTextConstructor"
+ p_CompTextConstructor: function() {
+ var retval = new XQueryParser.p_CompTextConstructor_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var LBRACKET434 = null;
+ var RBRACKET436 = null;
+ var p_Expr435 = null;
+
+ var k_tree=null;
+ var LBRACKET434_tree=null;
+ var RBRACKET436_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1280:9: (k= TEXT LBRACKET p_Expr[true,true] RBRACKET )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1280:11: k= TEXT LBRACKET p_Expr[true,true] RBRACKET
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,TEXT,XQueryParser.FOLLOW_TEXT_in_p_CompTextConstructor9471); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ LBRACKET434=this.match(this.input,LBRACKET,XQueryParser.FOLLOW_LBRACKET_in_p_CompTextConstructor9475); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LBRACKET434_tree = this.adaptor.create(LBRACKET434);
+ this.adaptor.addChild(root_0, LBRACKET434_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_Expr_in_p_CompTextConstructor9477);
+ p_Expr435=this.p_Expr(true, true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Expr435.getTree());
+ RBRACKET436=this.match(this.input,RBRACKET,XQueryParser.FOLLOW_RBRACKET_in_p_CompTextConstructor9480); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RBRACKET436_tree = this.adaptor.create(RBRACKET436);
+ this.adaptor.addChild(root_0, RBRACKET436_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ pm_CompCommentConstructor_return: (function() {
+ XQueryParser.pm_CompCommentConstructor_return = function(){};
+ org.antlr.lang.extend(XQueryParser.pm_CompCommentConstructor_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1285:1: pm_CompCommentConstructor : k= COMMENT LBRACKET p_StatementsAndOptionalExpr RBRACKET ;
+ // $ANTLR start "pm_CompCommentConstructor"
+ pm_CompCommentConstructor: function() {
+ var retval = new XQueryParser.pm_CompCommentConstructor_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var LBRACKET437 = null;
+ var RBRACKET439 = null;
+ var p_StatementsAndOptionalExpr438 = null;
+
+ var k_tree=null;
+ var LBRACKET437_tree=null;
+ var RBRACKET439_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1286:9: (k= COMMENT LBRACKET p_StatementsAndOptionalExpr RBRACKET )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1286:11: k= COMMENT LBRACKET p_StatementsAndOptionalExpr RBRACKET
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,COMMENT,XQueryParser.FOLLOW_COMMENT_in_pm_CompCommentConstructor9509); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ LBRACKET437=this.match(this.input,LBRACKET,XQueryParser.FOLLOW_LBRACKET_in_pm_CompCommentConstructor9513); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LBRACKET437_tree = this.adaptor.create(LBRACKET437);
+ this.adaptor.addChild(root_0, LBRACKET437_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_StatementsAndOptionalExpr_in_pm_CompCommentConstructor9515);
+ p_StatementsAndOptionalExpr438=this.p_StatementsAndOptionalExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_StatementsAndOptionalExpr438.getTree());
+ RBRACKET439=this.match(this.input,RBRACKET,XQueryParser.FOLLOW_RBRACKET_in_pm_CompCommentConstructor9517); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RBRACKET439_tree = this.adaptor.create(RBRACKET439);
+ this.adaptor.addChild(root_0, RBRACKET439_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ pm_CompPIConstructor_return: (function() {
+ XQueryParser.pm_CompPIConstructor_return = function(){};
+ org.antlr.lang.extend(XQueryParser.pm_CompPIConstructor_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1291:1: pm_CompPIConstructor : k= PROCESSING_INSTRUCTION ( p_NCName | ( LBRACKET p_Expr[true,true] RBRACKET ) ) LBRACKET p_StatementsAndOptionalExpr RBRACKET ;
+ // $ANTLR start "pm_CompPIConstructor"
+ pm_CompPIConstructor: function() {
+ var retval = new XQueryParser.pm_CompPIConstructor_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var LBRACKET441 = null;
+ var RBRACKET443 = null;
+ var LBRACKET444 = null;
+ var RBRACKET446 = null;
+ var p_NCName440 = null;
+ var p_Expr442 = null;
+ var p_StatementsAndOptionalExpr445 = null;
+
+ var k_tree=null;
+ var LBRACKET441_tree=null;
+ var RBRACKET443_tree=null;
+ var LBRACKET444_tree=null;
+ var RBRACKET446_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1292:9: (k= PROCESSING_INSTRUCTION ( p_NCName | ( LBRACKET p_Expr[true,true] RBRACKET ) ) LBRACKET p_StatementsAndOptionalExpr RBRACKET )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1292:11: k= PROCESSING_INSTRUCTION ( p_NCName | ( LBRACKET p_Expr[true,true] RBRACKET ) ) LBRACKET p_StatementsAndOptionalExpr RBRACKET
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,PROCESSING_INSTRUCTION,XQueryParser.FOLLOW_PROCESSING_INSTRUCTION_in_pm_CompPIConstructor9546); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1292:51: ( p_NCName | ( LBRACKET p_Expr[true,true] RBRACKET ) )
+ var alt165=2;
+ var LA165_0 = this.input.LA(1);
+
+ if ( ((LA165_0>=ANCESTOR && LA165_0<=SKIP)||(LA165_0>=VALUE && LA165_0<=QUOT_ER)||LA165_0==L_NCName) ) {
+ alt165=1;
+ }
+ else if ( (LA165_0==LBRACKET) ) {
+ alt165=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 165, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt165) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1292:52: p_NCName
+ this.pushFollow(XQueryParser.FOLLOW_p_NCName_in_pm_CompPIConstructor9551);
+ p_NCName440=this.p_NCName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_NCName440.getTree());
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1292:63: ( LBRACKET p_Expr[true,true] RBRACKET )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1292:63: ( LBRACKET p_Expr[true,true] RBRACKET )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1292:64: LBRACKET p_Expr[true,true] RBRACKET
+ LBRACKET441=this.match(this.input,LBRACKET,XQueryParser.FOLLOW_LBRACKET_in_pm_CompPIConstructor9556); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LBRACKET441_tree = this.adaptor.create(LBRACKET441);
+ this.adaptor.addChild(root_0, LBRACKET441_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_Expr_in_pm_CompPIConstructor9558);
+ p_Expr442=this.p_Expr(true, true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Expr442.getTree());
+ RBRACKET443=this.match(this.input,RBRACKET,XQueryParser.FOLLOW_RBRACKET_in_pm_CompPIConstructor9561); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RBRACKET443_tree = this.adaptor.create(RBRACKET443);
+ this.adaptor.addChild(root_0, RBRACKET443_tree);
+ }
+
+
+
+
+
+ break;
+
+ }
+
+ LBRACKET444=this.match(this.input,LBRACKET,XQueryParser.FOLLOW_LBRACKET_in_pm_CompPIConstructor9565); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LBRACKET444_tree = this.adaptor.create(LBRACKET444);
+ this.adaptor.addChild(root_0, LBRACKET444_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_StatementsAndOptionalExpr_in_pm_CompPIConstructor9567);
+ p_StatementsAndOptionalExpr445=this.p_StatementsAndOptionalExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_StatementsAndOptionalExpr445.getTree());
+ RBRACKET446=this.match(this.input,RBRACKET,XQueryParser.FOLLOW_RBRACKET_in_pm_CompPIConstructor9569); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RBRACKET446_tree = this.adaptor.create(RBRACKET446);
+ this.adaptor.addChild(root_0, RBRACKET446_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_FunctionItemExpr_return: (function() {
+ XQueryParser.p_FunctionItemExpr_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_FunctionItemExpr_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1296:1: p_FunctionItemExpr : p_LiteralFunctionItem ;
+ // $ANTLR start "p_FunctionItemExpr"
+ p_FunctionItemExpr: function() {
+ var retval = new XQueryParser.p_FunctionItemExpr_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_LiteralFunctionItem447 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1297:9: ( p_LiteralFunctionItem )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1297:11: p_LiteralFunctionItem
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_LiteralFunctionItem_in_p_FunctionItemExpr9595);
+ p_LiteralFunctionItem447=this.p_LiteralFunctionItem();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_LiteralFunctionItem447.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_LiteralFunctionItem_return: (function() {
+ XQueryParser.p_LiteralFunctionItem_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_LiteralFunctionItem_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1302:1: p_LiteralFunctionItem : p_EQName HASH L_IntegerLiteral ;
+ // $ANTLR start "p_LiteralFunctionItem"
+ p_LiteralFunctionItem: function() {
+ var retval = new XQueryParser.p_LiteralFunctionItem_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var HASH449 = null;
+ var L_IntegerLiteral450 = null;
+ var p_EQName448 = null;
+
+ var HASH449_tree=null;
+ var L_IntegerLiteral450_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1303:9: ( p_EQName HASH L_IntegerLiteral )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1303:11: p_EQName HASH L_IntegerLiteral
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_EQName_in_p_LiteralFunctionItem9622);
+ p_EQName448=this.p_EQName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_EQName448.getTree());
+ HASH449=this.match(this.input,HASH,XQueryParser.FOLLOW_HASH_in_p_LiteralFunctionItem9624); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ HASH449_tree = this.adaptor.create(HASH449);
+ this.adaptor.addChild(root_0, HASH449_tree);
+ }
+ L_IntegerLiteral450=this.match(this.input,L_IntegerLiteral,XQueryParser.FOLLOW_L_IntegerLiteral_in_p_LiteralFunctionItem9626); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ L_IntegerLiteral450_tree = this.adaptor.create(L_IntegerLiteral450);
+ this.adaptor.addChild(root_0, L_IntegerLiteral450_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_InlineFunction_return: (function() {
+ XQueryParser.p_InlineFunction_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_InlineFunction_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1307:1: p_InlineFunction : ( p_Annotation )* k= FUNCTION LPAREN ( p_ParamList )? RPAREN (k= AS p_SequenceType )? LBRACKET p_StatementsAndOptionalExpr RBRACKET ;
+ // $ANTLR start "p_InlineFunction"
+ p_InlineFunction: function() {
+ var retval = new XQueryParser.p_InlineFunction_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var LPAREN452 = null;
+ var RPAREN454 = null;
+ var LBRACKET456 = null;
+ var RBRACKET458 = null;
+ var p_Annotation451 = null;
+ var p_ParamList453 = null;
+ var p_SequenceType455 = null;
+ var p_StatementsAndOptionalExpr457 = null;
+
+ var k_tree=null;
+ var LPAREN452_tree=null;
+ var RPAREN454_tree=null;
+ var LBRACKET456_tree=null;
+ var RBRACKET458_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1309:9: ( ( p_Annotation )* k= FUNCTION LPAREN ( p_ParamList )? RPAREN (k= AS p_SequenceType )? LBRACKET p_StatementsAndOptionalExpr RBRACKET )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1309:11: ( p_Annotation )* k= FUNCTION LPAREN ( p_ParamList )? RPAREN (k= AS p_SequenceType )? LBRACKET p_StatementsAndOptionalExpr RBRACKET
+ root_0 = this.adaptor.nil();
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1309:11: ( p_Annotation )*
+ loop166:
+ do {
+ var alt166=2;
+ var LA166_0 = this.input.LA(1);
+
+ if ( (LA166_0==ANN_PERCENT) ) {
+ alt166=1;
+ }
+
+
+ switch (alt166) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1309:11: p_Annotation
+ this.pushFollow(XQueryParser.FOLLOW_p_Annotation_in_p_InlineFunction9661);
+ p_Annotation451=this.p_Annotation();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Annotation451.getTree());
+
+
+ break;
+
+ default :
+ break loop166;
+ }
+ } while (true);
+
+ k=this.match(this.input,FUNCTION,XQueryParser.FOLLOW_FUNCTION_in_p_InlineFunction9666); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ LPAREN452=this.match(this.input,LPAREN,XQueryParser.FOLLOW_LPAREN_in_p_InlineFunction9670); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LPAREN452_tree = this.adaptor.create(LPAREN452);
+ this.adaptor.addChild(root_0, LPAREN452_tree);
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1309:60: ( p_ParamList )?
+ var alt167=2;
+ var LA167_0 = this.input.LA(1);
+
+ if ( (LA167_0==DOLLAR) ) {
+ alt167=1;
+ }
+ switch (alt167) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1309:60: p_ParamList
+ this.pushFollow(XQueryParser.FOLLOW_p_ParamList_in_p_InlineFunction9672);
+ p_ParamList453=this.p_ParamList();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ParamList453.getTree());
+
+
+ break;
+
+ }
+
+ RPAREN454=this.match(this.input,RPAREN,XQueryParser.FOLLOW_RPAREN_in_p_InlineFunction9675); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RPAREN454_tree = this.adaptor.create(RPAREN454);
+ this.adaptor.addChild(root_0, RPAREN454_tree);
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1309:80: (k= AS p_SequenceType )?
+ var alt168=2;
+ var LA168_0 = this.input.LA(1);
+
+ if ( (LA168_0==AS) ) {
+ alt168=1;
+ }
+ switch (alt168) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1309:81: k= AS p_SequenceType
+ k=this.match(this.input,AS,XQueryParser.FOLLOW_AS_in_p_InlineFunction9680); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_SequenceType_in_p_InlineFunction9684);
+ p_SequenceType455=this.p_SequenceType();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_SequenceType455.getTree());
+
+
+ break;
+
+ }
+
+ LBRACKET456=this.match(this.input,LBRACKET,XQueryParser.FOLLOW_LBRACKET_in_p_InlineFunction9688); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LBRACKET456_tree = this.adaptor.create(LBRACKET456);
+ this.adaptor.addChild(root_0, LBRACKET456_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_StatementsAndOptionalExpr_in_p_InlineFunction9690);
+ p_StatementsAndOptionalExpr457=this.p_StatementsAndOptionalExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_StatementsAndOptionalExpr457.getTree());
+ RBRACKET458=this.match(this.input,RBRACKET,XQueryParser.FOLLOW_RBRACKET_in_p_InlineFunction9692); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RBRACKET458_tree = this.adaptor.create(RBRACKET458);
+ this.adaptor.addChild(root_0, RBRACKET458_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_SingleType_return: (function() {
+ XQueryParser.p_SingleType_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_SingleType_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1313:1: p_SingleType : p_AtomicOrUnionType ( QUESTION )? ;
+ // $ANTLR start "p_SingleType"
+ p_SingleType: function() {
+ var retval = new XQueryParser.p_SingleType_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var QUESTION460 = null;
+ var p_AtomicOrUnionType459 = null;
+
+ var QUESTION460_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1314:9: ( p_AtomicOrUnionType ( QUESTION )? )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1314:11: p_AtomicOrUnionType ( QUESTION )?
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_AtomicOrUnionType_in_p_SingleType9718);
+ p_AtomicOrUnionType459=this.p_AtomicOrUnionType();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_AtomicOrUnionType459.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1314:31: ( QUESTION )?
+ var alt169=2;
+ var LA169_0 = this.input.LA(1);
+
+ if ( (LA169_0==QUESTION) ) {
+ alt169=1;
+ }
+ switch (alt169) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1314:31: QUESTION
+ QUESTION460=this.match(this.input,QUESTION,XQueryParser.FOLLOW_QUESTION_in_p_SingleType9720); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ QUESTION460_tree = this.adaptor.create(QUESTION460);
+ this.adaptor.addChild(root_0, QUESTION460_tree);
+ }
+
+
+ break;
+
+ }
+
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_TypeDeclaration_return: (function() {
+ XQueryParser.p_TypeDeclaration_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_TypeDeclaration_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1318:1: p_TypeDeclaration : k= AS st= p_SequenceType -> ^( TypeDeclaration $st) ;
+ // $ANTLR start "p_TypeDeclaration"
+ p_TypeDeclaration: function() {
+ var retval = new XQueryParser.p_TypeDeclaration_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var st = null;
+
+ var k_tree=null;
+ var stream_AS=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token AS");
+ var stream_p_SequenceType=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"rule p_SequenceType");
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1319:9: (k= AS st= p_SequenceType -> ^( TypeDeclaration $st) )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1319:11: k= AS st= p_SequenceType
+ k=this.match(this.input,AS,XQueryParser.FOLLOW_AS_in_p_TypeDeclaration9749); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_AS.add(k);
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_SequenceType_in_p_TypeDeclaration9755);
+ st=this.p_SequenceType();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_p_SequenceType.add(st.getTree());
+
+
+ // AST REWRITE
+ // elements: st
+ // token labels:
+ // rule labels: retval, st
+ // token list labels:
+ // rule list labels:
+ if ( this.state.backtracking===0 ) {
+ retval.tree = root_0;
+ var stream_retval=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token retval",retval!=null?retval.tree:null);
+ var stream_st=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token st",st!=null?st.tree:null);
+
+ root_0 = this.adaptor.nil();
+ // 1320:17: -> ^( TypeDeclaration $st)
+ {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1320:20: ^( TypeDeclaration $st)
+ {
+ var root_1 = this.adaptor.nil();
+ root_1 = this.adaptor.becomeRoot(this.adaptor.create(TypeDeclaration, "TypeDeclaration"), root_1);
+
+ this.adaptor.addChild(root_1, stream_st.nextTree());
+
+ this.adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;}
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_SequenceType_return: (function() {
+ XQueryParser.p_SequenceType_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_SequenceType_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1324:1: p_SequenceType : (k= EMPTY_SEQUENCE l= LPAREN r= RPAREN -> ^( SequenceType ^( EmptySequenceTest $k $l $r) ) | it= p_ItemType ( ( p_OccurrenceIndicator )=>oi= p_OccurrenceIndicator )? -> ^( SequenceType $it ( $oi)? ) );
+ // $ANTLR start "p_SequenceType"
+ p_SequenceType: function() {
+ var retval = new XQueryParser.p_SequenceType_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var l = null;
+ var r = null;
+ var it = null;
+ var oi = null;
+
+ var k_tree=null;
+ var l_tree=null;
+ var r_tree=null;
+ var stream_EMPTY_SEQUENCE=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token EMPTY_SEQUENCE");
+ var stream_RPAREN=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token RPAREN");
+ var stream_LPAREN=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token LPAREN");
+ var stream_p_ItemType=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"rule p_ItemType");
+ var stream_p_OccurrenceIndicator=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"rule p_OccurrenceIndicator");
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1325:9: (k= EMPTY_SEQUENCE l= LPAREN r= RPAREN -> ^( SequenceType ^( EmptySequenceTest $k $l $r) ) | it= p_ItemType ( ( p_OccurrenceIndicator )=>oi= p_OccurrenceIndicator )? -> ^( SequenceType $it ( $oi)? ) )
+ var alt171=2;
+ var LA171_0 = this.input.LA(1);
+
+ if ( (LA171_0==EMPTY_SEQUENCE) ) {
+ var LA171_1 = this.input.LA(2);
+
+ if ( (LA171_1==LPAREN) ) {
+ alt171=1;
+ }
+ else if ( (LA171_1==EOF||(LA171_1>=AND && LA171_1<=AT)||LA171_1==CASE||LA171_1==COLLATION||LA171_1==DEFAULT||(LA171_1>=DESCENDING && LA171_1<=DIV)||LA171_1==EMPTY||LA171_1==EQ||(LA171_1>=EXCEPT && LA171_1<=EXTERNAL)||LA171_1==FOR||LA171_1==GE||(LA171_1>=GT && LA171_1<=IDIV)||LA171_1==IN||(LA171_1>=INSTANCE && LA171_1<=IS)||LA171_1==LE||(LA171_1>=LET && LA171_1<=MOD)||LA171_1==NE||(LA171_1>=OR && LA171_1<=ORDER)||(LA171_1>=RETURN && LA171_1<=SATISFIES)||LA171_1==STABLE||LA171_1==TO||LA171_1==UNION||LA171_1==WHERE||LA171_1==ALLOWING||LA171_1==COUNT||(LA171_1>=END && LA171_1<=GROUP)||LA171_1==ONLY||LA171_1==START||(LA171_1>=AFTER && LA171_1<=BEFORE)||LA171_1==INTO||LA171_1==MODIFY||LA171_1==WITH||LA171_1==CONTAINS||LA171_1==PARAGRAPHS||LA171_1==SCORE||LA171_1==SENTENCES||LA171_1==TIMES||LA171_1==WORDS||LA171_1==CONCAT||LA171_1==RPAREN||(LA171_1>=R_UNION_BRACKET && LA171_1<=RBRACKET)||(LA171_1>=RSQUARE && LA171_1<=NOTEQUAL)||(LA171_1>=COMMA && LA171_1<=GREATER_GREATER)||LA171_1==COLON||(LA171_1>=SEMICOLON && LA171_1<=VBAR)) ) {
+ alt171=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 171, 1, this.input);
+
+ throw nvae;
+ }
+ }
+ else if ( ((LA171_0>=ANCESTOR && LA171_0<=EMPTY)||(LA171_0>=ENCODING && LA171_0<=SKIP)||(LA171_0>=VALUE && LA171_0<=QUOT_ER)||LA171_0==LPAREN||LA171_0==ANN_PERCENT||LA171_0==Q||LA171_0==L_NCName) ) {
+ alt171=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 171, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt171) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1325:11: k= EMPTY_SEQUENCE l= LPAREN r= RPAREN
+ k=this.match(this.input,EMPTY_SEQUENCE,XQueryParser.FOLLOW_EMPTY_SEQUENCE_in_p_SequenceType9808); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_EMPTY_SEQUENCE.add(k);
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ l=this.match(this.input,LPAREN,XQueryParser.FOLLOW_LPAREN_in_p_SequenceType9814); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_LPAREN.add(l);
+
+ r=this.match(this.input,RPAREN,XQueryParser.FOLLOW_RPAREN_in_p_SequenceType9818); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_RPAREN.add(r);
+
+
+
+ // AST REWRITE
+ // elements: r, k, l
+ // token labels: r, l, k
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( this.state.backtracking===0 ) {
+ retval.tree = root_0;
+ var stream_r=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token r",r);
+ var stream_l=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token l",l);
+ var stream_k=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token k",k);
+ var stream_retval=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = this.adaptor.nil();
+ // 1326:17: -> ^( SequenceType ^( EmptySequenceTest $k $l $r) )
+ {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1326:20: ^( SequenceType ^( EmptySequenceTest $k $l $r) )
+ {
+ var root_1 = this.adaptor.nil();
+ root_1 = this.adaptor.becomeRoot(this.adaptor.create(SequenceType, "SequenceType"), root_1);
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1326:35: ^( EmptySequenceTest $k $l $r)
+ {
+ var root_2 = this.adaptor.nil();
+ root_2 = this.adaptor.becomeRoot(this.adaptor.create(EmptySequenceTest, "EmptySequenceTest"), root_2);
+
+ this.adaptor.addChild(root_2, stream_k.nextNode());
+ this.adaptor.addChild(root_2, stream_l.nextNode());
+ this.adaptor.addChild(root_2, stream_r.nextNode());
+
+ this.adaptor.addChild(root_1, root_2);
+ }
+
+ this.adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;}
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1327:11: it= p_ItemType ( ( p_OccurrenceIndicator )=>oi= p_OccurrenceIndicator )?
+ this.pushFollow(XQueryParser.FOLLOW_p_ItemType_in_p_SequenceType9867);
+ it=this.p_ItemType();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_p_ItemType.add(it.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1327:25: ( ( p_OccurrenceIndicator )=>oi= p_OccurrenceIndicator )?
+ var alt170=2;
+ switch ( this.input.LA(1) ) {
+ case STAR:
+ var LA170_1 = this.input.LA(2);
+
+ if ( (this.synpred14_XQueryParser()) ) {
+ alt170=1;
+ }
+ break;
+ case PLUS:
+ var LA170_3 = this.input.LA(2);
+
+ if ( (this.synpred14_XQueryParser()) ) {
+ alt170=1;
+ }
+ break;
+ case QUESTION:
+ var LA170_4 = this.input.LA(2);
+
+ if ( (this.synpred14_XQueryParser()) ) {
+ alt170=1;
+ }
+ break;
+ }
+
+ switch (alt170) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1327:26: ( p_OccurrenceIndicator )=>oi= p_OccurrenceIndicator
+ this.pushFollow(XQueryParser.FOLLOW_p_OccurrenceIndicator_in_p_SequenceType9878);
+ oi=this.p_OccurrenceIndicator();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_p_OccurrenceIndicator.add(oi.getTree());
+
+
+ break;
+
+ }
+
+
+
+ // AST REWRITE
+ // elements: it, oi
+ // token labels:
+ // rule labels: retval, it, oi
+ // token list labels:
+ // rule list labels:
+ if ( this.state.backtracking===0 ) {
+ retval.tree = root_0;
+ var stream_retval=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token retval",retval!=null?retval.tree:null);
+ var stream_it=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token it",it!=null?it.tree:null);
+ var stream_oi=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token oi",oi!=null?oi.tree:null);
+
+ root_0 = this.adaptor.nil();
+ // 1328:17: -> ^( SequenceType $it ( $oi)? )
+ {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1328:20: ^( SequenceType $it ( $oi)? )
+ {
+ var root_1 = this.adaptor.nil();
+ root_1 = this.adaptor.becomeRoot(this.adaptor.create(SequenceType, "SequenceType"), root_1);
+
+ this.adaptor.addChild(root_1, stream_it.nextTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1328:39: ( $oi)?
+ if ( stream_oi.hasNext() ) {
+ this.adaptor.addChild(root_1, stream_oi.nextTree());
+
+ }
+ stream_oi.reset();
+
+ this.adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;}
+
+ break;
+
+ }
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_OccurrenceIndicator_return: (function() {
+ XQueryParser.p_OccurrenceIndicator_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_OccurrenceIndicator_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1332:1: p_OccurrenceIndicator : ( QUESTION | STAR | PLUS );
+ // $ANTLR start "p_OccurrenceIndicator"
+ p_OccurrenceIndicator: function() {
+ var retval = new XQueryParser.p_OccurrenceIndicator_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var set461 = null;
+
+ var set461_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1333:9: ( QUESTION | STAR | PLUS )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:
+ root_0 = this.adaptor.nil();
+
+ set461=this.input.LT(1);
+ if ( (this.input.LA(1)>=QUESTION && this.input.LA(1)<=PLUS) ) {
+ this.input.consume();
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, this.adaptor.create(set461));
+ this.state.errorRecovery=false;this.state.failed=false;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
+ throw mse;
+ }
+
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_ItemType_return: (function() {
+ XQueryParser.p_ItemType_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_ItemType_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1337:1: p_ItemType : ( p_KindTest -> ^( KindTest p_KindTest ) | ( ITEM LPAREN RPAREN ) -> ^( ItemTest ITEM LPAREN RPAREN ) | p_FunctionTest -> ^( FunctionTest p_FunctionTest ) | p_AtomicOrUnionType | p_ParenthesizedItemType | p_JSONTest | p_StructuredItemTest );
+ // $ANTLR start "p_ItemType"
+ p_ItemType: function() {
+ var retval = new XQueryParser.p_ItemType_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var ITEM463 = null;
+ var LPAREN464 = null;
+ var RPAREN465 = null;
+ var p_KindTest462 = null;
+ var p_FunctionTest466 = null;
+ var p_AtomicOrUnionType467 = null;
+ var p_ParenthesizedItemType468 = null;
+ var p_JSONTest469 = null;
+ var p_StructuredItemTest470 = null;
+
+ var ITEM463_tree=null;
+ var LPAREN464_tree=null;
+ var RPAREN465_tree=null;
+ var stream_RPAREN=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token RPAREN");
+ var stream_ITEM=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token ITEM");
+ var stream_LPAREN=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token LPAREN");
+ var stream_p_FunctionTest=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"rule p_FunctionTest");
+ var stream_p_KindTest=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"rule p_KindTest");
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1338:9: ( p_KindTest -> ^( KindTest p_KindTest ) | ( ITEM LPAREN RPAREN ) -> ^( ItemTest ITEM LPAREN RPAREN ) | p_FunctionTest -> ^( FunctionTest p_FunctionTest ) | p_AtomicOrUnionType | p_ParenthesizedItemType | p_JSONTest | p_StructuredItemTest )
+ var alt172=7;
+ alt172 = this.dfa172.predict(this.input);
+ switch (alt172) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1338:11: p_KindTest
+ this.pushFollow(XQueryParser.FOLLOW_p_KindTest_in_p_ItemType9980);
+ p_KindTest462=this.p_KindTest();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_p_KindTest.add(p_KindTest462.getTree());
+
+
+ // AST REWRITE
+ // elements: p_KindTest
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( this.state.backtracking===0 ) {
+ retval.tree = root_0;
+ var stream_retval=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = this.adaptor.nil();
+ // 1339:17: -> ^( KindTest p_KindTest )
+ {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1339:20: ^( KindTest p_KindTest )
+ {
+ var root_1 = this.adaptor.nil();
+ root_1 = this.adaptor.becomeRoot(this.adaptor.create(KindTest, "KindTest"), root_1);
+
+ this.adaptor.addChild(root_1, stream_p_KindTest.nextTree());
+
+ this.adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;}
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1340:11: ( ITEM LPAREN RPAREN )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1340:11: ( ITEM LPAREN RPAREN )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1340:12: ITEM LPAREN RPAREN
+ ITEM463=this.match(this.input,ITEM,XQueryParser.FOLLOW_ITEM_in_p_ItemType10017); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_ITEM.add(ITEM463);
+
+ LPAREN464=this.match(this.input,LPAREN,XQueryParser.FOLLOW_LPAREN_in_p_ItemType10019); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_LPAREN.add(LPAREN464);
+
+ RPAREN465=this.match(this.input,RPAREN,XQueryParser.FOLLOW_RPAREN_in_p_ItemType10021); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_RPAREN.add(RPAREN465);
+
+
+
+
+
+
+ // AST REWRITE
+ // elements: RPAREN, LPAREN, ITEM
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( this.state.backtracking===0 ) {
+ retval.tree = root_0;
+ var stream_retval=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = this.adaptor.nil();
+ // 1341:17: -> ^( ItemTest ITEM LPAREN RPAREN )
+ {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1341:20: ^( ItemTest ITEM LPAREN RPAREN )
+ {
+ var root_1 = this.adaptor.nil();
+ root_1 = this.adaptor.becomeRoot(this.adaptor.create(ItemTest, "ItemTest"), root_1);
+
+ this.adaptor.addChild(root_1, stream_ITEM.nextNode());
+ this.adaptor.addChild(root_1, stream_LPAREN.nextNode());
+ this.adaptor.addChild(root_1, stream_RPAREN.nextNode());
+
+ this.adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;}
+
+ break;
+ case 3 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1342:11: p_FunctionTest
+ this.pushFollow(XQueryParser.FOLLOW_p_FunctionTest_in_p_ItemType10062);
+ p_FunctionTest466=this.p_FunctionTest();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_p_FunctionTest.add(p_FunctionTest466.getTree());
+
+
+ // AST REWRITE
+ // elements: p_FunctionTest
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( this.state.backtracking===0 ) {
+ retval.tree = root_0;
+ var stream_retval=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = this.adaptor.nil();
+ // 1343:17: -> ^( FunctionTest p_FunctionTest )
+ {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1343:20: ^( FunctionTest p_FunctionTest )
+ {
+ var root_1 = this.adaptor.nil();
+ root_1 = this.adaptor.becomeRoot(this.adaptor.create(FunctionTest, "FunctionTest"), root_1);
+
+ this.adaptor.addChild(root_1, stream_p_FunctionTest.nextTree());
+
+ this.adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;}
+
+ break;
+ case 4 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1344:11: p_AtomicOrUnionType
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_AtomicOrUnionType_in_p_ItemType10098);
+ p_AtomicOrUnionType467=this.p_AtomicOrUnionType();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_AtomicOrUnionType467.getTree());
+
+
+ break;
+ case 5 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1345:11: p_ParenthesizedItemType
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_ParenthesizedItemType_in_p_ItemType10110);
+ p_ParenthesizedItemType468=this.p_ParenthesizedItemType();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ParenthesizedItemType468.getTree());
+
+
+ break;
+ case 6 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1346:11: p_JSONTest
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_JSONTest_in_p_ItemType10122);
+ p_JSONTest469=this.p_JSONTest();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_JSONTest469.getTree());
+
+
+ break;
+ case 7 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1347:11: p_StructuredItemTest
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_StructuredItemTest_in_p_ItemType10134);
+ p_StructuredItemTest470=this.p_StructuredItemTest();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_StructuredItemTest470.getTree());
+
+
+ break;
+
+ }
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_JSONTest_return: (function() {
+ XQueryParser.p_JSONTest_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_JSONTest_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1350:1: p_JSONTest : ( p_JSONItemTest | p_JSONObjectTest | p_JSONArrayTest );
+ // $ANTLR start "p_JSONTest"
+ p_JSONTest: function() {
+ var retval = new XQueryParser.p_JSONTest_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_JSONItemTest471 = null;
+ var p_JSONObjectTest472 = null;
+ var p_JSONArrayTest473 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1351:9: ( p_JSONItemTest | p_JSONObjectTest | p_JSONArrayTest )
+ var alt173=3;
+ switch ( this.input.LA(1) ) {
+ case JSON_ITEM:
+ alt173=1;
+ break;
+ case OBJECT:
+ alt173=2;
+ break;
+ case ARRAY:
+ alt173=3;
+ break;
+ default:
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 173, 0, this.input);
+
+ throw nvae;
+ }
+
+ switch (alt173) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1351:11: p_JSONItemTest
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_JSONItemTest_in_p_JSONTest10159);
+ p_JSONItemTest471=this.p_JSONItemTest();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_JSONItemTest471.getTree());
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1352:11: p_JSONObjectTest
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_JSONObjectTest_in_p_JSONTest10171);
+ p_JSONObjectTest472=this.p_JSONObjectTest();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_JSONObjectTest472.getTree());
+
+
+ break;
+ case 3 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1353:11: p_JSONArrayTest
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_JSONArrayTest_in_p_JSONTest10183);
+ p_JSONArrayTest473=this.p_JSONArrayTest();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_JSONArrayTest473.getTree());
+
+
+ break;
+
+ }
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_StructuredItemTest_return: (function() {
+ XQueryParser.p_StructuredItemTest_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_StructuredItemTest_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1356:1: p_StructuredItemTest : STRUCTURED_ITEM LPAREN RPAREN ;
+ // $ANTLR start "p_StructuredItemTest"
+ p_StructuredItemTest: function() {
+ var retval = new XQueryParser.p_StructuredItemTest_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var STRUCTURED_ITEM474 = null;
+ var LPAREN475 = null;
+ var RPAREN476 = null;
+
+ var STRUCTURED_ITEM474_tree=null;
+ var LPAREN475_tree=null;
+ var RPAREN476_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1357:9: ( STRUCTURED_ITEM LPAREN RPAREN )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1357:11: STRUCTURED_ITEM LPAREN RPAREN
+ root_0 = this.adaptor.nil();
+
+ STRUCTURED_ITEM474=this.match(this.input,STRUCTURED_ITEM,XQueryParser.FOLLOW_STRUCTURED_ITEM_in_p_StructuredItemTest10208); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ STRUCTURED_ITEM474_tree = this.adaptor.create(STRUCTURED_ITEM474);
+ this.adaptor.addChild(root_0, STRUCTURED_ITEM474_tree);
+ }
+ LPAREN475=this.match(this.input,LPAREN,XQueryParser.FOLLOW_LPAREN_in_p_StructuredItemTest10210); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LPAREN475_tree = this.adaptor.create(LPAREN475);
+ this.adaptor.addChild(root_0, LPAREN475_tree);
+ }
+ RPAREN476=this.match(this.input,RPAREN,XQueryParser.FOLLOW_RPAREN_in_p_StructuredItemTest10212); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RPAREN476_tree = this.adaptor.create(RPAREN476);
+ this.adaptor.addChild(root_0, RPAREN476_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_JSONItemTest_return: (function() {
+ XQueryParser.p_JSONItemTest_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_JSONItemTest_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1360:1: p_JSONItemTest : JSON_ITEM LPAREN RPAREN ;
+ // $ANTLR start "p_JSONItemTest"
+ p_JSONItemTest: function() {
+ var retval = new XQueryParser.p_JSONItemTest_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var JSON_ITEM477 = null;
+ var LPAREN478 = null;
+ var RPAREN479 = null;
+
+ var JSON_ITEM477_tree=null;
+ var LPAREN478_tree=null;
+ var RPAREN479_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1361:9: ( JSON_ITEM LPAREN RPAREN )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1361:11: JSON_ITEM LPAREN RPAREN
+ root_0 = this.adaptor.nil();
+
+ JSON_ITEM477=this.match(this.input,JSON_ITEM,XQueryParser.FOLLOW_JSON_ITEM_in_p_JSONItemTest10237); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ JSON_ITEM477_tree = this.adaptor.create(JSON_ITEM477);
+ this.adaptor.addChild(root_0, JSON_ITEM477_tree);
+ }
+ LPAREN478=this.match(this.input,LPAREN,XQueryParser.FOLLOW_LPAREN_in_p_JSONItemTest10239); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LPAREN478_tree = this.adaptor.create(LPAREN478);
+ this.adaptor.addChild(root_0, LPAREN478_tree);
+ }
+ RPAREN479=this.match(this.input,RPAREN,XQueryParser.FOLLOW_RPAREN_in_p_JSONItemTest10241); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RPAREN479_tree = this.adaptor.create(RPAREN479);
+ this.adaptor.addChild(root_0, RPAREN479_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_JSONObjectTest_return: (function() {
+ XQueryParser.p_JSONObjectTest_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_JSONObjectTest_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1364:1: p_JSONObjectTest : OBJECT LPAREN RPAREN ;
+ // $ANTLR start "p_JSONObjectTest"
+ p_JSONObjectTest: function() {
+ var retval = new XQueryParser.p_JSONObjectTest_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var OBJECT480 = null;
+ var LPAREN481 = null;
+ var RPAREN482 = null;
+
+ var OBJECT480_tree=null;
+ var LPAREN481_tree=null;
+ var RPAREN482_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1365:9: ( OBJECT LPAREN RPAREN )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1365:11: OBJECT LPAREN RPAREN
+ root_0 = this.adaptor.nil();
+
+ OBJECT480=this.match(this.input,OBJECT,XQueryParser.FOLLOW_OBJECT_in_p_JSONObjectTest10266); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ OBJECT480_tree = this.adaptor.create(OBJECT480);
+ this.adaptor.addChild(root_0, OBJECT480_tree);
+ }
+ LPAREN481=this.match(this.input,LPAREN,XQueryParser.FOLLOW_LPAREN_in_p_JSONObjectTest10268); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LPAREN481_tree = this.adaptor.create(LPAREN481);
+ this.adaptor.addChild(root_0, LPAREN481_tree);
+ }
+ RPAREN482=this.match(this.input,RPAREN,XQueryParser.FOLLOW_RPAREN_in_p_JSONObjectTest10270); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RPAREN482_tree = this.adaptor.create(RPAREN482);
+ this.adaptor.addChild(root_0, RPAREN482_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_JSONArrayTest_return: (function() {
+ XQueryParser.p_JSONArrayTest_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_JSONArrayTest_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1368:1: p_JSONArrayTest : ARRAY LPAREN RPAREN ;
+ // $ANTLR start "p_JSONArrayTest"
+ p_JSONArrayTest: function() {
+ var retval = new XQueryParser.p_JSONArrayTest_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var ARRAY483 = null;
+ var LPAREN484 = null;
+ var RPAREN485 = null;
+
+ var ARRAY483_tree=null;
+ var LPAREN484_tree=null;
+ var RPAREN485_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1369:9: ( ARRAY LPAREN RPAREN )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1369:11: ARRAY LPAREN RPAREN
+ root_0 = this.adaptor.nil();
+
+ ARRAY483=this.match(this.input,ARRAY,XQueryParser.FOLLOW_ARRAY_in_p_JSONArrayTest10295); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ ARRAY483_tree = this.adaptor.create(ARRAY483);
+ this.adaptor.addChild(root_0, ARRAY483_tree);
+ }
+ LPAREN484=this.match(this.input,LPAREN,XQueryParser.FOLLOW_LPAREN_in_p_JSONArrayTest10297); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LPAREN484_tree = this.adaptor.create(LPAREN484);
+ this.adaptor.addChild(root_0, LPAREN484_tree);
+ }
+ RPAREN485=this.match(this.input,RPAREN,XQueryParser.FOLLOW_RPAREN_in_p_JSONArrayTest10299); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RPAREN485_tree = this.adaptor.create(RPAREN485);
+ this.adaptor.addChild(root_0, RPAREN485_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_AtomicOrUnionType_return: (function() {
+ XQueryParser.p_AtomicOrUnionType_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_AtomicOrUnionType_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1373:1: p_AtomicOrUnionType : p_EQName -> ^( AtomicOrUnionType p_EQName ) ;
+ // $ANTLR start "p_AtomicOrUnionType"
+ p_AtomicOrUnionType: function() {
+ var retval = new XQueryParser.p_AtomicOrUnionType_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_EQName486 = null;
+
+ var stream_p_EQName=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"rule p_EQName");
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1374:9: ( p_EQName -> ^( AtomicOrUnionType p_EQName ) )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1374:11: p_EQName
+ this.pushFollow(XQueryParser.FOLLOW_p_EQName_in_p_AtomicOrUnionType10325);
+ p_EQName486=this.p_EQName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_p_EQName.add(p_EQName486.getTree());
+
+
+ // AST REWRITE
+ // elements: p_EQName
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( this.state.backtracking===0 ) {
+ retval.tree = root_0;
+ var stream_retval=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = this.adaptor.nil();
+ // 1375:17: -> ^( AtomicOrUnionType p_EQName )
+ {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1375:20: ^( AtomicOrUnionType p_EQName )
+ {
+ var root_1 = this.adaptor.nil();
+ root_1 = this.adaptor.becomeRoot(this.adaptor.create(AtomicOrUnionType, "AtomicOrUnionType"), root_1);
+
+ this.adaptor.addChild(root_1, stream_p_EQName.nextTree());
+
+ this.adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;}
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_KindTest_return: (function() {
+ XQueryParser.p_KindTest_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_KindTest_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1379:1: p_KindTest : ( p_DocumentTest | p_ElementTest | p_AttributeTest | p_SchemaElementTest | p_SchemaAttributeTest | p_PITest | p_CommentTest | p_TextTest | p_NamespaceNodeTest | p_AnyKindTest );
+ // $ANTLR start "p_KindTest"
+ p_KindTest: function() {
+ var retval = new XQueryParser.p_KindTest_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_DocumentTest487 = null;
+ var p_ElementTest488 = null;
+ var p_AttributeTest489 = null;
+ var p_SchemaElementTest490 = null;
+ var p_SchemaAttributeTest491 = null;
+ var p_PITest492 = null;
+ var p_CommentTest493 = null;
+ var p_TextTest494 = null;
+ var p_NamespaceNodeTest495 = null;
+ var p_AnyKindTest496 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1380:9: ( p_DocumentTest | p_ElementTest | p_AttributeTest | p_SchemaElementTest | p_SchemaAttributeTest | p_PITest | p_CommentTest | p_TextTest | p_NamespaceNodeTest | p_AnyKindTest )
+ var alt174=10;
+ switch ( this.input.LA(1) ) {
+ case DOCUMENT_NODE:
+ alt174=1;
+ break;
+ case ELEMENT:
+ alt174=2;
+ break;
+ case ATTRIBUTE:
+ alt174=3;
+ break;
+ case SCHEMA_ELEMENT:
+ alt174=4;
+ break;
+ case SCHEMA_ATTRIBUTE:
+ alt174=5;
+ break;
+ case PROCESSING_INSTRUCTION:
+ alt174=6;
+ break;
+ case COMMENT:
+ alt174=7;
+ break;
+ case TEXT:
+ alt174=8;
+ break;
+ case NAMESPACE_NODE:
+ alt174=9;
+ break;
+ case NODE:
+ alt174=10;
+ break;
+ default:
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 174, 0, this.input);
+
+ throw nvae;
+ }
+
+ switch (alt174) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1380:11: p_DocumentTest
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_DocumentTest_in_p_KindTest10375);
+ p_DocumentTest487=this.p_DocumentTest();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_DocumentTest487.getTree());
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1381:11: p_ElementTest
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_ElementTest_in_p_KindTest10387);
+ p_ElementTest488=this.p_ElementTest();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ElementTest488.getTree());
+
+
+ break;
+ case 3 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1382:11: p_AttributeTest
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_AttributeTest_in_p_KindTest10399);
+ p_AttributeTest489=this.p_AttributeTest();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_AttributeTest489.getTree());
+
+
+ break;
+ case 4 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1383:11: p_SchemaElementTest
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_SchemaElementTest_in_p_KindTest10411);
+ p_SchemaElementTest490=this.p_SchemaElementTest();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_SchemaElementTest490.getTree());
+
+
+ break;
+ case 5 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1384:11: p_SchemaAttributeTest
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_SchemaAttributeTest_in_p_KindTest10423);
+ p_SchemaAttributeTest491=this.p_SchemaAttributeTest();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_SchemaAttributeTest491.getTree());
+
+
+ break;
+ case 6 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1385:11: p_PITest
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_PITest_in_p_KindTest10435);
+ p_PITest492=this.p_PITest();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_PITest492.getTree());
+
+
+ break;
+ case 7 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1386:11: p_CommentTest
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_CommentTest_in_p_KindTest10447);
+ p_CommentTest493=this.p_CommentTest();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_CommentTest493.getTree());
+
+
+ break;
+ case 8 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1387:11: p_TextTest
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_TextTest_in_p_KindTest10459);
+ p_TextTest494=this.p_TextTest();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_TextTest494.getTree());
+
+
+ break;
+ case 9 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1388:11: p_NamespaceNodeTest
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_NamespaceNodeTest_in_p_KindTest10471);
+ p_NamespaceNodeTest495=this.p_NamespaceNodeTest();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_NamespaceNodeTest495.getTree());
+
+
+ break;
+ case 10 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1389:11: p_AnyKindTest
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_AnyKindTest_in_p_KindTest10483);
+ p_AnyKindTest496=this.p_AnyKindTest();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_AnyKindTest496.getTree());
+
+
+ break;
+
+ }
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_AnyKindTest_return: (function() {
+ XQueryParser.p_AnyKindTest_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_AnyKindTest_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1393:1: p_AnyKindTest : NODE LPAREN RPAREN ;
+ // $ANTLR start "p_AnyKindTest"
+ p_AnyKindTest: function() {
+ var retval = new XQueryParser.p_AnyKindTest_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var NODE497 = null;
+ var LPAREN498 = null;
+ var RPAREN499 = null;
+
+ var NODE497_tree=null;
+ var LPAREN498_tree=null;
+ var RPAREN499_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1394:9: ( NODE LPAREN RPAREN )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1394:11: NODE LPAREN RPAREN
+ root_0 = this.adaptor.nil();
+
+ NODE497=this.match(this.input,NODE,XQueryParser.FOLLOW_NODE_in_p_AnyKindTest10509); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ NODE497_tree = this.adaptor.create(NODE497);
+ this.adaptor.addChild(root_0, NODE497_tree);
+ }
+ LPAREN498=this.match(this.input,LPAREN,XQueryParser.FOLLOW_LPAREN_in_p_AnyKindTest10511); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LPAREN498_tree = this.adaptor.create(LPAREN498);
+ this.adaptor.addChild(root_0, LPAREN498_tree);
+ }
+ RPAREN499=this.match(this.input,RPAREN,XQueryParser.FOLLOW_RPAREN_in_p_AnyKindTest10513); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RPAREN499_tree = this.adaptor.create(RPAREN499);
+ this.adaptor.addChild(root_0, RPAREN499_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_DocumentTest_return: (function() {
+ XQueryParser.p_DocumentTest_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_DocumentTest_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1398:1: p_DocumentTest : DOCUMENT_NODE LPAREN ( p_ElementTest | p_SchemaElementTest )? RPAREN ;
+ // $ANTLR start "p_DocumentTest"
+ p_DocumentTest: function() {
+ var retval = new XQueryParser.p_DocumentTest_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var DOCUMENT_NODE500 = null;
+ var LPAREN501 = null;
+ var RPAREN504 = null;
+ var p_ElementTest502 = null;
+ var p_SchemaElementTest503 = null;
+
+ var DOCUMENT_NODE500_tree=null;
+ var LPAREN501_tree=null;
+ var RPAREN504_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1399:9: ( DOCUMENT_NODE LPAREN ( p_ElementTest | p_SchemaElementTest )? RPAREN )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1399:11: DOCUMENT_NODE LPAREN ( p_ElementTest | p_SchemaElementTest )? RPAREN
+ root_0 = this.adaptor.nil();
+
+ DOCUMENT_NODE500=this.match(this.input,DOCUMENT_NODE,XQueryParser.FOLLOW_DOCUMENT_NODE_in_p_DocumentTest10539); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ DOCUMENT_NODE500_tree = this.adaptor.create(DOCUMENT_NODE500);
+ this.adaptor.addChild(root_0, DOCUMENT_NODE500_tree);
+ }
+ LPAREN501=this.match(this.input,LPAREN,XQueryParser.FOLLOW_LPAREN_in_p_DocumentTest10541); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LPAREN501_tree = this.adaptor.create(LPAREN501);
+ this.adaptor.addChild(root_0, LPAREN501_tree);
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1399:32: ( p_ElementTest | p_SchemaElementTest )?
+ var alt175=3;
+ var LA175_0 = this.input.LA(1);
+
+ if ( (LA175_0==ELEMENT) ) {
+ alt175=1;
+ }
+ else if ( (LA175_0==SCHEMA_ELEMENT) ) {
+ alt175=2;
+ }
+ switch (alt175) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1399:33: p_ElementTest
+ this.pushFollow(XQueryParser.FOLLOW_p_ElementTest_in_p_DocumentTest10544);
+ p_ElementTest502=this.p_ElementTest();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ElementTest502.getTree());
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1399:49: p_SchemaElementTest
+ this.pushFollow(XQueryParser.FOLLOW_p_SchemaElementTest_in_p_DocumentTest10548);
+ p_SchemaElementTest503=this.p_SchemaElementTest();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_SchemaElementTest503.getTree());
+
+
+ break;
+
+ }
+
+ RPAREN504=this.match(this.input,RPAREN,XQueryParser.FOLLOW_RPAREN_in_p_DocumentTest10552); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RPAREN504_tree = this.adaptor.create(RPAREN504);
+ this.adaptor.addChild(root_0, RPAREN504_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_TextTest_return: (function() {
+ XQueryParser.p_TextTest_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_TextTest_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1403:1: p_TextTest : TEXT LPAREN RPAREN ;
+ // $ANTLR start "p_TextTest"
+ p_TextTest: function() {
+ var retval = new XQueryParser.p_TextTest_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var TEXT505 = null;
+ var LPAREN506 = null;
+ var RPAREN507 = null;
+
+ var TEXT505_tree=null;
+ var LPAREN506_tree=null;
+ var RPAREN507_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1404:9: ( TEXT LPAREN RPAREN )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1404:11: TEXT LPAREN RPAREN
+ root_0 = this.adaptor.nil();
+
+ TEXT505=this.match(this.input,TEXT,XQueryParser.FOLLOW_TEXT_in_p_TextTest10578); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ TEXT505_tree = this.adaptor.create(TEXT505);
+ this.adaptor.addChild(root_0, TEXT505_tree);
+ }
+ LPAREN506=this.match(this.input,LPAREN,XQueryParser.FOLLOW_LPAREN_in_p_TextTest10580); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LPAREN506_tree = this.adaptor.create(LPAREN506);
+ this.adaptor.addChild(root_0, LPAREN506_tree);
+ }
+ RPAREN507=this.match(this.input,RPAREN,XQueryParser.FOLLOW_RPAREN_in_p_TextTest10582); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RPAREN507_tree = this.adaptor.create(RPAREN507);
+ this.adaptor.addChild(root_0, RPAREN507_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_CommentTest_return: (function() {
+ XQueryParser.p_CommentTest_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_CommentTest_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1408:1: p_CommentTest : COMMENT LPAREN RPAREN ;
+ // $ANTLR start "p_CommentTest"
+ p_CommentTest: function() {
+ var retval = new XQueryParser.p_CommentTest_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var COMMENT508 = null;
+ var LPAREN509 = null;
+ var RPAREN510 = null;
+
+ var COMMENT508_tree=null;
+ var LPAREN509_tree=null;
+ var RPAREN510_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1409:9: ( COMMENT LPAREN RPAREN )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1409:11: COMMENT LPAREN RPAREN
+ root_0 = this.adaptor.nil();
+
+ COMMENT508=this.match(this.input,COMMENT,XQueryParser.FOLLOW_COMMENT_in_p_CommentTest10608); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ COMMENT508_tree = this.adaptor.create(COMMENT508);
+ this.adaptor.addChild(root_0, COMMENT508_tree);
+ }
+ LPAREN509=this.match(this.input,LPAREN,XQueryParser.FOLLOW_LPAREN_in_p_CommentTest10610); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LPAREN509_tree = this.adaptor.create(LPAREN509);
+ this.adaptor.addChild(root_0, LPAREN509_tree);
+ }
+ RPAREN510=this.match(this.input,RPAREN,XQueryParser.FOLLOW_RPAREN_in_p_CommentTest10612); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RPAREN510_tree = this.adaptor.create(RPAREN510);
+ this.adaptor.addChild(root_0, RPAREN510_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_NamespaceNodeTest_return: (function() {
+ XQueryParser.p_NamespaceNodeTest_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_NamespaceNodeTest_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1413:1: p_NamespaceNodeTest : NAMESPACE_NODE LPAREN RPAREN ;
+ // $ANTLR start "p_NamespaceNodeTest"
+ p_NamespaceNodeTest: function() {
+ var retval = new XQueryParser.p_NamespaceNodeTest_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var NAMESPACE_NODE511 = null;
+ var LPAREN512 = null;
+ var RPAREN513 = null;
+
+ var NAMESPACE_NODE511_tree=null;
+ var LPAREN512_tree=null;
+ var RPAREN513_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1414:9: ( NAMESPACE_NODE LPAREN RPAREN )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1414:11: NAMESPACE_NODE LPAREN RPAREN
+ root_0 = this.adaptor.nil();
+
+ NAMESPACE_NODE511=this.match(this.input,NAMESPACE_NODE,XQueryParser.FOLLOW_NAMESPACE_NODE_in_p_NamespaceNodeTest10638); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ NAMESPACE_NODE511_tree = this.adaptor.create(NAMESPACE_NODE511);
+ this.adaptor.addChild(root_0, NAMESPACE_NODE511_tree);
+ }
+ LPAREN512=this.match(this.input,LPAREN,XQueryParser.FOLLOW_LPAREN_in_p_NamespaceNodeTest10640); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LPAREN512_tree = this.adaptor.create(LPAREN512);
+ this.adaptor.addChild(root_0, LPAREN512_tree);
+ }
+ RPAREN513=this.match(this.input,RPAREN,XQueryParser.FOLLOW_RPAREN_in_p_NamespaceNodeTest10642); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RPAREN513_tree = this.adaptor.create(RPAREN513);
+ this.adaptor.addChild(root_0, RPAREN513_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_PITest_return: (function() {
+ XQueryParser.p_PITest_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_PITest_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1418:1: p_PITest : PROCESSING_INSTRUCTION LPAREN ( p_NCName | p_StringLiteral )? RPAREN ;
+ // $ANTLR start "p_PITest"
+ p_PITest: function() {
+ var retval = new XQueryParser.p_PITest_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var PROCESSING_INSTRUCTION514 = null;
+ var LPAREN515 = null;
+ var RPAREN518 = null;
+ var p_NCName516 = null;
+ var p_StringLiteral517 = null;
+
+ var PROCESSING_INSTRUCTION514_tree=null;
+ var LPAREN515_tree=null;
+ var RPAREN518_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1419:9: ( PROCESSING_INSTRUCTION LPAREN ( p_NCName | p_StringLiteral )? RPAREN )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1419:11: PROCESSING_INSTRUCTION LPAREN ( p_NCName | p_StringLiteral )? RPAREN
+ root_0 = this.adaptor.nil();
+
+ PROCESSING_INSTRUCTION514=this.match(this.input,PROCESSING_INSTRUCTION,XQueryParser.FOLLOW_PROCESSING_INSTRUCTION_in_p_PITest10668); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ PROCESSING_INSTRUCTION514_tree = this.adaptor.create(PROCESSING_INSTRUCTION514);
+ this.adaptor.addChild(root_0, PROCESSING_INSTRUCTION514_tree);
+ }
+ LPAREN515=this.match(this.input,LPAREN,XQueryParser.FOLLOW_LPAREN_in_p_PITest10670); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LPAREN515_tree = this.adaptor.create(LPAREN515);
+ this.adaptor.addChild(root_0, LPAREN515_tree);
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1419:41: ( p_NCName | p_StringLiteral )?
+ var alt176=3;
+ var LA176_0 = this.input.LA(1);
+
+ if ( ((LA176_0>=ANCESTOR && LA176_0<=SKIP)||(LA176_0>=VALUE && LA176_0<=QUOT_ER)||LA176_0==L_NCName) ) {
+ alt176=1;
+ }
+ else if ( ((LA176_0>=APOS && LA176_0<=QUOT)) ) {
+ alt176=2;
+ }
+ switch (alt176) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1419:42: p_NCName
+ this.pushFollow(XQueryParser.FOLLOW_p_NCName_in_p_PITest10673);
+ p_NCName516=this.p_NCName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_NCName516.getTree());
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1419:53: p_StringLiteral
+ this.pushFollow(XQueryParser.FOLLOW_p_StringLiteral_in_p_PITest10677);
+ p_StringLiteral517=this.p_StringLiteral();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_StringLiteral517.getTree());
+
+
+ break;
+
+ }
+
+ RPAREN518=this.match(this.input,RPAREN,XQueryParser.FOLLOW_RPAREN_in_p_PITest10681); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RPAREN518_tree = this.adaptor.create(RPAREN518);
+ this.adaptor.addChild(root_0, RPAREN518_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_AttributeTest_return: (function() {
+ XQueryParser.p_AttributeTest_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_AttributeTest_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1423:1: p_AttributeTest : ATTRIBUTE LPAREN ( p_AttribNameOrWildcard ( COMMA p_TypeName )? )? RPAREN ;
+ // $ANTLR start "p_AttributeTest"
+ p_AttributeTest: function() {
+ var retval = new XQueryParser.p_AttributeTest_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var ATTRIBUTE519 = null;
+ var LPAREN520 = null;
+ var COMMA522 = null;
+ var RPAREN524 = null;
+ var p_AttribNameOrWildcard521 = null;
+ var p_TypeName523 = null;
+
+ var ATTRIBUTE519_tree=null;
+ var LPAREN520_tree=null;
+ var COMMA522_tree=null;
+ var RPAREN524_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1424:9: ( ATTRIBUTE LPAREN ( p_AttribNameOrWildcard ( COMMA p_TypeName )? )? RPAREN )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1424:11: ATTRIBUTE LPAREN ( p_AttribNameOrWildcard ( COMMA p_TypeName )? )? RPAREN
+ root_0 = this.adaptor.nil();
+
+ ATTRIBUTE519=this.match(this.input,ATTRIBUTE,XQueryParser.FOLLOW_ATTRIBUTE_in_p_AttributeTest10707); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ ATTRIBUTE519_tree = this.adaptor.create(ATTRIBUTE519);
+ this.adaptor.addChild(root_0, ATTRIBUTE519_tree);
+ }
+ LPAREN520=this.match(this.input,LPAREN,XQueryParser.FOLLOW_LPAREN_in_p_AttributeTest10709); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LPAREN520_tree = this.adaptor.create(LPAREN520);
+ this.adaptor.addChild(root_0, LPAREN520_tree);
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1424:28: ( p_AttribNameOrWildcard ( COMMA p_TypeName )? )?
+ var alt178=2;
+ var LA178_0 = this.input.LA(1);
+
+ if ( ((LA178_0>=ANCESTOR && LA178_0<=SKIP)||(LA178_0>=VALUE && LA178_0<=QUOT_ER)||LA178_0==STAR||LA178_0==Q||LA178_0==L_NCName) ) {
+ alt178=1;
+ }
+ switch (alt178) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1424:29: p_AttribNameOrWildcard ( COMMA p_TypeName )?
+ this.pushFollow(XQueryParser.FOLLOW_p_AttribNameOrWildcard_in_p_AttributeTest10712);
+ p_AttribNameOrWildcard521=this.p_AttribNameOrWildcard();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_AttribNameOrWildcard521.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1424:52: ( COMMA p_TypeName )?
+ var alt177=2;
+ var LA177_0 = this.input.LA(1);
+
+ if ( (LA177_0==COMMA) ) {
+ alt177=1;
+ }
+ switch (alt177) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1424:53: COMMA p_TypeName
+ COMMA522=this.match(this.input,COMMA,XQueryParser.FOLLOW_COMMA_in_p_AttributeTest10715); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ COMMA522_tree = this.adaptor.create(COMMA522);
+ this.adaptor.addChild(root_0, COMMA522_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_TypeName_in_p_AttributeTest10717);
+ p_TypeName523=this.p_TypeName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_TypeName523.getTree());
+
+
+ break;
+
+ }
+
+
+
+ break;
+
+ }
+
+ RPAREN524=this.match(this.input,RPAREN,XQueryParser.FOLLOW_RPAREN_in_p_AttributeTest10723); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RPAREN524_tree = this.adaptor.create(RPAREN524);
+ this.adaptor.addChild(root_0, RPAREN524_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_AttribNameOrWildcard_return: (function() {
+ XQueryParser.p_AttribNameOrWildcard_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_AttribNameOrWildcard_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1428:1: p_AttribNameOrWildcard : ( p_AttributeName | STAR );
+ // $ANTLR start "p_AttribNameOrWildcard"
+ p_AttribNameOrWildcard: function() {
+ var retval = new XQueryParser.p_AttribNameOrWildcard_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var STAR526 = null;
+ var p_AttributeName525 = null;
+
+ var STAR526_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1429:9: ( p_AttributeName | STAR )
+ var alt179=2;
+ var LA179_0 = this.input.LA(1);
+
+ if ( ((LA179_0>=ANCESTOR && LA179_0<=SKIP)||(LA179_0>=VALUE && LA179_0<=QUOT_ER)||LA179_0==Q||LA179_0==L_NCName) ) {
+ alt179=1;
+ }
+ else if ( (LA179_0==STAR) ) {
+ alt179=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 179, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt179) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1429:11: p_AttributeName
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_AttributeName_in_p_AttribNameOrWildcard10751);
+ p_AttributeName525=this.p_AttributeName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_AttributeName525.getTree());
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1429:29: STAR
+ root_0 = this.adaptor.nil();
+
+ STAR526=this.match(this.input,STAR,XQueryParser.FOLLOW_STAR_in_p_AttribNameOrWildcard10755); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ STAR526_tree = this.adaptor.create(STAR526);
+ this.adaptor.addChild(root_0, STAR526_tree);
+ }
+
+
+ break;
+
+ }
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_SchemaAttributeTest_return: (function() {
+ XQueryParser.p_SchemaAttributeTest_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_SchemaAttributeTest_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1433:1: p_SchemaAttributeTest : SCHEMA_ATTRIBUTE LPAREN p_AttributeDeclaration RPAREN ;
+ // $ANTLR start "p_SchemaAttributeTest"
+ p_SchemaAttributeTest: function() {
+ var retval = new XQueryParser.p_SchemaAttributeTest_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var SCHEMA_ATTRIBUTE527 = null;
+ var LPAREN528 = null;
+ var RPAREN530 = null;
+ var p_AttributeDeclaration529 = null;
+
+ var SCHEMA_ATTRIBUTE527_tree=null;
+ var LPAREN528_tree=null;
+ var RPAREN530_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1434:9: ( SCHEMA_ATTRIBUTE LPAREN p_AttributeDeclaration RPAREN )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1434:11: SCHEMA_ATTRIBUTE LPAREN p_AttributeDeclaration RPAREN
+ root_0 = this.adaptor.nil();
+
+ SCHEMA_ATTRIBUTE527=this.match(this.input,SCHEMA_ATTRIBUTE,XQueryParser.FOLLOW_SCHEMA_ATTRIBUTE_in_p_SchemaAttributeTest10781); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ SCHEMA_ATTRIBUTE527_tree = this.adaptor.create(SCHEMA_ATTRIBUTE527);
+ this.adaptor.addChild(root_0, SCHEMA_ATTRIBUTE527_tree);
+ }
+ LPAREN528=this.match(this.input,LPAREN,XQueryParser.FOLLOW_LPAREN_in_p_SchemaAttributeTest10783); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LPAREN528_tree = this.adaptor.create(LPAREN528);
+ this.adaptor.addChild(root_0, LPAREN528_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_AttributeDeclaration_in_p_SchemaAttributeTest10785);
+ p_AttributeDeclaration529=this.p_AttributeDeclaration();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_AttributeDeclaration529.getTree());
+ RPAREN530=this.match(this.input,RPAREN,XQueryParser.FOLLOW_RPAREN_in_p_SchemaAttributeTest10787); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RPAREN530_tree = this.adaptor.create(RPAREN530);
+ this.adaptor.addChild(root_0, RPAREN530_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_AttributeDeclaration_return: (function() {
+ XQueryParser.p_AttributeDeclaration_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_AttributeDeclaration_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1438:1: p_AttributeDeclaration : p_AttributeName ;
+ // $ANTLR start "p_AttributeDeclaration"
+ p_AttributeDeclaration: function() {
+ var retval = new XQueryParser.p_AttributeDeclaration_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_AttributeName531 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1439:9: ( p_AttributeName )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1439:11: p_AttributeName
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_AttributeName_in_p_AttributeDeclaration10813);
+ p_AttributeName531=this.p_AttributeName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_AttributeName531.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_ElementTest_return: (function() {
+ XQueryParser.p_ElementTest_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_ElementTest_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1443:1: p_ElementTest : ELEMENT LPAREN ( p_ElementNameOrWildcard ( COMMA p_TypeName ( QUESTION )? )? )? RPAREN ;
+ // $ANTLR start "p_ElementTest"
+ p_ElementTest: function() {
+ var retval = new XQueryParser.p_ElementTest_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var ELEMENT532 = null;
+ var LPAREN533 = null;
+ var COMMA535 = null;
+ var QUESTION537 = null;
+ var RPAREN538 = null;
+ var p_ElementNameOrWildcard534 = null;
+ var p_TypeName536 = null;
+
+ var ELEMENT532_tree=null;
+ var LPAREN533_tree=null;
+ var COMMA535_tree=null;
+ var QUESTION537_tree=null;
+ var RPAREN538_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1444:9: ( ELEMENT LPAREN ( p_ElementNameOrWildcard ( COMMA p_TypeName ( QUESTION )? )? )? RPAREN )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1444:11: ELEMENT LPAREN ( p_ElementNameOrWildcard ( COMMA p_TypeName ( QUESTION )? )? )? RPAREN
+ root_0 = this.adaptor.nil();
+
+ ELEMENT532=this.match(this.input,ELEMENT,XQueryParser.FOLLOW_ELEMENT_in_p_ElementTest10839); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ ELEMENT532_tree = this.adaptor.create(ELEMENT532);
+ this.adaptor.addChild(root_0, ELEMENT532_tree);
+ }
+ LPAREN533=this.match(this.input,LPAREN,XQueryParser.FOLLOW_LPAREN_in_p_ElementTest10841); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LPAREN533_tree = this.adaptor.create(LPAREN533);
+ this.adaptor.addChild(root_0, LPAREN533_tree);
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1444:26: ( p_ElementNameOrWildcard ( COMMA p_TypeName ( QUESTION )? )? )?
+ var alt182=2;
+ var LA182_0 = this.input.LA(1);
+
+ if ( ((LA182_0>=ANCESTOR && LA182_0<=SKIP)||(LA182_0>=VALUE && LA182_0<=QUOT_ER)||LA182_0==STAR||LA182_0==Q||LA182_0==L_NCName) ) {
+ alt182=1;
+ }
+ switch (alt182) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1444:27: p_ElementNameOrWildcard ( COMMA p_TypeName ( QUESTION )? )?
+ this.pushFollow(XQueryParser.FOLLOW_p_ElementNameOrWildcard_in_p_ElementTest10844);
+ p_ElementNameOrWildcard534=this.p_ElementNameOrWildcard();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ElementNameOrWildcard534.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1444:51: ( COMMA p_TypeName ( QUESTION )? )?
+ var alt181=2;
+ var LA181_0 = this.input.LA(1);
+
+ if ( (LA181_0==COMMA) ) {
+ alt181=1;
+ }
+ switch (alt181) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1444:52: COMMA p_TypeName ( QUESTION )?
+ COMMA535=this.match(this.input,COMMA,XQueryParser.FOLLOW_COMMA_in_p_ElementTest10847); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ COMMA535_tree = this.adaptor.create(COMMA535);
+ this.adaptor.addChild(root_0, COMMA535_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_TypeName_in_p_ElementTest10849);
+ p_TypeName536=this.p_TypeName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_TypeName536.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1444:69: ( QUESTION )?
+ var alt180=2;
+ var LA180_0 = this.input.LA(1);
+
+ if ( (LA180_0==QUESTION) ) {
+ alt180=1;
+ }
+ switch (alt180) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1444:69: QUESTION
+ QUESTION537=this.match(this.input,QUESTION,XQueryParser.FOLLOW_QUESTION_in_p_ElementTest10851); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ QUESTION537_tree = this.adaptor.create(QUESTION537);
+ this.adaptor.addChild(root_0, QUESTION537_tree);
+ }
+
+
+ break;
+
+ }
+
+
+
+ break;
+
+ }
+
+
+
+ break;
+
+ }
+
+ RPAREN538=this.match(this.input,RPAREN,XQueryParser.FOLLOW_RPAREN_in_p_ElementTest10858); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RPAREN538_tree = this.adaptor.create(RPAREN538);
+ this.adaptor.addChild(root_0, RPAREN538_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_ElementNameOrWildcard_return: (function() {
+ XQueryParser.p_ElementNameOrWildcard_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_ElementNameOrWildcard_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1448:1: p_ElementNameOrWildcard : ( p_EQName | STAR );
+ // $ANTLR start "p_ElementNameOrWildcard"
+ p_ElementNameOrWildcard: function() {
+ var retval = new XQueryParser.p_ElementNameOrWildcard_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var STAR540 = null;
+ var p_EQName539 = null;
+
+ var STAR540_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1449:9: ( p_EQName | STAR )
+ var alt183=2;
+ var LA183_0 = this.input.LA(1);
+
+ if ( ((LA183_0>=ANCESTOR && LA183_0<=SKIP)||(LA183_0>=VALUE && LA183_0<=QUOT_ER)||LA183_0==Q||LA183_0==L_NCName) ) {
+ alt183=1;
+ }
+ else if ( (LA183_0==STAR) ) {
+ alt183=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 183, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt183) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1449:11: p_EQName
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_EQName_in_p_ElementNameOrWildcard10884);
+ p_EQName539=this.p_EQName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_EQName539.getTree());
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1449:22: STAR
+ root_0 = this.adaptor.nil();
+
+ STAR540=this.match(this.input,STAR,XQueryParser.FOLLOW_STAR_in_p_ElementNameOrWildcard10888); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ STAR540_tree = this.adaptor.create(STAR540);
+ this.adaptor.addChild(root_0, STAR540_tree);
+ }
+
+
+ break;
+
+ }
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_SchemaElementTest_return: (function() {
+ XQueryParser.p_SchemaElementTest_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_SchemaElementTest_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1452:1: p_SchemaElementTest : SCHEMA_ELEMENT LPAREN p_ElementDeclaration RPAREN ;
+ // $ANTLR start "p_SchemaElementTest"
+ p_SchemaElementTest: function() {
+ var retval = new XQueryParser.p_SchemaElementTest_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var SCHEMA_ELEMENT541 = null;
+ var LPAREN542 = null;
+ var RPAREN544 = null;
+ var p_ElementDeclaration543 = null;
+
+ var SCHEMA_ELEMENT541_tree=null;
+ var LPAREN542_tree=null;
+ var RPAREN544_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1453:9: ( SCHEMA_ELEMENT LPAREN p_ElementDeclaration RPAREN )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1453:11: SCHEMA_ELEMENT LPAREN p_ElementDeclaration RPAREN
+ root_0 = this.adaptor.nil();
+
+ SCHEMA_ELEMENT541=this.match(this.input,SCHEMA_ELEMENT,XQueryParser.FOLLOW_SCHEMA_ELEMENT_in_p_SchemaElementTest10906); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ SCHEMA_ELEMENT541_tree = this.adaptor.create(SCHEMA_ELEMENT541);
+ this.adaptor.addChild(root_0, SCHEMA_ELEMENT541_tree);
+ }
+ LPAREN542=this.match(this.input,LPAREN,XQueryParser.FOLLOW_LPAREN_in_p_SchemaElementTest10908); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LPAREN542_tree = this.adaptor.create(LPAREN542);
+ this.adaptor.addChild(root_0, LPAREN542_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_ElementDeclaration_in_p_SchemaElementTest10910);
+ p_ElementDeclaration543=this.p_ElementDeclaration();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ElementDeclaration543.getTree());
+ RPAREN544=this.match(this.input,RPAREN,XQueryParser.FOLLOW_RPAREN_in_p_SchemaElementTest10912); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RPAREN544_tree = this.adaptor.create(RPAREN544);
+ this.adaptor.addChild(root_0, RPAREN544_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_ElementDeclaration_return: (function() {
+ XQueryParser.p_ElementDeclaration_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_ElementDeclaration_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1457:1: p_ElementDeclaration : p_ElementName ;
+ // $ANTLR start "p_ElementDeclaration"
+ p_ElementDeclaration: function() {
+ var retval = new XQueryParser.p_ElementDeclaration_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_ElementName545 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1458:9: ( p_ElementName )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1458:11: p_ElementName
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_ElementName_in_p_ElementDeclaration10938);
+ p_ElementName545=this.p_ElementName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ElementName545.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_AttributeName_return: (function() {
+ XQueryParser.p_AttributeName_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_AttributeName_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1462:1: p_AttributeName : p_EQName ;
+ // $ANTLR start "p_AttributeName"
+ p_AttributeName: function() {
+ var retval = new XQueryParser.p_AttributeName_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_EQName546 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1463:9: ( p_EQName )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1463:11: p_EQName
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_EQName_in_p_AttributeName10964);
+ p_EQName546=this.p_EQName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_EQName546.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_ElementName_return: (function() {
+ XQueryParser.p_ElementName_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_ElementName_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1467:1: p_ElementName : p_EQName ;
+ // $ANTLR start "p_ElementName"
+ p_ElementName: function() {
+ var retval = new XQueryParser.p_ElementName_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_EQName547 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1468:9: ( p_EQName )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1468:11: p_EQName
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_EQName_in_p_ElementName10990);
+ p_EQName547=this.p_EQName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_EQName547.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_TypeName_return: (function() {
+ XQueryParser.p_TypeName_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_TypeName_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1472:1: p_TypeName : p_EQName ;
+ // $ANTLR start "p_TypeName"
+ p_TypeName: function() {
+ var retval = new XQueryParser.p_TypeName_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_EQName548 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1473:9: ( p_EQName )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1473:11: p_EQName
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_EQName_in_p_TypeName11016);
+ p_EQName548=this.p_EQName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_EQName548.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_FunctionTest_return: (function() {
+ XQueryParser.p_FunctionTest_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_FunctionTest_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1477:1: p_FunctionTest : ( p_Annotation )* ( p_AnyFunctionTest | p_TypedFunctionTest ) ;
+ // $ANTLR start "p_FunctionTest"
+ p_FunctionTest: function() {
+ var retval = new XQueryParser.p_FunctionTest_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_Annotation549 = null;
+ var p_AnyFunctionTest550 = null;
+ var p_TypedFunctionTest551 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1478:9: ( ( p_Annotation )* ( p_AnyFunctionTest | p_TypedFunctionTest ) )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1478:11: ( p_Annotation )* ( p_AnyFunctionTest | p_TypedFunctionTest )
+ root_0 = this.adaptor.nil();
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1478:11: ( p_Annotation )*
+ loop184:
+ do {
+ var alt184=2;
+ var LA184_0 = this.input.LA(1);
+
+ if ( (LA184_0==ANN_PERCENT) ) {
+ alt184=1;
+ }
+
+
+ switch (alt184) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1478:11: p_Annotation
+ this.pushFollow(XQueryParser.FOLLOW_p_Annotation_in_p_FunctionTest11042);
+ p_Annotation549=this.p_Annotation();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Annotation549.getTree());
+
+
+ break;
+
+ default :
+ break loop184;
+ }
+ } while (true);
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1478:25: ( p_AnyFunctionTest | p_TypedFunctionTest )
+ var alt185=2;
+ var LA185_0 = this.input.LA(1);
+
+ if ( (LA185_0==FUNCTION) ) {
+ var LA185_1 = this.input.LA(2);
+
+ if ( (LA185_1==LPAREN) ) {
+ var LA185_2 = this.input.LA(3);
+
+ if ( (LA185_2==STAR) ) {
+ alt185=1;
+ }
+ else if ( ((LA185_2>=ANCESTOR && LA185_2<=SKIP)||(LA185_2>=VALUE && LA185_2<=QUOT_ER)||(LA185_2>=LPAREN && LA185_2<=RPAREN)||LA185_2==ANN_PERCENT||LA185_2==Q||LA185_2==L_NCName) ) {
+ alt185=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 185, 2, this.input);
+
+ throw nvae;
+ }
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 185, 1, this.input);
+
+ throw nvae;
+ }
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 185, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt185) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1478:26: p_AnyFunctionTest
+ this.pushFollow(XQueryParser.FOLLOW_p_AnyFunctionTest_in_p_FunctionTest11046);
+ p_AnyFunctionTest550=this.p_AnyFunctionTest();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_AnyFunctionTest550.getTree());
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1478:46: p_TypedFunctionTest
+ this.pushFollow(XQueryParser.FOLLOW_p_TypedFunctionTest_in_p_FunctionTest11050);
+ p_TypedFunctionTest551=this.p_TypedFunctionTest();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_TypedFunctionTest551.getTree());
+
+
+ break;
+
+ }
+
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_AnyFunctionTest_return: (function() {
+ XQueryParser.p_AnyFunctionTest_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_AnyFunctionTest_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1482:1: p_AnyFunctionTest : FUNCTION LPAREN STAR RPAREN ;
+ // $ANTLR start "p_AnyFunctionTest"
+ p_AnyFunctionTest: function() {
+ var retval = new XQueryParser.p_AnyFunctionTest_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var FUNCTION552 = null;
+ var LPAREN553 = null;
+ var STAR554 = null;
+ var RPAREN555 = null;
+
+ var FUNCTION552_tree=null;
+ var LPAREN553_tree=null;
+ var STAR554_tree=null;
+ var RPAREN555_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1483:9: ( FUNCTION LPAREN STAR RPAREN )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1483:11: FUNCTION LPAREN STAR RPAREN
+ root_0 = this.adaptor.nil();
+
+ FUNCTION552=this.match(this.input,FUNCTION,XQueryParser.FOLLOW_FUNCTION_in_p_AnyFunctionTest11077); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ FUNCTION552_tree = this.adaptor.create(FUNCTION552);
+ this.adaptor.addChild(root_0, FUNCTION552_tree);
+ }
+ LPAREN553=this.match(this.input,LPAREN,XQueryParser.FOLLOW_LPAREN_in_p_AnyFunctionTest11079); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LPAREN553_tree = this.adaptor.create(LPAREN553);
+ this.adaptor.addChild(root_0, LPAREN553_tree);
+ }
+ STAR554=this.match(this.input,STAR,XQueryParser.FOLLOW_STAR_in_p_AnyFunctionTest11081); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ STAR554_tree = this.adaptor.create(STAR554);
+ this.adaptor.addChild(root_0, STAR554_tree);
+ }
+ RPAREN555=this.match(this.input,RPAREN,XQueryParser.FOLLOW_RPAREN_in_p_AnyFunctionTest11083); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RPAREN555_tree = this.adaptor.create(RPAREN555);
+ this.adaptor.addChild(root_0, RPAREN555_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_TypedFunctionTest_return: (function() {
+ XQueryParser.p_TypedFunctionTest_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_TypedFunctionTest_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1487:1: p_TypedFunctionTest : FUNCTION LPAREN ( p_SequenceType ( COMMA p_SequenceType )* )? RPAREN AS p_SequenceType ;
+ // $ANTLR start "p_TypedFunctionTest"
+ p_TypedFunctionTest: function() {
+ var retval = new XQueryParser.p_TypedFunctionTest_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var FUNCTION556 = null;
+ var LPAREN557 = null;
+ var COMMA559 = null;
+ var RPAREN561 = null;
+ var AS562 = null;
+ var p_SequenceType558 = null;
+ var p_SequenceType560 = null;
+ var p_SequenceType563 = null;
+
+ var FUNCTION556_tree=null;
+ var LPAREN557_tree=null;
+ var COMMA559_tree=null;
+ var RPAREN561_tree=null;
+ var AS562_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1488:9: ( FUNCTION LPAREN ( p_SequenceType ( COMMA p_SequenceType )* )? RPAREN AS p_SequenceType )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1488:11: FUNCTION LPAREN ( p_SequenceType ( COMMA p_SequenceType )* )? RPAREN AS p_SequenceType
+ root_0 = this.adaptor.nil();
+
+ FUNCTION556=this.match(this.input,FUNCTION,XQueryParser.FOLLOW_FUNCTION_in_p_TypedFunctionTest11109); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ FUNCTION556_tree = this.adaptor.create(FUNCTION556);
+ this.adaptor.addChild(root_0, FUNCTION556_tree);
+ }
+ LPAREN557=this.match(this.input,LPAREN,XQueryParser.FOLLOW_LPAREN_in_p_TypedFunctionTest11111); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LPAREN557_tree = this.adaptor.create(LPAREN557);
+ this.adaptor.addChild(root_0, LPAREN557_tree);
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1488:27: ( p_SequenceType ( COMMA p_SequenceType )* )?
+ var alt187=2;
+ var LA187_0 = this.input.LA(1);
+
+ if ( ((LA187_0>=ANCESTOR && LA187_0<=SKIP)||(LA187_0>=VALUE && LA187_0<=QUOT_ER)||LA187_0==LPAREN||LA187_0==ANN_PERCENT||LA187_0==Q||LA187_0==L_NCName) ) {
+ alt187=1;
+ }
+ switch (alt187) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1488:28: p_SequenceType ( COMMA p_SequenceType )*
+ this.pushFollow(XQueryParser.FOLLOW_p_SequenceType_in_p_TypedFunctionTest11114);
+ p_SequenceType558=this.p_SequenceType();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_SequenceType558.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1488:43: ( COMMA p_SequenceType )*
+ loop186:
+ do {
+ var alt186=2;
+ var LA186_0 = this.input.LA(1);
+
+ if ( (LA186_0==COMMA) ) {
+ alt186=1;
+ }
+
+
+ switch (alt186) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1488:44: COMMA p_SequenceType
+ COMMA559=this.match(this.input,COMMA,XQueryParser.FOLLOW_COMMA_in_p_TypedFunctionTest11117); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ COMMA559_tree = this.adaptor.create(COMMA559);
+ this.adaptor.addChild(root_0, COMMA559_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_SequenceType_in_p_TypedFunctionTest11119);
+ p_SequenceType560=this.p_SequenceType();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_SequenceType560.getTree());
+
+
+ break;
+
+ default :
+ break loop186;
+ }
+ } while (true);
+
+
+
+ break;
+
+ }
+
+ RPAREN561=this.match(this.input,RPAREN,XQueryParser.FOLLOW_RPAREN_in_p_TypedFunctionTest11125); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RPAREN561_tree = this.adaptor.create(RPAREN561);
+ this.adaptor.addChild(root_0, RPAREN561_tree);
+ }
+ AS562=this.match(this.input,AS,XQueryParser.FOLLOW_AS_in_p_TypedFunctionTest11127); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ AS562_tree = this.adaptor.create(AS562);
+ this.adaptor.addChild(root_0, AS562_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_SequenceType_in_p_TypedFunctionTest11129);
+ p_SequenceType563=this.p_SequenceType();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_SequenceType563.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_ParenthesizedItemType_return: (function() {
+ XQueryParser.p_ParenthesizedItemType_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_ParenthesizedItemType_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1492:1: p_ParenthesizedItemType : LPAREN p_ItemType RPAREN ;
+ // $ANTLR start "p_ParenthesizedItemType"
+ p_ParenthesizedItemType: function() {
+ var retval = new XQueryParser.p_ParenthesizedItemType_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var LPAREN564 = null;
+ var RPAREN566 = null;
+ var p_ItemType565 = null;
+
+ var LPAREN564_tree=null;
+ var RPAREN566_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1493:9: ( LPAREN p_ItemType RPAREN )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1493:11: LPAREN p_ItemType RPAREN
+ root_0 = this.adaptor.nil();
+
+ LPAREN564=this.match(this.input,LPAREN,XQueryParser.FOLLOW_LPAREN_in_p_ParenthesizedItemType11155); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LPAREN564_tree = this.adaptor.create(LPAREN564);
+ this.adaptor.addChild(root_0, LPAREN564_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_ItemType_in_p_ParenthesizedItemType11157);
+ p_ItemType565=this.p_ItemType();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ItemType565.getTree());
+ RPAREN566=this.match(this.input,RPAREN,XQueryParser.FOLLOW_RPAREN_in_p_ParenthesizedItemType11159); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RPAREN566_tree = this.adaptor.create(RPAREN566);
+ this.adaptor.addChild(root_0, RPAREN566_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_StringLiteral_return: (function() {
+ XQueryParser.p_StringLiteral_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_StringLiteral_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1522:1: p_StringLiteral : ( QUOT pg_QuotStringLiteralContent QUOT -> ^( StringLiteral ( pg_QuotStringLiteralContent )* ) | APOS pg_AposStringLiteralContent APOS -> ^( StringLiteral ( pg_AposStringLiteralContent )* ) );
+ // $ANTLR start "p_StringLiteral"
+ p_StringLiteral: function() {
+ var retval = new XQueryParser.p_StringLiteral_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var QUOT567 = null;
+ var QUOT569 = null;
+ var APOS570 = null;
+ var APOS572 = null;
+ var pg_QuotStringLiteralContent568 = null;
+ var pg_AposStringLiteralContent571 = null;
+
+ var QUOT567_tree=null;
+ var QUOT569_tree=null;
+ var APOS570_tree=null;
+ var APOS572_tree=null;
+ var stream_APOS=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token APOS");
+ var stream_QUOT=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token QUOT");
+ var stream_pg_QuotStringLiteralContent=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"rule pg_QuotStringLiteralContent");
+ var stream_pg_AposStringLiteralContent=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"rule pg_AposStringLiteralContent");
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1523:9: ( QUOT pg_QuotStringLiteralContent QUOT -> ^( StringLiteral ( pg_QuotStringLiteralContent )* ) | APOS pg_AposStringLiteralContent APOS -> ^( StringLiteral ( pg_AposStringLiteralContent )* ) )
+ var alt188=2;
+ var LA188_0 = this.input.LA(1);
+
+ if ( (LA188_0==QUOT) ) {
+ alt188=1;
+ }
+ else if ( (LA188_0==APOS) ) {
+ alt188=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 188, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt188) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1523:11: QUOT pg_QuotStringLiteralContent QUOT
+ QUOT567=this.match(this.input,QUOT,XQueryParser.FOLLOW_QUOT_in_p_StringLiteral11210); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_QUOT.add(QUOT567);
+
+ if ( this.state.backtracking===0 ) {
+ this.pushStringLexer(false);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_pg_QuotStringLiteralContent_in_p_StringLiteral11214);
+ pg_QuotStringLiteralContent568=this.pg_QuotStringLiteralContent();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_pg_QuotStringLiteralContent.add(pg_QuotStringLiteralContent568.getTree());
+ QUOT569=this.match(this.input,QUOT,XQueryParser.FOLLOW_QUOT_in_p_StringLiteral11216); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_QUOT.add(QUOT569);
+
+ if ( this.state.backtracking===0 ) {
+ this.popLexer();
+ }
+
+
+ // AST REWRITE
+ // elements: pg_QuotStringLiteralContent
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( this.state.backtracking===0 ) {
+ retval.tree = root_0;
+ var stream_retval=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = this.adaptor.nil();
+ // 1524:17: -> ^( StringLiteral ( pg_QuotStringLiteralContent )* )
+ {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1524:20: ^( StringLiteral ( pg_QuotStringLiteralContent )* )
+ {
+ var root_1 = this.adaptor.nil();
+ root_1 = this.adaptor.becomeRoot(this.adaptor.create(StringLiteral, "StringLiteral"), root_1);
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1524:36: ( pg_QuotStringLiteralContent )*
+ while ( stream_pg_QuotStringLiteralContent.hasNext() ) {
+ this.adaptor.addChild(root_1, stream_pg_QuotStringLiteralContent.nextTree());
+
+ }
+ stream_pg_QuotStringLiteralContent.reset();
+
+ this.adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;}
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1525:11: APOS pg_AposStringLiteralContent APOS
+ APOS570=this.match(this.input,APOS,XQueryParser.FOLLOW_APOS_in_p_StringLiteral11255); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_APOS.add(APOS570);
+
+ if ( this.state.backtracking===0 ) {
+ this.pushStringLexer(true);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_pg_AposStringLiteralContent_in_p_StringLiteral11259);
+ pg_AposStringLiteralContent571=this.pg_AposStringLiteralContent();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_pg_AposStringLiteralContent.add(pg_AposStringLiteralContent571.getTree());
+ APOS572=this.match(this.input,APOS,XQueryParser.FOLLOW_APOS_in_p_StringLiteral11261); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_APOS.add(APOS572);
+
+ if ( this.state.backtracking===0 ) {
+ this.popLexer();
+ }
+
+
+ // AST REWRITE
+ // elements: pg_AposStringLiteralContent
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( this.state.backtracking===0 ) {
+ retval.tree = root_0;
+ var stream_retval=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = this.adaptor.nil();
+ // 1526:17: -> ^( StringLiteral ( pg_AposStringLiteralContent )* )
+ {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1526:20: ^( StringLiteral ( pg_AposStringLiteralContent )* )
+ {
+ var root_1 = this.adaptor.nil();
+ root_1 = this.adaptor.becomeRoot(this.adaptor.create(StringLiteral, "StringLiteral"), root_1);
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1526:36: ( pg_AposStringLiteralContent )*
+ while ( stream_pg_AposStringLiteralContent.hasNext() ) {
+ this.adaptor.addChild(root_1, stream_pg_AposStringLiteralContent.nextTree());
+
+ }
+ stream_pg_AposStringLiteralContent.reset();
+
+ this.adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;}
+
+ break;
+
+ }
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ this.addString(retval.start, retval.stop);
+ }
+ return retval;
+ },
+
+ // inline static return class
+ pg_QuotStringLiteralContent_return: (function() {
+ XQueryParser.pg_QuotStringLiteralContent_return = function(){};
+ org.antlr.lang.extend(XQueryParser.pg_QuotStringLiteralContent_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1532:1: pg_QuotStringLiteralContent : ( ESCAPE_QUOT | L_CharRef | L_PredefinedEntityRef | ~ ( QUOT | AMP ) )* ;
+ // $ANTLR start "pg_QuotStringLiteralContent"
+ pg_QuotStringLiteralContent: function() {
+ var retval = new XQueryParser.pg_QuotStringLiteralContent_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var set573 = null;
+
+ var set573_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1533:9: ( ( ESCAPE_QUOT | L_CharRef | L_PredefinedEntityRef | ~ ( QUOT | AMP ) )* )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1533:11: ( ESCAPE_QUOT | L_CharRef | L_PredefinedEntityRef | ~ ( QUOT | AMP ) )*
+ root_0 = this.adaptor.nil();
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1533:11: ( ESCAPE_QUOT | L_CharRef | L_PredefinedEntityRef | ~ ( QUOT | AMP ) )*
+ loop189:
+ do {
+ var alt189=2;
+ var LA189_0 = this.input.LA(1);
+
+ if ( ((LA189_0>=L_QuotAttrContentChar && LA189_0<=HASH)||(LA189_0>=COMMA && LA189_0<=APOS)||(LA189_0>=NCNameStartChar && LA189_0<=BlockExpr)) ) {
+ alt189=1;
+ }
+
+
+ switch (alt189) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:
+ set573=this.input.LT(1);
+ if ( (this.input.LA(1)>=L_QuotAttrContentChar && this.input.LA(1)<=HASH)||(this.input.LA(1)>=COMMA && this.input.LA(1)<=APOS)||(this.input.LA(1)>=NCNameStartChar && this.input.LA(1)<=BlockExpr) ) {
+ this.input.consume();
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, this.adaptor.create(set573));
+ this.state.errorRecovery=false;this.state.failed=false;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
+ throw mse;
+ }
+
+
+
+ break;
+
+ default :
+ break loop189;
+ }
+ } while (true);
+
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ pg_AposStringLiteralContent_return: (function() {
+ XQueryParser.pg_AposStringLiteralContent_return = function(){};
+ org.antlr.lang.extend(XQueryParser.pg_AposStringLiteralContent_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1540:1: pg_AposStringLiteralContent : ( ESCAPE_APOS | L_CharRef | L_PredefinedEntityRef | ~ ( APOS | AMP ) )* ;
+ // $ANTLR start "pg_AposStringLiteralContent"
+ pg_AposStringLiteralContent: function() {
+ var retval = new XQueryParser.pg_AposStringLiteralContent_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var set574 = null;
+
+ var set574_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1541:9: ( ( ESCAPE_APOS | L_CharRef | L_PredefinedEntityRef | ~ ( APOS | AMP ) )* )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1541:11: ( ESCAPE_APOS | L_CharRef | L_PredefinedEntityRef | ~ ( APOS | AMP ) )*
+ root_0 = this.adaptor.nil();
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1541:11: ( ESCAPE_APOS | L_CharRef | L_PredefinedEntityRef | ~ ( APOS | AMP ) )*
+ loop190:
+ do {
+ var alt190=2;
+ var LA190_0 = this.input.LA(1);
+
+ if ( ((LA190_0>=L_QuotAttrContentChar && LA190_0<=HASH)||(LA190_0>=COMMA && LA190_0<=CHARREF_HEX)||(LA190_0>=QUOT && LA190_0<=BlockExpr)) ) {
+ alt190=1;
+ }
+
+
+ switch (alt190) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:
+ set574=this.input.LT(1);
+ if ( (this.input.LA(1)>=L_QuotAttrContentChar && this.input.LA(1)<=HASH)||(this.input.LA(1)>=COMMA && this.input.LA(1)<=CHARREF_HEX)||(this.input.LA(1)>=QUOT && this.input.LA(1)<=BlockExpr) ) {
+ this.input.consume();
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, this.adaptor.create(set574));
+ this.state.errorRecovery=false;this.state.failed=false;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
+ throw mse;
+ }
+
+
+
+ break;
+
+ default :
+ break loop190;
+ }
+ } while (true);
+
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_ElementContentChar_return: (function() {
+ XQueryParser.p_ElementContentChar_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_ElementContentChar_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1555:1: p_ElementContentChar : L_ElementContentChar ;
+ // $ANTLR start "p_ElementContentChar"
+ p_ElementContentChar: function() {
+ var retval = new XQueryParser.p_ElementContentChar_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var L_ElementContentChar575 = null;
+
+ var L_ElementContentChar575_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1556:9: ( L_ElementContentChar )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1556:11: L_ElementContentChar
+ root_0 = this.adaptor.nil();
+
+ L_ElementContentChar575=this.match(this.input,L_ElementContentChar,XQueryParser.FOLLOW_L_ElementContentChar_in_p_ElementContentChar11436); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ L_ElementContentChar575_tree = this.adaptor.create(L_ElementContentChar575);
+ this.adaptor.addChild(root_0, L_ElementContentChar575_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_QuotAttrContentChar_return: (function() {
+ XQueryParser.p_QuotAttrContentChar_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_QuotAttrContentChar_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1560:1: p_QuotAttrContentChar : L_QuotAttrContentChar -> ^( AttributeValueChar L_QuotAttrContentChar ) ;
+ // $ANTLR start "p_QuotAttrContentChar"
+ p_QuotAttrContentChar: function() {
+ var retval = new XQueryParser.p_QuotAttrContentChar_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var L_QuotAttrContentChar576 = null;
+
+ var L_QuotAttrContentChar576_tree=null;
+ var stream_L_QuotAttrContentChar=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token L_QuotAttrContentChar");
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1561:9: ( L_QuotAttrContentChar -> ^( AttributeValueChar L_QuotAttrContentChar ) )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1561:11: L_QuotAttrContentChar
+ L_QuotAttrContentChar576=this.match(this.input,L_QuotAttrContentChar,XQueryParser.FOLLOW_L_QuotAttrContentChar_in_p_QuotAttrContentChar11462); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_L_QuotAttrContentChar.add(L_QuotAttrContentChar576);
+
+
+
+ // AST REWRITE
+ // elements: L_QuotAttrContentChar
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( this.state.backtracking===0 ) {
+ retval.tree = root_0;
+ var stream_retval=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = this.adaptor.nil();
+ // 1562:17: -> ^( AttributeValueChar L_QuotAttrContentChar )
+ {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1562:20: ^( AttributeValueChar L_QuotAttrContentChar )
+ {
+ var root_1 = this.adaptor.nil();
+ root_1 = this.adaptor.becomeRoot(this.adaptor.create(AttributeValueChar, "AttributeValueChar"), root_1);
+
+ this.adaptor.addChild(root_1, stream_L_QuotAttrContentChar.nextNode());
+
+ this.adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;}
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_AposAttrContentChar_return: (function() {
+ XQueryParser.p_AposAttrContentChar_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_AposAttrContentChar_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1566:1: p_AposAttrContentChar : L_AposAttrContentChar -> ^( AttributeValueChar L_AposAttrContentChar ) ;
+ // $ANTLR start "p_AposAttrContentChar"
+ p_AposAttrContentChar: function() {
+ var retval = new XQueryParser.p_AposAttrContentChar_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var L_AposAttrContentChar577 = null;
+
+ var L_AposAttrContentChar577_tree=null;
+ var stream_L_AposAttrContentChar=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token L_AposAttrContentChar");
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1567:9: ( L_AposAttrContentChar -> ^( AttributeValueChar L_AposAttrContentChar ) )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1567:11: L_AposAttrContentChar
+ L_AposAttrContentChar577=this.match(this.input,L_AposAttrContentChar,XQueryParser.FOLLOW_L_AposAttrContentChar_in_p_AposAttrContentChar11512); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_L_AposAttrContentChar.add(L_AposAttrContentChar577);
+
+
+
+ // AST REWRITE
+ // elements: L_AposAttrContentChar
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( this.state.backtracking===0 ) {
+ retval.tree = root_0;
+ var stream_retval=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = this.adaptor.nil();
+ // 1568:17: -> ^( AttributeValueChar L_AposAttrContentChar )
+ {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1568:20: ^( AttributeValueChar L_AposAttrContentChar )
+ {
+ var root_1 = this.adaptor.nil();
+ root_1 = this.adaptor.becomeRoot(this.adaptor.create(AttributeValueChar, "AttributeValueChar"), root_1);
+
+ this.adaptor.addChild(root_1, stream_L_AposAttrContentChar.nextNode());
+
+ this.adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;}
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_EQName_return: (function() {
+ XQueryParser.p_EQName_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_EQName_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1583:1: p_EQName : ( p_QName | p_URIQualifiedName );
+ // $ANTLR start "p_EQName"
+ p_EQName: function() {
+ var retval = new XQueryParser.p_EQName_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_QName578 = null;
+ var p_URIQualifiedName579 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1584:9: ( p_QName | p_URIQualifiedName )
+ var alt191=2;
+ var LA191_0 = this.input.LA(1);
+
+ if ( ((LA191_0>=ANCESTOR && LA191_0<=SKIP)||(LA191_0>=VALUE && LA191_0<=QUOT_ER)||LA191_0==L_NCName) ) {
+ alt191=1;
+ }
+ else if ( (LA191_0==Q) ) {
+ alt191=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 191, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt191) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1584:11: p_QName
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_QName_in_p_EQName11581);
+ p_QName578=this.p_QName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_QName578.getTree());
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1585:11: p_URIQualifiedName
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_URIQualifiedName_in_p_EQName11593);
+ p_URIQualifiedName579=this.p_URIQualifiedName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_URIQualifiedName579.getTree());
+
+
+ break;
+
+ }
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_URIQualifiedName_return: (function() {
+ XQueryParser.p_URIQualifiedName_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_URIQualifiedName_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1588:1: p_URIQualifiedName : p_BracedURILiteral p_NCName ;
+ // $ANTLR start "p_URIQualifiedName"
+ p_URIQualifiedName: function() {
+ var retval = new XQueryParser.p_URIQualifiedName_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_BracedURILiteral580 = null;
+ var p_NCName581 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1589:9: ( p_BracedURILiteral p_NCName )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1589:11: p_BracedURILiteral p_NCName
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_BracedURILiteral_in_p_URIQualifiedName11618);
+ p_BracedURILiteral580=this.p_BracedURILiteral();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_BracedURILiteral580.getTree());
+ this.pushFollow(XQueryParser.FOLLOW_p_NCName_in_p_URIQualifiedName11620);
+ p_NCName581=this.p_NCName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_NCName581.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_BracedURILiteral_return: (function() {
+ XQueryParser.p_BracedURILiteral_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_BracedURILiteral_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1592:1: p_BracedURILiteral : Q LBRACKET ( L_PredefinedEntityRef | L_CharRef | ~ ( AMP | LBRACKET | RBRACKET ) )* RBRACKET ;
+ // $ANTLR start "p_BracedURILiteral"
+ p_BracedURILiteral: function() {
+ var retval = new XQueryParser.p_BracedURILiteral_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var Q582 = null;
+ var LBRACKET583 = null;
+ var set584 = null;
+ var RBRACKET585 = null;
+
+ var Q582_tree=null;
+ var LBRACKET583_tree=null;
+ var set584_tree=null;
+ var RBRACKET585_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1593:9: ( Q LBRACKET ( L_PredefinedEntityRef | L_CharRef | ~ ( AMP | LBRACKET | RBRACKET ) )* RBRACKET )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1593:11: Q LBRACKET ( L_PredefinedEntityRef | L_CharRef | ~ ( AMP | LBRACKET | RBRACKET ) )* RBRACKET
+ root_0 = this.adaptor.nil();
+
+ Q582=this.match(this.input,Q,XQueryParser.FOLLOW_Q_in_p_BracedURILiteral11645); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ Q582_tree = this.adaptor.create(Q582);
+ this.adaptor.addChild(root_0, Q582_tree);
+ }
+ LBRACKET583=this.match(this.input,LBRACKET,XQueryParser.FOLLOW_LBRACKET_in_p_BracedURILiteral11647); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LBRACKET583_tree = this.adaptor.create(LBRACKET583);
+ this.adaptor.addChild(root_0, LBRACKET583_tree);
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1593:22: ( L_PredefinedEntityRef | L_CharRef | ~ ( AMP | LBRACKET | RBRACKET ) )*
+ loop192:
+ do {
+ var alt192=2;
+ var LA192_0 = this.input.LA(1);
+
+ if ( ((LA192_0>=L_QuotAttrContentChar && LA192_0<=R_UNION_BRACKET)||(LA192_0>=LSQUARE && LA192_0<=HASH)||(LA192_0>=COMMA && LA192_0<=BlockExpr)) ) {
+ alt192=1;
+ }
+
+
+ switch (alt192) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:
+ set584=this.input.LT(1);
+ if ( (this.input.LA(1)>=L_QuotAttrContentChar && this.input.LA(1)<=R_UNION_BRACKET)||(this.input.LA(1)>=LSQUARE && this.input.LA(1)<=HASH)||(this.input.LA(1)>=COMMA && this.input.LA(1)<=BlockExpr) ) {
+ this.input.consume();
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, this.adaptor.create(set584));
+ this.state.errorRecovery=false;this.state.failed=false;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
+ throw mse;
+ }
+
+
+
+ break;
+
+ default :
+ break loop192;
+ }
+ } while (true);
+
+ RBRACKET585=this.match(this.input,RBRACKET,XQueryParser.FOLLOW_RBRACKET_in_p_BracedURILiteral11673); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RBRACKET585_tree = this.adaptor.create(RBRACKET585);
+ this.adaptor.addChild(root_0, RBRACKET585_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_QName_return: (function() {
+ XQueryParser.p_QName_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_QName_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1597:1: p_QName : ( pg_QName | p_NCName -> ^( QName p_NCName ) );
+ // $ANTLR start "p_QName"
+ p_QName: function() {
+ var retval = new XQueryParser.p_QName_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var pg_QName586 = null;
+ var p_NCName587 = null;
+
+ var stream_p_NCName=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"rule p_NCName");
+ this.setWsExplicit(true);
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1599:9: ( pg_QName | p_NCName -> ^( QName p_NCName ) )
+ var alt193=2;
+ var LA193_0 = this.input.LA(1);
+
+ if ( ((LA193_0>=ANCESTOR && LA193_0<=SKIP)||(LA193_0>=VALUE && LA193_0<=QUOT_ER)||LA193_0==L_NCName) ) {
+ var LA193_1 = this.input.LA(2);
+
+ if ( (LA193_1==COLON) ) {
+ alt193=1;
+ }
+ else if ( (LA193_1==EOF||(LA193_1>=AND && LA193_1<=AT)||(LA193_1>=BY && LA193_1<=CASTABLE)||LA193_1==COLLATION||LA193_1==DEFAULT||(LA193_1>=DESCENDING && LA193_1<=DIV)||LA193_1==EMPTY||LA193_1==EQ||(LA193_1>=EXCEPT && LA193_1<=EXTERNAL)||(LA193_1>=FOR && LA193_1<=GE)||(LA193_1>=GT && LA193_1<=IDIV)||LA193_1==IN||(LA193_1>=INSTANCE && LA193_1<=IS)||LA193_1==LE||(LA193_1>=LET && LA193_1<=MOD)||LA193_1==NE||LA193_1==NODE||(LA193_1>=OR && LA193_1<=ORDER)||(LA193_1>=RETURN && LA193_1<=SATISFIES)||LA193_1==STABLE||(LA193_1>=TO && LA193_1<=TREAT)||LA193_1==UNION||LA193_1==VARIABLE||LA193_1==WHERE||LA193_1==ALLOWING||LA193_1==COUNT||(LA193_1>=DECIMAL_SEPARATOR && LA193_1<=MINUS_SIGN)||(LA193_1>=NAN && LA193_1<=PREVIOUS)||LA193_1==START||LA193_1==WHEN||(LA193_1>=ZERO_DIGIT && LA193_1<=BEFORE)||LA193_1==INTO||LA193_1==MODIFY||LA193_1==UPDATING||LA193_1==WITH||LA193_1==CONTAINS||LA193_1==PARAGRAPHS||LA193_1==SCORE||LA193_1==SENTENCES||LA193_1==TIMES||LA193_1==WORDS||(LA193_1>=CHECK && LA193_1<=COLLECTION)||(LA193_1>=FOREACH && LA193_1<=ON)||(LA193_1>=CONCAT && LA193_1<=DOLLAR)||(LA193_1>=R_UNION_BRACKET && LA193_1<=HASH)||(LA193_1>=COMMA && LA193_1<=BANG)||LA193_1==EMPTY_CLOSE_TAG||(LA193_1>=SEMICOLON && LA193_1<=VBAR)||(LA193_1>=APOS && LA193_1<=QUOT)||LA193_1==S) ) {
+ alt193=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 193, 1, this.input);
+
+ throw nvae;
+ }
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 193, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt193) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1599:11: pg_QName
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_pg_QName_in_p_QName11715);
+ pg_QName586=this.pg_QName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, pg_QName586.getTree());
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1600:11: p_NCName
+ this.pushFollow(XQueryParser.FOLLOW_p_NCName_in_p_QName11727);
+ p_NCName587=this.p_NCName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_p_NCName.add(p_NCName587.getTree());
+
+
+ // AST REWRITE
+ // elements: p_NCName
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( this.state.backtracking===0 ) {
+ retval.tree = root_0;
+ var stream_retval=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = this.adaptor.nil();
+ // 1601:17: -> ^( QName p_NCName )
+ {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1601:20: ^( QName p_NCName )
+ {
+ var root_1 = this.adaptor.nil();
+ root_1 = this.adaptor.becomeRoot(this.adaptor.create(QName, "QName"), root_1);
+
+ this.adaptor.addChild(root_1, stream_p_NCName.nextTree());
+
+ this.adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;}
+
+ break;
+
+ }
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ this.setWsExplicit(false);
+ }
+ return retval;
+ },
+
+ // inline static return class
+ pg_FQName_return: (function() {
+ XQueryParser.pg_FQName_return = function(){};
+ org.antlr.lang.extend(XQueryParser.pg_FQName_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1605:1: pg_FQName : ( pg_QName | p_FNCName -> ^( QName p_FNCName ) );
+ // $ANTLR start "pg_FQName"
+ pg_FQName: function() {
+ var retval = new XQueryParser.pg_FQName_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var pg_QName588 = null;
+ var p_FNCName589 = null;
+
+ var stream_p_FNCName=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"rule p_FNCName");
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1606:9: ( pg_QName | p_FNCName -> ^( QName p_FNCName ) )
+ var alt194=2;
+ switch ( this.input.LA(1) ) {
+ case ANCESTOR:
+ case ANCESTOR_OR_SELF:
+ case AND:
+ case AS:
+ case ASCENDING:
+ case AT:
+ case BASE_URI:
+ case BOUNDARY_SPACE:
+ case BY:
+ case CASE:
+ case CAST:
+ case CASTABLE:
+ case CHILD:
+ case COLLATION:
+ case CONSTRUCTION:
+ case COPY_NAMESPACES:
+ case DECLARE:
+ case DEFAULT:
+ case DESCENDANT:
+ case DESCENDANT_OR_SELF:
+ case DESCENDING:
+ case DIV:
+ case DOCUMENT:
+ case ELSE:
+ case EMPTY:
+ case ENCODING:
+ case EQ:
+ case EVERY:
+ case EXCEPT:
+ case EXTERNAL:
+ case FOLLOWING:
+ case FOLLOWING_SIBLING:
+ case FOR:
+ case FUNCTION:
+ case GE:
+ case GREATEST:
+ case GT:
+ case IDIV:
+ case IMPORT:
+ case IN:
+ case INHERIT:
+ case INSTANCE:
+ case INTERSECT:
+ case IS:
+ case LAX:
+ case LE:
+ case LEAST:
+ case LET:
+ case LT:
+ case MOD:
+ case MODULE:
+ case NAMESPACE:
+ case NE:
+ case NO_INHERIT:
+ case NO_PRESERVE:
+ case JSON:
+ case OF:
+ case OPTION:
+ case OR:
+ case ORDER:
+ case ORDERED:
+ case ORDERING:
+ case PARENT:
+ case PRECEDING:
+ case PRECEDING_SIBLING:
+ case PRESERVE:
+ case RETURN:
+ case SATISFIES:
+ case SCHEMA:
+ case SELF:
+ case SOME:
+ case STABLE:
+ case STRICT:
+ case STRIP:
+ case THEN:
+ case TO:
+ case TREAT:
+ case UNION:
+ case UNORDERED:
+ case VALIDATE:
+ case VARIABLE:
+ case VERSION:
+ case WHERE:
+ case XQUERY:
+ case ALLOWING:
+ case CATCH:
+ case CONTEXT:
+ case COUNT:
+ case DECIMAL_FORMAT:
+ case DECIMAL_SEPARATOR:
+ case DIGIT:
+ case END:
+ case GROUP:
+ case GROUPING_SEPARATOR:
+ case INFINITY:
+ case MINUS_SIGN:
+ case NAN:
+ case NEXT:
+ case ONLY:
+ case PATTERN_SEPARATOR:
+ case PERCENT:
+ case PER_MILLE:
+ case PREVIOUS:
+ case SLIDING:
+ case START:
+ case TRY:
+ case TUMBLING:
+ case TYPE:
+ case WHEN:
+ case WINDOW:
+ case ZERO_DIGIT:
+ case AFTER:
+ case BEFORE:
+ case COPY:
+ case DELETE:
+ case FIRST:
+ case INSERT:
+ case INTO:
+ case POSITION:
+ case APPEND:
+ case LAST:
+ case MODIFY:
+ case NODES:
+ case RENAME:
+ case REPLACE:
+ case REVALIDATION:
+ case SKIP:
+ case VALUE:
+ case WITH:
+ case ALL:
+ case ANY:
+ case CONTAINS:
+ case CONTENT:
+ case DIACRITICS:
+ case DIFFERENT:
+ case DISTANCE:
+ case ENTIRE:
+ case EXACTLY:
+ case FROM:
+ case FT_OPTION:
+ case FTAND:
+ case FTNOT:
+ case FTOR:
+ case INSENSITIVE:
+ case LANGUAGE:
+ case LEVELS:
+ case LOWERCASE:
+ case MOST:
+ case NO:
+ case NOT:
+ case OCCURS:
+ case PARAGRAPH:
+ case PARAGRAPHS:
+ case PHRASE:
+ case RELATIONSHIP:
+ case SAME:
+ case SCORE:
+ case SENSITIVE:
+ case SENTENCE:
+ case SENTENCES:
+ case STEMMING:
+ case STOP:
+ case THESAURUS:
+ case TIMES:
+ case UPPERCASE:
+ case USING:
+ case WEIGHT:
+ case WILDCARDS:
+ case WITHOUT:
+ case WORD:
+ case WORDS:
+ case BREAK:
+ case CONTINUE:
+ case EXIT:
+ case LOOP:
+ case RETURNING:
+ case CHECK:
+ case COLLECTION:
+ case CONSTRAINT:
+ case FOREACH:
+ case FOREIGN:
+ case INDEX:
+ case INTEGRITY:
+ case KEY:
+ case ON:
+ case UNIQUE:
+ case AMP_ER:
+ case APOS_ER:
+ case QUOT_ER:
+ case L_NCName:
+ var LA194_1 = this.input.LA(2);
+
+ if ( (LA194_1==COLON) ) {
+ alt194=1;
+ }
+ else if ( (LA194_1==LPAREN) ) {
+ alt194=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 194, 1, this.input);
+
+ throw nvae;
+ }
+ break;
+ case ATTRIBUTE:
+ case COMMENT:
+ case DOCUMENT_NODE:
+ case ELEMENT:
+ case EMPTY_SEQUENCE:
+ case IF:
+ case ITEM:
+ case NODE:
+ case PROCESSING_INSTRUCTION:
+ case STRUCTURED_ITEM:
+ case JSON_ITEM:
+ case OBJECT:
+ case ARRAY:
+ case SCHEMA_ATTRIBUTE:
+ case SCHEMA_ELEMENT:
+ case TEXT:
+ case TYPESWITCH:
+ case NAMESPACE_NODE:
+ case SWITCH:
+ case WHILE:
+ alt194=1;
+ break;
+ case UPDATING:
+ alt194=2;
+ break;
+ default:
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 194, 0, this.input);
+
+ throw nvae;
+ }
+
+ switch (alt194) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1606:11: pg_QName
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_pg_QName_in_pg_FQName11788);
+ pg_QName588=this.pg_QName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, pg_QName588.getTree());
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1607:11: p_FNCName
+ this.pushFollow(XQueryParser.FOLLOW_p_FNCName_in_pg_FQName11800);
+ p_FNCName589=this.p_FNCName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_p_FNCName.add(p_FNCName589.getTree());
+
+
+ // AST REWRITE
+ // elements: p_FNCName
+ // token labels:
+ // rule labels: retval
+ // token list labels:
+ // rule list labels:
+ if ( this.state.backtracking===0 ) {
+ retval.tree = root_0;
+ var stream_retval=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token retval",retval!=null?retval.tree:null);
+
+ root_0 = this.adaptor.nil();
+ // 1608:17: -> ^( QName p_FNCName )
+ {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1608:20: ^( QName p_FNCName )
+ {
+ var root_1 = this.adaptor.nil();
+ root_1 = this.adaptor.becomeRoot(this.adaptor.create(QName, "QName"), root_1);
+
+ this.adaptor.addChild(root_1, stream_p_FNCName.nextTree());
+
+ this.adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;}
+
+ break;
+
+ }
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ pg_QName_return: (function() {
+ XQueryParser.pg_QName_return = function(){};
+ org.antlr.lang.extend(XQueryParser.pg_QName_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1610:1: pg_QName : nn= p_NCName COLON nl= p_NCName -> ^( QName $nn $nl) ;
+ // $ANTLR start "pg_QName"
+ pg_QName: function() {
+ var retval = new XQueryParser.pg_QName_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var COLON590 = null;
+ var nn = null;
+ var nl = null;
+
+ var COLON590_tree=null;
+ var stream_COLON=new org.antlr.runtime.tree.RewriteRuleTokenStream(this.adaptor,"token COLON");
+ var stream_p_NCName=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"rule p_NCName");
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1611:9: (nn= p_NCName COLON nl= p_NCName -> ^( QName $nn $nl) )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1611:11: nn= p_NCName COLON nl= p_NCName
+ this.pushFollow(XQueryParser.FOLLOW_p_NCName_in_pg_QName11844);
+ nn=this.p_NCName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_p_NCName.add(nn.getTree());
+ COLON590=this.match(this.input,COLON,XQueryParser.FOLLOW_COLON_in_pg_QName11846); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_COLON.add(COLON590);
+
+ this.pushFollow(XQueryParser.FOLLOW_p_NCName_in_pg_QName11850);
+ nl=this.p_NCName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) stream_p_NCName.add(nl.getTree());
+
+
+ // AST REWRITE
+ // elements: nl, nn
+ // token labels:
+ // rule labels: retval, nn, nl
+ // token list labels:
+ // rule list labels:
+ if ( this.state.backtracking===0 ) {
+ retval.tree = root_0;
+ var stream_retval=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token retval",retval!=null?retval.tree:null);
+ var stream_nn=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token nn",nn!=null?nn.tree:null);
+ var stream_nl=new org.antlr.runtime.tree.RewriteRuleSubtreeStream(this.adaptor,"token nl",nl!=null?nl.tree:null);
+
+ root_0 = this.adaptor.nil();
+ // 1612:17: -> ^( QName $nn $nl)
+ {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1612:20: ^( QName $nn $nl)
+ {
+ var root_1 = this.adaptor.nil();
+ root_1 = this.adaptor.becomeRoot(this.adaptor.create(QName, "QName"), root_1);
+
+ this.adaptor.addChild(root_1, stream_nn.nextTree());
+ this.adaptor.addChild(root_1, stream_nl.nextTree());
+
+ this.adaptor.addChild(root_0, root_1);
+ }
+
+ }
+
+ retval.tree = root_0;}
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_NCName_return: (function() {
+ XQueryParser.p_NCName_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_NCName_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1642:1: p_NCName : ( L_NCName | ANCESTOR | ANCESTOR_OR_SELF | AND | AS | ASCENDING | AT | ATTRIBUTE | BASE_URI | BOUNDARY_SPACE | BY | CASE | CAST | CASTABLE | CHILD | COLLATION | COMMENT | CONSTRUCTION | COPY_NAMESPACES | DECLARE | DEFAULT | DESCENDANT | DESCENDANT_OR_SELF | DESCENDING | DIV | DOCUMENT | DOCUMENT_NODE | ELEMENT | ELSE | EMPTY | EMPTY_SEQUENCE | ENCODING | EQ | EVERY | EXCEPT | EXTERNAL | FOLLOWING | FOLLOWING_SIBLING | FOR | FUNCTION | GE | GREATEST | GT | IDIV | IF | IMPORT | IN | INHERIT | INSTANCE | INTERSECT | IS | ITEM | LAX | LE | LEAST | LET | LT | MOD | MODULE | NAMESPACE | NE | NO_INHERIT | NO_PRESERVE | NODE | OF | OPTION | OR | ORDER | ORDERED | ORDERING | PARENT | PRECEDING | PRECEDING_SIBLING | PRESERVE | PROCESSING_INSTRUCTION | RETURN | SATISFIES | SCHEMA | SCHEMA_ATTRIBUTE | SCHEMA_ELEMENT | SELF | SOME | STABLE | STRICT | STRIP | SWITCH | TEXT | THEN | TO | TREAT | TYPESWITCH | UNION | UNORDERED | VALIDATE | VARIABLE | VERSION | WHERE | XQUERY | ALLOWING | CATCH | CONTEXT | COUNT | DECIMAL_FORMAT | DECIMAL_SEPARATOR | DIGIT | END | GROUP | GROUPING_SEPARATOR | INFINITY | MINUS_SIGN | NAMESPACE_NODE | NAN | NEXT | ONLY | PATTERN_SEPARATOR | PERCENT | PER_MILLE | PREVIOUS | SLIDING | START | TRY | TUMBLING | TYPE | WHEN | WINDOW | ZERO_DIGIT | AFTER | BEFORE | COPY | DELETE | FIRST | INSERT | INTO | LAST | MODIFY | NODES | RENAME | REPLACE | REVALIDATION | SKIP | VALUE | WITH | APPEND | JSON | POSITION | STRUCTURED_ITEM | JSON_ITEM | OBJECT | ARRAY | ALL | ANY | CONTAINS | CONTENT | DIACRITICS | DIFFERENT | DISTANCE | ENTIRE | EXACTLY | FROM | FT_OPTION | FTAND | FTNOT | FTOR | INSENSITIVE | LANGUAGE | LEVELS | LOWERCASE | MOST | NO | NOT | OCCURS | PARAGRAPH | PARAGRAPHS | PHRASE | RELATIONSHIP | SAME | SCORE | SENSITIVE | SENTENCE | SENTENCES | STEMMING | STOP | THESAURUS | TIMES | UPPERCASE | USING | WEIGHT | WILDCARDS | WITHOUT | WORD | WORDS | BREAK | CONTINUE | EXIT | LOOP | RETURNING | WHILE | CHECK | COLLECTION | CONSTRAINT | FOREACH | FOREIGN | INDEX | INTEGRITY | KEY | ON | UNIQUE | AMP_ER | APOS_ER | QUOT_ER );
+ // $ANTLR start "p_NCName"
+ p_NCName: function() {
+ var retval = new XQueryParser.p_NCName_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var set591 = null;
+
+ var set591_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1643:9: ( L_NCName | ANCESTOR | ANCESTOR_OR_SELF | AND | AS | ASCENDING | AT | ATTRIBUTE | BASE_URI | BOUNDARY_SPACE | BY | CASE | CAST | CASTABLE | CHILD | COLLATION | COMMENT | CONSTRUCTION | COPY_NAMESPACES | DECLARE | DEFAULT | DESCENDANT | DESCENDANT_OR_SELF | DESCENDING | DIV | DOCUMENT | DOCUMENT_NODE | ELEMENT | ELSE | EMPTY | EMPTY_SEQUENCE | ENCODING | EQ | EVERY | EXCEPT | EXTERNAL | FOLLOWING | FOLLOWING_SIBLING | FOR | FUNCTION | GE | GREATEST | GT | IDIV | IF | IMPORT | IN | INHERIT | INSTANCE | INTERSECT | IS | ITEM | LAX | LE | LEAST | LET | LT | MOD | MODULE | NAMESPACE | NE | NO_INHERIT | NO_PRESERVE | NODE | OF | OPTION | OR | ORDER | ORDERED | ORDERING | PARENT | PRECEDING | PRECEDING_SIBLING | PRESERVE | PROCESSING_INSTRUCTION | RETURN | SATISFIES | SCHEMA | SCHEMA_ATTRIBUTE | SCHEMA_ELEMENT | SELF | SOME | STABLE | STRICT | STRIP | SWITCH | TEXT | THEN | TO | TREAT | TYPESWITCH | UNION | UNORDERED | VALIDATE | VARIABLE | VERSION | WHERE | XQUERY | ALLOWING | CATCH | CONTEXT | COUNT | DECIMAL_FORMAT | DECIMAL_SEPARATOR | DIGIT | END | GROUP | GROUPING_SEPARATOR | INFINITY | MINUS_SIGN | NAMESPACE_NODE | NAN | NEXT | ONLY | PATTERN_SEPARATOR | PERCENT | PER_MILLE | PREVIOUS | SLIDING | START | TRY | TUMBLING | TYPE | WHEN | WINDOW | ZERO_DIGIT | AFTER | BEFORE | COPY | DELETE | FIRST | INSERT | INTO | LAST | MODIFY | NODES | RENAME | REPLACE | REVALIDATION | SKIP | VALUE | WITH | APPEND | JSON | POSITION | STRUCTURED_ITEM | JSON_ITEM | OBJECT | ARRAY | ALL | ANY | CONTAINS | CONTENT | DIACRITICS | DIFFERENT | DISTANCE | ENTIRE | EXACTLY | FROM | FT_OPTION | FTAND | FTNOT | FTOR | INSENSITIVE | LANGUAGE | LEVELS | LOWERCASE | MOST | NO | NOT | OCCURS | PARAGRAPH | PARAGRAPHS | PHRASE | RELATIONSHIP | SAME | SCORE | SENSITIVE | SENTENCE | SENTENCES | STEMMING | STOP | THESAURUS | TIMES | UPPERCASE | USING | WEIGHT | WILDCARDS | WITHOUT | WORD | WORDS | BREAK | CONTINUE | EXIT | LOOP | RETURNING | WHILE | CHECK | COLLECTION | CONSTRAINT | FOREACH | FOREIGN | INDEX | INTEGRITY | KEY | ON | UNIQUE | AMP_ER | APOS_ER | QUOT_ER )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:
+ root_0 = this.adaptor.nil();
+
+ set591=this.input.LT(1);
+ if ( (this.input.LA(1)>=ANCESTOR && this.input.LA(1)<=SKIP)||(this.input.LA(1)>=VALUE && this.input.LA(1)<=QUOT_ER)||this.input.LA(1)==L_NCName ) {
+ this.input.consume();
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, this.adaptor.create(set591));
+ this.state.errorRecovery=false;this.state.failed=false;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
+ throw mse;
+ }
+
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_FNCName_return: (function() {
+ XQueryParser.p_FNCName_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_FNCName_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1660:1: p_FNCName : ( L_NCName | ANCESTOR | ANCESTOR_OR_SELF | AND | AS | ASCENDING | AT | BASE_URI | BOUNDARY_SPACE | BY | CASE | CAST | CASTABLE | CHILD | COLLATION | CONSTRUCTION | COPY_NAMESPACES | DECLARE | DEFAULT | DESCENDANT | DESCENDANT_OR_SELF | DESCENDING | DIV | DOCUMENT | ELSE | EMPTY | ENCODING | EQ | EVERY | EXCEPT | EXTERNAL | FOLLOWING | FOLLOWING_SIBLING | FOR | FUNCTION | GE | GREATEST | GT | IDIV | IMPORT | IN | INHERIT | INSTANCE | INTERSECT | IS | LAX | LE | LEAST | LET | LT | MOD | MODULE | NAMESPACE | NE | NO_INHERIT | NO_PRESERVE | OF | OPTION | OR | ORDER | ORDERED | ORDERING | PARENT | PRECEDING | PRECEDING_SIBLING | PRESERVE | RETURN | SATISFIES | SCHEMA | SELF | SOME | STABLE | STRICT | STRIP | THEN | TO | TREAT | UNION | UNORDERED | VALIDATE | VARIABLE | VERSION | WHERE | XQUERY | ALLOWING | CATCH | CONTEXT | COUNT | DECIMAL_FORMAT | DECIMAL_SEPARATOR | DIGIT | END | GROUP | GROUPING_SEPARATOR | INFINITY | MINUS_SIGN | NAN | NEXT | ONLY | PATTERN_SEPARATOR | PERCENT | PER_MILLE | PREVIOUS | SLIDING | START | TRY | TUMBLING | TYPE | WHEN | WINDOW | ZERO_DIGIT | AFTER | BEFORE | COPY | DELETE | FIRST | INSERT | INTO | LAST | MODIFY | NODES | RENAME | REPLACE | REVALIDATION | SKIP | UPDATING | VALUE | WITH | APPEND | JSON | POSITION | ALL | ANY | CONTAINS | CONTENT | DIACRITICS | DIFFERENT | DISTANCE | ENTIRE | EXACTLY | FROM | FT_OPTION | FTAND | FTNOT | FTOR | INSENSITIVE | LANGUAGE | LEVELS | LOWERCASE | MOST | NO | NOT | OCCURS | PARAGRAPH | PARAGRAPHS | PHRASE | RELATIONSHIP | SAME | SCORE | SENSITIVE | SENTENCE | SENTENCES | STEMMING | STOP | THESAURUS | TIMES | UPPERCASE | USING | WEIGHT | WILDCARDS | WITHOUT | WORD | WORDS | BREAK | CONTINUE | EXIT | LOOP | RETURNING | CHECK | COLLECTION | CONSTRAINT | FOREACH | FOREIGN | INDEX | INTEGRITY | KEY | ON | UNIQUE | AMP_ER | APOS_ER | QUOT_ER );
+ // $ANTLR start "p_FNCName"
+ p_FNCName: function() {
+ var retval = new XQueryParser.p_FNCName_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var set592 = null;
+
+ var set592_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1661:9: ( L_NCName | ANCESTOR | ANCESTOR_OR_SELF | AND | AS | ASCENDING | AT | BASE_URI | BOUNDARY_SPACE | BY | CASE | CAST | CASTABLE | CHILD | COLLATION | CONSTRUCTION | COPY_NAMESPACES | DECLARE | DEFAULT | DESCENDANT | DESCENDANT_OR_SELF | DESCENDING | DIV | DOCUMENT | ELSE | EMPTY | ENCODING | EQ | EVERY | EXCEPT | EXTERNAL | FOLLOWING | FOLLOWING_SIBLING | FOR | FUNCTION | GE | GREATEST | GT | IDIV | IMPORT | IN | INHERIT | INSTANCE | INTERSECT | IS | LAX | LE | LEAST | LET | LT | MOD | MODULE | NAMESPACE | NE | NO_INHERIT | NO_PRESERVE | OF | OPTION | OR | ORDER | ORDERED | ORDERING | PARENT | PRECEDING | PRECEDING_SIBLING | PRESERVE | RETURN | SATISFIES | SCHEMA | SELF | SOME | STABLE | STRICT | STRIP | THEN | TO | TREAT | UNION | UNORDERED | VALIDATE | VARIABLE | VERSION | WHERE | XQUERY | ALLOWING | CATCH | CONTEXT | COUNT | DECIMAL_FORMAT | DECIMAL_SEPARATOR | DIGIT | END | GROUP | GROUPING_SEPARATOR | INFINITY | MINUS_SIGN | NAN | NEXT | ONLY | PATTERN_SEPARATOR | PERCENT | PER_MILLE | PREVIOUS | SLIDING | START | TRY | TUMBLING | TYPE | WHEN | WINDOW | ZERO_DIGIT | AFTER | BEFORE | COPY | DELETE | FIRST | INSERT | INTO | LAST | MODIFY | NODES | RENAME | REPLACE | REVALIDATION | SKIP | UPDATING | VALUE | WITH | APPEND | JSON | POSITION | ALL | ANY | CONTAINS | CONTENT | DIACRITICS | DIFFERENT | DISTANCE | ENTIRE | EXACTLY | FROM | FT_OPTION | FTAND | FTNOT | FTOR | INSENSITIVE | LANGUAGE | LEVELS | LOWERCASE | MOST | NO | NOT | OCCURS | PARAGRAPH | PARAGRAPHS | PHRASE | RELATIONSHIP | SAME | SCORE | SENSITIVE | SENTENCE | SENTENCES | STEMMING | STOP | THESAURUS | TIMES | UPPERCASE | USING | WEIGHT | WILDCARDS | WITHOUT | WORD | WORDS | BREAK | CONTINUE | EXIT | LOOP | RETURNING | CHECK | COLLECTION | CONSTRAINT | FOREACH | FOREIGN | INDEX | INTEGRITY | KEY | ON | UNIQUE | AMP_ER | APOS_ER | QUOT_ER )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:
+ root_0 = this.adaptor.nil();
+
+ set592=this.input.LT(1);
+ if ( (this.input.LA(1)>=ANCESTOR && this.input.LA(1)<=AT)||(this.input.LA(1)>=BASE_URI && this.input.LA(1)<=COLLATION)||(this.input.LA(1)>=CONSTRUCTION && this.input.LA(1)<=DOCUMENT)||(this.input.LA(1)>=ELSE && this.input.LA(1)<=EMPTY)||(this.input.LA(1)>=ENCODING && this.input.LA(1)<=IDIV)||(this.input.LA(1)>=IMPORT && this.input.LA(1)<=IS)||(this.input.LA(1)>=LAX && this.input.LA(1)<=NO_PRESERVE)||(this.input.LA(1)>=JSON && this.input.LA(1)<=PRESERVE)||(this.input.LA(1)>=RETURN && this.input.LA(1)<=SCHEMA)||(this.input.LA(1)>=SELF && this.input.LA(1)<=STRIP)||(this.input.LA(1)>=THEN && this.input.LA(1)<=TREAT)||(this.input.LA(1)>=UNION && this.input.LA(1)<=MINUS_SIGN)||(this.input.LA(1)>=NAN && this.input.LA(1)<=START)||(this.input.LA(1)>=TRY && this.input.LA(1)<=RETURNING)||(this.input.LA(1)>=CHECK && this.input.LA(1)<=QUOT_ER)||this.input.LA(1)==L_NCName ) {
+ this.input.consume();
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, this.adaptor.create(set592));
+ this.state.errorRecovery=false;this.state.failed=false;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
+ throw mse;
+ }
+
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ pg_UpdateExpr_return: (function() {
+ XQueryParser.pg_UpdateExpr_return = function(){};
+ org.antlr.lang.extend(XQueryParser.pg_UpdateExpr_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1697:1: pg_UpdateExpr : ( p_InsertExpr | p_DeleteExpr | p_RenameExpr | p_ReplaceExpr | p_TransformExpr | p_JSONDeleteExpr | p_JSONInsertExpr | p_JSONRenameExpr | p_JSONReplaceExpr | p_JSONAppendExpr );
+ // $ANTLR start "pg_UpdateExpr"
+ pg_UpdateExpr: function() {
+ var retval = new XQueryParser.pg_UpdateExpr_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_InsertExpr593 = null;
+ var p_DeleteExpr594 = null;
+ var p_RenameExpr595 = null;
+ var p_ReplaceExpr596 = null;
+ var p_TransformExpr597 = null;
+ var p_JSONDeleteExpr598 = null;
+ var p_JSONInsertExpr599 = null;
+ var p_JSONRenameExpr600 = null;
+ var p_JSONReplaceExpr601 = null;
+ var p_JSONAppendExpr602 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1698:9: ( p_InsertExpr | p_DeleteExpr | p_RenameExpr | p_ReplaceExpr | p_TransformExpr | p_JSONDeleteExpr | p_JSONInsertExpr | p_JSONRenameExpr | p_JSONReplaceExpr | p_JSONAppendExpr )
+ var alt195=10;
+ alt195 = this.dfa195.predict(this.input);
+ switch (alt195) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1698:11: p_InsertExpr
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_InsertExpr_in_pg_UpdateExpr13847);
+ p_InsertExpr593=this.p_InsertExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_InsertExpr593.getTree());
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1699:11: p_DeleteExpr
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_DeleteExpr_in_pg_UpdateExpr13859);
+ p_DeleteExpr594=this.p_DeleteExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_DeleteExpr594.getTree());
+
+
+ break;
+ case 3 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1700:11: p_RenameExpr
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_RenameExpr_in_pg_UpdateExpr13871);
+ p_RenameExpr595=this.p_RenameExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_RenameExpr595.getTree());
+
+
+ break;
+ case 4 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1701:11: p_ReplaceExpr
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_ReplaceExpr_in_pg_UpdateExpr13883);
+ p_ReplaceExpr596=this.p_ReplaceExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ReplaceExpr596.getTree());
+
+
+ break;
+ case 5 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1702:11: p_TransformExpr
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_TransformExpr_in_pg_UpdateExpr13895);
+ p_TransformExpr597=this.p_TransformExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_TransformExpr597.getTree());
+
+
+ break;
+ case 6 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1703:11: p_JSONDeleteExpr
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_JSONDeleteExpr_in_pg_UpdateExpr13907);
+ p_JSONDeleteExpr598=this.p_JSONDeleteExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_JSONDeleteExpr598.getTree());
+
+
+ break;
+ case 7 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1704:11: p_JSONInsertExpr
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_JSONInsertExpr_in_pg_UpdateExpr13919);
+ p_JSONInsertExpr599=this.p_JSONInsertExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_JSONInsertExpr599.getTree());
+
+
+ break;
+ case 8 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1705:11: p_JSONRenameExpr
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_JSONRenameExpr_in_pg_UpdateExpr13931);
+ p_JSONRenameExpr600=this.p_JSONRenameExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_JSONRenameExpr600.getTree());
+
+
+ break;
+ case 9 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1706:11: p_JSONReplaceExpr
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_JSONReplaceExpr_in_pg_UpdateExpr13943);
+ p_JSONReplaceExpr601=this.p_JSONReplaceExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_JSONReplaceExpr601.getTree());
+
+
+ break;
+ case 10 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1707:11: p_JSONAppendExpr
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_JSONAppendExpr_in_pg_UpdateExpr13955);
+ p_JSONAppendExpr602=this.p_JSONAppendExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_JSONAppendExpr602.getTree());
+
+
+ break;
+
+ }
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_JSONDeleteExpr_return: (function() {
+ XQueryParser.p_JSONDeleteExpr_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_JSONDeleteExpr_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1710:1: p_JSONDeleteExpr : k+= DELETE k+= JSON p_TargetExpr ;
+ // $ANTLR start "p_JSONDeleteExpr"
+ p_JSONDeleteExpr: function() {
+ var retval = new XQueryParser.p_JSONDeleteExpr_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var list_k=null;
+ var p_TargetExpr603 = null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1711:9: (k+= DELETE k+= JSON p_TargetExpr )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1711:11: k+= DELETE k+= JSON p_TargetExpr
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,DELETE,XQueryParser.FOLLOW_DELETE_in_p_JSONDeleteExpr13982); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ k=this.match(this.input,JSON,XQueryParser.FOLLOW_JSON_in_p_JSONDeleteExpr13986); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(list_k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_TargetExpr_in_p_JSONDeleteExpr13990);
+ p_TargetExpr603=this.p_TargetExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_TargetExpr603.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_JSONInsertExpr_return: (function() {
+ XQueryParser.p_JSONInsertExpr_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_JSONInsertExpr_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1714:1: p_JSONInsertExpr : k+= INSERT k+= JSON p_SourceExpr k+= INTO p_TargetExpr (k+= AT k+= POSITION p_ExprSingle[true] )? ;
+ // $ANTLR start "p_JSONInsertExpr"
+ p_JSONInsertExpr: function() {
+ var retval = new XQueryParser.p_JSONInsertExpr_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var list_k=null;
+ var p_SourceExpr604 = null;
+ var p_TargetExpr605 = null;
+ var p_ExprSingle606 = null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1715:9: (k+= INSERT k+= JSON p_SourceExpr k+= INTO p_TargetExpr (k+= AT k+= POSITION p_ExprSingle[true] )? )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1715:11: k+= INSERT k+= JSON p_SourceExpr k+= INTO p_TargetExpr (k+= AT k+= POSITION p_ExprSingle[true] )?
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,INSERT,XQueryParser.FOLLOW_INSERT_in_p_JSONInsertExpr14017); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ k=this.match(this.input,JSON,XQueryParser.FOLLOW_JSON_in_p_JSONInsertExpr14021); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ this.pushFollow(XQueryParser.FOLLOW_p_SourceExpr_in_p_JSONInsertExpr14023);
+ p_SourceExpr604=this.p_SourceExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_SourceExpr604.getTree());
+ k=this.match(this.input,INTO,XQueryParser.FOLLOW_INTO_in_p_JSONInsertExpr14027); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ this.pushFollow(XQueryParser.FOLLOW_p_TargetExpr_in_p_JSONInsertExpr14029);
+ p_TargetExpr605=this.p_TargetExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_TargetExpr605.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1715:63: (k+= AT k+= POSITION p_ExprSingle[true] )?
+ var alt196=2;
+ var LA196_0 = this.input.LA(1);
+
+ if ( (LA196_0==AT) ) {
+ alt196=1;
+ }
+ switch (alt196) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1715:64: k+= AT k+= POSITION p_ExprSingle[true]
+ k=this.match(this.input,AT,XQueryParser.FOLLOW_AT_in_p_JSONInsertExpr14034); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ k=this.match(this.input,POSITION,XQueryParser.FOLLOW_POSITION_in_p_JSONInsertExpr14038); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ this.pushFollow(XQueryParser.FOLLOW_p_ExprSingle_in_p_JSONInsertExpr14040);
+ p_ExprSingle606=this.p_ExprSingle(true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ExprSingle606.getTree());
+
+
+ break;
+
+ }
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(list_k);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_JSONRenameExpr_return: (function() {
+ XQueryParser.p_JSONRenameExpr_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_JSONRenameExpr_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1722:1: p_JSONRenameExpr : k+= RENAME k+= JSON p_TargetExpr k+= AS p_ExprSingle[true] ;
+ // $ANTLR start "p_JSONRenameExpr"
+ p_JSONRenameExpr: function() {
+ var retval = new XQueryParser.p_JSONRenameExpr_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var list_k=null;
+ var p_TargetExpr607 = null;
+ var p_ExprSingle608 = null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1723:9: (k+= RENAME k+= JSON p_TargetExpr k+= AS p_ExprSingle[true] )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1723:11: k+= RENAME k+= JSON p_TargetExpr k+= AS p_ExprSingle[true]
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,RENAME,XQueryParser.FOLLOW_RENAME_in_p_JSONRenameExpr14076); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ k=this.match(this.input,JSON,XQueryParser.FOLLOW_JSON_in_p_JSONRenameExpr14080); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ this.pushFollow(XQueryParser.FOLLOW_p_TargetExpr_in_p_JSONRenameExpr14082);
+ p_TargetExpr607=this.p_TargetExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_TargetExpr607.getTree());
+ k=this.match(this.input,AS,XQueryParser.FOLLOW_AS_in_p_JSONRenameExpr14086); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(list_k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_ExprSingle_in_p_JSONRenameExpr14090);
+ p_ExprSingle608=this.p_ExprSingle(true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ExprSingle608.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_JSONReplaceExpr_return: (function() {
+ XQueryParser.p_JSONReplaceExpr_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_JSONReplaceExpr_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1726:1: p_JSONReplaceExpr : k+= REPLACE k+= JSON k+= VALUE k+= OF p_TargetExpr k+= WITH p_ExprSingle[true] ;
+ // $ANTLR start "p_JSONReplaceExpr"
+ p_JSONReplaceExpr: function() {
+ var retval = new XQueryParser.p_JSONReplaceExpr_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var list_k=null;
+ var p_TargetExpr609 = null;
+ var p_ExprSingle610 = null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1727:9: (k+= REPLACE k+= JSON k+= VALUE k+= OF p_TargetExpr k+= WITH p_ExprSingle[true] )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1727:12: k+= REPLACE k+= JSON k+= VALUE k+= OF p_TargetExpr k+= WITH p_ExprSingle[true]
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,REPLACE,XQueryParser.FOLLOW_REPLACE_in_p_JSONReplaceExpr14120); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ k=this.match(this.input,JSON,XQueryParser.FOLLOW_JSON_in_p_JSONReplaceExpr14124); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ k=this.match(this.input,VALUE,XQueryParser.FOLLOW_VALUE_in_p_JSONReplaceExpr14128); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ k=this.match(this.input,OF,XQueryParser.FOLLOW_OF_in_p_JSONReplaceExpr14132); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ this.pushFollow(XQueryParser.FOLLOW_p_TargetExpr_in_p_JSONReplaceExpr14134);
+ p_TargetExpr609=this.p_TargetExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_TargetExpr609.getTree());
+ k=this.match(this.input,WITH,XQueryParser.FOLLOW_WITH_in_p_JSONReplaceExpr14138); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ this.pushFollow(XQueryParser.FOLLOW_p_ExprSingle_in_p_JSONReplaceExpr14140);
+ p_ExprSingle610=this.p_ExprSingle(true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ExprSingle610.getTree());
+ if ( this.state.backtracking===0 ) {
+ this.ak(list_k);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_JSONAppendExpr_return: (function() {
+ XQueryParser.p_JSONAppendExpr_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_JSONAppendExpr_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1730:1: p_JSONAppendExpr : k+= APPEND k+= JSON LSQUARE p_Expr[true, true] RSQUARE k+= TO p_ExprSingle[true] ;
+ // $ANTLR start "p_JSONAppendExpr"
+ p_JSONAppendExpr: function() {
+ var retval = new XQueryParser.p_JSONAppendExpr_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var LSQUARE611 = null;
+ var RSQUARE613 = null;
+ var k = null;
+ var list_k=null;
+ var p_Expr612 = null;
+ var p_ExprSingle614 = null;
+
+ var LSQUARE611_tree=null;
+ var RSQUARE613_tree=null;
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1731:9: (k+= APPEND k+= JSON LSQUARE p_Expr[true, true] RSQUARE k+= TO p_ExprSingle[true] )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1731:12: k+= APPEND k+= JSON LSQUARE p_Expr[true, true] RSQUARE k+= TO p_ExprSingle[true]
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,APPEND,XQueryParser.FOLLOW_APPEND_in_p_JSONAppendExpr14171); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ k=this.match(this.input,JSON,XQueryParser.FOLLOW_JSON_in_p_JSONAppendExpr14175); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ LSQUARE611=this.match(this.input,LSQUARE,XQueryParser.FOLLOW_LSQUARE_in_p_JSONAppendExpr14177); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LSQUARE611_tree = this.adaptor.create(LSQUARE611);
+ this.adaptor.addChild(root_0, LSQUARE611_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_Expr_in_p_JSONAppendExpr14179);
+ p_Expr612=this.p_Expr(true, true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Expr612.getTree());
+ RSQUARE613=this.match(this.input,RSQUARE,XQueryParser.FOLLOW_RSQUARE_in_p_JSONAppendExpr14182); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RSQUARE613_tree = this.adaptor.create(RSQUARE613);
+ this.adaptor.addChild(root_0, RSQUARE613_tree);
+ }
+ k=this.match(this.input,TO,XQueryParser.FOLLOW_TO_in_p_JSONAppendExpr14186); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ this.pushFollow(XQueryParser.FOLLOW_p_ExprSingle_in_p_JSONAppendExpr14188);
+ p_ExprSingle614=this.p_ExprSingle(true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ExprSingle614.getTree());
+ if ( this.state.backtracking===0 ) {
+ this.ak(list_k);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ pm_RevalidationDecl_return: (function() {
+ XQueryParser.pm_RevalidationDecl_return = function(){};
+ org.antlr.lang.extend(XQueryParser.pm_RevalidationDecl_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1735:1: pm_RevalidationDecl : k+= DECLARE k+= REVALIDATION (k+= STRICT | k+= LAX | k+= SKIP ) SEMICOLON ;
+ // $ANTLR start "pm_RevalidationDecl"
+ pm_RevalidationDecl: function() {
+ var retval = new XQueryParser.pm_RevalidationDecl_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var SEMICOLON615 = null;
+ var k = null;
+ var list_k=null;
+
+ var SEMICOLON615_tree=null;
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1736:9: (k+= DECLARE k+= REVALIDATION (k+= STRICT | k+= LAX | k+= SKIP ) SEMICOLON )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1736:11: k+= DECLARE k+= REVALIDATION (k+= STRICT | k+= LAX | k+= SKIP ) SEMICOLON
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,DECLARE,XQueryParser.FOLLOW_DECLARE_in_pm_RevalidationDecl14219); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ k=this.match(this.input,REVALIDATION,XQueryParser.FOLLOW_REVALIDATION_in_pm_RevalidationDecl14223); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1736:38: (k+= STRICT | k+= LAX | k+= SKIP )
+ var alt197=3;
+ switch ( this.input.LA(1) ) {
+ case STRICT:
+ alt197=1;
+ break;
+ case LAX:
+ alt197=2;
+ break;
+ case SKIP:
+ alt197=3;
+ break;
+ default:
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 197, 0, this.input);
+
+ throw nvae;
+ }
+
+ switch (alt197) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1736:39: k+= STRICT
+ k=this.match(this.input,STRICT,XQueryParser.FOLLOW_STRICT_in_pm_RevalidationDecl14228); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1736:51: k+= LAX
+ k=this.match(this.input,LAX,XQueryParser.FOLLOW_LAX_in_pm_RevalidationDecl14234); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+
+
+ break;
+ case 3 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1736:60: k+= SKIP
+ k=this.match(this.input,SKIP,XQueryParser.FOLLOW_SKIP_in_pm_RevalidationDecl14240); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+
+
+ break;
+
+ }
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(list_k);
+ }
+ SEMICOLON615=this.match(this.input,SEMICOLON,XQueryParser.FOLLOW_SEMICOLON_in_pm_RevalidationDecl14245); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ SEMICOLON615_tree = this.adaptor.create(SEMICOLON615);
+ this.adaptor.addChild(root_0, SEMICOLON615_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_InsertExprTargetChoice_return: (function() {
+ XQueryParser.p_InsertExprTargetChoice_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_InsertExprTargetChoice_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1740:1: p_InsertExprTargetChoice : ( ( (k+= AS (k+= FIRST | k+= LAST ) )? k+= INTO ) | ka= AFTER | kb= BEFORE );
+ // $ANTLR start "p_InsertExprTargetChoice"
+ p_InsertExprTargetChoice: function() {
+ var retval = new XQueryParser.p_InsertExprTargetChoice_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var ka = null;
+ var kb = null;
+ var k = null;
+ var list_k=null;
+
+ var ka_tree=null;
+ var kb_tree=null;
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1741:9: ( ( (k+= AS (k+= FIRST | k+= LAST ) )? k+= INTO ) | ka= AFTER | kb= BEFORE )
+ var alt200=3;
+ switch ( this.input.LA(1) ) {
+ case AS:
+ case INTO:
+ alt200=1;
+ break;
+ case AFTER:
+ alt200=2;
+ break;
+ case BEFORE:
+ alt200=3;
+ break;
+ default:
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 200, 0, this.input);
+
+ throw nvae;
+ }
+
+ switch (alt200) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1741:11: ( (k+= AS (k+= FIRST | k+= LAST ) )? k+= INTO )
+ root_0 = this.adaptor.nil();
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1741:11: ( (k+= AS (k+= FIRST | k+= LAST ) )? k+= INTO )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1741:12: (k+= AS (k+= FIRST | k+= LAST ) )? k+= INTO
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1741:12: (k+= AS (k+= FIRST | k+= LAST ) )?
+ var alt199=2;
+ var LA199_0 = this.input.LA(1);
+
+ if ( (LA199_0==AS) ) {
+ alt199=1;
+ }
+ switch (alt199) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1741:13: k+= AS (k+= FIRST | k+= LAST )
+ k=this.match(this.input,AS,XQueryParser.FOLLOW_AS_in_p_InsertExprTargetChoice14275); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1741:19: (k+= FIRST | k+= LAST )
+ var alt198=2;
+ var LA198_0 = this.input.LA(1);
+
+ if ( (LA198_0==FIRST) ) {
+ alt198=1;
+ }
+ else if ( (LA198_0==LAST) ) {
+ alt198=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 198, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt198) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1741:20: k+= FIRST
+ k=this.match(this.input,FIRST,XQueryParser.FOLLOW_FIRST_in_p_InsertExprTargetChoice14280); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1741:31: k+= LAST
+ k=this.match(this.input,LAST,XQueryParser.FOLLOW_LAST_in_p_InsertExprTargetChoice14286); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+
+
+ break;
+
+ }
+
+
+
+ break;
+
+ }
+
+ k=this.match(this.input,INTO,XQueryParser.FOLLOW_INTO_in_p_InsertExprTargetChoice14293); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+
+
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(list_k);
+ }
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1742:11: ka= AFTER
+ root_0 = this.adaptor.nil();
+
+ ka=this.match(this.input,AFTER,XQueryParser.FOLLOW_AFTER_in_p_InsertExprTargetChoice14310); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ ka_tree = this.adaptor.create(ka);
+ this.adaptor.addChild(root_0, ka_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(ka);
+ }
+
+
+ break;
+ case 3 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1743:11: kb= BEFORE
+ root_0 = this.adaptor.nil();
+
+ kb=this.match(this.input,BEFORE,XQueryParser.FOLLOW_BEFORE_in_p_InsertExprTargetChoice14326); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ kb_tree = this.adaptor.create(kb);
+ this.adaptor.addChild(root_0, kb_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(kb);
+ }
+
+
+ break;
+
+ }
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_InsertExpr_return: (function() {
+ XQueryParser.p_InsertExpr_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_InsertExpr_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1747:1: p_InsertExpr : k+= INSERT (k+= NODE | k+= NODES ) p_SourceExpr p_InsertExprTargetChoice p_TargetExpr ;
+ // $ANTLR start "p_InsertExpr"
+ p_InsertExpr: function() {
+ var retval = new XQueryParser.p_InsertExpr_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var list_k=null;
+ var p_SourceExpr616 = null;
+ var p_InsertExprTargetChoice617 = null;
+ var p_TargetExpr618 = null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1748:9: (k+= INSERT (k+= NODE | k+= NODES ) p_SourceExpr p_InsertExprTargetChoice p_TargetExpr )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1748:11: k+= INSERT (k+= NODE | k+= NODES ) p_SourceExpr p_InsertExprTargetChoice p_TargetExpr
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,INSERT,XQueryParser.FOLLOW_INSERT_in_p_InsertExpr14356); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1748:21: (k+= NODE | k+= NODES )
+ var alt201=2;
+ var LA201_0 = this.input.LA(1);
+
+ if ( (LA201_0==NODE) ) {
+ alt201=1;
+ }
+ else if ( (LA201_0==NODES) ) {
+ alt201=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 201, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt201) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1748:22: k+= NODE
+ k=this.match(this.input,NODE,XQueryParser.FOLLOW_NODE_in_p_InsertExpr14361); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1748:32: k+= NODES
+ k=this.match(this.input,NODES,XQueryParser.FOLLOW_NODES_in_p_InsertExpr14367); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+
+
+ break;
+
+ }
+
+ this.pushFollow(XQueryParser.FOLLOW_p_SourceExpr_in_p_InsertExpr14370);
+ p_SourceExpr616=this.p_SourceExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_SourceExpr616.getTree());
+ this.pushFollow(XQueryParser.FOLLOW_p_InsertExprTargetChoice_in_p_InsertExpr14372);
+ p_InsertExprTargetChoice617=this.p_InsertExprTargetChoice();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_InsertExprTargetChoice617.getTree());
+ this.pushFollow(XQueryParser.FOLLOW_p_TargetExpr_in_p_InsertExpr14374);
+ p_TargetExpr618=this.p_TargetExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_TargetExpr618.getTree());
+ if ( this.state.backtracking===0 ) {
+ this.ak(list_k);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_DeleteExpr_return: (function() {
+ XQueryParser.p_DeleteExpr_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_DeleteExpr_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1752:1: p_DeleteExpr : k+= DELETE (k+= NODE | k+= NODES ) p_TargetExpr ;
+ // $ANTLR start "p_DeleteExpr"
+ p_DeleteExpr: function() {
+ var retval = new XQueryParser.p_DeleteExpr_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var list_k=null;
+ var p_TargetExpr619 = null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1753:9: (k+= DELETE (k+= NODE | k+= NODES ) p_TargetExpr )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1753:11: k+= DELETE (k+= NODE | k+= NODES ) p_TargetExpr
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,DELETE,XQueryParser.FOLLOW_DELETE_in_p_DeleteExpr14404); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1753:21: (k+= NODE | k+= NODES )
+ var alt202=2;
+ var LA202_0 = this.input.LA(1);
+
+ if ( (LA202_0==NODE) ) {
+ alt202=1;
+ }
+ else if ( (LA202_0==NODES) ) {
+ alt202=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 202, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt202) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1753:22: k+= NODE
+ k=this.match(this.input,NODE,XQueryParser.FOLLOW_NODE_in_p_DeleteExpr14409); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1753:32: k+= NODES
+ k=this.match(this.input,NODES,XQueryParser.FOLLOW_NODES_in_p_DeleteExpr14415); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+
+
+ break;
+
+ }
+
+ this.pushFollow(XQueryParser.FOLLOW_p_TargetExpr_in_p_DeleteExpr14418);
+ p_TargetExpr619=this.p_TargetExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_TargetExpr619.getTree());
+ if ( this.state.backtracking===0 ) {
+ this.ak(list_k);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_ReplaceExpr_return: (function() {
+ XQueryParser.p_ReplaceExpr_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_ReplaceExpr_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1757:1: p_ReplaceExpr : k+= REPLACE (k+= VALUE k+= OF )? k+= NODE p_ExprSingle[true] k+= WITH p_ExprSingle[true] ;
+ // $ANTLR start "p_ReplaceExpr"
+ p_ReplaceExpr: function() {
+ var retval = new XQueryParser.p_ReplaceExpr_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var list_k=null;
+ var p_ExprSingle620 = null;
+ var p_ExprSingle621 = null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1758:9: (k+= REPLACE (k+= VALUE k+= OF )? k+= NODE p_ExprSingle[true] k+= WITH p_ExprSingle[true] )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1758:11: k+= REPLACE (k+= VALUE k+= OF )? k+= NODE p_ExprSingle[true] k+= WITH p_ExprSingle[true]
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,REPLACE,XQueryParser.FOLLOW_REPLACE_in_p_ReplaceExpr14448); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1758:22: (k+= VALUE k+= OF )?
+ var alt203=2;
+ var LA203_0 = this.input.LA(1);
+
+ if ( (LA203_0==VALUE) ) {
+ alt203=1;
+ }
+ switch (alt203) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1758:23: k+= VALUE k+= OF
+ k=this.match(this.input,VALUE,XQueryParser.FOLLOW_VALUE_in_p_ReplaceExpr14453); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ k=this.match(this.input,OF,XQueryParser.FOLLOW_OF_in_p_ReplaceExpr14457); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+
+
+ break;
+
+ }
+
+ k=this.match(this.input,NODE,XQueryParser.FOLLOW_NODE_in_p_ReplaceExpr14463); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ this.pushFollow(XQueryParser.FOLLOW_p_ExprSingle_in_p_ReplaceExpr14465);
+ p_ExprSingle620=this.p_ExprSingle(true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ExprSingle620.getTree());
+ k=this.match(this.input,WITH,XQueryParser.FOLLOW_WITH_in_p_ReplaceExpr14470); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ this.pushFollow(XQueryParser.FOLLOW_p_ExprSingle_in_p_ReplaceExpr14472);
+ p_ExprSingle621=this.p_ExprSingle(true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ExprSingle621.getTree());
+ if ( this.state.backtracking===0 ) {
+ this.ak(list_k);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_RenameExpr_return: (function() {
+ XQueryParser.p_RenameExpr_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_RenameExpr_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1762:1: p_RenameExpr : k+= RENAME k+= NODE p_TargetExpr k+= AS p_NewNameExpr ;
+ // $ANTLR start "p_RenameExpr"
+ p_RenameExpr: function() {
+ var retval = new XQueryParser.p_RenameExpr_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var list_k=null;
+ var p_TargetExpr622 = null;
+ var p_NewNameExpr623 = null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1763:9: (k+= RENAME k+= NODE p_TargetExpr k+= AS p_NewNameExpr )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1763:11: k+= RENAME k+= NODE p_TargetExpr k+= AS p_NewNameExpr
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,RENAME,XQueryParser.FOLLOW_RENAME_in_p_RenameExpr14503); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ k=this.match(this.input,NODE,XQueryParser.FOLLOW_NODE_in_p_RenameExpr14507); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ this.pushFollow(XQueryParser.FOLLOW_p_TargetExpr_in_p_RenameExpr14509);
+ p_TargetExpr622=this.p_TargetExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_TargetExpr622.getTree());
+ k=this.match(this.input,AS,XQueryParser.FOLLOW_AS_in_p_RenameExpr14513); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ this.pushFollow(XQueryParser.FOLLOW_p_NewNameExpr_in_p_RenameExpr14515);
+ p_NewNameExpr623=this.p_NewNameExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_NewNameExpr623.getTree());
+ if ( this.state.backtracking===0 ) {
+ this.ak(list_k);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_SourceExpr_return: (function() {
+ XQueryParser.p_SourceExpr_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_SourceExpr_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1767:1: p_SourceExpr : p_ExprSingle[true] ;
+ // $ANTLR start "p_SourceExpr"
+ p_SourceExpr: function() {
+ var retval = new XQueryParser.p_SourceExpr_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_ExprSingle624 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1768:9: ( p_ExprSingle[true] )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1768:11: p_ExprSingle[true]
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_ExprSingle_in_p_SourceExpr14543);
+ p_ExprSingle624=this.p_ExprSingle(true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ExprSingle624.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_TargetExpr_return: (function() {
+ XQueryParser.p_TargetExpr_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_TargetExpr_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1772:1: p_TargetExpr : p_ExprSingle[true] ;
+ // $ANTLR start "p_TargetExpr"
+ p_TargetExpr: function() {
+ var retval = new XQueryParser.p_TargetExpr_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_ExprSingle625 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1773:9: ( p_ExprSingle[true] )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1773:11: p_ExprSingle[true]
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_ExprSingle_in_p_TargetExpr14570);
+ p_ExprSingle625=this.p_ExprSingle(true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ExprSingle625.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_NewNameExpr_return: (function() {
+ XQueryParser.p_NewNameExpr_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_NewNameExpr_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1777:1: p_NewNameExpr : p_ExprSingle[true] ;
+ // $ANTLR start "p_NewNameExpr"
+ p_NewNameExpr: function() {
+ var retval = new XQueryParser.p_NewNameExpr_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_ExprSingle626 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1778:9: ( p_ExprSingle[true] )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1778:11: p_ExprSingle[true]
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_ExprSingle_in_p_NewNameExpr14597);
+ p_ExprSingle626=this.p_ExprSingle(true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ExprSingle626.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_TransformExpr_return: (function() {
+ XQueryParser.p_TransformExpr_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_TransformExpr_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1782:1: p_TransformExpr : k+= COPY d= DOLLAR v= p_VarName BIND p_ExprSingle[true] ( COMMA e= DOLLAR w= p_VarName BIND p_ExprSingle[true] )* k+= MODIFY p_ExprSingle[true] k+= RETURN p_ExprSingle[true] ;
+ // $ANTLR start "p_TransformExpr"
+ p_TransformExpr: function() {
+ var retval = new XQueryParser.p_TransformExpr_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var d = null;
+ var e = null;
+ var BIND627 = null;
+ var COMMA629 = null;
+ var BIND630 = null;
+ var k = null;
+ var list_k=null;
+ var v = null;
+ var w = null;
+ var p_ExprSingle628 = null;
+ var p_ExprSingle631 = null;
+ var p_ExprSingle632 = null;
+ var p_ExprSingle633 = null;
+
+ var d_tree=null;
+ var e_tree=null;
+ var BIND627_tree=null;
+ var COMMA629_tree=null;
+ var BIND630_tree=null;
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1783:9: (k+= COPY d= DOLLAR v= p_VarName BIND p_ExprSingle[true] ( COMMA e= DOLLAR w= p_VarName BIND p_ExprSingle[true] )* k+= MODIFY p_ExprSingle[true] k+= RETURN p_ExprSingle[true] )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1783:11: k+= COPY d= DOLLAR v= p_VarName BIND p_ExprSingle[true] ( COMMA e= DOLLAR w= p_VarName BIND p_ExprSingle[true] )* k+= MODIFY p_ExprSingle[true] k+= RETURN p_ExprSingle[true]
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,COPY,XQueryParser.FOLLOW_COPY_in_p_TransformExpr14626); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ d=this.match(this.input,DOLLAR,XQueryParser.FOLLOW_DOLLAR_in_p_TransformExpr14630); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ d_tree = this.adaptor.create(d);
+ this.adaptor.addChild(root_0, d_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_VarName_in_p_TransformExpr14634);
+ v=this.p_VarName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, v.getTree());
+ if ( this.state.backtracking===0 ) {
+ this.av(d, (v?v.stop:null));
+ }
+ BIND627=this.match(this.input,BIND,XQueryParser.FOLLOW_BIND_in_p_TransformExpr14638); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ BIND627_tree = this.adaptor.create(BIND627);
+ this.adaptor.addChild(root_0, BIND627_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_ExprSingle_in_p_TransformExpr14640);
+ p_ExprSingle628=this.p_ExprSingle(true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ExprSingle628.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1783:90: ( COMMA e= DOLLAR w= p_VarName BIND p_ExprSingle[true] )*
+ loop204:
+ do {
+ var alt204=2;
+ var LA204_0 = this.input.LA(1);
+
+ if ( (LA204_0==COMMA) ) {
+ alt204=1;
+ }
+
+
+ switch (alt204) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1783:91: COMMA e= DOLLAR w= p_VarName BIND p_ExprSingle[true]
+ COMMA629=this.match(this.input,COMMA,XQueryParser.FOLLOW_COMMA_in_p_TransformExpr14644); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ COMMA629_tree = this.adaptor.create(COMMA629);
+ this.adaptor.addChild(root_0, COMMA629_tree);
+ }
+ e=this.match(this.input,DOLLAR,XQueryParser.FOLLOW_DOLLAR_in_p_TransformExpr14648); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ e_tree = this.adaptor.create(e);
+ this.adaptor.addChild(root_0, e_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_VarName_in_p_TransformExpr14652);
+ w=this.p_VarName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, w.getTree());
+ if ( this.state.backtracking===0 ) {
+ this.av(e, (w?w.stop:null));
+ }
+ BIND630=this.match(this.input,BIND,XQueryParser.FOLLOW_BIND_in_p_TransformExpr14656); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ BIND630_tree = this.adaptor.create(BIND630);
+ this.adaptor.addChild(root_0, BIND630_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_ExprSingle_in_p_TransformExpr14658);
+ p_ExprSingle631=this.p_ExprSingle(true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ExprSingle631.getTree());
+
+
+ break;
+
+ default :
+ break loop204;
+ }
+ } while (true);
+
+ k=this.match(this.input,MODIFY,XQueryParser.FOLLOW_MODIFY_in_p_TransformExpr14665); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ this.pushFollow(XQueryParser.FOLLOW_p_ExprSingle_in_p_TransformExpr14667);
+ p_ExprSingle632=this.p_ExprSingle(true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ExprSingle632.getTree());
+ k=this.match(this.input,RETURN,XQueryParser.FOLLOW_RETURN_in_p_TransformExpr14672); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ this.pushFollow(XQueryParser.FOLLOW_p_ExprSingle_in_p_TransformExpr14674);
+ p_ExprSingle633=this.p_ExprSingle(true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ExprSingle633.getTree());
+ if ( this.state.backtracking===0 ) {
+ this.ak(list_k);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ pm_FTOptionDecl_return: (function() {
+ XQueryParser.pm_FTOptionDecl_return = function(){};
+ org.antlr.lang.extend(XQueryParser.pm_FTOptionDecl_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1793:1: pm_FTOptionDecl : k+= DECLARE k+= FT_OPTION p_FTMatchOptions SEMICOLON ;
+ // $ANTLR start "pm_FTOptionDecl"
+ pm_FTOptionDecl: function() {
+ var retval = new XQueryParser.pm_FTOptionDecl_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var SEMICOLON635 = null;
+ var k = null;
+ var list_k=null;
+ var p_FTMatchOptions634 = null;
+
+ var SEMICOLON635_tree=null;
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1794:9: (k+= DECLARE k+= FT_OPTION p_FTMatchOptions SEMICOLON )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1794:11: k+= DECLARE k+= FT_OPTION p_FTMatchOptions SEMICOLON
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,DECLARE,XQueryParser.FOLLOW_DECLARE_in_pm_FTOptionDecl14712); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ k=this.match(this.input,FT_OPTION,XQueryParser.FOLLOW_FT_OPTION_in_pm_FTOptionDecl14716); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ this.pushFollow(XQueryParser.FOLLOW_p_FTMatchOptions_in_pm_FTOptionDecl14718);
+ p_FTMatchOptions634=this.p_FTMatchOptions();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_FTMatchOptions634.getTree());
+ SEMICOLON635=this.match(this.input,SEMICOLON,XQueryParser.FOLLOW_SEMICOLON_in_pm_FTOptionDecl14720); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ SEMICOLON635_tree = this.adaptor.create(SEMICOLON635);
+ this.adaptor.addChild(root_0, SEMICOLON635_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(list_k);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_FTScoreVar_return: (function() {
+ XQueryParser.p_FTScoreVar_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_FTScoreVar_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1798:1: p_FTScoreVar : ks= SCORE d= DOLLAR v= p_VarName ;
+ // $ANTLR start "p_FTScoreVar"
+ p_FTScoreVar: function() {
+ var retval = new XQueryParser.p_FTScoreVar_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var ks = null;
+ var d = null;
+ var v = null;
+
+ var ks_tree=null;
+ var d_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1799:9: (ks= SCORE d= DOLLAR v= p_VarName )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1799:11: ks= SCORE d= DOLLAR v= p_VarName
+ root_0 = this.adaptor.nil();
+
+ ks=this.match(this.input,SCORE,XQueryParser.FOLLOW_SCORE_in_p_FTScoreVar14750); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ ks_tree = this.adaptor.create(ks);
+ this.adaptor.addChild(root_0, ks_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(ks);
+ }
+ d=this.match(this.input,DOLLAR,XQueryParser.FOLLOW_DOLLAR_in_p_FTScoreVar14756); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ d_tree = this.adaptor.create(d);
+ this.adaptor.addChild(root_0, d_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_VarName_in_p_FTScoreVar14760);
+ v=this.p_VarName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, v.getTree());
+ if ( this.state.backtracking===0 ) {
+ this.av(d, (v?v.stop:null));
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_FTContainsExpr_return: (function() {
+ XQueryParser.p_FTContainsExpr_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_FTContainsExpr_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1803:1: p_FTContainsExpr : p_StringConcatExpr (k+= CONTAINS k+= TEXT p_FTSelection ( p_FTIgnoreOption )? )? ;
+ // $ANTLR start "p_FTContainsExpr"
+ p_FTContainsExpr: function() {
+ var retval = new XQueryParser.p_FTContainsExpr_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var list_k=null;
+ var p_StringConcatExpr636 = null;
+ var p_FTSelection637 = null;
+ var p_FTIgnoreOption638 = null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1804:9: ( p_StringConcatExpr (k+= CONTAINS k+= TEXT p_FTSelection ( p_FTIgnoreOption )? )? )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1804:11: p_StringConcatExpr (k+= CONTAINS k+= TEXT p_FTSelection ( p_FTIgnoreOption )? )?
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_StringConcatExpr_in_p_FTContainsExpr14788);
+ p_StringConcatExpr636=this.p_StringConcatExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_StringConcatExpr636.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1804:30: (k+= CONTAINS k+= TEXT p_FTSelection ( p_FTIgnoreOption )? )?
+ var alt206=2;
+ var LA206_0 = this.input.LA(1);
+
+ if ( (LA206_0==CONTAINS) ) {
+ alt206=1;
+ }
+ switch (alt206) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1804:32: k+= CONTAINS k+= TEXT p_FTSelection ( p_FTIgnoreOption )?
+ k=this.match(this.input,CONTAINS,XQueryParser.FOLLOW_CONTAINS_in_p_FTContainsExpr14794); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ k=this.match(this.input,TEXT,XQueryParser.FOLLOW_TEXT_in_p_FTContainsExpr14798); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(list_k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_FTSelection_in_p_FTContainsExpr14802);
+ p_FTSelection637=this.p_FTSelection();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_FTSelection637.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1804:81: ( p_FTIgnoreOption )?
+ var alt205=2;
+ var LA205_0 = this.input.LA(1);
+
+ if ( (LA205_0==WITHOUT) ) {
+ alt205=1;
+ }
+ switch (alt205) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1804:81: p_FTIgnoreOption
+ this.pushFollow(XQueryParser.FOLLOW_p_FTIgnoreOption_in_p_FTContainsExpr14804);
+ p_FTIgnoreOption638=this.p_FTIgnoreOption();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_FTIgnoreOption638.getTree());
+
+
+ break;
+
+ }
+
+
+
+ break;
+
+ }
+
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_FTSelection_return: (function() {
+ XQueryParser.p_FTSelection_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_FTSelection_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1808:1: p_FTSelection : p_FTOr ( p_FTPosFilter )* ;
+ // $ANTLR start "p_FTSelection"
+ p_FTSelection: function() {
+ var retval = new XQueryParser.p_FTSelection_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_FTOr639 = null;
+ var p_FTPosFilter640 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1809:9: ( p_FTOr ( p_FTPosFilter )* )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1809:11: p_FTOr ( p_FTPosFilter )*
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_FTOr_in_p_FTSelection14834);
+ p_FTOr639=this.p_FTOr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_FTOr639.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1809:18: ( p_FTPosFilter )*
+ loop207:
+ do {
+ var alt207=2;
+ var LA207_0 = this.input.LA(1);
+
+ if ( (LA207_0==AT) ) {
+ var LA207_2 = this.input.LA(2);
+
+ if ( (LA207_2==END||LA207_2==START) ) {
+ alt207=1;
+ }
+
+
+ }
+ else if ( (LA207_0==ORDERED||LA207_0==WINDOW||(LA207_0>=DIFFERENT && LA207_0<=ENTIRE)||LA207_0==SAME) ) {
+ alt207=1;
+ }
+
+
+ switch (alt207) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1809:18: p_FTPosFilter
+ this.pushFollow(XQueryParser.FOLLOW_p_FTPosFilter_in_p_FTSelection14836);
+ p_FTPosFilter640=this.p_FTPosFilter();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_FTPosFilter640.getTree());
+
+
+ break;
+
+ default :
+ break loop207;
+ }
+ } while (true);
+
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_FTWeight_return: (function() {
+ XQueryParser.p_FTWeight_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_FTWeight_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1813:1: p_FTWeight : kw= WEIGHT LBRACKET p_Expr[true,true] RBRACKET ;
+ // $ANTLR start "p_FTWeight"
+ p_FTWeight: function() {
+ var retval = new XQueryParser.p_FTWeight_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var kw = null;
+ var LBRACKET641 = null;
+ var RBRACKET643 = null;
+ var p_Expr642 = null;
+
+ var kw_tree=null;
+ var LBRACKET641_tree=null;
+ var RBRACKET643_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1814:9: (kw= WEIGHT LBRACKET p_Expr[true,true] RBRACKET )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1814:11: kw= WEIGHT LBRACKET p_Expr[true,true] RBRACKET
+ root_0 = this.adaptor.nil();
+
+ kw=this.match(this.input,WEIGHT,XQueryParser.FOLLOW_WEIGHT_in_p_FTWeight14865); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ kw_tree = this.adaptor.create(kw);
+ this.adaptor.addChild(root_0, kw_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(kw);
+ }
+ LBRACKET641=this.match(this.input,LBRACKET,XQueryParser.FOLLOW_LBRACKET_in_p_FTWeight14869); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LBRACKET641_tree = this.adaptor.create(LBRACKET641);
+ this.adaptor.addChild(root_0, LBRACKET641_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_Expr_in_p_FTWeight14871);
+ p_Expr642=this.p_Expr(true, true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Expr642.getTree());
+ RBRACKET643=this.match(this.input,RBRACKET,XQueryParser.FOLLOW_RBRACKET_in_p_FTWeight14874); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RBRACKET643_tree = this.adaptor.create(RBRACKET643);
+ this.adaptor.addChild(root_0, RBRACKET643_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_FTOr_return: (function() {
+ XQueryParser.p_FTOr_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_FTOr_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1818:1: p_FTOr : p_FTAnd (ko= FTOR p_FTAnd )* ;
+ // $ANTLR start "p_FTOr"
+ p_FTOr: function() {
+ var retval = new XQueryParser.p_FTOr_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var ko = null;
+ var p_FTAnd644 = null;
+ var p_FTAnd645 = null;
+
+ var ko_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1819:9: ( p_FTAnd (ko= FTOR p_FTAnd )* )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1819:11: p_FTAnd (ko= FTOR p_FTAnd )*
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_FTAnd_in_p_FTOr14900);
+ p_FTAnd644=this.p_FTAnd();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_FTAnd644.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1819:19: (ko= FTOR p_FTAnd )*
+ loop208:
+ do {
+ var alt208=2;
+ var LA208_0 = this.input.LA(1);
+
+ if ( (LA208_0==FTOR) ) {
+ alt208=1;
+ }
+
+
+ switch (alt208) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1819:21: ko= FTOR p_FTAnd
+ ko=this.match(this.input,FTOR,XQueryParser.FOLLOW_FTOR_in_p_FTOr14906); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ ko_tree = this.adaptor.create(ko);
+ this.adaptor.addChild(root_0, ko_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(ko);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_FTAnd_in_p_FTOr14910);
+ p_FTAnd645=this.p_FTAnd();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_FTAnd645.getTree());
+
+
+ break;
+
+ default :
+ break loop208;
+ }
+ } while (true);
+
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_FTAnd_return: (function() {
+ XQueryParser.p_FTAnd_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_FTAnd_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1823:1: p_FTAnd : p_FTMildNot (ka= FTAND p_FTMildNot )* ;
+ // $ANTLR start "p_FTAnd"
+ p_FTAnd: function() {
+ var retval = new XQueryParser.p_FTAnd_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var ka = null;
+ var p_FTMildNot646 = null;
+ var p_FTMildNot647 = null;
+
+ var ka_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1824:9: ( p_FTMildNot (ka= FTAND p_FTMildNot )* )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1824:11: p_FTMildNot (ka= FTAND p_FTMildNot )*
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_FTMildNot_in_p_FTAnd14939);
+ p_FTMildNot646=this.p_FTMildNot();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_FTMildNot646.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1824:23: (ka= FTAND p_FTMildNot )*
+ loop209:
+ do {
+ var alt209=2;
+ var LA209_0 = this.input.LA(1);
+
+ if ( (LA209_0==FTAND) ) {
+ alt209=1;
+ }
+
+
+ switch (alt209) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1824:25: ka= FTAND p_FTMildNot
+ ka=this.match(this.input,FTAND,XQueryParser.FOLLOW_FTAND_in_p_FTAnd14945); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ ka_tree = this.adaptor.create(ka);
+ this.adaptor.addChild(root_0, ka_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(ka);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_FTMildNot_in_p_FTAnd14949);
+ p_FTMildNot647=this.p_FTMildNot();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_FTMildNot647.getTree());
+
+
+ break;
+
+ default :
+ break loop209;
+ }
+ } while (true);
+
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_FTMildNot_return: (function() {
+ XQueryParser.p_FTMildNot_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_FTMildNot_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1828:1: p_FTMildNot : p_FTUnaryNot (k+= NOT k+= IN p_FTUnaryNot )* ;
+ // $ANTLR start "p_FTMildNot"
+ p_FTMildNot: function() {
+ var retval = new XQueryParser.p_FTMildNot_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var list_k=null;
+ var p_FTUnaryNot648 = null;
+ var p_FTUnaryNot649 = null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1829:9: ( p_FTUnaryNot (k+= NOT k+= IN p_FTUnaryNot )* )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1829:11: p_FTUnaryNot (k+= NOT k+= IN p_FTUnaryNot )*
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_FTUnaryNot_in_p_FTMildNot14978);
+ p_FTUnaryNot648=this.p_FTUnaryNot();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_FTUnaryNot648.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1829:24: (k+= NOT k+= IN p_FTUnaryNot )*
+ loop210:
+ do {
+ var alt210=2;
+ var LA210_0 = this.input.LA(1);
+
+ if ( (LA210_0==NOT) ) {
+ alt210=1;
+ }
+
+
+ switch (alt210) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1829:26: k+= NOT k+= IN p_FTUnaryNot
+ k=this.match(this.input,NOT,XQueryParser.FOLLOW_NOT_in_p_FTMildNot14984); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ k=this.match(this.input,IN,XQueryParser.FOLLOW_IN_in_p_FTMildNot14988); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(list_k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_FTUnaryNot_in_p_FTMildNot14992);
+ p_FTUnaryNot649=this.p_FTUnaryNot();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_FTUnaryNot649.getTree());
+
+
+ break;
+
+ default :
+ break loop210;
+ }
+ } while (true);
+
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_FTUnaryNot_return: (function() {
+ XQueryParser.p_FTUnaryNot_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_FTUnaryNot_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1833:1: p_FTUnaryNot : (kn= FTNOT )? p_FTPrimaryWithOptions ;
+ // $ANTLR start "p_FTUnaryNot"
+ p_FTUnaryNot: function() {
+ var retval = new XQueryParser.p_FTUnaryNot_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var kn = null;
+ var p_FTPrimaryWithOptions650 = null;
+
+ var kn_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1834:9: ( (kn= FTNOT )? p_FTPrimaryWithOptions )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1834:11: (kn= FTNOT )? p_FTPrimaryWithOptions
+ root_0 = this.adaptor.nil();
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1834:11: (kn= FTNOT )?
+ var alt211=2;
+ var LA211_0 = this.input.LA(1);
+
+ if ( (LA211_0==FTNOT) ) {
+ alt211=1;
+ }
+ switch (alt211) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1834:13: kn= FTNOT
+ kn=this.match(this.input,FTNOT,XQueryParser.FOLLOW_FTNOT_in_p_FTUnaryNot15025); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ kn_tree = this.adaptor.create(kn);
+ this.adaptor.addChild(root_0, kn_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(kn);
+ }
+
+
+ break;
+
+ }
+
+ this.pushFollow(XQueryParser.FOLLOW_p_FTPrimaryWithOptions_in_p_FTUnaryNot15032);
+ p_FTPrimaryWithOptions650=this.p_FTPrimaryWithOptions();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_FTPrimaryWithOptions650.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_FTPrimaryWithOptions_return: (function() {
+ XQueryParser.p_FTPrimaryWithOptions_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_FTPrimaryWithOptions_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1838:1: p_FTPrimaryWithOptions : p_FTPrimary ( p_FTMatchOptions )? ( p_FTWeight )? ;
+ // $ANTLR start "p_FTPrimaryWithOptions"
+ p_FTPrimaryWithOptions: function() {
+ var retval = new XQueryParser.p_FTPrimaryWithOptions_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_FTPrimary651 = null;
+ var p_FTMatchOptions652 = null;
+ var p_FTWeight653 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1839:9: ( p_FTPrimary ( p_FTMatchOptions )? ( p_FTWeight )? )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1839:11: p_FTPrimary ( p_FTMatchOptions )? ( p_FTWeight )?
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_FTPrimary_in_p_FTPrimaryWithOptions15058);
+ p_FTPrimary651=this.p_FTPrimary();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_FTPrimary651.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1839:23: ( p_FTMatchOptions )?
+ var alt212=2;
+ var LA212_0 = this.input.LA(1);
+
+ if ( (LA212_0==USING) ) {
+ alt212=1;
+ }
+ switch (alt212) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1839:23: p_FTMatchOptions
+ this.pushFollow(XQueryParser.FOLLOW_p_FTMatchOptions_in_p_FTPrimaryWithOptions15060);
+ p_FTMatchOptions652=this.p_FTMatchOptions();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_FTMatchOptions652.getTree());
+
+
+ break;
+
+ }
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1839:41: ( p_FTWeight )?
+ var alt213=2;
+ var LA213_0 = this.input.LA(1);
+
+ if ( (LA213_0==WEIGHT) ) {
+ alt213=1;
+ }
+ switch (alt213) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1839:41: p_FTWeight
+ this.pushFollow(XQueryParser.FOLLOW_p_FTWeight_in_p_FTPrimaryWithOptions15063);
+ p_FTWeight653=this.p_FTWeight();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_FTWeight653.getTree());
+
+
+ break;
+
+ }
+
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_FTPrimary_return: (function() {
+ XQueryParser.p_FTPrimary_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_FTPrimary_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1846:1: p_FTPrimary : ( ( p_FTWords ( p_FTTimes )? ) | ( LPAREN p_FTSelection RPAREN ) | p_FTExtensionSelection );
+ // $ANTLR start "p_FTPrimary"
+ p_FTPrimary: function() {
+ var retval = new XQueryParser.p_FTPrimary_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var LPAREN656 = null;
+ var RPAREN658 = null;
+ var p_FTWords654 = null;
+ var p_FTTimes655 = null;
+ var p_FTSelection657 = null;
+ var p_FTExtensionSelection659 = null;
+
+ var LPAREN656_tree=null;
+ var RPAREN658_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1847:9: ( ( p_FTWords ( p_FTTimes )? ) | ( LPAREN p_FTSelection RPAREN ) | p_FTExtensionSelection )
+ var alt215=3;
+ switch ( this.input.LA(1) ) {
+ case LBRACKET:
+ case APOS:
+ case QUOT:
+ alt215=1;
+ break;
+ case LPAREN:
+ alt215=2;
+ break;
+ case L_Pragma:
+ alt215=3;
+ break;
+ default:
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 215, 0, this.input);
+
+ throw nvae;
+ }
+
+ switch (alt215) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1847:11: ( p_FTWords ( p_FTTimes )? )
+ root_0 = this.adaptor.nil();
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1847:11: ( p_FTWords ( p_FTTimes )? )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1847:12: p_FTWords ( p_FTTimes )?
+ this.pushFollow(XQueryParser.FOLLOW_p_FTWords_in_p_FTPrimary15094);
+ p_FTWords654=this.p_FTWords();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_FTWords654.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1847:22: ( p_FTTimes )?
+ var alt214=2;
+ var LA214_0 = this.input.LA(1);
+
+ if ( (LA214_0==OCCURS) ) {
+ alt214=1;
+ }
+ switch (alt214) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1847:22: p_FTTimes
+ this.pushFollow(XQueryParser.FOLLOW_p_FTTimes_in_p_FTPrimary15096);
+ p_FTTimes655=this.p_FTTimes();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_FTTimes655.getTree());
+
+
+ break;
+
+ }
+
+
+
+
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1848:11: ( LPAREN p_FTSelection RPAREN )
+ root_0 = this.adaptor.nil();
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1848:11: ( LPAREN p_FTSelection RPAREN )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1848:12: LPAREN p_FTSelection RPAREN
+ LPAREN656=this.match(this.input,LPAREN,XQueryParser.FOLLOW_LPAREN_in_p_FTPrimary15111); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LPAREN656_tree = this.adaptor.create(LPAREN656);
+ this.adaptor.addChild(root_0, LPAREN656_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_FTSelection_in_p_FTPrimary15113);
+ p_FTSelection657=this.p_FTSelection();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_FTSelection657.getTree());
+ RPAREN658=this.match(this.input,RPAREN,XQueryParser.FOLLOW_RPAREN_in_p_FTPrimary15115); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RPAREN658_tree = this.adaptor.create(RPAREN658);
+ this.adaptor.addChild(root_0, RPAREN658_tree);
+ }
+
+
+
+
+
+ break;
+ case 3 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1849:11: p_FTExtensionSelection
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_FTExtensionSelection_in_p_FTPrimary15128);
+ p_FTExtensionSelection659=this.p_FTExtensionSelection();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_FTExtensionSelection659.getTree());
+
+
+ break;
+
+ }
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_FTWords_return: (function() {
+ XQueryParser.p_FTWords_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_FTWords_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1853:1: p_FTWords : p_FTWordsValue ( p_FTAnyallOption )? ;
+ // $ANTLR start "p_FTWords"
+ p_FTWords: function() {
+ var retval = new XQueryParser.p_FTWords_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_FTWordsValue660 = null;
+ var p_FTAnyallOption661 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1854:9: ( p_FTWordsValue ( p_FTAnyallOption )? )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1854:11: p_FTWordsValue ( p_FTAnyallOption )?
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_FTWordsValue_in_p_FTWords15154);
+ p_FTWordsValue660=this.p_FTWordsValue();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_FTWordsValue660.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1854:26: ( p_FTAnyallOption )?
+ var alt216=2;
+ var LA216_0 = this.input.LA(1);
+
+ if ( ((LA216_0>=ALL && LA216_0<=ANY)||LA216_0==PHRASE) ) {
+ alt216=1;
+ }
+ switch (alt216) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1854:26: p_FTAnyallOption
+ this.pushFollow(XQueryParser.FOLLOW_p_FTAnyallOption_in_p_FTWords15156);
+ p_FTAnyallOption661=this.p_FTAnyallOption();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_FTAnyallOption661.getTree());
+
+
+ break;
+
+ }
+
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_FTWordsValue_return: (function() {
+ XQueryParser.p_FTWordsValue_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_FTWordsValue_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1858:1: p_FTWordsValue : ( p_StringLiteral | ( LBRACKET p_Expr[true,true] RBRACKET ) );
+ // $ANTLR start "p_FTWordsValue"
+ p_FTWordsValue: function() {
+ var retval = new XQueryParser.p_FTWordsValue_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var LBRACKET663 = null;
+ var RBRACKET665 = null;
+ var p_StringLiteral662 = null;
+ var p_Expr664 = null;
+
+ var LBRACKET663_tree=null;
+ var RBRACKET665_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1859:9: ( p_StringLiteral | ( LBRACKET p_Expr[true,true] RBRACKET ) )
+ var alt217=2;
+ var LA217_0 = this.input.LA(1);
+
+ if ( ((LA217_0>=APOS && LA217_0<=QUOT)) ) {
+ alt217=1;
+ }
+ else if ( (LA217_0==LBRACKET) ) {
+ alt217=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 217, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt217) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1859:11: p_StringLiteral
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_StringLiteral_in_p_FTWordsValue15183);
+ p_StringLiteral662=this.p_StringLiteral();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_StringLiteral662.getTree());
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1860:11: ( LBRACKET p_Expr[true,true] RBRACKET )
+ root_0 = this.adaptor.nil();
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1860:11: ( LBRACKET p_Expr[true,true] RBRACKET )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1860:12: LBRACKET p_Expr[true,true] RBRACKET
+ LBRACKET663=this.match(this.input,LBRACKET,XQueryParser.FOLLOW_LBRACKET_in_p_FTWordsValue15196); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LBRACKET663_tree = this.adaptor.create(LBRACKET663);
+ this.adaptor.addChild(root_0, LBRACKET663_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_Expr_in_p_FTWordsValue15198);
+ p_Expr664=this.p_Expr(true, true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Expr664.getTree());
+ RBRACKET665=this.match(this.input,RBRACKET,XQueryParser.FOLLOW_RBRACKET_in_p_FTWordsValue15201); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RBRACKET665_tree = this.adaptor.create(RBRACKET665);
+ this.adaptor.addChild(root_0, RBRACKET665_tree);
+ }
+
+
+
+
+
+ break;
+
+ }
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_FTExtensionSelection_return: (function() {
+ XQueryParser.p_FTExtensionSelection_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_FTExtensionSelection_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1864:1: p_FTExtensionSelection : ( L_Pragma )+ LBRACKET ( p_FTSelection )? RBRACKET ;
+ // $ANTLR start "p_FTExtensionSelection"
+ p_FTExtensionSelection: function() {
+ var retval = new XQueryParser.p_FTExtensionSelection_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var L_Pragma666 = null;
+ var LBRACKET667 = null;
+ var RBRACKET669 = null;
+ var p_FTSelection668 = null;
+
+ var L_Pragma666_tree=null;
+ var LBRACKET667_tree=null;
+ var RBRACKET669_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1865:9: ( ( L_Pragma )+ LBRACKET ( p_FTSelection )? RBRACKET )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1865:11: ( L_Pragma )+ LBRACKET ( p_FTSelection )? RBRACKET
+ root_0 = this.adaptor.nil();
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1865:11: ( L_Pragma )+
+ var cnt218=0;
+ loop218:
+ do {
+ var alt218=2;
+ var LA218_0 = this.input.LA(1);
+
+ if ( (LA218_0==L_Pragma) ) {
+ alt218=1;
+ }
+
+
+ switch (alt218) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1865:11: L_Pragma
+ L_Pragma666=this.match(this.input,L_Pragma,XQueryParser.FOLLOW_L_Pragma_in_p_FTExtensionSelection15228); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ L_Pragma666_tree = this.adaptor.create(L_Pragma666);
+ this.adaptor.addChild(root_0, L_Pragma666_tree);
+ }
+
+
+ break;
+
+ default :
+ if ( cnt218 >= 1 ) {
+ break loop218;
+ }
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var eee = new org.antlr.runtime.EarlyExitException(218, this.input);
+ throw eee;
+ }
+ cnt218++;
+ } while (true);
+
+ LBRACKET667=this.match(this.input,LBRACKET,XQueryParser.FOLLOW_LBRACKET_in_p_FTExtensionSelection15231); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LBRACKET667_tree = this.adaptor.create(LBRACKET667);
+ this.adaptor.addChild(root_0, LBRACKET667_tree);
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1865:30: ( p_FTSelection )?
+ var alt219=2;
+ var LA219_0 = this.input.LA(1);
+
+ if ( (LA219_0==FTNOT||LA219_0==LPAREN||LA219_0==LBRACKET||(LA219_0>=APOS && LA219_0<=QUOT)||LA219_0==L_Pragma) ) {
+ alt219=1;
+ }
+ switch (alt219) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1865:30: p_FTSelection
+ this.pushFollow(XQueryParser.FOLLOW_p_FTSelection_in_p_FTExtensionSelection15233);
+ p_FTSelection668=this.p_FTSelection();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_FTSelection668.getTree());
+
+
+ break;
+
+ }
+
+ RBRACKET669=this.match(this.input,RBRACKET,XQueryParser.FOLLOW_RBRACKET_in_p_FTExtensionSelection15236); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RBRACKET669_tree = this.adaptor.create(RBRACKET669);
+ this.adaptor.addChild(root_0, RBRACKET669_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_FTAnyallOption_return: (function() {
+ XQueryParser.p_FTAnyallOption_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_FTAnyallOption_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1869:1: p_FTAnyallOption : ( (k+= ANY (k+= WORD )? ) | (k+= ALL ( WORDS )? ) | k+= PHRASE ) ;
+ // $ANTLR start "p_FTAnyallOption"
+ p_FTAnyallOption: function() {
+ var retval = new XQueryParser.p_FTAnyallOption_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var WORDS670 = null;
+ var k = null;
+ var list_k=null;
+
+ var WORDS670_tree=null;
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1870:9: ( ( (k+= ANY (k+= WORD )? ) | (k+= ALL ( WORDS )? ) | k+= PHRASE ) )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1870:11: ( (k+= ANY (k+= WORD )? ) | (k+= ALL ( WORDS )? ) | k+= PHRASE )
+ root_0 = this.adaptor.nil();
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1870:11: ( (k+= ANY (k+= WORD )? ) | (k+= ALL ( WORDS )? ) | k+= PHRASE )
+ var alt222=3;
+ switch ( this.input.LA(1) ) {
+ case ANY:
+ alt222=1;
+ break;
+ case ALL:
+ alt222=2;
+ break;
+ case PHRASE:
+ alt222=3;
+ break;
+ default:
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 222, 0, this.input);
+
+ throw nvae;
+ }
+
+ switch (alt222) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1870:13: (k+= ANY (k+= WORD )? )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1870:13: (k+= ANY (k+= WORD )? )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1870:14: k+= ANY (k+= WORD )?
+ k=this.match(this.input,ANY,XQueryParser.FOLLOW_ANY_in_p_FTAnyallOption15267); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1870:22: (k+= WORD )?
+ var alt220=2;
+ var LA220_0 = this.input.LA(1);
+
+ if ( (LA220_0==WORD) ) {
+ alt220=1;
+ }
+ switch (alt220) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1870:22: k+= WORD
+ k=this.match(this.input,WORD,XQueryParser.FOLLOW_WORD_in_p_FTAnyallOption15271); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+
+
+ break;
+
+ }
+
+
+
+
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1870:33: (k+= ALL ( WORDS )? )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1870:33: (k+= ALL ( WORDS )? )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1870:34: k+= ALL ( WORDS )?
+ k=this.match(this.input,ALL,XQueryParser.FOLLOW_ALL_in_p_FTAnyallOption15280); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1870:41: ( WORDS )?
+ var alt221=2;
+ var LA221_0 = this.input.LA(1);
+
+ if ( (LA221_0==WORDS) ) {
+ alt221=1;
+ }
+ switch (alt221) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1870:41: WORDS
+ WORDS670=this.match(this.input,WORDS,XQueryParser.FOLLOW_WORDS_in_p_FTAnyallOption15282); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ WORDS670_tree = this.adaptor.create(WORDS670);
+ this.adaptor.addChild(root_0, WORDS670_tree);
+ }
+
+
+ break;
+
+ }
+
+
+
+
+
+
+ break;
+ case 3 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1870:51: k+= PHRASE
+ k=this.match(this.input,PHRASE,XQueryParser.FOLLOW_PHRASE_in_p_FTAnyallOption15290); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+
+
+ break;
+
+ }
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(list_k);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_FTTimes_return: (function() {
+ XQueryParser.p_FTTimes_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_FTTimes_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1874:1: p_FTTimes : k+= OCCURS p_FTRange k+= TIMES ;
+ // $ANTLR start "p_FTTimes"
+ p_FTTimes: function() {
+ var retval = new XQueryParser.p_FTTimes_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var list_k=null;
+ var p_FTRange671 = null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1875:9: (k+= OCCURS p_FTRange k+= TIMES )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1875:11: k+= OCCURS p_FTRange k+= TIMES
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,OCCURS,XQueryParser.FOLLOW_OCCURS_in_p_FTTimes15322); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ this.pushFollow(XQueryParser.FOLLOW_p_FTRange_in_p_FTTimes15324);
+ p_FTRange671=this.p_FTRange();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_FTRange671.getTree());
+ k=this.match(this.input,TIMES,XQueryParser.FOLLOW_TIMES_in_p_FTTimes15328); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(list_k);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_FTRange_return: (function() {
+ XQueryParser.p_FTRange_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_FTRange_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1879:1: p_FTRange : ( (k+= EXACTLY p_AdditiveExpr ) | (k+= AT k+= LEAST p_AdditiveExpr ) | (k+= AT k+= MOST p_AdditiveExpr ) | (k+= FROM p_AdditiveExpr k+= TO p_AdditiveExpr ) ) ;
+ // $ANTLR start "p_FTRange"
+ p_FTRange: function() {
+ var retval = new XQueryParser.p_FTRange_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var list_k=null;
+ var p_AdditiveExpr672 = null;
+ var p_AdditiveExpr673 = null;
+ var p_AdditiveExpr674 = null;
+ var p_AdditiveExpr675 = null;
+ var p_AdditiveExpr676 = null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1880:9: ( ( (k+= EXACTLY p_AdditiveExpr ) | (k+= AT k+= LEAST p_AdditiveExpr ) | (k+= AT k+= MOST p_AdditiveExpr ) | (k+= FROM p_AdditiveExpr k+= TO p_AdditiveExpr ) ) )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1880:11: ( (k+= EXACTLY p_AdditiveExpr ) | (k+= AT k+= LEAST p_AdditiveExpr ) | (k+= AT k+= MOST p_AdditiveExpr ) | (k+= FROM p_AdditiveExpr k+= TO p_AdditiveExpr ) )
+ root_0 = this.adaptor.nil();
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1880:11: ( (k+= EXACTLY p_AdditiveExpr ) | (k+= AT k+= LEAST p_AdditiveExpr ) | (k+= AT k+= MOST p_AdditiveExpr ) | (k+= FROM p_AdditiveExpr k+= TO p_AdditiveExpr ) )
+ var alt223=4;
+ switch ( this.input.LA(1) ) {
+ case EXACTLY:
+ alt223=1;
+ break;
+ case AT:
+ var LA223_2 = this.input.LA(2);
+
+ if ( (LA223_2==LEAST) ) {
+ alt223=2;
+ }
+ else if ( (LA223_2==MOST) ) {
+ alt223=3;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 223, 2, this.input);
+
+ throw nvae;
+ }
+ break;
+ case FROM:
+ alt223=4;
+ break;
+ default:
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 223, 0, this.input);
+
+ throw nvae;
+ }
+
+ switch (alt223) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1880:13: (k+= EXACTLY p_AdditiveExpr )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1880:13: (k+= EXACTLY p_AdditiveExpr )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1880:14: k+= EXACTLY p_AdditiveExpr
+ k=this.match(this.input,EXACTLY,XQueryParser.FOLLOW_EXACTLY_in_p_FTRange15361); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ this.pushFollow(XQueryParser.FOLLOW_p_AdditiveExpr_in_p_FTRange15363);
+ p_AdditiveExpr672=this.p_AdditiveExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_AdditiveExpr672.getTree());
+
+
+
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1881:13: (k+= AT k+= LEAST p_AdditiveExpr )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1881:13: (k+= AT k+= LEAST p_AdditiveExpr )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1881:14: k+= AT k+= LEAST p_AdditiveExpr
+ k=this.match(this.input,AT,XQueryParser.FOLLOW_AT_in_p_FTRange15381); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ k=this.match(this.input,LEAST,XQueryParser.FOLLOW_LEAST_in_p_FTRange15385); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ this.pushFollow(XQueryParser.FOLLOW_p_AdditiveExpr_in_p_FTRange15387);
+ p_AdditiveExpr673=this.p_AdditiveExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_AdditiveExpr673.getTree());
+
+
+
+
+
+ break;
+ case 3 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1882:13: (k+= AT k+= MOST p_AdditiveExpr )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1882:13: (k+= AT k+= MOST p_AdditiveExpr )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1882:14: k+= AT k+= MOST p_AdditiveExpr
+ k=this.match(this.input,AT,XQueryParser.FOLLOW_AT_in_p_FTRange15405); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ k=this.match(this.input,MOST,XQueryParser.FOLLOW_MOST_in_p_FTRange15409); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ this.pushFollow(XQueryParser.FOLLOW_p_AdditiveExpr_in_p_FTRange15411);
+ p_AdditiveExpr674=this.p_AdditiveExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_AdditiveExpr674.getTree());
+
+
+
+
+
+ break;
+ case 4 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1883:13: (k+= FROM p_AdditiveExpr k+= TO p_AdditiveExpr )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1883:13: (k+= FROM p_AdditiveExpr k+= TO p_AdditiveExpr )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1883:14: k+= FROM p_AdditiveExpr k+= TO p_AdditiveExpr
+ k=this.match(this.input,FROM,XQueryParser.FOLLOW_FROM_in_p_FTRange15429); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ this.pushFollow(XQueryParser.FOLLOW_p_AdditiveExpr_in_p_FTRange15431);
+ p_AdditiveExpr675=this.p_AdditiveExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_AdditiveExpr675.getTree());
+ k=this.match(this.input,TO,XQueryParser.FOLLOW_TO_in_p_FTRange15435); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ this.pushFollow(XQueryParser.FOLLOW_p_AdditiveExpr_in_p_FTRange15437);
+ p_AdditiveExpr676=this.p_AdditiveExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_AdditiveExpr676.getTree());
+
+
+
+
+
+ break;
+
+ }
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(list_k);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_FTPosFilter_return: (function() {
+ XQueryParser.p_FTPosFilter_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_FTPosFilter_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1887:1: p_FTPosFilter : ( p_FTOrder | p_FTWindow | p_FTDistance | p_FTScope | p_FTContent );
+ // $ANTLR start "p_FTPosFilter"
+ p_FTPosFilter: function() {
+ var retval = new XQueryParser.p_FTPosFilter_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_FTOrder677 = null;
+ var p_FTWindow678 = null;
+ var p_FTDistance679 = null;
+ var p_FTScope680 = null;
+ var p_FTContent681 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1888:9: ( p_FTOrder | p_FTWindow | p_FTDistance | p_FTScope | p_FTContent )
+ var alt224=5;
+ switch ( this.input.LA(1) ) {
+ case ORDERED:
+ alt224=1;
+ break;
+ case WINDOW:
+ alt224=2;
+ break;
+ case DISTANCE:
+ alt224=3;
+ break;
+ case DIFFERENT:
+ case SAME:
+ alt224=4;
+ break;
+ case AT:
+ case ENTIRE:
+ alt224=5;
+ break;
+ default:
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 224, 0, this.input);
+
+ throw nvae;
+ }
+
+ switch (alt224) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1888:11: p_FTOrder
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_FTOrder_in_p_FTPosFilter15468);
+ p_FTOrder677=this.p_FTOrder();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_FTOrder677.getTree());
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1888:23: p_FTWindow
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_FTWindow_in_p_FTPosFilter15472);
+ p_FTWindow678=this.p_FTWindow();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_FTWindow678.getTree());
+
+
+ break;
+ case 3 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1888:36: p_FTDistance
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_FTDistance_in_p_FTPosFilter15476);
+ p_FTDistance679=this.p_FTDistance();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_FTDistance679.getTree());
+
+
+ break;
+ case 4 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1888:51: p_FTScope
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_FTScope_in_p_FTPosFilter15480);
+ p_FTScope680=this.p_FTScope();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_FTScope680.getTree());
+
+
+ break;
+ case 5 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1888:63: p_FTContent
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_FTContent_in_p_FTPosFilter15484);
+ p_FTContent681=this.p_FTContent();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_FTContent681.getTree());
+
+
+ break;
+
+ }
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_FTOrder_return: (function() {
+ XQueryParser.p_FTOrder_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_FTOrder_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1892:1: p_FTOrder : ko= ORDERED ;
+ // $ANTLR start "p_FTOrder"
+ p_FTOrder: function() {
+ var retval = new XQueryParser.p_FTOrder_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var ko = null;
+
+ var ko_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1893:9: (ko= ORDERED )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1893:11: ko= ORDERED
+ root_0 = this.adaptor.nil();
+
+ ko=this.match(this.input,ORDERED,XQueryParser.FOLLOW_ORDERED_in_p_FTOrder15512); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ ko_tree = this.adaptor.create(ko);
+ this.adaptor.addChild(root_0, ko_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(ko);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_FTWindow_return: (function() {
+ XQueryParser.p_FTWindow_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_FTWindow_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1897:1: p_FTWindow : kw= WINDOW p_AdditiveExpr p_FTUnit ;
+ // $ANTLR start "p_FTWindow"
+ p_FTWindow: function() {
+ var retval = new XQueryParser.p_FTWindow_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var kw = null;
+ var p_AdditiveExpr682 = null;
+ var p_FTUnit683 = null;
+
+ var kw_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1898:9: (kw= WINDOW p_AdditiveExpr p_FTUnit )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1898:11: kw= WINDOW p_AdditiveExpr p_FTUnit
+ root_0 = this.adaptor.nil();
+
+ kw=this.match(this.input,WINDOW,XQueryParser.FOLLOW_WINDOW_in_p_FTWindow15542); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ kw_tree = this.adaptor.create(kw);
+ this.adaptor.addChild(root_0, kw_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(kw);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_AdditiveExpr_in_p_FTWindow15546);
+ p_AdditiveExpr682=this.p_AdditiveExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_AdditiveExpr682.getTree());
+ this.pushFollow(XQueryParser.FOLLOW_p_FTUnit_in_p_FTWindow15548);
+ p_FTUnit683=this.p_FTUnit();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_FTUnit683.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_FTDistance_return: (function() {
+ XQueryParser.p_FTDistance_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_FTDistance_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1902:1: p_FTDistance : kd= DISTANCE p_FTRange p_FTUnit ;
+ // $ANTLR start "p_FTDistance"
+ p_FTDistance: function() {
+ var retval = new XQueryParser.p_FTDistance_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var kd = null;
+ var p_FTRange684 = null;
+ var p_FTUnit685 = null;
+
+ var kd_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1903:9: (kd= DISTANCE p_FTRange p_FTUnit )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1903:11: kd= DISTANCE p_FTRange p_FTUnit
+ root_0 = this.adaptor.nil();
+
+ kd=this.match(this.input,DISTANCE,XQueryParser.FOLLOW_DISTANCE_in_p_FTDistance15576); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ kd_tree = this.adaptor.create(kd);
+ this.adaptor.addChild(root_0, kd_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(kd);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_FTRange_in_p_FTDistance15580);
+ p_FTRange684=this.p_FTRange();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_FTRange684.getTree());
+ this.pushFollow(XQueryParser.FOLLOW_p_FTUnit_in_p_FTDistance15582);
+ p_FTUnit685=this.p_FTUnit();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_FTUnit685.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_FTUnit_return: (function() {
+ XQueryParser.p_FTUnit_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_FTUnit_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1907:1: p_FTUnit : (k+= WORDS | k+= SENTENCES | k+= PARAGRAPHS ) ;
+ // $ANTLR start "p_FTUnit"
+ p_FTUnit: function() {
+ var retval = new XQueryParser.p_FTUnit_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var list_k=null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1908:9: ( (k+= WORDS | k+= SENTENCES | k+= PARAGRAPHS ) )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1908:11: (k+= WORDS | k+= SENTENCES | k+= PARAGRAPHS )
+ root_0 = this.adaptor.nil();
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1908:11: (k+= WORDS | k+= SENTENCES | k+= PARAGRAPHS )
+ var alt225=3;
+ switch ( this.input.LA(1) ) {
+ case WORDS:
+ alt225=1;
+ break;
+ case SENTENCES:
+ alt225=2;
+ break;
+ case PARAGRAPHS:
+ alt225=3;
+ break;
+ default:
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 225, 0, this.input);
+
+ throw nvae;
+ }
+
+ switch (alt225) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1908:13: k+= WORDS
+ k=this.match(this.input,WORDS,XQueryParser.FOLLOW_WORDS_in_p_FTUnit15612); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1908:24: k+= SENTENCES
+ k=this.match(this.input,SENTENCES,XQueryParser.FOLLOW_SENTENCES_in_p_FTUnit15618); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+
+
+ break;
+ case 3 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1908:39: k+= PARAGRAPHS
+ k=this.match(this.input,PARAGRAPHS,XQueryParser.FOLLOW_PARAGRAPHS_in_p_FTUnit15624); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+
+
+ break;
+
+ }
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(list_k);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_FTScope_return: (function() {
+ XQueryParser.p_FTScope_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_FTScope_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1912:1: p_FTScope : (k+= SAME | k+= DIFFERENT ) p_FTBigUnit ;
+ // $ANTLR start "p_FTScope"
+ p_FTScope: function() {
+ var retval = new XQueryParser.p_FTScope_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var list_k=null;
+ var p_FTBigUnit686 = null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1913:9: ( (k+= SAME | k+= DIFFERENT ) p_FTBigUnit )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1913:11: (k+= SAME | k+= DIFFERENT ) p_FTBigUnit
+ root_0 = this.adaptor.nil();
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1913:11: (k+= SAME | k+= DIFFERENT )
+ var alt226=2;
+ var LA226_0 = this.input.LA(1);
+
+ if ( (LA226_0==SAME) ) {
+ alt226=1;
+ }
+ else if ( (LA226_0==DIFFERENT) ) {
+ alt226=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 226, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt226) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1913:12: k+= SAME
+ k=this.match(this.input,SAME,XQueryParser.FOLLOW_SAME_in_p_FTScope15657); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1913:22: k+= DIFFERENT
+ k=this.match(this.input,DIFFERENT,XQueryParser.FOLLOW_DIFFERENT_in_p_FTScope15663); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+
+
+ break;
+
+ }
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(list_k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_FTBigUnit_in_p_FTScope15668);
+ p_FTBigUnit686=this.p_FTBigUnit();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_FTBigUnit686.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_FTBigUnit_return: (function() {
+ XQueryParser.p_FTBigUnit_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_FTBigUnit_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1917:1: p_FTBigUnit : (k+= SENTENCE | k+= PARAGRAPH ) ;
+ // $ANTLR start "p_FTBigUnit"
+ p_FTBigUnit: function() {
+ var retval = new XQueryParser.p_FTBigUnit_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var list_k=null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1918:9: ( (k+= SENTENCE | k+= PARAGRAPH ) )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1918:11: (k+= SENTENCE | k+= PARAGRAPH )
+ root_0 = this.adaptor.nil();
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1918:11: (k+= SENTENCE | k+= PARAGRAPH )
+ var alt227=2;
+ var LA227_0 = this.input.LA(1);
+
+ if ( (LA227_0==SENTENCE) ) {
+ alt227=1;
+ }
+ else if ( (LA227_0==PARAGRAPH) ) {
+ alt227=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 227, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt227) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1918:13: k+= SENTENCE
+ k=this.match(this.input,SENTENCE,XQueryParser.FOLLOW_SENTENCE_in_p_FTBigUnit15698); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1918:27: k+= PARAGRAPH
+ k=this.match(this.input,PARAGRAPH,XQueryParser.FOLLOW_PARAGRAPH_in_p_FTBigUnit15704); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+
+
+ break;
+
+ }
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(list_k);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_FTContent_return: (function() {
+ XQueryParser.p_FTContent_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_FTContent_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1922:1: p_FTContent : ( (k+= AT k+= START ) | (k+= AT k+= END ) | (k+= ENTIRE k+= CONTENT ) ) ;
+ // $ANTLR start "p_FTContent"
+ p_FTContent: function() {
+ var retval = new XQueryParser.p_FTContent_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var list_k=null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1923:9: ( ( (k+= AT k+= START ) | (k+= AT k+= END ) | (k+= ENTIRE k+= CONTENT ) ) )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1923:11: ( (k+= AT k+= START ) | (k+= AT k+= END ) | (k+= ENTIRE k+= CONTENT ) )
+ root_0 = this.adaptor.nil();
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1923:11: ( (k+= AT k+= START ) | (k+= AT k+= END ) | (k+= ENTIRE k+= CONTENT ) )
+ var alt228=3;
+ var LA228_0 = this.input.LA(1);
+
+ if ( (LA228_0==AT) ) {
+ var LA228_1 = this.input.LA(2);
+
+ if ( (LA228_1==START) ) {
+ alt228=1;
+ }
+ else if ( (LA228_1==END) ) {
+ alt228=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 228, 1, this.input);
+
+ throw nvae;
+ }
+ }
+ else if ( (LA228_0==ENTIRE) ) {
+ alt228=3;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 228, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt228) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1923:13: (k+= AT k+= START )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1923:13: (k+= AT k+= START )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1923:14: k+= AT k+= START
+ k=this.match(this.input,AT,XQueryParser.FOLLOW_AT_in_p_FTContent15739); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ k=this.match(this.input,START,XQueryParser.FOLLOW_START_in_p_FTContent15743); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+
+
+
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1923:32: (k+= AT k+= END )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1923:32: (k+= AT k+= END )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1923:33: k+= AT k+= END
+ k=this.match(this.input,AT,XQueryParser.FOLLOW_AT_in_p_FTContent15751); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ k=this.match(this.input,END,XQueryParser.FOLLOW_END_in_p_FTContent15755); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+
+
+
+
+
+ break;
+ case 3 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1923:49: (k+= ENTIRE k+= CONTENT )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1923:49: (k+= ENTIRE k+= CONTENT )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1923:50: k+= ENTIRE k+= CONTENT
+ k=this.match(this.input,ENTIRE,XQueryParser.FOLLOW_ENTIRE_in_p_FTContent15763); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ k=this.match(this.input,CONTENT,XQueryParser.FOLLOW_CONTENT_in_p_FTContent15767); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+
+
+
+
+
+ break;
+
+ }
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(list_k);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_FTMatchOptions_return: (function() {
+ XQueryParser.p_FTMatchOptions_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_FTMatchOptions_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1927:1: p_FTMatchOptions : (ku= USING p_FTMatchOption )+ ;
+ // $ANTLR start "p_FTMatchOptions"
+ p_FTMatchOptions: function() {
+ var retval = new XQueryParser.p_FTMatchOptions_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var ku = null;
+ var p_FTMatchOption687 = null;
+
+ var ku_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1928:9: ( (ku= USING p_FTMatchOption )+ )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1928:11: (ku= USING p_FTMatchOption )+
+ root_0 = this.adaptor.nil();
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1928:11: (ku= USING p_FTMatchOption )+
+ var cnt229=0;
+ loop229:
+ do {
+ var alt229=2;
+ var LA229_0 = this.input.LA(1);
+
+ if ( (LA229_0==USING) ) {
+ alt229=1;
+ }
+
+
+ switch (alt229) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1928:12: ku= USING p_FTMatchOption
+ ku=this.match(this.input,USING,XQueryParser.FOLLOW_USING_in_p_FTMatchOptions15801); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ ku_tree = this.adaptor.create(ku);
+ this.adaptor.addChild(root_0, ku_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(ku);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_FTMatchOption_in_p_FTMatchOptions15805);
+ p_FTMatchOption687=this.p_FTMatchOption();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_FTMatchOption687.getTree());
+
+
+ break;
+
+ default :
+ if ( cnt229 >= 1 ) {
+ break loop229;
+ }
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var eee = new org.antlr.runtime.EarlyExitException(229, this.input);
+ throw eee;
+ }
+ cnt229++;
+ } while (true);
+
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_FTMatchOption_return: (function() {
+ XQueryParser.p_FTMatchOption_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_FTMatchOption_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1932:1: p_FTMatchOption : ( p_FTLanguageOption | p_FTWildCardOption | p_FTThesaurusOption | p_FTStemOption | p_FTCaseOption | p_FTDiacriticsOption | p_FTStopWordOption | p_FTExtensionOption );
+ // $ANTLR start "p_FTMatchOption"
+ p_FTMatchOption: function() {
+ var retval = new XQueryParser.p_FTMatchOption_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_FTLanguageOption688 = null;
+ var p_FTWildCardOption689 = null;
+ var p_FTThesaurusOption690 = null;
+ var p_FTStemOption691 = null;
+ var p_FTCaseOption692 = null;
+ var p_FTDiacriticsOption693 = null;
+ var p_FTStopWordOption694 = null;
+ var p_FTExtensionOption695 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1933:9: ( p_FTLanguageOption | p_FTWildCardOption | p_FTThesaurusOption | p_FTStemOption | p_FTCaseOption | p_FTDiacriticsOption | p_FTStopWordOption | p_FTExtensionOption )
+ var alt230=8;
+ alt230 = this.dfa230.predict(this.input);
+ switch (alt230) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1933:11: p_FTLanguageOption
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_FTLanguageOption_in_p_FTMatchOption15833);
+ p_FTLanguageOption688=this.p_FTLanguageOption();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_FTLanguageOption688.getTree());
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1934:11: p_FTWildCardOption
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_FTWildCardOption_in_p_FTMatchOption15845);
+ p_FTWildCardOption689=this.p_FTWildCardOption();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_FTWildCardOption689.getTree());
+
+
+ break;
+ case 3 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1935:11: p_FTThesaurusOption
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_FTThesaurusOption_in_p_FTMatchOption15857);
+ p_FTThesaurusOption690=this.p_FTThesaurusOption();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_FTThesaurusOption690.getTree());
+
+
+ break;
+ case 4 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1936:11: p_FTStemOption
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_FTStemOption_in_p_FTMatchOption15869);
+ p_FTStemOption691=this.p_FTStemOption();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_FTStemOption691.getTree());
+
+
+ break;
+ case 5 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1937:11: p_FTCaseOption
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_FTCaseOption_in_p_FTMatchOption15881);
+ p_FTCaseOption692=this.p_FTCaseOption();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_FTCaseOption692.getTree());
+
+
+ break;
+ case 6 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1938:11: p_FTDiacriticsOption
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_FTDiacriticsOption_in_p_FTMatchOption15893);
+ p_FTDiacriticsOption693=this.p_FTDiacriticsOption();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_FTDiacriticsOption693.getTree());
+
+
+ break;
+ case 7 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1939:11: p_FTStopWordOption
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_FTStopWordOption_in_p_FTMatchOption15905);
+ p_FTStopWordOption694=this.p_FTStopWordOption();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_FTStopWordOption694.getTree());
+
+
+ break;
+ case 8 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1940:11: p_FTExtensionOption
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_FTExtensionOption_in_p_FTMatchOption15917);
+ p_FTExtensionOption695=this.p_FTExtensionOption();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_FTExtensionOption695.getTree());
+
+
+ break;
+
+ }
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_FTCaseOption_return: (function() {
+ XQueryParser.p_FTCaseOption_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_FTCaseOption_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1944:1: p_FTCaseOption : ( (k+= CASE k+= INSENSITIVE ) | (k+= CASE k+= SENSITIVE ) | k+= LOWERCASE | k+= UPPERCASE ) ;
+ // $ANTLR start "p_FTCaseOption"
+ p_FTCaseOption: function() {
+ var retval = new XQueryParser.p_FTCaseOption_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var list_k=null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1945:9: ( ( (k+= CASE k+= INSENSITIVE ) | (k+= CASE k+= SENSITIVE ) | k+= LOWERCASE | k+= UPPERCASE ) )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1945:11: ( (k+= CASE k+= INSENSITIVE ) | (k+= CASE k+= SENSITIVE ) | k+= LOWERCASE | k+= UPPERCASE )
+ root_0 = this.adaptor.nil();
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1945:11: ( (k+= CASE k+= INSENSITIVE ) | (k+= CASE k+= SENSITIVE ) | k+= LOWERCASE | k+= UPPERCASE )
+ var alt231=4;
+ switch ( this.input.LA(1) ) {
+ case CASE:
+ var LA231_1 = this.input.LA(2);
+
+ if ( (LA231_1==INSENSITIVE) ) {
+ alt231=1;
+ }
+ else if ( (LA231_1==SENSITIVE) ) {
+ alt231=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 231, 1, this.input);
+
+ throw nvae;
+ }
+ break;
+ case LOWERCASE:
+ alt231=3;
+ break;
+ case UPPERCASE:
+ alt231=4;
+ break;
+ default:
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 231, 0, this.input);
+
+ throw nvae;
+ }
+
+ switch (alt231) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1945:13: (k+= CASE k+= INSENSITIVE )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1945:13: (k+= CASE k+= INSENSITIVE )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1945:14: k+= CASE k+= INSENSITIVE
+ k=this.match(this.input,CASE,XQueryParser.FOLLOW_CASE_in_p_FTCaseOption15948); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ k=this.match(this.input,INSENSITIVE,XQueryParser.FOLLOW_INSENSITIVE_in_p_FTCaseOption15952); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+
+
+
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1946:13: (k+= CASE k+= SENSITIVE )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1946:13: (k+= CASE k+= SENSITIVE )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1946:14: k+= CASE k+= SENSITIVE
+ k=this.match(this.input,CASE,XQueryParser.FOLLOW_CASE_in_p_FTCaseOption15970); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ k=this.match(this.input,SENSITIVE,XQueryParser.FOLLOW_SENSITIVE_in_p_FTCaseOption15974); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+
+
+
+
+
+ break;
+ case 3 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1947:13: k+= LOWERCASE
+ k=this.match(this.input,LOWERCASE,XQueryParser.FOLLOW_LOWERCASE_in_p_FTCaseOption15991); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+
+
+ break;
+ case 4 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1948:13: k+= UPPERCASE
+ k=this.match(this.input,UPPERCASE,XQueryParser.FOLLOW_UPPERCASE_in_p_FTCaseOption16007); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+
+
+ break;
+
+ }
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(list_k);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_FTDiacriticsOption_return: (function() {
+ XQueryParser.p_FTDiacriticsOption_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_FTDiacriticsOption_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1952:1: p_FTDiacriticsOption : ( (k+= DIACRITICS k+= INSENSITIVE ) | (k+= DIACRITICS k+= SENSITIVE ) ) ;
+ // $ANTLR start "p_FTDiacriticsOption"
+ p_FTDiacriticsOption: function() {
+ var retval = new XQueryParser.p_FTDiacriticsOption_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var list_k=null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1953:9: ( ( (k+= DIACRITICS k+= INSENSITIVE ) | (k+= DIACRITICS k+= SENSITIVE ) ) )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1953:11: ( (k+= DIACRITICS k+= INSENSITIVE ) | (k+= DIACRITICS k+= SENSITIVE ) )
+ root_0 = this.adaptor.nil();
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1953:11: ( (k+= DIACRITICS k+= INSENSITIVE ) | (k+= DIACRITICS k+= SENSITIVE ) )
+ var alt232=2;
+ var LA232_0 = this.input.LA(1);
+
+ if ( (LA232_0==DIACRITICS) ) {
+ var LA232_1 = this.input.LA(2);
+
+ if ( (LA232_1==INSENSITIVE) ) {
+ alt232=1;
+ }
+ else if ( (LA232_1==SENSITIVE) ) {
+ alt232=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 232, 1, this.input);
+
+ throw nvae;
+ }
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 232, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt232) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1953:13: (k+= DIACRITICS k+= INSENSITIVE )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1953:13: (k+= DIACRITICS k+= INSENSITIVE )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1953:14: k+= DIACRITICS k+= INSENSITIVE
+ k=this.match(this.input,DIACRITICS,XQueryParser.FOLLOW_DIACRITICS_in_p_FTDiacriticsOption16042); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ k=this.match(this.input,INSENSITIVE,XQueryParser.FOLLOW_INSENSITIVE_in_p_FTDiacriticsOption16046); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+
+
+
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1954:13: (k+= DIACRITICS k+= SENSITIVE )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1954:13: (k+= DIACRITICS k+= SENSITIVE )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1954:14: k+= DIACRITICS k+= SENSITIVE
+ k=this.match(this.input,DIACRITICS,XQueryParser.FOLLOW_DIACRITICS_in_p_FTDiacriticsOption16064); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ k=this.match(this.input,SENSITIVE,XQueryParser.FOLLOW_SENSITIVE_in_p_FTDiacriticsOption16068); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+
+
+
+
+
+ break;
+
+ }
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(list_k);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_FTStemOption_return: (function() {
+ XQueryParser.p_FTStemOption_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_FTStemOption_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1958:1: p_FTStemOption : (k+= STEMMING | (k+= NO k+= STEMMING ) ) ;
+ // $ANTLR start "p_FTStemOption"
+ p_FTStemOption: function() {
+ var retval = new XQueryParser.p_FTStemOption_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var list_k=null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1959:9: ( (k+= STEMMING | (k+= NO k+= STEMMING ) ) )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1959:11: (k+= STEMMING | (k+= NO k+= STEMMING ) )
+ root_0 = this.adaptor.nil();
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1959:11: (k+= STEMMING | (k+= NO k+= STEMMING ) )
+ var alt233=2;
+ var LA233_0 = this.input.LA(1);
+
+ if ( (LA233_0==STEMMING) ) {
+ alt233=1;
+ }
+ else if ( (LA233_0==NO) ) {
+ alt233=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 233, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt233) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1959:13: k+= STEMMING
+ k=this.match(this.input,STEMMING,XQueryParser.FOLLOW_STEMMING_in_p_FTStemOption16103); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1959:27: (k+= NO k+= STEMMING )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1959:27: (k+= NO k+= STEMMING )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1959:28: k+= NO k+= STEMMING
+ k=this.match(this.input,NO,XQueryParser.FOLLOW_NO_in_p_FTStemOption16110); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ k=this.match(this.input,STEMMING,XQueryParser.FOLLOW_STEMMING_in_p_FTStemOption16114); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+
+
+
+
+
+ break;
+
+ }
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(list_k);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_FTThesaurusOption_return: (function() {
+ XQueryParser.p_FTThesaurusOption_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_FTThesaurusOption_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1963:1: p_FTThesaurusOption : ( (k+= THESAURUS ( p_FTThesaurusID | k+= DEFAULT ) ) | (k+= THESAURUS LPAREN ( p_FTThesaurusID | k+= DEFAULT ) ( COMMA p_FTThesaurusID )* RPAREN ) | (k+= NO k+= THESAURUS ) ) ;
+ // $ANTLR start "p_FTThesaurusOption"
+ p_FTThesaurusOption: function() {
+ var retval = new XQueryParser.p_FTThesaurusOption_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var LPAREN697 = null;
+ var COMMA699 = null;
+ var RPAREN701 = null;
+ var k = null;
+ var list_k=null;
+ var p_FTThesaurusID696 = null;
+ var p_FTThesaurusID698 = null;
+ var p_FTThesaurusID700 = null;
+
+ var LPAREN697_tree=null;
+ var COMMA699_tree=null;
+ var RPAREN701_tree=null;
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1964:9: ( ( (k+= THESAURUS ( p_FTThesaurusID | k+= DEFAULT ) ) | (k+= THESAURUS LPAREN ( p_FTThesaurusID | k+= DEFAULT ) ( COMMA p_FTThesaurusID )* RPAREN ) | (k+= NO k+= THESAURUS ) ) )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1964:11: ( (k+= THESAURUS ( p_FTThesaurusID | k+= DEFAULT ) ) | (k+= THESAURUS LPAREN ( p_FTThesaurusID | k+= DEFAULT ) ( COMMA p_FTThesaurusID )* RPAREN ) | (k+= NO k+= THESAURUS ) )
+ root_0 = this.adaptor.nil();
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1964:11: ( (k+= THESAURUS ( p_FTThesaurusID | k+= DEFAULT ) ) | (k+= THESAURUS LPAREN ( p_FTThesaurusID | k+= DEFAULT ) ( COMMA p_FTThesaurusID )* RPAREN ) | (k+= NO k+= THESAURUS ) )
+ var alt237=3;
+ var LA237_0 = this.input.LA(1);
+
+ if ( (LA237_0==THESAURUS) ) {
+ var LA237_1 = this.input.LA(2);
+
+ if ( (LA237_1==LPAREN) ) {
+ alt237=2;
+ }
+ else if ( (LA237_1==AT||LA237_1==DEFAULT) ) {
+ alt237=1;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 237, 1, this.input);
+
+ throw nvae;
+ }
+ }
+ else if ( (LA237_0==NO) ) {
+ alt237=3;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 237, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt237) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1964:13: (k+= THESAURUS ( p_FTThesaurusID | k+= DEFAULT ) )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1964:13: (k+= THESAURUS ( p_FTThesaurusID | k+= DEFAULT ) )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1964:14: k+= THESAURUS ( p_FTThesaurusID | k+= DEFAULT )
+ k=this.match(this.input,THESAURUS,XQueryParser.FOLLOW_THESAURUS_in_p_FTThesaurusOption16150); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1964:27: ( p_FTThesaurusID | k+= DEFAULT )
+ var alt234=2;
+ var LA234_0 = this.input.LA(1);
+
+ if ( (LA234_0==AT) ) {
+ alt234=1;
+ }
+ else if ( (LA234_0==DEFAULT) ) {
+ alt234=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 234, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt234) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1964:28: p_FTThesaurusID
+ this.pushFollow(XQueryParser.FOLLOW_p_FTThesaurusID_in_p_FTThesaurusOption16153);
+ p_FTThesaurusID696=this.p_FTThesaurusID();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_FTThesaurusID696.getTree());
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1964:46: k+= DEFAULT
+ k=this.match(this.input,DEFAULT,XQueryParser.FOLLOW_DEFAULT_in_p_FTThesaurusOption16159); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+
+
+ break;
+
+ }
+
+
+
+
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1965:13: (k+= THESAURUS LPAREN ( p_FTThesaurusID | k+= DEFAULT ) ( COMMA p_FTThesaurusID )* RPAREN )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1965:13: (k+= THESAURUS LPAREN ( p_FTThesaurusID | k+= DEFAULT ) ( COMMA p_FTThesaurusID )* RPAREN )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1965:14: k+= THESAURUS LPAREN ( p_FTThesaurusID | k+= DEFAULT ) ( COMMA p_FTThesaurusID )* RPAREN
+ k=this.match(this.input,THESAURUS,XQueryParser.FOLLOW_THESAURUS_in_p_FTThesaurusOption16178); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ LPAREN697=this.match(this.input,LPAREN,XQueryParser.FOLLOW_LPAREN_in_p_FTThesaurusOption16180); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LPAREN697_tree = this.adaptor.create(LPAREN697);
+ this.adaptor.addChild(root_0, LPAREN697_tree);
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1965:34: ( p_FTThesaurusID | k+= DEFAULT )
+ var alt235=2;
+ var LA235_0 = this.input.LA(1);
+
+ if ( (LA235_0==AT) ) {
+ alt235=1;
+ }
+ else if ( (LA235_0==DEFAULT) ) {
+ alt235=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 235, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt235) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1965:35: p_FTThesaurusID
+ this.pushFollow(XQueryParser.FOLLOW_p_FTThesaurusID_in_p_FTThesaurusOption16183);
+ p_FTThesaurusID698=this.p_FTThesaurusID();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_FTThesaurusID698.getTree());
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1965:53: k+= DEFAULT
+ k=this.match(this.input,DEFAULT,XQueryParser.FOLLOW_DEFAULT_in_p_FTThesaurusOption16189); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+
+
+ break;
+
+ }
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1965:65: ( COMMA p_FTThesaurusID )*
+ loop236:
+ do {
+ var alt236=2;
+ var LA236_0 = this.input.LA(1);
+
+ if ( (LA236_0==COMMA) ) {
+ alt236=1;
+ }
+
+
+ switch (alt236) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1965:66: COMMA p_FTThesaurusID
+ COMMA699=this.match(this.input,COMMA,XQueryParser.FOLLOW_COMMA_in_p_FTThesaurusOption16193); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ COMMA699_tree = this.adaptor.create(COMMA699);
+ this.adaptor.addChild(root_0, COMMA699_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_FTThesaurusID_in_p_FTThesaurusOption16195);
+ p_FTThesaurusID700=this.p_FTThesaurusID();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_FTThesaurusID700.getTree());
+
+
+ break;
+
+ default :
+ break loop236;
+ }
+ } while (true);
+
+ RPAREN701=this.match(this.input,RPAREN,XQueryParser.FOLLOW_RPAREN_in_p_FTThesaurusOption16199); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RPAREN701_tree = this.adaptor.create(RPAREN701);
+ this.adaptor.addChild(root_0, RPAREN701_tree);
+ }
+
+
+
+
+
+ break;
+ case 3 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1966:13: (k+= NO k+= THESAURUS )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1966:13: (k+= NO k+= THESAURUS )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1966:14: k+= NO k+= THESAURUS
+ k=this.match(this.input,NO,XQueryParser.FOLLOW_NO_in_p_FTThesaurusOption16217); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ k=this.match(this.input,THESAURUS,XQueryParser.FOLLOW_THESAURUS_in_p_FTThesaurusOption16221); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+
+
+
+
+
+ break;
+
+ }
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(list_k);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_FTThesaurusID_return: (function() {
+ XQueryParser.p_FTThesaurusID_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_FTThesaurusID_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1970:1: p_FTThesaurusID : k+= AT p_StringLiteral (k+= RELATIONSHIP p_StringLiteral )? ( p_FTLiteralRange k+= LEVELS )? ;
+ // $ANTLR start "p_FTThesaurusID"
+ p_FTThesaurusID: function() {
+ var retval = new XQueryParser.p_FTThesaurusID_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var list_k=null;
+ var p_StringLiteral702 = null;
+ var p_StringLiteral703 = null;
+ var p_FTLiteralRange704 = null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1971:9: (k+= AT p_StringLiteral (k+= RELATIONSHIP p_StringLiteral )? ( p_FTLiteralRange k+= LEVELS )? )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1971:11: k+= AT p_StringLiteral (k+= RELATIONSHIP p_StringLiteral )? ( p_FTLiteralRange k+= LEVELS )?
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,AT,XQueryParser.FOLLOW_AT_in_p_FTThesaurusID16254); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ this.pushFollow(XQueryParser.FOLLOW_p_StringLiteral_in_p_FTThesaurusID16256);
+ p_StringLiteral702=this.p_StringLiteral();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_StringLiteral702.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1971:33: (k+= RELATIONSHIP p_StringLiteral )?
+ var alt238=2;
+ var LA238_0 = this.input.LA(1);
+
+ if ( (LA238_0==RELATIONSHIP) ) {
+ alt238=1;
+ }
+ switch (alt238) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1971:34: k+= RELATIONSHIP p_StringLiteral
+ k=this.match(this.input,RELATIONSHIP,XQueryParser.FOLLOW_RELATIONSHIP_in_p_FTThesaurusID16261); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ this.pushFollow(XQueryParser.FOLLOW_p_StringLiteral_in_p_FTThesaurusID16263);
+ p_StringLiteral703=this.p_StringLiteral();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_StringLiteral703.getTree());
+
+
+ break;
+
+ }
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1971:68: ( p_FTLiteralRange k+= LEVELS )?
+ var alt239=2;
+ var LA239_0 = this.input.LA(1);
+
+ if ( ((LA239_0>=EXACTLY && LA239_0<=FROM)) ) {
+ alt239=1;
+ }
+ else if ( (LA239_0==AT) ) {
+ var LA239_2 = this.input.LA(2);
+
+ if ( (LA239_2==LEAST||LA239_2==MOST) ) {
+ alt239=1;
+ }
+ }
+ switch (alt239) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1971:69: p_FTLiteralRange k+= LEVELS
+ this.pushFollow(XQueryParser.FOLLOW_p_FTLiteralRange_in_p_FTThesaurusID16268);
+ p_FTLiteralRange704=this.p_FTLiteralRange();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_FTLiteralRange704.getTree());
+ k=this.match(this.input,LEVELS,XQueryParser.FOLLOW_LEVELS_in_p_FTThesaurusID16272); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+
+
+ break;
+
+ }
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(list_k);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_FTLiteralRange_return: (function() {
+ XQueryParser.p_FTLiteralRange_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_FTLiteralRange_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1975:1: p_FTLiteralRange : ( (k+= EXACTLY L_IntegerLiteral ) | (k+= AT k+= LEAST L_IntegerLiteral ) | (k+= AT k+= MOST L_IntegerLiteral ) | (k+= FROM L_IntegerLiteral TO L_IntegerLiteral ) ) ;
+ // $ANTLR start "p_FTLiteralRange"
+ p_FTLiteralRange: function() {
+ var retval = new XQueryParser.p_FTLiteralRange_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var L_IntegerLiteral705 = null;
+ var L_IntegerLiteral706 = null;
+ var L_IntegerLiteral707 = null;
+ var L_IntegerLiteral708 = null;
+ var TO709 = null;
+ var L_IntegerLiteral710 = null;
+ var k = null;
+ var list_k=null;
+
+ var L_IntegerLiteral705_tree=null;
+ var L_IntegerLiteral706_tree=null;
+ var L_IntegerLiteral707_tree=null;
+ var L_IntegerLiteral708_tree=null;
+ var TO709_tree=null;
+ var L_IntegerLiteral710_tree=null;
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1976:9: ( ( (k+= EXACTLY L_IntegerLiteral ) | (k+= AT k+= LEAST L_IntegerLiteral ) | (k+= AT k+= MOST L_IntegerLiteral ) | (k+= FROM L_IntegerLiteral TO L_IntegerLiteral ) ) )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1976:11: ( (k+= EXACTLY L_IntegerLiteral ) | (k+= AT k+= LEAST L_IntegerLiteral ) | (k+= AT k+= MOST L_IntegerLiteral ) | (k+= FROM L_IntegerLiteral TO L_IntegerLiteral ) )
+ root_0 = this.adaptor.nil();
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1976:11: ( (k+= EXACTLY L_IntegerLiteral ) | (k+= AT k+= LEAST L_IntegerLiteral ) | (k+= AT k+= MOST L_IntegerLiteral ) | (k+= FROM L_IntegerLiteral TO L_IntegerLiteral ) )
+ var alt240=4;
+ switch ( this.input.LA(1) ) {
+ case EXACTLY:
+ alt240=1;
+ break;
+ case AT:
+ var LA240_2 = this.input.LA(2);
+
+ if ( (LA240_2==LEAST) ) {
+ alt240=2;
+ }
+ else if ( (LA240_2==MOST) ) {
+ alt240=3;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 240, 2, this.input);
+
+ throw nvae;
+ }
+ break;
+ case FROM:
+ alt240=4;
+ break;
+ default:
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 240, 0, this.input);
+
+ throw nvae;
+ }
+
+ switch (alt240) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1976:13: (k+= EXACTLY L_IntegerLiteral )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1976:13: (k+= EXACTLY L_IntegerLiteral )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1976:14: k+= EXACTLY L_IntegerLiteral
+ k=this.match(this.input,EXACTLY,XQueryParser.FOLLOW_EXACTLY_in_p_FTLiteralRange16307); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ L_IntegerLiteral705=this.match(this.input,L_IntegerLiteral,XQueryParser.FOLLOW_L_IntegerLiteral_in_p_FTLiteralRange16309); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ L_IntegerLiteral705_tree = this.adaptor.create(L_IntegerLiteral705);
+ this.adaptor.addChild(root_0, L_IntegerLiteral705_tree);
+ }
+
+
+
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1977:13: (k+= AT k+= LEAST L_IntegerLiteral )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1977:13: (k+= AT k+= LEAST L_IntegerLiteral )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1977:14: k+= AT k+= LEAST L_IntegerLiteral
+ k=this.match(this.input,AT,XQueryParser.FOLLOW_AT_in_p_FTLiteralRange16327); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ k=this.match(this.input,LEAST,XQueryParser.FOLLOW_LEAST_in_p_FTLiteralRange16331); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ L_IntegerLiteral706=this.match(this.input,L_IntegerLiteral,XQueryParser.FOLLOW_L_IntegerLiteral_in_p_FTLiteralRange16333); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ L_IntegerLiteral706_tree = this.adaptor.create(L_IntegerLiteral706);
+ this.adaptor.addChild(root_0, L_IntegerLiteral706_tree);
+ }
+
+
+
+
+
+ break;
+ case 3 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1978:13: (k+= AT k+= MOST L_IntegerLiteral )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1978:13: (k+= AT k+= MOST L_IntegerLiteral )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1978:14: k+= AT k+= MOST L_IntegerLiteral
+ k=this.match(this.input,AT,XQueryParser.FOLLOW_AT_in_p_FTLiteralRange16351); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ k=this.match(this.input,MOST,XQueryParser.FOLLOW_MOST_in_p_FTLiteralRange16355); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ L_IntegerLiteral707=this.match(this.input,L_IntegerLiteral,XQueryParser.FOLLOW_L_IntegerLiteral_in_p_FTLiteralRange16357); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ L_IntegerLiteral707_tree = this.adaptor.create(L_IntegerLiteral707);
+ this.adaptor.addChild(root_0, L_IntegerLiteral707_tree);
+ }
+
+
+
+
+
+ break;
+ case 4 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1979:13: (k+= FROM L_IntegerLiteral TO L_IntegerLiteral )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1979:13: (k+= FROM L_IntegerLiteral TO L_IntegerLiteral )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1979:14: k+= FROM L_IntegerLiteral TO L_IntegerLiteral
+ k=this.match(this.input,FROM,XQueryParser.FOLLOW_FROM_in_p_FTLiteralRange16375); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ L_IntegerLiteral708=this.match(this.input,L_IntegerLiteral,XQueryParser.FOLLOW_L_IntegerLiteral_in_p_FTLiteralRange16377); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ L_IntegerLiteral708_tree = this.adaptor.create(L_IntegerLiteral708);
+ this.adaptor.addChild(root_0, L_IntegerLiteral708_tree);
+ }
+ TO709=this.match(this.input,TO,XQueryParser.FOLLOW_TO_in_p_FTLiteralRange16379); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ TO709_tree = this.adaptor.create(TO709);
+ this.adaptor.addChild(root_0, TO709_tree);
+ }
+ L_IntegerLiteral710=this.match(this.input,L_IntegerLiteral,XQueryParser.FOLLOW_L_IntegerLiteral_in_p_FTLiteralRange16381); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ L_IntegerLiteral710_tree = this.adaptor.create(L_IntegerLiteral710);
+ this.adaptor.addChild(root_0, L_IntegerLiteral710_tree);
+ }
+
+
+
+
+
+ break;
+
+ }
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(list_k);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_FTStopWordOption_return: (function() {
+ XQueryParser.p_FTStopWordOption_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_FTStopWordOption_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1983:1: p_FTStopWordOption : ( (k+= STOP k+= WORDS p_FTStopWords ( p_FTStopWordsInclExcl )* ) | (k+= STOP k+= WORDS k+= DEFAULT ( p_FTStopWordsInclExcl )* ) | (k+= NO k+= STOP k+= WORDS ) ) ;
+ // $ANTLR start "p_FTStopWordOption"
+ p_FTStopWordOption: function() {
+ var retval = new XQueryParser.p_FTStopWordOption_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var list_k=null;
+ var p_FTStopWords711 = null;
+ var p_FTStopWordsInclExcl712 = null;
+ var p_FTStopWordsInclExcl713 = null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1984:9: ( ( (k+= STOP k+= WORDS p_FTStopWords ( p_FTStopWordsInclExcl )* ) | (k+= STOP k+= WORDS k+= DEFAULT ( p_FTStopWordsInclExcl )* ) | (k+= NO k+= STOP k+= WORDS ) ) )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1984:11: ( (k+= STOP k+= WORDS p_FTStopWords ( p_FTStopWordsInclExcl )* ) | (k+= STOP k+= WORDS k+= DEFAULT ( p_FTStopWordsInclExcl )* ) | (k+= NO k+= STOP k+= WORDS ) )
+ root_0 = this.adaptor.nil();
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1984:11: ( (k+= STOP k+= WORDS p_FTStopWords ( p_FTStopWordsInclExcl )* ) | (k+= STOP k+= WORDS k+= DEFAULT ( p_FTStopWordsInclExcl )* ) | (k+= NO k+= STOP k+= WORDS ) )
+ var alt243=3;
+ var LA243_0 = this.input.LA(1);
+
+ if ( (LA243_0==STOP) ) {
+ var LA243_1 = this.input.LA(2);
+
+ if ( (LA243_1==WORDS) ) {
+ var LA243_3 = this.input.LA(3);
+
+ if ( (LA243_3==DEFAULT) ) {
+ alt243=2;
+ }
+ else if ( (LA243_3==AT||LA243_3==LPAREN) ) {
+ alt243=1;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 243, 3, this.input);
+
+ throw nvae;
+ }
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 243, 1, this.input);
+
+ throw nvae;
+ }
+ }
+ else if ( (LA243_0==NO) ) {
+ alt243=3;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 243, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt243) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1984:13: (k+= STOP k+= WORDS p_FTStopWords ( p_FTStopWordsInclExcl )* )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1984:13: (k+= STOP k+= WORDS p_FTStopWords ( p_FTStopWordsInclExcl )* )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1984:14: k+= STOP k+= WORDS p_FTStopWords ( p_FTStopWordsInclExcl )*
+ k=this.match(this.input,STOP,XQueryParser.FOLLOW_STOP_in_p_FTStopWordOption16417); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ k=this.match(this.input,WORDS,XQueryParser.FOLLOW_WORDS_in_p_FTStopWordOption16421); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ this.pushFollow(XQueryParser.FOLLOW_p_FTStopWords_in_p_FTStopWordOption16423);
+ p_FTStopWords711=this.p_FTStopWords();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_FTStopWords711.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1984:45: ( p_FTStopWordsInclExcl )*
+ loop241:
+ do {
+ var alt241=2;
+ var LA241_0 = this.input.LA(1);
+
+ if ( (LA241_0==EXCEPT||LA241_0==UNION) ) {
+ alt241=1;
+ }
+
+
+ switch (alt241) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1984:45: p_FTStopWordsInclExcl
+ this.pushFollow(XQueryParser.FOLLOW_p_FTStopWordsInclExcl_in_p_FTStopWordOption16425);
+ p_FTStopWordsInclExcl712=this.p_FTStopWordsInclExcl();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_FTStopWordsInclExcl712.getTree());
+
+
+ break;
+
+ default :
+ break loop241;
+ }
+ } while (true);
+
+
+
+
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1985:13: (k+= STOP k+= WORDS k+= DEFAULT ( p_FTStopWordsInclExcl )* )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1985:13: (k+= STOP k+= WORDS k+= DEFAULT ( p_FTStopWordsInclExcl )* )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1985:14: k+= STOP k+= WORDS k+= DEFAULT ( p_FTStopWordsInclExcl )*
+ k=this.match(this.input,STOP,XQueryParser.FOLLOW_STOP_in_p_FTStopWordOption16444); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ k=this.match(this.input,WORDS,XQueryParser.FOLLOW_WORDS_in_p_FTStopWordOption16448); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ k=this.match(this.input,DEFAULT,XQueryParser.FOLLOW_DEFAULT_in_p_FTStopWordOption16452); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1985:42: ( p_FTStopWordsInclExcl )*
+ loop242:
+ do {
+ var alt242=2;
+ var LA242_0 = this.input.LA(1);
+
+ if ( (LA242_0==EXCEPT||LA242_0==UNION) ) {
+ alt242=1;
+ }
+
+
+ switch (alt242) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1985:42: p_FTStopWordsInclExcl
+ this.pushFollow(XQueryParser.FOLLOW_p_FTStopWordsInclExcl_in_p_FTStopWordOption16454);
+ p_FTStopWordsInclExcl713=this.p_FTStopWordsInclExcl();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_FTStopWordsInclExcl713.getTree());
+
+
+ break;
+
+ default :
+ break loop242;
+ }
+ } while (true);
+
+
+
+
+
+
+ break;
+ case 3 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1986:13: (k+= NO k+= STOP k+= WORDS )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1986:13: (k+= NO k+= STOP k+= WORDS )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1986:14: k+= NO k+= STOP k+= WORDS
+ k=this.match(this.input,NO,XQueryParser.FOLLOW_NO_in_p_FTStopWordOption16473); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ k=this.match(this.input,STOP,XQueryParser.FOLLOW_STOP_in_p_FTStopWordOption16477); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ k=this.match(this.input,WORDS,XQueryParser.FOLLOW_WORDS_in_p_FTStopWordOption16481); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+
+
+
+
+
+ break;
+
+ }
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(list_k);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_FTStopWords_return: (function() {
+ XQueryParser.p_FTStopWords_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_FTStopWords_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1990:1: p_FTStopWords : ( (ka= AT p_StringLiteral ) | ( LPAREN p_StringLiteral ( COMMA p_StringLiteral )* RPAREN ) );
+ // $ANTLR start "p_FTStopWords"
+ p_FTStopWords: function() {
+ var retval = new XQueryParser.p_FTStopWords_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var ka = null;
+ var LPAREN715 = null;
+ var COMMA717 = null;
+ var RPAREN719 = null;
+ var p_StringLiteral714 = null;
+ var p_StringLiteral716 = null;
+ var p_StringLiteral718 = null;
+
+ var ka_tree=null;
+ var LPAREN715_tree=null;
+ var COMMA717_tree=null;
+ var RPAREN719_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1991:9: ( (ka= AT p_StringLiteral ) | ( LPAREN p_StringLiteral ( COMMA p_StringLiteral )* RPAREN ) )
+ var alt245=2;
+ var LA245_0 = this.input.LA(1);
+
+ if ( (LA245_0==AT) ) {
+ alt245=1;
+ }
+ else if ( (LA245_0==LPAREN) ) {
+ alt245=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 245, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt245) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1991:11: (ka= AT p_StringLiteral )
+ root_0 = this.adaptor.nil();
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1991:11: (ka= AT p_StringLiteral )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1991:12: ka= AT p_StringLiteral
+ ka=this.match(this.input,AT,XQueryParser.FOLLOW_AT_in_p_FTStopWords16515); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ ka_tree = this.adaptor.create(ka);
+ this.adaptor.addChild(root_0, ka_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(ka);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_StringLiteral_in_p_FTStopWords16519);
+ p_StringLiteral714=this.p_StringLiteral();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_StringLiteral714.getTree());
+
+
+
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1992:11: ( LPAREN p_StringLiteral ( COMMA p_StringLiteral )* RPAREN )
+ root_0 = this.adaptor.nil();
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1992:11: ( LPAREN p_StringLiteral ( COMMA p_StringLiteral )* RPAREN )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1992:12: LPAREN p_StringLiteral ( COMMA p_StringLiteral )* RPAREN
+ LPAREN715=this.match(this.input,LPAREN,XQueryParser.FOLLOW_LPAREN_in_p_FTStopWords16533); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LPAREN715_tree = this.adaptor.create(LPAREN715);
+ this.adaptor.addChild(root_0, LPAREN715_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_StringLiteral_in_p_FTStopWords16535);
+ p_StringLiteral716=this.p_StringLiteral();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_StringLiteral716.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1992:35: ( COMMA p_StringLiteral )*
+ loop244:
+ do {
+ var alt244=2;
+ var LA244_0 = this.input.LA(1);
+
+ if ( (LA244_0==COMMA) ) {
+ alt244=1;
+ }
+
+
+ switch (alt244) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1992:36: COMMA p_StringLiteral
+ COMMA717=this.match(this.input,COMMA,XQueryParser.FOLLOW_COMMA_in_p_FTStopWords16538); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ COMMA717_tree = this.adaptor.create(COMMA717);
+ this.adaptor.addChild(root_0, COMMA717_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_StringLiteral_in_p_FTStopWords16540);
+ p_StringLiteral718=this.p_StringLiteral();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_StringLiteral718.getTree());
+
+
+ break;
+
+ default :
+ break loop244;
+ }
+ } while (true);
+
+ RPAREN719=this.match(this.input,RPAREN,XQueryParser.FOLLOW_RPAREN_in_p_FTStopWords16544); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RPAREN719_tree = this.adaptor.create(RPAREN719);
+ this.adaptor.addChild(root_0, RPAREN719_tree);
+ }
+
+
+
+
+
+ break;
+
+ }
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_FTStopWordsInclExcl_return: (function() {
+ XQueryParser.p_FTStopWordsInclExcl_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_FTStopWordsInclExcl_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1996:1: p_FTStopWordsInclExcl : ( (k+= UNION | k+= EXCEPT ) p_FTStopWords ) ;
+ // $ANTLR start "p_FTStopWordsInclExcl"
+ p_FTStopWordsInclExcl: function() {
+ var retval = new XQueryParser.p_FTStopWordsInclExcl_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var list_k=null;
+ var p_FTStopWords720 = null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1997:9: ( ( (k+= UNION | k+= EXCEPT ) p_FTStopWords ) )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1997:11: ( (k+= UNION | k+= EXCEPT ) p_FTStopWords )
+ root_0 = this.adaptor.nil();
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1997:11: ( (k+= UNION | k+= EXCEPT ) p_FTStopWords )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1997:13: (k+= UNION | k+= EXCEPT ) p_FTStopWords
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1997:13: (k+= UNION | k+= EXCEPT )
+ var alt246=2;
+ var LA246_0 = this.input.LA(1);
+
+ if ( (LA246_0==UNION) ) {
+ alt246=1;
+ }
+ else if ( (LA246_0==EXCEPT) ) {
+ alt246=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 246, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt246) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1997:14: k+= UNION
+ k=this.match(this.input,UNION,XQueryParser.FOLLOW_UNION_in_p_FTStopWordsInclExcl16576); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1997:25: k+= EXCEPT
+ k=this.match(this.input,EXCEPT,XQueryParser.FOLLOW_EXCEPT_in_p_FTStopWordsInclExcl16582); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+
+
+ break;
+
+ }
+
+ this.pushFollow(XQueryParser.FOLLOW_p_FTStopWords_in_p_FTStopWordsInclExcl16585);
+ p_FTStopWords720=this.p_FTStopWords();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_FTStopWords720.getTree());
+
+
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(list_k);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_FTLanguageOption_return: (function() {
+ XQueryParser.p_FTLanguageOption_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_FTLanguageOption_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2001:1: p_FTLanguageOption : kl= LANGUAGE p_StringLiteral ;
+ // $ANTLR start "p_FTLanguageOption"
+ p_FTLanguageOption: function() {
+ var retval = new XQueryParser.p_FTLanguageOption_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var kl = null;
+ var p_StringLiteral721 = null;
+
+ var kl_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2002:9: (kl= LANGUAGE p_StringLiteral )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2002:11: kl= LANGUAGE p_StringLiteral
+ root_0 = this.adaptor.nil();
+
+ kl=this.match(this.input,LANGUAGE,XQueryParser.FOLLOW_LANGUAGE_in_p_FTLanguageOption16617); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ kl_tree = this.adaptor.create(kl);
+ this.adaptor.addChild(root_0, kl_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(kl);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_StringLiteral_in_p_FTLanguageOption16621);
+ p_StringLiteral721=this.p_StringLiteral();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_StringLiteral721.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_FTWildCardOption_return: (function() {
+ XQueryParser.p_FTWildCardOption_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_FTWildCardOption_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2006:1: p_FTWildCardOption : (k+= WILDCARDS | (k+= NO k+= WILDCARDS ) ) ;
+ // $ANTLR start "p_FTWildCardOption"
+ p_FTWildCardOption: function() {
+ var retval = new XQueryParser.p_FTWildCardOption_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var list_k=null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2007:9: ( (k+= WILDCARDS | (k+= NO k+= WILDCARDS ) ) )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2007:11: (k+= WILDCARDS | (k+= NO k+= WILDCARDS ) )
+ root_0 = this.adaptor.nil();
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2007:11: (k+= WILDCARDS | (k+= NO k+= WILDCARDS ) )
+ var alt247=2;
+ var LA247_0 = this.input.LA(1);
+
+ if ( (LA247_0==WILDCARDS) ) {
+ alt247=1;
+ }
+ else if ( (LA247_0==NO) ) {
+ alt247=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 247, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt247) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2007:13: k+= WILDCARDS
+ k=this.match(this.input,WILDCARDS,XQueryParser.FOLLOW_WILDCARDS_in_p_FTWildCardOption16651); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2007:28: (k+= NO k+= WILDCARDS )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2007:28: (k+= NO k+= WILDCARDS )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2007:29: k+= NO k+= WILDCARDS
+ k=this.match(this.input,NO,XQueryParser.FOLLOW_NO_in_p_FTWildCardOption16658); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ k=this.match(this.input,WILDCARDS,XQueryParser.FOLLOW_WILDCARDS_in_p_FTWildCardOption16662); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+
+
+
+
+
+ break;
+
+ }
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(list_k);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_FTExtensionOption_return: (function() {
+ XQueryParser.p_FTExtensionOption_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_FTExtensionOption_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2011:1: p_FTExtensionOption : ko= OPTION p_QName p_StringLiteral ;
+ // $ANTLR start "p_FTExtensionOption"
+ p_FTExtensionOption: function() {
+ var retval = new XQueryParser.p_FTExtensionOption_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var ko = null;
+ var p_QName722 = null;
+ var p_StringLiteral723 = null;
+
+ var ko_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2012:9: (ko= OPTION p_QName p_StringLiteral )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2012:11: ko= OPTION p_QName p_StringLiteral
+ root_0 = this.adaptor.nil();
+
+ ko=this.match(this.input,OPTION,XQueryParser.FOLLOW_OPTION_in_p_FTExtensionOption16695); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ ko_tree = this.adaptor.create(ko);
+ this.adaptor.addChild(root_0, ko_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(ko);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_QName_in_p_FTExtensionOption16699);
+ p_QName722=this.p_QName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_QName722.getTree());
+ this.pushFollow(XQueryParser.FOLLOW_p_StringLiteral_in_p_FTExtensionOption16701);
+ p_StringLiteral723=this.p_StringLiteral();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_StringLiteral723.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_FTIgnoreOption_return: (function() {
+ XQueryParser.p_FTIgnoreOption_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_FTIgnoreOption_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2016:1: p_FTIgnoreOption : k+= WITHOUT k+= CONTENT p_UnionExpr ;
+ // $ANTLR start "p_FTIgnoreOption"
+ p_FTIgnoreOption: function() {
+ var retval = new XQueryParser.p_FTIgnoreOption_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var list_k=null;
+ var p_UnionExpr724 = null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2017:9: (k+= WITHOUT k+= CONTENT p_UnionExpr )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2017:11: k+= WITHOUT k+= CONTENT p_UnionExpr
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,WITHOUT,XQueryParser.FOLLOW_WITHOUT_in_p_FTIgnoreOption16729); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ k=this.match(this.input,CONTENT,XQueryParser.FOLLOW_CONTENT_in_p_FTIgnoreOption16733); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if (org.antlr.lang.isNull(list_k)) list_k = [];
+ list_k.push(k);
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(list_k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_UnionExpr_in_p_FTIgnoreOption16737);
+ p_UnionExpr724=this.p_UnionExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_UnionExpr724.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_Program_return: (function() {
+ XQueryParser.p_Program_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_Program_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2027:1: p_Program : p_StatementsAndOptionalExpr ;
+ // $ANTLR start "p_Program"
+ p_Program: function() {
+ var retval = new XQueryParser.p_Program_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_StatementsAndOptionalExpr725 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2028:9: ( p_StatementsAndOptionalExpr )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2028:11: p_StatementsAndOptionalExpr
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_StatementsAndOptionalExpr_in_p_Program16769);
+ p_StatementsAndOptionalExpr725=this.p_StatementsAndOptionalExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_StatementsAndOptionalExpr725.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_Statements_return: (function() {
+ XQueryParser.p_Statements_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_Statements_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2032:1: p_Statements[strict] : ( p_Hybrid[$strict,true] )* ;
+ // $ANTLR start "p_Statements"
+ p_Statements: function(strict) {
+ var retval = new XQueryParser.p_Statements_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_Hybrid726 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2033:9: ( ( p_Hybrid[$strict,true] )* )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2033:11: ( p_Hybrid[$strict,true] )*
+ root_0 = this.adaptor.nil();
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2033:11: ( p_Hybrid[$strict,true] )*
+ loop248:
+ do {
+ var alt248=2;
+ var LA248_0 = this.input.LA(1);
+
+ if ( ((LA248_0>=ANCESTOR && LA248_0<=QUOT_ER)||LA248_0==LPAREN||(LA248_0>=DOLLAR && LA248_0<=L_UNION_BRACKET)||LA248_0==LBRACKET||LA248_0==LSQUARE||LA248_0==ANN_PERCENT||(LA248_0>=STAR && LA248_0<=SMALLER)||(LA248_0>=SLASH && LA248_0<=SLASH_SLASH)||(LA248_0>=DOT && LA248_0<=DOT_DOT)||(LA248_0>=ATTR_SIGN && LA248_0<=Q)||(LA248_0>=APOS && LA248_0<=QUOT)||LA248_0==L_NCName||(LA248_0>=L_Pragma && LA248_0<=L_DoubleLiteral)) ) {
+ alt248=1;
+ }
+
+
+ switch (alt248) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2033:11: p_Hybrid[$strict,true]
+ this.pushFollow(XQueryParser.FOLLOW_p_Hybrid_in_p_Statements16796);
+ p_Hybrid726=this.p_Hybrid(strict, true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Hybrid726.getTree());
+
+
+ break;
+
+ default :
+ break loop248;
+ }
+ } while (true);
+
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_StatementsAndExpr_return: (function() {
+ XQueryParser.p_StatementsAndExpr_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_StatementsAndExpr_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2037:1: p_StatementsAndExpr : p_Statements[false] ;
+ // $ANTLR start "p_StatementsAndExpr"
+ p_StatementsAndExpr: function() {
+ var retval = new XQueryParser.p_StatementsAndExpr_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_Statements727 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2038:9: ( p_Statements[false] )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2038:11: p_Statements[false]
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_Statements_in_p_StatementsAndExpr16824);
+ p_Statements727=this.p_Statements(false);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Statements727.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_StatementsAndOptionalExpr_return: (function() {
+ XQueryParser.p_StatementsAndOptionalExpr_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_StatementsAndOptionalExpr_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2042:1: p_StatementsAndOptionalExpr : p_Statements[false] ;
+ // $ANTLR start "p_StatementsAndOptionalExpr"
+ p_StatementsAndOptionalExpr: function() {
+ var retval = new XQueryParser.p_StatementsAndOptionalExpr_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_Statements728 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2043:9: ( p_Statements[false] )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2043:11: p_Statements[false]
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_Statements_in_p_StatementsAndOptionalExpr16851);
+ p_Statements728=this.p_Statements(false);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Statements728.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_Hybrid_return: (function() {
+ XQueryParser.p_Hybrid_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_Hybrid_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2046:1: p_Hybrid[strict, allowConcat] : ( p_HybridExprSingle[$strict,$allowConcat] | p_Statement );
+ // $ANTLR start "p_Hybrid"
+ p_Hybrid: function(strict, allowConcat) {
+ var retval = new XQueryParser.p_Hybrid_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_HybridExprSingle729 = null;
+ var p_Statement730 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2047:9: ( p_HybridExprSingle[$strict,$allowConcat] | p_Statement )
+ var alt249=2;
+ alt249 = this.dfa249.predict(this.input);
+ switch (alt249) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2047:11: p_HybridExprSingle[$strict,$allowConcat]
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_HybridExprSingle_in_p_Hybrid16878);
+ p_HybridExprSingle729=this.p_HybridExprSingle(strict, allowConcat);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_HybridExprSingle729.getTree());
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2048:11: p_Statement
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_Statement_in_p_Hybrid16891);
+ p_Statement730=this.p_Statement();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Statement730.getTree());
+
+
+ break;
+
+ }
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+
+ if(re instanceof org.antlr.runtime.RecognitionException) {
+ //console.log("catch3");
+ var v = this.p_StepExpr();
+ root_0 = this.adaptor.nil();
+ this.adaptor.addChild(root_0, v.getTree());
+ retval.stop = this.input.LT(-1);
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ } else {
+ throw re;
+ }
+
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_Statement_return: (function() {
+ XQueryParser.p_Statement_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_Statement_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2064:1: p_Statement : ( p_AssignStatement | p_BreakStatement | p_ContinueStatement | p_ExitStatement | p_VarDeclStatement | p_WhileStatement );
+ // $ANTLR start "p_Statement"
+ p_Statement: function() {
+ var retval = new XQueryParser.p_Statement_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_AssignStatement731 = null;
+ var p_BreakStatement732 = null;
+ var p_ContinueStatement733 = null;
+ var p_ExitStatement734 = null;
+ var p_VarDeclStatement735 = null;
+ var p_WhileStatement736 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2065:9: ( p_AssignStatement | p_BreakStatement | p_ContinueStatement | p_ExitStatement | p_VarDeclStatement | p_WhileStatement )
+ var alt250=6;
+ switch ( this.input.LA(1) ) {
+ case DOLLAR:
+ alt250=1;
+ break;
+ case BREAK:
+ alt250=2;
+ break;
+ case CONTINUE:
+ alt250=3;
+ break;
+ case EXIT:
+ alt250=4;
+ break;
+ case VARIABLE:
+ case ANN_PERCENT:
+ alt250=5;
+ break;
+ case WHILE:
+ alt250=6;
+ break;
+ default:
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 250, 0, this.input);
+
+ throw nvae;
+ }
+
+ switch (alt250) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2065:11: p_AssignStatement
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_AssignStatement_in_p_Statement16922);
+ p_AssignStatement731=this.p_AssignStatement();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_AssignStatement731.getTree());
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2066:11: p_BreakStatement
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_BreakStatement_in_p_Statement16934);
+ p_BreakStatement732=this.p_BreakStatement();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_BreakStatement732.getTree());
+
+
+ break;
+ case 3 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2067:11: p_ContinueStatement
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_ContinueStatement_in_p_Statement16946);
+ p_ContinueStatement733=this.p_ContinueStatement();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ContinueStatement733.getTree());
+
+
+ break;
+ case 4 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2068:11: p_ExitStatement
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_ExitStatement_in_p_Statement16958);
+ p_ExitStatement734=this.p_ExitStatement();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ExitStatement734.getTree());
+
+
+ break;
+ case 5 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2069:11: p_VarDeclStatement
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_VarDeclStatement_in_p_Statement16970);
+ p_VarDeclStatement735=this.p_VarDeclStatement();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_VarDeclStatement735.getTree());
+
+
+ break;
+ case 6 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2070:11: p_WhileStatement
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_WhileStatement_in_p_Statement16982);
+ p_WhileStatement736=this.p_WhileStatement();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_WhileStatement736.getTree());
+
+
+ break;
+
+ }
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_HybridExprSingle_return: (function() {
+ XQueryParser.p_HybridExprSingle_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_HybridExprSingle_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2072:1: p_HybridExprSingle[strict, allowConcat] : e= p_Expr[$strict,$allowConcat] SEMICOLON ;
+ // $ANTLR start "p_HybridExprSingle"
+ p_HybridExprSingle: function(strict, allowConcat) {
+ var retval = new XQueryParser.p_HybridExprSingle_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var SEMICOLON737 = null;
+ var e = null;
+
+ var SEMICOLON737_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2073:9: (e= p_Expr[$strict,$allowConcat] SEMICOLON )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2073:11: e= p_Expr[$strict,$allowConcat] SEMICOLON
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_Expr_in_p_HybridExprSingle17009);
+ e=this.p_Expr(strict, allowConcat);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, e.getTree());
+ if ( this.state.backtracking===0 ) {
+ if (strict || this.input.LT(1).getType() != SEMICOLON) throw new org.antlr.runtime.RecognitionException(this.input);
+ }
+ SEMICOLON737=this.match(this.input,SEMICOLON,XQueryParser.FOLLOW_SEMICOLON_in_p_HybridExprSingle17024); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ SEMICOLON737_tree = this.adaptor.create(SEMICOLON737);
+ this.adaptor.addChild(root_0, SEMICOLON737_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+
+ if(re instanceof org.antlr.runtime.RecognitionException) {
+ //console.log("catch4");
+ if(this.input.LT(1).getType() == COLON) {
+ var v = this.p_PairConstructor();
+ root_0 = this.adaptor.nil();
+ this.adaptor.addChild(root_0, v.getTree());
+ retval.stop = this.input.LT(-1);
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ } else {
+ root_0 = this.adaptor.nil();
+ this.adaptor.addChild(root_0, e.getTree());
+ retval.stop = this.input.LT(-1);
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ } else {
+ throw re;
+ }
+
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_ApplyStatement_return: (function() {
+ XQueryParser.p_ApplyStatement_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_ApplyStatement_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2117:1: p_ApplyStatement : p_ExprSimple SEMICOLON ;
+ // $ANTLR start "p_ApplyStatement"
+ p_ApplyStatement: function() {
+ var retval = new XQueryParser.p_ApplyStatement_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var SEMICOLON739 = null;
+ var p_ExprSimple738 = null;
+
+ var SEMICOLON739_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2118:9: ( p_ExprSimple SEMICOLON )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2118:11: p_ExprSimple SEMICOLON
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_ExprSimple_in_p_ApplyStatement17074);
+ p_ExprSimple738=this.p_ExprSimple();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ExprSimple738.getTree());
+ SEMICOLON739=this.match(this.input,SEMICOLON,XQueryParser.FOLLOW_SEMICOLON_in_p_ApplyStatement17076); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ SEMICOLON739_tree = this.adaptor.create(SEMICOLON739);
+ this.adaptor.addChild(root_0, SEMICOLON739_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_AssignStatement_return: (function() {
+ XQueryParser.p_AssignStatement_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_AssignStatement_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2122:1: p_AssignStatement : d= DOLLAR v= p_VarName BIND p_ExprSingle[true] SEMICOLON ;
+ // $ANTLR start "p_AssignStatement"
+ p_AssignStatement: function() {
+ var retval = new XQueryParser.p_AssignStatement_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var d = null;
+ var BIND740 = null;
+ var SEMICOLON742 = null;
+ var v = null;
+ var p_ExprSingle741 = null;
+
+ var d_tree=null;
+ var BIND740_tree=null;
+ var SEMICOLON742_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2123:9: (d= DOLLAR v= p_VarName BIND p_ExprSingle[true] SEMICOLON )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2123:11: d= DOLLAR v= p_VarName BIND p_ExprSingle[true] SEMICOLON
+ root_0 = this.adaptor.nil();
+
+ d=this.match(this.input,DOLLAR,XQueryParser.FOLLOW_DOLLAR_in_p_AssignStatement17104); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ d_tree = this.adaptor.create(d);
+ this.adaptor.addChild(root_0, d_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_VarName_in_p_AssignStatement17108);
+ v=this.p_VarName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, v.getTree());
+ if ( this.state.backtracking===0 ) {
+ this.av(d, (v?v.stop:null));
+ }
+ BIND740=this.match(this.input,BIND,XQueryParser.FOLLOW_BIND_in_p_AssignStatement17112); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ BIND740_tree = this.adaptor.create(BIND740);
+ this.adaptor.addChild(root_0, BIND740_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_ExprSingle_in_p_AssignStatement17114);
+ p_ExprSingle741=this.p_ExprSingle(true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ExprSingle741.getTree());
+ SEMICOLON742=this.match(this.input,SEMICOLON,XQueryParser.FOLLOW_SEMICOLON_in_p_AssignStatement17117); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ SEMICOLON742_tree = this.adaptor.create(SEMICOLON742);
+ this.adaptor.addChild(root_0, SEMICOLON742_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_BlockStatement_return: (function() {
+ XQueryParser.p_BlockStatement_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_BlockStatement_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2127:1: p_BlockStatement : LBRACKET p_Statements[false] RBRACKET ;
+ // $ANTLR start "p_BlockStatement"
+ p_BlockStatement: function() {
+ var retval = new XQueryParser.p_BlockStatement_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var LBRACKET743 = null;
+ var RBRACKET745 = null;
+ var p_Statements744 = null;
+
+ var LBRACKET743_tree=null;
+ var RBRACKET745_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2128:9: ( LBRACKET p_Statements[false] RBRACKET )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2128:11: LBRACKET p_Statements[false] RBRACKET
+ root_0 = this.adaptor.nil();
+
+ LBRACKET743=this.match(this.input,LBRACKET,XQueryParser.FOLLOW_LBRACKET_in_p_BlockStatement17143); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LBRACKET743_tree = this.adaptor.create(LBRACKET743);
+ this.adaptor.addChild(root_0, LBRACKET743_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_Statements_in_p_BlockStatement17145);
+ p_Statements744=this.p_Statements(false);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Statements744.getTree());
+ RBRACKET745=this.match(this.input,RBRACKET,XQueryParser.FOLLOW_RBRACKET_in_p_BlockStatement17148); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RBRACKET745_tree = this.adaptor.create(RBRACKET745);
+ this.adaptor.addChild(root_0, RBRACKET745_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_BlockHybrid_return: (function() {
+ XQueryParser.p_BlockHybrid_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_BlockHybrid_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2131:1: p_BlockHybrid[strict] : LBRACKET p_Statements[$strict] RBRACKET ;
+ // $ANTLR start "p_BlockHybrid"
+ p_BlockHybrid: function(strict) {
+ var retval = new XQueryParser.p_BlockHybrid_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var LBRACKET746 = null;
+ var RBRACKET748 = null;
+ var p_Statements747 = null;
+
+ var LBRACKET746_tree=null;
+ var RBRACKET748_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2132:9: ( LBRACKET p_Statements[$strict] RBRACKET )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2132:11: LBRACKET p_Statements[$strict] RBRACKET
+ root_0 = this.adaptor.nil();
+
+ LBRACKET746=this.match(this.input,LBRACKET,XQueryParser.FOLLOW_LBRACKET_in_p_BlockHybrid17174); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LBRACKET746_tree = this.adaptor.create(LBRACKET746);
+ this.adaptor.addChild(root_0, LBRACKET746_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_Statements_in_p_BlockHybrid17176);
+ p_Statements747=this.p_Statements(strict);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Statements747.getTree());
+ RBRACKET748=this.match(this.input,RBRACKET,XQueryParser.FOLLOW_RBRACKET_in_p_BlockHybrid17179); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RBRACKET748_tree = this.adaptor.create(RBRACKET748);
+ this.adaptor.addChild(root_0, RBRACKET748_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_BreakStatement_return: (function() {
+ XQueryParser.p_BreakStatement_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_BreakStatement_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2136:1: p_BreakStatement : k= BREAK k= LOOP SEMICOLON ;
+ // $ANTLR start "p_BreakStatement"
+ p_BreakStatement: function() {
+ var retval = new XQueryParser.p_BreakStatement_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var SEMICOLON749 = null;
+
+ var k_tree=null;
+ var SEMICOLON749_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2137:9: (k= BREAK k= LOOP SEMICOLON )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2137:11: k= BREAK k= LOOP SEMICOLON
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,BREAK,XQueryParser.FOLLOW_BREAK_in_p_BreakStatement17207); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ k=this.match(this.input,LOOP,XQueryParser.FOLLOW_LOOP_in_p_BreakStatement17213); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ SEMICOLON749=this.match(this.input,SEMICOLON,XQueryParser.FOLLOW_SEMICOLON_in_p_BreakStatement17217); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ SEMICOLON749_tree = this.adaptor.create(SEMICOLON749);
+ this.adaptor.addChild(root_0, SEMICOLON749_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_ContinueStatement_return: (function() {
+ XQueryParser.p_ContinueStatement_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_ContinueStatement_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2141:1: p_ContinueStatement : k= CONTINUE k= LOOP SEMICOLON ;
+ // $ANTLR start "p_ContinueStatement"
+ p_ContinueStatement: function() {
+ var retval = new XQueryParser.p_ContinueStatement_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var SEMICOLON750 = null;
+
+ var k_tree=null;
+ var SEMICOLON750_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2142:9: (k= CONTINUE k= LOOP SEMICOLON )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2142:11: k= CONTINUE k= LOOP SEMICOLON
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,CONTINUE,XQueryParser.FOLLOW_CONTINUE_in_p_ContinueStatement17245); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ k=this.match(this.input,LOOP,XQueryParser.FOLLOW_LOOP_in_p_ContinueStatement17251); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ SEMICOLON750=this.match(this.input,SEMICOLON,XQueryParser.FOLLOW_SEMICOLON_in_p_ContinueStatement17255); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ SEMICOLON750_tree = this.adaptor.create(SEMICOLON750);
+ this.adaptor.addChild(root_0, SEMICOLON750_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_ExitStatement_return: (function() {
+ XQueryParser.p_ExitStatement_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_ExitStatement_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2146:1: p_ExitStatement : k= EXIT k= RETURNING p_ExprSingle[true] SEMICOLON ;
+ // $ANTLR start "p_ExitStatement"
+ p_ExitStatement: function() {
+ var retval = new XQueryParser.p_ExitStatement_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var SEMICOLON752 = null;
+ var p_ExprSingle751 = null;
+
+ var k_tree=null;
+ var SEMICOLON752_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2147:9: (k= EXIT k= RETURNING p_ExprSingle[true] SEMICOLON )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2147:11: k= EXIT k= RETURNING p_ExprSingle[true] SEMICOLON
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,EXIT,XQueryParser.FOLLOW_EXIT_in_p_ExitStatement17283); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ k=this.match(this.input,RETURNING,XQueryParser.FOLLOW_RETURNING_in_p_ExitStatement17289); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_ExprSingle_in_p_ExitStatement17293);
+ p_ExprSingle751=this.p_ExprSingle(true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ExprSingle751.getTree());
+ SEMICOLON752=this.match(this.input,SEMICOLON,XQueryParser.FOLLOW_SEMICOLON_in_p_ExitStatement17296); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ SEMICOLON752_tree = this.adaptor.create(SEMICOLON752);
+ this.adaptor.addChild(root_0, SEMICOLON752_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_FLWORStatement_return: (function() {
+ XQueryParser.p_FLWORStatement_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_FLWORStatement_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2151:1: p_FLWORStatement : p_InitialClause ( p_IntermediateClause )* p_ReturnStatement ;
+ // $ANTLR start "p_FLWORStatement"
+ p_FLWORStatement: function() {
+ var retval = new XQueryParser.p_FLWORStatement_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_InitialClause753 = null;
+ var p_IntermediateClause754 = null;
+ var p_ReturnStatement755 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2152:9: ( p_InitialClause ( p_IntermediateClause )* p_ReturnStatement )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2152:11: p_InitialClause ( p_IntermediateClause )* p_ReturnStatement
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_InitialClause_in_p_FLWORStatement17322);
+ p_InitialClause753=this.p_InitialClause();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_InitialClause753.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2152:27: ( p_IntermediateClause )*
+ loop251:
+ do {
+ var alt251=2;
+ var LA251_0 = this.input.LA(1);
+
+ if ( (LA251_0==FOR||LA251_0==LET||LA251_0==ORDER||LA251_0==STABLE||LA251_0==WHERE||LA251_0==COUNT||LA251_0==GROUP) ) {
+ alt251=1;
+ }
+
+
+ switch (alt251) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2152:27: p_IntermediateClause
+ this.pushFollow(XQueryParser.FOLLOW_p_IntermediateClause_in_p_FLWORStatement17324);
+ p_IntermediateClause754=this.p_IntermediateClause();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_IntermediateClause754.getTree());
+
+
+ break;
+
+ default :
+ break loop251;
+ }
+ } while (true);
+
+ this.pushFollow(XQueryParser.FOLLOW_p_ReturnStatement_in_p_FLWORStatement17327);
+ p_ReturnStatement755=this.p_ReturnStatement();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ReturnStatement755.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_ReturnStatement_return: (function() {
+ XQueryParser.p_ReturnStatement_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_ReturnStatement_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2156:1: p_ReturnStatement : k= RETURN p_Hybrid[false,false] ;
+ // $ANTLR start "p_ReturnStatement"
+ p_ReturnStatement: function() {
+ var retval = new XQueryParser.p_ReturnStatement_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var p_Hybrid756 = null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2157:9: (k= RETURN p_Hybrid[false,false] )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2157:11: k= RETURN p_Hybrid[false,false]
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,RETURN,XQueryParser.FOLLOW_RETURN_in_p_ReturnStatement17359); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_Hybrid_in_p_ReturnStatement17363);
+ p_Hybrid756=this.p_Hybrid(false, false);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Hybrid756.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_IfStatement_return: (function() {
+ XQueryParser.p_IfStatement_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_IfStatement_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2161:1: p_IfStatement : k= IF LPAREN p_Expr[true,true] RPAREN k= THEN p_Hybrid[false,false] k= ELSE p_Hybrid[false,false] ;
+ // $ANTLR start "p_IfStatement"
+ p_IfStatement: function() {
+ var retval = new XQueryParser.p_IfStatement_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var LPAREN757 = null;
+ var RPAREN759 = null;
+ var p_Expr758 = null;
+ var p_Hybrid760 = null;
+ var p_Hybrid761 = null;
+
+ var k_tree=null;
+ var LPAREN757_tree=null;
+ var RPAREN759_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2162:9: (k= IF LPAREN p_Expr[true,true] RPAREN k= THEN p_Hybrid[false,false] k= ELSE p_Hybrid[false,false] )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2162:11: k= IF LPAREN p_Expr[true,true] RPAREN k= THEN p_Hybrid[false,false] k= ELSE p_Hybrid[false,false]
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,IF,XQueryParser.FOLLOW_IF_in_p_IfStatement17392); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ LPAREN757=this.match(this.input,LPAREN,XQueryParser.FOLLOW_LPAREN_in_p_IfStatement17396); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LPAREN757_tree = this.adaptor.create(LPAREN757);
+ this.adaptor.addChild(root_0, LPAREN757_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_Expr_in_p_IfStatement17398);
+ p_Expr758=this.p_Expr(true, true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Expr758.getTree());
+ RPAREN759=this.match(this.input,RPAREN,XQueryParser.FOLLOW_RPAREN_in_p_IfStatement17401); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RPAREN759_tree = this.adaptor.create(RPAREN759);
+ this.adaptor.addChild(root_0, RPAREN759_tree);
+ }
+ k=this.match(this.input,THEN,XQueryParser.FOLLOW_THEN_in_p_IfStatement17405); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_Hybrid_in_p_IfStatement17409);
+ p_Hybrid760=this.p_Hybrid(false, false);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Hybrid760.getTree());
+ k=this.match(this.input,ELSE,XQueryParser.FOLLOW_ELSE_in_p_IfStatement17414); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_Hybrid_in_p_IfStatement17418);
+ p_Hybrid761=this.p_Hybrid(false, false);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Hybrid761.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_SwitchStatement_return: (function() {
+ XQueryParser.p_SwitchStatement_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_SwitchStatement_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2166:1: p_SwitchStatement : k= SWITCH LPAREN p_Expr[true,true] RPAREN ( p_SwitchCaseStatement )+ k= DEFAULT k= RETURN p_Hybrid[false,false] ;
+ // $ANTLR start "p_SwitchStatement"
+ p_SwitchStatement: function() {
+ var retval = new XQueryParser.p_SwitchStatement_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var LPAREN762 = null;
+ var RPAREN764 = null;
+ var p_Expr763 = null;
+ var p_SwitchCaseStatement765 = null;
+ var p_Hybrid766 = null;
+
+ var k_tree=null;
+ var LPAREN762_tree=null;
+ var RPAREN764_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2167:9: (k= SWITCH LPAREN p_Expr[true,true] RPAREN ( p_SwitchCaseStatement )+ k= DEFAULT k= RETURN p_Hybrid[false,false] )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2167:11: k= SWITCH LPAREN p_Expr[true,true] RPAREN ( p_SwitchCaseStatement )+ k= DEFAULT k= RETURN p_Hybrid[false,false]
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,SWITCH,XQueryParser.FOLLOW_SWITCH_in_p_SwitchStatement17447); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ LPAREN762=this.match(this.input,LPAREN,XQueryParser.FOLLOW_LPAREN_in_p_SwitchStatement17451); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LPAREN762_tree = this.adaptor.create(LPAREN762);
+ this.adaptor.addChild(root_0, LPAREN762_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_Expr_in_p_SwitchStatement17453);
+ p_Expr763=this.p_Expr(true, true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Expr763.getTree());
+ RPAREN764=this.match(this.input,RPAREN,XQueryParser.FOLLOW_RPAREN_in_p_SwitchStatement17456); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RPAREN764_tree = this.adaptor.create(RPAREN764);
+ this.adaptor.addChild(root_0, RPAREN764_tree);
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2167:67: ( p_SwitchCaseStatement )+
+ var cnt252=0;
+ loop252:
+ do {
+ var alt252=2;
+ var LA252_0 = this.input.LA(1);
+
+ if ( (LA252_0==CASE) ) {
+ alt252=1;
+ }
+
+
+ switch (alt252) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2167:67: p_SwitchCaseStatement
+ this.pushFollow(XQueryParser.FOLLOW_p_SwitchCaseStatement_in_p_SwitchStatement17458);
+ p_SwitchCaseStatement765=this.p_SwitchCaseStatement();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_SwitchCaseStatement765.getTree());
+
+
+ break;
+
+ default :
+ if ( cnt252 >= 1 ) {
+ break loop252;
+ }
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var eee = new org.antlr.runtime.EarlyExitException(252, this.input);
+ throw eee;
+ }
+ cnt252++;
+ } while (true);
+
+ k=this.match(this.input,DEFAULT,XQueryParser.FOLLOW_DEFAULT_in_p_SwitchStatement17463); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ k=this.match(this.input,RETURN,XQueryParser.FOLLOW_RETURN_in_p_SwitchStatement17469); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_Hybrid_in_p_SwitchStatement17473);
+ p_Hybrid766=this.p_Hybrid(false, false);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Hybrid766.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_SwitchCaseStatement_return: (function() {
+ XQueryParser.p_SwitchCaseStatement_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_SwitchCaseStatement_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2171:1: p_SwitchCaseStatement : (k= CASE p_SwitchCaseOperand )+ k= RETURN p_Hybrid[false,false] ;
+ // $ANTLR start "p_SwitchCaseStatement"
+ p_SwitchCaseStatement: function() {
+ var retval = new XQueryParser.p_SwitchCaseStatement_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var p_SwitchCaseOperand767 = null;
+ var p_Hybrid768 = null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2172:9: ( (k= CASE p_SwitchCaseOperand )+ k= RETURN p_Hybrid[false,false] )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2172:11: (k= CASE p_SwitchCaseOperand )+ k= RETURN p_Hybrid[false,false]
+ root_0 = this.adaptor.nil();
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2172:11: (k= CASE p_SwitchCaseOperand )+
+ var cnt253=0;
+ loop253:
+ do {
+ var alt253=2;
+ var LA253_0 = this.input.LA(1);
+
+ if ( (LA253_0==CASE) ) {
+ alt253=1;
+ }
+
+
+ switch (alt253) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2172:12: k= CASE p_SwitchCaseOperand
+ k=this.match(this.input,CASE,XQueryParser.FOLLOW_CASE_in_p_SwitchCaseStatement17503); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_SwitchCaseOperand_in_p_SwitchCaseStatement17507);
+ p_SwitchCaseOperand767=this.p_SwitchCaseOperand();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_SwitchCaseOperand767.getTree());
+
+
+ break;
+
+ default :
+ if ( cnt253 >= 1 ) {
+ break loop253;
+ }
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var eee = new org.antlr.runtime.EarlyExitException(253, this.input);
+ throw eee;
+ }
+ cnt253++;
+ } while (true);
+
+ k=this.match(this.input,RETURN,XQueryParser.FOLLOW_RETURN_in_p_SwitchCaseStatement17513); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_Hybrid_in_p_SwitchCaseStatement17517);
+ p_Hybrid768=this.p_Hybrid(false, false);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Hybrid768.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_TryCatchStatement_return: (function() {
+ XQueryParser.p_TryCatchStatement_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_TryCatchStatement_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2176:1: p_TryCatchStatement : k= TRY p_BlockStatement (k= CATCH p_CatchErrorList p_BlockStatement )+ ;
+ // $ANTLR start "p_TryCatchStatement"
+ p_TryCatchStatement: function() {
+ var retval = new XQueryParser.p_TryCatchStatement_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var p_BlockStatement769 = null;
+ var p_CatchErrorList770 = null;
+ var p_BlockStatement771 = null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2177:9: (k= TRY p_BlockStatement (k= CATCH p_CatchErrorList p_BlockStatement )+ )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2177:11: k= TRY p_BlockStatement (k= CATCH p_CatchErrorList p_BlockStatement )+
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,TRY,XQueryParser.FOLLOW_TRY_in_p_TryCatchStatement17546); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_BlockStatement_in_p_TryCatchStatement17550);
+ p_BlockStatement769=this.p_BlockStatement();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_BlockStatement769.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2177:49: (k= CATCH p_CatchErrorList p_BlockStatement )+
+ var cnt254=0;
+ loop254:
+ do {
+ var alt254=2;
+ var LA254_0 = this.input.LA(1);
+
+ if ( (LA254_0==CATCH) ) {
+ alt254=1;
+ }
+
+
+ switch (alt254) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2177:50: k= CATCH p_CatchErrorList p_BlockStatement
+ k=this.match(this.input,CATCH,XQueryParser.FOLLOW_CATCH_in_p_TryCatchStatement17555); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_CatchErrorList_in_p_TryCatchStatement17559);
+ p_CatchErrorList770=this.p_CatchErrorList();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_CatchErrorList770.getTree());
+ this.pushFollow(XQueryParser.FOLLOW_p_BlockStatement_in_p_TryCatchStatement17561);
+ p_BlockStatement771=this.p_BlockStatement();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_BlockStatement771.getTree());
+
+
+ break;
+
+ default :
+ if ( cnt254 >= 1 ) {
+ break loop254;
+ }
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var eee = new org.antlr.runtime.EarlyExitException(254, this.input);
+ throw eee;
+ }
+ cnt254++;
+ } while (true);
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_TryCatchHybrid_return: (function() {
+ XQueryParser.p_TryCatchHybrid_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_TryCatchHybrid_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2180:1: p_TryCatchHybrid[strict] : k= TRY p_BlockHybrid[$strict] (k= CATCH p_CatchErrorList p_BlockHybrid[$strict] )+ ;
+ // $ANTLR start "p_TryCatchHybrid"
+ p_TryCatchHybrid: function(strict) {
+ var retval = new XQueryParser.p_TryCatchHybrid_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var p_BlockHybrid772 = null;
+ var p_CatchErrorList773 = null;
+ var p_BlockHybrid774 = null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2181:9: (k= TRY p_BlockHybrid[$strict] (k= CATCH p_CatchErrorList p_BlockHybrid[$strict] )+ )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2181:11: k= TRY p_BlockHybrid[$strict] (k= CATCH p_CatchErrorList p_BlockHybrid[$strict] )+
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,TRY,XQueryParser.FOLLOW_TRY_in_p_TryCatchHybrid17593); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_BlockHybrid_in_p_TryCatchHybrid17597);
+ p_BlockHybrid772=this.p_BlockHybrid(strict);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_BlockHybrid772.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2181:55: (k= CATCH p_CatchErrorList p_BlockHybrid[$strict] )+
+ var cnt255=0;
+ loop255:
+ do {
+ var alt255=2;
+ var LA255_0 = this.input.LA(1);
+
+ if ( (LA255_0==CATCH) ) {
+ alt255=1;
+ }
+
+
+ switch (alt255) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2181:56: k= CATCH p_CatchErrorList p_BlockHybrid[$strict]
+ k=this.match(this.input,CATCH,XQueryParser.FOLLOW_CATCH_in_p_TryCatchHybrid17603); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_CatchErrorList_in_p_TryCatchHybrid17607);
+ p_CatchErrorList773=this.p_CatchErrorList();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_CatchErrorList773.getTree());
+ this.pushFollow(XQueryParser.FOLLOW_p_BlockHybrid_in_p_TryCatchHybrid17609);
+ p_BlockHybrid774=this.p_BlockHybrid(strict);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_BlockHybrid774.getTree());
+
+
+ break;
+
+ default :
+ if ( cnt255 >= 1 ) {
+ break loop255;
+ }
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var eee = new org.antlr.runtime.EarlyExitException(255, this.input);
+ throw eee;
+ }
+ cnt255++;
+ } while (true);
+
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_TypeswitchStatement_return: (function() {
+ XQueryParser.p_TypeswitchStatement_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_TypeswitchStatement_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2185:1: p_TypeswitchStatement : k= TYPESWITCH LPAREN p_Expr[true,true] RPAREN ( p_CaseStatement )+ k= DEFAULT (d= DOLLAR v= p_VarName )? k= RETURN p_Hybrid[false,false] ;
+ // $ANTLR start "p_TypeswitchStatement"
+ p_TypeswitchStatement: function() {
+ var retval = new XQueryParser.p_TypeswitchStatement_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var d = null;
+ var LPAREN775 = null;
+ var RPAREN777 = null;
+ var v = null;
+ var p_Expr776 = null;
+ var p_CaseStatement778 = null;
+ var p_Hybrid779 = null;
+
+ var k_tree=null;
+ var d_tree=null;
+ var LPAREN775_tree=null;
+ var RPAREN777_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2186:9: (k= TYPESWITCH LPAREN p_Expr[true,true] RPAREN ( p_CaseStatement )+ k= DEFAULT (d= DOLLAR v= p_VarName )? k= RETURN p_Hybrid[false,false] )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2186:11: k= TYPESWITCH LPAREN p_Expr[true,true] RPAREN ( p_CaseStatement )+ k= DEFAULT (d= DOLLAR v= p_VarName )? k= RETURN p_Hybrid[false,false]
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,TYPESWITCH,XQueryParser.FOLLOW_TYPESWITCH_in_p_TypeswitchStatement17642); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ LPAREN775=this.match(this.input,LPAREN,XQueryParser.FOLLOW_LPAREN_in_p_TypeswitchStatement17646); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LPAREN775_tree = this.adaptor.create(LPAREN775);
+ this.adaptor.addChild(root_0, LPAREN775_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_Expr_in_p_TypeswitchStatement17648);
+ p_Expr776=this.p_Expr(true, true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Expr776.getTree());
+ RPAREN777=this.match(this.input,RPAREN,XQueryParser.FOLLOW_RPAREN_in_p_TypeswitchStatement17651); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RPAREN777_tree = this.adaptor.create(RPAREN777);
+ this.adaptor.addChild(root_0, RPAREN777_tree);
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2186:71: ( p_CaseStatement )+
+ var cnt256=0;
+ loop256:
+ do {
+ var alt256=2;
+ var LA256_0 = this.input.LA(1);
+
+ if ( (LA256_0==CASE) ) {
+ alt256=1;
+ }
+
+
+ switch (alt256) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2186:71: p_CaseStatement
+ this.pushFollow(XQueryParser.FOLLOW_p_CaseStatement_in_p_TypeswitchStatement17653);
+ p_CaseStatement778=this.p_CaseStatement();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_CaseStatement778.getTree());
+
+
+ break;
+
+ default :
+ if ( cnt256 >= 1 ) {
+ break loop256;
+ }
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var eee = new org.antlr.runtime.EarlyExitException(256, this.input);
+ throw eee;
+ }
+ cnt256++;
+ } while (true);
+
+ k=this.match(this.input,DEFAULT,XQueryParser.FOLLOW_DEFAULT_in_p_TypeswitchStatement17658); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2186:113: (d= DOLLAR v= p_VarName )?
+ var alt257=2;
+ var LA257_0 = this.input.LA(1);
+
+ if ( (LA257_0==DOLLAR) ) {
+ alt257=1;
+ }
+ switch (alt257) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2186:114: d= DOLLAR v= p_VarName
+ d=this.match(this.input,DOLLAR,XQueryParser.FOLLOW_DOLLAR_in_p_TypeswitchStatement17665); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ d_tree = this.adaptor.create(d);
+ this.adaptor.addChild(root_0, d_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_VarName_in_p_TypeswitchStatement17669);
+ v=this.p_VarName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, v.getTree());
+ if ( this.state.backtracking===0 ) {
+ this.av(d, (v?v.stop:null));
+ }
+
+
+ break;
+
+ }
+
+ k=this.match(this.input,RETURN,XQueryParser.FOLLOW_RETURN_in_p_TypeswitchStatement17677); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_Hybrid_in_p_TypeswitchStatement17681);
+ p_Hybrid779=this.p_Hybrid(false, false);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Hybrid779.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_CaseStatement_return: (function() {
+ XQueryParser.p_CaseStatement_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_CaseStatement_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2190:1: p_CaseStatement : k= CASE (d= DOLLAR v= p_VarName AS )? p_SequenceType k= RETURN p_Hybrid[false,false] ;
+ // $ANTLR start "p_CaseStatement"
+ p_CaseStatement: function() {
+ var retval = new XQueryParser.p_CaseStatement_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var d = null;
+ var AS780 = null;
+ var v = null;
+ var p_SequenceType781 = null;
+ var p_Hybrid782 = null;
+
+ var k_tree=null;
+ var d_tree=null;
+ var AS780_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2191:9: (k= CASE (d= DOLLAR v= p_VarName AS )? p_SequenceType k= RETURN p_Hybrid[false,false] )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2191:11: k= CASE (d= DOLLAR v= p_VarName AS )? p_SequenceType k= RETURN p_Hybrid[false,false]
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,CASE,XQueryParser.FOLLOW_CASE_in_p_CaseStatement17710); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2191:33: (d= DOLLAR v= p_VarName AS )?
+ var alt258=2;
+ var LA258_0 = this.input.LA(1);
+
+ if ( (LA258_0==DOLLAR) ) {
+ alt258=1;
+ }
+ switch (alt258) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2191:34: d= DOLLAR v= p_VarName AS
+ d=this.match(this.input,DOLLAR,XQueryParser.FOLLOW_DOLLAR_in_p_CaseStatement17717); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ d_tree = this.adaptor.create(d);
+ this.adaptor.addChild(root_0, d_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_VarName_in_p_CaseStatement17721);
+ v=this.p_VarName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, v.getTree());
+ if ( this.state.backtracking===0 ) {
+ this.av(d, (v?v.stop:null));
+ }
+ AS780=this.match(this.input,AS,XQueryParser.FOLLOW_AS_in_p_CaseStatement17725); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ AS780_tree = this.adaptor.create(AS780);
+ this.adaptor.addChild(root_0, AS780_tree);
+ }
+
+
+ break;
+
+ }
+
+ this.pushFollow(XQueryParser.FOLLOW_p_SequenceType_in_p_CaseStatement17729);
+ p_SequenceType781=this.p_SequenceType();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_SequenceType781.getTree());
+ k=this.match(this.input,RETURN,XQueryParser.FOLLOW_RETURN_in_p_CaseStatement17733); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_Hybrid_in_p_CaseStatement17737);
+ p_Hybrid782=this.p_Hybrid(false, false);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Hybrid782.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_VarDeclStatement_return: (function() {
+ XQueryParser.p_VarDeclStatement_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_VarDeclStatement_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2195:1: p_VarDeclStatement : ( p_Annotation )* k= VARIABLE d= DOLLAR v= p_VarName ( p_TypeDeclaration )? ( BIND p_ExprSingle[true] )? ( COMMA e= DOLLAR w= p_VarName ( p_TypeDeclaration )? ( BIND p_ExprSingle[true] )? )* SEMICOLON ;
+ // $ANTLR start "p_VarDeclStatement"
+ p_VarDeclStatement: function() {
+ var retval = new XQueryParser.p_VarDeclStatement_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var d = null;
+ var e = null;
+ var BIND785 = null;
+ var COMMA787 = null;
+ var BIND789 = null;
+ var SEMICOLON791 = null;
+ var v = null;
+ var w = null;
+ var p_Annotation783 = null;
+ var p_TypeDeclaration784 = null;
+ var p_ExprSingle786 = null;
+ var p_TypeDeclaration788 = null;
+ var p_ExprSingle790 = null;
+
+ var k_tree=null;
+ var d_tree=null;
+ var e_tree=null;
+ var BIND785_tree=null;
+ var COMMA787_tree=null;
+ var BIND789_tree=null;
+ var SEMICOLON791_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2196:9: ( ( p_Annotation )* k= VARIABLE d= DOLLAR v= p_VarName ( p_TypeDeclaration )? ( BIND p_ExprSingle[true] )? ( COMMA e= DOLLAR w= p_VarName ( p_TypeDeclaration )? ( BIND p_ExprSingle[true] )? )* SEMICOLON )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2196:11: ( p_Annotation )* k= VARIABLE d= DOLLAR v= p_VarName ( p_TypeDeclaration )? ( BIND p_ExprSingle[true] )? ( COMMA e= DOLLAR w= p_VarName ( p_TypeDeclaration )? ( BIND p_ExprSingle[true] )? )* SEMICOLON
+ root_0 = this.adaptor.nil();
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2196:11: ( p_Annotation )*
+ loop259:
+ do {
+ var alt259=2;
+ var LA259_0 = this.input.LA(1);
+
+ if ( (LA259_0==ANN_PERCENT) ) {
+ alt259=1;
+ }
+
+
+ switch (alt259) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2196:11: p_Annotation
+ this.pushFollow(XQueryParser.FOLLOW_p_Annotation_in_p_VarDeclStatement17764);
+ p_Annotation783=this.p_Annotation();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Annotation783.getTree());
+
+
+ break;
+
+ default :
+ break loop259;
+ }
+ } while (true);
+
+ k=this.match(this.input,VARIABLE,XQueryParser.FOLLOW_VARIABLE_in_p_VarDeclStatement17769); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ d=this.match(this.input,DOLLAR,XQueryParser.FOLLOW_DOLLAR_in_p_VarDeclStatement17775); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ d_tree = this.adaptor.create(d);
+ this.adaptor.addChild(root_0, d_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_VarName_in_p_VarDeclStatement17779);
+ v=this.p_VarName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, v.getTree());
+ if ( this.state.backtracking===0 ) {
+ this.av(d, (v?v.stop:null));
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2196:98: ( p_TypeDeclaration )?
+ var alt260=2;
+ var LA260_0 = this.input.LA(1);
+
+ if ( (LA260_0==AS) ) {
+ alt260=1;
+ }
+ switch (alt260) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2196:98: p_TypeDeclaration
+ this.pushFollow(XQueryParser.FOLLOW_p_TypeDeclaration_in_p_VarDeclStatement17783);
+ p_TypeDeclaration784=this.p_TypeDeclaration();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_TypeDeclaration784.getTree());
+
+
+ break;
+
+ }
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2196:117: ( BIND p_ExprSingle[true] )?
+ var alt261=2;
+ var LA261_0 = this.input.LA(1);
+
+ if ( (LA261_0==BIND) ) {
+ alt261=1;
+ }
+ switch (alt261) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2196:118: BIND p_ExprSingle[true]
+ BIND785=this.match(this.input,BIND,XQueryParser.FOLLOW_BIND_in_p_VarDeclStatement17787); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ BIND785_tree = this.adaptor.create(BIND785);
+ this.adaptor.addChild(root_0, BIND785_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_ExprSingle_in_p_VarDeclStatement17789);
+ p_ExprSingle786=this.p_ExprSingle(true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ExprSingle786.getTree());
+
+
+ break;
+
+ }
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2197:11: ( COMMA e= DOLLAR w= p_VarName ( p_TypeDeclaration )? ( BIND p_ExprSingle[true] )? )*
+ loop264:
+ do {
+ var alt264=2;
+ var LA264_0 = this.input.LA(1);
+
+ if ( (LA264_0==COMMA) ) {
+ alt264=1;
+ }
+
+
+ switch (alt264) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2197:12: COMMA e= DOLLAR w= p_VarName ( p_TypeDeclaration )? ( BIND p_ExprSingle[true] )?
+ COMMA787=this.match(this.input,COMMA,XQueryParser.FOLLOW_COMMA_in_p_VarDeclStatement17805); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ COMMA787_tree = this.adaptor.create(COMMA787);
+ this.adaptor.addChild(root_0, COMMA787_tree);
+ }
+ e=this.match(this.input,DOLLAR,XQueryParser.FOLLOW_DOLLAR_in_p_VarDeclStatement17809); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ e_tree = this.adaptor.create(e);
+ this.adaptor.addChild(root_0, e_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_VarName_in_p_VarDeclStatement17813);
+ w=this.p_VarName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, w.getTree());
+ if ( this.state.backtracking===0 ) {
+ this.av(e, (w?w.stop:null));
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2197:65: ( p_TypeDeclaration )?
+ var alt262=2;
+ var LA262_0 = this.input.LA(1);
+
+ if ( (LA262_0==AS) ) {
+ alt262=1;
+ }
+ switch (alt262) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2197:65: p_TypeDeclaration
+ this.pushFollow(XQueryParser.FOLLOW_p_TypeDeclaration_in_p_VarDeclStatement17817);
+ p_TypeDeclaration788=this.p_TypeDeclaration();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_TypeDeclaration788.getTree());
+
+
+ break;
+
+ }
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2197:84: ( BIND p_ExprSingle[true] )?
+ var alt263=2;
+ var LA263_0 = this.input.LA(1);
+
+ if ( (LA263_0==BIND) ) {
+ alt263=1;
+ }
+ switch (alt263) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2197:85: BIND p_ExprSingle[true]
+ BIND789=this.match(this.input,BIND,XQueryParser.FOLLOW_BIND_in_p_VarDeclStatement17821); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ BIND789_tree = this.adaptor.create(BIND789);
+ this.adaptor.addChild(root_0, BIND789_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_ExprSingle_in_p_VarDeclStatement17823);
+ p_ExprSingle790=this.p_ExprSingle(true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ExprSingle790.getTree());
+
+
+ break;
+
+ }
+
+
+
+ break;
+
+ default :
+ break loop264;
+ }
+ } while (true);
+
+ SEMICOLON791=this.match(this.input,SEMICOLON,XQueryParser.FOLLOW_SEMICOLON_in_p_VarDeclStatement17840); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ SEMICOLON791_tree = this.adaptor.create(SEMICOLON791);
+ this.adaptor.addChild(root_0, SEMICOLON791_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_WhileStatement_return: (function() {
+ XQueryParser.p_WhileStatement_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_WhileStatement_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2202:1: p_WhileStatement : k= WHILE LPAREN p_Expr[true,true] RPAREN p_Hybrid[false,false] ;
+ // $ANTLR start "p_WhileStatement"
+ p_WhileStatement: function() {
+ var retval = new XQueryParser.p_WhileStatement_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var LPAREN792 = null;
+ var RPAREN794 = null;
+ var p_Expr793 = null;
+ var p_Hybrid795 = null;
+
+ var k_tree=null;
+ var LPAREN792_tree=null;
+ var RPAREN794_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2203:9: (k= WHILE LPAREN p_Expr[true,true] RPAREN p_Hybrid[false,false] )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2203:11: k= WHILE LPAREN p_Expr[true,true] RPAREN p_Hybrid[false,false]
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,WHILE,XQueryParser.FOLLOW_WHILE_in_p_WhileStatement17868); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ LPAREN792=this.match(this.input,LPAREN,XQueryParser.FOLLOW_LPAREN_in_p_WhileStatement17872); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LPAREN792_tree = this.adaptor.create(LPAREN792);
+ this.adaptor.addChild(root_0, LPAREN792_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_Expr_in_p_WhileStatement17874);
+ p_Expr793=this.p_Expr(true, true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Expr793.getTree());
+ RPAREN794=this.match(this.input,RPAREN,XQueryParser.FOLLOW_RPAREN_in_p_WhileStatement17877); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RPAREN794_tree = this.adaptor.create(RPAREN794);
+ this.adaptor.addChild(root_0, RPAREN794_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_Hybrid_in_p_WhileStatement17879);
+ p_Hybrid795=this.p_Hybrid(false, false);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_Hybrid795.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_ExprSimple_return: (function() {
+ XQueryParser.p_ExprSimple_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_ExprSimple_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2207:1: p_ExprSimple : ( p_QuantifiedExpr | p_OrExpr | {...}? => pg_UpdateExpr );
+ // $ANTLR start "p_ExprSimple"
+ p_ExprSimple: function() {
+ var retval = new XQueryParser.p_ExprSimple_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_QuantifiedExpr796 = null;
+ var p_OrExpr797 = null;
+ var pg_UpdateExpr798 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2208:9: ( p_QuantifiedExpr | p_OrExpr | {...}? => pg_UpdateExpr )
+ var alt265=3;
+ alt265 = this.dfa265.predict(this.input);
+ switch (alt265) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2208:11: p_QuantifiedExpr
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_QuantifiedExpr_in_p_ExprSimple17906);
+ p_QuantifiedExpr796=this.p_QuantifiedExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_QuantifiedExpr796.getTree());
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2209:11: p_OrExpr
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_OrExpr_in_p_ExprSimple17918);
+ p_OrExpr797=this.p_OrExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_OrExpr797.getTree());
+
+
+ break;
+ case 3 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2210:11: {...}? => pg_UpdateExpr
+ root_0 = this.adaptor.nil();
+
+ if ( !((this.lc(XQU))) ) {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ throw new org.antlr.runtime.FailedPredicateException(this.input, "p_ExprSimple", "this.lc(XQU)");
+ }
+ this.pushFollow(XQueryParser.FOLLOW_pg_UpdateExpr_in_p_ExprSimple17933);
+ pg_UpdateExpr798=this.pg_UpdateExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, pg_UpdateExpr798.getTree());
+
+
+ break;
+
+ }
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_BlockExpr_return: (function() {
+ XQueryParser.p_BlockExpr_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_BlockExpr_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2214:1: p_BlockExpr : LBRACKET p_StatementsAndExpr RBRACKET ;
+ // $ANTLR start "p_BlockExpr"
+ p_BlockExpr: function() {
+ var retval = new XQueryParser.p_BlockExpr_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var LBRACKET799 = null;
+ var RBRACKET801 = null;
+ var p_StatementsAndExpr800 = null;
+
+ var LBRACKET799_tree=null;
+ var RBRACKET801_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2215:9: ( LBRACKET p_StatementsAndExpr RBRACKET )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2215:11: LBRACKET p_StatementsAndExpr RBRACKET
+ root_0 = this.adaptor.nil();
+
+ LBRACKET799=this.match(this.input,LBRACKET,XQueryParser.FOLLOW_LBRACKET_in_p_BlockExpr17959); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ LBRACKET799_tree = this.adaptor.create(LBRACKET799);
+ this.adaptor.addChild(root_0, LBRACKET799_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_StatementsAndExpr_in_p_BlockExpr17961);
+ p_StatementsAndExpr800=this.p_StatementsAndExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_StatementsAndExpr800.getTree());
+ RBRACKET801=this.match(this.input,RBRACKET,XQueryParser.FOLLOW_RBRACKET_in_p_BlockExpr17963); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ RBRACKET801_tree = this.adaptor.create(RBRACKET801);
+ this.adaptor.addChild(root_0, RBRACKET801_tree);
+ }
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_CollectionDecl_return: (function() {
+ XQueryParser.p_CollectionDecl_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_CollectionDecl_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2222:1: p_CollectionDecl : k= COLLECTION p_QName ( p_CollectionTypeDecl )? ;
+ // $ANTLR start "p_CollectionDecl"
+ p_CollectionDecl: function() {
+ var retval = new XQueryParser.p_CollectionDecl_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var p_QName802 = null;
+ var p_CollectionTypeDecl803 = null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2223:9: (k= COLLECTION p_QName ( p_CollectionTypeDecl )? )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2223:11: k= COLLECTION p_QName ( p_CollectionTypeDecl )?
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,COLLECTION,XQueryParser.FOLLOW_COLLECTION_in_p_CollectionDecl17994); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_QName_in_p_CollectionDecl17998);
+ p_QName802=this.p_QName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_QName802.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2223:47: ( p_CollectionTypeDecl )?
+ var alt266=2;
+ var LA266_0 = this.input.LA(1);
+
+ if ( (LA266_0==AS) ) {
+ alt266=1;
+ }
+ switch (alt266) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2223:47: p_CollectionTypeDecl
+ this.pushFollow(XQueryParser.FOLLOW_p_CollectionTypeDecl_in_p_CollectionDecl18000);
+ p_CollectionTypeDecl803=this.p_CollectionTypeDecl();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_CollectionTypeDecl803.getTree());
+
+
+ break;
+
+ }
+
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_CollectionTypeDecl_return: (function() {
+ XQueryParser.p_CollectionTypeDecl_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_CollectionTypeDecl_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2226:1: p_CollectionTypeDecl : (k= AS p_KindTest ( ( p_OccurrenceIndicator )=> p_OccurrenceIndicator )? ) ;
+ // $ANTLR start "p_CollectionTypeDecl"
+ p_CollectionTypeDecl: function() {
+ var retval = new XQueryParser.p_CollectionTypeDecl_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var p_KindTest804 = null;
+ var p_OccurrenceIndicator805 = null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2227:9: ( (k= AS p_KindTest ( ( p_OccurrenceIndicator )=> p_OccurrenceIndicator )? ) )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2227:11: (k= AS p_KindTest ( ( p_OccurrenceIndicator )=> p_OccurrenceIndicator )? )
+ root_0 = this.adaptor.nil();
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2227:11: (k= AS p_KindTest ( ( p_OccurrenceIndicator )=> p_OccurrenceIndicator )? )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2227:12: k= AS p_KindTest ( ( p_OccurrenceIndicator )=> p_OccurrenceIndicator )?
+ k=this.match(this.input,AS,XQueryParser.FOLLOW_AS_in_p_CollectionTypeDecl18029); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_KindTest_in_p_CollectionTypeDecl18033);
+ p_KindTest804=this.p_KindTest();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_KindTest804.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2227:43: ( ( p_OccurrenceIndicator )=> p_OccurrenceIndicator )?
+ var alt267=2;
+ var LA267_0 = this.input.LA(1);
+
+ if ( ((LA267_0>=QUESTION && LA267_0<=PLUS)) && (this.synpred15_XQueryParser())) {
+ alt267=1;
+ }
+ switch (alt267) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2227:44: ( p_OccurrenceIndicator )=> p_OccurrenceIndicator
+ this.pushFollow(XQueryParser.FOLLOW_p_OccurrenceIndicator_in_p_CollectionTypeDecl18042);
+ p_OccurrenceIndicator805=this.p_OccurrenceIndicator();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_OccurrenceIndicator805.getTree());
+
+
+ break;
+
+ }
+
+
+
+
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_IndexDecl_return: (function() {
+ XQueryParser.p_IndexDecl_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_IndexDecl_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2230:1: p_IndexDecl : k= INDEX p_IndexName k= ON k= NODES p_IndexDomainExpr k= BY p_IndexKeySpec ( COMMA p_IndexKeySpec )* ;
+ // $ANTLR start "p_IndexDecl"
+ p_IndexDecl: function() {
+ var retval = new XQueryParser.p_IndexDecl_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var COMMA809 = null;
+ var p_IndexName806 = null;
+ var p_IndexDomainExpr807 = null;
+ var p_IndexKeySpec808 = null;
+ var p_IndexKeySpec810 = null;
+
+ var k_tree=null;
+ var COMMA809_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2231:9: (k= INDEX p_IndexName k= ON k= NODES p_IndexDomainExpr k= BY p_IndexKeySpec ( COMMA p_IndexKeySpec )* )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2231:11: k= INDEX p_IndexName k= ON k= NODES p_IndexDomainExpr k= BY p_IndexKeySpec ( COMMA p_IndexKeySpec )*
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,INDEX,XQueryParser.FOLLOW_INDEX_in_p_IndexDecl18072); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_IndexName_in_p_IndexDecl18076);
+ p_IndexName806=this.p_IndexName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_IndexName806.getTree());
+ k=this.match(this.input,ON,XQueryParser.FOLLOW_ON_in_p_IndexDecl18080); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ k=this.match(this.input,NODES,XQueryParser.FOLLOW_NODES_in_p_IndexDecl18086); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_IndexDomainExpr_in_p_IndexDecl18090);
+ p_IndexDomainExpr807=this.p_IndexDomainExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_IndexDomainExpr807.getTree());
+ k=this.match(this.input,BY,XQueryParser.FOLLOW_BY_in_p_IndexDecl18094); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_IndexKeySpec_in_p_IndexDecl18098);
+ p_IndexKeySpec808=this.p_IndexKeySpec();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_IndexKeySpec808.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2231:142: ( COMMA p_IndexKeySpec )*
+ loop268:
+ do {
+ var alt268=2;
+ var LA268_0 = this.input.LA(1);
+
+ if ( (LA268_0==COMMA) ) {
+ alt268=1;
+ }
+
+
+ switch (alt268) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2231:143: COMMA p_IndexKeySpec
+ COMMA809=this.match(this.input,COMMA,XQueryParser.FOLLOW_COMMA_in_p_IndexDecl18101); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ COMMA809_tree = this.adaptor.create(COMMA809);
+ this.adaptor.addChild(root_0, COMMA809_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_IndexKeySpec_in_p_IndexDecl18103);
+ p_IndexKeySpec810=this.p_IndexKeySpec();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_IndexKeySpec810.getTree());
+
+
+ break;
+
+ default :
+ break loop268;
+ }
+ } while (true);
+
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_IndexName_return: (function() {
+ XQueryParser.p_IndexName_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_IndexName_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2234:1: p_IndexName : p_QName ;
+ // $ANTLR start "p_IndexName"
+ p_IndexName: function() {
+ var retval = new XQueryParser.p_IndexName_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_QName811 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2235:9: ( p_QName )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2235:11: p_QName
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_QName_in_p_IndexName18130);
+ p_QName811=this.p_QName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_QName811.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_IndexDomainExpr_return: (function() {
+ XQueryParser.p_IndexDomainExpr_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_IndexDomainExpr_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2238:1: p_IndexDomainExpr : p_PathExpr ;
+ // $ANTLR start "p_IndexDomainExpr"
+ p_IndexDomainExpr: function() {
+ var retval = new XQueryParser.p_IndexDomainExpr_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_PathExpr812 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2239:9: ( p_PathExpr )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2239:11: p_PathExpr
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_PathExpr_in_p_IndexDomainExpr18155);
+ p_PathExpr812=this.p_PathExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_PathExpr812.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_IndexKeySpec_return: (function() {
+ XQueryParser.p_IndexKeySpec_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_IndexKeySpec_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2242:1: p_IndexKeySpec : p_IndexKeyExpr ( p_IndexKeyTypeDecl )? ( p_IndexKeyCollation )? ;
+ // $ANTLR start "p_IndexKeySpec"
+ p_IndexKeySpec: function() {
+ var retval = new XQueryParser.p_IndexKeySpec_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_IndexKeyExpr813 = null;
+ var p_IndexKeyTypeDecl814 = null;
+ var p_IndexKeyCollation815 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2243:9: ( p_IndexKeyExpr ( p_IndexKeyTypeDecl )? ( p_IndexKeyCollation )? )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2243:11: p_IndexKeyExpr ( p_IndexKeyTypeDecl )? ( p_IndexKeyCollation )?
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_IndexKeyExpr_in_p_IndexKeySpec18180);
+ p_IndexKeyExpr813=this.p_IndexKeyExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_IndexKeyExpr813.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2243:26: ( p_IndexKeyTypeDecl )?
+ var alt269=2;
+ var LA269_0 = this.input.LA(1);
+
+ if ( (LA269_0==AS) ) {
+ alt269=1;
+ }
+ switch (alt269) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2243:26: p_IndexKeyTypeDecl
+ this.pushFollow(XQueryParser.FOLLOW_p_IndexKeyTypeDecl_in_p_IndexKeySpec18182);
+ p_IndexKeyTypeDecl814=this.p_IndexKeyTypeDecl();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_IndexKeyTypeDecl814.getTree());
+
+
+ break;
+
+ }
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2243:46: ( p_IndexKeyCollation )?
+ var alt270=2;
+ var LA270_0 = this.input.LA(1);
+
+ if ( (LA270_0==COLLATION) ) {
+ alt270=1;
+ }
+ switch (alt270) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2243:46: p_IndexKeyCollation
+ this.pushFollow(XQueryParser.FOLLOW_p_IndexKeyCollation_in_p_IndexKeySpec18185);
+ p_IndexKeyCollation815=this.p_IndexKeyCollation();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_IndexKeyCollation815.getTree());
+
+
+ break;
+
+ }
+
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_IndexKeyExpr_return: (function() {
+ XQueryParser.p_IndexKeyExpr_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_IndexKeyExpr_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2246:1: p_IndexKeyExpr : p_PathExpr ;
+ // $ANTLR start "p_IndexKeyExpr"
+ p_IndexKeyExpr: function() {
+ var retval = new XQueryParser.p_IndexKeyExpr_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_PathExpr816 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2247:9: ( p_PathExpr )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2247:11: p_PathExpr
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_PathExpr_in_p_IndexKeyExpr18211);
+ p_PathExpr816=this.p_PathExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_PathExpr816.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_IndexKeyTypeDecl_return: (function() {
+ XQueryParser.p_IndexKeyTypeDecl_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_IndexKeyTypeDecl_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2250:1: p_IndexKeyTypeDecl : k= AS p_AtomicType ( p_OccurrenceIndicator )? ;
+ // $ANTLR start "p_IndexKeyTypeDecl"
+ p_IndexKeyTypeDecl: function() {
+ var retval = new XQueryParser.p_IndexKeyTypeDecl_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var p_AtomicType817 = null;
+ var p_OccurrenceIndicator818 = null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2251:9: (k= AS p_AtomicType ( p_OccurrenceIndicator )? )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2251:11: k= AS p_AtomicType ( p_OccurrenceIndicator )?
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,AS,XQueryParser.FOLLOW_AS_in_p_IndexKeyTypeDecl18238); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_AtomicType_in_p_IndexKeyTypeDecl18242);
+ p_AtomicType817=this.p_AtomicType();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_AtomicType817.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2251:44: ( p_OccurrenceIndicator )?
+ var alt271=2;
+ var LA271_0 = this.input.LA(1);
+
+ if ( ((LA271_0>=QUESTION && LA271_0<=PLUS)) ) {
+ alt271=1;
+ }
+ switch (alt271) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2251:44: p_OccurrenceIndicator
+ this.pushFollow(XQueryParser.FOLLOW_p_OccurrenceIndicator_in_p_IndexKeyTypeDecl18244);
+ p_OccurrenceIndicator818=this.p_OccurrenceIndicator();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_OccurrenceIndicator818.getTree());
+
+
+ break;
+
+ }
+
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_AtomicType_return: (function() {
+ XQueryParser.p_AtomicType_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_AtomicType_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2254:1: p_AtomicType : p_QName ;
+ // $ANTLR start "p_AtomicType"
+ p_AtomicType: function() {
+ var retval = new XQueryParser.p_AtomicType_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var p_QName819 = null;
+
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2255:9: ( p_QName )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2255:11: p_QName
+ root_0 = this.adaptor.nil();
+
+ this.pushFollow(XQueryParser.FOLLOW_p_QName_in_p_AtomicType18270);
+ p_QName819=this.p_QName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_QName819.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_IndexKeyCollation_return: (function() {
+ XQueryParser.p_IndexKeyCollation_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_IndexKeyCollation_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2258:1: p_IndexKeyCollation : k= COLLATION p_StringLiteral ;
+ // $ANTLR start "p_IndexKeyCollation"
+ p_IndexKeyCollation: function() {
+ var retval = new XQueryParser.p_IndexKeyCollation_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var p_StringLiteral820 = null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2259:9: (k= COLLATION p_StringLiteral )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2259:11: k= COLLATION p_StringLiteral
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,COLLATION,XQueryParser.FOLLOW_COLLATION_in_p_IndexKeyCollation18297); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_StringLiteral_in_p_IndexKeyCollation18301);
+ p_StringLiteral820=this.p_StringLiteral();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_StringLiteral820.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_ICDecl_return: (function() {
+ XQueryParser.p_ICDecl_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_ICDecl_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2262:1: p_ICDecl : k= INTEGRITY k= CONSTRAINT p_QName ( p_ICCollection | p_ICForeignKey ) ;
+ // $ANTLR start "p_ICDecl"
+ p_ICDecl: function() {
+ var retval = new XQueryParser.p_ICDecl_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var p_QName821 = null;
+ var p_ICCollection822 = null;
+ var p_ICForeignKey823 = null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2263:9: (k= INTEGRITY k= CONSTRAINT p_QName ( p_ICCollection | p_ICForeignKey ) )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2263:11: k= INTEGRITY k= CONSTRAINT p_QName ( p_ICCollection | p_ICForeignKey )
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,INTEGRITY,XQueryParser.FOLLOW_INTEGRITY_in_p_ICDecl18328); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ k=this.match(this.input,CONSTRAINT,XQueryParser.FOLLOW_CONSTRAINT_in_p_ICDecl18334); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_QName_in_p_ICDecl18338);
+ p_QName821=this.p_QName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_QName821.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2263:74: ( p_ICCollection | p_ICForeignKey )
+ var alt272=2;
+ var LA272_0 = this.input.LA(1);
+
+ if ( (LA272_0==ON) ) {
+ alt272=1;
+ }
+ else if ( (LA272_0==FOREIGN) ) {
+ alt272=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 272, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt272) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2263:75: p_ICCollection
+ this.pushFollow(XQueryParser.FOLLOW_p_ICCollection_in_p_ICDecl18341);
+ p_ICCollection822=this.p_ICCollection();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ICCollection822.getTree());
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2263:92: p_ICForeignKey
+ this.pushFollow(XQueryParser.FOLLOW_p_ICForeignKey_in_p_ICDecl18345);
+ p_ICForeignKey823=this.p_ICForeignKey();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ICForeignKey823.getTree());
+
+
+ break;
+
+ }
+
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_ICCollection_return: (function() {
+ XQueryParser.p_ICCollection_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_ICCollection_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2266:1: p_ICCollection : k= ON k= COLLECTION p_QName ( p_ICCollSequence | p_ICCollSequenceUnique | p_ICCollNode ) ;
+ // $ANTLR start "p_ICCollection"
+ p_ICCollection: function() {
+ var retval = new XQueryParser.p_ICCollection_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var p_QName824 = null;
+ var p_ICCollSequence825 = null;
+ var p_ICCollSequenceUnique826 = null;
+ var p_ICCollNode827 = null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2267:9: (k= ON k= COLLECTION p_QName ( p_ICCollSequence | p_ICCollSequenceUnique | p_ICCollNode ) )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2267:11: k= ON k= COLLECTION p_QName ( p_ICCollSequence | p_ICCollSequenceUnique | p_ICCollNode )
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,ON,XQueryParser.FOLLOW_ON_in_p_ICCollection18373); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ k=this.match(this.input,COLLECTION,XQueryParser.FOLLOW_COLLECTION_in_p_ICCollection18379); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_QName_in_p_ICCollection18383);
+ p_QName824=this.p_QName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_QName824.getTree());
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2267:67: ( p_ICCollSequence | p_ICCollSequenceUnique | p_ICCollNode )
+ var alt273=3;
+ switch ( this.input.LA(1) ) {
+ case DOLLAR:
+ alt273=1;
+ break;
+ case NODE:
+ alt273=2;
+ break;
+ case FOREACH:
+ alt273=3;
+ break;
+ default:
+ if (this.state.backtracking>0) {this.state.failed=true; return retval;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 273, 0, this.input);
+
+ throw nvae;
+ }
+
+ switch (alt273) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2267:68: p_ICCollSequence
+ this.pushFollow(XQueryParser.FOLLOW_p_ICCollSequence_in_p_ICCollection18386);
+ p_ICCollSequence825=this.p_ICCollSequence();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ICCollSequence825.getTree());
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2267:87: p_ICCollSequenceUnique
+ this.pushFollow(XQueryParser.FOLLOW_p_ICCollSequenceUnique_in_p_ICCollection18390);
+ p_ICCollSequenceUnique826=this.p_ICCollSequenceUnique();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ICCollSequenceUnique826.getTree());
+
+
+ break;
+ case 3 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2267:112: p_ICCollNode
+ this.pushFollow(XQueryParser.FOLLOW_p_ICCollNode_in_p_ICCollection18394);
+ p_ICCollNode827=this.p_ICCollNode();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ICCollNode827.getTree());
+
+
+ break;
+
+ }
+
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_ICCollSequence_return: (function() {
+ XQueryParser.p_ICCollSequence_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_ICCollSequence_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2270:1: p_ICCollSequence : d= DOLLAR v= p_QName k= CHECK p_ExprSingle[true] ;
+ // $ANTLR start "p_ICCollSequence"
+ p_ICCollSequence: function() {
+ var retval = new XQueryParser.p_ICCollSequence_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var d = null;
+ var k = null;
+ var v = null;
+ var p_ExprSingle828 = null;
+
+ var d_tree=null;
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2271:9: (d= DOLLAR v= p_QName k= CHECK p_ExprSingle[true] )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2271:11: d= DOLLAR v= p_QName k= CHECK p_ExprSingle[true]
+ root_0 = this.adaptor.nil();
+
+ d=this.match(this.input,DOLLAR,XQueryParser.FOLLOW_DOLLAR_in_p_ICCollSequence18422); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ d_tree = this.adaptor.create(d);
+ this.adaptor.addChild(root_0, d_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_QName_in_p_ICCollSequence18426);
+ v=this.p_QName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, v.getTree());
+ if ( this.state.backtracking===0 ) {
+ this.av(d, (v?v.stop:null));
+ }
+ k=this.match(this.input,CHECK,XQueryParser.FOLLOW_CHECK_in_p_ICCollSequence18432); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_ExprSingle_in_p_ICCollSequence18436);
+ p_ExprSingle828=this.p_ExprSingle(true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ExprSingle828.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_ICCollSequenceUnique_return: (function() {
+ XQueryParser.p_ICCollSequenceUnique_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_ICCollSequenceUnique_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2274:1: p_ICCollSequenceUnique : k= NODE d= DOLLAR v= p_QName k= CHECK k= UNIQUE k= KEY p_PathExpr ;
+ // $ANTLR start "p_ICCollSequenceUnique"
+ p_ICCollSequenceUnique: function() {
+ var retval = new XQueryParser.p_ICCollSequenceUnique_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var d = null;
+ var v = null;
+ var p_PathExpr829 = null;
+
+ var k_tree=null;
+ var d_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2275:9: (k= NODE d= DOLLAR v= p_QName k= CHECK k= UNIQUE k= KEY p_PathExpr )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2275:11: k= NODE d= DOLLAR v= p_QName k= CHECK k= UNIQUE k= KEY p_PathExpr
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,NODE,XQueryParser.FOLLOW_NODE_in_p_ICCollSequenceUnique18464); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ d=this.match(this.input,DOLLAR,XQueryParser.FOLLOW_DOLLAR_in_p_ICCollSequenceUnique18470); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ d_tree = this.adaptor.create(d);
+ this.adaptor.addChild(root_0, d_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_QName_in_p_ICCollSequenceUnique18474);
+ v=this.p_QName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, v.getTree());
+ if ( this.state.backtracking===0 ) {
+ this.av(d, (v?v.stop:null));
+ }
+ k=this.match(this.input,CHECK,XQueryParser.FOLLOW_CHECK_in_p_ICCollSequenceUnique18480); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ k=this.match(this.input,UNIQUE,XQueryParser.FOLLOW_UNIQUE_in_p_ICCollSequenceUnique18486); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ k=this.match(this.input,KEY,XQueryParser.FOLLOW_KEY_in_p_ICCollSequenceUnique18492); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_PathExpr_in_p_ICCollSequenceUnique18496);
+ p_PathExpr829=this.p_PathExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_PathExpr829.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_ICCollNode_return: (function() {
+ XQueryParser.p_ICCollNode_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_ICCollNode_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2278:1: p_ICCollNode : k= FOREACH k= NODE d= DOLLAR v= p_QName k= CHECK p_ExprSingle[true] ;
+ // $ANTLR start "p_ICCollNode"
+ p_ICCollNode: function() {
+ var retval = new XQueryParser.p_ICCollNode_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var d = null;
+ var v = null;
+ var p_ExprSingle830 = null;
+
+ var k_tree=null;
+ var d_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2279:9: (k= FOREACH k= NODE d= DOLLAR v= p_QName k= CHECK p_ExprSingle[true] )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2279:11: k= FOREACH k= NODE d= DOLLAR v= p_QName k= CHECK p_ExprSingle[true]
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,FOREACH,XQueryParser.FOLLOW_FOREACH_in_p_ICCollNode18523); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ k=this.match(this.input,NODE,XQueryParser.FOLLOW_NODE_in_p_ICCollNode18529); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ d=this.match(this.input,DOLLAR,XQueryParser.FOLLOW_DOLLAR_in_p_ICCollNode18535); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ d_tree = this.adaptor.create(d);
+ this.adaptor.addChild(root_0, d_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_QName_in_p_ICCollNode18539);
+ v=this.p_QName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, v.getTree());
+ if ( this.state.backtracking===0 ) {
+ this.av(d, (v?v.stop:null));
+ }
+ k=this.match(this.input,CHECK,XQueryParser.FOLLOW_CHECK_in_p_ICCollNode18545); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_ExprSingle_in_p_ICCollNode18549);
+ p_ExprSingle830=this.p_ExprSingle(true);
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ExprSingle830.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_ICForeignKey_return: (function() {
+ XQueryParser.p_ICForeignKey_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_ICForeignKey_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2282:1: p_ICForeignKey : k= FOREIGN k= KEY p_ICForeignKeySource p_ICForeignKeyTarget ;
+ // $ANTLR start "p_ICForeignKey"
+ p_ICForeignKey: function() {
+ var retval = new XQueryParser.p_ICForeignKey_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var p_ICForeignKeySource831 = null;
+ var p_ICForeignKeyTarget832 = null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2283:9: (k= FOREIGN k= KEY p_ICForeignKeySource p_ICForeignKeyTarget )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2283:11: k= FOREIGN k= KEY p_ICForeignKeySource p_ICForeignKeyTarget
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,FOREIGN,XQueryParser.FOLLOW_FOREIGN_in_p_ICForeignKey18577); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ k=this.match(this.input,KEY,XQueryParser.FOLLOW_KEY_in_p_ICForeignKey18583); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_ICForeignKeySource_in_p_ICForeignKey18587);
+ p_ICForeignKeySource831=this.p_ICForeignKeySource();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ICForeignKeySource831.getTree());
+ this.pushFollow(XQueryParser.FOLLOW_p_ICForeignKeyTarget_in_p_ICForeignKey18589);
+ p_ICForeignKeyTarget832=this.p_ICForeignKeyTarget();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ICForeignKeyTarget832.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_ICForeignKeySource_return: (function() {
+ XQueryParser.p_ICForeignKeySource_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_ICForeignKeySource_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2286:1: p_ICForeignKeySource : k= FROM p_ICForeignKeyValues ;
+ // $ANTLR start "p_ICForeignKeySource"
+ p_ICForeignKeySource: function() {
+ var retval = new XQueryParser.p_ICForeignKeySource_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var p_ICForeignKeyValues833 = null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2287:9: (k= FROM p_ICForeignKeyValues )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2287:11: k= FROM p_ICForeignKeyValues
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,FROM,XQueryParser.FOLLOW_FROM_in_p_ICForeignKeySource18616); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_ICForeignKeyValues_in_p_ICForeignKeySource18620);
+ p_ICForeignKeyValues833=this.p_ICForeignKeyValues();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ICForeignKeyValues833.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_ICForeignKeyTarget_return: (function() {
+ XQueryParser.p_ICForeignKeyTarget_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_ICForeignKeyTarget_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2290:1: p_ICForeignKeyTarget : k= TO p_ICForeignKeyValues ;
+ // $ANTLR start "p_ICForeignKeyTarget"
+ p_ICForeignKeyTarget: function() {
+ var retval = new XQueryParser.p_ICForeignKeyTarget_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var p_ICForeignKeyValues834 = null;
+
+ var k_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2291:9: (k= TO p_ICForeignKeyValues )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2291:11: k= TO p_ICForeignKeyValues
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,TO,XQueryParser.FOLLOW_TO_in_p_ICForeignKeyTarget18647); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_ICForeignKeyValues_in_p_ICForeignKeyTarget18651);
+ p_ICForeignKeyValues834=this.p_ICForeignKeyValues();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_ICForeignKeyValues834.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // inline static return class
+ p_ICForeignKeyValues_return: (function() {
+ XQueryParser.p_ICForeignKeyValues_return = function(){};
+ org.antlr.lang.extend(XQueryParser.p_ICForeignKeyValues_return,
+ org.antlr.runtime.ParserRuleReturnScope,
+ {
+ getTree: function() { return this.tree; }
+ });
+ return;
+ })(),
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2294:1: p_ICForeignKeyValues : k= COLLECTION p_QName k= NODE d= DOLLAR v= p_QName k= KEY p_PathExpr ;
+ // $ANTLR start "p_ICForeignKeyValues"
+ p_ICForeignKeyValues: function() {
+ var retval = new XQueryParser.p_ICForeignKeyValues_return();
+ retval.start = this.input.LT(1);
+
+ var root_0 = null;
+
+ var k = null;
+ var d = null;
+ var v = null;
+ var p_QName835 = null;
+ var p_PathExpr836 = null;
+
+ var k_tree=null;
+ var d_tree=null;
+
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2295:9: (k= COLLECTION p_QName k= NODE d= DOLLAR v= p_QName k= KEY p_PathExpr )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2295:11: k= COLLECTION p_QName k= NODE d= DOLLAR v= p_QName k= KEY p_PathExpr
+ root_0 = this.adaptor.nil();
+
+ k=this.match(this.input,COLLECTION,XQueryParser.FOLLOW_COLLECTION_in_p_ICForeignKeyValues18678); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_QName_in_p_ICForeignKeyValues18682);
+ p_QName835=this.p_QName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_QName835.getTree());
+ k=this.match(this.input,NODE,XQueryParser.FOLLOW_NODE_in_p_ICForeignKeyValues18686); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ d=this.match(this.input,DOLLAR,XQueryParser.FOLLOW_DOLLAR_in_p_ICForeignKeyValues18692); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ d_tree = this.adaptor.create(d);
+ this.adaptor.addChild(root_0, d_tree);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_QName_in_p_ICForeignKeyValues18696);
+ v=this.p_QName();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, v.getTree());
+ if ( this.state.backtracking===0 ) {
+ this.av(d, (v?v.stop:null));
+ }
+ k=this.match(this.input,KEY,XQueryParser.FOLLOW_KEY_in_p_ICForeignKeyValues18702); if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) {
+ k_tree = this.adaptor.create(k);
+ this.adaptor.addChild(root_0, k_tree);
+ }
+ if ( this.state.backtracking===0 ) {
+ this.ak(k);
+ }
+ this.pushFollow(XQueryParser.FOLLOW_p_PathExpr_in_p_ICForeignKeyValues18706);
+ p_PathExpr836=this.p_PathExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return retval;
+ if ( this.state.backtracking===0 ) this.adaptor.addChild(root_0, p_PathExpr836.getTree());
+
+
+
+ retval.stop = this.input.LT(-1);
+
+ if ( this.state.backtracking===0 ) {
+
+ retval.tree = this.adaptor.rulePostProcessing(root_0);
+ this.adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ }
+ }
+ catch (re) {
+ if (re instanceof org.antlr.runtime.RecognitionException) {
+ this.reportError(re);
+ this.recover(this.input,re);
+ retval.tree = this.adaptor.errorNode(this.input, retval.start, this.input.LT(-1), re);
+ } else {
+ throw re;
+ }
+ }
+ finally {
+ }
+ return retval;
+ },
+
+ // $ANTLR start "synpred1_XQueryParser"
+ synpred1_XQueryParser_fragment: function() {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:571:11: ( ( ( FOR | LET ) DOLLAR ) | ( FOR ( TUMBLING | SLIDING ) ) )
+ var alt274=2;
+ var LA274_0 = this.input.LA(1);
+
+ if ( (LA274_0==FOR) ) {
+ var LA274_1 = this.input.LA(2);
+
+ if ( (LA274_1==DOLLAR) ) {
+ alt274=1;
+ }
+ else if ( (LA274_1==SLIDING||LA274_1==TUMBLING) ) {
+ alt274=2;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return ;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 274, 1, this.input);
+
+ throw nvae;
+ }
+ }
+ else if ( (LA274_0==LET) ) {
+ alt274=1;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return ;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 274, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt274) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:571:12: ( ( FOR | LET ) DOLLAR )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:571:12: ( ( FOR | LET ) DOLLAR )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:571:13: ( FOR | LET ) DOLLAR
+ if ( this.input.LA(1)==FOR||this.input.LA(1)==LET ) {
+ this.input.consume();
+ this.state.errorRecovery=false;this.state.failed=false;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return ;}
+ var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
+ throw mse;
+ }
+
+ this.match(this.input,DOLLAR,XQueryParser.FOLLOW_DOLLAR_in_synpred1_XQueryParser3539); if (this.state.failed) return ;
+
+
+
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:571:35: ( FOR ( TUMBLING | SLIDING ) )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:571:35: ( FOR ( TUMBLING | SLIDING ) )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:571:36: FOR ( TUMBLING | SLIDING )
+ this.match(this.input,FOR,XQueryParser.FOLLOW_FOR_in_synpred1_XQueryParser3545); if (this.state.failed) return ;
+ if ( this.input.LA(1)==SLIDING||this.input.LA(1)==TUMBLING ) {
+ this.input.consume();
+ this.state.errorRecovery=false;this.state.failed=false;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return ;}
+ var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
+ throw mse;
+ }
+
+
+
+
+
+
+ break;
+
+ }},
+ // $ANTLR end "synpred1_XQueryParser",
+
+ // $ANTLR start "synpred2_XQueryParser"
+ synpred2_XQueryParser_fragment: function() {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:572:11: ( IF LPAREN )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:572:12: IF LPAREN
+ this.match(this.input,IF,XQueryParser.FOLLOW_IF_in_synpred2_XQueryParser3573); if (this.state.failed) return ;
+ this.match(this.input,LPAREN,XQueryParser.FOLLOW_LPAREN_in_synpred2_XQueryParser3575); if (this.state.failed) return ;
+
+
+ },
+ // $ANTLR end "synpred2_XQueryParser",
+
+ // $ANTLR start "synpred3_XQueryParser"
+ synpred3_XQueryParser_fragment: function() {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:573:11: ( SWITCH LPAREN )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:573:12: SWITCH LPAREN
+ this.match(this.input,SWITCH,XQueryParser.FOLLOW_SWITCH_in_synpred3_XQueryParser3603); if (this.state.failed) return ;
+ this.match(this.input,LPAREN,XQueryParser.FOLLOW_LPAREN_in_synpred3_XQueryParser3605); if (this.state.failed) return ;
+
+
+ },
+ // $ANTLR end "synpred3_XQueryParser",
+
+ // $ANTLR start "synpred4_XQueryParser"
+ synpred4_XQueryParser_fragment: function() {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:574:11: ( TYPESWITCH LPAREN )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:574:12: TYPESWITCH LPAREN
+ this.match(this.input,TYPESWITCH,XQueryParser.FOLLOW_TYPESWITCH_in_synpred4_XQueryParser3629); if (this.state.failed) return ;
+ this.match(this.input,LPAREN,XQueryParser.FOLLOW_LPAREN_in_synpred4_XQueryParser3631); if (this.state.failed) return ;
+
+
+ },
+ // $ANTLR end "synpred4_XQueryParser",
+
+ // $ANTLR start "synpred5_XQueryParser"
+ synpred5_XQueryParser_fragment: function() {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:575:11: ( TRY LBRACKET )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:575:12: TRY LBRACKET
+ this.match(this.input,TRY,XQueryParser.FOLLOW_TRY_in_synpred5_XQueryParser3651); if (this.state.failed) return ;
+ this.match(this.input,LBRACKET,XQueryParser.FOLLOW_LBRACKET_in_synpred5_XQueryParser3653); if (this.state.failed) return ;
+
+
+ },
+ // $ANTLR end "synpred5_XQueryParser",
+
+ // $ANTLR start "synpred6_XQueryParser"
+ synpred6_XQueryParser_fragment: function() {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:864:11: ( VALIDATE ( p_ValidationMode | TYPE )? )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:864:12: VALIDATE ( p_ValidationMode | TYPE )?
+ this.match(this.input,VALIDATE,XQueryParser.FOLLOW_VALIDATE_in_synpred6_XQueryParser6204); if (this.state.failed) return ;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:864:21: ( p_ValidationMode | TYPE )?
+ var alt275=3;
+ var LA275_0 = this.input.LA(1);
+
+ if ( (LA275_0==LAX||LA275_0==STRICT) ) {
+ alt275=1;
+ }
+ else if ( (LA275_0==TYPE) ) {
+ alt275=2;
+ }
+ switch (alt275) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:864:23: p_ValidationMode
+ this.pushFollow(XQueryParser.FOLLOW_p_ValidationMode_in_synpred6_XQueryParser6208);
+ this.p_ValidationMode();
+
+ this.state._fsp--;
+ if (this.state.failed) return ;
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:864:42: TYPE
+ this.match(this.input,TYPE,XQueryParser.FOLLOW_TYPE_in_synpred6_XQueryParser6212); if (this.state.failed) return ;
+
+
+ break;
+
+ }
+
+
+
+ },
+ // $ANTLR end "synpred6_XQueryParser",
+
+ // $ANTLR start "synpred7_XQueryParser"
+ synpred7_XQueryParser_fragment: function() {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:913:11: ( SLASH p_RelativePathExpr )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:913:12: SLASH p_RelativePathExpr
+ this.match(this.input,SLASH,XQueryParser.FOLLOW_SLASH_in_synpred7_XQueryParser6600); if (this.state.failed) return ;
+ this.pushFollow(XQueryParser.FOLLOW_p_RelativePathExpr_in_synpred7_XQueryParser6602);
+ this.p_RelativePathExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return ;
+
+
+ },
+ // $ANTLR end "synpred7_XQueryParser",
+
+ // $ANTLR start "synpred8_XQueryParser"
+ synpred8_XQueryParser_fragment: function() {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:926:11: ( LBRACKET | LPAREN | SMALLER | QUOT | APOS | DOLLAR )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:
+ if ( this.input.LA(1)==LPAREN||this.input.LA(1)==DOLLAR||this.input.LA(1)==LBRACKET||this.input.LA(1)==SMALLER||(this.input.LA(1)>=APOS && this.input.LA(1)<=QUOT) ) {
+ this.input.consume();
+ this.state.errorRecovery=false;this.state.failed=false;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return ;}
+ var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
+ throw mse;
+ }
+
+
+
+ },
+ // $ANTLR end "synpred8_XQueryParser",
+
+ // $ANTLR start "synpred9_XQueryParser"
+ synpred9_XQueryParser_fragment: function() {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:927:11: ( ( ( ELEMENT | ATTRIBUTE ) ( p_EQName )? LBRACKET ) | ( ( NAMESPACE | PROCESSING_INSTRUCTION ) ( p_NCName )? LBRACKET ) | ( ( DOCUMENT | TEXT | COMMENT ) LBRACKET ) )
+ var alt278=3;
+ switch ( this.input.LA(1) ) {
+ case ATTRIBUTE:
+ case ELEMENT:
+ alt278=1;
+ break;
+ case NAMESPACE:
+ case PROCESSING_INSTRUCTION:
+ alt278=2;
+ break;
+ case COMMENT:
+ case DOCUMENT:
+ case TEXT:
+ alt278=3;
+ break;
+ default:
+ if (this.state.backtracking>0) {this.state.failed=true; return ;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 278, 0, this.input);
+
+ throw nvae;
+ }
+
+ switch (alt278) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:928:13: ( ( ELEMENT | ATTRIBUTE ) ( p_EQName )? LBRACKET )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:928:13: ( ( ELEMENT | ATTRIBUTE ) ( p_EQName )? LBRACKET )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:928:14: ( ELEMENT | ATTRIBUTE ) ( p_EQName )? LBRACKET
+ if ( this.input.LA(1)==ATTRIBUTE||this.input.LA(1)==ELEMENT ) {
+ this.input.consume();
+ this.state.errorRecovery=false;this.state.failed=false;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return ;}
+ var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
+ throw mse;
+ }
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:928:36: ( p_EQName )?
+ var alt276=2;
+ var LA276_0 = this.input.LA(1);
+
+ if ( ((LA276_0>=ANCESTOR && LA276_0<=SKIP)||(LA276_0>=VALUE && LA276_0<=QUOT_ER)||LA276_0==Q||LA276_0==L_NCName) ) {
+ alt276=1;
+ }
+ switch (alt276) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:928:36: p_EQName
+ this.pushFollow(XQueryParser.FOLLOW_p_EQName_in_synpred9_XQueryParser6777);
+ this.p_EQName();
+
+ this.state._fsp--;
+ if (this.state.failed) return ;
+
+
+ break;
+
+ }
+
+ this.match(this.input,LBRACKET,XQueryParser.FOLLOW_LBRACKET_in_synpred9_XQueryParser6780); if (this.state.failed) return ;
+
+
+
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:929:13: ( ( NAMESPACE | PROCESSING_INSTRUCTION ) ( p_NCName )? LBRACKET )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:929:13: ( ( NAMESPACE | PROCESSING_INSTRUCTION ) ( p_NCName )? LBRACKET )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:929:14: ( NAMESPACE | PROCESSING_INSTRUCTION ) ( p_NCName )? LBRACKET
+ if ( this.input.LA(1)==NAMESPACE||this.input.LA(1)==PROCESSING_INSTRUCTION ) {
+ this.input.consume();
+ this.state.errorRecovery=false;this.state.failed=false;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return ;}
+ var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
+ throw mse;
+ }
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:929:51: ( p_NCName )?
+ var alt277=2;
+ var LA277_0 = this.input.LA(1);
+
+ if ( ((LA277_0>=ANCESTOR && LA277_0<=SKIP)||(LA277_0>=VALUE && LA277_0<=QUOT_ER)||LA277_0==L_NCName) ) {
+ alt277=1;
+ }
+ switch (alt277) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:929:51: p_NCName
+ this.pushFollow(XQueryParser.FOLLOW_p_NCName_in_synpred9_XQueryParser6806);
+ this.p_NCName();
+
+ this.state._fsp--;
+ if (this.state.failed) return ;
+
+
+ break;
+
+ }
+
+ this.match(this.input,LBRACKET,XQueryParser.FOLLOW_LBRACKET_in_synpred9_XQueryParser6809); if (this.state.failed) return ;
+
+
+
+
+
+ break;
+ case 3 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:930:13: ( ( DOCUMENT | TEXT | COMMENT ) LBRACKET )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:930:13: ( ( DOCUMENT | TEXT | COMMENT ) LBRACKET )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:930:14: ( DOCUMENT | TEXT | COMMENT ) LBRACKET
+ if ( this.input.LA(1)==COMMENT||this.input.LA(1)==DOCUMENT||this.input.LA(1)==TEXT ) {
+ this.input.consume();
+ this.state.errorRecovery=false;this.state.failed=false;
+ }
+ else {
+ if (this.state.backtracking>0) {this.state.failed=true; return ;}
+ var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
+ throw mse;
+ }
+
+ this.match(this.input,LBRACKET,XQueryParser.FOLLOW_LBRACKET_in_synpred9_XQueryParser6839); if (this.state.failed) return ;
+
+
+
+
+
+ break;
+
+ }},
+ // $ANTLR end "synpred9_XQueryParser",
+
+ // $ANTLR start "synpred10_XQueryParser"
+ synpred10_XQueryParser_fragment: function() {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:932:11: ( p_KindTest )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:932:12: p_KindTest
+ this.pushFollow(XQueryParser.FOLLOW_p_KindTest_in_synpred10_XQueryParser6869);
+ this.p_KindTest();
+
+ this.state._fsp--;
+ if (this.state.failed) return ;
+
+
+ },
+ // $ANTLR end "synpred10_XQueryParser",
+
+ // $ANTLR start "synpred11_XQueryParser"
+ synpred11_XQueryParser_fragment: function() {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:933:11: ( p_EQName LPAREN )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:933:12: p_EQName LPAREN
+ this.pushFollow(XQueryParser.FOLLOW_p_EQName_in_synpred11_XQueryParser6888);
+ this.p_EQName();
+
+ this.state._fsp--;
+ if (this.state.failed) return ;
+ this.match(this.input,LPAREN,XQueryParser.FOLLOW_LPAREN_in_synpred11_XQueryParser6890); if (this.state.failed) return ;
+
+
+ },
+ // $ANTLR end "synpred11_XQueryParser",
+
+ // $ANTLR start "synpred12_XQueryParser"
+ synpred12_XQueryParser_fragment: function() {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:934:11: ( p_PrimaryExpr )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:934:12: p_PrimaryExpr
+ this.pushFollow(XQueryParser.FOLLOW_p_PrimaryExpr_in_synpred12_XQueryParser6908);
+ this.p_PrimaryExpr();
+
+ this.state._fsp--;
+ if (this.state.failed) return ;
+
+
+ },
+ // $ANTLR end "synpred12_XQueryParser",
+
+ // $ANTLR start "synpred13_XQueryParser"
+ synpred13_XQueryParser_fragment: function() {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1029:11: ( LPAREN )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1029:12: LPAREN
+ this.match(this.input,LPAREN,XQueryParser.FOLLOW_LPAREN_in_synpred13_XQueryParser7593); if (this.state.failed) return ;
+
+
+ },
+ // $ANTLR end "synpred13_XQueryParser",
+
+ // $ANTLR start "synpred14_XQueryParser"
+ synpred14_XQueryParser_fragment: function() {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1327:26: ( p_OccurrenceIndicator )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:1327:27: p_OccurrenceIndicator
+ this.pushFollow(XQueryParser.FOLLOW_p_OccurrenceIndicator_in_synpred14_XQueryParser9871);
+ this.p_OccurrenceIndicator();
+
+ this.state._fsp--;
+ if (this.state.failed) return ;
+
+
+ },
+ // $ANTLR end "synpred14_XQueryParser",
+
+ // $ANTLR start "synpred15_XQueryParser"
+ synpred15_XQueryParser_fragment: function() {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2227:44: ( p_OccurrenceIndicator )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XQueryParser.g:2227:45: p_OccurrenceIndicator
+ this.pushFollow(XQueryParser.FOLLOW_p_OccurrenceIndicator_in_synpred15_XQueryParser18037);
+ this.p_OccurrenceIndicator();
+
+ this.state._fsp--;
+ if (this.state.failed) return ;
+
+
+ },
+ // $ANTLR end "synpred15_XQueryParser"
+
+ // Delegated rules
+
+
+
+ synpred3_XQueryParser: function() {
+ this.state.backtracking++;
+ var start = this.input.mark();
+ try {
+ this.synpred3_XQueryParser_fragment(); // can never throw exception
+ } catch (re) {
+ alert("impossible: "+re.toString());
+ }
+ var success = !this.state.failed;
+ this.input.rewind(start);
+ this.state.backtracking--;
+ this.state.failed=false;
+ return success;
+ },
+ synpred15_XQueryParser: function() {
+ this.state.backtracking++;
+ var start = this.input.mark();
+ try {
+ this.synpred15_XQueryParser_fragment(); // can never throw exception
+ } catch (re) {
+ alert("impossible: "+re.toString());
+ }
+ var success = !this.state.failed;
+ this.input.rewind(start);
+ this.state.backtracking--;
+ this.state.failed=false;
+ return success;
+ },
+ synpred7_XQueryParser: function() {
+ this.state.backtracking++;
+ var start = this.input.mark();
+ try {
+ this.synpred7_XQueryParser_fragment(); // can never throw exception
+ } catch (re) {
+ alert("impossible: "+re.toString());
+ }
+ var success = !this.state.failed;
+ this.input.rewind(start);
+ this.state.backtracking--;
+ this.state.failed=false;
+ return success;
+ },
+ synpred9_XQueryParser: function() {
+ this.state.backtracking++;
+ var start = this.input.mark();
+ try {
+ this.synpred9_XQueryParser_fragment(); // can never throw exception
+ } catch (re) {
+ alert("impossible: "+re.toString());
+ }
+ var success = !this.state.failed;
+ this.input.rewind(start);
+ this.state.backtracking--;
+ this.state.failed=false;
+ return success;
+ },
+ synpred10_XQueryParser: function() {
+ this.state.backtracking++;
+ var start = this.input.mark();
+ try {
+ this.synpred10_XQueryParser_fragment(); // can never throw exception
+ } catch (re) {
+ alert("impossible: "+re.toString());
+ }
+ var success = !this.state.failed;
+ this.input.rewind(start);
+ this.state.backtracking--;
+ this.state.failed=false;
+ return success;
+ },
+ synpred5_XQueryParser: function() {
+ this.state.backtracking++;
+ var start = this.input.mark();
+ try {
+ this.synpred5_XQueryParser_fragment(); // can never throw exception
+ } catch (re) {
+ alert("impossible: "+re.toString());
+ }
+ var success = !this.state.failed;
+ this.input.rewind(start);
+ this.state.backtracking--;
+ this.state.failed=false;
+ return success;
+ },
+ synpred12_XQueryParser: function() {
+ this.state.backtracking++;
+ var start = this.input.mark();
+ try {
+ this.synpred12_XQueryParser_fragment(); // can never throw exception
+ } catch (re) {
+ alert("impossible: "+re.toString());
+ }
+ var success = !this.state.failed;
+ this.input.rewind(start);
+ this.state.backtracking--;
+ this.state.failed=false;
+ return success;
+ },
+ synpred14_XQueryParser: function() {
+ this.state.backtracking++;
+ var start = this.input.mark();
+ try {
+ this.synpred14_XQueryParser_fragment(); // can never throw exception
+ } catch (re) {
+ alert("impossible: "+re.toString());
+ }
+ var success = !this.state.failed;
+ this.input.rewind(start);
+ this.state.backtracking--;
+ this.state.failed=false;
+ return success;
+ },
+ synpred6_XQueryParser: function() {
+ this.state.backtracking++;
+ var start = this.input.mark();
+ try {
+ this.synpred6_XQueryParser_fragment(); // can never throw exception
+ } catch (re) {
+ alert("impossible: "+re.toString());
+ }
+ var success = !this.state.failed;
+ this.input.rewind(start);
+ this.state.backtracking--;
+ this.state.failed=false;
+ return success;
+ },
+ synpred8_XQueryParser: function() {
+ this.state.backtracking++;
+ var start = this.input.mark();
+ try {
+ this.synpred8_XQueryParser_fragment(); // can never throw exception
+ } catch (re) {
+ alert("impossible: "+re.toString());
+ }
+ var success = !this.state.failed;
+ this.input.rewind(start);
+ this.state.backtracking--;
+ this.state.failed=false;
+ return success;
+ },
+ synpred4_XQueryParser: function() {
+ this.state.backtracking++;
+ var start = this.input.mark();
+ try {
+ this.synpred4_XQueryParser_fragment(); // can never throw exception
+ } catch (re) {
+ alert("impossible: "+re.toString());
+ }
+ var success = !this.state.failed;
+ this.input.rewind(start);
+ this.state.backtracking--;
+ this.state.failed=false;
+ return success;
+ },
+ synpred11_XQueryParser: function() {
+ this.state.backtracking++;
+ var start = this.input.mark();
+ try {
+ this.synpred11_XQueryParser_fragment(); // can never throw exception
+ } catch (re) {
+ alert("impossible: "+re.toString());
+ }
+ var success = !this.state.failed;
+ this.input.rewind(start);
+ this.state.backtracking--;
+ this.state.failed=false;
+ return success;
+ },
+ synpred13_XQueryParser: function() {
+ this.state.backtracking++;
+ var start = this.input.mark();
+ try {
+ this.synpred13_XQueryParser_fragment(); // can never throw exception
+ } catch (re) {
+ alert("impossible: "+re.toString());
+ }
+ var success = !this.state.failed;
+ this.input.rewind(start);
+ this.state.backtracking--;
+ this.state.failed=false;
+ return success;
+ },
+ synpred1_XQueryParser: function() {
+ this.state.backtracking++;
+ var start = this.input.mark();
+ try {
+ this.synpred1_XQueryParser_fragment(); // can never throw exception
+ } catch (re) {
+ alert("impossible: "+re.toString());
+ }
+ var success = !this.state.failed;
+ this.input.rewind(start);
+ this.state.backtracking--;
+ this.state.failed=false;
+ return success;
+ },
+ synpred2_XQueryParser: function() {
+ this.state.backtracking++;
+ var start = this.input.mark();
+ try {
+ this.synpred2_XQueryParser_fragment(); // can never throw exception
+ } catch (re) {
+ alert("impossible: "+re.toString());
+ }
+ var success = !this.state.failed;
+ this.input.rewind(start);
+ this.state.backtracking--;
+ this.state.failed=false;
+ return success;
+ }
+
+}, true); // important to pass true to overwrite default implementations
+
+org.antlr.lang.augmentObject(XQueryParser, {
+ DFA1_eotS:
+ "\u000a\uffff",
+ DFA1_eofS:
+ "\u0001\u0005\u0001\u0009\u0008\uffff",
+ DFA1_minS:
+ "\u0001\u0010\u0001\u0012\u0008\uffff",
+ DFA1_maxS:
+ "\u0001\u0122\u0001\u0107\u0008\uffff",
+ DFA1_acceptS:
+ "\u0002\uffff\u0004\u0002\u0001\u0001\u0003\u0002",
+ DFA1_specialS:
+ "\u0001\u0000\u0001\u0001\u0008\uffff}>",
+ DFA1_transitionS: [
+ "\u0002\u0002\u0004\u0004\u0001\u0002\u0006\u0004\u0001\u0002"+
+ "\u0001\u0004\u0001\u0002\u0002\u0004\u0001\u0002\u0001\u0004"+
+ "\u0002\u0002\u0002\u0004\u0003\u0002\u0005\u0004\u0001\u0002"+
+ "\u0002\u0004\u0003\u0002\u0005\u0004\u0002\u0002\u0009\u0004"+
+ "\u0001\u0002\u0002\u0004\u0002\u0002\u0003\u0004\u0001\u0002"+
+ "\u0005\u0004\u0001\u0002\u0001\u0004\u0003\u0002\u0001\u0004"+
+ "\u0001\u0002\u0007\u0004\u0004\u0002\u0003\u0004\u0001\u0002"+
+ "\u0003\u0004\u0001\u0002\u0001\u0004\u0003\u0002\u0002\u0004"+
+ "\u0001\u0001\u000c\u0004\u0001\u0002\u0009\u0004\u0002\u0002"+
+ "\u0007\u0004\u0002\u0002\u0001\u0004\u0001\u0002\u0002\u0004"+
+ "\u0001\u0002\u0003\u0004\u0002\u0002\u0002\u0004\u0001\u0002"+
+ "\u002c\u0004\u0003\u0002\u0002\u0004\u0001\u0002\u000d\u0004"+
+ "\u0001\uffff\u0001\u0002\u0001\uffff\u0002\u0002\u0001\uffff"+
+ "\u0001\u0002\u0001\uffff\u0001\u0002\u0004\uffff\u0001\u0003"+
+ "\u0004\uffff\u0004\u0002\u0005\uffff\u0002\u0002\u0001\uffff"+
+ "\u0002\u0002\u000c\uffff\u0002\u0002\u0002\uffff\u0002\u0002"+
+ "\u0002\uffff\u0001\u0004\u0006\uffff\u0006\u0002",
+ "\u0001\u0007\u0008\uffff\u0002\u0007\u000a\uffff\u0001\u0007"+
+ "\u0006\uffff\u0001\u0006\u0001\u0007\u0001\uffff\u0001\u0007"+
+ "\u0005\uffff\u0001\u0007\u0001\uffff\u0002\u0007\u0004\uffff"+
+ "\u0003\u0007\u0002\uffff\u0001\u0007\u0002\uffff\u0002\u0007"+
+ "\u0002\uffff\u0001\u0007\u0006\uffff\u0001\u0007\u0018\uffff"+
+ "\u0002\u0007\u0001\uffff\u0001\u0007\u0003\uffff\u0001\u0006"+
+ "\u0034\uffff\u0001\u0007\u003a\uffff\u0002\u0007\u0006\uffff"+
+ "\u0001\u0007\u0001\uffff\u0001\u0007\u0001\uffff\u0001\u0007"+
+ "\u0001\uffff\u0001\u0007\u0001\uffff\u0001\u0007\u0001\uffff"+
+ "\u000c\u0007\u0002\uffff\u0001\u0007\u0003\uffff\u0001\u0008"+
+ "\u0001\u0007",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ ""
+ ]
+});
+
+org.antlr.lang.augmentObject(XQueryParser, {
+ DFA1_eot:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA1_eotS),
+ DFA1_eof:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA1_eofS),
+ DFA1_min:
+ org.antlr.runtime.DFA.unpackEncodedStringToUnsignedChars(XQueryParser.DFA1_minS),
+ DFA1_max:
+ org.antlr.runtime.DFA.unpackEncodedStringToUnsignedChars(XQueryParser.DFA1_maxS),
+ DFA1_accept:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA1_acceptS),
+ DFA1_special:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA1_specialS),
+ DFA1_transition: (function() {
+ var a = [],
+ i,
+ numStates = XQueryParser.DFA1_transitionS.length;
+ for (i=0; i<numStates; i++) {
+ a.push(org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA1_transitionS[i]));
+ }
+ return a;
+ })()
+});
+
+XQueryParser.DFA1 = function(recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 1;
+ this.eot = XQueryParser.DFA1_eot;
+ this.eof = XQueryParser.DFA1_eof;
+ this.min = XQueryParser.DFA1_min;
+ this.max = XQueryParser.DFA1_max;
+ this.accept = XQueryParser.DFA1_accept;
+ this.special = XQueryParser.DFA1_special;
+ this.transition = XQueryParser.DFA1_transition;
+};
+
+org.antlr.lang.extend(XQueryParser.DFA1, org.antlr.runtime.DFA, {
+ getDescription: function() {
+ return "293:13: (vd= p_VersionDecl )?";
+ },
+ specialStateTransition: function(s, input) {
+ var _s = s;
+ var retval = (function(s, input) {
+ switch ( s ) {
+ case 0 :
+ var LA1_0 = input.LA(1);
+
+
+ var index1_0 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (LA1_0==XQUERY) ) {s = 1;}
+
+ else if ( ((LA1_0>=ANCESTOR && LA1_0<=ANCESTOR_OR_SELF)||LA1_0==ATTRIBUTE||LA1_0==CHILD||LA1_0==COMMENT||LA1_0==DECLARE||(LA1_0>=DESCENDANT && LA1_0<=DESCENDANT_OR_SELF)||(LA1_0>=DOCUMENT && LA1_0<=ELEMENT)||LA1_0==EVERY||(LA1_0>=FOLLOWING && LA1_0<=FOR)||(LA1_0>=IF && LA1_0<=IMPORT)||LA1_0==LET||(LA1_0>=MODULE && LA1_0<=NAMESPACE)||LA1_0==NODE||LA1_0==ORDERED||(LA1_0>=PARENT && LA1_0<=PRECEDING_SIBLING)||LA1_0==PROCESSING_INSTRUCTION||(LA1_0>=SCHEMA_ATTRIBUTE && LA1_0<=SOME)||LA1_0==TEXT||LA1_0==TYPESWITCH||(LA1_0>=UNORDERED && LA1_0<=VARIABLE)||LA1_0==NAMESPACE_NODE||(LA1_0>=SWITCH && LA1_0<=TRY)||(LA1_0>=COPY && LA1_0<=DELETE)||LA1_0==INSERT||LA1_0==APPEND||(LA1_0>=RENAME && LA1_0<=REPLACE)||LA1_0==UPDATING||(LA1_0>=BREAK && LA1_0<=EXIT)||LA1_0==WHILE||LA1_0==LPAREN||(LA1_0>=DOLLAR && LA1_0<=L_UNION_BRACKET)||LA1_0==LBRACKET||LA1_0==LSQUARE||(LA1_0>=STAR && LA1_0<=SMALLER)||(LA1_0>=SLASH && LA1_0<=SLASH_SLASH)||(LA1_0>=DOT && LA1_0<=DOT_DOT)||(LA1_0>=ATTR_SIGN && LA1_0<=Q)||(LA1_0>=APOS && LA1_0<=QUOT)||(LA1_0>=L_Pragma && LA1_0<=L_DoubleLiteral)) ) {s = 2;}
+
+ else if ( (LA1_0==ANN_PERCENT) && ((this.lc(XQS)))) {s = 3;}
+
+ else if ( ((LA1_0>=AND && LA1_0<=AT)||(LA1_0>=BASE_URI && LA1_0<=CASTABLE)||LA1_0==COLLATION||(LA1_0>=CONSTRUCTION && LA1_0<=COPY_NAMESPACES)||LA1_0==DEFAULT||(LA1_0>=DESCENDING && LA1_0<=DIV)||(LA1_0>=ELSE && LA1_0<=EQ)||(LA1_0>=EXCEPT && LA1_0<=EXTERNAL)||(LA1_0>=FUNCTION && LA1_0<=IDIV)||(LA1_0>=IN && LA1_0<=LEAST)||(LA1_0>=LT && LA1_0<=MOD)||(LA1_0>=NE && LA1_0<=NO_PRESERVE)||(LA1_0>=JSON && LA1_0<=ORDER)||LA1_0==ORDERING||LA1_0==PRESERVE||(LA1_0>=STRUCTURED_ITEM && LA1_0<=SCHEMA)||(LA1_0>=STABLE && LA1_0<=STRIP)||(LA1_0>=THEN && LA1_0<=TREAT)||LA1_0==UNION||(LA1_0>=VERSION && LA1_0<=WHERE)||(LA1_0>=ALLOWING && LA1_0<=MINUS_SIGN)||(LA1_0>=NAN && LA1_0<=START)||(LA1_0>=TUMBLING && LA1_0<=BEFORE)||LA1_0==FIRST||(LA1_0>=INTO && LA1_0<=POSITION)||(LA1_0>=LAST && LA1_0<=NODES)||(LA1_0>=REVALIDATION && LA1_0<=SKIP)||(LA1_0>=VALUE && LA1_0<=WORDS)||(LA1_0>=LOOP && LA1_0<=RETURNING)||(LA1_0>=CHECK && LA1_0<=QUOT_ER)||LA1_0==L_NCName) ) {s = 4;}
+
+ else if ( (LA1_0==EOF) && ((this.lc(XQS)))) {s = 5;}
+
+
+ input.seek(index1_0);
+ if ( s>=0 ) return s;
+ break;
+ case 1 :
+ var LA1_1 = input.LA(1);
+
+
+ var index1_1 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (LA1_1==ENCODING||LA1_1==VERSION) ) {s = 6;}
+
+ else if ( (LA1_1==AND||(LA1_1>=CAST && LA1_1<=CASTABLE)||LA1_1==DIV||LA1_1==EQ||LA1_1==EXCEPT||LA1_1==GE||(LA1_1>=GT && LA1_1<=IDIV)||(LA1_1>=INSTANCE && LA1_1<=IS)||LA1_1==LE||(LA1_1>=LT && LA1_1<=MOD)||LA1_1==NE||LA1_1==OR||(LA1_1>=TO && LA1_1<=TREAT)||LA1_1==UNION||LA1_1==CONTAINS||(LA1_1>=CONCAT && LA1_1<=LPAREN)||LA1_1==LSQUARE||LA1_1==EQUAL||LA1_1==NOTEQUAL||LA1_1==HASH||LA1_1==COMMA||(LA1_1>=STAR && LA1_1<=BANG)||LA1_1==COLON||LA1_1==VBAR) ) {s = 7;}
+
+ else if ( (LA1_1==SEMICOLON) && ((this.lc(XQS)))) {s = 8;}
+
+ else if ( (LA1_1==EOF) ) {s = 9;}
+
+
+ input.seek(index1_1);
+ if ( s>=0 ) return s;
+ break;
+ }
+ }).call(this.recognizer, s, input);
+ if (!org.antlr.lang.isUndefined(retval)) {
+ return retval;
+ }
+ if (this.recognizer.state.backtracking>0) {this.recognizer.state.failed=true; return -1;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException(this.getDescription(), 1, _s, input);
+ this.error(nvae);
+ throw nvae;
+ },
+ dummy: null
+});
+org.antlr.lang.augmentObject(XQueryParser, {
+ DFA2_eotS:
+ "\u000a\uffff",
+ DFA2_eofS:
+ "\u0001\u0005\u0001\u0009\u0008\uffff",
+ DFA2_minS:
+ "\u0001\u0010\u0001\u0012\u0008\uffff",
+ DFA2_maxS:
+ "\u0001\u0122\u0001\u0107\u0008\uffff",
+ DFA2_acceptS:
+ "\u0002\uffff\u0004\u0002\u0001\u0001\u0003\u0002",
+ DFA2_specialS:
+ "\u0001\u0001\u0001\u0000\u0008\uffff}>",
+ DFA2_transitionS: [
+ "\u0002\u0002\u0004\u0004\u0001\u0002\u0006\u0004\u0001\u0002"+
+ "\u0001\u0004\u0001\u0002\u0002\u0004\u0001\u0002\u0001\u0004"+
+ "\u0002\u0002\u0002\u0004\u0003\u0002\u0005\u0004\u0001\u0002"+
+ "\u0002\u0004\u0003\u0002\u0005\u0004\u0002\u0002\u0009\u0004"+
+ "\u0001\u0002\u0002\u0004\u0001\u0001\u0001\u0002\u0003\u0004"+
+ "\u0001\u0002\u0005\u0004\u0001\u0002\u0001\u0004\u0003\u0002"+
+ "\u0001\u0004\u0001\u0002\u0007\u0004\u0004\u0002\u0003\u0004"+
+ "\u0001\u0002\u0003\u0004\u0001\u0002\u0001\u0004\u0003\u0002"+
+ "\u000f\u0004\u0001\u0002\u0009\u0004\u0002\u0002\u0007\u0004"+
+ "\u0002\u0002\u0001\u0004\u0001\u0002\u0002\u0004\u0001\u0002"+
+ "\u0003\u0004\u0002\u0002\u0002\u0004\u0001\u0002\u002c\u0004"+
+ "\u0003\u0002\u0002\u0004\u0001\u0002\u000d\u0004\u0001\uffff"+
+ "\u0001\u0002\u0001\uffff\u0002\u0002\u0001\uffff\u0001\u0002"+
+ "\u0001\uffff\u0001\u0002\u0004\uffff\u0001\u0003\u0004\uffff"+
+ "\u0004\u0002\u0005\uffff\u0002\u0002\u0001\uffff\u0002\u0002"+
+ "\u000c\uffff\u0002\u0002\u0002\uffff\u0002\u0002\u0002\uffff"+
+ "\u0001\u0004\u0006\uffff\u0006\u0002",
+ "\u0001\u0007\u0008\uffff\u0002\u0007\u000a\uffff\u0001\u0007"+
+ "\u0007\uffff\u0001\u0007\u0001\uffff\u0001\u0007\u0005\uffff"+
+ "\u0001\u0007\u0001\uffff\u0002\u0007\u0004\uffff\u0003\u0007"+
+ "\u0002\uffff\u0001\u0007\u0002\uffff\u0002\u0007\u0001\uffff"+
+ "\u0001\u0006\u0001\u0007\u0006\uffff\u0001\u0007\u0018\uffff"+
+ "\u0002\u0007\u0001\uffff\u0001\u0007\u0038\uffff\u0001\u0007"+
+ "\u003a\uffff\u0002\u0007\u0006\uffff\u0001\u0007\u0001\uffff"+
+ "\u0001\u0007\u0001\uffff\u0001\u0007\u0001\uffff\u0001\u0007"+
+ "\u0001\uffff\u0001\u0007\u0001\uffff\u000c\u0007\u0002\uffff"+
+ "\u0001\u0007\u0003\uffff\u0001\u0008\u0001\u0007",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ ""
+ ]
+});
+
+org.antlr.lang.augmentObject(XQueryParser, {
+ DFA2_eot:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA2_eotS),
+ DFA2_eof:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA2_eofS),
+ DFA2_min:
+ org.antlr.runtime.DFA.unpackEncodedStringToUnsignedChars(XQueryParser.DFA2_minS),
+ DFA2_max:
+ org.antlr.runtime.DFA.unpackEncodedStringToUnsignedChars(XQueryParser.DFA2_maxS),
+ DFA2_accept:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA2_acceptS),
+ DFA2_special:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA2_specialS),
+ DFA2_transition: (function() {
+ var a = [],
+ i,
+ numStates = XQueryParser.DFA2_transitionS.length;
+ for (i=0; i<numStates; i++) {
+ a.push(org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA2_transitionS[i]));
+ }
+ return a;
+ })()
+});
+
+XQueryParser.DFA2 = function(recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 2;
+ this.eot = XQueryParser.DFA2_eot;
+ this.eof = XQueryParser.DFA2_eof;
+ this.min = XQueryParser.DFA2_min;
+ this.max = XQueryParser.DFA2_max;
+ this.accept = XQueryParser.DFA2_accept;
+ this.special = XQueryParser.DFA2_special;
+ this.transition = XQueryParser.DFA2_transition;
+};
+
+org.antlr.lang.extend(XQueryParser.DFA2, org.antlr.runtime.DFA, {
+ getDescription: function() {
+ return "294:13: (lm= p_LibraryModule[$vd.tree] -> | mm= p_MainModule[$vd.tree] ->)";
+ },
+ specialStateTransition: function(s, input) {
+ var _s = s;
+ var retval = (function(s, input) {
+ switch ( s ) {
+ case 0 :
+ var LA2_1 = input.LA(1);
+
+
+ var index2_1 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (LA2_1==NAMESPACE) ) {s = 6;}
+
+ else if ( (LA2_1==AND||(LA2_1>=CAST && LA2_1<=CASTABLE)||LA2_1==DIV||LA2_1==EQ||LA2_1==EXCEPT||LA2_1==GE||(LA2_1>=GT && LA2_1<=IDIV)||(LA2_1>=INSTANCE && LA2_1<=IS)||LA2_1==LE||(LA2_1>=LT && LA2_1<=MOD)||LA2_1==NE||LA2_1==OR||(LA2_1>=TO && LA2_1<=TREAT)||LA2_1==UNION||LA2_1==CONTAINS||(LA2_1>=CONCAT && LA2_1<=LPAREN)||LA2_1==LSQUARE||LA2_1==EQUAL||LA2_1==NOTEQUAL||LA2_1==HASH||LA2_1==COMMA||(LA2_1>=STAR && LA2_1<=BANG)||LA2_1==COLON||LA2_1==VBAR) ) {s = 7;}
+
+ else if ( (LA2_1==SEMICOLON) && ((this.lc(XQS)))) {s = 8;}
+
+ else if ( (LA2_1==EOF) ) {s = 9;}
+
+
+ input.seek(index2_1);
+ if ( s>=0 ) return s;
+ break;
+ case 1 :
+ var LA2_0 = input.LA(1);
+
+
+ var index2_0 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (LA2_0==MODULE) ) {s = 1;}
+
+ else if ( ((LA2_0>=ANCESTOR && LA2_0<=ANCESTOR_OR_SELF)||LA2_0==ATTRIBUTE||LA2_0==CHILD||LA2_0==COMMENT||LA2_0==DECLARE||(LA2_0>=DESCENDANT && LA2_0<=DESCENDANT_OR_SELF)||(LA2_0>=DOCUMENT && LA2_0<=ELEMENT)||LA2_0==EVERY||(LA2_0>=FOLLOWING && LA2_0<=FOR)||(LA2_0>=IF && LA2_0<=IMPORT)||LA2_0==LET||LA2_0==NAMESPACE||LA2_0==NODE||LA2_0==ORDERED||(LA2_0>=PARENT && LA2_0<=PRECEDING_SIBLING)||LA2_0==PROCESSING_INSTRUCTION||(LA2_0>=SCHEMA_ATTRIBUTE && LA2_0<=SOME)||LA2_0==TEXT||LA2_0==TYPESWITCH||(LA2_0>=UNORDERED && LA2_0<=VARIABLE)||LA2_0==NAMESPACE_NODE||(LA2_0>=SWITCH && LA2_0<=TRY)||(LA2_0>=COPY && LA2_0<=DELETE)||LA2_0==INSERT||LA2_0==APPEND||(LA2_0>=RENAME && LA2_0<=REPLACE)||LA2_0==UPDATING||(LA2_0>=BREAK && LA2_0<=EXIT)||LA2_0==WHILE||LA2_0==LPAREN||(LA2_0>=DOLLAR && LA2_0<=L_UNION_BRACKET)||LA2_0==LBRACKET||LA2_0==LSQUARE||(LA2_0>=STAR && LA2_0<=SMALLER)||(LA2_0>=SLASH && LA2_0<=SLASH_SLASH)||(LA2_0>=DOT && LA2_0<=DOT_DOT)||(LA2_0>=ATTR_SIGN && LA2_0<=Q)||(LA2_0>=APOS && LA2_0<=QUOT)||(LA2_0>=L_Pragma && LA2_0<=L_DoubleLiteral)) ) {s = 2;}
+
+ else if ( (LA2_0==ANN_PERCENT) && ((this.lc(XQS)))) {s = 3;}
+
+ else if ( ((LA2_0>=AND && LA2_0<=AT)||(LA2_0>=BASE_URI && LA2_0<=CASTABLE)||LA2_0==COLLATION||(LA2_0>=CONSTRUCTION && LA2_0<=COPY_NAMESPACES)||LA2_0==DEFAULT||(LA2_0>=DESCENDING && LA2_0<=DIV)||(LA2_0>=ELSE && LA2_0<=EQ)||(LA2_0>=EXCEPT && LA2_0<=EXTERNAL)||(LA2_0>=FUNCTION && LA2_0<=IDIV)||(LA2_0>=IN && LA2_0<=LEAST)||(LA2_0>=LT && LA2_0<=MOD)||(LA2_0>=NE && LA2_0<=NO_PRESERVE)||(LA2_0>=JSON && LA2_0<=ORDER)||LA2_0==ORDERING||LA2_0==PRESERVE||(LA2_0>=STRUCTURED_ITEM && LA2_0<=SCHEMA)||(LA2_0>=STABLE && LA2_0<=STRIP)||(LA2_0>=THEN && LA2_0<=TREAT)||LA2_0==UNION||(LA2_0>=VERSION && LA2_0<=MINUS_SIGN)||(LA2_0>=NAN && LA2_0<=START)||(LA2_0>=TUMBLING && LA2_0<=BEFORE)||LA2_0==FIRST||(LA2_0>=INTO && LA2_0<=POSITION)||(LA2_0>=LAST && LA2_0<=NODES)||(LA2_0>=REVALIDATION && LA2_0<=SKIP)||(LA2_0>=VALUE && LA2_0<=WORDS)||(LA2_0>=LOOP && LA2_0<=RETURNING)||(LA2_0>=CHECK && LA2_0<=QUOT_ER)||LA2_0==L_NCName) ) {s = 4;}
+
+ else if ( (LA2_0==EOF) && ((this.lc(XQS)))) {s = 5;}
+
+
+ input.seek(index2_0);
+ if ( s>=0 ) return s;
+ break;
+ }
+ }).call(this.recognizer, s, input);
+ if (!org.antlr.lang.isUndefined(retval)) {
+ return retval;
+ }
+ if (this.recognizer.state.backtracking>0) {this.recognizer.state.failed=true; return -1;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException(this.getDescription(), 2, _s, input);
+ this.error(nvae);
+ throw nvae;
+ },
+ dummy: null
+});
+org.antlr.lang.augmentObject(XQueryParser, {
+ DFA6_eotS:
+ "\u000a\uffff",
+ DFA6_eofS:
+ "\u0001\u0005\u0001\u0009\u0002\uffff\u0001\u0009\u0005\uffff",
+ DFA6_minS:
+ "\u0001\u0010\u0001\u0012\u0002\uffff\u0001\u0012\u0005\uffff",
+ DFA6_maxS:
+ "\u0001\u0122\u0001\u0107\u0002\uffff\u0001\u0107\u0005\uffff",
+ DFA6_acceptS:
+ "\u0002\uffff\u0002\u0002\u0001\uffff\u0001\u0002\u0002\u0001\u0002"+
+ "\u0002",
+ DFA6_specialS:
+ "\u0001\u0000\u0001\u0002\u0002\uffff\u0001\u0001\u0005\uffff}>",
+ DFA6_transitionS: [
+ "\u0002\u0002\u0004\u0005\u0001\u0002\u0006\u0005\u0001\u0002"+
+ "\u0001\u0005\u0001\u0002\u0002\u0005\u0001\u0001\u0001\u0005"+
+ "\u0002\u0002\u0002\u0005\u0003\u0002\u0005\u0005\u0001\u0002"+
+ "\u0002\u0005\u0003\u0002\u0005\u0005\u0001\u0002\u0001\u0004"+
+ "\u0009\u0005\u0001\u0002\u0003\u0005\u0001\u0002\u0003\u0005"+
+ "\u0001\u0002\u0005\u0005\u0001\u0002\u0001\u0005\u0003\u0002"+
+ "\u0001\u0005\u0001\u0002\u0007\u0005\u0004\u0002\u0003\u0005"+
+ "\u0001\u0002\u0003\u0005\u0001\u0002\u0001\u0005\u0003\u0002"+
+ "\u000f\u0005\u0001\u0002\u0009\u0005\u0002\u0002\u0007\u0005"+
+ "\u0002\u0002\u0001\u0005\u0001\u0002\u0002\u0005\u0001\u0002"+
+ "\u0003\u0005\u0002\u0002\u0002\u0005\u0001\u0002\u002c\u0005"+
+ "\u0003\u0002\u0002\u0005\u0001\u0002\u000d\u0005\u0001\uffff"+
+ "\u0001\u0002\u0001\uffff\u0002\u0002\u0001\uffff\u0001\u0002"+
+ "\u0001\uffff\u0001\u0002\u0004\uffff\u0001\u0003\u0004\uffff"+
+ "\u0004\u0002\u0005\uffff\u0002\u0002\u0001\uffff\u0002\u0002"+
+ "\u000c\uffff\u0002\u0002\u0002\uffff\u0002\u0002\u0002\uffff"+
+ "\u0001\u0005\u0006\uffff\u0006\u0002",
+ "\u0001\u0005\u0004\uffff\u0002\u0007\u0002\uffff\u0002\u0005"+
+ "\u0003\uffff\u0002\u0007\u0001\uffff\u0001\u0007\u0003\uffff"+
+ "\u0001\u0005\u0007\uffff\u0001\u0005\u0001\uffff\u0001\u0005"+
+ "\u0004\uffff\u0002\u0005\u0001\uffff\u0002\u0005\u0004\uffff"+
+ "\u0003\u0005\u0002\uffff\u0001\u0005\u0002\uffff\u0002\u0005"+
+ "\u0001\uffff\u0001\u0007\u0001\u0005\u0005\uffff\u0002\u0005"+
+ "\u0002\uffff\u0001\u0007\u0015\uffff\u0002\u0005\u0001\uffff"+
+ "\u0001\u0005\u0002\uffff\u0001\u0005\u0005\uffff\u0001\u0005"+
+ "\u0001\uffff\u0001\u0007\u0026\uffff\u0001\u0006\u0001\uffff"+
+ "\u0001\u0005\u0004\uffff\u0001\u0005\u0007\uffff\u0001\u0007"+
+ "\u0026\uffff\u0001\u0005\u0003\uffff\u0002\u0005\u0006\uffff"+
+ "\u0002\u0005\u0006\uffff\u0001\u0005\u0001\uffff\u0001\u0005"+
+ "\u0001\uffff\u0003\u0005\u0001\uffff\u0001\u0005\u0001\uffff"+
+ "\u000c\u0005\u0002\uffff\u0001\u0005\u0003\uffff\u0001\u0008"+
+ "\u0001\u0005",
+ "",
+ "",
+ "\u0001\u0009\u0008\uffff\u0002\u0009\u000a\uffff\u0001\u0009"+
+ "\u0007\uffff\u0001\u0009\u0001\uffff\u0001\u0009\u0005\uffff"+
+ "\u0001\u0009\u0001\uffff\u0002\u0009\u0004\uffff\u0003\u0009"+
+ "\u0002\uffff\u0001\u0009\u0002\uffff\u0002\u0009\u0001\u0007"+
+ "\u0001\uffff\u0001\u0009\u0006\uffff\u0001\u0009\u000e\uffff"+
+ "\u0001\u0007\u0009\uffff\u0002\u0009\u0001\uffff\u0001\u0009"+
+ "\u0038\uffff\u0001\u0009\u003a\uffff\u0002\u0009\u0006\uffff"+
+ "\u0001\u0009\u0001\uffff\u0001\u0009\u0001\uffff\u0001\u0009"+
+ "\u0001\uffff\u0001\u0009\u0001\uffff\u0001\u0009\u0001\uffff"+
+ "\u000c\u0009\u0002\uffff\u0001\u0009\u0003\uffff\u0001\u0008"+
+ "\u0001\u0009",
+ "",
+ "",
+ "",
+ "",
+ ""
+ ]
+});
+
+org.antlr.lang.augmentObject(XQueryParser, {
+ DFA6_eot:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA6_eotS),
+ DFA6_eof:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA6_eofS),
+ DFA6_min:
+ org.antlr.runtime.DFA.unpackEncodedStringToUnsignedChars(XQueryParser.DFA6_minS),
+ DFA6_max:
+ org.antlr.runtime.DFA.unpackEncodedStringToUnsignedChars(XQueryParser.DFA6_maxS),
+ DFA6_accept:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA6_acceptS),
+ DFA6_special:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA6_specialS),
+ DFA6_transition: (function() {
+ var a = [],
+ i,
+ numStates = XQueryParser.DFA6_transitionS.length;
+ for (i=0; i<numStates; i++) {
+ a.push(org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA6_transitionS[i]));
+ }
+ return a;
+ })()
+});
+
+XQueryParser.DFA6 = function(recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 6;
+ this.eot = XQueryParser.DFA6_eot;
+ this.eof = XQueryParser.DFA6_eof;
+ this.min = XQueryParser.DFA6_min;
+ this.max = XQueryParser.DFA6_max;
+ this.accept = XQueryParser.DFA6_accept;
+ this.special = XQueryParser.DFA6_special;
+ this.transition = XQueryParser.DFA6_transition;
+};
+
+org.antlr.lang.extend(XQueryParser.DFA6, org.antlr.runtime.DFA, {
+ getDescription: function() {
+ return "()* loopback of 329:11: ( (dnd+= pm_DefaultNamespaceDecl | s+= p_Setter | nd+= pm_NamespaceDecl | i+= p_Import | fto+= pm_FTOptionDecl ) )*";
+ },
+ specialStateTransition: function(s, input) {
+ var _s = s;
+ var retval = (function(s, input) {
+ switch ( s ) {
+ case 0 :
+ var LA6_0 = input.LA(1);
+
+
+ var index6_0 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (LA6_0==DECLARE) ) {s = 1;}
+
+ else if ( ((LA6_0>=ANCESTOR && LA6_0<=ANCESTOR_OR_SELF)||LA6_0==ATTRIBUTE||LA6_0==CHILD||LA6_0==COMMENT||(LA6_0>=DESCENDANT && LA6_0<=DESCENDANT_OR_SELF)||(LA6_0>=DOCUMENT && LA6_0<=ELEMENT)||LA6_0==EVERY||(LA6_0>=FOLLOWING && LA6_0<=FOR)||LA6_0==IF||LA6_0==LET||LA6_0==NAMESPACE||LA6_0==NODE||LA6_0==ORDERED||(LA6_0>=PARENT && LA6_0<=PRECEDING_SIBLING)||LA6_0==PROCESSING_INSTRUCTION||(LA6_0>=SCHEMA_ATTRIBUTE && LA6_0<=SOME)||LA6_0==TEXT||LA6_0==TYPESWITCH||(LA6_0>=UNORDERED && LA6_0<=VARIABLE)||LA6_0==NAMESPACE_NODE||(LA6_0>=SWITCH && LA6_0<=TRY)||(LA6_0>=COPY && LA6_0<=DELETE)||LA6_0==INSERT||LA6_0==APPEND||(LA6_0>=RENAME && LA6_0<=REPLACE)||LA6_0==UPDATING||(LA6_0>=BREAK && LA6_0<=EXIT)||LA6_0==WHILE||LA6_0==LPAREN||(LA6_0>=DOLLAR && LA6_0<=L_UNION_BRACKET)||LA6_0==LBRACKET||LA6_0==LSQUARE||(LA6_0>=STAR && LA6_0<=SMALLER)||(LA6_0>=SLASH && LA6_0<=SLASH_SLASH)||(LA6_0>=DOT && LA6_0<=DOT_DOT)||(LA6_0>=ATTR_SIGN && LA6_0<=Q)||(LA6_0>=APOS && LA6_0<=QUOT)||(LA6_0>=L_Pragma && LA6_0<=L_DoubleLiteral)) ) {s = 2;}
+
+ else if ( (LA6_0==ANN_PERCENT) && ((this.lc(XQS)))) {s = 3;}
+
+ else if ( (LA6_0==IMPORT) ) {s = 4;}
+
+ else if ( (LA6_0==EOF||(LA6_0>=AND && LA6_0<=AT)||(LA6_0>=BASE_URI && LA6_0<=CASTABLE)||LA6_0==COLLATION||(LA6_0>=CONSTRUCTION && LA6_0<=COPY_NAMESPACES)||LA6_0==DEFAULT||(LA6_0>=DESCENDING && LA6_0<=DIV)||(LA6_0>=ELSE && LA6_0<=EQ)||(LA6_0>=EXCEPT && LA6_0<=EXTERNAL)||(LA6_0>=FUNCTION && LA6_0<=IDIV)||(LA6_0>=IN && LA6_0<=LEAST)||(LA6_0>=LT && LA6_0<=MODULE)||(LA6_0>=NE && LA6_0<=NO_PRESERVE)||(LA6_0>=JSON && LA6_0<=ORDER)||LA6_0==ORDERING||LA6_0==PRESERVE||(LA6_0>=STRUCTURED_ITEM && LA6_0<=SCHEMA)||(LA6_0>=STABLE && LA6_0<=STRIP)||(LA6_0>=THEN && LA6_0<=TREAT)||LA6_0==UNION||(LA6_0>=VERSION && LA6_0<=MINUS_SIGN)||(LA6_0>=NAN && LA6_0<=START)||(LA6_0>=TUMBLING && LA6_0<=BEFORE)||LA6_0==FIRST||(LA6_0>=INTO && LA6_0<=POSITION)||(LA6_0>=LAST && LA6_0<=NODES)||(LA6_0>=REVALIDATION && LA6_0<=SKIP)||(LA6_0>=VALUE && LA6_0<=WORDS)||(LA6_0>=LOOP && LA6_0<=RETURNING)||(LA6_0>=CHECK && LA6_0<=QUOT_ER)||LA6_0==L_NCName) ) {s = 5;}
+
+
+ input.seek(index6_0);
+ if ( s>=0 ) return s;
+ break;
+ case 1 :
+ var LA6_4 = input.LA(1);
+
+
+ var index6_4 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (LA6_4==EOF||LA6_4==AND||(LA6_4>=CAST && LA6_4<=CASTABLE)||LA6_4==DIV||LA6_4==EQ||LA6_4==EXCEPT||LA6_4==GE||(LA6_4>=GT && LA6_4<=IDIV)||(LA6_4>=INSTANCE && LA6_4<=IS)||LA6_4==LE||(LA6_4>=LT && LA6_4<=MOD)||LA6_4==NE||LA6_4==OR||(LA6_4>=TO && LA6_4<=TREAT)||LA6_4==UNION||LA6_4==CONTAINS||(LA6_4>=CONCAT && LA6_4<=LPAREN)||LA6_4==LSQUARE||LA6_4==EQUAL||LA6_4==NOTEQUAL||LA6_4==HASH||LA6_4==COMMA||(LA6_4>=STAR && LA6_4<=BANG)||LA6_4==COLON||LA6_4==VBAR) ) {s = 9;}
+
+ else if ( (LA6_4==SEMICOLON) && ((this.lc(XQS)))) {s = 8;}
+
+ else if ( (LA6_4==MODULE||LA6_4==SCHEMA) ) {s = 7;}
+
+
+ input.seek(index6_4);
+ if ( s>=0 ) return s;
+ break;
+ case 2 :
+ var LA6_1 = input.LA(1);
+
+
+ var index6_1 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (LA6_1==REVALIDATION) && ((this.lc(XQU)))) {s = 6;}
+
+ else if ( ((LA6_1>=BASE_URI && LA6_1<=BOUNDARY_SPACE)||(LA6_1>=CONSTRUCTION && LA6_1<=COPY_NAMESPACES)||LA6_1==DEFAULT||LA6_1==NAMESPACE||LA6_1==ORDERING||LA6_1==DECIMAL_FORMAT||LA6_1==FT_OPTION) ) {s = 7;}
+
+ else if ( (LA6_1==AND||(LA6_1>=CAST && LA6_1<=CASTABLE)||LA6_1==DIV||LA6_1==EQ||LA6_1==EXCEPT||(LA6_1>=FUNCTION && LA6_1<=GE)||(LA6_1>=GT && LA6_1<=IDIV)||(LA6_1>=INSTANCE && LA6_1<=IS)||LA6_1==LE||(LA6_1>=LT && LA6_1<=MOD)||LA6_1==NE||(LA6_1>=OPTION && LA6_1<=OR)||(LA6_1>=TO && LA6_1<=TREAT)||LA6_1==UNION||LA6_1==VARIABLE||LA6_1==CONTEXT||LA6_1==UPDATING||LA6_1==CONTAINS||LA6_1==COLLECTION||(LA6_1>=INDEX && LA6_1<=INTEGRITY)||(LA6_1>=CONCAT && LA6_1<=LPAREN)||LA6_1==LSQUARE||LA6_1==EQUAL||(LA6_1>=NOTEQUAL && LA6_1<=HASH)||LA6_1==COMMA||(LA6_1>=STAR && LA6_1<=BANG)||LA6_1==COLON||LA6_1==VBAR) ) {s = 5;}
+
+ else if ( (LA6_1==SEMICOLON) && ((this.lc(XQS)))) {s = 8;}
+
+ else if ( (LA6_1==EOF) ) {s = 9;}
+
+
+ input.seek(index6_1);
+ if ( s>=0 ) return s;
+ break;
+ }
+ }).call(this.recognizer, s, input);
+ if (!org.antlr.lang.isUndefined(retval)) {
+ return retval;
+ }
+ if (this.recognizer.state.backtracking>0) {this.recognizer.state.failed=true; return -1;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException(this.getDescription(), 6, _s, input);
+ this.error(nvae);
+ throw nvae;
+ },
+ dummy: null
+});
+org.antlr.lang.augmentObject(XQueryParser, {
+ DFA9_eotS:
+ "\u000c\uffff",
+ DFA9_eofS:
+ "\u000c\uffff",
+ DFA9_minS:
+ "\u0001\u0022\u0001\u0017\u0002\uffff\u0001\u001e\u0007\uffff",
+ DFA9_maxS:
+ "\u0001\u0022\u0001\u00a0\u0002\uffff\u0001\u0079\u0007\uffff",
+ DFA9_acceptS:
+ "\u0002\uffff\u0001\u0007\u0001\u0001\u0001\uffff\u0001\u0003\u0001"+
+ "\u0004\u0001\u0005\u0001\u0008\u0001\u0009\u0001\u0002\u0001\u0006",
+ DFA9_specialS:
+ "\u0001\uffff\u0001\u0000\u000a\uffff}>",
+ DFA9_transitionS: [
+ "\u0001\u0001",
+ "\u0001\u0005\u0001\u0003\u0007\uffff\u0001\u0006\u0001\u0008"+
+ "\u0001\uffff\u0001\u0004\u0031\uffff\u0001\u0007\u0023\uffff"+
+ "\u0001\u0009\u0026\uffff\u0001\u0002",
+ "",
+ "",
+ "\u0001\u000a\u0034\uffff\u0001\u000b\u0025\uffff\u0001\u0009",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ ""
+ ]
+});
+
+org.antlr.lang.augmentObject(XQueryParser, {
+ DFA9_eot:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA9_eotS),
+ DFA9_eof:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA9_eofS),
+ DFA9_min:
+ org.antlr.runtime.DFA.unpackEncodedStringToUnsignedChars(XQueryParser.DFA9_minS),
+ DFA9_max:
+ org.antlr.runtime.DFA.unpackEncodedStringToUnsignedChars(XQueryParser.DFA9_maxS),
+ DFA9_accept:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA9_acceptS),
+ DFA9_special:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA9_specialS),
+ DFA9_transition: (function() {
+ var a = [],
+ i,
+ numStates = XQueryParser.DFA9_transitionS.length;
+ for (i=0; i<numStates; i++) {
+ a.push(org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA9_transitionS[i]));
+ }
+ return a;
+ })()
+});
+
+XQueryParser.DFA9 = function(recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 9;
+ this.eot = XQueryParser.DFA9_eot;
+ this.eof = XQueryParser.DFA9_eof;
+ this.min = XQueryParser.DFA9_min;
+ this.max = XQueryParser.DFA9_max;
+ this.accept = XQueryParser.DFA9_accept;
+ this.special = XQueryParser.DFA9_special;
+ this.transition = XQueryParser.DFA9_transition;
+};
+
+org.antlr.lang.extend(XQueryParser.DFA9, org.antlr.runtime.DFA, {
+ getDescription: function() {
+ return "355:1: p_Setter : ( pm_BoundarySpaceDecl | pm_DefaultCollationDecl | pm_BaseURIDecl | pm_ConstructionDecl | pm_OrderingModeDecl | pm_EmptyOrderDecl | {...}? => pm_RevalidationDecl | pm_CopyNamespacesDecl | pm_DecimalFormatDecl );";
+ },
+ specialStateTransition: function(s, input) {
+ var _s = s;
+ var retval = (function(s, input) {
+ switch ( s ) {
+ case 0 :
+ var LA9_1 = input.LA(1);
+
+
+ var index9_1 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (LA9_1==REVALIDATION) && ((this.lc(XQU)))) {s = 2;}
+
+ else if ( (LA9_1==BOUNDARY_SPACE) ) {s = 3;}
+
+ else if ( (LA9_1==DEFAULT) ) {s = 4;}
+
+ else if ( (LA9_1==BASE_URI) ) {s = 5;}
+
+ else if ( (LA9_1==CONSTRUCTION) ) {s = 6;}
+
+ else if ( (LA9_1==ORDERING) ) {s = 7;}
+
+ else if ( (LA9_1==COPY_NAMESPACES) ) {s = 8;}
+
+ else if ( (LA9_1==DECIMAL_FORMAT) ) {s = 9;}
+
+
+ input.seek(index9_1);
+ if ( s>=0 ) return s;
+ break;
+ }
+ }).call(this.recognizer, s, input);
+ if (!org.antlr.lang.isUndefined(retval)) {
+ return retval;
+ }
+ if (this.recognizer.state.backtracking>0) {this.recognizer.state.failed=true; return -1;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException(this.getDescription(), 9, _s, input);
+ this.error(nvae);
+ throw nvae;
+ },
+ dummy: null
+});
+org.antlr.lang.augmentObject(XQueryParser, {
+ DFA44_eotS:
+ "\u004b\uffff",
+ DFA44_eofS:
+ "\u0001\u0046\u004a\uffff",
+ DFA44_minS:
+ "\u0001\u0010\u0045\u0000\u0001\uffff\u0002\u0000\u0002\uffff",
+ DFA44_maxS:
+ "\u0001\u0122\u0045\u0000\u0001\uffff\u0002\u0000\u0002\uffff",
+ DFA44_acceptS:
+ "\u0046\uffff\u0001\u0001\u0003\uffff\u0001\u0002",
+ DFA44_specialS:
+ "\u0001\u0000\u0001\u0001\u0001\u0002\u0001\u0003\u0001\u0004\u0001"+
+ "\u0005\u0001\u0006\u0001\u0007\u0001\u0008\u0001\u0009\u0001\u000a\u0001"+
+ "\u000b\u0001\u000c\u0001\u000d\u0001\u000e\u0001\u000f\u0001\u0010\u0001"+
+ "\u0011\u0001\u0012\u0001\u0013\u0001\u0014\u0001\u0015\u0001\u0016\u0001"+
+ "\u0017\u0001\u0018\u0001\u0019\u0001\u001a\u0001\u001b\u0001\u001c\u0001"+
+ "\u001d\u0001\u001e\u0001\u001f\u0001\u0020\u0001\u0021\u0001\u0022\u0001"+
+ "\u0023\u0001\u0024\u0001\u0025\u0001\u0026\u0001\u0027\u0001\u0028\u0001"+
+ "\u0029\u0001\u002a\u0001\u002b\u0001\u002c\u0001\u002d\u0001\u002e\u0001"+
+ "\u002f\u0001\u0030\u0001\u0031\u0001\u0032\u0001\u0033\u0001\u0034\u0001"+
+ "\u0035\u0001\u0036\u0001\u0037\u0001\u0038\u0001\u0039\u0001\u003a\u0001"+
+ "\u003b\u0001\u003c\u0001\u003d\u0001\u003e\u0001\u003f\u0001\u0040\u0001"+
+ "\u0041\u0001\u0042\u0001\u0043\u0001\u0044\u0001\u0045\u0001\uffff\u0001"+
+ "\u0046\u0001\u0047\u0002\uffff}>",
+ DFA44_transitionS: [
+ "\u0001\u0029\u0001\u002c\u0004\u0047\u0001\u001f\u0006\u0047"+
+ "\u0001\u002d\u0001\u0047\u0001\u0022\u0004\u0047\u0001\u002f"+
+ "\u0001\u0031\u0002\u0047\u0001\u001a\u0001\u0024\u0001\u0017"+
+ "\u0002\u0047\u0001\u0048\u0002\u0047\u0001\u0008\u0002\u0047"+
+ "\u0001\u0033\u0001\u0032\u0001\u0001\u0005\u0047\u0001\u0003"+
+ "\u0006\u0047\u0001\u0048\u0003\u0047\u0001\u0002\u0003\u0047"+
+ "\u0001\u001e\u0003\u0047\u0001\u0039\u0005\u0047\u0001\u0016"+
+ "\u0001\u0047\u0001\u0021\u0001\u002b\u0001\u002a\u0001\u0047"+
+ "\u0001\u0023\u0004\u0048\u0003\u0047\u0001\u0037\u0001\u0036"+
+ "\u0001\u0030\u0001\u0007\u0003\u0047\u0001\u0020\u0003\u0047"+
+ "\u0001\u0005\u0001\u0047\u0001\u0019\u0001\u000b\u0001\u0045"+
+ "\u000f\u0047\u0001\u0038\u0009\u0047\u0001\u0004\u0001\u0006"+
+ "\u0007\u0047\u0001\u0040\u0001\u003d\u0001\u0047\u0001\u0034"+
+ "\u0002\u0047\u0001\u0041\u0003\u0047\u0001\u003e\u0001\u003f"+
+ "\u0002\u0047\u0001\u0018\u002c\u0047\u0001\u0042\u0001\u0043"+
+ "\u0001\u0044\u0002\u0047\u0001\u003a\u000d\u0047\u0001\uffff"+
+ "\u0001\u000e\u0001\uffff\u0001\u0014\u0001\u0028\u0001\uffff"+
+ "\u0001\u0025\u0001\uffff\u0001\u0027\u0004\uffff\u0001\u0046"+
+ "\u0004\uffff\u0001\u003b\u0001\u0009\u0001\u000a\u0001\u001b"+
+ "\u0005\uffff\u0001\u000c\u0001\u000d\u0001\uffff\u0001\u0015"+
+ "\u0001\u002e\u000c\uffff\u0001\u0035\u0001\u0026\u0002\uffff"+
+ "\u0001\u0013\u0001\u0012\u0002\uffff\u0001\u0047\u0006\uffff"+
+ "\u0001\u003c\u0001\u001c\u0001\u001d\u0001\u000f\u0001\u0010"+
+ "\u0001\u0011",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "",
+ ""
+ ]
+});
+
+org.antlr.lang.augmentObject(XQueryParser, {
+ DFA44_eot:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA44_eotS),
+ DFA44_eof:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA44_eofS),
+ DFA44_min:
+ org.antlr.runtime.DFA.unpackEncodedStringToUnsignedChars(XQueryParser.DFA44_minS),
+ DFA44_max:
+ org.antlr.runtime.DFA.unpackEncodedStringToUnsignedChars(XQueryParser.DFA44_maxS),
+ DFA44_accept:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA44_acceptS),
+ DFA44_special:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA44_specialS),
+ DFA44_transition: (function() {
+ var a = [],
+ i,
+ numStates = XQueryParser.DFA44_transitionS.length;
+ for (i=0; i<numStates; i++) {
+ a.push(org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA44_transitionS[i]));
+ }
+ return a;
+ })()
+});
+
+XQueryParser.DFA44 = function(recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 44;
+ this.eot = XQueryParser.DFA44_eot;
+ this.eof = XQueryParser.DFA44_eof;
+ this.min = XQueryParser.DFA44_min;
+ this.max = XQueryParser.DFA44_max;
+ this.accept = XQueryParser.DFA44_accept;
+ this.special = XQueryParser.DFA44_special;
+ this.transition = XQueryParser.DFA44_transition;
+};
+
+org.antlr.lang.extend(XQueryParser.DFA44, org.antlr.runtime.DFA, {
+ getDescription: function() {
+ return "534:1: pm_QueryBody : ({...}? => p_Program | p_Expr[true,true] );";
+ },
+ specialStateTransition: function(s, input) {
+ var _s = s;
+ var retval = (function(s, input) {
+ switch ( s ) {
+ case 0 :
+ var LA44_0 = input.LA(1);
+
+
+ var index44_0 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (LA44_0==FOR) ) {s = 1;}
+
+ else if ( (LA44_0==LET) ) {s = 2;}
+
+ else if ( (LA44_0==IF) ) {s = 3;}
+
+ else if ( (LA44_0==SWITCH) ) {s = 4;}
+
+ else if ( (LA44_0==TYPESWITCH) ) {s = 5;}
+
+ else if ( (LA44_0==TRY) ) {s = 6;}
+
+ else if ( (LA44_0==SOME) ) {s = 7;}
+
+ else if ( (LA44_0==EVERY) ) {s = 8;}
+
+ else if ( (LA44_0==PLUS) ) {s = 9;}
+
+ else if ( (LA44_0==MINUS) ) {s = 10;}
+
+ else if ( (LA44_0==VALIDATE) ) {s = 11;}
+
+ else if ( (LA44_0==SLASH) ) {s = 12;}
+
+ else if ( (LA44_0==SLASH_SLASH) ) {s = 13;}
+
+ else if ( (LA44_0==LPAREN) ) {s = 14;}
+
+ else if ( (LA44_0==L_IntegerLiteral) ) {s = 15;}
+
+ else if ( (LA44_0==L_DecimalLiteral) ) {s = 16;}
+
+ else if ( (LA44_0==L_DoubleLiteral) ) {s = 17;}
+
+ else if ( (LA44_0==QUOT) ) {s = 18;}
+
+ else if ( (LA44_0==APOS) ) {s = 19;}
+
+ else if ( (LA44_0==DOLLAR) ) {s = 20;}
+
+ else if ( (LA44_0==DOT) ) {s = 21;}
+
+ else if ( (LA44_0==ORDERED) ) {s = 22;}
+
+ else if ( (LA44_0==ELEMENT) ) {s = 23;}
+
+ else if ( (LA44_0==UPDATING) ) {s = 24;}
+
+ else if ( (LA44_0==UNORDERED) ) {s = 25;}
+
+ else if ( (LA44_0==DOCUMENT) ) {s = 26;}
+
+ else if ( (LA44_0==SMALLER) ) {s = 27;}
+
+ else if ( (LA44_0==L_DirCommentConstructor) ) {s = 28;}
+
+ else if ( (LA44_0==L_DirPIConstructor) ) {s = 29;}
+
+ else if ( (LA44_0==NAMESPACE) ) {s = 30;}
+
+ else if ( (LA44_0==ATTRIBUTE) ) {s = 31;}
+
+ else if ( (LA44_0==TEXT) ) {s = 32;}
+
+ else if ( (LA44_0==PARENT) ) {s = 33;}
+
+ else if ( (LA44_0==COMMENT) ) {s = 34;}
+
+ else if ( (LA44_0==PROCESSING_INSTRUCTION) ) {s = 35;}
+
+ else if ( (LA44_0==DOCUMENT_NODE) ) {s = 36;}
+
+ else if ( (LA44_0==LBRACKET) ) {s = 37;}
+
+ else if ( (LA44_0==Q) ) {s = 38;}
+
+ else if ( (LA44_0==LSQUARE) ) {s = 39;}
+
+ else if ( (LA44_0==L_UNION_BRACKET) ) {s = 40;}
+
+ else if ( (LA44_0==ANCESTOR) ) {s = 41;}
+
+ else if ( (LA44_0==PRECEDING_SIBLING) ) {s = 42;}
+
+ else if ( (LA44_0==PRECEDING) ) {s = 43;}
+
+ else if ( (LA44_0==ANCESTOR_OR_SELF) ) {s = 44;}
+
+ else if ( (LA44_0==CHILD) ) {s = 45;}
+
+ else if ( (LA44_0==DOT_DOT) ) {s = 46;}
+
+ else if ( (LA44_0==DESCENDANT) ) {s = 47;}
+
+ else if ( (LA44_0==SELF) ) {s = 48;}
+
+ else if ( (LA44_0==DESCENDANT_OR_SELF) ) {s = 49;}
+
+ else if ( (LA44_0==FOLLOWING_SIBLING) ) {s = 50;}
+
+ else if ( (LA44_0==FOLLOWING) ) {s = 51;}
+
+ else if ( (LA44_0==INSERT) ) {s = 52;}
+
+ else if ( (LA44_0==ATTR_SIGN) ) {s = 53;}
+
+ else if ( (LA44_0==SCHEMA_ELEMENT) ) {s = 54;}
+
+ else if ( (LA44_0==SCHEMA_ATTRIBUTE) ) {s = 55;}
+
+ else if ( (LA44_0==NAMESPACE_NODE) ) {s = 56;}
+
+ else if ( (LA44_0==NODE) ) {s = 57;}
+
+ else if ( (LA44_0==WHILE) ) {s = 58;}
+
+ else if ( (LA44_0==STAR) ) {s = 59;}
+
+ else if ( (LA44_0==L_Pragma) ) {s = 60;}
+
+ else if ( (LA44_0==DELETE) ) {s = 61;}
+
+ else if ( (LA44_0==RENAME) ) {s = 62;}
+
+ else if ( (LA44_0==REPLACE) ) {s = 63;}
+
+ else if ( (LA44_0==COPY) ) {s = 64;}
+
+ else if ( (LA44_0==APPEND) ) {s = 65;}
+
+ else if ( (LA44_0==BREAK) ) {s = 66;}
+
+ else if ( (LA44_0==CONTINUE) ) {s = 67;}
+
+ else if ( (LA44_0==EXIT) ) {s = 68;}
+
+ else if ( (LA44_0==VARIABLE) ) {s = 69;}
+
+ else if ( (LA44_0==EOF||LA44_0==ANN_PERCENT) && ((this.lc(XQS)))) {s = 70;}
+
+ else if ( ((LA44_0>=AND && LA44_0<=AT)||(LA44_0>=BASE_URI && LA44_0<=CASTABLE)||LA44_0==COLLATION||(LA44_0>=CONSTRUCTION && LA44_0<=DEFAULT)||(LA44_0>=DESCENDING && LA44_0<=DIV)||(LA44_0>=ELSE && LA44_0<=EMPTY)||(LA44_0>=ENCODING && LA44_0<=EQ)||(LA44_0>=EXCEPT && LA44_0<=EXTERNAL)||(LA44_0>=FUNCTION && LA44_0<=IDIV)||(LA44_0>=IMPORT && LA44_0<=IS)||(LA44_0>=LAX && LA44_0<=LEAST)||(LA44_0>=LT && LA44_0<=MODULE)||(LA44_0>=NE && LA44_0<=NO_PRESERVE)||(LA44_0>=JSON && LA44_0<=ORDER)||LA44_0==ORDERING||LA44_0==PRESERVE||(LA44_0>=RETURN && LA44_0<=SCHEMA)||(LA44_0>=STABLE && LA44_0<=STRIP)||(LA44_0>=THEN && LA44_0<=TREAT)||LA44_0==UNION||(LA44_0>=VERSION && LA44_0<=MINUS_SIGN)||(LA44_0>=NAN && LA44_0<=START)||(LA44_0>=TUMBLING && LA44_0<=BEFORE)||LA44_0==FIRST||(LA44_0>=INTO && LA44_0<=POSITION)||(LA44_0>=LAST && LA44_0<=NODES)||(LA44_0>=REVALIDATION && LA44_0<=SKIP)||(LA44_0>=VALUE && LA44_0<=WORDS)||(LA44_0>=LOOP && LA44_0<=RETURNING)||(LA44_0>=CHECK && LA44_0<=QUOT_ER)||LA44_0==L_NCName) ) {s = 71;}
+
+ else if ( (LA44_0==EMPTY_SEQUENCE||LA44_0==ITEM||(LA44_0>=STRUCTURED_ITEM && LA44_0<=ARRAY)) ) {s = 72;}
+
+
+ input.seek(index44_0);
+ if ( s>=0 ) return s;
+ break;
+ case 1 :
+ var LA44_1 = input.LA(1);
+
+
+ var index44_1 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_1);
+ if ( s>=0 ) return s;
+ break;
+ case 2 :
+ var LA44_2 = input.LA(1);
+
+
+ var index44_2 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_2);
+ if ( s>=0 ) return s;
+ break;
+ case 3 :
+ var LA44_3 = input.LA(1);
+
+
+ var index44_3 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_3);
+ if ( s>=0 ) return s;
+ break;
+ case 4 :
+ var LA44_4 = input.LA(1);
+
+
+ var index44_4 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_4);
+ if ( s>=0 ) return s;
+ break;
+ case 5 :
+ var LA44_5 = input.LA(1);
+
+
+ var index44_5 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_5);
+ if ( s>=0 ) return s;
+ break;
+ case 6 :
+ var LA44_6 = input.LA(1);
+
+
+ var index44_6 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_6);
+ if ( s>=0 ) return s;
+ break;
+ case 7 :
+ var LA44_7 = input.LA(1);
+
+
+ var index44_7 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_7);
+ if ( s>=0 ) return s;
+ break;
+ case 8 :
+ var LA44_8 = input.LA(1);
+
+
+ var index44_8 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_8);
+ if ( s>=0 ) return s;
+ break;
+ case 9 :
+ var LA44_9 = input.LA(1);
+
+
+ var index44_9 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_9);
+ if ( s>=0 ) return s;
+ break;
+ case 10 :
+ var LA44_10 = input.LA(1);
+
+
+ var index44_10 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_10);
+ if ( s>=0 ) return s;
+ break;
+ case 11 :
+ var LA44_11 = input.LA(1);
+
+
+ var index44_11 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_11);
+ if ( s>=0 ) return s;
+ break;
+ case 12 :
+ var LA44_12 = input.LA(1);
+
+
+ var index44_12 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_12);
+ if ( s>=0 ) return s;
+ break;
+ case 13 :
+ var LA44_13 = input.LA(1);
+
+
+ var index44_13 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_13);
+ if ( s>=0 ) return s;
+ break;
+ case 14 :
+ var LA44_14 = input.LA(1);
+
+
+ var index44_14 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_14);
+ if ( s>=0 ) return s;
+ break;
+ case 15 :
+ var LA44_15 = input.LA(1);
+
+
+ var index44_15 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_15);
+ if ( s>=0 ) return s;
+ break;
+ case 16 :
+ var LA44_16 = input.LA(1);
+
+
+ var index44_16 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_16);
+ if ( s>=0 ) return s;
+ break;
+ case 17 :
+ var LA44_17 = input.LA(1);
+
+
+ var index44_17 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_17);
+ if ( s>=0 ) return s;
+ break;
+ case 18 :
+ var LA44_18 = input.LA(1);
+
+
+ var index44_18 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_18);
+ if ( s>=0 ) return s;
+ break;
+ case 19 :
+ var LA44_19 = input.LA(1);
+
+
+ var index44_19 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_19);
+ if ( s>=0 ) return s;
+ break;
+ case 20 :
+ var LA44_20 = input.LA(1);
+
+
+ var index44_20 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_20);
+ if ( s>=0 ) return s;
+ break;
+ case 21 :
+ var LA44_21 = input.LA(1);
+
+
+ var index44_21 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_21);
+ if ( s>=0 ) return s;
+ break;
+ case 22 :
+ var LA44_22 = input.LA(1);
+
+
+ var index44_22 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_22);
+ if ( s>=0 ) return s;
+ break;
+ case 23 :
+ var LA44_23 = input.LA(1);
+
+
+ var index44_23 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_23);
+ if ( s>=0 ) return s;
+ break;
+ case 24 :
+ var LA44_24 = input.LA(1);
+
+
+ var index44_24 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_24);
+ if ( s>=0 ) return s;
+ break;
+ case 25 :
+ var LA44_25 = input.LA(1);
+
+
+ var index44_25 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_25);
+ if ( s>=0 ) return s;
+ break;
+ case 26 :
+ var LA44_26 = input.LA(1);
+
+
+ var index44_26 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_26);
+ if ( s>=0 ) return s;
+ break;
+ case 27 :
+ var LA44_27 = input.LA(1);
+
+
+ var index44_27 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_27);
+ if ( s>=0 ) return s;
+ break;
+ case 28 :
+ var LA44_28 = input.LA(1);
+
+
+ var index44_28 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_28);
+ if ( s>=0 ) return s;
+ break;
+ case 29 :
+ var LA44_29 = input.LA(1);
+
+
+ var index44_29 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_29);
+ if ( s>=0 ) return s;
+ break;
+ case 30 :
+ var LA44_30 = input.LA(1);
+
+
+ var index44_30 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_30);
+ if ( s>=0 ) return s;
+ break;
+ case 31 :
+ var LA44_31 = input.LA(1);
+
+
+ var index44_31 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_31);
+ if ( s>=0 ) return s;
+ break;
+ case 32 :
+ var LA44_32 = input.LA(1);
+
+
+ var index44_32 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_32);
+ if ( s>=0 ) return s;
+ break;
+ case 33 :
+ var LA44_33 = input.LA(1);
+
+
+ var index44_33 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_33);
+ if ( s>=0 ) return s;
+ break;
+ case 34 :
+ var LA44_34 = input.LA(1);
+
+
+ var index44_34 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_34);
+ if ( s>=0 ) return s;
+ break;
+ case 35 :
+ var LA44_35 = input.LA(1);
+
+
+ var index44_35 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_35);
+ if ( s>=0 ) return s;
+ break;
+ case 36 :
+ var LA44_36 = input.LA(1);
+
+
+ var index44_36 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_36);
+ if ( s>=0 ) return s;
+ break;
+ case 37 :
+ var LA44_37 = input.LA(1);
+
+
+ var index44_37 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_37);
+ if ( s>=0 ) return s;
+ break;
+ case 38 :
+ var LA44_38 = input.LA(1);
+
+
+ var index44_38 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_38);
+ if ( s>=0 ) return s;
+ break;
+ case 39 :
+ var LA44_39 = input.LA(1);
+
+
+ var index44_39 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_39);
+ if ( s>=0 ) return s;
+ break;
+ case 40 :
+ var LA44_40 = input.LA(1);
+
+
+ var index44_40 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_40);
+ if ( s>=0 ) return s;
+ break;
+ case 41 :
+ var LA44_41 = input.LA(1);
+
+
+ var index44_41 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_41);
+ if ( s>=0 ) return s;
+ break;
+ case 42 :
+ var LA44_42 = input.LA(1);
+
+
+ var index44_42 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_42);
+ if ( s>=0 ) return s;
+ break;
+ case 43 :
+ var LA44_43 = input.LA(1);
+
+
+ var index44_43 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_43);
+ if ( s>=0 ) return s;
+ break;
+ case 44 :
+ var LA44_44 = input.LA(1);
+
+
+ var index44_44 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_44);
+ if ( s>=0 ) return s;
+ break;
+ case 45 :
+ var LA44_45 = input.LA(1);
+
+
+ var index44_45 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_45);
+ if ( s>=0 ) return s;
+ break;
+ case 46 :
+ var LA44_46 = input.LA(1);
+
+
+ var index44_46 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_46);
+ if ( s>=0 ) return s;
+ break;
+ case 47 :
+ var LA44_47 = input.LA(1);
+
+
+ var index44_47 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_47);
+ if ( s>=0 ) return s;
+ break;
+ case 48 :
+ var LA44_48 = input.LA(1);
+
+
+ var index44_48 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_48);
+ if ( s>=0 ) return s;
+ break;
+ case 49 :
+ var LA44_49 = input.LA(1);
+
+
+ var index44_49 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_49);
+ if ( s>=0 ) return s;
+ break;
+ case 50 :
+ var LA44_50 = input.LA(1);
+
+
+ var index44_50 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_50);
+ if ( s>=0 ) return s;
+ break;
+ case 51 :
+ var LA44_51 = input.LA(1);
+
+
+ var index44_51 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_51);
+ if ( s>=0 ) return s;
+ break;
+ case 52 :
+ var LA44_52 = input.LA(1);
+
+
+ var index44_52 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (((this.lc(XQS))||((this.lc(XQS))&&(this.lc(XQU))))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_52);
+ if ( s>=0 ) return s;
+ break;
+ case 53 :
+ var LA44_53 = input.LA(1);
+
+
+ var index44_53 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_53);
+ if ( s>=0 ) return s;
+ break;
+ case 54 :
+ var LA44_54 = input.LA(1);
+
+
+ var index44_54 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_54);
+ if ( s>=0 ) return s;
+ break;
+ case 55 :
+ var LA44_55 = input.LA(1);
+
+
+ var index44_55 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_55);
+ if ( s>=0 ) return s;
+ break;
+ case 56 :
+ var LA44_56 = input.LA(1);
+
+
+ var index44_56 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_56);
+ if ( s>=0 ) return s;
+ break;
+ case 57 :
+ var LA44_57 = input.LA(1);
+
+
+ var index44_57 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_57);
+ if ( s>=0 ) return s;
+ break;
+ case 58 :
+ var LA44_58 = input.LA(1);
+
+
+ var index44_58 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_58);
+ if ( s>=0 ) return s;
+ break;
+ case 59 :
+ var LA44_59 = input.LA(1);
+
+
+ var index44_59 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_59);
+ if ( s>=0 ) return s;
+ break;
+ case 60 :
+ var LA44_60 = input.LA(1);
+
+
+ var index44_60 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_60);
+ if ( s>=0 ) return s;
+ break;
+ case 61 :
+ var LA44_61 = input.LA(1);
+
+
+ var index44_61 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (((this.lc(XQS))||((this.lc(XQS))&&(this.lc(XQU))))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_61);
+ if ( s>=0 ) return s;
+ break;
+ case 62 :
+ var LA44_62 = input.LA(1);
+
+
+ var index44_62 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (((this.lc(XQS))||((this.lc(XQS))&&(this.lc(XQU))))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_62);
+ if ( s>=0 ) return s;
+ break;
+ case 63 :
+ var LA44_63 = input.LA(1);
+
+
+ var index44_63 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (((this.lc(XQS))||((this.lc(XQS))&&(this.lc(XQU))))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_63);
+ if ( s>=0 ) return s;
+ break;
+ case 64 :
+ var LA44_64 = input.LA(1);
+
+
+ var index44_64 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (((this.lc(XQS))||((this.lc(XQS))&&(this.lc(XQU))))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_64);
+ if ( s>=0 ) return s;
+ break;
+ case 65 :
+ var LA44_65 = input.LA(1);
+
+
+ var index44_65 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (((this.lc(XQS))||((this.lc(XQS))&&(this.lc(XQU))))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_65);
+ if ( s>=0 ) return s;
+ break;
+ case 66 :
+ var LA44_66 = input.LA(1);
+
+
+ var index44_66 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_66);
+ if ( s>=0 ) return s;
+ break;
+ case 67 :
+ var LA44_67 = input.LA(1);
+
+
+ var index44_67 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_67);
+ if ( s>=0 ) return s;
+ break;
+ case 68 :
+ var LA44_68 = input.LA(1);
+
+
+ var index44_68 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_68);
+ if ( s>=0 ) return s;
+ break;
+ case 69 :
+ var LA44_69 = input.LA(1);
+
+
+ var index44_69 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_69);
+ if ( s>=0 ) return s;
+ break;
+ case 70 :
+ var LA44_71 = input.LA(1);
+
+
+ var index44_71 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_71);
+ if ( s>=0 ) return s;
+ break;
+ case 71 :
+ var LA44_72 = input.LA(1);
+
+
+ var index44_72 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((this.lc(XQS))) ) {s = 70;}
+
+ else if ( (true) ) {s = 74;}
+
+
+ input.seek(index44_72);
+ if ( s>=0 ) return s;
+ break;
+ }
+ }).call(this.recognizer, s, input);
+ if (!org.antlr.lang.isUndefined(retval)) {
+ return retval;
+ }
+ if (this.recognizer.state.backtracking>0) {this.recognizer.state.failed=true; return -1;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException(this.getDescription(), 44, _s, input);
+ this.error(nvae);
+ throw nvae;
+ },
+ dummy: null
+});
+org.antlr.lang.augmentObject(XQueryParser, {
+ DFA46_eotS:
+ "\u0011\uffff",
+ DFA46_eofS:
+ "\u0001\uffff\u0006\u0007\u000a\uffff",
+ DFA46_minS:
+ "\u0001\u0010\u0006\u0012\u000a\uffff",
+ DFA46_maxS:
+ "\u0001\u0122\u0006\u0107\u000a\uffff",
+ DFA46_acceptS:
+ "\u0007\uffff\u0001\u0006\u0005\u0001\u0001\u0002\u0001\u0003\u0001"+
+ "\u0004\u0001\u0005",
+ DFA46_specialS:
+ "\u0001\uffff\u0001\u0002\u0001\u0005\u0001\u0004\u0001\u0001\u0001"+
+ "\u0003\u0001\u0000\u000a\uffff}>",
+ DFA46_transitionS: [
+ "\u0025\u0007\u0001\u0001\u0005\u0007\u0001\u0003\u000a\u0007"+
+ "\u0001\u0002\u0026\u0007\u0001\u0005\u001d\u0007\u0001\u0004"+
+ "\u0001\u0006\u0055\u0007\u0001\uffff\u0001\u0007\u0001\uffff"+
+ "\u0002\u0007\u0001\uffff\u0001\u0007\u0001\uffff\u0001\u0007"+
+ "\u0009\uffff\u0004\u0007\u0005\uffff\u0002\u0007\u0001\uffff"+
+ "\u0002\u0007\u000c\uffff\u0002\u0007\u0002\uffff\u0002\u0007"+
+ "\u0002\uffff\u0001\u0007\u0006\uffff\u0006\u0007",
+ "\u0004\u0007\u0004\uffff\u0003\u0007\u0001\uffff\u0001\u0007"+
+ "\u0004\uffff\u0001\u0007\u0002\uffff\u0002\u0007\u0004\uffff"+
+ "\u0001\u0007\u0002\uffff\u0001\u0007\u0001\uffff\u0001\u0007"+
+ "\u0003\uffff\u0001\u0007\u0001\uffff\u0001\u0007\u0001\uffff"+
+ "\u0002\u0007\u0004\uffff\u0003\u0007\u0002\uffff\u0001\u0007"+
+ "\u0001\uffff\u0003\u0007\u0002\uffff\u0001\u0007\u0006\uffff"+
+ "\u0002\u0007\u000b\uffff\u0002\u0007\u0005\uffff\u0001\u0007"+
+ "\u0004\uffff\u0002\u0007\u0001\uffff\u0001\u0007\u0004\uffff"+
+ "\u0001\u0007\u0004\uffff\u0001\u0007\u0003\uffff\u0002\u0007"+
+ "\u0006\uffff\u0001\u0007\u0004\uffff\u0001\u000a\u0001\u0007"+
+ "\u0002\uffff\u0001\u0009\u0004\uffff\u0002\u0007\u0004\uffff"+
+ "\u0001\u0007\u0003\uffff\u0001\u0007\u0007\uffff\u0001\u0007"+
+ "\u0002\uffff\u0001\u0007\u003a\uffff\u0003\u0007\u0001\u0008"+
+ "\u0001\uffff\u0001\u0007\u0001\uffff\u0004\u0007\u0001\uffff"+
+ "\u0001\u0007\u0001\uffff\u0001\u0007\u0001\uffff\u0001\u0007"+
+ "\u0001\uffff\u000c\u0007\u0002\uffff\u0001\u0007\u0003\uffff"+
+ "\u0002\u0007",
+ "\u0004\u0007\u0004\uffff\u0003\u0007\u0001\uffff\u0001\u0007"+
+ "\u0004\uffff\u0001\u0007\u0002\uffff\u0002\u0007\u0004\uffff"+
+ "\u0001\u0007\u0002\uffff\u0001\u0007\u0001\uffff\u0001\u0007"+
+ "\u0003\uffff\u0001\u0007\u0001\uffff\u0001\u0007\u0001\uffff"+
+ "\u0002\u0007\u0004\uffff\u0003\u0007\u0002\uffff\u0001\u0007"+
+ "\u0001\uffff\u0003\u0007\u0002\uffff\u0001\u0007\u0006\uffff"+
+ "\u0002\u0007\u000b\uffff\u0002\u0007\u0005\uffff\u0001\u0007"+
+ "\u0004\uffff\u0002\u0007\u0001\uffff\u0001\u0007\u0004\uffff"+
+ "\u0001\u0007\u0004\uffff\u0001\u0007\u0003\uffff\u0002\u0007"+
+ "\u0006\uffff\u0001\u0007\u0005\uffff\u0001\u0007\u0007\uffff"+
+ "\u0002\u0007\u0004\uffff\u0001\u0007\u0003\uffff\u0001\u0007"+
+ "\u0007\uffff\u0001\u0007\u0002\uffff\u0001\u0007\u0018\uffff"+
+ "\u0001\u000c\u0021\uffff\u0003\u0007\u0001\u000b\u0001\uffff"+
+ "\u0001\u0007\u0001\uffff\u0004\u0007\u0001\uffff\u0001\u0007"+
+ "\u0001\uffff\u0001\u0007\u0001\uffff\u0001\u0007\u0001\uffff"+
+ "\u000c\u0007\u0002\uffff\u0001\u0007\u0003\uffff\u0002\u0007",
+ "\u0004\u0007\u0004\uffff\u0003\u0007\u0001\uffff\u0001\u0007"+
+ "\u0004\uffff\u0001\u0007\u0002\uffff\u0002\u0007\u0004\uffff"+
+ "\u0001\u0007\u0002\uffff\u0001\u0007\u0001\uffff\u0001\u0007"+
+ "\u0003\uffff\u0001\u0007\u0001\uffff\u0001\u0007\u0001\uffff"+
+ "\u0002\u0007\u0004\uffff\u0003\u0007\u0002\uffff\u0001\u0007"+
+ "\u0001\uffff\u0003\u0007\u0002\uffff\u0001\u0007\u0006\uffff"+
+ "\u0002\u0007\u000b\uffff\u0002\u0007\u0005\uffff\u0001\u0007"+
+ "\u0004\uffff\u0002\u0007\u0001\uffff\u0001\u0007\u0004\uffff"+
+ "\u0001\u0007\u0004\uffff\u0001\u0007\u0003\uffff\u0002\u0007"+
+ "\u0006\uffff\u0001\u0007\u0005\uffff\u0001\u0007\u0007\uffff"+
+ "\u0002\u0007\u0004\uffff\u0001\u0007\u0003\uffff\u0001\u0007"+
+ "\u0007\uffff\u0001\u0007\u0002\uffff\u0001\u0007\u003a\uffff"+
+ "\u0001\u0007\u0001\u000d\u0001\u0007\u0002\uffff\u0001\u0007"+
+ "\u0001\uffff\u0004\u0007\u0001\uffff\u0001\u0007\u0001\uffff"+
+ "\u0001\u0007\u0001\uffff\u0001\u0007\u0001\uffff\u000c\u0007"+
+ "\u0002\uffff\u0001\u0007\u0003\uffff\u0002\u0007",
+ "\u0004\u0007\u0004\uffff\u0003\u0007\u0001\uffff\u0001\u0007"+
+ "\u0004\uffff\u0001\u0007\u0002\uffff\u0002\u0007\u0004\uffff"+
+ "\u0001\u0007\u0002\uffff\u0001\u0007\u0001\uffff\u0001\u0007"+
+ "\u0003\uffff\u0001\u0007\u0001\uffff\u0001\u0007\u0001\uffff"+
+ "\u0002\u0007\u0004\uffff\u0003\u0007\u0002\uffff\u0001\u0007"+
+ "\u0001\uffff\u0003\u0007\u0002\uffff\u0001\u0007\u0006\uffff"+
+ "\u0002\u0007\u000b\uffff\u0002\u0007\u0005\uffff\u0001\u0007"+
+ "\u0004\uffff\u0002\u0007\u0001\uffff\u0001\u0007\u0004\uffff"+
+ "\u0001\u0007\u0004\uffff\u0001\u0007\u0003\uffff\u0002\u0007"+
+ "\u0006\uffff\u0001\u0007\u0005\uffff\u0001\u0007\u0007\uffff"+
+ "\u0002\u0007\u0004\uffff\u0001\u0007\u0003\uffff\u0001\u0007"+
+ "\u0007\uffff\u0001\u0007\u0002\uffff\u0001\u0007\u003a\uffff"+
+ "\u0001\u0007\u0001\u000e\u0001\u0007\u0002\uffff\u0001\u0007"+
+ "\u0001\uffff\u0004\u0007\u0001\uffff\u0001\u0007\u0001\uffff"+
+ "\u0001\u0007\u0001\uffff\u0001\u0007\u0001\uffff\u000c\u0007"+
+ "\u0002\uffff\u0001\u0007\u0003\uffff\u0002\u0007",
+ "\u0004\u0007\u0004\uffff\u0003\u0007\u0001\uffff\u0001\u0007"+
+ "\u0004\uffff\u0001\u0007\u0002\uffff\u0002\u0007\u0004\uffff"+
+ "\u0001\u0007\u0002\uffff\u0001\u0007\u0001\uffff\u0001\u0007"+
+ "\u0003\uffff\u0001\u0007\u0001\uffff\u0001\u0007\u0001\uffff"+
+ "\u0002\u0007\u0004\uffff\u0003\u0007\u0002\uffff\u0001\u0007"+
+ "\u0001\uffff\u0003\u0007\u0002\uffff\u0001\u0007\u0006\uffff"+
+ "\u0002\u0007\u000b\uffff\u0002\u0007\u0005\uffff\u0001\u0007"+
+ "\u0004\uffff\u0002\u0007\u0001\uffff\u0001\u0007\u0004\uffff"+
+ "\u0001\u0007\u0004\uffff\u0001\u0007\u0003\uffff\u0002\u0007"+
+ "\u0006\uffff\u0001\u0007\u0005\uffff\u0001\u0007\u0007\uffff"+
+ "\u0002\u0007\u0004\uffff\u0001\u0007\u0003\uffff\u0001\u0007"+
+ "\u0007\uffff\u0001\u0007\u0002\uffff\u0001\u0007\u003a\uffff"+
+ "\u0001\u0007\u0001\u000f\u0001\u0007\u0002\uffff\u0001\u0007"+
+ "\u0001\uffff\u0004\u0007\u0001\uffff\u0001\u0007\u0001\uffff"+
+ "\u0001\u0007\u0001\uffff\u0001\u0007\u0001\uffff\u000c\u0007"+
+ "\u0002\uffff\u0001\u0007\u0003\uffff\u0002\u0007",
+ "\u0004\u0007\u0004\uffff\u0003\u0007\u0001\uffff\u0001\u0007"+
+ "\u0004\uffff\u0001\u0007\u0002\uffff\u0002\u0007\u0004\uffff"+
+ "\u0001\u0007\u0002\uffff\u0001\u0007\u0001\uffff\u0001\u0007"+
+ "\u0003\uffff\u0001\u0007\u0001\uffff\u0001\u0007\u0001\uffff"+
+ "\u0002\u0007\u0004\uffff\u0003\u0007\u0002\uffff\u0001\u0007"+
+ "\u0001\uffff\u0003\u0007\u0002\uffff\u0001\u0007\u0006\uffff"+
+ "\u0002\u0007\u000b\uffff\u0002\u0007\u0005\uffff\u0001\u0007"+
+ "\u0004\uffff\u0002\u0007\u0001\uffff\u0001\u0007\u0004\uffff"+
+ "\u0001\u0007\u0004\uffff\u0001\u0007\u0003\uffff\u0002\u0007"+
+ "\u0006\uffff\u0001\u0007\u0005\uffff\u0001\u0007\u0007\uffff"+
+ "\u0002\u0007\u0004\uffff\u0001\u0007\u0003\uffff\u0001\u0007"+
+ "\u0007\uffff\u0001\u0007\u0002\uffff\u0001\u0007\u003a\uffff"+
+ "\u0003\u0007\u0002\uffff\u0001\u0007\u0001\u0010\u0004\u0007"+
+ "\u0001\uffff\u0001\u0007\u0001\uffff\u0001\u0007\u0001\uffff"+
+ "\u0001\u0007\u0001\uffff\u000c\u0007\u0002\uffff\u0001\u0007"+
+ "\u0003\uffff\u0002\u0007",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ ""
+ ]
+});
+
+org.antlr.lang.augmentObject(XQueryParser, {
+ DFA46_eot:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA46_eotS),
+ DFA46_eof:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA46_eofS),
+ DFA46_min:
+ org.antlr.runtime.DFA.unpackEncodedStringToUnsignedChars(XQueryParser.DFA46_minS),
+ DFA46_max:
+ org.antlr.runtime.DFA.unpackEncodedStringToUnsignedChars(XQueryParser.DFA46_maxS),
+ DFA46_accept:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA46_acceptS),
+ DFA46_special:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA46_specialS),
+ DFA46_transition: (function() {
+ var a = [],
+ i,
+ numStates = XQueryParser.DFA46_transitionS.length;
+ for (i=0; i<numStates; i++) {
+ a.push(org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA46_transitionS[i]));
+ }
+ return a;
+ })()
+});
+
+XQueryParser.DFA46 = function(recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 46;
+ this.eot = XQueryParser.DFA46_eot;
+ this.eof = XQueryParser.DFA46_eof;
+ this.min = XQueryParser.DFA46_min;
+ this.max = XQueryParser.DFA46_max;
+ this.accept = XQueryParser.DFA46_accept;
+ this.special = XQueryParser.DFA46_special;
+ this.transition = XQueryParser.DFA46_transition;
+};
+
+org.antlr.lang.extend(XQueryParser.DFA46, org.antlr.runtime.DFA, {
+ getDescription: function() {
+ return "570:1: p_ExprSingle[strict] : ( ( ( ( FOR | LET ) DOLLAR ) | ( FOR ( TUMBLING | SLIDING ) ) )=> p_FLWORHybrid[$strict] | ( IF LPAREN )=> p_IfHybrid[$strict] | ( SWITCH LPAREN )=> p_SwitchHybrid[$strict] | ( TYPESWITCH LPAREN )=> p_TypeswitchHybrid[$strict] | ( TRY LBRACKET )=> p_TryCatchHybrid[$strict] | p_ExprSimple );";
+ },
+ specialStateTransition: function(s, input) {
+ var _s = s;
+ var retval = (function(s, input) {
+ switch ( s ) {
+ case 0 :
+ var LA46_6 = input.LA(1);
+
+
+ var index46_6 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (LA46_6==LBRACKET) && (this.synpred5_XQueryParser())) {s = 16;}
+
+ else if ( (LA46_6==EOF||(LA46_6>=AND && LA46_6<=AT)||(LA46_6>=CASE && LA46_6<=CASTABLE)||LA46_6==COLLATION||LA46_6==DEFAULT||(LA46_6>=DESCENDING && LA46_6<=DIV)||LA46_6==EMPTY||LA46_6==EQ||LA46_6==EXCEPT||LA46_6==FOR||LA46_6==GE||(LA46_6>=GT && LA46_6<=IDIV)||(LA46_6>=INSTANCE && LA46_6<=IS)||LA46_6==LE||(LA46_6>=LET && LA46_6<=MOD)||LA46_6==NE||(LA46_6>=OR && LA46_6<=ORDER)||(LA46_6>=RETURN && LA46_6<=SATISFIES)||LA46_6==STABLE||(LA46_6>=TO && LA46_6<=TREAT)||LA46_6==UNION||LA46_6==WHERE||LA46_6==COUNT||(LA46_6>=END && LA46_6<=GROUP)||LA46_6==ONLY||LA46_6==START||(LA46_6>=AFTER && LA46_6<=BEFORE)||LA46_6==INTO||LA46_6==MODIFY||LA46_6==WITH||LA46_6==CONTAINS||(LA46_6>=CONCAT && LA46_6<=RPAREN)||LA46_6==R_UNION_BRACKET||(LA46_6>=RBRACKET && LA46_6<=EQUAL)||LA46_6==NOTEQUAL||LA46_6==HASH||LA46_6==COMMA||(LA46_6>=STAR && LA46_6<=BANG)||LA46_6==COLON||(LA46_6>=SEMICOLON && LA46_6<=VBAR)) ) {s = 7;}
+
+
+ input.seek(index46_6);
+ if ( s>=0 ) return s;
+ break;
+ case 1 :
+ var LA46_4 = input.LA(1);
+
+
+ var index46_4 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (LA46_4==LPAREN) && (this.synpred3_XQueryParser())) {s = 14;}
+
+ else if ( (LA46_4==EOF||(LA46_4>=AND && LA46_4<=AT)||(LA46_4>=CASE && LA46_4<=CASTABLE)||LA46_4==COLLATION||LA46_4==DEFAULT||(LA46_4>=DESCENDING && LA46_4<=DIV)||LA46_4==EMPTY||LA46_4==EQ||LA46_4==EXCEPT||LA46_4==FOR||LA46_4==GE||(LA46_4>=GT && LA46_4<=IDIV)||(LA46_4>=INSTANCE && LA46_4<=IS)||LA46_4==LE||(LA46_4>=LET && LA46_4<=MOD)||LA46_4==NE||(LA46_4>=OR && LA46_4<=ORDER)||(LA46_4>=RETURN && LA46_4<=SATISFIES)||LA46_4==STABLE||(LA46_4>=TO && LA46_4<=TREAT)||LA46_4==UNION||LA46_4==WHERE||LA46_4==COUNT||(LA46_4>=END && LA46_4<=GROUP)||LA46_4==ONLY||LA46_4==START||(LA46_4>=AFTER && LA46_4<=BEFORE)||LA46_4==INTO||LA46_4==MODIFY||LA46_4==WITH||LA46_4==CONTAINS||LA46_4==CONCAT||LA46_4==RPAREN||LA46_4==R_UNION_BRACKET||(LA46_4>=RBRACKET && LA46_4<=EQUAL)||LA46_4==NOTEQUAL||LA46_4==HASH||LA46_4==COMMA||(LA46_4>=STAR && LA46_4<=BANG)||LA46_4==COLON||(LA46_4>=SEMICOLON && LA46_4<=VBAR)) ) {s = 7;}
+
+
+ input.seek(index46_4);
+ if ( s>=0 ) return s;
+ break;
+ case 2 :
+ var LA46_1 = input.LA(1);
+
+
+ var index46_1 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (LA46_1==DOLLAR) && (this.synpred1_XQueryParser())) {s = 8;}
+
+ else if ( (LA46_1==TUMBLING) && (this.synpred1_XQueryParser())) {s = 9;}
+
+ else if ( (LA46_1==SLIDING) && (this.synpred1_XQueryParser())) {s = 10;}
+
+ else if ( (LA46_1==EOF||(LA46_1>=AND && LA46_1<=AT)||(LA46_1>=CASE && LA46_1<=CASTABLE)||LA46_1==COLLATION||LA46_1==DEFAULT||(LA46_1>=DESCENDING && LA46_1<=DIV)||LA46_1==EMPTY||LA46_1==EQ||LA46_1==EXCEPT||LA46_1==FOR||LA46_1==GE||(LA46_1>=GT && LA46_1<=IDIV)||(LA46_1>=INSTANCE && LA46_1<=IS)||LA46_1==LE||(LA46_1>=LET && LA46_1<=MOD)||LA46_1==NE||(LA46_1>=OR && LA46_1<=ORDER)||(LA46_1>=RETURN && LA46_1<=SATISFIES)||LA46_1==STABLE||(LA46_1>=TO && LA46_1<=TREAT)||LA46_1==UNION||LA46_1==WHERE||LA46_1==COUNT||(LA46_1>=END && LA46_1<=GROUP)||LA46_1==ONLY||LA46_1==START||(LA46_1>=AFTER && LA46_1<=BEFORE)||LA46_1==INTO||LA46_1==MODIFY||LA46_1==WITH||LA46_1==CONTAINS||(LA46_1>=CONCAT && LA46_1<=RPAREN)||LA46_1==R_UNION_BRACKET||(LA46_1>=RBRACKET && LA46_1<=EQUAL)||LA46_1==NOTEQUAL||LA46_1==HASH||LA46_1==COMMA||(LA46_1>=STAR && LA46_1<=BANG)||LA46_1==COLON||(LA46_1>=SEMICOLON && LA46_1<=VBAR)) ) {s = 7;}
+
+
+ input.seek(index46_1);
+ if ( s>=0 ) return s;
+ break;
+ case 3 :
+ var LA46_5 = input.LA(1);
+
+
+ var index46_5 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (LA46_5==LPAREN) && (this.synpred4_XQueryParser())) {s = 15;}
+
+ else if ( (LA46_5==EOF||(LA46_5>=AND && LA46_5<=AT)||(LA46_5>=CASE && LA46_5<=CASTABLE)||LA46_5==COLLATION||LA46_5==DEFAULT||(LA46_5>=DESCENDING && LA46_5<=DIV)||LA46_5==EMPTY||LA46_5==EQ||LA46_5==EXCEPT||LA46_5==FOR||LA46_5==GE||(LA46_5>=GT && LA46_5<=IDIV)||(LA46_5>=INSTANCE && LA46_5<=IS)||LA46_5==LE||(LA46_5>=LET && LA46_5<=MOD)||LA46_5==NE||(LA46_5>=OR && LA46_5<=ORDER)||(LA46_5>=RETURN && LA46_5<=SATISFIES)||LA46_5==STABLE||(LA46_5>=TO && LA46_5<=TREAT)||LA46_5==UNION||LA46_5==WHERE||LA46_5==COUNT||(LA46_5>=END && LA46_5<=GROUP)||LA46_5==ONLY||LA46_5==START||(LA46_5>=AFTER && LA46_5<=BEFORE)||LA46_5==INTO||LA46_5==MODIFY||LA46_5==WITH||LA46_5==CONTAINS||LA46_5==CONCAT||LA46_5==RPAREN||LA46_5==R_UNION_BRACKET||(LA46_5>=RBRACKET && LA46_5<=EQUAL)||LA46_5==NOTEQUAL||LA46_5==HASH||LA46_5==COMMA||(LA46_5>=STAR && LA46_5<=BANG)||LA46_5==COLON||(LA46_5>=SEMICOLON && LA46_5<=VBAR)) ) {s = 7;}
+
+
+ input.seek(index46_5);
+ if ( s>=0 ) return s;
+ break;
+ case 4 :
+ var LA46_3 = input.LA(1);
+
+
+ var index46_3 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (LA46_3==LPAREN) && (this.synpred2_XQueryParser())) {s = 13;}
+
+ else if ( (LA46_3==EOF||(LA46_3>=AND && LA46_3<=AT)||(LA46_3>=CASE && LA46_3<=CASTABLE)||LA46_3==COLLATION||LA46_3==DEFAULT||(LA46_3>=DESCENDING && LA46_3<=DIV)||LA46_3==EMPTY||LA46_3==EQ||LA46_3==EXCEPT||LA46_3==FOR||LA46_3==GE||(LA46_3>=GT && LA46_3<=IDIV)||(LA46_3>=INSTANCE && LA46_3<=IS)||LA46_3==LE||(LA46_3>=LET && LA46_3<=MOD)||LA46_3==NE||(LA46_3>=OR && LA46_3<=ORDER)||(LA46_3>=RETURN && LA46_3<=SATISFIES)||LA46_3==STABLE||(LA46_3>=TO && LA46_3<=TREAT)||LA46_3==UNION||LA46_3==WHERE||LA46_3==COUNT||(LA46_3>=END && LA46_3<=GROUP)||LA46_3==ONLY||LA46_3==START||(LA46_3>=AFTER && LA46_3<=BEFORE)||LA46_3==INTO||LA46_3==MODIFY||LA46_3==WITH||LA46_3==CONTAINS||LA46_3==CONCAT||LA46_3==RPAREN||LA46_3==R_UNION_BRACKET||(LA46_3>=RBRACKET && LA46_3<=EQUAL)||LA46_3==NOTEQUAL||LA46_3==HASH||LA46_3==COMMA||(LA46_3>=STAR && LA46_3<=BANG)||LA46_3==COLON||(LA46_3>=SEMICOLON && LA46_3<=VBAR)) ) {s = 7;}
+
+
+ input.seek(index46_3);
+ if ( s>=0 ) return s;
+ break;
+ case 5 :
+ var LA46_2 = input.LA(1);
+
+
+ var index46_2 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (LA46_2==DOLLAR) && (this.synpred1_XQueryParser())) {s = 11;}
+
+ else if ( (LA46_2==SCORE) && (this.synpred1_XQueryParser())) {s = 12;}
+
+ else if ( (LA46_2==EOF||(LA46_2>=AND && LA46_2<=AT)||(LA46_2>=CASE && LA46_2<=CASTABLE)||LA46_2==COLLATION||LA46_2==DEFAULT||(LA46_2>=DESCENDING && LA46_2<=DIV)||LA46_2==EMPTY||LA46_2==EQ||LA46_2==EXCEPT||LA46_2==FOR||LA46_2==GE||(LA46_2>=GT && LA46_2<=IDIV)||(LA46_2>=INSTANCE && LA46_2<=IS)||LA46_2==LE||(LA46_2>=LET && LA46_2<=MOD)||LA46_2==NE||(LA46_2>=OR && LA46_2<=ORDER)||(LA46_2>=RETURN && LA46_2<=SATISFIES)||LA46_2==STABLE||(LA46_2>=TO && LA46_2<=TREAT)||LA46_2==UNION||LA46_2==WHERE||LA46_2==COUNT||(LA46_2>=END && LA46_2<=GROUP)||LA46_2==ONLY||LA46_2==START||(LA46_2>=AFTER && LA46_2<=BEFORE)||LA46_2==INTO||LA46_2==MODIFY||LA46_2==WITH||LA46_2==CONTAINS||(LA46_2>=CONCAT && LA46_2<=RPAREN)||LA46_2==R_UNION_BRACKET||(LA46_2>=RBRACKET && LA46_2<=EQUAL)||LA46_2==NOTEQUAL||LA46_2==HASH||LA46_2==COMMA||(LA46_2>=STAR && LA46_2<=BANG)||LA46_2==COLON||(LA46_2>=SEMICOLON && LA46_2<=VBAR)) ) {s = 7;}
+
+
+ input.seek(index46_2);
+ if ( s>=0 ) return s;
+ break;
+ }
+ }).call(this.recognizer, s, input);
+ if (!org.antlr.lang.isUndefined(retval)) {
+ return retval;
+ }
+ if (this.recognizer.state.backtracking>0) {this.recognizer.state.failed=true; return -1;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException(this.getDescription(), 46, _s, input);
+ this.error(nvae);
+ throw nvae;
+ },
+ dummy: null
+});
+org.antlr.lang.augmentObject(XQueryParser, {
+ DFA119_eotS:
+ "\u0033\uffff",
+ DFA119_eofS:
+ "\u0033\uffff",
+ DFA119_minS:
+ "\u0001\u0010\u0001\u0000\u0031\uffff",
+ DFA119_maxS:
+ "\u0001\u0122\u0001\u0000\u0031\uffff",
+ DFA119_acceptS:
+ "\u0002\uffff\u0001\u0003\u0001\u0004\u002d\uffff\u0001\u0001\u0001"+
+ "\u0002",
+ DFA119_specialS:
+ "\u0001\uffff\u0001\u0000\u0031\uffff}>",
+ DFA119_transitionS: [
+ "\u00d2\u0003\u0001\uffff\u0001\u0003\u0001\uffff\u0002\u0003"+
+ "\u0001\uffff\u0001\u0003\u0001\uffff\u0001\u0003\u0009\uffff"+
+ "\u0001\u0003\u0002\uffff\u0001\u0003\u0005\uffff\u0001\u0001"+
+ "\u0001\u0002\u0001\uffff\u0002\u0003\u000c\uffff\u0002\u0003"+
+ "\u0002\uffff\u0002\u0003\u0002\uffff\u0001\u0003\u0007\uffff"+
+ "\u0005\u0003",
+ "\u0001\uffff",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ ""
+ ]
+});
+
+org.antlr.lang.augmentObject(XQueryParser, {
+ DFA119_eot:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA119_eotS),
+ DFA119_eof:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA119_eofS),
+ DFA119_min:
+ org.antlr.runtime.DFA.unpackEncodedStringToUnsignedChars(XQueryParser.DFA119_minS),
+ DFA119_max:
+ org.antlr.runtime.DFA.unpackEncodedStringToUnsignedChars(XQueryParser.DFA119_maxS),
+ DFA119_accept:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA119_acceptS),
+ DFA119_special:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA119_specialS),
+ DFA119_transition: (function() {
+ var a = [],
+ i,
+ numStates = XQueryParser.DFA119_transitionS.length;
+ for (i=0; i<numStates; i++) {
+ a.push(org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA119_transitionS[i]));
+ }
+ return a;
+ })()
+});
+
+XQueryParser.DFA119 = function(recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 119;
+ this.eot = XQueryParser.DFA119_eot;
+ this.eof = XQueryParser.DFA119_eof;
+ this.min = XQueryParser.DFA119_min;
+ this.max = XQueryParser.DFA119_max;
+ this.accept = XQueryParser.DFA119_accept;
+ this.special = XQueryParser.DFA119_special;
+ this.transition = XQueryParser.DFA119_transition;
+};
+
+org.antlr.lang.extend(XQueryParser.DFA119, org.antlr.runtime.DFA, {
+ getDescription: function() {
+ return "912:1: p_PathExpr : ( ( SLASH p_RelativePathExpr )=> ( SLASH p_RelativePathExpr ) | SLASH | SLASH_SLASH p_RelativePathExpr | p_RelativePathExpr );";
+ },
+ specialStateTransition: function(s, input) {
+ var _s = s;
+ var retval = (function(s, input) {
+ switch ( s ) {
+ case 0 :
+ var LA119_1 = input.LA(1);
+
+
+ var index119_1 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (this.synpred7_XQueryParser()) ) {s = 49;}
+
+ else if ( (true) ) {s = 50;}
+
+
+ input.seek(index119_1);
+ if ( s>=0 ) return s;
+ break;
+ }
+ }).call(this.recognizer, s, input);
+ if (!org.antlr.lang.isUndefined(retval)) {
+ return retval;
+ }
+ if (this.recognizer.state.backtracking>0) {this.recognizer.state.failed=true; return -1;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException(this.getDescription(), 119, _s, input);
+ this.error(nvae);
+ throw nvae;
+ },
+ dummy: null
+});
+org.antlr.lang.augmentObject(XQueryParser, {
+ DFA121_eotS:
+ "\u0035\uffff",
+ DFA121_eofS:
+ "\u0035\uffff",
+ DFA121_minS:
+ "\u0001\u0010\u002e\u0000\u0006\uffff",
+ DFA121_maxS:
+ "\u0001\u0122\u002e\u0000\u0006\uffff",
+ DFA121_acceptS:
+ "\u002f\uffff\u0001\u0001\u0001\u0002\u0001\u0004\u0001\u0005\u0001"+
+ "\u0003\u0001\u0006",
+ DFA121_specialS:
+ "\u0001\uffff\u0001\u0000\u0001\u0001\u0001\u0002\u0001\u0003\u0001"+
+ "\u0004\u0001\u0005\u0001\u0006\u0001\u0007\u0001\u0008\u0001\u0009\u0001"+
+ "\u000a\u0001\u000b\u0001\u000c\u0001\u000d\u0001\u000e\u0001\u000f\u0001"+
+ "\u0010\u0001\u0011\u0001\u0012\u0001\u0013\u0001\u0014\u0001\u0015\u0001"+
+ "\u0016\u0001\u0017\u0001\u0018\u0001\u0019\u0001\u001a\u0001\u001b\u0001"+
+ "\u001c\u0001\u001d\u0001\u001e\u0001\u001f\u0001\u0020\u0001\u0021\u0001"+
+ "\u0022\u0001\u0023\u0001\u0024\u0001\u0025\u0001\u0026\u0001\u0027\u0001"+
+ "\u0028\u0001\u0029\u0001\u002a\u0001\u002b\u0001\u002c\u0001\u002d\u0006"+
+ "\uffff}>",
+ DFA121_transitionS: [
+ "\u0001\u001c\u0001\u001f\u0004\u0027\u0001\u0012\u0006\u0027"+
+ "\u0001\u0020\u0001\u0027\u0001\u0015\u0004\u0027\u0001\u0022"+
+ "\u0001\u0024\u0002\u0027\u0001\u000d\u0001\u0017\u0001\u000a"+
+ "\u0002\u0027\u0001\u002d\u0005\u0027\u0001\u0026\u0001\u0025"+
+ "\u0006\u0027\u0001\u002d\u0006\u0027\u0001\u002d\u0007\u0027"+
+ "\u0001\u0011\u0003\u0027\u0001\u002c\u0005\u0027\u0001\u0009"+
+ "\u0001\u0027\u0001\u0014\u0001\u001e\u0001\u001d\u0001\u0027"+
+ "\u0001\u0016\u0004\u002d\u0003\u0027\u0001\u002a\u0001\u0029"+
+ "\u0001\u0023\u0004\u0027\u0001\u0013\u0003\u0027\u0001\u002d"+
+ "\u0001\u0027\u0001\u000c\u0011\u0027\u0001\u002b\u0009\u0027"+
+ "\u0001\u002d\u0016\u0027\u0001\u000b\u0031\u0027\u0001\u002d"+
+ "\u000d\u0027\u0001\uffff\u0001\u0001\u0001\uffff\u0001\u0007"+
+ "\u0001\u001b\u0001\uffff\u0001\u0018\u0001\uffff\u0001\u001a"+
+ "\u0009\uffff\u0001\u002e\u0002\uffff\u0001\u000e\u0008\uffff"+
+ "\u0001\u0008\u0001\u0021\u000c\uffff\u0001\u0028\u0001\u0019"+
+ "\u0002\uffff\u0001\u0006\u0001\u0005\u0002\uffff\u0001\u0027"+
+ "\u0007\uffff\u0001\u000f\u0001\u0010\u0001\u0002\u0001\u0003"+
+ "\u0001\u0004",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "",
+ "",
+ "",
+ "",
+ "",
+ ""
+ ]
+});
+
+org.antlr.lang.augmentObject(XQueryParser, {
+ DFA121_eot:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA121_eotS),
+ DFA121_eof:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA121_eofS),
+ DFA121_min:
+ org.antlr.runtime.DFA.unpackEncodedStringToUnsignedChars(XQueryParser.DFA121_minS),
+ DFA121_max:
+ org.antlr.runtime.DFA.unpackEncodedStringToUnsignedChars(XQueryParser.DFA121_maxS),
+ DFA121_accept:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA121_acceptS),
+ DFA121_special:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA121_specialS),
+ DFA121_transition: (function() {
+ var a = [],
+ i,
+ numStates = XQueryParser.DFA121_transitionS.length;
+ for (i=0; i<numStates; i++) {
+ a.push(org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA121_transitionS[i]));
+ }
+ return a;
+ })()
+});
+
+XQueryParser.DFA121 = function(recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 121;
+ this.eot = XQueryParser.DFA121_eot;
+ this.eof = XQueryParser.DFA121_eof;
+ this.min = XQueryParser.DFA121_min;
+ this.max = XQueryParser.DFA121_max;
+ this.accept = XQueryParser.DFA121_accept;
+ this.special = XQueryParser.DFA121_special;
+ this.transition = XQueryParser.DFA121_transition;
+};
+
+org.antlr.lang.extend(XQueryParser.DFA121, org.antlr.runtime.DFA, {
+ getDescription: function() {
+ return "925:1: p_StepExpr : ( ( LBRACKET | LPAREN | SMALLER | QUOT | APOS | DOLLAR )=> p_PostfixExpr | ( ( ( ELEMENT | ATTRIBUTE ) ( p_EQName )? LBRACKET ) | ( ( NAMESPACE | PROCESSING_INSTRUCTION ) ( p_NCName )? LBRACKET ) | ( ( DOCUMENT | TEXT | COMMENT ) LBRACKET ) )=> p_PostfixExpr | ( p_KindTest )=> p_AxisStep | ( p_EQName LPAREN )=> p_PostfixExpr | ( p_PrimaryExpr )=> p_PostfixExpr | p_AxisStep );";
+ },
+ specialStateTransition: function(s, input) {
+ var _s = s;
+ var retval = (function(s, input) {
+ switch ( s ) {
+ case 0 :
+ var LA121_1 = input.LA(1);
+
+
+ var index121_1 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (this.synpred8_XQueryParser()) ) {s = 47;}
+
+ else if ( (this.synpred9_XQueryParser()) ) {s = 48;}
+
+ else if ( (this.synpred11_XQueryParser()) ) {s = 49;}
+
+ else if ( (this.synpred12_XQueryParser()) ) {s = 50;}
+
+
+ input.seek(index121_1);
+ if ( s>=0 ) return s;
+ break;
+ case 1 :
+ var LA121_2 = input.LA(1);
+
+
+ var index121_2 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (this.synpred8_XQueryParser()) ) {s = 47;}
+
+ else if ( (this.synpred9_XQueryParser()) ) {s = 48;}
+
+ else if ( (this.synpred11_XQueryParser()) ) {s = 49;}
+
+ else if ( (this.synpred12_XQueryParser()) ) {s = 50;}
+
+
+ input.seek(index121_2);
+ if ( s>=0 ) return s;
+ break;
+ case 2 :
+ var LA121_3 = input.LA(1);
+
+
+ var index121_3 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (this.synpred8_XQueryParser()) ) {s = 47;}
+
+ else if ( (this.synpred9_XQueryParser()) ) {s = 48;}
+
+ else if ( (this.synpred11_XQueryParser()) ) {s = 49;}
+
+ else if ( (this.synpred12_XQueryParser()) ) {s = 50;}
+
+
+ input.seek(index121_3);
+ if ( s>=0 ) return s;
+ break;
+ case 3 :
+ var LA121_4 = input.LA(1);
+
+
+ var index121_4 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (this.synpred8_XQueryParser()) ) {s = 47;}
+
+ else if ( (this.synpred9_XQueryParser()) ) {s = 48;}
+
+ else if ( (this.synpred11_XQueryParser()) ) {s = 49;}
+
+ else if ( (this.synpred12_XQueryParser()) ) {s = 50;}
+
+
+ input.seek(index121_4);
+ if ( s>=0 ) return s;
+ break;
+ case 4 :
+ var LA121_5 = input.LA(1);
+
+
+ var index121_5 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (this.synpred8_XQueryParser()) ) {s = 47;}
+
+ else if ( (this.synpred9_XQueryParser()) ) {s = 48;}
+
+ else if ( (this.synpred11_XQueryParser()) ) {s = 49;}
+
+ else if ( (this.synpred12_XQueryParser()) ) {s = 50;}
+
+
+ input.seek(index121_5);
+ if ( s>=0 ) return s;
+ break;
+ case 5 :
+ var LA121_6 = input.LA(1);
+
+
+ var index121_6 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (this.synpred8_XQueryParser()) ) {s = 47;}
+
+ else if ( (this.synpred9_XQueryParser()) ) {s = 48;}
+
+ else if ( (this.synpred11_XQueryParser()) ) {s = 49;}
+
+ else if ( (this.synpred12_XQueryParser()) ) {s = 50;}
+
+
+ input.seek(index121_6);
+ if ( s>=0 ) return s;
+ break;
+ case 6 :
+ var LA121_7 = input.LA(1);
+
+
+ var index121_7 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (this.synpred8_XQueryParser()) ) {s = 47;}
+
+ else if ( (this.synpred9_XQueryParser()) ) {s = 48;}
+
+ else if ( (this.synpred11_XQueryParser()) ) {s = 49;}
+
+ else if ( (this.synpred12_XQueryParser()) ) {s = 50;}
+
+
+ input.seek(index121_7);
+ if ( s>=0 ) return s;
+ break;
+ case 7 :
+ var LA121_8 = input.LA(1);
+
+
+ var index121_8 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (this.synpred8_XQueryParser()) ) {s = 47;}
+
+ else if ( (this.synpred9_XQueryParser()) ) {s = 48;}
+
+ else if ( (this.synpred11_XQueryParser()) ) {s = 49;}
+
+ else if ( (this.synpred12_XQueryParser()) ) {s = 50;}
+
+
+ input.seek(index121_8);
+ if ( s>=0 ) return s;
+ break;
+ case 8 :
+ var LA121_9 = input.LA(1);
+
+
+ var index121_9 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (this.synpred8_XQueryParser()) ) {s = 47;}
+
+ else if ( (this.synpred9_XQueryParser()) ) {s = 48;}
+
+ else if ( (this.synpred10_XQueryParser()) ) {s = 51;}
+
+ else if ( (this.synpred11_XQueryParser()) ) {s = 49;}
+
+ else if ( (this.synpred12_XQueryParser()) ) {s = 50;}
+
+ else if ( (true) ) {s = 52;}
+
+
+ input.seek(index121_9);
+ if ( s>=0 ) return s;
+ break;
+ case 9 :
+ var LA121_10 = input.LA(1);
+
+
+ var index121_10 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (this.synpred8_XQueryParser()) ) {s = 47;}
+
+ else if ( (this.synpred9_XQueryParser()) ) {s = 48;}
+
+ else if ( (this.synpred10_XQueryParser()) ) {s = 51;}
+
+ else if ( (this.synpred11_XQueryParser()) ) {s = 49;}
+
+ else if ( (this.synpred12_XQueryParser()) ) {s = 50;}
+
+ else if ( (true) ) {s = 52;}
+
+
+ input.seek(index121_10);
+ if ( s>=0 ) return s;
+ break;
+ case 10 :
+ var LA121_11 = input.LA(1);
+
+
+ var index121_11 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (this.synpred8_XQueryParser()) ) {s = 47;}
+
+ else if ( (this.synpred9_XQueryParser()) ) {s = 48;}
+
+ else if ( (this.synpred11_XQueryParser()) ) {s = 49;}
+
+ else if ( (this.synpred12_XQueryParser()) ) {s = 50;}
+
+
+ input.seek(index121_11);
+ if ( s>=0 ) return s;
+ break;
+ case 11 :
+ var LA121_12 = input.LA(1);
+
+
+ var index121_12 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (this.synpred8_XQueryParser()) ) {s = 47;}
+
+ else if ( (this.synpred9_XQueryParser()) ) {s = 48;}
+
+ else if ( (this.synpred10_XQueryParser()) ) {s = 51;}
+
+ else if ( (this.synpred11_XQueryParser()) ) {s = 49;}
+
+ else if ( (this.synpred12_XQueryParser()) ) {s = 50;}
+
+ else if ( (true) ) {s = 52;}
+
+
+ input.seek(index121_12);
+ if ( s>=0 ) return s;
+ break;
+ case 12 :
+ var LA121_13 = input.LA(1);
+
+
+ var index121_13 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (this.synpred8_XQueryParser()) ) {s = 47;}
+
+ else if ( (this.synpred9_XQueryParser()) ) {s = 48;}
+
+ else if ( (this.synpred10_XQueryParser()) ) {s = 51;}
+
+ else if ( (this.synpred11_XQueryParser()) ) {s = 49;}
+
+ else if ( (this.synpred12_XQueryParser()) ) {s = 50;}
+
+ else if ( (true) ) {s = 52;}
+
+
+ input.seek(index121_13);
+ if ( s>=0 ) return s;
+ break;
+ case 13 :
+ var LA121_14 = input.LA(1);
+
+
+ var index121_14 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (this.synpred8_XQueryParser()) ) {s = 47;}
+
+ else if ( (this.synpred9_XQueryParser()) ) {s = 48;}
+
+ else if ( (this.synpred11_XQueryParser()) ) {s = 49;}
+
+ else if ( (this.synpred12_XQueryParser()) ) {s = 50;}
+
+
+ input.seek(index121_14);
+ if ( s>=0 ) return s;
+ break;
+ case 14 :
+ var LA121_15 = input.LA(1);
+
+
+ var index121_15 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (this.synpred8_XQueryParser()) ) {s = 47;}
+
+ else if ( (this.synpred9_XQueryParser()) ) {s = 48;}
+
+ else if ( (this.synpred11_XQueryParser()) ) {s = 49;}
+
+ else if ( (this.synpred12_XQueryParser()) ) {s = 50;}
+
+
+ input.seek(index121_15);
+ if ( s>=0 ) return s;
+ break;
+ case 15 :
+ var LA121_16 = input.LA(1);
+
+
+ var index121_16 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (this.synpred8_XQueryParser()) ) {s = 47;}
+
+ else if ( (this.synpred9_XQueryParser()) ) {s = 48;}
+
+ else if ( (this.synpred11_XQueryParser()) ) {s = 49;}
+
+ else if ( (this.synpred12_XQueryParser()) ) {s = 50;}
+
+
+ input.seek(index121_16);
+ if ( s>=0 ) return s;
+ break;
+ case 16 :
+ var LA121_17 = input.LA(1);
+
+
+ var index121_17 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (this.synpred8_XQueryParser()) ) {s = 47;}
+
+ else if ( (this.synpred9_XQueryParser()) ) {s = 48;}
+
+ else if ( (this.synpred10_XQueryParser()) ) {s = 51;}
+
+ else if ( (this.synpred11_XQueryParser()) ) {s = 49;}
+
+ else if ( (this.synpred12_XQueryParser()) ) {s = 50;}
+
+ else if ( (true) ) {s = 52;}
+
+
+ input.seek(index121_17);
+ if ( s>=0 ) return s;
+ break;
+ case 17 :
+ var LA121_18 = input.LA(1);
+
+
+ var index121_18 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (this.synpred8_XQueryParser()) ) {s = 47;}
+
+ else if ( (this.synpred9_XQueryParser()) ) {s = 48;}
+
+ else if ( (this.synpred10_XQueryParser()) ) {s = 51;}
+
+ else if ( (this.synpred11_XQueryParser()) ) {s = 49;}
+
+ else if ( (this.synpred12_XQueryParser()) ) {s = 50;}
+
+ else if ( (true) ) {s = 52;}
+
+
+ input.seek(index121_18);
+ if ( s>=0 ) return s;
+ break;
+ case 18 :
+ var LA121_19 = input.LA(1);
+
+
+ var index121_19 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (this.synpred8_XQueryParser()) ) {s = 47;}
+
+ else if ( (this.synpred9_XQueryParser()) ) {s = 48;}
+
+ else if ( (this.synpred10_XQueryParser()) ) {s = 51;}
+
+ else if ( (this.synpred11_XQueryParser()) ) {s = 49;}
+
+ else if ( (this.synpred12_XQueryParser()) ) {s = 50;}
+
+ else if ( (true) ) {s = 52;}
+
+
+ input.seek(index121_19);
+ if ( s>=0 ) return s;
+ break;
+ case 19 :
+ var LA121_20 = input.LA(1);
+
+
+ var index121_20 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (this.synpred8_XQueryParser()) ) {s = 47;}
+
+ else if ( (this.synpred9_XQueryParser()) ) {s = 48;}
+
+ else if ( (this.synpred10_XQueryParser()) ) {s = 51;}
+
+ else if ( (this.synpred11_XQueryParser()) ) {s = 49;}
+
+ else if ( (this.synpred12_XQueryParser()) ) {s = 50;}
+
+ else if ( (true) ) {s = 52;}
+
+
+ input.seek(index121_20);
+ if ( s>=0 ) return s;
+ break;
+ case 20 :
+ var LA121_21 = input.LA(1);
+
+
+ var index121_21 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (this.synpred8_XQueryParser()) ) {s = 47;}
+
+ else if ( (this.synpred9_XQueryParser()) ) {s = 48;}
+
+ else if ( (this.synpred10_XQueryParser()) ) {s = 51;}
+
+ else if ( (this.synpred11_XQueryParser()) ) {s = 49;}
+
+ else if ( (this.synpred12_XQueryParser()) ) {s = 50;}
+
+ else if ( (true) ) {s = 52;}
+
+
+ input.seek(index121_21);
+ if ( s>=0 ) return s;
+ break;
+ case 21 :
+ var LA121_22 = input.LA(1);
+
+
+ var index121_22 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (this.synpred8_XQueryParser()) ) {s = 47;}
+
+ else if ( (this.synpred9_XQueryParser()) ) {s = 48;}
+
+ else if ( (this.synpred10_XQueryParser()) ) {s = 51;}
+
+ else if ( (this.synpred11_XQueryParser()) ) {s = 49;}
+
+ else if ( (this.synpred12_XQueryParser()) ) {s = 50;}
+
+ else if ( (true) ) {s = 52;}
+
+
+ input.seek(index121_22);
+ if ( s>=0 ) return s;
+ break;
+ case 22 :
+ var LA121_23 = input.LA(1);
+
+
+ var index121_23 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (this.synpred8_XQueryParser()) ) {s = 47;}
+
+ else if ( (this.synpred9_XQueryParser()) ) {s = 48;}
+
+ else if ( (this.synpred10_XQueryParser()) ) {s = 51;}
+
+ else if ( (this.synpred11_XQueryParser()) ) {s = 49;}
+
+ else if ( (this.synpred12_XQueryParser()) ) {s = 50;}
+
+ else if ( (true) ) {s = 52;}
+
+
+ input.seek(index121_23);
+ if ( s>=0 ) return s;
+ break;
+ case 23 :
+ var LA121_24 = input.LA(1);
+
+
+ var index121_24 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (this.synpred8_XQueryParser()) ) {s = 47;}
+
+ else if ( (this.synpred9_XQueryParser()) ) {s = 48;}
+
+ else if ( (this.synpred11_XQueryParser()) ) {s = 49;}
+
+ else if ( (this.synpred12_XQueryParser()) ) {s = 50;}
+
+
+ input.seek(index121_24);
+ if ( s>=0 ) return s;
+ break;
+ case 24 :
+ var LA121_25 = input.LA(1);
+
+
+ var index121_25 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (this.synpred8_XQueryParser()) ) {s = 47;}
+
+ else if ( (this.synpred9_XQueryParser()) ) {s = 48;}
+
+ else if ( (this.synpred10_XQueryParser()) ) {s = 51;}
+
+ else if ( (this.synpred11_XQueryParser()) ) {s = 49;}
+
+ else if ( (this.synpred12_XQueryParser()) ) {s = 50;}
+
+ else if ( (true) ) {s = 52;}
+
+
+ input.seek(index121_25);
+ if ( s>=0 ) return s;
+ break;
+ case 25 :
+ var LA121_26 = input.LA(1);
+
+
+ var index121_26 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (this.synpred8_XQueryParser()) ) {s = 47;}
+
+ else if ( (this.synpred9_XQueryParser()) ) {s = 48;}
+
+ else if ( (this.synpred11_XQueryParser()) ) {s = 49;}
+
+ else if ( (this.synpred12_XQueryParser()) ) {s = 50;}
+
+
+ input.seek(index121_26);
+ if ( s>=0 ) return s;
+ break;
+ case 26 :
+ var LA121_27 = input.LA(1);
+
+
+ var index121_27 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (this.synpred8_XQueryParser()) ) {s = 47;}
+
+ else if ( (this.synpred9_XQueryParser()) ) {s = 48;}
+
+ else if ( (this.synpred11_XQueryParser()) ) {s = 49;}
+
+ else if ( (this.synpred12_XQueryParser()) ) {s = 50;}
+
+
+ input.seek(index121_27);
+ if ( s>=0 ) return s;
+ break;
+ case 27 :
+ var LA121_28 = input.LA(1);
+
+
+ var index121_28 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (this.synpred8_XQueryParser()) ) {s = 47;}
+
+ else if ( (this.synpred9_XQueryParser()) ) {s = 48;}
+
+ else if ( (this.synpred10_XQueryParser()) ) {s = 51;}
+
+ else if ( (this.synpred11_XQueryParser()) ) {s = 49;}
+
+ else if ( (this.synpred12_XQueryParser()) ) {s = 50;}
+
+ else if ( (true) ) {s = 52;}
+
+
+ input.seek(index121_28);
+ if ( s>=0 ) return s;
+ break;
+ case 28 :
+ var LA121_29 = input.LA(1);
+
+
+ var index121_29 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (this.synpred8_XQueryParser()) ) {s = 47;}
+
+ else if ( (this.synpred9_XQueryParser()) ) {s = 48;}
+
+ else if ( (this.synpred10_XQueryParser()) ) {s = 51;}
+
+ else if ( (this.synpred11_XQueryParser()) ) {s = 49;}
+
+ else if ( (this.synpred12_XQueryParser()) ) {s = 50;}
+
+ else if ( (true) ) {s = 52;}
+
+
+ input.seek(index121_29);
+ if ( s>=0 ) return s;
+ break;
+ case 29 :
+ var LA121_30 = input.LA(1);
+
+
+ var index121_30 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (this.synpred8_XQueryParser()) ) {s = 47;}
+
+ else if ( (this.synpred9_XQueryParser()) ) {s = 48;}
+
+ else if ( (this.synpred10_XQueryParser()) ) {s = 51;}
+
+ else if ( (this.synpred11_XQueryParser()) ) {s = 49;}
+
+ else if ( (this.synpred12_XQueryParser()) ) {s = 50;}
+
+ else if ( (true) ) {s = 52;}
+
+
+ input.seek(index121_30);
+ if ( s>=0 ) return s;
+ break;
+ case 30 :
+ var LA121_31 = input.LA(1);
+
+
+ var index121_31 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (this.synpred8_XQueryParser()) ) {s = 47;}
+
+ else if ( (this.synpred9_XQueryParser()) ) {s = 48;}
+
+ else if ( (this.synpred10_XQueryParser()) ) {s = 51;}
+
+ else if ( (this.synpred11_XQueryParser()) ) {s = 49;}
+
+ else if ( (this.synpred12_XQueryParser()) ) {s = 50;}
+
+ else if ( (true) ) {s = 52;}
+
+
+ input.seek(index121_31);
+ if ( s>=0 ) return s;
+ break;
+ case 31 :
+ var LA121_32 = input.LA(1);
+
+
+ var index121_32 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (this.synpred8_XQueryParser()) ) {s = 47;}
+
+ else if ( (this.synpred9_XQueryParser()) ) {s = 48;}
+
+ else if ( (this.synpred10_XQueryParser()) ) {s = 51;}
+
+ else if ( (this.synpred11_XQueryParser()) ) {s = 49;}
+
+ else if ( (this.synpred12_XQueryParser()) ) {s = 50;}
+
+ else if ( (true) ) {s = 52;}
+
+
+ input.seek(index121_32);
+ if ( s>=0 ) return s;
+ break;
+ case 32 :
+ var LA121_33 = input.LA(1);
+
+
+ var index121_33 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (this.synpred10_XQueryParser()) ) {s = 51;}
+
+ else if ( (true) ) {s = 52;}
+
+
+ input.seek(index121_33);
+ if ( s>=0 ) return s;
+ break;
+ case 33 :
+ var LA121_34 = input.LA(1);
+
+
+ var index121_34 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (this.synpred8_XQueryParser()) ) {s = 47;}
+
+ else if ( (this.synpred9_XQueryParser()) ) {s = 48;}
+
+ else if ( (this.synpred10_XQueryParser()) ) {s = 51;}
+
+ else if ( (this.synpred11_XQueryParser()) ) {s = 49;}
+
+ else if ( (this.synpred12_XQueryParser()) ) {s = 50;}
+
+ else if ( (true) ) {s = 52;}
+
+
+ input.seek(index121_34);
+ if ( s>=0 ) return s;
+ break;
+ case 34 :
+ var LA121_35 = input.LA(1);
+
+
+ var index121_35 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (this.synpred8_XQueryParser()) ) {s = 47;}
+
+ else if ( (this.synpred9_XQueryParser()) ) {s = 48;}
+
+ else if ( (this.synpred10_XQueryParser()) ) {s = 51;}
+
+ else if ( (this.synpred11_XQueryParser()) ) {s = 49;}
+
+ else if ( (this.synpred12_XQueryParser()) ) {s = 50;}
+
+ else if ( (true) ) {s = 52;}
+
+
+ input.seek(index121_35);
+ if ( s>=0 ) return s;
+ break;
+ case 35 :
+ var LA121_36 = input.LA(1);
+
+
+ var index121_36 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (this.synpred8_XQueryParser()) ) {s = 47;}
+
+ else if ( (this.synpred9_XQueryParser()) ) {s = 48;}
+
+ else if ( (this.synpred10_XQueryParser()) ) {s = 51;}
+
+ else if ( (this.synpred11_XQueryParser()) ) {s = 49;}
+
+ else if ( (this.synpred12_XQueryParser()) ) {s = 50;}
+
+ else if ( (true) ) {s = 52;}
+
+
+ input.seek(index121_36);
+ if ( s>=0 ) return s;
+ break;
+ case 36 :
+ var LA121_37 = input.LA(1);
+
+
+ var index121_37 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (this.synpred8_XQueryParser()) ) {s = 47;}
+
+ else if ( (this.synpred9_XQueryParser()) ) {s = 48;}
+
+ else if ( (this.synpred10_XQueryParser()) ) {s = 51;}
+
+ else if ( (this.synpred11_XQueryParser()) ) {s = 49;}
+
+ else if ( (this.synpred12_XQueryParser()) ) {s = 50;}
+
+ else if ( (true) ) {s = 52;}
+
+
+ input.seek(index121_37);
+ if ( s>=0 ) return s;
+ break;
+ case 37 :
+ var LA121_38 = input.LA(1);
+
+
+ var index121_38 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (this.synpred8_XQueryParser()) ) {s = 47;}
+
+ else if ( (this.synpred9_XQueryParser()) ) {s = 48;}
+
+ else if ( (this.synpred10_XQueryParser()) ) {s = 51;}
+
+ else if ( (this.synpred11_XQueryParser()) ) {s = 49;}
+
+ else if ( (this.synpred12_XQueryParser()) ) {s = 50;}
+
+ else if ( (true) ) {s = 52;}
+
+
+ input.seek(index121_38);
+ if ( s>=0 ) return s;
+ break;
+ case 38 :
+ var LA121_39 = input.LA(1);
+
+
+ var index121_39 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (this.synpred8_XQueryParser()) ) {s = 47;}
+
+ else if ( (this.synpred9_XQueryParser()) ) {s = 48;}
+
+ else if ( (this.synpred10_XQueryParser()) ) {s = 51;}
+
+ else if ( (this.synpred11_XQueryParser()) ) {s = 49;}
+
+ else if ( (this.synpred12_XQueryParser()) ) {s = 50;}
+
+ else if ( (true) ) {s = 52;}
+
+
+ input.seek(index121_39);
+ if ( s>=0 ) return s;
+ break;
+ case 39 :
+ var LA121_40 = input.LA(1);
+
+
+ var index121_40 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (this.synpred10_XQueryParser()) ) {s = 51;}
+
+ else if ( (true) ) {s = 52;}
+
+
+ input.seek(index121_40);
+ if ( s>=0 ) return s;
+ break;
+ case 40 :
+ var LA121_41 = input.LA(1);
+
+
+ var index121_41 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (this.synpred8_XQueryParser()) ) {s = 47;}
+
+ else if ( (this.synpred9_XQueryParser()) ) {s = 48;}
+
+ else if ( (this.synpred10_XQueryParser()) ) {s = 51;}
+
+ else if ( (this.synpred11_XQueryParser()) ) {s = 49;}
+
+ else if ( (this.synpred12_XQueryParser()) ) {s = 50;}
+
+ else if ( (true) ) {s = 52;}
+
+
+ input.seek(index121_41);
+ if ( s>=0 ) return s;
+ break;
+ case 41 :
+ var LA121_42 = input.LA(1);
+
+
+ var index121_42 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (this.synpred8_XQueryParser()) ) {s = 47;}
+
+ else if ( (this.synpred9_XQueryParser()) ) {s = 48;}
+
+ else if ( (this.synpred10_XQueryParser()) ) {s = 51;}
+
+ else if ( (this.synpred11_XQueryParser()) ) {s = 49;}
+
+ else if ( (this.synpred12_XQueryParser()) ) {s = 50;}
+
+ else if ( (true) ) {s = 52;}
+
+
+ input.seek(index121_42);
+ if ( s>=0 ) return s;
+ break;
+ case 42 :
+ var LA121_43 = input.LA(1);
+
+
+ var index121_43 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (this.synpred8_XQueryParser()) ) {s = 47;}
+
+ else if ( (this.synpred9_XQueryParser()) ) {s = 48;}
+
+ else if ( (this.synpred10_XQueryParser()) ) {s = 51;}
+
+ else if ( (this.synpred11_XQueryParser()) ) {s = 49;}
+
+ else if ( (this.synpred12_XQueryParser()) ) {s = 50;}
+
+ else if ( (true) ) {s = 52;}
+
+
+ input.seek(index121_43);
+ if ( s>=0 ) return s;
+ break;
+ case 43 :
+ var LA121_44 = input.LA(1);
+
+
+ var index121_44 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (this.synpred8_XQueryParser()) ) {s = 47;}
+
+ else if ( (this.synpred9_XQueryParser()) ) {s = 48;}
+
+ else if ( (this.synpred10_XQueryParser()) ) {s = 51;}
+
+ else if ( (this.synpred11_XQueryParser()) ) {s = 49;}
+
+ else if ( (this.synpred12_XQueryParser()) ) {s = 50;}
+
+ else if ( (true) ) {s = 52;}
+
+
+ input.seek(index121_44);
+ if ( s>=0 ) return s;
+ break;
+ case 44 :
+ var LA121_45 = input.LA(1);
+
+
+ var index121_45 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (this.synpred8_XQueryParser()) ) {s = 47;}
+
+ else if ( (this.synpred9_XQueryParser()) ) {s = 48;}
+
+ else if ( (this.synpred10_XQueryParser()) ) {s = 51;}
+
+ else if ( (this.synpred11_XQueryParser()) ) {s = 49;}
+
+ else if ( (this.synpred12_XQueryParser()) ) {s = 50;}
+
+ else if ( (true) ) {s = 52;}
+
+
+ input.seek(index121_45);
+ if ( s>=0 ) return s;
+ break;
+ case 45 :
+ var LA121_46 = input.LA(1);
+
+
+ var index121_46 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (this.synpred10_XQueryParser()) ) {s = 51;}
+
+ else if ( (true) ) {s = 52;}
+
+
+ input.seek(index121_46);
+ if ( s>=0 ) return s;
+ break;
+ }
+ }).call(this.recognizer, s, input);
+ if (!org.antlr.lang.isUndefined(retval)) {
+ return retval;
+ }
+ if (this.recognizer.state.backtracking>0) {this.recognizer.state.failed=true; return -1;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException(this.getDescription(), 121, _s, input);
+ this.error(nvae);
+ throw nvae;
+ },
+ dummy: null
+});
+org.antlr.lang.augmentObject(XQueryParser, {
+ DFA123_eotS:
+ "\u000a\uffff",
+ DFA123_eofS:
+ "\u0001\uffff\u0007\u0008\u0002\uffff",
+ DFA123_minS:
+ "\u0001\u0010\u0007\u0012\u0002\uffff",
+ DFA123_maxS:
+ "\u0001\u0116\u0007\u0107\u0002\uffff",
+ DFA123_acceptS:
+ "\u0008\uffff\u0001\u0002\u0001\u0001",
+ DFA123_specialS:
+ "\u000a\uffff}>",
+ DFA123_transitionS: [
+ "\u0006\u0008\u0001\u0003\u0006\u0008\u0001\u0001\u0006\u0008"+
+ "\u0001\u0002\u0001\u0005\u000d\u0008\u0001\u0007\u0001\u0006"+
+ "\u002f\u0008\u0001\u0004\u003d\u0008\u0001\uffff\u003f\u0008"+
+ "\u0012\uffff\u0001\u0008\u0019\uffff\u0002\u0008\u0006\uffff"+
+ "\u0001\u0008",
+ "\u0004\u0008\u0003\uffff\u0004\u0008\u0001\uffff\u0001\u0008"+
+ "\u0004\uffff\u0001\u0008\u0002\uffff\u0002\u0008\u0004\uffff"+
+ "\u0001\u0008\u0002\uffff\u0001\u0008\u0001\uffff\u0001\u0008"+
+ "\u0003\uffff\u0001\u0008\u0001\uffff\u0001\u0008\u0001\uffff"+
+ "\u0002\u0008\u0004\uffff\u0003\u0008\u0002\uffff\u0001\u0008"+
+ "\u0001\uffff\u0003\u0008\u0002\uffff\u0001\u0008\u0006\uffff"+
+ "\u0002\u0008\u000b\uffff\u0002\u0008\u0005\uffff\u0001\u0008"+
+ "\u0004\uffff\u0002\u0008\u0001\uffff\u0001\u0008\u0004\uffff"+
+ "\u0001\u0008\u0004\uffff\u0001\u0008\u0003\uffff\u0002\u0008"+
+ "\u0006\uffff\u0001\u0008\u0005\uffff\u0001\u0008\u0007\uffff"+
+ "\u0002\u0008\u0004\uffff\u0001\u0008\u0003\uffff\u0001\u0008"+
+ "\u0007\uffff\u0001\u0008\u0002\uffff\u0001\u0008\u0014\uffff"+
+ "\u0001\u0008\u0006\uffff\u0001\u0008\u0003\uffff\u0001\u0008"+
+ "\u0006\uffff\u0001\u0008\u0013\uffff\u0001\u0008\u0001\uffff"+
+ "\u0001\u0008\u0002\uffff\u0001\u0008\u0001\uffff\u0004\u0008"+
+ "\u0001\uffff\u0001\u0008\u0003\uffff\u0001\u0008\u0001\uffff"+
+ "\u000c\u0008\u0002\uffff\u0001\u0008\u0001\u0009\u0002\uffff"+
+ "\u0002\u0008",
+ "\u0004\u0008\u0003\uffff\u0004\u0008\u0001\uffff\u0001\u0008"+
+ "\u0004\uffff\u0001\u0008\u0002\uffff\u0002\u0008\u0004\uffff"+
+ "\u0001\u0008\u0002\uffff\u0001\u0008\u0001\uffff\u0001\u0008"+
+ "\u0003\uffff\u0001\u0008\u0001\uffff\u0001\u0008\u0001\uffff"+
+ "\u0002\u0008\u0004\uffff\u0003\u0008\u0002\uffff\u0001\u0008"+
+ "\u0001\uffff\u0003\u0008\u0002\uffff\u0001\u0008\u0006\uffff"+
+ "\u0002\u0008\u000b\uffff\u0002\u0008\u0005\uffff\u0001\u0008"+
+ "\u0004\uffff\u0002\u0008\u0001\uffff\u0001\u0008\u0004\uffff"+
+ "\u0001\u0008\u0004\uffff\u0001\u0008\u0003\uffff\u0002\u0008"+
+ "\u0006\uffff\u0001\u0008\u0005\uffff\u0001\u0008\u0007\uffff"+
+ "\u0002\u0008\u0004\uffff\u0001\u0008\u0003\uffff\u0001\u0008"+
+ "\u0007\uffff\u0001\u0008\u0002\uffff\u0001\u0008\u0014\uffff"+
+ "\u0001\u0008\u0006\uffff\u0001\u0008\u0003\uffff\u0001\u0008"+
+ "\u0006\uffff\u0001\u0008\u0013\uffff\u0001\u0008\u0001\uffff"+
+ "\u0001\u0008\u0002\uffff\u0001\u0008\u0001\uffff\u0004\u0008"+
+ "\u0001\uffff\u0001\u0008\u0003\uffff\u0001\u0008\u0001\uffff"+
+ "\u000c\u0008\u0002\uffff\u0001\u0008\u0001\u0009\u0002\uffff"+
+ "\u0002\u0008",
+ "\u0004\u0008\u0003\uffff\u0004\u0008\u0001\uffff\u0001\u0008"+
+ "\u0004\uffff\u0001\u0008\u0002\uffff\u0002\u0008\u0004\uffff"+
+ "\u0001\u0008\u0002\uffff\u0001\u0008\u0001\uffff\u0001\u0008"+
+ "\u0003\uffff\u0001\u0008\u0001\uffff\u0001\u0008\u0001\uffff"+
+ "\u0002\u0008\u0004\uffff\u0003\u0008\u0002\uffff\u0001\u0008"+
+ "\u0001\uffff\u0003\u0008\u0002\uffff\u0001\u0008\u0006\uffff"+
+ "\u0002\u0008\u000b\uffff\u0002\u0008\u0005\uffff\u0001\u0008"+
+ "\u0004\uffff\u0002\u0008\u0001\uffff\u0001\u0008\u0004\uffff"+
+ "\u0001\u0008\u0004\uffff\u0001\u0008\u0003\uffff\u0002\u0008"+
+ "\u0006\uffff\u0001\u0008\u0005\uffff\u0001\u0008\u0007\uffff"+
+ "\u0002\u0008\u0004\uffff\u0001\u0008\u0003\uffff\u0001\u0008"+
+ "\u0007\uffff\u0001\u0008\u0002\uffff\u0001\u0008\u0014\uffff"+
+ "\u0001\u0008\u0006\uffff\u0001\u0008\u0003\uffff\u0001\u0008"+
+ "\u0006\uffff\u0001\u0008\u0013\uffff\u0003\u0008\u0002\uffff"+
+ "\u0001\u0008\u0001\uffff\u0004\u0008\u0001\uffff\u0001\u0008"+
+ "\u0003\uffff\u0001\u0008\u0001\uffff\u000c\u0008\u0002\uffff"+
+ "\u0001\u0008\u0001\u0009\u0002\uffff\u0002\u0008",
+ "\u0004\u0008\u0003\uffff\u0004\u0008\u0001\uffff\u0001\u0008"+
+ "\u0004\uffff\u0001\u0008\u0002\uffff\u0002\u0008\u0004\uffff"+
+ "\u0001\u0008\u0002\uffff\u0001\u0008\u0001\uffff\u0001\u0008"+
+ "\u0003\uffff\u0001\u0008\u0001\uffff\u0001\u0008\u0001\uffff"+
+ "\u0002\u0008\u0004\uffff\u0003\u0008\u0002\uffff\u0001\u0008"+
+ "\u0001\uffff\u0003\u0008\u0002\uffff\u0001\u0008\u0006\uffff"+
+ "\u0002\u0008\u000b\uffff\u0002\u0008\u0005\uffff\u0001\u0008"+
+ "\u0004\uffff\u0002\u0008\u0001\uffff\u0001\u0008\u0004\uffff"+
+ "\u0001\u0008\u0004\uffff\u0001\u0008\u0003\uffff\u0002\u0008"+
+ "\u0006\uffff\u0001\u0008\u0005\uffff\u0001\u0008\u0007\uffff"+
+ "\u0002\u0008\u0004\uffff\u0001\u0008\u0003\uffff\u0001\u0008"+
+ "\u0007\uffff\u0001\u0008\u0002\uffff\u0001\u0008\u0014\uffff"+
+ "\u0001\u0008\u0006\uffff\u0001\u0008\u0003\uffff\u0001\u0008"+
+ "\u0006\uffff\u0001\u0008\u0013\uffff\u0001\u0008\u0001\uffff"+
+ "\u0001\u0008\u0002\uffff\u0001\u0008\u0001\uffff\u0004\u0008"+
+ "\u0001\uffff\u0001\u0008\u0003\uffff\u0001\u0008\u0001\uffff"+
+ "\u000c\u0008\u0002\uffff\u0001\u0008\u0001\u0009\u0002\uffff"+
+ "\u0002\u0008",
+ "\u0004\u0008\u0003\uffff\u0004\u0008\u0001\uffff\u0001\u0008"+
+ "\u0004\uffff\u0001\u0008\u0002\uffff\u0002\u0008\u0004\uffff"+
+ "\u0001\u0008\u0002\uffff\u0001\u0008\u0001\uffff\u0001\u0008"+
+ "\u0003\uffff\u0001\u0008\u0001\uffff\u0001\u0008\u0001\uffff"+
+ "\u0002\u0008\u0004\uffff\u0003\u0008\u0002\uffff\u0001\u0008"+
+ "\u0001\uffff\u0003\u0008\u0002\uffff\u0001\u0008\u0006\uffff"+
+ "\u0002\u0008\u000b\uffff\u0002\u0008\u0005\uffff\u0001\u0008"+
+ "\u0004\uffff\u0002\u0008\u0001\uffff\u0001\u0008\u0004\uffff"+
+ "\u0001\u0008\u0004\uffff\u0001\u0008\u0003\uffff\u0002\u0008"+
+ "\u0006\uffff\u0001\u0008\u0005\uffff\u0001\u0008\u0007\uffff"+
+ "\u0002\u0008\u0004\uffff\u0001\u0008\u0003\uffff\u0001\u0008"+
+ "\u0007\uffff\u0001\u0008\u0002\uffff\u0001\u0008\u0014\uffff"+
+ "\u0001\u0008\u0006\uffff\u0001\u0008\u0003\uffff\u0001\u0008"+
+ "\u0006\uffff\u0001\u0008\u0013\uffff\u0001\u0008\u0001\uffff"+
+ "\u0001\u0008\u0002\uffff\u0001\u0008\u0001\uffff\u0004\u0008"+
+ "\u0001\uffff\u0001\u0008\u0003\uffff\u0001\u0008\u0001\uffff"+
+ "\u000c\u0008\u0002\uffff\u0001\u0008\u0001\u0009\u0002\uffff"+
+ "\u0002\u0008",
+ "\u0004\u0008\u0003\uffff\u0004\u0008\u0001\uffff\u0001\u0008"+
+ "\u0004\uffff\u0001\u0008\u0002\uffff\u0002\u0008\u0004\uffff"+
+ "\u0001\u0008\u0002\uffff\u0001\u0008\u0001\uffff\u0001\u0008"+
+ "\u0003\uffff\u0001\u0008\u0001\uffff\u0001\u0008\u0001\uffff"+
+ "\u0002\u0008\u0004\uffff\u0003\u0008\u0002\uffff\u0001\u0008"+
+ "\u0001\uffff\u0003\u0008\u0002\uffff\u0001\u0008\u0006\uffff"+
+ "\u0002\u0008\u000b\uffff\u0002\u0008\u0005\uffff\u0001\u0008"+
+ "\u0004\uffff\u0002\u0008\u0001\uffff\u0001\u0008\u0004\uffff"+
+ "\u0001\u0008\u0004\uffff\u0001\u0008\u0003\uffff\u0002\u0008"+
+ "\u0006\uffff\u0001\u0008\u0005\uffff\u0001\u0008\u0007\uffff"+
+ "\u0002\u0008\u0004\uffff\u0001\u0008\u0003\uffff\u0001\u0008"+
+ "\u0007\uffff\u0001\u0008\u0002\uffff\u0001\u0008\u0014\uffff"+
+ "\u0001\u0008\u0006\uffff\u0001\u0008\u0003\uffff\u0001\u0008"+
+ "\u0006\uffff\u0001\u0008\u0013\uffff\u0001\u0008\u0001\uffff"+
+ "\u0001\u0008\u0002\uffff\u0001\u0008\u0001\uffff\u0004\u0008"+
+ "\u0001\uffff\u0001\u0008\u0003\uffff\u0001\u0008\u0001\uffff"+
+ "\u000c\u0008\u0002\uffff\u0001\u0008\u0001\u0009\u0002\uffff"+
+ "\u0002\u0008",
+ "\u0004\u0008\u0003\uffff\u0004\u0008\u0001\uffff\u0001\u0008"+
+ "\u0004\uffff\u0001\u0008\u0002\uffff\u0002\u0008\u0004\uffff"+
+ "\u0001\u0008\u0002\uffff\u0001\u0008\u0001\uffff\u0001\u0008"+
+ "\u0003\uffff\u0001\u0008\u0001\uffff\u0001\u0008\u0001\uffff"+
+ "\u0002\u0008\u0004\uffff\u0003\u0008\u0002\uffff\u0001\u0008"+
+ "\u0001\uffff\u0003\u0008\u0002\uffff\u0001\u0008\u0006\uffff"+
+ "\u0002\u0008\u000b\uffff\u0002\u0008\u0005\uffff\u0001\u0008"+
+ "\u0004\uffff\u0002\u0008\u0001\uffff\u0001\u0008\u0004\uffff"+
+ "\u0001\u0008\u0004\uffff\u0001\u0008\u0003\uffff\u0002\u0008"+
+ "\u0006\uffff\u0001\u0008\u0005\uffff\u0001\u0008\u0007\uffff"+
+ "\u0002\u0008\u0004\uffff\u0001\u0008\u0003\uffff\u0001\u0008"+
+ "\u0007\uffff\u0001\u0008\u0002\uffff\u0001\u0008\u0014\uffff"+
+ "\u0001\u0008\u0006\uffff\u0001\u0008\u0003\uffff\u0001\u0008"+
+ "\u0006\uffff\u0001\u0008\u0013\uffff\u0001\u0008\u0001\uffff"+
+ "\u0001\u0008\u0002\uffff\u0001\u0008\u0001\uffff\u0004\u0008"+
+ "\u0001\uffff\u0001\u0008\u0003\uffff\u0001\u0008\u0001\uffff"+
+ "\u000c\u0008\u0002\uffff\u0001\u0008\u0001\u0009\u0002\uffff"+
+ "\u0002\u0008",
+ "",
+ ""
+ ]
+});
+
+org.antlr.lang.augmentObject(XQueryParser, {
+ DFA123_eot:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA123_eotS),
+ DFA123_eof:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA123_eofS),
+ DFA123_min:
+ org.antlr.runtime.DFA.unpackEncodedStringToUnsignedChars(XQueryParser.DFA123_minS),
+ DFA123_max:
+ org.antlr.runtime.DFA.unpackEncodedStringToUnsignedChars(XQueryParser.DFA123_maxS),
+ DFA123_accept:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA123_acceptS),
+ DFA123_special:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA123_specialS),
+ DFA123_transition: (function() {
+ var a = [],
+ i,
+ numStates = XQueryParser.DFA123_transitionS.length;
+ for (i=0; i<numStates; i++) {
+ a.push(org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA123_transitionS[i]));
+ }
+ return a;
+ })()
+});
+
+XQueryParser.DFA123 = function(recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 123;
+ this.eot = XQueryParser.DFA123_eot;
+ this.eof = XQueryParser.DFA123_eof;
+ this.min = XQueryParser.DFA123_min;
+ this.max = XQueryParser.DFA123_max;
+ this.accept = XQueryParser.DFA123_accept;
+ this.special = XQueryParser.DFA123_special;
+ this.transition = XQueryParser.DFA123_transition;
+};
+
+org.antlr.lang.extend(XQueryParser.DFA123, org.antlr.runtime.DFA, {
+ getDescription: function() {
+ return "944:1: p_ForwardStep : ( p_ForwardAxis p_NodeTest | p_AbbrevForwardStep );";
+ },
+ dummy: null
+});
+org.antlr.lang.augmentObject(XQueryParser, {
+ DFA128_eotS:
+ "\u000d\uffff",
+ DFA128_eofS:
+ "\u0001\uffff\u000a\u000b\u0002\uffff",
+ DFA128_minS:
+ "\u0001\u0010\u000a\u0012\u0002\uffff",
+ DFA128_maxS:
+ "\u0001\u0116\u000a\u0107\u0002\uffff",
+ DFA128_acceptS:
+ "\u000b\uffff\u0001\u0002\u0001\u0001",
+ DFA128_specialS:
+ "\u000d\uffff}>",
+ DFA128_transitionS: [
+ "\u0006\u000b\u0001\u0003\u0008\u000b\u0001\u0007\u0009\u000b"+
+ "\u0001\u0001\u0001\u0002\u0023\u000b\u0001\u000a\u000b\u000b"+
+ "\u0001\u0006\u0007\u000b\u0001\u0005\u0001\u0004\u0005\u000b"+
+ "\u0001\u0008\u0017\u000b\u0001\u0009\u0020\u000b\u0001\uffff"+
+ "\u003f\u000b\u0012\uffff\u0001\u000b\u001a\uffff\u0001\u000b"+
+ "\u0006\uffff\u0001\u000b",
+ "\u0004\u000b\u0003\uffff\u0004\u000b\u0001\uffff\u0001\u000b"+
+ "\u0004\uffff\u0001\u000b\u0002\uffff\u0002\u000b\u0004\uffff"+
+ "\u0001\u000b\u0002\uffff\u0001\u000b\u0001\uffff\u0001\u000b"+
+ "\u0003\uffff\u0001\u000b\u0001\uffff\u0001\u000b\u0001\uffff"+
+ "\u0002\u000b\u0004\uffff\u0003\u000b\u0002\uffff\u0001\u000b"+
+ "\u0001\uffff\u0003\u000b\u0002\uffff\u0001\u000b\u0006\uffff"+
+ "\u0002\u000b\u000b\uffff\u0002\u000b\u0005\uffff\u0001\u000b"+
+ "\u0004\uffff\u0002\u000b\u0001\uffff\u0001\u000b\u0004\uffff"+
+ "\u0001\u000b\u0004\uffff\u0001\u000b\u0003\uffff\u0002\u000b"+
+ "\u0006\uffff\u0001\u000b\u0005\uffff\u0001\u000b\u0007\uffff"+
+ "\u0002\u000b\u0004\uffff\u0001\u000b\u0003\uffff\u0001\u000b"+
+ "\u0007\uffff\u0001\u000b\u0002\uffff\u0001\u000b\u0014\uffff"+
+ "\u0001\u000b\u0006\uffff\u0001\u000b\u0003\uffff\u0001\u000b"+
+ "\u0006\uffff\u0001\u000b\u0013\uffff\u0001\u000b\u0001\u000c"+
+ "\u0001\u000b\u0002\uffff\u0001\u000b\u0001\uffff\u0004\u000b"+
+ "\u0001\uffff\u0001\u000b\u0003\uffff\u0001\u000b\u0001\uffff"+
+ "\u000c\u000b\u0002\uffff\u0001\u000b\u0003\uffff\u0002\u000b",
+ "\u0004\u000b\u0003\uffff\u0004\u000b\u0001\uffff\u0001\u000b"+
+ "\u0004\uffff\u0001\u000b\u0002\uffff\u0002\u000b\u0004\uffff"+
+ "\u0001\u000b\u0002\uffff\u0001\u000b\u0001\uffff\u0001\u000b"+
+ "\u0003\uffff\u0001\u000b\u0001\uffff\u0001\u000b\u0001\uffff"+
+ "\u0002\u000b\u0004\uffff\u0003\u000b\u0002\uffff\u0001\u000b"+
+ "\u0001\uffff\u0003\u000b\u0002\uffff\u0001\u000b\u0006\uffff"+
+ "\u0002\u000b\u000b\uffff\u0002\u000b\u0005\uffff\u0001\u000b"+
+ "\u0004\uffff\u0002\u000b\u0001\uffff\u0001\u000b\u0004\uffff"+
+ "\u0001\u000b\u0004\uffff\u0001\u000b\u0003\uffff\u0002\u000b"+
+ "\u0006\uffff\u0001\u000b\u0005\uffff\u0001\u000b\u0007\uffff"+
+ "\u0002\u000b\u0004\uffff\u0001\u000b\u0003\uffff\u0001\u000b"+
+ "\u0007\uffff\u0001\u000b\u0002\uffff\u0001\u000b\u0014\uffff"+
+ "\u0001\u000b\u0006\uffff\u0001\u000b\u0003\uffff\u0001\u000b"+
+ "\u0006\uffff\u0001\u000b\u0013\uffff\u0001\u000b\u0001\u000c"+
+ "\u0001\u000b\u0002\uffff\u0001\u000b\u0001\uffff\u0004\u000b"+
+ "\u0001\uffff\u0001\u000b\u0003\uffff\u0001\u000b\u0001\uffff"+
+ "\u000c\u000b\u0002\uffff\u0001\u000b\u0003\uffff\u0002\u000b",
+ "\u0004\u000b\u0003\uffff\u0004\u000b\u0001\uffff\u0001\u000b"+
+ "\u0004\uffff\u0001\u000b\u0002\uffff\u0002\u000b\u0004\uffff"+
+ "\u0001\u000b\u0002\uffff\u0001\u000b\u0001\uffff\u0001\u000b"+
+ "\u0003\uffff\u0001\u000b\u0001\uffff\u0001\u000b\u0001\uffff"+
+ "\u0002\u000b\u0004\uffff\u0003\u000b\u0002\uffff\u0001\u000b"+
+ "\u0001\uffff\u0003\u000b\u0002\uffff\u0001\u000b\u0006\uffff"+
+ "\u0002\u000b\u000b\uffff\u0002\u000b\u0005\uffff\u0001\u000b"+
+ "\u0004\uffff\u0002\u000b\u0001\uffff\u0001\u000b\u0004\uffff"+
+ "\u0001\u000b\u0004\uffff\u0001\u000b\u0003\uffff\u0002\u000b"+
+ "\u0006\uffff\u0001\u000b\u0005\uffff\u0001\u000b\u0007\uffff"+
+ "\u0002\u000b\u0004\uffff\u0001\u000b\u0003\uffff\u0001\u000b"+
+ "\u0007\uffff\u0001\u000b\u0002\uffff\u0001\u000b\u0014\uffff"+
+ "\u0001\u000b\u0006\uffff\u0001\u000b\u0003\uffff\u0001\u000b"+
+ "\u0006\uffff\u0001\u000b\u0013\uffff\u0001\u000b\u0001\u000c"+
+ "\u0001\u000b\u0002\uffff\u0001\u000b\u0001\uffff\u0004\u000b"+
+ "\u0001\uffff\u0001\u000b\u0003\uffff\u0001\u000b\u0001\uffff"+
+ "\u000c\u000b\u0002\uffff\u0001\u000b\u0003\uffff\u0002\u000b",
+ "\u0004\u000b\u0003\uffff\u0004\u000b\u0001\uffff\u0001\u000b"+
+ "\u0004\uffff\u0001\u000b\u0002\uffff\u0002\u000b\u0004\uffff"+
+ "\u0001\u000b\u0002\uffff\u0001\u000b\u0001\uffff\u0001\u000b"+
+ "\u0003\uffff\u0001\u000b\u0001\uffff\u0001\u000b\u0001\uffff"+
+ "\u0002\u000b\u0004\uffff\u0003\u000b\u0002\uffff\u0001\u000b"+
+ "\u0001\uffff\u0003\u000b\u0002\uffff\u0001\u000b\u0006\uffff"+
+ "\u0002\u000b\u000b\uffff\u0002\u000b\u0005\uffff\u0001\u000b"+
+ "\u0004\uffff\u0002\u000b\u0001\uffff\u0001\u000b\u0004\uffff"+
+ "\u0001\u000b\u0004\uffff\u0001\u000b\u0003\uffff\u0002\u000b"+
+ "\u0006\uffff\u0001\u000b\u0005\uffff\u0001\u000b\u0007\uffff"+
+ "\u0002\u000b\u0004\uffff\u0001\u000b\u0003\uffff\u0001\u000b"+
+ "\u0007\uffff\u0001\u000b\u0002\uffff\u0001\u000b\u0014\uffff"+
+ "\u0001\u000b\u0006\uffff\u0001\u000b\u0003\uffff\u0001\u000b"+
+ "\u0006\uffff\u0001\u000b\u0013\uffff\u0001\u000b\u0001\u000c"+
+ "\u0001\u000b\u0002\uffff\u0001\u000b\u0001\uffff\u0004\u000b"+
+ "\u0001\uffff\u0001\u000b\u0003\uffff\u0001\u000b\u0001\uffff"+
+ "\u000c\u000b\u0002\uffff\u0001\u000b\u0003\uffff\u0002\u000b",
+ "\u0004\u000b\u0003\uffff\u0004\u000b\u0001\uffff\u0001\u000b"+
+ "\u0004\uffff\u0001\u000b\u0002\uffff\u0002\u000b\u0004\uffff"+
+ "\u0001\u000b\u0002\uffff\u0001\u000b\u0001\uffff\u0001\u000b"+
+ "\u0003\uffff\u0001\u000b\u0001\uffff\u0001\u000b\u0001\uffff"+
+ "\u0002\u000b\u0004\uffff\u0003\u000b\u0002\uffff\u0001\u000b"+
+ "\u0001\uffff\u0003\u000b\u0002\uffff\u0001\u000b\u0006\uffff"+
+ "\u0002\u000b\u000b\uffff\u0002\u000b\u0005\uffff\u0001\u000b"+
+ "\u0004\uffff\u0002\u000b\u0001\uffff\u0001\u000b\u0004\uffff"+
+ "\u0001\u000b\u0004\uffff\u0001\u000b\u0003\uffff\u0002\u000b"+
+ "\u0006\uffff\u0001\u000b\u0005\uffff\u0001\u000b\u0007\uffff"+
+ "\u0002\u000b\u0004\uffff\u0001\u000b\u0003\uffff\u0001\u000b"+
+ "\u0007\uffff\u0001\u000b\u0002\uffff\u0001\u000b\u0014\uffff"+
+ "\u0001\u000b\u0006\uffff\u0001\u000b\u0003\uffff\u0001\u000b"+
+ "\u0006\uffff\u0001\u000b\u0013\uffff\u0001\u000b\u0001\u000c"+
+ "\u0001\u000b\u0002\uffff\u0001\u000b\u0001\uffff\u0004\u000b"+
+ "\u0001\uffff\u0001\u000b\u0003\uffff\u0001\u000b\u0001\uffff"+
+ "\u000c\u000b\u0002\uffff\u0001\u000b\u0003\uffff\u0002\u000b",
+ "\u0004\u000b\u0003\uffff\u0004\u000b\u0001\uffff\u0001\u000b"+
+ "\u0004\uffff\u0001\u000b\u0002\uffff\u0002\u000b\u0004\uffff"+
+ "\u0001\u000b\u0002\uffff\u0001\u000b\u0001\uffff\u0001\u000b"+
+ "\u0003\uffff\u0001\u000b\u0001\uffff\u0001\u000b\u0001\uffff"+
+ "\u0002\u000b\u0004\uffff\u0003\u000b\u0002\uffff\u0001\u000b"+
+ "\u0001\uffff\u0003\u000b\u0002\uffff\u0001\u000b\u0006\uffff"+
+ "\u0002\u000b\u000b\uffff\u0002\u000b\u0005\uffff\u0001\u000b"+
+ "\u0004\uffff\u0002\u000b\u0001\uffff\u0001\u000b\u0004\uffff"+
+ "\u0001\u000b\u0004\uffff\u0001\u000b\u0003\uffff\u0002\u000b"+
+ "\u0006\uffff\u0001\u000b\u0005\uffff\u0001\u000b\u0007\uffff"+
+ "\u0002\u000b\u0004\uffff\u0001\u000b\u0003\uffff\u0001\u000b"+
+ "\u0007\uffff\u0001\u000b\u0002\uffff\u0001\u000b\u0014\uffff"+
+ "\u0001\u000b\u0006\uffff\u0001\u000b\u0003\uffff\u0001\u000b"+
+ "\u0006\uffff\u0001\u000b\u0013\uffff\u0001\u000b\u0001\u000c"+
+ "\u0001\u000b\u0002\uffff\u0001\u000b\u0001\uffff\u0004\u000b"+
+ "\u0001\uffff\u0001\u000b\u0003\uffff\u0001\u000b\u0001\uffff"+
+ "\u000c\u000b\u0002\uffff\u0001\u000b\u0003\uffff\u0002\u000b",
+ "\u0004\u000b\u0003\uffff\u0004\u000b\u0001\uffff\u0001\u000b"+
+ "\u0004\uffff\u0001\u000b\u0002\uffff\u0002\u000b\u0004\uffff"+
+ "\u0001\u000b\u0002\uffff\u0001\u000b\u0001\uffff\u0001\u000b"+
+ "\u0003\uffff\u0001\u000b\u0001\uffff\u0001\u000b\u0001\uffff"+
+ "\u0002\u000b\u0004\uffff\u0003\u000b\u0002\uffff\u0001\u000b"+
+ "\u0001\uffff\u0003\u000b\u0002\uffff\u0001\u000b\u0006\uffff"+
+ "\u0002\u000b\u000b\uffff\u0002\u000b\u0005\uffff\u0001\u000b"+
+ "\u0004\uffff\u0002\u000b\u0001\uffff\u0001\u000b\u0004\uffff"+
+ "\u0001\u000b\u0004\uffff\u0001\u000b\u0003\uffff\u0002\u000b"+
+ "\u0006\uffff\u0001\u000b\u0005\uffff\u0001\u000b\u0007\uffff"+
+ "\u0002\u000b\u0004\uffff\u0001\u000b\u0003\uffff\u0001\u000b"+
+ "\u0007\uffff\u0001\u000b\u0002\uffff\u0001\u000b\u0014\uffff"+
+ "\u0001\u000b\u0006\uffff\u0001\u000b\u0003\uffff\u0001\u000b"+
+ "\u0006\uffff\u0001\u000b\u0013\uffff\u0001\u000b\u0001\u000c"+
+ "\u0001\u000b\u0002\uffff\u0001\u000b\u0001\uffff\u0004\u000b"+
+ "\u0001\uffff\u0001\u000b\u0003\uffff\u0001\u000b\u0001\uffff"+
+ "\u000c\u000b\u0002\uffff\u0001\u000b\u0003\uffff\u0002\u000b",
+ "\u0004\u000b\u0003\uffff\u0004\u000b\u0001\uffff\u0001\u000b"+
+ "\u0004\uffff\u0001\u000b\u0002\uffff\u0002\u000b\u0004\uffff"+
+ "\u0001\u000b\u0002\uffff\u0001\u000b\u0001\uffff\u0001\u000b"+
+ "\u0003\uffff\u0001\u000b\u0001\uffff\u0001\u000b\u0001\uffff"+
+ "\u0002\u000b\u0004\uffff\u0003\u000b\u0002\uffff\u0001\u000b"+
+ "\u0001\uffff\u0003\u000b\u0002\uffff\u0001\u000b\u0006\uffff"+
+ "\u0002\u000b\u000b\uffff\u0002\u000b\u0005\uffff\u0001\u000b"+
+ "\u0004\uffff\u0002\u000b\u0001\uffff\u0001\u000b\u0004\uffff"+
+ "\u0001\u000b\u0004\uffff\u0001\u000b\u0003\uffff\u0002\u000b"+
+ "\u0006\uffff\u0001\u000b\u0005\uffff\u0001\u000b\u0007\uffff"+
+ "\u0002\u000b\u0004\uffff\u0001\u000b\u0003\uffff\u0001\u000b"+
+ "\u0007\uffff\u0001\u000b\u0002\uffff\u0001\u000b\u0014\uffff"+
+ "\u0001\u000b\u0006\uffff\u0001\u000b\u0003\uffff\u0001\u000b"+
+ "\u0006\uffff\u0001\u000b\u0013\uffff\u0001\u000b\u0001\u000c"+
+ "\u0001\u000b\u0002\uffff\u0001\u000b\u0001\uffff\u0004\u000b"+
+ "\u0001\uffff\u0001\u000b\u0003\uffff\u0001\u000b\u0001\uffff"+
+ "\u000c\u000b\u0002\uffff\u0001\u000b\u0003\uffff\u0002\u000b",
+ "\u0004\u000b\u0003\uffff\u0004\u000b\u0001\uffff\u0001\u000b"+
+ "\u0004\uffff\u0001\u000b\u0002\uffff\u0002\u000b\u0004\uffff"+
+ "\u0001\u000b\u0002\uffff\u0001\u000b\u0001\uffff\u0001\u000b"+
+ "\u0003\uffff\u0001\u000b\u0001\uffff\u0001\u000b\u0001\uffff"+
+ "\u0002\u000b\u0004\uffff\u0003\u000b\u0002\uffff\u0001\u000b"+
+ "\u0001\uffff\u0003\u000b\u0002\uffff\u0001\u000b\u0006\uffff"+
+ "\u0002\u000b\u000b\uffff\u0002\u000b\u0005\uffff\u0001\u000b"+
+ "\u0004\uffff\u0002\u000b\u0001\uffff\u0001\u000b\u0004\uffff"+
+ "\u0001\u000b\u0004\uffff\u0001\u000b\u0003\uffff\u0002\u000b"+
+ "\u0006\uffff\u0001\u000b\u0005\uffff\u0001\u000b\u0007\uffff"+
+ "\u0002\u000b\u0004\uffff\u0001\u000b\u0003\uffff\u0001\u000b"+
+ "\u0007\uffff\u0001\u000b\u0002\uffff\u0001\u000b\u0014\uffff"+
+ "\u0001\u000b\u0006\uffff\u0001\u000b\u0003\uffff\u0001\u000b"+
+ "\u0006\uffff\u0001\u000b\u0013\uffff\u0001\u000b\u0001\u000c"+
+ "\u0001\u000b\u0002\uffff\u0001\u000b\u0001\uffff\u0004\u000b"+
+ "\u0001\uffff\u0001\u000b\u0003\uffff\u0001\u000b\u0001\uffff"+
+ "\u000c\u000b\u0002\uffff\u0001\u000b\u0003\uffff\u0002\u000b",
+ "\u0004\u000b\u0003\uffff\u0004\u000b\u0001\uffff\u0001\u000b"+
+ "\u0004\uffff\u0001\u000b\u0002\uffff\u0002\u000b\u0004\uffff"+
+ "\u0001\u000b\u0002\uffff\u0001\u000b\u0001\uffff\u0001\u000b"+
+ "\u0003\uffff\u0001\u000b\u0001\uffff\u0001\u000b\u0001\uffff"+
+ "\u0002\u000b\u0004\uffff\u0003\u000b\u0002\uffff\u0001\u000b"+
+ "\u0001\uffff\u0003\u000b\u0002\uffff\u0001\u000b\u0006\uffff"+
+ "\u0002\u000b\u000b\uffff\u0002\u000b\u0005\uffff\u0001\u000b"+
+ "\u0004\uffff\u0002\u000b\u0001\uffff\u0001\u000b\u0004\uffff"+
+ "\u0001\u000b\u0004\uffff\u0001\u000b\u0003\uffff\u0002\u000b"+
+ "\u0006\uffff\u0001\u000b\u0005\uffff\u0001\u000b\u0007\uffff"+
+ "\u0002\u000b\u0004\uffff\u0001\u000b\u0003\uffff\u0001\u000b"+
+ "\u0007\uffff\u0001\u000b\u0002\uffff\u0001\u000b\u0014\uffff"+
+ "\u0001\u000b\u0006\uffff\u0001\u000b\u0003\uffff\u0001\u000b"+
+ "\u0006\uffff\u0001\u000b\u0013\uffff\u0001\u000b\u0001\u000c"+
+ "\u0001\u000b\u0002\uffff\u0001\u000b\u0001\uffff\u0004\u000b"+
+ "\u0001\uffff\u0001\u000b\u0003\uffff\u0001\u000b\u0001\uffff"+
+ "\u000c\u000b\u0002\uffff\u0001\u000b\u0003\uffff\u0002\u000b",
+ "",
+ ""
+ ]
+});
+
+org.antlr.lang.augmentObject(XQueryParser, {
+ DFA128_eot:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA128_eotS),
+ DFA128_eof:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA128_eofS),
+ DFA128_min:
+ org.antlr.runtime.DFA.unpackEncodedStringToUnsignedChars(XQueryParser.DFA128_minS),
+ DFA128_max:
+ org.antlr.runtime.DFA.unpackEncodedStringToUnsignedChars(XQueryParser.DFA128_maxS),
+ DFA128_accept:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA128_acceptS),
+ DFA128_special:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA128_specialS),
+ DFA128_transition: (function() {
+ var a = [],
+ i,
+ numStates = XQueryParser.DFA128_transitionS.length;
+ for (i=0; i<numStates; i++) {
+ a.push(org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA128_transitionS[i]));
+ }
+ return a;
+ })()
+});
+
+XQueryParser.DFA128 = function(recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 128;
+ this.eot = XQueryParser.DFA128_eot;
+ this.eof = XQueryParser.DFA128_eof;
+ this.min = XQueryParser.DFA128_min;
+ this.max = XQueryParser.DFA128_max;
+ this.accept = XQueryParser.DFA128_accept;
+ this.special = XQueryParser.DFA128_special;
+ this.transition = XQueryParser.DFA128_transition;
+};
+
+org.antlr.lang.extend(XQueryParser.DFA128, org.antlr.runtime.DFA, {
+ getDescription: function() {
+ return "986:1: p_NodeTest : ( p_KindTest | p_NameTest );";
+ },
+ dummy: null
+});
+org.antlr.lang.augmentObject(XQueryParser, {
+ DFA129_eotS:
+ "\u0009\uffff",
+ DFA129_eofS:
+ "\u0001\uffff\u0001\u0005\u0007\uffff",
+ DFA129_minS:
+ "\u0001\u0010\u0001\u0012\u0001\u00e8\u0001\uffff\u0001\u0010\u0001"+
+ "\uffff\u0002\u0004\u0001\u0010",
+ DFA129_maxS:
+ "\u0001\u0116\u0001\u0107\u0001\u00e8\u0001\uffff\u0001\u0116\u0001"+
+ "\uffff\u0002\u015c\u0001\u0116",
+ DFA129_acceptS:
+ "\u0003\uffff\u0001\u0002\u0001\uffff\u0001\u0001\u0003\uffff",
+ DFA129_specialS:
+ "\u0009\uffff}>",
+ DFA129_transitionS: [
+ "\u0092\u0001\u0001\uffff\u003f\u0001\u0012\uffff\u0001\u0003"+
+ "\u001a\uffff\u0001\u0002\u0006\uffff\u0001\u0001",
+ "\u0004\u0005\u0003\uffff\u0004\u0005\u0001\uffff\u0001\u0005"+
+ "\u0004\uffff\u0001\u0005\u0002\uffff\u0002\u0005\u0004\uffff"+
+ "\u0001\u0005\u0002\uffff\u0001\u0005\u0001\uffff\u0001\u0005"+
+ "\u0003\uffff\u0001\u0005\u0001\uffff\u0001\u0005\u0001\uffff"+
+ "\u0002\u0005\u0004\uffff\u0003\u0005\u0002\uffff\u0001\u0005"+
+ "\u0001\uffff\u0003\u0005\u0002\uffff\u0001\u0005\u0006\uffff"+
+ "\u0002\u0005\u000b\uffff\u0002\u0005\u0005\uffff\u0001\u0005"+
+ "\u0004\uffff\u0002\u0005\u0001\uffff\u0001\u0005\u0004\uffff"+
+ "\u0001\u0005\u0004\uffff\u0001\u0005\u0003\uffff\u0002\u0005"+
+ "\u0006\uffff\u0001\u0005\u0005\uffff\u0001\u0005\u0007\uffff"+
+ "\u0002\u0005\u0004\uffff\u0001\u0005\u0003\uffff\u0001\u0005"+
+ "\u0007\uffff\u0001\u0005\u0002\uffff\u0001\u0005\u0014\uffff"+
+ "\u0001\u0005\u0006\uffff\u0001\u0005\u0003\uffff\u0001\u0005"+
+ "\u0006\uffff\u0001\u0005\u0013\uffff\u0001\u0005\u0001\uffff"+
+ "\u0001\u0005\u0002\uffff\u0006\u0005\u0001\uffff\u0001\u0005"+
+ "\u0003\uffff\u0001\u0005\u0001\uffff\u000c\u0005\u0002\uffff"+
+ "\u0001\u0004\u0003\uffff\u0002\u0005",
+ "\u0001\u0006",
+ "",
+ "\u0092\u0005\u0001\uffff\u003f\u0005\u0012\uffff\u0001\u0003"+
+ "\u0021\uffff\u0001\u0005",
+ "",
+ "\u00e4\u0007\u0001\uffff\u0001\u0008\u0007\u0007\u0001\uffff"+
+ "\u006b\u0007",
+ "\u00e4\u0007\u0001\uffff\u0001\u0008\u0007\u0007\u0001\uffff"+
+ "\u006b\u0007",
+ "\u0092\u0005\u0001\uffff\u003f\u0005\u0012\uffff\u0001\u0003"+
+ "\u0021\uffff\u0001\u0005"
+ ]
+});
+
+org.antlr.lang.augmentObject(XQueryParser, {
+ DFA129_eot:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA129_eotS),
+ DFA129_eof:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA129_eofS),
+ DFA129_min:
+ org.antlr.runtime.DFA.unpackEncodedStringToUnsignedChars(XQueryParser.DFA129_minS),
+ DFA129_max:
+ org.antlr.runtime.DFA.unpackEncodedStringToUnsignedChars(XQueryParser.DFA129_maxS),
+ DFA129_accept:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA129_acceptS),
+ DFA129_special:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA129_specialS),
+ DFA129_transition: (function() {
+ var a = [],
+ i,
+ numStates = XQueryParser.DFA129_transitionS.length;
+ for (i=0; i<numStates; i++) {
+ a.push(org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA129_transitionS[i]));
+ }
+ return a;
+ })()
+});
+
+XQueryParser.DFA129 = function(recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 129;
+ this.eot = XQueryParser.DFA129_eot;
+ this.eof = XQueryParser.DFA129_eof;
+ this.min = XQueryParser.DFA129_min;
+ this.max = XQueryParser.DFA129_max;
+ this.accept = XQueryParser.DFA129_accept;
+ this.special = XQueryParser.DFA129_special;
+ this.transition = XQueryParser.DFA129_transition;
+};
+
+org.antlr.lang.extend(XQueryParser.DFA129, org.antlr.runtime.DFA, {
+ getDescription: function() {
+ return "991:1: p_NameTest : ( p_EQName | p_Wildcard );";
+ },
+ dummy: null
+});
+org.antlr.lang.augmentObject(XQueryParser, {
+ DFA136_eotS:
+ "\u001a\uffff",
+ DFA136_eofS:
+ "\u001a\uffff",
+ DFA136_minS:
+ "\u0001\u0010\u0004\uffff\u0001\u00e3\u0001\u0010\u0001\uffff\u0002"+
+ "\u00e3\u0001\uffff\u0002\u0010\u0001\u00e8\u0001\u00e3\u0001\u00e8\u0001"+
+ "\u0010\u0001\u00f0\u0004\uffff\u0001\u0010\u0002\uffff\u0001\u00e3",
+ DFA136_maxS:
+ "\u0001\u0122\u0004\uffff\u0001\u0102\u0001\u0116\u0001\uffff\u0002"+
+ "\u0102\u0001\uffff\u0002\u0116\u0003\u0102\u0001\u0116\u0001\u0102\u0004"+
+ "\uffff\u0001\u0116\u0002\uffff\u0001\u00f0",
+ DFA136_acceptS:
+ "\u0001\uffff\u0001\u0001\u0001\u0002\u0001\u0003\u0001\u0004\u0002"+
+ "\uffff\u0001\u0005\u0002\uffff\u0001\u0008\u0007\uffff\u0001\u0009\u0001"+
+ "\u000a\u0001\u000b\u0001\u000c\u0001\uffff\u0001\u0006\u0001\u0007\u0001"+
+ "\uffff",
+ DFA136_specialS:
+ "\u0001\u0000\u0019\uffff}>",
+ DFA136_transitionS: [
+ "\u0006\u000e\u0001\u000c\u0008\u000e\u0001\u000f\u0008\u000e"+
+ "\u0001\u0009\u0001\u0011\u0001\u0006\u0002\u000e\u0001\u0011"+
+ "\u000d\u000e\u0001\u0011\u0006\u000e\u0001\u0011\u0007\u000e"+
+ "\u0001\u000b\u0003\u000e\u0001\u0011\u0005\u000e\u0001\u0005"+
+ "\u0005\u000e\u0001\u0010\u0004\u0011\u0003\u000e\u0002\u0011"+
+ "\u0005\u000e\u0001\u000d\u0003\u000e\u0001\u0011\u0001\u000e"+
+ "\u0001\u0008\u0011\u000e\u0001\u0011\u0009\u000e\u0001\u0011"+
+ "\u0016\u000e\u0001\u0007\u0031\u000e\u0001\u0011\u000d\u000e"+
+ "\u0001\uffff\u0001\u0001\u0001\uffff\u0001\u0003\u0001\u0015"+
+ "\u0001\uffff\u0001\u0012\u0001\uffff\u0001\u0014\u000c\uffff"+
+ "\u0001\u000a\u0008\uffff\u0001\u0004\u000e\uffff\u0001\u0013"+
+ "\u0002\uffff\u0002\u0002\u0002\uffff\u0001\u000e\u0007\uffff"+
+ "\u0002\u000a\u0003\u0002",
+ "",
+ "",
+ "",
+ "",
+ "\u0001\u0007\u0004\uffff\u0001\u0017\u0007\uffff\u0001\u0013"+
+ "\u0011\uffff\u0001\u0016",
+ "\u0092\u000a\u0001\uffff\u003f\u000a\u0006\uffff\u0001\u000a"+
+ "\u0007\uffff\u0001\u0013\u0011\uffff\u0001\u0016\u000c\uffff"+
+ "\u0001\u000a\u0006\uffff\u0001\u000a",
+ "",
+ "\u0001\u0007\u0004\uffff\u0001\u0018\u0007\uffff\u0001\u0013"+
+ "\u0011\uffff\u0001\u0016",
+ "\u0001\u0007\u0004\uffff\u0001\u000a\u0007\uffff\u0001\u0013"+
+ "\u0011\uffff\u0001\u0016",
+ "",
+ "\u0092\u000a\u0001\uffff\u003f\u000a\u0001\uffff\u0001\u0007"+
+ "\u0004\uffff\u0001\u000a\u0007\uffff\u0001\u0013\u0011\uffff"+
+ "\u0001\u0016\u0013\uffff\u0001\u000a",
+ "\u0092\u000a\u0001\uffff\u003f\u000a\u0006\uffff\u0001\u000a"+
+ "\u0007\uffff\u0001\u0013\u0011\uffff\u0001\u0016\u000c\uffff"+
+ "\u0001\u000a\u0006\uffff\u0001\u000a",
+ "\u0001\u000a\u0007\uffff\u0001\u0013\u0011\uffff\u0001\u0016",
+ "\u0001\u0007\u000c\uffff\u0001\u0013\u0011\uffff\u0001\u0016",
+ "\u0001\u000a\u0007\uffff\u0001\u0013\u0011\uffff\u0001\u0016",
+ "\u0092\u000a\u0001\uffff\u003f\u000a\u0006\uffff\u0001\u000a"+
+ "\u0007\uffff\u0001\u0013\u0011\uffff\u0001\u0016\u0013\uffff"+
+ "\u0001\u000a",
+ "\u0001\u0013\u0011\uffff\u0001\u0016",
+ "",
+ "",
+ "",
+ "",
+ "\u0092\u0019\u0001\uffff\u003f\u0019\u0034\uffff\u0001\u0019",
+ "",
+ "",
+ "\u0001\u0007\u000c\uffff\u0001\u0013"
+ ]
+});
+
+org.antlr.lang.augmentObject(XQueryParser, {
+ DFA136_eot:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA136_eotS),
+ DFA136_eof:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA136_eofS),
+ DFA136_min:
+ org.antlr.runtime.DFA.unpackEncodedStringToUnsignedChars(XQueryParser.DFA136_minS),
+ DFA136_max:
+ org.antlr.runtime.DFA.unpackEncodedStringToUnsignedChars(XQueryParser.DFA136_maxS),
+ DFA136_accept:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA136_acceptS),
+ DFA136_special:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA136_specialS),
+ DFA136_transition: (function() {
+ var a = [],
+ i,
+ numStates = XQueryParser.DFA136_transitionS.length;
+ for (i=0; i<numStates; i++) {
+ a.push(org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA136_transitionS[i]));
+ }
+ return a;
+ })()
+});
+
+XQueryParser.DFA136 = function(recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 136;
+ this.eot = XQueryParser.DFA136_eot;
+ this.eof = XQueryParser.DFA136_eof;
+ this.min = XQueryParser.DFA136_min;
+ this.max = XQueryParser.DFA136_max;
+ this.accept = XQueryParser.DFA136_accept;
+ this.special = XQueryParser.DFA136_special;
+ this.transition = XQueryParser.DFA136_transition;
+};
+
+org.antlr.lang.extend(XQueryParser.DFA136, org.antlr.runtime.DFA, {
+ getDescription: function() {
+ return "1028:1: p_PrimaryExpr : ( ( LPAREN )=> p_ParenthesizedExpr | p_Literal | p_VarRef | p_ContextItemExpr | p_FunctionCall | p_OrderedExpr | p_UnorderedExpr | p_Constructor | p_BlockExpr | p_FunctionItemExpr | p_ArrayConstructor | p_SimpleObjectUnion );";
+ },
+ specialStateTransition: function(s, input) {
+ var _s = s;
+ var retval = (function(s, input) {
+ switch ( s ) {
+ case 0 :
+ var LA136_0 = input.LA(1);
+
+
+ var index136_0 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (LA136_0==LPAREN) && (this.synpred13_XQueryParser())) {s = 1;}
+
+ else if ( ((LA136_0>=APOS && LA136_0<=QUOT)||(LA136_0>=L_IntegerLiteral && LA136_0<=L_DoubleLiteral)) ) {s = 2;}
+
+ else if ( (LA136_0==DOLLAR) ) {s = 3;}
+
+ else if ( (LA136_0==DOT) ) {s = 4;}
+
+ else if ( (LA136_0==ORDERED) ) {s = 5;}
+
+ else if ( (LA136_0==ELEMENT) ) {s = 6;}
+
+ else if ( (LA136_0==UPDATING) ) {s = 7;}
+
+ else if ( (LA136_0==UNORDERED) ) {s = 8;}
+
+ else if ( (LA136_0==DOCUMENT) ) {s = 9;}
+
+ else if ( (LA136_0==SMALLER||(LA136_0>=L_DirCommentConstructor && LA136_0<=L_DirPIConstructor)) ) {s = 10;}
+
+ else if ( (LA136_0==NAMESPACE) ) {s = 11;}
+
+ else if ( (LA136_0==ATTRIBUTE) ) {s = 12;}
+
+ else if ( (LA136_0==TEXT) ) {s = 13;}
+
+ else if ( ((LA136_0>=ANCESTOR && LA136_0<=AT)||(LA136_0>=BASE_URI && LA136_0<=COLLATION)||(LA136_0>=CONSTRUCTION && LA136_0<=DIV)||(LA136_0>=ELSE && LA136_0<=EMPTY)||(LA136_0>=ENCODING && LA136_0<=IDIV)||(LA136_0>=IMPORT && LA136_0<=IS)||(LA136_0>=LAX && LA136_0<=MODULE)||(LA136_0>=NE && LA136_0<=NO_PRESERVE)||(LA136_0>=JSON && LA136_0<=ORDER)||(LA136_0>=ORDERING && LA136_0<=PRESERVE)||(LA136_0>=RETURN && LA136_0<=SCHEMA)||(LA136_0>=SELF && LA136_0<=STRIP)||(LA136_0>=THEN && LA136_0<=TREAT)||LA136_0==UNION||(LA136_0>=VALIDATE && LA136_0<=MINUS_SIGN)||(LA136_0>=NAN && LA136_0<=START)||(LA136_0>=TRY && LA136_0<=SKIP)||(LA136_0>=VALUE && LA136_0<=RETURNING)||(LA136_0>=CHECK && LA136_0<=QUOT_ER)||LA136_0==L_NCName) ) {s = 14;}
+
+ else if ( (LA136_0==COMMENT) ) {s = 15;}
+
+ else if ( (LA136_0==PROCESSING_INSTRUCTION) ) {s = 16;}
+
+ else if ( (LA136_0==DOCUMENT_NODE||LA136_0==EMPTY_SEQUENCE||LA136_0==IF||LA136_0==ITEM||LA136_0==NODE||(LA136_0>=STRUCTURED_ITEM && LA136_0<=ARRAY)||(LA136_0>=SCHEMA_ATTRIBUTE && LA136_0<=SCHEMA_ELEMENT)||LA136_0==TYPESWITCH||LA136_0==NAMESPACE_NODE||LA136_0==SWITCH||LA136_0==WHILE) ) {s = 17;}
+
+ else if ( (LA136_0==LBRACKET) ) {s = 18;}
+
+ else if ( (LA136_0==Q) ) {s = 19;}
+
+ else if ( (LA136_0==LSQUARE) ) {s = 20;}
+
+ else if ( (LA136_0==L_UNION_BRACKET) ) {s = 21;}
+
+
+ input.seek(index136_0);
+ if ( s>=0 ) return s;
+ break;
+ }
+ }).call(this.recognizer, s, input);
+ if (!org.antlr.lang.isUndefined(retval)) {
+ return retval;
+ }
+ if (this.recognizer.state.backtracking>0) {this.recognizer.state.failed=true; return -1;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException(this.getDescription(), 136, _s, input);
+ this.error(nvae);
+ throw nvae;
+ },
+ dummy: null
+});
+org.antlr.lang.augmentObject(XQueryParser, {
+ DFA172_eotS:
+ "\u0018\uffff",
+ DFA172_eofS:
+ "\u0001\uffff\u000b\u000f\u0001\uffff\u0002\u000f\u0002\uffff\u0003"+
+ "\u000f\u0004\uffff",
+ DFA172_minS:
+ "\u0001\u0010\u000b\u0012\u0001\uffff\u0002\u0012\u0002\uffff\u0003"+
+ "\u0012\u0004\uffff",
+ DFA172_maxS:
+ "\u0001\u0116\u000b\u0107\u0001\uffff\u0002\u0107\u0002\uffff\u0003"+
+ "\u0107\u0004\uffff",
+ DFA172_acceptS:
+ "\u000c\uffff\u0001\u0003\u0002\uffff\u0001\u0004\u0001\u0005\u0003"+
+ "\uffff\u0001\u0001\u0001\u0002\u0001\u0006\u0001\u0007",
+ DFA172_specialS:
+ "\u0018\uffff}>",
+ DFA172_transitionS: [
+ "\u0006\u000f\u0001\u0003\u0008\u000f\u0001\u0007\u0009\u000f"+
+ "\u0001\u0001\u0001\u0002\u000b\u000f\u0001\u000d\u000b\u000f"+
+ "\u0001\u000b\u000b\u000f\u0001\u000a\u000b\u000f\u0001\u0006"+
+ "\u0001\u0013\u0001\u000e\u0001\u0011\u0001\u0012\u0003\u000f"+
+ "\u0001\u0005\u0001\u0004\u0005\u000f\u0001\u0008\u0017\u000f"+
+ "\u0001\u0009\u0020\u000f\u0001\uffff\u003f\u000f\u0001\uffff"+
+ "\u0001\u0010\u000b\uffff\u0001\u000c\u001f\uffff\u0001\u000f"+
+ "\u0006\uffff\u0001\u000f",
+ "\u0004\u000f\u0004\uffff\u0001\u000f\u0003\uffff\u0001\u000f"+
+ "\u0004\uffff\u0001\u000f\u0002\uffff\u0002\u000f\u0004\uffff"+
+ "\u0001\u000f\u0002\uffff\u0001\u000f\u0001\uffff\u0002\u000f"+
+ "\u0002\uffff\u0001\u000f\u0001\uffff\u0001\u000f\u0001\uffff"+
+ "\u0002\u000f\u0002\uffff\u0001\u000f\u0001\uffff\u0003\u000f"+
+ "\u0002\uffff\u0001\u000f\u0001\uffff\u0003\u000f\u0002\uffff"+
+ "\u0001\u000f\u0006\uffff\u0002\u000f\u000b\uffff\u0002\u000f"+
+ "\u0005\uffff\u0001\u000f\u0004\uffff\u0001\u000f\u0002\uffff"+
+ "\u0001\u000f\u0004\uffff\u0001\u000f\u0001\uffff\u0001\u000f"+
+ "\u0002\uffff\u0001\u000f\u0003\uffff\u0002\u000f\u0006\uffff"+
+ "\u0001\u000f\u0005\uffff\u0001\u000f\u0007\uffff\u0002\u000f"+
+ "\u0004\uffff\u0001\u000f\u0003\uffff\u0001\u000f\u0007\uffff"+
+ "\u0001\u000f\u0002\uffff\u0001\u000f\u0014\uffff\u0001\u000f"+
+ "\u0003\uffff\u0001\u000f\u0002\uffff\u0001\u000f\u0003\uffff"+
+ "\u0001\u000f\u0006\uffff\u0001\u000f\u0013\uffff\u0001\u000f"+
+ "\u0001\u0014\u0001\u000f\u0002\uffff\u0003\u000f\u0001\uffff"+
+ "\u0004\u000f\u0003\uffff\u000b\u000f\u0005\uffff\u0001\u000f"+
+ "\u0003\uffff\u0002\u000f",
+ "\u0004\u000f\u0004\uffff\u0001\u000f\u0003\uffff\u0001\u000f"+
+ "\u0004\uffff\u0001\u000f\u0002\uffff\u0002\u000f\u0004\uffff"+
+ "\u0001\u000f\u0002\uffff\u0001\u000f\u0001\uffff\u0002\u000f"+
+ "\u0002\uffff\u0001\u000f\u0001\uffff\u0001\u000f\u0001\uffff"+
+ "\u0002\u000f\u0002\uffff\u0001\u000f\u0001\uffff\u0003\u000f"+
+ "\u0002\uffff\u0001\u000f\u0001\uffff\u0003\u000f\u0002\uffff"+
+ "\u0001\u000f\u0006\uffff\u0002\u000f\u000b\uffff\u0002\u000f"+
+ "\u0005\uffff\u0001\u000f\u0004\uffff\u0001\u000f\u0002\uffff"+
+ "\u0001\u000f\u0004\uffff\u0001\u000f\u0001\uffff\u0001\u000f"+
+ "\u0002\uffff\u0001\u000f\u0003\uffff\u0002\u000f\u0006\uffff"+
+ "\u0001\u000f\u0005\uffff\u0001\u000f\u0007\uffff\u0002\u000f"+
+ "\u0004\uffff\u0001\u000f\u0003\uffff\u0001\u000f\u0007\uffff"+
+ "\u0001\u000f\u0002\uffff\u0001\u000f\u0014\uffff\u0001\u000f"+
+ "\u0003\uffff\u0001\u000f\u0002\uffff\u0001\u000f\u0003\uffff"+
+ "\u0001\u000f\u0006\uffff\u0001\u000f\u0013\uffff\u0001\u000f"+
+ "\u0001\u0014\u0001\u000f\u0002\uffff\u0003\u000f\u0001\uffff"+
+ "\u0004\u000f\u0003\uffff\u000b\u000f\u0005\uffff\u0001\u000f"+
+ "\u0003\uffff\u0002\u000f",
+ "\u0004\u000f\u0004\uffff\u0001\u000f\u0003\uffff\u0001\u000f"+
+ "\u0004\uffff\u0001\u000f\u0002\uffff\u0002\u000f\u0004\uffff"+
+ "\u0001\u000f\u0002\uffff\u0001\u000f\u0001\uffff\u0002\u000f"+
+ "\u0002\uffff\u0001\u000f\u0001\uffff\u0001\u000f\u0001\uffff"+
+ "\u0002\u000f\u0002\uffff\u0001\u000f\u0001\uffff\u0003\u000f"+
+ "\u0002\uffff\u0001\u000f\u0001\uffff\u0003\u000f\u0002\uffff"+
+ "\u0001\u000f\u0006\uffff\u0002\u000f\u000b\uffff\u0002\u000f"+
+ "\u0005\uffff\u0001\u000f\u0004\uffff\u0001\u000f\u0002\uffff"+
+ "\u0001\u000f\u0004\uffff\u0001\u000f\u0001\uffff\u0001\u000f"+
+ "\u0002\uffff\u0001\u000f\u0003\uffff\u0002\u000f\u0006\uffff"+
+ "\u0001\u000f\u0005\uffff\u0001\u000f\u0007\uffff\u0002\u000f"+
+ "\u0004\uffff\u0001\u000f\u0003\uffff\u0001\u000f\u0007\uffff"+
+ "\u0001\u000f\u0002\uffff\u0001\u000f\u0014\uffff\u0001\u000f"+
+ "\u0003\uffff\u0001\u000f\u0002\uffff\u0001\u000f\u0003\uffff"+
+ "\u0001\u000f\u0006\uffff\u0001\u000f\u0013\uffff\u0001\u000f"+
+ "\u0001\u0014\u0001\u000f\u0002\uffff\u0003\u000f\u0001\uffff"+
+ "\u0004\u000f\u0003\uffff\u000b\u000f\u0005\uffff\u0001\u000f"+
+ "\u0003\uffff\u0002\u000f",
+ "\u0004\u000f\u0004\uffff\u0001\u000f\u0003\uffff\u0001\u000f"+
+ "\u0004\uffff\u0001\u000f\u0002\uffff\u0002\u000f\u0004\uffff"+
+ "\u0001\u000f\u0002\uffff\u0001\u000f\u0001\uffff\u0002\u000f"+
+ "\u0002\uffff\u0001\u000f\u0001\uffff\u0001\u000f\u0001\uffff"+
+ "\u0002\u000f\u0002\uffff\u0001\u000f\u0001\uffff\u0003\u000f"+
+ "\u0002\uffff\u0001\u000f\u0001\uffff\u0003\u000f\u0002\uffff"+
+ "\u0001\u000f\u0006\uffff\u0002\u000f\u000b\uffff\u0002\u000f"+
+ "\u0005\uffff\u0001\u000f\u0004\uffff\u0001\u000f\u0002\uffff"+
+ "\u0001\u000f\u0004\uffff\u0001\u000f\u0001\uffff\u0001\u000f"+
+ "\u0002\uffff\u0001\u000f\u0003\uffff\u0002\u000f\u0006\uffff"+
+ "\u0001\u000f\u0005\uffff\u0001\u000f\u0007\uffff\u0002\u000f"+
+ "\u0004\uffff\u0001\u000f\u0003\uffff\u0001\u000f\u0007\uffff"+
+ "\u0001\u000f\u0002\uffff\u0001\u000f\u0014\uffff\u0001\u000f"+
+ "\u0003\uffff\u0001\u000f\u0002\uffff\u0001\u000f\u0003\uffff"+
+ "\u0001\u000f\u0006\uffff\u0001\u000f\u0013\uffff\u0001\u000f"+
+ "\u0001\u0014\u0001\u000f\u0002\uffff\u0003\u000f\u0001\uffff"+
+ "\u0004\u000f\u0003\uffff\u000b\u000f\u0005\uffff\u0001\u000f"+
+ "\u0003\uffff\u0002\u000f",
+ "\u0004\u000f\u0004\uffff\u0001\u000f\u0003\uffff\u0001\u000f"+
+ "\u0004\uffff\u0001\u000f\u0002\uffff\u0002\u000f\u0004\uffff"+
+ "\u0001\u000f\u0002\uffff\u0001\u000f\u0001\uffff\u0002\u000f"+
+ "\u0002\uffff\u0001\u000f\u0001\uffff\u0001\u000f\u0001\uffff"+
+ "\u0002\u000f\u0002\uffff\u0001\u000f\u0001\uffff\u0003\u000f"+
+ "\u0002\uffff\u0001\u000f\u0001\uffff\u0003\u000f\u0002\uffff"+
+ "\u0001\u000f\u0006\uffff\u0002\u000f\u000b\uffff\u0002\u000f"+
+ "\u0005\uffff\u0001\u000f\u0004\uffff\u0001\u000f\u0002\uffff"+
+ "\u0001\u000f\u0004\uffff\u0001\u000f\u0001\uffff\u0001\u000f"+
+ "\u0002\uffff\u0001\u000f\u0003\uffff\u0002\u000f\u0006\uffff"+
+ "\u0001\u000f\u0005\uffff\u0001\u000f\u0007\uffff\u0002\u000f"+
+ "\u0004\uffff\u0001\u000f\u0003\uffff\u0001\u000f\u0007\uffff"+
+ "\u0001\u000f\u0002\uffff\u0001\u000f\u0014\uffff\u0001\u000f"+
+ "\u0003\uffff\u0001\u000f\u0002\uffff\u0001\u000f\u0003\uffff"+
+ "\u0001\u000f\u0006\uffff\u0001\u000f\u0013\uffff\u0001\u000f"+
+ "\u0001\u0014\u0001\u000f\u0002\uffff\u0003\u000f\u0001\uffff"+
+ "\u0004\u000f\u0003\uffff\u000b\u000f\u0005\uffff\u0001\u000f"+
+ "\u0003\uffff\u0002\u000f",
+ "\u0004\u000f\u0004\uffff\u0001\u000f\u0003\uffff\u0001\u000f"+
+ "\u0004\uffff\u0001\u000f\u0002\uffff\u0002\u000f\u0004\uffff"+
+ "\u0001\u000f\u0002\uffff\u0001\u000f\u0001\uffff\u0002\u000f"+
+ "\u0002\uffff\u0001\u000f\u0001\uffff\u0001\u000f\u0001\uffff"+
+ "\u0002\u000f\u0002\uffff\u0001\u000f\u0001\uffff\u0003\u000f"+
+ "\u0002\uffff\u0001\u000f\u0001\uffff\u0003\u000f\u0002\uffff"+
+ "\u0001\u000f\u0006\uffff\u0002\u000f\u000b\uffff\u0002\u000f"+
+ "\u0005\uffff\u0001\u000f\u0004\uffff\u0001\u000f\u0002\uffff"+
+ "\u0001\u000f\u0004\uffff\u0001\u000f\u0001\uffff\u0001\u000f"+
+ "\u0002\uffff\u0001\u000f\u0003\uffff\u0002\u000f\u0006\uffff"+
+ "\u0001\u000f\u0005\uffff\u0001\u000f\u0007\uffff\u0002\u000f"+
+ "\u0004\uffff\u0001\u000f\u0003\uffff\u0001\u000f\u0007\uffff"+
+ "\u0001\u000f\u0002\uffff\u0001\u000f\u0014\uffff\u0001\u000f"+
+ "\u0003\uffff\u0001\u000f\u0002\uffff\u0001\u000f\u0003\uffff"+
+ "\u0001\u000f\u0006\uffff\u0001\u000f\u0013\uffff\u0001\u000f"+
+ "\u0001\u0014\u0001\u000f\u0002\uffff\u0003\u000f\u0001\uffff"+
+ "\u0004\u000f\u0003\uffff\u000b\u000f\u0005\uffff\u0001\u000f"+
+ "\u0003\uffff\u0002\u000f",
+ "\u0004\u000f\u0004\uffff\u0001\u000f\u0003\uffff\u0001\u000f"+
+ "\u0004\uffff\u0001\u000f\u0002\uffff\u0002\u000f\u0004\uffff"+
+ "\u0001\u000f\u0002\uffff\u0001\u000f\u0001\uffff\u0002\u000f"+
+ "\u0002\uffff\u0001\u000f\u0001\uffff\u0001\u000f\u0001\uffff"+
+ "\u0002\u000f\u0002\uffff\u0001\u000f\u0001\uffff\u0003\u000f"+
+ "\u0002\uffff\u0001\u000f\u0001\uffff\u0003\u000f\u0002\uffff"+
+ "\u0001\u000f\u0006\uffff\u0002\u000f\u000b\uffff\u0002\u000f"+
+ "\u0005\uffff\u0001\u000f\u0004\uffff\u0001\u000f\u0002\uffff"+
+ "\u0001\u000f\u0004\uffff\u0001\u000f\u0001\uffff\u0001\u000f"+
+ "\u0002\uffff\u0001\u000f\u0003\uffff\u0002\u000f\u0006\uffff"+
+ "\u0001\u000f\u0005\uffff\u0001\u000f\u0007\uffff\u0002\u000f"+
+ "\u0004\uffff\u0001\u000f\u0003\uffff\u0001\u000f\u0007\uffff"+
+ "\u0001\u000f\u0002\uffff\u0001\u000f\u0014\uffff\u0001\u000f"+
+ "\u0003\uffff\u0001\u000f\u0002\uffff\u0001\u000f\u0003\uffff"+
+ "\u0001\u000f\u0006\uffff\u0001\u000f\u0013\uffff\u0001\u000f"+
+ "\u0001\u0014\u0001\u000f\u0002\uffff\u0003\u000f\u0001\uffff"+
+ "\u0004\u000f\u0003\uffff\u000b\u000f\u0005\uffff\u0001\u000f"+
+ "\u0003\uffff\u0002\u000f",
+ "\u0004\u000f\u0004\uffff\u0001\u000f\u0003\uffff\u0001\u000f"+
+ "\u0004\uffff\u0001\u000f\u0002\uffff\u0002\u000f\u0004\uffff"+
+ "\u0001\u000f\u0002\uffff\u0001\u000f\u0001\uffff\u0002\u000f"+
+ "\u0002\uffff\u0001\u000f\u0001\uffff\u0001\u000f\u0001\uffff"+
+ "\u0002\u000f\u0002\uffff\u0001\u000f\u0001\uffff\u0003\u000f"+
+ "\u0002\uffff\u0001\u000f\u0001\uffff\u0003\u000f\u0002\uffff"+
+ "\u0001\u000f\u0006\uffff\u0002\u000f\u000b\uffff\u0002\u000f"+
+ "\u0005\uffff\u0001\u000f\u0004\uffff\u0001\u000f\u0002\uffff"+
+ "\u0001\u000f\u0004\uffff\u0001\u000f\u0001\uffff\u0001\u000f"+
+ "\u0002\uffff\u0001\u000f\u0003\uffff\u0002\u000f\u0006\uffff"+
+ "\u0001\u000f\u0005\uffff\u0001\u000f\u0007\uffff\u0002\u000f"+
+ "\u0004\uffff\u0001\u000f\u0003\uffff\u0001\u000f\u0007\uffff"+
+ "\u0001\u000f\u0002\uffff\u0001\u000f\u0014\uffff\u0001\u000f"+
+ "\u0003\uffff\u0001\u000f\u0002\uffff\u0001\u000f\u0003\uffff"+
+ "\u0001\u000f\u0006\uffff\u0001\u000f\u0013\uffff\u0001\u000f"+
+ "\u0001\u0014\u0001\u000f\u0002\uffff\u0003\u000f\u0001\uffff"+
+ "\u0004\u000f\u0003\uffff\u000b\u000f\u0005\uffff\u0001\u000f"+
+ "\u0003\uffff\u0002\u000f",
+ "\u0004\u000f\u0004\uffff\u0001\u000f\u0003\uffff\u0001\u000f"+
+ "\u0004\uffff\u0001\u000f\u0002\uffff\u0002\u000f\u0004\uffff"+
+ "\u0001\u000f\u0002\uffff\u0001\u000f\u0001\uffff\u0002\u000f"+
+ "\u0002\uffff\u0001\u000f\u0001\uffff\u0001\u000f\u0001\uffff"+
+ "\u0002\u000f\u0002\uffff\u0001\u000f\u0001\uffff\u0003\u000f"+
+ "\u0002\uffff\u0001\u000f\u0001\uffff\u0003\u000f\u0002\uffff"+
+ "\u0001\u000f\u0006\uffff\u0002\u000f\u000b\uffff\u0002\u000f"+
+ "\u0005\uffff\u0001\u000f\u0004\uffff\u0001\u000f\u0002\uffff"+
+ "\u0001\u000f\u0004\uffff\u0001\u000f\u0001\uffff\u0001\u000f"+
+ "\u0002\uffff\u0001\u000f\u0003\uffff\u0002\u000f\u0006\uffff"+
+ "\u0001\u000f\u0005\uffff\u0001\u000f\u0007\uffff\u0002\u000f"+
+ "\u0004\uffff\u0001\u000f\u0003\uffff\u0001\u000f\u0007\uffff"+
+ "\u0001\u000f\u0002\uffff\u0001\u000f\u0014\uffff\u0001\u000f"+
+ "\u0003\uffff\u0001\u000f\u0002\uffff\u0001\u000f\u0003\uffff"+
+ "\u0001\u000f\u0006\uffff\u0001\u000f\u0013\uffff\u0001\u000f"+
+ "\u0001\u0014\u0001\u000f\u0002\uffff\u0003\u000f\u0001\uffff"+
+ "\u0004\u000f\u0003\uffff\u000b\u000f\u0005\uffff\u0001\u000f"+
+ "\u0003\uffff\u0002\u000f",
+ "\u0004\u000f\u0004\uffff\u0001\u000f\u0003\uffff\u0001\u000f"+
+ "\u0004\uffff\u0001\u000f\u0002\uffff\u0002\u000f\u0004\uffff"+
+ "\u0001\u000f\u0002\uffff\u0001\u000f\u0001\uffff\u0002\u000f"+
+ "\u0002\uffff\u0001\u000f\u0001\uffff\u0001\u000f\u0001\uffff"+
+ "\u0002\u000f\u0002\uffff\u0001\u000f\u0001\uffff\u0003\u000f"+
+ "\u0002\uffff\u0001\u000f\u0001\uffff\u0003\u000f\u0002\uffff"+
+ "\u0001\u000f\u0006\uffff\u0002\u000f\u000b\uffff\u0002\u000f"+
+ "\u0005\uffff\u0001\u000f\u0004\uffff\u0001\u000f\u0002\uffff"+
+ "\u0001\u000f\u0004\uffff\u0001\u000f\u0001\uffff\u0001\u000f"+
+ "\u0002\uffff\u0001\u000f\u0003\uffff\u0002\u000f\u0006\uffff"+
+ "\u0001\u000f\u0005\uffff\u0001\u000f\u0007\uffff\u0002\u000f"+
+ "\u0004\uffff\u0001\u000f\u0003\uffff\u0001\u000f\u0007\uffff"+
+ "\u0001\u000f\u0002\uffff\u0001\u000f\u0014\uffff\u0001\u000f"+
+ "\u0003\uffff\u0001\u000f\u0002\uffff\u0001\u000f\u0003\uffff"+
+ "\u0001\u000f\u0006\uffff\u0001\u000f\u0013\uffff\u0001\u000f"+
+ "\u0001\u0014\u0001\u000f\u0002\uffff\u0003\u000f\u0001\uffff"+
+ "\u0004\u000f\u0003\uffff\u000b\u000f\u0005\uffff\u0001\u000f"+
+ "\u0003\uffff\u0002\u000f",
+ "\u0004\u000f\u0004\uffff\u0001\u000f\u0003\uffff\u0001\u000f"+
+ "\u0004\uffff\u0001\u000f\u0002\uffff\u0002\u000f\u0004\uffff"+
+ "\u0001\u000f\u0002\uffff\u0001\u000f\u0001\uffff\u0002\u000f"+
+ "\u0002\uffff\u0001\u000f\u0001\uffff\u0001\u000f\u0001\uffff"+
+ "\u0002\u000f\u0002\uffff\u0001\u000f\u0001\uffff\u0003\u000f"+
+ "\u0002\uffff\u0001\u000f\u0001\uffff\u0003\u000f\u0002\uffff"+
+ "\u0001\u000f\u0006\uffff\u0002\u000f\u000b\uffff\u0002\u000f"+
+ "\u0005\uffff\u0001\u000f\u0004\uffff\u0001\u000f\u0002\uffff"+
+ "\u0001\u000f\u0004\uffff\u0001\u000f\u0001\uffff\u0001\u000f"+
+ "\u0002\uffff\u0001\u000f\u0003\uffff\u0002\u000f\u0006\uffff"+
+ "\u0001\u000f\u0005\uffff\u0001\u000f\u0007\uffff\u0002\u000f"+
+ "\u0004\uffff\u0001\u000f\u0003\uffff\u0001\u000f\u0007\uffff"+
+ "\u0001\u000f\u0002\uffff\u0001\u000f\u0014\uffff\u0001\u000f"+
+ "\u0003\uffff\u0001\u000f\u0002\uffff\u0001\u000f\u0003\uffff"+
+ "\u0001\u000f\u0006\uffff\u0001\u000f\u0013\uffff\u0001\u000f"+
+ "\u0001\u0015\u0001\u000f\u0002\uffff\u0003\u000f\u0001\uffff"+
+ "\u0004\u000f\u0003\uffff\u000b\u000f\u0005\uffff\u0001\u000f"+
+ "\u0003\uffff\u0002\u000f",
+ "",
+ "\u0004\u000f\u0004\uffff\u0001\u000f\u0003\uffff\u0001\u000f"+
+ "\u0004\uffff\u0001\u000f\u0002\uffff\u0002\u000f\u0004\uffff"+
+ "\u0001\u000f\u0002\uffff\u0001\u000f\u0001\uffff\u0002\u000f"+
+ "\u0002\uffff\u0001\u000f\u0001\uffff\u0001\u000f\u0001\uffff"+
+ "\u0002\u000f\u0002\uffff\u0001\u000f\u0001\uffff\u0003\u000f"+
+ "\u0002\uffff\u0001\u000f\u0001\uffff\u0003\u000f\u0002\uffff"+
+ "\u0001\u000f\u0006\uffff\u0002\u000f\u000b\uffff\u0002\u000f"+
+ "\u0005\uffff\u0001\u000f\u0004\uffff\u0001\u000f\u0002\uffff"+
+ "\u0001\u000f\u0004\uffff\u0001\u000f\u0001\uffff\u0001\u000f"+
+ "\u0002\uffff\u0001\u000f\u0003\uffff\u0002\u000f\u0006\uffff"+
+ "\u0001\u000f\u0005\uffff\u0001\u000f\u0007\uffff\u0002\u000f"+
+ "\u0004\uffff\u0001\u000f\u0003\uffff\u0001\u000f\u0007\uffff"+
+ "\u0001\u000f\u0002\uffff\u0001\u000f\u0014\uffff\u0001\u000f"+
+ "\u0003\uffff\u0001\u000f\u0002\uffff\u0001\u000f\u0003\uffff"+
+ "\u0001\u000f\u0006\uffff\u0001\u000f\u0013\uffff\u0001\u000f"+
+ "\u0001\u000c\u0001\u000f\u0002\uffff\u0003\u000f\u0001\uffff"+
+ "\u0004\u000f\u0003\uffff\u000b\u000f\u0005\uffff\u0001\u000f"+
+ "\u0003\uffff\u0002\u000f",
+ "\u0004\u000f\u0004\uffff\u0001\u000f\u0003\uffff\u0001\u000f"+
+ "\u0004\uffff\u0001\u000f\u0002\uffff\u0002\u000f\u0004\uffff"+
+ "\u0001\u000f\u0002\uffff\u0001\u000f\u0001\uffff\u0002\u000f"+
+ "\u0002\uffff\u0001\u000f\u0001\uffff\u0001\u000f\u0001\uffff"+
+ "\u0002\u000f\u0002\uffff\u0001\u000f\u0001\uffff\u0003\u000f"+
+ "\u0002\uffff\u0001\u000f\u0001\uffff\u0003\u000f\u0002\uffff"+
+ "\u0001\u000f\u0006\uffff\u0002\u000f\u000b\uffff\u0002\u000f"+
+ "\u0005\uffff\u0001\u000f\u0004\uffff\u0001\u000f\u0002\uffff"+
+ "\u0001\u000f\u0004\uffff\u0001\u000f\u0001\uffff\u0001\u000f"+
+ "\u0002\uffff\u0001\u000f\u0003\uffff\u0002\u000f\u0006\uffff"+
+ "\u0001\u000f\u0005\uffff\u0001\u000f\u0007\uffff\u0002\u000f"+
+ "\u0004\uffff\u0001\u000f\u0003\uffff\u0001\u000f\u0007\uffff"+
+ "\u0001\u000f\u0002\uffff\u0001\u000f\u0014\uffff\u0001\u000f"+
+ "\u0003\uffff\u0001\u000f\u0002\uffff\u0001\u000f\u0003\uffff"+
+ "\u0001\u000f\u0006\uffff\u0001\u000f\u0013\uffff\u0001\u000f"+
+ "\u0001\u0016\u0001\u000f\u0002\uffff\u0003\u000f\u0001\uffff"+
+ "\u0004\u000f\u0003\uffff\u000b\u000f\u0005\uffff\u0001\u000f"+
+ "\u0003\uffff\u0002\u000f",
+ "",
+ "",
+ "\u0004\u000f\u0004\uffff\u0001\u000f\u0003\uffff\u0001\u000f"+
+ "\u0004\uffff\u0001\u000f\u0002\uffff\u0002\u000f\u0004\uffff"+
+ "\u0001\u000f\u0002\uffff\u0001\u000f\u0001\uffff\u0002\u000f"+
+ "\u0002\uffff\u0001\u000f\u0001\uffff\u0001\u000f\u0001\uffff"+
+ "\u0002\u000f\u0002\uffff\u0001\u000f\u0001\uffff\u0003\u000f"+
+ "\u0002\uffff\u0001\u000f\u0001\uffff\u0003\u000f\u0002\uffff"+
+ "\u0001\u000f\u0006\uffff\u0002\u000f\u000b\uffff\u0002\u000f"+
+ "\u0005\uffff\u0001\u000f\u0004\uffff\u0001\u000f\u0002\uffff"+
+ "\u0001\u000f\u0004\uffff\u0001\u000f\u0001\uffff\u0001\u000f"+
+ "\u0002\uffff\u0001\u000f\u0003\uffff\u0002\u000f\u0006\uffff"+
+ "\u0001\u000f\u0005\uffff\u0001\u000f\u0007\uffff\u0002\u000f"+
+ "\u0004\uffff\u0001\u000f\u0003\uffff\u0001\u000f\u0007\uffff"+
+ "\u0001\u000f\u0002\uffff\u0001\u000f\u0014\uffff\u0001\u000f"+
+ "\u0003\uffff\u0001\u000f\u0002\uffff\u0001\u000f\u0003\uffff"+
+ "\u0001\u000f\u0006\uffff\u0001\u000f\u0013\uffff\u0001\u000f"+
+ "\u0001\u0016\u0001\u000f\u0002\uffff\u0003\u000f\u0001\uffff"+
+ "\u0004\u000f\u0003\uffff\u000b\u000f\u0005\uffff\u0001\u000f"+
+ "\u0003\uffff\u0002\u000f",
+ "\u0004\u000f\u0004\uffff\u0001\u000f\u0003\uffff\u0001\u000f"+
+ "\u0004\uffff\u0001\u000f\u0002\uffff\u0002\u000f\u0004\uffff"+
+ "\u0001\u000f\u0002\uffff\u0001\u000f\u0001\uffff\u0002\u000f"+
+ "\u0002\uffff\u0001\u000f\u0001\uffff\u0001\u000f\u0001\uffff"+
+ "\u0002\u000f\u0002\uffff\u0001\u000f\u0001\uffff\u0003\u000f"+
+ "\u0002\uffff\u0001\u000f\u0001\uffff\u0003\u000f\u0002\uffff"+
+ "\u0001\u000f\u0006\uffff\u0002\u000f\u000b\uffff\u0002\u000f"+
+ "\u0005\uffff\u0001\u000f\u0004\uffff\u0001\u000f\u0002\uffff"+
+ "\u0001\u000f\u0004\uffff\u0001\u000f\u0001\uffff\u0001\u000f"+
+ "\u0002\uffff\u0001\u000f\u0003\uffff\u0002\u000f\u0006\uffff"+
+ "\u0001\u000f\u0005\uffff\u0001\u000f\u0007\uffff\u0002\u000f"+
+ "\u0004\uffff\u0001\u000f\u0003\uffff\u0001\u000f\u0007\uffff"+
+ "\u0001\u000f\u0002\uffff\u0001\u000f\u0014\uffff\u0001\u000f"+
+ "\u0003\uffff\u0001\u000f\u0002\uffff\u0001\u000f\u0003\uffff"+
+ "\u0001\u000f\u0006\uffff\u0001\u000f\u0013\uffff\u0001\u000f"+
+ "\u0001\u0016\u0001\u000f\u0002\uffff\u0003\u000f\u0001\uffff"+
+ "\u0004\u000f\u0003\uffff\u000b\u000f\u0005\uffff\u0001\u000f"+
+ "\u0003\uffff\u0002\u000f",
+ "\u0004\u000f\u0004\uffff\u0001\u000f\u0003\uffff\u0001\u000f"+
+ "\u0004\uffff\u0001\u000f\u0002\uffff\u0002\u000f\u0004\uffff"+
+ "\u0001\u000f\u0002\uffff\u0001\u000f\u0001\uffff\u0002\u000f"+
+ "\u0002\uffff\u0001\u000f\u0001\uffff\u0001\u000f\u0001\uffff"+
+ "\u0002\u000f\u0002\uffff\u0001\u000f\u0001\uffff\u0003\u000f"+
+ "\u0002\uffff\u0001\u000f\u0001\uffff\u0003\u000f\u0002\uffff"+
+ "\u0001\u000f\u0006\uffff\u0002\u000f\u000b\uffff\u0002\u000f"+
+ "\u0005\uffff\u0001\u000f\u0004\uffff\u0001\u000f\u0002\uffff"+
+ "\u0001\u000f\u0004\uffff\u0001\u000f\u0001\uffff\u0001\u000f"+
+ "\u0002\uffff\u0001\u000f\u0003\uffff\u0002\u000f\u0006\uffff"+
+ "\u0001\u000f\u0005\uffff\u0001\u000f\u0007\uffff\u0002\u000f"+
+ "\u0004\uffff\u0001\u000f\u0003\uffff\u0001\u000f\u0007\uffff"+
+ "\u0001\u000f\u0002\uffff\u0001\u000f\u0014\uffff\u0001\u000f"+
+ "\u0003\uffff\u0001\u000f\u0002\uffff\u0001\u000f\u0003\uffff"+
+ "\u0001\u000f\u0006\uffff\u0001\u000f\u0013\uffff\u0001\u000f"+
+ "\u0001\u0017\u0001\u000f\u0002\uffff\u0003\u000f\u0001\uffff"+
+ "\u0004\u000f\u0003\uffff\u000b\u000f\u0005\uffff\u0001\u000f"+
+ "\u0003\uffff\u0002\u000f",
+ "",
+ "",
+ "",
+ ""
+ ]
+});
+
+org.antlr.lang.augmentObject(XQueryParser, {
+ DFA172_eot:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA172_eotS),
+ DFA172_eof:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA172_eofS),
+ DFA172_min:
+ org.antlr.runtime.DFA.unpackEncodedStringToUnsignedChars(XQueryParser.DFA172_minS),
+ DFA172_max:
+ org.antlr.runtime.DFA.unpackEncodedStringToUnsignedChars(XQueryParser.DFA172_maxS),
+ DFA172_accept:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA172_acceptS),
+ DFA172_special:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA172_specialS),
+ DFA172_transition: (function() {
+ var a = [],
+ i,
+ numStates = XQueryParser.DFA172_transitionS.length;
+ for (i=0; i<numStates; i++) {
+ a.push(org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA172_transitionS[i]));
+ }
+ return a;
+ })()
+});
+
+XQueryParser.DFA172 = function(recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 172;
+ this.eot = XQueryParser.DFA172_eot;
+ this.eof = XQueryParser.DFA172_eof;
+ this.min = XQueryParser.DFA172_min;
+ this.max = XQueryParser.DFA172_max;
+ this.accept = XQueryParser.DFA172_accept;
+ this.special = XQueryParser.DFA172_special;
+ this.transition = XQueryParser.DFA172_transition;
+};
+
+org.antlr.lang.extend(XQueryParser.DFA172, org.antlr.runtime.DFA, {
+ getDescription: function() {
+ return "1337:1: p_ItemType : ( p_KindTest -> ^( KindTest p_KindTest ) | ( ITEM LPAREN RPAREN ) -> ^( ItemTest ITEM LPAREN RPAREN ) | p_FunctionTest -> ^( FunctionTest p_FunctionTest ) | p_AtomicOrUnionType | p_ParenthesizedItemType | p_JSONTest | p_StructuredItemTest );";
+ },
+ dummy: null
+});
+org.antlr.lang.augmentObject(XQueryParser, {
+ DFA195_eotS:
+ "\u000f\uffff",
+ DFA195_eofS:
+ "\u000f\uffff",
+ DFA195_minS:
+ "\u0001\u0094\u0004\u004e\u000a\uffff",
+ DFA195_maxS:
+ "\u0001\u009f\u0002\u009d\u0001\u004f\u0001\u00a3\u000a\uffff",
+ DFA195_acceptS:
+ "\u0005\uffff\u0001\u0005\u0001\u000a\u0001\u0007\u0001\u0001\u0001"+
+ "\u0006\u0001\u0002\u0001\u0003\u0001\u0008\u0001\u0009\u0001\u0004",
+ DFA195_specialS:
+ "\u000f\uffff}>",
+ DFA195_transitionS: [
+ "\u0001\u0005\u0001\u0002\u0001\uffff\u0001\u0001\u0002\uffff"+
+ "\u0001\u0006\u0003\uffff\u0001\u0003\u0001\u0004",
+ "\u0001\u0008\u0001\u0007\u004d\uffff\u0001\u0008",
+ "\u0001\u000a\u0001\u0009\u004d\uffff\u0001\u000a",
+ "\u0001\u000b\u0001\u000c",
+ "\u0001\u000e\u0001\u000d\u0053\uffff\u0001\u000e",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ ""
+ ]
+});
+
+org.antlr.lang.augmentObject(XQueryParser, {
+ DFA195_eot:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA195_eotS),
+ DFA195_eof:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA195_eofS),
+ DFA195_min:
+ org.antlr.runtime.DFA.unpackEncodedStringToUnsignedChars(XQueryParser.DFA195_minS),
+ DFA195_max:
+ org.antlr.runtime.DFA.unpackEncodedStringToUnsignedChars(XQueryParser.DFA195_maxS),
+ DFA195_accept:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA195_acceptS),
+ DFA195_special:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA195_specialS),
+ DFA195_transition: (function() {
+ var a = [],
+ i,
+ numStates = XQueryParser.DFA195_transitionS.length;
+ for (i=0; i<numStates; i++) {
+ a.push(org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA195_transitionS[i]));
+ }
+ return a;
+ })()
+});
+
+XQueryParser.DFA195 = function(recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 195;
+ this.eot = XQueryParser.DFA195_eot;
+ this.eof = XQueryParser.DFA195_eof;
+ this.min = XQueryParser.DFA195_min;
+ this.max = XQueryParser.DFA195_max;
+ this.accept = XQueryParser.DFA195_accept;
+ this.special = XQueryParser.DFA195_special;
+ this.transition = XQueryParser.DFA195_transition;
+};
+
+org.antlr.lang.extend(XQueryParser.DFA195, org.antlr.runtime.DFA, {
+ getDescription: function() {
+ return "1697:1: pg_UpdateExpr : ( p_InsertExpr | p_DeleteExpr | p_RenameExpr | p_ReplaceExpr | p_TransformExpr | p_JSONDeleteExpr | p_JSONInsertExpr | p_JSONRenameExpr | p_JSONReplaceExpr | p_JSONAppendExpr );";
+ },
+ dummy: null
+});
+org.antlr.lang.augmentObject(XQueryParser, {
+ DFA230_eotS:
+ "\u000a\uffff",
+ DFA230_eofS:
+ "\u000a\uffff",
+ DFA230_minS:
+ "\u0001\u001a\u0002\uffff\u0001\u00c4\u0006\uffff",
+ DFA230_maxS:
+ "\u0001\u00cb\u0002\uffff\u0001\u00cb\u0006\uffff",
+ DFA230_acceptS:
+ "\u0001\uffff\u0001\u0001\u0001\u0002\u0001\uffff\u0001\u0003\u0001"+
+ "\u0004\u0001\u0005\u0001\u0006\u0001\u0007\u0001\u0008",
+ DFA230_specialS:
+ "\u000a\uffff}>",
+ DFA230_transitionS: [
+ "\u0001\u0006\u0036\uffff\u0001\u0009\u0057\uffff\u0001\u0007"+
+ "\u000a\uffff\u0001\u0001\u0001\uffff\u0001\u0006\u0001\uffff"+
+ "\u0001\u0003\u000b\uffff\u0001\u0005\u0001\u0008\u0001\u0004"+
+ "\u0001\uffff\u0001\u0006\u0002\uffff\u0001\u0002",
+ "",
+ "",
+ "\u0001\u0005\u0001\u0008\u0001\u0004\u0004\uffff\u0001\u0002",
+ "",
+ "",
+ "",
+ "",
+ "",
+ ""
+ ]
+});
+
+org.antlr.lang.augmentObject(XQueryParser, {
+ DFA230_eot:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA230_eotS),
+ DFA230_eof:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA230_eofS),
+ DFA230_min:
+ org.antlr.runtime.DFA.unpackEncodedStringToUnsignedChars(XQueryParser.DFA230_minS),
+ DFA230_max:
+ org.antlr.runtime.DFA.unpackEncodedStringToUnsignedChars(XQueryParser.DFA230_maxS),
+ DFA230_accept:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA230_acceptS),
+ DFA230_special:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA230_specialS),
+ DFA230_transition: (function() {
+ var a = [],
+ i,
+ numStates = XQueryParser.DFA230_transitionS.length;
+ for (i=0; i<numStates; i++) {
+ a.push(org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA230_transitionS[i]));
+ }
+ return a;
+ })()
+});
+
+XQueryParser.DFA230 = function(recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 230;
+ this.eot = XQueryParser.DFA230_eot;
+ this.eof = XQueryParser.DFA230_eof;
+ this.min = XQueryParser.DFA230_min;
+ this.max = XQueryParser.DFA230_max;
+ this.accept = XQueryParser.DFA230_accept;
+ this.special = XQueryParser.DFA230_special;
+ this.transition = XQueryParser.DFA230_transition;
+};
+
+org.antlr.lang.extend(XQueryParser.DFA230, org.antlr.runtime.DFA, {
+ getDescription: function() {
+ return "1932:1: p_FTMatchOption : ( p_FTLanguageOption | p_FTWildCardOption | p_FTThesaurusOption | p_FTStemOption | p_FTCaseOption | p_FTDiacriticsOption | p_FTStopWordOption | p_FTExtensionOption );";
+ },
+ dummy: null
+});
+org.antlr.lang.augmentObject(XQueryParser, {
+ DFA249_eotS:
+ "\u0011\uffff",
+ DFA249_eofS:
+ "\u0011\uffff",
+ DFA249_minS:
+ "\u0001\u0010\u0001\uffff\u0001\u0010\u0005\u0012\u0001\uffff\u0001"+
+ "\u0012\u0001\u00e8\u0001\u0010\u0001\u0004\u0001\u0012\u0001\u0004\u0001"+
+ "\u0010\u0001\u0012",
+ DFA249_maxS:
+ "\u0001\u0122\u0001\uffff\u0001\u0116\u0005\u0107\u0001\uffff\u0001"+
+ "\u0107\u0001\u00e8\u0001\u0116\u0001\u015c\u0001\u0107\u0001\u015c\u0001"+
+ "\u0116\u0001\u0107",
+ DFA249_acceptS:
+ "\u0001\uffff\u0001\u0001\u0006\uffff\u0001\u0002\u0008\uffff",
+ DFA249_specialS:
+ "\u0011\uffff}>",
+ DFA249_transitionS: [
+ "\u0061\u0001\u0001\u0007\u005d\u0001\u0001\u0004\u0001\u0005"+
+ "\u0001\u0006\u0002\u0001\u0001\u0003\u000d\u0001\u0001\uffff"+
+ "\u0001\u0001\u0001\uffff\u0001\u0002\u0001\u0001\u0001\uffff"+
+ "\u0001\u0001\u0001\uffff\u0001\u0001\u0004\uffff\u0001\u0008"+
+ "\u0004\uffff\u0004\u0001\u0005\uffff\u0002\u0001\u0001\uffff"+
+ "\u0002\u0001\u000c\uffff\u0002\u0001\u0002\uffff\u0002\u0001"+
+ "\u0002\uffff\u0001\u0001\u0006\uffff\u0006\u0001",
+ "",
+ "\u0092\u0009\u0001\uffff\u003f\u0009\u002d\uffff\u0001\u000a"+
+ "\u0006\uffff\u0001\u0009",
+ "\u0001\u0001\u0008\uffff\u0002\u0001\u000a\uffff\u0001\u0001"+
+ "\u0007\uffff\u0001\u0001\u0001\uffff\u0001\u0001\u0005\uffff"+
+ "\u0001\u0001\u0001\uffff\u0002\u0001\u0004\uffff\u0003\u0001"+
+ "\u0002\uffff\u0001\u0001\u0002\uffff\u0002\u0001\u0002\uffff"+
+ "\u0001\u0001\u0006\uffff\u0001\u0001\u0018\uffff\u0002\u0001"+
+ "\u0001\uffff\u0001\u0001\u0038\uffff\u0001\u0001\u003a\uffff"+
+ "\u0001\u0001\u0001\u0008\u0006\uffff\u0001\u0001\u0001\uffff"+
+ "\u0001\u0001\u0001\uffff\u0001\u0001\u0001\uffff\u0001\u0001"+
+ "\u0001\uffff\u0001\u0001\u0001\uffff\u000c\u0001\u0002\uffff"+
+ "\u0001\u0001\u0003\uffff\u0002\u0001",
+ "\u0001\u0001\u0008\uffff\u0002\u0001\u000a\uffff\u0001\u0001"+
+ "\u0007\uffff\u0001\u0001\u0001\uffff\u0001\u0001\u0005\uffff"+
+ "\u0001\u0001\u0001\uffff\u0002\u0001\u0004\uffff\u0003\u0001"+
+ "\u0002\uffff\u0001\u0001\u0002\uffff\u0002\u0001\u0002\uffff"+
+ "\u0001\u0001\u0006\uffff\u0001\u0001\u0018\uffff\u0002\u0001"+
+ "\u0001\uffff\u0001\u0001\u0038\uffff\u0001\u0001\u002a\uffff"+
+ "\u0001\u0008\u000f\uffff\u0002\u0001\u0006\uffff\u0001\u0001"+
+ "\u0001\uffff\u0001\u0001\u0001\uffff\u0001\u0001\u0001\uffff"+
+ "\u0001\u0001\u0001\uffff\u0001\u0001\u0001\uffff\u000c\u0001"+
+ "\u0002\uffff\u0001\u0001\u0003\uffff\u0002\u0001",
+ "\u0001\u0001\u0008\uffff\u0002\u0001\u000a\uffff\u0001\u0001"+
+ "\u0007\uffff\u0001\u0001\u0001\uffff\u0001\u0001\u0005\uffff"+
+ "\u0001\u0001\u0001\uffff\u0002\u0001\u0004\uffff\u0003\u0001"+
+ "\u0002\uffff\u0001\u0001\u0002\uffff\u0002\u0001\u0002\uffff"+
+ "\u0001\u0001\u0006\uffff\u0001\u0001\u0018\uffff\u0002\u0001"+
+ "\u0001\uffff\u0001\u0001\u0038\uffff\u0001\u0001\u002a\uffff"+
+ "\u0001\u0008\u000f\uffff\u0002\u0001\u0006\uffff\u0001\u0001"+
+ "\u0001\uffff\u0001\u0001\u0001\uffff\u0001\u0001\u0001\uffff"+
+ "\u0001\u0001\u0001\uffff\u0001\u0001\u0001\uffff\u000c\u0001"+
+ "\u0002\uffff\u0001\u0001\u0003\uffff\u0002\u0001",
+ "\u0001\u0001\u0008\uffff\u0002\u0001\u000a\uffff\u0001\u0001"+
+ "\u0007\uffff\u0001\u0001\u0001\uffff\u0001\u0001\u0005\uffff"+
+ "\u0001\u0001\u0001\uffff\u0002\u0001\u0004\uffff\u0003\u0001"+
+ "\u0002\uffff\u0001\u0001\u0002\uffff\u0002\u0001\u0002\uffff"+
+ "\u0001\u0001\u0006\uffff\u0001\u0001\u0018\uffff\u0002\u0001"+
+ "\u0001\uffff\u0001\u0001\u0038\uffff\u0001\u0001\u002b\uffff"+
+ "\u0001\u0008\u000e\uffff\u0002\u0001\u0006\uffff\u0001\u0001"+
+ "\u0001\uffff\u0001\u0001\u0001\uffff\u0001\u0001\u0001\uffff"+
+ "\u0001\u0001\u0001\uffff\u0001\u0001\u0001\uffff\u000c\u0001"+
+ "\u0002\uffff\u0001\u0001\u0003\uffff\u0002\u0001",
+ "\u0001\u0001\u0008\uffff\u0002\u0001\u000a\uffff\u0001\u0001"+
+ "\u0007\uffff\u0001\u0001\u0001\uffff\u0001\u0001\u0005\uffff"+
+ "\u0001\u0001\u0001\uffff\u0002\u0001\u0004\uffff\u0003\u0001"+
+ "\u0002\uffff\u0001\u0001\u0002\uffff\u0002\u0001\u0002\uffff"+
+ "\u0001\u0001\u0006\uffff\u0001\u0001\u0018\uffff\u0002\u0001"+
+ "\u0001\uffff\u0001\u0001\u0038\uffff\u0001\u0001\u003a\uffff"+
+ "\u0002\u0001\u0001\uffff\u0001\u0008\u0004\uffff\u0001\u0001"+
+ "\u0001\uffff\u0001\u0001\u0001\uffff\u0001\u0001\u0001\uffff"+
+ "\u0001\u0001\u0001\uffff\u0001\u0001\u0001\uffff\u000c\u0001"+
+ "\u0002\uffff\u0001\u0001\u0003\uffff\u0002\u0001",
+ "",
+ "\u0001\u0001\u0008\uffff\u0002\u0001\u000a\uffff\u0001\u0001"+
+ "\u0007\uffff\u0001\u0001\u0001\uffff\u0001\u0001\u0005\uffff"+
+ "\u0001\u0001\u0001\uffff\u0002\u0001\u0004\uffff\u0003\u0001"+
+ "\u0002\uffff\u0001\u0001\u0002\uffff\u0002\u0001\u0002\uffff"+
+ "\u0001\u0001\u0006\uffff\u0001\u0001\u0018\uffff\u0002\u0001"+
+ "\u0001\uffff\u0001\u0001\u0038\uffff\u0001\u0001\u003a\uffff"+
+ "\u0002\u0001\u0006\uffff\u0001\u0001\u0001\uffff\u0001\u0001"+
+ "\u0001\u0008\u0001\u0001\u0003\uffff\u0001\u0001\u0001\uffff"+
+ "\u000c\u0001\u0002\uffff\u0001\u000b\u0003\uffff\u0002\u0001",
+ "\u0001\u000c",
+ "\u0092\u000d\u0001\uffff\u003f\u000d\u0034\uffff\u0001\u000d",
+ "\u00e4\u000e\u0001\uffff\u0001\u000f\u0007\u000e\u0001\uffff"+
+ "\u006b\u000e",
+ "\u0001\u0001\u0008\uffff\u0002\u0001\u000a\uffff\u0001\u0001"+
+ "\u0007\uffff\u0001\u0001\u0001\uffff\u0001\u0001\u0005\uffff"+
+ "\u0001\u0001\u0001\uffff\u0002\u0001\u0004\uffff\u0003\u0001"+
+ "\u0002\uffff\u0001\u0001\u0002\uffff\u0002\u0001\u0002\uffff"+
+ "\u0001\u0001\u0006\uffff\u0001\u0001\u0018\uffff\u0002\u0001"+
+ "\u0001\uffff\u0001\u0001\u0038\uffff\u0001\u0001\u003a\uffff"+
+ "\u0002\u0001\u0006\uffff\u0001\u0001\u0001\uffff\u0001\u0001"+
+ "\u0001\u0008\u0001\u0001\u0003\uffff\u0001\u0001\u0001\uffff"+
+ "\u000c\u0001\u0006\uffff\u0002\u0001",
+ "\u00e4\u000e\u0001\uffff\u0001\u000f\u0007\u000e\u0001\uffff"+
+ "\u006b\u000e",
+ "\u0092\u0010\u0001\uffff\u003f\u0010\u0034\uffff\u0001\u0010",
+ "\u0001\u0001\u0008\uffff\u0002\u0001\u000a\uffff\u0001\u0001"+
+ "\u0007\uffff\u0001\u0001\u0001\uffff\u0001\u0001\u0005\uffff"+
+ "\u0001\u0001\u0001\uffff\u0002\u0001\u0004\uffff\u0003\u0001"+
+ "\u0002\uffff\u0001\u0001\u0002\uffff\u0002\u0001\u0002\uffff"+
+ "\u0001\u0001\u0006\uffff\u0001\u0001\u0018\uffff\u0002\u0001"+
+ "\u0001\uffff\u0001\u0001\u0038\uffff\u0001\u0001\u003a\uffff"+
+ "\u0002\u0001\u0006\uffff\u0001\u0001\u0001\uffff\u0001\u0001"+
+ "\u0001\u0008\u0001\u0001\u0003\uffff\u0001\u0001\u0001\uffff"+
+ "\u000c\u0001\u0006\uffff\u0002\u0001"
+ ]
+});
+
+org.antlr.lang.augmentObject(XQueryParser, {
+ DFA249_eot:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA249_eotS),
+ DFA249_eof:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA249_eofS),
+ DFA249_min:
+ org.antlr.runtime.DFA.unpackEncodedStringToUnsignedChars(XQueryParser.DFA249_minS),
+ DFA249_max:
+ org.antlr.runtime.DFA.unpackEncodedStringToUnsignedChars(XQueryParser.DFA249_maxS),
+ DFA249_accept:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA249_acceptS),
+ DFA249_special:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA249_specialS),
+ DFA249_transition: (function() {
+ var a = [],
+ i,
+ numStates = XQueryParser.DFA249_transitionS.length;
+ for (i=0; i<numStates; i++) {
+ a.push(org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA249_transitionS[i]));
+ }
+ return a;
+ })()
+});
+
+XQueryParser.DFA249 = function(recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 249;
+ this.eot = XQueryParser.DFA249_eot;
+ this.eof = XQueryParser.DFA249_eof;
+ this.min = XQueryParser.DFA249_min;
+ this.max = XQueryParser.DFA249_max;
+ this.accept = XQueryParser.DFA249_accept;
+ this.special = XQueryParser.DFA249_special;
+ this.transition = XQueryParser.DFA249_transition;
+};
+
+org.antlr.lang.extend(XQueryParser.DFA249, org.antlr.runtime.DFA, {
+ getDescription: function() {
+ return "2046:1: p_Hybrid[strict, allowConcat] : ( p_HybridExprSingle[$strict,$allowConcat] | p_Statement );";
+ },
+ dummy: null
+});
+org.antlr.lang.augmentObject(XQueryParser, {
+ DFA265_eotS:
+ "\u000c\uffff",
+ DFA265_eofS:
+ "\u0001\uffff\u0002\u0003\u0001\uffff\u0006\u0003\u0002\uffff",
+ DFA265_minS:
+ "\u0001\u0010\u0002\u0012\u0001\uffff\u0006\u0012\u0002\uffff",
+ DFA265_maxS:
+ "\u0001\u0122\u0002\u0107\u0001\uffff\u0006\u0107\u0002\uffff",
+ DFA265_acceptS:
+ "\u0003\uffff\u0001\u0002\u0006\uffff\u0001\u0001\u0001\u0003",
+ DFA265_specialS:
+ "\u0004\uffff\u0001\u0002\u0001\u0004\u0001\u0005\u0001\u0001\u0001"+
+ "\u0003\u0001\u0000\u0002\uffff}>",
+ DFA265_transitionS: [
+ "\u0020\u0003\u0001\u0002\u0034\u0003\u0001\u0001\u002e\u0003"+
+ "\u0001\u0008\u0001\u0005\u0001\u0003\u0001\u0004\u0002\u0003"+
+ "\u0001\u0009\u0003\u0003\u0001\u0006\u0001\u0007\u0042\u0003"+
+ "\u0001\uffff\u0001\u0003\u0001\uffff\u0002\u0003\u0001\uffff"+
+ "\u0001\u0003\u0001\uffff\u0001\u0003\u0009\uffff\u0004\u0003"+
+ "\u0005\uffff\u0002\u0003\u0001\uffff\u0002\u0003\u000c\uffff"+
+ "\u0002\u0003\u0002\uffff\u0002\u0003\u0002\uffff\u0001\u0003"+
+ "\u0006\uffff\u0006\u0003",
+ "\u0004\u0003\u0004\uffff\u0003\u0003\u0001\uffff\u0001\u0003"+
+ "\u0004\uffff\u0001\u0003\u0002\uffff\u0002\u0003\u0004\uffff"+
+ "\u0001\u0003\u0002\uffff\u0001\u0003\u0001\uffff\u0001\u0003"+
+ "\u0003\uffff\u0001\u0003\u0001\uffff\u0001\u0003\u0001\uffff"+
+ "\u0002\u0003\u0004\uffff\u0003\u0003\u0002\uffff\u0001\u0003"+
+ "\u0001\uffff\u0003\u0003\u0002\uffff\u0001\u0003\u0006\uffff"+
+ "\u0002\u0003\u000b\uffff\u0002\u0003\u0005\uffff\u0001\u0003"+
+ "\u0004\uffff\u0002\u0003\u0001\uffff\u0001\u0003\u0004\uffff"+
+ "\u0001\u0003\u0004\uffff\u0001\u0003\u0003\uffff\u0002\u0003"+
+ "\u0006\uffff\u0001\u0003\u0005\uffff\u0001\u0003\u0007\uffff"+
+ "\u0002\u0003\u0004\uffff\u0001\u0003\u0003\uffff\u0001\u0003"+
+ "\u0007\uffff\u0001\u0003\u0002\uffff\u0001\u0003\u003a\uffff"+
+ "\u0003\u0003\u0001\u000a\u0001\uffff\u0001\u0003\u0001\uffff"+
+ "\u0004\u0003\u0001\uffff\u0001\u0003\u0001\uffff\u0001\u0003"+
+ "\u0001\uffff\u0001\u0003\u0001\uffff\u000c\u0003\u0002\uffff"+
+ "\u0001\u0003\u0003\uffff\u0002\u0003",
+ "\u0004\u0003\u0004\uffff\u0003\u0003\u0001\uffff\u0001\u0003"+
+ "\u0004\uffff\u0001\u0003\u0002\uffff\u0002\u0003\u0004\uffff"+
+ "\u0001\u0003\u0002\uffff\u0001\u0003\u0001\uffff\u0001\u0003"+
+ "\u0003\uffff\u0001\u0003\u0001\uffff\u0001\u0003\u0001\uffff"+
+ "\u0002\u0003\u0004\uffff\u0003\u0003\u0002\uffff\u0001\u0003"+
+ "\u0001\uffff\u0003\u0003\u0002\uffff\u0001\u0003\u0006\uffff"+
+ "\u0002\u0003\u000b\uffff\u0002\u0003\u0005\uffff\u0001\u0003"+
+ "\u0004\uffff\u0002\u0003\u0001\uffff\u0001\u0003\u0004\uffff"+
+ "\u0001\u0003\u0004\uffff\u0001\u0003\u0003\uffff\u0002\u0003"+
+ "\u0006\uffff\u0001\u0003\u0005\uffff\u0001\u0003\u0007\uffff"+
+ "\u0002\u0003\u0004\uffff\u0001\u0003\u0003\uffff\u0001\u0003"+
+ "\u0007\uffff\u0001\u0003\u0002\uffff\u0001\u0003\u003a\uffff"+
+ "\u0003\u0003\u0001\u000a\u0001\uffff\u0001\u0003\u0001\uffff"+
+ "\u0004\u0003\u0001\uffff\u0001\u0003\u0001\uffff\u0001\u0003"+
+ "\u0001\uffff\u0001\u0003\u0001\uffff\u000c\u0003\u0002\uffff"+
+ "\u0001\u0003\u0003\uffff\u0002\u0003",
+ "",
+ "\u0004\u0003\u0004\uffff\u0003\u0003\u0001\uffff\u0001\u0003"+
+ "\u0004\uffff\u0001\u0003\u0002\uffff\u0002\u0003\u0004\uffff"+
+ "\u0001\u0003\u0002\uffff\u0001\u0003\u0001\uffff\u0001\u0003"+
+ "\u0003\uffff\u0001\u0003\u0001\uffff\u0001\u0003\u0001\uffff"+
+ "\u0002\u0003\u0004\uffff\u0003\u0003\u0002\uffff\u0001\u0003"+
+ "\u0001\uffff\u0003\u0003\u0002\uffff\u0001\u0003\u0002\uffff"+
+ "\u0002\u000b\u0002\uffff\u0002\u0003\u000b\uffff\u0002\u0003"+
+ "\u0005\uffff\u0001\u0003\u0004\uffff\u0002\u0003\u0001\uffff"+
+ "\u0001\u0003\u0004\uffff\u0001\u0003\u0004\uffff\u0001\u0003"+
+ "\u0003\uffff\u0002\u0003\u0006\uffff\u0001\u0003\u0005\uffff"+
+ "\u0001\u0003\u0007\uffff\u0002\u0003\u0004\uffff\u0001\u0003"+
+ "\u0003\uffff\u0001\u0003\u0001\u000b\u0006\uffff\u0001\u0003"+
+ "\u0002\uffff\u0001\u0003\u003a\uffff\u0003\u0003\u0002\uffff"+
+ "\u0001\u0003\u0001\uffff\u0004\u0003\u0001\uffff\u0001\u0003"+
+ "\u0001\uffff\u0001\u0003\u0001\uffff\u0001\u0003\u0001\uffff"+
+ "\u000c\u0003\u0002\uffff\u0001\u0003\u0003\uffff\u0002\u0003",
+ "\u0004\u0003\u0004\uffff\u0003\u0003\u0001\uffff\u0001\u0003"+
+ "\u0004\uffff\u0001\u0003\u0002\uffff\u0002\u0003\u0004\uffff"+
+ "\u0001\u0003\u0002\uffff\u0001\u0003\u0001\uffff\u0001\u0003"+
+ "\u0003\uffff\u0001\u0003\u0001\uffff\u0001\u0003\u0001\uffff"+
+ "\u0002\u0003\u0004\uffff\u0003\u0003\u0002\uffff\u0001\u0003"+
+ "\u0001\uffff\u0003\u0003\u0002\uffff\u0001\u0003\u0002\uffff"+
+ "\u0002\u000b\u0002\uffff\u0002\u0003\u000b\uffff\u0002\u0003"+
+ "\u0005\uffff\u0001\u0003\u0004\uffff\u0002\u0003\u0001\uffff"+
+ "\u0001\u0003\u0004\uffff\u0001\u0003\u0004\uffff\u0001\u0003"+
+ "\u0003\uffff\u0002\u0003\u0006\uffff\u0001\u0003\u0005\uffff"+
+ "\u0001\u0003\u0007\uffff\u0002\u0003\u0004\uffff\u0001\u0003"+
+ "\u0003\uffff\u0001\u0003\u0001\u000b\u0006\uffff\u0001\u0003"+
+ "\u0002\uffff\u0001\u0003\u003a\uffff\u0003\u0003\u0002\uffff"+
+ "\u0001\u0003\u0001\uffff\u0004\u0003\u0001\uffff\u0001\u0003"+
+ "\u0001\uffff\u0001\u0003\u0001\uffff\u0001\u0003\u0001\uffff"+
+ "\u000c\u0003\u0002\uffff\u0001\u0003\u0003\uffff\u0002\u0003",
+ "\u0004\u0003\u0004\uffff\u0003\u0003\u0001\uffff\u0001\u0003"+
+ "\u0004\uffff\u0001\u0003\u0002\uffff\u0002\u0003\u0004\uffff"+
+ "\u0001\u0003\u0002\uffff\u0001\u0003\u0001\uffff\u0001\u0003"+
+ "\u0003\uffff\u0001\u0003\u0001\uffff\u0001\u0003\u0001\uffff"+
+ "\u0002\u0003\u0004\uffff\u0003\u0003\u0002\uffff\u0001\u0003"+
+ "\u0001\uffff\u0003\u0003\u0002\uffff\u0001\u0003\u0002\uffff"+
+ "\u0002\u000b\u0002\uffff\u0002\u0003\u000b\uffff\u0002\u0003"+
+ "\u0005\uffff\u0001\u0003\u0004\uffff\u0002\u0003\u0001\uffff"+
+ "\u0001\u0003\u0004\uffff\u0001\u0003\u0004\uffff\u0001\u0003"+
+ "\u0003\uffff\u0002\u0003\u0006\uffff\u0001\u0003\u0005\uffff"+
+ "\u0001\u0003\u0007\uffff\u0002\u0003\u0004\uffff\u0001\u0003"+
+ "\u0003\uffff\u0001\u0003\u0007\uffff\u0001\u0003\u0002\uffff"+
+ "\u0001\u0003\u003a\uffff\u0003\u0003\u0002\uffff\u0001\u0003"+
+ "\u0001\uffff\u0004\u0003\u0001\uffff\u0001\u0003\u0001\uffff"+
+ "\u0001\u0003\u0001\uffff\u0001\u0003\u0001\uffff\u000c\u0003"+
+ "\u0002\uffff\u0001\u0003\u0003\uffff\u0002\u0003",
+ "\u0004\u0003\u0004\uffff\u0003\u0003\u0001\uffff\u0001\u0003"+
+ "\u0004\uffff\u0001\u0003\u0002\uffff\u0002\u0003\u0004\uffff"+
+ "\u0001\u0003\u0002\uffff\u0001\u0003\u0001\uffff\u0001\u0003"+
+ "\u0003\uffff\u0001\u0003\u0001\uffff\u0001\u0003\u0001\uffff"+
+ "\u0002\u0003\u0004\uffff\u0003\u0003\u0002\uffff\u0001\u0003"+
+ "\u0001\uffff\u0003\u0003\u0002\uffff\u0001\u0003\u0002\uffff"+
+ "\u0002\u000b\u0002\uffff\u0002\u0003\u000b\uffff\u0002\u0003"+
+ "\u0005\uffff\u0001\u0003\u0004\uffff\u0002\u0003\u0001\uffff"+
+ "\u0001\u0003\u0004\uffff\u0001\u0003\u0004\uffff\u0001\u0003"+
+ "\u0003\uffff\u0002\u0003\u0006\uffff\u0001\u0003\u0005\uffff"+
+ "\u0001\u0003\u0007\uffff\u0002\u0003\u0004\uffff\u0001\u0003"+
+ "\u0003\uffff\u0001\u0003\u0006\uffff\u0001\u000b\u0001\u0003"+
+ "\u0002\uffff\u0001\u0003\u003a\uffff\u0003\u0003\u0002\uffff"+
+ "\u0001\u0003\u0001\uffff\u0004\u0003\u0001\uffff\u0001\u0003"+
+ "\u0001\uffff\u0001\u0003\u0001\uffff\u0001\u0003\u0001\uffff"+
+ "\u000c\u0003\u0002\uffff\u0001\u0003\u0003\uffff\u0002\u0003",
+ "\u0004\u0003\u0004\uffff\u0003\u0003\u0001\uffff\u0001\u0003"+
+ "\u0004\uffff\u0001\u0003\u0002\uffff\u0002\u0003\u0004\uffff"+
+ "\u0001\u0003\u0002\uffff\u0001\u0003\u0001\uffff\u0001\u0003"+
+ "\u0003\uffff\u0001\u0003\u0001\uffff\u0001\u0003\u0001\uffff"+
+ "\u0002\u0003\u0004\uffff\u0003\u0003\u0002\uffff\u0001\u0003"+
+ "\u0001\uffff\u0003\u0003\u0002\uffff\u0001\u0003\u0006\uffff"+
+ "\u0002\u0003\u000b\uffff\u0002\u0003\u0005\uffff\u0001\u0003"+
+ "\u0004\uffff\u0002\u0003\u0001\uffff\u0001\u0003\u0004\uffff"+
+ "\u0001\u0003\u0004\uffff\u0001\u0003\u0003\uffff\u0002\u0003"+
+ "\u0006\uffff\u0001\u0003\u0005\uffff\u0001\u0003\u0007\uffff"+
+ "\u0002\u0003\u0004\uffff\u0001\u0003\u0003\uffff\u0001\u0003"+
+ "\u0007\uffff\u0001\u0003\u0002\uffff\u0001\u0003\u003a\uffff"+
+ "\u0003\u0003\u0001\u000b\u0001\uffff\u0001\u0003\u0001\uffff"+
+ "\u0004\u0003\u0001\uffff\u0001\u0003\u0001\uffff\u0001\u0003"+
+ "\u0001\uffff\u0001\u0003\u0001\uffff\u000c\u0003\u0002\uffff"+
+ "\u0001\u0003\u0003\uffff\u0002\u0003",
+ "\u0004\u0003\u0004\uffff\u0003\u0003\u0001\uffff\u0001\u0003"+
+ "\u0004\uffff\u0001\u0003\u0002\uffff\u0002\u0003\u0004\uffff"+
+ "\u0001\u0003\u0002\uffff\u0001\u0003\u0001\uffff\u0001\u0003"+
+ "\u0003\uffff\u0001\u0003\u0001\uffff\u0001\u0003\u0001\uffff"+
+ "\u0002\u0003\u0004\uffff\u0003\u0003\u0002\uffff\u0001\u0003"+
+ "\u0001\uffff\u0003\u0003\u0002\uffff\u0001\u0003\u0003\uffff"+
+ "\u0001\u000b\u0002\uffff\u0002\u0003\u000b\uffff\u0002\u0003"+
+ "\u0005\uffff\u0001\u0003\u0004\uffff\u0002\u0003\u0001\uffff"+
+ "\u0001\u0003\u0004\uffff\u0001\u0003\u0004\uffff\u0001\u0003"+
+ "\u0003\uffff\u0002\u0003\u0006\uffff\u0001\u0003\u0005\uffff"+
+ "\u0001\u0003\u0007\uffff\u0002\u0003\u0004\uffff\u0001\u0003"+
+ "\u0003\uffff\u0001\u0003\u0007\uffff\u0001\u0003\u0002\uffff"+
+ "\u0001\u0003\u003a\uffff\u0003\u0003\u0002\uffff\u0001\u0003"+
+ "\u0001\uffff\u0004\u0003\u0001\uffff\u0001\u0003\u0001\uffff"+
+ "\u0001\u0003\u0001\uffff\u0001\u0003\u0001\uffff\u000c\u0003"+
+ "\u0002\uffff\u0001\u0003\u0003\uffff\u0002\u0003",
+ "",
+ ""
+ ]
+});
+
+org.antlr.lang.augmentObject(XQueryParser, {
+ DFA265_eot:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA265_eotS),
+ DFA265_eof:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA265_eofS),
+ DFA265_min:
+ org.antlr.runtime.DFA.unpackEncodedStringToUnsignedChars(XQueryParser.DFA265_minS),
+ DFA265_max:
+ org.antlr.runtime.DFA.unpackEncodedStringToUnsignedChars(XQueryParser.DFA265_maxS),
+ DFA265_accept:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA265_acceptS),
+ DFA265_special:
+ org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA265_specialS),
+ DFA265_transition: (function() {
+ var a = [],
+ i,
+ numStates = XQueryParser.DFA265_transitionS.length;
+ for (i=0; i<numStates; i++) {
+ a.push(org.antlr.runtime.DFA.unpackEncodedString(XQueryParser.DFA265_transitionS[i]));
+ }
+ return a;
+ })()
+});
+
+XQueryParser.DFA265 = function(recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 265;
+ this.eot = XQueryParser.DFA265_eot;
+ this.eof = XQueryParser.DFA265_eof;
+ this.min = XQueryParser.DFA265_min;
+ this.max = XQueryParser.DFA265_max;
+ this.accept = XQueryParser.DFA265_accept;
+ this.special = XQueryParser.DFA265_special;
+ this.transition = XQueryParser.DFA265_transition;
+};
+
+org.antlr.lang.extend(XQueryParser.DFA265, org.antlr.runtime.DFA, {
+ getDescription: function() {
+ return "2207:1: p_ExprSimple : ( p_QuantifiedExpr | p_OrExpr | {...}? => pg_UpdateExpr );";
+ },
+ specialStateTransition: function(s, input) {
+ var _s = s;
+ var retval = (function(s, input) {
+ switch ( s ) {
+ case 0 :
+ var LA265_9 = input.LA(1);
+
+
+ var index265_9 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (LA265_9==JSON) && ((this.lc(XQU)))) {s = 11;}
+
+ else if ( (LA265_9==EOF||(LA265_9>=AND && LA265_9<=AT)||(LA265_9>=CASE && LA265_9<=CASTABLE)||LA265_9==COLLATION||LA265_9==DEFAULT||(LA265_9>=DESCENDING && LA265_9<=DIV)||LA265_9==EMPTY||LA265_9==EQ||LA265_9==EXCEPT||LA265_9==FOR||LA265_9==GE||(LA265_9>=GT && LA265_9<=IDIV)||(LA265_9>=INSTANCE && LA265_9<=IS)||LA265_9==LE||(LA265_9>=LET && LA265_9<=MOD)||LA265_9==NE||(LA265_9>=OR && LA265_9<=ORDER)||(LA265_9>=RETURN && LA265_9<=SATISFIES)||LA265_9==STABLE||(LA265_9>=TO && LA265_9<=TREAT)||LA265_9==UNION||LA265_9==WHERE||LA265_9==COUNT||(LA265_9>=END && LA265_9<=GROUP)||LA265_9==ONLY||LA265_9==START||(LA265_9>=AFTER && LA265_9<=BEFORE)||LA265_9==INTO||LA265_9==MODIFY||LA265_9==WITH||LA265_9==CONTAINS||(LA265_9>=CONCAT && LA265_9<=RPAREN)||LA265_9==R_UNION_BRACKET||(LA265_9>=RBRACKET && LA265_9<=EQUAL)||LA265_9==NOTEQUAL||LA265_9==HASH||LA265_9==COMMA||(LA265_9>=STAR && LA265_9<=BANG)||LA265_9==COLON||(LA265_9>=SEMICOLON && LA265_9<=VBAR)) ) {s = 3;}
+
+
+ input.seek(index265_9);
+ if ( s>=0 ) return s;
+ break;
+ case 1 :
+ var LA265_7 = input.LA(1);
+
+
+ var index265_7 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((LA265_7>=NODE && LA265_7<=JSON)||LA265_7==VALUE) && ((this.lc(XQU)))) {s = 11;}
+
+ else if ( (LA265_7==EOF||(LA265_7>=AND && LA265_7<=AT)||(LA265_7>=CASE && LA265_7<=CASTABLE)||LA265_7==COLLATION||LA265_7==DEFAULT||(LA265_7>=DESCENDING && LA265_7<=DIV)||LA265_7==EMPTY||LA265_7==EQ||LA265_7==EXCEPT||LA265_7==FOR||LA265_7==GE||(LA265_7>=GT && LA265_7<=IDIV)||(LA265_7>=INSTANCE && LA265_7<=IS)||LA265_7==LE||(LA265_7>=LET && LA265_7<=MOD)||LA265_7==NE||(LA265_7>=OR && LA265_7<=ORDER)||(LA265_7>=RETURN && LA265_7<=SATISFIES)||LA265_7==STABLE||(LA265_7>=TO && LA265_7<=TREAT)||LA265_7==UNION||LA265_7==WHERE||LA265_7==COUNT||(LA265_7>=END && LA265_7<=GROUP)||LA265_7==ONLY||LA265_7==START||(LA265_7>=AFTER && LA265_7<=BEFORE)||LA265_7==INTO||LA265_7==MODIFY||LA265_7==WITH||LA265_7==CONTAINS||(LA265_7>=CONCAT && LA265_7<=RPAREN)||LA265_7==R_UNION_BRACKET||(LA265_7>=RBRACKET && LA265_7<=EQUAL)||LA265_7==NOTEQUAL||LA265_7==HASH||LA265_7==COMMA||(LA265_7>=STAR && LA265_7<=BANG)||LA265_7==COLON||(LA265_7>=SEMICOLON && LA265_7<=VBAR)) ) {s = 3;}
+
+
+ input.seek(index265_7);
+ if ( s>=0 ) return s;
+ break;
+ case 2 :
+ var LA265_4 = input.LA(1);
+
+
+ var index265_4 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((LA265_4>=NODE && LA265_4<=JSON)||LA265_4==NODES) && ((this.lc(XQU)))) {s = 11;}
+
+ else if ( (LA265_4==EOF||(LA265_4>=AND && LA265_4<=AT)||(LA265_4>=CASE && LA265_4<=CASTABLE)||LA265_4==COLLATION||LA265_4==DEFAULT||(LA265_4>=DESCENDING && LA265_4<=DIV)||LA265_4==EMPTY||LA265_4==EQ||LA265_4==EXCEPT||LA265_4==FOR||LA265_4==GE||(LA265_4>=GT && LA265_4<=IDIV)||(LA265_4>=INSTANCE && LA265_4<=IS)||LA265_4==LE||(LA265_4>=LET && LA265_4<=MOD)||LA265_4==NE||(LA265_4>=OR && LA265_4<=ORDER)||(LA265_4>=RETURN && LA265_4<=SATISFIES)||LA265_4==STABLE||(LA265_4>=TO && LA265_4<=TREAT)||LA265_4==UNION||LA265_4==WHERE||LA265_4==COUNT||(LA265_4>=END && LA265_4<=GROUP)||LA265_4==ONLY||LA265_4==START||(LA265_4>=AFTER && LA265_4<=BEFORE)||LA265_4==INTO||LA265_4==MODIFY||LA265_4==WITH||LA265_4==CONTAINS||(LA265_4>=CONCAT && LA265_4<=RPAREN)||LA265_4==R_UNION_BRACKET||(LA265_4>=RBRACKET && LA265_4<=EQUAL)||LA265_4==NOTEQUAL||LA265_4==HASH||LA265_4==COMMA||(LA265_4>=STAR && LA265_4<=BANG)||LA265_4==COLON||(LA265_4>=SEMICOLON && LA265_4<=VBAR)) ) {s = 3;}
+
+
+ input.seek(index265_4);
+ if ( s>=0 ) return s;
+ break;
+ case 3 :
+ var LA265_8 = input.LA(1);
+
+
+ var index265_8 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (LA265_8==DOLLAR) && ((this.lc(XQU)))) {s = 11;}
+
+ else if ( (LA265_8==EOF||(LA265_8>=AND && LA265_8<=AT)||(LA265_8>=CASE && LA265_8<=CASTABLE)||LA265_8==COLLATION||LA265_8==DEFAULT||(LA265_8>=DESCENDING && LA265_8<=DIV)||LA265_8==EMPTY||LA265_8==EQ||LA265_8==EXCEPT||LA265_8==FOR||LA265_8==GE||(LA265_8>=GT && LA265_8<=IDIV)||(LA265_8>=INSTANCE && LA265_8<=IS)||LA265_8==LE||(LA265_8>=LET && LA265_8<=MOD)||LA265_8==NE||(LA265_8>=OR && LA265_8<=ORDER)||(LA265_8>=RETURN && LA265_8<=SATISFIES)||LA265_8==STABLE||(LA265_8>=TO && LA265_8<=TREAT)||LA265_8==UNION||LA265_8==WHERE||LA265_8==COUNT||(LA265_8>=END && LA265_8<=GROUP)||LA265_8==ONLY||LA265_8==START||(LA265_8>=AFTER && LA265_8<=BEFORE)||LA265_8==INTO||LA265_8==MODIFY||LA265_8==WITH||LA265_8==CONTAINS||(LA265_8>=CONCAT && LA265_8<=RPAREN)||LA265_8==R_UNION_BRACKET||(LA265_8>=RBRACKET && LA265_8<=EQUAL)||LA265_8==NOTEQUAL||LA265_8==HASH||LA265_8==COMMA||(LA265_8>=STAR && LA265_8<=BANG)||LA265_8==COLON||(LA265_8>=SEMICOLON && LA265_8<=VBAR)) ) {s = 3;}
+
+
+ input.seek(index265_8);
+ if ( s>=0 ) return s;
+ break;
+ case 4 :
+ var LA265_5 = input.LA(1);
+
+
+ var index265_5 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((LA265_5>=NODE && LA265_5<=JSON)||LA265_5==NODES) && ((this.lc(XQU)))) {s = 11;}
+
+ else if ( (LA265_5==EOF||(LA265_5>=AND && LA265_5<=AT)||(LA265_5>=CASE && LA265_5<=CASTABLE)||LA265_5==COLLATION||LA265_5==DEFAULT||(LA265_5>=DESCENDING && LA265_5<=DIV)||LA265_5==EMPTY||LA265_5==EQ||LA265_5==EXCEPT||LA265_5==FOR||LA265_5==GE||(LA265_5>=GT && LA265_5<=IDIV)||(LA265_5>=INSTANCE && LA265_5<=IS)||LA265_5==LE||(LA265_5>=LET && LA265_5<=MOD)||LA265_5==NE||(LA265_5>=OR && LA265_5<=ORDER)||(LA265_5>=RETURN && LA265_5<=SATISFIES)||LA265_5==STABLE||(LA265_5>=TO && LA265_5<=TREAT)||LA265_5==UNION||LA265_5==WHERE||LA265_5==COUNT||(LA265_5>=END && LA265_5<=GROUP)||LA265_5==ONLY||LA265_5==START||(LA265_5>=AFTER && LA265_5<=BEFORE)||LA265_5==INTO||LA265_5==MODIFY||LA265_5==WITH||LA265_5==CONTAINS||(LA265_5>=CONCAT && LA265_5<=RPAREN)||LA265_5==R_UNION_BRACKET||(LA265_5>=RBRACKET && LA265_5<=EQUAL)||LA265_5==NOTEQUAL||LA265_5==HASH||LA265_5==COMMA||(LA265_5>=STAR && LA265_5<=BANG)||LA265_5==COLON||(LA265_5>=SEMICOLON && LA265_5<=VBAR)) ) {s = 3;}
+
+
+ input.seek(index265_5);
+ if ( s>=0 ) return s;
+ break;
+ case 5 :
+ var LA265_6 = input.LA(1);
+
+
+ var index265_6 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((LA265_6>=NODE && LA265_6<=JSON)) && ((this.lc(XQU)))) {s = 11;}
+
+ else if ( (LA265_6==EOF||(LA265_6>=AND && LA265_6<=AT)||(LA265_6>=CASE && LA265_6<=CASTABLE)||LA265_6==COLLATION||LA265_6==DEFAULT||(LA265_6>=DESCENDING && LA265_6<=DIV)||LA265_6==EMPTY||LA265_6==EQ||LA265_6==EXCEPT||LA265_6==FOR||LA265_6==GE||(LA265_6>=GT && LA265_6<=IDIV)||(LA265_6>=INSTANCE && LA265_6<=IS)||LA265_6==LE||(LA265_6>=LET && LA265_6<=MOD)||LA265_6==NE||(LA265_6>=OR && LA265_6<=ORDER)||(LA265_6>=RETURN && LA265_6<=SATISFIES)||LA265_6==STABLE||(LA265_6>=TO && LA265_6<=TREAT)||LA265_6==UNION||LA265_6==WHERE||LA265_6==COUNT||(LA265_6>=END && LA265_6<=GROUP)||LA265_6==ONLY||LA265_6==START||(LA265_6>=AFTER && LA265_6<=BEFORE)||LA265_6==INTO||LA265_6==MODIFY||LA265_6==WITH||LA265_6==CONTAINS||(LA265_6>=CONCAT && LA265_6<=RPAREN)||LA265_6==R_UNION_BRACKET||(LA265_6>=RBRACKET && LA265_6<=EQUAL)||LA265_6==NOTEQUAL||LA265_6==HASH||LA265_6==COMMA||(LA265_6>=STAR && LA265_6<=BANG)||LA265_6==COLON||(LA265_6>=SEMICOLON && LA265_6<=VBAR)) ) {s = 3;}
+
+
+ input.seek(index265_6);
+ if ( s>=0 ) return s;
+ break;
+ }
+ }).call(this.recognizer, s, input);
+ if (!org.antlr.lang.isUndefined(retval)) {
+ return retval;
+ }
+ if (this.recognizer.state.backtracking>0) {this.recognizer.state.failed=true; return -1;}
+ var nvae =
+ new org.antlr.runtime.NoViableAltException(this.getDescription(), 265, _s, input);
+ this.error(nvae);
+ throw nvae;
+ },
+ dummy: null
+});
+
+
+// public class variables
+org.antlr.lang.augmentObject(XQueryParser, {
+ tokenNames: ["<invalid>", "<EOR>", "<DOWN>", "<UP>", "L_QuotAttrContentChar", "L_AposAttrContentChar", "L_ElementContentChar", "L_CDataSection", "L_PredefinedEntityRef", "L_CharRef", "ESCAPE_LBRACKET", "ESCAPE_RBRACKET", "ESCAPE_APOS", "ESCAPE_QUOT", "CDATA_START", "CDATA_END", "ANCESTOR", "ANCESTOR_OR_SELF", "AND", "AS", "ASCENDING", "AT", "ATTRIBUTE", "BASE_URI", "BOUNDARY_SPACE", "BY", "CASE", "CAST", "CASTABLE", "CHILD", "COLLATION", "COMMENT", "CONSTRUCTION", "COPY_NAMESPACES", "DECLARE", "DEFAULT", "DESCENDANT", "DESCENDANT_OR_SELF", "DESCENDING", "DIV", "DOCUMENT", "DOCUMENT_NODE", "ELEMENT", "ELSE", "EMPTY", "EMPTY_SEQUENCE", "ENCODING", "EQ", "EVERY", "EXCEPT", "EXTERNAL", "FOLLOWING", "FOLLOWING_SIBLING", "FOR", "FUNCTION", "GE", "GREATEST", "GT", "IDIV", "IF", "IMPORT", "IN", "INHERIT", "INSTANCE", "INTERSECT", "IS", "ITEM", "LAX", "LE", "LEAST", "LET", "LT", "MOD", "MODULE", "NAMESPACE", "NE", "NO_INHERIT", "NO_PRESERVE", "NODE", "JSON", "OF", "OPTION", "OR", "ORDER", "ORDERED", "ORDERING", "PARENT", "PRECEDING", "PRECEDING_SIBLING", "PRESERVE", "PROCESSING_INSTRUCTION", "STRUCTURED_ITEM", "JSON_ITEM", "OBJECT", "ARRAY", "RETURN", "SATISFIES", "SCHEMA", "SCHEMA_ATTRIBUTE", "SCHEMA_ELEMENT", "SELF", "SOME", "STABLE", "STRICT", "STRIP", "TEXT", "THEN", "TO", "TREAT", "TYPESWITCH", "UNION", "UNORDERED", "VALIDATE", "VARIABLE", "VERSION", "WHERE", "XQUERY", "ALLOWING", "CATCH", "CONTEXT", "COUNT", "DECIMAL_FORMAT", "DECIMAL_SEPARATOR", "DIGIT", "END", "GROUP", "GROUPING_SEPARATOR", "INFINITY", "MINUS_SIGN", "NAMESPACE_NODE", "NAN", "NEXT", "ONLY", "PATTERN_SEPARATOR", "PERCENT", "PER_MILLE", "PREVIOUS", "SLIDING", "START", "SWITCH", "TRY", "TUMBLING", "TYPE", "WHEN", "WINDOW", "ZERO_DIGIT", "AFTER", "BEFORE", "COPY", "DELETE", "FIRST", "INSERT", "INTO", "POSITION", "APPEND", "LAST", "MODIFY", "NODES", "RENAME", "REPLACE", "REVALIDATION", "SKIP", "UPDATING", "VALUE", "WITH", "ALL", "ANY", "CONTAINS", "CONTENT", "DIACRITICS", "DIFFERENT", "DISTANCE", "ENTIRE", "EXACTLY", "FROM", "FT_OPTION", "FTAND", "FTNOT", "FTOR", "INSENSITIVE", "LANGUAGE", "LEVELS", "LOWERCASE", "MOST", "NO", "NOT", "OCCURS", "PARAGRAPH", "PARAGRAPHS", "PHRASE", "RELATIONSHIP", "SAME", "SCORE", "SENSITIVE", "SENTENCE", "SENTENCES", "STEMMING", "STOP", "THESAURUS", "TIMES", "UPPERCASE", "USING", "WEIGHT", "WILDCARDS", "WITHOUT", "WORD", "WORDS", "BREAK", "CONTINUE", "EXIT", "LOOP", "RETURNING", "WHILE", "CHECK", "COLLECTION", "CONSTRAINT", "FOREACH", "FOREIGN", "INDEX", "INTEGRITY", "KEY", "ON", "UNIQUE", "AMP_ER", "APOS_ER", "QUOT_ER", "CONCAT", "LPAREN", "RPAREN", "DOLLAR", "L_UNION_BRACKET", "R_UNION_BRACKET", "LBRACKET", "RBRACKET", "LSQUARE", "RSQUARE", "EQUAL", "BIND", "NOTEQUAL", "ANN_PERCENT", "HASH", "AMP", "COMMA", "QUESTION", "STAR", "PLUS", "MINUS", "SMALLER", "GREATER", "SMALLEREQ", "GREATEREQ", "SMALLER_SMALLER", "GREATER_GREATER", "SLASH", "SLASH_SLASH", "BANG", "DOT", "DOT_DOT", "COLON", "COLON_COLON", "EMPTY_CLOSE_TAG", "CLOSE_TAG", "SEMICOLON", "VBAR", "PRAGMA_START", "PRAGMA_END", "XML_COMMENT_START", "XML_COMMENT_END", "PI_START", "PI_END", "ATTR_SIGN", "Q", "CHARREF_DEC", "CHARREF_HEX", "APOS", "QUOT", "NCNameStartChar", "NCNameChar", "L_NCName", "Letter", "HexLetter", "Digit", "Digits", "S", "SU", "L_Pragma", "L_DirCommentConstructor", "L_DirPIConstructor", "L_IntegerLiteral", "L_DecimalLiteral", "L_DoubleLiteral", "L_Comment", "L_AnyChar", "L_QuotStringLiteralChar", "L_AposStringLiteralChar", "LibraryModule", "MainModule", "VersionDecl", "VersionDeclEncoding", "VersionDeclVersion", "ModuleDecl", "Prolog", "DefaultNamespaceDecls", "DefaultNamespaceDecl", "Setters", "Setter", "NamespaceDecls", "NamespaceDecl", "Imports", "FTOptionDecls", "SchemaImport", "SchemaPrefix", "NamespaceName", "DefaultElementNamespace", "AtHints", "ModuleImport", "BaseURIDecl", "OrderedDecls", "VarDecl", "VarType", "VarValue", "VarDefaultValue", "VarVariableDecl", "FunctionDecl", "ParamList", "ReturnType", "OptionDecl", "TypeDeclaration", "Param", "EnclosedExpr", "QueryBody", "UnaryExpr", "DirElemConstructor", "DirAttributeList", "DirAttributeValue", "DirElemContent", "CommonContent", "SequenceType", "EmptySequenceTest", "KindTest", "ItemTest", "FunctionTest", "AtomicType", "AtomicOrUnionType", "StringLiteral", "ElementContentChar", "AttributeValueChar", "QName", "BlockExpr"],
+ FOLLOW_p_VersionDecl_in_p_Module503: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0856B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_LibraryModule_in_p_Module536: new org.antlr.runtime.BitSet([0x00000000, 0x00000000]),
+ FOLLOW_p_MainModule_in_p_Module559: new org.antlr.runtime.BitSet([0x00000000, 0x00000000]),
+ FOLLOW_EOF_in_p_Module583: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_XQUERY_in_p_VersionDecl611: new org.antlr.runtime.BitSet([0x00000000, 0x00004000,0x00000000, 0x00040000]),
+ FOLLOW_ENCODING_in_p_VersionDecl619: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x000C0000, 0x00000007]),
+ FOLLOW_p_StringLiteral_in_p_VersionDecl625: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000040, 0x00000000]),
+ FOLLOW_VERSION_in_p_VersionDecl646: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x000C0000, 0x00000007]),
+ FOLLOW_p_StringLiteral_in_p_VersionDecl652: new org.antlr.runtime.BitSet([0x00000000, 0x00004000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000040, 0x00000000]),
+ FOLLOW_ENCODING_in_p_VersionDecl657: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x000C0000, 0x00000007]),
+ FOLLOW_p_StringLiteral_in_p_VersionDecl663: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000040, 0x00000000]),
+ FOLLOW_SEMICOLON_in_p_VersionDecl669: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_pm_Prolog_in_p_MainModule735: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0856B,0xE04CC003, 0x00000007]),
+ FOLLOW_pm_QueryBody_in_p_MainModule737: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_ModuleDecl_in_p_LibraryModule793: new org.antlr.runtime.BitSet([0x00000000, 0x10000004]),
+ FOLLOW_pm_Prolog_in_p_LibraryModule795: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_MODULE_in_p_ModuleDecl851: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000400, 0x00000000]),
+ FOLLOW_NAMESPACE_in_p_ModuleDecl855: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000003,0x00400000, 0x00000000]),
+ FOLLOW_p_NCName_in_p_ModuleDecl859: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00001000]),
+ FOLLOW_EQUAL_in_p_ModuleDecl861: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x000C0000, 0x00000007]),
+ FOLLOW_p_StringLiteral_in_p_ModuleDecl863: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000040, 0x00000000]),
+ FOLLOW_SEMICOLON_in_p_ModuleDecl865: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_pm_DefaultNamespaceDecl_in_pm_Prolog924: new org.antlr.runtime.BitSet([0x00000002, 0x10000004]),
+ FOLLOW_p_Setter_in_pm_Prolog930: new org.antlr.runtime.BitSet([0x00000002, 0x10000004]),
+ FOLLOW_pm_NamespaceDecl_in_pm_Prolog936: new org.antlr.runtime.BitSet([0x00000002, 0x10000004]),
+ FOLLOW_p_Import_in_pm_Prolog942: new org.antlr.runtime.BitSet([0x00000002, 0x10000004]),
+ FOLLOW_pm_FTOptionDecl_in_pm_Prolog948: new org.antlr.runtime.BitSet([0x00000002, 0x10000004]),
+ FOLLOW_pg_OrderedDecl_in_pm_Prolog955: new org.antlr.runtime.BitSet([0x00000002, 0x00000004]),
+ FOLLOW_pm_ContextItemDecl_in_pg_OrderedDecl1270: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_pm_AnnotatedDecl_in_pg_OrderedDecl1282: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_pm_OptionDecl_in_pg_OrderedDecl1294: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_pm_BoundarySpaceDecl_in_p_Setter1324: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_pm_DefaultCollationDecl_in_p_Setter1336: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_pm_BaseURIDecl_in_p_Setter1348: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_pm_ConstructionDecl_in_p_Setter1360: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_pm_OrderingModeDecl_in_p_Setter1372: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_pm_EmptyOrderDecl_in_p_Setter1384: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_pm_RevalidationDecl_in_p_Setter1399: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_pm_CopyNamespacesDecl_in_p_Setter1411: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_pm_DecimalFormatDecl_in_p_Setter1423: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_DECLARE_in_pm_BoundarySpaceDecl1455: new org.antlr.runtime.BitSet([0x01000000, 0x00000000]),
+ FOLLOW_BOUNDARY_SPACE_in_pm_BoundarySpaceDecl1461: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x02000000, 0x00000100]),
+ FOLLOW_PRESERVE_in_pm_BoundarySpaceDecl1470: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000040, 0x00000000]),
+ FOLLOW_STRIP_in_pm_BoundarySpaceDecl1480: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000040, 0x00000000]),
+ FOLLOW_SEMICOLON_in_pm_BoundarySpaceDecl1487: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_DECLARE_in_pm_DefaultCollationDecl1515: new org.antlr.runtime.BitSet([0x00000000, 0x00000008]),
+ FOLLOW_DEFAULT_in_pm_DefaultCollationDecl1521: new org.antlr.runtime.BitSet([0x40000000, 0x00000000]),
+ FOLLOW_COLLATION_in_pm_DefaultCollationDecl1527: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x000C0000, 0x00000007]),
+ FOLLOW_p_StringLiteral_in_pm_DefaultCollationDecl1531: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000040, 0x00000000]),
+ FOLLOW_SEMICOLON_in_pm_DefaultCollationDecl1533: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_DECLARE_in_pm_BaseURIDecl1569: new org.antlr.runtime.BitSet([0x00800000, 0x00000000]),
+ FOLLOW_BASE_URI_in_pm_BaseURIDecl1575: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x000C0000, 0x00000007]),
+ FOLLOW_p_StringLiteral_in_pm_BaseURIDecl1581: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000040, 0x00000000]),
+ FOLLOW_SEMICOLON_in_pm_BaseURIDecl1583: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_DECLARE_in_pm_ConstructionDecl1636: new org.antlr.runtime.BitSet([0x00000000, 0x00000001]),
+ FOLLOW_CONSTRUCTION_in_pm_ConstructionDecl1642: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x02000000, 0x00000100]),
+ FOLLOW_STRIP_in_pm_ConstructionDecl1651: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000040, 0x00000000]),
+ FOLLOW_PRESERVE_in_pm_ConstructionDecl1657: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000040, 0x00000000]),
+ FOLLOW_SEMICOLON_in_pm_ConstructionDecl1664: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_DECLARE_in_pm_OrderingModeDecl1692: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00200000, 0x00000000]),
+ FOLLOW_ORDERING_in_pm_OrderingModeDecl1698: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00100000, 0x00008000]),
+ FOLLOW_ORDERED_in_pm_OrderingModeDecl1707: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000040, 0x00000000]),
+ FOLLOW_UNORDERED_in_pm_OrderingModeDecl1713: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000040, 0x00000000]),
+ FOLLOW_SEMICOLON_in_pm_OrderingModeDecl1720: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_DECLARE_in_pm_EmptyOrderDecl1748: new org.antlr.runtime.BitSet([0x00000000, 0x00000008]),
+ FOLLOW_DEFAULT_in_pm_EmptyOrderDecl1754: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00080000, 0x00000000]),
+ FOLLOW_ORDER_in_pm_EmptyOrderDecl1760: new org.antlr.runtime.BitSet([0x00000000, 0x00001000]),
+ FOLLOW_EMPTY_in_pm_EmptyOrderDecl1766: new org.antlr.runtime.BitSet([0x00000000, 0x01000000,0x00000020, 0x00000000]),
+ FOLLOW_GREATEST_in_pm_EmptyOrderDecl1775: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000040, 0x00000000]),
+ FOLLOW_LEAST_in_pm_EmptyOrderDecl1781: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000040, 0x00000000]),
+ FOLLOW_SEMICOLON_in_pm_EmptyOrderDecl1788: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_DECLARE_in_pm_CopyNamespacesDecl1816: new org.antlr.runtime.BitSet([0x00000000, 0x00000002]),
+ FOLLOW_COPY_NAMESPACES_in_pm_CopyNamespacesDecl1822: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x02002000, 0x00000000]),
+ FOLLOW_p_PreserveMode_in_pm_CopyNamespacesDecl1826: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00040000]),
+ FOLLOW_COMMA_in_pm_CopyNamespacesDecl1828: new org.antlr.runtime.BitSet([0x00000000, 0x40000000,0x00001000, 0x00000000]),
+ FOLLOW_p_InheritMode_in_pm_CopyNamespacesDecl1830: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000040, 0x00000000]),
+ FOLLOW_SEMICOLON_in_pm_CopyNamespacesDecl1832: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_PRESERVE_in_p_PreserveMode1861: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_NO_PRESERVE_in_p_PreserveMode1867: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_INHERIT_in_p_InheritMode1899: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_NO_INHERIT_in_p_InheritMode1905: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_DECLARE_in_pm_DecimalFormatDecl1944: new org.antlr.runtime.BitSet([0x00000000, 0x00000008,0x00000000, 0x02000000]),
+ FOLLOW_DECIMAL_FORMAT_in_pm_DecimalFormatDecl1952: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000003,0x00408000, 0x00000000]),
+ FOLLOW_p_EQName_in_pm_DecimalFormatDecl1956: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0xCC000000,0x000200E5, 0x00000000,0x00000000, 0x00000000,0x00000040, 0x00000000]),
+ FOLLOW_DEFAULT_in_pm_DecimalFormatDecl1964: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x02000000]),
+ FOLLOW_DECIMAL_FORMAT_in_pm_DecimalFormatDecl1970: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0xCC000000,0x000200E5, 0x00000000,0x00000000, 0x00000000,0x00000040, 0x00000000]),
+ FOLLOW_p_DFPropertyName_in_pm_DecimalFormatDecl1977: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00001000]),
+ FOLLOW_EQUAL_in_pm_DecimalFormatDecl1979: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x000C0000, 0x00000007]),
+ FOLLOW_p_StringLiteral_in_pm_DecimalFormatDecl1981: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0xCC000000,0x000200E5, 0x00000000,0x00000000, 0x00000000,0x00000040, 0x00000000]),
+ FOLLOW_SEMICOLON_in_pm_DecimalFormatDecl1985: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_DECIMAL_SEPARATOR_in_p_DFPropertyName2014: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_GROUPING_SEPARATOR_in_p_DFPropertyName2020: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_INFINITY_in_p_DFPropertyName2026: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_MINUS_SIGN_in_p_DFPropertyName2032: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_NAN_in_p_DFPropertyName2038: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_PERCENT_in_p_DFPropertyName2044: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_PER_MILLE_in_p_DFPropertyName2050: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_ZERO_DIGIT_in_p_DFPropertyName2056: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_DIGIT_in_p_DFPropertyName2062: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_PATTERN_SEPARATOR_in_p_DFPropertyName2068: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_pm_SchemaImport_in_p_Import2097: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_pm_ModuleImport_in_p_Import2101: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_IMPORT_in_pm_SchemaImport2137: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000002]),
+ FOLLOW_SCHEMA_in_pm_SchemaImport2143: new org.antlr.runtime.BitSet([0x00000000, 0x00000008,0x00000400, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x000C0000, 0x00000007]),
+ FOLLOW_p_SchemaPrefix_in_pm_SchemaImport2149: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x000C0000, 0x00000007]),
+ FOLLOW_p_StringLiteral_in_pm_SchemaImport2154: new org.antlr.runtime.BitSet([0x00200000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000040, 0x00000000]),
+ FOLLOW_AT_in_pm_SchemaImport2159: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x000C0000, 0x00000007]),
+ FOLLOW_p_StringLiteral_in_pm_SchemaImport2165: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00040000,0x00000040, 0x00000000]),
+ FOLLOW_COMMA_in_pm_SchemaImport2168: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x000C0000, 0x00000007]),
+ FOLLOW_p_StringLiteral_in_pm_SchemaImport2172: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00040000,0x00000040, 0x00000000]),
+ FOLLOW_SEMICOLON_in_pm_SchemaImport2178: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_NAMESPACE_in_p_SchemaPrefix2248: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000003,0x00400000, 0x00000000]),
+ FOLLOW_p_NCName_in_p_SchemaPrefix2254: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00001000]),
+ FOLLOW_EQUAL_in_p_SchemaPrefix2256: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_DEFAULT_in_p_SchemaPrefix2295: new org.antlr.runtime.BitSet([0x00000000, 0x00000400]),
+ FOLLOW_ELEMENT_in_p_SchemaPrefix2301: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000400, 0x00000000]),
+ FOLLOW_NAMESPACE_in_p_SchemaPrefix2307: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_IMPORT_in_pm_ModuleImport2357: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000200, 0x00000000]),
+ FOLLOW_MODULE_in_pm_ModuleImport2363: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000400, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x000C0000, 0x00000007]),
+ FOLLOW_NAMESPACE_in_pm_ModuleImport2370: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000003,0x00400000, 0x00000000]),
+ FOLLOW_p_NCName_in_pm_ModuleImport2376: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00001000]),
+ FOLLOW_EQUAL_in_pm_ModuleImport2378: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x000C0000, 0x00000007]),
+ FOLLOW_p_StringLiteral_in_pm_ModuleImport2384: new org.antlr.runtime.BitSet([0x00200000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000040, 0x00000000]),
+ FOLLOW_AT_in_pm_ModuleImport2389: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x000C0000, 0x00000007]),
+ FOLLOW_p_StringLiteral_in_pm_ModuleImport2395: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00040000,0x00000040, 0x00000000]),
+ FOLLOW_COMMA_in_pm_ModuleImport2398: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x000C0000, 0x00000007]),
+ FOLLOW_p_StringLiteral_in_pm_ModuleImport2402: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00040000,0x00000040, 0x00000000]),
+ FOLLOW_SEMICOLON_in_pm_ModuleImport2408: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_DECLARE_in_pm_NamespaceDecl2477: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000400, 0x00000000]),
+ FOLLOW_NAMESPACE_in_pm_NamespaceDecl2483: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000003,0x00400000, 0x00000000]),
+ FOLLOW_p_NCName_in_pm_NamespaceDecl2489: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00001000]),
+ FOLLOW_EQUAL_in_pm_NamespaceDecl2491: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x000C0000, 0x00000007]),
+ FOLLOW_p_StringLiteral_in_pm_NamespaceDecl2495: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000040, 0x00000000]),
+ FOLLOW_SEMICOLON_in_pm_NamespaceDecl2497: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_DECLARE_in_pm_DefaultNamespaceDecl2554: new org.antlr.runtime.BitSet([0x00000000, 0x00000008]),
+ FOLLOW_DEFAULT_in_pm_DefaultNamespaceDecl2560: new org.antlr.runtime.BitSet([0x00000000, 0x00400400]),
+ FOLLOW_ELEMENT_in_pm_DefaultNamespaceDecl2567: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000400, 0x00000000]),
+ FOLLOW_FUNCTION_in_pm_DefaultNamespaceDecl2573: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000400, 0x00000000]),
+ FOLLOW_NAMESPACE_in_pm_DefaultNamespaceDecl2580: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x000C0000, 0x00000007]),
+ FOLLOW_p_StringLiteral_in_pm_DefaultNamespaceDecl2584: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000040, 0x00000000]),
+ FOLLOW_SEMICOLON_in_pm_DefaultNamespaceDecl2586: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_DECLARE_in_pm_AnnotatedDecl2614: new org.antlr.runtime.BitSet([0x00000000, 0x00400000,0x00000000, 0x00020000,0x00000000, 0x00000004,0x0C400000, 0x00008000]),
+ FOLLOW_p_Annotation_in_pm_AnnotatedDecl2618: new org.antlr.runtime.BitSet([0x00000000, 0x00400000,0x00000000, 0x00020000,0x00000000, 0x00000004,0x0C400000, 0x00008000]),
+ FOLLOW_pg_AnnotatedDecl_in_pm_AnnotatedDecl2621: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000040, 0x00000000]),
+ FOLLOW_SEMICOLON_in_pm_AnnotatedDecl2623: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_VarDecl_in_pg_AnnotatedDecl2647: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_pm_FunctionDecl_in_pg_AnnotatedDecl2659: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_CollectionDecl_in_pg_AnnotatedDecl2674: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_IndexDecl_in_pg_AnnotatedDecl2689: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_ICDecl_in_pg_AnnotatedDecl2704: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_ANN_PERCENT_in_p_Annotation2730: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000003,0x00408000, 0x00000000]),
+ FOLLOW_p_EQName_in_p_Annotation2732: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000008]),
+ FOLLOW_LPAREN_in_p_Annotation2735: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x000C0000, 0x00000007]),
+ FOLLOW_p_Literal_in_p_Annotation2737: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00040010]),
+ FOLLOW_COMMA_in_p_Annotation2740: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x000C0000, 0x00000007]),
+ FOLLOW_p_Literal_in_p_Annotation2742: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00040010]),
+ FOLLOW_RPAREN_in_p_Annotation2746: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_VARIABLE_in_p_VarDecl2776: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000020]),
+ FOLLOW_DOLLAR_in_p_VarDecl2782: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000003,0x00408000, 0x00000000]),
+ FOLLOW_p_EQName_in_p_VarDecl2786: new org.antlr.runtime.BitSet([0x00080000, 0x00040000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00002000]),
+ FOLLOW_p_TypeDeclaration_in_p_VarDecl2792: new org.antlr.runtime.BitSet([0x00000000, 0x00040000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00002000]),
+ FOLLOW_BIND_in_p_VarDecl2797: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_VarValue_in_p_VarDecl2801: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_EXTERNAL_in_p_VarDecl2809: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00002000]),
+ FOLLOW_BIND_in_p_VarDecl2814: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_VarDefaultValue_in_p_VarDecl2818: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_ExprSingle_in_p_VarValue2897: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_ExprSingle_in_p_VarDefaultValue2924: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_DECLARE_in_pm_ContextItemDecl2953: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00800000]),
+ FOLLOW_CONTEXT_in_pm_ContextItemDecl2959: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000004, 0x00000000]),
+ FOLLOW_ITEM_in_pm_ContextItemDecl2965: new org.antlr.runtime.BitSet([0x00080000, 0x00040000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00002000]),
+ FOLLOW_AS_in_pm_ContextItemDecl2972: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x0000800B,0x00408000, 0x00000000]),
+ FOLLOW_p_ItemType_in_pm_ContextItemDecl2976: new org.antlr.runtime.BitSet([0x00000000, 0x00040000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00002000]),
+ FOLLOW_BIND_in_pm_ContextItemDecl2982: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_VarValue_in_pm_ContextItemDecl2984: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000040, 0x00000000]),
+ FOLLOW_EXTERNAL_in_pm_ContextItemDecl2992: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00002000,0x00000040, 0x00000000]),
+ FOLLOW_BIND_in_pm_ContextItemDecl2997: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_VarDefaultValue_in_pm_ContextItemDecl2999: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000040, 0x00000000]),
+ FOLLOW_SEMICOLON_in_pm_ContextItemDecl3005: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_UPDATING_in_pm_FunctionDecl3038: new org.antlr.runtime.BitSet([0x00000000, 0x00400000]),
+ FOLLOW_FUNCTION_in_pm_FunctionDecl3046: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x00000003,0x00400000, 0x00000000]),
+ FOLLOW_pg_FQName_in_pm_FunctionDecl3052: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000008]),
+ FOLLOW_LPAREN_in_pm_FunctionDecl3054: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000030]),
+ FOLLOW_p_ParamList_in_pm_FunctionDecl3058: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000010]),
+ FOLLOW_RPAREN_in_pm_FunctionDecl3061: new org.antlr.runtime.BitSet([0x00080000, 0x00040000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000100]),
+ FOLLOW_AS_in_pm_FunctionDecl3066: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x0000800B,0x00408000, 0x00000000]),
+ FOLLOW_p_SequenceType_in_pm_FunctionDecl3072: new org.antlr.runtime.BitSet([0x00000000, 0x00040000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000100]),
+ FOLLOW_LBRACKET_in_pm_FunctionDecl3077: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0856B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_StatementsAndOptionalExpr_in_pm_FunctionDecl3081: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000200]),
+ FOLLOW_RBRACKET_in_pm_FunctionDecl3083: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_EXTERNAL_in_pm_FunctionDecl3089: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_Param_in_p_ParamList3166: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00040000]),
+ FOLLOW_COMMA_in_p_ParamList3169: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000020]),
+ FOLLOW_p_Param_in_p_ParamList3173: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00040000]),
+ FOLLOW_DOLLAR_in_p_Param3233: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000003,0x00408000, 0x00000000]),
+ FOLLOW_p_EQName_in_p_Param3237: new org.antlr.runtime.BitSet([0x00080002, 0x00000000]),
+ FOLLOW_p_TypeDeclaration_in_p_Param3243: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_EnclosedExpr_in_pm_FunctionBody3299: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_LBRACKET_in_p_EnclosedExpr3326: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_Expr_in_p_EnclosedExpr3328: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000200]),
+ FOLLOW_RBRACKET_in_p_EnclosedExpr3331: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_DECLARE_in_pm_OptionDecl3383: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00020000, 0x00000000]),
+ FOLLOW_OPTION_in_pm_OptionDecl3389: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000003,0x00408000, 0x00000000]),
+ FOLLOW_p_EQName_in_pm_OptionDecl3393: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x000C0000, 0x00000007]),
+ FOLLOW_p_StringLiteral_in_pm_OptionDecl3395: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000040, 0x00000000]),
+ FOLLOW_SEMICOLON_in_pm_OptionDecl3397: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_Program_in_pm_QueryBody3426: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_Expr_in_pm_QueryBody3438: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_ExprSingle_in_p_Expr3474: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00040000]),
+ FOLLOW_COMMA_in_p_Expr3490: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_ExprSingle_in_p_Expr3492: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00040000]),
+ FOLLOW_p_FLWORHybrid_in_p_ExprSingle3559: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_IfHybrid_in_p_ExprSingle3589: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_SwitchHybrid_in_p_ExprSingle3615: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_TypeswitchHybrid_in_p_ExprSingle3637: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_TryCatchHybrid_in_p_ExprSingle3664: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_ExprSimple_in_p_ExprSingle3677: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_InitialClause_in_p_FLWORHybrid3704: new org.antlr.runtime.BitSet([0x00000000, 0x00200000,0x80080040, 0x21080040]),
+ FOLLOW_p_IntermediateClause_in_p_FLWORHybrid3706: new org.antlr.runtime.BitSet([0x00000000, 0x00200000,0x80080040, 0x21080040]),
+ FOLLOW_p_ReturnHybrid_in_p_FLWORHybrid3709: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_ForClause_in_p_InitialClause3736: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_LetClause_in_p_InitialClause3740: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_WindowClause_in_p_InitialClause3744: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_InitialClause_in_p_IntermediateClause3770: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_WhereClause_in_p_IntermediateClause3774: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_GroupByClause_in_p_IntermediateClause3778: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_OrderByClause_in_p_IntermediateClause3782: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_CountClause_in_p_IntermediateClause3786: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_RangeExpr_in_p_StringConcatExpr3807: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000004]),
+ FOLLOW_CONCAT_in_p_StringConcatExpr3813: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_RangeExpr_in_p_StringConcatExpr3817: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000004]),
+ FOLLOW_FOR_in_p_ForClause3844: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000020]),
+ FOLLOW_p_ForBinding_in_p_ForClause3848: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00040000]),
+ FOLLOW_COMMA_in_p_ForClause3851: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000020]),
+ FOLLOW_p_ForBinding_in_p_ForClause3853: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00040000]),
+ FOLLOW_DOLLAR_in_p_ForBinding3883: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000003,0x00408000, 0x00000000]),
+ FOLLOW_p_VarName_in_p_ForBinding3887: new org.antlr.runtime.BitSet([0x00280000, 0x20000000,0x00000000, 0x00200000,0x00000000, 0x00000000,0x00000001, 0x00000000]),
+ FOLLOW_p_TypeDeclaration_in_p_ForBinding3891: new org.antlr.runtime.BitSet([0x00200000, 0x20000000,0x00000000, 0x00200000,0x00000000, 0x00000000,0x00000001, 0x00000000]),
+ FOLLOW_p_AllowingEmpty_in_p_ForBinding3894: new org.antlr.runtime.BitSet([0x00200000, 0x20000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000001, 0x00000000]),
+ FOLLOW_p_PositionalVar_in_p_ForBinding3897: new org.antlr.runtime.BitSet([0x00000000, 0x20000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000001, 0x00000000]),
+ FOLLOW_p_FTScoreVar_in_p_ForBinding3900: new org.antlr.runtime.BitSet([0x00000000, 0x20000000]),
+ FOLLOW_IN_in_p_ForBinding3905: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_ExprSingle_in_p_ForBinding3909: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_ALLOWING_in_p_AllowingEmpty3938: new org.antlr.runtime.BitSet([0x00000000, 0x00001000]),
+ FOLLOW_EMPTY_in_p_AllowingEmpty3944: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_AT_in_p_PositionalVar3974: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000020]),
+ FOLLOW_DOLLAR_in_p_PositionalVar3980: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000003,0x00408000, 0x00000000]),
+ FOLLOW_p_VarName_in_p_PositionalVar3984: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_LET_in_p_LetClause4014: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000001, 0x00000020]),
+ FOLLOW_p_LetBinding_in_p_LetClause4018: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00040000]),
+ FOLLOW_COMMA_in_p_LetClause4021: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000001, 0x00000020]),
+ FOLLOW_p_LetBinding_in_p_LetClause4023: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00040000]),
+ FOLLOW_DOLLAR_in_p_LetBinding4057: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000003,0x00408000, 0x00000000]),
+ FOLLOW_p_VarName_in_p_LetBinding4061: new org.antlr.runtime.BitSet([0x00080000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00002000]),
+ FOLLOW_p_TypeDeclaration_in_p_LetBinding4065: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00002000]),
+ FOLLOW_p_FTScoreVar_in_p_LetBinding4071: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00002000]),
+ FOLLOW_BIND_in_p_LetBinding4075: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_ExprSingle_in_p_LetBinding4077: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_FOR_in_p_WindowClause4106: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00002200, 0x00000000]),
+ FOLLOW_p_TumblingWindowClause_in_p_WindowClause4111: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_SlidingWindowClause_in_p_WindowClause4115: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_TUMBLING_in_p_TumblingWindowClause4152: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00010000, 0x00000000]),
+ FOLLOW_WINDOW_in_p_TumblingWindowClause4158: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000020]),
+ FOLLOW_DOLLAR_in_p_TumblingWindowClause4164: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000003,0x00408000, 0x00000000]),
+ FOLLOW_p_VarName_in_p_TumblingWindowClause4168: new org.antlr.runtime.BitSet([0x00080000, 0x20000000]),
+ FOLLOW_p_TypeDeclaration_in_p_TumblingWindowClause4172: new org.antlr.runtime.BitSet([0x00000000, 0x20000000]),
+ FOLLOW_IN_in_p_TumblingWindowClause4177: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_ExprSingle_in_p_TumblingWindowClause4181: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000400, 0x00000000]),
+ FOLLOW_p_WindowStartCondition_in_p_TumblingWindowClause4184: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x10000000,0x00000010, 0x00000000]),
+ FOLLOW_p_WindowEndCondition_in_p_TumblingWindowClause4186: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_SLIDING_in_p_SlidingWindowClause4215: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00010000, 0x00000000]),
+ FOLLOW_WINDOW_in_p_SlidingWindowClause4221: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000020]),
+ FOLLOW_DOLLAR_in_p_SlidingWindowClause4227: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000003,0x00408000, 0x00000000]),
+ FOLLOW_p_VarName_in_p_SlidingWindowClause4231: new org.antlr.runtime.BitSet([0x00080000, 0x20000000]),
+ FOLLOW_p_TypeDeclaration_in_p_SlidingWindowClause4235: new org.antlr.runtime.BitSet([0x00000000, 0x20000000]),
+ FOLLOW_IN_in_p_SlidingWindowClause4240: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_ExprSingle_in_p_SlidingWindowClause4244: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000400, 0x00000000]),
+ FOLLOW_p_WindowStartCondition_in_p_SlidingWindowClause4247: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x10000000,0x00000010, 0x00000000]),
+ FOLLOW_p_WindowEndCondition_in_p_SlidingWindowClause4249: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_START_in_p_WindowStartCondition4278: new org.antlr.runtime.BitSet([0x00200000, 0x00000000,0x00000000, 0x00000000,0x00008108, 0x00000000,0x00000000, 0x00000020]),
+ FOLLOW_p_WindowVars_in_p_WindowStartCondition4282: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00008000, 0x00000000]),
+ FOLLOW_WHEN_in_p_WindowStartCondition4286: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_ExprSingle_in_p_WindowStartCondition4290: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_ONLY_in_p_WindowEndCondition4320: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x10000000]),
+ FOLLOW_END_in_p_WindowEndCondition4328: new org.antlr.runtime.BitSet([0x00200000, 0x00000000,0x00000000, 0x00000000,0x00008108, 0x00000000,0x00000000, 0x00000020]),
+ FOLLOW_p_WindowVars_in_p_WindowEndCondition4332: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00008000, 0x00000000]),
+ FOLLOW_WHEN_in_p_WindowEndCondition4336: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_ExprSingle_in_p_WindowEndCondition4340: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_DOLLAR_in_p_WindowVars4370: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000003,0x00408000, 0x00000000]),
+ FOLLOW_p_CurrentItem_in_p_WindowVars4374: new org.antlr.runtime.BitSet([0x00200002, 0x00000000,0x00000000, 0x00000000,0x00000108, 0x00000000]),
+ FOLLOW_p_PositionalVar_in_p_WindowVars4380: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000000,0x00000108, 0x00000000]),
+ FOLLOW_PREVIOUS_in_p_WindowVars4386: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000020]),
+ FOLLOW_DOLLAR_in_p_WindowVars4390: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000003,0x00408000, 0x00000000]),
+ FOLLOW_p_PreviousItem_in_p_WindowVars4392: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000000,0x00000008, 0x00000000]),
+ FOLLOW_NEXT_in_p_WindowVars4399: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000020]),
+ FOLLOW_DOLLAR_in_p_WindowVars4403: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000003,0x00408000, 0x00000000]),
+ FOLLOW_p_NextItem_in_p_WindowVars4405: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_EQName_in_p_CurrentItem4433: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_EQName_in_p_PreviousItem4459: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_EQName_in_p_NextItem4485: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_COUNT_in_p_CountClause4513: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000020]),
+ FOLLOW_DOLLAR_in_p_CountClause4519: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000003,0x00408000, 0x00000000]),
+ FOLLOW_p_VarName_in_p_CountClause4523: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_WHERE_in_p_WhereClause4561: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_ExprSingle_in_p_WhereClause4565: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_GROUP_in_p_GroupByClause4594: new org.antlr.runtime.BitSet([0x02000000, 0x00000000]),
+ FOLLOW_BY_in_p_GroupByClause4600: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000020]),
+ FOLLOW_p_GroupingSpecList_in_p_GroupByClause4604: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_GroupingSpec_in_p_GroupingSpecList4630: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00040000]),
+ FOLLOW_COMMA_in_p_GroupingSpecList4633: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000020]),
+ FOLLOW_p_GroupingSpec_in_p_GroupingSpecList4635: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00040000]),
+ FOLLOW_p_GroupingVariable_in_p_GroupingSpec4663: new org.antlr.runtime.BitSet([0x40080002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00002000]),
+ FOLLOW_p_TypeDeclaration_in_p_GroupingSpec4666: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00002000]),
+ FOLLOW_BIND_in_p_GroupingSpec4669: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_ExprSingle_in_p_GroupingSpec4671: new org.antlr.runtime.BitSet([0x40000002, 0x00000000]),
+ FOLLOW_COLLATION_in_p_GroupingSpec4679: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x000C0000, 0x00000007]),
+ FOLLOW_p_StringLiteral_in_p_GroupingSpec4683: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_DOLLAR_in_p_GroupingVariable4712: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000003,0x00408000, 0x00000000]),
+ FOLLOW_p_VarName_in_p_GroupingVariable4716: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_ORDER_in_p_OrderByClause4748: new org.antlr.runtime.BitSet([0x02000000, 0x00000000]),
+ FOLLOW_BY_in_p_OrderByClause4752: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_STABLE_in_p_OrderByClause4760: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00080000, 0x00000000]),
+ FOLLOW_ORDER_in_p_OrderByClause4764: new org.antlr.runtime.BitSet([0x02000000, 0x00000000]),
+ FOLLOW_BY_in_p_OrderByClause4768: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_OrderSpecList_in_p_OrderByClause4774: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_OrderSpec_in_p_OrderSpecList4800: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00040000]),
+ FOLLOW_COMMA_in_p_OrderSpecList4803: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_OrderSpec_in_p_OrderSpecList4805: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00040000]),
+ FOLLOW_p_ExprSingle_in_p_OrderSpec4833: new org.antlr.runtime.BitSet([0x40100000, 0x00001040]),
+ FOLLOW_p_OrderModifier_in_p_OrderSpec4836: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_ASCENDING_in_p_OrderModifier4865: new org.antlr.runtime.BitSet([0x40000002, 0x00001000]),
+ FOLLOW_DESCENDING_in_p_OrderModifier4871: new org.antlr.runtime.BitSet([0x40000002, 0x00001000]),
+ FOLLOW_EMPTY_in_p_OrderModifier4878: new org.antlr.runtime.BitSet([0x00000000, 0x01000000,0x00000020, 0x00000000]),
+ FOLLOW_GREATEST_in_p_OrderModifier4883: new org.antlr.runtime.BitSet([0x40000002, 0x00000000]),
+ FOLLOW_LEAST_in_p_OrderModifier4889: new org.antlr.runtime.BitSet([0x40000002, 0x00000000]),
+ FOLLOW_COLLATION_in_p_OrderModifier4897: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x000C0000, 0x00000007]),
+ FOLLOW_p_StringLiteral_in_p_OrderModifier4899: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_RETURN_in_p_ReturnHybrid4932: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0856B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_Hybrid_in_p_ReturnHybrid4936: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_SOME_in_p_QuantifiedExpr4966: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000020]),
+ FOLLOW_EVERY_in_p_QuantifiedExpr4972: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000020]),
+ FOLLOW_DOLLAR_in_p_QuantifiedExpr4979: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000003,0x00408000, 0x00000000]),
+ FOLLOW_p_VarName_in_p_QuantifiedExpr4983: new org.antlr.runtime.BitSet([0x00080000, 0x20000000]),
+ FOLLOW_p_TypeDeclaration_in_p_QuantifiedExpr4987: new org.antlr.runtime.BitSet([0x00000000, 0x20000000]),
+ FOLLOW_IN_in_p_QuantifiedExpr4992: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_ExprSingle_in_p_QuantifiedExpr4996: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000001,0x00000000, 0x00000000,0x00000000, 0x00040000]),
+ FOLLOW_COMMA_in_p_QuantifiedExpr5000: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000020]),
+ FOLLOW_DOLLAR_in_p_QuantifiedExpr5004: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000003,0x00408000, 0x00000000]),
+ FOLLOW_p_EQName_in_p_QuantifiedExpr5008: new org.antlr.runtime.BitSet([0x00080000, 0x20000000]),
+ FOLLOW_p_TypeDeclaration_in_p_QuantifiedExpr5012: new org.antlr.runtime.BitSet([0x00000000, 0x20000000]),
+ FOLLOW_IN_in_p_QuantifiedExpr5017: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_ExprSingle_in_p_QuantifiedExpr5021: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000001,0x00000000, 0x00000000,0x00000000, 0x00040000]),
+ FOLLOW_SATISFIES_in_p_QuantifiedExpr5028: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_ExprSingle_in_p_QuantifiedExpr5032: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_SWITCH_in_p_SwitchHybrid5062: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000008]),
+ FOLLOW_LPAREN_in_p_SwitchHybrid5066: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_Expr_in_p_SwitchHybrid5068: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000010]),
+ FOLLOW_RPAREN_in_p_SwitchHybrid5071: new org.antlr.runtime.BitSet([0x04000000, 0x00000000]),
+ FOLLOW_p_SwitchCaseHybrid_in_p_SwitchHybrid5073: new org.antlr.runtime.BitSet([0x04000000, 0x00000008]),
+ FOLLOW_DEFAULT_in_p_SwitchHybrid5079: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x80000000, 0x00000000]),
+ FOLLOW_RETURN_in_p_SwitchHybrid5085: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0856B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_Hybrid_in_p_SwitchHybrid5089: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_CASE_in_p_SwitchCaseHybrid5120: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_SwitchCaseOperand_in_p_SwitchCaseHybrid5124: new org.antlr.runtime.BitSet([0x04000000, 0x00000000,0x80000000, 0x00000000]),
+ FOLLOW_RETURN_in_p_SwitchCaseHybrid5130: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0856B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_Hybrid_in_p_SwitchCaseHybrid5134: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_ExprSingle_in_p_SwitchCaseOperand5161: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_TYPESWITCH_in_p_TypeswitchHybrid5191: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000008]),
+ FOLLOW_LPAREN_in_p_TypeswitchHybrid5195: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_Expr_in_p_TypeswitchHybrid5197: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000010]),
+ FOLLOW_RPAREN_in_p_TypeswitchHybrid5200: new org.antlr.runtime.BitSet([0x04000000, 0x00000000]),
+ FOLLOW_p_CaseHybrid_in_p_TypeswitchHybrid5202: new org.antlr.runtime.BitSet([0x04000000, 0x00000008]),
+ FOLLOW_DEFAULT_in_p_TypeswitchHybrid5208: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x80000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000020]),
+ FOLLOW_DOLLAR_in_p_TypeswitchHybrid5215: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000003,0x00408000, 0x00000000]),
+ FOLLOW_p_VarName_in_p_TypeswitchHybrid5219: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x80000000, 0x00000000]),
+ FOLLOW_RETURN_in_p_TypeswitchHybrid5227: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0856B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_Hybrid_in_p_TypeswitchHybrid5231: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_CASE_in_p_CaseHybrid5261: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x0000802B,0x00408000, 0x00000000]),
+ FOLLOW_DOLLAR_in_p_CaseHybrid5268: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000003,0x00408000, 0x00000000]),
+ FOLLOW_p_VarName_in_p_CaseHybrid5272: new org.antlr.runtime.BitSet([0x00080000, 0x00000000]),
+ FOLLOW_AS_in_p_CaseHybrid5278: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x0000802B,0x00408000, 0x00000000]),
+ FOLLOW_p_SequenceTypeUnion_in_p_CaseHybrid5284: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x80000000, 0x00000000]),
+ FOLLOW_RETURN_in_p_CaseHybrid5288: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_ExprSingle_in_p_CaseHybrid5292: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_SequenceType_in_p_SequenceTypeUnion5319: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000080, 0x00000000]),
+ FOLLOW_VBAR_in_p_SequenceTypeUnion5322: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x0000800B,0x00408000, 0x00000000]),
+ FOLLOW_p_SequenceType_in_p_SequenceTypeUnion5324: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000080, 0x00000000]),
+ FOLLOW_IF_in_p_IfHybrid5355: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000008]),
+ FOLLOW_LPAREN_in_p_IfHybrid5359: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_Expr_in_p_IfHybrid5361: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000010]),
+ FOLLOW_RPAREN_in_p_IfHybrid5364: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000400]),
+ FOLLOW_THEN_in_p_IfHybrid5368: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0856B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_Hybrid_in_p_IfHybrid5372: new org.antlr.runtime.BitSet([0x00000000, 0x00000800]),
+ FOLLOW_ELSE_in_p_IfHybrid5377: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0856B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_Hybrid_in_p_IfHybrid5381: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_TryClause_in_p_TryCatchExpr5408: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00400000]),
+ FOLLOW_p_CatchClause_in_p_TryCatchExpr5410: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00400000]),
+ FOLLOW_TRY_in_p_TryClause5439: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000100]),
+ FOLLOW_LBRACKET_in_p_TryClause5443: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_TryTargetExpr_in_p_TryClause5445: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000200]),
+ FOLLOW_RBRACKET_in_p_TryClause5447: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_Expr_in_p_TryTargetExpr5473: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_CATCH_in_p_CatchClause5502: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00100003,0x0040C002, 0x00000000]),
+ FOLLOW_p_CatchErrorList_in_p_CatchClause5506: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000100]),
+ FOLLOW_LBRACKET_in_p_CatchClause5508: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_Expr_in_p_CatchClause5510: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000200]),
+ FOLLOW_RBRACKET_in_p_CatchClause5513: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_NameTest_in_p_CatchErrorList5539: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000080, 0x00000000]),
+ FOLLOW_VBAR_in_p_CatchErrorList5542: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00100003,0x0040C002, 0x00000000]),
+ FOLLOW_p_NameTest_in_p_CatchErrorList5544: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000080, 0x00000000]),
+ FOLLOW_p_AndExpr_in_p_OrExpr5572: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00040000, 0x00000000]),
+ FOLLOW_OR_in_p_OrExpr5578: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_AndExpr_in_p_OrExpr5582: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00040000, 0x00000000]),
+ FOLLOW_p_ComparisonExpr_in_p_AndExpr5611: new org.antlr.runtime.BitSet([0x00040002, 0x00000000]),
+ FOLLOW_AND_in_p_AndExpr5617: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_ComparisonExpr_in_p_AndExpr5621: new org.antlr.runtime.BitSet([0x00040002, 0x00000000]),
+ FOLLOW_p_FTContainsExpr_in_p_ComparisonExpr5651: new org.antlr.runtime.BitSet([0x00000002, 0x02808000,0x00000892, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x1F805000]),
+ FOLLOW_p_ValueComp_in_p_ComparisonExpr5656: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_GeneralComp_in_p_ComparisonExpr5660: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_NodeComp_in_p_ComparisonExpr5664: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_FTContainsExpr_in_p_ComparisonExpr5667: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_AdditiveExpr_in_p_RangeExpr5696: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000800]),
+ FOLLOW_TO_in_p_RangeExpr5702: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_AdditiveExpr_in_p_RangeExpr5706: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_MultiplicativeExpr_in_p_AdditiveExpr5735: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00600000]),
+ FOLLOW_PLUS_in_p_AdditiveExpr5742: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_MINUS_in_p_AdditiveExpr5750: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_MultiplicativeExpr_in_p_AdditiveExpr5755: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00600000]),
+ FOLLOW_p_UnionExpr_in_p_MultiplicativeExpr5784: new org.antlr.runtime.BitSet([0x00000002, 0x04000080,0x00000100, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00100000]),
+ FOLLOW_STAR_in_p_MultiplicativeExpr5791: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_DIV_in_p_MultiplicativeExpr5800: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_IDIV_in_p_MultiplicativeExpr5806: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_MOD_in_p_MultiplicativeExpr5812: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_UnionExpr_in_p_MultiplicativeExpr5818: new org.antlr.runtime.BitSet([0x00000002, 0x04000080,0x00000100, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00100000]),
+ FOLLOW_p_IntersectExceptExpr_in_p_UnionExpr5847: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00004000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000080, 0x00000000]),
+ FOLLOW_UNION_in_p_UnionExpr5854: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_VBAR_in_p_UnionExpr5860: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_IntersectExceptExpr_in_p_UnionExpr5863: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00004000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000080, 0x00000000]),
+ FOLLOW_p_InstanceofExpr_in_p_IntersectExceptExpr5892: new org.antlr.runtime.BitSet([0x00000002, 0x00020000,0x00000001, 0x00000000]),
+ FOLLOW_INTERSECT_in_p_IntersectExceptExpr5899: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_EXCEPT_in_p_IntersectExceptExpr5905: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_InstanceofExpr_in_p_IntersectExceptExpr5910: new org.antlr.runtime.BitSet([0x00000002, 0x00020000,0x00000001, 0x00000000]),
+ FOLLOW_p_TreatExpr_in_p_InstanceofExpr5939: new org.antlr.runtime.BitSet([0x00000002, 0x80000000]),
+ FOLLOW_INSTANCE_in_p_InstanceofExpr5945: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00010000, 0x00000000]),
+ FOLLOW_OF_in_p_InstanceofExpr5951: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x0000800B,0x00408000, 0x00000000]),
+ FOLLOW_p_SequenceType_in_p_InstanceofExpr5955: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_CastableExpr_in_p_TreatExpr5983: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00001000]),
+ FOLLOW_TREAT_in_p_TreatExpr5989: new org.antlr.runtime.BitSet([0x00080000, 0x00000000]),
+ FOLLOW_AS_in_p_TreatExpr5995: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x0000800B,0x00408000, 0x00000000]),
+ FOLLOW_p_SequenceType_in_p_TreatExpr5999: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_CastExpr_in_p_CastableExpr6036: new org.antlr.runtime.BitSet([0x10000002, 0x00000000]),
+ FOLLOW_CASTABLE_in_p_CastableExpr6042: new org.antlr.runtime.BitSet([0x00080000, 0x00000000]),
+ FOLLOW_AS_in_p_CastableExpr6048: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000003,0x00408000, 0x00000000]),
+ FOLLOW_p_SingleType_in_p_CastableExpr6052: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_UnaryExpr_in_p_CastExpr6089: new org.antlr.runtime.BitSet([0x08000002, 0x00000000]),
+ FOLLOW_CAST_in_p_CastExpr6095: new org.antlr.runtime.BitSet([0x00080000, 0x00000000]),
+ FOLLOW_AS_in_p_CastExpr6101: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000003,0x00408000, 0x00000000]),
+ FOLLOW_p_SingleType_in_p_CastExpr6105: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_PLUS_in_p_UnaryExpr6137: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_MINUS_in_p_UnaryExpr6145: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_ValueExpr_in_p_UnaryExpr6150: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_ValidateExpr_in_p_ValueExpr6220: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_SimpleMapExpr_in_p_ValueExpr6232: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_ExtensionExpr_in_p_ValueExpr6244: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_PathExpr_in_p_SimpleMapExpr6269: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x80000000]),
+ FOLLOW_BANG_in_p_SimpleMapExpr6272: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x6090056B,0xC04CC003, 0x00000007]),
+ FOLLOW_p_PathExpr_in_p_SimpleMapExpr6274: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x80000000]),
+ FOLLOW_EQUAL_in_p_GeneralComp6305: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_NOTEQUAL_in_p_GeneralComp6311: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_SMALLER_in_p_GeneralComp6317: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_SMALLEREQ_in_p_GeneralComp6323: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_GREATER_in_p_GeneralComp6329: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_GREATEREQ_in_p_GeneralComp6335: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_EQ_in_p_ValueComp6367: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_NE_in_p_ValueComp6373: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_LT_in_p_ValueComp6379: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_LE_in_p_ValueComp6385: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_GT_in_p_ValueComp6391: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_GE_in_p_ValueComp6397: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_IS_in_p_NodeComp6428: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_SMALLER_SMALLER_in_p_NodeComp6434: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_GREATER_GREATER_in_p_NodeComp6438: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_VALIDATE_in_p_ValidateExpr6466: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000008, 0x00000080,0x00004000, 0x00000000,0x00000000, 0x00000100]),
+ FOLLOW_p_ValidationMode_in_p_ValidateExpr6472: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000100]),
+ FOLLOW_TYPE_in_p_ValidateExpr6478: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000003,0x00408000, 0x00000000]),
+ FOLLOW_p_TypeName_in_p_ValidateExpr6482: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000100]),
+ FOLLOW_LBRACKET_in_p_ValidateExpr6487: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_Expr_in_p_ValidateExpr6489: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000200]),
+ FOLLOW_RBRACKET_in_p_ValidateExpr6492: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_LAX_in_p_ValidationMode6521: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_STRICT_in_p_ValidationMode6527: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_L_Pragma_in_p_ExtensionExpr6556: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000100,0x20000000, 0x00000000]),
+ FOLLOW_LBRACKET_in_p_ExtensionExpr6559: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0076B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_Expr_in_p_ExtensionExpr6561: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000200]),
+ FOLLOW_RBRACKET_in_p_ExtensionExpr6565: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_SLASH_in_p_PathExpr6608: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x6090056B,0xC04CC003, 0x00000007]),
+ FOLLOW_p_RelativePathExpr_in_p_PathExpr6610: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_SLASH_in_p_PathExpr6623: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_SLASH_SLASH_in_p_PathExpr6635: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x6090056B,0xC04CC003, 0x00000007]),
+ FOLLOW_p_RelativePathExpr_in_p_PathExpr6637: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_RelativePathExpr_in_p_PathExpr6649: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_StepExpr_in_p_RelativePathExpr6677: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x60000000]),
+ FOLLOW_set_in_p_RelativePathExpr6680: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x6090056B,0xC04CC003, 0x00000007]),
+ FOLLOW_p_StepExpr_in_p_RelativePathExpr6688: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x60000000]),
+ FOLLOW_p_PostfixExpr_in_p_StepExpr6742: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_PostfixExpr_in_p_StepExpr6856: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_AxisStep_in_p_StepExpr6874: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_PostfixExpr_in_p_StepExpr6895: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_PostfixExpr_in_p_StepExpr6913: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_AxisStep_in_p_StepExpr6925: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_ReverseStep_in_p_AxisStep6952: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000400]),
+ FOLLOW_p_ForwardStep_in_p_AxisStep6956: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000400]),
+ FOLLOW_p_PredicateList_in_p_AxisStep6959: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_ForwardAxis_in_p_ForwardStep6985: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00100003,0x0040C002, 0x00000000]),
+ FOLLOW_p_NodeTest_in_p_ForwardStep6987: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_AbbrevForwardStep_in_p_ForwardStep6999: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_CHILD_in_p_ForwardAxis7025: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000008, 0x00000000]),
+ FOLLOW_COLON_COLON_in_p_ForwardAxis7027: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_DESCENDANT_in_p_ForwardAxis7039: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000008, 0x00000000]),
+ FOLLOW_COLON_COLON_in_p_ForwardAxis7041: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_ATTRIBUTE_in_p_ForwardAxis7053: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000008, 0x00000000]),
+ FOLLOW_COLON_COLON_in_p_ForwardAxis7055: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_SELF_in_p_ForwardAxis7067: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000008, 0x00000000]),
+ FOLLOW_COLON_COLON_in_p_ForwardAxis7069: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_DESCENDANT_OR_SELF_in_p_ForwardAxis7081: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000008, 0x00000000]),
+ FOLLOW_COLON_COLON_in_p_ForwardAxis7083: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_FOLLOWING_SIBLING_in_p_ForwardAxis7095: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000008, 0x00000000]),
+ FOLLOW_COLON_COLON_in_p_ForwardAxis7097: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_FOLLOWING_in_p_ForwardAxis7109: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000008, 0x00000000]),
+ FOLLOW_COLON_COLON_in_p_ForwardAxis7111: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_ATTR_SIGN_in_p_AbbrevForwardStep7137: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00100003,0x0040C002, 0x00000000]),
+ FOLLOW_p_NodeTest_in_p_AbbrevForwardStep7140: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_ReverseAxis_in_p_ReverseStep7166: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00100003,0x0040C002, 0x00000000]),
+ FOLLOW_p_NodeTest_in_p_ReverseStep7168: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_AbbrevReverseStep_in_p_ReverseStep7180: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_PARENT_in_p_ReverseAxis7206: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000008, 0x00000000]),
+ FOLLOW_COLON_COLON_in_p_ReverseAxis7208: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_ANCESTOR_in_p_ReverseAxis7220: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000008, 0x00000000]),
+ FOLLOW_COLON_COLON_in_p_ReverseAxis7222: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_PRECEDING_SIBLING_in_p_ReverseAxis7234: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000008, 0x00000000]),
+ FOLLOW_COLON_COLON_in_p_ReverseAxis7236: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_PRECEDING_in_p_ReverseAxis7248: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000008, 0x00000000]),
+ FOLLOW_COLON_COLON_in_p_ReverseAxis7250: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_ANCESTOR_OR_SELF_in_p_ReverseAxis7262: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000008, 0x00000000]),
+ FOLLOW_COLON_COLON_in_p_ReverseAxis7264: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_DOT_DOT_in_p_AbbrevReverseStep7290: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_KindTest_in_p_NodeTest7316: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_NameTest_in_p_NodeTest7320: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_EQName_in_p_NameTest7346: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_Wildcard_in_p_NameTest7350: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_STAR_in_p_Wildcard7383: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000004, 0x00000000]),
+ FOLLOW_COLON_in_p_Wildcard7386: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000003,0x00400000, 0x00000000]),
+ FOLLOW_p_NCName_in_p_Wildcard7388: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_NCName_in_p_Wildcard7402: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000004, 0x00000000]),
+ FOLLOW_COLON_in_p_Wildcard7404: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00100000]),
+ FOLLOW_STAR_in_p_Wildcard7406: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_BracedURILiteral_in_p_Wildcard7418: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00100000]),
+ FOLLOW_STAR_in_p_Wildcard7420: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_PrimaryExpr_in_p_PostfixExpr7458: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000408]),
+ FOLLOW_p_Predicate_in_p_PostfixExpr7461: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000408]),
+ FOLLOW_p_ArgumentList_in_p_PostfixExpr7465: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000408]),
+ FOLLOW_LPAREN_in_p_ArgumentList7493: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F8057B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_Argument_in_p_ArgumentList7496: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00040010]),
+ FOLLOW_COMMA_in_p_ArgumentList7499: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F8056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_Argument_in_p_ArgumentList7501: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00040010]),
+ FOLLOW_RPAREN_in_p_ArgumentList7507: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_Predicate_in_p_PredicateList7533: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000400]),
+ FOLLOW_LSQUARE_in_p_Predicate7560: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_Expr_in_p_Predicate7562: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000800]),
+ FOLLOW_RSQUARE_in_p_Predicate7565: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_ParenthesizedExpr_in_p_PrimaryExpr7598: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_Literal_in_p_PrimaryExpr7610: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_VarRef_in_p_PrimaryExpr7622: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_ContextItemExpr_in_p_PrimaryExpr7634: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_FunctionCall_in_p_PrimaryExpr7646: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_OrderedExpr_in_p_PrimaryExpr7659: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_UnorderedExpr_in_p_PrimaryExpr7671: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_Constructor_in_p_PrimaryExpr7683: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_BlockExpr_in_p_PrimaryExpr7696: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_FunctionItemExpr_in_p_PrimaryExpr7708: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_ArrayConstructor_in_p_PrimaryExpr7721: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_SimpleObjectUnion_in_p_PrimaryExpr7733: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_L_UNION_BRACKET_in_p_SimpleObjectUnion7769: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F005EB,0xE04CC003, 0x00000007]),
+ FOLLOW_p_Expr_in_p_SimpleObjectUnion7771: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000080]),
+ FOLLOW_R_UNION_BRACKET_in_p_SimpleObjectUnion7775: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_COLON_in_p_PairConstructor7817: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_ExprSingle_in_p_PairConstructor7819: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00040000]),
+ FOLLOW_COMMA_in_p_PairConstructor7823: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0856B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_Hybrid_in_p_PairConstructor7825: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00040000]),
+ FOLLOW_LSQUARE_in_p_ArrayConstructor7856: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F00D6B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_Expr_in_p_ArrayConstructor7858: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000800]),
+ FOLLOW_RSQUARE_in_p_ArrayConstructor7862: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_NumericLiteral_in_p_Literal7888: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_StringLiteral_in_p_Literal7892: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_L_IntegerLiteral_in_p_NumericLiteral7920: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_L_DecimalLiteral_in_p_NumericLiteral7928: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_L_DoubleLiteral_in_p_NumericLiteral7936: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_DOLLAR_in_p_VarRef7974: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000003,0x00408000, 0x00000000]),
+ FOLLOW_p_VarName_in_p_VarRef7978: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_EQName_in_p_VarName8006: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_LPAREN_in_p_ParenthesizedExpr8032: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0057B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_Expr_in_p_ParenthesizedExpr8034: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000010]),
+ FOLLOW_RPAREN_in_p_ParenthesizedExpr8038: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_DOT_in_p_ContextItemExpr8064: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_ORDERED_in_p_OrderedExpr8092: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000100]),
+ FOLLOW_LBRACKET_in_p_OrderedExpr8096: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_Expr_in_p_OrderedExpr8098: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000200]),
+ FOLLOW_RBRACKET_in_p_OrderedExpr8101: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_UNORDERED_in_p_UnorderedExpr8129: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000100]),
+ FOLLOW_LBRACKET_in_p_UnorderedExpr8133: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_Expr_in_p_UnorderedExpr8135: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000200]),
+ FOLLOW_RBRACKET_in_p_UnorderedExpr8138: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_pg_FQName_in_p_FunctionCall8167: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000408]),
+ FOLLOW_p_ArgumentList_in_p_FunctionCall8172: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_ExprSingle_in_p_Argument8198: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_ArgumentPlaceholder_in_p_Argument8203: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_QUESTION_in_p_ArgumentPlaceholder8229: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_DirectConstructor_in_p_Constructor8255: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_ComputedConstructor_in_p_Constructor8267: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_DirElemConstructor_in_p_DirectConstructor8293: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_DirCommentConstructor_in_p_DirectConstructor8305: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_DirPIConstructor_in_p_DirectConstructor8317: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_SMALLER_in_p_DirElemConstructor8344: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000003,0x00400000, 0x00000000]),
+ FOLLOW_p_QName_in_p_DirElemConstructor8360: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x01000000,0x08000010, 0x00000000]),
+ FOLLOW_p_DirAttributeList_in_p_DirElemConstructor8365: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x01000000,0x00000010, 0x00000000]),
+ FOLLOW_EMPTY_CLOSE_TAG_in_p_DirElemConstructor8379: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_GREATER_in_p_DirElemConstructor8384: new org.antlr.runtime.BitSet([0x00000FC0, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00800100,0xC0000020, 0x00000000]),
+ FOLLOW_pm_DirElemContent_in_p_DirElemConstructor8386: new org.antlr.runtime.BitSet([0x00000FC0, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00800100,0xC0000020, 0x00000000]),
+ FOLLOW_CLOSE_TAG_in_p_DirElemConstructor8389: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000003,0x00400000, 0x00000000]),
+ FOLLOW_p_QName_in_p_DirElemConstructor8393: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x01000000,0x08000000, 0x00000000]),
+ FOLLOW_S_in_p_DirElemConstructor8397: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x01000000]),
+ FOLLOW_GREATER_in_p_DirElemConstructor8400: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_S_in_p_DirAttributeList8477: new org.antlr.runtime.BitSet([0xFFFF0002, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000003,0x08400000, 0x00000000]),
+ FOLLOW_p_QName_in_p_DirAttributeList8482: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00001000,0x08000000, 0x00000000]),
+ FOLLOW_S_in_p_DirAttributeList8486: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00001000]),
+ FOLLOW_EQUAL_in_p_DirAttributeList8489: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x080C0000, 0x00000000]),
+ FOLLOW_S_in_p_DirAttributeList8491: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x080C0000, 0x00000000]),
+ FOLLOW_p_DirAttributeValue_in_p_DirAttributeList8496: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x08000000, 0x00000000]),
+ FOLLOW_QUOT_in_p_DirAttributeValue8530: new org.antlr.runtime.BitSet([0x00002F10, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000100,0x000C0000, 0x00000000]),
+ FOLLOW_ESCAPE_QUOT_in_p_DirAttributeValue8537: new org.antlr.runtime.BitSet([0x00002F10, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000100,0x000C0000, 0x00000000]),
+ FOLLOW_APOS_in_p_DirAttributeValue8543: new org.antlr.runtime.BitSet([0x00002F10, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000100,0x000C0000, 0x00000000]),
+ FOLLOW_p_QuotAttrValueContent_in_p_DirAttributeValue8547: new org.antlr.runtime.BitSet([0x00002F10, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000100,0x000C0000, 0x00000000]),
+ FOLLOW_QUOT_in_p_DirAttributeValue8553: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_APOS_in_p_DirAttributeValue8598: new org.antlr.runtime.BitSet([0x00001F20, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000100,0x000C0000, 0x00000000]),
+ FOLLOW_ESCAPE_APOS_in_p_DirAttributeValue8605: new org.antlr.runtime.BitSet([0x00001F20, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000100,0x000C0000, 0x00000000]),
+ FOLLOW_QUOT_in_p_DirAttributeValue8611: new org.antlr.runtime.BitSet([0x00001F20, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000100,0x000C0000, 0x00000000]),
+ FOLLOW_p_AposAttrValueContent_in_p_DirAttributeValue8615: new org.antlr.runtime.BitSet([0x00001F20, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000100,0x000C0000, 0x00000000]),
+ FOLLOW_APOS_in_p_DirAttributeValue8621: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_QuotAttrContentChar_in_p_QuotAttrValueContent8679: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_pm_CommonContent_in_p_QuotAttrValueContent8685: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_AposAttrContentChar_in_p_AposAttrValueContent8713: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_pm_CommonContent_in_p_AposAttrValueContent8719: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_DirectConstructor_in_pm_DirElemContent8745: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_CDataSection_in_pm_DirElemContent8757: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_pm_CommonContent_in_pm_DirElemContent8769: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_ElementContentChar_in_pm_DirElemContent8781: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_L_PredefinedEntityRef_in_pm_CommonContent8809: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_L_CharRef_in_pm_CommonContent8821: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_ESCAPE_LBRACKET_in_pm_CommonContent8835: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_ESCAPE_RBRACKET_in_pm_CommonContent8851: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_pg_EnclosedExprXml_in_pm_CommonContent8865: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_LBRACKET_in_pg_EnclosedExprXml8897: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0856B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_StatementsAndOptionalExpr_in_pg_EnclosedExprXml8913: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000200]),
+ FOLLOW_RBRACKET_in_pg_EnclosedExprXml8927: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_L_DirCommentConstructor_in_p_DirCommentConstructor8958: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_L_DirPIConstructor_in_p_DirPIConstructor8994: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_L_CDataSection_in_p_CDataSection9031: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_pm_CompDocConstructor_in_p_ComputedConstructor9065: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_pm_CompElemConstructor_in_p_ComputedConstructor9077: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_pm_CompAttrConstructor_in_p_ComputedConstructor9089: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_CompNamespaceConstructor_in_p_ComputedConstructor9101: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_CompTextConstructor_in_p_ComputedConstructor9113: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_pm_CompCommentConstructor_in_p_ComputedConstructor9125: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_pm_CompPIConstructor_in_p_ComputedConstructor9137: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_DOCUMENT_in_pm_CompDocConstructor9166: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000100]),
+ FOLLOW_LBRACKET_in_pm_CompDocConstructor9170: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0856B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_StatementsAndOptionalExpr_in_pm_CompDocConstructor9172: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000200]),
+ FOLLOW_RBRACKET_in_pm_CompDocConstructor9174: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_ELEMENT_in_pm_CompElemConstructor9210: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000103,0x00408000, 0x00000000]),
+ FOLLOW_p_EQName_in_pm_CompElemConstructor9215: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000100]),
+ FOLLOW_LBRACKET_in_pm_CompElemConstructor9220: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_Expr_in_pm_CompElemConstructor9222: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000200]),
+ FOLLOW_RBRACKET_in_pm_CompElemConstructor9225: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000100]),
+ FOLLOW_LBRACKET_in_pm_CompElemConstructor9229: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0856B,0xE04CC003, 0x00000007]),
+ FOLLOW_pm_ContentExpr_in_pm_CompElemConstructor9231: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000200]),
+ FOLLOW_RBRACKET_in_pm_CompElemConstructor9233: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_StatementsAndOptionalExpr_in_pm_ContentExpr9260: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_ATTRIBUTE_in_pm_CompAttrConstructor9289: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000103,0x00408000, 0x00000000]),
+ FOLLOW_p_EQName_in_pm_CompAttrConstructor9294: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000100]),
+ FOLLOW_LBRACKET_in_pm_CompAttrConstructor9299: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_Expr_in_pm_CompAttrConstructor9301: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000200]),
+ FOLLOW_RBRACKET_in_pm_CompAttrConstructor9304: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000100]),
+ FOLLOW_LBRACKET_in_pm_CompAttrConstructor9308: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0856B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_StatementsAndOptionalExpr_in_pm_CompAttrConstructor9310: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000200]),
+ FOLLOW_RBRACKET_in_pm_CompAttrConstructor9312: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_NAMESPACE_in_p_CompNamespaceConstructor9340: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000103,0x00400000, 0x00000000]),
+ FOLLOW_p_Prefix_in_p_CompNamespaceConstructor9345: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000100]),
+ FOLLOW_LBRACKET_in_p_CompNamespaceConstructor9350: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_PrefixExpr_in_p_CompNamespaceConstructor9352: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000200]),
+ FOLLOW_RBRACKET_in_p_CompNamespaceConstructor9354: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000100]),
+ FOLLOW_LBRACKET_in_p_CompNamespaceConstructor9358: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0076B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_URIExpr_in_p_CompNamespaceConstructor9360: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000200]),
+ FOLLOW_RBRACKET_in_p_CompNamespaceConstructor9363: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_NCName_in_p_Prefix9389: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_Expr_in_p_PrefixExpr9415: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_Expr_in_p_URIExpr9442: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_TEXT_in_p_CompTextConstructor9471: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000100]),
+ FOLLOW_LBRACKET_in_p_CompTextConstructor9475: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_Expr_in_p_CompTextConstructor9477: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000200]),
+ FOLLOW_RBRACKET_in_p_CompTextConstructor9480: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_COMMENT_in_pm_CompCommentConstructor9509: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000100]),
+ FOLLOW_LBRACKET_in_pm_CompCommentConstructor9513: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0856B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_StatementsAndOptionalExpr_in_pm_CompCommentConstructor9515: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000200]),
+ FOLLOW_RBRACKET_in_pm_CompCommentConstructor9517: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_PROCESSING_INSTRUCTION_in_pm_CompPIConstructor9546: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000103,0x00400000, 0x00000000]),
+ FOLLOW_p_NCName_in_pm_CompPIConstructor9551: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000100]),
+ FOLLOW_LBRACKET_in_pm_CompPIConstructor9556: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_Expr_in_pm_CompPIConstructor9558: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000200]),
+ FOLLOW_RBRACKET_in_pm_CompPIConstructor9561: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000100]),
+ FOLLOW_LBRACKET_in_pm_CompPIConstructor9565: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0856B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_StatementsAndOptionalExpr_in_pm_CompPIConstructor9567: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000200]),
+ FOLLOW_RBRACKET_in_pm_CompPIConstructor9569: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_LiteralFunctionItem_in_p_FunctionItemExpr9595: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_EQName_in_p_LiteralFunctionItem9622: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00010000]),
+ FOLLOW_HASH_in_p_LiteralFunctionItem9624: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000001]),
+ FOLLOW_L_IntegerLiteral_in_p_LiteralFunctionItem9626: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_Annotation_in_p_InlineFunction9661: new org.antlr.runtime.BitSet([0x00000000, 0x00400000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00008000]),
+ FOLLOW_FUNCTION_in_p_InlineFunction9666: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000008]),
+ FOLLOW_LPAREN_in_p_InlineFunction9670: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000030]),
+ FOLLOW_p_ParamList_in_p_InlineFunction9672: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000010]),
+ FOLLOW_RPAREN_in_p_InlineFunction9675: new org.antlr.runtime.BitSet([0x00080000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000100]),
+ FOLLOW_AS_in_p_InlineFunction9680: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x0000800B,0x00408000, 0x00000000]),
+ FOLLOW_p_SequenceType_in_p_InlineFunction9684: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000100]),
+ FOLLOW_LBRACKET_in_p_InlineFunction9688: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0856B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_StatementsAndOptionalExpr_in_p_InlineFunction9690: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000200]),
+ FOLLOW_RBRACKET_in_p_InlineFunction9692: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_AtomicOrUnionType_in_p_SingleType9718: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00080000]),
+ FOLLOW_QUESTION_in_p_SingleType9720: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_AS_in_p_TypeDeclaration9749: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x0000800B,0x00408000, 0x00000000]),
+ FOLLOW_p_SequenceType_in_p_TypeDeclaration9755: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_EMPTY_SEQUENCE_in_p_SequenceType9808: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000008]),
+ FOLLOW_LPAREN_in_p_SequenceType9814: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000010]),
+ FOLLOW_RPAREN_in_p_SequenceType9818: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_ItemType_in_p_SequenceType9867: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00380000]),
+ FOLLOW_p_OccurrenceIndicator_in_p_SequenceType9878: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_set_in_p_OccurrenceIndicator0: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_KindTest_in_p_ItemType9980: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_ITEM_in_p_ItemType10017: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000008]),
+ FOLLOW_LPAREN_in_p_ItemType10019: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000010]),
+ FOLLOW_RPAREN_in_p_ItemType10021: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_FunctionTest_in_p_ItemType10062: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_AtomicOrUnionType_in_p_ItemType10098: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_ParenthesizedItemType_in_p_ItemType10110: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_JSONTest_in_p_ItemType10122: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_StructuredItemTest_in_p_ItemType10134: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_JSONItemTest_in_p_JSONTest10159: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_JSONObjectTest_in_p_JSONTest10171: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_JSONArrayTest_in_p_JSONTest10183: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_STRUCTURED_ITEM_in_p_StructuredItemTest10208: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000008]),
+ FOLLOW_LPAREN_in_p_StructuredItemTest10210: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000010]),
+ FOLLOW_RPAREN_in_p_StructuredItemTest10212: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_JSON_ITEM_in_p_JSONItemTest10237: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000008]),
+ FOLLOW_LPAREN_in_p_JSONItemTest10239: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000010]),
+ FOLLOW_RPAREN_in_p_JSONItemTest10241: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_OBJECT_in_p_JSONObjectTest10266: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000008]),
+ FOLLOW_LPAREN_in_p_JSONObjectTest10268: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000010]),
+ FOLLOW_RPAREN_in_p_JSONObjectTest10270: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_ARRAY_in_p_JSONArrayTest10295: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000008]),
+ FOLLOW_LPAREN_in_p_JSONArrayTest10297: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000010]),
+ FOLLOW_RPAREN_in_p_JSONArrayTest10299: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_EQName_in_p_AtomicOrUnionType10325: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_DocumentTest_in_p_KindTest10375: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_ElementTest_in_p_KindTest10387: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_AttributeTest_in_p_KindTest10399: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_SchemaElementTest_in_p_KindTest10411: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_SchemaAttributeTest_in_p_KindTest10423: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_PITest_in_p_KindTest10435: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_CommentTest_in_p_KindTest10447: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_TextTest_in_p_KindTest10459: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_NamespaceNodeTest_in_p_KindTest10471: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_AnyKindTest_in_p_KindTest10483: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_NODE_in_p_AnyKindTest10509: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000008]),
+ FOLLOW_LPAREN_in_p_AnyKindTest10511: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000010]),
+ FOLLOW_RPAREN_in_p_AnyKindTest10513: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_DOCUMENT_NODE_in_p_DocumentTest10539: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000008]),
+ FOLLOW_LPAREN_in_p_DocumentTest10541: new org.antlr.runtime.BitSet([0x00000000, 0x00000400,0x00000000, 0x00000008,0x00000000, 0x00000000,0x00000000, 0x00000010]),
+ FOLLOW_p_ElementTest_in_p_DocumentTest10544: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000010]),
+ FOLLOW_p_SchemaElementTest_in_p_DocumentTest10548: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000010]),
+ FOLLOW_RPAREN_in_p_DocumentTest10552: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_TEXT_in_p_TextTest10578: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000008]),
+ FOLLOW_LPAREN_in_p_TextTest10580: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000010]),
+ FOLLOW_RPAREN_in_p_TextTest10582: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_COMMENT_in_p_CommentTest10608: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000008]),
+ FOLLOW_LPAREN_in_p_CommentTest10610: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000010]),
+ FOLLOW_RPAREN_in_p_CommentTest10612: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_NAMESPACE_NODE_in_p_NamespaceNodeTest10638: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000008]),
+ FOLLOW_LPAREN_in_p_NamespaceNodeTest10640: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000010]),
+ FOLLOW_RPAREN_in_p_NamespaceNodeTest10642: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_PROCESSING_INSTRUCTION_in_p_PITest10668: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000008]),
+ FOLLOW_LPAREN_in_p_PITest10670: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000013,0x004C0000, 0x00000007]),
+ FOLLOW_p_NCName_in_p_PITest10673: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000010]),
+ FOLLOW_p_StringLiteral_in_p_PITest10677: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000010]),
+ FOLLOW_RPAREN_in_p_PITest10681: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_ATTRIBUTE_in_p_AttributeTest10707: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000008]),
+ FOLLOW_LPAREN_in_p_AttributeTest10709: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00100013,0x00408000, 0x00000000]),
+ FOLLOW_p_AttribNameOrWildcard_in_p_AttributeTest10712: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00040010]),
+ FOLLOW_COMMA_in_p_AttributeTest10715: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000003,0x00408000, 0x00000000]),
+ FOLLOW_p_TypeName_in_p_AttributeTest10717: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000010]),
+ FOLLOW_RPAREN_in_p_AttributeTest10723: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_AttributeName_in_p_AttribNameOrWildcard10751: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_STAR_in_p_AttribNameOrWildcard10755: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_SCHEMA_ATTRIBUTE_in_p_SchemaAttributeTest10781: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000008]),
+ FOLLOW_LPAREN_in_p_SchemaAttributeTest10783: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000003,0x00408000, 0x00000000]),
+ FOLLOW_p_AttributeDeclaration_in_p_SchemaAttributeTest10785: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000010]),
+ FOLLOW_RPAREN_in_p_SchemaAttributeTest10787: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_AttributeName_in_p_AttributeDeclaration10813: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_ELEMENT_in_p_ElementTest10839: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000008]),
+ FOLLOW_LPAREN_in_p_ElementTest10841: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00100013,0x00408000, 0x00000000]),
+ FOLLOW_p_ElementNameOrWildcard_in_p_ElementTest10844: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00040010]),
+ FOLLOW_COMMA_in_p_ElementTest10847: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000003,0x00408000, 0x00000000]),
+ FOLLOW_p_TypeName_in_p_ElementTest10849: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00080010]),
+ FOLLOW_QUESTION_in_p_ElementTest10851: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000010]),
+ FOLLOW_RPAREN_in_p_ElementTest10858: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_EQName_in_p_ElementNameOrWildcard10884: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_STAR_in_p_ElementNameOrWildcard10888: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_SCHEMA_ELEMENT_in_p_SchemaElementTest10906: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000008]),
+ FOLLOW_LPAREN_in_p_SchemaElementTest10908: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000003,0x00408000, 0x00000000]),
+ FOLLOW_p_ElementDeclaration_in_p_SchemaElementTest10910: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000010]),
+ FOLLOW_RPAREN_in_p_SchemaElementTest10912: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_ElementName_in_p_ElementDeclaration10938: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_EQName_in_p_AttributeName10964: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_EQName_in_p_ElementName10990: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_EQName_in_p_TypeName11016: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_Annotation_in_p_FunctionTest11042: new org.antlr.runtime.BitSet([0x00000000, 0x00400000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00008000]),
+ FOLLOW_p_AnyFunctionTest_in_p_FunctionTest11046: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_TypedFunctionTest_in_p_FunctionTest11050: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_FUNCTION_in_p_AnyFunctionTest11077: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000008]),
+ FOLLOW_LPAREN_in_p_AnyFunctionTest11079: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00100000]),
+ FOLLOW_STAR_in_p_AnyFunctionTest11081: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000010]),
+ FOLLOW_RPAREN_in_p_AnyFunctionTest11083: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_FUNCTION_in_p_TypedFunctionTest11109: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000008]),
+ FOLLOW_LPAREN_in_p_TypedFunctionTest11111: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x0000801B,0x00408000, 0x00000000]),
+ FOLLOW_p_SequenceType_in_p_TypedFunctionTest11114: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00040010]),
+ FOLLOW_COMMA_in_p_TypedFunctionTest11117: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x0000800B,0x00408000, 0x00000000]),
+ FOLLOW_p_SequenceType_in_p_TypedFunctionTest11119: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00040010]),
+ FOLLOW_RPAREN_in_p_TypedFunctionTest11125: new org.antlr.runtime.BitSet([0x00080000, 0x00000000]),
+ FOLLOW_AS_in_p_TypedFunctionTest11127: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x0000800B,0x00408000, 0x00000000]),
+ FOLLOW_p_SequenceType_in_p_TypedFunctionTest11129: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_LPAREN_in_p_ParenthesizedItemType11155: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x0000800B,0x00408000, 0x00000000]),
+ FOLLOW_p_ItemType_in_p_ParenthesizedItemType11157: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000010]),
+ FOLLOW_RPAREN_in_p_ParenthesizedItemType11159: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_QUOT_in_p_StringLiteral11210: new org.antlr.runtime.BitSet([0xFFFFFFF0, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFDFFFF,0xFFFFFFFF, 0xFFFFFFFF,0x1FFFFFFF, 0x00000000]),
+ FOLLOW_pg_QuotStringLiteralContent_in_p_StringLiteral11214: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00080000, 0x00000000]),
+ FOLLOW_QUOT_in_p_StringLiteral11216: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_APOS_in_p_StringLiteral11255: new org.antlr.runtime.BitSet([0xFFFFFFF0, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFDFFFF,0xFFFFFFFF, 0xFFFFFFFF,0x1FFFFFFF, 0x00000000]),
+ FOLLOW_pg_AposStringLiteralContent_in_p_StringLiteral11259: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00040000, 0x00000000]),
+ FOLLOW_APOS_in_p_StringLiteral11261: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_set_in_pg_QuotStringLiteralContent11327: new org.antlr.runtime.BitSet([0xFFFFFFF2, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFDFFFF,0xFFF7FFFF, 0xFFFFFFFF,0x1FFFFFFF, 0x00000000]),
+ FOLLOW_set_in_pg_AposStringLiteralContent11378: new org.antlr.runtime.BitSet([0xFFFFFFF2, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFDFFFF,0xFFFBFFFF, 0xFFFFFFFF,0x1FFFFFFF, 0x00000000]),
+ FOLLOW_L_ElementContentChar_in_p_ElementContentChar11436: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_L_QuotAttrContentChar_in_p_QuotAttrContentChar11462: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_L_AposAttrContentChar_in_p_AposAttrContentChar11512: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_QName_in_p_EQName11581: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_URIQualifiedName_in_p_EQName11593: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_BracedURILiteral_in_p_URIQualifiedName11618: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000003,0x00400000, 0x00000000]),
+ FOLLOW_p_NCName_in_p_URIQualifiedName11620: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_Q_in_p_BracedURILiteral11645: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000100]),
+ FOLLOW_LBRACKET_in_p_BracedURILiteral11647: new org.antlr.runtime.BitSet([0xFFFFFFF0, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFDFEFF,0xFFFFFFFF, 0xFFFFFFFF,0x1FFFFFFF, 0x00000000]),
+ FOLLOW_set_in_p_BracedURILiteral11649: new org.antlr.runtime.BitSet([0xFFFFFFF0, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFDFEFF,0xFFFFFFFF, 0xFFFFFFFF,0x1FFFFFFF, 0x00000000]),
+ FOLLOW_RBRACKET_in_p_BracedURILiteral11673: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_pg_QName_in_p_QName11715: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_NCName_in_p_QName11727: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_pg_QName_in_pg_FQName11788: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_FNCName_in_pg_FQName11800: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_NCName_in_pg_QName11844: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000004, 0x00000000]),
+ FOLLOW_COLON_in_pg_QName11846: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000003,0x00400000, 0x00000000]),
+ FOLLOW_p_NCName_in_pg_QName11850: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_set_in_p_NCName0: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_set_in_p_FNCName0: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_InsertExpr_in_pg_UpdateExpr13847: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_DeleteExpr_in_pg_UpdateExpr13859: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_RenameExpr_in_pg_UpdateExpr13871: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_ReplaceExpr_in_pg_UpdateExpr13883: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_TransformExpr_in_pg_UpdateExpr13895: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_JSONDeleteExpr_in_pg_UpdateExpr13907: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_JSONInsertExpr_in_pg_UpdateExpr13919: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_JSONRenameExpr_in_pg_UpdateExpr13931: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_JSONReplaceExpr_in_pg_UpdateExpr13943: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_JSONAppendExpr_in_pg_UpdateExpr13955: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_DELETE_in_p_JSONDeleteExpr13982: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00008000, 0x00000000]),
+ FOLLOW_JSON_in_p_JSONDeleteExpr13986: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_TargetExpr_in_p_JSONDeleteExpr13990: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_INSERT_in_p_JSONInsertExpr14017: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00008000, 0x00000000]),
+ FOLLOW_JSON_in_p_JSONInsertExpr14021: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_SourceExpr_in_p_JSONInsertExpr14023: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x01000000, 0x00000000]),
+ FOLLOW_INTO_in_p_JSONInsertExpr14027: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_TargetExpr_in_p_JSONInsertExpr14029: new org.antlr.runtime.BitSet([0x00200002, 0x00000000]),
+ FOLLOW_AT_in_p_JSONInsertExpr14034: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x02000000, 0x00000000]),
+ FOLLOW_POSITION_in_p_JSONInsertExpr14038: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_ExprSingle_in_p_JSONInsertExpr14040: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_RENAME_in_p_JSONRenameExpr14076: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00008000, 0x00000000]),
+ FOLLOW_JSON_in_p_JSONRenameExpr14080: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_TargetExpr_in_p_JSONRenameExpr14082: new org.antlr.runtime.BitSet([0x00080000, 0x00000000]),
+ FOLLOW_AS_in_p_JSONRenameExpr14086: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_ExprSingle_in_p_JSONRenameExpr14090: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_REPLACE_in_p_JSONReplaceExpr14120: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00008000, 0x00000000]),
+ FOLLOW_JSON_in_p_JSONReplaceExpr14124: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000008]),
+ FOLLOW_VALUE_in_p_JSONReplaceExpr14128: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00010000, 0x00000000]),
+ FOLLOW_OF_in_p_JSONReplaceExpr14132: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_TargetExpr_in_p_JSONReplaceExpr14134: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000010]),
+ FOLLOW_WITH_in_p_JSONReplaceExpr14138: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_ExprSingle_in_p_JSONReplaceExpr14140: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_APPEND_in_p_JSONAppendExpr14171: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00008000, 0x00000000]),
+ FOLLOW_JSON_in_p_JSONAppendExpr14175: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000400]),
+ FOLLOW_LSQUARE_in_p_JSONAppendExpr14177: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_Expr_in_p_JSONAppendExpr14179: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000800]),
+ FOLLOW_RSQUARE_in_p_JSONAppendExpr14182: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000800]),
+ FOLLOW_TO_in_p_JSONAppendExpr14186: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_ExprSingle_in_p_JSONAppendExpr14188: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_DECLARE_in_pm_RevalidationDecl14219: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000001]),
+ FOLLOW_REVALIDATION_in_pm_RevalidationDecl14223: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000008, 0x00000080,0x00000000, 0x00000002]),
+ FOLLOW_STRICT_in_pm_RevalidationDecl14228: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000040, 0x00000000]),
+ FOLLOW_LAX_in_pm_RevalidationDecl14234: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000040, 0x00000000]),
+ FOLLOW_SKIP_in_pm_RevalidationDecl14240: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000040, 0x00000000]),
+ FOLLOW_SEMICOLON_in_pm_RevalidationDecl14245: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_AS_in_p_InsertExprTargetChoice14275: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x08400000, 0x00000000]),
+ FOLLOW_FIRST_in_p_InsertExprTargetChoice14280: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x01000000, 0x00000000]),
+ FOLLOW_LAST_in_p_InsertExprTargetChoice14286: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x01000000, 0x00000000]),
+ FOLLOW_INTO_in_p_InsertExprTargetChoice14293: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_AFTER_in_p_InsertExprTargetChoice14310: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_BEFORE_in_p_InsertExprTargetChoice14326: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_INSERT_in_p_InsertExpr14356: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00004000, 0x00000000,0x20000000, 0x00000000]),
+ FOLLOW_NODE_in_p_InsertExpr14361: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_NODES_in_p_InsertExpr14367: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_SourceExpr_in_p_InsertExpr14370: new org.antlr.runtime.BitSet([0x00080000, 0x00000000,0x00000000, 0x00000000,0x010C0000, 0x00000000]),
+ FOLLOW_p_InsertExprTargetChoice_in_p_InsertExpr14372: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_TargetExpr_in_p_InsertExpr14374: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_DELETE_in_p_DeleteExpr14404: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00004000, 0x00000000,0x20000000, 0x00000000]),
+ FOLLOW_NODE_in_p_DeleteExpr14409: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_NODES_in_p_DeleteExpr14415: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_TargetExpr_in_p_DeleteExpr14418: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_REPLACE_in_p_ReplaceExpr14448: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00004000, 0x00000000,0x00000000, 0x00000008]),
+ FOLLOW_VALUE_in_p_ReplaceExpr14453: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00010000, 0x00000000]),
+ FOLLOW_OF_in_p_ReplaceExpr14457: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00004000, 0x00000000]),
+ FOLLOW_NODE_in_p_ReplaceExpr14463: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_ExprSingle_in_p_ReplaceExpr14465: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000010]),
+ FOLLOW_WITH_in_p_ReplaceExpr14470: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_ExprSingle_in_p_ReplaceExpr14472: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_RENAME_in_p_RenameExpr14503: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00004000, 0x00000000]),
+ FOLLOW_NODE_in_p_RenameExpr14507: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_TargetExpr_in_p_RenameExpr14509: new org.antlr.runtime.BitSet([0x00080000, 0x00000000]),
+ FOLLOW_AS_in_p_RenameExpr14513: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_NewNameExpr_in_p_RenameExpr14515: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_ExprSingle_in_p_SourceExpr14543: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_ExprSingle_in_p_TargetExpr14570: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_ExprSingle_in_p_NewNameExpr14597: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_COPY_in_p_TransformExpr14626: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000020]),
+ FOLLOW_DOLLAR_in_p_TransformExpr14630: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000003,0x00408000, 0x00000000]),
+ FOLLOW_p_VarName_in_p_TransformExpr14634: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00002000]),
+ FOLLOW_BIND_in_p_TransformExpr14638: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_ExprSingle_in_p_TransformExpr14640: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x10000000, 0x00000000,0x00000000, 0x00040000]),
+ FOLLOW_COMMA_in_p_TransformExpr14644: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000020]),
+ FOLLOW_DOLLAR_in_p_TransformExpr14648: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000003,0x00408000, 0x00000000]),
+ FOLLOW_p_VarName_in_p_TransformExpr14652: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00002000]),
+ FOLLOW_BIND_in_p_TransformExpr14656: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_ExprSingle_in_p_TransformExpr14658: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x10000000, 0x00000000,0x00000000, 0x00040000]),
+ FOLLOW_MODIFY_in_p_TransformExpr14665: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_ExprSingle_in_p_TransformExpr14667: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x80000000, 0x00000000]),
+ FOLLOW_RETURN_in_p_TransformExpr14672: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_ExprSingle_in_p_TransformExpr14674: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_DECLARE_in_pm_FTOptionDecl14712: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00008000]),
+ FOLLOW_FT_OPTION_in_pm_FTOptionDecl14716: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000200, 0x00000000]),
+ FOLLOW_p_FTMatchOptions_in_pm_FTOptionDecl14718: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000040, 0x00000000]),
+ FOLLOW_SEMICOLON_in_pm_FTOptionDecl14720: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_SCORE_in_p_FTScoreVar14750: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000020]),
+ FOLLOW_DOLLAR_in_p_FTScoreVar14756: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000003,0x00408000, 0x00000000]),
+ FOLLOW_p_VarName_in_p_FTScoreVar14760: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_StringConcatExpr_in_p_FTContainsExpr14788: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000080]),
+ FOLLOW_CONTAINS_in_p_FTContainsExpr14794: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000200]),
+ FOLLOW_TEXT_in_p_FTContainsExpr14798: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00020000,0x00000000, 0x00000108,0x200C0000, 0x00000007]),
+ FOLLOW_p_FTSelection_in_p_FTContainsExpr14802: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00001000, 0x00000000]),
+ FOLLOW_p_FTIgnoreOption_in_p_FTContainsExpr14804: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_FTOr_in_p_FTSelection14834: new org.antlr.runtime.BitSet([0x00200002, 0x00000000,0x00100000, 0x00000000,0x00010000, 0x80001C00]),
+ FOLLOW_p_FTPosFilter_in_p_FTSelection14836: new org.antlr.runtime.BitSet([0x00200002, 0x00000000,0x00100000, 0x00000000,0x00010000, 0x80001C00]),
+ FOLLOW_WEIGHT_in_p_FTWeight14865: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000100]),
+ FOLLOW_LBRACKET_in_p_FTWeight14869: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_Expr_in_p_FTWeight14871: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000200]),
+ FOLLOW_RBRACKET_in_p_FTWeight14874: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_FTAnd_in_p_FTOr14900: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00040000]),
+ FOLLOW_FTOR_in_p_FTOr14906: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00020000,0x00000000, 0x00000108,0x200C0000, 0x00000007]),
+ FOLLOW_p_FTAnd_in_p_FTOr14910: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00040000]),
+ FOLLOW_p_FTMildNot_in_p_FTAnd14939: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00010000]),
+ FOLLOW_FTAND_in_p_FTAnd14945: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00020000,0x00000000, 0x00000108,0x200C0000, 0x00000007]),
+ FOLLOW_p_FTMildNot_in_p_FTAnd14949: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00010000]),
+ FOLLOW_p_FTUnaryNot_in_p_FTMildNot14978: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x02000000]),
+ FOLLOW_NOT_in_p_FTMildNot14984: new org.antlr.runtime.BitSet([0x00000000, 0x20000000]),
+ FOLLOW_IN_in_p_FTMildNot14988: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00020000,0x00000000, 0x00000108,0x200C0000, 0x00000007]),
+ FOLLOW_p_FTUnaryNot_in_p_FTMildNot14992: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x02000000]),
+ FOLLOW_FTNOT_in_p_FTUnaryNot15025: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00020000,0x00000000, 0x00000108,0x200C0000, 0x00000007]),
+ FOLLOW_p_FTPrimaryWithOptions_in_p_FTUnaryNot15032: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_FTPrimary_in_p_FTPrimaryWithOptions15058: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000600, 0x00000000]),
+ FOLLOW_p_FTMatchOptions_in_p_FTPrimaryWithOptions15060: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000400, 0x00000000]),
+ FOLLOW_p_FTWeight_in_p_FTPrimaryWithOptions15063: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_FTWords_in_p_FTPrimary15094: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x04000000]),
+ FOLLOW_p_FTTimes_in_p_FTPrimary15096: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_LPAREN_in_p_FTPrimary15111: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00020000,0x00000000, 0x00000108,0x200C0000, 0x00000007]),
+ FOLLOW_p_FTSelection_in_p_FTPrimary15113: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000010]),
+ FOLLOW_RPAREN_in_p_FTPrimary15115: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_FTExtensionSelection_in_p_FTPrimary15128: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_FTWordsValue_in_p_FTWords15154: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x20000060]),
+ FOLLOW_p_FTAnyallOption_in_p_FTWords15156: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_StringLiteral_in_p_FTWordsValue15183: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_LBRACKET_in_p_FTWordsValue15196: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_Expr_in_p_FTWordsValue15198: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000200]),
+ FOLLOW_RBRACKET_in_p_FTWordsValue15201: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_L_Pragma_in_p_FTExtensionSelection15228: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000100,0x20000000, 0x00000000]),
+ FOLLOW_LBRACKET_in_p_FTExtensionSelection15231: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00020000,0x00000000, 0x00000308,0x200C0000, 0x00000007]),
+ FOLLOW_p_FTSelection_in_p_FTExtensionSelection15233: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000200]),
+ FOLLOW_RBRACKET_in_p_FTExtensionSelection15236: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_ANY_in_p_FTAnyallOption15267: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00002000, 0x00000000]),
+ FOLLOW_WORD_in_p_FTAnyallOption15271: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_ALL_in_p_FTAnyallOption15280: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00004000, 0x00000000]),
+ FOLLOW_WORDS_in_p_FTAnyallOption15282: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_PHRASE_in_p_FTAnyallOption15290: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_OCCURS_in_p_FTTimes15322: new org.antlr.runtime.BitSet([0x00200000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00006000]),
+ FOLLOW_p_FTRange_in_p_FTTimes15324: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000080, 0x00000000]),
+ FOLLOW_TIMES_in_p_FTTimes15328: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_EXACTLY_in_p_FTRange15361: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_AdditiveExpr_in_p_FTRange15363: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_AT_in_p_FTRange15381: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000020, 0x00000000]),
+ FOLLOW_LEAST_in_p_FTRange15385: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_AdditiveExpr_in_p_FTRange15387: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_AT_in_p_FTRange15405: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00800000]),
+ FOLLOW_MOST_in_p_FTRange15409: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_AdditiveExpr_in_p_FTRange15411: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_FROM_in_p_FTRange15429: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_AdditiveExpr_in_p_FTRange15431: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000800]),
+ FOLLOW_TO_in_p_FTRange15435: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_AdditiveExpr_in_p_FTRange15437: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_FTOrder_in_p_FTPosFilter15468: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_FTWindow_in_p_FTPosFilter15472: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_FTDistance_in_p_FTPosFilter15476: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_FTScope_in_p_FTPosFilter15480: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_FTContent_in_p_FTPosFilter15484: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_ORDERED_in_p_FTOrder15512: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_WINDOW_in_p_FTWindow15542: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_AdditiveExpr_in_p_FTWindow15546: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x10000000,0x00004008, 0x00000000]),
+ FOLLOW_p_FTUnit_in_p_FTWindow15548: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_DISTANCE_in_p_FTDistance15576: new org.antlr.runtime.BitSet([0x00200000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00006000]),
+ FOLLOW_p_FTRange_in_p_FTDistance15580: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x10000000,0x00004008, 0x00000000]),
+ FOLLOW_p_FTUnit_in_p_FTDistance15582: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_WORDS_in_p_FTUnit15612: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_SENTENCES_in_p_FTUnit15618: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_PARAGRAPHS_in_p_FTUnit15624: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_SAME_in_p_FTScope15657: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x08000000,0x00000004, 0x00000000]),
+ FOLLOW_DIFFERENT_in_p_FTScope15663: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x08000000,0x00000004, 0x00000000]),
+ FOLLOW_p_FTBigUnit_in_p_FTScope15668: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_SENTENCE_in_p_FTBigUnit15698: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_PARAGRAPH_in_p_FTBigUnit15704: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_AT_in_p_FTContent15739: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000400, 0x00000000]),
+ FOLLOW_START_in_p_FTContent15743: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_AT_in_p_FTContent15751: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x10000000]),
+ FOLLOW_END_in_p_FTContent15755: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_ENTIRE_in_p_FTContent15763: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000100]),
+ FOLLOW_CONTENT_in_p_FTContent15767: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_USING_in_p_FTMatchOptions15801: new org.antlr.runtime.BitSet([0x04000000, 0x00000000,0x00020000, 0x00000000,0x00000000, 0x01500200,0x00000970, 0x00000000]),
+ FOLLOW_p_FTMatchOption_in_p_FTMatchOptions15805: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000200, 0x00000000]),
+ FOLLOW_p_FTLanguageOption_in_p_FTMatchOption15833: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_FTWildCardOption_in_p_FTMatchOption15845: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_FTThesaurusOption_in_p_FTMatchOption15857: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_FTStemOption_in_p_FTMatchOption15869: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_FTCaseOption_in_p_FTMatchOption15881: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_FTDiacriticsOption_in_p_FTMatchOption15893: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_FTStopWordOption_in_p_FTMatchOption15905: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_FTExtensionOption_in_p_FTMatchOption15917: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_CASE_in_p_FTCaseOption15948: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00080000]),
+ FOLLOW_INSENSITIVE_in_p_FTCaseOption15952: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_CASE_in_p_FTCaseOption15970: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000002, 0x00000000]),
+ FOLLOW_SENSITIVE_in_p_FTCaseOption15974: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_LOWERCASE_in_p_FTCaseOption15991: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_UPPERCASE_in_p_FTCaseOption16007: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_DIACRITICS_in_p_FTDiacriticsOption16042: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00080000]),
+ FOLLOW_INSENSITIVE_in_p_FTDiacriticsOption16046: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_DIACRITICS_in_p_FTDiacriticsOption16064: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000002, 0x00000000]),
+ FOLLOW_SENSITIVE_in_p_FTDiacriticsOption16068: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_STEMMING_in_p_FTStemOption16103: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_NO_in_p_FTStemOption16110: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000010, 0x00000000]),
+ FOLLOW_STEMMING_in_p_FTStemOption16114: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_THESAURUS_in_p_FTThesaurusOption16150: new org.antlr.runtime.BitSet([0x00200000, 0x00000008]),
+ FOLLOW_p_FTThesaurusID_in_p_FTThesaurusOption16153: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_DEFAULT_in_p_FTThesaurusOption16159: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_THESAURUS_in_p_FTThesaurusOption16178: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000008]),
+ FOLLOW_LPAREN_in_p_FTThesaurusOption16180: new org.antlr.runtime.BitSet([0x00200000, 0x00000008]),
+ FOLLOW_p_FTThesaurusID_in_p_FTThesaurusOption16183: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00040010]),
+ FOLLOW_DEFAULT_in_p_FTThesaurusOption16189: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00040010]),
+ FOLLOW_COMMA_in_p_FTThesaurusOption16193: new org.antlr.runtime.BitSet([0x00200000, 0x00000000]),
+ FOLLOW_p_FTThesaurusID_in_p_FTThesaurusOption16195: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00040010]),
+ FOLLOW_RPAREN_in_p_FTThesaurusOption16199: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_NO_in_p_FTThesaurusOption16217: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000040, 0x00000000]),
+ FOLLOW_THESAURUS_in_p_FTThesaurusOption16221: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_AT_in_p_FTThesaurusID16254: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x000C0000, 0x00000007]),
+ FOLLOW_p_StringLiteral_in_p_FTThesaurusID16256: new org.antlr.runtime.BitSet([0x00200002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x40006000]),
+ FOLLOW_RELATIONSHIP_in_p_FTThesaurusID16261: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x000C0000, 0x00000007]),
+ FOLLOW_p_StringLiteral_in_p_FTThesaurusID16263: new org.antlr.runtime.BitSet([0x00200002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00006000]),
+ FOLLOW_p_FTLiteralRange_in_p_FTThesaurusID16268: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00200000]),
+ FOLLOW_LEVELS_in_p_FTThesaurusID16272: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_EXACTLY_in_p_FTLiteralRange16307: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000001]),
+ FOLLOW_L_IntegerLiteral_in_p_FTLiteralRange16309: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_AT_in_p_FTLiteralRange16327: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000020, 0x00000000]),
+ FOLLOW_LEAST_in_p_FTLiteralRange16331: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000001]),
+ FOLLOW_L_IntegerLiteral_in_p_FTLiteralRange16333: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_AT_in_p_FTLiteralRange16351: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00800000]),
+ FOLLOW_MOST_in_p_FTLiteralRange16355: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000001]),
+ FOLLOW_L_IntegerLiteral_in_p_FTLiteralRange16357: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_FROM_in_p_FTLiteralRange16375: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000001]),
+ FOLLOW_L_IntegerLiteral_in_p_FTLiteralRange16377: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000800]),
+ FOLLOW_TO_in_p_FTLiteralRange16379: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000001]),
+ FOLLOW_L_IntegerLiteral_in_p_FTLiteralRange16381: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_STOP_in_p_FTStopWordOption16417: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00004000, 0x00000000]),
+ FOLLOW_WORDS_in_p_FTStopWordOption16421: new org.antlr.runtime.BitSet([0x00200000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000008]),
+ FOLLOW_p_FTStopWords_in_p_FTStopWordOption16423: new org.antlr.runtime.BitSet([0x00000002, 0x00020000,0x00000000, 0x00004000]),
+ FOLLOW_p_FTStopWordsInclExcl_in_p_FTStopWordOption16425: new org.antlr.runtime.BitSet([0x00000002, 0x00020000,0x00000000, 0x00004000]),
+ FOLLOW_STOP_in_p_FTStopWordOption16444: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00004000, 0x00000000]),
+ FOLLOW_WORDS_in_p_FTStopWordOption16448: new org.antlr.runtime.BitSet([0x00000000, 0x00000008]),
+ FOLLOW_DEFAULT_in_p_FTStopWordOption16452: new org.antlr.runtime.BitSet([0x00000002, 0x00020000,0x00000000, 0x00004000]),
+ FOLLOW_p_FTStopWordsInclExcl_in_p_FTStopWordOption16454: new org.antlr.runtime.BitSet([0x00000002, 0x00020000,0x00000000, 0x00004000]),
+ FOLLOW_NO_in_p_FTStopWordOption16473: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000020, 0x00000000]),
+ FOLLOW_STOP_in_p_FTStopWordOption16477: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00004000, 0x00000000]),
+ FOLLOW_WORDS_in_p_FTStopWordOption16481: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_AT_in_p_FTStopWords16515: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x000C0000, 0x00000007]),
+ FOLLOW_p_StringLiteral_in_p_FTStopWords16519: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_LPAREN_in_p_FTStopWords16533: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x000C0000, 0x00000007]),
+ FOLLOW_p_StringLiteral_in_p_FTStopWords16535: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00040010]),
+ FOLLOW_COMMA_in_p_FTStopWords16538: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x000C0000, 0x00000007]),
+ FOLLOW_p_StringLiteral_in_p_FTStopWords16540: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00040010]),
+ FOLLOW_RPAREN_in_p_FTStopWords16544: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_UNION_in_p_FTStopWordsInclExcl16576: new org.antlr.runtime.BitSet([0x00200000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000008]),
+ FOLLOW_EXCEPT_in_p_FTStopWordsInclExcl16582: new org.antlr.runtime.BitSet([0x00200000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000008]),
+ FOLLOW_p_FTStopWords_in_p_FTStopWordsInclExcl16585: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_LANGUAGE_in_p_FTLanguageOption16617: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x000C0000, 0x00000007]),
+ FOLLOW_p_StringLiteral_in_p_FTLanguageOption16621: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_WILDCARDS_in_p_FTWildCardOption16651: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_NO_in_p_FTWildCardOption16658: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000800, 0x00000000]),
+ FOLLOW_WILDCARDS_in_p_FTWildCardOption16662: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_OPTION_in_p_FTExtensionOption16695: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000003,0x00400000, 0x00000000]),
+ FOLLOW_p_QName_in_p_FTExtensionOption16699: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x000C0000, 0x00000007]),
+ FOLLOW_p_StringLiteral_in_p_FTExtensionOption16701: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_WITHOUT_in_p_FTIgnoreOption16729: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000100]),
+ FOLLOW_CONTENT_in_p_FTIgnoreOption16733: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_UnionExpr_in_p_FTIgnoreOption16737: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_StatementsAndOptionalExpr_in_p_Program16769: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_Hybrid_in_p_Statements16796: new org.antlr.runtime.BitSet([0xFFFF0002, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0856B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_Statements_in_p_StatementsAndExpr16824: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_Statements_in_p_StatementsAndOptionalExpr16851: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_HybridExprSingle_in_p_Hybrid16878: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_Statement_in_p_Hybrid16891: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_AssignStatement_in_p_Statement16922: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_BreakStatement_in_p_Statement16934: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_ContinueStatement_in_p_Statement16946: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_ExitStatement_in_p_Statement16958: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_VarDeclStatement_in_p_Statement16970: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_WhileStatement_in_p_Statement16982: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_Expr_in_p_HybridExprSingle17009: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000040, 0x00000000]),
+ FOLLOW_SEMICOLON_in_p_HybridExprSingle17024: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_ExprSimple_in_p_ApplyStatement17074: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000040, 0x00000000]),
+ FOLLOW_SEMICOLON_in_p_ApplyStatement17076: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_DOLLAR_in_p_AssignStatement17104: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000003,0x00408000, 0x00000000]),
+ FOLLOW_p_VarName_in_p_AssignStatement17108: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00002000]),
+ FOLLOW_BIND_in_p_AssignStatement17112: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_ExprSingle_in_p_AssignStatement17114: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000040, 0x00000000]),
+ FOLLOW_SEMICOLON_in_p_AssignStatement17117: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_LBRACKET_in_p_BlockStatement17143: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0876B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_Statements_in_p_BlockStatement17145: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000200]),
+ FOLLOW_RBRACKET_in_p_BlockStatement17148: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_LBRACKET_in_p_BlockHybrid17174: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0876B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_Statements_in_p_BlockHybrid17176: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000200]),
+ FOLLOW_RBRACKET_in_p_BlockHybrid17179: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_BREAK_in_p_BreakStatement17207: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00040000, 0x00000000]),
+ FOLLOW_LOOP_in_p_BreakStatement17213: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000040, 0x00000000]),
+ FOLLOW_SEMICOLON_in_p_BreakStatement17217: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_CONTINUE_in_p_ContinueStatement17245: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00040000, 0x00000000]),
+ FOLLOW_LOOP_in_p_ContinueStatement17251: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000040, 0x00000000]),
+ FOLLOW_SEMICOLON_in_p_ContinueStatement17255: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_EXIT_in_p_ExitStatement17283: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00080000, 0x00000000]),
+ FOLLOW_RETURNING_in_p_ExitStatement17289: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_ExprSingle_in_p_ExitStatement17293: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000040, 0x00000000]),
+ FOLLOW_SEMICOLON_in_p_ExitStatement17296: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_InitialClause_in_p_FLWORStatement17322: new org.antlr.runtime.BitSet([0x00000000, 0x00200000,0x80080040, 0x21080040]),
+ FOLLOW_p_IntermediateClause_in_p_FLWORStatement17324: new org.antlr.runtime.BitSet([0x00000000, 0x00200000,0x80080040, 0x21080040]),
+ FOLLOW_p_ReturnStatement_in_p_FLWORStatement17327: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_RETURN_in_p_ReturnStatement17359: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0856B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_Hybrid_in_p_ReturnStatement17363: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_IF_in_p_IfStatement17392: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000008]),
+ FOLLOW_LPAREN_in_p_IfStatement17396: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_Expr_in_p_IfStatement17398: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000010]),
+ FOLLOW_RPAREN_in_p_IfStatement17401: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000400]),
+ FOLLOW_THEN_in_p_IfStatement17405: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0856B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_Hybrid_in_p_IfStatement17409: new org.antlr.runtime.BitSet([0x00000000, 0x00000800]),
+ FOLLOW_ELSE_in_p_IfStatement17414: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0856B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_Hybrid_in_p_IfStatement17418: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_SWITCH_in_p_SwitchStatement17447: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000008]),
+ FOLLOW_LPAREN_in_p_SwitchStatement17451: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_Expr_in_p_SwitchStatement17453: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000010]),
+ FOLLOW_RPAREN_in_p_SwitchStatement17456: new org.antlr.runtime.BitSet([0x04000000, 0x00000000]),
+ FOLLOW_p_SwitchCaseStatement_in_p_SwitchStatement17458: new org.antlr.runtime.BitSet([0x04000000, 0x00000008]),
+ FOLLOW_DEFAULT_in_p_SwitchStatement17463: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x80000000, 0x00000000]),
+ FOLLOW_RETURN_in_p_SwitchStatement17469: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0856B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_Hybrid_in_p_SwitchStatement17473: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_CASE_in_p_SwitchCaseStatement17503: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_SwitchCaseOperand_in_p_SwitchCaseStatement17507: new org.antlr.runtime.BitSet([0x04000000, 0x00000000,0x80000000, 0x00000000]),
+ FOLLOW_RETURN_in_p_SwitchCaseStatement17513: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0856B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_Hybrid_in_p_SwitchCaseStatement17517: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_TRY_in_p_TryCatchStatement17546: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000100]),
+ FOLLOW_p_BlockStatement_in_p_TryCatchStatement17550: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00400000]),
+ FOLLOW_CATCH_in_p_TryCatchStatement17555: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00100003,0x0040C002, 0x00000000]),
+ FOLLOW_p_CatchErrorList_in_p_TryCatchStatement17559: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000100]),
+ FOLLOW_p_BlockStatement_in_p_TryCatchStatement17561: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00400000]),
+ FOLLOW_TRY_in_p_TryCatchHybrid17593: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000100]),
+ FOLLOW_p_BlockHybrid_in_p_TryCatchHybrid17597: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00400000]),
+ FOLLOW_CATCH_in_p_TryCatchHybrid17603: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00100003,0x0040C002, 0x00000000]),
+ FOLLOW_p_CatchErrorList_in_p_TryCatchHybrid17607: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000100]),
+ FOLLOW_p_BlockHybrid_in_p_TryCatchHybrid17609: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00400000]),
+ FOLLOW_TYPESWITCH_in_p_TypeswitchStatement17642: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000008]),
+ FOLLOW_LPAREN_in_p_TypeswitchStatement17646: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_Expr_in_p_TypeswitchStatement17648: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000010]),
+ FOLLOW_RPAREN_in_p_TypeswitchStatement17651: new org.antlr.runtime.BitSet([0x04000000, 0x00000000]),
+ FOLLOW_p_CaseStatement_in_p_TypeswitchStatement17653: new org.antlr.runtime.BitSet([0x04000000, 0x00000008]),
+ FOLLOW_DEFAULT_in_p_TypeswitchStatement17658: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x80000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000020]),
+ FOLLOW_DOLLAR_in_p_TypeswitchStatement17665: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000003,0x00408000, 0x00000000]),
+ FOLLOW_p_VarName_in_p_TypeswitchStatement17669: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x80000000, 0x00000000]),
+ FOLLOW_RETURN_in_p_TypeswitchStatement17677: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0856B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_Hybrid_in_p_TypeswitchStatement17681: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_CASE_in_p_CaseStatement17710: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x0000802B,0x00408000, 0x00000000]),
+ FOLLOW_DOLLAR_in_p_CaseStatement17717: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000003,0x00408000, 0x00000000]),
+ FOLLOW_p_VarName_in_p_CaseStatement17721: new org.antlr.runtime.BitSet([0x00080000, 0x00000000]),
+ FOLLOW_AS_in_p_CaseStatement17725: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x0000800B,0x00408000, 0x00000000]),
+ FOLLOW_p_SequenceType_in_p_CaseStatement17729: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x80000000, 0x00000000]),
+ FOLLOW_RETURN_in_p_CaseStatement17733: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0856B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_Hybrid_in_p_CaseStatement17737: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_Annotation_in_p_VarDeclStatement17764: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00020000,0x00000000, 0x00000000,0x00000000, 0x00008000]),
+ FOLLOW_VARIABLE_in_p_VarDeclStatement17769: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000020]),
+ FOLLOW_DOLLAR_in_p_VarDeclStatement17775: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000003,0x00408000, 0x00000000]),
+ FOLLOW_p_VarName_in_p_VarDeclStatement17779: new org.antlr.runtime.BitSet([0x00080000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00042000,0x00000040, 0x00000000]),
+ FOLLOW_p_TypeDeclaration_in_p_VarDeclStatement17783: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00042000,0x00000040, 0x00000000]),
+ FOLLOW_BIND_in_p_VarDeclStatement17787: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_ExprSingle_in_p_VarDeclStatement17789: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00040000,0x00000040, 0x00000000]),
+ FOLLOW_COMMA_in_p_VarDeclStatement17805: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000020]),
+ FOLLOW_DOLLAR_in_p_VarDeclStatement17809: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000003,0x00408000, 0x00000000]),
+ FOLLOW_p_VarName_in_p_VarDeclStatement17813: new org.antlr.runtime.BitSet([0x00080000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00042000,0x00000040, 0x00000000]),
+ FOLLOW_p_TypeDeclaration_in_p_VarDeclStatement17817: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00042000,0x00000040, 0x00000000]),
+ FOLLOW_BIND_in_p_VarDeclStatement17821: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_ExprSingle_in_p_VarDeclStatement17823: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00040000,0x00000040, 0x00000000]),
+ FOLLOW_SEMICOLON_in_p_VarDeclStatement17840: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_WHILE_in_p_WhileStatement17868: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000008]),
+ FOLLOW_LPAREN_in_p_WhileStatement17872: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_Expr_in_p_WhileStatement17874: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000010]),
+ FOLLOW_RPAREN_in_p_WhileStatement17877: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0856B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_Hybrid_in_p_WhileStatement17879: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_QuantifiedExpr_in_p_ExprSimple17906: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_OrExpr_in_p_ExprSimple17918: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_pg_UpdateExpr_in_p_ExprSimple17933: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_LBRACKET_in_p_BlockExpr17959: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0856B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_StatementsAndExpr_in_p_BlockExpr17961: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000200]),
+ FOLLOW_RBRACKET_in_p_BlockExpr17963: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_COLLECTION_in_p_CollectionDecl17994: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000003,0x00400000, 0x00000000]),
+ FOLLOW_p_QName_in_p_CollectionDecl17998: new org.antlr.runtime.BitSet([0x00080002, 0x00000000]),
+ FOLLOW_p_CollectionTypeDecl_in_p_CollectionDecl18000: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_AS_in_p_CollectionTypeDecl18029: new org.antlr.runtime.BitSet([0x80400000, 0x00000600,0x04004000, 0x0000020C,0x00000002, 0x00000000]),
+ FOLLOW_p_KindTest_in_p_CollectionTypeDecl18033: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00380000]),
+ FOLLOW_p_OccurrenceIndicator_in_p_CollectionTypeDecl18042: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_INDEX_in_p_IndexDecl18072: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000003,0x00400000, 0x00000000]),
+ FOLLOW_p_IndexName_in_p_IndexDecl18076: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x20000000, 0x00000000]),
+ FOLLOW_ON_in_p_IndexDecl18080: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x20000000, 0x00000000]),
+ FOLLOW_NODES_in_p_IndexDecl18086: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x6090056B,0xC04CC003, 0x00000007]),
+ FOLLOW_p_IndexDomainExpr_in_p_IndexDecl18090: new org.antlr.runtime.BitSet([0x02000000, 0x00000000]),
+ FOLLOW_BY_in_p_IndexDecl18094: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x6090056B,0xC04CC003, 0x00000007]),
+ FOLLOW_p_IndexKeySpec_in_p_IndexDecl18098: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00040000]),
+ FOLLOW_COMMA_in_p_IndexDecl18101: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x6090056B,0xC04CC003, 0x00000007]),
+ FOLLOW_p_IndexKeySpec_in_p_IndexDecl18103: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00040000]),
+ FOLLOW_p_QName_in_p_IndexName18130: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_PathExpr_in_p_IndexDomainExpr18155: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_IndexKeyExpr_in_p_IndexKeySpec18180: new org.antlr.runtime.BitSet([0x40080002, 0x00000000]),
+ FOLLOW_p_IndexKeyTypeDecl_in_p_IndexKeySpec18182: new org.antlr.runtime.BitSet([0x40000002, 0x00000000]),
+ FOLLOW_p_IndexKeyCollation_in_p_IndexKeySpec18185: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_PathExpr_in_p_IndexKeyExpr18211: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_AS_in_p_IndexKeyTypeDecl18238: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000003,0x00400000, 0x00000000]),
+ FOLLOW_p_AtomicType_in_p_IndexKeyTypeDecl18242: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00380000]),
+ FOLLOW_p_OccurrenceIndicator_in_p_IndexKeyTypeDecl18244: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_QName_in_p_AtomicType18270: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_COLLATION_in_p_IndexKeyCollation18297: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x000C0000, 0x00000007]),
+ FOLLOW_p_StringLiteral_in_p_IndexKeyCollation18301: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_INTEGRITY_in_p_ICDecl18328: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00800000, 0x00000000]),
+ FOLLOW_CONSTRAINT_in_p_ICDecl18334: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000003,0x00400000, 0x00000000]),
+ FOLLOW_p_QName_in_p_ICDecl18338: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x22000000, 0x00000000]),
+ FOLLOW_p_ICCollection_in_p_ICDecl18341: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_ICForeignKey_in_p_ICDecl18345: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_ON_in_p_ICCollection18373: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00400000, 0x00000000]),
+ FOLLOW_COLLECTION_in_p_ICCollection18379: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000003,0x00400000, 0x00000000]),
+ FOLLOW_p_QName_in_p_ICCollection18383: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00004000, 0x00000000,0x00000000, 0x00000000,0x01000000, 0x00000020]),
+ FOLLOW_p_ICCollSequence_in_p_ICCollection18386: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_ICCollSequenceUnique_in_p_ICCollection18390: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_ICCollNode_in_p_ICCollection18394: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_DOLLAR_in_p_ICCollSequence18422: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000003,0x00400000, 0x00000000]),
+ FOLLOW_p_QName_in_p_ICCollSequence18426: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00200000, 0x00000000]),
+ FOLLOW_CHECK_in_p_ICCollSequence18432: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_ExprSingle_in_p_ICCollSequence18436: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_NODE_in_p_ICCollSequenceUnique18464: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000020]),
+ FOLLOW_DOLLAR_in_p_ICCollSequenceUnique18470: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000003,0x00400000, 0x00000000]),
+ FOLLOW_p_QName_in_p_ICCollSequenceUnique18474: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00200000, 0x00000000]),
+ FOLLOW_CHECK_in_p_ICCollSequenceUnique18480: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x40000000, 0x00000000]),
+ FOLLOW_UNIQUE_in_p_ICCollSequenceUnique18486: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x10000000, 0x00000000]),
+ FOLLOW_KEY_in_p_ICCollSequenceUnique18492: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x6090056B,0xC04CC003, 0x00000007]),
+ FOLLOW_p_PathExpr_in_p_ICCollSequenceUnique18496: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_FOREACH_in_p_ICCollNode18523: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00004000, 0x00000000]),
+ FOLLOW_NODE_in_p_ICCollNode18529: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000020]),
+ FOLLOW_DOLLAR_in_p_ICCollNode18535: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000003,0x00400000, 0x00000000]),
+ FOLLOW_p_QName_in_p_ICCollNode18539: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00200000, 0x00000000]),
+ FOLLOW_CHECK_in_p_ICCollNode18545: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x60F0056B,0xE04CC003, 0x00000007]),
+ FOLLOW_p_ExprSingle_in_p_ICCollNode18549: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_FOREIGN_in_p_ICForeignKey18577: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x10000000, 0x00000000]),
+ FOLLOW_KEY_in_p_ICForeignKey18583: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00004000]),
+ FOLLOW_p_ICForeignKeySource_in_p_ICForeignKey18587: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000800]),
+ FOLLOW_p_ICForeignKeyTarget_in_p_ICForeignKey18589: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_FROM_in_p_ICForeignKeySource18616: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00400000, 0x00000000]),
+ FOLLOW_p_ICForeignKeyValues_in_p_ICForeignKeySource18620: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_TO_in_p_ICForeignKeyTarget18647: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00400000, 0x00000000]),
+ FOLLOW_p_ICForeignKeyValues_in_p_ICForeignKeyTarget18651: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_COLLECTION_in_p_ICForeignKeyValues18678: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000003,0x00400000, 0x00000000]),
+ FOLLOW_p_QName_in_p_ICForeignKeyValues18682: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00004000, 0x00000000]),
+ FOLLOW_NODE_in_p_ICForeignKeyValues18686: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000020]),
+ FOLLOW_DOLLAR_in_p_ICForeignKeyValues18692: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000003,0x00400000, 0x00000000]),
+ FOLLOW_p_QName_in_p_ICForeignKeyValues18696: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x10000000, 0x00000000]),
+ FOLLOW_KEY_in_p_ICForeignKeyValues18702: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x6090056B,0xC04CC003, 0x00000007]),
+ FOLLOW_p_PathExpr_in_p_ICForeignKeyValues18706: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_set_in_synpred1_XQueryParser3531: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000020]),
+ FOLLOW_DOLLAR_in_synpred1_XQueryParser3539: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_FOR_in_synpred1_XQueryParser3545: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00002200, 0x00000000]),
+ FOLLOW_set_in_synpred1_XQueryParser3547: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_IF_in_synpred2_XQueryParser3573: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000008]),
+ FOLLOW_LPAREN_in_synpred2_XQueryParser3575: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_SWITCH_in_synpred3_XQueryParser3603: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000008]),
+ FOLLOW_LPAREN_in_synpred3_XQueryParser3605: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_TYPESWITCH_in_synpred4_XQueryParser3629: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000008]),
+ FOLLOW_LPAREN_in_synpred4_XQueryParser3631: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_TRY_in_synpred5_XQueryParser3651: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000100]),
+ FOLLOW_LBRACKET_in_synpred5_XQueryParser3653: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_VALIDATE_in_synpred6_XQueryParser6204: new org.antlr.runtime.BitSet([0x00000002, 0x00000000,0x00000008, 0x00000080,0x00004000, 0x00000000]),
+ FOLLOW_p_ValidationMode_in_synpred6_XQueryParser6208: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_TYPE_in_synpred6_XQueryParser6212: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_SLASH_in_synpred7_XQueryParser6600: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0x6090056B,0xC04CC003, 0x00000007]),
+ FOLLOW_p_RelativePathExpr_in_synpred7_XQueryParser6602: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_set_in_synpred8_XQueryParser6716: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_set_in_synpred9_XQueryParser6769: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000103,0x00408000, 0x00000000]),
+ FOLLOW_p_EQName_in_synpred9_XQueryParser6777: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000100]),
+ FOLLOW_LBRACKET_in_synpred9_XQueryParser6780: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_set_in_synpred9_XQueryParser6798: new org.antlr.runtime.BitSet([0xFFFF0000, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF, 0xFFFFFFFB,0xFFFFFFFF, 0x00000103,0x00400000, 0x00000000]),
+ FOLLOW_p_NCName_in_synpred9_XQueryParser6806: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000100]),
+ FOLLOW_LBRACKET_in_synpred9_XQueryParser6809: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_set_in_synpred9_XQueryParser6827: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000100]),
+ FOLLOW_LBRACKET_in_synpred9_XQueryParser6839: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_KindTest_in_synpred10_XQueryParser6869: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_EQName_in_synpred11_XQueryParser6888: new org.antlr.runtime.BitSet([0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000000,0x00000000, 0x00000008]),
+ FOLLOW_LPAREN_in_synpred11_XQueryParser6890: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_PrimaryExpr_in_synpred12_XQueryParser6908: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_LPAREN_in_synpred13_XQueryParser7593: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_OccurrenceIndicator_in_synpred14_XQueryParser9871: new org.antlr.runtime.BitSet([0x00000002, 0x00000000]),
+ FOLLOW_p_OccurrenceIndicator_in_synpred15_XQueryParser18037: new org.antlr.runtime.BitSet([0x00000002, 0x00000000])
+});
+
+})();
+exports.XQueryParser = XQueryParser; });
+define('ace/mode/xquery/StringLexer', ['require', 'exports', 'module' , 'ace/mode/xquery/antlr3-all', 'ace/mode/xquery/XQDTLexer'], function(require, exports, module) {// $ANTLR 3.3 Nov 30, 2010 12:50:56 /Users/wcandillon/28msec/xquery.js/xquery/StringLexer.g 2012-09-05 10:41:39
+
+/* ***** 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 ***** */
+ var org = require("./antlr3-all").org;
+ var XQDTLexer = require("./XQDTLexer").XQDTLexer;
+
+
+var StringLexer = function(input, state) {
+// alternate constructor @todo
+// public StringLexer(CharStream input)
+// public StringLexer(CharStream input, RecognizerSharedState state) {
+ if (!state) {
+ state = new org.antlr.runtime.RecognizerSharedState();
+ }
+
+ (function(){
+
+
+ this.inQuotStr = false;
+ this.inAposStr = false;
+
+ //boolean inQuotStr = false;
+ //boolean inAposStr = false;
+
+ //public StringLexer(CharStream input, boolean isAposStr) {
+ // this(input, new RecognizerSharedState());
+ // this.inAposStr = isAposStr;
+ // this.inQuotStr = !isAposStr;
+ // setIsWsExplicit(true);
+ //}
+
+ }).call(this);
+
+ this.dfa8 = new StringLexer.DFA8(this);
+ StringLexer.superclass.constructor.call(this, input, state);
+
+
+};
+
+org.antlr.lang.augmentObject(StringLexer, {
+ EOF: -1,
+ L_QuotAttrContentChar: 4,
+ L_AposAttrContentChar: 5,
+ L_ElementContentChar: 6,
+ L_CDataSection: 7,
+ L_PredefinedEntityRef: 8,
+ L_CharRef: 9,
+ ESCAPE_LBRACKET: 10,
+ ESCAPE_RBRACKET: 11,
+ ESCAPE_APOS: 12,
+ ESCAPE_QUOT: 13,
+ CDATA_START: 14,
+ CDATA_END: 15,
+ ANCESTOR: 16,
+ ANCESTOR_OR_SELF: 17,
+ AND: 18,
+ AS: 19,
+ ASCENDING: 20,
+ AT: 21,
+ ATTRIBUTE: 22,
+ BASE_URI: 23,
+ BOUNDARY_SPACE: 24,
+ BY: 25,
+ CASE: 26,
+ CAST: 27,
+ CASTABLE: 28,
+ CHILD: 29,
+ COLLATION: 30,
+ COMMENT: 31,
+ CONSTRUCTION: 32,
+ COPY_NAMESPACES: 33,
+ DECLARE: 34,
+ DEFAULT: 35,
+ DESCENDANT: 36,
+ DESCENDANT_OR_SELF: 37,
+ DESCENDING: 38,
+ DIV: 39,
+ DOCUMENT: 40,
+ DOCUMENT_NODE: 41,
+ ELEMENT: 42,
+ ELSE: 43,
+ EMPTY: 44,
+ EMPTY_SEQUENCE: 45,
+ ENCODING: 46,
+ EQ: 47,
+ EVERY: 48,
+ EXCEPT: 49,
+ EXTERNAL: 50,
+ FOLLOWING: 51,
+ FOLLOWING_SIBLING: 52,
+ FOR: 53,
+ FUNCTION: 54,
+ GE: 55,
+ GREATEST: 56,
+ GT: 57,
+ IDIV: 58,
+ IF: 59,
+ IMPORT: 60,
+ IN: 61,
+ INHERIT: 62,
+ INSTANCE: 63,
+ INTERSECT: 64,
+ IS: 65,
+ ITEM: 66,
+ LAX: 67,
+ LE: 68,
+ LEAST: 69,
+ LET: 70,
+ LT: 71,
+ MOD: 72,
+ MODULE: 73,
+ NAMESPACE: 74,
+ NE: 75,
+ NO_INHERIT: 76,
+ NO_PRESERVE: 77,
+ NODE: 78,
+ JSON: 79,
+ OF: 80,
+ OPTION: 81,
+ OR: 82,
+ ORDER: 83,
+ ORDERED: 84,
+ ORDERING: 85,
+ PARENT: 86,
+ PRECEDING: 87,
+ PRECEDING_SIBLING: 88,
+ PRESERVE: 89,
+ PROCESSING_INSTRUCTION: 90,
+ STRUCTURED_ITEM: 91,
+ JSON_ITEM: 92,
+ OBJECT: 93,
+ ARRAY: 94,
+ RETURN: 95,
+ SATISFIES: 96,
+ SCHEMA: 97,
+ SCHEMA_ATTRIBUTE: 98,
+ SCHEMA_ELEMENT: 99,
+ SELF: 100,
+ SOME: 101,
+ STABLE: 102,
+ STRICT: 103,
+ STRIP: 104,
+ TEXT: 105,
+ THEN: 106,
+ TO: 107,
+ TREAT: 108,
+ TYPESWITCH: 109,
+ UNION: 110,
+ UNORDERED: 111,
+ VALIDATE: 112,
+ VARIABLE: 113,
+ VERSION: 114,
+ WHERE: 115,
+ XQUERY: 116,
+ ALLOWING: 117,
+ CATCH: 118,
+ CONTEXT: 119,
+ COUNT: 120,
+ DECIMAL_FORMAT: 121,
+ DECIMAL_SEPARATOR: 122,
+ DIGIT: 123,
+ END: 124,
+ GROUP: 125,
+ GROUPING_SEPARATOR: 126,
+ INFINITY: 127,
+ MINUS_SIGN: 128,
+ NAMESPACE_NODE: 129,
+ NAN: 130,
+ NEXT: 131,
+ ONLY: 132,
+ PATTERN_SEPARATOR: 133,
+ PERCENT: 134,
+ PER_MILLE: 135,
+ PREVIOUS: 136,
+ SLIDING: 137,
+ START: 138,
+ SWITCH: 139,
+ TRY: 140,
+ TUMBLING: 141,
+ TYPE: 142,
+ WHEN: 143,
+ WINDOW: 144,
+ ZERO_DIGIT: 145,
+ AFTER: 146,
+ BEFORE: 147,
+ COPY: 148,
+ DELETE: 149,
+ FIRST: 150,
+ INSERT: 151,
+ INTO: 152,
+ POSITION: 153,
+ APPEND: 154,
+ LAST: 155,
+ MODIFY: 156,
+ NODES: 157,
+ RENAME: 158,
+ REPLACE: 159,
+ REVALIDATION: 160,
+ SKIP: 161,
+ UPDATING: 162,
+ VALUE: 163,
+ WITH: 164,
+ ALL: 165,
+ ANY: 166,
+ CONTAINS: 167,
+ CONTENT: 168,
+ DIACRITICS: 169,
+ DIFFERENT: 170,
+ DISTANCE: 171,
+ ENTIRE: 172,
+ EXACTLY: 173,
+ FROM: 174,
+ FT_OPTION: 175,
+ FTAND: 176,
+ FTNOT: 177,
+ FTOR: 178,
+ INSENSITIVE: 179,
+ LANGUAGE: 180,
+ LEVELS: 181,
+ LOWERCASE: 182,
+ MOST: 183,
+ NO: 184,
+ NOT: 185,
+ OCCURS: 186,
+ PARAGRAPH: 187,
+ PARAGRAPHS: 188,
+ PHRASE: 189,
+ RELATIONSHIP: 190,
+ SAME: 191,
+ SCORE: 192,
+ SENSITIVE: 193,
+ SENTENCE: 194,
+ SENTENCES: 195,
+ STEMMING: 196,
+ STOP: 197,
+ THESAURUS: 198,
+ TIMES: 199,
+ UPPERCASE: 200,
+ USING: 201,
+ WEIGHT: 202,
+ WILDCARDS: 203,
+ WITHOUT: 204,
+ WORD: 205,
+ WORDS: 206,
+ BREAK: 207,
+ CONTINUE: 208,
+ EXIT: 209,
+ LOOP: 210,
+ RETURNING: 211,
+ WHILE: 212,
+ CHECK: 213,
+ COLLECTION: 214,
+ CONSTRAINT: 215,
+ FOREACH: 216,
+ FOREIGN: 217,
+ INDEX: 218,
+ INTEGRITY: 219,
+ KEY: 220,
+ ON: 221,
+ UNIQUE: 222,
+ AMP_ER: 223,
+ APOS_ER: 224,
+ QUOT_ER: 225,
+ CONCAT: 226,
+ LPAREN: 227,
+ RPAREN: 228,
+ DOLLAR: 229,
+ L_UNION_BRACKET: 230,
+ R_UNION_BRACKET: 231,
+ LBRACKET: 232,
+ RBRACKET: 233,
+ LSQUARE: 234,
+ RSQUARE: 235,
+ EQUAL: 236,
+ BIND: 237,
+ NOTEQUAL: 238,
+ ANN_PERCENT: 239,
+ HASH: 240,
+ AMP: 241,
+ COMMA: 242,
+ QUESTION: 243,
+ STAR: 244,
+ PLUS: 245,
+ MINUS: 246,
+ SMALLER: 247,
+ GREATER: 248,
+ SMALLEREQ: 249,
+ GREATEREQ: 250,
+ SMALLER_SMALLER: 251,
+ GREATER_GREATER: 252,
+ SLASH: 253,
+ SLASH_SLASH: 254,
+ BANG: 255,
+ DOT: 256,
+ DOT_DOT: 257,
+ COLON: 258,
+ COLON_COLON: 259,
+ EMPTY_CLOSE_TAG: 260,
+ CLOSE_TAG: 261,
+ SEMICOLON: 262,
+ VBAR: 263,
+ PRAGMA_START: 264,
+ PRAGMA_END: 265,
+ XML_COMMENT_START: 266,
+ XML_COMMENT_END: 267,
+ PI_START: 268,
+ PI_END: 269,
+ ATTR_SIGN: 270,
+ Q: 271,
+ CHARREF_DEC: 272,
+ CHARREF_HEX: 273,
+ APOS: 274,
+ QUOT: 275,
+ NCNameStartChar: 276,
+ NCNameChar: 277,
+ L_NCName: 278,
+ Letter: 279,
+ HexLetter: 280,
+ Digit: 281,
+ Digits: 282,
+ S: 283,
+ SU: 284,
+ L_Pragma: 285,
+ L_DirCommentConstructor: 286,
+ L_DirPIConstructor: 287,
+ L_IntegerLiteral: 288,
+ L_DecimalLiteral: 289,
+ L_DoubleLiteral: 290,
+ L_Comment: 291,
+ L_AnyChar: 292,
+ L_QuotStringLiteralChar: 293,
+ L_AposStringLiteralChar: 294
+});
+
+(function(){
+var HIDDEN = org.antlr.runtime.Token.HIDDEN_CHANNEL,
+ EOF = org.antlr.runtime.Token.EOF;
+org.antlr.lang.extend(StringLexer, XQDTLexer, {
+ EOF : -1,
+ L_QuotAttrContentChar : 4,
+ L_AposAttrContentChar : 5,
+ L_ElementContentChar : 6,
+ L_CDataSection : 7,
+ L_PredefinedEntityRef : 8,
+ L_CharRef : 9,
+ ESCAPE_LBRACKET : 10,
+ ESCAPE_RBRACKET : 11,
+ ESCAPE_APOS : 12,
+ ESCAPE_QUOT : 13,
+ CDATA_START : 14,
+ CDATA_END : 15,
+ ANCESTOR : 16,
+ ANCESTOR_OR_SELF : 17,
+ AND : 18,
+ AS : 19,
+ ASCENDING : 20,
+ AT : 21,
+ ATTRIBUTE : 22,
+ BASE_URI : 23,
+ BOUNDARY_SPACE : 24,
+ BY : 25,
+ CASE : 26,
+ CAST : 27,
+ CASTABLE : 28,
+ CHILD : 29,
+ COLLATION : 30,
+ COMMENT : 31,
+ CONSTRUCTION : 32,
+ COPY_NAMESPACES : 33,
+ DECLARE : 34,
+ DEFAULT : 35,
+ DESCENDANT : 36,
+ DESCENDANT_OR_SELF : 37,
+ DESCENDING : 38,
+ DIV : 39,
+ DOCUMENT : 40,
+ DOCUMENT_NODE : 41,
+ ELEMENT : 42,
+ ELSE : 43,
+ EMPTY : 44,
+ EMPTY_SEQUENCE : 45,
+ ENCODING : 46,
+ EQ : 47,
+ EVERY : 48,
+ EXCEPT : 49,
+ EXTERNAL : 50,
+ FOLLOWING : 51,
+ FOLLOWING_SIBLING : 52,
+ FOR : 53,
+ FUNCTION : 54,
+ GE : 55,
+ GREATEST : 56,
+ GT : 57,
+ IDIV : 58,
+ IF : 59,
+ IMPORT : 60,
+ IN : 61,
+ INHERIT : 62,
+ INSTANCE : 63,
+ INTERSECT : 64,
+ IS : 65,
+ ITEM : 66,
+ LAX : 67,
+ LE : 68,
+ LEAST : 69,
+ LET : 70,
+ LT : 71,
+ MOD : 72,
+ MODULE : 73,
+ NAMESPACE : 74,
+ NE : 75,
+ NO_INHERIT : 76,
+ NO_PRESERVE : 77,
+ NODE : 78,
+ JSON : 79,
+ OF : 80,
+ OPTION : 81,
+ OR : 82,
+ ORDER : 83,
+ ORDERED : 84,
+ ORDERING : 85,
+ PARENT : 86,
+ PRECEDING : 87,
+ PRECEDING_SIBLING : 88,
+ PRESERVE : 89,
+ PROCESSING_INSTRUCTION : 90,
+ STRUCTURED_ITEM : 91,
+ JSON_ITEM : 92,
+ OBJECT : 93,
+ ARRAY : 94,
+ RETURN : 95,
+ SATISFIES : 96,
+ SCHEMA : 97,
+ SCHEMA_ATTRIBUTE : 98,
+ SCHEMA_ELEMENT : 99,
+ SELF : 100,
+ SOME : 101,
+ STABLE : 102,
+ STRICT : 103,
+ STRIP : 104,
+ TEXT : 105,
+ THEN : 106,
+ TO : 107,
+ TREAT : 108,
+ TYPESWITCH : 109,
+ UNION : 110,
+ UNORDERED : 111,
+ VALIDATE : 112,
+ VARIABLE : 113,
+ VERSION : 114,
+ WHERE : 115,
+ XQUERY : 116,
+ ALLOWING : 117,
+ CATCH : 118,
+ CONTEXT : 119,
+ COUNT : 120,
+ DECIMAL_FORMAT : 121,
+ DECIMAL_SEPARATOR : 122,
+ DIGIT : 123,
+ END : 124,
+ GROUP : 125,
+ GROUPING_SEPARATOR : 126,
+ INFINITY : 127,
+ MINUS_SIGN : 128,
+ NAMESPACE_NODE : 129,
+ NAN : 130,
+ NEXT : 131,
+ ONLY : 132,
+ PATTERN_SEPARATOR : 133,
+ PERCENT : 134,
+ PER_MILLE : 135,
+ PREVIOUS : 136,
+ SLIDING : 137,
+ START : 138,
+ SWITCH : 139,
+ TRY : 140,
+ TUMBLING : 141,
+ TYPE : 142,
+ WHEN : 143,
+ WINDOW : 144,
+ ZERO_DIGIT : 145,
+ AFTER : 146,
+ BEFORE : 147,
+ COPY : 148,
+ DELETE : 149,
+ FIRST : 150,
+ INSERT : 151,
+ INTO : 152,
+ POSITION : 153,
+ APPEND : 154,
+ LAST : 155,
+ MODIFY : 156,
+ NODES : 157,
+ RENAME : 158,
+ REPLACE : 159,
+ REVALIDATION : 160,
+ SKIP : 161,
+ UPDATING : 162,
+ VALUE : 163,
+ WITH : 164,
+ ALL : 165,
+ ANY : 166,
+ CONTAINS : 167,
+ CONTENT : 168,
+ DIACRITICS : 169,
+ DIFFERENT : 170,
+ DISTANCE : 171,
+ ENTIRE : 172,
+ EXACTLY : 173,
+ FROM : 174,
+ FT_OPTION : 175,
+ FTAND : 176,
+ FTNOT : 177,
+ FTOR : 178,
+ INSENSITIVE : 179,
+ LANGUAGE : 180,
+ LEVELS : 181,
+ LOWERCASE : 182,
+ MOST : 183,
+ NO : 184,
+ NOT : 185,
+ OCCURS : 186,
+ PARAGRAPH : 187,
+ PARAGRAPHS : 188,
+ PHRASE : 189,
+ RELATIONSHIP : 190,
+ SAME : 191,
+ SCORE : 192,
+ SENSITIVE : 193,
+ SENTENCE : 194,
+ SENTENCES : 195,
+ STEMMING : 196,
+ STOP : 197,
+ THESAURUS : 198,
+ TIMES : 199,
+ UPPERCASE : 200,
+ USING : 201,
+ WEIGHT : 202,
+ WILDCARDS : 203,
+ WITHOUT : 204,
+ WORD : 205,
+ WORDS : 206,
+ BREAK : 207,
+ CONTINUE : 208,
+ EXIT : 209,
+ LOOP : 210,
+ RETURNING : 211,
+ WHILE : 212,
+ CHECK : 213,
+ COLLECTION : 214,
+ CONSTRAINT : 215,
+ FOREACH : 216,
+ FOREIGN : 217,
+ INDEX : 218,
+ INTEGRITY : 219,
+ KEY : 220,
+ ON : 221,
+ UNIQUE : 222,
+ AMP_ER : 223,
+ APOS_ER : 224,
+ QUOT_ER : 225,
+ CONCAT : 226,
+ LPAREN : 227,
+ RPAREN : 228,
+ DOLLAR : 229,
+ L_UNION_BRACKET : 230,
+ R_UNION_BRACKET : 231,
+ LBRACKET : 232,
+ RBRACKET : 233,
+ LSQUARE : 234,
+ RSQUARE : 235,
+ EQUAL : 236,
+ BIND : 237,
+ NOTEQUAL : 238,
+ ANN_PERCENT : 239,
+ HASH : 240,
+ AMP : 241,
+ COMMA : 242,
+ QUESTION : 243,
+ STAR : 244,
+ PLUS : 245,
+ MINUS : 246,
+ SMALLER : 247,
+ GREATER : 248,
+ SMALLEREQ : 249,
+ GREATEREQ : 250,
+ SMALLER_SMALLER : 251,
+ GREATER_GREATER : 252,
+ SLASH : 253,
+ SLASH_SLASH : 254,
+ BANG : 255,
+ DOT : 256,
+ DOT_DOT : 257,
+ COLON : 258,
+ COLON_COLON : 259,
+ EMPTY_CLOSE_TAG : 260,
+ CLOSE_TAG : 261,
+ SEMICOLON : 262,
+ VBAR : 263,
+ PRAGMA_START : 264,
+ PRAGMA_END : 265,
+ XML_COMMENT_START : 266,
+ XML_COMMENT_END : 267,
+ PI_START : 268,
+ PI_END : 269,
+ ATTR_SIGN : 270,
+ Q : 271,
+ CHARREF_DEC : 272,
+ CHARREF_HEX : 273,
+ APOS : 274,
+ QUOT : 275,
+ NCNameStartChar : 276,
+ NCNameChar : 277,
+ L_NCName : 278,
+ Letter : 279,
+ HexLetter : 280,
+ Digit : 281,
+ Digits : 282,
+ S : 283,
+ SU : 284,
+ L_Pragma : 285,
+ L_DirCommentConstructor : 286,
+ L_DirPIConstructor : 287,
+ L_IntegerLiteral : 288,
+ L_DecimalLiteral : 289,
+ L_DoubleLiteral : 290,
+ L_Comment : 291,
+ L_AnyChar : 292,
+ L_QuotStringLiteralChar : 293,
+ L_AposStringLiteralChar : 294,
+ getGrammarFileName: function() { return "/Users/wcandillon/28msec/xquery.js/xquery/StringLexer.g"; }
+});
+org.antlr.lang.augmentObject(StringLexer.prototype, {
+ // $ANTLR start QUOT
+ mQUOT: function() {
+ try {
+ var _type = this.QUOT;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/StringLexer.g:66:6: ({...}? => '\"' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/StringLexer.g:66:8: {...}? => '\"'
+ if ( !(( this.inQuotStr )) ) {
+ throw new org.antlr.runtime.FailedPredicateException(this.input, "QUOT", " this.inQuotStr ");
+ }
+ this.match('\"');
+ this.inQuotStr = !this.inQuotStr;
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "QUOT",
+
+ // $ANTLR start APOS
+ mAPOS: function() {
+ try {
+ var _type = this.APOS;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/StringLexer.g:67:6: ({...}? => '\\'' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/StringLexer.g:67:8: {...}? => '\\''
+ if ( !(( this.inAposStr )) ) {
+ throw new org.antlr.runtime.FailedPredicateException(this.input, "APOS", " this.inAposStr ");
+ }
+ this.match('\'');
+ this.inAposStr = !this.inAposStr;
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "APOS",
+
+ // $ANTLR start ESCAPE_QUOT
+ mESCAPE_QUOT: function() {
+ try {
+ var _type = this.ESCAPE_QUOT;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/StringLexer.g:68:13: ({...}? => '\"\"' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/StringLexer.g:68:15: {...}? => '\"\"'
+ if ( !(( this.inQuotStr )) ) {
+ throw new org.antlr.runtime.FailedPredicateException(this.input, "ESCAPE_QUOT", " this.inQuotStr ");
+ }
+ this.match("\"\"");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "ESCAPE_QUOT",
+
+ // $ANTLR start ESCAPE_APOS
+ mESCAPE_APOS: function() {
+ try {
+ var _type = this.ESCAPE_APOS;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/StringLexer.g:69:13: ({...}? => '\\'\\'' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/StringLexer.g:69:15: {...}? => '\\'\\''
+ if ( !(( this.inAposStr )) ) {
+ throw new org.antlr.runtime.FailedPredicateException(this.input, "ESCAPE_APOS", " this.inAposStr ");
+ }
+ this.match("''");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "ESCAPE_APOS",
+
+ // $ANTLR start L_PredefinedEntityRef
+ mL_PredefinedEntityRef: function() {
+ try {
+ var _type = this.L_PredefinedEntityRef;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/StringLexer.g:73:2: ({...}? => '&' ( 'lt' | 'gt' | 'apos' | 'quot' | 'amp' ) ';' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/StringLexer.g:73:4: {...}? => '&' ( 'lt' | 'gt' | 'apos' | 'quot' | 'amp' ) ';'
+ if ( !(( this.inQuotStr | this.inAposStr )) ) {
+ throw new org.antlr.runtime.FailedPredicateException(this.input, "L_PredefinedEntityRef", " this.inQuotStr | this.inAposStr ");
+ }
+ this.match('&');
+ // /Users/wcandillon/28msec/xquery.js/xquery/StringLexer.g:73:48: ( 'lt' | 'gt' | 'apos' | 'quot' | 'amp' )
+ var alt1=5;
+ switch ( this.input.LA(1) ) {
+ case 'l':
+ alt1=1;
+ break;
+ case 'g':
+ alt1=2;
+ break;
+ case 'a':
+ var LA1_3 = this.input.LA(2);
+
+ if ( (LA1_3=='p') ) {
+ alt1=3;
+ }
+ else if ( (LA1_3=='m') ) {
+ alt1=5;
+ }
+ else {
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 1, 3, this.input);
+
+ throw nvae;
+ }
+ break;
+ case 'q':
+ alt1=4;
+ break;
+ default:
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 1, 0, this.input);
+
+ throw nvae;
+ }
+
+ switch (alt1) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/StringLexer.g:73:49: 'lt'
+ this.match("lt");
+
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/StringLexer.g:73:56: 'gt'
+ this.match("gt");
+
+
+
+ break;
+ case 3 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/StringLexer.g:73:63: 'apos'
+ this.match("apos");
+
+
+
+ break;
+ case 4 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/StringLexer.g:73:72: 'quot'
+ this.match("quot");
+
+
+
+ break;
+ case 5 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/StringLexer.g:73:81: 'amp'
+ this.match("amp");
+
+
+
+ break;
+
+ }
+
+ this.match(';');
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "L_PredefinedEntityRef",
+
+ // $ANTLR start L_CharRef
+ mL_CharRef: function() {
+ try {
+ var _type = this.L_CharRef;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/StringLexer.g:78:2: ({...}? => '&#' ( '0' .. '9' )+ ';' | '&#x' ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' )+ ';' )
+ var alt4=2;
+ var LA4_0 = this.input.LA(1);
+
+ if ( (LA4_0=='&') ) {
+ var LA4_1 = this.input.LA(2);
+
+ if ( (LA4_1=='#') ) {
+ var LA4_2 = this.input.LA(3);
+
+ if ( (LA4_2=='x') ) {
+ alt4=2;
+ }
+ else if ( ((LA4_2>='0' && LA4_2<='9')) && (( this.inQuotStr | this.inAposStr ))) {
+ alt4=1;
+ }
+ else {
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 4, 2, this.input);
+
+ throw nvae;
+ }
+ }
+ else {
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 4, 1, this.input);
+
+ throw nvae;
+ }
+ }
+ else {
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 4, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt4) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/StringLexer.g:78:4: {...}? => '&#' ( '0' .. '9' )+ ';'
+ if ( !(( this.inQuotStr | this.inAposStr )) ) {
+ throw new org.antlr.runtime.FailedPredicateException(this.input, "L_CharRef", " this.inQuotStr | this.inAposStr ");
+ }
+ this.match("&#");
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/StringLexer.g:78:49: ( '0' .. '9' )+
+ var cnt2=0;
+ loop2:
+ do {
+ var alt2=2;
+ var LA2_0 = this.input.LA(1);
+
+ if ( ((LA2_0>='0' && LA2_0<='9')) ) {
+ alt2=1;
+ }
+
+
+ switch (alt2) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/StringLexer.g:78:49: '0' .. '9'
+ this.matchRange('0','9');
+
+
+ break;
+
+ default :
+ if ( cnt2 >= 1 ) {
+ break loop2;
+ }
+ var eee = new org.antlr.runtime.EarlyExitException(2, this.input);
+ throw eee;
+ }
+ cnt2++;
+ } while (true);
+
+ this.match(';');
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/StringLexer.g:78:65: '&#x' ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' )+ ';'
+ this.match("&#x");
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/StringLexer.g:78:71: ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' )+
+ var cnt3=0;
+ loop3:
+ do {
+ var alt3=2;
+ var LA3_0 = this.input.LA(1);
+
+ if ( ((LA3_0>='0' && LA3_0<='9')||(LA3_0>='A' && LA3_0<='F')||(LA3_0>='a' && LA3_0<='f')) ) {
+ alt3=1;
+ }
+
+
+ switch (alt3) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/StringLexer.g:
+ if ( (this.input.LA(1)>='0' && this.input.LA(1)<='9')||(this.input.LA(1)>='A' && this.input.LA(1)<='F')||(this.input.LA(1)>='a' && this.input.LA(1)<='f') ) {
+ this.input.consume();
+
+ }
+ else {
+ var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
+ this.recover(mse);
+ throw mse;}
+
+
+
+ break;
+
+ default :
+ if ( cnt3 >= 1 ) {
+ break loop3;
+ }
+ var eee = new org.antlr.runtime.EarlyExitException(3, this.input);
+ throw eee;
+ }
+ cnt3++;
+ } while (true);
+
+ this.match(';');
+
+
+ break;
+
+ }
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "L_CharRef",
+
+ // $ANTLR start L_QuotStringLiteralChar
+ mL_QuotStringLiteralChar: function() {
+ try {
+ var _type = this.L_QuotStringLiteralChar;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/StringLexer.g:82:2: ({...}? => ( '\\u0009' | '\\u000A' | '\\u000D' | '\\u0020' .. '\\u0021' | '\\u0023' .. '\\u0025' | '\\u0027' .. '\\uD7FF' | '\\uE000' .. '\\uFFFD' )+ )
+ // /Users/wcandillon/28msec/xquery.js/xquery/StringLexer.g:82:4: {...}? => ( '\\u0009' | '\\u000A' | '\\u000D' | '\\u0020' .. '\\u0021' | '\\u0023' .. '\\u0025' | '\\u0027' .. '\\uD7FF' | '\\uE000' .. '\\uFFFD' )+
+ if ( !(( this.inQuotStr )) ) {
+ throw new org.antlr.runtime.FailedPredicateException(this.input, "L_QuotStringLiteralChar", " this.inQuotStr ");
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/StringLexer.g:83:3: ( '\\u0009' | '\\u000A' | '\\u000D' | '\\u0020' .. '\\u0021' | '\\u0023' .. '\\u0025' | '\\u0027' .. '\\uD7FF' | '\\uE000' .. '\\uFFFD' )+
+ var cnt5=0;
+ loop5:
+ do {
+ var alt5=2;
+ var LA5_0 = this.input.LA(1);
+
+ if ( ((LA5_0>='\t' && LA5_0<='\n')||LA5_0=='\r'||(LA5_0>=' ' && LA5_0<='!')||(LA5_0>='#' && LA5_0<='%')||(LA5_0>='\'' && LA5_0<='\uD7FF')||(LA5_0>='\uE000' && LA5_0<='\uFFFD')) ) {
+ alt5=1;
+ }
+
+
+ switch (alt5) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/StringLexer.g:
+ if ( (this.input.LA(1)>='\t' && this.input.LA(1)<='\n')||this.input.LA(1)=='\r'||(this.input.LA(1)>=' ' && this.input.LA(1)<='!')||(this.input.LA(1)>='#' && this.input.LA(1)<='%')||(this.input.LA(1)>='\'' && this.input.LA(1)<='\uD7FF')||(this.input.LA(1)>='\uE000' && this.input.LA(1)<='\uFFFD') ) {
+ this.input.consume();
+
+ }
+ else {
+ var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
+ this.recover(mse);
+ throw mse;}
+
+
+
+ break;
+
+ default :
+ if ( cnt5 >= 1 ) {
+ break loop5;
+ }
+ var eee = new org.antlr.runtime.EarlyExitException(5, this.input);
+ throw eee;
+ }
+ cnt5++;
+ } while (true);
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "L_QuotStringLiteralChar",
+
+ // $ANTLR start L_AposStringLiteralChar
+ mL_AposStringLiteralChar: function() {
+ try {
+ var _type = this.L_AposStringLiteralChar;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/StringLexer.g:88:2: ({...}? => ( '\\u0009' | '\\u000A' | '\\u000D' | '\\u0020' .. '\\u0025' | '\\u0028' .. '\\uD7FF' | '\\uE000' .. '\\uFFFD' )+ )
+ // /Users/wcandillon/28msec/xquery.js/xquery/StringLexer.g:88:4: {...}? => ( '\\u0009' | '\\u000A' | '\\u000D' | '\\u0020' .. '\\u0025' | '\\u0028' .. '\\uD7FF' | '\\uE000' .. '\\uFFFD' )+
+ if ( !(( this.inAposStr )) ) {
+ throw new org.antlr.runtime.FailedPredicateException(this.input, "L_AposStringLiteralChar", " this.inAposStr ");
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/StringLexer.g:89:3: ( '\\u0009' | '\\u000A' | '\\u000D' | '\\u0020' .. '\\u0025' | '\\u0028' .. '\\uD7FF' | '\\uE000' .. '\\uFFFD' )+
+ var cnt6=0;
+ loop6:
+ do {
+ var alt6=2;
+ var LA6_0 = this.input.LA(1);
+
+ if ( ((LA6_0>='\t' && LA6_0<='\n')||LA6_0=='\r'||(LA6_0>=' ' && LA6_0<='%')||(LA6_0>='(' && LA6_0<='\uD7FF')||(LA6_0>='\uE000' && LA6_0<='\uFFFD')) ) {
+ alt6=1;
+ }
+
+
+ switch (alt6) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/StringLexer.g:
+ if ( (this.input.LA(1)>='\t' && this.input.LA(1)<='\n')||this.input.LA(1)=='\r'||(this.input.LA(1)>=' ' && this.input.LA(1)<='%')||(this.input.LA(1)>='(' && this.input.LA(1)<='\uD7FF')||(this.input.LA(1)>='\uE000' && this.input.LA(1)<='\uFFFD') ) {
+ this.input.consume();
+
+ }
+ else {
+ var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
+ this.recover(mse);
+ throw mse;}
+
+
+
+ break;
+
+ default :
+ if ( cnt6 >= 1 ) {
+ break loop6;
+ }
+ var eee = new org.antlr.runtime.EarlyExitException(6, this.input);
+ throw eee;
+ }
+ cnt6++;
+ } while (true);
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "L_AposStringLiteralChar",
+
+ // $ANTLR start L_AnyChar
+ mL_AnyChar: function() {
+ try {
+ var _type = this.L_AnyChar;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/StringLexer.g:98:5: ({...}? => ( '\\u0009' | '\\u000A' | '\\u000D' | '\\u0020' .. '\\u0025' | '\\u0027' .. '\\u003B' | '\\u003D' .. '\\u007A' | '\\u007C' | '\\u007E' .. '\\uD7FF' | '\\uE000' .. '\\uFFFD' )+ )
+ // /Users/wcandillon/28msec/xquery.js/xquery/StringLexer.g:98:9: {...}? => ( '\\u0009' | '\\u000A' | '\\u000D' | '\\u0020' .. '\\u0025' | '\\u0027' .. '\\u003B' | '\\u003D' .. '\\u007A' | '\\u007C' | '\\u007E' .. '\\uD7FF' | '\\uE000' .. '\\uFFFD' )+
+ if ( !(( !this.inQuotStr && !this.inAposStr )) ) {
+ throw new org.antlr.runtime.FailedPredicateException(this.input, "L_AnyChar", " !this.inQuotStr && !this.inAposStr ");
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/StringLexer.g:99:9: ( '\\u0009' | '\\u000A' | '\\u000D' | '\\u0020' .. '\\u0025' | '\\u0027' .. '\\u003B' | '\\u003D' .. '\\u007A' | '\\u007C' | '\\u007E' .. '\\uD7FF' | '\\uE000' .. '\\uFFFD' )+
+ var cnt7=0;
+ loop7:
+ do {
+ var alt7=2;
+ var LA7_0 = this.input.LA(1);
+
+ if ( ((LA7_0>='\t' && LA7_0<='\n')||LA7_0=='\r'||(LA7_0>=' ' && LA7_0<='%')||(LA7_0>='\'' && LA7_0<=';')||(LA7_0>='=' && LA7_0<='z')||LA7_0=='|'||(LA7_0>='~' && LA7_0<='\uD7FF')||(LA7_0>='\uE000' && LA7_0<='\uFFFD')) ) {
+ alt7=1;
+ }
+
+
+ switch (alt7) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/StringLexer.g:
+ if ( (this.input.LA(1)>='\t' && this.input.LA(1)<='\n')||this.input.LA(1)=='\r'||(this.input.LA(1)>=' ' && this.input.LA(1)<='%')||(this.input.LA(1)>='\'' && this.input.LA(1)<=';')||(this.input.LA(1)>='=' && this.input.LA(1)<='z')||this.input.LA(1)=='|'||(this.input.LA(1)>='~' && this.input.LA(1)<='\uD7FF')||(this.input.LA(1)>='\uE000' && this.input.LA(1)<='\uFFFD') ) {
+ this.input.consume();
+
+ }
+ else {
+ var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
+ this.recover(mse);
+ throw mse;}
+
+
+
+ break;
+
+ default :
+ if ( cnt7 >= 1 ) {
+ break loop7;
+ }
+ var eee = new org.antlr.runtime.EarlyExitException(7, this.input);
+ throw eee;
+ }
+ cnt7++;
+ } while (true);
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "L_AnyChar",
+
+ mTokens: function() {
+ // /Users/wcandillon/28msec/xquery.js/xquery/StringLexer.g:1:8: ( QUOT | APOS | ESCAPE_QUOT | ESCAPE_APOS | L_PredefinedEntityRef | L_CharRef | L_QuotStringLiteralChar | L_AposStringLiteralChar | L_AnyChar )
+ var alt8=9;
+ alt8 = this.dfa8.predict(this.input);
+ switch (alt8) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/StringLexer.g:1:10: QUOT
+ this.mQUOT();
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/StringLexer.g:1:15: APOS
+ this.mAPOS();
+
+
+ break;
+ case 3 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/StringLexer.g:1:20: ESCAPE_QUOT
+ this.mESCAPE_QUOT();
+
+
+ break;
+ case 4 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/StringLexer.g:1:32: ESCAPE_APOS
+ this.mESCAPE_APOS();
+
+
+ break;
+ case 5 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/StringLexer.g:1:44: L_PredefinedEntityRef
+ this.mL_PredefinedEntityRef();
+
+
+ break;
+ case 6 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/StringLexer.g:1:66: L_CharRef
+ this.mL_CharRef();
+
+
+ break;
+ case 7 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/StringLexer.g:1:76: L_QuotStringLiteralChar
+ this.mL_QuotStringLiteralChar();
+
+
+ break;
+ case 8 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/StringLexer.g:1:100: L_AposStringLiteralChar
+ this.mL_AposStringLiteralChar();
+
+
+ break;
+ case 9 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/StringLexer.g:1:124: L_AnyChar
+ this.mL_AnyChar();
+
+
+ break;
+
+ }
+
+ }
+
+}, true); // important to pass true to overwrite default implementations
+
+org.antlr.lang.augmentObject(StringLexer, {
+ DFA8_eotS:
+ "\u0001\uffff\u0001\u0007\u0001\u000c\u0001\uffff\u0001\u0011\u0001"+
+ "\u0012\u0001\u0013\u0001\uffff\u0001\u0015\u0002\uffff\u0001\u0016\u0001"+
+ "\uffff\u0001\u0018\u000d\uffff",
+ DFA8_eofS:
+ "\u001b\uffff",
+ DFA8_minS:
+ "\u0003\u0009\u0001\u0023\u0003\u0009\u0001\u0000\u0001\u0009\u0002"+
+ "\uffff\u0001\u0009\u0001\u0000\u0001\u0009\u0003\uffff\u0003\u0000\u0001"+
+ "\uffff\u0002\u0000\u0001\uffff\u0001\u0000\u0002\uffff",
+ DFA8_maxS:
+ "\u0003\ufffd\u0001\u0071\u0003\ufffd\u0001\u0000\u0001\ufffd\u0002"+
+ "\uffff\u0001\ufffd\u0001\u0000\u0001\ufffd\u0003\uffff\u0003\u0000\u0001"+
+ "\uffff\u0002\u0000\u0001\uffff\u0001\u0000\u0002\uffff",
+ DFA8_acceptS:
+ "\u0009\uffff\u0001\u0008\u0001\u0009\u0003\uffff\u0001\u0007\u0001"+
+ "\u0006\u0001\u0005\u0003\uffff\u0001\u0001\u0002\uffff\u0001\u0002\u0001"+
+ "\uffff\u0001\u0003\u0001\u0004",
+ DFA8_specialS:
+ "\u0001\u0007\u0001\u000e\u0001\u0000\u0001\u0004\u0001\u0011\u0001"+
+ "\u000a\u0001\u0005\u0001\u0009\u0001\u0010\u0002\uffff\u0001\u000f\u0001"+
+ "\u0008\u0001\u0006\u0003\uffff\u0001\u000d\u0001\u0003\u0001\u000b\u0001"+
+ "\uffff\u0001\u0001\u0001\u000c\u0001\uffff\u0001\u0002\u0002\uffff}>",
+ DFA8_transitionS: [
+ "\u0002\u0004\u0002\uffff\u0001\u0004\u0012\uffff\u0002\u0004"+
+ "\u0001\u0001\u0003\u0004\u0001\u0003\u0001\u0002\u0014\u0004"+
+ "\u0001\u0005\u003e\u0004\u0001\u0005\u0001\u0004\u0001\u0005"+
+ "\ud782\u0004\u0800\uffff\u1ffe\u0004",
+ "\u0002\u0008\u0002\uffff\u0001\u0008\u0012\uffff\u0002\u0008"+
+ "\u0001\u0006\u0003\u0008\u0001\uffff\u0001\u000a\u0014\u0008"+
+ "\u0001\u0009\u003e\u0008\u0001\u0009\u0001\u0008\u0001\u0009"+
+ "\ud782\u0008\u0800\uffff\u1ffe\u0008",
+ "\u0002\u000d\u0002\uffff\u0001\u000d\u0012\uffff\u0002\u000d"+
+ "\u0001\u000a\u0003\u000d\u0001\uffff\u0001\u000b\u0014\u000d"+
+ "\u0001\u000e\u003e\u000d\u0001\u000e\u0001\u000d\u0001\u000e"+
+ "\ud782\u000d\u0800\uffff\u1ffe\u000d",
+ "\u0001\u000f\u003d\uffff\u0001\u0010\u0005\uffff\u0001\u0010"+
+ "\u0004\uffff\u0001\u0010\u0004\uffff\u0001\u0010",
+ "\u0002\u0004\u0002\uffff\u0001\u0004\u0012\uffff\u0002\u0004"+
+ "\u0001\u0008\u0003\u0004\u0001\uffff\u0001\u000d\u0014\u0004"+
+ "\u0001\u0005\u003e\u0004\u0001\u0005\u0001\u0004\u0001\u0005"+
+ "\ud782\u0004\u0800\uffff\u1ffe\u0004",
+ "\u0002\u0005\u0002\uffff\u0001\u0005\u0012\uffff\u0002\u0005"+
+ "\u0001\u0009\u0003\u0005\u0001\uffff\u0001\u000e\ud7d8\u0005"+
+ "\u0800\uffff\u1ffe\u0005",
+ "\u0002\u0008\u0002\uffff\u0001\u0008\u0012\uffff\u0006\u0008"+
+ "\u0001\uffff\u0001\u000a\u0014\u0008\u0001\u0009\u003e\u0008"+
+ "\u0001\u0009\u0001\u0008\u0001\u0009\ud782\u0008\u0800\uffff"+
+ "\u1ffe\u0008",
+ "\u0001\uffff",
+ "\u0002\u0008\u0002\uffff\u0001\u0008\u0012\uffff\u0006\u0008"+
+ "\u0001\uffff\u0001\u000a\u0014\u0008\u0001\u0009\u003e\u0008"+
+ "\u0001\u0009\u0001\u0008\u0001\u0009\ud782\u0008\u0800\uffff"+
+ "\u1ffe\u0008",
+ "",
+ "",
+ "\u0002\u000d\u0002\uffff\u0001\u000d\u0012\uffff\u0002\u000d"+
+ "\u0001\u000a\u0003\u000d\u0001\uffff\u0015\u000d\u0001\u000e"+
+ "\u003e\u000d\u0001\u000e\u0001\u000d\u0001\u000e\ud782\u000d"+
+ "\u0800\uffff\u1ffe\u000d",
+ "\u0001\uffff",
+ "\u0002\u000d\u0002\uffff\u0001\u000d\u0012\uffff\u0002\u000d"+
+ "\u0001\u000a\u0003\u000d\u0001\uffff\u0015\u000d\u0001\u000e"+
+ "\u003e\u000d\u0001\u000e\u0001\u000d\u0001\u000e\ud782\u000d"+
+ "\u0800\uffff\u1ffe\u000d",
+ "",
+ "",
+ "",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "",
+ "\u0001\uffff",
+ "",
+ ""
+ ]
+});
+
+org.antlr.lang.augmentObject(StringLexer, {
+ DFA8_eot:
+ org.antlr.runtime.DFA.unpackEncodedString(StringLexer.DFA8_eotS),
+ DFA8_eof:
+ org.antlr.runtime.DFA.unpackEncodedString(StringLexer.DFA8_eofS),
+ DFA8_min:
+ org.antlr.runtime.DFA.unpackEncodedStringToUnsignedChars(StringLexer.DFA8_minS),
+ DFA8_max:
+ org.antlr.runtime.DFA.unpackEncodedStringToUnsignedChars(StringLexer.DFA8_maxS),
+ DFA8_accept:
+ org.antlr.runtime.DFA.unpackEncodedString(StringLexer.DFA8_acceptS),
+ DFA8_special:
+ org.antlr.runtime.DFA.unpackEncodedString(StringLexer.DFA8_specialS),
+ DFA8_transition: (function() {
+ var a = [],
+ i,
+ numStates = StringLexer.DFA8_transitionS.length;
+ for (i=0; i<numStates; i++) {
+ a.push(org.antlr.runtime.DFA.unpackEncodedString(StringLexer.DFA8_transitionS[i]));
+ }
+ return a;
+ })()
+});
+
+StringLexer.DFA8 = function(recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 8;
+ this.eot = StringLexer.DFA8_eot;
+ this.eof = StringLexer.DFA8_eof;
+ this.min = StringLexer.DFA8_min;
+ this.max = StringLexer.DFA8_max;
+ this.accept = StringLexer.DFA8_accept;
+ this.special = StringLexer.DFA8_special;
+ this.transition = StringLexer.DFA8_transition;
+};
+
+org.antlr.lang.extend(StringLexer.DFA8, org.antlr.runtime.DFA, {
+ getDescription: function() {
+ return "1:1: Tokens : ( QUOT | APOS | ESCAPE_QUOT | ESCAPE_APOS | L_PredefinedEntityRef | L_CharRef | L_QuotStringLiteralChar | L_AposStringLiteralChar | L_AnyChar );";
+ },
+ specialStateTransition: function(s, input) {
+ var _s = s;
+ var retval = (function(s, input) {
+ switch ( s ) {
+ case 0 :
+ var LA8_2 = input.LA(1);
+
+
+ var index8_2 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (LA8_2=='\'') && ((( this.inAposStr )||( this.inQuotStr )||( !this.inQuotStr && !this.inAposStr )))) {s = 11;}
+
+ else if ( ((LA8_2>='\t' && LA8_2<='\n')||LA8_2=='\r'||(LA8_2>=' ' && LA8_2<='!')||(LA8_2>='#' && LA8_2<='%')||(LA8_2>='(' && LA8_2<=';')||(LA8_2>='=' && LA8_2<='z')||LA8_2=='|'||(LA8_2>='~' && LA8_2<='\uD7FF')||(LA8_2>='\uE000' && LA8_2<='\uFFFD')) && ((( this.inQuotStr )||( !this.inQuotStr && !this.inAposStr )))) {s = 13;}
+
+ else if ( (LA8_2=='<'||LA8_2=='{'||LA8_2=='}') && (( this.inQuotStr ))) {s = 14;}
+
+ else if ( (LA8_2=='\"') && (( !this.inQuotStr && !this.inAposStr ))) {s = 10;}
+
+ else s = 12;
+
+
+ input.seek(index8_2);
+ if ( s>=0 ) return s;
+ break;
+ case 1 :
+ var LA8_21 = input.LA(1);
+
+
+ var index8_21 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (( this.inAposStr )) ) {s = 9;}
+
+ else if ( (( !this.inQuotStr && !this.inAposStr )) ) {s = 10;}
+
+
+ input.seek(index8_21);
+ if ( s>=0 ) return s;
+ break;
+ case 2 :
+ var LA8_24 = input.LA(1);
+
+
+ var index8_24 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (( this.inQuotStr )) ) {s = 14;}
+
+ else if ( (( !this.inQuotStr && !this.inAposStr )) ) {s = 10;}
+
+
+ input.seek(index8_24);
+ if ( s>=0 ) return s;
+ break;
+ case 3 :
+ var LA8_18 = input.LA(1);
+
+
+ var index8_18 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (( this.inQuotStr )) ) {s = 14;}
+
+ else if ( (( this.inAposStr )) ) {s = 9;}
+
+
+ input.seek(index8_18);
+ if ( s>=0 ) return s;
+ break;
+ case 4 :
+ var LA8_3 = input.LA(1);
+
+
+ var index8_3 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (LA8_3=='#') ) {s = 15;}
+
+ else if ( (LA8_3=='a'||LA8_3=='g'||LA8_3=='l'||LA8_3=='q') && (( this.inQuotStr | this.inAposStr ))) {s = 16;}
+
+
+ input.seek(index8_3);
+ if ( s>=0 ) return s;
+ break;
+ case 5 :
+ var LA8_6 = input.LA(1);
+
+
+ var index8_6 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((LA8_6>='\t' && LA8_6<='\n')||LA8_6=='\r'||(LA8_6>=' ' && LA8_6<='%')||(LA8_6>='(' && LA8_6<=';')||(LA8_6>='=' && LA8_6<='z')||LA8_6=='|'||(LA8_6>='~' && LA8_6<='\uD7FF')||(LA8_6>='\uE000' && LA8_6<='\uFFFD')) && ((( this.inAposStr )||( !this.inQuotStr && !this.inAposStr )))) {s = 8;}
+
+ else if ( (LA8_6=='<'||LA8_6=='{'||LA8_6=='}') && (( this.inAposStr ))) {s = 9;}
+
+ else if ( (LA8_6=='\'') && (( !this.inQuotStr && !this.inAposStr ))) {s = 10;}
+
+ else s = 19;
+
+
+ input.seek(index8_6);
+ if ( s>=0 ) return s;
+ break;
+ case 6 :
+ var LA8_13 = input.LA(1);
+
+
+ var index8_13 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((LA8_13>='\t' && LA8_13<='\n')||LA8_13=='\r'||(LA8_13>=' ' && LA8_13<='!')||(LA8_13>='#' && LA8_13<='%')||(LA8_13>='\'' && LA8_13<=';')||(LA8_13>='=' && LA8_13<='z')||LA8_13=='|'||(LA8_13>='~' && LA8_13<='\uD7FF')||(LA8_13>='\uE000' && LA8_13<='\uFFFD')) && ((( this.inQuotStr )||( !this.inQuotStr && !this.inAposStr )))) {s = 13;}
+
+ else if ( (LA8_13=='<'||LA8_13=='{'||LA8_13=='}') && (( this.inQuotStr ))) {s = 14;}
+
+ else if ( (LA8_13=='\"') && (( !this.inQuotStr && !this.inAposStr ))) {s = 10;}
+
+ else s = 24;
+
+
+ input.seek(index8_13);
+ if ( s>=0 ) return s;
+ break;
+ case 7 :
+ var LA8_0 = input.LA(1);
+
+
+ var index8_0 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (LA8_0=='\"') && ((( this.inAposStr )||( this.inQuotStr )||( !this.inQuotStr && !this.inAposStr )))) {s = 1;}
+
+ else if ( (LA8_0=='\'') && ((( this.inAposStr )||( this.inQuotStr )||( !this.inQuotStr && !this.inAposStr )))) {s = 2;}
+
+ else if ( (LA8_0=='&') ) {s = 3;}
+
+ else if ( ((LA8_0>='\t' && LA8_0<='\n')||LA8_0=='\r'||(LA8_0>=' ' && LA8_0<='!')||(LA8_0>='#' && LA8_0<='%')||(LA8_0>='(' && LA8_0<=';')||(LA8_0>='=' && LA8_0<='z')||LA8_0=='|'||(LA8_0>='~' && LA8_0<='\uD7FF')||(LA8_0>='\uE000' && LA8_0<='\uFFFD')) && ((( this.inAposStr )||( this.inQuotStr )||( !this.inQuotStr && !this.inAposStr )))) {s = 4;}
+
+ else if ( (LA8_0=='<'||LA8_0=='{'||LA8_0=='}') && ((( this.inAposStr )||( this.inQuotStr )))) {s = 5;}
+
+
+ input.seek(index8_0);
+ if ( s>=0 ) return s;
+ break;
+ case 8 :
+ var LA8_12 = input.LA(1);
+
+
+ var index8_12 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (( this.inAposStr )) ) {s = 23;}
+
+ else if ( (( this.inQuotStr )) ) {s = 14;}
+
+ else if ( (( !this.inQuotStr && !this.inAposStr )) ) {s = 10;}
+
+
+ input.seek(index8_12);
+ if ( s>=0 ) return s;
+ break;
+ case 9 :
+ var LA8_7 = input.LA(1);
+
+
+ var index8_7 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (( this.inQuotStr )) ) {s = 20;}
+
+ else if ( (( this.inAposStr )) ) {s = 9;}
+
+ else if ( (( !this.inQuotStr && !this.inAposStr )) ) {s = 10;}
+
+
+ input.seek(index8_7);
+ if ( s>=0 ) return s;
+ break;
+ case 10 :
+ var LA8_5 = input.LA(1);
+
+
+ var index8_5 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((LA8_5>='\t' && LA8_5<='\n')||LA8_5=='\r'||(LA8_5>=' ' && LA8_5<='!')||(LA8_5>='#' && LA8_5<='%')||(LA8_5>='(' && LA8_5<='\uD7FF')||(LA8_5>='\uE000' && LA8_5<='\uFFFD')) && ((( this.inAposStr )||( this.inQuotStr )))) {s = 5;}
+
+ else if ( (LA8_5=='\'') && (( this.inQuotStr ))) {s = 14;}
+
+ else if ( (LA8_5=='\"') && (( this.inAposStr ))) {s = 9;}
+
+ else s = 18;
+
+
+ input.seek(index8_5);
+ if ( s>=0 ) return s;
+ break;
+ case 11 :
+ var LA8_19 = input.LA(1);
+
+
+ var index8_19 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (( this.inQuotStr )) ) {s = 25;}
+
+ else if ( (( this.inAposStr )) ) {s = 9;}
+
+ else if ( (( !this.inQuotStr && !this.inAposStr )) ) {s = 10;}
+
+
+ input.seek(index8_19);
+ if ( s>=0 ) return s;
+ break;
+ case 12 :
+ var LA8_22 = input.LA(1);
+
+
+ var index8_22 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (( this.inAposStr )) ) {s = 26;}
+
+ else if ( (( this.inQuotStr )) ) {s = 14;}
+
+ else if ( (( !this.inQuotStr && !this.inAposStr )) ) {s = 10;}
+
+
+ input.seek(index8_22);
+ if ( s>=0 ) return s;
+ break;
+ case 13 :
+ var LA8_17 = input.LA(1);
+
+
+ var index8_17 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (( this.inQuotStr )) ) {s = 14;}
+
+ else if ( (( this.inAposStr )) ) {s = 9;}
+
+ else if ( (( !this.inQuotStr && !this.inAposStr )) ) {s = 10;}
+
+
+ input.seek(index8_17);
+ if ( s>=0 ) return s;
+ break;
+ case 14 :
+ var LA8_1 = input.LA(1);
+
+
+ var index8_1 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (LA8_1=='\"') && ((( this.inAposStr )||( this.inQuotStr )||( !this.inQuotStr && !this.inAposStr )))) {s = 6;}
+
+ else if ( ((LA8_1>='\t' && LA8_1<='\n')||LA8_1=='\r'||(LA8_1>=' ' && LA8_1<='!')||(LA8_1>='#' && LA8_1<='%')||(LA8_1>='(' && LA8_1<=';')||(LA8_1>='=' && LA8_1<='z')||LA8_1=='|'||(LA8_1>='~' && LA8_1<='\uD7FF')||(LA8_1>='\uE000' && LA8_1<='\uFFFD')) && ((( this.inAposStr )||( !this.inQuotStr && !this.inAposStr )))) {s = 8;}
+
+ else if ( (LA8_1=='<'||LA8_1=='{'||LA8_1=='}') && (( this.inAposStr ))) {s = 9;}
+
+ else if ( (LA8_1=='\'') && (( !this.inQuotStr && !this.inAposStr ))) {s = 10;}
+
+ else s = 7;
+
+
+ input.seek(index8_1);
+ if ( s>=0 ) return s;
+ break;
+ case 15 :
+ var LA8_11 = input.LA(1);
+
+
+ var index8_11 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((LA8_11>='\t' && LA8_11<='\n')||LA8_11=='\r'||(LA8_11>=' ' && LA8_11<='!')||(LA8_11>='#' && LA8_11<='%')||(LA8_11>='\'' && LA8_11<=';')||(LA8_11>='=' && LA8_11<='z')||LA8_11=='|'||(LA8_11>='~' && LA8_11<='\uD7FF')||(LA8_11>='\uE000' && LA8_11<='\uFFFD')) && ((( this.inQuotStr )||( !this.inQuotStr && !this.inAposStr )))) {s = 13;}
+
+ else if ( (LA8_11=='<'||LA8_11=='{'||LA8_11=='}') && (( this.inQuotStr ))) {s = 14;}
+
+ else if ( (LA8_11=='\"') && (( !this.inQuotStr && !this.inAposStr ))) {s = 10;}
+
+ else s = 22;
+
+
+ input.seek(index8_11);
+ if ( s>=0 ) return s;
+ break;
+ case 16 :
+ var LA8_8 = input.LA(1);
+
+
+ var index8_8 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((LA8_8>='\t' && LA8_8<='\n')||LA8_8=='\r'||(LA8_8>=' ' && LA8_8<='%')||(LA8_8>='(' && LA8_8<=';')||(LA8_8>='=' && LA8_8<='z')||LA8_8=='|'||(LA8_8>='~' && LA8_8<='\uD7FF')||(LA8_8>='\uE000' && LA8_8<='\uFFFD')) && ((( this.inAposStr )||( !this.inQuotStr && !this.inAposStr )))) {s = 8;}
+
+ else if ( (LA8_8=='<'||LA8_8=='{'||LA8_8=='}') && (( this.inAposStr ))) {s = 9;}
+
+ else if ( (LA8_8=='\'') && (( !this.inQuotStr && !this.inAposStr ))) {s = 10;}
+
+ else s = 21;
+
+
+ input.seek(index8_8);
+ if ( s>=0 ) return s;
+ break;
+ case 17 :
+ var LA8_4 = input.LA(1);
+
+
+ var index8_4 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((LA8_4>='\t' && LA8_4<='\n')||LA8_4=='\r'||(LA8_4>=' ' && LA8_4<='!')||(LA8_4>='#' && LA8_4<='%')||(LA8_4>='(' && LA8_4<=';')||(LA8_4>='=' && LA8_4<='z')||LA8_4=='|'||(LA8_4>='~' && LA8_4<='\uD7FF')||(LA8_4>='\uE000' && LA8_4<='\uFFFD')) && ((( this.inAposStr )||( this.inQuotStr )||( !this.inQuotStr && !this.inAposStr )))) {s = 4;}
+
+ else if ( (LA8_4=='\'') && ((( this.inQuotStr )||( !this.inQuotStr && !this.inAposStr )))) {s = 13;}
+
+ else if ( (LA8_4=='\"') && ((( this.inAposStr )||( !this.inQuotStr && !this.inAposStr )))) {s = 8;}
+
+ else if ( (LA8_4=='<'||LA8_4=='{'||LA8_4=='}') && ((( this.inAposStr )||( this.inQuotStr )))) {s = 5;}
+
+ else s = 17;
+
+
+ input.seek(index8_4);
+ if ( s>=0 ) return s;
+ break;
+ }
+ }).call(this.recognizer, s, input);
+ if (!org.antlr.lang.isUndefined(retval)) {
+ return retval;
+ }
+ var nvae =
+ new org.antlr.runtime.NoViableAltException(this.getDescription(), 8, _s, input);
+ this.error(nvae);
+ throw nvae;
+ },
+ dummy: null
+});
+
+})();
+exports.StringLexer = StringLexer; });
+define('ace/mode/xquery/XMLLexer', ['require', 'exports', 'module' , 'ace/mode/xquery/antlr3-all', 'ace/mode/xquery/XQDTLexer'], function(require, exports, module) {// $ANTLR 3.3 Nov 30, 2010 12:50:56 /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g 2012-09-05 10:41:40
+
+/* ***** 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 ***** */
+var org = require("./antlr3-all").org;
+var XQDTLexer = require("./XQDTLexer").XQDTLexer;
+
+
+var XMLLexer = function(input, state) {
+// alternate constructor @todo
+// public XMLLexer(CharStream input)
+// public XMLLexer(CharStream input, RecognizerSharedState state) {
+ if (!state) {
+ state = new org.antlr.runtime.RecognizerSharedState();
+ }
+
+ (function(){
+
+
+ this.inElem = true;
+ this.inAposAttr = false;
+ this.inQuotAttr = false;
+
+ this.isInElement = function()
+ {
+ return this.inElem;
+ }
+
+ this.isInAposAttribute = function()
+ {
+ return this.inAposAttr;
+ }
+
+ this.isInQuotAttr = function()
+ {
+ return this.inQuotAttr;
+ }
+
+ this.addToStack = function(stack) {
+ if (!this.inAposAttr && !this.inQuotAttr)
+ this.inElem = false;
+ stack.push(this);
+ }
+
+
+ // dummy list for warning elimination
+ //List<Stack<Object>> dummy = new ArrayList<Stack<Object>>();
+
+ // when we start, the '<' has already been eaten by the other lexer
+ //boolean inElem = true;
+ //boolean inAposAttr = false;
+ //boolean inQuotAttr = false;
+ //
+ //public boolean isInElement()
+ //{
+ // return inElem;
+ //}
+ //
+ //public boolean isInAposAttribute()
+ //{
+ // return inAposAttr;
+ //}
+ //
+ //public boolean isInQuotAttr()
+ //{
+ // return inQuotAttr;
+ //}
+ //
+ //@Override
+ //public void addToStack(List<XQDTLexer> stack) {
+ // if (!inAposAttr && !inQuotAttr)
+ // inElem = false;
+ // stack.add(this);
+ //}
+ //
+ //private boolean log() {
+ // System.out.println("inApos:\t" + inAposAttr);
+ // System.out.println("inQuot:\t" + inQuotAttr);
+ // System.out.println("inElem:\t" + inElem);
+ // System.out.println("---------------------");
+ // return false;
+ //}
+
+
+ }).call(this);
+
+ this.dfa16 = new XMLLexer.DFA16(this);
+ XMLLexer.superclass.constructor.call(this, input, state);
+
+
+};
+
+org.antlr.lang.augmentObject(XMLLexer, {
+ EOF: -1,
+ L_QuotAttrContentChar: 4,
+ L_AposAttrContentChar: 5,
+ L_ElementContentChar: 6,
+ L_CDataSection: 7,
+ L_PredefinedEntityRef: 8,
+ L_CharRef: 9,
+ ESCAPE_LBRACKET: 10,
+ ESCAPE_RBRACKET: 11,
+ ESCAPE_APOS: 12,
+ ESCAPE_QUOT: 13,
+ CDATA_START: 14,
+ CDATA_END: 15,
+ ANCESTOR: 16,
+ ANCESTOR_OR_SELF: 17,
+ AND: 18,
+ AS: 19,
+ ASCENDING: 20,
+ AT: 21,
+ ATTRIBUTE: 22,
+ BASE_URI: 23,
+ BOUNDARY_SPACE: 24,
+ BY: 25,
+ CASE: 26,
+ CAST: 27,
+ CASTABLE: 28,
+ CHILD: 29,
+ COLLATION: 30,
+ COMMENT: 31,
+ CONSTRUCTION: 32,
+ COPY_NAMESPACES: 33,
+ DECLARE: 34,
+ DEFAULT: 35,
+ DESCENDANT: 36,
+ DESCENDANT_OR_SELF: 37,
+ DESCENDING: 38,
+ DIV: 39,
+ DOCUMENT: 40,
+ DOCUMENT_NODE: 41,
+ ELEMENT: 42,
+ ELSE: 43,
+ EMPTY: 44,
+ EMPTY_SEQUENCE: 45,
+ ENCODING: 46,
+ EQ: 47,
+ EVERY: 48,
+ EXCEPT: 49,
+ EXTERNAL: 50,
+ FOLLOWING: 51,
+ FOLLOWING_SIBLING: 52,
+ FOR: 53,
+ FUNCTION: 54,
+ GE: 55,
+ GREATEST: 56,
+ GT: 57,
+ IDIV: 58,
+ IF: 59,
+ IMPORT: 60,
+ IN: 61,
+ INHERIT: 62,
+ INSTANCE: 63,
+ INTERSECT: 64,
+ IS: 65,
+ ITEM: 66,
+ LAX: 67,
+ LE: 68,
+ LEAST: 69,
+ LET: 70,
+ LT: 71,
+ MOD: 72,
+ MODULE: 73,
+ NAMESPACE: 74,
+ NE: 75,
+ NO_INHERIT: 76,
+ NO_PRESERVE: 77,
+ NODE: 78,
+ JSON: 79,
+ OF: 80,
+ OPTION: 81,
+ OR: 82,
+ ORDER: 83,
+ ORDERED: 84,
+ ORDERING: 85,
+ PARENT: 86,
+ PRECEDING: 87,
+ PRECEDING_SIBLING: 88,
+ PRESERVE: 89,
+ PROCESSING_INSTRUCTION: 90,
+ STRUCTURED_ITEM: 91,
+ JSON_ITEM: 92,
+ OBJECT: 93,
+ ARRAY: 94,
+ RETURN: 95,
+ SATISFIES: 96,
+ SCHEMA: 97,
+ SCHEMA_ATTRIBUTE: 98,
+ SCHEMA_ELEMENT: 99,
+ SELF: 100,
+ SOME: 101,
+ STABLE: 102,
+ STRICT: 103,
+ STRIP: 104,
+ TEXT: 105,
+ THEN: 106,
+ TO: 107,
+ TREAT: 108,
+ TYPESWITCH: 109,
+ UNION: 110,
+ UNORDERED: 111,
+ VALIDATE: 112,
+ VARIABLE: 113,
+ VERSION: 114,
+ WHERE: 115,
+ XQUERY: 116,
+ ALLOWING: 117,
+ CATCH: 118,
+ CONTEXT: 119,
+ COUNT: 120,
+ DECIMAL_FORMAT: 121,
+ DECIMAL_SEPARATOR: 122,
+ DIGIT: 123,
+ END: 124,
+ GROUP: 125,
+ GROUPING_SEPARATOR: 126,
+ INFINITY: 127,
+ MINUS_SIGN: 128,
+ NAMESPACE_NODE: 129,
+ NAN: 130,
+ NEXT: 131,
+ ONLY: 132,
+ PATTERN_SEPARATOR: 133,
+ PERCENT: 134,
+ PER_MILLE: 135,
+ PREVIOUS: 136,
+ SLIDING: 137,
+ START: 138,
+ SWITCH: 139,
+ TRY: 140,
+ TUMBLING: 141,
+ TYPE: 142,
+ WHEN: 143,
+ WINDOW: 144,
+ ZERO_DIGIT: 145,
+ AFTER: 146,
+ BEFORE: 147,
+ COPY: 148,
+ DELETE: 149,
+ FIRST: 150,
+ INSERT: 151,
+ INTO: 152,
+ POSITION: 153,
+ APPEND: 154,
+ LAST: 155,
+ MODIFY: 156,
+ NODES: 157,
+ RENAME: 158,
+ REPLACE: 159,
+ REVALIDATION: 160,
+ SKIP: 161,
+ UPDATING: 162,
+ VALUE: 163,
+ WITH: 164,
+ ALL: 165,
+ ANY: 166,
+ CONTAINS: 167,
+ CONTENT: 168,
+ DIACRITICS: 169,
+ DIFFERENT: 170,
+ DISTANCE: 171,
+ ENTIRE: 172,
+ EXACTLY: 173,
+ FROM: 174,
+ FT_OPTION: 175,
+ FTAND: 176,
+ FTNOT: 177,
+ FTOR: 178,
+ INSENSITIVE: 179,
+ LANGUAGE: 180,
+ LEVELS: 181,
+ LOWERCASE: 182,
+ MOST: 183,
+ NO: 184,
+ NOT: 185,
+ OCCURS: 186,
+ PARAGRAPH: 187,
+ PARAGRAPHS: 188,
+ PHRASE: 189,
+ RELATIONSHIP: 190,
+ SAME: 191,
+ SCORE: 192,
+ SENSITIVE: 193,
+ SENTENCE: 194,
+ SENTENCES: 195,
+ STEMMING: 196,
+ STOP: 197,
+ THESAURUS: 198,
+ TIMES: 199,
+ UPPERCASE: 200,
+ USING: 201,
+ WEIGHT: 202,
+ WILDCARDS: 203,
+ WITHOUT: 204,
+ WORD: 205,
+ WORDS: 206,
+ BREAK: 207,
+ CONTINUE: 208,
+ EXIT: 209,
+ LOOP: 210,
+ RETURNING: 211,
+ WHILE: 212,
+ CHECK: 213,
+ COLLECTION: 214,
+ CONSTRAINT: 215,
+ FOREACH: 216,
+ FOREIGN: 217,
+ INDEX: 218,
+ INTEGRITY: 219,
+ KEY: 220,
+ ON: 221,
+ UNIQUE: 222,
+ AMP_ER: 223,
+ APOS_ER: 224,
+ QUOT_ER: 225,
+ CONCAT: 226,
+ LPAREN: 227,
+ RPAREN: 228,
+ DOLLAR: 229,
+ L_UNION_BRACKET: 230,
+ R_UNION_BRACKET: 231,
+ LBRACKET: 232,
+ RBRACKET: 233,
+ LSQUARE: 234,
+ RSQUARE: 235,
+ EQUAL: 236,
+ BIND: 237,
+ NOTEQUAL: 238,
+ ANN_PERCENT: 239,
+ HASH: 240,
+ AMP: 241,
+ COMMA: 242,
+ QUESTION: 243,
+ STAR: 244,
+ PLUS: 245,
+ MINUS: 246,
+ SMALLER: 247,
+ GREATER: 248,
+ SMALLEREQ: 249,
+ GREATEREQ: 250,
+ SMALLER_SMALLER: 251,
+ GREATER_GREATER: 252,
+ SLASH: 253,
+ SLASH_SLASH: 254,
+ BANG: 255,
+ DOT: 256,
+ DOT_DOT: 257,
+ COLON: 258,
+ COLON_COLON: 259,
+ EMPTY_CLOSE_TAG: 260,
+ CLOSE_TAG: 261,
+ SEMICOLON: 262,
+ VBAR: 263,
+ PRAGMA_START: 264,
+ PRAGMA_END: 265,
+ XML_COMMENT_START: 266,
+ XML_COMMENT_END: 267,
+ PI_START: 268,
+ PI_END: 269,
+ ATTR_SIGN: 270,
+ Q: 271,
+ CHARREF_DEC: 272,
+ CHARREF_HEX: 273,
+ APOS: 274,
+ QUOT: 275,
+ NCNameStartChar: 276,
+ NCNameChar: 277,
+ L_NCName: 278,
+ Letter: 279,
+ HexLetter: 280,
+ Digit: 281,
+ Digits: 282,
+ S: 283,
+ SU: 284,
+ L_Pragma: 285,
+ L_DirCommentConstructor: 286,
+ L_DirPIConstructor: 287,
+ L_IntegerLiteral: 288,
+ L_DecimalLiteral: 289,
+ L_DoubleLiteral: 290,
+ L_Comment: 291,
+ L_AnyChar: 292,
+ NCNameUnprotected: 293,
+ XMLDigit: 294
+});
+
+(function(){
+var HIDDEN = org.antlr.runtime.Token.HIDDEN_CHANNEL,
+ EOF = org.antlr.runtime.Token.EOF;
+org.antlr.lang.extend(XMLLexer, XQDTLexer, {
+ EOF : -1,
+ L_QuotAttrContentChar : 4,
+ L_AposAttrContentChar : 5,
+ L_ElementContentChar : 6,
+ L_CDataSection : 7,
+ L_PredefinedEntityRef : 8,
+ L_CharRef : 9,
+ ESCAPE_LBRACKET : 10,
+ ESCAPE_RBRACKET : 11,
+ ESCAPE_APOS : 12,
+ ESCAPE_QUOT : 13,
+ CDATA_START : 14,
+ CDATA_END : 15,
+ ANCESTOR : 16,
+ ANCESTOR_OR_SELF : 17,
+ AND : 18,
+ AS : 19,
+ ASCENDING : 20,
+ AT : 21,
+ ATTRIBUTE : 22,
+ BASE_URI : 23,
+ BOUNDARY_SPACE : 24,
+ BY : 25,
+ CASE : 26,
+ CAST : 27,
+ CASTABLE : 28,
+ CHILD : 29,
+ COLLATION : 30,
+ COMMENT : 31,
+ CONSTRUCTION : 32,
+ COPY_NAMESPACES : 33,
+ DECLARE : 34,
+ DEFAULT : 35,
+ DESCENDANT : 36,
+ DESCENDANT_OR_SELF : 37,
+ DESCENDING : 38,
+ DIV : 39,
+ DOCUMENT : 40,
+ DOCUMENT_NODE : 41,
+ ELEMENT : 42,
+ ELSE : 43,
+ EMPTY : 44,
+ EMPTY_SEQUENCE : 45,
+ ENCODING : 46,
+ EQ : 47,
+ EVERY : 48,
+ EXCEPT : 49,
+ EXTERNAL : 50,
+ FOLLOWING : 51,
+ FOLLOWING_SIBLING : 52,
+ FOR : 53,
+ FUNCTION : 54,
+ GE : 55,
+ GREATEST : 56,
+ GT : 57,
+ IDIV : 58,
+ IF : 59,
+ IMPORT : 60,
+ IN : 61,
+ INHERIT : 62,
+ INSTANCE : 63,
+ INTERSECT : 64,
+ IS : 65,
+ ITEM : 66,
+ LAX : 67,
+ LE : 68,
+ LEAST : 69,
+ LET : 70,
+ LT : 71,
+ MOD : 72,
+ MODULE : 73,
+ NAMESPACE : 74,
+ NE : 75,
+ NO_INHERIT : 76,
+ NO_PRESERVE : 77,
+ NODE : 78,
+ JSON : 79,
+ OF : 80,
+ OPTION : 81,
+ OR : 82,
+ ORDER : 83,
+ ORDERED : 84,
+ ORDERING : 85,
+ PARENT : 86,
+ PRECEDING : 87,
+ PRECEDING_SIBLING : 88,
+ PRESERVE : 89,
+ PROCESSING_INSTRUCTION : 90,
+ STRUCTURED_ITEM : 91,
+ JSON_ITEM : 92,
+ OBJECT : 93,
+ ARRAY : 94,
+ RETURN : 95,
+ SATISFIES : 96,
+ SCHEMA : 97,
+ SCHEMA_ATTRIBUTE : 98,
+ SCHEMA_ELEMENT : 99,
+ SELF : 100,
+ SOME : 101,
+ STABLE : 102,
+ STRICT : 103,
+ STRIP : 104,
+ TEXT : 105,
+ THEN : 106,
+ TO : 107,
+ TREAT : 108,
+ TYPESWITCH : 109,
+ UNION : 110,
+ UNORDERED : 111,
+ VALIDATE : 112,
+ VARIABLE : 113,
+ VERSION : 114,
+ WHERE : 115,
+ XQUERY : 116,
+ ALLOWING : 117,
+ CATCH : 118,
+ CONTEXT : 119,
+ COUNT : 120,
+ DECIMAL_FORMAT : 121,
+ DECIMAL_SEPARATOR : 122,
+ DIGIT : 123,
+ END : 124,
+ GROUP : 125,
+ GROUPING_SEPARATOR : 126,
+ INFINITY : 127,
+ MINUS_SIGN : 128,
+ NAMESPACE_NODE : 129,
+ NAN : 130,
+ NEXT : 131,
+ ONLY : 132,
+ PATTERN_SEPARATOR : 133,
+ PERCENT : 134,
+ PER_MILLE : 135,
+ PREVIOUS : 136,
+ SLIDING : 137,
+ START : 138,
+ SWITCH : 139,
+ TRY : 140,
+ TUMBLING : 141,
+ TYPE : 142,
+ WHEN : 143,
+ WINDOW : 144,
+ ZERO_DIGIT : 145,
+ AFTER : 146,
+ BEFORE : 147,
+ COPY : 148,
+ DELETE : 149,
+ FIRST : 150,
+ INSERT : 151,
+ INTO : 152,
+ POSITION : 153,
+ APPEND : 154,
+ LAST : 155,
+ MODIFY : 156,
+ NODES : 157,
+ RENAME : 158,
+ REPLACE : 159,
+ REVALIDATION : 160,
+ SKIP : 161,
+ UPDATING : 162,
+ VALUE : 163,
+ WITH : 164,
+ ALL : 165,
+ ANY : 166,
+ CONTAINS : 167,
+ CONTENT : 168,
+ DIACRITICS : 169,
+ DIFFERENT : 170,
+ DISTANCE : 171,
+ ENTIRE : 172,
+ EXACTLY : 173,
+ FROM : 174,
+ FT_OPTION : 175,
+ FTAND : 176,
+ FTNOT : 177,
+ FTOR : 178,
+ INSENSITIVE : 179,
+ LANGUAGE : 180,
+ LEVELS : 181,
+ LOWERCASE : 182,
+ MOST : 183,
+ NO : 184,
+ NOT : 185,
+ OCCURS : 186,
+ PARAGRAPH : 187,
+ PARAGRAPHS : 188,
+ PHRASE : 189,
+ RELATIONSHIP : 190,
+ SAME : 191,
+ SCORE : 192,
+ SENSITIVE : 193,
+ SENTENCE : 194,
+ SENTENCES : 195,
+ STEMMING : 196,
+ STOP : 197,
+ THESAURUS : 198,
+ TIMES : 199,
+ UPPERCASE : 200,
+ USING : 201,
+ WEIGHT : 202,
+ WILDCARDS : 203,
+ WITHOUT : 204,
+ WORD : 205,
+ WORDS : 206,
+ BREAK : 207,
+ CONTINUE : 208,
+ EXIT : 209,
+ LOOP : 210,
+ RETURNING : 211,
+ WHILE : 212,
+ CHECK : 213,
+ COLLECTION : 214,
+ CONSTRAINT : 215,
+ FOREACH : 216,
+ FOREIGN : 217,
+ INDEX : 218,
+ INTEGRITY : 219,
+ KEY : 220,
+ ON : 221,
+ UNIQUE : 222,
+ AMP_ER : 223,
+ APOS_ER : 224,
+ QUOT_ER : 225,
+ CONCAT : 226,
+ LPAREN : 227,
+ RPAREN : 228,
+ DOLLAR : 229,
+ L_UNION_BRACKET : 230,
+ R_UNION_BRACKET : 231,
+ LBRACKET : 232,
+ RBRACKET : 233,
+ LSQUARE : 234,
+ RSQUARE : 235,
+ EQUAL : 236,
+ BIND : 237,
+ NOTEQUAL : 238,
+ ANN_PERCENT : 239,
+ HASH : 240,
+ AMP : 241,
+ COMMA : 242,
+ QUESTION : 243,
+ STAR : 244,
+ PLUS : 245,
+ MINUS : 246,
+ SMALLER : 247,
+ GREATER : 248,
+ SMALLEREQ : 249,
+ GREATEREQ : 250,
+ SMALLER_SMALLER : 251,
+ GREATER_GREATER : 252,
+ SLASH : 253,
+ SLASH_SLASH : 254,
+ BANG : 255,
+ DOT : 256,
+ DOT_DOT : 257,
+ COLON : 258,
+ COLON_COLON : 259,
+ EMPTY_CLOSE_TAG : 260,
+ CLOSE_TAG : 261,
+ SEMICOLON : 262,
+ VBAR : 263,
+ PRAGMA_START : 264,
+ PRAGMA_END : 265,
+ XML_COMMENT_START : 266,
+ XML_COMMENT_END : 267,
+ PI_START : 268,
+ PI_END : 269,
+ ATTR_SIGN : 270,
+ Q : 271,
+ CHARREF_DEC : 272,
+ CHARREF_HEX : 273,
+ APOS : 274,
+ QUOT : 275,
+ NCNameStartChar : 276,
+ NCNameChar : 277,
+ L_NCName : 278,
+ Letter : 279,
+ HexLetter : 280,
+ Digit : 281,
+ Digits : 282,
+ S : 283,
+ SU : 284,
+ L_Pragma : 285,
+ L_DirCommentConstructor : 286,
+ L_DirPIConstructor : 287,
+ L_IntegerLiteral : 288,
+ L_DecimalLiteral : 289,
+ L_DoubleLiteral : 290,
+ L_Comment : 291,
+ L_AnyChar : 292,
+ NCNameUnprotected : 293,
+ XMLDigit : 294,
+ getGrammarFileName: function() { return "/Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g"; }
+});
+org.antlr.lang.augmentObject(XMLLexer.prototype, {
+ // $ANTLR start QUOT
+ mQUOT: function() {
+ try {
+ var _type = this.QUOT;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:132:6: ({...}? => '\"' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:132:8: {...}? => '\"'
+ if ( !(( this.inElem || this.inQuotAttr )) ) {
+ throw new org.antlr.runtime.FailedPredicateException(this.input, "QUOT", " this.inElem || this.inQuotAttr ");
+ }
+ this.match('\"');
+ if (!this.inAposAttr) this.inQuotAttr = (!this.inQuotAttr);
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "QUOT",
+
+ // $ANTLR start APOS
+ mAPOS: function() {
+ try {
+ var _type = this.APOS;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:133:6: ({...}? => '\\'' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:133:8: {...}? => '\\''
+ if ( !(( this.inElem || this.inAposAttr )) ) {
+ throw new org.antlr.runtime.FailedPredicateException(this.input, "APOS", " this.inElem || this.inAposAttr ");
+ }
+ this.match('\'');
+ if (!this.inQuotAttr) this.inAposAttr = !this.inAposAttr;
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "APOS",
+
+ // $ANTLR start L_QuotAttrContentChar
+ mL_QuotAttrContentChar: function() {
+ try {
+ var _type = this.L_QuotAttrContentChar;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:136:2: ({...}? => ( '\\u0009' | '\\u000A' | '\\u000D' | '\\u0020' | '\\u0021' | '\\u0023' .. '\\u0025' | '\\u0028' .. '\\u003B' | '\\u003D' .. '\\u007A' | '\\u007C' .. '\\u007C' | '\\u007E' .. '\\uD7FF' | '\\uE000' .. '\\uFFFD' )+ )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:136:4: {...}? => ( '\\u0009' | '\\u000A' | '\\u000D' | '\\u0020' | '\\u0021' | '\\u0023' .. '\\u0025' | '\\u0028' .. '\\u003B' | '\\u003D' .. '\\u007A' | '\\u007C' .. '\\u007C' | '\\u007E' .. '\\uD7FF' | '\\uE000' .. '\\uFFFD' )+
+ if ( !(( this.inQuotAttr )) ) {
+ throw new org.antlr.runtime.FailedPredicateException(this.input, "L_QuotAttrContentChar", " this.inQuotAttr ");
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:137:3: ( '\\u0009' | '\\u000A' | '\\u000D' | '\\u0020' | '\\u0021' | '\\u0023' .. '\\u0025' | '\\u0028' .. '\\u003B' | '\\u003D' .. '\\u007A' | '\\u007C' .. '\\u007C' | '\\u007E' .. '\\uD7FF' | '\\uE000' .. '\\uFFFD' )+
+ var cnt1=0;
+ loop1:
+ do {
+ var alt1=2;
+ var LA1_0 = this.input.LA(1);
+
+ if ( ((LA1_0>='\t' && LA1_0<='\n')||LA1_0=='\r'||(LA1_0>=' ' && LA1_0<='!')||(LA1_0>='#' && LA1_0<='%')||(LA1_0>='(' && LA1_0<=';')||(LA1_0>='=' && LA1_0<='z')||LA1_0=='|'||(LA1_0>='~' && LA1_0<='\uD7FF')||(LA1_0>='\uE000' && LA1_0<='\uFFFD')) ) {
+ alt1=1;
+ }
+
+
+ switch (alt1) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:
+ if ( (this.input.LA(1)>='\t' && this.input.LA(1)<='\n')||this.input.LA(1)=='\r'||(this.input.LA(1)>=' ' && this.input.LA(1)<='!')||(this.input.LA(1)>='#' && this.input.LA(1)<='%')||(this.input.LA(1)>='(' && this.input.LA(1)<=';')||(this.input.LA(1)>='=' && this.input.LA(1)<='z')||this.input.LA(1)=='|'||(this.input.LA(1)>='~' && this.input.LA(1)<='\uD7FF')||(this.input.LA(1)>='\uE000' && this.input.LA(1)<='\uFFFD') ) {
+ this.input.consume();
+
+ }
+ else {
+ var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
+ this.recover(mse);
+ throw mse;}
+
+
+
+ break;
+
+ default :
+ if ( cnt1 >= 1 ) {
+ break loop1;
+ }
+ var eee = new org.antlr.runtime.EarlyExitException(1, this.input);
+ throw eee;
+ }
+ cnt1++;
+ } while (true);
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "L_QuotAttrContentChar",
+
+ // $ANTLR start L_AposAttrContentChar
+ mL_AposAttrContentChar: function() {
+ try {
+ var _type = this.L_AposAttrContentChar;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:143:2: ({...}? => ( '\\u0009' | '\\u000A' | '\\u000D' | '\\u0020' | '\\u0021' | '\\u0023' .. '\\u0025' | '\\u0028' .. '\\u003B' | '\\u003D' .. '\\u007A' | '\\u007C' .. '\\u007C' | '\\u007E' .. '\\uD7FF' | '\\uE000' .. '\\uFFFD' )+ )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:143:4: {...}? => ( '\\u0009' | '\\u000A' | '\\u000D' | '\\u0020' | '\\u0021' | '\\u0023' .. '\\u0025' | '\\u0028' .. '\\u003B' | '\\u003D' .. '\\u007A' | '\\u007C' .. '\\u007C' | '\\u007E' .. '\\uD7FF' | '\\uE000' .. '\\uFFFD' )+
+ if ( !(( this.inAposAttr )) ) {
+ throw new org.antlr.runtime.FailedPredicateException(this.input, "L_AposAttrContentChar", " this.inAposAttr ");
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:144:3: ( '\\u0009' | '\\u000A' | '\\u000D' | '\\u0020' | '\\u0021' | '\\u0023' .. '\\u0025' | '\\u0028' .. '\\u003B' | '\\u003D' .. '\\u007A' | '\\u007C' .. '\\u007C' | '\\u007E' .. '\\uD7FF' | '\\uE000' .. '\\uFFFD' )+
+ var cnt2=0;
+ loop2:
+ do {
+ var alt2=2;
+ var LA2_0 = this.input.LA(1);
+
+ if ( ((LA2_0>='\t' && LA2_0<='\n')||LA2_0=='\r'||(LA2_0>=' ' && LA2_0<='!')||(LA2_0>='#' && LA2_0<='%')||(LA2_0>='(' && LA2_0<=';')||(LA2_0>='=' && LA2_0<='z')||LA2_0=='|'||(LA2_0>='~' && LA2_0<='\uD7FF')||(LA2_0>='\uE000' && LA2_0<='\uFFFD')) ) {
+ alt2=1;
+ }
+
+
+ switch (alt2) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:
+ if ( (this.input.LA(1)>='\t' && this.input.LA(1)<='\n')||this.input.LA(1)=='\r'||(this.input.LA(1)>=' ' && this.input.LA(1)<='!')||(this.input.LA(1)>='#' && this.input.LA(1)<='%')||(this.input.LA(1)>='(' && this.input.LA(1)<=';')||(this.input.LA(1)>='=' && this.input.LA(1)<='z')||this.input.LA(1)=='|'||(this.input.LA(1)>='~' && this.input.LA(1)<='\uD7FF')||(this.input.LA(1)>='\uE000' && this.input.LA(1)<='\uFFFD') ) {
+ this.input.consume();
+
+ }
+ else {
+ var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
+ this.recover(mse);
+ throw mse;}
+
+
+
+ break;
+
+ default :
+ if ( cnt2 >= 1 ) {
+ break loop2;
+ }
+ var eee = new org.antlr.runtime.EarlyExitException(2, this.input);
+ throw eee;
+ }
+ cnt2++;
+ } while (true);
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "L_AposAttrContentChar",
+
+ // $ANTLR start L_ElementContentChar
+ mL_ElementContentChar: function() {
+ try {
+ var _type = this.L_ElementContentChar;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:151:2: ({...}? => ( '\\u0009' | '\\u000A' | '\\u000D' | '\\u0020' .. '\\u0025' | '\\u0027' .. '\\u003B' | '\\u003D' .. '\\u007A' | '\\u007C' | '\\u007E' .. '\\uD7FF' | '\\uE000' .. '\\uFFFD' )+ )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:151:4: {...}? => ( '\\u0009' | '\\u000A' | '\\u000D' | '\\u0020' .. '\\u0025' | '\\u0027' .. '\\u003B' | '\\u003D' .. '\\u007A' | '\\u007C' | '\\u007E' .. '\\uD7FF' | '\\uE000' .. '\\uFFFD' )+
+ if ( !(( !this.inElem )) ) {
+ throw new org.antlr.runtime.FailedPredicateException(this.input, "L_ElementContentChar", " !this.inElem ");
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:152:3: ( '\\u0009' | '\\u000A' | '\\u000D' | '\\u0020' .. '\\u0025' | '\\u0027' .. '\\u003B' | '\\u003D' .. '\\u007A' | '\\u007C' | '\\u007E' .. '\\uD7FF' | '\\uE000' .. '\\uFFFD' )+
+ var cnt3=0;
+ loop3:
+ do {
+ var alt3=2;
+ var LA3_0 = this.input.LA(1);
+
+ if ( ((LA3_0>='\t' && LA3_0<='\n')||LA3_0=='\r'||(LA3_0>=' ' && LA3_0<='%')||(LA3_0>='\'' && LA3_0<=';')||(LA3_0>='=' && LA3_0<='z')||LA3_0=='|'||(LA3_0>='~' && LA3_0<='\uD7FF')||(LA3_0>='\uE000' && LA3_0<='\uFFFD')) ) {
+ alt3=1;
+ }
+
+
+ switch (alt3) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:
+ if ( (this.input.LA(1)>='\t' && this.input.LA(1)<='\n')||this.input.LA(1)=='\r'||(this.input.LA(1)>=' ' && this.input.LA(1)<='%')||(this.input.LA(1)>='\'' && this.input.LA(1)<=';')||(this.input.LA(1)>='=' && this.input.LA(1)<='z')||this.input.LA(1)=='|'||(this.input.LA(1)>='~' && this.input.LA(1)<='\uD7FF')||(this.input.LA(1)>='\uE000' && this.input.LA(1)<='\uFFFD') ) {
+ this.input.consume();
+
+ }
+ else {
+ var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
+ this.recover(mse);
+ throw mse;}
+
+
+
+ break;
+
+ default :
+ if ( cnt3 >= 1 ) {
+ break loop3;
+ }
+ var eee = new org.antlr.runtime.EarlyExitException(3, this.input);
+ throw eee;
+ }
+ cnt3++;
+ } while (true);
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "L_ElementContentChar",
+
+ // $ANTLR start GREATER
+ mGREATER: function() {
+ try {
+ var _type = this.GREATER;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:158:2: ({...}? => '>' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:158:4: {...}? => '>'
+ if ( !(( this.inElem )) ) {
+ throw new org.antlr.runtime.FailedPredicateException(this.input, "GREATER", " this.inElem ");
+ }
+ this.match('>');
+ this.inElem = false;
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "GREATER",
+
+ // $ANTLR start EMPTY_CLOSE_TAG
+ mEMPTY_CLOSE_TAG: function() {
+ try {
+ var _type = this.EMPTY_CLOSE_TAG;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:162:2: ({...}? => '/>' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:162:4: {...}? => '/>'
+ if ( !(( this.inElem )) ) {
+ throw new org.antlr.runtime.FailedPredicateException(this.input, "EMPTY_CLOSE_TAG", " this.inElem ");
+ }
+ this.match("/>");
+
+ this.inElem = false;
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "EMPTY_CLOSE_TAG",
+
+ // $ANTLR start S
+ mS: function() {
+ try {
+ var _type = this.S;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:166:2: ({...}? => ( ' ' | '\\t' | '\\r' | '\\n' )+ )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:166:4: {...}? => ( ' ' | '\\t' | '\\r' | '\\n' )+
+ if ( !(( this.inElem )) ) {
+ throw new org.antlr.runtime.FailedPredicateException(this.input, "S", " this.inElem ");
+ }
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:166:24: ( ' ' | '\\t' | '\\r' | '\\n' )+
+ var cnt4=0;
+ loop4:
+ do {
+ var alt4=2;
+ var LA4_0 = this.input.LA(1);
+
+ if ( ((LA4_0>='\t' && LA4_0<='\n')||LA4_0=='\r'||LA4_0==' ') ) {
+ alt4=1;
+ }
+
+
+ switch (alt4) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:
+ if ( (this.input.LA(1)>='\t' && this.input.LA(1)<='\n')||this.input.LA(1)=='\r'||this.input.LA(1)==' ' ) {
+ this.input.consume();
+
+ }
+ else {
+ var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
+ this.recover(mse);
+ throw mse;}
+
+
+
+ break;
+
+ default :
+ if ( cnt4 >= 1 ) {
+ break loop4;
+ }
+ var eee = new org.antlr.runtime.EarlyExitException(4, this.input);
+ throw eee;
+ }
+ cnt4++;
+ } while (true);
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "S",
+
+ // $ANTLR start L_NCName
+ mL_NCName: function() {
+ try {
+ var _type = this.L_NCName;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:172:2: ({...}? => NCNameUnprotected )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:172:4: {...}? => NCNameUnprotected
+ if ( !(( this.inElem )) ) {
+ throw new org.antlr.runtime.FailedPredicateException(this.input, "L_NCName", " this.inElem ");
+ }
+ this.mNCNameUnprotected();
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "L_NCName",
+
+ // $ANTLR start NCNameUnprotected
+ mNCNameUnprotected: function() {
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:176:2: ( NCNameStartChar ( NCNameChar )* )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:176:4: NCNameStartChar ( NCNameChar )*
+ this.mNCNameStartChar();
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:176:20: ( NCNameChar )*
+ loop5:
+ do {
+ var alt5=2;
+ var LA5_0 = this.input.LA(1);
+
+ if ( ((LA5_0>='-' && LA5_0<='.')||(LA5_0>='0' && LA5_0<='9')||(LA5_0>='A' && LA5_0<='Z')||LA5_0=='_'||(LA5_0>='a' && LA5_0<='z')) ) {
+ alt5=1;
+ }
+
+
+ switch (alt5) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:176:20: NCNameChar
+ this.mNCNameChar();
+
+
+ break;
+
+ default :
+ break loop5;
+ }
+ } while (true);
+
+
+
+
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "NCNameUnprotected",
+
+ // $ANTLR start NCNameStartChar
+ mNCNameStartChar: function() {
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:180:2: ( Letter | '_' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:
+ if ( (this.input.LA(1)>='A' && this.input.LA(1)<='Z')||this.input.LA(1)=='_'||(this.input.LA(1)>='a' && this.input.LA(1)<='z') ) {
+ this.input.consume();
+
+ }
+ else {
+ var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
+ this.recover(mse);
+ throw mse;}
+
+
+
+
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "NCNameStartChar",
+
+ // $ANTLR start NCNameChar
+ mNCNameChar: function() {
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:184:2: ( Letter | XMLDigit | '.' | '-' | '_' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:
+ if ( (this.input.LA(1)>='-' && this.input.LA(1)<='.')||(this.input.LA(1)>='0' && this.input.LA(1)<='9')||(this.input.LA(1)>='A' && this.input.LA(1)<='Z')||this.input.LA(1)=='_'||(this.input.LA(1)>='a' && this.input.LA(1)<='z') ) {
+ this.input.consume();
+
+ }
+ else {
+ var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
+ this.recover(mse);
+ throw mse;}
+
+
+
+
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "NCNameChar",
+
+ // $ANTLR start Letter
+ mLetter: function() {
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:188:2: ( 'a' .. 'z' | 'A' .. 'Z' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:
+ if ( (this.input.LA(1)>='A' && this.input.LA(1)<='Z')||(this.input.LA(1)>='a' && this.input.LA(1)<='z') ) {
+ this.input.consume();
+
+ }
+ else {
+ var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
+ this.recover(mse);
+ throw mse;}
+
+
+
+
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "Letter",
+
+ // $ANTLR start XMLDigit
+ mXMLDigit: function() {
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:192:2: ( '0' .. '9' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:192:4: '0' .. '9'
+ this.matchRange('0','9');
+
+
+
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "XMLDigit",
+
+ // $ANTLR start EQUAL
+ mEQUAL: function() {
+ try {
+ var _type = this.EQUAL;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:207:7: ({...}? => '=' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:207:9: {...}? => '='
+ if ( !(( this.inElem )) ) {
+ throw new org.antlr.runtime.FailedPredicateException(this.input, "EQUAL", " this.inElem ");
+ }
+ this.match('=');
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "EQUAL",
+
+ // $ANTLR start ESCAPE_APOS
+ mESCAPE_APOS: function() {
+ try {
+ var _type = this.ESCAPE_APOS;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:208:13: ({...}? => '\\'\\'' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:208:15: {...}? => '\\'\\''
+ if ( !(( this.inAposAttr )) ) {
+ throw new org.antlr.runtime.FailedPredicateException(this.input, "ESCAPE_APOS", " this.inAposAttr ");
+ }
+ this.match("''");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "ESCAPE_APOS",
+
+ // $ANTLR start ESCAPE_QUOT
+ mESCAPE_QUOT: function() {
+ try {
+ var _type = this.ESCAPE_QUOT;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:209:13: ({...}? => '\"\"' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:209:15: {...}? => '\"\"'
+ if ( !(( this.inQuotAttr )) ) {
+ throw new org.antlr.runtime.FailedPredicateException(this.input, "ESCAPE_QUOT", " this.inQuotAttr ");
+ }
+ this.match("\"\"");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "ESCAPE_QUOT",
+
+ // $ANTLR start ESCAPE_LBRACKET
+ mESCAPE_LBRACKET: function() {
+ try {
+ var _type = this.ESCAPE_LBRACKET;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:212:2: ({...}? => '{{' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:212:4: {...}? => '{{'
+ if ( !(( !this.inElem || this.inAposAttr || this.inQuotAttr )) ) {
+ throw new org.antlr.runtime.FailedPredicateException(this.input, "ESCAPE_LBRACKET", " !this.inElem || this.inAposAttr || this.inQuotAttr ");
+ }
+ this.match("{{");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "ESCAPE_LBRACKET",
+
+ // $ANTLR start ESCAPE_RBRACKET
+ mESCAPE_RBRACKET: function() {
+ try {
+ var _type = this.ESCAPE_RBRACKET;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:216:2: ({...}? => '}}' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:216:4: {...}? => '}}'
+ if ( !(( !this.inElem || this.inAposAttr || this.inQuotAttr )) ) {
+ throw new org.antlr.runtime.FailedPredicateException(this.input, "ESCAPE_RBRACKET", " !this.inElem || this.inAposAttr || this.inQuotAttr ");
+ }
+ this.match("}}");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "ESCAPE_RBRACKET",
+
+ // $ANTLR start LBRACKET
+ mLBRACKET: function() {
+ try {
+ var _type = this.LBRACKET;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:219:10: ({...}? => '{' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:219:12: {...}? => '{'
+ if ( !(( !this.inElem || this.inAposAttr || this.inQuotAttr )) ) {
+ throw new org.antlr.runtime.FailedPredicateException(this.input, "LBRACKET", " !this.inElem || this.inAposAttr || this.inQuotAttr ");
+ }
+ this.match('{');
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "LBRACKET",
+
+ // $ANTLR start RBRACKET
+ mRBRACKET: function() {
+ try {
+ var _type = this.RBRACKET;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:220:10: ({...}? => '}' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:220:12: {...}? => '}'
+ if ( !(( !this.inElem || this.inAposAttr || this.inQuotAttr )) ) {
+ throw new org.antlr.runtime.FailedPredicateException(this.input, "RBRACKET", " !this.inElem || this.inAposAttr || this.inQuotAttr ");
+ }
+ this.match('}');
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "RBRACKET",
+
+ // $ANTLR start SMALLER
+ mSMALLER: function() {
+ try {
+ var _type = this.SMALLER;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:221:9: ( '<' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:221:11: '<'
+ this.match('<');
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "SMALLER",
+
+ // $ANTLR start CLOSE_TAG
+ mCLOSE_TAG: function() {
+ try {
+ var _type = this.CLOSE_TAG;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:222:11: ({...}? => '</' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:222:13: {...}? => '</'
+ if ( !(( !this.inElem )) ) {
+ throw new org.antlr.runtime.FailedPredicateException(this.input, "CLOSE_TAG", " !this.inElem ");
+ }
+ this.match("</");
+
+ this.inElem = true;
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "CLOSE_TAG",
+
+ // $ANTLR start CDATA_START
+ mCDATA_START: function() {
+ try {
+ var _type = this.CDATA_START;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:224:13: ( '<![CDATA[' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:224:15: '<![CDATA['
+ this.match("<![CDATA[");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "CDATA_START",
+
+ // $ANTLR start CDATA_END
+ mCDATA_END: function() {
+ try {
+ var _type = this.CDATA_END;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:225:12: ( ']]>' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:225:14: ']]>'
+ this.match("]]>");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "CDATA_END",
+
+ // $ANTLR start L_CDataSection
+ mL_CDataSection: function() {
+ try {
+ var _type = this.L_CDataSection;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:229:3: ({...}? => CDATA_START ( options {greedy=false; } : ( . )* ) CDATA_END )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:229:5: {...}? => CDATA_START ( options {greedy=false; } : ( . )* ) CDATA_END
+ if ( !(( !this.inElem )) ) {
+ throw new org.antlr.runtime.FailedPredicateException(this.input, "L_CDataSection", " !this.inElem ");
+ }
+ this.mCDATA_START();
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:229:38: ( options {greedy=false; } : ( . )* )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:229:65: ( . )*
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:229:65: ( . )*
+ loop6:
+ do {
+ var alt6=2;
+ var LA6_0 = this.input.LA(1);
+
+ if ( (LA6_0==']') ) {
+ var LA6_1 = this.input.LA(2);
+
+ if ( (LA6_1==']') ) {
+ var LA6_3 = this.input.LA(3);
+
+ if ( (LA6_3=='>') ) {
+ alt6=2;
+ }
+ else if ( ((LA6_3>='\u0000' && LA6_3<='=')||(LA6_3>='?' && LA6_3<='\uFFFF')) ) {
+ alt6=1;
+ }
+
+
+ }
+ else if ( ((LA6_1>='\u0000' && LA6_1<='\\')||(LA6_1>='^' && LA6_1<='\uFFFF')) ) {
+ alt6=1;
+ }
+
+
+ }
+ else if ( ((LA6_0>='\u0000' && LA6_0<='\\')||(LA6_0>='^' && LA6_0<='\uFFFF')) ) {
+ alt6=1;
+ }
+
+
+ switch (alt6) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:229:65: .
+ this.matchAny();
+
+
+ break;
+
+ default :
+ break loop6;
+ }
+ } while (true);
+
+
+
+
+ this.mCDATA_END();
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "L_CDataSection",
+
+ // $ANTLR start L_PredefinedEntityRef
+ mL_PredefinedEntityRef: function() {
+ try {
+ var _type = this.L_PredefinedEntityRef;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:237:2: ({...}? => '&' ( 'lt' | 'gt' | 'apos' | 'quot' | 'amp' ) ';' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:237:4: {...}? => '&' ( 'lt' | 'gt' | 'apos' | 'quot' | 'amp' ) ';'
+ if ( !(( !this.inElem || this.inAposAttr || this.inQuotAttr )) ) {
+ throw new org.antlr.runtime.FailedPredicateException(this.input, "L_PredefinedEntityRef", " !this.inElem || this.inAposAttr || this.inQuotAttr ");
+ }
+ this.match('&');
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:237:67: ( 'lt' | 'gt' | 'apos' | 'quot' | 'amp' )
+ var alt7=5;
+ switch ( this.input.LA(1) ) {
+ case 'l':
+ alt7=1;
+ break;
+ case 'g':
+ alt7=2;
+ break;
+ case 'a':
+ var LA7_3 = this.input.LA(2);
+
+ if ( (LA7_3=='p') ) {
+ alt7=3;
+ }
+ else if ( (LA7_3=='m') ) {
+ alt7=5;
+ }
+ else {
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 7, 3, this.input);
+
+ throw nvae;
+ }
+ break;
+ case 'q':
+ alt7=4;
+ break;
+ default:
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 7, 0, this.input);
+
+ throw nvae;
+ }
+
+ switch (alt7) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:237:68: 'lt'
+ this.match("lt");
+
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:237:75: 'gt'
+ this.match("gt");
+
+
+
+ break;
+ case 3 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:237:82: 'apos'
+ this.match("apos");
+
+
+
+ break;
+ case 4 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:237:91: 'quot'
+ this.match("quot");
+
+
+
+ break;
+ case 5 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:237:100: 'amp'
+ this.match("amp");
+
+
+
+ break;
+
+ }
+
+ this.match(';');
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "L_PredefinedEntityRef",
+
+ // $ANTLR start L_CharRef
+ mL_CharRef: function() {
+ try {
+ var _type = this.L_CharRef;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:242:2: ({...}? => '&#' ( '0' .. '9' )+ ';' | '&#x' ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' )+ ';' )
+ var alt10=2;
+ var LA10_0 = this.input.LA(1);
+
+ if ( (LA10_0=='&') ) {
+ var LA10_1 = this.input.LA(2);
+
+ if ( (LA10_1=='#') ) {
+ var LA10_2 = this.input.LA(3);
+
+ if ( (LA10_2=='x') ) {
+ alt10=2;
+ }
+ else if ( ((LA10_2>='0' && LA10_2<='9')) && (( !this.inElem || this.inAposAttr || this.inQuotAttr ))) {
+ alt10=1;
+ }
+ else {
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 10, 2, this.input);
+
+ throw nvae;
+ }
+ }
+ else {
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 10, 1, this.input);
+
+ throw nvae;
+ }
+ }
+ else {
+ var nvae =
+ new org.antlr.runtime.NoViableAltException("", 10, 0, this.input);
+
+ throw nvae;
+ }
+ switch (alt10) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:242:4: {...}? => '&#' ( '0' .. '9' )+ ';'
+ if ( !(( !this.inElem || this.inAposAttr || this.inQuotAttr )) ) {
+ throw new org.antlr.runtime.FailedPredicateException(this.input, "L_CharRef", " !this.inElem || this.inAposAttr || this.inQuotAttr ");
+ }
+ this.match("&#");
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:242:68: ( '0' .. '9' )+
+ var cnt8=0;
+ loop8:
+ do {
+ var alt8=2;
+ var LA8_0 = this.input.LA(1);
+
+ if ( ((LA8_0>='0' && LA8_0<='9')) ) {
+ alt8=1;
+ }
+
+
+ switch (alt8) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:242:69: '0' .. '9'
+ this.matchRange('0','9');
+
+
+ break;
+
+ default :
+ if ( cnt8 >= 1 ) {
+ break loop8;
+ }
+ var eee = new org.antlr.runtime.EarlyExitException(8, this.input);
+ throw eee;
+ }
+ cnt8++;
+ } while (true);
+
+ this.match(';');
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:242:86: '&#x' ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' )+ ';'
+ this.match("&#x");
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:242:92: ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' )+
+ var cnt9=0;
+ loop9:
+ do {
+ var alt9=2;
+ var LA9_0 = this.input.LA(1);
+
+ if ( ((LA9_0>='0' && LA9_0<='9')||(LA9_0>='A' && LA9_0<='F')||(LA9_0>='a' && LA9_0<='f')) ) {
+ alt9=1;
+ }
+
+
+ switch (alt9) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:
+ if ( (this.input.LA(1)>='0' && this.input.LA(1)<='9')||(this.input.LA(1)>='A' && this.input.LA(1)<='F')||(this.input.LA(1)>='a' && this.input.LA(1)<='f') ) {
+ this.input.consume();
+
+ }
+ else {
+ var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
+ this.recover(mse);
+ throw mse;}
+
+
+
+ break;
+
+ default :
+ if ( cnt9 >= 1 ) {
+ break loop9;
+ }
+ var eee = new org.antlr.runtime.EarlyExitException(9, this.input);
+ throw eee;
+ }
+ cnt9++;
+ } while (true);
+
+ this.match(';');
+
+
+ break;
+
+ }
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "L_CharRef",
+
+ // $ANTLR start L_DirCommentConstructor
+ mL_DirCommentConstructor: function() {
+ try {
+ var _type = this.L_DirCommentConstructor;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:246:2: ({...}? => '<!--' ( options {greedy=false; } : ( . )* ) '-->' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:246:4: {...}? => '<!--' ( options {greedy=false; } : ( . )* ) '-->'
+ if ( !(( !this.inElem )) ) {
+ throw new org.antlr.runtime.FailedPredicateException(this.input, "L_DirCommentConstructor", " !this.inElem ");
+ }
+ this.match("<!--");
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:246:32: ( options {greedy=false; } : ( . )* )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:246:59: ( . )*
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:246:59: ( . )*
+ loop11:
+ do {
+ var alt11=2;
+ var LA11_0 = this.input.LA(1);
+
+ if ( (LA11_0=='-') ) {
+ var LA11_1 = this.input.LA(2);
+
+ if ( (LA11_1=='-') ) {
+ var LA11_3 = this.input.LA(3);
+
+ if ( (LA11_3=='>') ) {
+ alt11=2;
+ }
+ else if ( ((LA11_3>='\u0000' && LA11_3<='=')||(LA11_3>='?' && LA11_3<='\uFFFF')) ) {
+ alt11=1;
+ }
+
+
+ }
+ else if ( ((LA11_1>='\u0000' && LA11_1<=',')||(LA11_1>='.' && LA11_1<='\uFFFF')) ) {
+ alt11=1;
+ }
+
+
+ }
+ else if ( ((LA11_0>='\u0000' && LA11_0<=',')||(LA11_0>='.' && LA11_0<='\uFFFF')) ) {
+ alt11=1;
+ }
+
+
+ switch (alt11) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:246:59: .
+ this.matchAny();
+
+
+ break;
+
+ default :
+ break loop11;
+ }
+ } while (true);
+
+
+
+
+ this.match("-->");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "L_DirCommentConstructor",
+
+ // $ANTLR start L_DirPIConstructor
+ mL_DirPIConstructor: function() {
+ try {
+ var _type = this.L_DirPIConstructor;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:249:2: ({...}? => '<?' ( SU )? NCNameUnprotected ( SU ( options {greedy=false; } : ( . )* ) )? '?>' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:249:4: {...}? => '<?' ( SU )? NCNameUnprotected ( SU ( options {greedy=false; } : ( . )* ) )? '?>'
+ if ( !(( !this.inElem )) ) {
+ throw new org.antlr.runtime.FailedPredicateException(this.input, "L_DirPIConstructor", " !this.inElem ");
+ }
+ this.match("<?");
+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:250:8: ( SU )?
+ var alt12=2;
+ var LA12_0 = this.input.LA(1);
+
+ if ( ((LA12_0>='\t' && LA12_0<='\n')||LA12_0=='\r'||LA12_0==' ') ) {
+ alt12=1;
+ }
+ switch (alt12) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:250:8: SU
+ this.mSU();
+
+
+ break;
+
+ }
+
+ this.mNCNameUnprotected();
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:250:30: ( SU ( options {greedy=false; } : ( . )* ) )?
+ var alt14=2;
+ var LA14_0 = this.input.LA(1);
+
+ if ( ((LA14_0>='\t' && LA14_0<='\n')||LA14_0=='\r'||LA14_0==' ') ) {
+ alt14=1;
+ }
+ switch (alt14) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:250:31: SU ( options {greedy=false; } : ( . )* )
+ this.mSU();
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:250:34: ( options {greedy=false; } : ( . )* )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:250:61: ( . )*
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:250:61: ( . )*
+ loop13:
+ do {
+ var alt13=2;
+ var LA13_0 = this.input.LA(1);
+
+ if ( (LA13_0=='?') ) {
+ var LA13_1 = this.input.LA(2);
+
+ if ( (LA13_1=='>') ) {
+ alt13=2;
+ }
+ else if ( ((LA13_1>='\u0000' && LA13_1<='=')||(LA13_1>='?' && LA13_1<='\uFFFF')) ) {
+ alt13=1;
+ }
+
+
+ }
+ else if ( ((LA13_0>='\u0000' && LA13_0<='>')||(LA13_0>='@' && LA13_0<='\uFFFF')) ) {
+ alt13=1;
+ }
+
+
+ switch (alt13) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:250:61: .
+ this.matchAny();
+
+
+ break;
+
+ default :
+ break loop13;
+ }
+ } while (true);
+
+
+
+
+
+
+ break;
+
+ }
+
+ this.match("?>");
+
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "L_DirPIConstructor",
+
+ // $ANTLR start SU
+ mSU: function() {
+ try {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:254:2: ( ( ' ' | '\\t' | '\\n' | '\\r' )+ )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:254:4: ( ' ' | '\\t' | '\\n' | '\\r' )+
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:254:4: ( ' ' | '\\t' | '\\n' | '\\r' )+
+ var cnt15=0;
+ loop15:
+ do {
+ var alt15=2;
+ var LA15_0 = this.input.LA(1);
+
+ if ( ((LA15_0>='\t' && LA15_0<='\n')||LA15_0=='\r'||LA15_0==' ') ) {
+ alt15=1;
+ }
+
+
+ switch (alt15) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:
+ if ( (this.input.LA(1)>='\t' && this.input.LA(1)<='\n')||this.input.LA(1)=='\r'||this.input.LA(1)==' ' ) {
+ this.input.consume();
+
+ }
+ else {
+ var mse = new org.antlr.runtime.MismatchedSetException(null,this.input);
+ this.recover(mse);
+ throw mse;}
+
+
+
+ break;
+
+ default :
+ if ( cnt15 >= 1 ) {
+ break loop15;
+ }
+ var eee = new org.antlr.runtime.EarlyExitException(15, this.input);
+ throw eee;
+ }
+ cnt15++;
+ } while (true);
+
+
+
+
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "SU",
+
+ // $ANTLR start COLON
+ mCOLON: function() {
+ try {
+ var _type = this.COLON;
+ var _channel = org.antlr.runtime.BaseRecognizer.DEFAULT_TOKEN_CHANNEL;
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:257:7: ( ':' )
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:257:9: ':'
+ this.match(':');
+
+
+
+ this.state.type = _type;
+ this.state.channel = _channel;
+ }
+ finally {
+ }
+ },
+ // $ANTLR end "COLON",
+
+ mTokens: function() {
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:1:8: ( QUOT | APOS | L_QuotAttrContentChar | L_AposAttrContentChar | L_ElementContentChar | GREATER | EMPTY_CLOSE_TAG | S | L_NCName | EQUAL | ESCAPE_APOS | ESCAPE_QUOT | ESCAPE_LBRACKET | ESCAPE_RBRACKET | LBRACKET | RBRACKET | SMALLER | CLOSE_TAG | CDATA_START | CDATA_END | L_CDataSection | L_PredefinedEntityRef | L_CharRef | L_DirCommentConstructor | L_DirPIConstructor | COLON )
+ var alt16=26;
+ alt16 = this.dfa16.predict(this.input);
+ switch (alt16) {
+ case 1 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:1:10: QUOT
+ this.mQUOT();
+
+
+ break;
+ case 2 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:1:15: APOS
+ this.mAPOS();
+
+
+ break;
+ case 3 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:1:20: L_QuotAttrContentChar
+ this.mL_QuotAttrContentChar();
+
+
+ break;
+ case 4 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:1:42: L_AposAttrContentChar
+ this.mL_AposAttrContentChar();
+
+
+ break;
+ case 5 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:1:64: L_ElementContentChar
+ this.mL_ElementContentChar();
+
+
+ break;
+ case 6 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:1:85: GREATER
+ this.mGREATER();
+
+
+ break;
+ case 7 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:1:93: EMPTY_CLOSE_TAG
+ this.mEMPTY_CLOSE_TAG();
+
+
+ break;
+ case 8 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:1:109: S
+ this.mS();
+
+
+ break;
+ case 9 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:1:111: L_NCName
+ this.mL_NCName();
+
+
+ break;
+ case 10 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:1:120: EQUAL
+ this.mEQUAL();
+
+
+ break;
+ case 11 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:1:126: ESCAPE_APOS
+ this.mESCAPE_APOS();
+
+
+ break;
+ case 12 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:1:138: ESCAPE_QUOT
+ this.mESCAPE_QUOT();
+
+
+ break;
+ case 13 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:1:150: ESCAPE_LBRACKET
+ this.mESCAPE_LBRACKET();
+
+
+ break;
+ case 14 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:1:166: ESCAPE_RBRACKET
+ this.mESCAPE_RBRACKET();
+
+
+ break;
+ case 15 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:1:182: LBRACKET
+ this.mLBRACKET();
+
+
+ break;
+ case 16 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:1:191: RBRACKET
+ this.mRBRACKET();
+
+
+ break;
+ case 17 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:1:200: SMALLER
+ this.mSMALLER();
+
+
+ break;
+ case 18 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:1:208: CLOSE_TAG
+ this.mCLOSE_TAG();
+
+
+ break;
+ case 19 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:1:218: CDATA_START
+ this.mCDATA_START();
+
+
+ break;
+ case 20 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:1:230: CDATA_END
+ this.mCDATA_END();
+
+
+ break;
+ case 21 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:1:240: L_CDataSection
+ this.mL_CDataSection();
+
+
+ break;
+ case 22 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:1:255: L_PredefinedEntityRef
+ this.mL_PredefinedEntityRef();
+
+
+ break;
+ case 23 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:1:277: L_CharRef
+ this.mL_CharRef();
+
+
+ break;
+ case 24 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:1:287: L_DirCommentConstructor
+ this.mL_DirCommentConstructor();
+
+
+ break;
+ case 25 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:1:311: L_DirPIConstructor
+ this.mL_DirPIConstructor();
+
+
+ break;
+ case 26 :
+ // /Users/wcandillon/28msec/xquery.js/xquery/XMLLexer.g:1:330: COLON
+ this.mCOLON();
+
+
+ break;
+
+ }
+
+ }
+
+}, true); // important to pass true to overwrite default implementations
+
+org.antlr.lang.augmentObject(XMLLexer, {
+ DFA16_eotS:
+ "\u0001\uffff\u0001\u0010\u0001\u0013\u0001\u0014\u0001\u0016\u0001"+
+ "\u0017\u0001\u0018\u0001\u001a\u0001\u0016\u0001\u001d\u0001\u001f\u0001"+
+ "\u0023\u0001\u0024\u0001\uffff\u0001\u0016\u0001\u0027\u0002\uffff\u0001"+
+ "\u0029\u0002\uffff\u0001\u002e\u0003\uffff\u0001\u0018\u0001\uffff\u0001"+
+ "\u0016\u0016\uffff\u0001\u0039\u000d\uffff\u0001\u0041\u0002\uffff",
+ DFA16_eofS:
+ "\u0043\uffff",
+ DFA16_minS:
+ "\u0009\u0009\u0001\u007b\u0001\u007d\u0001\u0021\u0001\u0009\u0001"+
+ "\u0023\u0002\u0009\u0001\u0000\u0001\uffff\u0001\u0009\u0002\u0000\u0001"+
+ "\u0009\u0003\u0000\u0001\u0009\u0001\u0000\u0001\u0009\u0005\uffff\u0001"+
+ "\u002d\u0002\uffff\u0001\u0000\u0002\uffff\u0001\u0000\u0001\uffff\u0001"+
+ "\u0000\u0004\uffff\u0001\u0000\u0003\uffff\u0001\u0009\u0001\u0043\u0005"+
+ "\uffff\u0001\u0000\u0001\u0044\u0001\uffff\u0001\u0041\u0001\u0054\u0001"+
+ "\u0041\u0001\u005b\u0001\u0000\u0002\uffff",
+ DFA16_maxS:
+ "\u0009\ufffd\u0001\u007b\u0001\u007d\u0001\u003f\u0001\ufffd\u0001"+
+ "\u0071\u0002\ufffd\u0001\u0000\u0001\uffff\u0001\ufffd\u0002\u0000\u0001"+
+ "\ufffd\u0003\u0000\u0001\ufffd\u0001\u0000\u0001\ufffd\u0005\uffff\u0001"+
+ "\u005b\u0002\uffff\u0001\u0000\u0002\uffff\u0001\u0000\u0001\uffff\u0001"+
+ "\u0000\u0004\uffff\u0001\u0000\u0003\uffff\u0001\ufffd\u0001\u0043\u0005"+
+ "\uffff\u0001\u0000\u0001\u0044\u0001\uffff\u0001\u0041\u0001\u0054\u0001"+
+ "\u0041\u0001\u005b\u0001\uffff\u0002\uffff",
+ DFA16_acceptS:
+ "\u0011\uffff\u0001\u0005\u000a\uffff\u0001\u000d\u0001\u000f\u0001"+
+ "\u000e\u0001\u0010\u0001\u0012\u0001\uffff\u0001\u0019\u0001\u0011\u0001"+
+ "\uffff\u0001\u0017\u0001\u0016\u0001\uffff\u0001\u0001\u0001\uffff\u0001"+
+ "\u0002\u0001\u0003\u0001\u0004\u0001\u0006\u0001\uffff\u0001\u0008\u0001"+
+ "\u0009\u0001\u000a\u0002\uffff\u0001\u0018\u0001\u001a\u0001\u000c\u0001"+
+ "\u000b\u0001\u0007\u0002\uffff\u0001\u0014\u0005\uffff\u0001\u0013\u0001"+
+ "\u0015",
+ DFA16_specialS:
+ "\u0001\u0000\u0001\u001f\u0001\u0022\u0001\u0004\u0001\u000d\u0001"+
+ "\u001e\u0001\u0015\u0001\u0002\u0001\u000b\u0001\u0021\u0001\u0005\u0001"+
+ "\u0011\u0001\u001b\u0001\u0020\u0001\u000c\u0001\u001a\u0001\u0009\u0001"+
+ "\uffff\u0001\u0010\u0001\u000a\u0001\u001d\u0001\u0016\u0001\u000f\u0001"+
+ "\u0018\u0001\u0019\u0001\u0003\u0001\u0017\u0001\u0008\u0005\uffff\u0001"+
+ "\u0012\u0002\uffff\u0001\u000e\u0002\uffff\u0001\u0006\u0001\uffff\u0001"+
+ "\u0007\u0004\uffff\u0001\u001c\u0003\uffff\u0001\u0013\u0006\uffff\u0001"+
+ "\u0014\u0006\uffff\u0001\u0001\u0002\uffff}>",
+ DFA16_transitionS: [
+ "\u0002\u0005\u0002\uffff\u0001\u0005\u0012\uffff\u0001\u0005"+
+ "\u0001\u000e\u0001\u0001\u0003\u000e\u0001\u000d\u0001\u0002"+
+ "\u0007\u000e\u0001\u0004\u000a\u000e\u0001\u000c\u0001\u000e"+
+ "\u0001\u000b\u0001\u0007\u0001\u0003\u0002\u000e\u001a\u0006"+
+ "\u0002\u000e\u0001\u0008\u0001\u000e\u0001\u0006\u0001\u000e"+
+ "\u001a\u0006\u0001\u0009\u0001\u000e\u0001\u000a\ud782\u000e"+
+ "\u0800\uffff\u1ffe\u000e",
+ "\u0002\u0011\u0002\uffff\u0001\u0011\u0012\uffff\u0002\u0011"+
+ "\u0001\u000f\u0003\u0011\u0001\uffff\u0015\u0011\u0001\uffff"+
+ "\u003e\u0011\u0001\uffff\u0001\u0011\u0001\uffff\ud782\u0011"+
+ "\u0800\uffff\u1ffe\u0011",
+ "\u0002\u0011\u0002\uffff\u0001\u0011\u0012\uffff\u0006\u0011"+
+ "\u0001\uffff\u0001\u0012\u0014\u0011\u0001\uffff\u003e\u0011"+
+ "\u0001\uffff\u0001\u0011\u0001\uffff\ud782\u0011\u0800\uffff"+
+ "\u1ffe\u0011",
+ "\u0002\u000e\u0002\uffff\u0001\u000e\u0012\uffff\u0002\u000e"+
+ "\u0001\u0011\u0003\u000e\u0001\uffff\u0001\u0011\u0014\u000e"+
+ "\u0001\uffff\u003e\u000e\u0001\uffff\u0001\u000e\u0001\uffff"+
+ "\ud782\u000e\u0800\uffff\u1ffe\u000e",
+ "\u0002\u000e\u0002\uffff\u0001\u000e\u0012\uffff\u0002\u000e"+
+ "\u0001\u0011\u0003\u000e\u0001\uffff\u0001\u0011\u0014\u000e"+
+ "\u0001\uffff\u0001\u000e\u0001\u0015\u003c\u000e\u0001\uffff"+
+ "\u0001\u000e\u0001\uffff\ud782\u000e\u0800\uffff\u1ffe\u000e",
+ "\u0002\u0005\u0002\uffff\u0001\u0005\u0012\uffff\u0001\u0005"+
+ "\u0001\u000e\u0001\u0011\u0003\u000e\u0001\uffff\u0001\u0011"+
+ "\u0014\u000e\u0001\uffff\u003e\u000e\u0001\uffff\u0001\u000e"+
+ "\u0001\uffff\ud782\u000e\u0800\uffff\u1ffe\u000e",
+ "\u0002\u000e\u0002\uffff\u0001\u000e\u0012\uffff\u0002\u000e"+
+ "\u0001\u0011\u0003\u000e\u0001\uffff\u0001\u0011\u0005\u000e"+
+ "\u0002\u0019\u0001\u000e\u000a\u0019\u0002\u000e\u0001\uffff"+
+ "\u0004\u000e\u001a\u0019\u0004\u000e\u0001\u0019\u0001\u000e"+
+ "\u001a\u0019\u0001\uffff\u0001\u000e\u0001\uffff\ud782\u000e"+
+ "\u0800\uffff\u1ffe\u000e",
+ "\u0002\u000e\u0002\uffff\u0001\u000e\u0012\uffff\u0002\u000e"+
+ "\u0001\u0011\u0003\u000e\u0001\uffff\u0001\u0011\u0014\u000e"+
+ "\u0001\uffff\u003e\u000e\u0001\uffff\u0001\u000e\u0001\uffff"+
+ "\ud782\u000e\u0800\uffff\u1ffe\u000e",
+ "\u0002\u000e\u0002\uffff\u0001\u000e\u0012\uffff\u0002\u000e"+
+ "\u0001\u0011\u0003\u000e\u0001\uffff\u0001\u0011\u0014\u000e"+
+ "\u0001\uffff\u0020\u000e\u0001\u001b\u001d\u000e\u0001\uffff"+
+ "\u0001\u000e\u0001\uffff\ud782\u000e\u0800\uffff\u1ffe\u000e",
+ "\u0001\u001c",
+ "\u0001\u001e",
+ "\u0001\u0021\u000d\uffff\u0001\u0020\u000f\uffff\u0001\u0022",
+ "\u0002\u000e\u0002\uffff\u0001\u000e\u0012\uffff\u0002\u000e"+
+ "\u0001\u0011\u0003\u000e\u0001\uffff\u0001\u0011\u0014\u000e"+
+ "\u0001\uffff\u003e\u000e\u0001\uffff\u0001\u000e\u0001\uffff"+
+ "\ud782\u000e\u0800\uffff\u1ffe\u000e",
+ "\u0001\u0025\u003d\uffff\u0001\u0026\u0005\uffff\u0001\u0026"+
+ "\u0004\uffff\u0001\u0026\u0004\uffff\u0001\u0026",
+ "\u0002\u000e\u0002\uffff\u0001\u000e\u0012\uffff\u0002\u000e"+
+ "\u0001\u0011\u0003\u000e\u0001\uffff\u0001\u0011\u0014\u000e"+
+ "\u0001\uffff\u003e\u000e\u0001\uffff\u0001\u000e\u0001\uffff"+
+ "\ud782\u000e\u0800\uffff\u1ffe\u000e",
+ "\u0002\u0011\u0002\uffff\u0001\u0011\u0012\uffff\u0006\u0011"+
+ "\u0001\uffff\u0015\u0011\u0001\uffff\u003e\u0011\u0001\uffff"+
+ "\u0001\u0011\u0001\uffff\ud782\u0011\u0800\uffff\u1ffe\u0011",
+ "\u0001\uffff",
+ "",
+ "\u0002\u0011\u0002\uffff\u0001\u0011\u0012\uffff\u0006\u0011"+
+ "\u0001\uffff\u0015\u0011\u0001\uffff\u003e\u0011\u0001\uffff"+
+ "\u0001\u0011\u0001\uffff\ud782\u0011\u0800\uffff\u1ffe\u0011",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0002\u000e\u0002\uffff\u0001\u000e\u0012\uffff\u0002\u000e"+
+ "\u0001\u0011\u0003\u000e\u0001\uffff\u0001\u0011\u0014\u000e"+
+ "\u0001\uffff\u003e\u000e\u0001\uffff\u0001\u000e\u0001\uffff"+
+ "\ud782\u000e\u0800\uffff\u1ffe\u000e",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0001\uffff",
+ "\u0002\u000e\u0002\uffff\u0001\u000e\u0012\uffff\u0002\u000e"+
+ "\u0001\u0011\u0003\u000e\u0001\uffff\u0001\u0011\u0005\u000e"+
+ "\u0002\u0019\u0001\u000e\u000a\u0019\u0002\u000e\u0001\uffff"+
+ "\u0004\u000e\u001a\u0019\u0004\u000e\u0001\u0019\u0001\u000e"+
+ "\u001a\u0019\u0001\uffff\u0001\u000e\u0001\uffff\ud782\u000e"+
+ "\u0800\uffff\u1ffe\u000e",
+ "\u0001\uffff",
+ "\u0002\u000e\u0002\uffff\u0001\u000e\u0012\uffff\u0002\u000e"+
+ "\u0001\u0011\u0003\u000e\u0001\uffff\u0001\u0011\u0014\u000e"+
+ "\u0001\uffff\u0001\u000e\u0001\u0032\u003c\u000e\u0001\uffff"+
+ "\u0001\u000e\u0001\uffff\ud782\u000e\u0800\uffff\u1ffe\u000e",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\u0001\u0034\u002d\uffff\u0001\u0033",
+ "",
+ "",
+ "\u0001\uffff",
+ "",
+ "",
+ "\u0001\uffff",
+ "",
+ "\u0001\uffff",
+ "",
+ "",
+ "",
+ "",
+ "\u0001\uffff",
+ "",
+ "",
+ "",
+ "\u0002\u000e\u0002\uffff\u0001\u000e\u0012\uffff\u0002\u000e"+
+ "\u0001\u0011\u0003\u000e\u0001\uffff\u0001\u0011\u0014\u000e"+
+ "\u0001\uffff\u003e\u000e\u0001\uffff\u0001\u000e\u0001\uffff"+
+ "\ud782\u000e\u0800\uffff\u1ffe\u000e",
+ "\u0001\u003a",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "\u0001\uffff",
+ "\u0001\u003c",
+ "",
+ "\u0001\u003d",
+ "\u0001\u003e",
+ "\u0001\u003f",
+ "\u0001\u0040",
+ "\u0000\u0042",
+ "",
+ ""
+ ]
+});
+
+org.antlr.lang.augmentObject(XMLLexer, {
+ DFA16_eot:
+ org.antlr.runtime.DFA.unpackEncodedString(XMLLexer.DFA16_eotS),
+ DFA16_eof:
+ org.antlr.runtime.DFA.unpackEncodedString(XMLLexer.DFA16_eofS),
+ DFA16_min:
+ org.antlr.runtime.DFA.unpackEncodedStringToUnsignedChars(XMLLexer.DFA16_minS),
+ DFA16_max:
+ org.antlr.runtime.DFA.unpackEncodedStringToUnsignedChars(XMLLexer.DFA16_maxS),
+ DFA16_accept:
+ org.antlr.runtime.DFA.unpackEncodedString(XMLLexer.DFA16_acceptS),
+ DFA16_special:
+ org.antlr.runtime.DFA.unpackEncodedString(XMLLexer.DFA16_specialS),
+ DFA16_transition: (function() {
+ var a = [],
+ i,
+ numStates = XMLLexer.DFA16_transitionS.length;
+ for (i=0; i<numStates; i++) {
+ a.push(org.antlr.runtime.DFA.unpackEncodedString(XMLLexer.DFA16_transitionS[i]));
+ }
+ return a;
+ })()
+});
+
+XMLLexer.DFA16 = function(recognizer) {
+ this.recognizer = recognizer;
+ this.decisionNumber = 16;
+ this.eot = XMLLexer.DFA16_eot;
+ this.eof = XMLLexer.DFA16_eof;
+ this.min = XMLLexer.DFA16_min;
+ this.max = XMLLexer.DFA16_max;
+ this.accept = XMLLexer.DFA16_accept;
+ this.special = XMLLexer.DFA16_special;
+ this.transition = XMLLexer.DFA16_transition;
+};
+
+org.antlr.lang.extend(XMLLexer.DFA16, org.antlr.runtime.DFA, {
+ getDescription: function() {
+ return "1:1: Tokens : ( QUOT | APOS | L_QuotAttrContentChar | L_AposAttrContentChar | L_ElementContentChar | GREATER | EMPTY_CLOSE_TAG | S | L_NCName | EQUAL | ESCAPE_APOS | ESCAPE_QUOT | ESCAPE_LBRACKET | ESCAPE_RBRACKET | LBRACKET | RBRACKET | SMALLER | CLOSE_TAG | CDATA_START | CDATA_END | L_CDataSection | L_PredefinedEntityRef | L_CharRef | L_DirCommentConstructor | L_DirPIConstructor | COLON );";
+ },
+ specialStateTransition: function(s, input) {
+ var _s = s;
+ var retval = (function(s, input) {
+ switch ( s ) {
+ case 0 :
+ var LA16_0 = input.LA(1);
+
+
+ var index16_0 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (LA16_0=='\"') && ((( this.inQuotAttr )||( this.inElem || this.inQuotAttr )||( !this.inElem )))) {s = 1;}
+
+ else if ( (LA16_0=='\'') && ((( this.inElem || this.inAposAttr )||( this.inAposAttr )||( !this.inElem )))) {s = 2;}
+
+ else if ( (LA16_0=='>') && ((( this.inElem )||( this.inQuotAttr )||( this.inAposAttr )||( !this.inElem )))) {s = 3;}
+
+ else if ( (LA16_0=='/') && ((( this.inElem )||( this.inQuotAttr )||( this.inAposAttr )||( !this.inElem )))) {s = 4;}
+
+ else if ( ((LA16_0>='\t' && LA16_0<='\n')||LA16_0=='\r'||LA16_0==' ') && ((( this.inElem )||( this.inQuotAttr )||( this.inAposAttr )||( !this.inElem )))) {s = 5;}
+
+ else if ( ((LA16_0>='A' && LA16_0<='Z')||LA16_0=='_'||(LA16_0>='a' && LA16_0<='z')) && ((( this.inElem )||( this.inQuotAttr )||( this.inAposAttr )||( !this.inElem )))) {s = 6;}
+
+ else if ( (LA16_0=='=') && ((( this.inElem )||( this.inQuotAttr )||( this.inAposAttr )||( !this.inElem )))) {s = 7;}
+
+ else if ( (LA16_0==']') ) {s = 8;}
+
+ else if ( (LA16_0=='{') && (( !this.inElem || this.inAposAttr || this.inQuotAttr ))) {s = 9;}
+
+ else if ( (LA16_0=='}') && (( !this.inElem || this.inAposAttr || this.inQuotAttr ))) {s = 10;}
+
+ else if ( (LA16_0=='<') ) {s = 11;}
+
+ else if ( (LA16_0==':') ) {s = 12;}
+
+ else if ( (LA16_0=='&') ) {s = 13;}
+
+ else if ( (LA16_0=='!'||(LA16_0>='#' && LA16_0<='%')||(LA16_0>='(' && LA16_0<='.')||(LA16_0>='0' && LA16_0<='9')||LA16_0==';'||(LA16_0>='?' && LA16_0<='@')||(LA16_0>='[' && LA16_0<='\\')||LA16_0=='^'||LA16_0=='`'||LA16_0=='|'||(LA16_0>='~' && LA16_0<='\uD7FF')||(LA16_0>='\uE000' && LA16_0<='\uFFFD')) && ((( this.inQuotAttr )||( this.inAposAttr )||( !this.inElem )))) {s = 14;}
+
+
+ input.seek(index16_0);
+ if ( s>=0 ) return s;
+ break;
+ case 1 :
+ var LA16_64 = input.LA(1);
+
+
+ var index16_64 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((LA16_64>='\u0000' && LA16_64<='\uFFFF')) && (( !this.inElem ))) {s = 66;}
+
+ else s = 65;
+
+
+ input.seek(index16_64);
+ if ( s>=0 ) return s;
+ break;
+ case 2 :
+ var LA16_7 = input.LA(1);
+
+
+ var index16_7 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((LA16_7>='\t' && LA16_7<='\n')||LA16_7=='\r'||(LA16_7>=' ' && LA16_7<='!')||(LA16_7>='#' && LA16_7<='%')||(LA16_7>='(' && LA16_7<=';')||(LA16_7>='=' && LA16_7<='z')||LA16_7=='|'||(LA16_7>='~' && LA16_7<='\uD7FF')||(LA16_7>='\uE000' && LA16_7<='\uFFFD')) && ((( this.inQuotAttr )||( this.inAposAttr )||( !this.inElem )))) {s = 14;}
+
+ else if ( (LA16_7=='\"'||LA16_7=='\'') && (( !this.inElem ))) {s = 17;}
+
+ else s = 26;
+
+
+ input.seek(index16_7);
+ if ( s>=0 ) return s;
+ break;
+ case 3 :
+ var LA16_25 = input.LA(1);
+
+
+ var index16_25 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((LA16_25>='-' && LA16_25<='.')||(LA16_25>='0' && LA16_25<='9')||(LA16_25>='A' && LA16_25<='Z')||LA16_25=='_'||(LA16_25>='a' && LA16_25<='z')) && ((( this.inElem )||( this.inQuotAttr )||( this.inAposAttr )||( !this.inElem )))) {s = 25;}
+
+ else if ( (LA16_25=='\"'||LA16_25=='\'') && (( !this.inElem ))) {s = 17;}
+
+ else if ( ((LA16_25>='\t' && LA16_25<='\n')||LA16_25=='\r'||(LA16_25>=' ' && LA16_25<='!')||(LA16_25>='#' && LA16_25<='%')||(LA16_25>='(' && LA16_25<=',')||LA16_25=='/'||(LA16_25>=':' && LA16_25<=';')||(LA16_25>='=' && LA16_25<='@')||(LA16_25>='[' && LA16_25<='^')||LA16_25=='`'||LA16_25=='|'||(LA16_25>='~' && LA16_25<='\uD7FF')||(LA16_25>='\uE000' && LA16_25<='\uFFFD')) && ((( this.inQuotAttr )||( this.inAposAttr )||( !this.inElem )))) {s = 14;}
+
+ else s = 24;
+
+
+ input.seek(index16_25);
+ if ( s>=0 ) return s;
+ break;
+ case 4 :
+ var LA16_3 = input.LA(1);
+
+
+ var index16_3 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((LA16_3>='\t' && LA16_3<='\n')||LA16_3=='\r'||(LA16_3>=' ' && LA16_3<='!')||(LA16_3>='#' && LA16_3<='%')||(LA16_3>='(' && LA16_3<=';')||(LA16_3>='=' && LA16_3<='z')||LA16_3=='|'||(LA16_3>='~' && LA16_3<='\uD7FF')||(LA16_3>='\uE000' && LA16_3<='\uFFFD')) && ((( this.inQuotAttr )||( this.inAposAttr )||( !this.inElem )))) {s = 14;}
+
+ else if ( (LA16_3=='\"'||LA16_3=='\'') && (( !this.inElem ))) {s = 17;}
+
+ else s = 20;
+
+
+ input.seek(index16_3);
+ if ( s>=0 ) return s;
+ break;
+ case 5 :
+ var LA16_10 = input.LA(1);
+
+
+ var index16_10 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (LA16_10=='}') && (( !this.inElem || this.inAposAttr || this.inQuotAttr ))) {s = 30;}
+
+ else s = 31;
+
+
+ input.seek(index16_10);
+ if ( s>=0 ) return s;
+ break;
+ case 6 :
+ var LA16_39 = input.LA(1);
+
+
+ var index16_39 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (( !this.inElem )) ) {s = 17;}
+
+ else if ( (( this.inQuotAttr )) ) {s = 54;}
+
+
+ input.seek(index16_39);
+ if ( s>=0 ) return s;
+ break;
+ case 7 :
+ var LA16_41 = input.LA(1);
+
+
+ var index16_41 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (( !this.inElem )) ) {s = 17;}
+
+ else if ( (( this.inAposAttr )) ) {s = 55;}
+
+
+ input.seek(index16_41);
+ if ( s>=0 ) return s;
+ break;
+ case 8 :
+ var LA16_27 = input.LA(1);
+
+
+ var index16_27 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (LA16_27=='>') ) {s = 50;}
+
+ else if ( ((LA16_27>='\t' && LA16_27<='\n')||LA16_27=='\r'||(LA16_27>=' ' && LA16_27<='!')||(LA16_27>='#' && LA16_27<='%')||(LA16_27>='(' && LA16_27<=';')||LA16_27=='='||(LA16_27>='?' && LA16_27<='z')||LA16_27=='|'||(LA16_27>='~' && LA16_27<='\uD7FF')||(LA16_27>='\uE000' && LA16_27<='\uFFFD')) && ((( this.inQuotAttr )||( this.inAposAttr )||( !this.inElem )))) {s = 14;}
+
+ else if ( (LA16_27=='\"'||LA16_27=='\'') && (( !this.inElem ))) {s = 17;}
+
+ else s = 22;
+
+
+ input.seek(index16_27);
+ if ( s>=0 ) return s;
+ break;
+ case 9 :
+ var LA16_16 = input.LA(1);
+
+
+ var index16_16 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (( this.inElem || this.inQuotAttr )) ) {s = 40;}
+
+ else if ( (( !this.inElem )) ) {s = 17;}
+
+
+ input.seek(index16_16);
+ if ( s>=0 ) return s;
+ break;
+ case 10 :
+ var LA16_19 = input.LA(1);
+
+
+ var index16_19 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (( this.inElem || this.inAposAttr )) ) {s = 42;}
+
+ else if ( (( !this.inElem )) ) {s = 17;}
+
+
+ input.seek(index16_19);
+ if ( s>=0 ) return s;
+ break;
+ case 11 :
+ var LA16_8 = input.LA(1);
+
+
+ var index16_8 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (LA16_8==']') ) {s = 27;}
+
+ else if ( ((LA16_8>='\t' && LA16_8<='\n')||LA16_8=='\r'||(LA16_8>=' ' && LA16_8<='!')||(LA16_8>='#' && LA16_8<='%')||(LA16_8>='(' && LA16_8<=';')||(LA16_8>='=' && LA16_8<='\\')||(LA16_8>='^' && LA16_8<='z')||LA16_8=='|'||(LA16_8>='~' && LA16_8<='\uD7FF')||(LA16_8>='\uE000' && LA16_8<='\uFFFD')) && ((( this.inQuotAttr )||( this.inAposAttr )||( !this.inElem )))) {s = 14;}
+
+ else if ( (LA16_8=='\"'||LA16_8=='\'') && (( !this.inElem ))) {s = 17;}
+
+ else s = 22;
+
+
+ input.seek(index16_8);
+ if ( s>=0 ) return s;
+ break;
+ case 12 :
+ var LA16_14 = input.LA(1);
+
+
+ var index16_14 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((LA16_14>='\t' && LA16_14<='\n')||LA16_14=='\r'||(LA16_14>=' ' && LA16_14<='!')||(LA16_14>='#' && LA16_14<='%')||(LA16_14>='(' && LA16_14<=';')||(LA16_14>='=' && LA16_14<='z')||LA16_14=='|'||(LA16_14>='~' && LA16_14<='\uD7FF')||(LA16_14>='\uE000' && LA16_14<='\uFFFD')) && ((( this.inQuotAttr )||( this.inAposAttr )||( !this.inElem )))) {s = 14;}
+
+ else if ( (LA16_14=='\"'||LA16_14=='\'') && (( !this.inElem ))) {s = 17;}
+
+ else s = 22;
+
+
+ input.seek(index16_14);
+ if ( s>=0 ) return s;
+ break;
+ case 13 :
+ var LA16_4 = input.LA(1);
+
+
+ var index16_4 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (LA16_4=='>') && ((( this.inElem )||( this.inQuotAttr )||( this.inAposAttr )||( !this.inElem )))) {s = 21;}
+
+ else if ( ((LA16_4>='\t' && LA16_4<='\n')||LA16_4=='\r'||(LA16_4>=' ' && LA16_4<='!')||(LA16_4>='#' && LA16_4<='%')||(LA16_4>='(' && LA16_4<=';')||LA16_4=='='||(LA16_4>='?' && LA16_4<='z')||LA16_4=='|'||(LA16_4>='~' && LA16_4<='\uD7FF')||(LA16_4>='\uE000' && LA16_4<='\uFFFD')) && ((( this.inQuotAttr )||( this.inAposAttr )||( !this.inElem )))) {s = 14;}
+
+ else if ( (LA16_4=='\"'||LA16_4=='\'') && (( !this.inElem ))) {s = 17;}
+
+ else s = 22;
+
+
+ input.seek(index16_4);
+ if ( s>=0 ) return s;
+ break;
+ case 14 :
+ var LA16_36 = input.LA(1);
+
+
+ var index16_36 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (( this.inQuotAttr )) ) {s = 43;}
+
+ else if ( (( this.inAposAttr )) ) {s = 44;}
+
+ else if ( (( !this.inElem )) ) {s = 17;}
+
+ else if ( (true) ) {s = 53;}
+
+
+ input.seek(index16_36);
+ if ( s>=0 ) return s;
+ break;
+ case 15 :
+ var LA16_22 = input.LA(1);
+
+
+ var index16_22 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (( this.inQuotAttr )) ) {s = 43;}
+
+ else if ( (( this.inAposAttr )) ) {s = 44;}
+
+ else if ( (( !this.inElem )) ) {s = 17;}
+
+
+ input.seek(index16_22);
+ if ( s>=0 ) return s;
+ break;
+ case 16 :
+ var LA16_18 = input.LA(1);
+
+
+ var index16_18 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((LA16_18>='\t' && LA16_18<='\n')||LA16_18=='\r'||(LA16_18>=' ' && LA16_18<='%')||(LA16_18>='\'' && LA16_18<=';')||(LA16_18>='=' && LA16_18<='z')||LA16_18=='|'||(LA16_18>='~' && LA16_18<='\uD7FF')||(LA16_18>='\uE000' && LA16_18<='\uFFFD')) && (( !this.inElem ))) {s = 17;}
+
+ else s = 41;
+
+
+ input.seek(index16_18);
+ if ( s>=0 ) return s;
+ break;
+ case 17 :
+ var LA16_11 = input.LA(1);
+
+
+ var index16_11 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (LA16_11=='/') && (( !this.inElem ))) {s = 32;}
+
+ else if ( (LA16_11=='!') ) {s = 33;}
+
+ else if ( (LA16_11=='?') && (( !this.inElem ))) {s = 34;}
+
+ else s = 35;
+
+
+ input.seek(index16_11);
+ if ( s>=0 ) return s;
+ break;
+ case 18 :
+ var LA16_33 = input.LA(1);
+
+
+ var index16_33 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (LA16_33=='[') ) {s = 51;}
+
+ else if ( (LA16_33=='-') && (( !this.inElem ))) {s = 52;}
+
+
+ input.seek(index16_33);
+ if ( s>=0 ) return s;
+ break;
+ case 19 :
+ var LA16_50 = input.LA(1);
+
+
+ var index16_50 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((LA16_50>='\t' && LA16_50<='\n')||LA16_50=='\r'||(LA16_50>=' ' && LA16_50<='!')||(LA16_50>='#' && LA16_50<='%')||(LA16_50>='(' && LA16_50<=';')||(LA16_50>='=' && LA16_50<='z')||LA16_50=='|'||(LA16_50>='~' && LA16_50<='\uD7FF')||(LA16_50>='\uE000' && LA16_50<='\uFFFD')) && ((( this.inQuotAttr )||( this.inAposAttr )||( !this.inElem )))) {s = 14;}
+
+ else if ( (LA16_50=='\"'||LA16_50=='\'') && (( !this.inElem ))) {s = 17;}
+
+ else s = 57;
+
+
+ input.seek(index16_50);
+ if ( s>=0 ) return s;
+ break;
+ case 20 :
+ var LA16_57 = input.LA(1);
+
+
+ var index16_57 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (( this.inQuotAttr )) ) {s = 43;}
+
+ else if ( (( this.inAposAttr )) ) {s = 44;}
+
+ else if ( (( !this.inElem )) ) {s = 17;}
+
+ else if ( (true) ) {s = 59;}
+
+
+ input.seek(index16_57);
+ if ( s>=0 ) return s;
+ break;
+ case 21 :
+ var LA16_6 = input.LA(1);
+
+
+ var index16_6 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((LA16_6>='-' && LA16_6<='.')||(LA16_6>='0' && LA16_6<='9')||(LA16_6>='A' && LA16_6<='Z')||LA16_6=='_'||(LA16_6>='a' && LA16_6<='z')) && ((( this.inElem )||( this.inQuotAttr )||( this.inAposAttr )||( !this.inElem )))) {s = 25;}
+
+ else if ( (LA16_6=='\"'||LA16_6=='\'') && (( !this.inElem ))) {s = 17;}
+
+ else if ( ((LA16_6>='\t' && LA16_6<='\n')||LA16_6=='\r'||(LA16_6>=' ' && LA16_6<='!')||(LA16_6>='#' && LA16_6<='%')||(LA16_6>='(' && LA16_6<=',')||LA16_6=='/'||(LA16_6>=':' && LA16_6<=';')||(LA16_6>='=' && LA16_6<='@')||(LA16_6>='[' && LA16_6<='^')||LA16_6=='`'||LA16_6=='|'||(LA16_6>='~' && LA16_6<='\uD7FF')||(LA16_6>='\uE000' && LA16_6<='\uFFFD')) && ((( this.inQuotAttr )||( this.inAposAttr )||( !this.inElem )))) {s = 14;}
+
+ else s = 24;
+
+
+ input.seek(index16_6);
+ if ( s>=0 ) return s;
+ break;
+ case 22 :
+ var LA16_21 = input.LA(1);
+
+
+ var index16_21 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((LA16_21>='\t' && LA16_21<='\n')||LA16_21=='\r'||(LA16_21>=' ' && LA16_21<='!')||(LA16_21>='#' && LA16_21<='%')||(LA16_21>='(' && LA16_21<=';')||(LA16_21>='=' && LA16_21<='z')||LA16_21=='|'||(LA16_21>='~' && LA16_21<='\uD7FF')||(LA16_21>='\uE000' && LA16_21<='\uFFFD')) && ((( this.inQuotAttr )||( this.inAposAttr )||( !this.inElem )))) {s = 14;}
+
+ else if ( (LA16_21=='\"'||LA16_21=='\'') && (( !this.inElem ))) {s = 17;}
+
+ else s = 46;
+
+
+ input.seek(index16_21);
+ if ( s>=0 ) return s;
+ break;
+ case 23 :
+ var LA16_26 = input.LA(1);
+
+
+ var index16_26 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (( this.inQuotAttr )) ) {s = 43;}
+
+ else if ( (( this.inAposAttr )) ) {s = 44;}
+
+ else if ( (( !this.inElem )) ) {s = 17;}
+
+ else if ( (( this.inElem )) ) {s = 49;}
+
+
+ input.seek(index16_26);
+ if ( s>=0 ) return s;
+ break;
+ case 24 :
+ var LA16_23 = input.LA(1);
+
+
+ var index16_23 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (( this.inQuotAttr )) ) {s = 43;}
+
+ else if ( (( this.inAposAttr )) ) {s = 44;}
+
+ else if ( (( !this.inElem )) ) {s = 17;}
+
+ else if ( (( this.inElem )) ) {s = 47;}
+
+
+ input.seek(index16_23);
+ if ( s>=0 ) return s;
+ break;
+ case 25 :
+ var LA16_24 = input.LA(1);
+
+
+ var index16_24 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (( this.inQuotAttr )) ) {s = 43;}
+
+ else if ( (( this.inAposAttr )) ) {s = 44;}
+
+ else if ( (( !this.inElem )) ) {s = 17;}
+
+ else if ( (( this.inElem )) ) {s = 48;}
+
+
+ input.seek(index16_24);
+ if ( s>=0 ) return s;
+ break;
+ case 26 :
+ var LA16_15 = input.LA(1);
+
+
+ var index16_15 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((LA16_15>='\t' && LA16_15<='\n')||LA16_15=='\r'||(LA16_15>=' ' && LA16_15<='%')||(LA16_15>='\'' && LA16_15<=';')||(LA16_15>='=' && LA16_15<='z')||LA16_15=='|'||(LA16_15>='~' && LA16_15<='\uD7FF')||(LA16_15>='\uE000' && LA16_15<='\uFFFD')) && (( !this.inElem ))) {s = 17;}
+
+ else s = 39;
+
+
+ input.seek(index16_15);
+ if ( s>=0 ) return s;
+ break;
+ case 27 :
+ var LA16_12 = input.LA(1);
+
+
+ var index16_12 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((LA16_12>='\t' && LA16_12<='\n')||LA16_12=='\r'||(LA16_12>=' ' && LA16_12<='!')||(LA16_12>='#' && LA16_12<='%')||(LA16_12>='(' && LA16_12<=';')||(LA16_12>='=' && LA16_12<='z')||LA16_12=='|'||(LA16_12>='~' && LA16_12<='\uD7FF')||(LA16_12>='\uE000' && LA16_12<='\uFFFD')) && ((( this.inQuotAttr )||( this.inAposAttr )||( !this.inElem )))) {s = 14;}
+
+ else if ( (LA16_12=='\"'||LA16_12=='\'') && (( !this.inElem ))) {s = 17;}
+
+ else s = 36;
+
+
+ input.seek(index16_12);
+ if ( s>=0 ) return s;
+ break;
+ case 28 :
+ var LA16_46 = input.LA(1);
+
+
+ var index16_46 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (( this.inQuotAttr )) ) {s = 43;}
+
+ else if ( (( this.inAposAttr )) ) {s = 44;}
+
+ else if ( (( !this.inElem )) ) {s = 17;}
+
+ else if ( (( this.inElem )) ) {s = 56;}
+
+
+ input.seek(index16_46);
+ if ( s>=0 ) return s;
+ break;
+ case 29 :
+ var LA16_20 = input.LA(1);
+
+
+ var index16_20 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (( this.inQuotAttr )) ) {s = 43;}
+
+ else if ( (( this.inAposAttr )) ) {s = 44;}
+
+ else if ( (( !this.inElem )) ) {s = 17;}
+
+ else if ( (( this.inElem )) ) {s = 45;}
+
+
+ input.seek(index16_20);
+ if ( s>=0 ) return s;
+ break;
+ case 30 :
+ var LA16_5 = input.LA(1);
+
+
+ var index16_5 = input.index();
+ input.rewind();
+ s = -1;
+ if ( ((LA16_5>='\t' && LA16_5<='\n')||LA16_5=='\r'||LA16_5==' ') && ((( this.inElem )||( this.inQuotAttr )||( this.inAposAttr )||( !this.inElem )))) {s = 5;}
+
+ else if ( (LA16_5=='\"'||LA16_5=='\'') && (( !this.inElem ))) {s = 17;}
+
+ else if ( (LA16_5=='!'||(LA16_5>='#' && LA16_5<='%')||(LA16_5>='(' && LA16_5<=';')||(LA16_5>='=' && LA16_5<='z')||LA16_5=='|'||(LA16_5>='~' && LA16_5<='\uD7FF')||(LA16_5>='\uE000' && LA16_5<='\uFFFD')) && ((( this.inQuotAttr )||( this.inAposAttr )||( !this.inElem )))) {s = 14;}
+
+ else s = 23;
+
+
+ input.seek(index16_5);
+ if ( s>=0 ) return s;
+ break;
+ case 31 :
+ var LA16_1 = input.LA(1);
+
+
+ var index16_1 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (LA16_1=='\"') && ((( this.inQuotAttr )||( !this.inElem )))) {s = 15;}
+
+ else if ( ((LA16_1>='\t' && LA16_1<='\n')||LA16_1=='\r'||(LA16_1>=' ' && LA16_1<='!')||(LA16_1>='#' && LA16_1<='%')||(LA16_1>='\'' && LA16_1<=';')||(LA16_1>='=' && LA16_1<='z')||LA16_1=='|'||(LA16_1>='~' && LA16_1<='\uD7FF')||(LA16_1>='\uE000' && LA16_1<='\uFFFD')) && (( !this.inElem ))) {s = 17;}
+
+ else s = 16;
+
+
+ input.seek(index16_1);
+ if ( s>=0 ) return s;
+ break;
+ case 32 :
+ var LA16_13 = input.LA(1);
+
+
+ var index16_13 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (LA16_13=='#') ) {s = 37;}
+
+ else if ( (LA16_13=='a'||LA16_13=='g'||LA16_13=='l'||LA16_13=='q') && (( !this.inElem || this.inAposAttr || this.inQuotAttr ))) {s = 38;}
+
+
+ input.seek(index16_13);
+ if ( s>=0 ) return s;
+ break;
+ case 33 :
+ var LA16_9 = input.LA(1);
+
+
+ var index16_9 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (LA16_9=='{') && (( !this.inElem || this.inAposAttr || this.inQuotAttr ))) {s = 28;}
+
+ else s = 29;
+
+
+ input.seek(index16_9);
+ if ( s>=0 ) return s;
+ break;
+ case 34 :
+ var LA16_2 = input.LA(1);
+
+
+ var index16_2 = input.index();
+ input.rewind();
+ s = -1;
+ if ( (LA16_2=='\'') && ((( this.inAposAttr )||( !this.inElem )))) {s = 18;}
+
+ else if ( ((LA16_2>='\t' && LA16_2<='\n')||LA16_2=='\r'||(LA16_2>=' ' && LA16_2<='%')||(LA16_2>='(' && LA16_2<=';')||(LA16_2>='=' && LA16_2<='z')||LA16_2=='|'||(LA16_2>='~' && LA16_2<='\uD7FF')||(LA16_2>='\uE000' && LA16_2<='\uFFFD')) && (( !this.inElem ))) {s = 17;}
+
+ else s = 19;
+
+
+ input.seek(index16_2);
+ if ( s>=0 ) return s;
+ break;
+ }
+ }).call(this.recognizer, s, input);
+ if (!org.antlr.lang.isUndefined(retval)) {
+ return retval;
+ }
+ var nvae =
+ new org.antlr.runtime.NoViableAltException(this.getDescription(), 16, _s, input);
+ this.error(nvae);
+ throw nvae;
+ },
+ dummy: null
+});
+
+})();
+exports.XMLLexer = XMLLexer; });
+define('ace/mode/xquery/XQDTParser', ['require', 'exports', 'module' , 'ace/mode/xquery/antlr3-all', 'ace/mode/xquery/XQuerySemanticHighlighter'], function(require, exports, module) {
+
+var org = require("./antlr3-all").org;
+var XQuerySemanticHighlighter = require("./XQuerySemanticHighlighter").XQuerySemanticHighlighter;
+
+var XQDTParser = exports.XQDTParser = function(input, state)
+{
+ this.highlighter = new XQuerySemanticHighlighter();
+ var that = this;
+
+ input.getTokenSource().addComment = function(start, stop) {
+ var comments = input.getTokenSource().comments;
+ for(var i in comments)
+ {
+ var c = comments[i];
+ that.highlighter.addToken(c.start, c.stop, "comment");
+ }
+ input.getTokenSource().comments = [];
+ that.highlighter.addToken(start, stop, "comment")
+ };
+ XQDTParser.superclass.constructor.call(this, input, state);
+};
+
+org.antlr.lang.extend(XQDTParser, org.antlr.runtime.Parser, {
+
+});
+
+});
+define('ace/mode/xquery/XQuerySemanticHighlighter', ['require', 'exports', 'module' , 'ace/mode/xquery/Position'], function(require, exports, module) {
+
+ var Position = require("./Position").Position;
+ var XQuerySemanticHighlighter = exports.XQuerySemanticHighlighter = function() {
+ this.tokenizer = null;
+ this.plain = null;
+ this.source = [];
+ this.lines = [];
+
+ this.getTokens = function() {
+ var resultLines = new Array(this.source.length);
+ var resultStates = new Array(this.source.length);
+ var previousState = "start";
+ var i = 0;
+ for(i in this.source){
+ var lineTokens = [];
+ var tokens = [];
+ if(this.lines[i]) {
+ tokens = this.lines[i].sort(function(a, b){ return a.position.getOffset() - b.position.getOffset(); });
+ }
+ var sourceLine = this.source[i];
+ var tokenizedLine = "";
+ var cursor = 0;
+ var j = 0;
+ for(j in tokens)
+ {
+ var token = tokens[j];
+ var position = token.position;
+ if(position.getOffset() > cursor) {
+ var value = sourceLine.substring(cursor, position.getOffset());
+ tokenizedLine += value;
+ lineTokens.push({
+ type: "text",
+ value: value
+ });
+ }
+ cursor = position.getOffset() + position.getLength();
+ value = sourceLine.substring(position.getOffset(), cursor);
+ tokenizedLine += value;
+ lineTokens.push({
+ type: token.type,
+ value: value
+ });
+ }
+
+ var nextState = "start";
+ if(lineTokens.length > 0) {
+ lineTokens[lineTokens.length - 1].type;
+ }
+ nextState = (nextState != "comment" && nextState != "string" && nextState != "cdata" && nextState != "tag") ? "start" : nextState;
+
+ if(cursor < (sourceLine.length )) {
+ value = sourceLine.substring(cursor);
+ lineTokens.push({
+ type: "text",
+ value: value
+ });
+ tokenizedLine += value;
+ }
+ //Check if the tokenized line is equal to the original one:
+ if(sourceLine == tokenizedLine) {
+ resultLines[i] = lineTokens;
+ resultStates[i] = nextState;
+ //result[i] = { line: sourceLine, startState: previousState, tokens: { tokens: lineTokens, state: nextState } };
+ } else {
+ //console.log("sourceLine: " + sourceLine);
+ //console.log("tokenizedLine: " + tokenizedLine);
+ resultLines[i] = [{ type: "text", value: sourceLine }];
+ resultStates[i] = nextState;
+ //result[i] = { tokens: [ { type: "text", value: sourceLine } ], state: nextState };
+ }
+
+ if(resultLines[i].length === 1 && resultLines[i][0].type === "text" && this.tokenizer instanceof Object) {
+ var prev = resultStates[i - 1] ? resultStates[i - 1] : "start";
+ var result = this.tokenizer.getLineTokens(resultLines[i][0].value, prev);
+ resultLines[i] = result.tokens;
+ resultStates[i] = result.state;
+ }
+ }
+ return {states: resultStates, lines: resultLines};
+ };
+
+ this.addToken = function(start, stop, type) {
+ var before = this.plain.substring(0, start);
+ var startLine = this.plain.substring(0, start).split("\n").length;
+ startLine = startLine == 0 ? 0 : startLine - 1;
+
+ var offset = before.lastIndexOf("\n");
+ offset = offset == -1 ? start : start - before.lastIndexOf("\n") - 1;
+
+ var cursor = start;
+
+ var text = this.plain.substring(start, stop);
+
+ var currentLine = startLine;
+ for(var i in text)
+ {
+ var c = text[i];
+ if(c == "\n") {
+ var s = i;
+ s = s < stop ? s : stop;
+ this.addPosition(new Position(currentLine, offset, s), type);
+ currentLine++;
+ offset = 0;
+ cursor = i;
+ }
+ };
+ this.addPosition(new Position(currentLine, offset, stop - cursor + 1), type);
+ };
+
+ this.addPosition = function(position, type)
+ {
+ var line = position.getLine();
+ if(!this.lines[line]) {
+ this.lines[line] = [];
+ }
+ this.lines[line].push({
+ type: type,
+ position: position
+ });
+ };
+
+ this.setSource = function(source)
+ {
+ this.plain = source.data;
+ this.source = this.plain.split("\n");
+ };
+ //console.log("Line: " + token.getLine());
+ //console.log(token.getText());
+ //console.log(type);
+ };
+});
+define('ace/mode/xquery/Position', ['require', 'exports', 'module' ], function(require, exports, module) {
+ var Position = exports.Position = function(line, offset, length)
+ {
+ this.line = line;
+ this.offset = offset;
+ this.length = length;
+
+ this.getLine = function()
+ {
+ return this.line;
+ };
+
+ this.getOffset = function()
+ {
+ return this.offset;
+ };
+
+ this.getLength = function()
+ {
+ return this.length;
+ };
+ };
+
+});
+
+define('ace/tokenizer', ['require', 'exports', 'module' ], function(require, exports, module) {
+
+
+/**
+ * class Tokenizer
+ *
+ * This class takes a set of highlighting rules, and creates a tokenizer out of them. For more information, see [the wiki on extending highlighters](https://github.com/ajaxorg/ace/wiki/Creating-or-Extending-an-Edit-Mode#wiki-extendingTheHighlighter).
+ *
+ **/
+
+/**
+ * new Tokenizer(rules, flag)
+ * - rules (Object): The highlighting rules
+ * - flag (String): Any additional regular expression flags to pass (like "i" for case insensitive)
+ *
+ * Constructs a new tokenizer based on the given rules and flags.
+ *
+ **/
+var Tokenizer = function(rules, flag) {
+ flag = flag ? "g" + flag : "g";
+ this.rules = rules;
+
+ this.regExps = {};
+ this.matchMappings = {};
+ for ( var key in this.rules) {
+ var rule = this.rules[key];
+ var state = rule;
+ var ruleRegExps = [];
+ var matchTotal = 0;
+ var mapping = this.matchMappings[key] = {};
+
+ for ( var i = 0; i < state.length; i++) {
+
+ if (state[i].regex instanceof RegExp)
+ state[i].regex = state[i].regex.toString().slice(1, -1);
+
+ // Count number of matching groups. 2 extra groups from the full match
+ // And the catch-all on the end (used to force a match);
+ var matchcount = new RegExp("(?:(" + state[i].regex + ")|(.))").exec("a").length - 2;
+
+ // Replace any backreferences and offset appropriately.
+ var adjustedregex = state[i].regex.replace(/\\([0-9]+)/g, function (match, digit) {
+ return "\\" + (parseInt(digit, 10) + matchTotal + 1);
+ });
+
+ if (matchcount > 1 && state[i].token.length !== matchcount-1)
+ throw new Error("For " + state[i].regex + " the matching groups and length of the token array don't match (rule #" + i + " of state " + key + ")");
+
+ mapping[matchTotal] = {
+ rule: i,
+ len: matchcount
+ };
+ matchTotal += matchcount;
+
+ ruleRegExps.push(adjustedregex);
+ }
+
+ this.regExps[key] = new RegExp("(?:(" + ruleRegExps.join(")|(") + ")|(.))", flag);
+ }
+};
+
+(function() {
+
+ /**
+ * Tokenizer.getLineTokens() -> Object
+ *
+ * Returns an object containing two properties: `tokens`, which contains all the tokens; and `state`, the current state.
+ **/
+ this.getLineTokens = function(line, startState) {
+ var currentState = startState || "start";
+ var state = this.rules[currentState];
+ var mapping = this.matchMappings[currentState];
+ var re = this.regExps[currentState];
+ re.lastIndex = 0;
+
+ var match, tokens = [];
+
+ var lastIndex = 0;
+
+ var token = {
+ type: null,
+ value: ""
+ };
+
+ while (match = re.exec(line)) {
+ var type = "text";
+ var rule = null;
+ var value = [match[0]];
+
+ for (var i = 0; i < match.length-2; i++) {
+ if (match[i + 1] === undefined)
+ continue;
+
+ rule = state[mapping[i].rule];
+
+ if (mapping[i].len > 1)
+ value = match.slice(i+2, i+1+mapping[i].len);
+
+ // compute token type
+ if (typeof rule.token == "function")
+ type = rule.token.apply(this, value);
+ else
+ type = rule.token;
+
+ if (rule.next) {
+ currentState = rule.next;
+ state = this.rules[currentState];
+ mapping = this.matchMappings[currentState];
+ lastIndex = re.lastIndex;
+
+ re = this.regExps[currentState];
+
+ if (re === undefined) {
+ throw new Error("You indicated a state of " + rule.next + " to go to, but it doesn't exist!");
+ }
+
+ re.lastIndex = lastIndex;
+ }
+ break;
+ }
+
+ if (value[0]) {
+ if (typeof type == "string") {
+ value = [value.join("")];
+ type = [type];
+ }
+ for (var i = 0; i < value.length; i++) {
+ if (!value[i])
+ continue;
+
+ if ((!rule || rule.merge || type[i] === "text") && token.type === type[i]) {
+ token.value += value[i];
+ } else {
+ if (token.type)
+ tokens.push(token);
+
+ token = {
+ type: type[i],
+ value: value[i]
+ };
+ }
+ }
+ }
+
+ if (lastIndex == line.length)
+ break;
+
+ lastIndex = re.lastIndex;
+ }
+
+ if (token.type)
+ tokens.push(token);
+
+ return {
+ tokens : tokens,
+ state : currentState
+ };
+ };
+
+}).call(Tokenizer.prototype);
+
+exports.Tokenizer = Tokenizer;
+});
+define('ace/mode/xquery_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 XQueryHighlightRules = function() {
+
+ var keywordMapper = this.createKeywordMapper({
+ keyword: "after|ancestor|ancestor-or-self|and|as|ascending|attribute|before|case|cast|castable|child|collation|comment|copy|count|declare|default|delete|descendant|descendant-or-self|descending|div|document|document-node|element|else|empty|empty-sequence|end|eq|every|except|first|following|following-sibling|for|function|ge|group|gt|idiv|if|import|insert|instance|intersect|into|is|item|last|le|let|lt|mod|modify|module|namespace|namespace-node|ne|node|only|or|order|ordered|parent|preceding|preceding-sibling|processing-instruction|rename|replace|return|satisfies|schema-attribute|schema-element|self|some|stable|start|switch|text|to|treat|try|typeswitch|union|unordered|validate|where|with|xquery|contains|paragraphs|sentences|times|words|by|collectionreturn|variable|version|option|when|encoding|toswitch|catch|tumbling|sliding|window|at|using|stemming|collection|schema|while|on|nodes|index|external|then|in|updating|value|of|containsbreak|loop|continue|exit|returning|append|json|position"
+ }, "identifier");
+
+ // regexp must not have capturing parentheses
+ // regexps are ordered -> the first match is used
+
+ this.$rules = {
+ start : [ {
+ token : "text",
+ regex : "<\\!\\[CDATA\\[",
+ next : "cdata"
+ }, {
+ token : "xml_pe",
+ regex : "<\\?.*?\\?>"
+ }, {
+ token : "comment",
+ regex : "<\\!--",
+ next : "comment"
+ }, {
+ token : "comment",
+ regex : "\\(:",
+ next : "comment"
+ }, {
+ token : "text", // opening tag
+ regex : "<\\/?",
+ next : "tag"
+ }, {
+ token : "constant", // number
+ regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
+ }, {
+ token : "variable", // variable
+ regex : "\\$[a-zA-Z_][a-zA-Z0-9_\\-:]*\\b"
+ }, {
+ token: "string",
+ regex : '".*?"'
+ }, {
+ token: "string",
+ regex : "'.*?'"
+ }, {
+ token : "text",
+ regex : "\\s+"
+ }, {
+ token: "support.function",
+ regex: "\\w[\\w+_\\-:]+(?=\\()"
+ }, {
+ token : keywordMapper,
+ regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
+ }, {
+ token: "keyword.operator",
+ regex: "\\*|=|<|>|\\-|\\+"
+ }, {
+ token: "lparen",
+ regex: "[[({]"
+ }, {
+ token: "rparen",
+ regex: "[\\])}]"
+ } ],
+
+ tag : [ {
+ token : "text",
+ regex : ">",
+ next : "start"
+ }, {
+ token : "meta.tag",
+ regex : "[-_a-zA-Z0-9:]+"
+ }, {
+ token : "text",
+ regex : "\\s+"
+ }, {
+ token : "string",
+ regex : '".*?"'
+ }, {
+ token : "string",
+ regex : "'.*?'"
+ } ],
+
+ cdata : [ {
+ token : "comment",
+ regex : "\\]\\]>",
+ next : "start"
+ }, {
+ token : "comment",
+ regex : "\\s+"
+ }, {
+ token : "comment",
+ regex : "(?:[^\\]]|\\](?!\\]>))+"
+ } ],
+
+ comment : [ {
+ token : "comment",
+ regex : ".*?-->",
+ next : "start"
+ }, {
+ token: "comment",
+ regex : ".*:\\)",
+ next : "start"
+ }, {
+ token : "comment",
+ regex : ".+"
+ } ]
+ };
+};
+
+oop.inherits(XQueryHighlightRules, TextHighlightRules);
+
+exports.XQueryHighlightRules = XQueryHighlightRules;
+});
+
+define('ace/mode/text_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/lang'], function(require, exports, module) {
+
+
+var lang = require("../lib/lang");
+
+var TextHighlightRules = function() {
+
+ // regexp must not have capturing parentheses
+ // regexps are ordered -> the first match is used
+
+ this.$rules = {
+ "start" : [{
+ token : "empty_line",
+ regex : '^$'
+ }, {
+ token : "text",
+ regex : ".+"
+ }]
+ };
+};
+
+(function() {
+
+ this.addRules = function(rules, prefix) {
+ for (var key in rules) {
+ var state = rules[key];
+ for (var i=0; i<state.length; i++) {
+ var rule = state[i];
+ if (rule.next) {
+ rule.next = prefix + rule.next;
+ }
+ }
+ this.$rules[prefix + key] = state;
+ }
+ };
+
+ this.getRules = function() {
+ return this.$rules;
+ };
+
+ this.embedRules = function (HighlightRules, prefix, escapeRules, states) {
+ var embedRules = new HighlightRules().getRules();
+ if (states) {
+ for (var i = 0; i < states.length; i++) {
+ states[i] = prefix + states[i];
+ }
+ } else {
+ states = [];
+ for (var key in embedRules) {
+ states.push(prefix + key);
+ }
+ }
+ this.addRules(embedRules, prefix);
+
+ for (var i = 0; i < states.length; i++) {
+ Array.prototype.unshift.apply(this.$rules[states[i]], lang.deepCopy(escapeRules));
+ }
+
+ if (!this.$embeds) {
+ this.$embeds = [];
+ }
+ this.$embeds.push(prefix);
+ }
+
+ this.getEmbeds = function() {
+ return this.$embeds;
+ }
+
+ this.createKeywordMapper = function(map, defaultToken, ignoreCase, splitChar) {
+ var keywords = Object.create(null);
+ Object.keys(map).forEach(function(className) {
+ var list = map[className].split(splitChar || "|");
+ for (var i = list.length; i--; )
+ keywords[list[i]] = className;
+ });
+ map = null;
+ return ignoreCase
+ ? function(value) {return keywords[value.toLowerCase()] || defaultToken }
+ : function(value) {return keywords[value] || defaultToken };
+ }
+
+}).call(TextHighlightRules.prototype);
+
+exports.TextHighlightRules = TextHighlightRules;
+});